From 1943967ffe7e8087d0d26557289c17cb9b5318f6 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Wed, 14 Jan 2004 22:03:24 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'Second_releng'. Sprout from master 2004-01-14 22:03:23 UTC Doug Schaefer 'Make failure more visible.' Delete: build/org.eclipse.cdt.make.core/.classpath build/org.eclipse.cdt.make.core/.cvsignore build/org.eclipse.cdt.make.core/.project build/org.eclipse.cdt.make.core/about.html build/org.eclipse.cdt.make.core/build.properties build/org.eclipse.cdt.make.core/builtin/gnu.mk build/org.eclipse.cdt.make.core/builtin/posix.mk build/org.eclipse.cdt.make.core/plugin.properties build/org.eclipse.cdt.make.core/plugin.xml build/org.eclipse.cdt.make.core/schema/MakeTargetBuilder.exsd build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeBuilderInfo.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTarget.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetListener.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeTargetEvent.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/PluginResources.properties build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IArchiveTarget.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IBadDirective.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ICommand.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IComment.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDefaultRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IEmptyLine.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IIgnoreRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IInferenceRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMacroDefinition.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefile.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefileValidator.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IParent.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPosixRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPreciousRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISccsGetRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISilentRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISpecialRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISuffixesRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITargetRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IConditional.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IDeleteOnErrorRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IExportAllVariablesRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IGNUMakefile.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IInclude.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IIntermediateRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ILowResolutionTimeRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/INotParallelRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IPhonyRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ISecondaryRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ITerminal.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IUnExport.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVPath.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVariableDefinition.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ListenerList.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeRecon.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/StreamMonitor.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/ArchiveTarget.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/BadDirective.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/DefaultRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/IgnoreRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/InferenceRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MakefileReader.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PosixRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PreciousRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SccsGetRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SilentRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SuffixesRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Target.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DefineVariable.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DeleteOnErrorRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Else.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endef.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endif.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportAllVariablesRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportVariable.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileUtil.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUTargetRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifdef.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifeq.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifndef.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifneq.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/IntermediateRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/LowResolutionTimeRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/NotParallelRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideDefine.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideVariable.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/PhonyRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/SecondaryRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/StaticTargetRule.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/TargetVariable.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java build/org.eclipse.cdt.make.ui/.classpath build/org.eclipse.cdt.make.ui/.cvsignore build/org.eclipse.cdt.make.ui/.project build/org.eclipse.cdt.make.ui/about.html build/org.eclipse.cdt.make.ui/build.properties build/org.eclipse.cdt.make.ui/icons/actions/build_menu.gif build/org.eclipse.cdt.make.ui/icons/ctool16/alphab_sort_co.gif build/org.eclipse.cdt.make.ui/icons/ctool16/convert-normal.gif build/org.eclipse.cdt.make.ui/icons/ctool16/make.gif build/org.eclipse.cdt.make.ui/icons/ctool16/makefile.gif build/org.eclipse.cdt.make.ui/icons/ctool16/newc_app.gif build/org.eclipse.cdt.make.ui/icons/ctool16/newcc_app.gif build/org.eclipse.cdt.make.ui/icons/ctool16/segment_edit.gif build/org.eclipse.cdt.make.ui/icons/ctool16/target_add.gif build/org.eclipse.cdt.make.ui/icons/ctool16/target_build.gif build/org.eclipse.cdt.make.ui/icons/ctool16/target_delete.gif build/org.eclipse.cdt.make.ui/icons/ctool16/target_edit.gif build/org.eclipse.cdt.make.ui/icons/ctool16/update_old.gif build/org.eclipse.cdt.make.ui/icons/cview16/make_target.gif build/org.eclipse.cdt.make.ui/icons/dtool16/alphab_sort_co.gif build/org.eclipse.cdt.make.ui/icons/dtool16/segment_edit.gif build/org.eclipse.cdt.make.ui/icons/dtool16/target_add.gif build/org.eclipse.cdt.make.ui/icons/dtool16/target_build.gif build/org.eclipse.cdt.make.ui/icons/dtool16/target_delete.gif build/org.eclipse.cdt.make.ui/icons/dtool16/target_edit.gif build/org.eclipse.cdt.make.ui/icons/etool16/alphab_sort_co.gif build/org.eclipse.cdt.make.ui/icons/etool16/segment_edit.gif build/org.eclipse.cdt.make.ui/icons/etool16/target_add.gif build/org.eclipse.cdt.make.ui/icons/etool16/target_build.gif build/org.eclipse.cdt.make.ui/icons/etool16/target_delete.gif build/org.eclipse.cdt.make.ui/icons/etool16/target_edit.gif build/org.eclipse.cdt.make.ui/icons/obj16/command_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/error_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/include_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/irule_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/macro_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/relation_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/target_obj.gif build/org.eclipse.cdt.make.ui/icons/obj16/trule_obj.gif build/org.eclipse.cdt.make.ui/icons/wizban/newcprj_wiz.gif build/org.eclipse.cdt.make.ui/plugin.properties build/org.eclipse.cdt.make.ui/plugin.xml build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/ErrorParserBlock.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeProjectOptionBlock.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MessageLine.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileDocumentProvider.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorTogglePresentationAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPart.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPartWithButtons.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/StructuredViewerPart.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakePreferencePage.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/properties/MakePropertyPage.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/IMakefileColorManager.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/MakefileColorManager.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileMacroScanner.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileSimpleMacroRule.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileWordDetector.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/wizards/StatusWizardPage.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManager.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManagerExtension.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeLabelProvider.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetListViewerPart.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildTargetDialog.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/AddTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/BuildTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/EditTargetAction.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizard.java build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java build/org.eclipse.cdt.managedbuilder.core/.classpath build/org.eclipse.cdt.managedbuilder.core/.cvsignore build/org.eclipse.cdt.managedbuilder.core/.project build/org.eclipse.cdt.managedbuilder.core/ChangeLog build/org.eclipse.cdt.managedbuilder.core/about.html build/org.eclipse.cdt.managedbuilder.core/build.properties build/org.eclipse.cdt.managedbuilder.core/plugin.properties build/org.eclipse.cdt.managedbuilder.core/plugin.xml build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildException.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java build/org.eclipse.cdt.managedbuilder.ui/.classpath build/org.eclipse.cdt.managedbuilder.ui/.cvsignore build/org.eclipse.cdt.managedbuilder.ui/.project build/org.eclipse.cdt.managedbuilder.ui/ChangeLog build/org.eclipse.cdt.managedbuilder.ui/about.html build/org.eclipse.cdt.managedbuilder.ui/build.properties build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-buildconfig.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-deleteconfig.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-editconfig.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-newconfig.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/build_configs.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-category.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-compiler.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-debug.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-librarian.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-linker.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-preprocessor.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-profile.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-release.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-tool.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngc_app.gif build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngcc_app.gif build/org.eclipse.cdt.managedbuilder.ui/plugin.properties build/org.eclipse.cdt.managedbuilder.ui/plugin.xml build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedProjectOptionBlock.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationContentProvider.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationLabelProvider.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCCProjectWizard.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java core/org.eclipse.cdt.core.aix/.classpath core/org.eclipse.cdt.core.aix/.cvsignore core/org.eclipse.cdt.core.aix/.project core/org.eclipse.cdt.core.aix/.template core/org.eclipse.cdt.core.aix/build.properties core/org.eclipse.cdt.core.aix/fragment.properties core/org.eclipse.cdt.core.aix/fragment.xml core/org.eclipse.cdt.core.aix/library/.cvsignore core/org.eclipse.cdt.core.aix/library/Makefile core/org.eclipse.cdt.core.aix/library/PTY.h core/org.eclipse.cdt.core.aix/library/PTYInputStream.h core/org.eclipse.cdt.core.aix/library/PTYOutputStream.h core/org.eclipse.cdt.core.aix/library/Spawner.h core/org.eclipse.cdt.core.aix/library/SpawnerInputStream.h core/org.eclipse.cdt.core.aix/library/SpawnerOutputStream.h core/org.eclipse.cdt.core.aix/library/exec0.h core/org.eclipse.cdt.core.aix/library/exec_unix.c core/org.eclipse.cdt.core.aix/library/io.c core/org.eclipse.cdt.core.aix/library/openpty.c core/org.eclipse.cdt.core.aix/library/openpty.h core/org.eclipse.cdt.core.aix/library/pfind.c core/org.eclipse.cdt.core.aix/library/pty.c core/org.eclipse.cdt.core.aix/library/ptyio.c core/org.eclipse.cdt.core.aix/library/spawner.c core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessInfo.java core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessList.java core/org.eclipse.cdt.core.linux/.classpath core/org.eclipse.cdt.core.linux/.cvsignore core/org.eclipse.cdt.core.linux/.project core/org.eclipse.cdt.core.linux/ChangeLog core/org.eclipse.cdt.core.linux/build.properties core/org.eclipse.cdt.core.linux/fragment.properties core/org.eclipse.cdt.core.linux/fragment.xml core/org.eclipse.cdt.core.linux/library/.cvsignore core/org.eclipse.cdt.core.linux/library/Makefile core/org.eclipse.cdt.core.linux/library/PTY.h core/org.eclipse.cdt.core.linux/library/PTYInputStream.h core/org.eclipse.cdt.core.linux/library/PTYOutputStream.h core/org.eclipse.cdt.core.linux/library/Spawner.h core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h core/org.eclipse.cdt.core.linux/library/exec0.h core/org.eclipse.cdt.core.linux/library/exec_unix.c core/org.eclipse.cdt.core.linux/library/io.c core/org.eclipse.cdt.core.linux/library/openpty.c core/org.eclipse.cdt.core.linux/library/openpty.h core/org.eclipse.cdt.core.linux/library/pfind.c core/org.eclipse.cdt.core.linux/library/pty.c core/org.eclipse.cdt.core.linux/library/ptyio.c core/org.eclipse.cdt.core.linux/library/spawner.c core/org.eclipse.cdt.core.linux/os/linux/x86/libpty.so core/org.eclipse.cdt.core.linux/os/linux/x86/libspawner.so core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessInfo.java core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessList.java core/org.eclipse.cdt.core.qnx/.classpath core/org.eclipse.cdt.core.qnx/.cvsignore core/org.eclipse.cdt.core.qnx/.project core/org.eclipse.cdt.core.qnx/ChangeLog core/org.eclipse.cdt.core.qnx/build.properties core/org.eclipse.cdt.core.qnx/fragment.properties core/org.eclipse.cdt.core.qnx/fragment.xml core/org.eclipse.cdt.core.qnx/library/.cvsignore core/org.eclipse.cdt.core.qnx/library/Makefile core/org.eclipse.cdt.core.qnx/library/pty/Makefile core/org.eclipse.cdt.core.qnx/library/pty/PTY.h core/org.eclipse.cdt.core.qnx/library/pty/PTYInputStream.h core/org.eclipse.cdt.core.qnx/library/pty/PTYOutputStream.h core/org.eclipse.cdt.core.qnx/library/pty/common.mk core/org.eclipse.cdt.core.qnx/library/pty/openpty.c core/org.eclipse.cdt.core.qnx/library/pty/openpty.h core/org.eclipse.cdt.core.qnx/library/pty/pty.c core/org.eclipse.cdt.core.qnx/library/pty/ptyio.c core/org.eclipse.cdt.core.qnx/library/pty/x86/Makefile core/org.eclipse.cdt.core.qnx/library/pty/x86/so/Makefile core/org.eclipse.cdt.core.qnx/library/spawner/Makefile core/org.eclipse.cdt.core.qnx/library/spawner/Spawner.h core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerInputStream.h core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerOutputStream.h core/org.eclipse.cdt.core.qnx/library/spawner/common.mk core/org.eclipse.cdt.core.qnx/library/spawner/iostream.c core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c core/org.eclipse.cdt.core.qnx/library/spawner/x86/Makefile core/org.eclipse.cdt.core.qnx/library/spawner/x86/so/Makefile core/org.eclipse.cdt.core.qnx/os/qnx/x86/libpty.so core/org.eclipse.cdt.core.qnx/os/qnx/x86/libspawner.so core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessInfo.java core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessList.java core/org.eclipse.cdt.core.solaris/.classpath core/org.eclipse.cdt.core.solaris/.cvsignore core/org.eclipse.cdt.core.solaris/.project core/org.eclipse.cdt.core.solaris/ChangeLog core/org.eclipse.cdt.core.solaris/build.properties core/org.eclipse.cdt.core.solaris/fragment.properties core/org.eclipse.cdt.core.solaris/fragment.xml core/org.eclipse.cdt.core.solaris/library/.cvsignore core/org.eclipse.cdt.core.solaris/library/Makefile core/org.eclipse.cdt.core.solaris/library/PTY.h core/org.eclipse.cdt.core.solaris/library/PTYInputStream.h core/org.eclipse.cdt.core.solaris/library/PTYOutputStream.h core/org.eclipse.cdt.core.solaris/library/Spawner.h core/org.eclipse.cdt.core.solaris/library/SpawnerInputStream.h core/org.eclipse.cdt.core.solaris/library/SpawnerOutputStream.h core/org.eclipse.cdt.core.solaris/library/exec0.h core/org.eclipse.cdt.core.solaris/library/exec_unix.c core/org.eclipse.cdt.core.solaris/library/io.c core/org.eclipse.cdt.core.solaris/library/openpty.c core/org.eclipse.cdt.core.solaris/library/openpty.h core/org.eclipse.cdt.core.solaris/library/pfind.c core/org.eclipse.cdt.core.solaris/library/pty.c core/org.eclipse.cdt.core.solaris/library/ptyio.c core/org.eclipse.cdt.core.solaris/library/spawner.c core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libpty.so core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libspawner.so core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessInfo.java core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessList.java core/org.eclipse.cdt.core.tests/.classpath core/org.eclipse.cdt.core.tests/.cvsignore core/org.eclipse.cdt.core.tests/.project core/org.eclipse.cdt.core.tests/ChangeLog core/org.eclipse.cdt.core.tests/about.html core/org.eclipse.cdt.core.tests/build.properties core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/CModelElementsFailedTests.java core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedDeclaratorsTest.java core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedMacroTests.java core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/STLFailedTests.java core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/DependencyTests.java core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/IndexManagerTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/codeassist/tests/CompletionProposalsTest.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AllLanguageInterfaceTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/DeclaratorsTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ElementDeltaTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IIncludeTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IMacroTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IStructureTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ITemplateTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IntegratedCModelTest.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/MacroTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitBaseTest.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ContextualParseTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java core/org.eclipse.cdt.core.tests/plugin.xml core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.cpp core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.h core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c core/org.eclipse.cdt.core.tests/resources/cfiles/WorkingCopyTestStart.h core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h core/org.eclipse.cdt.core.tests/resources/cmodel/IStructure.c core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp core/org.eclipse.cdt.core.tests/resources/cmodel/MacroTests.c core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h core/org.eclipse.cdt.core.tests/resources/dependency/a.h core/org.eclipse.cdt.core.tests/resources/dependency/c.h core/org.eclipse.cdt.core.tests/resources/dependency/d.h core/org.eclipse.cdt.core.tests/resources/exe/Makefile core/org.eclipse.cdt.core.tests/resources/exe/common.mk core/org.eclipse.cdt.core.tests/resources/exe/main.c core/org.eclipse.cdt.core.tests/resources/exe/ppc/Makefile core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/Makefile core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/exe_g core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/main.o core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test.o core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test2.o core/org.eclipse.cdt.core.tests/resources/exe/test.c core/org.eclipse.cdt.core.tests/resources/exe/test2.c core/org.eclipse.cdt.core.tests/resources/exe/x86/Makefile core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/Makefile core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/exe_g core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/main.o core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test.o core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test2.o core/org.eclipse.cdt.core.tests/resources/exe/x86/o/Makefile core/org.eclipse.cdt.core.tests/resources/exe/x86/o/exe core/org.eclipse.cdt.core.tests/resources/exe/x86/o/main.o core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test.o core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test2.o core/org.eclipse.cdt.core.tests/resources/exebig/Makefile core/org.eclipse.cdt.core.tests/resources/exebig/common.mk core/org.eclipse.cdt.core.tests/resources/exebig/main.c core/org.eclipse.cdt.core.tests/resources/exebig/x86/Makefile core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/Makefile core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/exebig_g core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/main.o core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.h core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp core/org.eclipse.cdt.core.tests/resources/indexer/mail.cpp core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/AutomatedTest.properties core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/FractionalAutomatedTest.properties core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/.cvsignore core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/ReadMe-TortureText.txt core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp core/org.eclipse.cdt.core.tests/resources/search/include.h core/org.eclipse.cdt.core.tests/resources/testlib/Makefile core/org.eclipse.cdt.core.tests/resources/testlib/common.mk core/org.eclipse.cdt.core.tests/resources/testlib/test.c core/org.eclipse.cdt.core.tests/resources/testlib/test2.c core/org.eclipse.cdt.core.tests/resources/testlib/x86/Makefile core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/Makefile core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/libtestlib_g.a core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test.o core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test2.o core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/Makefile core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_g.so core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_gS.a core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test.o core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test2.o core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/BaseSearchTest.java core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/FunctionMethodPatternTests.java core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/OtherPatternTests.java core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/SearchTestSuite.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AISResultPrinter.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/RunTests.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CElementDecorator.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CProjectHelper.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CTestPlugin.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CTestSetup.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/FileManager.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/Main.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/NewMain.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/TestPluginLauncher.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStrings.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/FailureDialog.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/FocusTestPass.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/IDialogTestPass.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/SizingTestPass.java core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/VerifyDialog.java core/org.eclipse.cdt.core.tests/test.xml core/org.eclipse.cdt.core.win32/.classpath core/org.eclipse.cdt.core.win32/.cvsignore core/org.eclipse.cdt.core.win32/.project core/org.eclipse.cdt.core.win32/ChangeLog core/org.eclipse.cdt.core.win32/build.properties core/org.eclipse.cdt.core.win32/fragment.properties core/org.eclipse.cdt.core.win32/fragment.xml core/org.eclipse.cdt.core.win32/library/Spawner.h core/org.eclipse.cdt.core.win32/library/SpawnerInputStream.h core/org.eclipse.cdt.core.win32/library/SpawnerOutputStream.h core/org.eclipse.cdt.core.win32/library/StdAfx.c core/org.eclipse.cdt.core.win32/library/StdAfx.h core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c core/org.eclipse.cdt.core.win32/library/iostream.c core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h core/org.eclipse.cdt.core.win32/library/raise.c core/org.eclipse.cdt.core.win32/library/spawner.c core/org.eclipse.cdt.core.win32/library/spawner.dep core/org.eclipse.cdt.core.win32/library/spawner.dsp core/org.eclipse.cdt.core.win32/library/spawner.dsw core/org.eclipse.cdt.core.win32/library/spawner.mak core/org.eclipse.cdt.core.win32/library/starter/starter.cpp core/org.eclipse.cdt.core.win32/library/starter/starter.dep core/org.eclipse.cdt.core.win32/library/starter/starter.mak core/org.eclipse.cdt.core.win32/os/win32/x86/listtasks.exe core/org.eclipse.cdt.core.win32/os/win32/x86/spawner.dll core/org.eclipse.cdt.core.win32/os/win32/x86/starter.exe core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessInfo.java core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java core/org.eclipse.cdt.core/.classpath core/org.eclipse.cdt.core/.cvsignore core/org.eclipse.cdt.core/.options core/org.eclipse.cdt.core/.project core/org.eclipse.cdt.core/ChangeLog core/org.eclipse.cdt.core/about.html core/org.eclipse.cdt.core/build.properties core/org.eclipse.cdt.core/dependency/ChangeLog core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/DependencyQueryJob.java core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/Node.java core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/UpdateDependency.java core/org.eclipse.cdt.core/index/ChangeLog core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/CharOperation.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IDocument.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IEntryResult.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexer.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IQueryResult.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/StringMatcher.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Block.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexOutput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Field.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/FileListBlock.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntry.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntryHashedArray.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Index.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Int.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Util.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/messages.properties core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/BufferChangedEvent.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CModelException.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ElementChangedEvent.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/Flags.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchive.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchiveContainer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinary.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryContainer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryElement.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryFunction.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryModule.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryVariable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBuffer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBufferChangedListener.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElementDelta.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModel.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelMarker.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatus.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatusConstants.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICPathEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IContainerEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IElementChangedListener.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumeration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumerator.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IField.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunction.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunctionDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInclude.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IIncludeEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInheritance.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryReference.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacro.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacroEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMember.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethod.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IOpenable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IProjectEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceManipulation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceRange.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IStructure.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITemplate.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITranslationUnit.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariableDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ACPathEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BatchOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFileInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CPathEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContainerEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFunctionDeclarationOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateIncludeOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMemberOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Function.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IBufferFactory.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IConstants.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MoveResourceElementsOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/OpenableInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProjectEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/RenameResourceElementsOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetCPathEntriesOperation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceMapper.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplate.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopyInfo.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/PEParser.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ILRUCacheable.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ToStringSorter.java core/org.eclipse.cdt.core/parser/ChangeLog-parser core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/BacktrackException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultLogService.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultProblemHandler.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/EndOfFileException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Enum.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ILineOffsetReconciler.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IOffsetDuple.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParser.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParserLogService.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IPreprocessor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScanner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfo.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementCallbackDelegate.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ITokenDuple.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactoryException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserLanguage.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserMode.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserNotImplementedException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/SyntaxErrorException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTNotImplementedException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTSemanticException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ExpressionEvaluationException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTASMDefinition.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractTypeSpecifierDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTArrayModifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompilationUnit.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompletionNode.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumeratorReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExceptionSpecification.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTField.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFieldReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunctionReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInclusion.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTLinkageSpecification.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMacro.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMember.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethodReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceAlias.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNode.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableElement.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableNamedElement.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTPointerOperatorOwner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScope.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedElement.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplate.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameter.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameterList.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplatedDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeId.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifierOwner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDirective.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariableReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BaseProblemFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CompleteParser.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextStack.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextualParser.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclarator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParameterCollection.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IProblemFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/KeywordSets.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LimitedScannerContext.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LineOffsetReconciler.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/OffsetDuple.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParameterCollection.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Problem.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParser.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerProblemFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/SimpleDeclarationStrategy.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParseCallback.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParser.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Token.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TypeId.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTArrayModifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTCompletionNode.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInclusion.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTMacro.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTQualifiedNamedElement.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/NamedOffsets.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/Offsets.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTASMDefinition.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAbstractTypeSpecifierDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAnonymousDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTBaseSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCompilationUnit.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTElaboratedTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumeratorReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExceptionSpecification.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFieldReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunctionReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLinkageSpecification.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethodReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceAlias.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceDefinition.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNode.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReferenceStore.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTScope.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbolOwner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateInstantiation.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateSpecialization.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeId.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDirective.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariableReference.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResult.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResultList.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTASMDefinition.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTAbstractTypeSpecifierDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTCompilationUnit.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerationSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerator.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExceptionSpecification.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTLinkageSpecification.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceAlias.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNode.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTParameterDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateInstantiation.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateParameter.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateSpecialization.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypeId.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDeclaration.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDirective.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQScope.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/AbstractSymbolExtension.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/BasicSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ContainerSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/DerivableContainerSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IContainerSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IParameterizedSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISpecializedSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolASTExtension.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolOwner.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParameterizedSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTableException.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/SpecializedSymbol.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateInstance.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeFilter.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java core/org.eclipse.cdt.core/plugin.properties core/org.eclipse.cdt.core/plugin.xml core/org.eclipse.cdt.core/schema/CProject.exsd core/org.eclipse.cdt.core/schema/ProcessList.exsd core/org.eclipse.cdt.core/search/ChangeLog core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchMatch.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchConstants.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchResultCollector.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchScope.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/IMatch.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/SearchEngine.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/AcceptMatchOperation.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IndexSelector.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PathCollector.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MacroDeclarationPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/OrPattern.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/IJob.java core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/JobManager.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ConsoleOutputStream.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IBinaryParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICDescriptor.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtension.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtensionReference.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICLogConstants.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwner.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwnerInfo.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IErrorParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IMarkerGenerator.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessInfo.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessList.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoProvider.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IConsole.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDTLogWriter.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptor.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptorManager.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionReference.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/InternalCExtension.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GASErrorParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/VCErrorParser.java core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Addr2line.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CPPFilt.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/ICygwinToolsProvider.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/IToolsProvider.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEConstants.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/ReadMemoryAccess.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/ARMember.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryExecutable.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryFile.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryShared.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEParser.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEParser.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/Symbol.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ERandomAccessFile.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ARMember.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryExecutable.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryFile.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfParser.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/Symbol.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabConstant.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/Stabs.java core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabsAddr2line.java core/org.eclipse.cdt.ui.tests/.classpath core/org.eclipse.cdt.ui.tests/.cvsignore core/org.eclipse.cdt.ui.tests/.project core/org.eclipse.cdt.ui.tests/ChangeLog core/org.eclipse.cdt.ui.tests/about.html core/org.eclipse.cdt.ui.tests/build.properties core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java core/org.eclipse.cdt.ui.tests/plugin.xml core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java core/org.eclipse.cdt.ui.tests/test.xml core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt core/org.eclipse.cdt.ui/.classpath core/org.eclipse.cdt.ui/.cvsignore core/org.eclipse.cdt.ui/.project core/org.eclipse.cdt.ui/ChangeLog core/org.eclipse.cdt.ui/about.html core/org.eclipse.cdt.ui/build.properties core/org.eclipse.cdt.ui/icons/full/build16/action-buildconfig.gif core/org.eclipse.cdt.ui/icons/full/build16/action-deleteconfig.gif core/org.eclipse.cdt.ui/icons/full/build16/action-editconfig.gif core/org.eclipse.cdt.ui/icons/full/build16/action-newconfig.gif core/org.eclipse.cdt.ui/icons/full/build16/build_configs.gif core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif core/org.eclipse.cdt.ui/icons/full/build16/config-compiler.gif core/org.eclipse.cdt.ui/icons/full/build16/config-debug.gif core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif core/org.eclipse.cdt.ui/icons/full/build16/config-linker.gif core/org.eclipse.cdt.ui/icons/full/build16/config-preprocessor.gif core/org.eclipse.cdt.ui/icons/full/build16/config-profile.gif core/org.eclipse.cdt.ui/icons/full/build16/config-release.gif core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif core/org.eclipse.cdt.ui/icons/full/clcl16/alphab_sort_co.gif core/org.eclipse.cdt.ui/icons/full/clcl16/clear_co.gif core/org.eclipse.cdt.ui/icons/full/clcl16/collapseall.gif core/org.eclipse.cdt.ui/icons/full/clcl16/fields_co.gif core/org.eclipse.cdt.ui/icons/full/clcl16/metharg_obj.gif core/org.eclipse.cdt.ui/icons/full/clcl16/open_incl.gif core/org.eclipse.cdt.ui/icons/full/clcl16/public_co.gif core/org.eclipse.cdt.ui/icons/full/clcl16/search_sortmatch.gif core/org.eclipse.cdt.ui/icons/full/clcl16/segment_edit.gif core/org.eclipse.cdt.ui/icons/full/clcl16/shift_l_edit.gif core/org.eclipse.cdt.ui/icons/full/clcl16/shift_r_edit.gif core/org.eclipse.cdt.ui/icons/full/clcl16/static_co.gif core/org.eclipse.cdt.ui/icons/full/ctool16/convert-normal.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newc_app.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newc_lib.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_app.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_lib.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newclass_wiz.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newcprj_wiz.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newfile_wiz.gif core/org.eclipse.cdt.ui/icons/full/ctool16/newfolder_wiz.gif core/org.eclipse.cdt.ui/icons/full/ctool16/next_error_nav.gif core/org.eclipse.cdt.ui/icons/full/ctool16/prev_error_nav.gif core/org.eclipse.cdt.ui/icons/full/ctool16/prj_obj.gif core/org.eclipse.cdt.ui/icons/full/ctool16/prop_edt.gif core/org.eclipse.cdt.ui/icons/full/cview16/buildconsole.gif core/org.eclipse.cdt.ui/icons/full/cview16/c_pers.gif core/org.eclipse.cdt.ui/icons/full/cview16/cview.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/alphab_sort_co.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/clear_co.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/collapseall.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/fields_co.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/metharg_obj.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/open_incl.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/public_co.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/segment_edit.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_l_edit.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_r_edit.gif core/org.eclipse.cdt.ui/icons/full/dlcl16/static_co.gif core/org.eclipse.cdt.ui/icons/full/dtool16/newclass_wiz.gif core/org.eclipse.cdt.ui/icons/full/dtool16/newcprj_wiz.gif core/org.eclipse.cdt.ui/icons/full/dtool16/newfile_wiz.gif core/org.eclipse.cdt.ui/icons/full/dtool16/next_error_nav.gif core/org.eclipse.cdt.ui/icons/full/dtool16/prev_error_nav.gif core/org.eclipse.cdt.ui/icons/full/elcl16/alphab_sort_co.gif core/org.eclipse.cdt.ui/icons/full/elcl16/clear_co.gif core/org.eclipse.cdt.ui/icons/full/elcl16/collapseall.gif core/org.eclipse.cdt.ui/icons/full/elcl16/fields_co.gif core/org.eclipse.cdt.ui/icons/full/elcl16/metharg_obj.gif core/org.eclipse.cdt.ui/icons/full/elcl16/open_incl.gif core/org.eclipse.cdt.ui/icons/full/elcl16/public_co.gif core/org.eclipse.cdt.ui/icons/full/elcl16/segment_edit.gif core/org.eclipse.cdt.ui/icons/full/elcl16/shift_l_edit.gif core/org.eclipse.cdt.ui/icons/full/elcl16/shift_r_edit.gif core/org.eclipse.cdt.ui/icons/full/elcl16/static_co.gif core/org.eclipse.cdt.ui/icons/full/etool16/newclass_wiz.gif core/org.eclipse.cdt.ui/icons/full/etool16/newcprj_wiz.gif core/org.eclipse.cdt.ui/icons/full/etool16/newfile_wiz.gif core/org.eclipse.cdt.ui/icons/full/etool16/next_error_nav.gif core/org.eclipse.cdt.ui/icons/full/etool16/prev_error_nav.gif core/org.eclipse.cdt.ui/icons/full/eview16/buildconsole.gif core/org.eclipse.cdt.ui/icons/full/eview16/c_pers.gif core/org.eclipse.cdt.ui/icons/full/obj16/ar_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/bin_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint.gif core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_active.gif core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_disabled.gif core/org.eclipse.cdt.ui/icons/full/obj16/build_menu.gif core/org.eclipse.cdt.ui/icons/full/obj16/c_file_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/cdeclaration_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/cfolder_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/class_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/container_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/core_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/csearch_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/define_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/exec_dbg_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/exec_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/field_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/field_private_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/field_protected_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/field_public_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/function_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/h_file_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/include_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/lib_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/method_private_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/method_protected_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/method_public_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/search_decl_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/search_ref_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/search_sortmatch.gif core/org.eclipse.cdt.ui/icons/full/obj16/shlib_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/struct_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/template_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/union_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/variable_local_obj.gif core/org.eclipse.cdt.ui/icons/full/obj16/variable_obj.gif core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif core/org.eclipse.cdt.ui/icons/full/ovr16/error_co.gif core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif core/org.eclipse.cdt.ui/icons/full/ovr16/template_co.gif core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif core/org.eclipse.cdt.ui/icons/full/ovr16/warning_co.gif core/org.eclipse.cdt.ui/icons/full/wizban/c_app_wiz.gif core/org.eclipse.cdt.ui/icons/full/wizban/newclass_wiz.gif core/org.eclipse.cdt.ui/icons/full/wizban/newcprj_wiz.gif core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif core/org.eclipse.cdt.ui/icons/full/wizban/prj_obj.gif core/org.eclipse.cdt.ui/plugin.properties core/org.eclipse.cdt.ui/plugin.xml core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextTypeRegistry.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/DocumentTemplateContext.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ITemplateEditor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/SimpleTemplateVariable.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Template.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateBuffer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateContext.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplatePosition.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateSet.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateTranslator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateVariable.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFunctionContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CGlobalContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CStructureContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContext.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppFunctionContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppGlobalContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppStructureContextType.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/GlobalVariables.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ICompilationUnit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/default-templates.xml core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/ISourceRange.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/Messages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MoveTextEdit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MultiTextEdit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/NopTextEdit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SimpleTextEdit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SwapTextEdit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBuffer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferEditor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEdit.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNode.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNodeComparator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextManipulationMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRange.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRegion.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextUtil.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/UndoMemento.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsole.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementProperties.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementPropertySource.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CStatusConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIException.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIStatus.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CWorkbenchAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ConsoleEvent.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/DocumentInputStream.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IAdornmentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICElementPropertyConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IContextMenuConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ResourceAdapterFactory.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/StandardCElementLabelProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/WorkbenchRunnableAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleView.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ClearConsoleAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/AddIncludeOperation.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/StubUtility.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CContentViewerCreator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CMergeViewer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CNode.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CParseTreeBuilder.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CElementFilters.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CLibFilter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewFrameSource.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CollapseAllAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/DefaultAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FiltersContentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ElementListSelectionDialog.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ISelectionValidator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/IStatusChangeListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/MessageLine.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionStatusDialog.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusDialog.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusInfo.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusTool.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusUtil.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/DelegatingDragAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/FileTransferDragAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/LocalSelectionTransferDragAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/ResourceTransferDragAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/TransferDragSourceListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorErrorTickUpdater.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorTextHoverDispatcher.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotation.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CTextEditorActionConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchActionInWorkingSet.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefinitionIds.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IPositionManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IProblemAnnotation.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/LexicalSortingAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenDeclarationsAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ProblemAnnotationIterator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SearchDialogAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/TogglePresentationAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmPartitionScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextTools.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmWordDetector.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/BuildConsolePreferencePage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorEditor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorSettingPreviewCode.txt core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OverlayPreferenceStore.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPreferencePage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPropertyPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CElementLabels.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchScopeFactory.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchViewActionGroup.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ElementNameSorter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GotoMarkerAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GroupByKeyComputer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OpenCSearchPageAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ParentNameSorter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PathNameSorter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractCScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeReader.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentAutoIndentStrategy.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CDoubleClickSelector.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CFormattingStrategy.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPairMatcher.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CWordFinder.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CppCodeScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTML2TextReader.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLPrinter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICColorConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManagerExtension.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/LineBreakingReader.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/PreprocessorRule.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleCharReader.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleTokenCScanner.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SubstitutionTextReader.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposalComparator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionRequestorAdaptor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistElementRequestor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistPreference.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ICompletionRequestor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/RelevanceConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ResultCollector.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateContentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateLabelProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CColorManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWhitespaceDetector.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWordDetector.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExceptionHandler.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/IProblemChangedListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/PixelConverter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemItemMapper.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SWTUtil.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/Strings.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TwoArrayQuickSort.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilterAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/IStatusChangeListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.properties core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ComboDialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/DialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IDialogFieldListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IListAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IStringButtonAdapter.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LayoutUtil.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/Separator.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridData.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CLocalSelectionTransfer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CodeGeneration.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleEvent.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleListener.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICCompletionContributor.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICDTConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IEditorInputDelegate.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IFunctionSummary.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IRequiredInclude.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManager.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManagerExtension.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/AbstractOpenWizardAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/OpenClassWizardAction.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractCOptionPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParserPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICCompletionProposal.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCCProjectWizard.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizard.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizard.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/ControlFactory.java core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/TabFolderLayout.java debug/org.eclipse.cdt.debug.core/.classpath debug/org.eclipse.cdt.debug.core/.cvsignore debug/org.eclipse.cdt.debug.core/.project debug/org.eclipse.cdt.debug.core/ChangeLog debug/org.eclipse.cdt.debug.core/about.html debug/org.eclipse.cdt.debug.core/build.properties debug/org.eclipse.cdt.debug.core/plugin.properties debug/org.eclipse.cdt.debug.core/plugin.xml debug/org.eclipse.cdt.debug.core/schema/CDebugger.exsd debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/IAsyncExecutor.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpointManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConfiguration.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICMemoryManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICRegisterManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSharedLibraryManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSignalManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICUpdateManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/CDIException.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointHit.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICatchEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICondition.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEndSteppingRange.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEventManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExitInfo.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExpressionManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIFormat.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDILocation.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISession.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISessionObject.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalExitInfo.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalReceived.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceSnapshot.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointScope.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointTrigger.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIChangedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDICreatedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDestroyedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDisconnectedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEventListener.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIExitedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIRestartedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIResumedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDISuspendedEvent.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgument.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgumentObject.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDICatchpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIExpression.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDILocationBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMixedInstruction.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIObject.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegister.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterGroup.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterObject.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStaticVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITracepoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIWatchpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIVoidType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICAddressBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugElementErrorStatus.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTargetType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICExpressionEvaluator.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICFunctionBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSignal.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICWatchpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToArray.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDebuggerProcessSupport.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDummyStackFrame.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IExecFileInfo.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IGlobalVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IInstructionStep.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToLine.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRestart.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IResumeWithoutSignal.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToLine.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IStackFrameInfo.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IState.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToFrame.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToThread.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocation.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocator.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDirectorySourceLocation.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDisassemblyStorage.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IProjectSourceLocation.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ISourceMode.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/SessionManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartition.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartitionValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CCoreFileDebugTarget.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDummyStackFrame.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSignal.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CType.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValueFactory.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java debug/org.eclipse.cdt.debug.mi.core/.classpath debug/org.eclipse.cdt.debug.mi.core/.cvsignore debug/org.eclipse.cdt.debug.mi.core/.options debug/org.eclipse.cdt.debug.mi.core/.project debug/org.eclipse.cdt.debug.mi.core/ChangeLog debug/org.eclipse.cdt.debug.mi.core/about.html debug/org.eclipse.cdt.debug.mi.core/build.properties debug/org.eclipse.cdt.debug.mi.core/design.txt debug/org.eclipse.cdt.debug.mi.core/plugin.properties debug/org.eclipse.cdt.debug.mi.core/plugin.xml debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CommandQueue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/EventThread.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMIConstants.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIFormat.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/Queue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/SessionProcess.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointHit.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Condition.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CoreFileConfiguration.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EndSteppingRange.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExitInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Format.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Session.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalExitInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalReceived.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointScope.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointTrigger.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DisconnectedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/CObject.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Catchpoint.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MixedInstruction.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Watchpoint.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IncompleteType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/Type.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/VoidType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinCommandFactory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentDirectory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecAbort.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIHandle.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoProgram.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSharedLibrary.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSignals.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoThreads.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIJump.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIPType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISharedLibrary.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISignal.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIWhatis.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIArg.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsm.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoProgramInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIMemory.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIPTypeInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIShared.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVar.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIWhatisInfo.java debug/org.eclipse.cdt.debug.mi.ui/.classpath debug/org.eclipse.cdt.debug.mi.ui/.cvsignore debug/org.eclipse.cdt.debug.mi.ui/.project debug/org.eclipse.cdt.debug.mi.ui/ChangeLog debug/org.eclipse.cdt.debug.mi.ui/about.html debug/org.eclipse.cdt.debug.mi.ui/build.properties debug/org.eclipse.cdt.debug.mi.ui/icons/full/clcl16/auto_solib_co.gif debug/org.eclipse.cdt.debug.mi.ui/icons/full/dlcl16/auto_solib_co.gif debug/org.eclipse.cdt.debug.mi.ui/icons/full/elcl16/auto_solib_co.gif debug/org.eclipse.cdt.debug.mi.ui/plugin.properties debug/org.eclipse.cdt.debug.mi.ui/plugin.xml debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CygwinDebuggerPage.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBSolibBlock.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIHelpContextIds.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIUIConstants.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/PixelConverter.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SerialPortSettingsBlock.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/TCPSettingsBlock.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/CheckedListDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ComboDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/DialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IDialogFieldListener.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IListAdapter.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IStringButtonAdapter.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/LayoutUtil.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ListDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/Separator.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonStatusDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringDialogField.java debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java debug/org.eclipse.cdt.debug.ui.tests/.classpath debug/org.eclipse.cdt.debug.ui.tests/.cvsignore debug/org.eclipse.cdt.debug.ui.tests/.project debug/org.eclipse.cdt.debug.ui.tests/Changelog debug/org.eclipse.cdt.debug.ui.tests/about.html debug/org.eclipse.cdt.debug.ui.tests/build.properties debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java debug/org.eclipse.cdt.debug.ui.tests/plugin.xml debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java debug/org.eclipse.cdt.debug.ui.tests/test.xml debug/org.eclipse.cdt.debug.ui/.classpath debug/org.eclipse.cdt.debug.ui/.cvsignore debug/org.eclipse.cdt.debug.ui/.project debug/org.eclipse.cdt.debug.ui/ChangeLog debug/org.eclipse.cdt.debug.ui/about.html debug/org.eclipse.cdt.debug.ui/build.properties debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/autorefresh_mem.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/casttotype_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/debugger_console.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disabled_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disassembly.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/enabled_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/jump_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_all_symbols_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_symbols_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_clear.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_update.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/refresh_mem.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/restart.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/runtoline_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_ascii.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_paths.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/showasarray_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal0_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/tnames_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/watch_globals.gif debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/adddirsource_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/addprjsource_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/cview16/memory_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/cview16/registers_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/cview16/sharedlibraries_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/cview16/signals_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/autorefresh_mem.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/casttotype_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/change_reg_value_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/debugger_console.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/disassembly.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/jump_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_all_symbols_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_symbols_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_clear.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_update.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/refresh_mem.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/restart.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/runtoline_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_ascii.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_paths.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/showasarray_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal0_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/watch_globals.gif debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/adddirsource_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/addprjsource_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/autorefresh_mem.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/casttotype_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/debugger_console.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/disassembly.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/jump_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_all_symbols_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_symbols_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_clear.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_update.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/refresh_mem.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/restart.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/runtoline_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_ascii.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_parents.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/showasarray_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal0_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/watch_globals.gif debug/org.eclipse.cdt.debug.ui/icons/full/etool16/adddirsource_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/etool16/addprjsource_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/eview16/memory_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/eview16/registers_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/eview16/sharedlibraries_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/eview16/signals_view.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkp_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkpd_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkp_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpd_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpi_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/cproject_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/disassembly_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/expression_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/ext_file_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/filenotfound_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/folder_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkp_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkpd_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_syms_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/prj_file_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/project_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/showpaths_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/signal_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_aggr.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_env.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global_aggr.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_pointer.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple_aggr.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static_aggr.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_string.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_aggr.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_pointer.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_simple.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj.gif debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/argument_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/castarray_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/casttype_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/error_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr_disabled.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/symbols_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/warning_ovr.gif debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_dir_source_location_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_prj_source_location_wiz.gif debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_source_location_wiz.gif debug/org.eclipse.cdt.debug.ui/plugin.properties debug/org.eclipse.cdt.debug.ui/plugin.xml debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTValueDetailProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugUIInternalConstants.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageDescriptor.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/PixelConverter.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/SWTUtil.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractBreakpointRulerAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractDebugActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractEditorActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddAddressBreakpointActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshMemoryAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BreakpointLocationVerifier.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferencePage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ClearMemoryAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DebuggerConsoleActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ExpressionDialog.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryActionSelectionGroup.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryFormatAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryNumberOfColumnAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemorySizeAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshMemoryAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestartActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowAsciiAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroObjectActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleDelegateAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/WatchpointExpressionVerifier.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/CheckedListDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ComboDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IDialogFieldListener.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IListAdapter.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IStringButtonAdapter.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/LayoutUtil.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/Separator.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonStatusDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/CDebugEditor.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyDocumentProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditor.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditorInput.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotation.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotationModel.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblySourceViewerConfiguration.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/EditorInputDelegate.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/FileNotFoundElement.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/NoSymbolOrSourceElement.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ComboFieldEditor.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ICDebugPreferenceConstants.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/MemoryViewPreferencePage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandlerView.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/IDebugExceptionHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/ViewerState.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryText.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewAction.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewContentProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewEventHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewer.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewEventHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewer.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewContentProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewEventHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewEventHandler.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewer.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationBlock.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationWizard.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationBlock.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationWizard.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddSourceLocationWizard.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationSelectionPage.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationWizardNode.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/INewSourceLocationWizard.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceListDialogField.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupLabelProvider.java debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java doc/org.eclipse.cdt.doc.isv/.project doc/org.eclipse.cdt.doc.user/.project doc/org.eclipse.cdt.doc.user/build.properties doc/org.eclipse.cdt.doc.user/build.xml doc/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_comments.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_dbg_info.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_outlineview.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_cdt.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_dbg.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_proj_file_views.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_projects.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_search.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_c_whatsnew.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_o_code_entry.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_o_dbg_concepts.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_o_home.htm doc/org.eclipse.cdt.doc.user/concepts/cdt_o_projects.htm doc/org.eclipse.cdt.doc.user/contextHelp.xml doc/org.eclipse.cdt.doc.user/contexts_CDT.xml doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER.xml doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER_MI.xml doc/org.eclipse.cdt.doc.user/contexts_CDT_LAUNCH.xml doc/org.eclipse.cdt.doc.user/contexts_CDT_make.xml doc/org.eclipse.cdt.doc.user/doc.zip doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_build.htm doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_debug.htm doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_existing_code.htm doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newcpp.htm doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newmake.htm doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newproj.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_o_tutorial.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_build.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_existing_code.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newcpp.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newmake.htm doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newproj.htm doc/org.eclipse.cdt.doc.user/help.css doc/org.eclipse.cdt.doc.user/images/alphab_sort_co.gif doc/org.eclipse.cdt.doc.user/images/c_file_obj.gif doc/org.eclipse.cdt.doc.user/images/class_obj.gif doc/org.eclipse.cdt.doc.user/images/container_obj.gif doc/org.eclipse.cdt.doc.user/images/contents_view.gif doc/org.eclipse.cdt.doc.user/images/define_obj.gif doc/org.eclipse.cdt.doc.user/images/editor_c_codetemplates_use.gif doc/org.eclipse.cdt.doc.user/images/enum_obj.gif doc/org.eclipse.cdt.doc.user/images/enumerator_obj.gif doc/org.eclipse.cdt.doc.user/images/error_icon.gif doc/org.eclipse.cdt.doc.user/images/field_obj.gif doc/org.eclipse.cdt.doc.user/images/field_private_obj.gif doc/org.eclipse.cdt.doc.user/images/field_protected_obj.gif doc/org.eclipse.cdt.doc.user/images/field_public_obj.gif doc/org.eclipse.cdt.doc.user/images/fields_co.gif doc/org.eclipse.cdt.doc.user/images/filterbutton.gif doc/org.eclipse.cdt.doc.user/images/function_obj.gif doc/org.eclipse.cdt.doc.user/images/icon_breakpoint_obj.gif doc/org.eclipse.cdt.doc.user/images/icon_debug_exc.gif doc/org.eclipse.cdt.doc.user/images/icon_debugt_obj.gif doc/org.eclipse.cdt.doc.user/images/icon_disconnect.gif doc/org.eclipse.cdt.doc.user/images/icon_installed_ovr.gif doc/org.eclipse.cdt.doc.user/images/icon_memory_update.gif doc/org.eclipse.cdt.doc.user/images/icon_relaunch.gif doc/org.eclipse.cdt.doc.user/images/icon_remove_all.gif doc/org.eclipse.cdt.doc.user/images/icon_run_exc.gif doc/org.eclipse.cdt.doc.user/images/icon_stackframe.gif doc/org.eclipse.cdt.doc.user/images/icon_stackframe_running.gif doc/org.eclipse.cdt.doc.user/images/icon_terminate.gif doc/org.eclipse.cdt.doc.user/images/icon_terminate_all.gif doc/org.eclipse.cdt.doc.user/images/icon_terminate_rem.gif doc/org.eclipse.cdt.doc.user/images/icon_thread1.gif doc/org.eclipse.cdt.doc.user/images/icon_thread2.gif doc/org.eclipse.cdt.doc.user/images/icon_thread3.gif doc/org.eclipse.cdt.doc.user/images/icon_watchpoint_readwrite_obj.gif doc/org.eclipse.cdt.doc.user/images/include_obj.gif doc/org.eclipse.cdt.doc.user/images/makefile.gif doc/org.eclipse.cdt.doc.user/images/method_private_obj.gif doc/org.eclipse.cdt.doc.user/images/method_protected_obj.gif doc/org.eclipse.cdt.doc.user/images/method_public_obj.gif doc/org.eclipse.cdt.doc.user/images/ng03_04.gif doc/org.eclipse.cdt.doc.user/images/ng2003.gif doc/org.eclipse.cdt.doc.user/images/ngback.gif doc/org.eclipse.cdt.doc.user/images/ngconcepts.gif doc/org.eclipse.cdt.doc.user/images/ngnext.gif doc/org.eclipse.cdt.doc.user/images/ngref.gif doc/org.eclipse.cdt.doc.user/images/ngtasks.gif doc/org.eclipse.cdt.doc.user/images/ngtopics.gif doc/org.eclipse.cdt.doc.user/images/public_co.gif doc/org.eclipse.cdt.doc.user/images/ref-79.gif doc/org.eclipse.cdt.doc.user/images/static_co.gif doc/org.eclipse.cdt.doc.user/images/struct_obj.gif doc/org.eclipse.cdt.doc.user/images/template_obj.gif doc/org.eclipse.cdt.doc.user/images/toc_closed.gif doc/org.eclipse.cdt.doc.user/images/typedef_obj.gif doc/org.eclipse.cdt.doc.user/images/union_obj.gif doc/org.eclipse.cdt.doc.user/images/var_declaration_obj.gif doc/org.eclipse.cdt.doc.user/images/warning_icon.gif doc/org.eclipse.cdt.doc.user/plugin.properties doc/org.eclipse.cdt.doc.user/plugin.xml doc/org.eclipse.cdt.doc.user/raw/hackedguide/about.html doc/org.eclipse.cdt.doc.user/raw/hackedguide/cdev.html doc/org.eclipse.cdt.doc.user/raw/hackedguide/conc.html doc/org.eclipse.cdt.doc.user/raw/hackedguide/cvs.html doc/org.eclipse.cdt.doc.user/raw/hackedguide/cwiz.html doc/org.eclipse.cdt.doc.user/raw/hackedguide/dbug.html doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/caution.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/onestep.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/pointing.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_architecture.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_buildsettings.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_library.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_options.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_projects.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_convert_1.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_target.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_codetemplates_use.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_contentassist.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_helloworld.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_hoverhelp.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/findit doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/first_look.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_breakpoint_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debug_exc.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugger_console.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugt_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disassembly.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disconnect.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_error_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_filter_tsk.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_installed_ovr.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_memory_update.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_menu.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_app.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_lib.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_app.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_lib.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_next_error_nav.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_prev_error_nav.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_relaunch.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_remove_all.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_restart.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_resume.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_run_exc.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe_running.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepinto.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepover.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepreturn.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_suspend.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_all.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_rem.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread1.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread2.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread3.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_tnames.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_warning_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_read_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_readwrite_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_write_obj.gif doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_arguments.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_common.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_customize.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debug_debug.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debugger.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_environment.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_main.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run2_faster.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run_run.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/persp_dbug_properties_options.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_added.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_adding.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_disable.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_prop.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_watch_add.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild_configurations.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb_using.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_helloworld.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_building.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_filter.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_executable.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_source.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_add.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_use.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug_runtoline.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions_add.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_change.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_configure.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_outline.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_registers.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_filter_tasks.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_new_tasks.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables_customize.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_c_codetemplates.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_workbench.jpg doc/org.eclipse.cdt.doc.user/raw/hackedguide/lnch.html doc/org.eclipse.cdt.doc.user/reference/cdt_o_ceditor_pref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_o_dbg_view.htm doc/org.eclipse.cdt.doc.user/reference/cdt_o_proj_prop_pages.htm doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_o_run_dbg_pages.htm doc/org.eclipse.cdt.doc.user/reference/cdt_o_views.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_anno.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_color.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_con_assist.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_gen.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_code_temp.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_pref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_view.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_gdb_mi_pref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_icons.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_mem_view_pref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_memoryview.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_buildset.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_binary.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_error.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_pathsymb.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_platf.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_outlineview.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_reg_view_pref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_registersview.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_arg.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_comm.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_dbg.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_env.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_main.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_srce.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_search.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view_pref.htm doc/org.eclipse.cdt.doc.user/reference/cdt_u_signals_view.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_brkpnts_watch.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_build_task.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_con_assist.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_debug.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_prop.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run_config.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasksview.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tutorial.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_o_write_code.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_brkpnts.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_codetemp.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_watch.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_autosave.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_build_process.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cbuild_pref.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_comment_out.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_contentassist.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_controldebug.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_conv_proj.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cust_cpp_editor.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_debug_prog.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_disassembly.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_endis_able_brk_wtch.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_expressions.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_filtererror.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_imp_code_temp.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_jumperror.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_manualbuild.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_memory.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_cpp.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_make.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_run_config.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_open_declarations.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_build_set.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_error_parser.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_new.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_parser.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_platf.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_ref.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_rename.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_prvw_hide_files.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_registers.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rem_wtch_brk.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_arg.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_com.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_config.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_dbg.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_env.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_main.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_source.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setbuildorder.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setreminder.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_shift_code.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_show_proj_files.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_update_man.htm doc/org.eclipse.cdt.doc.user/tasks/cdt_t_variables.htm doc/org.eclipse.cdt.doc.user/toc.xml doc/org.eclipse.cdt.doc.user/topics_Concepts.xml doc/org.eclipse.cdt.doc.user/topics_Getting_Started.xml doc/org.eclipse.cdt.doc.user/topics_Reference.xml doc/org.eclipse.cdt.doc.user/topics_Tasks.xml launch/org.eclipse.cdt.launch/.classpath launch/org.eclipse.cdt.launch/.cvsignore launch/org.eclipse.cdt.launch/.project launch/org.eclipse.cdt.launch/ChangeLog launch/org.eclipse.cdt.launch/about.html launch/org.eclipse.cdt.launch/build.properties launch/org.eclipse.cdt.launch/icons/c_app.gif launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif launch/org.eclipse.cdt.launch/plugin.properties launch/org.eclipse.cdt.launch/plugin.xml launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java releng/org.eclipse.cdt-feature/.project releng/org.eclipse.cdt-feature/build.properties releng/org.eclipse.cdt-feature/cpl-v10.html releng/org.eclipse.cdt-feature/eclipse_update_120.jpg releng/org.eclipse.cdt-feature/feature.properties releng/org.eclipse.cdt-feature/feature.xml releng/org.eclipse.cdt-feature/license.html releng/org.eclipse.cdt.testing-feature/.project releng/org.eclipse.cdt.testing-feature/build.properties releng/org.eclipse.cdt.testing-feature/cpl-v10.html releng/org.eclipse.cdt.testing-feature/eclipse_update_120.jpg releng/org.eclipse.cdt.testing-feature/feature.properties releng/org.eclipse.cdt.testing-feature/feature.xml releng/org.eclipse.cdt.testing-feature/license.html releng/org.eclipse.cdt.testing/.project releng/org.eclipse.cdt.testing/about.html releng/org.eclipse.cdt.testing/about.ini releng/org.eclipse.cdt.testing/about.mappings releng/org.eclipse.cdt.testing/about.properties releng/org.eclipse.cdt.testing/build.properties releng/org.eclipse.cdt.testing/cpl-v10.html releng/org.eclipse.cdt.testing/eclipse32.gif releng/org.eclipse.cdt.testing/notice.html releng/org.eclipse.cdt.testing/plugin.properties releng/org.eclipse.cdt.testing/plugin.xml releng/org.eclipse.cdt/.eclipseproduct releng/org.eclipse.cdt/.project releng/org.eclipse.cdt/about.html releng/org.eclipse.cdt/about.ini releng/org.eclipse.cdt/about.mappings releng/org.eclipse.cdt/about.properties releng/org.eclipse.cdt/build.properties releng/org.eclipse.cdt/cpl-v10.html releng/org.eclipse.cdt/eclipse32.gif releng/org.eclipse.cdt/notice.html releng/org.eclipse.cdt/plugin.properties releng/org.eclipse.cdt/plugin.xml releng/org.eclipse.cdt/welcome.xml--- build/org.eclipse.cdt.make.core/.classpath | 7 - build/org.eclipse.cdt.make.core/.cvsignore | 1 - build/org.eclipse.cdt.make.core/.project | 29 - build/org.eclipse.cdt.make.core/about.html | 30 - build/org.eclipse.cdt.make.core/build.properties | 9 - build/org.eclipse.cdt.make.core/builtin/gnu.mk | 991 ---- build/org.eclipse.cdt.make.core/builtin/posix.mk | 92 - build/org.eclipse.cdt.make.core/plugin.properties | 6 - build/org.eclipse.cdt.make.core/plugin.xml | 81 - .../schema/MakeTargetBuilder.exsd | 106 - .../eclipse/cdt/make/core/IMakeBuilderInfo.java | 57 - .../src/org/eclipse/cdt/make/core/IMakeTarget.java | 52 - .../eclipse/cdt/make/core/IMakeTargetListener.java | 16 - .../eclipse/cdt/make/core/IMakeTargetManager.java | 35 - .../src/org/eclipse/cdt/make/core/MakeBuilder.java | 312 -- .../org/eclipse/cdt/make/core/MakeCorePlugin.java | 182 - .../eclipse/cdt/make/core/MakeProjectNature.java | 146 - .../org/eclipse/cdt/make/core/MakeScannerInfo.java | 108 - .../eclipse/cdt/make/core/MakeScannerProvider.java | 268 - .../org/eclipse/cdt/make/core/MakeTargetEvent.java | 50 - .../cdt/make/core/PluginResources.properties | 13 - .../cdt/make/core/makefile/IArchiveTarget.java | 29 - .../cdt/make/core/makefile/IBadDirective.java | 18 - .../eclipse/cdt/make/core/makefile/ICommand.java | 69 - .../eclipse/cdt/make/core/makefile/IComment.java | 22 - .../cdt/make/core/makefile/IDefaultRule.java | 20 - .../eclipse/cdt/make/core/makefile/IDirective.java | 40 - .../eclipse/cdt/make/core/makefile/IEmptyLine.java | 17 - .../cdt/make/core/makefile/IIgnoreRule.java | 19 - .../cdt/make/core/makefile/IInferenceRule.java | 23 - .../cdt/make/core/makefile/IMacroDefinition.java | 60 - .../eclipse/cdt/make/core/makefile/IMakefile.java | 79 - .../cdt/make/core/makefile/IMakefileValidator.java | 22 - .../eclipse/cdt/make/core/makefile/IParent.java | 18 - .../eclipse/cdt/make/core/makefile/IPosixRule.java | 19 - .../cdt/make/core/makefile/IPreciousRule.java | 19 - .../org/eclipse/cdt/make/core/makefile/IRule.java | 31 - .../cdt/make/core/makefile/ISccsGetRule.java | 20 - .../cdt/make/core/makefile/ISilentRule.java | 20 - .../cdt/make/core/makefile/ISpecialRule.java | 23 - .../cdt/make/core/makefile/ISuffixesRule.java | 19 - .../eclipse/cdt/make/core/makefile/ITarget.java | 20 - .../cdt/make/core/makefile/ITargetRule.java | 19 - .../cdt/make/core/makefile/gnu/IConditional.java | 35 - .../make/core/makefile/gnu/IDeleteOnErrorRule.java | 23 - .../core/makefile/gnu/IExportAllVariablesRule.java | 21 - .../cdt/make/core/makefile/gnu/IGNUMakefile.java | 31 - .../cdt/make/core/makefile/gnu/IInclude.java | 19 - .../make/core/makefile/gnu/IIntermediateRule.java | 21 - .../core/makefile/gnu/ILowResolutionTimeRule.java | 22 - .../make/core/makefile/gnu/INotParallelRule.java | 24 - .../cdt/make/core/makefile/gnu/IPhonyRule.java | 22 - .../cdt/make/core/makefile/gnu/ISecondaryRule.java | 24 - .../cdt/make/core/makefile/gnu/ITerminal.java | 24 - .../cdt/make/core/makefile/gnu/IUnExport.java | 18 - .../eclipse/cdt/make/core/makefile/gnu/IVPath.java | 22 - .../core/makefile/gnu/IVariableDefinition.java | 43 - .../cdt/make/internal/core/BuildInfoFactory.java | 362 -- .../cdt/make/internal/core/ListenerList.java | 170 - .../cdt/make/internal/core/MakeProject.java | 36 - .../eclipse/cdt/make/internal/core/MakeRecon.java | 194 - .../eclipse/cdt/make/internal/core/MakeTarget.java | 144 - .../cdt/make/internal/core/MakeTargetManager.java | 320 -- .../cdt/make/internal/core/ProjectTargets.java | 242 - .../cdt/make/internal/core/StreamMonitor.java | 102 - .../internal/core/makefile/AbstractMakefile.java | 179 - .../make/internal/core/makefile/ArchiveTarget.java | 33 - .../make/internal/core/makefile/BadDirective.java | 28 - .../cdt/make/internal/core/makefile/Command.java | 115 - .../cdt/make/internal/core/makefile/Comment.java | 37 - .../make/internal/core/makefile/DefaultRule.java | 26 - .../cdt/make/internal/core/makefile/Directive.java | 69 - .../cdt/make/internal/core/makefile/EmptyLine.java | 32 - .../make/internal/core/makefile/IgnoreRule.java | 27 - .../make/internal/core/makefile/InferenceRule.java | 42 - .../internal/core/makefile/MacroDefinition.java | 112 - .../internal/core/makefile/MakefileReader.java | 86 - .../make/internal/core/makefile/NullMakefile.java | 63 - .../cdt/make/internal/core/makefile/Parent.java | 71 - .../cdt/make/internal/core/makefile/PosixRule.java | 25 - .../make/internal/core/makefile/PreciousRule.java | 26 - .../cdt/make/internal/core/makefile/Rule.java | 57 - .../make/internal/core/makefile/SccsGetRule.java | 28 - .../make/internal/core/makefile/SilentRule.java | 27 - .../make/internal/core/makefile/SpecialRule.java | 47 - .../make/internal/core/makefile/SuffixesRule.java | 27 - .../cdt/make/internal/core/makefile/Target.java | 36 - .../make/internal/core/makefile/TargetRule.java | 75 - .../cdt/make/internal/core/makefile/Util.java | 86 - .../internal/core/makefile/gnu/Conditional.java | 156 - .../internal/core/makefile/gnu/DefineVariable.java | 33 - .../core/makefile/gnu/DeleteOnErrorRule.java | 32 - .../cdt/make/internal/core/makefile/gnu/Else.java | 29 - .../cdt/make/internal/core/makefile/gnu/Endef.java | 25 - .../cdt/make/internal/core/makefile/gnu/Endif.java | 25 - .../core/makefile/gnu/ExportAllVariablesRule.java | 30 - .../internal/core/makefile/gnu/ExportVariable.java | 25 - .../internal/core/makefile/gnu/GNUMakefile.java | 812 --- .../core/makefile/gnu/GNUMakefileChecker.java | 152 - .../core/makefile/gnu/GNUMakefileUtil.java | 225 - .../core/makefile/gnu/GNUMakefileValidator.java | 216 - .../internal/core/makefile/gnu/GNUTargetRule.java | 70 - .../cdt/make/internal/core/makefile/gnu/Ifdef.java | 36 - .../cdt/make/internal/core/makefile/gnu/Ifeq.java | 32 - .../make/internal/core/makefile/gnu/Ifndef.java | 36 - .../cdt/make/internal/core/makefile/gnu/Ifneq.java | 32 - .../make/internal/core/makefile/gnu/Include.java | 68 - .../core/makefile/gnu/IntermediateRule.java | 30 - .../core/makefile/gnu/LowResolutionTimeRule.java | 31 - .../core/makefile/gnu/NotParallelRule.java | 33 - .../internal/core/makefile/gnu/OverrideDefine.java | 34 - .../core/makefile/gnu/OverrideVariable.java | 26 - .../make/internal/core/makefile/gnu/PhonyRule.java | 31 - .../internal/core/makefile/gnu/SecondaryRule.java | 33 - .../core/makefile/gnu/StaticTargetRule.java | 76 - .../internal/core/makefile/gnu/TargetVariable.java | 34 - .../make/internal/core/makefile/gnu/Terminal.java | 38 - .../make/internal/core/makefile/gnu/UnExport.java | 35 - .../cdt/make/internal/core/makefile/gnu/VPath.java | 45 - .../core/makefile/gnu/VariableDefinition.java | 130 - .../core/makefile/posix/PosixMakefile.java | 348 -- .../core/makefile/posix/PosixMakefileUtil.java | 160 - build/org.eclipse.cdt.make.ui/.classpath | 7 - build/org.eclipse.cdt.make.ui/.cvsignore | 1 - build/org.eclipse.cdt.make.ui/.project | 31 - build/org.eclipse.cdt.make.ui/about.html | 30 - build/org.eclipse.cdt.make.ui/build.properties | 7 - .../icons/actions/build_menu.gif | Bin 161 -> 0 bytes .../icons/ctool16/alphab_sort_co.gif | Bin 224 -> 0 bytes .../icons/ctool16/convert-normal.gif | Bin 329 -> 0 bytes .../org.eclipse.cdt.make.ui/icons/ctool16/make.gif | Bin 161 -> 0 bytes .../icons/ctool16/makefile.gif | Bin 157 -> 0 bytes .../icons/ctool16/newc_app.gif | Bin 582 -> 0 bytes .../icons/ctool16/newcc_app.gif | Bin 585 -> 0 bytes .../icons/ctool16/segment_edit.gif | Bin 158 -> 0 bytes .../icons/ctool16/target_add.gif | Bin 161 -> 0 bytes .../icons/ctool16/target_build.gif | Bin 161 -> 0 bytes .../icons/ctool16/target_delete.gif | Bin 161 -> 0 bytes .../icons/ctool16/target_edit.gif | Bin 161 -> 0 bytes .../icons/ctool16/update_old.gif | Bin 571 -> 0 bytes .../icons/cview16/make_target.gif | Bin 161 -> 0 bytes .../icons/dtool16/alphab_sort_co.gif | Bin 99 -> 0 bytes .../icons/dtool16/segment_edit.gif | Bin 89 -> 0 bytes .../icons/dtool16/target_add.gif | Bin 161 -> 0 bytes .../icons/dtool16/target_build.gif | Bin 161 -> 0 bytes .../icons/dtool16/target_delete.gif | Bin 161 -> 0 bytes .../icons/dtool16/target_edit.gif | Bin 161 -> 0 bytes .../icons/etool16/alphab_sort_co.gif | Bin 160 -> 0 bytes .../icons/etool16/segment_edit.gif | Bin 121 -> 0 bytes .../icons/etool16/target_add.gif | Bin 161 -> 0 bytes .../icons/etool16/target_build.gif | Bin 161 -> 0 bytes .../icons/etool16/target_delete.gif | Bin 161 -> 0 bytes .../icons/etool16/target_edit.gif | Bin 161 -> 0 bytes .../icons/obj16/command_obj.gif | Bin 125 -> 0 bytes .../icons/obj16/error_obj.gif | Bin 159 -> 0 bytes .../icons/obj16/include_obj.gif | Bin 107 -> 0 bytes .../icons/obj16/irule_obj.gif | Bin 172 -> 0 bytes .../icons/obj16/macro_obj.gif | Bin 171 -> 0 bytes .../icons/obj16/relation_obj.gif | Bin 256 -> 0 bytes .../icons/obj16/target_obj.gif | Bin 161 -> 0 bytes .../icons/obj16/trule_obj.gif | Bin 135 -> 0 bytes .../icons/wizban/newcprj_wiz.gif | Bin 3192 -> 0 bytes build/org.eclipse.cdt.make.ui/plugin.properties | 48 - build/org.eclipse.cdt.make.ui/plugin.xml | 402 -- .../cdt/make/internal/ui/ErrorParserBlock.java | 48 - .../make/internal/ui/MakeProjectOptionBlock.java | 32 - .../cdt/make/internal/ui/MakeResources.properties | 104 - .../eclipse/cdt/make/internal/ui/MakeUIImages.java | 123 - .../eclipse/cdt/make/internal/ui/MakeUIPlugin.java | 271 - .../eclipse/cdt/make/internal/ui/MessageLine.java | 61 - .../internal/ui/editor/AddBuildTargetAction.java | 136 - .../ui/editor/IMakefileDocumentProvider.java | 25 - .../editor/IMakefileEditorActionDefinitionIds.java | 24 - .../internal/ui/editor/LexicalSortingAction.java | 81 - .../ui/editor/MakefileContentOutlinePage.java | 314 -- .../ui/editor/MakefileDocumentProvider.java | 176 - .../make/internal/ui/editor/MakefileEditor.java | 205 - .../ui/editor/MakefileEditorActionContributor.java | 96 - .../MakefileEditorTogglePresentationAction.java | 50 - .../ui/editor/MakefileSourceConfiguration.java | 165 - .../internal/ui/editor/WorkingCopyManager.java | 106 - .../make/internal/ui/part/CheckboxTablePart.java | 66 - .../cdt/make/internal/ui/part/SharedPart.java | 53 - .../internal/ui/part/SharedPartWithButtons.java | 111 - .../internal/ui/part/StructuredViewerPart.java | 69 - .../internal/ui/part/WizardCheckboxTablePart.java | 151 - .../ui/preferences/MakePreferencePage.java | 112 - .../internal/ui/properties/MakePropertyPage.java | 130 - .../ui/text/CompletionProposalComparator.java | 29 - .../internal/ui/text/IMakefileColorManager.java | 35 - .../internal/ui/text/MakefileColorManager.java | 47 - .../make/internal/ui/text/WordPartDetector.java | 64 - .../ui/text/makefile/MakefileCodeScanner.java | 186 - .../text/makefile/MakefileCompletionProcessor.java | 265 - .../ui/text/makefile/MakefileMacroScanner.java | 114 - .../ui/text/makefile/MakefilePartitionScanner.java | 235 - .../text/makefile/MakefileReconcilingStrategy.java | 99 - .../ui/text/makefile/MakefileSimpleMacroRule.java | 55 - .../ui/text/makefile/MakefileWordDetector.java | 34 - .../make/internal/ui/wizards/StatusWizardPage.java | 91 - .../eclipse/cdt/make/ui/IMakeHelpContextIds.java | 20 - .../eclipse/cdt/make/ui/IWorkingCopyManager.java | 77 - .../cdt/make/ui/IWorkingCopyManagerExtension.java | 43 - .../eclipse/cdt/make/ui/MakeContentProvider.java | 234 - .../org/eclipse/cdt/make/ui/MakeLabelProvider.java | 82 - .../src/org/eclipse/cdt/make/ui/TargetBuild.java | 108 - .../eclipse/cdt/make/ui/TargetListViewerPart.java | 140 - .../cdt/make/ui/actions/AbstractTargetAction.java | 85 - .../cdt/make/ui/actions/BuildTargetAction.java | 66 - .../cdt/make/ui/actions/CreateTargetAction.java | 27 - .../make/ui/actions/UpdateMakeProjectAction.java | 268 - .../cdt/make/ui/dialogs/BuildPathInfoBlock.java | 643 --- .../cdt/make/ui/dialogs/BuildTargetDialog.java | 86 - .../cdt/make/ui/dialogs/MakeTargetDialog.java | 361 -- .../eclipse/cdt/make/ui/dialogs/SettingsBlock.java | 395 -- .../eclipse/cdt/make/ui/views/AddTargetAction.java | 60 - .../cdt/make/ui/views/BuildTargetAction.java | 60 - .../cdt/make/ui/views/DeleteTargetAction.java | 104 - .../cdt/make/ui/views/EditTargetAction.java | 59 - .../org/eclipse/cdt/make/ui/views/MakeView.java | 156 - .../ui/wizards/ConvertToMakeProjectWizard.java | 102 - .../ui/wizards/ConvertToMakeProjectWizardPage.java | 96 - .../ui/wizards/MakeProjectWizardOptionPage.java | 67 - .../make/ui/wizards/NewMakeCCProjectWizard.java | 51 - .../cdt/make/ui/wizards/NewMakeCProjectWizard.java | 33 - .../cdt/make/ui/wizards/NewMakeProjectWizard.java | 54 - .../make/ui/wizards/UpdateMakeProjectWizard.java | 42 - .../ui/wizards/UpdateMakeProjectWizardPage.java | 121 - .../org.eclipse.cdt.managedbuilder.core/.classpath | 7 - .../org.eclipse.cdt.managedbuilder.core/.cvsignore | 1 - build/org.eclipse.cdt.managedbuilder.core/.project | 29 - .../org.eclipse.cdt.managedbuilder.core/ChangeLog | 301 -- .../org.eclipse.cdt.managedbuilder.core/about.html | 30 - .../build.properties | 6 - .../plugin.properties | 5 - .../org.eclipse.cdt.managedbuilder.core/plugin.xml | 71 - .../schema/ManagedBuildTools.exsd | 576 --- .../cdt/managedbuilder/core/BuildException.java | 19 - .../cdt/managedbuilder/core/IBuildObject.java | 21 - .../cdt/managedbuilder/core/IConfiguration.java | 83 - .../cdt/managedbuilder/core/IManagedBuildInfo.java | 231 - .../eclipse/cdt/managedbuilder/core/IOption.java | 180 - .../cdt/managedbuilder/core/IOptionCategory.java | 50 - .../eclipse/cdt/managedbuilder/core/ITarget.java | 185 - .../org/eclipse/cdt/managedbuilder/core/ITool.java | 151 - .../managedbuilder/core/ManagedBuildManager.java | 555 -- .../core/ManagedBuilderCorePlugin.java | 80 - .../managedbuilder/core/ManagedCProjectNature.java | 182 - .../managedbuilder/internal/core/BuildObject.java | 49 - .../internal/core/Configuration.java | 459 -- .../internal/core/GeneratedMakefileBuilder.java | 442 -- .../internal/core/MakefileGenerator.java | 968 ---- .../internal/core/ManagedBuildInfo.java | 870 ---- .../cdt/managedbuilder/internal/core/Option.java | 347 -- .../internal/core/OptionCategory.java | 120 - .../internal/core/OptionReference.java | 469 -- .../internal/core/PluginResources.properties | 27 - .../cdt/managedbuilder/internal/core/Target.java | 526 -- .../cdt/managedbuilder/internal/core/Tool.java | 411 -- .../internal/core/ToolReference.java | 398 -- build/org.eclipse.cdt.managedbuilder.ui/.classpath | 7 - build/org.eclipse.cdt.managedbuilder.ui/.cvsignore | 1 - build/org.eclipse.cdt.managedbuilder.ui/.project | 31 - build/org.eclipse.cdt.managedbuilder.ui/ChangeLog | 164 - build/org.eclipse.cdt.managedbuilder.ui/about.html | 30 - .../build.properties | 6 - .../icons/full/build16/action-buildconfig.gif | Bin 940 -> 0 bytes .../icons/full/build16/action-deleteconfig.gif | Bin 936 -> 0 bytes .../icons/full/build16/action-editconfig.gif | Bin 942 -> 0 bytes .../icons/full/build16/action-newconfig.gif | Bin 941 -> 0 bytes .../icons/full/build16/build_configs.gif | Bin 940 -> 0 bytes .../icons/full/build16/config-category.gif | Bin 902 -> 0 bytes .../icons/full/build16/config-compiler.gif | Bin 157 -> 0 bytes .../icons/full/build16/config-debug.gif | Bin 166 -> 0 bytes .../icons/full/build16/config-librarian.gif | Bin 171 -> 0 bytes .../icons/full/build16/config-linker.gif | Bin 130 -> 0 bytes .../icons/full/build16/config-preprocessor.gif | Bin 167 -> 0 bytes .../icons/full/build16/config-profile.gif | Bin 193 -> 0 bytes .../icons/full/build16/config-release.gif | Bin 166 -> 0 bytes .../icons/full/build16/config-tool.gif | Bin 891 -> 0 bytes .../icons/full/wizban/newmngc_app.gif | Bin 416 -> 0 bytes .../icons/full/wizban/newmngcc_app.gif | Bin 425 -> 0 bytes .../plugin.properties | 75 - build/org.eclipse.cdt.managedbuilder.ui/plugin.xml | 3755 -------------- .../internal/ui/ManagedBuilderHelpContextIds.java | 22 - .../internal/ui/ManagedBuilderUIImages.java | 112 - .../internal/ui/ManagedBuilderUIPlugin.java | 79 - .../internal/ui/ManagedProjectOptionBlock.java | 35 - .../internal/ui/PluginResources.properties | 79 - .../ui/properties/BrowseEntryDialog.java | 185 - .../ui/properties/BuildOptionComboFieldEditor.java | 116 - .../ui/properties/BuildOptionListFieldEditor.java | 440 -- .../ui/properties/BuildPropertyPage.java | 619 --- .../ui/properties/BuildToolSettingsPage.java | 150 - .../ui/properties/BuildToolsSettingsStore.java | 441 -- .../ui/properties/ManageConfigDialog.java | 466 -- .../ui/properties/NewConfigurationDialog.java | 219 - .../ui/properties/SummaryFieldEditor.java | 120 - .../ui/properties/ToolListContentProvider.java | 98 - .../ui/properties/ToolListLabelProvider.java | 56 - .../ui/wizards/CProjectPlatformPage.java | 229 - .../ui/wizards/ConfigurationContentProvider.java | 35 - .../ui/wizards/ConfigurationLabelProvider.java | 36 - .../ui/wizards/NewManagedCCProjectWizard.java | 54 - .../ui/wizards/NewManagedCProjectWizard.java | 36 - .../ui/wizards/NewManagedProjectOptionPage.java | 65 - .../ui/wizards/NewManagedProjectWizard.java | 180 - core/org.eclipse.cdt.core.aix/.classpath | 7 - core/org.eclipse.cdt.core.aix/.cvsignore | 1 - core/org.eclipse.cdt.core.aix/.project | 29 - core/org.eclipse.cdt.core.aix/.template | 4 - core/org.eclipse.cdt.core.aix/build.properties | 4 - core/org.eclipse.cdt.core.aix/fragment.properties | 2 - core/org.eclipse.cdt.core.aix/fragment.xml | 22 - core/org.eclipse.cdt.core.aix/library/.cvsignore | 1 - core/org.eclipse.cdt.core.aix/library/Makefile | 29 - core/org.eclipse.cdt.core.aix/library/PTY.h | 21 - .../library/PTYInputStream.h | 32 - .../library/PTYOutputStream.h | 29 - core/org.eclipse.cdt.core.aix/library/Spawner.h | 45 - .../library/SpawnerInputStream.h | 32 - .../library/SpawnerOutputStream.h | 29 - core/org.eclipse.cdt.core.aix/library/exec0.h | 11 - core/org.eclipse.cdt.core.aix/library/exec_unix.c | 135 - core/org.eclipse.cdt.core.aix/library/io.c | 103 - core/org.eclipse.cdt.core.aix/library/openpty.c | 105 - core/org.eclipse.cdt.core.aix/library/openpty.h | 10 - core/org.eclipse.cdt.core.aix/library/pfind.c | 78 - core/org.eclipse.cdt.core.aix/library/pty.c | 35 - core/org.eclipse.cdt.core.aix/library/ptyio.c | 107 - core/org.eclipse.cdt.core.aix/library/spawner.c | 218 - .../eclipse/cdt/internal/core/aix/ProcessInfo.java | 45 - .../eclipse/cdt/internal/core/aix/ProcessList.java | 72 - core/org.eclipse.cdt.core.linux/.classpath | 7 - core/org.eclipse.cdt.core.linux/.cvsignore | 2 - core/org.eclipse.cdt.core.linux/.project | 29 - core/org.eclipse.cdt.core.linux/ChangeLog | 32 - core/org.eclipse.cdt.core.linux/build.properties | 10 - .../org.eclipse.cdt.core.linux/fragment.properties | 2 - core/org.eclipse.cdt.core.linux/fragment.xml | 22 - core/org.eclipse.cdt.core.linux/library/.cvsignore | 1 - core/org.eclipse.cdt.core.linux/library/Makefile | 44 - core/org.eclipse.cdt.core.linux/library/PTY.h | 21 - .../library/PTYInputStream.h | 32 - .../library/PTYOutputStream.h | 29 - core/org.eclipse.cdt.core.linux/library/Spawner.h | 45 - .../library/SpawnerInputStream.h | 32 - .../library/SpawnerOutputStream.h | 29 - core/org.eclipse.cdt.core.linux/library/exec0.h | 11 - .../org.eclipse.cdt.core.linux/library/exec_unix.c | 135 - core/org.eclipse.cdt.core.linux/library/io.c | 103 - core/org.eclipse.cdt.core.linux/library/openpty.c | 105 - core/org.eclipse.cdt.core.linux/library/openpty.h | 10 - core/org.eclipse.cdt.core.linux/library/pfind.c | 78 - core/org.eclipse.cdt.core.linux/library/pty.c | 35 - core/org.eclipse.cdt.core.linux/library/ptyio.c | 107 - core/org.eclipse.cdt.core.linux/library/spawner.c | 218 - .../os/linux/x86/libpty.so | Bin 9208 -> 0 bytes .../os/linux/x86/libspawner.so | Bin 13206 -> 0 bytes .../cdt/internal/core/linux/ProcessInfo.java | 45 - .../cdt/internal/core/linux/ProcessList.java | 72 - core/org.eclipse.cdt.core.qnx/.classpath | 7 - core/org.eclipse.cdt.core.qnx/.cvsignore | 1 - core/org.eclipse.cdt.core.qnx/.project | 29 - core/org.eclipse.cdt.core.qnx/ChangeLog | 30 - core/org.eclipse.cdt.core.qnx/build.properties | 10 - core/org.eclipse.cdt.core.qnx/fragment.properties | 2 - core/org.eclipse.cdt.core.qnx/fragment.xml | 22 - core/org.eclipse.cdt.core.qnx/library/.cvsignore | 3 - core/org.eclipse.cdt.core.qnx/library/Makefile | 8 - core/org.eclipse.cdt.core.qnx/library/pty/Makefile | 8 - core/org.eclipse.cdt.core.qnx/library/pty/PTY.h | 21 - .../library/pty/PTYInputStream.h | 32 - .../library/pty/PTYOutputStream.h | 29 - .../org.eclipse.cdt.core.qnx/library/pty/common.mk | 14 - .../org.eclipse.cdt.core.qnx/library/pty/openpty.c | 104 - .../org.eclipse.cdt.core.qnx/library/pty/openpty.h | 10 - core/org.eclipse.cdt.core.qnx/library/pty/pty.c | 35 - core/org.eclipse.cdt.core.qnx/library/pty/ptyio.c | 103 - .../library/pty/x86/Makefile | 8 - .../library/pty/x86/so/Makefile | 1 - .../library/spawner/Makefile | 8 - .../library/spawner/Spawner.h | 45 - .../library/spawner/SpawnerInputStream.h | 32 - .../library/spawner/SpawnerOutputStream.h | 29 - .../library/spawner/common.mk | 14 - .../library/spawner/iostream.c | 109 - .../library/spawner/spawner.c | 266 - .../library/spawner/x86/Makefile | 8 - .../library/spawner/x86/so/Makefile | 1 - core/org.eclipse.cdt.core.qnx/os/qnx/x86/libpty.so | Bin 7028 -> 0 bytes .../os/qnx/x86/libspawner.so | Bin 9426 -> 0 bytes .../eclipse/cdt/internal/core/qnx/ProcessInfo.java | 45 - .../eclipse/cdt/internal/core/qnx/ProcessList.java | 130 - core/org.eclipse.cdt.core.solaris/.classpath | 7 - core/org.eclipse.cdt.core.solaris/.cvsignore | 2 - core/org.eclipse.cdt.core.solaris/.project | 29 - core/org.eclipse.cdt.core.solaris/ChangeLog | 26 - core/org.eclipse.cdt.core.solaris/build.properties | 10 - .../fragment.properties | 2 - core/org.eclipse.cdt.core.solaris/fragment.xml | 22 - .../library/.cvsignore | 1 - core/org.eclipse.cdt.core.solaris/library/Makefile | 29 - core/org.eclipse.cdt.core.solaris/library/PTY.h | 21 - .../library/PTYInputStream.h | 32 - .../library/PTYOutputStream.h | 29 - .../org.eclipse.cdt.core.solaris/library/Spawner.h | 45 - .../library/SpawnerInputStream.h | 32 - .../library/SpawnerOutputStream.h | 29 - core/org.eclipse.cdt.core.solaris/library/exec0.h | 10 - .../library/exec_unix.c | 135 - core/org.eclipse.cdt.core.solaris/library/io.c | 103 - .../org.eclipse.cdt.core.solaris/library/openpty.c | 107 - .../org.eclipse.cdt.core.solaris/library/openpty.h | 10 - core/org.eclipse.cdt.core.solaris/library/pfind.c | 76 - core/org.eclipse.cdt.core.solaris/library/pty.c | 35 - core/org.eclipse.cdt.core.solaris/library/ptyio.c | 103 - .../org.eclipse.cdt.core.solaris/library/spawner.c | 219 - .../os/solaris/sparc/libpty.so | Bin 9681 -> 0 bytes .../os/solaris/sparc/libspawner.so | Bin 14902 -> 0 bytes .../cdt/internal/core/solaris/ProcessInfo.java | 45 - .../cdt/internal/core/solaris/ProcessList.java | 68 - core/org.eclipse.cdt.core.tests/.classpath | 14 - core/org.eclipse.cdt.core.tests/.cvsignore | 1 - core/org.eclipse.cdt.core.tests/.project | 34 - core/org.eclipse.cdt.core.tests/ChangeLog | 1326 ----- core/org.eclipse.cdt.core.tests/about.html | 44 - core/org.eclipse.cdt.core.tests/build.properties | 20 - .../build/managed/tests/ManagedBuildTests.java | 991 ---- .../build/managed/tests/StandardBuildTests.java | 373 -- .../failedTests/CModelElementsFailedTests.java | 120 - .../model/failedTests/FailedDeclaratorsTest.java | 168 - .../core/model/failedTests/FailedMacroTests.java | 120 - .../core/parser/failedTests/ASTFailedTests.java | 239 - .../failedTests/FailedCompleteParseASTTest.java | 198 - .../core/parser/failedTests/STLFailedTests.java | 50 - .../cdt/core/indexer/tests/DependencyTests.java | 710 --- .../cdt/core/indexer/tests/IndexManagerTests.java | 598 --- .../codeassist/tests/CompletionProposalsTest.java | 159 - .../eclipse/cdt/core/model/tests/AllCoreTests.java | 44 - .../model/tests/AllLanguageInterfaceTests.java | 36 - .../eclipse/cdt/core/model/tests/ArchiveTests.java | 213 - .../eclipse/cdt/core/model/tests/BinaryTests.java | 438 -- .../cdt/core/model/tests/CModelElementsTests.java | 539 -- .../cdt/core/model/tests/CModelExceptionTest.java | 113 - .../eclipse/cdt/core/model/tests/CModelTests.java | 237 - .../cdt/core/model/tests/CPathEntryTest.java | 168 - .../cdt/core/model/tests/DeclaratorsTests.java | 103 - .../cdt/core/model/tests/ElementDeltaTests.java | 290 -- .../eclipse/cdt/core/model/tests/FlagTests.java | 212 - .../cdt/core/model/tests/IIncludeTests.java | 115 - .../eclipse/cdt/core/model/tests/IMacroTests.java | 106 - .../cdt/core/model/tests/IStructureTests.java | 422 -- .../cdt/core/model/tests/ITemplateTests.java | 253 - .../cdt/core/model/tests/IntegratedCModelTest.java | 107 - .../eclipse/cdt/core/model/tests/MacroTests.java | 48 - .../core/model/tests/TranslationUnitBaseTest.java | 155 - .../cdt/core/model/tests/TranslationUnitTests.java | 220 - .../cdt/core/model/tests/WorkingCopyTests.java | 130 - .../cdt/core/parser/tests/AutomatedFramework.java | 190 - .../cdt/core/parser/tests/AutomatedTest.java | 137 - .../eclipse/cdt/core/parser/tests/BaseASTTest.java | 174 - .../cdt/core/parser/tests/BaseScannerTest.java | 237 - .../cdt/core/parser/tests/BranchTrackerTest.java | 201 - .../tests/CompleteParseASTExpressionTest.java | 841 --- .../core/parser/tests/CompleteParseASTTest.java | 1207 ----- .../core/parser/tests/CompleteParseBaseTest.java | 899 ---- .../cdt/core/parser/tests/ContextualParseTest.java | 565 -- .../cdt/core/parser/tests/ExprEvalTest.java | 90 - .../core/parser/tests/FractionalAutomatedTest.java | 258 - .../core/parser/tests/ParserSymbolTableTest.java | 3437 ------------- .../cdt/core/parser/tests/ParserTestSuite.java | 43 - .../cdt/core/parser/tests/PerformanceTests.java | 45 - .../parser/tests/PreprocessorConditionalTest.java | 119 - .../cdt/core/parser/tests/PreprocessorTest.java | 81 - .../tests/QuickParseASTQualifiedNameTest.java | 114 - .../cdt/core/parser/tests/QuickParseASTTests.java | 2033 -------- .../cdt/core/parser/tests/ScannerTestCase.java | 1532 ------ .../eclipse/cdt/core/parser/tests/TortureTest.java | 295 -- .../eclipse/cdt/core/parser/tests/XMLDumper.java | 138 - core/org.eclipse.cdt.core.tests/plugin.xml | 248 - .../resources/cfiles/CModelElementsTestStart.h | 138 - .../cfiles/CompletionProposalsTestStart.cpp | 24 - .../cfiles/CompletionProposalsTestStart.h | 11 - .../resources/cfiles/TranslationUnits.c | 70 - .../resources/cfiles/WorkingCopyTestStart.h | 2 - .../resources/cmodel/DeclaratorsTests.cpp | 24 - .../resources/cmodel/IIncludeTest.h | 42 - .../resources/cmodel/IMacroTest.h | 4 - .../resources/cmodel/IStructure.c | 88 - .../resources/cmodel/ITemplate.cpp | 61 - .../resources/cmodel/MacroTests.c | 24 - .../resources/dependency/DepTest.cpp | 8 - .../resources/dependency/DepTest.h | 8 - .../resources/dependency/DepTest2.cpp | 8 - .../resources/dependency/DepTest2.h | 8 - .../resources/dependency/DepTest3.cpp | 7 - .../resources/dependency/DepTest3.h | 8 - .../resources/dependency/Inc1.h | 8 - .../resources/dependency/a.h | 8 - .../resources/dependency/c.h | 6 - .../resources/dependency/d.h | 6 - .../resources/exe/Makefile | 8 - .../resources/exe/common.mk | 7 - .../resources/exe/main.c | 7 - .../resources/exe/ppc/Makefile | 8 - .../resources/exe/ppc/be.g/Makefile | 1 - .../resources/exe/ppc/be.g/exe_g | Bin 18341 -> 0 bytes .../resources/exe/ppc/be.g/main.o | Bin 7724 -> 0 bytes .../resources/exe/ppc/be.g/test.o | Bin 8036 -> 0 bytes .../resources/exe/ppc/be.g/test2.o | Bin 8128 -> 0 bytes .../resources/exe/test.c | 14 - .../resources/exe/test2.c | 13 - .../resources/exe/x86/Makefile | 8 - .../resources/exe/x86/o.g/Makefile | 1 - .../resources/exe/x86/o.g/exe_g | Bin 10783 -> 0 bytes .../resources/exe/x86/o.g/main.o | Bin 5980 -> 0 bytes .../resources/exe/x86/o.g/test.o | Bin 6148 -> 0 bytes .../resources/exe/x86/o.g/test2.o | Bin 6284 -> 0 bytes .../resources/exe/x86/o/Makefile | 1 - .../resources/exe/x86/o/exe | Bin 4591 -> 0 bytes .../resources/exe/x86/o/main.o | Bin 892 -> 0 bytes .../resources/exe/x86/o/test.o | Bin 980 -> 0 bytes .../resources/exe/x86/o/test2.o | Bin 1076 -> 0 bytes .../resources/exebig/Makefile | 8 - .../resources/exebig/common.mk | 7 - .../resources/exebig/main.c | 8 - .../resources/exebig/x86/Makefile | 8 - .../resources/exebig/x86/o.g/Makefile | 1 - .../resources/exebig/x86/o.g/exebig_g | Bin 9065 -> 0 bytes .../resources/exebig/x86/o.g/main.o | Bin 6180 -> 0 bytes .../resources/indexer/DocumentManager.cpp | 25 - .../resources/indexer/DocumentManager.h | 20 - .../resources/indexer/extramail.cpp | 112 - .../resources/indexer/mail.cpp | 98 - .../resources/indexer/reftest.cpp | 22 - .../parser/AutomatedTest/AutomatedTest.properties | 13 - .../FractionalAutomatedTest.properties | 17 - .../parser/AutomatedTest/defaultC/Simple.c | 43 - .../parser/AutomatedTest/defaultC/Simple.h | 17 - .../parser/AutomatedTest/defaultCpp/Simple.cpp | 37 - .../parser/AutomatedTest/defaultCpp/Simple.h | 32 - .../resources/parser/LineNumberTest.h | 43 - .../resources/parser/TortureTest/.cvsignore | 1 - .../parser/TortureTest/ReadMe-TortureText.txt | 31 - .../resources/search/classDecl.cpp | 84 - .../resources/search/include.h | 34 - .../resources/testlib/Makefile | 8 - .../resources/testlib/common.mk | 6 - .../resources/testlib/test.c | 14 - .../resources/testlib/test2.c | 13 - .../resources/testlib/x86/Makefile | 8 - .../resources/testlib/x86/a.g/Makefile | 1 - .../resources/testlib/x86/a.g/libtestlib_g.a | Bin 12682 -> 0 bytes .../resources/testlib/x86/a.g/test.o | Bin 6156 -> 0 bytes .../resources/testlib/x86/a.g/test2.o | Bin 6284 -> 0 bytes .../resources/testlib/x86/so.g/Makefile | 1 - .../resources/testlib/x86/so.g/libtestlib_g.so | Bin 10171 -> 0 bytes .../resources/testlib/x86/so.g/libtestlib_gS.a | Bin 12906 -> 0 bytes .../resources/testlib/x86/so.g/test.o | Bin 6272 -> 0 bytes .../resources/testlib/x86/so.g/test2.o | Bin 6392 -> 0 bytes .../cdt/core/search/tests/BaseSearchTest.java | 185 - .../search/tests/ClassDeclarationPatternTests.java | 282 - .../search/tests/FunctionMethodPatternTests.java | 206 - .../cdt/core/search/tests/OtherPatternTests.java | 366 -- .../core/search/tests/ParseTestOnSearchFiles.java | 66 - .../cdt/core/search/tests/SearchTestSuite.java | 34 - .../eclipse/cdt/core/suite/AISResultPrinter.java | 53 - .../cdt/core/suite/AutomatedIntegrationSuite.java | 78 - .../suite/org/eclipse/cdt/core/suite/RunTests.java | 217 - .../eclipse/cdt/testplugin/CElementDecorator.java | 30 - .../org/eclipse/cdt/testplugin/CProjectHelper.java | 259 - .../org/eclipse/cdt/testplugin/CTestPlugin.java | 58 - .../org/eclipse/cdt/testplugin/CTestSetup.java | 31 - .../org/eclipse/cdt/testplugin/FileManager.java | 55 - .../suite/org/eclipse/cdt/testplugin/Main.java | 528 -- .../suite/org/eclipse/cdt/testplugin/NewMain.java | 73 - .../eclipse/cdt/testplugin/TestPluginLauncher.java | 57 - .../cdt/testplugin/util/AccessibilityTestPass.java | 66 - .../cdt/testplugin/util/ExpectedStrings.java | 96 - .../cdt/testplugin/util/ExpectedStringsTests.java | 114 - .../eclipse/cdt/testplugin/util/FailureDialog.java | 107 - .../eclipse/cdt/testplugin/util/FocusTestPass.java | 68 - .../cdt/testplugin/util/IDialogTestPass.java | 48 - .../cdt/testplugin/util/SizingTestPass.java | 76 - .../eclipse/cdt/testplugin/util/VerifyDialog.java | 305 -- core/org.eclipse.cdt.core.tests/test.xml | 56 - core/org.eclipse.cdt.core.win32/.classpath | 7 - core/org.eclipse.cdt.core.win32/.cvsignore | 1 - core/org.eclipse.cdt.core.win32/.project | 29 - core/org.eclipse.cdt.core.win32/ChangeLog | 104 - core/org.eclipse.cdt.core.win32/build.properties | 10 - .../org.eclipse.cdt.core.win32/fragment.properties | 2 - core/org.eclipse.cdt.core.win32/fragment.xml | 26 - core/org.eclipse.cdt.core.win32/library/Spawner.h | 48 - .../library/SpawnerInputStream.h | 32 - .../library/SpawnerOutputStream.h | 29 - core/org.eclipse.cdt.core.win32/library/StdAfx.c | 18 - core/org.eclipse.cdt.core.win32/library/StdAfx.h | 36 - .../library/Win32ProcessEx.c | 817 --- core/org.eclipse.cdt.core.win32/library/iostream.c | 143 - .../library/listtasks/StdAfx.cpp | 8 - .../library/listtasks/StdAfx.h | 29 - .../library/listtasks/listtasks.cpp | 323 -- .../library/listtasks/listtasks.dsp | 117 - .../library/listtasks/listtasks.dsw | 29 - .../library/listtasks/listtasks.h | 12 - core/org.eclipse.cdt.core.win32/library/raise.c | 180 - core/org.eclipse.cdt.core.win32/library/spawner.c | 51 - .../org.eclipse.cdt.core.win32/library/spawner.dep | 18 - .../org.eclipse.cdt.core.win32/library/spawner.dsp | 181 - .../org.eclipse.cdt.core.win32/library/spawner.dsw | 29 - .../org.eclipse.cdt.core.win32/library/spawner.mak | 264 - .../library/starter/starter.cpp | 256 - .../library/starter/starter.dep | 5 - .../library/starter/starter.mak | 156 - .../os/win32/x86/listtasks.exe | Bin 102400 -> 0 bytes .../os/win32/x86/spawner.dll | Bin 61440 -> 0 bytes .../os/win32/x86/starter.exe | Bin 16384 -> 0 bytes .../cdt/internal/core/win32/ProcessInfo.java | 45 - .../cdt/internal/core/win32/ProcessList.java | 88 - core/org.eclipse.cdt.core/.classpath | 13 - core/org.eclipse.cdt.core/.cvsignore | 2 - core/org.eclipse.cdt.core/.options | 25 - core/org.eclipse.cdt.core/.project | 28 - core/org.eclipse.cdt.core/ChangeLog | 2232 -------- core/org.eclipse.cdt.core/about.html | 30 - core/org.eclipse.cdt.core/build.properties | 37 - core/org.eclipse.cdt.core/dependency/ChangeLog | 64 - .../core/sourcedependency/DependencyQueryJob.java | 228 - .../cdt/internal/core/sourcedependency/Node.java | 45 - .../core/sourcedependency/UpdateDependency.java | 103 - core/org.eclipse.cdt.core/index/ChangeLog | 235 - .../eclipse/cdt/internal/core/CharOperation.java | 2572 ---------- .../index/org/eclipse/cdt/internal/core/Util.java | 399 -- .../eclipse/cdt/internal/core/index/IDocument.java | 48 - .../cdt/internal/core/index/IEntryResult.java | 17 - .../eclipse/cdt/internal/core/index/IIndex.java | 84 - .../eclipse/cdt/internal/core/index/IIndexer.java | 42 - .../cdt/internal/core/index/IIndexerOutput.java | 26 - .../cdt/internal/core/index/IQueryResult.java | 15 - .../cdt/internal/core/index/StringMatcher.java | 389 -- .../cdt/internal/core/index/impl/Block.java | 62 - .../internal/core/index/impl/BlocksIndexInput.java | 474 -- .../core/index/impl/BlocksIndexOutput.java | 216 - .../internal/core/index/impl/CodeByteStream.java | 343 -- .../cdt/internal/core/index/impl/EntryResult.java | 68 - .../cdt/internal/core/index/impl/Field.java | 381 -- .../internal/core/index/impl/FileListBlock.java | 110 - .../core/index/impl/GammaCompressedIndexBlock.java | 190 - .../internal/core/index/impl/IFileDocument.java | 98 - .../internal/core/index/impl/IIndexConstants.java | 29 - .../internal/core/index/impl/InMemoryIndex.java | 304 -- .../cdt/internal/core/index/impl/IncludeEntry.java | 223 - .../core/index/impl/IncludeEntryHashedArray.java | 84 - .../cdt/internal/core/index/impl/Index.java | 443 -- .../cdt/internal/core/index/impl/IndexBlock.java | 81 - .../cdt/internal/core/index/impl/IndexInput.java | 171 - .../cdt/internal/core/index/impl/IndexOutput.java | 43 - .../cdt/internal/core/index/impl/IndexSummary.java | 390 -- .../cdt/internal/core/index/impl/IndexedFile.java | 65 - .../core/index/impl/IndexedFileHashedArray.java | 109 - .../internal/core/index/impl/IndexerOutput.java | 77 - .../eclipse/cdt/internal/core/index/impl/Int.java | 21 - .../cdt/internal/core/index/impl/MergeFactory.java | 266 - .../internal/core/index/impl/PropertyDocument.java | 48 - .../core/index/impl/SafeRandomAccessFile.java | 31 - .../internal/core/index/impl/SimpleIndexInput.java | 209 - .../eclipse/cdt/internal/core/index/impl/Util.java | 371 -- .../cdt/internal/core/index/impl/WordEntry.java | 156 - .../core/index/impl/WordEntryHashedArray.java | 83 - .../eclipse/cdt/internal/core/messages.properties | 29 - .../cdt/internal/core/search/HashtableOfInt.java | 93 - .../internal/core/search/SimpleLookupTable.java | 153 - .../core/search/indexing/AbstractIndexer.java | 659 --- .../search/indexing/AddCompilationUnitToIndex.java | 43 - .../core/search/indexing/AddFileToIndex.java | 58 - .../core/search/indexing/AddFolderToIndex.java | 93 - .../core/search/indexing/IIndexConstants.java | 109 - .../core/search/indexing/IndexAllProject.java | 210 - .../core/search/indexing/IndexManager.java | 576 --- .../core/search/indexing/IndexRequest.java | 63 - .../core/search/indexing/ReadWriteMonitor.java | 85 - .../search/indexing/RemoveFolderFromIndex.java | 72 - .../core/search/indexing/RemoveFromIndex.java | 57 - .../internal/core/search/indexing/SaveIndex.java | 56 - .../core/search/indexing/SourceIndexer.java | 123 - .../search/indexing/SourceIndexerRequestor.java | 479 -- .../eclipse/cdt/core/model/BufferChangedEvent.java | 112 - .../eclipse/cdt/core/model/CModelException.java | 117 - .../org/eclipse/cdt/core/model/CoreModel.java | 528 -- .../cdt/core/model/ElementChangedEvent.java | 36 - .../model/org/eclipse/cdt/core/model/Flags.java | 188 - .../model/org/eclipse/cdt/core/model/IArchive.java | 18 - .../eclipse/cdt/core/model/IArchiveContainer.java | 14 - .../model/org/eclipse/cdt/core/model/IBinary.java | 40 - .../eclipse/cdt/core/model/IBinaryContainer.java | 15 - .../org/eclipse/cdt/core/model/IBinaryElement.java | 26 - .../eclipse/cdt/core/model/IBinaryFunction.java | 12 - .../org/eclipse/cdt/core/model/IBinaryModule.java | 13 - .../eclipse/cdt/core/model/IBinaryVariable.java | 12 - .../model/org/eclipse/cdt/core/model/IBuffer.java | 257 - .../cdt/core/model/IBufferChangedListener.java | 34 - .../org/eclipse/cdt/core/model/ICContainer.java | 27 - .../org/eclipse/cdt/core/model/ICElement.java | 316 -- .../org/eclipse/cdt/core/model/ICElementDelta.java | 200 - .../model/org/eclipse/cdt/core/model/ICModel.java | 192 - .../org/eclipse/cdt/core/model/ICModelMarker.java | 44 - .../org/eclipse/cdt/core/model/ICModelStatus.java | 79 - .../cdt/core/model/ICModelStatusConstants.java | 224 - .../org/eclipse/cdt/core/model/ICPathEntry.java | 96 - .../org/eclipse/cdt/core/model/ICProject.java | 160 - .../eclipse/cdt/core/model/IContainerEntry.java | 23 - .../org/eclipse/cdt/core/model/IDeclaration.java | 18 - .../cdt/core/model/IElementChangedListener.java | 20 - .../org/eclipse/cdt/core/model/IEnumeration.java | 12 - .../org/eclipse/cdt/core/model/IEnumerator.java | 21 - .../model/org/eclipse/cdt/core/model/IField.java | 20 - .../org/eclipse/cdt/core/model/IFunction.java | 13 - .../cdt/core/model/IFunctionDeclaration.java | 66 - .../model/org/eclipse/cdt/core/model/IInclude.java | 29 - .../org/eclipse/cdt/core/model/IIncludeEntry.java | 50 - .../org/eclipse/cdt/core/model/IInheritance.java | 22 - .../org/eclipse/cdt/core/model/ILibraryEntry.java | 66 - .../eclipse/cdt/core/model/ILibraryReference.java | 11 - .../model/org/eclipse/cdt/core/model/IMacro.java | 14 - .../org/eclipse/cdt/core/model/IMacroEntry.java | 51 - .../model/org/eclipse/cdt/core/model/IMember.java | 24 - .../model/org/eclipse/cdt/core/model/IMethod.java | 13 - .../eclipse/cdt/core/model/IMethodDeclaration.java | 72 - .../org/eclipse/cdt/core/model/INamespace.java | 13 - .../org/eclipse/cdt/core/model/IOpenable.java | 69 - .../model/org/eclipse/cdt/core/model/IParent.java | 39 - .../org/eclipse/cdt/core/model/IProjectEntry.java | 26 - .../org/eclipse/cdt/core/model/ISourceEntry.java | 46 - .../cdt/core/model/ISourceManipulation.java | 109 - .../org/eclipse/cdt/core/model/ISourceRange.java | 42 - .../eclipse/cdt/core/model/ISourceReference.java | 51 - .../org/eclipse/cdt/core/model/IStructure.java | 27 - .../org/eclipse/cdt/core/model/ITemplate.java | 33 - .../eclipse/cdt/core/model/ITranslationUnit.java | 214 - .../model/org/eclipse/cdt/core/model/ITypeDef.java | 17 - .../model/org/eclipse/cdt/core/model/IUsing.java | 16 - .../org/eclipse/cdt/core/model/IVariable.java | 13 - .../cdt/core/model/IVariableDeclaration.java | 14 - .../cdt/internal/core/model/ACPathEntry.java | 74 - .../eclipse/cdt/internal/core/model/Archive.java | 104 - .../cdt/internal/core/model/ArchiveContainer.java | 45 - .../internal/core/model/ArchiveContainerInfo.java | 27 - .../cdt/internal/core/model/ArchiveInfo.java | 21 - .../cdt/internal/core/model/BatchOperation.java | 59 - .../eclipse/cdt/internal/core/model/Binary.java | 274 - .../cdt/internal/core/model/BinaryContainer.java | 45 - .../internal/core/model/BinaryContainerInfo.java | 27 - .../cdt/internal/core/model/BinaryElement.java | 169 - .../cdt/internal/core/model/BinaryFunction.java | 89 - .../cdt/internal/core/model/BinaryInfo.java | 15 - .../cdt/internal/core/model/BinaryModule.java | 79 - .../cdt/internal/core/model/BinaryRunner.java | 128 - .../cdt/internal/core/model/BinaryVariable.java | 66 - .../eclipse/cdt/internal/core/model/Buffer.java | 445 -- .../cdt/internal/core/model/BufferManager.java | 152 - .../cdt/internal/core/model/CContainer.java | 149 - .../cdt/internal/core/model/CContainerInfo.java | 85 - .../eclipse/cdt/internal/core/model/CElement.java | 386 -- .../cdt/internal/core/model/CElementDelta.java | 729 --- .../internal/core/model/CElementDeltaBuilder.java | 401 -- .../cdt/internal/core/model/CElementInfo.java | 179 - .../eclipse/cdt/internal/core/model/CFileInfo.java | 16 - .../eclipse/cdt/internal/core/model/CModel.java | 109 - .../cdt/internal/core/model/CModelBuilder.java | 637 --- .../cdt/internal/core/model/CModelCache.java | 146 - .../cdt/internal/core/model/CModelInfo.java | 57 - .../cdt/internal/core/model/CModelManager.java | 885 ---- .../cdt/internal/core/model/CModelOperation.java | 555 -- .../cdt/internal/core/model/CModelStatus.java | 263 - .../cdt/internal/core/model/CPathEntry.java | 136 - .../eclipse/cdt/internal/core/model/CProject.java | 579 --- .../cdt/internal/core/model/CProjectInfo.java | 42 - .../core/model/CommitWorkingCopyOperation.java | 142 - .../cdt/internal/core/model/ContainerEntry.java | 54 - .../internal/core/model/CopyElementsOperation.java | 214 - .../core/model/CopyResourceElementsOperation.java | 249 - .../core/model/CreateElementInTUOperation.java | 429 -- .../internal/core/model/CreateFieldOperation.java | 74 - .../model/CreateFunctionDeclarationOperation.java | 96 - .../core/model/CreateIncludeOperation.java | 92 - .../internal/core/model/CreateMemberOperation.java | 91 - .../internal/core/model/CreateMethodOperation.java | 52 - .../model/DeleteResourceElementsOperation.java | 49 - .../cdt/internal/core/model/DeltaProcessor.java | 524 -- .../cdt/internal/core/model/ElementCache.java | 71 - .../cdt/internal/core/model/Enumeration.java | 96 - .../cdt/internal/core/model/EnumerationInfo.java | 21 - .../cdt/internal/core/model/Enumerator.java | 43 - .../org/eclipse/cdt/internal/core/model/Field.java | 73 - .../eclipse/cdt/internal/core/model/FieldInfo.java | 100 - .../eclipse/cdt/internal/core/model/Function.java | 16 - .../internal/core/model/FunctionDeclaration.java | 153 - .../cdt/internal/core/model/FunctionInfo.java | 77 - .../cdt/internal/core/model/FunctionTemplate.java | 91 - .../cdt/internal/core/model/IBufferFactory.java | 36 - .../cdt/internal/core/model/IConstants.java | 39 - .../internal/core/model/IDebugLogConstants.java | 28 - .../cdt/internal/core/model/IWorkingCopy.java | 128 - .../eclipse/cdt/internal/core/model/Include.java | 54 - .../cdt/internal/core/model/IncludeEntry.java | 88 - .../cdt/internal/core/model/LibraryEntry.java | 120 - .../cdt/internal/core/model/LibraryReference.java | 48 - .../core/model/LibraryReferenceArchive.java | 53 - .../core/model/LibraryReferenceShared.java | 50 - .../org/eclipse/cdt/internal/core/model/Macro.java | 28 - .../cdt/internal/core/model/MacroEntry.java | 86 - .../eclipse/cdt/internal/core/model/Method.java | 16 - .../cdt/internal/core/model/MethodDeclaration.java | 126 - .../cdt/internal/core/model/MethodInfo.java | 100 - .../cdt/internal/core/model/MethodTemplate.java | 93 - .../core/model/MoveResourceElementsOperation.java | 40 - .../cdt/internal/core/model/MultiOperation.java | 297 -- .../eclipse/cdt/internal/core/model/Namespace.java | 40 - .../cdt/internal/core/model/NullBinaryParser.java | 38 - .../eclipse/cdt/internal/core/model/Openable.java | 304 -- .../cdt/internal/core/model/OpenableInfo.java | 20 - .../eclipse/cdt/internal/core/model/Parent.java | 80 - .../cdt/internal/core/model/ProjectEntry.java | 56 - .../model/RenameResourceElementsOperation.java | 52 - .../core/model/SetCPathEntriesOperation.java | 221 - .../cdt/internal/core/model/SourceEntry.java | 76 - .../internal/core/model/SourceManipulation.java | 160 - .../core/model/SourceManipulationInfo.java | 152 - .../cdt/internal/core/model/SourceMapper.java | 54 - .../cdt/internal/core/model/SourceRange.java | 91 - .../eclipse/cdt/internal/core/model/Structure.java | 140 - .../cdt/internal/core/model/StructureInfo.java | 41 - .../cdt/internal/core/model/StructureTemplate.java | 71 - .../cdt/internal/core/model/TranslationUnit.java | 481 -- .../internal/core/model/TranslationUnitInfo.java | 71 - .../eclipse/cdt/internal/core/model/TypeDef.java | 39 - .../org/eclipse/cdt/internal/core/model/Using.java | 27 - .../org/eclipse/cdt/internal/core/model/Util.java | 300 -- .../eclipse/cdt/internal/core/model/Variable.java | 25 - .../internal/core/model/VariableDeclaration.java | 60 - .../cdt/internal/core/model/VariableInfo.java | 67 - .../cdt/internal/core/model/VariableTemplate.java | 71 - .../cdt/internal/core/model/WorkingCopy.java | 382 -- .../cdt/internal/core/model/WorkingCopyInfo.java | 22 - .../cdt/internal/core/model/parser/ElfParser.java | 19 - .../cdt/internal/core/model/parser/PEParser.java | 14 - .../cdt/internal/core/util/ICacheEnumeration.java | 42 - .../cdt/internal/core/util/ILRUCacheable.java | 32 - .../eclipse/cdt/internal/core/util/LRUCache.java | 503 -- .../cdt/internal/core/util/LRUCacheEnumerator.java | 72 - .../internal/core/util/OverflowingLRUCache.java | 429 -- .../cdt/internal/core/util/ToStringSorter.java | 78 - core/org.eclipse.cdt.core/parser/ChangeLog-parser | 938 ---- .../cdt/core/parser/BacktrackException.java | 19 - .../eclipse/cdt/core/parser/DefaultLogService.java | 36 - .../cdt/core/parser/DefaultProblemHandler.java | 50 - .../cdt/core/parser/EndOfFileException.java | 19 - .../parser/org/eclipse/cdt/core/parser/Enum.java | 32 - .../cdt/core/parser/ILineOffsetReconciler.java | 21 - .../eclipse/cdt/core/parser/IMacroDescriptor.java | 19 - .../org/eclipse/cdt/core/parser/IOffsetDuple.java | 21 - .../org/eclipse/cdt/core/parser/IParser.java | 71 - .../eclipse/cdt/core/parser/IParserLogService.java | 23 - .../org/eclipse/cdt/core/parser/IPreprocessor.java | 22 - .../org/eclipse/cdt/core/parser/IProblem.java | 349 -- .../cdt/core/parser/IQuickParseCallback.java | 28 - .../org/eclipse/cdt/core/parser/IScanner.java | 40 - .../org/eclipse/cdt/core/parser/IScannerInfo.java | 42 - .../parser/ISourceElementCallbackDelegate.java | 22 - .../cdt/core/parser/ISourceElementRequestor.java | 105 - .../parser/org/eclipse/cdt/core/parser/IToken.java | 306 -- .../org/eclipse/cdt/core/parser/ITokenDuple.java | 37 - .../org/eclipse/cdt/core/parser/Keywords.java | 97 - .../core/parser/NullSourceElementRequestor.java | 452 -- .../core/parser/OffsetLimitReachedException.java | 32 - .../org/eclipse/cdt/core/parser/ParserFactory.java | 102 - .../cdt/core/parser/ParserFactoryException.java | 44 - .../eclipse/cdt/core/parser/ParserLanguage.java | 35 - .../org/eclipse/cdt/core/parser/ParserMode.java | 36 - .../core/parser/ParserNotImplementedException.java | 18 - .../eclipse/cdt/core/parser/ScannerException.java | 30 - .../org/eclipse/cdt/core/parser/ScannerInfo.java | 50 - .../cdt/core/parser/SyntaxErrorException.java | 29 - .../cdt/core/parser/ast/ASTAccessVisibility.java | 30 - .../eclipse/cdt/core/parser/ast/ASTClassKind.java | 31 - .../parser/ast/ASTNotImplementedException.java | 19 - .../cdt/core/parser/ast/ASTPointerOperator.java | 34 - .../cdt/core/parser/ast/ASTSemanticException.java | 47 - .../parser/ast/ExpressionEvaluationException.java | 19 - .../cdt/core/parser/ast/IASTASMDefinition.java | 22 - .../core/parser/ast/IASTAbstractDeclaration.java | 30 - .../ast/IASTAbstractTypeSpecifierDeclaration.java | 20 - .../cdt/core/parser/ast/IASTArrayModifier.java | 23 - .../cdt/core/parser/ast/IASTBaseSpecifier.java | 28 - .../cdt/core/parser/ast/IASTClassReference.java | 20 - .../cdt/core/parser/ast/IASTClassSpecifier.java | 44 - .../eclipse/cdt/core/parser/ast/IASTCodeScope.java | 21 - .../cdt/core/parser/ast/IASTCompilationUnit.java | 21 - .../cdt/core/parser/ast/IASTCompletionNode.java | 116 - .../ast/IASTConstructorMemberInitializer.java | 24 - .../cdt/core/parser/ast/IASTDeclaration.java | 22 - .../cdt/core/parser/ast/IASTDesignator.java | 40 - .../parser/ast/IASTElaboratedTypeSpecifier.java | 26 - .../core/parser/ast/IASTEnumerationReference.java | 19 - .../core/parser/ast/IASTEnumerationSpecifier.java | 24 - .../cdt/core/parser/ast/IASTEnumerator.java | 23 - .../core/parser/ast/IASTEnumeratorReference.java | 19 - .../parser/ast/IASTExceptionSpecification.java | 24 - .../cdt/core/parser/ast/IASTExpression.java | 146 - .../eclipse/cdt/core/parser/ast/IASTFactory.java | 243 - .../org/eclipse/cdt/core/parser/ast/IASTField.java | 22 - .../cdt/core/parser/ast/IASTFieldReference.java | 19 - .../eclipse/cdt/core/parser/ast/IASTFunction.java | 43 - .../cdt/core/parser/ast/IASTFunctionReference.java | 19 - .../eclipse/cdt/core/parser/ast/IASTInclusion.java | 28 - .../cdt/core/parser/ast/IASTInitializerClause.java | 47 - .../core/parser/ast/IASTLinkageSpecification.java | 21 - .../org/eclipse/cdt/core/parser/ast/IASTMacro.java | 23 - .../eclipse/cdt/core/parser/ast/IASTMember.java | 20 - .../eclipse/cdt/core/parser/ast/IASTMethod.java | 33 - .../cdt/core/parser/ast/IASTMethodReference.java | 19 - .../cdt/core/parser/ast/IASTNamespaceAlias.java | 24 - .../core/parser/ast/IASTNamespaceDefinition.java | 20 - .../core/parser/ast/IASTNamespaceReference.java | 19 - .../org/eclipse/cdt/core/parser/ast/IASTNode.java | 72 - .../cdt/core/parser/ast/IASTOffsetableElement.java | 25 - .../parser/ast/IASTOffsetableNamedElement.java | 25 - .../core/parser/ast/IASTParameterDeclaration.java | 20 - .../core/parser/ast/IASTParameterReference.java | 19 - .../core/parser/ast/IASTPointerOperatorOwner.java | 20 - .../core/parser/ast/IASTQualifiedNameElement.java | 20 - .../eclipse/cdt/core/parser/ast/IASTReference.java | 26 - .../org/eclipse/cdt/core/parser/ast/IASTScope.java | 22 - .../cdt/core/parser/ast/IASTScopedElement.java | 20 - .../core/parser/ast/IASTScopedTypeSpecifier.java | 19 - .../core/parser/ast/IASTSimpleTypeSpecifier.java | 56 - .../eclipse/cdt/core/parser/ast/IASTTemplate.java | 21 - .../core/parser/ast/IASTTemplateDeclaration.java | 23 - .../core/parser/ast/IASTTemplateInstantiation.java | 19 - .../cdt/core/parser/ast/IASTTemplateParameter.java | 42 - .../core/parser/ast/IASTTemplateParameterList.java | 22 - .../parser/ast/IASTTemplateSpecialization.java | 19 - .../core/parser/ast/IASTTemplatedDeclaration.java | 20 - .../eclipse/cdt/core/parser/ast/IASTTypeId.java | 40 - .../cdt/core/parser/ast/IASTTypeSpecifier.java | 19 - .../core/parser/ast/IASTTypeSpecifierOwner.java | 20 - .../core/parser/ast/IASTTypedefDeclaration.java | 23 - .../cdt/core/parser/ast/IASTTypedefReference.java | 19 - .../cdt/core/parser/ast/IASTUsingDeclaration.java | 23 - .../cdt/core/parser/ast/IASTUsingDirective.java | 21 - .../eclipse/cdt/core/parser/ast/IASTVariable.java | 33 - .../cdt/core/parser/ast/IASTVariableReference.java | 19 - .../internal/core/parser/BaseProblemFactory.java | 65 - .../cdt/internal/core/parser/BranchTracker.java | 166 - .../cdt/internal/core/parser/CompleteParser.java | 71 - .../cdt/internal/core/parser/ContextException.java | 37 - .../cdt/internal/core/parser/ContextStack.java | 193 - .../cdt/internal/core/parser/ContextualParser.java | 194 - .../internal/core/parser/DeclarationWrapper.java | 809 --- .../cdt/internal/core/parser/Declarator.java | 451 -- .../cdt/internal/core/parser/IDeclarator.java | 44 - .../cdt/internal/core/parser/IDeclaratorOwner.java | 23 - .../internal/core/parser/IParameterCollection.java | 23 - .../cdt/internal/core/parser/IProblemFactory.java | 26 - .../cdt/internal/core/parser/IScannerContext.java | 81 - .../cdt/internal/core/parser/KeywordSets.java | 167 - .../core/parser/LimitedScannerContext.java | 47 - .../internal/core/parser/LineOffsetReconciler.java | 104 - .../cdt/internal/core/parser/MacroDescriptor.java | 126 - .../cdt/internal/core/parser/OffsetDuple.java | 45 - .../internal/core/parser/ParameterCollection.java | 37 - .../eclipse/cdt/internal/core/parser/Parser.java | 5420 -------------------- .../cdt/internal/core/parser/ParserException.java | 20 - .../cdt/internal/core/parser/Preprocessor.java | 63 - .../eclipse/cdt/internal/core/parser/Problem.java | 118 - .../internal/core/parser/QuickParseCallback.java | 197 - .../cdt/internal/core/parser/QuickParser.java | 69 - .../eclipse/cdt/internal/core/parser/Scanner.java | 2749 ---------- .../cdt/internal/core/parser/ScannerContext.java | 178 - .../core/parser/ScannerProblemFactory.java | 228 - .../core/parser/SimpleDeclarationStrategy.java | 32 - .../core/parser/StructuralParseCallback.java | 247 - .../cdt/internal/core/parser/StructuralParser.java | 77 - .../eclipse/cdt/internal/core/parser/Token.java | 178 - .../cdt/internal/core/parser/TokenDuple.java | 176 - .../eclipse/cdt/internal/core/parser/TypeId.java | 79 - .../core/parser/ast/ASTAbstractDeclaration.java | 124 - .../internal/core/parser/ast/ASTArrayModifier.java | 62 - .../core/parser/ast/ASTCompletionNode.java | 77 - .../internal/core/parser/ast/ASTDesignator.java | 88 - .../cdt/internal/core/parser/ast/ASTInclusion.java | 156 - .../cdt/internal/core/parser/ast/ASTMacro.java | 118 - .../core/parser/ast/ASTQualifiedNamedElement.java | 69 - .../internal/core/parser/ast/BaseASTFactory.java | 67 - .../internal/core/parser/ast/EmptyIterator.java | 44 - .../cdt/internal/core/parser/ast/NamedOffsets.java | 47 - .../cdt/internal/core/parser/ast/Offsets.java | 39 - .../core/parser/ast/complete/ASTASMDefinition.java | 98 - .../ASTAbstractTypeSpecifierDeclaration.java | 120 - .../ast/complete/ASTAnonymousDeclaration.java | 39 - .../core/parser/ast/complete/ASTBaseSpecifier.java | 115 - .../parser/ast/complete/ASTClassReference.java | 78 - .../parser/ast/complete/ASTClassSpecifier.java | 271 - .../core/parser/ast/complete/ASTCodeScope.java | 91 - .../parser/ast/complete/ASTCompilationUnit.java | 82 - .../complete/ASTConstructorMemberInitializer.java | 99 - .../ast/complete/ASTElaboratedTypeSpecifier.java | 171 - .../ast/complete/ASTEnumerationReference.java | 71 - .../ast/complete/ASTEnumerationSpecifier.java | 158 - .../core/parser/ast/complete/ASTEnumerator.java | 141 - .../ast/complete/ASTEnumeratorReference.java | 70 - .../ast/complete/ASTExceptionSpecification.java | 68 - .../core/parser/ast/complete/ASTExpression.java | 260 - .../core/parser/ast/complete/ASTField.java | 70 - .../parser/ast/complete/ASTFieldReference.java | 71 - .../core/parser/ast/complete/ASTFunction.java | 341 -- .../parser/ast/complete/ASTFunctionReference.java | 72 - .../parser/ast/complete/ASTInitializerClause.java | 130 - .../ast/complete/ASTLinkageSpecification.java | 115 - .../core/parser/ast/complete/ASTMethod.java | 195 - .../parser/ast/complete/ASTMethodReference.java | 69 - .../parser/ast/complete/ASTNamespaceAlias.java | 150 - .../ast/complete/ASTNamespaceDefinition.java | 177 - .../parser/ast/complete/ASTNamespaceReference.java | 72 - .../core/parser/ast/complete/ASTNewDescriptor.java | 90 - .../internal/core/parser/ast/complete/ASTNode.java | 148 - .../ast/complete/ASTParameterDeclaration.java | 197 - .../parser/ast/complete/ASTParameterReference.java | 72 - .../core/parser/ast/complete/ASTReference.java | 59 - .../parser/ast/complete/ASTReferenceStore.java | 43 - .../core/parser/ast/complete/ASTScope.java | 51 - .../ast/complete/ASTSimpleTypeSpecifier.java | 150 - .../core/parser/ast/complete/ASTSymbol.java | 40 - .../core/parser/ast/complete/ASTSymbolOwner.java | 43 - .../ast/complete/ASTTemplateDeclaration.java | 124 - .../ast/complete/ASTTemplateInstantiation.java | 106 - .../ast/complete/ASTTemplateSpecialization.java | 106 - .../core/parser/ast/complete/ASTTypeId.java | 229 - .../core/parser/ast/complete/ASTTypedef.java | 170 - .../parser/ast/complete/ASTTypedefReference.java | 69 - .../parser/ast/complete/ASTUsingDeclaration.java | 130 - .../parser/ast/complete/ASTUsingDirective.java | 125 - .../core/parser/ast/complete/ASTVariable.java | 246 - .../parser/ast/complete/ASTVariableReference.java | 72 - .../ast/complete/CompleteParseASTFactory.java | 2812 ---------- .../core/parser/ast/complete/ExpressionResult.java | 59 - .../parser/ast/complete/ExpressionResultList.java | 57 - .../core/parser/ast/quick/ASTASMDefinition.java | 99 - .../quick/ASTAbstractTypeSpecifierDeclaration.java | 117 - .../core/parser/ast/quick/ASTBaseSpecifier.java | 106 - .../core/parser/ast/quick/ASTClassSpecifier.java | 218 - .../core/parser/ast/quick/ASTCompilationUnit.java | 76 - .../ast/quick/ASTConstructorMemberInitializer.java | 68 - .../core/parser/ast/quick/ASTDeclaration.java | 37 - .../ast/quick/ASTElaboratedTypeSpecifier.java | 158 - .../parser/ast/quick/ASTEnumerationSpecifier.java | 151 - .../core/parser/ast/quick/ASTEnumerator.java | 145 - .../ast/quick/ASTExceptionSpecification.java | 67 - .../core/parser/ast/quick/ASTExpression.java | 222 - .../internal/core/parser/ast/quick/ASTField.java | 85 - .../core/parser/ast/quick/ASTFunction.java | 291 -- .../parser/ast/quick/ASTInitializerClause.java | 112 - .../parser/ast/quick/ASTLinkageSpecification.java | 128 - .../internal/core/parser/ast/quick/ASTMethod.java | 213 - .../core/parser/ast/quick/ASTNamespaceAlias.java | 148 - .../parser/ast/quick/ASTNamespaceDefinition.java | 162 - .../core/parser/ast/quick/ASTNewDescriptor.java | 69 - .../internal/core/parser/ast/quick/ASTNode.java | 31 - .../parser/ast/quick/ASTParameterDeclaration.java | 121 - .../parser/ast/quick/ASTScopedTypeSpecifier.java | 50 - .../parser/ast/quick/ASTSimpleTypeSpecifier.java | 195 - .../parser/ast/quick/ASTTemplateDeclaration.java | 139 - .../parser/ast/quick/ASTTemplateInstantiation.java | 122 - .../parser/ast/quick/ASTTemplateParameter.java | 79 - .../ast/quick/ASTTemplateSpecialization.java | 116 - .../internal/core/parser/ast/quick/ASTTypeId.java | 169 - .../parser/ast/quick/ASTTypedefDeclaration.java | 150 - .../core/parser/ast/quick/ASTUsingDeclaration.java | 115 - .../core/parser/ast/quick/ASTUsingDirective.java | 107 - .../core/parser/ast/quick/ASTVariable.java | 231 - .../core/parser/ast/quick/IASTQClassSpecifier.java | 23 - .../internal/core/parser/ast/quick/IASTQScope.java | 23 - .../parser/ast/quick/QuickParseASTFactory.java | 328 -- .../core/parser/pst/AbstractSymbolExtension.java | 45 - .../cdt/internal/core/parser/pst/BasicSymbol.java | 189 - .../internal/core/parser/pst/ContainerSymbol.java | 793 --- .../core/parser/pst/DerivableContainerSymbol.java | 388 -- .../pst/ForewardDeclaredSymbolExtension.java | 109 - .../internal/core/parser/pst/IContainerSymbol.java | 58 - .../core/parser/pst/IDerivableContainerSymbol.java | 58 - .../core/parser/pst/IParameterizedSymbol.java | 54 - .../core/parser/pst/ISpecializedSymbol.java | 27 - .../cdt/internal/core/parser/pst/ISymbol.java | 64 - .../core/parser/pst/ISymbolASTExtension.java | 32 - .../cdt/internal/core/parser/pst/ISymbolOwner.java | 20 - .../core/parser/pst/NamespaceSymbolExtension.java | 99 - .../core/parser/pst/ParameterizedSymbol.java | 290 -- .../core/parser/pst/ParserSymbolTable.java | 2481 --------- .../parser/pst/ParserSymbolTableException.java | 50 - .../core/parser/pst/SpecializedSymbol.java | 30 - .../core/parser/pst/StandardSymbolExtension.java | 94 - .../internal/core/parser/pst/TemplateInstance.java | 134 - .../cdt/internal/core/parser/pst/TypeFilter.java | 114 - .../cdt/internal/core/parser/pst/TypeInfo.java | 527 -- .../cdt/internal/core/parser/util/ASTUtil.java | 238 - core/org.eclipse.cdt.core/plugin.properties | 14 - core/org.eclipse.cdt.core/plugin.xml | 273 - core/org.eclipse.cdt.core/schema/CProject.exsd | 93 - core/org.eclipse.cdt.core/schema/ProcessList.exsd | 93 - core/org.eclipse.cdt.core/search/ChangeLog | 258 - .../eclipse/cdt/core/search/BasicSearchMatch.java | 266 - .../core/search/BasicSearchResultCollector.java | 266 - .../eclipse/cdt/core/search/ICSearchConstants.java | 207 - .../eclipse/cdt/core/search/ICSearchPattern.java | 39 - .../cdt/core/search/ICSearchResultCollector.java | 72 - .../org/eclipse/cdt/core/search/ICSearchScope.java | 46 - .../search/org/eclipse/cdt/core/search/IMatch.java | 46 - .../org/eclipse/cdt/core/search/SearchEngine.java | 213 - .../internal/core/search/AcceptMatchOperation.java | 48 - .../cdt/internal/core/search/CSearchScope.java | 251 - .../cdt/internal/core/search/CWorkspaceScope.java | 92 - .../core/search/IIndexSearchRequestor.java | 87 - .../cdt/internal/core/search/IndexSelector.java | 118 - .../cdt/internal/core/search/PathCollector.java | 168 - .../cdt/internal/core/search/PatternSearchJob.java | 168 - .../core/search/matching/CSearchPattern.java | 716 --- .../search/matching/ClassDeclarationPattern.java | 253 - .../search/matching/FieldDeclarationPattern.java | 195 - .../core/search/matching/IncludePattern.java | 105 - .../search/matching/MacroDeclarationPattern.java | 123 - .../core/search/matching/MatchLocator.java | 582 --- .../search/matching/MethodDeclarationPattern.java | 186 - .../matching/NamespaceDeclarationPattern.java | 153 - .../internal/core/search/matching/OrPattern.java | 118 - .../cdt/internal/core/search/processing/IJob.java | 50 - .../core/search/processing/JobManager.java | 451 -- .../org/eclipse/cdt/core/AbstractCExtension.java | 30 - .../src/org/eclipse/cdt/core/CCProjectNature.java | 41 - .../src/org/eclipse/cdt/core/CConventions.java | 137 - .../src/org/eclipse/cdt/core/CCorePlugin.java | 774 --- .../src/org/eclipse/cdt/core/CProjectNature.java | 109 - .../src/org/eclipse/cdt/core/CommandLauncher.java | 243 - .../org/eclipse/cdt/core/ConsoleOutputStream.java | 41 - .../org/eclipse/cdt/core/ErrorParserManager.java | 445 -- .../src/org/eclipse/cdt/core/IBinaryParser.java | 98 - .../src/org/eclipse/cdt/core/ICDescriptor.java | 31 - .../src/org/eclipse/cdt/core/ICExtension.java | 18 - .../org/eclipse/cdt/core/ICExtensionReference.java | 43 - .../src/org/eclipse/cdt/core/ICLogConstants.java | 30 - .../src/org/eclipse/cdt/core/ICOwner.java | 18 - .../src/org/eclipse/cdt/core/ICOwnerInfo.java | 17 - .../src/org/eclipse/cdt/core/IErrorParser.java | 15 - .../src/org/eclipse/cdt/core/IMarkerGenerator.java | 15 - .../src/org/eclipse/cdt/core/IProcessInfo.java | 10 - .../src/org/eclipse/cdt/core/IProcessList.java | 9 - .../core/parser/IScannerInfoChangeListener.java | 26 - .../cdt/core/parser/IScannerInfoProvider.java | 44 - .../org/eclipse/cdt/core/parser/ParserUtil.java | 27 - .../org/eclipse/cdt/core/resources/ACBuilder.java | 74 - .../eclipse/cdt/core/resources/FileStorage.java | 78 - .../org/eclipse/cdt/core/resources/IConsole.java | 17 - .../internal/core/CCorePluginResources.properties | 7 - .../eclipse/cdt/internal/core/CDTLogWriter.java | 216 - .../org/eclipse/cdt/internal/core/CDescriptor.java | 460 -- .../cdt/internal/core/CDescriptorManager.java | 142 - .../eclipse/cdt/internal/core/CExtensionInfo.java | 35 - .../cdt/internal/core/CExtensionReference.java | 52 - .../src/org/eclipse/cdt/internal/core/COwner.java | 88 - .../cdt/internal/core/InternalCExtension.java | 36 - .../eclipse/cdt/internal/core/ProcessClosure.java | 189 - .../cdt/internal/core/parser/ParserLogService.java | 41 - .../cdt/internal/errorparsers/GASErrorParser.java | 56 - .../cdt/internal/errorparsers/GCCErrorParser.java | 236 - .../cdt/internal/errorparsers/GLDErrorParser.java | 69 - .../cdt/internal/errorparsers/MakeErrorParser.java | 75 - .../cdt/internal/errorparsers/VCErrorParser.java | 54 - .../cdt/internal/formatter/CCodeFormatter.java | 24 - .../utils/org/eclipse/cdt/utils/Addr2line.java | 114 - .../utils/org/eclipse/cdt/utils/CPPFilt.java | 54 - .../utils/org/eclipse/cdt/utils/CygPath.java | 53 - .../eclipse/cdt/utils/ICygwinToolsProvider.java | 19 - .../org/eclipse/cdt/utils/IToolsProvider.java | 23 - .../utils/org/eclipse/cdt/utils/coff/Coff.java | 583 --- .../utils/org/eclipse/cdt/utils/coff/Exe.java | 159 - .../utils/org/eclipse/cdt/utils/coff/PE.java | 637 --- .../org/eclipse/cdt/utils/coff/PEArchive.java | 328 -- .../org/eclipse/cdt/utils/coff/PEConstants.java | 115 - .../eclipse/cdt/utils/coff/ReadMemoryAccess.java | 289 -- .../eclipse/cdt/utils/coff/parser/ARMember.java | 90 - .../cdt/utils/coff/parser/BinaryArchive.java | 88 - .../cdt/utils/coff/parser/BinaryExecutable.java | 41 - .../eclipse/cdt/utils/coff/parser/BinaryFile.java | 103 - .../cdt/utils/coff/parser/BinaryObject.java | 285 - .../cdt/utils/coff/parser/BinaryShared.java | 51 - .../cdt/utils/coff/parser/CygwinPEParser.java | 108 - .../eclipse/cdt/utils/coff/parser/PEParser.java | 108 - .../org/eclipse/cdt/utils/coff/parser/Symbol.java | 152 - .../utils/org/eclipse/cdt/utils/elf/AR.java | 334 -- .../eclipse/cdt/utils/elf/ERandomAccessFile.java | 75 - .../utils/org/eclipse/cdt/utils/elf/Elf.java | 921 ---- .../utils/org/eclipse/cdt/utils/elf/ElfHelper.java | 359 -- .../eclipse/cdt/utils/elf/SymbolSortCompare.java | 24 - .../org/eclipse/cdt/utils/elf/parser/ARMember.java | 80 - .../cdt/utils/elf/parser/BinaryArchive.java | 87 - .../cdt/utils/elf/parser/BinaryExecutable.java | 50 - .../eclipse/cdt/utils/elf/parser/BinaryFile.java | 97 - .../eclipse/cdt/utils/elf/parser/BinaryObject.java | 298 -- .../eclipse/cdt/utils/elf/parser/BinaryShared.java | 50 - .../eclipse/cdt/utils/elf/parser/ElfParser.java | 78 - .../eclipse/cdt/utils/elf/parser/GNUElfParser.java | 87 - .../org/eclipse/cdt/utils/elf/parser/Symbol.java | 149 - .../utils/org/eclipse/cdt/utils/pty/PTY.java | 75 - .../org/eclipse/cdt/utils/pty/PTYInputStream.java | 80 - .../org/eclipse/cdt/utils/pty/PTYOutputStream.java | 76 - .../cdt/utils/spawner/EnvironmentReader.java | 89 - .../eclipse/cdt/utils/spawner/ProcessFactory.java | 73 - .../org/eclipse/cdt/utils/spawner/Spawner.java | 290 -- .../cdt/utils/spawner/SpawnerInputStream.java | 80 - .../cdt/utils/spawner/SpawnerOutputStream.java | 73 - .../org/eclipse/cdt/utils/stabs/StabConstant.java | 157 - .../utils/org/eclipse/cdt/utils/stabs/Stabs.java | 458 -- .../eclipse/cdt/utils/stabs/StabsAddr2line.java | 127 - core/org.eclipse.cdt.ui.tests/.classpath | 9 - core/org.eclipse.cdt.ui.tests/.cvsignore | 1 - core/org.eclipse.cdt.ui.tests/.project | 30 - core/org.eclipse.cdt.ui.tests/ChangeLog | 599 --- core/org.eclipse.cdt.ui.tests/about.html | 44 - core/org.eclipse.cdt.ui.tests/build.properties | 13 - .../ui/tests/textmanipulation/TextBufferTest.java | 472 -- core/org.eclipse.cdt.ui.tests/plugin.xml | 25 - .../eclipse/cdt/testplugin/CElementDecorator.java | 30 - .../org/eclipse/cdt/testplugin/CTestPlugin.java | 58 - .../src/org/eclipse/cdt/testplugin/CTestSetup.java | 31 - .../src/org/eclipse/cdt/testplugin/Main.java | 528 -- .../src/org/eclipse/cdt/testplugin/NewMain.java | 73 - .../eclipse/cdt/testplugin/TestPluginLauncher.java | 57 - .../cdt/testplugin/util/AccessibilityTestPass.java | 66 - .../cdt/testplugin/util/ExpectedStrings.java | 96 - .../cdt/testplugin/util/ExpectedStringsTests.java | 114 - .../eclipse/cdt/testplugin/util/FailureDialog.java | 107 - .../eclipse/cdt/testplugin/util/FocusTestPass.java | 68 - .../cdt/testplugin/util/IDialogTestPass.java | 48 - .../cdt/testplugin/util/SizingTestPass.java | 76 - .../eclipse/cdt/testplugin/util/VerifyDialog.java | 305 -- core/org.eclipse.cdt.ui.tests/test.xml | 56 - .../org/eclipse/cdt/ui/tests/AutomatedSuite.java | 40 - .../ui/tests/text/PartitionTokenScannerTest.java | 253 - .../ui/org/eclipse/cdt/ui/tests/text/TestCase.txt | 43 - .../ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt | 68 - core/org.eclipse.cdt.ui/.classpath | 8 - core/org.eclipse.cdt.ui/.cvsignore | 2 - core/org.eclipse.cdt.ui/.project | 29 - core/org.eclipse.cdt.ui/ChangeLog | 2198 -------- core/org.eclipse.cdt.ui/about.html | 30 - core/org.eclipse.cdt.ui/build.properties | 16 - .../icons/full/build16/action-buildconfig.gif | Bin 940 -> 0 bytes .../icons/full/build16/action-deleteconfig.gif | Bin 936 -> 0 bytes .../icons/full/build16/action-editconfig.gif | Bin 942 -> 0 bytes .../icons/full/build16/action-newconfig.gif | Bin 941 -> 0 bytes .../icons/full/build16/build_configs.gif | Bin 940 -> 0 bytes .../icons/full/build16/config-category.gif | Bin 902 -> 0 bytes .../icons/full/build16/config-compiler.gif | Bin 157 -> 0 bytes .../icons/full/build16/config-debug.gif | Bin 166 -> 0 bytes .../icons/full/build16/config-librarian.gif | Bin 171 -> 0 bytes .../icons/full/build16/config-linker.gif | Bin 130 -> 0 bytes .../icons/full/build16/config-preprocessor.gif | Bin 167 -> 0 bytes .../icons/full/build16/config-profile.gif | Bin 193 -> 0 bytes .../icons/full/build16/config-release.gif | Bin 166 -> 0 bytes .../icons/full/build16/config-tool.gif | Bin 891 -> 0 bytes .../icons/full/clcl16/alphab_sort_co.gif | Bin 224 -> 0 bytes .../icons/full/clcl16/clear_co.gif | Bin 162 -> 0 bytes .../icons/full/clcl16/collapseall.gif | Bin 88 -> 0 bytes .../icons/full/clcl16/fields_co.gif | Bin 160 -> 0 bytes .../icons/full/clcl16/metharg_obj.gif | Bin 163 -> 0 bytes .../icons/full/clcl16/open_incl.gif | Bin 155 -> 0 bytes .../icons/full/clcl16/public_co.gif | Bin 97 -> 0 bytes .../icons/full/clcl16/search_sortmatch.gif | Bin 160 -> 0 bytes .../icons/full/clcl16/segment_edit.gif | Bin 158 -> 0 bytes .../icons/full/clcl16/shift_l_edit.gif | Bin 146 -> 0 bytes .../icons/full/clcl16/shift_r_edit.gif | Bin 149 -> 0 bytes .../icons/full/clcl16/static_co.gif | Bin 111 -> 0 bytes .../icons/full/ctool16/convert-normal.gif | Bin 329 -> 0 bytes .../icons/full/ctool16/newc_app.gif | Bin 582 -> 0 bytes .../icons/full/ctool16/newc_lib.gif | Bin 381 -> 0 bytes .../icons/full/ctool16/newcc_app.gif | Bin 585 -> 0 bytes .../icons/full/ctool16/newcc_lib.gif | Bin 368 -> 0 bytes .../icons/full/ctool16/newclass_wiz.gif | Bin 238 -> 0 bytes .../icons/full/ctool16/newcprj_wiz.gif | Bin 360 -> 0 bytes .../icons/full/ctool16/newfile_wiz.gif | Bin 227 -> 0 bytes .../icons/full/ctool16/newfolder_wiz.gif | Bin 182 -> 0 bytes .../icons/full/ctool16/next_error_nav.gif | Bin 160 -> 0 bytes .../icons/full/ctool16/prev_error_nav.gif | Bin 160 -> 0 bytes .../icons/full/ctool16/prj_obj.gif | Bin 159 -> 0 bytes .../icons/full/ctool16/prop_edt.gif | Bin 571 -> 0 bytes .../icons/full/cview16/buildconsole.gif | Bin 175 -> 0 bytes .../icons/full/cview16/c_pers.gif | Bin 245 -> 0 bytes .../icons/full/cview16/cview.gif | Bin 256 -> 0 bytes .../icons/full/dlcl16/alphab_sort_co.gif | Bin 99 -> 0 bytes .../icons/full/dlcl16/clear_co.gif | Bin 91 -> 0 bytes .../icons/full/dlcl16/collapseall.gif | Bin 88 -> 0 bytes .../icons/full/dlcl16/fields_co.gif | Bin 95 -> 0 bytes .../icons/full/dlcl16/metharg_obj.gif | Bin 92 -> 0 bytes .../icons/full/dlcl16/open_incl.gif | Bin 90 -> 0 bytes .../icons/full/dlcl16/public_co.gif | Bin 69 -> 0 bytes .../icons/full/dlcl16/segment_edit.gif | Bin 89 -> 0 bytes .../icons/full/dlcl16/shift_l_edit.gif | Bin 92 -> 0 bytes .../icons/full/dlcl16/shift_r_edit.gif | Bin 90 -> 0 bytes .../icons/full/dlcl16/static_co.gif | Bin 89 -> 0 bytes .../icons/full/dtool16/newclass_wiz.gif | Bin 104 -> 0 bytes .../icons/full/dtool16/newcprj_wiz.gif | Bin 104 -> 0 bytes .../icons/full/dtool16/newfile_wiz.gif | Bin 104 -> 0 bytes .../icons/full/dtool16/next_error_nav.gif | Bin 99 -> 0 bytes .../icons/full/dtool16/prev_error_nav.gif | Bin 100 -> 0 bytes .../icons/full/elcl16/alphab_sort_co.gif | Bin 160 -> 0 bytes .../icons/full/elcl16/clear_co.gif | Bin 122 -> 0 bytes .../icons/full/elcl16/collapseall.gif | Bin 88 -> 0 bytes .../icons/full/elcl16/fields_co.gif | Bin 127 -> 0 bytes .../icons/full/elcl16/metharg_obj.gif | Bin 133 -> 0 bytes .../icons/full/elcl16/open_incl.gif | Bin 122 -> 0 bytes .../icons/full/elcl16/public_co.gif | Bin 97 -> 0 bytes .../icons/full/elcl16/segment_edit.gif | Bin 121 -> 0 bytes .../icons/full/elcl16/shift_l_edit.gif | Bin 118 -> 0 bytes .../icons/full/elcl16/shift_r_edit.gif | Bin 118 -> 0 bytes .../icons/full/elcl16/static_co.gif | Bin 149 -> 0 bytes .../icons/full/etool16/newclass_wiz.gif | Bin 143 -> 0 bytes .../icons/full/etool16/newcprj_wiz.gif | Bin 183 -> 0 bytes .../icons/full/etool16/newfile_wiz.gif | Bin 173 -> 0 bytes .../icons/full/etool16/next_error_nav.gif | Bin 126 -> 0 bytes .../icons/full/etool16/prev_error_nav.gif | Bin 127 -> 0 bytes .../icons/full/eview16/buildconsole.gif | Bin 175 -> 0 bytes .../icons/full/eview16/c_pers.gif | Bin 177 -> 0 bytes .../org.eclipse.cdt.ui/icons/full/obj16/ar_obj.gif | Bin 173 -> 0 bytes .../icons/full/obj16/bin_obj.gif | Bin 218 -> 0 bytes .../icons/full/obj16/breakpoint.gif | Bin 198 -> 0 bytes .../icons/full/obj16/breakpoint_active.gif | Bin 319 -> 0 bytes .../icons/full/obj16/breakpoint_disabled.gif | Bin 197 -> 0 bytes .../icons/full/obj16/build_menu.gif | Bin 161 -> 0 bytes .../icons/full/obj16/c_file_obj.gif | Bin 165 -> 0 bytes .../icons/full/obj16/cdeclaration_obj.gif | Bin 146 -> 0 bytes .../icons/full/obj16/cfolder_obj.gif | Bin 156 -> 0 bytes .../icons/full/obj16/class_obj.gif | Bin 160 -> 0 bytes .../icons/full/obj16/container_obj.gif | Bin 122 -> 0 bytes .../icons/full/obj16/core_obj.gif | Bin 887 -> 0 bytes .../icons/full/obj16/csearch_obj.gif | Bin 959 -> 0 bytes .../icons/full/obj16/define_obj.gif | Bin 109 -> 0 bytes .../icons/full/obj16/enum_obj.gif | Bin 910 -> 0 bytes .../icons/full/obj16/enumerator_obj.gif | Bin 853 -> 0 bytes .../icons/full/obj16/exec_dbg_obj.gif | Bin 166 -> 0 bytes .../icons/full/obj16/exec_obj.gif | Bin 125 -> 0 bytes .../icons/full/obj16/field_obj.gif | Bin 76 -> 0 bytes .../icons/full/obj16/field_private_obj.gif | Bin 88 -> 0 bytes .../icons/full/obj16/field_protected_obj.gif | Bin 88 -> 0 bytes .../icons/full/obj16/field_public_obj.gif | Bin 92 -> 0 bytes .../icons/full/obj16/function_obj.gif | Bin 97 -> 0 bytes .../icons/full/obj16/h_file_obj.gif | Bin 900 -> 0 bytes .../icons/full/obj16/include_obj.gif | Bin 114 -> 0 bytes .../icons/full/obj16/lib_obj.gif | Bin 171 -> 0 bytes .../icons/full/obj16/method_private_obj.gif | Bin 94 -> 0 bytes .../icons/full/obj16/method_protected_obj.gif | Bin 92 -> 0 bytes .../icons/full/obj16/method_public_obj.gif | Bin 97 -> 0 bytes .../icons/full/obj16/search_decl_obj.gif | Bin 157 -> 0 bytes .../icons/full/obj16/search_ref_obj.gif | Bin 151 -> 0 bytes .../icons/full/obj16/search_sortmatch.gif | Bin 160 -> 0 bytes .../icons/full/obj16/shlib_obj.gif | Bin 161 -> 0 bytes .../icons/full/obj16/struct_obj.gif | Bin 133 -> 0 bytes .../icons/full/obj16/template_obj.gif | Bin 917 -> 0 bytes .../icons/full/obj16/typedef_obj.gif | Bin 910 -> 0 bytes .../icons/full/obj16/union_obj.gif | Bin 173 -> 0 bytes .../icons/full/obj16/var_declaration_obj.gif | Bin 895 -> 0 bytes .../icons/full/obj16/variable_local_obj.gif | Bin 94 -> 0 bytes .../icons/full/obj16/variable_obj.gif | Bin 78 -> 0 bytes core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif | Bin 826 -> 0 bytes .../icons/full/ovr16/error_co.gif | Bin 84 -> 0 bytes .../icons/full/ovr16/static_co.gif | Bin 833 -> 0 bytes .../icons/full/ovr16/template_co.gif | Bin 828 -> 0 bytes .../icons/full/ovr16/volatile_co.gif | Bin 833 -> 0 bytes .../icons/full/ovr16/warning_co.gif | Bin 116 -> 0 bytes .../icons/full/wizban/c_app_wiz.gif | Bin 3192 -> 0 bytes .../icons/full/wizban/newclass_wiz.gif | Bin 2328 -> 0 bytes .../icons/full/wizban/newcprj_wiz.gif | Bin 3192 -> 0 bytes .../icons/full/wizban/newmngc_app.gif | Bin 416 -> 0 bytes .../icons/full/wizban/newmngcc_app.gif | Bin 425 -> 0 bytes .../icons/full/wizban/prj_obj.gif | Bin 159 -> 0 bytes core/org.eclipse.cdt.ui/plugin.properties | 96 - core/org.eclipse.cdt.ui/plugin.xml | 511 -- .../cdt/internal/corext/template/ContextType.java | 167 - .../corext/template/ContextTypeRegistry.java | 79 - .../corext/template/DocumentTemplateContext.java | 70 - .../internal/corext/template/ITemplateEditor.java | 34 - .../corext/template/SimpleTemplateVariable.java | 55 - .../cdt/internal/corext/template/Template.java | 160 - .../internal/corext/template/TemplateBuffer.java | 64 - .../internal/corext/template/TemplateContext.java | 42 - .../internal/corext/template/TemplateMessages.java | 44 - .../corext/template/TemplateMessages.properties | 106 - .../internal/corext/template/TemplatePosition.java | 97 - .../cdt/internal/corext/template/TemplateSet.java | 295 -- .../corext/template/TemplateTranslator.java | 215 - .../internal/corext/template/TemplateVariable.java | 65 - .../cdt/internal/corext/template/Templates.java | 97 - .../cdt/internal/corext/template/c/CContext.java | 102 - .../cdt/internal/corext/template/c/CFormatter.java | 197 - .../corext/template/c/CFunctionContextType.java | 50 - .../corext/template/c/CGlobalContextType.java | 50 - .../corext/template/c/CStructureContextType.java | 51 - .../corext/template/c/CompilationUnitContext.java | 66 - .../template/c/CompilationUnitContextType.java | 180 - .../corext/template/c/CppFunctionContextType.java | 45 - .../corext/template/c/CppGlobalContextType.java | 47 - .../corext/template/c/CppStructureContextType.java | 45 - .../corext/template/c/GlobalVariables.java | 80 - .../corext/template/c/ICompilationUnit.java | 11 - .../corext/template/c/TemplateMessages.java | 46 - .../corext/template/c/TemplateMessages.properties | 29 - .../internal/corext/template/default-templates.xml | 125 - .../corext/textmanipulation/ISourceRange.java | 28 - .../corext/textmanipulation/Messages.properties | 17 - .../corext/textmanipulation/MoveTextEdit.java | 146 - .../corext/textmanipulation/MultiTextEdit.java | 136 - .../corext/textmanipulation/NopTextEdit.java | 61 - .../corext/textmanipulation/SimpleTextEdit.java | 106 - .../corext/textmanipulation/SwapTextEdit.java | 25 - .../corext/textmanipulation/TextBuffer.java | 451 -- .../corext/textmanipulation/TextBufferEditor.java | 218 - .../corext/textmanipulation/TextBufferFactory.java | 192 - .../internal/corext/textmanipulation/TextEdit.java | 106 - .../corext/textmanipulation/TextEditNode.java | 496 -- .../textmanipulation/TextEditNodeComparator.java | 48 - .../textmanipulation/TextManipulationMessages.java | 42 - .../corext/textmanipulation/TextRange.java | 196 - .../corext/textmanipulation/TextRegion.java | 37 - .../internal/corext/textmanipulation/TextUtil.java | 147 - .../corext/textmanipulation/UndoMemento.java | 29 - .../internal/ui/BaseCElementContentProvider.java | 288 -- .../cdt/internal/ui/BinaryPropertySource.java | 182 - .../org/eclipse/cdt/internal/ui/BuildConsole.java | 41 - .../cdt/internal/ui/BuildConsoleManager.java | 238 - .../internal/ui/CCompletionContributorManager.java | 118 - .../cdt/internal/ui/CElementAdapterFactory.java | 79 - .../cdt/internal/ui/CElementImageProvider.java | 480 -- .../cdt/internal/ui/CElementProperties.java | 80 - .../cdt/internal/ui/CElementPropertySource.java | 80 - .../cdt/internal/ui/CFileElementWorkingCopy.java | 231 - .../cdt/internal/ui/CPerspectiveFactory.java | 67 - .../org/eclipse/cdt/internal/ui/CPluginImages.java | 228 - .../cdt/internal/ui/CPluginResources.properties | 332 -- .../eclipse/cdt/internal/ui/CStatusConstants.java | 30 - .../org/eclipse/cdt/internal/ui/CUIException.java | 22 - .../org/eclipse/cdt/internal/ui/CUIMessages.java | 43 - .../eclipse/cdt/internal/ui/CUIMessages.properties | 19 - .../src/org/eclipse/cdt/internal/ui/CUIStatus.java | 23 - .../eclipse/cdt/internal/ui/CWorkbenchAdapter.java | 73 - .../org/eclipse/cdt/internal/ui/ConsoleEvent.java | 29 - .../cdt/internal/ui/DocumentInputStream.java | 42 - .../internal/ui/ErrorTickAdornmentProvider.java | 136 - .../cdt/internal/ui/IAdornmentProvider.java | 27 - .../internal/ui/ICElementPropertyConstants.java | 49 - .../eclipse/cdt/internal/ui/ICHelpContextIds.java | 61 - .../cdt/internal/ui/IContextMenuConstants.java | 102 - .../cdt/internal/ui/ResourceAdapterFactory.java | 57 - .../internal/ui/StandardCElementLabelProvider.java | 91 - .../cdt/internal/ui/actions/ActionMessages.java | 71 - .../internal/ui/actions/ActionMessages.properties | 274 - .../ui/actions/WorkbenchRunnableAdapter.java | 52 - .../ui/buildconsole/BuildConsoleAction.java | 52 - .../internal/ui/buildconsole/BuildConsoleView.java | 313 -- .../ui/buildconsole/ClearConsoleAction.java | 39 - .../ui/codemanipulation/AddIncludeOperation.java | 151 - .../internal/ui/codemanipulation/StubUtility.java | 36 - .../internal/ui/compare/CContentViewerCreator.java | 27 - .../cdt/internal/ui/compare/CMergeViewer.java | 53 - .../org/eclipse/cdt/internal/ui/compare/CNode.java | 56 - .../cdt/internal/ui/compare/CParseTreeBuilder.java | 310 -- .../cdt/internal/ui/compare/CStructureCreator.java | 173 - .../ui/compare/SourceElementRequestorAdapter.java | 334 -- .../cdt/internal/ui/cview/CElementFilters.java | 132 - .../eclipse/cdt/internal/ui/cview/CLibFilter.java | 40 - .../cdt/internal/ui/cview/CPatternFilter.java | 123 - .../org/eclipse/cdt/internal/ui/cview/CView.java | 1373 ----- .../cdt/internal/ui/cview/CViewDropAdapter.java | 446 -- .../cdt/internal/ui/cview/CViewFrameSource.java | 31 - .../cdt/internal/ui/cview/CViewMessages.java | 58 - .../cdt/internal/ui/cview/CViewMessages.properties | 16 - .../eclipse/cdt/internal/ui/cview/CViewSorter.java | 191 - .../cdt/internal/ui/cview/CollapseAllAction.java | 37 - .../cdt/internal/ui/cview/DefaultAction.java | 28 - .../internal/ui/cview/FilterSelectionAction.java | 90 - .../internal/ui/cview/FiltersContentProvider.java | 104 - .../cdt/internal/ui/cview/ShowLibrariesAction.java | 69 - .../AbstractElementListSelectionDialog.java | 277 - .../ui/dialogs/ElementListSelectionDialog.java | 114 - .../internal/ui/dialogs/ISelectionValidator.java | 10 - .../internal/ui/dialogs/IStatusChangeListener.java | 16 - .../cdt/internal/ui/dialogs/MessageLine.java | 126 - .../cdt/internal/ui/dialogs/SelectionList.java | 250 - .../internal/ui/dialogs/SelectionStatusDialog.java | 187 - .../cdt/internal/ui/dialogs/StatusDialog.java | 163 - .../cdt/internal/ui/dialogs/StatusInfo.java | 102 - .../cdt/internal/ui/dialogs/StatusTool.java | 73 - .../cdt/internal/ui/dialogs/StatusUtil.java | 75 - .../internal/ui/drag/DelegatingDragAdapter.java | 140 - .../internal/ui/drag/FileTransferDragAdapter.java | 186 - .../ui/drag/LocalSelectionTransferDragAdapter.java | 60 - .../ui/drag/ResourceTransferDragAdapter.java | 147 - .../ui/drag/TransferDragSourceListener.java | 24 - .../ui/editor/AddIncludeOnSelectionAction.java | 190 - .../internal/ui/editor/CContentOutlinePage.java | 333 -- .../cdt/internal/ui/editor/CDocumentProvider.java | 425 -- .../eclipse/cdt/internal/ui/editor/CEditor.java | 941 ---- .../ui/editor/CEditorActionContributor.java | 203 - .../ui/editor/CEditorErrorTickUpdater.java | 98 - .../cdt/internal/ui/editor/CEditorMessages.java | 43 - .../internal/ui/editor/CEditorMessages.properties | 136 - .../ui/editor/CEditorTextHoverDispatcher.java | 60 - .../cdt/internal/ui/editor/CMarkerAnnotation.java | 263 - .../internal/ui/editor/CMarkerAnnotationModel.java | 76 - .../ui/editor/CTextEditorActionConstants.java | 25 - .../ui/editor/DefaultCEditorTextHover.java | 135 - .../cdt/internal/ui/editor/DocumentAdapter.java | 486 -- .../cdt/internal/ui/editor/FileSearchAction.java | 160 - .../ui/editor/FileSearchActionInWorkingSet.java | 157 - .../cdt/internal/ui/editor/GotoErrorAction.java | 42 - .../ui/editor/ICEditorActionDefinitionIds.java | 57 - .../cdt/internal/ui/editor/IPositionManager.java | 18 - .../cdt/internal/ui/editor/IProblemAnnotation.java | 28 - .../internal/ui/editor/LexicalSortingAction.java | 82 - .../internal/ui/editor/OpenDeclarationsAction.java | 251 - .../cdt/internal/ui/editor/OpenIncludeAction.java | 212 - .../ui/editor/ProblemAnnotationIterator.java | 62 - .../cdt/internal/ui/editor/SearchDialogAction.java | 179 - .../cdt/internal/ui/editor/SharedTextColors.java | 79 - .../ui/editor/TogglePresentationAction.java | 134 - .../cdt/internal/ui/editor/WorkingCopyManager.java | 107 - .../cdt/internal/ui/editor/asm/AsmCodeScanner.java | 192 - .../ui/editor/asm/AsmPartitionScanner.java | 133 - .../editor/asm/AsmSourceViewerConfiguration.java | 106 - .../cdt/internal/ui/editor/asm/AsmTextEditor.java | 164 - .../cdt/internal/ui/editor/asm/AsmTextTools.java | 226 - .../internal/ui/editor/asm/AsmWordDetector.java | 54 - .../ui/preferences/BuildConsolePreferencePage.java | 98 - .../ui/preferences/CEditorPreferencePage.java | 1227 ----- .../ui/preferences/CPluginPreferencePage.java | 100 - .../cdt/internal/ui/preferences/ColorEditor.java | 118 - .../ui/preferences/ColorSettingPreviewCode.txt | 10 - .../ui/preferences/EditTemplateDialog.java | 540 -- .../ui/preferences/OptionsConfigurationBlock.java | 477 -- .../ui/preferences/OverlayPreferenceStore.java | 447 -- .../ui/preferences/PreferencesMessages.java | 41 - .../ui/preferences/PreferencesMessages.properties | 86 - .../ui/preferences/TemplatePreferencePage.java | 591 --- .../ui/preferences/TodoTaskConfigurationBlock.java | 305 -- .../ui/preferences/TodoTaskInputDialog.java | 162 - .../ui/preferences/TodoTaskPreferencePage.java | 99 - .../ui/preferences/TodoTaskPropertyPage.java | 219 - .../cdt/internal/ui/search/CElementLabels.java | 362 -- .../cdt/internal/ui/search/CSearchMessages.java | 72 - .../internal/ui/search/CSearchMessages.properties | 172 - .../cdt/internal/ui/search/CSearchOperation.java | 154 - .../cdt/internal/ui/search/CSearchPage.java | 671 --- .../internal/ui/search/CSearchResultCollector.java | 161 - .../internal/ui/search/CSearchScopeFactory.java | 138 - .../cdt/internal/ui/search/CSearchUtil.java | 82 - .../internal/ui/search/CSearchViewActionGroup.java | 35 - .../cdt/internal/ui/search/ElementNameSorter.java | 93 - .../cdt/internal/ui/search/GotoMarkerAction.java | 94 - .../cdt/internal/ui/search/GroupByKeyComputer.java | 46 - .../internal/ui/search/OpenCSearchPageAction.java | 54 - .../cdt/internal/ui/search/ParentNameSorter.java | 100 - .../cdt/internal/ui/search/PathNameSorter.java | 109 - .../cdt/internal/ui/text/AbstractCScanner.java | 219 - .../internal/ui/text/BufferedDocumentScanner.java | 159 - .../cdt/internal/ui/text/CAnnotationHover.java | 162 - .../cdt/internal/ui/text/CAutoIndentStrategy.java | 225 - .../eclipse/cdt/internal/ui/text/CCodeReader.java | 230 - .../eclipse/cdt/internal/ui/text/CCodeScanner.java | 140 - .../ui/text/CCommentAutoIndentStrategy.java | 105 - .../cdt/internal/ui/text/CCommentScanner.java | 153 - .../cdt/internal/ui/text/CDoubleClickSelector.java | 213 - .../cdt/internal/ui/text/CFormattingStrategy.java | 83 - .../eclipse/cdt/internal/ui/text/CPairMatcher.java | 243 - .../internal/ui/text/CParameterListValidator.java | 220 - .../cdt/internal/ui/text/CPartitionScanner.java | 128 - .../cdt/internal/ui/text/CReconcilingStrategy.java | 88 - .../ui/text/CSourceViewerConfiguration.java | 393 -- .../eclipse/cdt/internal/ui/text/CTextTools.java | 240 - .../eclipse/cdt/internal/ui/text/CWordFinder.java | 206 - .../cdt/internal/ui/text/CppCodeScanner.java | 144 - .../internal/ui/text/FastCPartitionScanner.java | 485 -- .../cdt/internal/ui/text/HTML2TextReader.java | 255 - .../eclipse/cdt/internal/ui/text/HTMLPrinter.java | 110 - .../cdt/internal/ui/text/HTMLTextPresenter.java | 185 - .../cdt/internal/ui/text/ICColorConstants.java | 37 - .../cdt/internal/ui/text/IColorManager.java | 48 - .../internal/ui/text/IColorManagerExtension.java | 34 - .../cdt/internal/ui/text/LineBreakingReader.java | 106 - .../cdt/internal/ui/text/PreprocessorRule.java | 117 - .../cdt/internal/ui/text/SingleCharReader.java | 57 - .../cdt/internal/ui/text/SingleTokenCScanner.java | 106 - .../internal/ui/text/SubstitutionTextReader.java | 134 - .../text/contentassist/CCompletionProcessor.java | 673 --- .../ui/text/contentassist/CCompletionProposal.java | 468 -- .../CCompletionProposalComparator.java | 44 - .../ui/text/contentassist/CompletionEngine.java | 844 --- .../contentassist/CompletionRequestorAdaptor.java | 148 - .../ContentAssistElementRequestor.java | 18 - .../contentassist/ContentAssistPreference.java | 229 - .../text/contentassist/ICompletionRequestor.java | 37 - .../ui/text/contentassist/RelevanceConstants.java | 35 - .../ui/text/contentassist/ResultCollector.java | 495 -- .../ui/text/link/LinkedPositionListener.java | 31 - .../ui/text/link/LinkedPositionManager.java | 449 -- .../ui/text/link/LinkedPositionMessages.java | 44 - .../ui/text/link/LinkedPositionMessages.properties | 9 - .../internal/ui/text/link/LinkedPositionUI.java | 547 -- .../ui/text/template/TemplateContentProvider.java | 39 - .../internal/ui/text/template/TemplateEngine.java | 92 - .../ui/text/template/TemplateLabelProvider.java | 72 - .../ui/text/template/TemplateProposal.java | 225 - .../text/template/TemplateVariableProcessor.java | 135 - .../ui/text/template/TemplateVariableProposal.java | 103 - .../cdt/internal/ui/text/util/CColorManager.java | 106 - .../internal/ui/text/util/CWhitespaceDetector.java | 22 - .../cdt/internal/ui/text/util/CWordDetector.java | 29 - .../cdt/internal/ui/util/DeleteTaskAction.java | 86 - .../cdt/internal/ui/util/EditorUtility.java | 330 -- .../cdt/internal/ui/util/ExceptionHandler.java | 137 - .../cdt/internal/ui/util/ExternalEditorInput.java | 104 - .../internal/ui/util/IProblemChangedListener.java | 22 - .../internal/ui/util/ImageDescriptorRegistry.java | 87 - .../cdt/internal/ui/util/PixelConverter.java | 58 - .../cdt/internal/ui/util/ProblemItemMapper.java | 195 - .../cdt/internal/ui/util/ProblemMarkerManager.java | 149 - .../cdt/internal/ui/util/ProblemTreeViewer.java | 137 - .../org/eclipse/cdt/internal/ui/util/SWTUtil.java | 122 - .../cdt/internal/ui/util/SelectionUtil.java | 118 - .../cdt/internal/ui/util/StringMatcher.java | 390 -- .../org/eclipse/cdt/internal/ui/util/Strings.java | 375 -- .../cdt/internal/ui/util/TableLayoutComposite.java | 171 - .../cdt/internal/ui/util/TwoArrayQuickSort.java | 69 - .../cdt/internal/ui/viewsupport/MemberFilter.java | 81 - .../ui/viewsupport/MemberFilterAction.java | 50 - .../internal/ui/wizards/IStatusChangeListener.java | 23 - .../cdt/internal/ui/wizards/NewWizardMessages.java | 51 - .../ui/wizards/NewWizardMessages.properties | 595 --- .../ui/wizards/OpenNewFileWizardAction.java | 68 - .../ui/wizards/OpenNewFolderWizardAction.java | 65 - .../dialogfields/CheckedListDialogField.java | 216 - .../ui/wizards/dialogfields/ComboDialogField.java | 225 - .../ui/wizards/dialogfields/DialogField.java | 213 - .../wizards/dialogfields/IDialogFieldListener.java | 11 - .../ui/wizards/dialogfields/IListAdapter.java | 33 - .../wizards/dialogfields/IStringButtonAdapter.java | 11 - .../ui/wizards/dialogfields/LayoutUtil.java | 140 - .../ui/wizards/dialogfields/LinkToFileGroup.java | 392 -- .../ui/wizards/dialogfields/ListDialogField.java | 894 ---- .../dialogfields/SelectionButtonDialogField.java | 192 - .../SelectionButtonDialogFieldGroup.java | 256 - .../ui/wizards/dialogfields/Separator.java | 95 - .../dialogfields/StringButtonDialogField.java | 137 - .../ui/wizards/dialogfields/StringDialogField.java | 153 - .../cdt/internal/ui/wizards/swt/MGridData.java | 171 - .../cdt/internal/ui/wizards/swt/MGridLayout.java | 682 --- .../eclipse/cdt/ui/CElementContentProvider.java | 342 -- .../eclipse/cdt/ui/CElementImageDescriptor.java | 229 - .../org/eclipse/cdt/ui/CElementLabelProvider.java | 222 - .../eclipse/cdt/ui/CLocalSelectionTransfer.java | 74 - .../eclipse/cdt/ui/CSearchResultLabelProvider.java | 171 - .../src/org/eclipse/cdt/ui/CUIPlugin.java | 384 -- .../src/org/eclipse/cdt/ui/CodeGeneration.java | 68 - .../eclipse/cdt/ui/FunctionPrototypeSummary.java | 95 - .../src/org/eclipse/cdt/ui/IBuildConsoleEvent.java | 15 - .../org/eclipse/cdt/ui/IBuildConsoleListener.java | 8 - .../org/eclipse/cdt/ui/IBuildConsoleManager.java | 16 - .../eclipse/cdt/ui/ICCompletionContributor.java | 25 - .../src/org/eclipse/cdt/ui/ICDTConstants.java | 22 - .../org/eclipse/cdt/ui/IEditorInputDelegate.java | 33 - .../src/org/eclipse/cdt/ui/IFunctionSummary.java | 87 - .../src/org/eclipse/cdt/ui/IRequiredInclude.java | 26 - .../org/eclipse/cdt/ui/IWorkingCopyManager.java | 75 - .../cdt/ui/IWorkingCopyManagerExtension.java | 42 - .../org/eclipse/cdt/ui/PreferenceConstants.java | 147 - .../cdt/ui/actions/AbstractOpenWizardAction.java | 215 - .../cdt/ui/actions/MemberFilterActionGroup.java | 267 - .../cdt/ui/actions/OpenClassWizardAction.java | 26 - .../cdt/ui/dialogs/AbstractBinaryParserPage.java | 159 - .../cdt/ui/dialogs/AbstractCOptionPage.java | 59 - .../cdt/ui/dialogs/AbstractErrorParserBlock.java | 241 - .../eclipse/cdt/ui/dialogs/BinaryParserBlock.java | 205 - .../cdt/ui/dialogs/CygwinPEBinaryParserPage.java | 263 - .../cdt/ui/dialogs/GNUElfBinaryParserPage.java | 215 - .../eclipse/cdt/ui/dialogs/ICOptionContainer.java | 30 - .../org/eclipse/cdt/ui/dialogs/ICOptionPage.java | 27 - .../org/eclipse/cdt/ui/dialogs/ReferenceBlock.java | 177 - .../cdt/ui/dialogs/TabFolderOptionBlock.java | 210 - .../eclipse/cdt/ui/text/ICCompletionProposal.java | 30 - .../eclipse/cdt/ui/wizards/NewCCProjectWizard.java | 37 - .../eclipse/cdt/ui/wizards/NewCProjectWizard.java | 305 -- .../ui/wizards/NewCProjectWizardOptionPage.java | 67 - .../cdt/ui/wizards/NewCProjectWizardPage.java | 350 -- .../org/eclipse/cdt/ui/wizards/NewClassWizard.java | 131 - .../eclipse/cdt/ui/wizards/NewClassWizardPage.java | 1045 ---- .../ui/wizards/conversion/ConversionWizard.java | 158 - .../conversion/ConvertProjectWizardPage.java | 522 -- .../cdt/utils/ui/controls/ControlFactory.java | 658 --- .../cdt/utils/ui/controls/RadioButtonsArea.java | 234 - .../cdt/utils/ui/controls/TabFolderLayout.java | 48 - debug/org.eclipse.cdt.debug.core/.classpath | 8 - debug/org.eclipse.cdt.debug.core/.cvsignore | 2 - debug/org.eclipse.cdt.debug.core/.project | 29 - debug/org.eclipse.cdt.debug.core/ChangeLog | 1689 ------ debug/org.eclipse.cdt.debug.core/about.html | 30 - debug/org.eclipse.cdt.debug.core/build.properties | 13 - debug/org.eclipse.cdt.debug.core/plugin.properties | 4 - debug/org.eclipse.cdt.debug.core/plugin.xml | 140 - .../schema/CDebugger.exsd | 128 - .../eclipse/cdt/debug/core/CDebugCorePlugin.java | 244 - .../org/eclipse/cdt/debug/core/CDebugModel.java | 686 --- .../org/eclipse/cdt/debug/core/CDebugUtils.java | 456 -- .../org/eclipse/cdt/debug/core/IAsyncExecutor.java | 16 - .../cdt/debug/core/ICBreakpointManager.java | 19 - .../core/ICDTLaunchConfigurationConstants.java | 188 - .../cdt/debug/core/ICDebugConfiguration.java | 18 - .../eclipse/cdt/debug/core/ICDebugConstants.java | 86 - .../src/org/eclipse/cdt/debug/core/ICDebugger.java | 17 - .../eclipse/cdt/debug/core/ICMemoryManager.java | 52 - .../eclipse/cdt/debug/core/ICRegisterManager.java | 33 - .../cdt/debug/core/ICSharedLibraryManager.java | 26 - .../eclipse/cdt/debug/core/ICSignalManager.java | 22 - .../eclipse/cdt/debug/core/ICUpdateManager.java | 24 - .../eclipse/cdt/debug/core/cdi/CDIException.java | 39 - .../cdt/debug/core/cdi/ICDIBreakpointHit.java | 25 - .../cdt/debug/core/cdi/ICDIBreakpointManager.java | 165 - .../eclipse/cdt/debug/core/cdi/ICDICatchEvent.java | 16 - .../eclipse/cdt/debug/core/cdi/ICDICondition.java | 30 - .../cdt/debug/core/cdi/ICDIConfiguration.java | 119 - .../cdt/debug/core/cdi/ICDIEndSteppingRange.java | 16 - .../eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java | 26 - .../cdt/debug/core/cdi/ICDIEventManager.java | 38 - .../eclipse/cdt/debug/core/cdi/ICDIExitInfo.java | 25 - .../cdt/debug/core/cdi/ICDIExpressionManager.java | 44 - .../org/eclipse/cdt/debug/core/cdi/ICDIFormat.java | 18 - .../eclipse/cdt/debug/core/cdi/ICDILocation.java | 54 - .../eclipse/cdt/debug/core/cdi/ICDIManager.java | 28 - .../cdt/debug/core/cdi/ICDIMemoryManager.java | 73 - .../cdt/debug/core/cdi/ICDIRegisterManager.java | 38 - .../cdt/debug/core/cdi/ICDIRuntimeOptions.java | 38 - .../eclipse/cdt/debug/core/cdi/ICDISession.java | 148 - .../cdt/debug/core/cdi/ICDISessionObject.java | 22 - .../cdt/debug/core/cdi/ICDISharedLibraryEvent.java | 18 - .../debug/core/cdi/ICDISharedLibraryManager.java | 58 - .../cdt/debug/core/cdi/ICDISignalExitInfo.java | 26 - .../cdt/debug/core/cdi/ICDISignalManager.java | 27 - .../cdt/debug/core/cdi/ICDISignalReceived.java | 24 - .../cdt/debug/core/cdi/ICDISourceManager.java | 88 - .../cdt/debug/core/cdi/ICDITraceManager.java | 154 - .../cdt/debug/core/cdi/ICDITraceSnapshot.java | 47 - .../cdt/debug/core/cdi/ICDIVariableManager.java | 121 - .../cdt/debug/core/cdi/ICDIWatchpointScope.java | 24 - .../cdt/debug/core/cdi/ICDIWatchpointTrigger.java | 38 - .../cdt/debug/core/cdi/event/ICDIChangedEvent.java | 16 - .../cdt/debug/core/cdi/event/ICDICreatedEvent.java | 21 - .../debug/core/cdi/event/ICDIDestroyedEvent.java | 20 - .../core/cdi/event/ICDIDisconnectedEvent.java | 20 - .../cdt/debug/core/cdi/event/ICDIEvent.java | 24 - .../debug/core/cdi/event/ICDIEventListener.java | 23 - .../cdt/debug/core/cdi/event/ICDIExitedEvent.java | 28 - .../core/cdi/event/ICDIMemoryChangedEvent.java | 18 - .../debug/core/cdi/event/ICDIRestartedEvent.java | 20 - .../cdt/debug/core/cdi/event/ICDIResumedEvent.java | 33 - .../debug/core/cdi/event/ICDISuspendedEvent.java | 38 - .../cdt/debug/core/cdi/model/ICDIArgument.java | 16 - .../debug/core/cdi/model/ICDIArgumentObject.java | 12 - .../cdt/debug/core/cdi/model/ICDIBreakpoint.java | 87 - .../cdt/debug/core/cdi/model/ICDICatchpoint.java | 26 - .../cdt/debug/core/cdi/model/ICDIExpression.java | 18 - .../cdt/debug/core/cdi/model/ICDIInstruction.java | 49 - .../core/cdi/model/ICDILocationBreakpoint.java | 26 - .../cdt/debug/core/cdi/model/ICDIMemoryBlock.java | 84 - .../debug/core/cdi/model/ICDIMixedInstruction.java | 29 - .../cdt/debug/core/cdi/model/ICDIObject.java | 21 - .../cdt/debug/core/cdi/model/ICDIRegister.java | 17 - .../debug/core/cdi/model/ICDIRegisterGroup.java | 25 - .../debug/core/cdi/model/ICDIRegisterObject.java | 16 - .../debug/core/cdi/model/ICDISharedLibrary.java | 52 - .../cdt/debug/core/cdi/model/ICDISignal.java | 64 - .../cdt/debug/core/cdi/model/ICDIStackFrame.java | 65 - .../debug/core/cdi/model/ICDIStaticVariable.java | 16 - .../cdt/debug/core/cdi/model/ICDITarget.java | 210 - .../cdt/debug/core/cdi/model/ICDIThread.java | 178 - .../cdt/debug/core/cdi/model/ICDITracepoint.java | 98 - .../cdt/debug/core/cdi/model/ICDIValue.java | 54 - .../cdt/debug/core/cdi/model/ICDIVariable.java | 54 - .../debug/core/cdi/model/ICDIVariableObject.java | 82 - .../cdt/debug/core/cdi/model/ICDIWatchpoint.java | 42 - .../core/cdi/model/type/ICDIAggregateType.java | 19 - .../core/cdi/model/type/ICDIAggregateValue.java | 21 - .../debug/core/cdi/model/type/ICDIArrayType.java | 19 - .../debug/core/cdi/model/type/ICDIArrayValue.java | 20 - .../debug/core/cdi/model/type/ICDIBoolType.java | 13 - .../debug/core/cdi/model/type/ICDIBoolValue.java | 12 - .../debug/core/cdi/model/type/ICDICharType.java | 18 - .../debug/core/cdi/model/type/ICDICharValue.java | 18 - .../debug/core/cdi/model/type/ICDIDerivedType.java | 20 - .../core/cdi/model/type/ICDIDerivedValue.java | 21 - .../debug/core/cdi/model/type/ICDIDoubleType.java | 18 - .../debug/core/cdi/model/type/ICDIDoubleValue.java | 18 - .../debug/core/cdi/model/type/ICDIEnumType.java | 12 - .../debug/core/cdi/model/type/ICDIEnumValue.java | 13 - .../debug/core/cdi/model/type/ICDIFloatType.java | 18 - .../debug/core/cdi/model/type/ICDIFloatValue.java | 18 - .../core/cdi/model/type/ICDIFloatingPointType.java | 23 - .../cdi/model/type/ICDIFloatingPointValue.java | 23 - .../core/cdi/model/type/ICDIFunctionType.java | 19 - .../core/cdi/model/type/ICDIFunctionValue.java | 19 - .../cdt/debug/core/cdi/model/type/ICDIIntType.java | 18 - .../debug/core/cdi/model/type/ICDIIntValue.java | 18 - .../core/cdi/model/type/ICDIIntegralType.java | 19 - .../core/cdi/model/type/ICDIIntegralValue.java | 29 - .../core/cdi/model/type/ICDILongLongType.java | 18 - .../core/cdi/model/type/ICDILongLongValue.java | 18 - .../debug/core/cdi/model/type/ICDILongType.java | 18 - .../debug/core/cdi/model/type/ICDILongValue.java | 18 - .../debug/core/cdi/model/type/ICDIPointerType.java | 18 - .../core/cdi/model/type/ICDIPointerValue.java | 21 - .../core/cdi/model/type/ICDIReferenceType.java | 13 - .../core/cdi/model/type/ICDIReferenceValue.java | 14 - .../debug/core/cdi/model/type/ICDIShortType.java | 18 - .../debug/core/cdi/model/type/ICDIShortValue.java | 18 - .../debug/core/cdi/model/type/ICDIStructType.java | 23 - .../debug/core/cdi/model/type/ICDIStructValue.java | 18 - .../cdt/debug/core/cdi/model/type/ICDIType.java | 33 - .../debug/core/cdi/model/type/ICDIVoidType.java | 19 - .../debug/core/cdi/model/type/ICDIWCharType.java | 13 - .../debug/core/cdi/model/type/ICDIWCharValue.java | 12 - .../cdt/debug/core/model/ICAddressBreakpoint.java | 42 - .../eclipse/cdt/debug/core/model/ICBreakpoint.java | 128 - .../core/model/ICDebugElementErrorStatus.java | 25 - .../cdt/debug/core/model/ICDebugTarget.java | 29 - .../cdt/debug/core/model/ICDebugTargetType.java | 22 - .../debug/core/model/ICExpressionEvaluator.java | 34 - .../cdt/debug/core/model/ICFunctionBreakpoint.java | 44 - .../cdt/debug/core/model/ICLineBreakpoint.java | 20 - .../cdt/debug/core/model/ICSharedLibrary.java | 54 - .../org/eclipse/cdt/debug/core/model/ICSignal.java | 33 - .../org/eclipse/cdt/debug/core/model/ICType.java | 35 - .../org/eclipse/cdt/debug/core/model/ICValue.java | 22 - .../eclipse/cdt/debug/core/model/ICVariable.java | 36 - .../eclipse/cdt/debug/core/model/ICWatchpoint.java | 58 - .../eclipse/cdt/debug/core/model/ICastToArray.java | 21 - .../eclipse/cdt/debug/core/model/ICastToType.java | 28 - .../debug/core/model/IDebuggerProcessSupport.java | 20 - .../cdt/debug/core/model/IDummyStackFrame.java | 15 - .../cdt/debug/core/model/IExecFileInfo.java | 23 - .../debug/core/model/IFormattedMemoryBlock.java | 135 - .../debug/core/model/IFormattedMemoryBlockRow.java | 37 - .../cdt/debug/core/model/IGlobalVariable.java | 19 - .../cdt/debug/core/model/IInstructionStep.java | 50 - .../cdt/debug/core/model/IJumpToAddress.java | 30 - .../eclipse/cdt/debug/core/model/IJumpToLine.java | 45 - .../org/eclipse/cdt/debug/core/model/IRestart.java | 30 - .../cdt/debug/core/model/IResumeWithoutSignal.java | 33 - .../cdt/debug/core/model/IRunToAddress.java | 31 - .../eclipse/cdt/debug/core/model/IRunToLine.java | 46 - .../cdt/debug/core/model/IStackFrameInfo.java | 63 - .../org/eclipse/cdt/debug/core/model/IState.java | 43 - .../cdt/debug/core/model/ISwitchToFrame.java | 20 - .../cdt/debug/core/model/ISwitchToThread.java | 21 - .../debug/core/sourcelookup/ICSourceLocation.java | 72 - .../debug/core/sourcelookup/ICSourceLocator.java | 88 - .../sourcelookup/IDirectorySourceLocation.java | 23 - .../core/sourcelookup/IDisassemblyStorage.java | 47 - .../core/sourcelookup/IProjectSourceLocation.java | 21 - .../cdt/debug/core/sourcelookup/ISourceMode.java | 33 - .../core/sourcelookup/SourceLookupFactory.java | 42 - .../debug/internal/core/CBreakpointManager.java | 739 --- .../cdt/debug/internal/core/CMemoryManager.java | 148 - .../cdt/debug/internal/core/CRegisterManager.java | 151 - .../debug/internal/core/CSharedLibraryManager.java | 189 - .../cdt/debug/internal/core/CSignalManager.java | 146 - .../cdt/debug/internal/core/CUpdateManager.java | 108 - .../debug/internal/core/DebugConfiguration.java | 118 - .../debug/internal/core/DisassemblyStorage.java | 249 - .../internal/core/ICDebugInternalConstants.java | 23 - .../cdt/debug/internal/core/SessionManager.java | 89 - .../core/breakpoints/CAddressBreakpoint.java | 115 - .../internal/core/breakpoints/CBreakpoint.java | 282 - .../core/breakpoints/CFunctionBreakpoint.java | 134 - .../internal/core/breakpoints/CLineBreakpoint.java | 97 - .../internal/core/breakpoints/CWatchpoint.java | 101 - .../debug/internal/core/model/CArrayPartition.java | 224 - .../internal/core/model/CArrayPartitionValue.java | 170 - .../internal/core/model/CCoreFileDebugTarget.java | 56 - .../debug/internal/core/model/CDebugElement.java | 330 -- .../debug/internal/core/model/CDebugTarget.java | 2235 -------- .../internal/core/model/CDummyStackFrame.java | 244 - .../cdt/debug/internal/core/model/CExpression.java | 128 - .../internal/core/model/CFormattedMemoryBlock.java | 682 --- .../debug/internal/core/model/CGlobalValue.java | 38 - .../debug/internal/core/model/CGlobalVariable.java | 90 - .../internal/core/model/CModificationVariable.java | 108 - .../cdt/debug/internal/core/model/CRegister.java | 80 - .../debug/internal/core/model/CRegisterGroup.java | 127 - .../debug/internal/core/model/CSharedLibrary.java | 112 - .../cdt/debug/internal/core/model/CSignal.java | 129 - .../cdt/debug/internal/core/model/CStackFrame.java | 783 --- .../cdt/debug/internal/core/model/CThread.java | 1155 ----- .../cdt/debug/internal/core/model/CType.java | 147 - .../cdt/debug/internal/core/model/CValue.java | 540 -- .../debug/internal/core/model/CValueFactory.java | 35 - .../cdt/debug/internal/core/model/CVariable.java | 1030 ---- .../sourcelookup/CDirectorySourceLocation.java | 518 -- .../core/sourcelookup/CProjectSourceLocation.java | 396 -- .../internal/core/sourcelookup/CSourceLocator.java | 745 --- .../internal/core/sourcelookup/CSourceManager.java | 294 -- .../core/sourcelookup/DisassemblyManager.java | 247 - .../internal/core/sourcelookup/SourceUtils.java | 181 - debug/org.eclipse.cdt.debug.mi.core/.classpath | 7 - debug/org.eclipse.cdt.debug.mi.core/.cvsignore | 1 - debug/org.eclipse.cdt.debug.mi.core/.options | 1 - debug/org.eclipse.cdt.debug.mi.core/.project | 30 - debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 2151 -------- debug/org.eclipse.cdt.debug.mi.core/about.html | 30 - .../org.eclipse.cdt.debug.mi.core/build.properties | 13 - debug/org.eclipse.cdt.debug.mi.core/design.txt | 110 - .../plugin.properties | 6 - debug/org.eclipse.cdt.debug.mi.core/plugin.xml | 52 - .../eclipse/cdt/debug/mi/core/CLIProcessor.java | 163 - .../eclipse/cdt/debug/mi/core/CommandQueue.java | 56 - .../cdt/debug/mi/core/CygwinGDBDebugger.java | 155 - .../org/eclipse/cdt/debug/mi/core/EventThread.java | 54 - .../org/eclipse/cdt/debug/mi/core/GDBDebugger.java | 159 - .../cdt/debug/mi/core/GDBServerDebugger.java | 126 - .../eclipse/cdt/debug/mi/core/GDBTypeParser.java | 428 -- .../IGDBServerMILaunchConfigurationConstants.java | 25 - .../eclipse/cdt/debug/mi/core/IMIConstants.java | 50 - .../mi/core/IMILaunchConfigurationConstants.java | 46 - .../org/eclipse/cdt/debug/mi/core/MIException.java | 29 - .../org/eclipse/cdt/debug/mi/core/MIFormat.java | 28 - .../org/eclipse/cdt/debug/mi/core/MIInferior.java | 328 -- .../org/eclipse/cdt/debug/mi/core/MIPlugin.java | 410 -- .../org/eclipse/cdt/debug/mi/core/MISession.java | 539 -- .../src/org/eclipse/cdt/debug/mi/core/Queue.java | 76 - .../org/eclipse/cdt/debug/mi/core/RxThread.java | 433 -- .../eclipse/cdt/debug/mi/core/SessionProcess.java | 88 - .../org/eclipse/cdt/debug/mi/core/TxThread.java | 84 - .../cdt/debug/mi/core/cdi/BreakpointHit.java | 37 - .../cdt/debug/mi/core/cdi/BreakpointManager.java | 560 -- .../eclipse/cdt/debug/mi/core/cdi/Condition.java | 34 - .../cdt/debug/mi/core/cdi/Configuration.java | 154 - .../debug/mi/core/cdi/CoreFileConfiguration.java | 81 - .../cdt/debug/mi/core/cdi/EndSteppingRange.java | 17 - .../eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java | 31 - .../cdt/debug/mi/core/cdi/EventManager.java | 536 -- .../eclipse/cdt/debug/mi/core/cdi/ExitInfo.java | 29 - .../cdt/debug/mi/core/cdi/ExpressionManager.java | 228 - .../org/eclipse/cdt/debug/mi/core/cdi/Format.java | 43 - .../eclipse/cdt/debug/mi/core/cdi/Location.java | 93 - .../cdt/debug/mi/core/cdi/MI2CDIException.java | 14 - .../cdt/debug/mi/core/cdi/MemoryManager.java | 214 - .../cdt/debug/mi/core/cdi/RegisterManager.java | 242 - .../cdt/debug/mi/core/cdi/RuntimeOptions.java | 105 - .../org/eclipse/cdt/debug/mi/core/cdi/Session.java | 239 - .../cdt/debug/mi/core/cdi/SessionObject.java | 28 - .../cdt/debug/mi/core/cdi/SharedLibraryEvent.java | 17 - .../debug/mi/core/cdi/SharedLibraryManager.java | 334 -- .../cdt/debug/mi/core/cdi/SignalExitInfo.java | 36 - .../cdt/debug/mi/core/cdi/SignalManager.java | 205 - .../cdt/debug/mi/core/cdi/SignalReceived.java | 31 - .../cdt/debug/mi/core/cdi/SourceManager.java | 445 -- .../cdt/debug/mi/core/cdi/VariableManager.java | 584 --- .../cdt/debug/mi/core/cdi/WatchpointScope.java | 37 - .../cdt/debug/mi/core/cdi/WatchpointTrigger.java | 51 - .../cdt/debug/mi/core/cdi/event/ChangedEvent.java | 117 - .../cdt/debug/mi/core/cdi/event/CreatedEvent.java | 109 - .../debug/mi/core/cdi/event/DestroyedEvent.java | 106 - .../debug/mi/core/cdi/event/DisconnectedEvent.java | 24 - .../cdt/debug/mi/core/cdi/event/ExitedEvent.java | 54 - .../mi/core/cdi/event/MemoryChangedEvent.java | 52 - .../cdt/debug/mi/core/cdi/event/ResumedEvent.java | 70 - .../debug/mi/core/cdi/event/SuspendedEvent.java | 78 - .../cdt/debug/mi/core/cdi/model/Argument.java | 18 - .../debug/mi/core/cdi/model/ArgumentObject.java | 21 - .../cdt/debug/mi/core/cdi/model/Breakpoint.java | 143 - .../cdt/debug/mi/core/cdi/model/CObject.java | 27 - .../cdt/debug/mi/core/cdi/model/Catchpoint.java | 27 - .../cdt/debug/mi/core/cdi/model/Expression.java | 18 - .../cdt/debug/mi/core/cdi/model/Instruction.java | 63 - .../cdt/debug/mi/core/cdi/model/MemoryBlock.java | 192 - .../debug/mi/core/cdi/model/MixedInstruction.java | 51 - .../cdt/debug/mi/core/cdi/model/Register.java | 54 - .../debug/mi/core/cdi/model/RegisterObject.java | 14 - .../cdt/debug/mi/core/cdi/model/SharedLibrary.java | 70 - .../cdt/debug/mi/core/cdi/model/Signal.java | 75 - .../cdt/debug/mi/core/cdi/model/StackFrame.java | 146 - .../cdt/debug/mi/core/cdi/model/Target.java | 678 --- .../cdt/debug/mi/core/cdi/model/Thread.java | 376 -- .../eclipse/cdt/debug/mi/core/cdi/model/Value.java | 97 - .../cdt/debug/mi/core/cdi/model/Variable.java | 391 -- .../debug/mi/core/cdi/model/VariableObject.java | 322 -- .../cdt/debug/mi/core/cdi/model/Watchpoint.java | 61 - .../mi/core/cdi/model/type/AggregateType.java | 18 - .../mi/core/cdi/model/type/AggregateValue.java | 19 - .../debug/mi/core/cdi/model/type/ArrayType.java | 58 - .../debug/mi/core/cdi/model/type/ArrayValue.java | 62 - .../cdt/debug/mi/core/cdi/model/type/BoolType.java | 26 - .../debug/mi/core/cdi/model/type/BoolValue.java | 22 - .../cdt/debug/mi/core/cdi/model/type/CharType.java | 25 - .../debug/mi/core/cdi/model/type/CharValue.java | 31 - .../debug/mi/core/cdi/model/type/DerivedType.java | 47 - .../debug/mi/core/cdi/model/type/DerivedValue.java | 20 - .../debug/mi/core/cdi/model/type/DoubleType.java | 25 - .../debug/mi/core/cdi/model/type/DoubleValue.java | 21 - .../cdt/debug/mi/core/cdi/model/type/EnumType.java | 26 - .../debug/mi/core/cdi/model/type/EnumValue.java | 22 - .../debug/mi/core/cdi/model/type/FloatType.java | 25 - .../debug/mi/core/cdi/model/type/FloatValue.java | 21 - .../mi/core/cdi/model/type/FloatingPointType.java | 47 - .../mi/core/cdi/model/type/FloatingPointValue.java | 77 - .../debug/mi/core/cdi/model/type/FunctionType.java | 40 - .../mi/core/cdi/model/type/FunctionValue.java | 22 - .../mi/core/cdi/model/type/IncompleteType.java | 22 - .../cdt/debug/mi/core/cdi/model/type/IntType.java | 26 - .../cdt/debug/mi/core/cdi/model/type/IntValue.java | 22 - .../debug/mi/core/cdi/model/type/IntegralType.java | 29 - .../mi/core/cdi/model/type/IntegralValue.java | 92 - .../debug/mi/core/cdi/model/type/LongLongType.java | 26 - .../mi/core/cdi/model/type/LongLongValue.java | 22 - .../cdt/debug/mi/core/cdi/model/type/LongType.java | 25 - .../debug/mi/core/cdi/model/type/LongValue.java | 22 - .../debug/mi/core/cdi/model/type/PointerType.java | 37 - .../debug/mi/core/cdi/model/type/PointerValue.java | 40 - .../mi/core/cdi/model/type/ReferenceType.java | 40 - .../mi/core/cdi/model/type/ReferenceValue.java | 45 - .../debug/mi/core/cdi/model/type/ShortType.java | 25 - .../debug/mi/core/cdi/model/type/ShortValue.java | 22 - .../debug/mi/core/cdi/model/type/StructType.java | 45 - .../debug/mi/core/cdi/model/type/StructValue.java | 22 - .../cdt/debug/mi/core/cdi/model/type/Type.java | 45 - .../cdt/debug/mi/core/cdi/model/type/VoidType.java | 18 - .../debug/mi/core/cdi/model/type/WCharType.java | 27 - .../debug/mi/core/cdi/model/type/WCharValue.java | 32 - .../cdt/debug/mi/core/command/CLICommand.java | 38 - .../eclipse/cdt/debug/mi/core/command/Command.java | 102 - .../cdt/debug/mi/core/command/CommandFactory.java | 368 -- .../mi/core/command/CygwinCommandFactory.java | 19 - .../core/command/CygwinMIEnvironmentDirectory.java | 43 - .../cdt/debug/mi/core/command/MIBreakAfter.java | 28 - .../debug/mi/core/command/MIBreakCondition.java | 35 - .../cdt/debug/mi/core/command/MIBreakDelete.java | 32 - .../cdt/debug/mi/core/command/MIBreakDisable.java | 31 - .../cdt/debug/mi/core/command/MIBreakEnable.java | 30 - .../cdt/debug/mi/core/command/MIBreakInsert.java | 121 - .../cdt/debug/mi/core/command/MIBreakList.java | 68 - .../cdt/debug/mi/core/command/MIBreakWatch.java | 58 - .../cdt/debug/mi/core/command/MICommand.java | 148 - .../debug/mi/core/command/MIDataDisassemble.java | 105 - .../mi/core/command/MIDataEvaluateExpression.java | 44 - .../core/command/MIDataListChangedRegisters.java | 42 - .../mi/core/command/MIDataListRegisterNames.java | 58 - .../mi/core/command/MIDataListRegisterValues.java | 89 - .../debug/mi/core/command/MIDataReadMemory.java | 147 - .../debug/mi/core/command/MIDataWriteMemory.java | 93 - .../mi/core/command/MIDataWriteRegisterValues.java | 67 - .../cdt/debug/mi/core/command/MIEnvironmentCD.java | 23 - .../mi/core/command/MIEnvironmentDirectory.java | 22 - .../debug/mi/core/command/MIEnvironmentPWD.java | 39 - .../debug/mi/core/command/MIEnvironmentPath.java | 21 - .../cdt/debug/mi/core/command/MIExecAbort.java | 23 - .../cdt/debug/mi/core/command/MIExecArguments.java | 22 - .../cdt/debug/mi/core/command/MIExecContinue.java | 22 - .../cdt/debug/mi/core/command/MIExecFinish.java | 23 - .../cdt/debug/mi/core/command/MIExecInterrupt.java | 26 - .../cdt/debug/mi/core/command/MIExecNext.java | 22 - .../mi/core/command/MIExecNextInstruction.java | 24 - .../cdt/debug/mi/core/command/MIExecReturn.java | 24 - .../cdt/debug/mi/core/command/MIExecRun.java | 27 - .../cdt/debug/mi/core/command/MIExecStep.java | 24 - .../mi/core/command/MIExecStepInstruction.java | 27 - .../cdt/debug/mi/core/command/MIExecUntil.java | 29 - .../cdt/debug/mi/core/command/MIFileExecFile.java | 25 - .../debug/mi/core/command/MIFileSymbolFile.java | 23 - .../cdt/debug/mi/core/command/MIGDBExit.java | 21 - .../cdt/debug/mi/core/command/MIGDBSet.java | 21 - .../debug/mi/core/command/MIGDBSetAutoSolib.java | 20 - .../debug/mi/core/command/MIGDBSetEnvironment.java | 46 - .../mi/core/command/MIGDBSetSolibSearchPath.java | 32 - .../mi/core/command/MIGDBSetStopOnSolibEvents.java | 20 - .../cdt/debug/mi/core/command/MIGDBShow.java | 41 - .../mi/core/command/MIGDBShowDirectories.java | 40 - .../debug/mi/core/command/MIGDBShowExitCode.java | 43 - .../mi/core/command/MIGDBShowSolibSearchPath.java | 40 - .../cdt/debug/mi/core/command/MIHandle.java | 22 - .../cdt/debug/mi/core/command/MIInfoProgram.java | 40 - .../debug/mi/core/command/MIInfoSharedLibrary.java | 40 - .../cdt/debug/mi/core/command/MIInfoSignals.java | 44 - .../cdt/debug/mi/core/command/MIInfoThreads.java | 40 - .../eclipse/cdt/debug/mi/core/command/MIJump.java | 43 - .../eclipse/cdt/debug/mi/core/command/MIPType.java | 40 - .../cdt/debug/mi/core/command/MISharedLibrary.java | 25 - .../cdt/debug/mi/core/command/MISignal.java | 44 - .../debug/mi/core/command/MIStackInfoDepth.java | 47 - .../mi/core/command/MIStackListArguments.java | 67 - .../debug/mi/core/command/MIStackListFrames.java | 69 - .../debug/mi/core/command/MIStackListLocals.java | 49 - .../debug/mi/core/command/MIStackSelectFrame.java | 24 - .../cdt/debug/mi/core/command/MITargetAttach.java | 22 - .../cdt/debug/mi/core/command/MITargetDetach.java | 22 - .../debug/mi/core/command/MITargetDownload.java | 36 - .../cdt/debug/mi/core/command/MITargetSelect.java | 34 - .../cdt/debug/mi/core/command/MIThreadListIds.java | 43 - .../cdt/debug/mi/core/command/MIThreadSelect.java | 43 - .../cdt/debug/mi/core/command/MIVarAssign.java | 22 - .../cdt/debug/mi/core/command/MIVarCreate.java | 72 - .../cdt/debug/mi/core/command/MIVarDelete.java | 44 - .../mi/core/command/MIVarEvaluateExpression.java | 46 - .../debug/mi/core/command/MIVarInfoExpression.java | 47 - .../mi/core/command/MIVarInfoNumChildren.java | 44 - .../cdt/debug/mi/core/command/MIVarInfoType.java | 24 - .../debug/mi/core/command/MIVarListChildren.java | 45 - .../cdt/debug/mi/core/command/MIVarSetFormat.java | 52 - .../debug/mi/core/command/MIVarShowAttributes.java | 46 - .../cdt/debug/mi/core/command/MIVarShowFormat.java | 24 - .../cdt/debug/mi/core/command/MIVarUpdate.java | 48 - .../cdt/debug/mi/core/command/MIWhatis.java | 40 - .../mi/core/event/MIBreakpointChangedEvent.java | 30 - .../mi/core/event/MIBreakpointCreatedEvent.java | 30 - .../mi/core/event/MIBreakpointDeletedEvent.java | 30 - .../debug/mi/core/event/MIBreakpointHitEvent.java | 88 - .../cdt/debug/mi/core/event/MIChangedEvent.java | 18 - .../cdt/debug/mi/core/event/MICreatedEvent.java | 18 - .../cdt/debug/mi/core/event/MIDestroyedEvent.java | 18 - .../cdt/debug/mi/core/event/MIDetachedEvent.java | 23 - .../cdt/debug/mi/core/event/MIErrorEvent.java | 74 - .../eclipse/cdt/debug/mi/core/event/MIEvent.java | 21 - .../mi/core/event/MIFunctionFinishedEvent.java | 92 - .../cdt/debug/mi/core/event/MIGDBExitEvent.java | 18 - .../debug/mi/core/event/MIInferiorExitEvent.java | 76 - .../mi/core/event/MIInferiorSignalExitEvent.java | 79 - .../mi/core/event/MILocationReachedEvent.java | 75 - .../debug/mi/core/event/MIMemoryChangedEvent.java | 30 - .../debug/mi/core/event/MIMemoryCreatedEvent.java | 37 - .../mi/core/event/MIRegisterChangedEvent.java | 32 - .../mi/core/event/MIRegisterCreatedEvent.java | 37 - .../cdt/debug/mi/core/event/MIRunningEvent.java | 39 - .../mi/core/event/MISharedLibChangedEvent.java | 30 - .../mi/core/event/MISharedLibCreatedEvent.java | 30 - .../cdt/debug/mi/core/event/MISharedLibEvent.java | 28 - .../mi/core/event/MISharedLibUnloadedEvent.java | 28 - .../debug/mi/core/event/MISignalChangedEvent.java | 30 - .../cdt/debug/mi/core/event/MISignalEvent.java | 93 - .../debug/mi/core/event/MISteppingRangeEvent.java | 74 - .../cdt/debug/mi/core/event/MIStoppedEvent.java | 93 - .../debug/mi/core/event/MIThreadCreatedEvent.java | 29 - .../cdt/debug/mi/core/event/MIThreadExitEvent.java | 29 - .../cdt/debug/mi/core/event/MIVarChangedEvent.java | 31 - .../cdt/debug/mi/core/event/MIVarCreatedEvent.java | 32 - .../cdt/debug/mi/core/event/MIVarDeletedEvent.java | 31 - .../mi/core/event/MIWatchpointScopeEvent.java | 79 - .../mi/core/event/MIWatchpointTriggerEvent.java | 150 - .../eclipse/cdt/debug/mi/core/output/MIArg.java | 94 - .../eclipse/cdt/debug/mi/core/output/MIAsm.java | 111 - .../cdt/debug/mi/core/output/MIAsyncRecord.java | 68 - .../debug/mi/core/output/MIBreakInsertInfo.java | 80 - .../cdt/debug/mi/core/output/MIBreakListInfo.java | 78 - .../cdt/debug/mi/core/output/MIBreakWatchInfo.java | 18 - .../cdt/debug/mi/core/output/MIBreakpoint.java | 256 - .../mi/core/output/MIConsoleStreamOutput.java | 12 - .../eclipse/cdt/debug/mi/core/output/MIConst.java | 93 - .../mi/core/output/MIDataDisassembleInfo.java | 115 - .../core/output/MIDataEvaluateExpressionInfo.java | 46 - .../output/MIDataListChangedRegistersInfo.java | 67 - .../core/output/MIDataListRegisterNamesInfo.java | 84 - .../core/output/MIDataListRegisterValuesInfo.java | 47 - .../debug/mi/core/output/MIDataReadMemoryInfo.java | 148 - .../debug/mi/core/output/MIEnvironmentPWDInfo.java | 49 - .../debug/mi/core/output/MIExecAsyncOutput.java | 11 - .../eclipse/cdt/debug/mi/core/output/MIFrame.java | 117 - .../mi/core/output/MIGDBShowDirectoriesInfo.java | 59 - .../mi/core/output/MIGDBShowExitCodeInfo.java | 33 - .../cdt/debug/mi/core/output/MIGDBShowInfo.java | 44 - .../core/output/MIGDBShowSolibSearchPathInfo.java | 46 - .../eclipse/cdt/debug/mi/core/output/MIInfo.java | 79 - .../debug/mi/core/output/MIInfoProgramInfo.java | 70 - .../mi/core/output/MIInfoSharedLibraryInfo.java | 140 - .../debug/mi/core/output/MIInfoSignalsInfo.java | 109 - .../debug/mi/core/output/MIInfoThreadsInfo.java | 81 - .../eclipse/cdt/debug/mi/core/output/MIList.java | 52 - .../debug/mi/core/output/MILogStreamOutput.java | 12 - .../eclipse/cdt/debug/mi/core/output/MIMemory.java | 87 - .../debug/mi/core/output/MINotifyAsyncOutput.java | 11 - .../cdt/debug/mi/core/output/MIOOBRecord.java | 11 - .../eclipse/cdt/debug/mi/core/output/MIOutput.java | 44 - .../cdt/debug/mi/core/output/MIPTypeInfo.java | 48 - .../eclipse/cdt/debug/mi/core/output/MIParser.java | 514 -- .../cdt/debug/mi/core/output/MIRegisterValue.java | 91 - .../eclipse/cdt/debug/mi/core/output/MIResult.java | 44 - .../cdt/debug/mi/core/output/MIResultRecord.java | 57 - .../eclipse/cdt/debug/mi/core/output/MIShared.java | 45 - .../cdt/debug/mi/core/output/MISigHandle.java | 52 - .../eclipse/cdt/debug/mi/core/output/MISrcAsm.java | 85 - .../debug/mi/core/output/MIStackInfoDepthInfo.java | 46 - .../mi/core/output/MIStackListArgumentsInfo.java | 63 - .../mi/core/output/MIStackListFramesInfo.java | 78 - .../mi/core/output/MIStackListLocalsInfo.java | 52 - .../debug/mi/core/output/MIStatusAsyncOutput.java | 12 - .../cdt/debug/mi/core/output/MIStreamRecord.java | 36 - .../debug/mi/core/output/MITargetStreamOutput.java | 13 - .../debug/mi/core/output/MIThreadListIdsInfo.java | 64 - .../debug/mi/core/output/MIThreadSelectInfo.java | 55 - .../eclipse/cdt/debug/mi/core/output/MITuple.java | 35 - .../eclipse/cdt/debug/mi/core/output/MIValue.java | 11 - .../eclipse/cdt/debug/mi/core/output/MIVar.java | 71 - .../cdt/debug/mi/core/output/MIVarChange.java | 39 - .../cdt/debug/mi/core/output/MIVarCreateInfo.java | 60 - .../cdt/debug/mi/core/output/MIVarDeleteInfo.java | 46 - .../core/output/MIVarEvaluateExpressionInfo.java | 41 - .../mi/core/output/MIVarInfoExpressionInfo.java | 51 - .../mi/core/output/MIVarInfoNumChildrenInfo.java | 48 - .../debug/mi/core/output/MIVarInfoTypeInfo.java | 42 - .../mi/core/output/MIVarListChildrenInfo.java | 72 - .../mi/core/output/MIVarShowAttributesInfo.java | 45 - .../debug/mi/core/output/MIVarShowFormatInfo.java | 54 - .../cdt/debug/mi/core/output/MIVarUpdateInfo.java | 73 - .../cdt/debug/mi/core/output/MIWhatisInfo.java | 48 - debug/org.eclipse.cdt.debug.mi.ui/.classpath | 7 - debug/org.eclipse.cdt.debug.mi.ui/.cvsignore | 1 - debug/org.eclipse.cdt.debug.mi.ui/.project | 33 - debug/org.eclipse.cdt.debug.mi.ui/ChangeLog | 138 - debug/org.eclipse.cdt.debug.mi.ui/about.html | 30 - debug/org.eclipse.cdt.debug.mi.ui/build.properties | 10 - .../icons/full/clcl16/auto_solib_co.gif | Bin 170 -> 0 bytes .../icons/full/dlcl16/auto_solib_co.gif | Bin 170 -> 0 bytes .../icons/full/elcl16/auto_solib_co.gif | Bin 112 -> 0 bytes .../org.eclipse.cdt.debug.mi.ui/plugin.properties | 7 - debug/org.eclipse.cdt.debug.mi.ui/plugin.xml | 56 - .../debug/mi/internal/ui/CygwinDebuggerPage.java | 26 - .../cdt/debug/mi/internal/ui/GDBDebuggerPage.java | 288 -- .../mi/internal/ui/GDBServerDebuggerPage.java | 287 -- .../cdt/debug/mi/internal/ui/GDBSolibBlock.java | 193 - .../debug/mi/internal/ui/IMIHelpContextIds.java | 24 - .../cdt/debug/mi/internal/ui/IMIUIConstants.java | 20 - .../cdt/debug/mi/internal/ui/MIUIPlugin.java | 63 - .../cdt/debug/mi/internal/ui/PixelConverter.java | 63 - .../mi/internal/ui/SerialPortSettingsBlock.java | 241 - .../debug/mi/internal/ui/SolibSearchPathBlock.java | 163 - .../cdt/debug/mi/internal/ui/TCPSettingsBlock.java | 236 - .../ui/actions/SetAutoSolibActionDelegate.java | 279 - .../ui/dialogfields/CheckedListDialogField.java | 216 - .../internal/ui/dialogfields/ComboDialogField.java | 220 - .../mi/internal/ui/dialogfields/DialogField.java | 221 - .../ui/dialogfields/IDialogFieldListener.java | 17 - .../mi/internal/ui/dialogfields/IListAdapter.java | 22 - .../ui/dialogfields/IStringButtonAdapter.java | 14 - .../mi/internal/ui/dialogfields/LayoutUtil.java | 134 - .../internal/ui/dialogfields/ListDialogField.java | 767 --- .../dialogfields/SelectionButtonDialogField.java | 185 - .../SelectionButtonDialogFieldGroup.java | 249 - .../mi/internal/ui/dialogfields/Separator.java | 87 - .../ui/dialogfields/StringButtonDialogField.java | 135 - .../StringButtonStatusDialogField.java | 160 - .../ui/dialogfields/StringDialogField.java | 153 - .../internal/ui/preferences/MIPreferencePage.java | 207 - debug/org.eclipse.cdt.debug.ui.tests/.classpath | 8 - debug/org.eclipse.cdt.debug.ui.tests/.cvsignore | 1 - debug/org.eclipse.cdt.debug.ui.tests/.project | 31 - debug/org.eclipse.cdt.debug.ui.tests/Changelog | 48 - debug/org.eclipse.cdt.debug.ui.tests/about.html | 44 - .../build.properties | 10 - .../org/eclipse/cdt/debug/core/tests/.cvsignore | 0 .../cdt/debug/core/tests/AllDebugTests.java | 42 - .../cdt/debug/core/tests/BreakpointTests.java | 697 --- .../eclipse/cdt/debug/core/tests/DebugTests.java | 141 - .../cdt/debug/core/tests/LocationTests.java | 189 - .../eclipse/cdt/debug/core/tests/TargetTests.java | 105 - debug/org.eclipse.cdt.debug.ui.tests/plugin.xml | 26 - .../resources/debugTest.zip | Bin 937 -> 0 bytes .../eclipse/cdt/debug/testplugin/CDebugHelper.java | 71 - .../cdt/debug/testplugin/CProjectHelper.java | 226 - .../eclipse/cdt/debug/testplugin/CTestPlugin.java | 58 - .../cdt/debug/testplugin/util/ExpectedStrings.java | 96 - .../testplugin/util/ExpectedStringsTests.java | 114 - debug/org.eclipse.cdt.debug.ui.tests/test.xml | 51 - debug/org.eclipse.cdt.debug.ui/.classpath | 7 - debug/org.eclipse.cdt.debug.ui/.cvsignore | 1 - debug/org.eclipse.cdt.debug.ui/.project | 31 - debug/org.eclipse.cdt.debug.ui/ChangeLog | 1271 ----- debug/org.eclipse.cdt.debug.ui/about.html | 30 - debug/org.eclipse.cdt.debug.ui/build.properties | 12 - .../icons/full/clcl16/autorefresh_mem.gif | Bin 182 -> 0 bytes .../icons/full/clcl16/casttotype_co.gif | Bin 96 -> 0 bytes .../icons/full/clcl16/change_reg_value_co.gif | Bin 171 -> 0 bytes .../icons/full/clcl16/debugger_console.gif | Bin 166 -> 0 bytes .../icons/full/clcl16/disabled_co.gif | Bin 885 -> 0 bytes .../icons/full/clcl16/disassembly.gif | Bin 161 -> 0 bytes .../icons/full/clcl16/enabled_co.gif | Bin 897 -> 0 bytes .../icons/full/clcl16/jump_co.gif | Bin 145 -> 0 bytes .../icons/full/clcl16/load_all_symbols_co.gif | Bin 354 -> 0 bytes .../icons/full/clcl16/load_symbols_co.gif | Bin 926 -> 0 bytes .../icons/full/clcl16/memory_clear.gif | Bin 162 -> 0 bytes .../icons/full/clcl16/memory_update.gif | Bin 568 -> 0 bytes .../icons/full/clcl16/refresh_mem.gif | Bin 237 -> 0 bytes .../icons/full/clcl16/restart.gif | Bin 180 -> 0 bytes .../icons/full/clcl16/runtoline_co.gif | Bin 138 -> 0 bytes .../icons/full/clcl16/show_ascii.gif | Bin 159 -> 0 bytes .../icons/full/clcl16/show_paths.gif | Bin 147 -> 0 bytes .../icons/full/clcl16/showasarray_co.gif | Bin 117 -> 0 bytes .../icons/full/clcl16/signal0_co.gif | Bin 139 -> 0 bytes .../icons/full/clcl16/signal_co.gif | Bin 136 -> 0 bytes .../icons/full/clcl16/tnames_co.gif | Bin 181 -> 0 bytes .../icons/full/clcl16/watch_globals.gif | Bin 145 -> 0 bytes .../icons/full/ctool16/adddirsource_wiz.gif | Bin 164 -> 0 bytes .../icons/full/ctool16/addprjsource_wiz.gif | Bin 239 -> 0 bytes .../icons/full/cview16/memory_view.gif | Bin 214 -> 0 bytes .../icons/full/cview16/registers_view.gif | Bin 119 -> 0 bytes .../icons/full/cview16/sharedlibraries_view.gif | Bin 153 -> 0 bytes .../icons/full/cview16/signals_view.gif | Bin 883 -> 0 bytes .../icons/full/dlcl16/autorefresh_mem.gif | Bin 104 -> 0 bytes .../icons/full/dlcl16/casttotype_co.gif | Bin 96 -> 0 bytes .../icons/full/dlcl16/change_reg_value_co.gif | Bin 97 -> 0 bytes .../icons/full/dlcl16/debugger_console.gif | Bin 136 -> 0 bytes .../icons/full/dlcl16/disassembly.gif | Bin 158 -> 0 bytes .../icons/full/dlcl16/jump_co.gif | Bin 92 -> 0 bytes .../icons/full/dlcl16/load_all_symbols_co.gif | Bin 135 -> 0 bytes .../icons/full/dlcl16/load_symbols_co.gif | Bin 168 -> 0 bytes .../icons/full/dlcl16/memory_clear.gif | Bin 91 -> 0 bytes .../icons/full/dlcl16/memory_update.gif | Bin 363 -> 0 bytes .../icons/full/dlcl16/refresh_mem.gif | Bin 129 -> 0 bytes .../icons/full/dlcl16/restart.gif | Bin 77 -> 0 bytes .../icons/full/dlcl16/runtoline_co.gif | Bin 104 -> 0 bytes .../icons/full/dlcl16/show_ascii.gif | Bin 156 -> 0 bytes .../icons/full/dlcl16/show_paths.gif | Bin 78 -> 0 bytes .../icons/full/dlcl16/showasarray_co.gif | Bin 117 -> 0 bytes .../icons/full/dlcl16/signal0_co.gif | Bin 139 -> 0 bytes .../icons/full/dlcl16/signal_co.gif | Bin 136 -> 0 bytes .../icons/full/dlcl16/tnames_co.gif | Bin 101 -> 0 bytes .../icons/full/dlcl16/watch_globals.gif | Bin 105 -> 0 bytes .../icons/full/dtool16/adddirsource_wiz.gif | Bin 86 -> 0 bytes .../icons/full/dtool16/addprjsource_wiz.gif | Bin 97 -> 0 bytes .../icons/full/elcl16/autorefresh_mem.gif | Bin 144 -> 0 bytes .../icons/full/elcl16/casttotype_co.gif | Bin 96 -> 0 bytes .../icons/full/elcl16/change_reg_value_co.gif | Bin 165 -> 0 bytes .../icons/full/elcl16/debugger_console.gif | Bin 163 -> 0 bytes .../icons/full/elcl16/disassembly.gif | Bin 158 -> 0 bytes .../icons/full/elcl16/jump_co.gif | Bin 112 -> 0 bytes .../icons/full/elcl16/load_all_symbols_co.gif | Bin 241 -> 0 bytes .../icons/full/elcl16/load_symbols_co.gif | Bin 905 -> 0 bytes .../icons/full/elcl16/memory_clear.gif | Bin 122 -> 0 bytes .../icons/full/elcl16/memory_update.gif | Bin 568 -> 0 bytes .../icons/full/elcl16/refresh_mem.gif | Bin 170 -> 0 bytes .../icons/full/elcl16/restart.gif | Bin 129 -> 0 bytes .../icons/full/elcl16/runtoline_co.gif | Bin 109 -> 0 bytes .../icons/full/elcl16/show_ascii.gif | Bin 156 -> 0 bytes .../icons/full/elcl16/show_parents.gif | Bin 118 -> 0 bytes .../icons/full/elcl16/showasarray_co.gif | Bin 117 -> 0 bytes .../icons/full/elcl16/signal0_co.gif | Bin 139 -> 0 bytes .../icons/full/elcl16/signal_co.gif | Bin 136 -> 0 bytes .../icons/full/elcl16/tnames_co.gif | Bin 145 -> 0 bytes .../icons/full/elcl16/watch_globals.gif | Bin 105 -> 0 bytes .../icons/full/etool16/adddirsource_wiz.gif | Bin 159 -> 0 bytes .../icons/full/etool16/addprjsource_wiz.gif | Bin 174 -> 0 bytes .../icons/full/eview16/memory_view.gif | Bin 214 -> 0 bytes .../icons/full/eview16/registers_view.gif | Bin 118 -> 0 bytes .../icons/full/eview16/sharedlibraries_view.gif | Bin 153 -> 0 bytes .../icons/full/eview16/signals_view.gif | Bin 883 -> 0 bytes .../icons/full/obj16/addrbrkp_obj.gif | Bin 151 -> 0 bytes .../icons/full/obj16/addrbrkpd_obj.gif | Bin 147 -> 0 bytes .../icons/full/obj16/brkp_obj.gif | Bin 140 -> 0 bytes .../icons/full/obj16/brkpd_obj.gif | Bin 136 -> 0 bytes .../icons/full/obj16/brkpi_obj.gif | Bin 107 -> 0 bytes .../icons/full/obj16/cproject_obj.gif | Bin 217 -> 0 bytes .../icons/full/obj16/disassembly_obj.gif | Bin 238 -> 0 bytes .../icons/full/obj16/expression_obj.gif | Bin 909 -> 0 bytes .../icons/full/obj16/ext_file_obj.gif | Bin 171 -> 0 bytes .../icons/full/obj16/filenotfound_obj.gif | Bin 165 -> 0 bytes .../icons/full/obj16/folder_obj.gif | Bin 152 -> 0 bytes .../icons/full/obj16/funbrkp_obj.gif | Bin 154 -> 0 bytes .../icons/full/obj16/funbrkpd_obj.gif | Bin 145 -> 0 bytes .../icons/full/obj16/library_obj.gif | Bin 160 -> 0 bytes .../icons/full/obj16/library_syms_obj.gif | Bin 160 -> 0 bytes .../icons/full/obj16/prj_file_obj.gif | Bin 180 -> 0 bytes .../icons/full/obj16/project_obj.gif | Bin 231 -> 0 bytes .../icons/full/obj16/read_obj.gif | Bin 156 -> 0 bytes .../icons/full/obj16/read_obj_disabled.gif | Bin 122 -> 0 bytes .../icons/full/obj16/readwrite_obj.gif | Bin 231 -> 0 bytes .../icons/full/obj16/readwrite_obj_disabled.gif | Bin 135 -> 0 bytes .../icons/full/obj16/register_obj.gif | Bin 118 -> 0 bytes .../icons/full/obj16/registergroup_obj.gif | Bin 255 -> 0 bytes .../icons/full/obj16/showpaths_obj.gif | Bin 147 -> 0 bytes .../icons/full/obj16/signal_obj.gif | Bin 129 -> 0 bytes .../icons/full/obj16/var_aggr.gif | Bin 147 -> 0 bytes .../icons/full/obj16/var_env.gif | Bin 198 -> 0 bytes .../icons/full/obj16/var_global.gif | Bin 132 -> 0 bytes .../icons/full/obj16/var_global_aggr.gif | Bin 147 -> 0 bytes .../icons/full/obj16/var_pointer.gif | Bin 130 -> 0 bytes .../icons/full/obj16/var_simple.gif | Bin 132 -> 0 bytes .../icons/full/obj16/var_simple_aggr.gif | Bin 147 -> 0 bytes .../icons/full/obj16/var_static.gif | Bin 132 -> 0 bytes .../icons/full/obj16/var_static_aggr.gif | Bin 147 -> 0 bytes .../icons/full/obj16/var_string.gif | Bin 71 -> 0 bytes .../icons/full/obj16/vard_aggr.gif | Bin 146 -> 0 bytes .../icons/full/obj16/vard_pointer.gif | Bin 130 -> 0 bytes .../icons/full/obj16/vard_simple.gif | Bin 131 -> 0 bytes .../icons/full/obj16/write_obj.gif | Bin 159 -> 0 bytes .../icons/full/obj16/write_obj_disabled.gif | Bin 125 -> 0 bytes .../icons/full/ovr16/address_ovr.gif | Bin 54 -> 0 bytes .../icons/full/ovr16/address_ovr_disabled.gif | Bin 54 -> 0 bytes .../icons/full/ovr16/argument_ovr.gif | Bin 54 -> 0 bytes .../icons/full/ovr16/castarray_ovr.gif | Bin 822 -> 0 bytes .../icons/full/ovr16/casttype_ovr.gif | Bin 819 -> 0 bytes .../icons/full/ovr16/conditional_ovr.gif | Bin 88 -> 0 bytes .../icons/full/ovr16/conditional_ovr_disabled.gif | Bin 82 -> 0 bytes .../icons/full/ovr16/error_ovr.gif | Bin 84 -> 0 bytes .../icons/full/ovr16/function_ovr.gif | Bin 80 -> 0 bytes .../icons/full/ovr16/function_ovr_disabled.gif | Bin 64 -> 0 bytes .../icons/full/ovr16/installed_ovr.gif | Bin 80 -> 0 bytes .../icons/full/ovr16/installed_ovr_disabled.gif | Bin 80 -> 0 bytes .../icons/full/ovr16/symbols_ovr.gif | Bin 66 -> 0 bytes .../icons/full/ovr16/warning_ovr.gif | Bin 116 -> 0 bytes .../full/wizban/add_dir_source_location_wiz.gif | Bin 2610 -> 0 bytes .../full/wizban/add_prj_source_location_wiz.gif | Bin 2476 -> 0 bytes .../icons/full/wizban/add_source_location_wiz.gif | Bin 2624 -> 0 bytes debug/org.eclipse.cdt.debug.ui/plugin.properties | 85 - debug/org.eclipse.cdt.debug.ui/plugin.xml | 1267 ----- .../internal/ui/CDTDebugModelPresentation.java | 1010 ---- .../debug/internal/ui/CDTValueDetailProvider.java | 46 - .../internal/ui/CDebugImageDescriptorRegistry.java | 96 - .../cdt/debug/internal/ui/CDebugImages.java | 293 -- .../cdt/debug/internal/ui/CDebugUIUtils.java | 83 - .../cdt/debug/internal/ui/ColorManager.java | 58 - .../cdt/debug/internal/ui/ErrorStatusHandler.java | 43 - .../debug/internal/ui/ICDebugHelpContextIds.java | 51 - .../internal/ui/ICDebugUIInternalConstants.java | 45 - .../cdt/debug/internal/ui/InfoStatusHandler.java | 44 - .../cdt/debug/internal/ui/OverlayImageCache.java | 53 - .../debug/internal/ui/OverlayImageDescriptor.java | 120 - .../cdt/debug/internal/ui/PixelConverter.java | 62 - .../debug/internal/ui/QuestionStatusHandler.java | 45 - .../org/eclipse/cdt/debug/internal/ui/SWTUtil.java | 102 - .../ui/actions/AbstractBreakpointRulerAction.java | 163 - .../ui/actions/AbstractDebugActionDelegate.java | 319 -- .../ui/actions/AbstractEditorActionDelegate.java | 220 - .../ui/actions/AbstractListenerActionDelegate.java | 113 - .../AddAddressBreakpointActionDelegate.java | 117 - .../ui/actions/AddExpressionActionDelegate.java | 171 - .../ui/actions/AddGlobalsActionDelegate.java | 393 -- .../ui/actions/AddWatchpointActionDelegate.java | 280 - .../internal/ui/actions/AddWatchpointDialog.java | 189 - .../internal/ui/actions/AutoRefreshAction.java | 66 - .../ui/actions/AutoRefreshMemoryAction.java | 55 - .../ui/actions/BreakpointLocationVerifier.java | 34 - .../ui/actions/CBreakpointPreferencePage.java | 426 -- .../ui/actions/CBreakpointPreferenceStore.java | 338 -- .../ui/actions/CBreakpointPropertiesAction.java | 91 - .../ui/actions/CBreakpointPropertiesDialog.java | 505 -- .../actions/CBreakpointPropertiesRulerAction.java | 58 - .../CBreakpointPropertiesRulerActionDelegate.java | 28 - .../ui/actions/CastToArrayActionDelegate.java | 365 -- .../ui/actions/CastToTypeActionDelegate.java | 188 - .../ui/actions/ChangeRegisterValueAction.java | 271 - .../internal/ui/actions/ClearMemoryAction.java | 54 - .../ui/actions/DebuggerConsoleActionDelegate.java | 105 - .../actions/DecVariableFormatActionDelegate.java | 27 - .../ui/actions/DisableVariablesActionDelegate.java | 23 - .../EnableDisableBreakpointRulerAction.java | 64 - ...EnableDisableBreakpointRulerActionDelegate.java | 17 - .../ui/actions/EnableVariablesActionDelegate.java | 166 - .../internal/ui/actions/ExpressionDialog.java | 141 - .../actions/HexVariableFormatActionDelegate.java | 26 - .../ui/actions/JumpToLineActionDelegate.java | 204 - .../ui/actions/LoadSymbolsActionDelegate.java | 126 - .../ui/actions/LoadSymbolsForAllAction.java | 80 - .../ui/actions/ManageBreakpointActionDelegate.java | 317 -- .../ui/actions/ManageBreakpointRulerAction.java | 311 -- .../ManageBreakpointRulerActionDelegate.java | 29 - .../ManageFunctionBreakpointActionDelegate.java | 148 - .../ui/actions/MemoryActionSelectionGroup.java | 73 - .../internal/ui/actions/MemoryFormatAction.java | 89 - .../ui/actions/MemoryNumberOfColumnAction.java | 74 - .../internal/ui/actions/MemorySizeAction.java | 91 - .../NaturalVariableFormatActionDelegate.java | 27 - .../debug/internal/ui/actions/RefreshAction.java | 72 - .../internal/ui/actions/RefreshMemoryAction.java | 54 - .../internal/ui/actions/RestartActionDelegate.java | 78 - .../actions/RestoreDefaultTypeActionDelegate.java | 133 - .../ui/actions/RunToLineActionDelegate.java | 204 - .../internal/ui/actions/RunToLineRulerAction.java | 173 - .../ui/actions/RunToLineRulerActionDelegate.java | 45 - .../debug/internal/ui/actions/ShowAsciiAction.java | 55 - .../internal/ui/actions/ShowFullPathsAction.java | 63 - .../ui/actions/ShowRegisterTypesAction.java | 97 - .../internal/ui/actions/SignalActionDelegate.java | 129 - .../ui/actions/SignalZeroObjectActionDelegate.java | 123 - .../actions/SignalZeroWorkbenchActionDelegate.java | 64 - .../actions/SwitchToDisassemblyActionDelegate.java | 129 - .../internal/ui/actions/ToggleDelegateAction.java | 186 - .../ui/actions/VariableFormatActionDelegate.java | 132 - .../ui/actions/WatchpointExpressionVerifier.java | 26 - .../ui/dialogfields/CheckedListDialogField.java | 216 - .../internal/ui/dialogfields/ComboDialogField.java | 220 - .../internal/ui/dialogfields/DialogField.java | 221 - .../ui/dialogfields/IDialogFieldListener.java | 17 - .../internal/ui/dialogfields/IListAdapter.java | 22 - .../ui/dialogfields/IStringButtonAdapter.java | 14 - .../debug/internal/ui/dialogfields/LayoutUtil.java | 134 - .../internal/ui/dialogfields/ListDialogField.java | 767 --- .../dialogfields/SelectionButtonDialogField.java | 185 - .../SelectionButtonDialogFieldGroup.java | 249 - .../debug/internal/ui/dialogfields/Separator.java | 87 - .../ui/dialogfields/StringButtonDialogField.java | 135 - .../StringButtonStatusDialogField.java | 160 - .../ui/dialogfields/StringDialogField.java | 153 - .../debug/internal/ui/editors/CDebugEditor.java | 518 -- .../debug/internal/ui/editors/DebugTextHover.java | 206 - .../ui/editors/DisassemblyDocumentProvider.java | 44 - .../internal/ui/editors/DisassemblyEditor.java | 32 - .../ui/editors/DisassemblyEditorInput.java | 142 - .../ui/editors/DisassemblyMarkerAnnotation.java | 55 - .../editors/DisassemblyMarkerAnnotationModel.java | 320 -- .../DisassemblySourceViewerConfiguration.java | 61 - .../internal/ui/editors/EditorInputDelegate.java | 174 - .../internal/ui/editors/FileNotFoundElement.java | 60 - .../ui/editors/NoSymbolOrSourceElement.java | 29 - .../ui/preferences/CDebugPreferencePage.java | 403 -- .../internal/ui/preferences/ComboFieldEditor.java | 194 - .../ui/preferences/ICDebugPreferenceConstants.java | 113 - .../ui/preferences/MemoryViewPreferencePage.java | 161 - .../preferences/RegistersViewPreferencePage.java | 122 - .../SharedLibrariesViewPreferencePage.java | 125 - .../ui/preferences/SourcePreferencePage.java | 233 - .../ui/views/AbstractDebugEventHandler.java | 252 - .../ui/views/AbstractDebugEventHandlerView.java | 54 - .../internal/ui/views/IDebugExceptionHandler.java | 21 - .../cdt/debug/internal/ui/views/ViewerState.java | 60 - .../ui/views/memory/MemoryControlArea.java | 572 --- .../ui/views/memory/MemoryPresentation.java | 535 -- .../debug/internal/ui/views/memory/MemoryText.java | 298 -- .../debug/internal/ui/views/memory/MemoryView.java | 427 -- .../internal/ui/views/memory/MemoryViewAction.java | 81 - .../ui/views/memory/MemoryViewContentProvider.java | 39 - .../ui/views/memory/MemoryViewEventHandler.java | 89 - .../internal/ui/views/memory/MemoryViewer.java | 288 -- .../internal/ui/views/registers/RegistersView.java | 416 -- .../registers/RegistersViewContentProvider.java | 214 - .../views/registers/RegistersViewEventHandler.java | 83 - .../ui/views/registers/RegistersViewer.java | 95 - .../ui/views/sharedlibs/SharedLibrariesView.java | 292 -- .../SharedLibrariesViewContentProvider.java | 166 - .../SharedLibrariesViewEventHandler.java | 77 - .../internal/ui/views/signals/SignalsView.java | 228 - .../views/signals/SignalsViewContentProvider.java | 94 - .../ui/views/signals/SignalsViewEventHandler.java | 80 - .../internal/ui/views/signals/SignalsViewer.java | 150 - .../wizards/AddDirectorySourceLocationBlock.java | 253 - .../wizards/AddDirectorySourceLocationWizard.java | 194 - .../ui/wizards/AddProjectSourceLocationBlock.java | 129 - .../ui/wizards/AddProjectSourceLocationWizard.java | 149 - .../ui/wizards/AddSourceLocationWizard.java | 65 - .../ui/wizards/SourceLocationSelectionPage.java | 222 - .../ui/wizards/SourceLocationWizardNode.java | 61 - .../org/eclipse/cdt/debug/ui/CDebugUIPlugin.java | 531 -- .../eclipse/cdt/debug/ui/ICDebugUIConstants.java | 99 - .../ui/sourcelookup/DefaultSourceLocator.java | 434 -- .../ui/sourcelookup/INewSourceLocationWizard.java | 21 - .../ui/sourcelookup/SourceListDialogField.java | 213 - .../debug/ui/sourcelookup/SourceLookupBlock.java | 526 -- .../ui/sourcelookup/SourceLookupLabelProvider.java | 65 - .../debug/ui/sourcelookup/SourcePropertyPage.java | 152 - doc/org.eclipse.cdt.doc.isv/.project | 11 - doc/org.eclipse.cdt.doc.user/.project | 22 - doc/org.eclipse.cdt.doc.user/build.properties | 13 - doc/org.eclipse.cdt.doc.user/build.xml | 57 - .../concepts/cdt_c_build_over.htm | 96 - .../concepts/cdt_c_comments.htm | 40 - .../concepts/cdt_c_content_assist.htm | 93 - .../concepts/cdt_c_dbg_info.htm | 84 - .../concepts/cdt_c_open_declarations.htm | 58 - .../concepts/cdt_c_outlineview.htm | 97 - .../concepts/cdt_c_over_cdt.htm | 87 - .../concepts/cdt_c_over_dbg.htm | 46 - .../concepts/cdt_c_proj_file_views.htm | 58 - .../concepts/cdt_c_projects.htm | 128 - .../concepts/cdt_c_search.htm | 226 - .../concepts/cdt_c_whatsnew.htm | 96 - .../concepts/cdt_o_build_conc.htm | 39 - .../concepts/cdt_o_code_entry.htm | 51 - .../concepts/cdt_o_concepts.htm | 61 - .../concepts/cdt_o_dbg_concepts.htm | 40 - .../concepts/cdt_o_home.htm | 45 - .../concepts/cdt_o_projects.htm | 39 - doc/org.eclipse.cdt.doc.user/contextHelp.xml | 170 - doc/org.eclipse.cdt.doc.user/contexts_CDT.xml | 72 - .../contexts_CDT_DEBUGGER.xml | 62 - .../contexts_CDT_DEBUGGER_MI.xml | 22 - .../contexts_CDT_LAUNCH.xml | 48 - doc/org.eclipse.cdt.doc.user/contexts_CDT_make.xml | 30 - doc/org.eclipse.cdt.doc.user/doc.zip | Bin 210835 -> 0 bytes .../getting_started/_vti_cnf/cdt_w_build.htm | 25 - .../getting_started/_vti_cnf/cdt_w_debug.htm | 25 - .../_vti_cnf/cdt_w_existing_code.htm | 25 - .../getting_started/_vti_cnf/cdt_w_newcpp.htm | 25 - .../getting_started/_vti_cnf/cdt_w_newmake.htm | 25 - .../getting_started/_vti_cnf/cdt_w_newproj.htm | 25 - .../getting_started/cdt_o_tutorial.htm | 66 - .../getting_started/cdt_w_build.htm | 60 - .../getting_started/cdt_w_debug.htm | 74 - .../getting_started/cdt_w_existing_code.htm | 86 - .../getting_started/cdt_w_newcpp.htm | 107 - .../getting_started/cdt_w_newmake.htm | 77 - .../getting_started/cdt_w_newproj.htm | 62 - doc/org.eclipse.cdt.doc.user/help.css | 52 - .../images/alphab_sort_co.gif | Bin 224 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/c_file_obj.gif | Bin 165 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/class_obj.gif | Bin 160 -> 0 bytes .../images/container_obj.gif | Bin 122 -> 0 bytes .../images/contents_view.gif | Bin 169 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/define_obj.gif | Bin 109 -> 0 bytes .../images/editor_c_codetemplates_use.gif | Bin 52610 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/enum_obj.gif | Bin 910 -> 0 bytes .../images/enumerator_obj.gif | Bin 853 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/error_icon.gif | Bin 920 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/field_obj.gif | Bin 76 -> 0 bytes .../images/field_private_obj.gif | Bin 88 -> 0 bytes .../images/field_protected_obj.gif | Bin 88 -> 0 bytes .../images/field_public_obj.gif | Bin 92 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/fields_co.gif | Bin 160 -> 0 bytes .../images/filterbutton.gif | Bin 166 -> 0 bytes .../images/function_obj.gif | Bin 97 -> 0 bytes .../images/icon_breakpoint_obj.gif | Bin 140 -> 0 bytes .../images/icon_debug_exc.gif | Bin 166 -> 0 bytes .../images/icon_debugt_obj.gif | Bin 179 -> 0 bytes .../images/icon_disconnect.gif | Bin 146 -> 0 bytes .../images/icon_installed_ovr.gif | Bin 80 -> 0 bytes .../images/icon_memory_update.gif | Bin 568 -> 0 bytes .../images/icon_relaunch.gif | Bin 216 -> 0 bytes .../images/icon_remove_all.gif | Bin 117 -> 0 bytes .../images/icon_run_exc.gif | Bin 125 -> 0 bytes .../images/icon_stackframe.gif | Bin 100 -> 0 bytes .../images/icon_stackframe_running.gif | Bin 149 -> 0 bytes .../images/icon_terminate.gif | Bin 109 -> 0 bytes .../images/icon_terminate_all.gif | Bin 130 -> 0 bytes .../images/icon_terminate_rem.gif | Bin 159 -> 0 bytes .../images/icon_thread1.gif | Bin 162 -> 0 bytes .../images/icon_thread2.gif | Bin 215 -> 0 bytes .../images/icon_thread3.gif | Bin 212 -> 0 bytes .../images/icon_watchpoint_readwrite_obj.gif | Bin 231 -> 0 bytes .../images/include_obj.gif | Bin 114 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/makefile.gif | Bin 571 -> 0 bytes .../images/method_private_obj.gif | Bin 94 -> 0 bytes .../images/method_protected_obj.gif | Bin 92 -> 0 bytes .../images/method_public_obj.gif | Bin 97 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ng03_04.gif | Bin 1195 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ng2003.gif | Bin 1941 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ngback.gif | Bin 222 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ngconcepts.gif | Bin 1267 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ngnext.gif | Bin 223 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ngref.gif | Bin 1280 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ngtasks.gif | Bin 1217 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ngtopics.gif | Bin 1226 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/public_co.gif | Bin 97 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/ref-79.gif | Bin 88 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/static_co.gif | Bin 111 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/struct_obj.gif | Bin 133 -> 0 bytes .../images/template_obj.gif | Bin 917 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/toc_closed.gif | Bin 158 -> 0 bytes .../images/typedef_obj.gif | Bin 910 -> 0 bytes doc/org.eclipse.cdt.doc.user/images/union_obj.gif | Bin 173 -> 0 bytes .../images/var_declaration_obj.gif | Bin 895 -> 0 bytes .../images/warning_icon.gif | Bin 898 -> 0 bytes doc/org.eclipse.cdt.doc.user/plugin.properties | 13 - doc/org.eclipse.cdt.doc.user/plugin.xml | 80 - .../raw/hackedguide/about.html | 115 - .../raw/hackedguide/cdev.html | 812 --- .../raw/hackedguide/conc.html | 273 - .../raw/hackedguide/cvs.html | 130 - .../raw/hackedguide/cwiz.html | 470 -- .../raw/hackedguide/dbug.html | 942 ---- .../raw/hackedguide/image-lib/caution.gif | Bin 1175 -> 0 bytes .../raw/hackedguide/image-lib/onestep.gif | Bin 978 -> 0 bytes .../raw/hackedguide/image-lib/pointing.gif | Bin 174 -> 0 bytes .../raw/hackedguide/images/cwiz.jpg | Bin 37591 -> 0 bytes .../raw/hackedguide/images/cwiz_c.jpg | Bin 25742 -> 0 bytes .../raw/hackedguide/images/cwiz_c_architecture.jpg | Bin 39198 -> 0 bytes .../hackedguide/images/cwiz_c_buildsettings.jpg | Bin 34696 -> 0 bytes .../raw/hackedguide/images/cwiz_c_library.jpg | Bin 36644 -> 0 bytes .../raw/hackedguide/images/cwiz_c_options.jpg | Bin 33662 -> 0 bytes .../raw/hackedguide/images/cwiz_c_projects.jpg | Bin 35923 -> 0 bytes .../raw/hackedguide/images/cwiz_convert_1.jpg | Bin 37851 -> 0 bytes .../raw/hackedguide/images/cwiz_target.jpg | Bin 43826 -> 0 bytes .../raw/hackedguide/images/editor_c.jpg | Bin 37492 -> 0 bytes .../images/editor_c_codetemplates_use.jpg | Bin 41261 -> 0 bytes .../hackedguide/images/editor_c_contentassist.jpg | Bin 42032 -> 0 bytes .../raw/hackedguide/images/editor_c_helloworld.jpg | Bin 20767 -> 0 bytes .../raw/hackedguide/images/editor_c_hoverhelp.jpg | Bin 34016 -> 0 bytes .../raw/hackedguide/images/findit | 13 - .../raw/hackedguide/images/first_look.jpg | Bin 111220 -> 0 bytes .../raw/hackedguide/images/icon_breakpoint_obj.gif | Bin 140 -> 0 bytes .../raw/hackedguide/images/icon_debug_exc.gif | Bin 166 -> 0 bytes .../hackedguide/images/icon_debugger_console.gif | Bin 166 -> 0 bytes .../raw/hackedguide/images/icon_debugt_obj.gif | Bin 179 -> 0 bytes .../raw/hackedguide/images/icon_disassembly.gif | Bin 161 -> 0 bytes .../raw/hackedguide/images/icon_disconnect.gif | Bin 146 -> 0 bytes .../raw/hackedguide/images/icon_error_obj.gif | Bin 159 -> 0 bytes .../raw/hackedguide/images/icon_filter_tsk.gif | Bin 159 -> 0 bytes .../raw/hackedguide/images/icon_installed_ovr.gif | Bin 80 -> 0 bytes .../raw/hackedguide/images/icon_memory_update.gif | Bin 568 -> 0 bytes .../raw/hackedguide/images/icon_menu.gif | Bin 88 -> 0 bytes .../raw/hackedguide/images/icon_newccqnx_app.gif | Bin 586 -> 0 bytes .../raw/hackedguide/images/icon_newccqnx_lib.gif | Bin 364 -> 0 bytes .../raw/hackedguide/images/icon_newcqnx_app.gif | Bin 582 -> 0 bytes .../raw/hackedguide/images/icon_newcqnx_lib.gif | Bin 381 -> 0 bytes .../raw/hackedguide/images/icon_next_error_nav.gif | Bin 160 -> 0 bytes .../raw/hackedguide/images/icon_prev_error_nav.gif | Bin 160 -> 0 bytes .../raw/hackedguide/images/icon_relaunch.gif | Bin 216 -> 0 bytes .../raw/hackedguide/images/icon_remove_all.gif | Bin 117 -> 0 bytes .../raw/hackedguide/images/icon_restart.gif | Bin 182 -> 0 bytes .../raw/hackedguide/images/icon_resume.gif | Bin 128 -> 0 bytes .../raw/hackedguide/images/icon_run_exc.gif | Bin 125 -> 0 bytes .../raw/hackedguide/images/icon_stackframe.gif | Bin 100 -> 0 bytes .../hackedguide/images/icon_stackframe_running.gif | Bin 149 -> 0 bytes .../raw/hackedguide/images/icon_stepinto.gif | Bin 144 -> 0 bytes .../raw/hackedguide/images/icon_stepover.gif | Bin 159 -> 0 bytes .../raw/hackedguide/images/icon_stepreturn.gif | Bin 144 -> 0 bytes .../raw/hackedguide/images/icon_suspend.gif | Bin 102 -> 0 bytes .../raw/hackedguide/images/icon_terminate.gif | Bin 109 -> 0 bytes .../raw/hackedguide/images/icon_terminate_all.gif | Bin 130 -> 0 bytes .../raw/hackedguide/images/icon_terminate_rem.gif | Bin 159 -> 0 bytes .../raw/hackedguide/images/icon_thread1.gif | Bin 162 -> 0 bytes .../raw/hackedguide/images/icon_thread2.gif | Bin 215 -> 0 bytes .../raw/hackedguide/images/icon_thread3.gif | Bin 212 -> 0 bytes .../raw/hackedguide/images/icon_tnames.gif | Bin 181 -> 0 bytes .../raw/hackedguide/images/icon_warning_obj.gif | Bin 139 -> 0 bytes .../images/icon_watchpoint_read_obj.gif | Bin 156 -> 0 bytes .../images/icon_watchpoint_readwrite_obj.gif | Bin 231 -> 0 bytes .../images/icon_watchpoint_write_obj.gif | Bin 159 -> 0 bytes .../raw/hackedguide/images/lnch.jpg | Bin 65022 -> 0 bytes .../raw/hackedguide/images/lnch_arguments.jpg | Bin 60651 -> 0 bytes .../raw/hackedguide/images/lnch_common.jpg | Bin 61972 -> 0 bytes .../raw/hackedguide/images/lnch_customize.jpg | Bin 49930 -> 0 bytes .../raw/hackedguide/images/lnch_debug_debug.jpg | Bin 25295 -> 0 bytes .../raw/hackedguide/images/lnch_debugger.jpg | Bin 58753 -> 0 bytes .../raw/hackedguide/images/lnch_environment.jpg | Bin 63658 -> 0 bytes .../raw/hackedguide/images/lnch_main.jpg | Bin 65379 -> 0 bytes .../raw/hackedguide/images/lnch_run2_faster.jpg | Bin 22266 -> 0 bytes .../raw/hackedguide/images/lnch_run_run.jpg | Bin 26132 -> 0 bytes .../images/persp_dbug_properties_options.jpg | Bin 42118 -> 0 bytes .../raw/hackedguide/images/view_breakpoints.jpg | Bin 11146 -> 0 bytes .../hackedguide/images/view_breakpoints_added.jpg | Bin 27495 -> 0 bytes .../hackedguide/images/view_breakpoints_adding.jpg | Bin 27588 -> 0 bytes .../images/view_breakpoints_disable.jpg | Bin 31503 -> 0 bytes .../hackedguide/images/view_breakpoints_prop.jpg | Bin 19741 -> 0 bytes .../images/view_breakpoints_watch_add.jpg | Bin 12063 -> 0 bytes .../raw/hackedguide/images/view_cbuild.jpg | Bin 135021 -> 0 bytes .../images/view_cbuild_configurations.jpg | Bin 36766 -> 0 bytes .../raw/hackedguide/images/view_console.jpg | Bin 18891 -> 0 bytes .../raw/hackedguide/images/view_console_gdb.jpg | Bin 38052 -> 0 bytes .../hackedguide/images/view_console_gdb_using.jpg | Bin 30334 -> 0 bytes .../hackedguide/images/view_console_helloworld.jpg | Bin 15877 -> 0 bytes .../raw/hackedguide/images/view_cprojects.jpg | Bin 16545 -> 0 bytes .../hackedguide/images/view_cprojects_building.jpg | Bin 27046 -> 0 bytes .../hackedguide/images/view_cprojects_filter.jpg | Bin 16496 -> 0 bytes .../images/view_cprojects_outline_executable.jpg | Bin 24436 -> 0 bytes .../images/view_cprojects_outline_source.jpg | Bin 15753 -> 0 bytes .../images/view_cprojects_target_add.jpg | Bin 11010 -> 0 bytes .../images/view_cprojects_target_use.jpg | Bin 33421 -> 0 bytes .../raw/hackedguide/images/view_debug.jpg | Bin 30339 -> 0 bytes .../hackedguide/images/view_debug_runtoline.jpg | Bin 58190 -> 0 bytes .../raw/hackedguide/images/view_expressions.jpg | Bin 13342 -> 0 bytes .../hackedguide/images/view_expressions_add.jpg | Bin 8659 -> 0 bytes .../raw/hackedguide/images/view_memory.jpg | Bin 70162 -> 0 bytes .../raw/hackedguide/images/view_memory_change.jpg | Bin 47147 -> 0 bytes .../hackedguide/images/view_memory_configure.jpg | Bin 93858 -> 0 bytes .../raw/hackedguide/images/view_outline.jpg | Bin 8486 -> 0 bytes .../raw/hackedguide/images/view_registers.jpg | Bin 22796 -> 0 bytes .../raw/hackedguide/images/view_tasks.jpg | Bin 33764 -> 0 bytes .../hackedguide/images/view_tasks_filter_tasks.jpg | Bin 41211 -> 0 bytes .../hackedguide/images/view_tasks_new_tasks.jpg | Bin 21865 -> 0 bytes .../raw/hackedguide/images/view_variables.jpg | Bin 11136 -> 0 bytes .../images/view_variables_customize.jpg | Bin 44263 -> 0 bytes .../images/window_preferences_c_codetemplates.jpg | Bin 65851 -> 0 bytes .../images/window_preferences_workbench.jpg | Bin 47675 -> 0 bytes .../raw/hackedguide/lnch.html | 457 -- .../reference/cdt_o_ceditor_pref.htm | 62 - .../reference/cdt_o_dbg_view.htm | 60 - .../reference/cdt_o_proj_prop_pages.htm | 51 - .../reference/cdt_o_ref.htm | 51 - .../reference/cdt_o_run_dbg_pages.htm | 60 - .../reference/cdt_o_views.htm | 40 - .../reference/cdt_u_c_editor_anno.htm | 46 - .../reference/cdt_u_c_editor_color.htm | 47 - .../reference/cdt_u_c_editor_con_assist.htm | 52 - .../reference/cdt_u_c_editor_gen.htm | 58 - .../reference/cdt_u_code_temp.htm | 57 - .../reference/cdt_u_dbg_pref.htm | 52 - .../reference/cdt_u_dbg_view.htm | 123 - .../reference/cdt_u_gdb_mi_pref.htm | 23 - .../reference/cdt_u_icons.htm | 141 - .../reference/cdt_u_mem_view_pref.htm | 51 - .../reference/cdt_u_memoryview.htm | 51 - .../reference/cdt_u_newproj_buildset.htm | 62 - .../reference/cdt_u_newproj_parser_binary.htm | 42 - .../reference/cdt_u_newproj_parser_error.htm | 49 - .../reference/cdt_u_newproj_pathsymb.htm | 57 - .../reference/cdt_u_newproj_platf.htm | 44 - .../reference/cdt_u_outlineview.htm | 149 - .../reference/cdt_u_reg_view_pref.htm | 27 - .../reference/cdt_u_registersview.htm | 58 - .../reference/cdt_u_run_dbg_arg.htm | 48 - .../reference/cdt_u_run_dbg_comm.htm | 54 - .../reference/cdt_u_run_dbg_dbg.htm | 50 - .../reference/cdt_u_run_dbg_env.htm | 49 - .../reference/cdt_u_run_dbg_main.htm | 42 - .../reference/cdt_u_run_dbg_srce.htm | 56 - .../reference/cdt_u_search.htm | 78 - .../reference/cdt_u_shared_lib_view.htm | 47 - .../reference/cdt_u_shared_lib_view_pref.htm | 23 - .../reference/cdt_u_signals_view.htm | 46 - .../tasks/cdt_o_brkpnts_watch.htm | 50 - .../tasks/cdt_o_build_task.htm | 97 - .../tasks/cdt_o_con_assist.htm | 45 - doc/org.eclipse.cdt.doc.user/tasks/cdt_o_debug.htm | 72 - .../tasks/cdt_o_proj_files.htm | 54 - .../tasks/cdt_o_proj_prop.htm | 66 - doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm | 45 - .../tasks/cdt_o_run_config.htm | 88 - doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm | 54 - .../tasks/cdt_o_tasksview.htm | 44 - .../tasks/cdt_o_tutorial.htm | 66 - .../tasks/cdt_o_write_code.htm | 59 - .../tasks/cdt_t_add_brkpnts.htm | 49 - .../tasks/cdt_t_add_codetemp.htm | 77 - .../tasks/cdt_t_add_watch.htm | 62 - .../tasks/cdt_t_addmaketarget.htm | 68 - .../tasks/cdt_t_autosave.htm | 45 - .../tasks/cdt_t_build_process.htm | 35 - .../tasks/cdt_t_cbuild_pref.htm | 42 - .../tasks/cdt_t_comment_out.htm | 51 - .../tasks/cdt_t_contentassist.htm | 83 - .../tasks/cdt_t_controldebug.htm | 51 - .../tasks/cdt_t_conv_proj.htm | 47 - .../tasks/cdt_t_cust_cpp_editor.htm | 53 - .../tasks/cdt_t_debug_prog.htm | 83 - .../tasks/cdt_t_disassembly.htm | 46 - .../tasks/cdt_t_endis_able_brk_wtch.htm | 49 - .../tasks/cdt_t_expressions.htm | 44 - .../tasks/cdt_t_filtererror.htm | 55 - .../tasks/cdt_t_imp_code_temp.htm | 77 - .../tasks/cdt_t_jumperror.htm | 55 - .../tasks/cdt_t_manualbuild.htm | 63 - .../tasks/cdt_t_memory.htm | 68 - .../tasks/cdt_t_new_cpp.htm | 55 - .../tasks/cdt_t_new_make.htm | 49 - .../tasks/cdt_t_new_run_config.htm | 45 - .../tasks/cdt_t_open_declarations.htm | 48 - .../tasks/cdt_t_proj_build_set.htm | 100 - .../tasks/cdt_t_proj_error_parser.htm | 57 - .../tasks/cdt_t_proj_new.htm | 54 - .../tasks/cdt_t_proj_parser.htm | 60 - .../tasks/cdt_t_proj_paths.htm | 63 - .../tasks/cdt_t_proj_platf.htm | 47 - .../tasks/cdt_t_proj_ref.htm | 51 - .../tasks/cdt_t_proj_rename.htm | 43 - .../tasks/cdt_t_prvw_hide_files.htm | 45 - .../tasks/cdt_t_registers.htm | 62 - .../tasks/cdt_t_rem_wtch_brk.htm | 51 - .../tasks/cdt_t_run_arg.htm | 59 - .../tasks/cdt_t_run_com.htm | 64 - .../tasks/cdt_t_run_config.htm | 41 - .../tasks/cdt_t_run_dbg.htm | 62 - .../tasks/cdt_t_run_env.htm | 64 - .../tasks/cdt_t_run_main.htm | 64 - .../tasks/cdt_t_run_source.htm | 67 - .../tasks/cdt_t_search.htm | 81 - .../tasks/cdt_t_setbuildorder.htm | 62 - .../tasks/cdt_t_setreminder.htm | 52 - .../tasks/cdt_t_shift_code.htm | 48 - .../tasks/cdt_t_show_proj_files.htm | 54 - .../tasks/cdt_t_update_man.htm | 42 - .../tasks/cdt_t_variables.htm | 63 - doc/org.eclipse.cdt.doc.user/toc.xml | 19 - doc/org.eclipse.cdt.doc.user/topics_Concepts.xml | 27 - .../topics_Getting_Started.xml | 11 - doc/org.eclipse.cdt.doc.user/topics_Reference.xml | 42 - doc/org.eclipse.cdt.doc.user/topics_Tasks.xml | 72 - launch/org.eclipse.cdt.launch/.classpath | 7 - launch/org.eclipse.cdt.launch/.cvsignore | 1 - launch/org.eclipse.cdt.launch/.project | 37 - launch/org.eclipse.cdt.launch/ChangeLog | 355 -- launch/org.eclipse.cdt.launch/about.html | 30 - launch/org.eclipse.cdt.launch/build.properties | 13 - launch/org.eclipse.cdt.launch/icons/c_app.gif | Bin 862 -> 0 bytes .../icons/tabs/arguments_tab.gif | Bin 108 -> 0 bytes .../icons/tabs/debugger_tab.gif | Bin 166 -> 0 bytes .../icons/tabs/environment_tab.gif | Bin 198 -> 0 bytes .../org.eclipse.cdt.launch/icons/tabs/main_tab.gif | Bin 152 -> 0 bytes .../icons/tabs/source_tab.gif | Bin 157 -> 0 bytes launch/org.eclipse.cdt.launch/plugin.properties | 15 - launch/org.eclipse.cdt.launch/plugin.xml | 90 - .../cdt/launch/AbstractCLaunchDelegate.java | 554 -- .../internal/CApplicationLaunchShortcut.java | 349 -- .../launch/internal/CoreFileLaunchDelegate.java | 112 - .../LocalCLaunchConfigurationDelegate.java | 245 - .../launch/internal/ui/AbstractCDebuggerTab.java | 223 - .../ui/CoreFileCLaunchConfigurationTabGroup.java | 39 - .../cdt/launch/internal/ui/LaunchImages.java | 81 - .../cdt/launch/internal/ui/LaunchUIPlugin.java | 209 - .../ui/LocalCLaunchConfigurationTabGroup.java | 35 - .../launch/internal/ui/WorkingDirectoryBlock.java | 417 -- .../org/eclipse/cdt/launch/ui/CArgumentsTab.java | 186 - .../org/eclipse/cdt/launch/ui/CDebuggerTab.java | 318 -- .../org/eclipse/cdt/launch/ui/CEnvironmentTab.java | 397 -- .../cdt/launch/ui/CLaunchConfigurationTab.java | 133 - .../src/org/eclipse/cdt/launch/ui/CMainTab.java | 429 -- .../eclipse/cdt/launch/ui/CSourceLookupTab.java | 120 - .../eclipse/cdt/launch/ui/CorefileDebuggerTab.java | 187 - .../cdt/launch/ui/ICDTLaunchHelpContextIds.java | 24 - releng/org.eclipse.cdt-feature/.project | 28 - releng/org.eclipse.cdt-feature/build.properties | 10 - releng/org.eclipse.cdt-feature/cpl-v10.html | 125 - .../org.eclipse.cdt-feature/eclipse_update_120.jpg | Bin 14641 -> 0 bytes releng/org.eclipse.cdt-feature/feature.properties | 99 - releng/org.eclipse.cdt-feature/feature.xml | 92 - releng/org.eclipse.cdt-feature/license.html | 53 - releng/org.eclipse.cdt.testing-feature/.project | 22 - .../build.properties | 5 - .../org.eclipse.cdt.testing-feature/cpl-v10.html | 125 - .../eclipse_update_120.jpg | Bin 14641 -> 0 bytes .../feature.properties | 99 - releng/org.eclipse.cdt.testing-feature/feature.xml | 71 - .../org.eclipse.cdt.testing-feature/license.html | 53 - releng/org.eclipse.cdt.testing/.project | 22 - releng/org.eclipse.cdt.testing/about.html | 30 - releng/org.eclipse.cdt.testing/about.ini | 27 - releng/org.eclipse.cdt.testing/about.mappings | 9 - releng/org.eclipse.cdt.testing/about.properties | 14 - releng/org.eclipse.cdt.testing/build.properties | 13 - releng/org.eclipse.cdt.testing/cpl-v10.html | 125 - releng/org.eclipse.cdt.testing/eclipse32.gif | Bin 1750 -> 0 bytes releng/org.eclipse.cdt.testing/notice.html | 53 - releng/org.eclipse.cdt.testing/plugin.properties | 2 - releng/org.eclipse.cdt.testing/plugin.xml | 12 - releng/org.eclipse.cdt/.eclipseproduct | 4 - releng/org.eclipse.cdt/.project | 22 - releng/org.eclipse.cdt/about.html | 30 - releng/org.eclipse.cdt/about.ini | 27 - releng/org.eclipse.cdt/about.mappings | 9 - releng/org.eclipse.cdt/about.properties | 13 - releng/org.eclipse.cdt/build.properties | 25 - releng/org.eclipse.cdt/cpl-v10.html | 125 - releng/org.eclipse.cdt/eclipse32.gif | Bin 1750 -> 0 bytes releng/org.eclipse.cdt/notice.html | 53 - releng/org.eclipse.cdt/plugin.properties | 2 - releng/org.eclipse.cdt/plugin.xml | 12 - releng/org.eclipse.cdt/welcome.xml | 29 - 2955 files changed, 316372 deletions(-) delete mode 100644 build/org.eclipse.cdt.make.core/.classpath delete mode 100644 build/org.eclipse.cdt.make.core/.cvsignore delete mode 100644 build/org.eclipse.cdt.make.core/.project delete mode 100644 build/org.eclipse.cdt.make.core/about.html delete mode 100644 build/org.eclipse.cdt.make.core/build.properties delete mode 100644 build/org.eclipse.cdt.make.core/builtin/gnu.mk delete mode 100644 build/org.eclipse.cdt.make.core/builtin/posix.mk delete mode 100644 build/org.eclipse.cdt.make.core/plugin.properties delete mode 100644 build/org.eclipse.cdt.make.core/plugin.xml delete mode 100644 build/org.eclipse.cdt.make.core/schema/MakeTargetBuilder.exsd delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeBuilderInfo.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTarget.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetListener.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeTargetEvent.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/PluginResources.properties delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IArchiveTarget.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IBadDirective.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ICommand.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IComment.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDefaultRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IEmptyLine.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IIgnoreRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IInferenceRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMacroDefinition.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefile.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefileValidator.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IParent.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPosixRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPreciousRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISccsGetRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISilentRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISpecialRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISuffixesRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITargetRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IConditional.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IDeleteOnErrorRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IExportAllVariablesRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IGNUMakefile.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IInclude.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IIntermediateRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ILowResolutionTimeRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/INotParallelRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IPhonyRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ISecondaryRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ITerminal.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IUnExport.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVPath.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVariableDefinition.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ListenerList.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeRecon.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/StreamMonitor.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/ArchiveTarget.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/BadDirective.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/DefaultRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/IgnoreRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/InferenceRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MakefileReader.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PosixRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PreciousRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SccsGetRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SilentRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SuffixesRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Target.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DefineVariable.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DeleteOnErrorRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Else.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endef.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endif.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportAllVariablesRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportVariable.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileUtil.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUTargetRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifdef.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifeq.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifndef.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifneq.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/IntermediateRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/LowResolutionTimeRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/NotParallelRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideDefine.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideVariable.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/PhonyRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/SecondaryRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/StaticTargetRule.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/TargetVariable.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java delete mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java delete mode 100644 build/org.eclipse.cdt.make.ui/.classpath delete mode 100644 build/org.eclipse.cdt.make.ui/.cvsignore delete mode 100644 build/org.eclipse.cdt.make.ui/.project delete mode 100644 build/org.eclipse.cdt.make.ui/about.html delete mode 100644 build/org.eclipse.cdt.make.ui/build.properties delete mode 100644 build/org.eclipse.cdt.make.ui/icons/actions/build_menu.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/alphab_sort_co.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/convert-normal.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/make.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/makefile.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/newc_app.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/newcc_app.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/segment_edit.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/target_add.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/target_build.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/target_delete.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/target_edit.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/ctool16/update_old.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/cview16/make_target.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/dtool16/alphab_sort_co.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/dtool16/segment_edit.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/dtool16/target_add.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/dtool16/target_build.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/dtool16/target_delete.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/dtool16/target_edit.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/etool16/alphab_sort_co.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/etool16/segment_edit.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/etool16/target_add.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/etool16/target_build.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/etool16/target_delete.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/etool16/target_edit.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/command_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/error_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/include_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/irule_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/macro_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/relation_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/target_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/obj16/trule_obj.gif delete mode 100644 build/org.eclipse.cdt.make.ui/icons/wizban/newcprj_wiz.gif delete mode 100644 build/org.eclipse.cdt.make.ui/plugin.properties delete mode 100644 build/org.eclipse.cdt.make.ui/plugin.xml delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/ErrorParserBlock.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeProjectOptionBlock.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MessageLine.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileDocumentProvider.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorTogglePresentationAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPart.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPartWithButtons.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/StructuredViewerPart.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakePreferencePage.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/properties/MakePropertyPage.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/IMakefileColorManager.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/MakefileColorManager.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileMacroScanner.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileSimpleMacroRule.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileWordDetector.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/wizards/StatusWizardPage.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManager.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManagerExtension.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeLabelProvider.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetListViewerPart.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildTargetDialog.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/AddTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/BuildTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/EditTargetAction.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizard.java delete mode 100644 build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/.classpath delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/.cvsignore delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/.project delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/ChangeLog delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/about.html delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/build.properties delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/plugin.properties delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/plugin.xml delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildException.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/.classpath delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/.cvsignore delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/.project delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/ChangeLog delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/about.html delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/build.properties delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-buildconfig.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-deleteconfig.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-editconfig.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-newconfig.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/build_configs.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-category.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-compiler.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-debug.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-librarian.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-linker.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-preprocessor.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-profile.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-release.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-tool.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngc_app.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngcc_app.gif delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/plugin.properties delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/plugin.xml delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedProjectOptionBlock.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationContentProvider.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationLabelProvider.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCCProjectWizard.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java delete mode 100644 build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java delete mode 100644 core/org.eclipse.cdt.core.aix/.classpath delete mode 100644 core/org.eclipse.cdt.core.aix/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.aix/.project delete mode 100644 core/org.eclipse.cdt.core.aix/.template delete mode 100644 core/org.eclipse.cdt.core.aix/build.properties delete mode 100644 core/org.eclipse.cdt.core.aix/fragment.properties delete mode 100644 core/org.eclipse.cdt.core.aix/fragment.xml delete mode 100644 core/org.eclipse.cdt.core.aix/library/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.aix/library/Makefile delete mode 100644 core/org.eclipse.cdt.core.aix/library/PTY.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/PTYInputStream.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/PTYOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/Spawner.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/SpawnerInputStream.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/SpawnerOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/exec0.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/exec_unix.c delete mode 100644 core/org.eclipse.cdt.core.aix/library/io.c delete mode 100644 core/org.eclipse.cdt.core.aix/library/openpty.c delete mode 100644 core/org.eclipse.cdt.core.aix/library/openpty.h delete mode 100644 core/org.eclipse.cdt.core.aix/library/pfind.c delete mode 100644 core/org.eclipse.cdt.core.aix/library/pty.c delete mode 100644 core/org.eclipse.cdt.core.aix/library/ptyio.c delete mode 100644 core/org.eclipse.cdt.core.aix/library/spawner.c delete mode 100644 core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessInfo.java delete mode 100644 core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessList.java delete mode 100644 core/org.eclipse.cdt.core.linux/.classpath delete mode 100644 core/org.eclipse.cdt.core.linux/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.linux/.project delete mode 100644 core/org.eclipse.cdt.core.linux/ChangeLog delete mode 100644 core/org.eclipse.cdt.core.linux/build.properties delete mode 100644 core/org.eclipse.cdt.core.linux/fragment.properties delete mode 100644 core/org.eclipse.cdt.core.linux/fragment.xml delete mode 100644 core/org.eclipse.cdt.core.linux/library/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.linux/library/Makefile delete mode 100644 core/org.eclipse.cdt.core.linux/library/PTY.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/PTYInputStream.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/PTYOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/Spawner.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/exec0.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/exec_unix.c delete mode 100644 core/org.eclipse.cdt.core.linux/library/io.c delete mode 100644 core/org.eclipse.cdt.core.linux/library/openpty.c delete mode 100644 core/org.eclipse.cdt.core.linux/library/openpty.h delete mode 100644 core/org.eclipse.cdt.core.linux/library/pfind.c delete mode 100644 core/org.eclipse.cdt.core.linux/library/pty.c delete mode 100644 core/org.eclipse.cdt.core.linux/library/ptyio.c delete mode 100644 core/org.eclipse.cdt.core.linux/library/spawner.c delete mode 100644 core/org.eclipse.cdt.core.linux/os/linux/x86/libpty.so delete mode 100644 core/org.eclipse.cdt.core.linux/os/linux/x86/libspawner.so delete mode 100644 core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessInfo.java delete mode 100644 core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessList.java delete mode 100644 core/org.eclipse.cdt.core.qnx/.classpath delete mode 100644 core/org.eclipse.cdt.core.qnx/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.qnx/.project delete mode 100644 core/org.eclipse.cdt.core.qnx/ChangeLog delete mode 100644 core/org.eclipse.cdt.core.qnx/build.properties delete mode 100644 core/org.eclipse.cdt.core.qnx/fragment.properties delete mode 100644 core/org.eclipse.cdt.core.qnx/fragment.xml delete mode 100644 core/org.eclipse.cdt.core.qnx/library/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.qnx/library/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/PTY.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/PTYInputStream.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/PTYOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/common.mk delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/openpty.c delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/openpty.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/pty.c delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/ptyio.c delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/x86/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/library/pty/x86/so/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/Spawner.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerInputStream.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/common.mk delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/iostream.c delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/x86/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/library/spawner/x86/so/Makefile delete mode 100644 core/org.eclipse.cdt.core.qnx/os/qnx/x86/libpty.so delete mode 100644 core/org.eclipse.cdt.core.qnx/os/qnx/x86/libspawner.so delete mode 100644 core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessInfo.java delete mode 100644 core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessList.java delete mode 100644 core/org.eclipse.cdt.core.solaris/.classpath delete mode 100644 core/org.eclipse.cdt.core.solaris/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.solaris/.project delete mode 100644 core/org.eclipse.cdt.core.solaris/ChangeLog delete mode 100644 core/org.eclipse.cdt.core.solaris/build.properties delete mode 100644 core/org.eclipse.cdt.core.solaris/fragment.properties delete mode 100644 core/org.eclipse.cdt.core.solaris/fragment.xml delete mode 100644 core/org.eclipse.cdt.core.solaris/library/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.solaris/library/Makefile delete mode 100644 core/org.eclipse.cdt.core.solaris/library/PTY.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/PTYInputStream.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/PTYOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/Spawner.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/SpawnerInputStream.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/SpawnerOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/exec0.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/exec_unix.c delete mode 100644 core/org.eclipse.cdt.core.solaris/library/io.c delete mode 100644 core/org.eclipse.cdt.core.solaris/library/openpty.c delete mode 100644 core/org.eclipse.cdt.core.solaris/library/openpty.h delete mode 100644 core/org.eclipse.cdt.core.solaris/library/pfind.c delete mode 100644 core/org.eclipse.cdt.core.solaris/library/pty.c delete mode 100644 core/org.eclipse.cdt.core.solaris/library/ptyio.c delete mode 100644 core/org.eclipse.cdt.core.solaris/library/spawner.c delete mode 100644 core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libpty.so delete mode 100644 core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libspawner.so delete mode 100644 core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessInfo.java delete mode 100644 core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessList.java delete mode 100644 core/org.eclipse.cdt.core.tests/.classpath delete mode 100644 core/org.eclipse.cdt.core.tests/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.tests/.project delete mode 100644 core/org.eclipse.cdt.core.tests/ChangeLog delete mode 100644 core/org.eclipse.cdt.core.tests/about.html delete mode 100644 core/org.eclipse.cdt.core.tests/build.properties delete mode 100644 core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/CModelElementsFailedTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedDeclaratorsTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedMacroTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/ASTFailedTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/STLFailedTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/DependencyTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/IndexManagerTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/codeassist/tests/CompletionProposalsTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AllLanguageInterfaceTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/DeclaratorsTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ElementDeltaTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IIncludeTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IMacroTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IStructureTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ITemplateTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IntegratedCModelTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/MacroTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitBaseTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ContextualParseTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java delete mode 100644 core/org.eclipse.cdt.core.tests/plugin.xml delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cfiles/WorkingCopyTestStart.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cmodel/IStructure.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/cmodel/MacroTests.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/a.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/c.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/dependency/d.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/common.mk delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/main.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/ppc/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/exe_g delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/main.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test2.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/test.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/test2.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/exe_g delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/main.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test2.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o/exe delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o/main.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test2.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/common.mk delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/main.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/x86/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/exebig_g delete mode 100644 core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/main.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/indexer/mail.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/indexer/reftest.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/AutomatedTest.properties delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/FractionalAutomatedTest.properties delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/ReadMe-TortureText.txt delete mode 100644 core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp delete mode 100644 core/org.eclipse.cdt.core.tests/resources/search/include.h delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/common.mk delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/test.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/test2.c delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/libtestlib_g.a delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test2.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/Makefile delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_g.so delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_gS.a delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test.o delete mode 100644 core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test2.o delete mode 100644 core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/BaseSearchTest.java delete mode 100644 core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/FunctionMethodPatternTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/OtherPatternTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java delete mode 100644 core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/SearchTestSuite.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AISResultPrinter.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/RunTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CElementDecorator.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CProjectHelper.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CTestPlugin.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CTestSetup.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/FileManager.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/Main.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/NewMain.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/TestPluginLauncher.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStrings.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/FailureDialog.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/FocusTestPass.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/IDialogTestPass.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/SizingTestPass.java delete mode 100644 core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/VerifyDialog.java delete mode 100644 core/org.eclipse.cdt.core.tests/test.xml delete mode 100644 core/org.eclipse.cdt.core.win32/.classpath delete mode 100644 core/org.eclipse.cdt.core.win32/.cvsignore delete mode 100644 core/org.eclipse.cdt.core.win32/.project delete mode 100644 core/org.eclipse.cdt.core.win32/ChangeLog delete mode 100644 core/org.eclipse.cdt.core.win32/build.properties delete mode 100644 core/org.eclipse.cdt.core.win32/fragment.properties delete mode 100644 core/org.eclipse.cdt.core.win32/fragment.xml delete mode 100644 core/org.eclipse.cdt.core.win32/library/Spawner.h delete mode 100644 core/org.eclipse.cdt.core.win32/library/SpawnerInputStream.h delete mode 100644 core/org.eclipse.cdt.core.win32/library/SpawnerOutputStream.h delete mode 100644 core/org.eclipse.cdt.core.win32/library/StdAfx.c delete mode 100644 core/org.eclipse.cdt.core.win32/library/StdAfx.h delete mode 100644 core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c delete mode 100644 core/org.eclipse.cdt.core.win32/library/iostream.c delete mode 100644 core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp delete mode 100644 core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h delete mode 100644 core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp delete mode 100644 core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp delete mode 100644 core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw delete mode 100644 core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h delete mode 100644 core/org.eclipse.cdt.core.win32/library/raise.c delete mode 100644 core/org.eclipse.cdt.core.win32/library/spawner.c delete mode 100644 core/org.eclipse.cdt.core.win32/library/spawner.dep delete mode 100644 core/org.eclipse.cdt.core.win32/library/spawner.dsp delete mode 100644 core/org.eclipse.cdt.core.win32/library/spawner.dsw delete mode 100644 core/org.eclipse.cdt.core.win32/library/spawner.mak delete mode 100644 core/org.eclipse.cdt.core.win32/library/starter/starter.cpp delete mode 100644 core/org.eclipse.cdt.core.win32/library/starter/starter.dep delete mode 100644 core/org.eclipse.cdt.core.win32/library/starter/starter.mak delete mode 100644 core/org.eclipse.cdt.core.win32/os/win32/x86/listtasks.exe delete mode 100644 core/org.eclipse.cdt.core.win32/os/win32/x86/spawner.dll delete mode 100644 core/org.eclipse.cdt.core.win32/os/win32/x86/starter.exe delete mode 100644 core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessInfo.java delete mode 100644 core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java delete mode 100644 core/org.eclipse.cdt.core/.classpath delete mode 100644 core/org.eclipse.cdt.core/.cvsignore delete mode 100644 core/org.eclipse.cdt.core/.options delete mode 100644 core/org.eclipse.cdt.core/.project delete mode 100644 core/org.eclipse.cdt.core/ChangeLog delete mode 100644 core/org.eclipse.cdt.core/about.html delete mode 100644 core/org.eclipse.cdt.core/build.properties delete mode 100644 core/org.eclipse.cdt.core/dependency/ChangeLog delete mode 100644 core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/DependencyQueryJob.java delete mode 100644 core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/Node.java delete mode 100644 core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/UpdateDependency.java delete mode 100644 core/org.eclipse.cdt.core/index/ChangeLog delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/CharOperation.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IDocument.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IEntryResult.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexer.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IQueryResult.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/StringMatcher.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Block.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexOutput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Field.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/FileListBlock.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntry.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntryHashedArray.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Index.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Int.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Util.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/messages.properties delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java delete mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/BufferChangedEvent.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CModelException.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ElementChangedEvent.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/Flags.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchive.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchiveContainer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinary.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryContainer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryElement.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryFunction.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryModule.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryVariable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBuffer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBufferChangedListener.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElementDelta.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModel.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelMarker.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatus.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatusConstants.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICPathEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IContainerEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IElementChangedListener.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumeration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumerator.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IField.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunction.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunctionDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInclude.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IIncludeEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInheritance.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryReference.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacro.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacroEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMember.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethod.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IOpenable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IProjectEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceManipulation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceRange.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IStructure.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITemplate.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITranslationUnit.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariableDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ACPathEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BatchOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFileInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CPathEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContainerEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFunctionDeclarationOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateIncludeOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMemberOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Function.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IBufferFactory.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IConstants.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MoveResourceElementsOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/OpenableInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProjectEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/RenameResourceElementsOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetCPathEntriesOperation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceMapper.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplate.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopyInfo.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/PEParser.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ILRUCacheable.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java delete mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ToStringSorter.java delete mode 100644 core/org.eclipse.cdt.core/parser/ChangeLog-parser delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/BacktrackException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultLogService.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultProblemHandler.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/EndOfFileException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Enum.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ILineOffsetReconciler.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IOffsetDuple.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParser.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParserLogService.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IPreprocessor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScanner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfo.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementCallbackDelegate.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ITokenDuple.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactoryException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserLanguage.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserMode.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserNotImplementedException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/SyntaxErrorException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTNotImplementedException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTSemanticException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ExpressionEvaluationException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTASMDefinition.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractTypeSpecifierDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTArrayModifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompilationUnit.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompletionNode.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumeratorReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExceptionSpecification.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTField.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFieldReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunctionReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInclusion.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTLinkageSpecification.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMacro.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMember.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethodReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceAlias.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNode.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableElement.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableNamedElement.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTPointerOperatorOwner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScope.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedElement.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplate.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameter.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameterList.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplatedDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeId.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifierOwner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDirective.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariableReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BaseProblemFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CompleteParser.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextStack.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextualParser.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclarator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParameterCollection.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IProblemFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/KeywordSets.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LimitedScannerContext.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LineOffsetReconciler.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/OffsetDuple.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParameterCollection.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Problem.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParser.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerProblemFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/SimpleDeclarationStrategy.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParseCallback.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParser.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Token.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TypeId.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTArrayModifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTCompletionNode.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInclusion.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTMacro.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTQualifiedNamedElement.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/NamedOffsets.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/Offsets.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTASMDefinition.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAbstractTypeSpecifierDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAnonymousDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTBaseSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCompilationUnit.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTElaboratedTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumeratorReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExceptionSpecification.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFieldReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunctionReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLinkageSpecification.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethodReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceAlias.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceDefinition.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNode.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReferenceStore.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTScope.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbolOwner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateInstantiation.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateSpecialization.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeId.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDirective.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariableReference.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResult.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResultList.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTASMDefinition.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTAbstractTypeSpecifierDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTCompilationUnit.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerationSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerator.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExceptionSpecification.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTLinkageSpecification.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceAlias.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNode.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTParameterDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateInstantiation.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateParameter.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateSpecialization.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypeId.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDeclaration.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDirective.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQScope.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/AbstractSymbolExtension.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/BasicSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ContainerSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/DerivableContainerSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IContainerSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IParameterizedSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISpecializedSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolASTExtension.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolOwner.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParameterizedSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTableException.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/SpecializedSymbol.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateInstance.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeFilter.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java delete mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java delete mode 100644 core/org.eclipse.cdt.core/plugin.properties delete mode 100644 core/org.eclipse.cdt.core/plugin.xml delete mode 100644 core/org.eclipse.cdt.core/schema/CProject.exsd delete mode 100644 core/org.eclipse.cdt.core/schema/ProcessList.exsd delete mode 100644 core/org.eclipse.cdt.core/search/ChangeLog delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchMatch.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchConstants.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchResultCollector.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchScope.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/IMatch.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/SearchEngine.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/AcceptMatchOperation.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IndexSelector.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PathCollector.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MacroDeclarationPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/OrPattern.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/IJob.java delete mode 100644 core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/JobManager.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ConsoleOutputStream.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IBinaryParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICDescriptor.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtension.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtensionReference.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICLogConstants.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwner.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwnerInfo.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IErrorParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IMarkerGenerator.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessInfo.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessList.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoProvider.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IConsole.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDTLogWriter.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptor.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptorManager.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionReference.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/InternalCExtension.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GASErrorParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/VCErrorParser.java delete mode 100644 core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Addr2line.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CPPFilt.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/ICygwinToolsProvider.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/IToolsProvider.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEConstants.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/ReadMemoryAccess.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/ARMember.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryExecutable.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryFile.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryShared.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEParser.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEParser.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/Symbol.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ERandomAccessFile.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ARMember.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryExecutable.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryFile.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfParser.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/Symbol.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabConstant.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/Stabs.java delete mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabsAddr2line.java delete mode 100644 core/org.eclipse.cdt.ui.tests/.classpath delete mode 100644 core/org.eclipse.cdt.ui.tests/.cvsignore delete mode 100644 core/org.eclipse.cdt.ui.tests/.project delete mode 100644 core/org.eclipse.cdt.ui.tests/ChangeLog delete mode 100644 core/org.eclipse.cdt.ui.tests/about.html delete mode 100644 core/org.eclipse.cdt.ui.tests/build.properties delete mode 100644 core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java delete mode 100644 core/org.eclipse.cdt.ui.tests/plugin.xml delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java delete mode 100644 core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java delete mode 100644 core/org.eclipse.cdt.ui.tests/test.xml delete mode 100644 core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java delete mode 100644 core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java delete mode 100644 core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt delete mode 100644 core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt delete mode 100644 core/org.eclipse.cdt.ui/.classpath delete mode 100644 core/org.eclipse.cdt.ui/.cvsignore delete mode 100644 core/org.eclipse.cdt.ui/.project delete mode 100644 core/org.eclipse.cdt.ui/ChangeLog delete mode 100644 core/org.eclipse.cdt.ui/about.html delete mode 100644 core/org.eclipse.cdt.ui/build.properties delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/action-buildconfig.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/action-deleteconfig.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/action-editconfig.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/action-newconfig.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/build_configs.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-compiler.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-debug.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-linker.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-preprocessor.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-profile.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-release.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/alphab_sort_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/clear_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/collapseall.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/fields_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/metharg_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/open_incl.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/public_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/search_sortmatch.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/segment_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/shift_l_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/shift_r_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/clcl16/static_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/convert-normal.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newc_app.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newc_lib.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_app.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_lib.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newclass_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newcprj_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newfile_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/newfolder_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/next_error_nav.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/prev_error_nav.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/prj_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ctool16/prop_edt.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/cview16/buildconsole.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/cview16/c_pers.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/cview16/cview.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/alphab_sort_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/clear_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/collapseall.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/fields_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/metharg_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/open_incl.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/public_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/segment_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_l_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_r_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dlcl16/static_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dtool16/newclass_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dtool16/newcprj_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dtool16/newfile_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dtool16/next_error_nav.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/dtool16/prev_error_nav.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/alphab_sort_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/clear_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/collapseall.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/fields_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/metharg_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/open_incl.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/public_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/segment_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/shift_l_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/shift_r_edit.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/elcl16/static_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/etool16/newclass_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/etool16/newcprj_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/etool16/newfile_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/etool16/next_error_nav.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/etool16/prev_error_nav.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/eview16/buildconsole.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/eview16/c_pers.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/ar_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/bin_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_active.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_disabled.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/build_menu.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/c_file_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/cdeclaration_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/cfolder_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/class_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/container_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/core_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/csearch_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/define_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/exec_dbg_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/exec_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/field_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/field_private_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/field_protected_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/field_public_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/function_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/h_file_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/include_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/lib_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/method_private_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/method_protected_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/method_public_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/search_decl_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/search_ref_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/search_sortmatch.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/shlib_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/struct_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/template_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/union_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/variable_local_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/obj16/variable_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ovr16/error_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ovr16/template_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/ovr16/warning_co.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/wizban/c_app_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/wizban/newclass_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/wizban/newcprj_wiz.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif delete mode 100644 core/org.eclipse.cdt.ui/icons/full/wizban/prj_obj.gif delete mode 100644 core/org.eclipse.cdt.ui/plugin.properties delete mode 100644 core/org.eclipse.cdt.ui/plugin.xml delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextTypeRegistry.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/DocumentTemplateContext.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ITemplateEditor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/SimpleTemplateVariable.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Template.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateBuffer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateContext.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplatePosition.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateSet.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateTranslator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateVariable.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFunctionContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CGlobalContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CStructureContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContext.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppFunctionContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppGlobalContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppStructureContextType.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/GlobalVariables.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ICompilationUnit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/default-templates.xml delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/ISourceRange.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/Messages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MoveTextEdit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MultiTextEdit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/NopTextEdit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SimpleTextEdit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SwapTextEdit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBuffer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferEditor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEdit.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNode.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNodeComparator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextManipulationMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRange.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRegion.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextUtil.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/UndoMemento.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsole.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementProperties.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementPropertySource.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CStatusConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIException.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIStatus.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CWorkbenchAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ConsoleEvent.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/DocumentInputStream.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IAdornmentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICElementPropertyConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IContextMenuConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ResourceAdapterFactory.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/StandardCElementLabelProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/WorkbenchRunnableAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleView.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ClearConsoleAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/AddIncludeOperation.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/StubUtility.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CContentViewerCreator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CMergeViewer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CNode.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CParseTreeBuilder.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CElementFilters.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CLibFilter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewFrameSource.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CollapseAllAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/DefaultAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FiltersContentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ElementListSelectionDialog.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ISelectionValidator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/IStatusChangeListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/MessageLine.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionStatusDialog.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusDialog.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusInfo.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusTool.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusUtil.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/DelegatingDragAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/FileTransferDragAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/LocalSelectionTransferDragAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/ResourceTransferDragAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/TransferDragSourceListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorErrorTickUpdater.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorTextHoverDispatcher.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotation.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CTextEditorActionConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchActionInWorkingSet.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefinitionIds.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IPositionManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IProblemAnnotation.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/LexicalSortingAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenDeclarationsAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ProblemAnnotationIterator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SearchDialogAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/TogglePresentationAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmPartitionScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmSourceViewerConfiguration.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextTools.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmWordDetector.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/BuildConsolePreferencePage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorEditor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorSettingPreviewCode.txt delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OverlayPreferenceStore.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPreferencePage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPropertyPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CElementLabels.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchScopeFactory.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchViewActionGroup.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ElementNameSorter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GotoMarkerAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GroupByKeyComputer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OpenCSearchPageAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ParentNameSorter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PathNameSorter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractCScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeReader.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentAutoIndentStrategy.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CDoubleClickSelector.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CFormattingStrategy.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPairMatcher.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CWordFinder.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CppCodeScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/FastCPartitionScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTML2TextReader.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLPrinter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICColorConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManagerExtension.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/LineBreakingReader.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/PreprocessorRule.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleCharReader.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleTokenCScanner.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SubstitutionTextReader.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposalComparator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionRequestorAdaptor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistElementRequestor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistPreference.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ICompletionRequestor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/RelevanceConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ResultCollector.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateContentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateLabelProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CColorManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWhitespaceDetector.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWordDetector.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExceptionHandler.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/IProblemChangedListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/PixelConverter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemItemMapper.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SWTUtil.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/Strings.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TwoArrayQuickSort.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilterAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/IStatusChangeListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.properties delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ComboDialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/DialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IDialogFieldListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IListAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IStringButtonAdapter.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LayoutUtil.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/Separator.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridData.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CLocalSelectionTransfer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CodeGeneration.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleEvent.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleListener.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICCompletionContributor.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICDTConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IEditorInputDelegate.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IFunctionSummary.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IRequiredInclude.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManager.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManagerExtension.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/AbstractOpenWizardAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/OpenClassWizardAction.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractCOptionPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParserPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICCompletionProposal.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCCProjectWizard.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizard.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizard.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java delete mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java delete mode 100644 core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/ControlFactory.java delete mode 100644 core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java delete mode 100644 core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/TabFolderLayout.java delete mode 100644 debug/org.eclipse.cdt.debug.core/.classpath delete mode 100644 debug/org.eclipse.cdt.debug.core/.cvsignore delete mode 100644 debug/org.eclipse.cdt.debug.core/.project delete mode 100644 debug/org.eclipse.cdt.debug.core/ChangeLog delete mode 100644 debug/org.eclipse.cdt.debug.core/about.html delete mode 100644 debug/org.eclipse.cdt.debug.core/build.properties delete mode 100644 debug/org.eclipse.cdt.debug.core/plugin.properties delete mode 100644 debug/org.eclipse.cdt.debug.core/plugin.xml delete mode 100644 debug/org.eclipse.cdt.debug.core/schema/CDebugger.exsd delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/IAsyncExecutor.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpointManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConfiguration.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICMemoryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICRegisterManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSharedLibraryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSignalManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICUpdateManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/CDIException.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointHit.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICatchEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICondition.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEndSteppingRange.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEventManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExitInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExpressionManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIFormat.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDILocation.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISession.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISessionObject.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalExitInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalReceived.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceSnapshot.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointScope.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointTrigger.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDICreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDestroyedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDisconnectedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEventListener.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIExitedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIRestartedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIResumedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDISuspendedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgument.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgumentObject.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDICatchpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIExpression.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDILocationBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMixedInstruction.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIObject.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegister.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterGroup.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterObject.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStaticVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITracepoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIWatchpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIVoidType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICAddressBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugElementErrorStatus.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTargetType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICExpressionEvaluator.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICFunctionBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSignal.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICWatchpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToArray.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDebuggerProcessSupport.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDummyStackFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IExecFileInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IGlobalVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IInstructionStep.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToLine.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRestart.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IResumeWithoutSignal.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToLine.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IStackFrameInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IState.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToThread.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocation.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocator.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDirectorySourceLocation.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDisassemblyStorage.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IProjectSourceLocation.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ISourceMode.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/SessionManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartition.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartitionValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CCoreFileDebugTarget.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDummyStackFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSignal.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CType.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValueFactory.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java delete mode 100644 debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/.classpath delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/.cvsignore delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/.options delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/.project delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/ChangeLog delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/about.html delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/build.properties delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/design.txt delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/plugin.properties delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/plugin.xml delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CommandQueue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/EventThread.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMIConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIFormat.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/Queue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/SessionProcess.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointHit.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Condition.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CoreFileConfiguration.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EndSteppingRange.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExitInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Format.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Session.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalExitInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalReceived.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointScope.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointTrigger.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DisconnectedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/CObject.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Catchpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MixedInstruction.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Watchpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IncompleteType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/Type.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/VoidType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinCommandFactory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentDirectory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecAbort.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIHandle.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoProgram.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSharedLibrary.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSignals.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoThreads.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIJump.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIPType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISharedLibrary.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISignal.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIWhatis.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIArg.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsm.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoProgramInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIMemory.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIPTypeInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIShared.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVar.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIWhatisInfo.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/.classpath delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/.cvsignore delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/.project delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/ChangeLog delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/about.html delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/build.properties delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/icons/full/clcl16/auto_solib_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/icons/full/dlcl16/auto_solib_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/icons/full/elcl16/auto_solib_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/plugin.properties delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/plugin.xml delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CygwinDebuggerPage.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBSolibBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIHelpContextIds.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIUIConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/PixelConverter.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SerialPortSettingsBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/TCPSettingsBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/CheckedListDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ComboDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/DialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IDialogFieldListener.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IListAdapter.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IStringButtonAdapter.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/LayoutUtil.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ListDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/Separator.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonStatusDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/.classpath delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/.cvsignore delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/.project delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/Changelog delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/about.html delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/build.properties delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/plugin.xml delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java delete mode 100644 debug/org.eclipse.cdt.debug.ui.tests/test.xml delete mode 100644 debug/org.eclipse.cdt.debug.ui/.classpath delete mode 100644 debug/org.eclipse.cdt.debug.ui/.cvsignore delete mode 100644 debug/org.eclipse.cdt.debug.ui/.project delete mode 100644 debug/org.eclipse.cdt.debug.ui/ChangeLog delete mode 100644 debug/org.eclipse.cdt.debug.ui/about.html delete mode 100644 debug/org.eclipse.cdt.debug.ui/build.properties delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/autorefresh_mem.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/casttotype_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/debugger_console.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disabled_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disassembly.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/enabled_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/jump_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_all_symbols_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_symbols_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_clear.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_update.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/refresh_mem.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/restart.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/runtoline_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_ascii.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_paths.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/showasarray_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal0_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/tnames_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/watch_globals.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/adddirsource_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/addprjsource_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/cview16/memory_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/cview16/registers_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/cview16/sharedlibraries_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/cview16/signals_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/autorefresh_mem.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/casttotype_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/change_reg_value_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/debugger_console.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/disassembly.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/jump_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_all_symbols_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_symbols_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_clear.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_update.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/refresh_mem.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/restart.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/runtoline_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_ascii.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_paths.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/showasarray_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal0_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/watch_globals.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/adddirsource_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/addprjsource_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/autorefresh_mem.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/casttotype_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/debugger_console.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/disassembly.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/jump_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_all_symbols_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_symbols_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_clear.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_update.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/refresh_mem.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/restart.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/runtoline_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_ascii.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_parents.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/showasarray_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal0_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/watch_globals.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/etool16/adddirsource_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/etool16/addprjsource_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/eview16/memory_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/eview16/registers_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/eview16/sharedlibraries_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/eview16/signals_view.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkp_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkpd_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkp_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpd_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpi_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/cproject_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/disassembly_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/expression_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/ext_file_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/filenotfound_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/folder_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkp_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkpd_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_syms_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/prj_file_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/project_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/showpaths_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/signal_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_aggr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_env.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global_aggr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_pointer.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple_aggr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static_aggr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_string.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_aggr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_pointer.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_simple.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/argument_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/castarray_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/casttype_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/error_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr_disabled.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/symbols_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/warning_ovr.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_dir_source_location_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_prj_source_location_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_source_location_wiz.gif delete mode 100644 debug/org.eclipse.cdt.debug.ui/plugin.properties delete mode 100644 debug/org.eclipse.cdt.debug.ui/plugin.xml delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTValueDetailProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugUIInternalConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageDescriptor.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/PixelConverter.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/SWTUtil.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractBreakpointRulerAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractDebugActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractEditorActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddAddressBreakpointActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshMemoryAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BreakpointLocationVerifier.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ClearMemoryAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DebuggerConsoleActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ExpressionDialog.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryActionSelectionGroup.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryFormatAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryNumberOfColumnAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemorySizeAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshMemoryAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestartActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowAsciiAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroObjectActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleDelegateAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/WatchpointExpressionVerifier.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/CheckedListDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ComboDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IDialogFieldListener.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IListAdapter.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IStringButtonAdapter.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/LayoutUtil.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/Separator.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonStatusDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/CDebugEditor.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyDocumentProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditor.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditorInput.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotation.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotationModel.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblySourceViewerConfiguration.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/EditorInputDelegate.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/FileNotFoundElement.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/NoSymbolOrSourceElement.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ComboFieldEditor.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ICDebugPreferenceConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/MemoryViewPreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandlerView.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/IDebugExceptionHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/ViewerState.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryText.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewAction.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewContentProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewEventHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewer.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewEventHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewer.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewContentProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewEventHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewEventHandler.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewer.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationWizard.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationWizard.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddSourceLocationWizard.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationSelectionPage.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationWizardNode.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/INewSourceLocationWizard.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceListDialogField.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupLabelProvider.java delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java delete mode 100644 doc/org.eclipse.cdt.doc.isv/.project delete mode 100644 doc/org.eclipse.cdt.doc.user/.project delete mode 100644 doc/org.eclipse.cdt.doc.user/build.properties delete mode 100644 doc/org.eclipse.cdt.doc.user/build.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_comments.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_dbg_info.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_outlineview.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_cdt.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_dbg.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_proj_file_views.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_projects.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_search.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_c_whatsnew.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_o_code_entry.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_o_dbg_concepts.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_o_home.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/concepts/cdt_o_projects.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/contextHelp.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/contexts_CDT.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER_MI.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/contexts_CDT_LAUNCH.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/contexts_CDT_make.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/doc.zip delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_build.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_debug.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_existing_code.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newcpp.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newmake.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newproj.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_o_tutorial.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_build.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_existing_code.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newcpp.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newmake.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newproj.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/help.css delete mode 100644 doc/org.eclipse.cdt.doc.user/images/alphab_sort_co.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/c_file_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/class_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/container_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/contents_view.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/define_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/editor_c_codetemplates_use.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/enum_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/enumerator_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/error_icon.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/field_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/field_private_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/field_protected_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/field_public_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/fields_co.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/filterbutton.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/function_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_breakpoint_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_debug_exc.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_debugt_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_disconnect.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_installed_ovr.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_memory_update.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_relaunch.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_remove_all.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_run_exc.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_stackframe.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_stackframe_running.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_terminate.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_terminate_all.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_terminate_rem.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_thread1.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_thread2.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_thread3.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/icon_watchpoint_readwrite_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/include_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/makefile.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/method_private_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/method_protected_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/method_public_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ng03_04.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ng2003.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ngback.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ngconcepts.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ngnext.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ngref.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ngtasks.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ngtopics.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/public_co.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/ref-79.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/static_co.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/struct_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/template_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/toc_closed.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/typedef_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/union_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/var_declaration_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/images/warning_icon.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/plugin.properties delete mode 100644 doc/org.eclipse.cdt.doc.user/plugin.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/about.html delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/cdev.html delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/conc.html delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/cvs.html delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/cwiz.html delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/dbug.html delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/caution.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/onestep.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/pointing.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_architecture.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_buildsettings.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_library.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_options.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_projects.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_convert_1.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_target.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_codetemplates_use.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_contentassist.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_helloworld.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_hoverhelp.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/findit delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/first_look.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_breakpoint_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debug_exc.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugger_console.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugt_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disassembly.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disconnect.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_error_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_filter_tsk.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_installed_ovr.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_memory_update.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_menu.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_app.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_lib.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_app.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_lib.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_next_error_nav.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_prev_error_nav.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_relaunch.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_remove_all.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_restart.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_resume.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_run_exc.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe_running.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepinto.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepover.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepreturn.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_suspend.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_all.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_rem.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread1.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread2.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread3.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_tnames.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_warning_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_read_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_readwrite_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_write_obj.gif delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_arguments.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_common.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_customize.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debug_debug.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debugger.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_environment.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_main.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run2_faster.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run_run.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/persp_dbug_properties_options.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_added.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_adding.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_disable.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_prop.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_watch_add.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild_configurations.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb_using.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_helloworld.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_building.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_filter.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_executable.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_source.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_add.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_use.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug_runtoline.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions_add.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_change.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_configure.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_outline.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_registers.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_filter_tasks.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_new_tasks.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables_customize.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_c_codetemplates.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_workbench.jpg delete mode 100644 doc/org.eclipse.cdt.doc.user/raw/hackedguide/lnch.html delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_o_ceditor_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_o_dbg_view.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_o_proj_prop_pages.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_o_run_dbg_pages.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_o_views.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_anno.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_color.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_con_assist.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_gen.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_code_temp.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_view.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_gdb_mi_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_icons.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_mem_view_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_memoryview.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_buildset.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_binary.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_error.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_pathsymb.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_platf.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_outlineview.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_reg_view_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_registersview.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_arg.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_comm.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_dbg.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_env.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_main.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_srce.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_search.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/reference/cdt_u_signals_view.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_brkpnts_watch.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_build_task.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_con_assist.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_debug.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_prop.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run_config.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasksview.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tutorial.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_o_write_code.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_brkpnts.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_codetemp.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_watch.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_autosave.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_build_process.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cbuild_pref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_comment_out.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_contentassist.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_controldebug.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_conv_proj.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cust_cpp_editor.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_debug_prog.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_disassembly.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_endis_able_brk_wtch.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_expressions.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_filtererror.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_imp_code_temp.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_jumperror.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_manualbuild.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_memory.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_cpp.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_make.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_run_config.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_open_declarations.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_build_set.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_error_parser.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_new.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_parser.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_platf.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_ref.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_rename.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_prvw_hide_files.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_registers.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rem_wtch_brk.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_arg.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_com.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_config.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_dbg.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_env.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_main.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_source.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setbuildorder.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setreminder.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_shift_code.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_show_proj_files.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_update_man.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/tasks/cdt_t_variables.htm delete mode 100644 doc/org.eclipse.cdt.doc.user/toc.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/topics_Concepts.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/topics_Getting_Started.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/topics_Reference.xml delete mode 100644 doc/org.eclipse.cdt.doc.user/topics_Tasks.xml delete mode 100644 launch/org.eclipse.cdt.launch/.classpath delete mode 100644 launch/org.eclipse.cdt.launch/.cvsignore delete mode 100644 launch/org.eclipse.cdt.launch/.project delete mode 100644 launch/org.eclipse.cdt.launch/ChangeLog delete mode 100644 launch/org.eclipse.cdt.launch/about.html delete mode 100644 launch/org.eclipse.cdt.launch/build.properties delete mode 100644 launch/org.eclipse.cdt.launch/icons/c_app.gif delete mode 100644 launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif delete mode 100644 launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif delete mode 100644 launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif delete mode 100644 launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif delete mode 100644 launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif delete mode 100644 launch/org.eclipse.cdt.launch/plugin.properties delete mode 100644 launch/org.eclipse.cdt.launch/plugin.xml delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java delete mode 100644 launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java delete mode 100644 releng/org.eclipse.cdt-feature/.project delete mode 100644 releng/org.eclipse.cdt-feature/build.properties delete mode 100644 releng/org.eclipse.cdt-feature/cpl-v10.html delete mode 100644 releng/org.eclipse.cdt-feature/eclipse_update_120.jpg delete mode 100644 releng/org.eclipse.cdt-feature/feature.properties delete mode 100644 releng/org.eclipse.cdt-feature/feature.xml delete mode 100644 releng/org.eclipse.cdt-feature/license.html delete mode 100644 releng/org.eclipse.cdt.testing-feature/.project delete mode 100644 releng/org.eclipse.cdt.testing-feature/build.properties delete mode 100644 releng/org.eclipse.cdt.testing-feature/cpl-v10.html delete mode 100644 releng/org.eclipse.cdt.testing-feature/eclipse_update_120.jpg delete mode 100644 releng/org.eclipse.cdt.testing-feature/feature.properties delete mode 100644 releng/org.eclipse.cdt.testing-feature/feature.xml delete mode 100644 releng/org.eclipse.cdt.testing-feature/license.html delete mode 100644 releng/org.eclipse.cdt.testing/.project delete mode 100644 releng/org.eclipse.cdt.testing/about.html delete mode 100644 releng/org.eclipse.cdt.testing/about.ini delete mode 100644 releng/org.eclipse.cdt.testing/about.mappings delete mode 100644 releng/org.eclipse.cdt.testing/about.properties delete mode 100644 releng/org.eclipse.cdt.testing/build.properties delete mode 100644 releng/org.eclipse.cdt.testing/cpl-v10.html delete mode 100644 releng/org.eclipse.cdt.testing/eclipse32.gif delete mode 100644 releng/org.eclipse.cdt.testing/notice.html delete mode 100644 releng/org.eclipse.cdt.testing/plugin.properties delete mode 100644 releng/org.eclipse.cdt.testing/plugin.xml delete mode 100644 releng/org.eclipse.cdt/.eclipseproduct delete mode 100644 releng/org.eclipse.cdt/.project delete mode 100644 releng/org.eclipse.cdt/about.html delete mode 100644 releng/org.eclipse.cdt/about.ini delete mode 100644 releng/org.eclipse.cdt/about.mappings delete mode 100644 releng/org.eclipse.cdt/about.properties delete mode 100644 releng/org.eclipse.cdt/build.properties delete mode 100644 releng/org.eclipse.cdt/cpl-v10.html delete mode 100644 releng/org.eclipse.cdt/eclipse32.gif delete mode 100644 releng/org.eclipse.cdt/notice.html delete mode 100644 releng/org.eclipse.cdt/plugin.properties delete mode 100644 releng/org.eclipse.cdt/plugin.xml delete mode 100644 releng/org.eclipse.cdt/welcome.xml diff --git a/build/org.eclipse.cdt.make.core/.classpath b/build/org.eclipse.cdt.make.core/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/build/org.eclipse.cdt.make.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/build/org.eclipse.cdt.make.core/.cvsignore b/build/org.eclipse.cdt.make.core/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/build/org.eclipse.cdt.make.core/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/build/org.eclipse.cdt.make.core/.project b/build/org.eclipse.cdt.make.core/.project deleted file mode 100644 index 8a04c072ab5..00000000000 --- a/build/org.eclipse.cdt.make.core/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.make.core - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/build/org.eclipse.cdt.make.core/about.html b/build/org.eclipse.cdt.make.core/about.html deleted file mode 100644 index 8c828de2ada..00000000000 --- a/build/org.eclipse.cdt.make.core/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

10th July, 2002

-

License

-

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

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/build.properties b/build/org.eclipse.cdt.make.core/build.properties deleted file mode 100644 index 7a00e9ea7d4..00000000000 --- a/build/org.eclipse.cdt.make.core/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -bin.includes = plugin.xml,\ - *.jar,\ - cdtmakecore.jar,\ - *.html,\ - plugin.properties,\ - schema/,\ - builtin/ -source.cdtmakecore.jar = src/ -src.includes = builtin/ diff --git a/build/org.eclipse.cdt.make.core/builtin/gnu.mk b/build/org.eclipse.cdt.make.core/builtin/gnu.mk deleted file mode 100644 index 0c3e93f5639..00000000000 --- a/build/org.eclipse.cdt.make.core/builtin/gnu.mk +++ /dev/null @@ -1,991 +0,0 @@ -# GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. -# Make data base, printed on Fri Sep 19 21:51:12 2003 - -# Variables - -# default -F77 = $(FC) -# default -PREPROCESS.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F -# automatic -@F = $(notdir $@) -# default -MAKE = $(MAKE_COMMAND) -# default -SUFFIXES := .out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh .elc .el -# default -COMPILE.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c -# default -LINK.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) -# default -LINK.s = $(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH) -# default -LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH) -# default -COFLAGS = -# default -TEXI2DVI = texi2dvi -# default -CURDIR := /home/alain -# automatic -+F = $(notdir $+) -# default -COMPILE.f = $(FC) $(FFLAGS) $(TARGET_ARCH) -c -# automatic -%F = $(notdir $%) -# default -LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) -# default -CO = co -# automatic -?D = $(patsubst %/,%,$(dir $?)) -# default -PREPROCESS.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F -# automatic - $*.c - $(LINT.c) -i $*.c -o $@ - $(RM) $*.c - -%.c: %.l -# commands to execute (built-in): - @$(RM) $@ - $(LEX.l) $< > $@ - -%.r: %.l -# commands to execute (built-in): - $(LEX.l) $< > $@ - mv -f lex.yy.r $@ - -%.s: - -%: %.s -# commands to execute (built-in): - $(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -%.o: %.s -# commands to execute (built-in): - $(COMPILE.s) -o $@ $< - -%.S: - -%: %.S -# commands to execute (built-in): - $(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -%.o: %.S -# commands to execute (built-in): - $(COMPILE.S) -o $@ $< - -%.s: %.S -# commands to execute (built-in): - $(PREPROCESS.S) $< > $@ - -%.mod: - -%: %.mod -# commands to execute (built-in): - $(COMPILE.mod) -o $@ -e $@ $^ - -%.o: %.mod -# commands to execute (built-in): - $(COMPILE.mod) -o $@ $< - -%.sym: - -%.def: - -%.sym: %.def -# commands to execute (built-in): - $(COMPILE.def) -o $@ $< - -%.h: - -%.info: - -%.dvi: - -%.tex: - -%.dvi: %.tex -# commands to execute (built-in): - $(TEX) $< - -%.texinfo: - -%.info: %.texinfo -# commands to execute (built-in): - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ - -%.dvi: %.texinfo -# commands to execute (built-in): - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< - -%.texi: - -%.info: %.texi -# commands to execute (built-in): - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ - -%.dvi: %.texi -# commands to execute (built-in): - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< - -%.txinfo: - -%.info: %.txinfo -# commands to execute (built-in): - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ - -%.dvi: %.txinfo -# commands to execute (built-in): - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< - -%.w: - -%.c: %.w -# commands to execute (built-in): - $(CTANGLE) $< - $@ - -%.tex: %.w -# commands to execute (built-in): - $(CWEAVE) $< - $@ - -%.ch: - -%.web: - -%.p: %.web -# commands to execute (built-in): - $(TANGLE) $< - -%.tex: %.web -# commands to execute (built-in): - $(WEAVE) $< - -%.sh: - -%: %.sh -# commands to execute (built-in): - cat $< >$@ - chmod a+x $@ - -%.elc: - -%.el: - -(%): % -# commands to execute (built-in): - $(AR) $(ARFLAGS) $@ $< - -%.out: % -# commands to execute (built-in): - @rm -f $@ - cp $< $@ - -%.c: %.w %.ch -# commands to execute (built-in): - $(CTANGLE) $^ $@ - -%.tex: %.w %.ch -# commands to execute (built-in): - $(CWEAVE) $^ $@ - -%:: %,v -# commands to execute (built-in): - $(CHECKOUT,v) - -%:: RCS/%,v -# commands to execute (built-in): - $(CHECKOUT,v) - -%:: RCS/% -# commands to execute (built-in): - $(CHECKOUT,v) - -%:: s.% -# commands to execute (built-in): - $(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $< - -%:: SCCS/s.% -# commands to execute (built-in): - $(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $< - -# 86 implicit rules, 5 (5.8%) terminal. - -# Pattern-specific variable values - -# No pattern-specific variable values. - -# Files - -# Not a target: -.c: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.texinfo.info: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ - -# Not a target: -.mod.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.mod) -o $@ $< - -# Not a target: -.c.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.c) $(OUTPUT_OPTION) $< - -# Not a target: -.s: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.s) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.txinfo.dvi: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< - -# Not a target: -.DEFAULT: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.y.c: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(YACC.y) $< - mv -f y.tab.c $@ - -# Not a target: -.l: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.web.tex: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(WEAVE) $< - -# Not a target: -.s.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.s) -o $@ $< - -# Not a target: -.sym: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.texi: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.F.f: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(PREPROCESS.F) $(OUTPUT_OPTION) $< - -# Not a target: -.dvi: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.web.p: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(TANGLE) $< - -# Not a target: -.def: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.F: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.cc.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.cc) $(OUTPUT_OPTION) $< - -# Not a target: -.S.s: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(PREPROCESS.S) $< > $@ - -# Not a target: -.ch: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.def.sym: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.def) -o $@ $< - -# Not a target: -.F.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.F) $(OUTPUT_OPTION) $< - -# Not a target: -.f: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.elc: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.y.ln: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(YACC.y) $< - $(LINT.c) -C$* y.tab.c - $(RM) y.tab.c - -# Not a target: -.texi.dvi: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< - -# Not a target: -.el: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.texinfo.dvi: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(TEXI2DVI) $(TEXI2DVI_FLAGS) $< - -# Not a target: -/dev/null: -# Implicit rule search has been done. -# Last modified 2003-01-30 05:24:37 -# File has been updated. -# Successfully updated. - -# Not a target: -.SUFFIXES: .out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo .w .ch .web .sh .elc .el -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.txinfo: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.p.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.p) $(OUTPUT_OPTION) $< - -# Not a target: -.r.f: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(PREPROCESS.r) $(OUTPUT_OPTION) $< - -# Not a target: -.w.tex: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(CWEAVE) $< - $@ - -# Not a target: -.txinfo.info: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ - -# Not a target: -.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.c.ln: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINT.c) -C$* $< - -# Not a target: -.w: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.ln: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.l.r: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LEX.l) $< > $@ - mv -f lex.yy.r $@ - -# Not a target: -.info: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.r.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.r) $(OUTPUT_OPTION) $< - -# Not a target: -.h: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.C.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.C) $(OUTPUT_OPTION) $< - -# Not a target: -.p: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.l.c: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - @$(RM) $@ - $(LEX.l) $< > $@ - -# Not a target: -.sh: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - cat $< >$@ - chmod a+x $@ - -# Not a target: -.web: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.out: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.cc: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.f.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.f) $(OUTPUT_OPTION) $< - -# Not a target: -.texi.info: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ - -# Not a target: -.a: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.tex: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.cpp.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.cpp) $(OUTPUT_OPTION) $< - -# Not a target: -.l.ln: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - @$(RM) $*.c - $(LEX.l) $< > $*.c - $(LINT.c) -i $*.c -o $@ - $(RM) $*.c - -# Not a target: -.y: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.S.o: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.S) -o $@ $< - -# Not a target: -.tex.dvi: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(TEX) $< - -# Not a target: -.r: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.r) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.mod: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(COMPILE.mod) -o $@ -e $@ $^ - -# Not a target: -.C: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.S: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.S) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# Not a target: -.texinfo: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. - -# Not a target: -.w.c: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(CTANGLE) $< - $@ - -# Not a target: -.cpp: -# Implicit rule search has not been done. -# Modification time never checked. -# File has not been updated. -# commands to execute (built-in): - $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@ - -# 67 files in 1007 hash buckets. -# average 0.067 files per bucket, max 2 files in one bucket. - -# VPATH Search Paths - -# No `vpath' search paths. - -# No general (`VPATH' variable) search path. - -# Finished Make data base on Fri Sep 19 21:51:12 2003 - diff --git a/build/org.eclipse.cdt.make.core/builtin/posix.mk b/build/org.eclipse.cdt.make.core/builtin/posix.mk deleted file mode 100644 index 1bbf3c4606a..00000000000 --- a/build/org.eclipse.cdt.make.core/builtin/posix.mk +++ /dev/null @@ -1,92 +0,0 @@ -MAKE = make -AR = ar -ARFLAGS = -rv -YACC = yacc -YFLAGS = -LEX = lex -LFLAGS = -LDFLAGS = -CC = c89 -CFLAGS = -O -FC = fort77 -FFLAGS = -O 1 -GET = get -GFLAGS = -SCCSFLAGS = -SCCSGETFLAGS = -s - -.SUFFIXES: .o .c .y .l .a .sh .f .c~ .y~ .l~ .sh~ .f~ - -.SCCS_GET: - sccs $(SCCSFLAGS) get $(SCCSGETFLAGS) $@ -.c: - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -.f: - $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $< -.sh: - cp $< $@ - chmod a+x $@ -.c~: - $(GET) $(GFLAGS) -p $< > $*.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $*.c -.f~: - $(GET) $(GFLAGS) -p $< > $*.f - $(FC) $(FFLAGS) $(LDFLAGS) -o $@ $*.f -.sh~: - $(GET) $(GFLAGS) -p $< > $*.sh - cp $*.sh $@ - chmod a+x $@ -.c.o: - $(CC) $(CFLAGS) -c $< -.f.o: - $(FC) $(FFLAGS) -c $< -.y.o: - $(YACC) $(YFLAGS) $< - $(CC) $(CFLAGS) -c y.tab.c - rm -f y.tab.c - mv y.tab.o $@ -.l.o: - $(LEX) $(LFLAGS) $< - $(CC) $(CFLAGS) -c lex.yy.c - rm -f lex.yy.c - mv lex.yy.o $@ -.y.c: - $(YACC) $(YFLAGS) $< - mv y.tab.c $@ -.l.c: - $(LEX) $(LFLAGS) $< - mv lex.yy.c $@ -.c~.o: - $(GET) $(GFLAGS) -p $< > $*.c - $(CC) $(CFLAGS) -c $*.c -.f~.o: - $(GET) $(GFLAGS) -p $< > $*.f - $(FC) $(FFLAGS) -c $*.f -.y~.o: - $(GET) $(GFLAGS) -p $< > $*.y - $(YACC) $(YFLAGS) $*.y - $(CC) $(CFLAGS) -c y.tab.c - rm -f y.tab.c - mv y.tab.o $@ -.l~.o: - $(GET) $(GFLAGS) -p $< > $*.l - $(LEX) $(LFLAGS) $*.l - $(CC) $(CFLAGS) -c lex.yy.c - rm -f lex.yy.c - mv lex.yy.o $@ -.y~.c: - $(GET) $(GFLAGS) -p $< > $*.y - $(YACC) $(YFLAGS) $*.y - mv y.tab.c $@ -.l~.c: - $(GET) $(GFLAGS) -p $< > $*.l - $(LEX) $(LFLAGS) $*.l - mv lex.yy.c $@ -.c.a: - $(CC) -c $(CFLAGS) $< - $(AR) $(ARFLAGS) $@ $*.o - rm -f $*.o -.f.a: - $(FC) -c $(FFLAGS) $< - $(AR) $(ARFLAGS) $@ $*.o - rm -f $*.o diff --git a/build/org.eclipse.cdt.make.core/plugin.properties b/build/org.eclipse.cdt.make.core/plugin.properties deleted file mode 100644 index 0c13be60b2c..00000000000 --- a/build/org.eclipse.cdt.make.core/plugin.properties +++ /dev/null @@ -1,6 +0,0 @@ -pluginName=C/C++ Standard make Build Core -providerName=Eclipse.org - -extensionTargetBuilder.name=Target Builder Extension -natureMake.name=CDT Make Nature -builderMake.name=CDT Makefile Builder \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/plugin.xml b/build/org.eclipse.cdt.make.core/plugin.xml deleted file mode 100644 index 6903624159b..00000000000 --- a/build/org.eclipse.cdt.make.core/plugin.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/org.eclipse.cdt.make.core/schema/MakeTargetBuilder.exsd b/build/org.eclipse.cdt.make.core/schema/MakeTargetBuilder.exsd deleted file mode 100644 index 72aa69e968f..00000000000 --- a/build/org.eclipse.cdt.make.core/schema/MakeTargetBuilder.exsd +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - This extension point is used to identify builders that support IMakeBuidlerInfo an arguments. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Eclipse builder ID of the builder that supports target builds. (Must support IMakeInfo as argument). - - - - - - - id used to identify this target builder - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - - - - - - - - - diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeBuilderInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeBuilderInfo.java deleted file mode 100644 index f7d8a1884c0..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeBuilderInfo.java +++ /dev/null @@ -1,57 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; - -public interface IMakeBuilderInfo { - IPath getBuildLocation(); - void setBuildLocation(IPath location) throws CoreException; - - boolean isStopOnError(); - void setStopOnError(boolean on) throws CoreException; - - boolean isDefaultBuildCmd(); - void setUseDefaultBuildCmd(boolean on) throws CoreException; - - IPath getBuildCommand(); - void setBuildCommand(IPath command) throws CoreException; - - String getBuildArguments(); - void setBuildArguments(String args) throws CoreException; - - boolean isAutoBuildEnable(); - void setAutoBuildEnable(boolean enabled) throws CoreException; - - String getAutoBuildTarget(); - void setAutoBuildTarget(String target) throws CoreException; - - boolean isIncrementalBuildEnabled(); - void setIncrementalBuildEnable(boolean enabled) throws CoreException; - - String getIncrementalBuildTarget(); - void setIncrementalBuildTarget(String target) throws CoreException; - - boolean isFullBuildEnabled(); - void setFullBuildEnable(boolean enabled) throws CoreException; - - String getFullBuildTarget(); - void setFullBuildTarget(String target) throws CoreException; - - String[] getErrorParsers(); - void setErrorParsers(String[] parsers) throws CoreException; - - Map getEnvironment(); - void setEnvironment(Map env) throws CoreException; -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTarget.java deleted file mode 100644 index e94f6f711c0..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTarget.java +++ /dev/null @@ -1,52 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public interface IMakeTarget { - String getName(); - String getTargetBuilderID(); - - boolean isStopOnError(); - void setStopOnError(boolean stopOnError); - - boolean isDefaultBuildCmd(); - void setUseDefaultBuildCmd(boolean useDefault); - - void setBuildTarget(String target); - String getBuildTarget(); - - IPath getBuildCommand(); - void setBuildCommand(IPath command); - String getBuildArguments(); - void setBuildArguments(String arguments); - - - /** - * Get the target build container. - * - * @return IContainer of where target build will be invoked. - */ - IContainer getContainer(); - - /** - * Make this target temporary on the container, this target will not be persisted, - * and may not be added to the IMakeTargetManager. - * @param container - */ - void setContainer(IContainer container); - - void build(IProgressMonitor monitor) throws CoreException; -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetListener.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetListener.java deleted file mode 100644 index 63e6b66df46..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetListener.java +++ /dev/null @@ -1,16 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -public interface IMakeTargetListener { - - void targetChanged(MakeTargetEvent event); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java deleted file mode 100644 index ebaba53ee98..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; - -public interface IMakeTargetManager { - IMakeTarget createTarget(IProject project, String targetName, String targetBuilderID) throws CoreException; - void addTarget(IContainer container, IMakeTarget target) throws CoreException; - void removeTarget(IMakeTarget target) throws CoreException; - void renameTarget(IMakeTarget target, String name) throws CoreException; - - IMakeTarget[] getTargets(IContainer container) throws CoreException; - IMakeTarget findTarget(IContainer container, String name); - - IProject[] getTargetBuilderProjects() throws CoreException; - - String getBuilderID(String targetBuilderID); - - boolean hasTargetBuilder(IProject project); - String[] getTargetBuilders(IProject project); - - void addListener(IMakeTargetListener listener); - void removeListener(IMakeTargetListener listener); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java deleted file mode 100644 index 221e5707e9f..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java +++ /dev/null @@ -1,312 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Map; -import java.util.Properties; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CommandLauncher; -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.model.ICModelMarker; -import org.eclipse.cdt.core.resources.ACBuilder; -import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.cdt.make.internal.core.StreamMonitor; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.SubProgressMonitor; - -public class MakeBuilder extends ACBuilder { - - private static final String BUILD_ERROR = "MakeBuilder.buildError"; //$NON-NLS-1$ - - public final static String BUILDER_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeBuilder"; //$NON-NLS-1$ - - public MakeBuilder() { - } - - public class MyResourceDeltaVisitor implements IResourceDeltaVisitor { - boolean bContinue; - - public boolean visit(IResourceDelta delta) throws CoreException { - IResource resource = delta.getResource(); - if (resource != null && resource.getProject() == getProject()) { - bContinue = true; - return false; - } - return true; - } - public boolean shouldBuild() { - return bContinue; - } - } - /** - * @see IncrementalProjectBuilder#build - */ - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - boolean bPerformBuild = true; - IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(args, MakeBuilder.BUILDER_ID); - if (!shouldBuild(kind, info)) { - forgetLastBuiltState(); - return new IProject[0]; - } - if (kind == IncrementalProjectBuilder.AUTO_BUILD) { - MyResourceDeltaVisitor vis = new MyResourceDeltaVisitor(); - IResourceDelta delta = getDelta(getProject()); - if (delta != null) { - delta.accept(vis); - bPerformBuild = vis.shouldBuild(); - } else - bPerformBuild = false; - } - if (bPerformBuild) { - boolean isClean = invokeMake(kind, info, monitor); - if (isClean) { - forgetLastBuiltState(); - } - } else { // This should really be based of last build state, for now its safer to just - // forget last, until we get some kind of build state manager in the CDT Core. - forgetLastBuiltState(); - } - checkCancel(monitor); - return getProject().getReferencedProjects(); - } - - private boolean invokeMake(int kind, IMakeBuilderInfo info, IProgressMonitor monitor) { - boolean isClean = false; - IProject currProject = getProject(); - - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(MakeCorePlugin.getResourceString("MakeBuilder.Invoking_Make_Builder") + currProject.getName(), 100); //$NON-NLS-1$ - - try { - IPath buildCommand = info.getBuildCommand(); - if (buildCommand != null) { - IConsole console = CCorePlugin.getDefault().getConsole(); - console.start(currProject); - - OutputStream cos = console.getOutputStream(); - - // remove all markers for this project - removeAllMarkers(currProject); - - IPath workingDirectory = null; - if (!info.getBuildLocation().isEmpty()) { - IResource res = currProject.getParent().findMember(info.getBuildLocation()); - if (res instanceof IContainer && res.exists()) { - workingDirectory = res.getLocation(); - } - } - if (workingDirectory == null) { - workingDirectory = currProject.getLocation(); - } - String[] targets = getTargets(kind, info); - if (targets.length != 0 && targets[targets.length - 1].equals("clean")) //$NON-NLS-1$ - isClean = true; - - String errMsg = null; - CommandLauncher launcher = new CommandLauncher(); - // Print the command for visual interaction. - launcher.showCommand(true); - - // Set the environmennt, some scripts may need the CWD var to be set. - Properties props = launcher.getEnvironment(); - props.putAll(info.getEnvironment()); - props.put("CWD", workingDirectory.toOSString()); //$NON-NLS-1$ - props.put("PWD", workingDirectory.toOSString()); //$NON-NLS-1$ - String[] env = null; - ArrayList envList = new ArrayList(); - Enumeration names = props.propertyNames(); - if (names != null) { - while (names.hasMoreElements()) { - String key = (String) names.nextElement(); - envList.add(key + "=" + props.getProperty(key)); //$NON-NLS-1$ - } - env = (String[]) envList.toArray(new String[envList.size()]); - } - String[] buildArguments = targets; - if (info.isDefaultBuildCmd()) { - if (!info.isStopOnError()) { - buildArguments = new String[targets.length + 1]; - buildArguments[0] = "-k"; //$NON-NLS-1$ - System.arraycopy(targets, 0, buildArguments, 1, targets.length); - } - } else { - String args = info.getBuildArguments(); - if (args != null && !args.equals("")) { //$NON-NLS-1$ - String[] newArgs = makeArray(args); - buildArguments = new String[targets.length + newArgs.length]; - System.arraycopy(newArgs, 0, buildArguments, 0, newArgs.length); - System.arraycopy(targets, 0, buildArguments, newArgs.length, targets.length); - } - } -// MakeRecon recon = new MakeRecon(buildCommand, buildArguments, env, workingDirectory, makeMonitor, cos); -// recon.invokeMakeRecon(); -// cos = recon; - QualifiedName qName = new QualifiedName(MakeCorePlugin.getUniqueIdentifier(), "progressMonitor"); - Integer last = (Integer)getProject().getSessionProperty(qName); - if (last == null) { - last = new Integer(100); - } - StreamMonitor streamMon = new StreamMonitor(new SubProgressMonitor(monitor, 100), cos, last.intValue()); - ErrorParserManager epm = new ErrorParserManager(getProject(), this, info.getErrorParsers()); - epm.setOutputStream(streamMon); - OutputStream stdout = epm.getOutputStream(); - OutputStream stderr = epm.getOutputStream(); - Process p = launcher.execute(buildCommand, buildArguments, env, workingDirectory); - if (p != null) { - try { - // Close the input of the Process explicitely. - // We will never write to it. - p.getOutputStream().close(); - } catch (IOException e) { - } - // Before launching give visual cues via the monitor - monitor.subTask(MakeCorePlugin.getResourceString("MakeBuilder.Invoking_Command") + launcher.getCommandLine()); //$NON-NLS-1$ - if (launcher.waitAndRead(stdout, stderr, new SubProgressMonitor(monitor, 0)) - != CommandLauncher.OK) - errMsg = launcher.getErrorMessage(); - monitor.subTask(MakeCorePlugin.getResourceString("MakeBuilder.Updating_project")); //$NON-NLS-1$ - - try { - // Do not allow the cancel of the refresh, since the builder is external - // to Eclipse, files may have been created/modified and we will be out-of-sync. - // The caveat is for hugue projects, it may take sometimes at every build. - currProject.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - } - } else { - errMsg = launcher.getErrorMessage(); - } - getProject().setSessionProperty(qName, !monitor.isCanceled() && !isClean ? new Integer(streamMon.getWorkDone()) : null); - - if (errMsg != null) { - StringBuffer buf = new StringBuffer(buildCommand.toString() + " "); //$NON-NLS-1$ - for (int i = 0; i < buildArguments.length; i++) { - buf.append(buildArguments[i]); - buf.append(' '); - } - - String errorDesc = MakeCorePlugin.getFormattedString(BUILD_ERROR, buf.toString()); - buf = new StringBuffer(errorDesc); - buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$ - buf.append("(").append(errMsg).append(")"); //$NON-NLS-1$ //$NON-NLS-2$ - cos.write(buf.toString().getBytes()); - cos.flush(); - } - - stdout.close(); - stderr.close(); - - monitor.subTask(MakeCorePlugin.getResourceString("MakeBuilder.Creating_Markers")); //$NON-NLS-1$ - epm.reportProblems(); - cos.close(); - } - } catch (Exception e) { - CCorePlugin.log(e); - } finally { - monitor.done(); - } - return (isClean); - } - - /** - * Check whether the build has been canceled. - */ - public void checkCancel(IProgressMonitor monitor) { - if (monitor != null && monitor.isCanceled()) - throw new OperationCanceledException(); - } - - protected boolean shouldBuild(int kind, IMakeBuilderInfo info) { - switch (kind) { - case IncrementalProjectBuilder.AUTO_BUILD : - return info.isAutoBuildEnable(); - case IncrementalProjectBuilder.INCREMENTAL_BUILD : - return info.isIncrementalBuildEnabled(); - case IncrementalProjectBuilder.FULL_BUILD : - return info.isFullBuildEnabled(); - } - return true; - } - - protected String[] getTargets(int kind, IMakeBuilderInfo info) { - String targets = ""; //$NON-NLS-1$ - switch (kind) { - case IncrementalProjectBuilder.AUTO_BUILD : - targets = info.getAutoBuildTarget(); - break; - case IncrementalProjectBuilder.INCREMENTAL_BUILD : - targets = info.getIncrementalBuildTarget(); - break; - case IncrementalProjectBuilder.FULL_BUILD : - targets = info.getFullBuildTarget(); - break; - } - return makeArray(targets); - } - - // Turn the string into an array. - String[] makeArray(String string) { - string.trim(); - char[] array = string.toCharArray(); - ArrayList aList = new ArrayList(); - StringBuffer buffer = new StringBuffer(); - boolean inComment = false; - for (int i = 0; i < array.length; i++) { - char c = array[i]; - if (array[i] == '"' || array[i] == '\'') { - if (i > 0 && array[i - 1] == '\\') { - inComment = false; - } else { - inComment = !inComment; - } - } - if (c == ' ' && !inComment) { - aList.add(buffer.toString()); - buffer = new StringBuffer(); - } else { - buffer.append(c); - } - } - if (buffer.length() > 0) - aList.add(buffer.toString()); - return (String[]) aList.toArray(new String[aList.size()]); - } - - private void removeAllMarkers(IProject currProject) throws CoreException { - IWorkspace workspace = currProject.getWorkspace(); - - // remove all markers - IMarker[] markers = currProject.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); - if (markers != null) { - workspace.deleteMarkers(markers); - } - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java deleted file mode 100644 index 933acce8e3f..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java +++ /dev/null @@ -1,182 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.internal.core.BuildInfoFactory; -import org.eclipse.cdt.make.internal.core.MakeTargetManager; -import org.eclipse.cdt.make.internal.core.makefile.gnu.GNUMakefile; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.Status; - -/** - * The main plugin class to be used in the desktop. - */ -public class MakeCorePlugin extends Plugin { - public static final String MAKE_PROJECT_ID = MakeCorePlugin.getUniqueIdentifier() + ".make"; - private MakeTargetManager fTargetManager; - public static final String OLD_BUILDER_ID = "org.eclipse.cdt.core.cbuilder"; //$NON-NLS-1$ - //The shared instance. - private static MakeCorePlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - /** - * The constructor. - */ - public MakeCorePlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - try { - resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.make.core.PluginResources"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - /** - * Returns the shared instance. - */ - public static MakeCorePlugin getDefault() { - return plugin; - } - - public static void log(Throwable e) { - if (e instanceof InvocationTargetException) - e = ((InvocationTargetException) e).getTargetException(); - IStatus status = null; - if (e instanceof CoreException) - status = ((CoreException) e).getStatus(); - else - status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, e.getMessage(), e); - log(status); - } - - public static void log(IStatus status) { - ResourcesPlugin.getPlugin().getLog().log(status); - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = MakeCorePlugin.getDefault().getResourceBundle(); - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } - } - - public static String getFormattedString(String key, String arg) { - return MessageFormat.format(getResourceString(key), new String[] { arg }); - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - return resourceBundle; - } - - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.make.core"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - protected void initializeDefaultPluginPreferences() { - IMakeBuilderInfo info = createBuildInfo(getPluginPreferences(), MakeBuilder.BUILDER_ID, true); - try { - info.setBuildCommand(new Path("make")); //$NON-NLS-1$ - info.setBuildLocation(new Path("")); //$NON-NLS-1$ - info.setStopOnError(false); - info.setUseDefaultBuildCmd(true); - info.setAutoBuildEnable(false); - info.setAutoBuildTarget("all"); //$NON-NLS-1$ - info.setIncrementalBuildEnable(true); - info.setIncrementalBuildTarget("all"); //$NON-NLS-1$ - info.setFullBuildEnable(true); - info.setFullBuildTarget("clean all"); //$NON-NLS-1$ - info.setErrorParsers(CCorePlugin.getDefault().getAllErrorParsersIDs()); - } catch (CoreException e) { - } - getPluginPreferences().setDefault(CCorePlugin.PREF_BINARY_PARSER, CCorePlugin.PLUGIN_ID + ".ELF"); //$NON-NLS-1$ - } - - public static IMakeBuilderInfo createBuildInfo(Preferences prefs, String builderID, boolean useDefaults) { - return BuildInfoFactory.create(prefs, builderID, useDefaults); - } - - public static IMakeBuilderInfo createBuildInfo(IProject project, String builderID) throws CoreException { - return BuildInfoFactory.create(project, builderID); - } - - public static IMakeBuilderInfo createBuildInfo(Map args, String builderID) { - return BuildInfoFactory.create(args, builderID); - } - - public IMakeTargetManager getTargetManager() { - if ( fTargetManager == null) { - fTargetManager = new MakeTargetManager(); - fTargetManager.startup(); - } - return fTargetManager; - } - - public IMakefile createMakefile(IFile file) { - GNUMakefile gnu = new GNUMakefile(); - try { - gnu.parse(file.getLocation().toOSString()); - String[] dirs = gnu.getIncludeDirectories(); - String[] includes = new String[dirs.length + 1]; - System.arraycopy(dirs, 0, includes, 0, dirs.length); - String cwd = file.getLocation().removeLastSegments(1).toOSString(); - includes[dirs.length] = cwd; - gnu.setIncludeDirectories(includes); - } catch (IOException e) { - } - return gnu; - // - // base on a preference to chose GNU vs Posix - //return PosixMakefile(file.getLocation); - } - - public void shutdown() throws CoreException { - super.shutdown(); - if ( fTargetManager != null) { - fTargetManager.shutdown(); - fTargetManager = null; - } - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java deleted file mode 100644 index 07d31716504..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeProjectNature.java +++ /dev/null @@ -1,146 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -public class MakeProjectNature implements IProjectNature { - - public final static String NATURE_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeNature"; //$NON-NLS-1$ - private IProject fProject; - - public static void addNature(IProject project, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = project.getDescription(); - String[] prevNatures= description.getNatureIds(); - for (int i= 0; i < prevNatures.length; i++) { - if (NATURE_ID.equals(prevNatures[i])) - return; - } - String[] newNatures= new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length]= NATURE_ID; - description.setNatureIds(newNatures); - project.setDescription(description, monitor); - } - - public static ICommand getBuildSpec(IProject project, String builderID) throws CoreException { - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(builderID)) { - return commands[i]; - } - } - return null; - } - - /** - * Adds a builder to the build spec for the given project. - */ - public static void addToBuildSpec(IProject project, String builderID, IProgressMonitor mon) throws CoreException { - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - boolean found = false; - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(builderID)) { - found = true; - break; - } - } - if (!found) { - ICommand command = description.newCommand(); - command.setBuilderName(builderID); - ICommand[] newCommands = new ICommand[commands.length + 1]; - // Add it before other builders. See 1FWJK7I: ITPJCORE:WIN2000 - System.arraycopy(commands, 0, newCommands, 1, commands.length); - newCommands[0] = command; - description.setBuildSpec(newCommands); - project.setDescription(description, mon); - } - } - - /** - * Removes the given builder from the build spec for the given project. - */ - public static void removeFromBuildSpec(IProject project, String builderID, IProgressMonitor mon) throws CoreException { - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(builderID)) { - ICommand[] newCommands = new ICommand[commands.length - 1]; - System.arraycopy(commands, 0, newCommands, 0, i); - System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1); - description.setBuildSpec(newCommands); - break; - } - } - project.setDescription(description, mon); - } - - public void addBuildSpec() throws CoreException { - addToBuildSpec(getProject(), MakeBuilder.BUILDER_ID, null); - } - - /** - * @see IProjectNature#configure - */ - public void configure() throws CoreException { - addBuildSpec(); - IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(MakeCorePlugin.getDefault().getPluginPreferences(), MakeBuilder.BUILDER_ID, false); - IMakeBuilderInfo projectInfo = MakeCorePlugin.createBuildInfo(getProject(), MakeBuilder.BUILDER_ID); - projectInfo.setBuildLocation(info.getBuildLocation()); - - - projectInfo.setUseDefaultBuildCmd(info.isDefaultBuildCmd()); - projectInfo.setStopOnError(info.isStopOnError()); - projectInfo.setBuildCommand(info.getBuildCommand()); - - projectInfo.setAutoBuildEnable(info.isAutoBuildEnable()); - projectInfo.setAutoBuildTarget(info.getAutoBuildTarget()); - - projectInfo.setIncrementalBuildEnable(info.isIncrementalBuildEnabled()); - projectInfo.setIncrementalBuildTarget(info.getIncrementalBuildTarget()); - - projectInfo.setFullBuildEnable(info.isFullBuildEnabled()); - projectInfo.setFullBuildTarget(info.getFullBuildTarget()); - projectInfo.setErrorParsers(info.getErrorParsers()); - } - - public void removeBuildSpec() throws CoreException { - removeFromBuildSpec(getProject(), MakeBuilder.BUILDER_ID, null); - } - - /** - * @see IProjectNature#deconfigure - */ - public void deconfigure() throws CoreException { - removeBuildSpec(); - } - - /** - * @see IProjectNature#getProject - */ - public IProject getProject() { - return fProject; - } - - /** - * @see IProjectNature#setProject - */ - public void setProject(IProject project) { - fProject = project; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java deleted file mode 100644 index 2f8168f81ec..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; - - -/** - * @author David - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MakeScannerInfo implements IScannerInfo { - private IProject project; - private ArrayList symbolList; - private ArrayList pathList; - - MakeScannerInfo(IProject project) { - this.project = project; - } - - IProject getProject() { - return project; - } - - public void update() throws CoreException { - MakeScannerProvider.updateScannerInfo(this); - } - - public synchronized void setPreprocessorSymbols(String[] symbols) { - // Clear out any existing symbols and add the new stuff - getSymbolList().clear(); - getSymbolList().addAll(Arrays.asList(symbols)); - } - - public synchronized void setIncludePaths(String[] paths) { - // Clear the existing list and add the paths - getPathList().clear(); - getPathList().addAll(Arrays.asList(paths)); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths() - */ - public synchronized String[] getIncludePaths() { - return (String[])getPathList().toArray(new String[getPathList().size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths() - */ - public synchronized Map getDefinedSymbols() { - // Return the defined symbols for the default configuration - HashMap symbols = new HashMap(); - String[] symbolList = getPreprocessorSymbols(); - for (int i = 0; i < symbolList.length; ++i) { - String symbol = symbolList[i]; - if (symbol.length() == 0) { - continue; - } - String key = new String(); - String value = new String(); - int index = symbol.indexOf("="); //$NON-NLS-1$ - if (index != -1) { - key = symbol.substring(0, index).trim(); - value = symbol.substring(index + 1).trim(); - } else { - key = symbol.trim(); - } - symbols.put(key, value); - } - return symbols; - } - - protected List getPathList() { - if (pathList == null) { - pathList = new ArrayList(); - } - return pathList; - } - - public synchronized String[] getPreprocessorSymbols() { - return (String[])getSymbolList().toArray(new String[getSymbolList().size()]); - } - - protected List getSymbolList() { - if (symbolList == null) { - symbolList = new ArrayList(); - } - return symbolList; - } -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java deleted file mode 100644 index e7bb6992cb9..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeScannerProvider.java +++ /dev/null @@ -1,268 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - -import org.eclipse.cdt.core.AbstractCExtension; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -public class MakeScannerProvider extends AbstractCExtension implements IScannerInfoProvider { - - // This is the id of the IScannerInfoProvider extension point entry - public static final String INTERFACE_IDENTITY = MakeCorePlugin.getUniqueIdentifier() + ".MakeScannerProvider"; //$NON-NLS-1$ - - // Name we will use to store build property with the project - private static final QualifiedName scannerInfoProperty = new QualifiedName(MakeCorePlugin.getUniqueIdentifier(), "makeBuildInfo"); //$NON-NLS-1$ - private static final String CDESCRIPTOR_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeScannerInfo"; //$NON-NLS-1$ - - public static final String INCLUDE_PATH = "includePath"; //$NON-NLS-1$ - public static final String PATH = "path"; //$NON-NLS-1$ - public static final String DEFINED_SYMBOL = "definedSymbol"; //$NON-NLS-1$ - public static final String SYMBOL = "symbol"; //$NON-NLS-1$ - - // Listeners interested in build model changes - private static Map listeners; - - private static MakeScannerProvider defaultProvider; - - public static MakeScannerProvider getDefault() { - if (defaultProvider == null) { - defaultProvider = new MakeScannerProvider(); - } - return defaultProvider; - } - - public MakeScannerInfo getMakeScannerInfo(IProject project, boolean cacheInfo) throws CoreException { - MakeScannerInfo scannerInfo = null; - // See if there's already one associated with the resource for this - // session - scannerInfo = (MakeScannerInfo)project.getSessionProperty(scannerInfoProperty); - - // Try to load one for the project - if (scannerInfo == null) { - scannerInfo = loadScannerInfo(project); - } - - // There is nothing persisted for the session, or saved in a file so - // create a build info object - if (scannerInfo != null && cacheInfo == true) { - project.setSessionProperty(scannerInfoProperty, scannerInfo); - } - return scannerInfo; - } - - /* - * @return - */ - private synchronized static Map getListeners() { - if (listeners == null) { - listeners = new HashMap(); - } - return listeners; - } - - /** - * @param project - * @param info - */ - private static void notifyInfoListeners(IProject project, IScannerInfo info) { - // Call in the cavalry - List listeners = (List)getListeners().get(project); - if (listeners == null) { - return; - } - ListIterator iter = listeners.listIterator(); - while (iter.hasNext()) { - ((IScannerInfoChangeListener)iter.next()).changeNotification(project, info); - } - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource) - */ - public IScannerInfo getScannerInformation(IResource resource) { - IScannerInfo info = null; - try { - info = getMakeScannerInfo(resource.getProject(), true); - } catch (CoreException e) { - } - return info; - } - - /* - * Loads the build file and parses the nodes for build information. The - * information is then associated with the resource for the duration of the - * session. - */ - private MakeScannerInfo loadScannerInfo(IProject project) throws CoreException { - ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project); - Node child = descriptor.getProjectData(CDESCRIPTOR_ID).getFirstChild(); - ArrayList includes = new ArrayList(); - ArrayList symbols = new ArrayList(); - while (child != null) { - if (child.getNodeName().equals(INCLUDE_PATH)) { - // Add the path to the property list - includes.add(((Element)child).getAttribute(PATH)); - } else if (child.getNodeName().equals(DEFINED_SYMBOL)) { - // Add the symbol to the symbol list - symbols.add(((Element)child).getAttribute(SYMBOL)); - } - child = child.getNextSibling(); - } - MakeScannerInfo info = new MakeScannerInfo(project); - info.setIncludePaths((String[])includes.toArray(new String[includes.size()])); - info.setPreprocessorSymbols((String[])symbols.toArray(new String[symbols.size()])); - return info; - } - - /** - * The build model manager for standard builds only caches the build - * information for a resource on a per-session basis. This method allows - * clients of the build model manager to programmatically remove the - * association between the resource and the information while the reource - * is still open or in the workspace. The Eclipse core will take care of - * removing it if a resource is closed or deleted. - * - * @param resource - */ - public static void removeScannerInfo(IResource resource) { - try { - resource.getProject().setSessionProperty(scannerInfoProperty, null); - } catch (CoreException e) { - } - } - - /** - * Persists build-specific information in the build file. Build information - * for standard make projects consists of preprocessor symbols and includes - * paths. Other project-related information is stored in the persistent - * properties of the project. - * - * @param project - */ - static void updateScannerInfo(MakeScannerInfo scannerInfo) throws CoreException { - IProject project = scannerInfo.getProject(); - - // See if there's already one associated with the resource for this - // session - if (project.getSessionProperty(scannerInfoProperty) != null) { - project.setSessionProperty(scannerInfoProperty, scannerInfo); - } - - ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project); - - Element rootElement = descriptor.getProjectData(CDESCRIPTOR_ID); - - // Clear out all current children - // Note: Probably would be a better idea to merge in the data - Node child = rootElement.getFirstChild(); - while (child != null) { - rootElement.removeChild(child); - child = rootElement.getFirstChild(); - } - - // Save the build info - if (scannerInfo != null) { - // Serialize the include paths - Document doc = rootElement.getOwnerDocument(); - ListIterator iter = Arrays.asList(scannerInfo.getIncludePaths()).listIterator(); - while (iter.hasNext()) { - Element pathElement = doc.createElement(INCLUDE_PATH); - pathElement.setAttribute(PATH, (String)iter.next()); - rootElement.appendChild(pathElement); - } - // Now do the same for the symbols - iter = Arrays.asList(scannerInfo.getPreprocessorSymbols()).listIterator(); - while (iter.hasNext()) { - Element symbolElement = doc.createElement(DEFINED_SYMBOL); - symbolElement.setAttribute(SYMBOL, (String)iter.next()); - rootElement.appendChild(symbolElement); - } - descriptor.saveProjectData(); - } - notifyInfoListeners(project, scannerInfo); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#subscribe(org.eclipse.core.resources.IResource, - * org.eclipse.cdt.core.parser.IScannerInfoChangeListener) - */ - public synchronized void subscribe(IResource resource, IScannerInfoChangeListener listener) { - IResource project = null; - if (resource instanceof IProject) { - project = resource; - } else if (resource instanceof IFile) { - project = ((IFile)resource).getProject(); - } else { - return; - } - // Get listeners for this resource - Map map = getListeners(); - List list = (List)map.get(project); - if (list == null) { - // Create a new list - list = new ArrayList(); - } - if (!list.contains(listener)) { - // Add the new listener for the resource - list.add(listener); - map.put(project, list); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#unsubscribe(org.eclipse.core.resources.IResource, - * org.eclipse.cdt.core.parser.IScannerInfoChangeListener) - */ - public synchronized void unsubscribe(IResource resource, IScannerInfoChangeListener listener) { - IResource project = null; - if (resource instanceof IProject) { - project = resource; - } else if (resource instanceof IFile) { - project = ((IFile)resource).getProject(); - } else { - return; - } - // Remove the listener - Map map = getListeners(); - List list = (List)map.get(project); - if (list != null && !list.isEmpty()) { - // The list is not empty so try to remove listener - list.remove(listener); - map.put(project, list); - } - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeTargetEvent.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeTargetEvent.java deleted file mode 100644 index 4fe3126d923..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeTargetEvent.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core; - -import java.util.EventObject; - -import org.eclipse.core.resources.IProject; - -public class MakeTargetEvent extends EventObject { - public static final int TARGET_ADD = 1; - public static final int TARGET_CHANGED = 2; - public static final int TARGET_REMOVED = 3; - public static final int PROJECT_ADDED = 4; - public static final int PROJECT_REMOVED = 5; - - IMakeTarget target; - IProject project; - int type; - - /** - * @param source - */ - public MakeTargetEvent(Object source, int type, IMakeTarget target) { - super(source); - this.type = type; - this.target = target; - } - - public MakeTargetEvent(Object source, int type, IProject project) { - super(source); - this.type = type; - this.project = project; - } - - public int getType() { - return type; - } - - public IMakeTarget getTarget() { - return target; - } -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/PluginResources.properties b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/PluginResources.properties deleted file mode 100644 index 6cbf15ca9af..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/PluginResources.properties +++ /dev/null @@ -1,13 +0,0 @@ - -MakeBuilder.buildError=Error launching builder ({0}) -MakeBuilder.Invoking_Make_Builder=Invoking Make Builder... -MakeBuilder.Invoking_Command=Invoking Command: -MakeBuilder.Updating_project=Updating project... -MakeBuidler.Creating_Markers=Generating markers... - -BuildInfoFactory.Missing_Builder=Missing Builder: - -MakeTargetProvider.add_to_workspace_root=Cannot add build targets to workspace root -MakeTargetProvider.add_temporary_target=Cannot add temporart Target to manager. -MakeTargetProvider.target_exists=Target exists -MakeTargetProvider.failed_initializing_targets=Failed initializing build targets diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IArchiveTarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IArchiveTarget.java deleted file mode 100644 index d044e6b4dab..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IArchiveTarget.java +++ /dev/null @@ -1,29 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * IArchiveTarget - * Archive files, are files maintained by the program "ar". - * They contain objects, the members of the Archive. - * For example: - * foolib(hack.o) : hack.o - * ar cr foolib hack.o - * ArchiveTarget(member) -- foolib(hack.o); - */ -public interface IArchiveTarget extends ITarget { - - /** - * Returns the members the point by archive target. - * @return String - */ - String[] getMembers(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IBadDirective.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IBadDirective.java deleted file mode 100644 index b8dc558b1ce..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IBadDirective.java +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.make.core.makefile; - -/** - * Represent an error in the makefile syntax - */ -public interface IBadDirective { -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ICommand.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ICommand.java deleted file mode 100644 index 489dac8a2bc..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ICommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -import java.io.File; -import java.io.IOException; - - -/** - * ICommand - * Commands are associated with a rule and executed by - * the make program when building a target. - */ -public interface ICommand extends IDirective { - - final public static char HYPHEN = '-'; - - final public static String HYPHEN_STRING = "-"; - - final public static char AT = '@'; - - final public static String AT_STRING = "@"; - - final public static char PLUS = '+'; - - final public static String PLUS_STRING = "+"; - - final public static char TAB = '\t'; - - /** - * - If the command prefix contains a hyphen, or the -i option is - * present, or the special target .IGNORE has either the current - * target as a prerequisite or has no prerequisites, any error - * found while executing the command will be ignored. - */ - boolean shouldIgnoreError(); - - /** - * @ If the command prefix contains an at sign and the - * command-line -n option is not specified, or the -s option is - * present, or the special target .SILENT has either the current - * target as a prerequisite or has no prerequisites, the command - * will not be written to standard output before it is executed. - */ - boolean shouldBeSilent(); - - /** - * + If the command prefix contains a plus sign, this indicates a - * command line that will be executed even if -n, -q or -t is - * specified. - */ - boolean shouldExecute(); - - - /** - * Executes the command in a separate process with the - * specified environment and working directory. - * - */ - Process execute(String shell, String[] envp, File dir) throws IOException; -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IComment.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IComment.java deleted file mode 100644 index 5a48695df4b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IComment.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * Comments start with '#' and until the end of the line. - */ -public interface IComment extends IDirective { - - final public static char POUND = '#'; - - final public static String POUND_STRING = "#"; - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDefaultRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDefaultRule.java deleted file mode 100644 index 77db59f5424..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDefaultRule.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .DEFAULT - * If the makefile uses this special target, the application shall ensure that it is - * specified with commands, but without prerequisites. - * The commands shall be used by make if there are no other rules available to build a target. - */ -public interface IDefaultRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java deleted file mode 100644 index 66c1a0d9cb9..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IDirective.java +++ /dev/null @@ -1,40 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * A Makefile can contain rules, macro definitons and comments. - * They are call directives. - */ -public interface IDirective { - - /** - * Returns the parent of this directive, null if none. - * @return - */ - IDirective getParent(); - - /** - * The starting line number of this directive. - * The numbering starts at 1 .i.e the first line is not 0 - * @return - */ - int getStartLine(); - - /** - * The ending line number of this directive. - * The numbering starts at 1 .i.e the first line is not 0 - * @return - */ - int getEndLine(); - - String toString(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IEmptyLine.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IEmptyLine.java deleted file mode 100644 index 17f2feca003..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IEmptyLine.java +++ /dev/null @@ -1,17 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * IEmptyLine - */ -public interface IEmptyLine extends IDirective { -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IIgnoreRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IIgnoreRule.java deleted file mode 100644 index 00906fbc1bc..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IIgnoreRule.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .IGNORE - * Prerequisites of this special target are targets themselves; this shall cause errors - * from commands associated with them to be ignored in the same manner as specified by the -i option. - */ -public interface IIgnoreRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IInferenceRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IInferenceRule.java deleted file mode 100644 index 63e9a3f7863..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IInferenceRule.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * IInferenceRules are formated as follows: - * target: - * command - * [command] - * - * The target is of the form .s2 or .s1.s2 - * There are no prerequisites. - */ -public interface IInferenceRule extends IRule { -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMacroDefinition.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMacroDefinition.java deleted file mode 100644 index 4c0f3047619..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMacroDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * IMacroDefinitions are in the form: - * string1 = [string2] - */ -public interface IMacroDefinition extends IDirective { - - /** - * Returns the name of the macro - * @return - */ - String getName(); - - /** - * Returns the value of the macro - * @return - */ - StringBuffer getValue(); - - /** - * The macro is a built-in - * @return - */ - boolean isFromDefault(); - - /** - * The macro was found in a Makefile. - * @return - */ - boolean isFromMakefile(); - - /** - * The macro came from the environment. - * @return - */ - boolean isFromEnviroment(); - - /** - * The macro came from the make command option -e - * @return - */ - boolean isFromEnvironmentOverride(); - - /** - * The macro was pass from an option to make. - * @return - */ - boolean isFromCommand(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefile.java deleted file mode 100644 index 048afc9fe34..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefile.java +++ /dev/null @@ -1,79 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -import java.io.IOException; -import java.io.Reader; - - -/** - * IMakefile: - * - * Makefile : ( directive ) * - * directive : rule | macro_definition | comments | empty - * rule : inference_rule | target_rule | special_rule - * inference_rule : target ':' [ ';' command ] - * [ ( command ) * ] - * target_rule : [ ( target ) + ] ':' [ ( prerequisite ) * ] [ ';' command ] - * [ ( command ) * ] - * macro_definition : string '=' ( string )* - * comments : ('#' ( string ) ) * - * empty : - * command : prefix_command string - * target : string - * prefix_command : '-' | '@' | '+' - * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%" - */ -public interface IMakefile extends IParent { - - /** - * ITargetRule | IInferenceRule | ISpecialRule - * @return - */ - IRule[] getRules(); - - /** - * Returns IInferenceRule - * @return - */ - IInferenceRule[] getInferenceRules(); - - /** - * Returns ITargetRule - * @return - */ - ITargetRule[] getTargetRules(); - - /** - * Return IMacroDefintion - * @return - */ - IMacroDefinition[] getMacroDefinitions(); - - /** - * Return all the builtin directives. - * @return - */ - IDirective[] getBuiltins(); - - /** - * Return all the buil-in MacroDefintions - * @return - */ - IMacroDefinition[] getBuiltinMacroDefinitions(); - - /** - * Clear the all statements and (re)parse the Makefile - * @param makefile - * @throws IOException - */ - void parse(Reader makefile) throws IOException; -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefileValidator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefileValidator.java deleted file mode 100644 index dfa75bd205d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IMakefileValidator.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Created on Sep 21, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.make.core.makefile; - -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * @author alain - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IMakefileValidator { - public abstract void setMarkerGenerator(IMarkerGenerator errorHandler); - public abstract void checkFile(IFile file, IProgressMonitor monitor); -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IParent.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IParent.java deleted file mode 100644 index 24c6962077e..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IParent.java +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * IParent - */ -public interface IParent extends IDirective { - IDirective[] getDirectives(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPosixRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPosixRule.java deleted file mode 100644 index f725e7b9bab..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPosixRule.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .POSIX - * The application shall ensure that this special target is specified without - * prerequisites or commands. - */ -public interface IPosixRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPreciousRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPreciousRule.java deleted file mode 100644 index 1ec04f908ce..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IPreciousRule.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .PRECIOUS - * Prerequisites of this special target shall not be removed if make recieves an - * asynchronous events. - */ -public interface IPreciousRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IRule.java deleted file mode 100644 index c0f7ba43385..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/IRule.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * There are several kinds of rules: Inference rules, target rules - * Some make provides special rules for example: - * .DEFAULT, .IGNORE etc ... - */ -public interface IRule extends IParent { - /** - * Array of command for the rule. - * @return - */ - ICommand[] getCommands(); - - /** - * The rule target name. - * @return - */ - ITarget getTarget(); - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISccsGetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISccsGetRule.java deleted file mode 100644 index aa167735742..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISccsGetRule.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .SCCS_GET - * The application shall ensure that this special target is specified without prerequesites. - * The commands specified with this target shall replace the default - * commands associated with this special target. - */ -public interface ISccsGetRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISilentRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISilentRule.java deleted file mode 100644 index 59a986eb4ef..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISilentRule.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .SILENT - * Prerequisites of this special target are targets themselves; this shall case - * commands associated with them not to be written to the standard output before - * they are executed. - */ -public interface ISilentRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISpecialRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISpecialRule.java deleted file mode 100644 index ec7220786e8..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISpecialRule.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * Target rule that have special meaning for Make. - */ -public interface ISpecialRule extends IRule { - - /** - * The meaning of the prerequistes are specific to - * each rules. - */ - String[] getPrerequisites(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISuffixesRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISuffixesRule.java deleted file mode 100644 index 40a08a51660..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ISuffixesRule.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * .SUFFIXES - * Prerequesites of .SUFFIXES shall be appended to the list of known suffixes and are - * used in conjunction with the inference rules. - */ -public interface ISuffixesRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java deleted file mode 100644 index a9df18cb4fc..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITarget.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * ITarget - */ -public interface ITarget { - - String toString(); - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITargetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITargetRule.java deleted file mode 100644 index 45b98f9bc25..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/ITargetRule.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile; - -/** - * ITargetRule - */ -public interface ITargetRule extends IRule { - - String[] getPrerequisites(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IConditional.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IConditional.java deleted file mode 100644 index ab2f26a8077..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IConditional.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.IDirective; - -/** - */ -public interface IConditional extends IDirective { - - String getConditional(); - - String getArg1(); - - String getArg2(); - - boolean isIfdef(); - - boolean isIfndef(); - - boolean isIfeq(); - - boolean isIfneq(); - - boolean isElse(); - -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IDeleteOnErrorRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IDeleteOnErrorRule.java deleted file mode 100644 index 510a0ecb37e..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IDeleteOnErrorRule.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .DELETE_ON_ERROR' - * If `.DELETE_ON_ERROR' is mentioned as a target anywhere in the - * makefile, then `make' will delete the target of a rule if it has - * changed and its commands exit with a nonzero exit status, just as - * it does when it receives a signal. - */ -public interface IDeleteOnErrorRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IExportAllVariablesRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IExportAllVariablesRule.java deleted file mode 100644 index 11547377177..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IExportAllVariablesRule.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .EXPORT_ALL_VARIABLES - * Simply by being mentioned as a target, this tells `make' to export - * all variables to child processes by default. - */ -public interface IExportAllVariablesRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IGNUMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IGNUMakefile.java deleted file mode 100644 index 6f8b0c5280b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IGNUMakefile.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.IMakefile; - -/** - */ -public interface IGNUMakefile extends IMakefile { - - /** - * Set the search include directories for the - * "include" directive - * @param paths - */ - void setIncludeDirectories(String[] paths); - - /** - * Get the include directories search paths. - * @return - */ - String[] getIncludeDirectories(); -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IInclude.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IInclude.java deleted file mode 100644 index 96422defdd8..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IInclude.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.IParent; - -/** - */ -public interface IInclude extends IParent { - String[] getFilenames(); -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IIntermediateRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IIntermediateRule.java deleted file mode 100644 index fed722a62bb..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IIntermediateRule.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .INTERMEDIATE - * The targets which `.INTERMEDIATE' depends on are treated as intermediate files. - * `.INTERMEDIATE' with no prerequisites has no effect. - */ -public interface IIntermediateRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ILowResolutionTimeRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ILowResolutionTimeRule.java deleted file mode 100644 index 56b5995250a..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ILowResolutionTimeRule.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .LOW_RESOLUTION_TIME - * If you specify prerequisites for `.LOW_RESOLUTION_TIME', `make' - * assumes that these files are created by commands that generate low - * resolution time stamps. - */ -public interface ILowResolutionTimeRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/INotParallelRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/INotParallelRule.java deleted file mode 100644 index 3620a0c05ed..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/INotParallelRule.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .NOTPARALLEL - * If `.NOTPARALLEL' is mentioned as a target, then this invocation of - * `make' will be run serially, even if the `-j' option is given. - * Any recursively invoked `make' command will still be run in - * parallel (unless its makefile contains this target). Any - * prerequisites on this target are ignored. - */ -public interface INotParallelRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IPhonyRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IPhonyRule.java deleted file mode 100644 index 708b634552c..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IPhonyRule.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .PHONY - * The prerequisites of the special target `.PHONY' are considered to be phony targets. - * When it is time to consider such a target, `make' will run its commands unconditionally, regardless of - * whether a file with that name exists or what its last-modification time is. - */ -public interface IPhonyRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ISecondaryRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ISecondaryRule.java deleted file mode 100644 index b4f1ed981c1..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ISecondaryRule.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; - -/** - * .SECONDARY - * The targets which `.SECONDARY' depends on are treated as - * intermediate files, except that they are never automatically deleted. - * - * `.SECONDARY' with no prerequisites causes all targets to be treated - * as secondary (i.e., no target is removed because it is considered intermediate). - */ -public interface ISecondaryRule extends ISpecialRule { -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ITerminal.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ITerminal.java deleted file mode 100644 index 99f56ae7d8c..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/ITerminal.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.IDirective; - -/** - * ITerminal finish a block. - */ -public interface ITerminal extends IDirective { - - boolean isEndef(); - - boolean isEndif(); - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IUnExport.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IUnExport.java deleted file mode 100644 index d6b79932293..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IUnExport.java +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -/** - */ -public interface IUnExport { - - String getVariable(); -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVPath.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVPath.java deleted file mode 100644 index d2f65d0dc05..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVPath.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.IDirective; - -/** - */ -public interface IVPath extends IDirective { - - String[] getDirectories(); - - String getPattern(); -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVariableDefinition.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVariableDefinition.java deleted file mode 100644 index be562c3b28d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/makefile/gnu/IVariableDefinition.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.IMacroDefinition; - -/** - */ -public interface IVariableDefinition extends IMacroDefinition { - - boolean isRecursivelyExpanded(); - - boolean isSimplyExpanded(); - - boolean isConditional(); - - boolean isAppend(); - - boolean isTargetSpecific(); - - boolean isExport(); - - boolean isMultiLine(); - - /** - * Variable from an `override' directive. - */ - boolean isOverride(); - - /** - * Automatic variable -- cannot be set. - */ - boolean isAutomatic(); - String getTarget(); -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java deleted file mode 100644 index 8e9f76a9209..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/BuildInfoFactory.java +++ /dev/null @@ -1,362 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.Map.Entry; - -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeProjectNature; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.Status; - -public class BuildInfoFactory { - - private static final String PREFIX = MakeCorePlugin.getUniqueIdentifier(); - - static final String BUILD_COMMAND = PREFIX + ".buildCommand"; //$NON-NLS-1$ - static final String BUILD_LOCATION = PREFIX + ".buildLocation"; //$NON-NLS-1$ - static final String STOP_ON_ERROR = PREFIX + ".stopOnError"; //$NON-NLS-1$ - static final String USE_DEFAULT_BUILD_CMD = PREFIX + ".useDefaultBuildCmd"; //$NON-NLS-1$ - static final String BUILD_TARGET_AUTO = PREFIX + ".autoBuildTarget"; //$NON-NLS-1$ - static final String BUILD_TARGET_INCREMENTAL = PREFIX + ".incrementalBuildTarget"; //$NON-NLS-1$ - static final String BUILD_TARGET_FULL = PREFIX + ".fullBuildTarget"; //$NON-NLS-1$ - static final String BUILD_FULL_ENABLED = PREFIX + ".enableFullBuild"; //$NON-NLS-1$ - static final String BUILD_INCREMENTAL_ENABLED = PREFIX + ".enabledIncrementalBuild"; //$NON-NLS-1$ - static final String BUILD_AUTO_ENABLED = PREFIX + ".enableAutoBuild"; //$NON-NLS-1$ - static final String BUILD_ARGUMENTS = PREFIX + ".buildArguments"; //$NON-NLS-1$ - static final String ENVIRONMENT = PREFIX + ".environment"; //$NON-NLS-1$ - - private abstract static class Store implements IMakeBuilderInfo { - - public void setUseDefaultBuildCmd(boolean on) throws CoreException { - putString(USE_DEFAULT_BUILD_CMD, new Boolean(on).toString()); - } - - public boolean isDefaultBuildCmd() { - if (getString(USE_DEFAULT_BUILD_CMD) == null) { // if no property then default to true - return true; - } - return getBoolean(USE_DEFAULT_BUILD_CMD); - } - - public void setBuildCommand(IPath location) throws CoreException { - putString(BUILD_COMMAND, location.toString()); - } - - public IPath getBuildCommand() { - if (isDefaultBuildCmd()) { - String command = getBuildParameter("defaultCommand"); //$NON-NLS-1$ - if (command == null) { - return new Path("make"); //$NON-NLS-1$ - } - return new Path(command); - } - return new Path(getString(BUILD_COMMAND)); - } - - protected String getBuildParameter(String name) { - IExtension extension = - Platform.getPluginRegistry().getExtension( - ResourcesPlugin.PI_RESOURCES, - ResourcesPlugin.PT_BUILDERS, - getBuilderID()); - if (extension == null) - return null; - IConfigurationElement[] configs = extension.getConfigurationElements(); - if (configs.length == 0) - return null; - //The nature exists, or this builder doesn't specify a nature - IConfigurationElement[] runElement = configs[0].getChildren("run"); //$NON-NLS-1$ - IConfigurationElement[] paramElement = runElement[0].getChildren("parameter"); //$NON-NLS-1$ - for (int i = 0; i < paramElement.length; i++) { - if (paramElement[i].getAttribute("name").equals(name)) { //$NON-NLS-1$ - return paramElement[i].getAttribute("value"); //$NON-NLS-1$ - } - } - return null; - } - - protected abstract String getBuilderID(); - - public void setBuildLocation(IPath location) throws CoreException { - putString(BUILD_LOCATION, location.toString()); - } - - public IPath getBuildLocation() { - String location = getString(BUILD_LOCATION); - return new Path(location == null ? "" : location); //$NON-NLS-1$ - } - - public void setStopOnError(boolean enabled) throws CoreException { - putString(STOP_ON_ERROR, new Boolean(enabled).toString()); - } - - public boolean isStopOnError() { - return getBoolean(STOP_ON_ERROR); - } - - public void setAutoBuildTarget(String target) throws CoreException { - putString(BUILD_TARGET_AUTO, target); - } - - public String getAutoBuildTarget() { - return getString(BUILD_TARGET_AUTO); - } - - public void setIncrementalBuildTarget(String target) throws CoreException { - putString(BUILD_TARGET_INCREMENTAL, target); - } - - public String getIncrementalBuildTarget() { - return getString(BUILD_TARGET_INCREMENTAL); - } - - public void setFullBuildTarget(String target) throws CoreException { - putString(BUILD_TARGET_FULL, target); - } - - public String getFullBuildTarget() { - return getString(BUILD_TARGET_FULL); - } - - public boolean getBoolean(String property) { - return Boolean.valueOf(getString(property)).booleanValue(); - } - - protected abstract void putString(String name, String value) throws CoreException; - protected abstract String getString(String property); - - public void setAutoBuildEnable(boolean enabled) throws CoreException { - putString(BUILD_AUTO_ENABLED, new Boolean(enabled).toString()); - } - - public boolean isAutoBuildEnable() { - return getBoolean(BUILD_AUTO_ENABLED); - } - - public void setIncrementalBuildEnable(boolean enabled) throws CoreException { - putString(BUILD_INCREMENTAL_ENABLED, new Boolean(enabled).toString()); - } - - public boolean isIncrementalBuildEnabled() { - return getBoolean(BUILD_INCREMENTAL_ENABLED); - } - - public void setFullBuildEnable(boolean enabled) throws CoreException { - putString(BUILD_FULL_ENABLED, new Boolean(enabled).toString()); - } - - public boolean isFullBuildEnabled() { - return getBoolean(BUILD_FULL_ENABLED); - } - - public String getBuildArguments() { - return getString(BUILD_ARGUMENTS); - } - - public void setBuildArguments(String args) throws CoreException { - putString(BUILD_ARGUMENTS, args); - } - - public String[] getErrorParsers() { - String parsers = getString(ErrorParserManager.PREF_ERROR_PARSER); - if (parsers != null && parsers.length() > 0) { - StringTokenizer tok = new StringTokenizer(parsers, ";"); - List list = new ArrayList(tok.countTokens()); - while (tok.hasMoreElements()) { - list.add(tok.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - return new String[0]; - } - - public void setErrorParsers(String[] parsers) throws CoreException { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < parsers.length; i++) { - buf.append(parsers[i]).append(';'); - } - putString(ErrorParserManager.PREF_ERROR_PARSER, buf.toString()); - } - - public Map getEnvironment() { - return decodeMap(getString(ENVIRONMENT)); - } - - public void setEnvironment(Map env) throws CoreException { - putString(ENVIRONMENT, encodeMap(env)); - } - - protected Map decodeMap(String value) { - Map map = new HashMap(); - try { - while (value != null && value.length() > 0) { - int ndx = 0; - while (value.charAt(ndx) != '|' || (ndx != 0 && value.charAt(ndx - 1) == '\\')) { - ndx++; - } - StringBuffer line = new StringBuffer(value.substring(0, ndx)); - int lndx = 0; - while (line.charAt(lndx) != '=' || (lndx != 0 && line.charAt(lndx - 1) == '\\')) { - lndx++; - } - map.put(line.substring(0, lndx), line.substring(lndx + 1)); - value = value.substring(ndx+1); - } - } catch (StringIndexOutOfBoundsException e) { - } - return map; - } - - protected String encodeMap(Map values) { - StringBuffer str = new StringBuffer(); - Iterator entries = values.entrySet().iterator(); - while (entries.hasNext()) { - Entry entry = (Entry) entries.next(); - str.append(escapeChars((String) entry.getKey(), "=|")); - str.append("="); - str.append(escapeChars((String) entry.getValue(), "=|)")); - str.append("|"); - } - return str.toString(); - } - - protected String escapeChars(String string, String escapeChars) { - StringBuffer str = new StringBuffer(string); - for(int i = 0; i < str.length(); i++) { - if ( escapeChars.indexOf(str.charAt(i)) != -1) { - str.insert(i-1, '\\'); - } - } - return str.toString(); - } - } - - private static class Preference extends Store { - private Preferences prefs; - private String builderID; - private boolean useDefaults; - - Preference(Preferences prefs, String builderID, boolean useDefaults) { - this.prefs = prefs; - this.builderID = builderID; - this.useDefaults = useDefaults; - } - - protected void putString(String name, String value) { - if (useDefaults) { - prefs.setDefault(name, value); - } else { - prefs.setValue(name, value); - } - } - - protected String getString(String property) { - if (useDefaults) { - return prefs.getDefaultString(property); - } - return prefs.getString(property); - } - - protected String getBuilderID() { - return builderID; - } - } - - private static class BuildProperty extends Store { - private IProject project; - private String builderID; - private Map args; - - BuildProperty(IProject project, String builderID) throws CoreException { - this.project = project; - this.builderID = builderID; - ICommand builder; - builder = MakeProjectNature.getBuildSpec(project, builderID); - if (builder == null) { - throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("BuildInfoFactory.Missing_Builder") + builderID, null)); //$NON-NLS-1$ - } - args = builder.getArguments(); - } - - protected void putString(String name, String value) throws CoreException { - String curValue = (String) args.get(name); - if (curValue != null && curValue.equals(value)) { - return; - } - ICommand builder = MakeProjectNature.getBuildSpec(project, builderID); - args.put(name, value); - builder.setArguments(args); - project.setDescription(project.getDescription(), null); - } - - protected String getString(String name) { - String value = (String) args.get(name); - return value == null ? "" : value; //$NON-NLS-1$ - } - - protected String getBuilderID() { - return builderID; - } - } - - private static class BuildArguments extends Store { - private Map args; - private String builderID; - - BuildArguments(Map args, String builderID) { - this.args = args; - this.builderID = builderID; - } - - protected void putString(String name, String value) { - args.put(name, value); - } - - protected String getString(String name) { - return (String) args.get(name); - } - - protected String getBuilderID() { - return builderID; - } - } - - public static IMakeBuilderInfo create(Preferences prefs, String builderID, boolean useDefaults) { - return new BuildInfoFactory.Preference(prefs, builderID, useDefaults); - } - - public static IMakeBuilderInfo create(IProject project, String builderID) throws CoreException { - return new BuildInfoFactory.BuildProperty(project, builderID); - } - - public static IMakeBuilderInfo create(Map args, String builderID) { - return new BuildInfoFactory.BuildArguments(args, builderID); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ListenerList.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ListenerList.java deleted file mode 100644 index 2e526580b35..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ListenerList.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Created on 19-Aug-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -/** - * This class is used to maintain a list of listeners, and - * is used in the implementations of several classes within JFace - * which allow you to register listeners of various kinds. - * It is a fairly lightweight object, occupying minimal space when - * no listeners are registered. - *

- * Note that the add method checks for and eliminates - * duplicates based on identity (not equality). Likewise, the - * remove method compares based on identity. - *

- *

- * Use the getListeners method when notifying listeners. - * Note that no garbage is created if no listeners are registered. - * The recommended code sequence for notifying all registered listeners - * of say, FooListener.eventHappened, is: - *

- * Object[] listeners = myListenerList.getListeners();
- * for (int i = 0; i < listeners.length; ++i) {
- *    ((FooListener) listeners[i]).eventHappened(event);
- * }
- * 
- *

- */ -public class ListenerList { - /** - * The initial capacity of the list. Always >= 1. - */ - private int capacity; - - /** - * The current number of listeners. - * Maintains invariant: 0 <= size <= listeners.length. - */ - private int size; - - /** - * The list of listeners. Initially null but initialized - * to an array of size capacity the first time a listener is added. - * Maintains invariant: listeners != null IFF size != 0 - */ - private Object[] listeners = null; - - /** - * The empty array singleton instance, returned by getListeners() - * when size == 0. - */ - private static final Object[] EmptyArray = new Object[0]; - - /** - * Creates a listener list with an initial capacity of 1. - */ - public ListenerList() { - this(1); - } - - /** - * Creates a listener list with the given initial capacity. - * - * @param capacity the number of listeners which this list can initially accept - * without growing its internal representation; must be at least 1 - */ - public ListenerList(int capacity) { - this.capacity = capacity; - } - - /** - * Adds the given listener to this list. Has no effect if an identical listener - * is already registered. - * - * @param listener the listener - */ - public void add(Object listener) { - if (size == 0) { - listeners = new Object[capacity]; - } else { - // check for duplicates using identity - for (int i = 0; i < size; ++i) { - if (listeners[i] == listener) { - return; - } - } - // grow array if necessary - if (size == listeners.length) { - System.arraycopy(listeners, 0, listeners = new Object[size * 2 + 1], 0, size); - } - } - listeners[size++] = listener; - } - - /** - * Removes all listeners from this list. - */ - public void clear() { - size = 0; - listeners = null; - } - - /** - * Returns an array containing all the registered listeners, - * in the order in which they were added. - *

- * The resulting array is unaffected by subsequent adds or removes. - * If there are no listeners registered, the result is an empty array - * singleton instance (no garbage is created). - * Use this method when notifying listeners, so that any modifications - * to the listener list during the notification will have no effect on the - * notification itself. - *

- * - * @return the list of registered listeners - */ - public Object[] getListeners() { - if (size == 0) - return EmptyArray; - Object[] result = new Object[size]; - System.arraycopy(listeners, 0, result, 0, size); - return result; - } - - /** - * Returns whether this listener list is empty. - * - * @return true if there are no registered listeners, and - * false otherwise - */ - public boolean isEmpty() { - return size == 0; - } - - /** - * Removes the given listener from this list. Has no effect if an identical - * listener was not already registered. - * - * @param listener the listener - */ - public void remove(Object listener) { - for (int i = 0; i < size; ++i) { - if (listeners[i] == listener) { - if (size == 1) { - listeners = null; - size = 0; - } else { - System.arraycopy(listeners, i + 1, listeners, i, --size - i); - listeners[size] = null; - } - return; - } - } - } - - /** - * Returns the number of registered listeners. - * - * @return the number of registered listeners - */ - public int size() { - return size; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java deleted file mode 100644 index 015012968e7..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeProject.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.ICOwner; -import org.eclipse.cdt.make.core.MakeScannerProvider; -import org.eclipse.core.runtime.CoreException; - -public class MakeProject implements ICOwner { - - public void configure(ICDescriptor cproject) throws CoreException { - cproject.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID); - cproject.remove(CCorePlugin.BUILDER_MODEL_ID); - cproject.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, MakeScannerProvider.INTERFACE_IDENTITY); - } - - public void update(ICDescriptor cproject, String extensionID) throws CoreException { - if ( extensionID.equals(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID)) { - cproject.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, MakeScannerProvider.INTERFACE_IDENTITY); - } - if ( extensionID.equals(CCorePlugin.BINARY_PARSER_UNIQ_ID)) { - cproject.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, CCorePlugin.PLUGIN_ID + ".Elf"); //$NON-NLS-1$ - } - - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeRecon.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeRecon.java deleted file mode 100644 index 6962d4834cc..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeRecon.java +++ /dev/null @@ -1,194 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.ArrayList; - -import org.eclipse.cdt.utils.spawner.ProcessFactory; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public class MakeRecon extends OutputStream { - - IPath make; - String[] args; - String[] environ; - IPath directory; - IProgressMonitor monitor; - OutputStream console; - MyList log; - StringBuffer currentLine; - - class MyList extends ArrayList { - public void removeInterval (int start, int len) { - removeRange(start, len); - } - } - - public MakeRecon(IPath buildCommand, String[] buildArguments, - String[] env, IPath workingDirectory, IProgressMonitor mon, OutputStream cos) { - this(buildCommand, new String[]{"-n"}, buildArguments, env, workingDirectory, mon, cos); - } - - public MakeRecon(IPath buildCommand, String[] options, String[] buildArguments, - String[] env, IPath workingDirectory, IProgressMonitor mon, OutputStream cos) { - - make = buildCommand; - - args = new String[0]; - if (options != null) { - String[]array = new String[args.length + options.length]; - System.arraycopy(args, 0, array, 0, args.length); - System.arraycopy(options, 0, array, args.length, options.length); - args = array; - } - if (buildArguments != null) { - String[] array = new String[args.length + buildArguments.length]; - System.arraycopy(args, 0, array, 0, args.length); - System.arraycopy(buildArguments, 0, array, args.length, buildArguments.length); - args = array; - } - - environ = env; - directory = workingDirectory; - monitor = mon; - console = cos; - currentLine = new StringBuffer(); - log = new MyList(); - - // Get the buffer log. - invokeMakeRecon(); - - } - - private void invokeMakeRecon() { - int i = 0; - String[] array = new String[args.length + 1]; - array[0] = make.toOSString(); - System.arraycopy(args, 0, array, 1, args.length); - Process p; - try { - p = ProcessFactory.getFactory().exec(array, environ, directory.toFile()); - InputStream in = p.getInputStream(); - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - // Swallow the output - String line; - try { - while ((line = reader.readLine()) != null) { - log.add(line); - i++; - } - } catch (IOException e) { - } - try { - in.close(); - } catch (IOException e) { - } - p.destroy(); - log.trimToSize(); - } catch (IOException e1) { - i = IProgressMonitor.UNKNOWN; - } - monitor.beginTask("", i); - } - - /** - * @see java.io.OutputStream#close() - */ - public void close() throws IOException { - if (console != null) { - console.close(); - } - monitor.done(); - } - - /** - * @see java.io.OutputStream#flush() - */ - public void flush() throws IOException { - if (console != null) { - console.flush(); - } - } - - /** - * @see java.io.OutputStream#write(int) - */ - public synchronized void write(int b) throws IOException { - currentLine.append((char) b); - checkProgress(false); - if (console != null) { - console.write(b); - } - } - - /** - * @see java.io.OutputStream#write(...) - */ - public synchronized void write(byte[] b, int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if (off != 0 || (len < 0) || (len > b.length)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - currentLine.append(new String(b, 0, len)); - checkProgress(false); - if (console != null) { - console.write(b, off, len); - } - } - - private void checkProgress(boolean flush) { - String buffer = currentLine.toString(); - int i = 0; - while ((i = buffer.indexOf("\n")) != -1) { - String line = buffer.substring(0, i).trim(); // get rid of any trailing \r - processLine(line); - buffer = buffer.substring(i + 1); // skip the \n and advance - } - currentLine.setLength(0); - if (flush) { - if (buffer.length() > 0) { - processLine(buffer); - } - } else { - currentLine.append(buffer); - } - } - - private void processLine(String line) { - int found = -1; - for (int i = 0; i < log.size(); i++) { - String s = (String)log.get(i); - if (s.startsWith(line)) { - found = i; - break; - } - } - - if (found != -1) { - String show = (String)log.get(found); - if (show.length() > 50) { - show = show.substring(0, 50); - } - monitor.subTask(show); - monitor.worked(found + 1); - log.removeInterval(0, found + 1); - } - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java deleted file mode 100644 index 4139da1b405..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Created on 19-Aug-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -import java.util.HashMap; - -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -public class MakeTarget implements IMakeTarget { - - private String target; - private String buildArguments; - private IPath buildCommand; - private boolean isDefaultBuildCmd; - private boolean isStopOnError; - private String name; - private String targetBuilderID; - private IContainer container; - private MakeTargetManager manager; - - MakeTarget(MakeTargetManager manager, IProject project, String targetBuilderID, String name) throws CoreException { - this.manager = manager; - this.targetBuilderID = targetBuilderID; - this.name = name; - IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(project, manager.getBuilderID(targetBuilderID)); - buildCommand = info.getBuildCommand(); - buildArguments = info.getBuildArguments(); - isDefaultBuildCmd = info.isDefaultBuildCmd(); - isStopOnError = info.isStopOnError(); - } - - public void setContainer(IContainer container) { - this.container = container; - } - - void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public String getTargetBuilderID() { - return targetBuilderID; - } - - public boolean isStopOnError() { - return isStopOnError; - } - - public void setStopOnError(boolean stopOnError) { - isStopOnError = stopOnError; - } - - public boolean isDefaultBuildCmd() { - return isDefaultBuildCmd; - } - - public void setUseDefaultBuildCmd(boolean useDefault) { - isDefaultBuildCmd = useDefault; - } - - public IPath getBuildCommand() { - return buildCommand != null ? buildCommand: new Path(""); - } - - public void setBuildCommand(IPath command) { - buildCommand = command; - } - - public String getBuildArguments() { - return buildArguments != null ? buildArguments : ""; - } - - public void setBuildArguments(String arguments) { - buildArguments = arguments; - } - - public IContainer getContainer() { - return container; - } - - public boolean equals(Object obj) { - if (obj == this) - return true; - if (obj instanceof MakeTarget) { - MakeTarget other = (MakeTarget) obj; - return container.equals(other.getContainer()) && name.equals(other.getName()); - } - return false; - } - - public int hashCode() { - return container.hashCode() * 17 + name.hashCode(); - } - - public void build(IProgressMonitor monitor) throws CoreException { - IProject project = container.getProject(); - String builderID = manager.getBuilderID(targetBuilderID); - HashMap infoMap = new HashMap(); - IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(infoMap, builderID); - if ( buildArguments != null) { - info.setBuildArguments(buildArguments); - } - if ( buildCommand != null ) { - info.setBuildCommand(buildCommand); - } - info.setUseDefaultBuildCmd(isDefaultBuildCmd); - info.setStopOnError(isStopOnError); - info.setFullBuildEnable(true); - info.setFullBuildTarget(target); - if ( container != null) { - info.setBuildLocation(container.getFullPath()); - } - IMakeBuilderInfo projectInfo = MakeCorePlugin.createBuildInfo(project, builderID); - info.setErrorParsers(projectInfo.getErrorParsers()); - project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, monitor); - } - - public void setBuildTarget(String target) { - this.target = target; - - } - - public String getBuildTarget() { - return target; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java deleted file mode 100644 index edaa4c7d2a2..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java +++ /dev/null @@ -1,320 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; -import java.util.Map.Entry; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetListener; -import org.eclipse.cdt.make.core.IMakeTargetManager; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeTargetEvent; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -public class MakeTargetManager implements IMakeTargetManager, IResourceChangeListener { - private static String TARGET_BUILD_EXT = "MakeTargetBuilder"; //$NON-NLS-1$ - - private static String TARGETS_EXT = "targets"; //$NON-NLS-1$ - - private ListenerList listeners = new ListenerList(); - private HashMap projectMap = new HashMap(); - private HashMap builderMap; - protected Vector fProjects = new Vector(); - - public MakeTargetManager() { - } - - public IMakeTarget createTarget(IProject project, String name, String targetBuilderID) throws CoreException { - return new MakeTarget(this, project, targetBuilderID, name); - } - - public void addTarget(IContainer container, IMakeTarget target) throws CoreException { - if (container instanceof IWorkspaceRoot) { - throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$ - } - if (target.getContainer() != null) { - throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.add_temporary_target"), null)); //$NON-NLS-1$ - } - IProject project = container.getProject(); - ProjectTargets projectTargets = (ProjectTargets)projectMap.get(project); - if (projectTargets == null) { - projectTargets = readTargets(project); - } - ((MakeTarget)target).setContainer(container); - projectTargets.add((MakeTarget)target); - writeTargets(projectTargets); - notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_ADD, target)); - } - - public void removeTarget(IMakeTarget target) throws CoreException { - IProject project = target.getContainer().getProject(); - ProjectTargets projectTargets = (ProjectTargets)projectMap.get(project); - if (projectTargets == null) { - projectTargets = readTargets(project); - } - projectTargets.remove(target); - writeTargets(projectTargets); - notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_REMOVED, target)); - } - - public void renameTarget(IMakeTarget target, String name) throws CoreException { - IProject project = target.getContainer().getProject(); - ProjectTargets projectTargets = (ProjectTargets)projectMap.get(project); - if (projectTargets == null) { - projectTargets = readTargets(project); - } - if (!projectTargets.contains((MakeTarget)target)) { - throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.target_exists"), null)); //$NON-NLS-1$ - } - ((MakeTarget)target).setName(name); - writeTargets(projectTargets); - notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_CHANGED, target)); - } - - public IMakeTarget[] getTargets(IContainer container) throws CoreException { - ProjectTargets projectTargets = (ProjectTargets)projectMap.get(container.getProject()); - if (projectTargets == null) { - projectTargets = readTargets(container.getProject()); - } - return projectTargets.get(container); - } - - public IMakeTarget findTarget(IContainer container, String name) { - ProjectTargets projectTargets = (ProjectTargets)projectMap.get(container.getProject()); - if (projectTargets == null) { - projectTargets = readTargets(container.getProject()); - } - return projectTargets.findTarget(container, name); - } - - public IProject[] getTargetBuilderProjects() throws CoreException { - return (IProject[])fProjects.toArray(new IProject[fProjects.size()]); - } - - public String[] getTargetBuilders(IProject project) { - if (fProjects.contains(project) || hasTargetBuilder(project)) { - try { - Vector ids = new Vector(); - IProjectDescription description = project.getDescription(); - ICommand builder[] = description.getBuildSpec(); - for (int i = 0; i < builder.length; i++) { - Iterator entries = builderMap.entrySet().iterator(); - while (entries.hasNext()) { - Map.Entry entry = (Entry)entries.next(); - if (entry.getValue().equals(builder[i].getBuilderName())) { - ids.add(entry.getKey()); - } - } - } - return (String[])ids.toArray(new String[ids.size()]); - } catch (CoreException e) { - } - } - return new String[0]; - } - - public boolean hasTargetBuilder(IProject project) { - try { - if (project.isAccessible()) { - IProjectDescription description = project.getDescription(); - ICommand builder[] = description.getBuildSpec(); - for (int j = 0; j < builder.length; j++) { - if (builderMap.containsValue(builder[j].getBuilderName())) { - return true; - } - } - } - } catch (CoreException e) { - } - return false; - } - - public void startup() { - initializeBuilders(); - IProject project[] = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - for (int i = 0; i < project.length; i++) { - if (hasTargetBuilder(project[i])) { - fProjects.add(project[i]); - } - } - ResourcesPlugin.getWorkspace().addResourceChangeListener(this); - } - - public void shutdown() { - ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); - } - - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - if (delta != null) { - try { - delta.accept(new MakeTargetVisitor()); - } catch (CoreException e) { - MakeCorePlugin.log(e); - } - } - } - - class MakeTargetVisitor implements IResourceDeltaVisitor { - /** - * @see IResourceDeltaVisitor#visit(IResourceDelta) - */ - public boolean visit(IResourceDelta delta) { - if (delta == null) { - return false; - } - IResource resource = delta.getResource(); - if (resource.getType() == IResource.PROJECT) { - IProject project = (IProject)resource; - int flags = delta.getFlags(); - int deltaKind = delta.getKind(); - if (deltaKind == IResourceDelta.ADDED) { - if (hasTargetBuilder(project)) { - fProjects.add(project); - notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project)); - } - } else if (deltaKind == IResourceDelta.REMOVED) { - if (fProjects.contains(project)) { - deleteTargets(project); - fProjects.remove(project); - notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project)); - } - } else if (deltaKind == IResourceDelta.CHANGED) { - if (0 != (flags & IResourceDelta.DESCRIPTION)) { - if (fProjects.contains(project) && !hasTargetBuilder(project)) { - fProjects.remove(project); - projectMap.remove(project); - notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project)); - } else if (!fProjects.contains(project) && hasTargetBuilder(project)) { - fProjects.add(project); - notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project)); - } - } - if (0 != (flags & IResourceDelta.OPEN)) { - if (!project.isOpen() && fProjects.contains(project)) { - fProjects.remove(project); - projectMap.remove(project); - notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project)); - } else if (project.isOpen() && hasTargetBuilder(project) && !fProjects.contains(project)) { - fProjects.add(project); - notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project)); - } - } - } - return false; - } - return resource instanceof IWorkspaceRoot; - } - } - - protected void writeTargets(ProjectTargets projectTargets) throws CoreException { - IPath targetFilePath = - MakeCorePlugin.getDefault().getStateLocation().append(projectTargets.getProject().getName()).addFileExtension( - TARGETS_EXT); - File targetFile = targetFilePath.toFile(); - try { - FileOutputStream file = new FileOutputStream(targetFile); - projectTargets.saveTargets(file); - } catch (IOException e) { - throw new CoreException( - new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, "Error writing target file", e)); - } - } - - protected ProjectTargets readTargets(IProject project) { - IPath targetFilePath = - MakeCorePlugin.getDefault().getStateLocation().append(project.getName()).addFileExtension(TARGETS_EXT); - File targetFile = targetFilePath.toFile(); - ProjectTargets projectTargets = null; - if (targetFile.exists()) { - try { - projectTargets = new ProjectTargets(this, project, new FileInputStream(targetFile)); - } catch (FileNotFoundException e) { - } - } - if (projectTargets == null) { - projectTargets = new ProjectTargets(this, project); - } - projectMap.put(project, projectTargets); - return projectTargets; - } - - protected void deleteTargets(IProject project) { - IPath targetFilePath = - MakeCorePlugin.getDefault().getStateLocation().append(project.getName()).addFileExtension(TARGETS_EXT); - File targetFile = targetFilePath.toFile(); - if (targetFile.exists()) { - targetFile.delete(); - } - projectMap.remove(project); - } - - protected void initializeBuilders() { - builderMap = new HashMap(); - IExtensionPoint point = MakeCorePlugin.getDefault().getDescriptor().getExtensionPoint(MakeTargetManager.TARGET_BUILD_EXT); - IExtension[] ext = point.getExtensions(); - for (int i = 0; i < ext.length; i++) { - IConfigurationElement[] element = ext[i].getConfigurationElements(); - for (int j = 0; j < element.length; j++) { - if (element[j].getName().equals("builder")) { //$NON-NLS-1$ - String builderID = element[j].getAttribute("builderID"); //$NON-NLS-1$ - String targetID = element[j].getAttribute("id"); //$NON-NLS-1$ - builderMap.put(targetID, builderID); - } - } - } - } - - protected void notifyListeners(MakeTargetEvent event) { - Object[] list = listeners.getListeners(); - for (int i = 0; i < list.length; i++) { - ((IMakeTargetListener)list[i]).targetChanged(event); - } - } - - public void addListener(IMakeTargetListener listener) { - listeners.add(listener); - } - - public void removeListener(IMakeTargetListener listener) { - listeners.remove(listeners); - } - - public String getBuilderID(String targetBuilderID) { - return (String)builderMap.get(targetBuilderID); - } -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java deleted file mode 100644 index a8a8c32fd0a..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java +++ /dev/null @@ -1,242 +0,0 @@ -package org.eclipse.cdt.make.internal.core; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.xerces.dom.DocumentImpl; -import org.apache.xml.serialize.Method; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.Serializer; -import org.apache.xml.serialize.SerializerFactory; -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -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.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class ProjectTargets { - - private static final String BUILD_TARGET_ELEMENT = "buildTargets"; //$NON-NLS-1$ - private static final String TARGET_ELEMENT = "target"; //$NON-NLS-1$ - private static final String TARGET_ATTR_ID = "targetID"; //$NON-NLS-1$ - private static final String TARGET_ATTR_PATH = "path"; - private static final String TARGET_ATTR_NAME = "name"; - private static final String TARGET_STOP_ON_ERROR = "stopOnError"; - private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; - private static final String TARGET_ARGUMENTS = "buildArguments"; - private static final String TARGET_COMMAND = "buildCommand"; - private static final String TARGET = "buidlTarget"; - - private HashMap targetMap = new HashMap(); - - private IProject project; - private MakeTargetManager manager; - - public ProjectTargets(MakeTargetManager manager, IProject project) { - this.project = project; - this.manager = manager; - } - - public ProjectTargets(MakeTargetManager manager, IProject project, InputStream input) { - this(manager, project); - - Document document = null; - try { - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - document = parser.parse(input); - } catch (Exception e) { - MakeCorePlugin.log(e); - } - Node node = document.getFirstChild(); - if (node.getNodeName().equals(BUILD_TARGET_ELEMENT)) { - NodeList list = node.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - node = list.item(i); - if (node.getNodeName().equals(TARGET_ELEMENT)) { - IContainer container = null; - NamedNodeMap attr = node.getAttributes(); - String path = attr.getNamedItem(TARGET_ATTR_PATH).getNodeValue(); - if (path != null && !path.equals("")) { - container = project.getFolder(path); - } else { - container = project; - } - try { - MakeTarget target = - new MakeTarget( - manager, - project, - attr.getNamedItem(TARGET_ATTR_ID).getNodeValue(), - attr.getNamedItem(TARGET_ATTR_NAME).getNodeValue()); - target.setContainer(container); - String option = getString(node, TARGET_STOP_ON_ERROR); - if (option != null) { - target.setStopOnError(Boolean.valueOf(option).booleanValue()); - } - option = getString(node, TARGET_USE_DEFAULT_CMD); - if (option != null) { - target.setUseDefaultBuildCmd(Boolean.valueOf(option).booleanValue()); - } - option = getString(node, TARGET_COMMAND); - if (option != null) { - target.setBuildCommand(new Path(option)); - } - option = getString(node, TARGET_ARGUMENTS); - if (option != null) { - target.setBuildArguments(option); - } - option = getString(node, TARGET); - if (option != null) { - target.setBuildTarget(option); - } - add(target); - } catch (CoreException e) { - MakeCorePlugin.log(e); - } - } - } - } - } - - protected String getString(Node target, String tagName) { - Node node = searchNode(target, tagName); - return node != null ? (node.getFirstChild() == null ? null : node.getFirstChild().getNodeValue()) : null; - } - - protected Node searchNode(Node target, String tagName) { - NodeList list = target.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - if (list.item(i).getNodeName().equals(tagName)) - return list.item(i); - } - return null; - } - - public IMakeTarget[] get(IContainer container) { - ArrayList list = (ArrayList)targetMap.get(container); - if (list != null) { - return (IMakeTarget[])list.toArray(new IMakeTarget[list.size()]); - } - return new IMakeTarget[0]; - } - - public IMakeTarget findTarget(IContainer container, String name) { - ArrayList list = (ArrayList)targetMap.get(container); - if (list != null) { - Iterator targets = list.iterator(); - while (targets.hasNext()) { - IMakeTarget target = (IMakeTarget)targets.next(); - if (target.getName().equals(name)) { - return target; - } - } - } - return null; - } - - public void add(MakeTarget target) throws CoreException { - ArrayList list = (ArrayList)targetMap.get(target.getContainer()); - if (list != null && list.contains(target)) { - throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.target_exists"), null)); //$NON-NLS-1$ - } - if (list == null) { - list = new ArrayList(); - targetMap.put(target.getContainer(), list); - } - list.add(target); - } - - public boolean contains(MakeTarget target) { - ArrayList list = (ArrayList)targetMap.get(target.getContainer()); - if (list != null && list.contains(target)) { - return true; - } - return false; - } - - public void remove(IMakeTarget target) { - ArrayList list = (ArrayList)targetMap.get(target.getContainer()); - if (list == null || !list.contains(target)) { - return; - } - list.remove(target); - if (list.size() == 0) { - targetMap.remove(list); - } - } - - public IProject getProject() { - return project; - } - - protected Document getAsXML() throws IOException { - Document doc = new DocumentImpl(); - Element targetsRootElement = doc.createElement(BUILD_TARGET_ELEMENT); - doc.appendChild(targetsRootElement); - Iterator container = targetMap.entrySet().iterator(); - while (container.hasNext()) { - List targets = (List) ((Map.Entry)container.next()).getValue(); - for (int i = 0; i < targets.size(); i++) { - MakeTarget target = (MakeTarget)targets.get(i); - targetsRootElement.appendChild(createTargetElement(doc, target)); - } - } - return doc; - } - - private Node createTargetElement(Document doc, MakeTarget target) { - Element targetElem = doc.createElement(TARGET_ELEMENT); - targetElem.setAttribute(TARGET_ATTR_NAME, target.getName()); - targetElem.setAttribute(TARGET_ATTR_ID, target.getTargetBuilderID()); - targetElem.setAttribute(TARGET_ATTR_PATH, target.getContainer().getProjectRelativePath().toString()); - Element elem = doc.createElement(TARGET_COMMAND); - targetElem.appendChild(elem); - elem.appendChild(doc.createTextNode(target.getBuildCommand().toString())); - - elem = doc.createElement(TARGET_ARGUMENTS); - elem.appendChild(doc.createTextNode(target.getBuildArguments())); - targetElem.appendChild(elem); - - elem = doc.createElement(TARGET); - elem.appendChild(doc.createTextNode(target.getBuildTarget())); - targetElem.appendChild(elem); - - elem = doc.createElement(TARGET_STOP_ON_ERROR); - elem.appendChild(doc.createTextNode(new Boolean(target.isStopOnError()).toString())); - targetElem.appendChild(elem); - - elem = doc.createElement(TARGET_USE_DEFAULT_CMD); - elem.appendChild(doc.createTextNode(new Boolean(target.isDefaultBuildCmd()).toString())); - targetElem.appendChild(elem); - return targetElem; - } - - public void saveTargets(OutputStream output) throws IOException { - Document doc = getAsXML(); - OutputFormat format = new OutputFormat(); - format.setIndenting(true); - format.setPreserveSpace(true); - format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$ - Serializer serializer = - SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(output, "UTF8"), format); - serializer.asDOMSerializer().serialize(doc); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/StreamMonitor.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/StreamMonitor.java deleted file mode 100644 index 32e1dcd0ca5..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/StreamMonitor.java +++ /dev/null @@ -1,102 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core; - -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.core.runtime.IProgressMonitor; - -public class StreamMonitor extends OutputStream { - - IProgressMonitor monitor; - OutputStream console; - public final int fTotalWork; - private int halfWay; - private int currentIncrement = 2; - private int nextProgress = currentIncrement; - private int worked = 0; - - public StreamMonitor(IProgressMonitor mon, OutputStream cos, int totalWork) { - monitor = mon; - console = cos; - fTotalWork = totalWork; - halfWay = fTotalWork / 2; - monitor.beginTask("", fTotalWork); - } - - private void progressUpdate() { - if (--nextProgress <= 0) { - //we have exhausted the current increment, so report progress - if (fTotalWork > worked) { - monitor.worked(1); - } - worked++; - if (worked >= halfWay) { - //we have passed the current halfway point, so double the - //increment and reset the halfway point. - currentIncrement *= 2; - halfWay += (fTotalWork - halfWay) / 2; - } - //reset the progress counter to another full increment - nextProgress = currentIncrement; - } - } - /** - * @see java.io.OutputStream#close() - */ - public void close() throws IOException { - if (console != null) { - console.close(); - } - monitor.done(); - } - - /** - * @see java.io.OutputStream#flush() - */ - public void flush() throws IOException { - if (console != null) { - console.flush(); - } - } - - /** - * @see java.io.OutputStream#write(int) - */ - public synchronized void write(int b) throws IOException { - if (console != null) { - console.write(b); - } - progressUpdate(); - } - - /** - * @see java.io.OutputStream#write(...) - */ - public synchronized void write(byte[] b, int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if (off != 0 || (len < 0) || (len > b.length)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - if (console != null) { - console.write(b, off, len); - } - progressUpdate(); - } - - public int getWorkDone() { - return worked; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java deleted file mode 100644 index 7c4467080ee..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/AbstractMakefile.java +++ /dev/null @@ -1,179 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.make.core.makefile.IInferenceRule; -import org.eclipse.cdt.make.core.makefile.IMacroDefinition; -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.core.makefile.IRule; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.ITargetRule; - -/** - * Makefile : ( statement ) * - * statement : rule | macro_definition | comments | empty - * rule : inference_rule | target_rule - * inference_rule : target ':' ( command ) + - * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] - [ ( command ) * ] - * macro_definition : string '=' (string)* - * comments : ('#' (string) ) * - * empty : - * command : prefix_command string - * target : string - * prefix_command : '-' | '@' | '+' - * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%" - */ - -public abstract class AbstractMakefile extends Parent implements IMakefile { - - public AbstractMakefile(Directive parent) { - super(parent); - } - - public abstract IDirective[] getBuiltins(); - - public IRule[] getRules() { - IDirective[] stmts = getDirectives(); - List array = new ArrayList(stmts.length); - for (int i = 0; i < stmts.length; i++) { - if (stmts[i] instanceof IRule) { - array.add(stmts[i]); - } - } - return (IRule[]) array.toArray(new IRule[0]); - } - - public IRule[] getRule(String target) { - IRule[] rules = getRules(); - List array = new ArrayList(rules.length); - for (int i = 0; i < rules.length; i++) { - if (rules[i].getTarget().equals(target)) { - array.add(rules[i]); - } - } - return (IRule[]) array.toArray(new IRule[0]); - } - - public IInferenceRule[] getInferenceRules() { - IRule[] rules = getRules(); - List array = new ArrayList(rules.length); - for (int i = 0; i < rules.length; i++) { - if (rules[i] instanceof IInferenceRule) { - array.add(rules[i]); - } - } - return (IInferenceRule[]) array.toArray(new IInferenceRule[0]); - } - - public IInferenceRule[] getInferenceRule(String target) { - IInferenceRule[] irules = getInferenceRules(); - List array = new ArrayList(irules.length); - for (int i = 0; i < irules.length; i++) { - if (irules[i].getTarget().equals(target)) { - array.add(irules[i]); - } - } - return (IInferenceRule[]) array.toArray(new IInferenceRule[0]); - } - - public ITargetRule[] getTargetRules() { - IRule[] trules = getRules(); - List array = new ArrayList(trules.length); - for (int i = 0; i < trules.length; i++) { - if (trules[i] instanceof ITargetRule) { - array.add(trules[i]); - } - } - return (ITargetRule[]) array.toArray(new ITargetRule[0]); - } - - public ITargetRule[] getTargetRule(String target) { - ITargetRule[] trules = getTargetRules(); - List array = new ArrayList(trules.length); - for (int i = 0; i < trules.length; i++) { - if (trules[i].getTarget().equals(target)) { - array.add(trules[i]); - } - } - return (ITargetRule[]) array.toArray(new ITargetRule[0]); - } - - public IMacroDefinition[] getMacroDefinitions() { - IDirective[] stmts = getDirectives(); - List array = new ArrayList(stmts.length); - for (int i = 0; i < stmts.length; i++) { - if (stmts[i] instanceof IMacroDefinition) { - array.add(stmts[i]); - } - } - return (IMacroDefinition[]) array.toArray(new IMacroDefinition[0]); - } - - public IMacroDefinition[] getMacroDefinition(String name) { - IMacroDefinition[] variables = getMacroDefinitions(); - List array = new ArrayList(variables.length); - for (int i = 0; i < variables.length; i++) { - if (variables[i].getName().equals(name)) { - array.add(variables[i]); - } - } - return (IMacroDefinition[]) array.toArray(new IMacroDefinition[0]); - } - - public IMacroDefinition[] getBuiltinMacroDefinitions() { - IDirective[] stmts = getBuiltins(); - List array = new ArrayList(stmts.length); - for (int i = 0; i < stmts.length; i++) { - if (stmts[i] instanceof IMacroDefinition) { - array.add(stmts[i]); - } - } - return (IMacroDefinition[]) array.toArray(new IMacroDefinition[0]); - } - - public IMacroDefinition[] getBuiltinMacroDefinition(String name) { - IMacroDefinition[] variables = getBuiltinMacroDefinitions(); - List array = new ArrayList(variables.length); - for (int i = 0; i < variables.length; i++) { - if (variables[i].getName().equals(name)) { - array.add(variables[i]); - } - } - return (IMacroDefinition[]) array.toArray(new IMacroDefinition[0]); - } - - public IInferenceRule[] getBuiltinInferenceRules() { - IDirective[] stmts = getBuiltins(); - List array = new ArrayList(stmts.length); - for (int i = 0; i < stmts.length; i++) { - if (stmts[i] instanceof IInferenceRule) { - array.add(stmts[i]); - } - } - return (IInferenceRule[]) array.toArray(new IInferenceRule[0]); - } - - public IInferenceRule[] getBuiltinInferenceRule(String target) { - IInferenceRule[] irules = getBuiltinInferenceRules(); - List array = new ArrayList(irules.length); - for (int i = 0; i < irules.length; i++) { - if (irules[i].getTarget().equals(target)) { - array.add(irules[i]); - } - } - return (IInferenceRule[]) array.toArray(new IInferenceRule[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/ArchiveTarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/ArchiveTarget.java deleted file mode 100644 index ea11178a2b9..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/ArchiveTarget.java +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -/** - * IArchiveTarget - */ -public class ArchiveTarget extends Target { - - String member; - - public ArchiveTarget(String lib, String obj) { - super(lib); - member = obj; - } - - public String getMember() { - return member; - } - - public String getLibaryName() { - return toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/BadDirective.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/BadDirective.java deleted file mode 100644 index d2a8ffbe6b1..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/BadDirective.java +++ /dev/null @@ -1,28 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IBadDirective; - -public class BadDirective extends Directive implements IBadDirective { - - String line; - - public BadDirective(Directive parent, String s) { - super(parent); - line = s; - } - - public String toString() { - return line; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java deleted file mode 100644 index 03b13938663..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java +++ /dev/null @@ -1,115 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.io.File; -import java.io.IOException; - -import org.eclipse.cdt.make.core.makefile.ICommand; - -/** - * Makefile : ( statement ) * - * statement : command | .. - * command : prefix_command string - * prefix_command : '-' | '@' | '+' - */ -public class Command extends Directive implements ICommand { - - final public static char NL = '\n'; - - String command = ""; - char prefix = '\0'; - - public Command(Directive parent, String cmd) { - super(parent); - parse(cmd); - } - - /** - * - If the command prefix contains a hyphen, or the -i option is - * present, or the special target .IGNORE has either the current - * target as a prerequisite or has no prerequisites, any error - * found while executing the command will be ignored. - */ - public boolean shouldIgnoreError() { - // Check for the prefix hyphen in the command. - if (getPrefix() == HYPHEN) { - return true; - } - return false; - } - - /** - * @ If the command prefix contains an at sign and the - * command-line -n option is not specified, or the -s option is - * present, or the special target .SILENT has either the current - * target as a prerequisite or has no prerequisites, the command - * will not be written to standard output before it is executed. - */ - public boolean shouldBeSilent() { - // Check for the prefix at sign - if (getPrefix() == AT) { - return true; - } - return false; - } - - /** - * + If the command prefix contains a plus sign, this indicates a - * command line that will be executed even if -n, -q or -t is - * specified. - */ - public boolean shouldExecute() { - // Check for the prefix at sign - if (getPrefix() == PLUS) { - return true; - } - return false; - } - - public String toString() { - StringBuffer cmd = new StringBuffer(); - cmd.append( '\t'); - if (getPrefix() != 0) { - cmd.append(getPrefix()); - } - cmd.append(command).append('\n'); - return cmd.toString(); - } - - public boolean equals(Command cmd) { - return cmd.toString().equals(toString()); - } - - char getPrefix() { - return prefix; - } - - /** - * command : prefix_command string - */ - void parse(String cmd) { - command = cmd.trim(); - if (command.startsWith(HYPHEN_STRING) || command.startsWith(AT_STRING) || command.startsWith(PLUS_STRING)) { - prefix = command.charAt(0); - command = command.substring(1).trim(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.ICommand#execute(java.lang.String[], java.io.File) - */ - public Process execute(String shell, String[] envp, File dir) throws IOException { - String[] cmdArray = new String[] { shell, "-c", command}; - return Runtime.getRuntime().exec(cmdArray, envp, dir); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java deleted file mode 100644 index 9deaf36819d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IComment; - -public class Comment extends Directive implements IComment { - - String comment; - - public Comment(Directive parent, String cmt) { - super(parent); - if (cmt.startsWith(POUND_STRING)) { - comment = cmt.substring(1); - } else { - comment = cmt; - } - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(POUND_STRING).append(comment).append('\n'); - return buffer.toString(); - } - - public boolean equals(Comment cmt) { - return cmt.toString().equals(toString()); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/DefaultRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/DefaultRule.java deleted file mode 100644 index cf7598a0ab7..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/DefaultRule.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IDefaultRule; - -/** - * .DEFAULT - * If the makefile uses this special target, the application shall ensure that it is - * specified with commands, but without prerequisites. - */ -public class DefaultRule extends SpecialRule implements IDefaultRule { - - public DefaultRule(Directive parent, Command[] cmds) { - super(parent, new Target(".DEFAULT"), new String[0], cmds); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java deleted file mode 100644 index 041a3a81634..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IDirective; - -public abstract class Directive implements IDirective { - - int endLine; - int startLine; - Directive parent; - - public Directive(Directive owner) { - parent = owner; - } - - public Directive(int start, int end) { - setLines(start, end); - } - - public abstract String toString(); - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IDirective#getEndLine() - */ - public int getEndLine() { - return endLine; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IDirective#getStartLine() - */ - public int getStartLine() { - return startLine; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IDirective#getParent() - */ - public IDirective getParent() { - return parent; - } - - public void setParent(Directive owner) { - parent = owner; - } - - public void setStartLine(int lineno) { - startLine = lineno; - } - - public void setEndLine(int lineno) { - endLine = lineno; - } - - public void setLines(int start, int end) { - setStartLine(start); - setEndLine(end); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java deleted file mode 100644 index ba98ed3428f..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java +++ /dev/null @@ -1,32 +0,0 @@ - -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IEmptyLine; - -public class EmptyLine extends Directive implements IEmptyLine { - - final public static char NL = '\n'; - final public static String NL_STRING = "\n"; - - public EmptyLine(Directive parent) { - super(parent); - } - - public String toString() { - return NL_STRING; - } - - public boolean equals(IEmptyLine stmt) { - return true; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/IgnoreRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/IgnoreRule.java deleted file mode 100644 index cb023e60bfe..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/IgnoreRule.java +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IIgnoreRule; - -/** - * .IGNORE - * Prerequistes of this special target are targets themselves; this shall cause errors - * from commands associated with them to be ignored in the same manner as - * specified by the -i option. - */ -public class IgnoreRule extends SpecialRule implements IIgnoreRule { - - public IgnoreRule(Directive parent, String[] reqs) { - super(parent, new Target(".IGNORE"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/InferenceRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/InferenceRule.java deleted file mode 100644 index 01b0a92168c..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/InferenceRule.java +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.ICommand; - -public class InferenceRule extends Rule { - - public InferenceRule(Directive parent, Target target) { - this(parent, target, new Command[0]); - } - - public InferenceRule(Directive parent, String tgt, Command[] cmds) { - this(parent, new Target(tgt), cmds); - } - - public InferenceRule(Directive parent, Target target, Command[] cmds) { - super(parent, target, cmds); - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(getTarget().toString()).append(":\n"); - ICommand[] cmds = getCommands(); - for (int i = 0; i < cmds.length; i++) { - buffer.append(cmds[i].toString()); - } - return buffer.toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java deleted file mode 100644 index 80191e5ca95..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MacroDefinition.java +++ /dev/null @@ -1,112 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IMacroDefinition; - -/** - */ -public class MacroDefinition extends Directive implements IMacroDefinition { - String name; - StringBuffer value; - boolean fromCommand; - boolean fromDefault; - boolean fromMakefile; - boolean fromEnvironment; - boolean fromEnvironmentOverride; - - public MacroDefinition(Directive parent, String n, StringBuffer v) { - super(parent); - name = n; - value = v; - } - - public String getName() { - return name; - } - - public void setName(String n) { - name = (n == null) ? "" : n.trim() ; - } - - public StringBuffer getValue() { - return value; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(getName()).append(" = ").append(getValue()).append('\n'); - return buffer.toString(); - } - - public boolean equals(MacroDefinition v) { - return v.getName().equals(getName()); - } - - public void setFromCommand(boolean from) { - fromCommand = from; - } - - public void setFromDefault(boolean from) { - fromDefault = from; - } - - public void setFromEnviroment(boolean from) { - fromEnvironment = from; - } - - public void setFromEnviromentOverride(boolean from) { - fromEnvironmentOverride = from; - } - - public void setFromMakefile(boolean from) { - fromMakefile = from; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromCommand() - */ - public boolean isFromCommand() { - return fromCommand; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromDefault() - */ - public boolean isFromDefault() { - return fromDefault; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromEnviroment() - */ - public boolean isFromEnviroment() { - return fromEnvironment; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromEnviroment() - */ - public boolean isFromEnvironmentOverride() { - return fromEnvironmentOverride; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IMacroDefinition#isFromMakefile() - */ - public boolean isFromMakefile() { - return fromMakefile; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MakefileReader.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MakefileReader.java deleted file mode 100644 index fb61f8f28e5..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/MakefileReader.java +++ /dev/null @@ -1,86 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.io.IOException; -import java.io.LineNumberReader; -import java.io.Reader; - -/** - */ -public class MakefileReader extends LineNumberReader { - - - public MakefileReader(Reader reader) { - super(reader); - } - - public MakefileReader(Reader reader, int sz) { - super(reader, sz); - } - - - public String readLine() throws IOException { - boolean done = false; - StringBuffer buffer = new StringBuffer(); - boolean escapedLine = false; - boolean escapedCommand = false; - while (!done) { - String line = super.readLine(); - if (line == null) { - return null; - } - - if (escapedLine && line.length() > 0) { - // Eat the spaces at the beginning. - int i = 0; - while (i < line.length() && (Util.isSpace(line.charAt(i)))) { - i++ ; - } - line = line.substring(i); - } else if (escapedCommand && line.length() > 0) { - // Only eat the first tab - if (line.charAt(0) == '\t') { - line.substring(1); - } - } - - // According to POSIX rules: - // When an escaped (one preceded by a backslash) is found - // anywhere in the makefile except in a command line, it shall be replaced, - // along with any leading white space on the following line, with a single - // - // When an escaped is found in a command line in a makefile, - // the command line shall contain the backslash, the , and the next line, - // except that the first character of the next line shall not be included if it is a - if (Util.isEscapedLine(line)) { - int index = line.lastIndexOf('\\'); - if (index > 0) { - if (!escapedLine && Util.isCommand(line)) { - escapedCommand = true; - buffer.append(line); - } else { - escapedLine = true; - buffer.append(line.substring(0, index)); - buffer.append(' '); - } - } - } else { - done = true; - escapedLine = false; - escapedCommand = false; - buffer.append(line); - } - } - return buffer.toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java deleted file mode 100644 index 66dd3c5d60b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java +++ /dev/null @@ -1,63 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.io.IOException; -import java.io.Reader; - -import org.eclipse.cdt.make.core.makefile.IDirective; - -/** - * Makefile : ( statement ) * - * statement : rule | macro_definition | comments | empty - * rule : inference_rule | target_rule - * inference_rule : target ':' ( command ) + - * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] - [ ( command ) * ] - * macro_definition : string '=' (string)* - * comments : ('#' (string) ) * - * empty : - * command : prefix_command string - * target : string - * prefix_command : '-' | '@' | '+' - * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%" - */ - -public class NullMakefile extends AbstractMakefile { - - public static IDirective[] empty = new IDirective[0]; - - public NullMakefile() { - super(null); - } - - public IDirective[] getDirectives() { - return empty; - } - - public IDirective[] getBuiltins() { - return empty; - } - - public void addDirective(IDirective directive) { - } - - public String toString() { - return new String(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.core.makefile.IMakefile#parse(java.io.Reader) - */ - public void parse(Reader makefile) throws IOException { - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java deleted file mode 100644 index df23fd01f7a..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.cdt.make.core.makefile.IParent; -import org.eclipse.cdt.make.core.makefile.IDirective; - -/** - * IParent - */ - -public abstract class Parent extends Directive implements IParent { - - ArrayList children = new ArrayList(); - - public Parent(Directive parent) { - super(parent); - } - - public IDirective[] getDirectives() { - children.trimToSize(); - return (IDirective[]) children.toArray(new IDirective[0]); - } - - public void addDirective(Directive directive) { - children.add(directive); - // reparent - directive.setParent(this); - } - - public void addDirectives(Directive[] directives) { - children.addAll(Arrays.asList(directives)); - // reparent - for (int i = 0; i < directives.length; i++) { - directives[i].setParent(this); - } - } - - public void clearDirectives() { - children.clear(); - } - - public Directive[] getStatements() { - children.trimToSize(); - return (Directive[]) children.toArray(new Directive[0]); - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer sb = new StringBuffer(); - IDirective[] directives = getDirectives(); - for (int i = 0; i < directives.length; i++) { - sb.append(directives[i]); - } - return sb.toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PosixRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PosixRule.java deleted file mode 100644 index e82abe9369b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PosixRule.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IPosixRule; - -/** - * .POSIX - * The appliation shall ensure that this special target is specified without - * prerequisites or commands. - */ -public class PosixRule extends SpecialRule implements IPosixRule { - - public PosixRule(Directive parent) { - super(parent, new Target(".POSIX"), new String[0], new Command[0]); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PreciousRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PreciousRule.java deleted file mode 100644 index 5d239a6ad76..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/PreciousRule.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.IPreciousRule; - -/** - * .PRECIOUS - * Prerequisites of this special target shall not be removed if make recieves an - * asynchronous events. - */ -public class PreciousRule extends SpecialRule implements IPreciousRule { - - public PreciousRule(Directive parent, String[] reqs) { - super(parent, new Target(".PRECIOUS"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java deleted file mode 100644 index 7faaab38d8d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Rule.java +++ /dev/null @@ -1,57 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.util.ArrayList; - -import org.eclipse.cdt.make.core.makefile.ICommand; -import org.eclipse.cdt.make.core.makefile.IRule; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.ITarget; - -public abstract class Rule extends Parent implements IRule { - - Target target; - - public Rule(Directive parent, Target tgt) { - this(parent, tgt, new Command[0]); - } - - public Rule(Directive parent, Target tgt, Command[] cmds) { - super(parent); - target = tgt; - addDirectives(cmds); - } - - public ICommand[] getCommands() { - IDirective[] directives = getDirectives(); - ArrayList cmds = new ArrayList(directives.length); - for (int i = 0; i < directives.length; i++) { - if (directives[i] instanceof ICommand) { - cmds.add(directives[i]); - } - } - return (ICommand[])cmds.toArray(new ICommand[0]); - } - - public ITarget getTarget() { - return target; - } - - public void setTarget(Target tgt) { - target = tgt; - } - - public boolean equals(Rule r) { - return r.getTarget().equals(getTarget()); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SccsGetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SccsGetRule.java deleted file mode 100644 index c13f25ab4f5..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SccsGetRule.java +++ /dev/null @@ -1,28 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.ISccsGetRule; - -/** - * .SCCS_GET - * The application shall ensure that this special target is specified without - * prerequesites. - * The commands specifeied with this target shall replace the default - * commands associated with this special target. - */ -public class SccsGetRule extends SpecialRule implements ISccsGetRule { - - public SccsGetRule(Directive parent, Command[] cmds) { - super(parent, new Target(".SCCS_GET"), new String[0], cmds); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SilentRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SilentRule.java deleted file mode 100644 index 6a33ebf0c76..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SilentRule.java +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.ISilentRule; - -/** - * .SILENT - * Prerequisties of this special target are targets themselves; this shall cause - * commands associated with them not to be written to the standard output before - * they are executed. - */ -public class SilentRule extends SpecialRule implements ISilentRule { - - public SilentRule(Directive parent, String[] reqs) { - super(parent, new Target(".SILENT"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java deleted file mode 100644 index 18d2dd0ae2b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SpecialRule.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.ISpecialRule; -import org.eclipse.cdt.make.core.makefile.ICommand; - -/** - * Targets that have special meaning for Make. - */ -public abstract class SpecialRule extends Rule implements ISpecialRule { - - String[] prerequisites; - - public SpecialRule(Directive parent, Target target, String[] reqs, Command[] cmds) { - super(parent, target, cmds); - prerequisites = reqs; - } - - public String[] getPrerequisites() { - return prerequisites; - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append(target).append(":"); - String[] reqs = getPrerequisites(); - for (int i = 0; i < reqs.length; i++) { - sb.append(' ').append(reqs[i]); - } - sb.append('\n'); - ICommand[] cmds = getCommands(); - for (int i = 0; i < cmds.length; i++) { - sb.append(cmds[i]); - } - return sb.toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SuffixesRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SuffixesRule.java deleted file mode 100644 index abec32bf6ea..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/SuffixesRule.java +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.ISuffixesRule; - -/** - * .SUFFIXES - * Prerequesites of .SUFFIXES shall be appended tothe list of known suffixes and are - * used inconjucntion with the inference rules. - * - */ -public class SuffixesRule extends SpecialRule implements ISuffixesRule { - - public SuffixesRule(Directive parent, String[] suffixes) { - super(parent, new Target(".SUFFIXES"), suffixes, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Target.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Target.java deleted file mode 100644 index 42c1ae2d4cf..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Target.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import java.io.File; - -import org.eclipse.cdt.make.core.makefile.ITarget; - -public class Target implements ITarget { - - String target; - - public Target(String t) { - target = t; - } - - public String toString() { - return target; - } - - public boolean exits() { - return new File(target).exists(); - } - - public long lastModified() { - return new File(target).lastModified(); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java deleted file mode 100644 index 7499c76167b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/TargetRule.java +++ /dev/null @@ -1,75 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -import org.eclipse.cdt.make.core.makefile.ICommand; -import org.eclipse.cdt.make.core.makefile.ITargetRule; - -/** - * Makefile : ( statement ) * - * statement : rule | macro_definition | comments | empty - * rule : inference_rule | target_rule - * inference_rule : target ':' ( command ) + - * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] - [ ( prefix_command command ) * ] - * macro_definition : string '=' (string)* - * comments : '#' (string) * - * empty : - * command : string - * target : string - * prefix_command : '-' | '@' | '+' - * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%" - */ - -public class TargetRule extends Rule implements ITargetRule { - - String[] prerequisites; - - public TargetRule(Directive parent, Target target) { - this(parent, target, new String[0], new Command[0]); - } - - public TargetRule(Directive parent, Target target, String[] deps) { - this(parent, target, deps, new Command[0]); - } - - public TargetRule(Directive parent, Target target, String[] reqs, Command[] commands) { - super(parent, target, commands); - prerequisites = reqs; - } - - public String[] getPrerequisites() { - return prerequisites; - } - - public void setDependecies(String[] reqs) { - prerequisites = reqs; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(getTarget().toString()); - buffer.append(':'); - String[] reqs = getPrerequisites(); - for (int i = 0; i < reqs.length; i++) { - buffer.append(' ').append(reqs[i]); - } - buffer.append('\n'); - ICommand[] cmds = getCommands(); - for (int i = 0; i < cmds.length; i++) { - buffer.append(cmds[i].toString()); - } - return buffer.toString(); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java deleted file mode 100644 index 296f382cb5e..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Util.java +++ /dev/null @@ -1,86 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile; - -/** - * Utility methods. - */ -public class Util { - - private Util() { - } - - public static boolean isCommand(String line) { - return line.length() > 1 && line.startsWith("\t"); - } - - public static boolean isEscapedLine(String line) { - return (line.endsWith("\\") && !line.endsWith("\\\\")); - } - - public static boolean isEmptyLine(String line) { - return line.trim().length() == 0; - } - - public static int indexOfComment(String line) { - boolean escaped = false; - for (int i = 0; i < line.length(); i++) { - if (line.charAt(i) == '#' && !escaped) { - return i; - } - escaped = line.charAt(i) == '\\'; - } - return -1; - } - - public static boolean isSpace(char c) { - return (c == ' ' || c == '\t' || c == '\r' || c == '\n'); - } - - public static int indexOf(String line, char c) { - return indexOf(line, new Character(c).toString()); - } - - /** - * Special indexOf() method that makes sure that what we are searching - * is not between parentheses and brackets like a macro $(foo) ${bar} - */ - public static int indexOf(String line, String tokens) { - int paren = 0; - int bracket = 0; - char prev = 0; - char pprev = 0; - for (int i = 0; i < line.length(); i++) { - char ch = line.charAt(i); - if (ch == '(' && prev == '$' && pprev != '\\') { - paren++; - } else if (ch == '{' && prev == '$' && pprev != '\\') { - bracket++; - } else if (ch == ')' && prev != '\\') { - if (paren > 0) { - paren--; - } - } else if (ch == '}' && prev != '\\') { - if (bracket > 0) { - bracket--; - } - } else if (tokens.indexOf(ch) != -1) { - if (paren == 0 && bracket == 0) { - return i; - } - } - pprev = prev; - prev = ch; - } - return -1; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java deleted file mode 100644 index 972666d4605..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java +++ /dev/null @@ -1,156 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IConditional; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.Parent; - -public abstract class Conditional extends Parent implements IConditional { - - String cond; - String arg1; - String arg2; - - public Conditional(Directive parent, String conditional) { - super(parent); - cond = conditional; - parse(); - } - - public Conditional(Directive parent) { - this(parent, "", "", ""); - } - - public Conditional(Directive parent, String conditional, String argument1, String argument2) { - super(parent); - arg1 = argument1; - arg2 = argument2; - cond = conditional; - } - - - public String getConditional() { - return cond; - } - - public String getArg1() { - return arg1; - } - - public String getArg2() { - return arg2; - } - - public boolean isIfdef() { - return false; - } - - public boolean isIfndef() { - return false; - } - - public boolean isIfeq() { - return false; - } - - public boolean isIfneq() { - return false; - } - - public boolean isElse() { - return false; - } - - public boolean isEndif() { - return false; - } - - /** - * Formats of the conditional string. - * ifeq (ARG1, ARG2) - * ifeq 'ARG1' 'ARG2' - * ifeq "ARG1" "ARG2" - * ifeq "ARG1" 'ARG2' - * ifeq 'ARG1' "ARG2" - */ - protected void parse() { - String line = getConditional().trim(); - - char terminal = line.charAt(0) == '(' ? ',' : line.charAt(0); - - if (line.length() < 5 && terminal != ',' && terminal != '"' && terminal != '\'') { - arg1 = arg2 = ""; - return; - } - - // Find the end of the first string. - int count = 0; - // For the (ARG1, ARG2) format. - - // get the first ARG1 - if (terminal == ',') { - int paren = 0; - for (count = 1; count < line.length(); count++) { - char ch = line.charAt(count); - if (ch == '(') { - paren++; - } else if (ch == ')') { - paren--; - } - if (ch == terminal && paren <= 0) { - break; - } - } - } else { - for (count = 1; count < line.length(); count++) { - if (line.charAt(count) == terminal) { - break; - } - } - } - - arg1 = line.substring(1, count); - - /* Find the start of the second string. */ - line = line.substring(count + 1).trim(); - - terminal = terminal == ',' ? ')' : line.charAt(0); - if (terminal != ')' && terminal != '"' && terminal != '\'') { - arg2 = ""; - return; - } - - count = 0; - /* Find the end of the second string. */ - if (terminal == ')') { - int paren = 0; - for (count = 0; count < line.length(); count++) { - char ch = line.charAt(count); - if (ch == '(') { - paren++; - } else if (ch == ')') { - paren--; - } - if (ch == terminal && paren <= 0) { - break; - } - } - } else { - for (count = 1; count < line.length(); count++) { - if (line.charAt(count) == terminal) { - break; - } - } - } - arg2 = line.substring(0, count); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DefineVariable.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DefineVariable.java deleted file mode 100644 index ed43f562c64..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DefineVariable.java +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class DefineVariable extends VariableDefinition { - - public DefineVariable(Directive parent, String name, StringBuffer value) { - super(parent, name, value); - } - - public boolean isMultiLine() { - return true; - } - - public String toString() { - StringBuffer sb = new StringBuffer("define"); - sb.append(getName()).append('\n'); - sb.append(getValue()); - sb.append("endef"); - return sb.toString(); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DeleteOnErrorRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DeleteOnErrorRule.java deleted file mode 100644 index 97a5661460d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/DeleteOnErrorRule.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IDeleteOnErrorRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .DELETE_ON_ERROR - * If `.DELETE_ON_ERROR' is mentioned as a target anywhere in the - * makefile, then `make' will delete the target of a rule if it has - * changed and its commands exit with a nonzero exit status, just as - * it does when it receives a signal. - */ -public class DeleteOnErrorRule extends SpecialRule implements IDeleteOnErrorRule { - - public DeleteOnErrorRule(Directive parent, String[] reqs) { - super(parent, new Target(".DELETE_ON_ERROR"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Else.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Else.java deleted file mode 100644 index 08f8aab5eb0..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Else.java +++ /dev/null @@ -1,29 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class Else extends Conditional { - - public Else(Directive parent) { - super(parent); - } - - public boolean isElse() { - return true; - } - - public String toString() { - return "else"; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endef.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endef.java deleted file mode 100644 index 8fe6d6c7217..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endef.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - -public class Endef extends Terminal { - - - public Endef(Directive parent) { - super(parent); - } - - public boolean isEndef() { - return true; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endif.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endif.java deleted file mode 100644 index 2e49fd6d512..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Endif.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - -public class Endif extends Terminal { - - public Endif(Directive parent) { - super(parent); - } - - public boolean isEndif() { - return true; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportAllVariablesRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportAllVariablesRule.java deleted file mode 100644 index 97965266fbb..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportAllVariablesRule.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IExportAllVariablesRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .EXPORT_ALL_VARIABLES - * Simply by being mentioned as a target, this tells `make' to export - * all variables to child processes by default. - */ -public class ExportAllVariablesRule extends SpecialRule implements IExportAllVariablesRule { - - public ExportAllVariablesRule(Directive parent, String[] reqs) { - super(parent, new Target(".EXPORT_ALL_VARIABLES"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportVariable.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportVariable.java deleted file mode 100644 index 812e0754f8d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/ExportVariable.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class ExportVariable extends VariableDefinition { - - public ExportVariable(Directive parent, String name, StringBuffer value, int type) { - super(parent, name, value, type); - } - - public boolean isExport() { - return true; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java deleted file mode 100644 index a04e8c1138a..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefile.java +++ /dev/null @@ -1,812 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; -import java.util.StringTokenizer; - -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.gnu.IGNUMakefile; -import org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile; -import org.eclipse.cdt.make.internal.core.makefile.BadDirective; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Comment; -import org.eclipse.cdt.make.internal.core.makefile.DefaultRule; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.EmptyLine; -import org.eclipse.cdt.make.internal.core.makefile.IgnoreRule; -import org.eclipse.cdt.make.internal.core.makefile.InferenceRule; -import org.eclipse.cdt.make.internal.core.makefile.MacroDefinition; -import org.eclipse.cdt.make.internal.core.makefile.MakefileReader; -import org.eclipse.cdt.make.internal.core.makefile.PosixRule; -import org.eclipse.cdt.make.internal.core.makefile.PreciousRule; -import org.eclipse.cdt.make.internal.core.makefile.Rule; -import org.eclipse.cdt.make.internal.core.makefile.SccsGetRule; -import org.eclipse.cdt.make.internal.core.makefile.SilentRule; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.SuffixesRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; -import org.eclipse.cdt.make.internal.core.makefile.TargetRule; -import org.eclipse.cdt.make.internal.core.makefile.Util; -import org.eclipse.core.runtime.Path; - -/** - * Makefile : ( statement ) * - * statement : rule | macro_definition | comments | empty - * rule : inference_rule | target_rule - * inference_rule : target ':' ( command ) + - * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] - [ ( command ) * ] - * macro_definition : string '=' (string)* - * comments : ('#' (string) ) * - * empty : - * command : prefix_command string - * target : string - * prefix_command : '-' | '@' | '+' - * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%" - */ - -public class GNUMakefile extends AbstractMakefile implements IGNUMakefile { - - public static String PATH_SEPARATOR = System.getProperty("path.separator", ":"); - public static String FILE_SEPARATOR = System.getProperty("file.separator", "/"); - - String[] includeDirectories = new String[0]; - IDirective[] builtins = null; - - public GNUMakefile() { - super(null); - } - - public void parse(String name) throws IOException { - FileReader stream = new FileReader(name); - parse(stream); - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - - public void parse(Reader reader) throws IOException { - parse(new MakefileReader(reader)); - } - - protected void parse(MakefileReader reader) throws IOException { - String line; - Rule[] rules = null; - Stack conditions = new Stack(); - Stack defines = new Stack(); - int startLine = 0; - int endLine = 0; - - // Clear any old directives. - clearDirectives(); - - while ((line = reader.readLine()) != null) { - startLine = endLine + 1; - endLine = reader.getLineNumber(); - - // Check if we enter in "define" - if (GNUMakefileUtil.isEndef(line)) { - // We should have a "define" for a "endef". - if (!defines.empty()) { - VariableDefinition def = (VariableDefinition) defines.pop(); - def.setEndLine(endLine); - } - Endef endef = new Endef(this); - endef.setLines(startLine, endLine); - addDirective(conditions, endef); - continue; - } else if (GNUMakefileUtil.isDefine(line)) { - VariableDefinition def = parseVariableDefinition(line); - def.setLines(startLine, endLine); - addDirective(conditions, def); - defines.push(def); - continue; - } else if (GNUMakefileUtil.isOverrideDefine(line)) { - VariableDefinition oDef = parseVariableDefinition(line); - oDef.setLines(startLine, endLine); - addDirective(conditions, oDef); - defines.push(oDef); - continue; - } - - // We still in a define. - if (!defines.empty()) { - VariableDefinition def = (VariableDefinition) defines.peek(); - StringBuffer sb = def.getValue(); - if (sb.length() > 0) { - sb.append('\n'); - } - sb.append(line); - continue; - } - - // 1- Try command first, since we can not strip '#' in command line - if (GNUMakefileUtil.isCommand(line)) { - Command cmd = new Command(this, line); - cmd.setLines(startLine, endLine); - if (!conditions.empty()) { - addDirective(conditions, cmd); - continue; - } else if (rules != null) { - // The command is added to the rules - for (int i = 0; i < rules.length; i++) { - rules[i].addDirective(cmd); - rules[i].setEndLine(endLine); - } - continue; - } - // If we have no rules/condition for the command, - // give the other directives a chance by falling through - } - - // 2- Strip away any comments. - int pound = Util.indexOfComment(line); - if (pound != -1) { - Comment cmt = new Comment(this, line.substring(pound + 1)); - cmt.setLines(startLine, endLine); - if (rules != null) { - // The comment is added to the rules. - for (int i = 0; i < rules.length; i++) { - rules[i].addDirective(cmt); - rules[i].setEndLine(endLine); - } - } else { - addDirective(conditions, cmt); - } - line = line.substring(0, pound); - // If all we have left are spaces continue - if (Util.isEmptyLine(line)) { - continue; - } - // The rest of the line maybe a valid directives. - // keep on trying by falling through. - } - - // 3- Empty lines ? - if (Util.isEmptyLine(line)) { - Directive empty = new EmptyLine(this); - empty.setLines(startLine, endLine); - if (rules != null) { - // The EmptyLine is added to the rules. - for (int i = 0; i < rules.length; i++) { - rules[i].addDirective(empty); - rules[i].setEndLine(endLine); - } - } else { - addDirective(conditions, empty); - } - continue; - } - - // 4- reset the rules to null - // The first non empty line that does not begin with a or '#' - // shall begin a new entry. - rules = null; - - if (GNUMakefileUtil.isElse(line)) { - Conditional elseDirective = parseConditional(line); - elseDirective.setLines(startLine, endLine); - // Are we missing a if condition ? - if (!conditions.empty()) { - Conditional cond = (Conditional) conditions.pop(); - cond.setEndLine(endLine - 1); - } - addDirective(conditions, elseDirective); - conditions.push(elseDirective); - continue; - } else if (GNUMakefileUtil.isEndif(line)) { - Endif endif = new Endif(this); - endif.setLines(startLine, endLine); - // Are we missing a if/else condition ? - if (!conditions.empty()) { - Conditional cond = (Conditional) conditions.pop(); - cond.setEndLine(endLine); - } - addDirective(conditions, endif); - continue; - } - - // 5- Check for the conditionnals. - Directive directive = processConditions(line); - if (directive != null) { - directive.setLines(startLine, endLine); - addDirective(conditions, directive); - conditions.push(directive); - continue; - } - - // 6- Check for other special gnu directives. - directive = processGNUDirectives(line); - if (directive != null) { - directive.setLines(startLine, endLine); - addDirective(conditions, directive); - continue; - } - - // 7- Check for GNU special rules. - SpecialRule special = processSpecialRules(line); - if (special != null) { - rules = new Rule[] { special }; - special.setLines(startLine, endLine); - addDirective(conditions, special); - continue; - } - - // - Check for inference rule. - if (GNUMakefileUtil.isInferenceRule(line)) { - InferenceRule irule = parseInferenceRule(line); - irule.setLines(startLine, endLine); - addDirective(conditions, irule); - rules = new Rule[] { irule }; - continue; - } - - // - Variable Definiton ? - if (GNUMakefileUtil.isVariableDefinition(line)) { - Directive stmt = parseVariableDefinition(line); - stmt.setLines(startLine, endLine); - addDirective(conditions, stmt); - continue; - } - - // - GNU Static Target rule ? - if (GNUMakefileUtil.isStaticTargetRule(line)) { - StaticTargetRule[] srules = parseStaticTargetRule(line); - for (int i = 0; i < srules.length; i++) { - srules[i].setLines(startLine, endLine); - addDirective(conditions, srules[i]); - } - rules = srules; - continue; - } - - // - Target Rule ? - if (GNUMakefileUtil.isGNUTargetRule(line)) { - TargetRule[] trules = parseGNUTargetRules(line); - for (int i = 0; i < trules.length; i++) { - trules[i].setLines(startLine, endLine); - addDirective(conditions, trules[i]); - } - rules = trules; - continue; - } - - // XXX ?? Should not be here. - BadDirective stmt = new BadDirective(this, line); - stmt.setLines(startLine, endLine); - addDirective(conditions, stmt); - - } - setLines(1, endLine); - // TEST please remove. - //GNUMakefileValidator validator = new GNUMakefileValidator(); - //validator.validateDirectives(null, getDirectives()); - } - - private void addDirective(Stack conditions, Directive directive) { - if (conditions.empty()) { - addDirective(directive); - } else { - Conditional cond = (Conditional) conditions.peek(); - cond.addDirective(directive); - cond.setEndLine(directive.getEndLine()); - } - } - - protected Conditional processConditions(String line) { - Conditional stmt = null; - if (GNUMakefileUtil.isIfdef(line)) { - stmt = parseConditional(line); - } else if (GNUMakefileUtil.isIfndef(line)) { - stmt = parseConditional(line); - } else if (GNUMakefileUtil.isIfeq(line)) { - stmt = parseConditional(line); - } else if (GNUMakefileUtil.isIfneq(line)) { - stmt = parseConditional(line); - } - return stmt; - } - - protected Directive processGNUDirectives(String line) { - Directive stmt = null; - if (GNUMakefileUtil.isUnExport(line)) { - stmt = parseUnExport(line); - } else if (GNUMakefileUtil.isVPath(line)) { - stmt = parseVPath(line); - } else if (GNUMakefileUtil.isInclude(line)) { - stmt = parseInclude(line); - } - return stmt; - } - - protected SpecialRule processSpecialRules(String line) { - SpecialRule stmt = null; - if (GNUMakefileUtil.isIgnoreRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isPosixRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isPreciousRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isSilentRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isSuffixesRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isDefaultRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isSccsGetRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isPhonyRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isIntermediateRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isSecondaryRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isDeleteOnErrorRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isLowResolutionTimeRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isExportAllVariablesRule(line)) { - stmt = parseSpecialRule(line); - } else if (GNUMakefileUtil.isNotParallelRule(line)) { - stmt = parseSpecialRule(line); - } - return stmt; - } - - /** - * @param line - * @return - */ - protected SpecialRule parseSpecialRule(String line) { - line = line.trim(); - String keyword = null; - String[] reqs = null; - SpecialRule special = null; - int index = Util.indexOf(line, ':'); - if (index != -1) { - keyword = line.substring(0, index).trim(); - String req = line.substring(index + 1); - reqs = GNUMakefileUtil.findPrerequisites(req); - } else { - keyword = line; - reqs = new String[0]; - } - if (".IGNORE".equals(keyword)) { - special = new IgnoreRule(this, reqs); - } else if (".POSIX".equals(keyword)) { - special = new PosixRule(this); - } else if (".PRECIOUS".equals(keyword)) { - special = new PreciousRule(this, reqs); - } else if (".SILENT".equals(keyword)) { - special = new SilentRule(this, reqs); - } else if (".SUFFIXES".equals(keyword)) { - special = new SuffixesRule(this, reqs); - } else if (".DEFAULT".equals(keyword)) { - special = new DefaultRule(this, new Command[0]); - } else if (".SCCS_GET".equals(keyword)) { - special = new SccsGetRule(this, new Command[0]); - } else if (".PHONY".equals(keyword)) { - special = new PhonyRule(this, reqs); - } else if (".INTERMEDIATE".equals(keyword)) { - special = new IntermediateRule(this, reqs); - } else if (".SECONDARY".equals(keyword)) { - special = new SecondaryRule(this, reqs); - } else if (".DELETE_ON_ERROR".equals(keyword)) { - special = new DeleteOnErrorRule(this, reqs); - } else if (".LOW_RESOLUTION_TIME".equals(keyword)) { - special = new LowResolutionTimeRule(this, reqs); - } else if (".EXPORT_ALL_VARIABLES".equals(keyword)) { - special = new ExportAllVariablesRule(this, reqs); - } else if (".NOTPARALLEL".equals(keyword)) { - special = new NotParallelRule(this, reqs); - } - return special; - } - - /** - * - * ifdef CONDITIONAL - * ifeq CONDITIONAL - * ifneq CONDITIONAL - * else - * - * @param line - * @return - */ - protected Conditional parseConditional(String line) { - Conditional condition = null; - line = line.trim(); - String keyword = null; - // Move pass the keyword - for (int i = 0; i < line.length(); i++) { - if (Util.isSpace(line.charAt(i))) { - keyword = line.substring(0, i); - line = line.substring(i).trim(); - break; - } - } - if (keyword == null) { - keyword = line; - } - if (keyword.equals("ifdef")) { - condition = new Ifdef(this, line); - } else if (keyword.equals("ifndef")) { - condition = new Ifndef(this, line); - } else if (keyword.equals("ifeq")) { - condition = new Ifeq(this, line); - } else if (keyword.equals("ifneq")) { - condition = new Ifneq(this, line); - } else if (keyword.equals("else")) { - condition = new Else(this); - } - return condition; - } - - /** - * Format of the include directive: - * include filename1 filename2 ... - */ - protected Include parseInclude(String line) { - String[] filenames; - StringTokenizer st = new StringTokenizer(line); - int count = st.countTokens(); - if (count > 0) { - filenames = new String[count - 1]; - for (int i = 0; i < count; i++) { - if (i == 0) { - st.nextToken(); - // ignore the "include" keyword. - continue; - } - filenames[i - 1] = st.nextToken(); - } - } else { - filenames = new String[0]; - } - return new Include(this, filenames, getIncludeDirectories()); - } - - /** - * There are three forms of the "vpath" directive: - * "vpath PATTERN DIRECTORIES" - * Specify the search path DIRECTORIES for file names that match PATTERN. - * - * The search path, DIRECTORIES, is a list of directories to be - * searched, separated by colons (semi-colons on MS-DOS and - * MS-Windows) or blanks, just like the search path used in the `VPATH' variable. - * - * "vpath PATTERN" - * Clear out the search path associated with PATTERN. - * - * "vpath" - * Clear all search paths previously specified with `vpath' directives. - */ - protected VPath parseVPath(String line) { - String pattern = null; - String[] directories; - StringTokenizer st = new StringTokenizer(line); - int count = st.countTokens(); - List dirs = new ArrayList(count); - if (count > 0) { - for (int i = 0; i < count; i++) { - if (count == 0) { - // ignore the "vpath" directive - st.nextToken(); - } else if (count == 1) { - pattern = st.nextToken(); - } else if (count == 3) { - String delim = " \t\n\r\f" + GNUMakefile.PATH_SEPARATOR; - dirs.add(st.nextToken(delim)); - } else { - dirs.add(st.nextToken()); - } - } - } - directories = (String[]) dirs.toArray(new String[0]); - if (pattern == null) { - pattern = new String(); - } - return new VPath(this, pattern, directories); - } - - /** - * @param line - * @return - */ - protected UnExport parseUnExport(String line) { - // Pass over "unexport" - for (int i = 0; i < line.length(); i++) { - if (Util.isSpace(line.charAt(i))) { - line = line.substring(i).trim(); - break; - } - } - return new UnExport(this, line); - } - - protected GNUTargetRule[] parseGNUTargetRules(String line) { - String[] targetNames; - String[] normalReqs; - String[] orderReqs; - String cmd = null; - boolean doubleColon = false; - int index = Util.indexOf(line, ':'); - if (index != -1) { - // Break the targets - String target = line.substring(0, index); - targetNames = GNUMakefileUtil.findTargets(target.trim()); - - // Some TargetRule have "::" for separator - String req = line.substring(index + 1); - doubleColon = req.startsWith(":"); - if (doubleColon) { - // move pass the second ':' - req = req.substring(1); - } - - // Check for command - int semicolon = Util.indexOf(req, ';'); - if (semicolon != -1) { - cmd = req.substring(semicolon + 1); - req = req.substring(0, semicolon); - } - - // Check for Normal and order prerequisites - String normalReq = null; - String orderReq = null; - int pipe = Util.indexOf(req, '|'); - if (pipe != -1) { - normalReq = req.substring(0, pipe); - orderReq = req.substring(pipe + 1); - } else { - normalReq = req; - orderReq = ""; - } - - normalReqs = GNUMakefileUtil.findPrerequisites(normalReq.trim()); - orderReqs = GNUMakefileUtil.findPrerequisites(orderReq.trim()); - } else { - targetNames = GNUMakefileUtil.findTargets(line); - normalReqs = new String[0]; - orderReqs = new String[0]; - } - - GNUTargetRule[] rules = new GNUTargetRule[targetNames.length]; - for (int i = 0; i < targetNames.length; i++) { - rules[i] = new GNUTargetRule(this, new Target(targetNames[i]), doubleColon, normalReqs, orderReqs, new Command[0]); - if (cmd != null) { - rules[i].addDirective(new Command(this, cmd)); - } - } - return rules; - } - - protected VariableDefinition parseVariableDefinition(String line) { - line = line.trim(); - VariableDefinition vd; - - // the default type. - int type = VariableDefinition.TYPE_RECURSIVE_EXPAND; - boolean isDefine = false; - boolean isOverride = false; - boolean isTargetVariable = false; - boolean isExport = false; - String targetName = ""; - - String name; - StringBuffer value = new StringBuffer(); - - // Check for Target: Variable-assignment - if (GNUMakefileUtil.isTargetVariable(line)) { - // move to the first ':' - int colon = Util.indexOf(line, ':'); - if (colon != -1) { - targetName = line.substring(0, colon).trim(); - line = line.substring(colon + 1).trim(); - } else { - targetName = ""; - } - } - - // Check for Override condition. - if (GNUMakefileUtil.isOverride(line)) { - isOverride = true; - // Move pass the keyword override. - for (int i = 0; i < line.length(); i++) { - if (Util.isSpace(line.charAt(i))) { - line = line.substring(i).trim(); - break; - } - } - } - - // Check for "define" - if (GNUMakefileUtil.isDefine(line)) { - isDefine = true; - // Move pass the keyword define. - for (int i = 0; i < line.length(); i++) { - if (Util.isSpace(line.charAt(i))) { - line = line.substring(i).trim(); - break; - } - } - } - - // Check for Override condition. - if (GNUMakefileUtil.isExport(line)) { - isExport = true; - // Move pass the keyword export. - for (int i = 0; i < line.length(); i++) { - if (Util.isSpace(line.charAt(i))) { - line = line.substring(i).trim(); - break; - } - } - } - - // Check for Target-variable - - int index = line.indexOf('='); - if (index != -1) { - int separator = index; - // Check for "+=", ":=", "?=" - if (index > 0) { - type = line.charAt(index - 1); - if (type == VariableDefinition.TYPE_SIMPLE_EXPAND - || type == VariableDefinition.TYPE_APPEND - || type == VariableDefinition.TYPE_CONDITIONAL) { - separator = index - 1; - } else { - type = VariableDefinition.TYPE_RECURSIVE_EXPAND; - } - } - name = line.substring(0, separator).trim(); - value.append(line.substring(index + 1).trim()); - } else { - name = line; - } - - if (isTargetVariable) { - vd = new TargetVariable(this, targetName, name, value, isOverride, type); - } - if (isOverride && isDefine) { - vd = new OverrideDefine(this, name, value); - } else if (isDefine) { - vd = new DefineVariable(this, name, value); - } else if (isOverride) { - vd = new OverrideVariable(this, name, value, type); - } else if (isExport) { - vd = new ExportVariable(this, name, value, type); - } else { - vd = new VariableDefinition(this, name, value, type); - } - return vd; - } - - protected StaticTargetRule[] parseStaticTargetRule(String line) { - // first colon: the Targets - String targetPattern; - String[] prereqPatterns; - String[] targets; - int colon = Util.indexOf(line, ':'); - if (colon > 1) { - String targetLine = line.substring(0, colon).trim(); - targets = GNUMakefileUtil.findTargets(targetLine); - // second colon: Target-Pattern - line = line.substring(colon + 1); - colon = Util.indexOf(line, ':'); - if (colon != -1) { - targetPattern = line.substring(0, colon).trim(); - line = line.substring(colon + 1); - StringTokenizer st = new StringTokenizer(line); - int count = st.countTokens(); - prereqPatterns = new String[count]; - for (int i = 0; i < count; i++) { - prereqPatterns[i] = st.nextToken(); - } - } else { - targetPattern = ""; - prereqPatterns = new String[0]; - } - } else { - targets = new String[0]; - targetPattern = ""; - prereqPatterns = new String[0]; - } - - StaticTargetRule[] staticRules = new StaticTargetRule[targets.length]; - for (int i = 0; i < targets.length; i++) { - staticRules[i] = new StaticTargetRule(this, new Target(targets[i]), targetPattern, prereqPatterns, new Command[0]); - } - return staticRules; - } - - /** - * @param line - * @return - */ - protected InferenceRule parseInferenceRule(String line) { - String tgt; - int index = Util.indexOf(line, ':'); - if (index != -1) { - tgt = line.substring(0, index); - } else { - tgt = line; - } - return new InferenceRule(this, new Target(tgt)); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile#getBuiltins() - */ - public IDirective[] getBuiltins() { - if (builtins == null) { - String location = "builtin" + File.separator + "gnu.mk"; - try { - InputStream stream = MakeCorePlugin.getDefault().openStream(new Path(location)); - GNUMakefile gnu = new GNUMakefile(); - gnu.parse(new InputStreamReader(stream)); - builtins = gnu.getDirectives(); - for (int i = 0; i < builtins.length; i++) { - if (builtins[i] instanceof MacroDefinition) { - ((MacroDefinition)builtins[i]).setFromDefault(true); - } - } - } catch (Exception e) { - //e.printStackTrace(); - } - if (builtins == null) { - builtins = new IDirective[0]; - } - } - return builtins; - } - - public void setIncludeDirectories(String[] dirs) { - includeDirectories = dirs; - } - - public String[] getIncludeDirectories() { - return includeDirectories; - } - - public static void main(String[] args) { - try { - String filename = "Makefile"; - if (args.length == 1) { - filename = args[0]; - } - GNUMakefile makefile = new GNUMakefile(); - makefile.parse(filename); - IDirective[] directive = makefile.getDirectives(); - for (int i = 0; i < directive.length; i++) { - //System.out.println("Rule[" + i +"]"); - System.out.print(directive[i]); - } - } catch (IOException e) { - System.out.println(e); - } - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java deleted file mode 100644 index 38edd5f1169..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileChecker.java +++ /dev/null @@ -1,152 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.model.ICModelMarker; -import org.eclipse.cdt.core.resources.ACBuilder; -import org.eclipse.cdt.make.core.makefile.IMakefileValidator; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; - -public class GNUMakefileChecker extends ACBuilder { - - public class MyResourceDeltaVisitor implements IResourceDeltaVisitor { - IProgressMonitor monitor; - - public MyResourceDeltaVisitor(IProgressMonitor monitor) { - this.monitor = monitor; - } - - public boolean visit(IResourceDelta delta) throws CoreException { - IResource resource = delta.getResource(); - if (resource != null && resource.getProject() == getProject()) { - if (resource instanceof IFile) { - // see if this a makefile candidate - IFile candidate = (IFile) resource; - if (isMakefileCandidate(candidate)) { - // ok verify. - if (delta.getKind() != IResourceDelta.REMOVED) { - checkMakefile(candidate, monitor); - } - } - } - } - return true; - } - } - - protected Map validatorMap = new HashMap(); - - public GNUMakefileChecker() { - } - - /** - * @see IncrementalProjectBuilder#build - */ - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - IResourceDelta delta = null; - - // For non-full-build fetch the deltas - if (kind != FULL_BUILD) { - delta = getDelta(getProject()); - } - - if (delta == null || kind == FULL_BUILD) { - // Full build - checkProject(getProject(), monitor); - } else { - MyResourceDeltaVisitor vis = new MyResourceDeltaVisitor(monitor); - if (delta != null) { - delta.accept(vis); - } - } - checkCancel(monitor); - return new IProject[0]; - } - - /** - * Check whether the build has been canceled. - */ - public void checkCancel(IProgressMonitor monitor) { - if (monitor != null && monitor.isCanceled()) { - throw new OperationCanceledException(); - } - } - - protected void checkProject(IProject project, IProgressMonitor monitor) { - IFile[] files = getCandidateMakefiles(project); - for (int i = 0; i < files.length; i++) { - checkMakefile(files[i], monitor); - } - } - - protected boolean isMakefileCandidate(IFile file) { - IFile[] files = getCandidateMakefiles(file.getProject()); - for (int i = 0; i < files.length; i++) { - if (files[i].getFullPath().equals(file.getFullPath())) { - return true; - } - } - return false; - } - - protected void checkMakefile(IFile file, IProgressMonitor monitor) { - IMakefileValidator validator = getMakefileValidator(file); - try { - removeAllMarkers(file); - } catch (CoreException e) { - //e.printStackTrace(); - } - validator.checkFile(file, monitor); - } - - protected IFile[] getCandidateMakefiles(IProject proj) { - // FIXME: Find the candidate in the store somewhere. - IFile defaultMakefile = proj.getFile(new Path("Makefile")); - if (defaultMakefile.exists()) { - return new IFile[] {defaultMakefile}; - } - return new IFile[0]; - } - - protected IMakefileValidator getMakefileValidator(IFile file) { - IMakefileValidator validator = (IMakefileValidator) validatorMap.get(file.getProject()); - if (validator == null) { - // FIXME: look int the preference store for a value. - validator = new GNUMakefileValidator(); - validator.setMarkerGenerator(this); - validatorMap.put(file.getProject(), validator); - } - return validator; - } - - private void removeAllMarkers(IFile file) throws CoreException { - IWorkspace workspace = file.getWorkspace(); - - // remove all markers - IMarker[] markers = file.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); - if (markers != null) { - workspace.deleteMarkers(markers); - } - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileUtil.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileUtil.java deleted file mode 100644 index 7651b7b32f1..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileUtil.java +++ /dev/null @@ -1,225 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Util; -import org.eclipse.cdt.make.internal.core.makefile.posix.PosixMakefileUtil; - -/** - * GNUMakefile - */ -public class GNUMakefileUtil extends PosixMakefileUtil { - - public static boolean isInclude(String line) { - line = line.trim(); - boolean isInclude = line.startsWith("include") && line.length() > 7 && Character.isWhitespace(line.charAt(7)); - boolean isDashInclude = line.startsWith("-include") && line.length() > 8 && Character.isWhitespace(line.charAt(8)); - boolean isSInclude = line.startsWith("sinclude") && line.length() > 8 && Character.isWhitespace(line.charAt(8)); - return isInclude || isDashInclude || isSInclude; - } - - public static boolean isVPath(String line) { - line = line.trim(); - return line.equals("vpath") || line.startsWith("vpath") && line.length() > 5 && Character.isWhitespace(line.charAt(5)); - } - - public static boolean isExport(String line) { - line = line.trim(); - return line.equals("export") || line.startsWith("export") && line.length() > 6 && Character.isWhitespace(line.charAt(6)); - } - - public static boolean isUnExport(String line) { - line = line.trim(); - return line.startsWith("unexport") && line.length() > 8 && Character.isWhitespace(line.charAt(8)); - } - - public static boolean isDefine(String line) { - line = line.trim(); - return line.startsWith("define") && line.length() > 6 && Character.isWhitespace(line.charAt(6)); - } - - public static boolean isEndef(String line) { - return line.trim().equals("endef"); - } - - public static boolean isOverride(String line) { - line = line.trim(); - return line.startsWith("override") && line.length() > 8 && Character.isWhitespace(line.charAt(8)); - } - - public static boolean isIfeq(String line) { - line = line.trim(); - return line.startsWith("ifeq") && line.length() > 4 && Character.isWhitespace(line.charAt(4)); - } - - public static boolean isIfneq(String line) { - line = line.trim(); - return line.startsWith("ifneq") && line.length() > 5 && Character.isWhitespace(line.charAt(5)); - } - - public static boolean isIfdef(String line) { - line = line.trim(); - return line.startsWith("ifdef") && line.length() > 5 && Character.isWhitespace(line.charAt(5)); - } - - public static boolean isIfndef(String line) { - line = line.trim(); - return line.startsWith("ifndef") && line.length() > 6 && Character.isWhitespace(line.charAt(6)); - } - - public static boolean isElse(String line) { - return line.trim().equals("else"); - } - - public static boolean isEndif(String line) { - return line.trim().equals("endif"); - } - - public static boolean isOverrideDefine(String line) { - line = line.trim(); - if (line.startsWith("override")) { - int i = 8; - for (; i < line.length() && Character.isWhitespace(line.charAt(i)); i++); - if (line.startsWith("define", i)) { - return true; - } - } - return false; - } - - public static boolean isTargetVariable(String line) { - line = line.trim(); - int index = Util.indexOf(line, ':'); - if (index > 1) { - line = line.substring(index + 1).trim(); - int equal = Util.indexOf(line, '='); - if (equal > 1) { - return true; - } - } - return false; - } - - public static boolean isVariableDefinition(String line) { - return isOverrideDefine(line) - || isTargetVariable(line) - || isDefine(line) - || isOverride(line) - || isExport(line) - || isMacroDefinition(line); - } - - /** - * @param line - * @return - */ - public static boolean isStaticTargetRule(String line) { - line = line.trim(); - int colon1 = Util.indexOf(line, ':'); - if (colon1 > 0) { - // move pass colon1 - line = line.substring(colon1 + 1); - int colon2 = Util.indexOf(line, ':'); - // Catch operator "::" not a static pattern rule - return (colon2 > 0); - } - return false; - } - - /** - * @param line - * @return - */ - public static boolean isGNUTargetRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - colon++; - // Catch VariableDefiniton with operator ":=" - if (colon < line.length()) { - return line.charAt(colon) != '='; - } - return true; - } - return false; - } - - public static boolean isPhonyRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".PHONY"); - } - return false; - } - - public static boolean isIntermediateRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".INTERMEDIATE"); - } - return false; - } - - public static boolean isSecondaryRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".SECONDARY"); - } - return false; - } - - public static boolean isDeleteOnErrorRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".DELETE_ON_ERROR"); - } - return false; - } - - public static boolean isLowResolutionTimeRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".LOW_RESOLUTION_TIME"); - } - return false; - } - - public static boolean isExportAllVariablesRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".EXPORT_ALL_VARIABLES"); - } - return false; - } - - public static boolean isNotParallelRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".NOTPARALLEL"); - } - return false; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java deleted file mode 100644 index 71f4c82aede..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUMakefileValidator.java +++ /dev/null @@ -1,216 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; - -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.cdt.make.core.makefile.*; -import org.eclipse.cdt.make.core.makefile.IBadDirective; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.ISpecialRule; -import org.eclipse.cdt.make.core.makefile.gnu.IConditional; -import org.eclipse.cdt.make.core.makefile.gnu.ITerminal; -import org.eclipse.cdt.make.core.makefile.gnu.IVariableDefinition; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -public class GNUMakefileValidator implements IMakefileValidator { - - IMarkerGenerator reporter; - - public GNUMakefileValidator() { - } - - public GNUMakefileValidator(IMarkerGenerator errorHandler) { - setMarkerGenerator(errorHandler); - } - - public void setMarkerGenerator(IMarkerGenerator errorHandler) { - reporter = errorHandler; - } - - public IMarkerGenerator getMarkerGenerator() { - if (reporter == null) { - reporter = new IMarkerGenerator() { - - public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) { - String name = "Makefile"; - if (file != null) { - name = file.getName(); - } - StringBuffer sb = new StringBuffer(name); - sb.append(':').append(lineNumber).append(':').append(getSeverity(severity)); - if (errorDesc != null) { - sb.append(':').append(errorDesc); - } - if (errorVar != null ) { - sb.append(':').append(errorVar); - } - sb.append('\n'); - System.out.println(sb.toString()); - } - - public String getSeverity(int severity) { - if (severity == IMarkerGenerator.SEVERITY_ERROR_BUILD) { - return "Error Build"; - } else if (severity == IMarkerGenerator.SEVERITY_ERROR_RESOURCE) { - return "Error resource"; - } else if (severity == IMarkerGenerator.SEVERITY_INFO) { - return "Warning info"; - } else if (severity == IMarkerGenerator.SEVERITY_WARNING) { - return "Warning"; - } - return "unknown"; - } - - }; - } - return reporter; - } - - public void checkFile(IFile file, IProgressMonitor monitor) { - String message = "Checking file : " + file.getFullPath().toString(); - monitor.subTask(message); - GNUMakefile gnu = new GNUMakefile(); - InputStream stream = null; - try { - stream = file.getContents(); - Reader source = new InputStreamReader(stream); - gnu.parse(source); - validateDirectives(file, gnu.getDirectives()); - } catch (CoreException e) { - } catch (IOException e) { - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - monitor.subTask("File checked"); - monitor.done(); - } - - public void validateDirectives(IResource res, IDirective[] directives) { - - IMarkerGenerator marker = getMarkerGenerator(); - int conditionCount = 0; - int defineCount = 0; - - IDirective directive = null; - for (int i = 0; i < directives.length; i++) { - directive = directives[i]; - if (directive instanceof IConditional) { - IConditional condition = (IConditional)directive; - validateCondition(condition); - if (!condition.isElse()) { - conditionCount++; - } else { - if (conditionCount == 0) { - // ERROR else missing conditon. - int startLine = condition.getStartLine(); - String msg = "else missing if condition"; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - String varName = condition.toString().trim(); - marker.addMarker(res, startLine, msg, severity, varName); - } - } - } else if (directive instanceof ITerminal) { - ITerminal terminal = (ITerminal)directive; - if (terminal.isEndif()) { - if (conditionCount == 0) { - // ERROR missing condition. - int startLine = terminal.getStartLine(); - String msg = "Endif missing if/else condition"; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - String varName = terminal.toString().trim(); - marker.addMarker(res, startLine, msg, severity, varName); - } else { - conditionCount--; - } - } else if (terminal.isEndef()) { - if (defineCount == 0) { - // ERROR missing define. - int startLine = terminal.getStartLine(); - String msg = "endef missing [override] define"; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - String varName = terminal.toString().trim(); - marker.addMarker(res, startLine, msg, severity, varName); - } else { - defineCount--; - } - } - } else if (directive instanceof IVariableDefinition) { - IVariableDefinition definition = (IVariableDefinition)directive; - if (definition.isMultiLine()) { - defineCount++; - } - } else if (directive instanceof IBadDirective) { - // ERROR unknow statement. - int startLine = directive.getStartLine(); - String msg = "unknow directive"; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - String varName = directive.toString().trim(); - marker.addMarker(res, startLine, msg, severity, varName); - } else if (directive instanceof ISpecialRule) { - validateSpecialRule((ISpecialRule)directive); - } - } - if (conditionCount > 0) { - // ERROR no matching endif for condition. - int startLine = 0; - String varName = ""; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - for (int i = directives.length - 1; i >= 0; i--) { - if (directives[i] instanceof IConditional) { - startLine = directives[i].getStartLine(); - varName = directives[i].toString().trim(); - break; - } - } - String msg = "No matching endif for condition"; - marker.addMarker(res, startLine, msg, severity, varName); - } - if (defineCount > 0) { - // ERROR no matching endef for define. - int startLine = 0; - String varName = ""; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - for (int i = directives.length - 1; i >= 0; i--) { - if (directives[i] instanceof IVariableDefinition) { - IVariableDefinition definition = (IVariableDefinition)directives[i]; - if (definition.isMultiLine()) { - startLine = definition.getStartLine(); - varName = definition.toString().trim(); - break; - } - } - } - String msg = "No matching endef for [override] define"; - marker.addMarker(res, startLine, msg, severity, varName); - } - } - - public void validateCondition(IConditional condition) { - // Check if the condition are good formats - } - - public void validateSpecialRule(ISpecialRule rule) { - // Check for special rules: .POSIX, .IGNORE etc ... - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUTargetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUTargetRule.java deleted file mode 100644 index 57221482b6d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/GNUTargetRule.java +++ /dev/null @@ -1,70 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ICommand; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.Target; -import org.eclipse.cdt.make.internal.core.makefile.TargetRule; - -/** - */ -public class GNUTargetRule extends TargetRule { - - String[] orderOnlyPrerequisites; - boolean doubleColon; - - public GNUTargetRule(Directive parent, Target target, boolean double_colon, String[] normal_prereqs, String[] order_prereqs, Command[] commands) { - super(parent, target, normal_prereqs, commands); - orderOnlyPrerequisites = order_prereqs; - doubleColon = double_colon; - } - - public boolean isDoubleColon() { - return doubleColon; - } - - public String[] getNormalPrerequisites() { - return getPrerequisites(); - } - - public String[] getOrderOnlyPrerequisites() { - return orderOnlyPrerequisites; - } - - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(getTarget().toString()); - buffer.append(':'); - String[] reqs = getNormalPrerequisites(); - for (int i = 0; i < reqs.length; i++) { - buffer.append(' ').append(reqs[i]); - } - reqs = getOrderOnlyPrerequisites(); - if (reqs.length > 0) { - buffer.append(" |"); - for (int i = 0; i < reqs.length; i++) { - buffer.append(' ').append(reqs[i]); - } - } - buffer.append('\n'); - ICommand[] cmds = getCommands(); - for (int i = 0; i < cmds.length; i++) { - buffer.append(cmds[i].toString()); - } - return buffer.toString(); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifdef.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifdef.java deleted file mode 100644 index b758e55e114..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifdef.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class Ifdef extends Conditional { - - public Ifdef(Directive parent, String var) { - super(parent, var, "", ""); - } - - public boolean isIfdef() { - return true; - } - - public String toString() { - StringBuffer sb = new StringBuffer("ifdef"); - sb.append(' ').append(getVariable()); - return sb.toString(); - } - - public String getVariable() { - return getConditional(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifeq.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifeq.java deleted file mode 100644 index 194fc7ca349..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifeq.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class Ifeq extends Conditional { - - public Ifeq(Directive parent, String cond) { - super(parent, cond); - } - - public boolean isIfeq() { - return true; - } - - public String toString() { - StringBuffer sb = new StringBuffer("ifeq"); - sb.append(' ').append(getConditional()); - return sb.toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifndef.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifndef.java deleted file mode 100644 index 5cf40a36d31..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifndef.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class Ifndef extends Conditional { - - public Ifndef(Directive parent, String var) { - super(parent, var, "", ""); - } - - public boolean isIfndef() { - return true; - } - - public String toString() { - StringBuffer sb = new StringBuffer("ifndef"); - sb.append(' ').append(getVariable()); - return sb.toString(); - } - - public String getVariable() { - return getConditional(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifneq.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifneq.java deleted file mode 100644 index 84c04183a0b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Ifneq.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class Ifneq extends Conditional { - - public Ifneq(Directive parent, String cond) { - super(parent, cond); - } - - public boolean isIfneq() { - return true; - } - - public String toString() { - StringBuffer sb = new StringBuffer("ifneq"); - sb.append(' ').append(getConditional()); - return sb.toString(); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java deleted file mode 100644 index 85dda93900c..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Include.java +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import java.io.IOException; - -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.gnu.IInclude; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.Parent; - -public class Include extends Parent implements IInclude { - - String[] filenames; - String[] dirs; - - public Include(Directive parent, String[] files, String[] directories) { - super(parent); - filenames = files; - dirs = directories; - } - - public String toString() { - StringBuffer sb = new StringBuffer("include"); - for (int i = 0; i < filenames.length; i++) { - sb.append(' ').append(filenames[i]); - } - return sb.toString(); - } - - public String[] getFilenames() { - return filenames; - } - - public IDirective[] getDirectives() { - GNUMakefile gnu = new GNUMakefile(); - clearDirectives(); - for (int i = 0; i < filenames.length; i++) { - // Try the current directory. - try { - gnu.parse(filenames[i]); - addDirectives(gnu.getStatements()); - continue; - } catch (IOException e) { - } - if (!filenames[i].startsWith(GNUMakefile.FILE_SEPARATOR) && dirs != null) { - for (int j = 0; j < dirs.length; j++) { - try { - String filename = dirs[j] + GNUMakefile.FILE_SEPARATOR + filenames[i]; - gnu.parse(filename); - addDirectives(gnu.getStatements()); - break; - } catch (IOException e) { - } - } - } - } - return super.getDirectives(); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/IntermediateRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/IntermediateRule.java deleted file mode 100644 index 9b632f73b2e..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/IntermediateRule.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IIntermediateRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .INTERMEDIATE - * The targets which `.INTERMEDIATE' depends on are treated as intermediate files. - * `.INTERMEDIATE' with no prerequisites has no effect. - */ -public class IntermediateRule extends SpecialRule implements IIntermediateRule { - - public IntermediateRule(Directive parent, String[] reqs) { - super(parent, new Target(".INTERMEDIATE"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/LowResolutionTimeRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/LowResolutionTimeRule.java deleted file mode 100644 index 9f7ad20c40a..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/LowResolutionTimeRule.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.ILowResolutionTimeRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .LOW_RESOLUTION_TIME' - * If you specify prerequisites for `.LOW_RESOLUTION_TIME', `make' - * assumes that these files are created by commands that generate low - * resolution time stamps. - */ -public class LowResolutionTimeRule extends SpecialRule implements ILowResolutionTimeRule { - - public LowResolutionTimeRule(Directive parent, String[] reqs) { - super(parent, new Target(".LOW_RESOLUTION_TIME"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/NotParallelRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/NotParallelRule.java deleted file mode 100644 index ac03352be6c..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/NotParallelRule.java +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.INotParallelRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .NOTPARALLEL - * If `.NOTPARALLEL' is mentioned as a target, then this invocation of - * `make' will be run serially, even if the `-j' option is given. - * Any recursively invoked `make' command will still be run in - * parallel (unless its makefile contains this target). Any - * prerequisites on this target are ignored. - */ -public class NotParallelRule extends SpecialRule implements INotParallelRule { - - public NotParallelRule(Directive parent, String[] reqs) { - super(parent, new Target(".NOTPARALLEL"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideDefine.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideDefine.java deleted file mode 100644 index 2b429e8bef4..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class OverrideDefine extends DefineVariable { - - public OverrideDefine(Directive parent, String name, StringBuffer value) { - super(parent, name, value); - } - - public String toString() { - StringBuffer sb = new StringBuffer("override define "); - sb.append(getName()).append('\n'); - sb.append(getValue()); - sb.append("endef"); - return sb.toString(); - } - - public boolean isOverride() { - return true; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideVariable.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideVariable.java deleted file mode 100644 index 4b981b2355b..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/OverrideVariable.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - - -public class OverrideVariable extends VariableDefinition { - - public OverrideVariable(Directive parent, String name, StringBuffer value, int type) { - super(parent, name, value, type); - } - - public boolean isOverride() { - return true; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/PhonyRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/PhonyRule.java deleted file mode 100644 index b9af5369072..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/PhonyRule.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IPhonyRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .PHONY - * The prerequisites of the special target `.PHONY' are considered to be phony targets. - * When it is time to consider such a target, `make' will run its commands unconditionally, regardless of - * whether a file with that name exists or what its last-modification time is. - */ -public class PhonyRule extends SpecialRule implements IPhonyRule { - - public PhonyRule(Directive parent, String[] reqs) { - super(parent, new Target(".PHONY"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/SecondaryRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/SecondaryRule.java deleted file mode 100644 index 9d7e455f786..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/SecondaryRule.java +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.ISecondaryRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - -/** - * .SECONDARY - * The targets which `.SECONDARY' depends on are treated as - * intermediate files, except that they are never automatically deleted. - * - * `.SECONDARY' with no prerequisites causes all targets to be treated - * as secondary (i.e., no target is removed because it is considered intermediate). - */ -public class SecondaryRule extends SpecialRule implements ISecondaryRule { - - public SecondaryRule(Directive parent, String[] reqs) { - super(parent, new Target(".SECONDARY"), reqs, new Command[0]); - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/StaticTargetRule.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/StaticTargetRule.java deleted file mode 100644 index 60b3b277cef..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/StaticTargetRule.java +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.ICommand; -import org.eclipse.cdt.make.core.makefile.IInferenceRule; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.InferenceRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; - - -/** - * Here is the syntax of a static pattern rule: - * - * TARGETS ...: TARGET-PATTERN: DEP-PATTERNS ... - * COMMANDS - * ... - */ -public class StaticTargetRule extends InferenceRule implements IInferenceRule { - - String targetPattern; - String[] prereqPatterns; - - public StaticTargetRule(Directive parent, Target target, String target_pattern, String[] prereq_patterns, Command[] commands) { - super(parent, target, commands); - targetPattern = target_pattern; - prereqPatterns = prereq_patterns; - } - - public String[] getPrerequisitePatterns() { - return prereqPatterns; - } - - public void setPrerequesitePatterns(String[] prereqs) { - prereqPatterns = prereqs; - } - - public String getTargetPattern() { - return targetPattern; - } - - public void setTargetPattern(String target_pattern) { - targetPattern = target_pattern; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(getTarget()).append(':'); - String pattern = getTargetPattern(); - if (pattern != null && pattern.length() > 0) { - buffer.append(' ').append(targetPattern); - } - buffer.append(':'); - for (int i = 0; i < prereqPatterns.length; i++) { - buffer.append(' ').append(prereqPatterns[i]); - } - buffer.append('\n'); - ICommand[] cmds = getCommands(); - for (int i = 0; i < cmds.length; i++) { - buffer.append(cmds[i].toString()); - } - return buffer.toString(); - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/TargetVariable.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/TargetVariable.java deleted file mode 100644 index c1ec49c5cfc..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/TargetVariable.java +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.internal.core.makefile.Directive; - -/** - * Here is the syntax of a static pattern rule: - * - * TARGETS ...: VARIABLE-ASSIGNMENT - * TARGETS ...: override VARIABLE-ASSIGNMENT - */ -public class TargetVariable extends VariableDefinition { - - boolean override; - - public TargetVariable(Directive parent, String target, String name, StringBuffer value, boolean override, int type) { - super(parent, target, name, value, type); - this.override = override; - } - - public boolean isOverride() { - return override; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java deleted file mode 100644 index f331ed904b2..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Terminal.java +++ /dev/null @@ -1,38 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.ITerminal; -import org.eclipse.cdt.make.internal.core.makefile.Directive; - -public class Terminal extends Directive implements ITerminal { - - public Terminal(Directive parent) { - super(parent); - } - - public boolean isEndif() { - return false; - } - - public boolean isEndef() { - return false; - } - - public String toString() { - if (isEndif()) { - return "endif\n"; - } else if (isEndef()){ - return "endef\n"; - } - return "\n"; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java deleted file mode 100644 index 708a4dc34f3..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/UnExport.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IUnExport; -import org.eclipse.cdt.make.internal.core.makefile.Directive; - -public class UnExport extends Directive implements IUnExport { - - String variable; - - public UnExport(Directive parent, String var) { - super(parent); - variable = var; - } - - public String toString() { - StringBuffer sb = new StringBuffer("unexport"); - sb.append(' ').append(variable); - return sb.toString(); - } - - public String getVariable() { - return variable; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java deleted file mode 100644 index 55be12c5913..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VPath.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IVPath; -import org.eclipse.cdt.make.internal.core.makefile.Directive; - -public class VPath extends Directive implements IVPath { - - String pattern; - String[] directories; - - public VPath(Directive parent, String pat, String[] dirs) { - super(parent); - pattern = pat; - directories = dirs; - } - - public String toString() { - StringBuffer sb = new StringBuffer("vpath"); - if (pattern != null && pattern.length() > 0) { - sb.append(' ').append(pattern); - } - for (int i = 0; i < directories.length; i++) { - sb.append(' ').append(directories[i]); - } - return sb.toString(); - } - - public String[] getDirectories() { - return directories; - } - - public String getPattern() { - return pattern; - } -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java deleted file mode 100644 index 214c5ef4005..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/VariableDefinition.java +++ /dev/null @@ -1,130 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.gnu; - -import org.eclipse.cdt.make.core.makefile.gnu.IVariableDefinition; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.MacroDefinition; - -/** - */ -public class VariableDefinition extends MacroDefinition implements IVariableDefinition { - - /** - * ? is Conditional - * : is Simply-expanded - * + is append - * 0 is recusively-expanded. - */ - final static int TYPE_RECURSIVE_EXPAND = 0; - final static int TYPE_SIMPLE_EXPAND = ':'; - final static int TYPE_CONDITIONAL = '?'; - final static int TYPE_APPEND = '+'; - int type; - String varTarget; - - public VariableDefinition(Directive parent, String name, StringBuffer value) { - this(parent, name, value, TYPE_RECURSIVE_EXPAND); - } - - public VariableDefinition(Directive parent, String name, StringBuffer value, int type) { - this(parent, "", name, value, type); - } - - public VariableDefinition(Directive parent, String target, String name, StringBuffer value, int type) { - super(parent, name, value); - varTarget = target; - this.type = type; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer sb = new StringBuffer(); - if (isTargetSpecific()) { - sb.append(getTarget()).append(": "); - } - if (isOverride()) { - sb.append("override "); - } - if (isMultiLine()) { - sb.append("define "); - sb.append(getName()).append('\n'); - sb.append(getValue()).append('\n'); - sb.append("endef\n"); - } else { - if (isExport()) { - sb.append("export "); - } - sb.append(getName()); - if (isRecursivelyExpanded()) { - sb.append(" = "); - } else if (isSimplyExpanded()) { - sb.append(" := "); - } else if (isConditional()) { - sb.append(" ?= "); - } else if (isAppend()) { - sb.append(" += "); - } - sb.append(getValue()).append('\n'); - } - return sb.toString(); - } - - public boolean isRecursivelyExpanded() { - return type == TYPE_RECURSIVE_EXPAND; - } - - public boolean isSimplyExpanded() { - return type == TYPE_SIMPLE_EXPAND; - } - - public boolean isConditional() { - return type == TYPE_CONDITIONAL; - } - - public boolean isAppend() { - return type == TYPE_APPEND; - } - - public boolean isTargetSpecific() { - String t = getTarget(); - return t != null && t.length() > 0; - } - - public boolean isExport() { - return false; - } - - public boolean isMultiLine() { - return false; - } - - /** - * Variable from an `override' directive. - */ - public boolean isOverride() { - return false; - } - - /** - * Automatic variable -- cannot be set. - */ - public boolean isAutomatic() { - return false; - } - - public String getTarget() { - return varTarget; - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java deleted file mode 100644 index 13e4abe3c13..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefile.java +++ /dev/null @@ -1,348 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.posix; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; - -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile; -import org.eclipse.cdt.make.internal.core.makefile.BadDirective; -import org.eclipse.cdt.make.internal.core.makefile.Command; -import org.eclipse.cdt.make.internal.core.makefile.Comment; -import org.eclipse.cdt.make.internal.core.makefile.DefaultRule; -import org.eclipse.cdt.make.internal.core.makefile.Directive; -import org.eclipse.cdt.make.internal.core.makefile.EmptyLine; -import org.eclipse.cdt.make.internal.core.makefile.IgnoreRule; -import org.eclipse.cdt.make.internal.core.makefile.InferenceRule; -import org.eclipse.cdt.make.internal.core.makefile.MacroDefinition; -import org.eclipse.cdt.make.internal.core.makefile.MakefileReader; -import org.eclipse.cdt.make.internal.core.makefile.PosixRule; -import org.eclipse.cdt.make.internal.core.makefile.PreciousRule; -import org.eclipse.cdt.make.internal.core.makefile.Rule; -import org.eclipse.cdt.make.internal.core.makefile.SccsGetRule; -import org.eclipse.cdt.make.internal.core.makefile.SilentRule; -import org.eclipse.cdt.make.internal.core.makefile.SpecialRule; -import org.eclipse.cdt.make.internal.core.makefile.SuffixesRule; -import org.eclipse.cdt.make.internal.core.makefile.Target; -import org.eclipse.cdt.make.internal.core.makefile.TargetRule; -import org.eclipse.cdt.make.internal.core.makefile.Util; -import org.eclipse.core.runtime.Path; - -/** - * Makefile : ( statement ) * - * statement : rule | macro_definition | comments | empty - * rule : inference_rule | target_rule | special_rule - * inference_rule : target ':' [ ';' command ] - [ ( command ) * ] - * target_rule : [ ( target ) + ] ':' [ ( prerequisite ) * ] [ ';' command ] - [ ( command ) * ] - * macro_definition : string '=' ( string )* - * comments : ('#' ( string ) ) * - * empty : - * command : prefix_command string - * target : string - * prefix_command : '-' | '@' | '+' - * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%" - */ - -public class PosixMakefile extends AbstractMakefile { - - IDirective[] builtins = null; - - public PosixMakefile() { - super(null); - } - - public void parse(String name) throws IOException { - FileReader stream = new FileReader(name); - parse(stream); - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - - public void parse(Reader reader) throws IOException { - parse(new MakefileReader(reader)); - } - - protected void parse(MakefileReader reader) throws IOException { - String line; - Rule[] rules = null; - int startLine = 0; - int endLine = 0; - while ((line = reader.readLine()) != null) { - startLine = endLine + 1; - endLine = reader.getLineNumber(); - - // 1- Try command first, since we can not strip '#' in command line - if (PosixMakefileUtil.isCommand(line)) { - Command cmd = new Command(this, line); - cmd.setLines(startLine, endLine); - // The command is added to the rules - if (rules != null) { - for (int i = 0; i < rules.length; i++) { - rules[i].addDirective(cmd); - rules[i].setEndLine(endLine); - } - continue; - } - // If we have no rules for the command, - // give the other directives a chance by falling through - } - - // 2- Strip away any comments. - int pound = Util.indexOfComment(line); - if (pound != -1) { - Comment cmt = new Comment(this, line.substring(pound + 1)); - cmt.setLines(startLine, endLine); - if (rules != null) { - for (int i = 0; i < rules.length; i++) { - rules[i].addDirective(cmt); - rules[i].setEndLine(endLine); - } - } else { - addDirective(cmt); - } - line = line.substring(0, pound); - // If all we have left are spaces continue - if (Util.isEmptyLine(line)) { - continue; - } - // The rest of the line maybe a valid directive. - // keep on trying by falling through. - } - - // 3- Empty lines ? - if (Util.isEmptyLine(line)) { - Directive empty = new EmptyLine(this); - empty.setLines(startLine, endLine); - if (rules != null) { - for (int i = 0; i < rules.length; i++) { - rules[i].addDirective(empty); - rules[i].setEndLine(endLine); - } - } else { - addDirective(empty); - } - continue; - } - - // 4- reset the rules to null - // The first non empty line that does not begin with a or '#' - // shall begin a new entry. - rules = null; - - // 5- Check for the special rules. - SpecialRule special = processSpecialRule(line); - if (special != null) { - rules = new Rule[] { special }; - special.setLines(startLine, endLine); - addDirective(special); - continue; - } - - // 6- Check for inference rule. - if (PosixMakefileUtil.isInferenceRule(line)) { - InferenceRule irule = parseInferenceRule(line); - irule.setLines(startLine, endLine); - addDirective(irule); - rules = new Rule[]{irule}; - continue; - } - - // 7- Macro Definiton ? - if (PosixMakefileUtil.isMacroDefinition(line)) { - Directive stmt = parseMacroDefinition(line); - stmt.setLines(startLine, endLine); - addDirective(stmt); - continue; - } - - // 8- Target Rule ? - if (PosixMakefileUtil.isTargetRule(line)) { - TargetRule[] trules = parseTargetRule(line); - for (int i = 0; i < trules.length; i++) { - trules[i].setLines(startLine, endLine); - addDirective(trules[i]); - } - rules = trules; - continue; - } - - // XXX ?? Should not be here. - BadDirective stmt = new BadDirective(this, line); - stmt.setLines(startLine, endLine); - addDirective(stmt); - } - setLines(1, endLine); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile#getBuiltins() - */ - public IDirective[] getBuiltins() { - if (builtins == null) { - String location = "builtin" + File.separator + "posix.mk"; - try { - InputStream stream = MakeCorePlugin.getDefault().openStream(new Path(location)); - PosixMakefile gnu = new PosixMakefile(); - gnu.parse(new InputStreamReader(stream)); - builtins = gnu.getDirectives(); - for (int i = 0; i < builtins.length; i++) { - if (builtins[i] instanceof MacroDefinition) { - ((MacroDefinition)builtins[i]).setFromDefault(true); - } - } - } catch (Exception e) { - //e.printStackTrace(); - } - if (builtins == null) { - builtins = new IDirective[0]; - } - } - return builtins; - } - - /** - * @param line - * @return - */ - protected SpecialRule processSpecialRule(String line) { - line = line.trim(); - String keyword = null; - String[] reqs = null; - SpecialRule special = null; - int index = Util.indexOf(line, ':'); - if (index != -1) { - keyword = line.substring(0, index).trim(); - String req = line.substring(index + 1); - reqs = PosixMakefileUtil.findPrerequisites(req); - } else { - keyword = line; - reqs = new String[0]; - } - if (".IGNORE".equals(keyword)) { - special = new IgnoreRule(this, reqs); - } else if (".POSIX".equals(keyword)) { - special = new PosixRule(this); - } else if (".PRECIOUS".equals(keyword)) { - special = new PreciousRule(this, reqs); - } else if (".SILENT".equals(keyword)) { - special = new SilentRule(this, reqs); - } else if (".SUFFIXES".equals(keyword)) { - special = new SuffixesRule(this, reqs); - } else if (".DEFAULT".equals(keyword)) { - special = new DefaultRule(this, new Command[0]); - } else if (".SCCS_GET".equals(keyword)) { - special = new SccsGetRule(this, new Command[0]); - } - return special; - } - - /** - * Inference Rule - */ - protected InferenceRule parseInferenceRule(String line) { - String tgt; - int index = Util.indexOf(line, ':'); - if (index != -1) { - tgt = line.substring(0, index); - } else { - tgt = line; - } - return new InferenceRule(this, new Target(tgt)); - } - - /** - * MacroDefinition - */ - protected MacroDefinition parseMacroDefinition(String line) { - String name; - String value; - int index = Util.indexOf(line, '='); - if (index != -1) { - name = line.substring(0, index).trim(); - value = line.substring(index + 1).trim(); - } else { - name = line; - value = ""; - } - return new MacroDefinition(this, name, new StringBuffer(value)); - } - - /** - * TargetRule - */ - protected TargetRule[] parseTargetRule(String line) { - String[] targets; - String[] reqs; - String cmd = null; - int index = Util.indexOf(line, ':'); - if (index != -1) { - String target = line.substring(0, index); - // Tokenize the targets - targets = PosixMakefileUtil.findTargets(target); - - String req = line.substring(index + 1); - int semicolon = Util.indexOf(req, ';'); - if (semicolon != -1) { - String c = req.substring(semicolon + 1).trim(); - if (c.length() > 0) { - cmd = c; - } - req = req.substring(0, semicolon); - } - reqs = PosixMakefileUtil.findPrerequisites(req); - } else { - targets = PosixMakefileUtil.findTargets(line); - reqs = new String[0]; - } - - TargetRule[] targetRules = new TargetRule[targets.length]; - for (int i = 0; i < targets.length; i++) { - targetRules[i] = new TargetRule(this, new Target(targets[i]), reqs); - if (cmd != null) { - Command command = new Command(this, cmd); - targetRules[i].addDirective(command); - } - } - return targetRules; - } - - public static void main(String[] args) { - try { - String filename = "Makefile"; - if (args.length == 1) { - filename = args[0]; - } - PosixMakefile makefile = new PosixMakefile(); - makefile.parse(filename); - IDirective[] directives = makefile.getDirectives(); - //IDirective[] directives = makefile.getBuiltins(); - for (int i = 0; i < directives.length; i++) { - //System.out.println("Rule[" + i +"]"); - System.out.print(directives[i]); - } - } catch (IOException e) { - System.out.println(e); - } - } - -} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java deleted file mode 100644 index f1539eaad4d..00000000000 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/posix/PosixMakefileUtil.java +++ /dev/null @@ -1,160 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.core.makefile.posix; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.make.internal.core.makefile.Util; - -/** - */ -public class PosixMakefileUtil { - - public static String[] findPrerequisites(String line) { - return findTargets(line); - } - - public static String[] findTargets(String line) { - List aList = new ArrayList(); - int space; - // Trim away trailing and prepending spaces. - line = line.trim(); - while ((space = Util.indexOf(line, " \t")) != -1) { - aList.add(line.substring(0, space).trim()); - line = line.substring(space + 1).trim(); - } - // The last target. - if (line.length() > 0) { - aList.add(line); - } - return (String[]) aList.toArray(new String[0]); - } - - public static boolean isMacroDefinition(String line) { - return Util.indexOf(line, '=') != -1; - } - - public static boolean isTargetRule(String line) { - return Util.indexOf(line, ':') != -1; - } - - public static boolean isCommand(String line) { - return line.length() > 1 && line.charAt(0) == '\t'; - } - - public static boolean isEmptyLine(String line) { - return line.trim().length() == 0; - } - - public static boolean isInferenceRule(String line) { - line = line.trim(); - if (line.startsWith(".")) { - int index = Util.indexOf(line, ':'); - if (index > 1) { - line = line.substring(index + 1).trim(); - if (line.length() == 0 || line.equals(";")) { - return true; - } - } - } - return false; - } - - public static boolean isDefaultRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".DEFAULT"); - } - return false; - } - - public static boolean isIgnoreRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".IGNORE"); - } - return false; - } - - public static boolean isPosixRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".POSIX"); - } - return false; - } - - public static boolean isPreciousRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".PRECIOUS"); - } - return false; - } - - public static boolean isSccsGetRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".SCCS_GET"); - } - return false; - } - - public static boolean isSilentRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".SILENT"); - } - return false; - } - - public static boolean isSuffixesRule(String line) { - line = line.trim(); - int colon = Util.indexOf(line, ':'); - if (colon > 0) { - line = line.substring(0, colon).trim(); - return line.equals(".SUFFIXES"); - } - return false; - } - - public static boolean isLibraryTarget(String line) { - char prev = 0; - int paren = 0; - - for (int i = 0; i < line.length(); i++) { - char ch = line.charAt(i); - if (ch == '(' && prev != '$' && prev != '\\') { - paren++; - } else if (ch == ')' && prev != '\\') { - if (paren > 0) { - return true; - } - } - prev = ch; - } - return false; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/.classpath b/build/org.eclipse.cdt.make.ui/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/build/org.eclipse.cdt.make.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/build/org.eclipse.cdt.make.ui/.cvsignore b/build/org.eclipse.cdt.make.ui/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/build/org.eclipse.cdt.make.ui/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/build/org.eclipse.cdt.make.ui/.project b/build/org.eclipse.cdt.make.ui/.project deleted file mode 100644 index 1b1d4a96461..00000000000 --- a/build/org.eclipse.cdt.make.ui/.project +++ /dev/null @@ -1,31 +0,0 @@ - - - org.eclipse.cdt.make.ui - - - org.eclipse.cdt.core - org.eclipse.cdt.make.core - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/build/org.eclipse.cdt.make.ui/about.html b/build/org.eclipse.cdt.make.ui/about.html deleted file mode 100644 index 8c828de2ada..00000000000 --- a/build/org.eclipse.cdt.make.ui/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

10th July, 2002

-

License

-

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

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.ui/build.properties b/build/org.eclipse.cdt.make.ui/build.properties deleted file mode 100644 index e1ced3c43d8..00000000000 --- a/build/org.eclipse.cdt.make.ui/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -bin.includes = plugin.xml,\ - *.jar,\ - cdtmakeui.jar,\ - icons/,\ - *.html,\ - plugin.properties -source.cdtmakeui.jar = src/ diff --git a/build/org.eclipse.cdt.make.ui/icons/actions/build_menu.gif b/build/org.eclipse.cdt.make.ui/icons/actions/build_menu.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/actions/build_menu.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/alphab_sort_co.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/alphab_sort_co.gif deleted file mode 100644 index 6d772441d0d..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/alphab_sort_co.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/convert-normal.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/convert-normal.gif deleted file mode 100644 index 80c3f8cbc5c..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/convert-normal.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/make.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/make.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/make.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/makefile.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/makefile.gif deleted file mode 100644 index 20e7baed143..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/makefile.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/newc_app.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/newc_app.gif deleted file mode 100644 index 6c2d75db2e6..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/newc_app.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/newcc_app.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/newcc_app.gif deleted file mode 100644 index 86d78df150f..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/newcc_app.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/segment_edit.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/segment_edit.gif deleted file mode 100644 index be9eb921513..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/segment_edit.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_add.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/target_add.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_add.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_build.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/target_build.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_build.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_delete.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/target_delete.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_delete.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_edit.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/target_edit.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/target_edit.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/ctool16/update_old.gif b/build/org.eclipse.cdt.make.ui/icons/ctool16/update_old.gif deleted file mode 100644 index 9d5a508bc49..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/ctool16/update_old.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/cview16/make_target.gif b/build/org.eclipse.cdt.make.ui/icons/cview16/make_target.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/cview16/make_target.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/dtool16/alphab_sort_co.gif b/build/org.eclipse.cdt.make.ui/icons/dtool16/alphab_sort_co.gif deleted file mode 100644 index 62a8fdb555b..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/dtool16/alphab_sort_co.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/dtool16/segment_edit.gif b/build/org.eclipse.cdt.make.ui/icons/dtool16/segment_edit.gif deleted file mode 100644 index 6844777924f..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/dtool16/segment_edit.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_add.gif b/build/org.eclipse.cdt.make.ui/icons/dtool16/target_add.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_add.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_build.gif b/build/org.eclipse.cdt.make.ui/icons/dtool16/target_build.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_build.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_delete.gif b/build/org.eclipse.cdt.make.ui/icons/dtool16/target_delete.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_delete.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_edit.gif b/build/org.eclipse.cdt.make.ui/icons/dtool16/target_edit.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/dtool16/target_edit.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/alphab_sort_co.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/alphab_sort_co.gif deleted file mode 100644 index 9d38f6dff8a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/etool16/alphab_sort_co.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/segment_edit.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/segment_edit.gif deleted file mode 100644 index e292fe5ef18..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/etool16/segment_edit.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/target_add.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/target_add.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/etool16/target_add.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/target_build.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/target_build.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/etool16/target_build.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/target_delete.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/target_delete.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/etool16/target_delete.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/target_edit.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/target_edit.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/etool16/target_edit.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/command_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/command_obj.gif deleted file mode 100644 index f13e465665b..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/command_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/error_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/error_obj.gif deleted file mode 100644 index b04020bc723..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/error_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/include_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/include_obj.gif deleted file mode 100644 index 0c5f2085409..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/include_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/irule_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/irule_obj.gif deleted file mode 100644 index a9a08d038fd..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/irule_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/macro_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/macro_obj.gif deleted file mode 100644 index c12970d2b48..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/macro_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/relation_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/relation_obj.gif deleted file mode 100644 index 11b6f337fb8..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/relation_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/target_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/target_obj.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/target_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/obj16/trule_obj.gif b/build/org.eclipse.cdt.make.ui/icons/obj16/trule_obj.gif deleted file mode 100644 index 64c522da372..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/obj16/trule_obj.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/icons/wizban/newcprj_wiz.gif b/build/org.eclipse.cdt.make.ui/icons/wizban/newcprj_wiz.gif deleted file mode 100644 index 60ccf9c7c6a..00000000000 Binary files a/build/org.eclipse.cdt.make.ui/icons/wizban/newcprj_wiz.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.make.ui/plugin.properties b/build/org.eclipse.cdt.make.ui/plugin.properties deleted file mode 100644 index edfa9a4e7e0..00000000000 --- a/build/org.eclipse.cdt.make.ui/plugin.properties +++ /dev/null @@ -1,48 +0,0 @@ -pluginName=C/C++ Standard make Build UI -providerName=Eclipse.org - -WizardNewCMakeProject.name=Standard Make C Project -WizardNewCMakeProject.description=Create a new C Project which uses a simple makefile. - -WizardNewCCMakeProject.name=Standard Make C++ Project -WizardNewCCMakeProject.description=Create a new C++ Project which uses a simple makefile. - -WizardConvertMakeProject.name=Convert to a C/C++ Make Project -WizardConvertMakeProject.description=Convert to a C/C++ Project which uses a simple makefile - -ActionMakeCreateTarget.label=Create Make Target... -ActionMakeBuildTarget.label=Build Make Target... - -ActionMakeUpdate.label=Update Old Make Project... -ActionMakeUpdate.tooltip=Update Old Make Project - -CommandTargetBuild.name=Make Target Build -CommandTargetBuild.description=Invoke a make target build for the selected container. -CommandTargetCreate.name=Create Make Target -CommandTargetCreate.description=Create a new make build target for the selected container. - -PreferenceMakeProject.name=New Make Projects - -PropertyMakeProject.name= C/C++ Make Project - -ViewCatagoryMake.name=Make -ViewMake.name=Make Targets - -ActionSetMake.label=Make Actions -ActionSetUpdateMake.label=Update Make Projects - -# Scope and Key Commands -scope.makefileEditor.name=Makefile Editor -makefileEditor.description=Editor for Makefile Files - -category.source.name=Makefile Source -category.source.description= Makefile Source Actions - -ActionDefinition.comment.name= Comment -ActionDefinition.comment.description= Turn the selected lines into # style comments - -ActionDefinition.uncomment.name= Uncomment -ActionDefinition.uncomment.description= Uncomment the selected # style comment lines - -MakefileEditor.name=Makefile Editor - diff --git a/build/org.eclipse.cdt.make.ui/plugin.xml b/build/org.eclipse.cdt.make.ui/plugin.xml deleted file mode 100644 index 7bed92a07d9..00000000000 --- a/build/org.eclipse.cdt.make.ui/plugin.xml +++ /dev/null @@ -1,402 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - %WizardNewCMakeProject.description - - - - - %WizardConvertMakeProject.description - - - - - - - - %WizardNewCCMakeProject.description - - - - - %WizardConvertMakeProject.description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/ErrorParserBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/ErrorParserBlock.java deleted file mode 100644 index 02b39076d60..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/ErrorParserBlock.java +++ /dev/null @@ -1,48 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Move to Make plugin -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui; - -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.MakeBuilder; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.ui.dialogs.AbstractErrorParserBlock; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Preferences; - -public class ErrorParserBlock extends AbstractErrorParserBlock { - - public ErrorParserBlock(Preferences prefs) { - super(prefs); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ErrorParserBlock#getErrorParserIDs(org.eclipse.core.resources.IProject) - */ - protected String[] getErrorParserIDs(IProject project) { - IMakeBuilderInfo info; - try { - info = MakeCorePlugin.createBuildInfo(project, MakeBuilder.BUILDER_ID); - } catch (CoreException e) { - return new String[0]; - } - return info.getErrorParsers(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ErrorParserBlock#saveErrorParsers(org.eclipse.core.resources.IProject, java.lang.String[]) - */ - public void saveErrorParsers(IProject project, String[] parserIDs) throws CoreException { - IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(project, MakeBuilder.BUILDER_ID); - info.setErrorParsers(parserIDs); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeProjectOptionBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeProjectOptionBlock.java deleted file mode 100644 index 9f28412db7b..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeProjectOptionBlock.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Created on 5-Aug-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui; - -import org.eclipse.cdt.make.core.MakeBuilder; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.ui.dialogs.BuildPathInfoBlock; -import org.eclipse.cdt.make.ui.dialogs.SettingsBlock; -import org.eclipse.cdt.ui.dialogs.BinaryParserBlock; -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock; - -public class MakeProjectOptionBlock extends TabFolderOptionBlock { - - public MakeProjectOptionBlock(ICOptionContainer parent) { - super(parent); - } - - protected void addTabs() { - addTab(new SettingsBlock(MakeCorePlugin.getDefault().getPluginPreferences(), MakeBuilder.BUILDER_ID)); - addTab(new ErrorParserBlock(MakeCorePlugin.getDefault().getPluginPreferences())); - addTab(new BinaryParserBlock(MakeCorePlugin.getDefault().getPluginPreferences())); - addTab(new BuildPathInfoBlock()); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties deleted file mode 100644 index 012d7a24d54..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties +++ /dev/null @@ -1,104 +0,0 @@ - -MakeCWizard.title=C/Make Project -MakeCWizard.description=Create a New C Project using 'make' to build it -MakeCWizard.task_name=Creating C project with Make builder... - -MakeCCWizard.title=C++/Make Project -MakeCCWizard.description=Create a New C++ Project using 'make' to build it -MakeCCWizard.task_name=Creating C++ project with Make builder... - -MakeCWizardSettings.title=C/Make Project Settings -MakeCWizardSettings.description=Define the project and 'make' builder settings - -MakeCCWizardSettings.title=C++/Make Project Settings -MakeCCWizardSettings.description=Define the project and 'make' builder settings - -WizardMakeProjectConversion.title=Convert to C/C++ Make project -WizardMakeProjectConversion.description=Convert a prject to a C/C++ project which uses 'make' to build it. - -MakeWizardUpdate.window_title=Make Project Migration -MakeWizardUpdatePage.title=Make Project Migration -MakeWizardUpdatePage.description=Migrate older make projects to new make builder. - -WizardCheckboxTablePart.WizardCheckboxTablePart.selectAll=Select All -WizardCheckboxTablePart.WizardCheckboxTablePart.deselectAll=Deselect All -WizardCheckboxTablePart.WizardCheckboxTablePart.counter={0} of {1} Selected - -SettingsBlock.label=Make Builder -SettingsBlock.message=Make builder settings. -SettingsBlock.makeSetting.group_label=Build Setting -SettingsBlock.makeSetting.stopOnError=Stop on first build error. -SettingsBlock.makeCmd.group_label=Build command -SettingsBlock.makeCmd.use_default=Use default -SettingsBlock.makeCmd.label=Build command: -SettingsBlock.makeDir.group_label=Build Directory -SettingsBlock.makeDir.label=Build directory: -SettingsBlock.makeDir.browse=Browse... -SettingsBlock.makeWorkbench.group_label=Workbench Build Behavior -SettingsBlock.makeWorkbench.type=Workbench build type: -SettingsBlock.makeWorkbench.target=Make build target: -SettingsBlock.makeWorkbench.auto=Build on resource save (Auto Build) -SettingsBlock.makeWorkbench.incremental=Build (Incremental Build) -SettingsBlock.makeWorkbench.full=Rebuild (Full Build) - -TargetBlock.target.group_label=Target -TargetBlock.target.label=Target Name: - -BuildTarget.target.group_label=Build Target -BuildTarget.target.label=Build Target: - - -# String constants for the build include path and preprocessor symbols -BuildPathInfoBlock.label=Paths and Symbols -BuildPathInfoBlock.paths=Include paths: -BuildPathInfoBlock.symbols=Defined symbols: -BuildPathInfoBlock.browse.path=New Include Path -BuildPathInfoBlock.browse.path.edit=Edit Include Path -BuildPathInfoBlock.browse.path.label=Path: -BuildPathInfoBlock.browse.symbol=New Defined Symbol -BuildPathInfoBlock.browse.symbol.edit=Edit Defined Symbol -BuildPathInfoBlock.browse.symbol.label=Symbol: - -BuildPropertyCommon.label.title=Enter Value -BuildPropertyCommon.label.new=New... -BuildPropertyCommon.label.edit=Edit... -BuildPropertyCommon.label.remove=Remove -BuildPropertyCommon.label.up=Move Up -BuildPropertyCommon.label.down=Move Down -BuildPropertyCommon.label.editVar=Edit -BuildPropertyCommon.label.addVar=Add -BuildPropertyCommon.label.message=Value: -BuildPropertyCommon.label.browse=Browse... -BuildPropertyCommon.label.configs=Defined configurations: - -# Makefile Editor messages -ContentAssistProposal.label=Content Assist@Ctrl+SPACE -ContentAssistProposal.tooltip=Content Assist -ContentAssistProposal.image= -ContentAssistProposal.description=Content Assist - -ContentAssistTip.label=Content Tip@Ctrl+SHIFT+SPACE -ContentAssistTip.tooltip=Content Tip -ContentAssistTip.image= -ContentAssistTip.description=Content Tip - -TogglePresentation.label=Change Presentation -TogglePresentation.tooltip=Enable/Disable Segmented Source Viewer -TogglePresentation.description=Enable/Disable Segmented Source Viewer - -Comment.label=&Comment -Comment.tooltip=Comment the Selected Lines -Comment.description=Turn the selected lines into # style comments - -Uncomment.label=Uncommen&t -Uncomment.tooltip=Uncomment the Selected # comment Lines -Uncomment.description=Uncomment the selected # comment lines - -# ------- LexicalSortingAction------------ - -LexicalSortingAction.label=Sort -LexicalSortingAction.description=Sorts the elements in the outliner -LexicalSortingAction.tooltip=Sort -LexicalSortingAction.tooltip.on=Do Not Sort -LexicalSortingAction.tooltip.off=Sort - diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java deleted file mode 100644 index d80f68560ea..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Created on 19-Aug-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; - -public class MakeUIImages { - - /** - * Bundle of all images used by the Make plugin. - */ - // The plugin registry - private static ImageRegistry imageRegistry = new ImageRegistry(); - - // Subdirectory (under the package containing this class) where 16 color images are - private static URL fgIconBaseURL; - static { - try { - fgIconBaseURL = new URL(MakeUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/"); //$NON-NLS-1$ - } catch (MalformedURLException e) { - MakeUIPlugin.log(e); - } - } - private static final String NAME_PREFIX = MakeUIPlugin.getUniqueIdentifier() + '.'; - private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length(); - - public static final String OBJ = "obj16/"; //$NON-NLS-1$ - public static final String T_TOOL= "tool16/"; //$NON-NLS-1$ - - // For the build image - public static final String IMG_OBJS_BUILD_TARGET = NAME_PREFIX + "target_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_BUILD_TARGET = createManaged(OBJ, IMG_OBJS_BUILD_TARGET); - - public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif"; - public static final ImageDescriptor DESC_OBJ_ERROR = createManaged(OBJ, IMG_OBJS_ERROR); - - - // For the outliner label provider. - public static final String IMG_TOOLS_MAKE_TARGET_BUILD = NAME_PREFIX + "target_build.gif"; //$NON-NLS-1$ - public static final String IMG_TOOLS_MAKE_TARGET_ADD = NAME_PREFIX + "target_add.gif"; //$NON-NLS-1$ - public static final String IMG_TOOLS_MAKE_TARGET_DELETE = NAME_PREFIX + "target_delete.gif"; //$NON-NLS-1$ - public static final String IMG_TOOLS_MAKE_TARGET_EDIT = NAME_PREFIX + "target_edit.gif"; //$NON-NLS-1$ - - public static final String IMG_OBJS_MAKEFILE_MACRO = NAME_PREFIX + "macro_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_MAKEFILE_MACRO = createManaged(OBJ, IMG_OBJS_MAKEFILE_MACRO); - - public static final String IMG_OBJS_MAKEFILE_TARGET_RULE = NAME_PREFIX + "trule_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_MAKEFILE_TARGET_RULE = createManaged(OBJ, IMG_OBJS_MAKEFILE_TARGET_RULE); - - public static final String IMG_OBJS_MAKEFILE_INFERENCE_RULE = NAME_PREFIX + "irule_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_MAKEFILE_INFERENCE_RULE = createManaged(OBJ, IMG_OBJS_MAKEFILE_INFERENCE_RULE); - - public static final String IMG_OBJS_MAKEFILE_RELATION = NAME_PREFIX + "relation_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_MAKEFILE_RELATION = createManaged(OBJ, IMG_OBJS_MAKEFILE_RELATION); - - public static final String IMG_OBJS_MAKEFILE_COMMAND = NAME_PREFIX + "command_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_MAKEFILE_COMMAND = createManaged(OBJ, IMG_OBJS_MAKEFILE_COMMAND); - - public static final String IMG_OBJS_MAKEFILE_INCLUDE = NAME_PREFIX + "include_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_MAKEFILE_INCLUDE = createManaged(OBJ, IMG_OBJS_MAKEFILE_INCLUDE); - - public static final String IMG_TOOLS_ALPHA_SORTING= NAME_PREFIX + "alphab_sort_co.gif"; - - public static final String IMG_TOOLS_MAKEFILE_SEGMENT_EDIT= NAME_PREFIX + "segment_edit.gif"; - - private static ImageDescriptor createManaged(String prefix, String name) { - return createManaged(imageRegistry, prefix, name); - } - - private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) { - ImageDescriptor result = ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH))); - registry.put(name, result); - return result; - } - - public static Image getImage(String key) { - return imageRegistry.get(key); - } - - private static ImageDescriptor create(String prefix, String name) { - return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); - } - - private static URL makeIconFileURL(String prefix, String name) { - StringBuffer buffer = new StringBuffer(prefix); - buffer.append(name); - try { - return new URL(fgIconBaseURL, buffer.toString()); - } catch (MalformedURLException e) { - MakeUIPlugin.log(e); - return null; - } - } - - /** - * Sets all available image descriptors for the given action. - */ - public static void setImageDescriptors(IAction action, String type, String relPath) { - relPath = relPath.substring(NAME_PREFIX_LENGTH); - action.setDisabledImageDescriptor(create("d" + type + "/", relPath)); //$NON-NLS-1$ - action.setHoverImageDescriptor(create("c" + type + "/", relPath)); //$NON-NLS-1$ - action.setImageDescriptor(create("e" + type + "/", relPath)); //$NON-NLS-1$ - } - - /** - * Helper method to access the image registry from the JavaPlugin class. - */ - static ImageRegistry getImageRegistry() { - return imageRegistry; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java deleted file mode 100644 index 6e418f422fa..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIPlugin.java +++ /dev/null @@ -1,271 +0,0 @@ -package org.eclipse.cdt.make.internal.ui; - -import java.lang.reflect.InvocationTargetException; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.cdt.make.internal.ui.editor.IMakefileDocumentProvider; -import org.eclipse.cdt.make.internal.ui.editor.MakefileDocumentProvider; -import org.eclipse.cdt.make.internal.ui.editor.WorkingCopyManager; -import org.eclipse.cdt.make.ui.IWorkingCopyManager; -import org.eclipse.cdt.make.ui.actions.UpdateMakeProjectAction; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IStartup; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * The main plugin class to be used in the desktop. - */ -public class MakeUIPlugin extends AbstractUIPlugin implements IStartup { - //The shared instance. - private static MakeUIPlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - private IWorkingCopyManager fWorkingCopyManager; - private IMakefileDocumentProvider fMakefileDocumentProvider; - - /** - * The constructor. - */ - public MakeUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - try { - resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.make.internal.ui.MakeResources"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - /** - * Returns the shared instance. - */ - public static MakeUIPlugin getDefault() { - return plugin; - } - - /** - * Returns the Uniqu idenetifier for this plugin. - */ - public static String getPluginId() { - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - /** - * Returns the workspace instance. - */ - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - public static Shell getActiveWorkbenchShell() { - IWorkbenchWindow window = getActiveWorkbenchWindow(); - if (window != null) { - return window.getShell(); - } - return null; - } - - /** - * Returns the active workbench window or null if none - */ - public static IWorkbenchWindow getActiveWorkbenchWindow() { - return getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - /** - * Returns the active workbench page or null if none. - */ - public static IWorkbenchPage getActivePage() { - IWorkbenchWindow window= getActiveWorkbenchWindow(); - if (window != null) { - return window.getActivePage(); - } - return null; - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = MakeUIPlugin.getDefault().getResourceBundle(); - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - return resourceBundle; - } - - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.make.ui"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - public static void log(IStatus status) { - ResourcesPlugin.getPlugin().getLog().log(status); - } - - public static void logErrorMessage(String message) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null)); - } - - public static void logException(Throwable e, final String title, String message) { - if (e instanceof InvocationTargetException) { - e = ((InvocationTargetException) e).getTargetException(); - } - IStatus status = null; - if (e instanceof CoreException) - status = ((CoreException) e).getStatus(); - else { - if (message == null) - message = e.getMessage(); - if (message == null) - message = e.toString(); - status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, message, e); - } - ResourcesPlugin.getPlugin().getLog().log(status); - Display display; - display = Display.getCurrent(); - if (display == null) - display = Display.getDefault(); - final IStatus fstatus = status; - display.asyncExec(new Runnable() { - public void run() { - ErrorDialog.openError(null, title, null, fstatus); - } - }); - } - - public static void logException(Throwable e) { - logException(e, null, null); - } - - public static void log(Throwable e) { - if (e instanceof InvocationTargetException) - e = ((InvocationTargetException) e).getTargetException(); - IStatus status = null; - if (e instanceof CoreException) - status = ((CoreException) e).getStatus(); - else - status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, e.getMessage(), e); - log(status); - } - - /** - * Utility method with conventions - */ - public static void errorDialog(Shell shell, String title, String message, IStatus s) { - log(s); - // if the 'message' resource string and the IStatus' message are the same, - // don't show both in the dialog - if (s != null && message.equals(s.getMessage())) { - message = null; - } - ErrorDialog.openError(shell, title, message, s); - } - - /** - * Utility method with conventions - */ - public static void errorDialog(Shell shell, String title, String message, Throwable t) { - log(t); - IStatus status; - if (t instanceof CoreException) { - status = ((CoreException) t).getStatus(); - // if the 'message' resource string and the IStatus' message are the same, - // don't show both in the dialog - if (status != null && message.equals(status.getMessage())) { - message = null; - } - } else { - status = new Status(IStatus.ERROR, MakeUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$ - } - ErrorDialog.openError(shell, title, message, status); - } - - public void earlyStartup() { - final IProject[] oldProject = UpdateMakeProjectAction.getOldProjects(); - if (oldProject.length > 0) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - if (MessageDialog - .openQuestion( - getShell(), - "Update make projects", - "Older 'make' projects have been detected in your workspace. \n" - + "These projects are no longer supported, " - + "would you like to convert these now?") - == true) { - ProgressMonitorDialog pd = new ProgressMonitorDialog(getShell()); - UpdateMakeProjectAction.run(false, pd, oldProject); - } - } - }); - } - return; - - } - - protected Shell getShell() { - if (getActiveWorkbenchShell() != null) { - return getActiveWorkbenchShell(); - } else { - IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows(); - return windows[0].getShell(); - } - } - - public synchronized IMakefileDocumentProvider getMakefileDocumentProvider() { - if (fMakefileDocumentProvider == null) { - fMakefileDocumentProvider= new MakefileDocumentProvider(); - } - return fMakefileDocumentProvider; - } - - public synchronized IWorkingCopyManager getWorkingCopyManager() { - if (fWorkingCopyManager == null) { - IMakefileDocumentProvider provider= getMakefileDocumentProvider(); - fWorkingCopyManager= new WorkingCopyManager(provider); - } - return fWorkingCopyManager; - } - - public void shutdown() throws CoreException { - super.shutdown(); - if (fWorkingCopyManager != null) { - fWorkingCopyManager.shutdown(); - fWorkingCopyManager= null; - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MessageLine.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MessageLine.java deleted file mode 100644 index f839a812cc1..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MessageLine.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.eclipse.cdt.make.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.resource.JFaceColors; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Composite; - -/** - * A message line. It distinguishs between "normal" messages and errors. - * Setting an error message hides a currently displayed message until - * clearErrorMessage is called. - */ -public class MessageLine extends CLabel { - - private String fMessage; - - private Color fNormalMsgAreaBackground; - - /** - * Creates a new message line as a child of the given parent. - */ - public MessageLine(Composite parent) { - this(parent, SWT.LEFT); - } - - /** - * Creates a new message line as a child of the parent and with the given SWT stylebits. - */ - public MessageLine(Composite parent, int style) { - super(parent, style); - fNormalMsgAreaBackground= getBackground(); - } - - - /** - * Display the given error message. A currently displayed message - * is saved and will be redisplayed when the error message is cleared. - */ - public void setErrorMessage(String message) { - if (message != null && message.length() > 0) { - setText(message); - setImage(MakeUIImages.getImage(MakeUIImages.IMG_OBJS_ERROR)); - setBackground(JFaceColors.getErrorBackground(getDisplay())); - return; - } - setText(fMessage); - setImage(null); - setBackground(fNormalMsgAreaBackground); - } - - public void setMessage(String message) { - fMessage = message; - setText(message); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java deleted file mode 100644 index 5e748ab7859..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java +++ /dev/null @@ -1,136 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetManager; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.makefile.ITargetRule; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IFileEditorInput; - -/** - */ -public class AddBuildTargetAction extends Action { - - MakefileContentOutlinePage fOutliner; - static final ITargetRule[] EMPTY_TARGET_RULES = {}; - - public AddBuildTargetAction(MakefileContentOutlinePage outliner) { - super("Add To Build Target"); - setDescription("Add To Build Target"); - setToolTipText("Add To Build Target"); - fOutliner = outliner; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - IMakeTargetManager manager = MakeCorePlugin.getDefault().getTargetManager(); - IFile file = getFile(); - Shell shell = fOutliner.getControl().getShell(); - ITargetRule[] rules = getTargetRules(fOutliner.getSelection()); - if (file != null && rules.length > 0 && shell != null) { - StringBuffer sbBuildName = new StringBuffer(); - StringBuffer sbMakefileTarget = new StringBuffer(); - for (int i = 0; i < rules.length; i++) { - String name = rules[i].getTarget().toString().trim(); - if (sbBuildName.length() == 0) { - sbBuildName.append(name); - } else { - sbBuildName.append('_').append(name); - } - if (sbMakefileTarget.length() == 0) { - sbMakefileTarget.append(name); - } else { - sbMakefileTarget.append(' ').append(name); - } - } - String buildName = sbBuildName.toString(); - String makefileTarget = sbMakefileTarget.toString(); - IMakeTarget target = manager.findTarget(file.getParent(), buildName); - if (target == null) { - try { - String[] ids = manager.getTargetBuilders(file.getProject()); - if (ids.length > 0) { - target = manager.createTarget(file.getProject(), buildName, ids[0]); - target.setBuildTarget(makefileTarget); - manager.addTarget(file.getParent(), target); - } - } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); - target = null; - } - } - - // Always popup the dialog. - if (target != null) { - MakeTargetDialog dialog; - try { - dialog = new MakeTargetDialog(shell, target); - dialog.open(); - } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); - } - } - } - } - - public boolean canActionBeAdded(ISelection selection) { - ITargetRule[] rules = getTargetRules(selection); - for (int i = 0; i < rules.length; i++) { - IFile file = getFile(); - if (file == null) - return false; - if (! MakeCorePlugin.getDefault().getTargetManager().hasTargetBuilder(file.getProject())) - return false; - } - return true; - } - - - private IFile getFile() { - Object input = fOutliner.getInput(); - if (input instanceof IFileEditorInput) { - return ((IFileEditorInput)input).getFile(); - } - return null; - } - - private ITargetRule[] getTargetRules(ISelection sel) { - if (!sel.isEmpty() && sel instanceof IStructuredSelection) { - List list= ((IStructuredSelection)sel).toList(); - if (list.size() > 0) { - List targets = new ArrayList(list.size()); - Object[] elements = list.toArray(); - for (int i = 0; i < elements.length; i++) { - if (elements[i] instanceof ITargetRule) { - targets.add(elements[i]); - } - } - return (ITargetRule[])targets.toArray(EMPTY_TARGET_RULES); - } - } - return EMPTY_TARGET_RULES; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileDocumentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileDocumentProvider.java deleted file mode 100644 index baeea749cab..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileDocumentProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - */ -package org.eclipse.cdt.make.internal.ui.editor; - -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.ui.texteditor.IDocumentProvider; - -/** - */ -public interface IMakefileDocumentProvider extends IDocumentProvider { - - /** - * Shuts down this provider. - */ - void shutdown(); - - /** - * Returns the working copy for the given element. - * - * @param element the element - * @return the working copy for the given element - */ - IMakefile getWorkingCopy(Object element); - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java deleted file mode 100644 index 86d9c12ecf4..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.make.internal.ui.editor; - -import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; - -/** - */ -public interface IMakefileEditorActionDefinitionIds extends ITextEditorActionDefinitionIds { - - String UNCOMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.comment"; - - String COMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.uncomment"; - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java deleted file mode 100644 index 8a726e49010..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java +++ /dev/null @@ -1,81 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - initial implementation -***********************************************************************/ - -package org.eclipse.cdt.make.internal.ui.editor; - -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.IInferenceRule; -import org.eclipse.cdt.make.core.makefile.IMacroDefinition; -import org.eclipse.cdt.make.core.makefile.ISpecialRule; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.ViewerSorter; - -public class LexicalSortingAction extends Action { - - private static final String ACTION_NAME = "LexicalSortingAction"; - private static final String DIALOG_STORE_KEY = ACTION_NAME + ".sort"; - - private LexicalMakefileSorter fSorter; - private TreeViewer fTreeViewer; - - public LexicalSortingAction(TreeViewer treeViewer) { - super(MakeUIPlugin.getResourceString(ACTION_NAME + ".label")); - - setDescription(MakeUIPlugin.getResourceString(ACTION_NAME + ".description")); - setToolTipText(MakeUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); - MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_ALPHA_SORTING); - - fTreeViewer = treeViewer; - fSorter = new LexicalMakefileSorter(); - boolean checked = MakeUIPlugin.getDefault().getDialogSettings().getBoolean(DIALOG_STORE_KEY); - valueChanged(checked, false); - } - - public void run() { - valueChanged(isChecked(), true); - } - - private void valueChanged(boolean on, boolean store) { - setChecked(on); - fTreeViewer.setSorter(on ? fSorter : null); - - String key = ACTION_NAME + ".tooltip" + (on ? ".on" : ".off"); - setToolTipText(MakeUIPlugin.getResourceString(key)); - if (store) { - MakeUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on); - } - } - - private class LexicalMakefileSorter extends ViewerSorter { - - public boolean isSorterProperty(Object element, Object property) { - return true; - } - - public int category(Object obj) { - if (obj instanceof IDirective) { - IDirective directive = (IDirective) obj; - if (directive instanceof IMacroDefinition) { - return 0; - } else if (directive instanceof ISpecialRule) { - return 1; - } else if (directive instanceof IInferenceRule) { - return 2; - } - } - return 3; - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java deleted file mode 100644 index c534d670eea..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java +++ /dev/null @@ -1,314 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.make.core.makefile.IBadDirective; -import org.eclipse.cdt.make.core.makefile.ICommand; -import org.eclipse.cdt.make.core.makefile.IComment; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.IEmptyLine; -import org.eclipse.cdt.make.core.makefile.IInferenceRule; -import org.eclipse.cdt.make.core.makefile.IMacroDefinition; -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.core.makefile.IParent; -import org.eclipse.cdt.make.core.makefile.IRule; -import org.eclipse.cdt.make.core.makefile.ITargetRule; -import org.eclipse.cdt.make.core.makefile.gnu.IInclude; -import org.eclipse.cdt.make.core.makefile.gnu.ITerminal; -import org.eclipse.cdt.make.internal.core.makefile.NullMakefile; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.IWorkingCopyManager; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.part.IPageSite; -import org.eclipse.ui.views.contentoutline.ContentOutlinePage; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; - -/** - * MakefileContentOutlinePage - */ -public class MakefileContentOutlinePage extends ContentOutlinePage implements IContentOutlinePage { - - private class MakefileContentProvider implements ITreeContentProvider { - - protected boolean showMacroDefinition = true; - protected boolean showTargetRule = true; - protected boolean showInferenceRule = true; - protected boolean showIncludeChildren = false; - - protected IMakefile makefile; - protected IMakefile nullMakefile = new NullMakefile(); - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) - */ - public Object[] getChildren(Object element) { - if (element == fInput) { - return getElements(makefile); - } else if (element instanceof IDirective) { - return getElements(element); - } - return new Object[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) - */ - public Object getParent(Object element) { - if (element instanceof IMakefile) { - return fInput; - } else if (element instanceof IDirective) { - return ((IDirective)element).getParent(); - } - return fInput; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) - */ - public boolean hasChildren(Object element) { - if (element == fInput) { - return true; - } else if (element instanceof IParent) { - // Do not drill down in includes. - if (element instanceof IInclude && !showIncludeChildren) { - return false; - } - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) - */ - public Object[] getElements(Object inputElement) { - IDirective[] directives; - if (inputElement == fInput) { - directives = makefile.getDirectives(); - } else if (inputElement instanceof IRule) { - directives = ((IRule)inputElement).getCommands(); - } else if (inputElement instanceof IParent) { - if (inputElement instanceof IInclude && !showIncludeChildren) { - directives = new IDirective[0]; - } else { - directives = ((IParent)inputElement).getDirectives(); - } - } else { - directives = new IDirective[0]; - } - List list = new ArrayList(directives.length); - for (int i = 0; i < directives.length; i++) { - if (showMacroDefinition && directives[i] instanceof IMacroDefinition) { - list.add(directives[i]); - } else if (showInferenceRule && directives[i] instanceof IInferenceRule) { - list.add(directives[i]); - } else if (showTargetRule && directives[i] instanceof ITargetRule) { - list.add(directives[i]); - } else { - boolean irrelevant = (directives[i] instanceof IComment || - directives[i] instanceof IEmptyLine || - directives[i] instanceof ITerminal); - if (!irrelevant) { - list.add(directives[i]); - } - } - } - return list.toArray(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - if (oldInput != null) { - makefile = nullMakefile; - } - - if (newInput != null) { - IWorkingCopyManager manager= MakeUIPlugin.getDefault().getWorkingCopyManager(); - makefile = manager.getWorkingCopy((IEditorInput)newInput); - if (makefile == null) { - makefile = nullMakefile; - } - } - } - - } - - private class MakefileLabelProvider extends LabelProvider implements ILabelProvider { - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) - */ - public Image getImage(Object element) { - if (element instanceof ITargetRule) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_TARGET_RULE); - } else if (element instanceof IInferenceRule) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_INFERENCE_RULE); - } else if (element instanceof IMacroDefinition) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_MACRO); - } else if (element instanceof ICommand) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_COMMAND); - } else if (element instanceof IInclude) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_INCLUDE); - } else if (element instanceof IBadDirective) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_ERROR); - } else if (element instanceof IParent) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_RELATION); - } - return super.getImage(element); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) - */ - public String getText(Object element) { - String name; - if (element instanceof IRule) { - name = ((IRule) element).getTarget().toString().trim(); - } else if (element instanceof IMacroDefinition) { - name = ((IMacroDefinition) element).getName().trim(); - } else { - name = super.getText(element); - } - if (name != null) { - name = name.trim(); - if (name.length() > 25) { - name = name.substring(0, 25) + " ..."; //$NON-NLS-1$ - } - } - return name; - } - - } - - protected MakefileEditor fEditor; - protected Object fInput; - protected AddBuildTargetAction fAddBuildTargetAction; - - public MakefileContentOutlinePage(MakefileEditor editor) { - super(); - fEditor = editor; - fAddBuildTargetAction = new AddBuildTargetAction(this); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - TreeViewer viewer = getTreeViewer(); - viewer.setContentProvider(new MakefileContentProvider()); - viewer.setLabelProvider(new MakefileLabelProvider()); - if (fInput != null) { - viewer.setInput(fInput); - } - - MenuManager manager= new MenuManager("#MakefileOutlinerContext"); - manager.setRemoveAllWhenShown(true); - manager.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager m) { - contextMenuAboutToShow(m); - } - }); - Control tree = viewer.getControl(); - Menu menu = manager.createContextMenu(tree); - tree.setMenu(menu); - - IPageSite site= getSite(); - site.registerContextMenu(MakeUIPlugin.getPluginId() + ".outline", manager, viewer); //$NON-NLS-1$ - site.setSelectionProvider(viewer); - - } - - /** - * called to create the context menu of the outline - */ - protected void contextMenuAboutToShow(IMenuManager menu) { - if (fAddBuildTargetAction.canActionBeAdded(getSelection())) - menu.add(fAddBuildTargetAction); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));//$NON-NLS-1$ - } - - /** - * Sets the input of the outline page - */ - public void setInput(Object input) { - fInput = input; - update(); - } - - public Object getInput() { - return fInput; - } - - /** - * Updates the outline page. - */ - public void update() { - final TreeViewer viewer = getTreeViewer(); - - if (viewer != null) { - final Control control = viewer.getControl(); - if (control != null && !control.isDisposed()) { - control.getDisplay().asyncExec(new Runnable() { - public void run() { - if (!control.isDisposed()) { - control.setRedraw(false); - viewer.setInput(fInput); - viewer.expandAll(); - control.setRedraw(true); - } - } - }); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars) - */ - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - IToolBarManager toolBarManager= actionBars.getToolBarManager(); - - LexicalSortingAction action= new LexicalSortingAction(getTreeViewer()); - toolBarManager.add(action); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java deleted file mode 100644 index e347f025e27..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java +++ /dev/null @@ -1,176 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import java.io.IOException; -import java.io.StringReader; -import java.util.Iterator; - -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.rules.DefaultPartitioner; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.editors.text.FileDocumentProvider; - -/** - */ -public class MakefileDocumentProvider extends FileDocumentProvider implements IMakefileDocumentProvider { - - private static MakefilePartitionScanner scanner = null; - - /** - * Bundle of all required informations to allow working copy management. - */ - protected class MakefileInfo extends FileInfo { - - IMakefile fCopy; - - public MakefileInfo(IDocument document, IAnnotationModel model, FileSynchronizer fileSynchronizer, IMakefile copy) { - super(document, model, fileSynchronizer); - fCopy = copy; - } - - public void setModificationStamp(long timeStamp) { - fModificationStamp = timeStamp; - } - } - - /** - * Constructor for MakefileDocumentProvider. - */ - public MakefileDocumentProvider() { - super(); - } - - /** - * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createDocument(Object) - */ - protected IDocument createDocument(Object element) throws CoreException { - IDocument document = super.createDocument(element); - if (document != null) { - IDocumentPartitioner partitioner = createPartitioner(); - partitioner.connect(document); - document.setDocumentPartitioner(partitioner); - } - return document; - } - - private IDocumentPartitioner createPartitioner() { - return new DefaultPartitioner(getPartitionScanner(), MakefilePartitionScanner.TYPES); - } - - private MakefilePartitionScanner getPartitionScanner() { - if (scanner == null) - scanner = new MakefilePartitionScanner(); - return scanner; - } - - /* - * @see AbstractDocumentProvider#createElementInfo(Object) - */ - protected ElementInfo createElementInfo(Object element) throws CoreException { - if (element instanceof IFileEditorInput) { - - IFileEditorInput input = (IFileEditorInput) element; - IMakefile makefile = createMakefile(input.getFile()); - if (makefile == null) { - return super.createElementInfo(element); - } - try { - refreshFile(input.getFile()); - } catch (CoreException x) { - handleCoreException(x, "FileDocumentProvider.createElementInfo"); - } - - IDocument d = null; - IStatus s = null; - - try { - d = createDocument(element); - } catch (CoreException x) { - s = x.getStatus(); - d = createEmptyDocument(); - } - - IAnnotationModel m = createAnnotationModel(element); - FileSynchronizer f = new FileSynchronizer(input); - f.install(); - - FileInfo info = new MakefileInfo(d, m, f, makefile); - info.fModificationStamp = computeModificationStamp(input.getFile()); - info.fStatus = s; - info.fEncoding = getPersistedEncoding(input); - - return info; - } - - return super.createElementInfo(element); - } - - /** - * @param file - * @return - */ - private IMakefile createMakefile(IFile file) { - return MakeCorePlugin.getDefault().createMakefile(file); - } - - /* - * @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument, boolean) - */ - protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException { - - // Update the makefile directives tree; - ElementInfo elementInfo= getElementInfo(element); - if (elementInfo instanceof MakefileInfo) { - MakefileInfo info= (MakefileInfo) elementInfo; - String content = document.get(); - StringReader reader = new StringReader(content); - try { - info.fCopy.parse(reader); - } catch (IOException e) { - } - } - super.doSaveDocument(monitor, element, document, overwrite); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.internal.ui.editor.IMakefileDocumentProvider#shutdown() - */ - public void shutdown() { - Iterator e = getConnectedElements(); - while (e.hasNext()) { - disconnect(e.next()); - } - } - - /* - * @see org.eclipse.cdt.make.internal.ui.editor.ICompilationUnitDocumentProvider#getWorkingCopy(java.lang.Object) - */ - public IMakefile getWorkingCopy(Object element) { - - ElementInfo elementInfo = getElementInfo(element); - if (elementInfo instanceof MakefileInfo) { - MakefileInfo info = (MakefileInfo) elementInfo; - return info.fCopy; - } - return null; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java deleted file mode 100644 index c5915916210..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java +++ /dev/null @@ -1,205 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import java.util.ResourceBundle; - -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.internal.ui.text.MakefileColorManager; -import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileWordDetector; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.ui.IPartService; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.editors.text.TextEditor; -import org.eclipse.ui.texteditor.DefaultRangeIndicator; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; -import org.eclipse.ui.texteditor.TextOperationAction; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; - -public class MakefileEditor extends TextEditor implements ISelectionChangedListener{ - - /** - * The page that shows the outline. - */ - protected MakefileContentOutlinePage page; - private IMakefile makefile; - - public MakefileContentOutlinePage getOutlinePage() { - if (page == null) { - page = new MakefileContentOutlinePage(this); - page.addSelectionChangedListener(this); - page.setInput(getEditorInput()); - } - return page; - } - - public MakefileEditor() { - super(); - } - - /** - * @see AbstractTextEditor#init(IEditorSite, IEditorInput) - */ - protected void initializeEditor() { - - setSourceViewerConfiguration(new MakefileSourceConfiguration(new MakefileColorManager(), this)); - setRangeIndicator(new DefaultRangeIndicator()); - setEditorContextMenuId("#MakefileEditorContext"); //$NON-NLS-1$ - setRulerContextMenuId("#MakefileRulerContext"); //$NON-NLS-1$ - setDocumentProvider(MakeUIPlugin.getDefault().getMakefileDocumentProvider()); - setPreferenceStore(MakeUIPlugin.getDefault().getPreferenceStore()); - } - - /* (non-Javadoc) - * Method declared on IAdaptable - */ - public Object getAdapter(Class key) { - if (key.equals(IContentOutlinePage.class)) { - return getOutlinePage(); - } - return super.getAdapter(key); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor) - */ - public void doSave(IProgressMonitor monitor) { - super.doSave(monitor); - makefile = null; - if (page != null) { - page.update(); - } - } - - /** - * Method to install the editor actions. - * - * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions() - */ - protected void createActions() { - super.createActions(); - - ResourceBundle bundle = MakeUIPlugin.getDefault().getResourceBundle(); - - IAction a = new TextOperationAction(bundle, "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); //$NON-NLS-1$ - a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - setAction("ContentAssistProposal", a); //$NON-NLS-1$ - - a = new TextOperationAction(bundle, "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION); //$NON-NLS-1$ - a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION); - setAction("ContentAssistTip", a); //$NON-NLS-1$ - - a = new TextOperationAction(bundle, "Comment.", this, ITextOperationTarget.PREFIX); //$NON-NLS-1$ - a.setActionDefinitionId(IMakefileEditorActionDefinitionIds.COMMENT); - setAction("Comment", a); //$NON-NLS-1$ - markAsStateDependentAction("Comment", true); //$NON-NLS-1$ - - a = new TextOperationAction(bundle, "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); //$NON-NLS-1$ - a.setActionDefinitionId(IMakefileEditorActionDefinitionIds.UNCOMMENT); - setAction("Uncomment", a); //$NON-NLS-1$ - markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$ - - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) - */ - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = event.getSelection(); - if (selection.isEmpty()) { - resetHighlightRange(); - } else if (selection instanceof IStructuredSelection){ - if (!isActivePart() && MakeUIPlugin.getActivePage() != null) { - MakeUIPlugin.getActivePage().bringToTop(this); - } - Object element = ((IStructuredSelection) selection).getFirstElement(); - if (element instanceof IDirective) { - IDirective statement = (IDirective)element; - setSelection(statement, !isActivePart()); - } - } - } - - /** - * Returns whether the editor is active. - */ - private boolean isActivePart() { - IWorkbenchWindow window= getSite().getWorkbenchWindow(); - IPartService service= window.getPartService(); - IWorkbenchPart part= service.getActivePart(); - return part != null && part.equals(this); - } - - private void setSelection(IDirective directive, boolean moveCursor) { - int startLine = directive.getStartLine() - 1; - int endLine = directive.getEndLine() - 1; - try { - IDocument doc = getDocumentProvider().getDocument(getEditorInput()); - int start = doc.getLineOffset(startLine); - int len = doc.getLineLength(endLine) - 1; - int length = (doc.getLineOffset(endLine) + len) - start; - setHighlightRange(start, length, true); - if (moveCursor) { - // Let see if we can move the cursor at the position also - String var = directive.toString().trim(); - IWordDetector detector = new MakefileWordDetector(); - for (len = 0; len < var.length(); len++) { - char c = var.charAt(len); - //if (! (Character.isLetterOrDigit(c) || c == '.' || c == '_')) { - if (!(detector.isWordPart(c) || detector.isWordStart(c) || c == '-' || c == '_')) { - break; - } - } - if (len > 0) { - var = var.substring(0, len); - } - len = doc.search(start, var, true, true, true); - length = var.length(); - if (len > -1 && length > 0) { - getSourceViewer().revealRange(len, length); - // Selected region begins one index after offset - getSourceViewer().setSelectedRange(len, length); - } - - } - } catch (IllegalArgumentException x) { - resetHighlightRange(); - } catch (BadLocationException e) { - resetHighlightRange(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager) - */ - protected void editorContextMenuAboutToShow(IMenuManager menu) { - super.editorContextMenuAboutToShow(menu); - addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); //$NON-NLS-1$ - addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Uncomment"); //$NON-NLS-1$ - - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java deleted file mode 100644 index b3344ab36bd..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorActionContributor.java +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; -import org.eclipse.ui.texteditor.RetargetTextEditorAction; - -/** - */ -public class MakefileEditorActionContributor extends BasicTextEditorActionContributor { - - private MakefileEditorTogglePresentationAction fTogglePresentation; - protected RetargetTextEditorAction fContentAssistProposal; - protected RetargetTextEditorAction fContentAssistTip; - - /** - * Constructor for MakefileEditorActionContributor. - */ - public MakefileEditorActionContributor() { - super(); - fContentAssistProposal = new RetargetTextEditorAction(MakeUIPlugin.getDefault().getResourceBundle(), "ContentAssistProposal."); //$NON-NLS-1$ - fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - fContentAssistTip = new RetargetTextEditorAction(MakeUIPlugin.getDefault().getResourceBundle(), "ContentAssistTip."); //$NON-NLS-1$ - fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION); - fTogglePresentation = new MakefileEditorTogglePresentationAction(); - } - - /** - * @see org.eclipse.ui.IEditorActionBarContributor#setActiveEditor(IEditorPart) - */ - public void setActiveEditor(IEditorPart targetEditor) { - super.setActiveEditor(targetEditor); - doSetActiveEditor(targetEditor); - } - - private void doSetActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - - ITextEditor editor = null; - if (part instanceof ITextEditor) { - editor = (ITextEditor) part; - } - - fContentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); //$NON-NLS-1$ - fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$ - - fTogglePresentation.setEditor(editor); - fTogglePresentation.update(); - } - - /* - * @see IEditorActionBarContributor#dispose() - */ - public void dispose() { - doSetActiveEditor(null); - super.dispose(); - } - - /** - * @see org.eclipse.ui.part.EditorActionBarContributor#init(IActionBars) - */ - public void init(IActionBars bars) { - super.init(bars); - IMenuManager menuManager = bars.getMenuManager(); - IMenuManager editMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); - if (editMenu != null) { - editMenu.add(new Separator()); - editMenu.add(fContentAssistProposal); - editMenu.add(fContentAssistTip); - } - - IToolBarManager toolBarManager = bars.getToolBarManager(); - if (toolBarManager != null) { - toolBarManager.add(new Separator()); - toolBarManager.add(fTogglePresentation); - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorTogglePresentationAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorTogglePresentationAction.java deleted file mode 100644 index 1d1137e1481..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditorTogglePresentationAction.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.TextEditorAction; - -/** - */ -public class MakefileEditorTogglePresentationAction extends TextEditorAction { - - /** - * Constructor for MakefileEditorTogglePresentationAction. - */ - public MakefileEditorTogglePresentationAction() { - super(MakeUIPlugin.getDefault().getResourceBundle(), "MakefileEditorTogglePresentation.", null); //$NON-NLS-1$ - MakeUIImages.setImageDescriptors(this, MakeUIImages.T_TOOL, MakeUIImages.IMG_TOOLS_MAKEFILE_SEGMENT_EDIT); - update(); - } - - /** - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - ITextEditor editor= getTextEditor(); - editor.resetHighlightRange(); - boolean show = editor.showsHighlightRangeOnly(); - setChecked(!show); - editor.showHighlightRangeOnly(!show); - } - - /** - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() { - setChecked(getTextEditor() != null && getTextEditor().showsHighlightRangeOnly()); - setEnabled(true); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java deleted file mode 100644 index 12b71800480..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java +++ /dev/null @@ -1,165 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.editor; - -import org.eclipse.cdt.make.internal.ui.text.IMakefileColorManager; -import org.eclipse.cdt.make.internal.ui.text.MakefileColorManager; -import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileCodeScanner; -import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileCompletionProcessor; -import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner; -import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileReconcilingStrategy; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.TextAttribute; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.jface.text.contentassist.IContentAssistant; -import org.eclipse.jface.text.presentation.IPresentationReconciler; -import org.eclipse.jface.text.presentation.PresentationReconciler; -import org.eclipse.jface.text.reconciler.IReconciler; -import org.eclipse.jface.text.reconciler.MonoReconciler; -import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; -import org.eclipse.jface.text.rules.DefaultDamagerRepairer; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.SourceViewerConfiguration; -import org.eclipse.swt.graphics.RGB; - -public class MakefileSourceConfiguration extends SourceViewerConfiguration { - - private IMakefileColorManager colorManager; - private MakefileCodeScanner codeScanner; - private MakefileEditor fEditor; - - /** - * Single token scanner. - */ - static class SingleTokenScanner extends BufferedRuleBasedScanner { - public SingleTokenScanner(TextAttribute attribute) { - setDefaultReturnToken(new Token(attribute)); - } - } - - /** - * Constructor for MakeConfiguration - */ - public MakefileSourceConfiguration(IMakefileColorManager colorManager, MakefileEditor editor) { - super(); - fEditor = editor; - this.colorManager = colorManager; - } - - /** - * @see SourceViewerConfiguration#getConfiguredContentTypes(ISourceViewer) - */ - public String[] getConfiguredContentTypes(ISourceViewer v) { - return new String[] { - IDocument.DEFAULT_CONTENT_TYPE, - MakefilePartitionScanner.MAKEFILE_COMMENT, - MakefilePartitionScanner.MAKEFILE_IF_BLOCK, - MakefilePartitionScanner.MAKEFILE_DEF_BLOCK, - MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK, - MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT, - }; - - } - - /** - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(ISourceViewer) - */ - public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { - ContentAssistant assistant = new ContentAssistant(); - assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), IDocument.DEFAULT_CONTENT_TYPE); - assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_COMMENT); - assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_DEF_BLOCK); - assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_IF_BLOCK); - assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK); - assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT); - - assistant.enableAutoActivation(true); - assistant.setAutoActivationDelay(500); - - assistant.setProposalPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW); - assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW); - //Set to Carolina blue - assistant.setContextInformationPopupBackground(getColorManager().getColor(new RGB(0, 191, 255))); - - return assistant; - } - - protected IMakefileColorManager getColorManager() { - if (null == colorManager) - colorManager = new MakefileColorManager(); - return colorManager; - } - - protected MakefileCodeScanner getCodeScanner() { - if (null == codeScanner) - codeScanner = new MakefileCodeScanner(getColorManager()); - return codeScanner; - - } - - public IPresentationReconciler getPresentationReconciler(ISourceViewer v) { - - PresentationReconciler reconciler = new PresentationReconciler(); - - DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_COMMENT); - reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_COMMENT); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT); - reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK); - reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_IF_BLOCK); - reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_IF_BLOCK); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_DEF_BLOCK); - reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_DEF_BLOCK); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_OTHER); - reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_OTHER); - return reconciler; - } - - /** - * @see SourceViewerConfiguration#getReconciler(ISourceViewer) - */ - public IReconciler getReconciler(ISourceViewer sourceViewer) { - if (fEditor != null && fEditor.isEditable()) { - MonoReconciler reconciler= new MonoReconciler(new MakefileReconcilingStrategy(fEditor), false); - reconciler.setDelay(1000); - reconciler.setProgressMonitor(new NullProgressMonitor()); - return reconciler; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer, java.lang.String) - */ - public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { - return new String[]{"#"}; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java deleted file mode 100644 index 201bc65ade3..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/WorkingCopyManager.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.make.internal.ui.editor; - - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.ui.IWorkingCopyManager; -import org.eclipse.cdt.make.ui.IWorkingCopyManagerExtension; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.Assert; -import org.eclipse.ui.IEditorInput; - - -/** - * This working copy manager works together with a given compilation unit document provider and - * additionally offers to "overwrite" the working copy provided by this document provider. - */ -public class WorkingCopyManager implements IWorkingCopyManager, IWorkingCopyManagerExtension { - - private IMakefileDocumentProvider fDocumentProvider; - private Map fMap; - private boolean fIsShuttingDown; - - /** - * Creates a new working copy manager that co-operates with the given - * compilation unit document provider. - * - * @param provider the provider - */ - public WorkingCopyManager(IMakefileDocumentProvider provider) { - Assert.isNotNull(provider); - fDocumentProvider= provider; - } - - /* - * @see org.eclipse.cdt.make.ui.IWorkingCopyManager#connect(org.eclipse.ui.IEditorInput) - */ - public void connect(IEditorInput input) throws CoreException { - fDocumentProvider.connect(input); - } - - /* - * @see org.eclipse.cdt.make.ui.IWorkingCopyManager#disconnect(org.eclipse.ui.IEditorInput) - */ - public void disconnect(IEditorInput input) { - fDocumentProvider.disconnect(input); - } - - /* - * @see org.eclipse.cdt.make.ui.IWorkingCopyManager#shutdown() - */ - public void shutdown() { - if (!fIsShuttingDown) { - fIsShuttingDown= true; - try { - if (fMap != null) { - fMap.clear(); - fMap= null; - } - fDocumentProvider.shutdown(); - } finally { - fIsShuttingDown= false; - } - } - } - - /* - * @see org.eclipse.cdt.make.ui.IWorkingCopyManager#getWorkingCopy(org.eclipse.ui.IEditorInput) - */ - public IMakefile getWorkingCopy(IEditorInput input) { - IMakefile unit= fMap == null ? null : (IMakefile) fMap.get(input); - return unit != null ? unit : fDocumentProvider.getWorkingCopy(input); - } - - /* - * @see org.eclipse.cdt.make.ui.IWorkingCopyManagerExtension#setWorkingCopy(org.eclipse.ui.IEditorInput, org.eclipse.cdt.make.core.makefile.IMakefile) - */ - public void setWorkingCopy(IEditorInput input, IMakefile workingCopy) { - if (fDocumentProvider.getDocument(input) != null) { - if (fMap == null) - fMap= new HashMap(); - fMap.put(input, workingCopy); - } - } - - /* - * @see org.eclipse.cdt.make.internal.ui.javaeditor.IWorkingCopyManagerExtension#removeWorkingCopy(org.eclipse.ui.IEditorInput) - */ - public void removeWorkingCopy(IEditorInput input) { - fMap.remove(input); - if (fMap.isEmpty()) - fMap= null; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java deleted file mode 100644 index 76313520b3f..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/CheckboxTablePart.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.part; - -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -/** - * @version 1.0 - * @author - */ -public class CheckboxTablePart extends StructuredViewerPart { - public CheckboxTablePart(String[] buttonLabels) { - super(buttonLabels); - } - - /* - * @see StructuredViewerPart#createStructuredViewer(Composite, FormWidgetFactory) - */ - protected StructuredViewer createStructuredViewer(Composite parent, int style) { - style |= SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER; - CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, style); - tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - CheckboxTablePart.this.selectionChanged((IStructuredSelection) e.getSelection()); - } - }); - tableViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent event) { - elementChecked(event.getElement(), event.getChecked()); - } - }); - return tableViewer; - } - - public CheckboxTableViewer getTableViewer() { - return (CheckboxTableViewer) getViewer(); - } - - /* - * @see SharedPartWithButtons#buttonSelected(int) - */ - protected void buttonSelected(Button button, int index) { - } - - protected void elementChecked(Object element, boolean checked) { - } - protected void selectionChanged(IStructuredSelection selection) { - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPart.java deleted file mode 100644 index b903e987e17..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPart.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.part; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -/** - * @version 1.0 - * @author - */ -public abstract class SharedPart { - private boolean enabled = true; - - public void setEnabled(boolean enabled) { - if (enabled != this.enabled) { - this.enabled = enabled; - updateEnabledState(); - } - } - - public abstract void createControl(Composite parent, int style, int span); - - public boolean isEnabled() { - return enabled; - } - - protected void updateEnabledState() { - } - - protected Composite createComposite(Composite parent) { - return new Composite(parent, SWT.NULL); - } - - protected Label createEmptySpace(Composite parent, int span) { - Label label = new Label(parent, SWT.NULL); - GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); - gd.horizontalSpan = span; - gd.widthHint = 0; - gd.heightHint = 0; - label.setLayoutData(gd); - return label; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPartWithButtons.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPartWithButtons.java deleted file mode 100644 index 74bf5032f2c..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/SharedPartWithButtons.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.part; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * @version 1.0 - * @author - */ -public abstract class SharedPartWithButtons extends SharedPart { - private String[] buttonLabels; - private Control[] controls; - private Composite buttonContainer; - - private class SelectionHandler implements SelectionListener { - public void widgetSelected(SelectionEvent e) { - buttonSelected(e); - } - public void widgetDefaultSelected(SelectionEvent e) { - buttonSelected(e); - } - private void buttonSelected(SelectionEvent e) { - Integer index = (Integer) e.widget.getData(); - SharedPartWithButtons.this.buttonSelected((Button) e.widget, index.intValue()); - } - } - - public SharedPartWithButtons(String[] buttonLabels) { - this.buttonLabels = buttonLabels; - } - - public void setButtonEnabled(int index, boolean enabled) { - if (controls != null && index >= 0 && controls.length > index) { - Control c = controls[index]; - if (c instanceof Button) - c.setEnabled(enabled); - } - } - - protected abstract void createMainControl(Composite parent, int style, int span); - protected abstract void buttonSelected(Button button, int index); - - /* - * @see SharedPart#createControl(Composite, FormWidgetFactory) - */ - public void createControl(Composite parent, int style, int span) { - createMainLabel(parent, span); - createMainControl(parent, style, span - 1); - if (buttonLabels != null && buttonLabels.length > 0) { - buttonContainer = createComposite(parent); - GridData gd = new GridData(GridData.FILL_VERTICAL); - buttonContainer.setLayoutData(gd); - buttonContainer.setLayout(createButtonsLayout()); - - controls = new Control[buttonLabels.length]; - SelectionHandler listener = new SelectionHandler(); - for (int i = 0; i < buttonLabels.length; i++) { - String label = buttonLabels[i]; - if (label != null) { - Button button = createButton(buttonContainer, label, i); - button.addSelectionListener(listener); - controls[i] = button; - } else { - createEmptySpace(buttonContainer, 1); - } - } - } - } - - protected GridLayout createButtonsLayout() { - GridLayout layout = new GridLayout(); - layout.marginWidth = layout.marginHeight = 0; - return layout; - } - - protected Button createButton(Composite parent, String label, int index) { - Button button = new Button(parent, SWT.PUSH); - button.setText(label); - GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); - button.setLayoutData(gd); - button.setData(new Integer(index)); - return button; - } - - protected void updateEnabledState() { - for (int i = 0; i < controls.length; i++) { - Control c = controls[i]; - if (c instanceof Button) - c.setEnabled(isEnabled()); - } - } - - protected void createMainLabel(Composite parent, int span) { - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/StructuredViewerPart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/StructuredViewerPart.java deleted file mode 100644 index 0bac65c69b3..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/StructuredViewerPart.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.part; - -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -/** - * @version 1.0 - * @author - */ -public abstract class StructuredViewerPart extends SharedPartWithButtons { - private StructuredViewer viewer; - private Point minSize = null; - - public StructuredViewerPart(String[] buttonLabels) { - super(buttonLabels); - } - - public StructuredViewer getViewer() { - return viewer; - } - - public Control getControl() { - return viewer.getControl(); - } - - /* - * @see SharedPartWithButtons#createMainControl(Composite, int, FormWidgetFactory) - */ - protected void createMainControl(Composite parent, int style, int span) { - viewer = createStructuredViewer(parent, style); - Control control = viewer.getControl(); - GridData gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = span; - control.setLayoutData(gd); - applyMinimumSize(); - } - - public void setMinimumSize(int width, int height) { - minSize = new Point(width, height); - if (viewer != null) - applyMinimumSize(); - } - private void applyMinimumSize() { - if (minSize != null) { - GridData gd = (GridData) viewer.getControl().getLayoutData(); - gd.widthHint = minSize.x; - gd.heightHint = minSize.y; - } - } - - protected void updateEnabledState() { - getControl().setEnabled(isEnabled()); - super.updateEnabledState(); - } - - protected abstract StructuredViewer createStructuredViewer(Composite parent, int style); -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java deleted file mode 100644 index 0bbf5467e98..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.part; -import java.text.MessageFormat; - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -/** - * @version 1.0 - * @author - */ -public class WizardCheckboxTablePart extends CheckboxTablePart { - public static final String KEY_SELECT_ALL = MakeUIPlugin.getResourceString("WizardCheckboxTablePart.WizardCheckboxTablePart.selectAll"); //$NON-NLS-1$ - public static final String KEY_DESELECT_ALL = MakeUIPlugin.getResourceString("WizardCheckboxTablePart.WizardCheckboxTablePart.deselectAll"); //$NON-NLS-1$ - public static final String KEY_COUNTER = MakeUIPlugin.getResourceString("WizardCheckboxTablePart.WizardCheckboxTablePart.counter"); //$NON-NLS-1$ - - private final String EMPTY_STRING = ""; //$NON-NLS-1$ - private int selectAllIndex = -1; - private int deselectAllIndex = -1; - private String tableName; - private int counter; - private Label counterLabel; - - /** - * Constructor for WizardCheckboxTablePart. - * @param buttonLabels - */ - public WizardCheckboxTablePart(String tableName, String[] buttonLabels) { - super(buttonLabels); - this.tableName = tableName; - } - - public WizardCheckboxTablePart(String mainLabel) { - this( - mainLabel, - new String[] { MakeUIPlugin.getResourceString(KEY_SELECT_ALL), MakeUIPlugin.getResourceString(KEY_DESELECT_ALL)}); - setSelectAllIndex(0); - setDeselectAllIndex(1); - } - - public void setSelectAllIndex(int index) { - this.selectAllIndex = index; - } - public void setDeselectAllIndex(int index) { - this.deselectAllIndex = index; - } - - protected void buttonSelected(Button button, int index) { - if (index == selectAllIndex) { - handleSelectAll(true); - } - if (index == deselectAllIndex) { - handleSelectAll(false); - } - } - - public Object[] getSelection() { - CheckboxTableViewer viewer = getTableViewer(); - return viewer.getCheckedElements(); - } - - public void setSelection(Object[] selected) { - CheckboxTableViewer viewer = getTableViewer(); - viewer.setCheckedElements(selected); - updateCounter(selected.length); - } - - public void createControl(Composite parent) { - createControl(parent, SWT.NULL, 2); - counterLabel = new Label(parent, SWT.NULL); - GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - counterLabel.setLayoutData(gd); - updateCounter(0); - } - - protected Button createButton(Composite parent, String label, int index) { - Button button = super.createButton(parent, label, index); - return button; - } - - protected StructuredViewer createStructuredViewer(Composite parent, int style) { - StructuredViewer viewer = super.createStructuredViewer(parent, style); - return viewer; - } - - protected void createMainLabel(Composite parent, int span) { - if (tableName == null) - return; - Label label = new Label(parent, SWT.NULL); - label.setText(tableName); - GridData gd = new GridData(); - gd.horizontalSpan = span; - label.setLayoutData(gd); - } - - protected void updateCounter(int amount) { - counter = amount; - updateCounterLabel(); - } - - protected void updateCounterLabel() { - String number = EMPTY_STRING + getSelectionCount(); - String totalNumber = EMPTY_STRING + getTotalCount(); - String message = MessageFormat.format(MakeUIPlugin.getResourceString(KEY_COUNTER), new String[] { number, totalNumber }); - counterLabel.setText(message); - } - - public int getSelectionCount() { - return counter; - } - - public void selectAll(boolean select) { - handleSelectAll(select); - } - - private int getTotalCount() { - CheckboxTableViewer viewer = getTableViewer(); - return viewer.getTable().getItemCount(); - } - - protected void handleSelectAll(boolean select) { - CheckboxTableViewer viewer = getTableViewer(); - viewer.setAllChecked(select); - int selected; - if (!select) { - selected = 0; - } else { - selected = getTotalCount(); - } - updateCounter(selected); - } - protected void elementChecked(Object element, boolean checked) { - int count = getSelectionCount(); - updateCounter(checked ? count + 1 : count - 1); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakePreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakePreferencePage.java deleted file mode 100644 index f165a1e4e60..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/MakePreferencePage.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.preferences; - -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeProjectOptionBlock; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -/** - * This class represents a preference page that - * is contributed to the Preferences dialog. By - * subclassing FieldEditorPreferencePage, we - * can use the field support built into JFace that allows - * us to create a page that is small and knows how to - * save, restore and apply itself. - *

- * This page is used to modify preferences only. They - * are stored in the preference store that belongs to - * the main plug-in class. That way, preferences can - * be accessed directly via the preference store. - */ - -public class MakePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, ICOptionContainer { - - private MakeProjectOptionBlock fOptionBlock; - - public MakePreferencePage() { - setPreferenceStore(MakeUIPlugin.getDefault().getPreferenceStore()); - setDescription("Make Project Preferences"); - fOptionBlock = new MakeProjectOptionBlock(this); - } - - /* - * @see PreferencePage#createControl(Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - // WorkbenchHelp.setHelp(parent, ICMakeHelpContextIds.PROJECT_PROPERTY_PAGE); - } - - protected Control createContents(Composite parent) { - return fOptionBlock.createContents(parent); - } - - - public void init(IWorkbench workbench) { - } - - public boolean performOk() { - boolean ok = fOptionBlock.performApply(null); - MakeCorePlugin.getDefault().savePluginPreferences(); - return ok; - } - - /** - * @see DialogPage#setVisible(boolean) - */ - public void setVisible(boolean visible) { - super.setVisible(visible); - fOptionBlock.setVisible(visible); - } - - public void updateContainer() { - fOptionBlock.update(); - boolean ok = fOptionBlock.isValid(); - if (!ok) { - setErrorMessage(fOptionBlock.getErrorMessage()); - } - if (ok) { - setErrorMessage(null); - } - setValid(ok); - } - - public IProject getProject() { - return null; - } - - public boolean isValid() { - updateContainer(); - return super.isValid(); - } - - protected void performDefaults() { - fOptionBlock.performDefaults(); - super.performDefaults(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreferences() - */ - public Preferences getPreferences() { - return MakeUIPlugin.getDefault().getPluginPreferences(); - } - -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/properties/MakePropertyPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/properties/MakePropertyPage.java deleted file mode 100644 index 4459fb51ad0..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/properties/MakePropertyPage.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.properties; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.cdt.make.internal.ui.MakeProjectOptionBlock; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; -import org.eclipse.ui.dialogs.PropertyPage; - -public class MakePropertyPage extends PropertyPage implements ICOptionContainer { - - MakeProjectOptionBlock fOptionBlock; - - private static final String MSG_CLOSEDPROJECT = "MakeProjectPropertyPage.closedproject"; //$NON-NLS-1$ - - public MakePropertyPage() { - super(); - fOptionBlock = new MakeProjectOptionBlock(this); - } - - - protected Control createContents(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new FillLayout()); - - IProject project = getProject(); - if (!project.isOpen()) { - contentForClosedProject(composite); - } else { - contentForCProject(composite); - } - - return composite; - } - - private void contentForCProject(Composite parent) { - fOptionBlock.createContents(parent); - // WorkbenchHelp.setHelp(parent, ICMakeHelpContextIds.PROJECT_PROPERTY_PAGE); - } - - private void contentForClosedProject(Composite parent) { - Label label = new Label(parent, SWT.LEFT); - label.setText(MakeUIPlugin.getResourceString(MSG_CLOSEDPROJECT)); - label.setFont(parent.getFont()); - - noDefaultAndApplyButton(); - } - - /** - * @see PreferencePage#performOk - */ - public boolean performOk() { - IRunnableWithProgress runnable = new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - fOptionBlock.performApply(monitor); - } - }; - IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable); - try { - new ProgressMonitorDialog(getShell()).run(false, true, op); - } catch (InvocationTargetException e) { - return false; - } catch (InterruptedException e) { - // cancelled - return false; - } - return true; - } - - public IProject getProject() { - Object element = getElement(); - if (element instanceof IProject) { - return (IProject) element; - } - return null; - } - - /** - * @see DialogPage#setVisible(boolean) - */ - public void setVisible(boolean visible) { - super.setVisible(visible); - fOptionBlock.setVisible(visible); - } - - public void updateContainer() { - fOptionBlock.update(); - setValid(fOptionBlock.isValid()); - setErrorMessage(fOptionBlock.getErrorMessage()); - } - - protected void performDefaults() { - fOptionBlock.performDefaults(); - super.performDefaults(); - } - - public boolean isValid() { - updateContainer(); - return super.isValid(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreferences() - */ - public Preferences getPreferences() { - return null; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java deleted file mode 100644 index 971bc37d571..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/CompletionProposalComparator.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.cdt.make.internal.ui.text; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Comparator; - -import org.eclipse.jface.text.contentassist.ICompletionProposal; - -public class CompletionProposalComparator implements Comparator { - - /** - * Constructor for CompletionProposalComparator. - */ - public CompletionProposalComparator() { - } - - /* (non-Javadoc) - * @see Comparator#compare(Object, Object) - */ - public int compare(Object o1, Object o2) { - ICompletionProposal c1= (ICompletionProposal) o1; - ICompletionProposal c2= (ICompletionProposal) o2; - return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString()); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/IMakefileColorManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/IMakefileColorManager.java deleted file mode 100644 index 588f4b11d08..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/IMakefileColorManager.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -public interface IMakefileColorManager { - public static final RGB MAKE_COMMENT = new RGB(128, 0, 0); - public static final RGB MAKE_KEYWORD = new RGB(128, 128, 0); - public static final RGB MAKE_FUNCTION = new RGB(128, 0, 128); - public static final RGB MAKE_MACRO_VAR = new RGB(0, 0, 128); - public static final RGB MAKE_META_DATA = new RGB(0, 128, 0); - public static final RGB MAKE_DEFAULT = new RGB(0, 0, 0); - - public static final RGB MAKE_FORM_FOREGROUND = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(); - public static final RGB MAKE_FORM_BACKGROUND = new RGB(0xff, 0xff, 0xff); //RGB(0xff, 0xfe, 0xf9); - public static final RGB MAKE_DEFAULT_PAGE_HEADER = new RGB(0x48, 0x70, 0x98); - public static final RGB MAKE_HYPERLINK_TEXT = new RGB(0, 0, 128); - public static final RGB MAKE_CONTROL_BORDER = new RGB(195, 191, 179); - - void dispose(); - Color getColor(RGB rgb); - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/MakefileColorManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/MakefileColorManager.java deleted file mode 100644 index 40f133748c5..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/MakefileColorManager.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -public class MakefileColorManager implements IMakefileColorManager { - - protected Map fColorTable = new HashMap(10); - - /** - * @see IMakefileColorManager#dispose() - */ - public void dispose() { - Iterator e = fColorTable.values().iterator(); - while (e.hasNext()) - ((Color) e.next()).dispose(); - } - - /** - * @see IMakefileColorManager#getColor(RGB) - */ - public Color getColor(RGB rgb) { - Color color = (Color) fColorTable.get(rgb); - if (color == null) { - color = new Color(Display.getCurrent(), rgb); - fColorTable.put(rgb, color); - } - return color; - - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java deleted file mode 100644 index 58994c399e8..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * "The Java Developer's Guide to Eclipse" - * by Shavor, D'Anjou, Fairbrother, Kehn, Kellerman, McCarthy - * - * (C) Copyright International Business Machines Corporation, 2003. - * All Rights Reserved. - * - * Code or samples provided herein are provided without warranty of any kind. - */ -package org.eclipse.cdt.make.internal.ui.text; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; - -/** - * Used to scan and detect for SQL keywords - */ -public class WordPartDetector { - String wordPart = ""; - int offset; - - /** - * Method WordPartDetector. - * @param viewer is a text viewer - * @param documentOffset into the SQL document - */ - public WordPartDetector(ITextViewer viewer, int documentOffset) { - offset = documentOffset - 1; - int endOffset = documentOffset; - try { - IDocument doc = viewer.getDocument(); - int bottom = viewer.getBottomIndexEndOffset(); - int top = viewer.getTopIndexStartOffset(); - while (offset >= top && isMakefileLetter(doc.getChar(offset))) { - offset--; - } - while (endOffset < bottom && isMakefileLetter(doc.getChar(endOffset))) { - endOffset++; - } - //we've been one step too far : increase the offset - offset++; - wordPart = viewer.getDocument().get(offset, endOffset - offset); - } catch (BadLocationException e) { - // do nothing - } - } - - /** - * Method getString. - * @return String - */ - public String getString() { - return wordPart; - } - - public int getOffset() { - return offset; - } - - boolean isMakefileLetter(char c) { - return Character.isLetterOrDigit(c) || c == '_' || c == '.'; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java deleted file mode 100644 index e68bcca03e0..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCodeScanner.java +++ /dev/null @@ -1,186 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.make.internal.ui.text.IMakefileColorManager; -import org.eclipse.jface.text.TextAttribute; -import org.eclipse.jface.text.rules.EndOfLineRule; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.IWhitespaceDetector; -import org.eclipse.jface.text.rules.RuleBasedScanner; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WhitespaceRule; -import org.eclipse.jface.text.rules.WordRule; - -public class MakefileCodeScanner extends RuleBasedScanner { - - private final static String[] keywords = { "define", "endef", "ifdef", "ifndef", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "ifeq", "ifneq", "else", "endif", "include", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "-include", "sinclude", "override", "endef", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "export", "unexport", "vpath" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - }; - - private final static String[] functions = { "subst", "patsubst", "strip", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - "findstring", "filter", "sort", "dir", "notdir", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "suffix", "basename", "addsuffix", "addprefix", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "join", "word", "words", "wordlist", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "firstword", "wildcard", "error", "warning", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "shell", "origin", "foreach", "call" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - }; - - - /** - * Constructor for MakefileCodeScanner - */ - public MakefileCodeScanner(IMakefileColorManager provider) { - super(); - - IToken keyword = new Token(new TextAttribute(provider.getColor(IMakefileColorManager.MAKE_KEYWORD))); - IToken function = new Token(new TextAttribute(provider.getColor(IMakefileColorManager.MAKE_FUNCTION))); - IToken comment = new Token(new TextAttribute(provider.getColor(IMakefileColorManager.MAKE_COMMENT))); - IToken macro = new Token(new TextAttribute(provider.getColor(IMakefileColorManager.MAKE_MACRO_VAR))); - IToken other = new Token(new TextAttribute(provider.getColor(IMakefileColorManager.MAKE_DEFAULT))); - - List rules = new ArrayList(); - - // Add rule for single line comments. - rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$ - - // Add generic whitespace rule. - rules.add(new WhitespaceRule(new IWhitespaceDetector() { - public boolean isWhitespace(char character) { - return Character.isWhitespace(character); - } - })); - - // Add word rule for keywords, types, and constants. - WordRule wordRule = new WordRule(new MakefileWordDetector(), other); - for (int i = 0; i < keywords.length; i++) - wordRule.addWord(keywords[i], keyword); - for (int i = 0; i < functions.length; i++) - wordRule.addWord(functions[i], function); - - rules.add(wordRule); - - //rules.add(new PatternRule("$(", ")", macro, '\\', true)); //$NON-NLS-1$ //$NON-NLS-2$ - rules.add(new MakefileSimpleMacroRule(macro)); //$NON-NLS-1$ //$NON-NLS-2$ - - rules.add(new MacroRule(macro, other)); - - setDefaultReturnToken(other); - - IRule[] result = new IRule[rules.size()]; - - rules.toArray(result); - - setRules(result); - - } - - private class MacroRule implements IRule { - private static final int INIT_STATE = 0; - private static final int VAR_STATE = 1; - private static final int END_VAR_STATE = 2; - private static final int EQUAL_STATE = 3; - private static final int FINISH_STATE = 4; - private static final int ERROR_STATE = 5; - - private IToken token; - private StringBuffer buffer = new StringBuffer(); - protected IToken defaultToken; - public MacroRule(IToken token, IToken defaultToken) { - this.token = token; - this.defaultToken = defaultToken; - } - public IToken evaluate(ICharacterScanner scanner) { - int state = INIT_STATE; - buffer.setLength(0); - boolean bTwoCharsAssign = false; - - for (int c = scanner.read(); c != ICharacterScanner.EOF; c = scanner.read()) { - switch (state) { - case INIT_STATE : - if (c != '\n' && Character.isWhitespace((char) c)) - break; - if (isValidCharacter(c)) - state = VAR_STATE; - else - state = ERROR_STATE; - break; - case VAR_STATE : - if (isValidCharacter(c)) - break; - case END_VAR_STATE : - if (c != '\n' && Character.isWhitespace((char) c)) - state = END_VAR_STATE; - else if (c == ':' || c == '+') { - bTwoCharsAssign = true; - state = EQUAL_STATE; - } else if (c == '=') - state = FINISH_STATE; - else { - if (state == END_VAR_STATE) - scanner.unread(); // Return back to the space - state = ERROR_STATE; - } - break; - case EQUAL_STATE : - if (c == '=') - state = FINISH_STATE; - else - state = ERROR_STATE; - break; - case FINISH_STATE : - break; - default : - break; - } - if (state >= FINISH_STATE) - break; - buffer.append((char) c); - } - - scanner.unread(); - - if (state == FINISH_STATE) { - if (bTwoCharsAssign) - scanner.unread(); - return token; - } - - if (defaultToken.isUndefined()) - unreadBuffer(scanner); - - return Token.UNDEFINED; - } - - /** - * Returns the characters in the buffer to the scanner. - * - * @param scanner the scanner to be used - */ - protected void unreadBuffer(ICharacterScanner scanner) { - for (int i = buffer.length() - 1; i >= 0; i--) - scanner.unread(); - } - - protected boolean isValidCharacter(int c) { - char c0 = (char) c; - return Character.isLetterOrDigit(c0) || (c0 == '_'); - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java deleted file mode 100644 index 85bd95eb10d..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java +++ /dev/null @@ -1,265 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; - -import org.eclipse.cdt.make.core.makefile.IMacroDefinition; -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.core.makefile.IRule; -import org.eclipse.cdt.make.core.makefile.IDirective; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.internal.ui.text.CompletionProposalComparator; -import org.eclipse.cdt.make.internal.ui.text.WordPartDetector; -import org.eclipse.cdt.make.ui.IWorkingCopyManager; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.TextPresentation; -import org.eclipse.jface.text.contentassist.CompletionProposal; -import org.eclipse.jface.text.contentassist.ContextInformation; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.text.contentassist.IContextInformationPresenter; -import org.eclipse.jface.text.contentassist.IContextInformationValidator; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IEditorPart; - -/** - * MakefileCompletionProcessor - */ -public class MakefileCompletionProcessor implements IContentAssistProcessor { - - /** - * Simple content assist tip closer. The tip is valid in a range - * of 5 characters around its popup location. - */ - protected static class Validator implements IContextInformationValidator, IContextInformationPresenter { - - protected int fInstallOffset; - - /* - * @see IContextInformationValidator#isContextInformationValid(int) - */ - public boolean isContextInformationValid(int offset) { - return Math.abs(fInstallOffset - offset) < 5; - } - - /* - * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int) - */ - public void install(IContextInformation info, ITextViewer viewer, int offset) { - fInstallOffset = offset; - } - - /* - * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int, TextPresentation) - */ - public boolean updatePresentation(int documentPosition, TextPresentation presentation) { - return false; - } - } - - public class DirectiveComparator implements Comparator { - - /* (non-Javadoc) - * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) - */ - public int compare(Object o1, Object o2) { - String name1; - String name2; - - if (o1 instanceof IMacroDefinition) { - name1 = ((IMacroDefinition)o1).getName(); - } else if (o1 instanceof IRule) { - name1 = ((IRule)o1).getTarget().toString(); - } else { - name1 =""; - } - - if (o2 instanceof IMacroDefinition) { - name2 = ((IMacroDefinition)o1).getName(); - } else if (o2 instanceof IRule) { - name2 = ((IRule)o1).getTarget().toString(); - } else { - name2 =""; - } - - //return String.CASE_INSENSITIVE_ORDER.compare(name1, name2); - return name1.compareToIgnoreCase(name2); - } - - } - protected IContextInformationValidator fValidator = new Validator(); - protected Image imageMacro = MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_MACRO); - protected Image imageTarget = MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_TARGET_RULE); - - protected CompletionProposalComparator comparator = new CompletionProposalComparator(); - protected IEditorPart fEditor; - protected IWorkingCopyManager fManager; - - public MakefileCompletionProcessor(IEditorPart editor) { - fEditor = editor; - fManager = MakeUIPlugin.getDefault().getWorkingCopyManager(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) - */ - public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) { - boolean macro = inMacro(viewer, documentOffset); - IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); - IDirective[] statements = null; - if (macro) { - IDirective[] m1 = makefile.getMacroDefinitions(); - IDirective[] m2 = makefile.getBuiltinMacroDefinitions(); - statements = new IDirective[m1.length + m2.length]; - System.arraycopy(m1, 0, statements, 0, m1.length); - System.arraycopy(m2, 0, statements, m1.length, m2.length); - } else { - statements = makefile.getTargetRules(); - } - - ArrayList proposalList = new ArrayList(statements.length); - WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset); - - // iterate over all the different categories - for (int i = 0; i < statements.length; i++) { - String name = null; - Image image = null; - String infoString = "";//getContentInfoString(name); - if (statements[i] instanceof IMacroDefinition) { - name = ((IMacroDefinition) statements[i]).getName(); - image = imageMacro; - infoString = ((IMacroDefinition)statements[i]).getValue().toString(); - } else if (statements[i] instanceof IRule) { - name = ((IRule) statements[i]).getTarget().toString(); - image = imageTarget; - infoString = name; - } - if (name != null && name.startsWith(wordPart.getString())) { - IContextInformation info = new ContextInformation(name, infoString); - String displayString = (name.equals(infoString) ? name : name + " - " + infoString); - ICompletionProposal result = - new CompletionProposal( - name, - wordPart.getOffset(), - wordPart.getString().length(), - name.length(), - image, - displayString, - info, - infoString); - proposalList.add(result); - } - } - ICompletionProposal[] proposals = (ICompletionProposal[]) proposalList.toArray(new ICompletionProposal[0]); - Arrays.sort(proposals, comparator); - return proposals; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int) - */ - public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) { - WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset); - boolean macro = inMacro(viewer, documentOffset); - IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); - ArrayList contextList = new ArrayList(); - if (macro) { - IDirective[] statements = makefile.getMacroDefinitions(); - for (int i = 0; i < statements.length; i++) { - if (statements[i] instanceof IMacroDefinition) { - String name = ((IMacroDefinition) statements[i]).getName(); - if (name != null && name.equals(wordPart.getString())) { - String value = ((IMacroDefinition) statements[i]).getValue().toString(); - if (value != null && value.length() > 0) { - contextList.add(value); - } - } - } - } - statements = makefile.getBuiltinMacroDefinitions(); - for (int i = 0; i < statements.length; i++) { - if (statements[i] instanceof IMacroDefinition) { - String name = ((IMacroDefinition) statements[i]).getName(); - if (name != null && name.equals(wordPart.getString())) { - String value = ((IMacroDefinition) statements[i]).getValue().toString(); - if (value != null && value.length() > 0) { - contextList.add(value); - } - } - } - } - } - - IContextInformation[] result = new IContextInformation[contextList.size()]; - for (int i = 0; i < result.length; i++) { - String context = (String)contextList.get(i); - result[i] = new ContextInformation(imageMacro, wordPart.getString(), context); - } - return result; - - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() - */ - public char[] getCompletionProposalAutoActivationCharacters() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters() - */ - public char[] getContextInformationAutoActivationCharacters() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() - */ - public String getErrorMessage() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator() - */ - public IContextInformationValidator getContextInformationValidator() { - return fValidator; - } - - private boolean inMacro(ITextViewer viewer, int offset) { - boolean isMacro = false; - IDocument document = viewer.getDocument(); - // Try to figure out if we are in a Macro. - try { - for (int index = offset - 1; index >= 0; index--) { - char c; - c = document.getChar(index); - if (c == '$') { - isMacro = true; - break; - } else if (Character.isWhitespace(c)) { - break; - } - } - } catch (BadLocationException e) { - } - return isMacro; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileMacroScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileMacroScanner.java deleted file mode 100644 index 4d70025b4d9..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileMacroScanner.java +++ /dev/null @@ -1,114 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.IWhitespaceDetector; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.PatternRule; -import org.eclipse.jface.text.rules.RuleBasedScanner; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WhitespaceRule; -import org.eclipse.jface.text.rules.WordRule; - -public class MakefileMacroScanner extends RuleBasedScanner { - private String buffer; - private final static String[] DELIMITERS = { "\r", "\n", "\r\n" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - public final static String tokenText = "text"; //$NON-NLS-1$ - public final static String tokenMacro = "macro"; //$NON-NLS-1$ - public final static String tokenOther = "other"; //$NON-NLS-1$ - - /** - * Constructor for MakefileMacroScanner - */ - public MakefileMacroScanner(String buffer) { - super(); - this.buffer = buffer; - fOffset = 0; - - IToken tText = new Token(tokenText); - IToken tMacro = new Token(tokenMacro); - IToken tOther = new Token(tokenOther); - - List rules = new ArrayList(); - - rules.add(new PatternRule("\"", "\"", tText, '\\', true)); //$NON-NLS-1$ //$NON-NLS-2$ - rules.add(new PatternRule("\'", "\'", tText, '\\', true)); //$NON-NLS-1$ //$NON-NLS-2$ - - rules.add(new MakefileSimpleMacroRule(tMacro)); - - // Add generic whitespace rule. - rules.add(new WhitespaceRule(new IWhitespaceDetector() { - public boolean isWhitespace(char character) { - return Character.isWhitespace(character); - } - })); - - WordRule wRule = new WordRule(new IWordDetector() { - public boolean isWordPart(char c) { - return isWordStart(c); - } - public boolean isWordStart(char c) { - return !(((short) c == EOF) || Character.isSpaceChar(c)); - } - }, tOther); - - rules.add(wRule); - - IRule[] result = new IRule[rules.size()]; - - rules.toArray(result); - - setRules(result); - - setRange(null, 0, buffer.length()); - } - - /** - * @see RuleBasedScanner#getColumn() - */ - public int getColumn() { - return fOffset; - } - - /** - * @see RuleBasedScanner#read() - */ - public int read() { - int c; - if (fOffset == buffer.length()) - c = EOF; - else - c = buffer.charAt(fOffset); - ++fOffset; - return c; - } - - /** - * @see RuleBasedScanner#setRange(IDocument, int, int) - */ - public void setRange(IDocument document, int offset, int length) { - fDocument = document; - fOffset = offset; - fRangeEnd = offset + length; - - fDelimiters = new char[DELIMITERS.length][]; - for (int i = 0; i < DELIMITERS.length; i++) - fDelimiters[i] = DELIMITERS[i].toCharArray(); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java deleted file mode 100644 index 0d7e3276432..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java +++ /dev/null @@ -1,235 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.rules.EndOfLineRule; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IPredicateRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.MultiLineRule; -import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; -import org.eclipse.jface.text.rules.Token; - -public class MakefilePartitionScanner extends RuleBasedPartitionScanner { - // Partition types - public final static String MAKEFILE_COMMENT = "makefile_comment"; //$NON-NLS-1$ - public final static String MAKEFILE_MACRO_ASSIGNEMENT = "makefile_macro_assignement"; //$NON-NLS-1$ - public final static String MAKEFILE_INCLUDE_BLOCK = "makefile_include_block"; //$NON-NLS-1$ - public final static String MAKEFILE_IF_BLOCK = "makefile_if_block"; //$NON-NLS-1$ - public final static String MAKEFILE_DEF_BLOCK = "makefile_def_block"; //$NON-NLS-1$ - public final static String MAKEFILE_OTHER = "makefile_other"; //$NON-NLS-1$ - - public final static String[] TYPES = - new String[] { - MAKEFILE_COMMENT, - MAKEFILE_MACRO_ASSIGNEMENT, - MAKEFILE_INCLUDE_BLOCK, - MAKEFILE_IF_BLOCK, - MAKEFILE_DEF_BLOCK, - MAKEFILE_OTHER, - // All other - }; - - /** The predefined delimiters of this tracker */ - private char[][] fModDelimiters = { { '\r', '\n' }, { - '\r' }, { - '\n' } - }; - - /** - * Constructor for MakefilePartitionScanner - */ - public MakefilePartitionScanner() { - super(); - - IToken tComment = new Token(MAKEFILE_COMMENT); - IToken tMacro = new Token(MAKEFILE_MACRO_ASSIGNEMENT); - IToken tInclude = new Token(MAKEFILE_INCLUDE_BLOCK); - IToken tIf = new Token(MAKEFILE_IF_BLOCK); - IToken tDef = new Token(MAKEFILE_DEF_BLOCK); - IToken tOther = new Token(MAKEFILE_OTHER); - - List rules = new ArrayList(); - - // Add rule for single line comments. - - rules.add(new EndOfLineRule("#", tComment, '\\')); //$NON-NLS-1$ - - rules.add(new EndOfLineRule("include", tInclude)); //$NON-NLS-1$ - - rules.add(new EndOfLineRule("export", tDef)); //$NON-NLS-1$ - rules.add(new EndOfLineRule("unexport", tDef)); //$NON-NLS-1$ - rules.add(new EndOfLineRule("vpath", tDef)); //$NON-NLS-1$ - rules.add(new EndOfLineRule("override", tDef)); //$NON-NLS-1$ - rules.add(new MultiLineRule("define", "endef", tDef)); //$NON-NLS-1$ - rules.add(new MultiLineRule("override define", "endef", tDef)); //$NON-NLS-1$ - - // Add rules for multi-line comments and javadoc. - rules.add(new MultiLineRule("ifdef", "endif", tIf)); //$NON-NLS-1$ - rules.add(new MultiLineRule("ifndef", "endif", tIf)); //$NON-NLS-1$ - rules.add(new MultiLineRule("ifeq", "endif", tIf)); //$NON-NLS-1$ - rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ - - // Last rule must be supplied with default token! - rules.add(new MacroRule(tMacro, tOther)); //$NON-NLS-1$ - - IPredicateRule[] result = new IPredicateRule[rules.size()]; - rules.toArray(result); - setPredicateRules(result); - - } - - /* - * @see ICharacterScanner#getLegalLineDelimiters - */ - public char[][] getLegalLineDelimiters() { - return fModDelimiters; - } - - private class MacroRule implements IPredicateRule { - private static final int INIT_STATE = 0; - private static final int VAR_STATE = 1; - private static final int END_VAR_STATE = 2; - private static final int EQUAL_STATE = 3; - private static final int FINISH_STATE = 4; - private static final int ERROR_STATE = 5; - - private IToken token; - private StringBuffer buffer = new StringBuffer(); - protected IToken defaultToken; - public MacroRule(IToken token, IToken defaultToken) { - this.token = token; - this.defaultToken = defaultToken; - } - - public IToken getSuccessToken() { - return token; - } - - public IToken evaluate(ICharacterScanner scanner, boolean resume) { - buffer.setLength(0); - int state = INIT_STATE; - - if (resume) - scanToBeginOfLine(scanner); - - for (int c = scanner.read(); c != ICharacterScanner.EOF; c = scanner.read()) { - switch (state) { - case INIT_STATE : - if (c != '\n' && Character.isWhitespace((char) c)) - break; - if (isValidCharacter(c)) - state = VAR_STATE; - else - state = ERROR_STATE; - break; - case VAR_STATE : - if (isValidCharacter(c)) - break; - case END_VAR_STATE : - if (c != '\n' && Character.isWhitespace((char) c)) - state = END_VAR_STATE; - else if (c == ':' || c == '+') - state = EQUAL_STATE; - else if (c == '=') - state = FINISH_STATE; - else { - if (state == END_VAR_STATE) - scanner.unread(); // Return back to the space - state = ERROR_STATE; - } - break; - case EQUAL_STATE : - if (c == '=') - state = FINISH_STATE; - else - state = ERROR_STATE; - break; - case FINISH_STATE : - break; - default : - break; - } - if (state >= FINISH_STATE) - break; - buffer.append((char) c); - } - - scanner.unread(); - - if (state == FINISH_STATE) { - scanToEndOfLine(scanner); - return token; - } - - if (defaultToken.isUndefined()) - unreadBuffer(scanner); - - return Token.UNDEFINED; - - } - - public IToken evaluate(ICharacterScanner scanner) { - return evaluate(scanner, false); - } - - /** - * Returns the characters in the buffer to the scanner. - * - * @param scanner the scanner to be used - */ - protected void unreadBuffer(ICharacterScanner scanner) { - for (int i = buffer.length() - 1; i >= 0; i--) - scanner.unread(); - } - - private void scanToEndOfLine(ICharacterScanner scanner) { - int c; - char[][] delimiters = scanner.getLegalLineDelimiters(); - while ((c = scanner.read()) != ICharacterScanner.EOF) { - // Check for end of line since it can be used to terminate the pattern. - for (int i = 0; i < delimiters.length; i++) { - if (c == delimiters[i][0] && sequenceDetected(scanner, delimiters[i])) - return; - } - } - } - - private void scanToBeginOfLine(ICharacterScanner scanner) { - for (; scanner.getColumn() != 0; scanner.unread()); - } - - private boolean sequenceDetected(ICharacterScanner scanner, char[] sequence) { - for (int i = 1; i < sequence.length; i++) { - int c = scanner.read(); - if (c == ICharacterScanner.EOF) { - return true; - } else if (c != sequence[i]) { - // Non-matching character detected, rewind the scanner back to the start. - for (; i > 0; i--) - scanner.unread(); - return false; - } - } - - return true; - } - protected boolean isValidCharacter(int c) { - char c0 = (char) c; - return Character.isLetterOrDigit(c0) || (c0 == '_'); - } - - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java deleted file mode 100644 index 623699bebea..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileReconcilingStrategy.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import java.io.IOException; -import java.io.StringReader; - -import org.eclipse.cdt.make.core.makefile.IMakefile; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.internal.ui.editor.MakefileContentOutlinePage; -import org.eclipse.cdt.make.internal.ui.editor.MakefileEditor; -import org.eclipse.cdt.make.ui.IWorkingCopyManager; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.reconciler.DirtyRegion; -import org.eclipse.jface.text.reconciler.IReconcilingStrategy; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; - - -public class MakefileReconcilingStrategy implements IReconcilingStrategy { - - - private int fLastRegionOffset; - private ITextEditor fEditor; - private IWorkingCopyManager fManager; - private IDocumentProvider fDocumentProvider; - private IProgressMonitor fProgressMonitor; - - private MakefileContentOutlinePage fOutliner; - - public MakefileReconcilingStrategy(MakefileEditor editor) { - fOutliner= editor.getOutlinePage(); - fLastRegionOffset = Integer.MAX_VALUE; - fEditor= editor; - fManager= MakeUIPlugin.getDefault().getWorkingCopyManager(); - fDocumentProvider= MakeUIPlugin.getDefault().getMakefileDocumentProvider(); - } - - /** - * @see IReconcilingStrategy#reconcile(document) - */ - public void setDocument(IDocument document) { - } - - - /* - * @see IReconcilingStrategyExtension#setProgressMonitor(IProgressMonitor) - */ - public void setProgressMonitor(IProgressMonitor monitor) { - fProgressMonitor= monitor; - } - - /** - * @see IReconcilingStrategy#reconcile(region) - */ - public void reconcile(IRegion region) { - // We use a trick to avoid running the reconciler multiple times - // on a file when it gets changed. This is because this gets called - // multiple times with different regions of the file, we do a - // complete parse on the first region. - if(region.getOffset() <= fLastRegionOffset) { - reconcile(); - } - fLastRegionOffset = region.getOffset(); - } - - - /** - * @see IReconcilingStrategy#reconcile(dirtyRegion, region) - */ - public void reconcile(DirtyRegion dirtyRegion, IRegion region) { - // FIXME: This seems to generate to much flashing in - // the contentouline viewer. - //reconcile(); - } - - private void reconcile() { - IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); - String content = fDocumentProvider.getDocument(fEditor.getEditorInput()).get(); - StringReader reader = new StringReader(content); - try { - makefile.parse(reader); - } catch (IOException e) { - } - - fOutliner.update(); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileSimpleMacroRule.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileSimpleMacroRule.java deleted file mode 100644 index 721c3f42450..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileSimpleMacroRule.java +++ /dev/null @@ -1,55 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.PatternRule; - -public class MakefileSimpleMacroRule extends PatternRule { - - private int nOfBrackets; - - public MakefileSimpleMacroRule(IToken token) { - super("$(", ")", token, (char) 0, true); //$NON-NLS-1$ //$NON-NLS-2$ - } - - protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) { - nOfBrackets = 1; - return super.doEvaluate(scanner, resume); - } - - protected boolean endSequenceDetected(ICharacterScanner scanner) { - int c; - char[][] delimiters = scanner.getLegalLineDelimiters(); - while ((c = scanner.read()) != ICharacterScanner.EOF) { - if ('(' == (char) c) - ++nOfBrackets; - - if (fEndSequence.length > 0 && c == fEndSequence[0]) { - // Check if the specified end sequence has been found. - if (sequenceDetected(scanner, fEndSequence, true)) { - if (0 == --nOfBrackets) - return true; - } - } else if (fBreaksOnEOL) { - // Check for end of line since it can be used to terminate the pattern. - for (int i = 0; i < delimiters.length; i++) { - if (c == delimiters[i][0] && sequenceDetected(scanner, delimiters[i], false)) - return true; - } - } - } - scanner.unread(); - return true; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileWordDetector.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileWordDetector.java deleted file mode 100644 index 05f7b300006..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileWordDetector.java +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.internal.ui.text.makefile; - -import org.eclipse.jface.text.rules.IWordDetector; - -public class MakefileWordDetector implements IWordDetector { - - private static final String correctStartSpecChars = "%*().><"; //$NON-NLS-1$ - private static final String correctSpecChars = "@$/\\"; //$NON-NLS-1$ - - /** - * @see IWordDetector#isWordPart(character) - */ - public boolean isWordPart(char character) { - return Character.isLetterOrDigit(character) || (correctSpecChars.indexOf(character) >= 0); - } - - /** - * @see IWordDetector#isWordStart(char) - */ - public boolean isWordStart(char character) { - return Character.isLetterOrDigit(character) || (correctStartSpecChars.indexOf(character) >= 0); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/wizards/StatusWizardPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/wizards/StatusWizardPage.java deleted file mode 100644 index e1e1fc2b634..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/wizards/StatusWizardPage.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.internal.ui.wizards; - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.DialogPage; -import org.eclipse.jface.wizard.WizardPage; - -public abstract class StatusWizardPage extends WizardPage { - - private IStatus fCurrStatus; - - private boolean fPageVisible; - private boolean fNoErrorOnStartup; - - public StatusWizardPage(String name, boolean noErrorOnStartup) { - super(name); - fPageVisible= false; - fCurrStatus= createStatus(IStatus.OK, ""); //$NON-NLS-1$ - fNoErrorOnStartup= noErrorOnStartup; - } - - // ---- WizardPage ---------------- - - /* - * @see WizardPage#becomesVisible - */ - public void setVisible(boolean visible) { - super.setVisible(visible); - fPageVisible= visible; - // policy: wizards are not allowed to come up with an error message - if (visible && fNoErrorOnStartup && fCurrStatus.matches(IStatus.ERROR)) { - // keep the error state, but remove the message - fCurrStatus= createStatus(IStatus.ERROR, ""); //$NON-NLS-1$ - } - updateStatus(fCurrStatus); - } - - /** - * Updates the status line and the ok button depending on the status - */ - protected void updateStatus(IStatus status) { - fCurrStatus= status; - setPageComplete(!status.matches(IStatus.ERROR)); - if (fPageVisible) { - applyToStatusLine(this, status); - } - } - - /** - * Applies the status to a dialog page - */ - public static void applyToStatusLine(DialogPage page, IStatus status) { - String errorMessage= null; - String warningMessage= null; - String statusMessage= status.getMessage(); - if (statusMessage.length() > 0) { - if (status.matches(IStatus.ERROR)) { - errorMessage= statusMessage; - } else if (!status.isOK()) { - warningMessage= statusMessage; - } - } - page.setErrorMessage(errorMessage); - page.setMessage(warningMessage,status.getSeverity()); - } - - public static IStatus getMoreSevere(IStatus s1, IStatus s2) { - if (s1.getSeverity() >= s2.getSeverity()) { - return s1; - } else { - return s2; - } - } - - - public static IStatus createStatus(int severity, String message) { - return new Status(severity, MakeUIPlugin.getUniqueIdentifier(), severity, message, null); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java deleted file mode 100644 index c8f17f4ca20..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui; - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; - -public interface IMakeHelpContextIds { - public static final String PREFIX = MakeUIPlugin.getUniqueIdentifier() + "."; - - public static final String MAKE_PATH_SYMBOL_SETTINGS = PREFIX + "cdt_paths_symbols_page"; - public static final String MAKE_BUILDER_SETTINGS = PREFIX + "cdt_make_builder_page"; -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManager.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManager.java deleted file mode 100644 index 54e4b739ace..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManager.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.make.ui; - -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.ui.IEditorInput; - -import org.eclipse.cdt.make.core.makefile.IMakefile; - -/** - * Interface for accessing working copies of IMakefile - * objects. The original unit is only given indirectly by means - * of an IEditorInput. The life cycle is as follows: - *

    - *
  • connect creates and remembers a working copy of the - * unit which is encoded in the given editor input
  • - *
  • getWorkingCopy returns the working copy remembered on - * connect
  • - *
  • disconnect destroys the working copy remembered on - * connect
  • - *
- *

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

- * - * - */ -public interface IWorkingCopyManager { - - /** - * Connects the given editor input to this manager. After calling - * this method, a working copy will be available for the compilation unit encoded - * in the given editor input (does nothing if there is no encoded compilation unit). - * - * @param input the editor input - * @exception CoreException if the working copy cannot be created for the - * unit - */ - void connect(IEditorInput input) throws CoreException; - - /** - * Disconnects the given editor input from this manager. After calling - * this method, a working copy for the compilation unit encoded - * in the given editor input will no longer be available. Does nothing if there - * is no encoded compilation unit, or if there is no remembered working copy for - * the compilation unit. - * - * @param input the editor input - */ - void disconnect(IEditorInput input); - - /** - * Returns the working copy remembered for the compilation unit encoded in the - * given editor input. - * - * @param input the editor input - * @return the working copy of the compilation unit, or null if the - * input does not encode an editor input, or if there is no remembered working - * copy for this compilation unit - */ - IMakefile getWorkingCopy(IEditorInput input); - - /** - * Shuts down this working copy manager. All working copies still remembered - * by this manager are destroyed. - */ - void shutdown(); -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManagerExtension.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManagerExtension.java deleted file mode 100644 index e33fa7c3f78..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IWorkingCopyManagerExtension.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.make.ui; - -import org.eclipse.ui.IEditorInput; - -import org.eclipse.cdt.make.core.makefile.IMakefile; - -/** - * Extension interface for IWorkingCopyManager. - * @since 2.1 - */ -public interface IWorkingCopyManagerExtension { - - /** - * Sets the given working copy for the given editor input. If the given editor input - * is not connected to this working copy manager, this call has no effect.

- * This working copy manager does not assume the ownership of this working copy, i.e., - * the given working copy is not automatically be freed when this manager is shut down. - * - * @param input the editor input - * @param workingCopy the working copy - */ - void setWorkingCopy(IEditorInput input, IMakefile workingCopy); - - /** - * Removes the working copy set for the given editor input. If there is no - * working copy set for this input or this input is not connected to this - * working copy manager, this call has no effect. - * - * @param input the editor input - */ - void removeWorkingCopy(IEditorInput input); -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java deleted file mode 100644 index 4b08da0f616..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.eclipse.cdt.make.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetListener; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeTargetEvent; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.AbstractTreeViewer; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.widgets.Control; - -public class MakeContentProvider implements ITreeContentProvider, IMakeTargetListener, IResourceChangeListener { - protected boolean bFlatten; - - protected StructuredViewer viewer; - - /** - * Constructor for MakeContentProvider - */ - public MakeContentProvider() { - this(false); - } - - public MakeContentProvider(boolean flat) { - bFlatten = flat; - } - - public Object[] getChildren(Object obj) { - if (obj instanceof IWorkspaceRoot) { - try { - return MakeCorePlugin.getDefault().getTargetManager().getTargetBuilderProjects(); - } catch (CoreException e) { - } - } else if (obj instanceof IContainer) { - ArrayList children = new ArrayList(); - try { - IResource[] resource = ((IContainer) obj).members(); - for (int i = 0; i < resource.length; i++) { - if (resource[i] instanceof IContainer) { - children.add(resource[i]); - } - } - children.addAll(Arrays.asList(MakeCorePlugin.getDefault().getTargetManager().getTargets((IContainer) obj))); - } catch (CoreException e) { - } - return children.toArray(); - } - return new Object[0]; - } - - public Object getParent(Object obj) { - if (obj instanceof IMakeTarget) { - return ((IMakeTarget) obj).getContainer(); - } else if (obj instanceof IContainer) { - return ((IContainer) obj).getParent(); - } - return null; - } - - public boolean hasChildren(Object obj) { - return getChildren(obj).length > 0; - } - - public Object[] getElements(Object obj) { - if (bFlatten) { - List list = new ArrayList(); - Object[] children = getChildren(obj); - for (int i = 0; i < children.length; i++) { - list.add(children[i]); - list.addAll(Arrays.asList(getElements(children[i]))); - } - return list.toArray(); - } - return getChildren(obj); - } - - public void dispose() { - if (viewer != null) { - MakeCorePlugin.getDefault().getTargetManager().removeListener(this); - } - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - if (this.viewer == null) { - MakeCorePlugin.getDefault().getTargetManager().addListener(this); - } - this.viewer = (StructuredViewer) viewer; - IWorkspace oldWorkspace = null; - IWorkspace newWorkspace = null; - if (oldInput instanceof IWorkspace) { - oldWorkspace = (IWorkspace) oldInput; - } else if (oldInput instanceof IContainer) { - oldWorkspace = ((IContainer) oldInput).getWorkspace(); - } - if (newInput instanceof IWorkspace) { - newWorkspace = (IWorkspace) newInput; - } else if (newInput instanceof IContainer) { - newWorkspace = ((IContainer) newInput).getWorkspace(); - } - if (oldWorkspace != newWorkspace) { - if (oldWorkspace != null) { - oldWorkspace.removeResourceChangeListener(this); - } - if (newWorkspace != null) { - newWorkspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); - } - } - } - - public void targetChanged(final MakeTargetEvent event) { - final Control ctrl = viewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) { - switch (event.getType()) { - case MakeTargetEvent.PROJECT_ADDED : - case MakeTargetEvent.PROJECT_REMOVED : - ctrl.getDisplay().syncExec(new Runnable() { - public void run() { - if (ctrl != null && !ctrl.isDisposed()) { - viewer.refresh(); - } - } - }); - break; - case MakeTargetEvent.TARGET_ADD : - case MakeTargetEvent.TARGET_CHANGED : - case MakeTargetEvent.TARGET_REMOVED : - ctrl.getDisplay().syncExec(new Runnable() { - public void run() { - if (ctrl != null && !ctrl.isDisposed()) { - if (bFlatten) { - viewer.refresh(); - } else { - viewer.refresh(event.getTarget().getContainer()); - } - } - } - }); - break; - } - } - } - - void processDelta(IResourceDelta delta) { - // Bail out if the widget was disposed. - Control ctrl = viewer.getControl(); - if (ctrl == null || ctrl.isDisposed() || delta == null) { - return; - } - - // Get the affected resource - IResource resource = delta.getResource(); - IResourceDelta[] affectedChildren = delta.getAffectedChildren(IResourceDelta.CHANGED); - - // Not interested in Content changes. - for (int i = 0; i < affectedChildren.length; i++) { - if ((affectedChildren[i].getFlags() & IResourceDelta.TYPE) != 0) { - return; - } - } - - // Handle changed children recursively. - for (int i = 0; i < affectedChildren.length; i++) { - processDelta(affectedChildren[i]); - } - - // Handle removed children. Issue one update for all removals. - affectedChildren = delta.getAffectedChildren(IResourceDelta.REMOVED); - if (affectedChildren.length > 0) { - ArrayList affected = new ArrayList(affectedChildren.length); - for (int i = 0; i < affectedChildren.length; i++) { - if (affectedChildren[i].getResource() instanceof IContainer) { - affected.add(affectedChildren[i].getResource()); - } - } - if (affected.size() != 0) { - if (viewer instanceof AbstractTreeViewer) { - ((AbstractTreeViewer) viewer).remove(affected.toArray()); - } else { - viewer.refresh(resource); - } - } - } - - // Handle added children. Issue one update for all insertions. - affectedChildren = delta.getAffectedChildren(IResourceDelta.ADDED); - if (affectedChildren.length > 0) { - ArrayList affected = new ArrayList(affectedChildren.length); - for (int i = 0; i < affectedChildren.length; i++) { - if (affectedChildren[i].getResource() instanceof IContainer) { - affected.add(affectedChildren[i].getResource()); - } - } - if (affected.size() != 0) { - if (viewer instanceof AbstractTreeViewer) { - ((AbstractTreeViewer) viewer).add(resource, affected.toArray()); - } else { - viewer.refresh(resource); - } - } - } - } - - public void resourceChanged(IResourceChangeEvent event) { - final IResourceDelta delta = event.getDelta(); - Control ctrl = viewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) { - // Do a sync exec, not an async exec, since the resource delta - // must be traversed in this method. It is destroyed - // when this method returns. - ctrl.getDisplay().syncExec(new Runnable() { - public void run() { - processDelta(delta); - } - }); - } - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeLabelProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeLabelProvider.java deleted file mode 100644 index 9829395843e..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeLabelProvider.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.eclipse.cdt.make.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -public class MakeLabelProvider extends LabelProvider implements ITableLabelProvider { - private IPath pathPrefix; - - WorkbenchLabelProvider fLableProvider = new WorkbenchLabelProvider(); - - public MakeLabelProvider() { - this(null); - } - - public MakeLabelProvider(IPath removePrefix) { - pathPrefix = removePrefix; - } - /** - * @see ILabelProvider#getImage(Object) - */ - public Image getImage(Object obj) { - Image image = null; - if (obj instanceof IMakeTarget) { - return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_BUILD_TARGET); - } else if (obj instanceof IContainer) { - return fLableProvider.getImage(obj); - } - return image; - } - - /** - * @see ILabelProvider#getText(Object) - */ - public String getText(Object obj) { - if (obj instanceof IMakeTarget) { - return ((IMakeTarget) obj).getName(); - } else if (obj instanceof IContainer) { - return fLableProvider.getText(obj); - } - return ""; - } - - public void dispose() { - super.dispose(); - fLableProvider.dispose(); - } - - public Image getColumnImage(Object obj, int columnIndex) { - return columnIndex == 0 ? getImage(obj) : null; - } - - public String getColumnText(Object obj, int columnIndex) { - switch (columnIndex) { - case 0 : - return getText(obj); - case 1 : - if (obj instanceof IMakeTarget) { - if (pathPrefix != null) { - IPath targetPath = ((IMakeTarget) obj).getContainer().getProjectRelativePath(); - if (pathPrefix.isPrefixOf(targetPath)) { - targetPath = targetPath.removeFirstSegments(pathPrefix.segmentCount()); - } - if (targetPath.segmentCount() > 0) { - return targetPath.toString(); - } - } - } - } - return ""; - } -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java deleted file mode 100644 index 80b24515ce7..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetBuild.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.eclipse.cdt.make.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.BuildAction; - -public class TargetBuild { - - /** - * Causes all editors to save any modified resources depending on the user's - * preference. - */ - static void saveAllResources(IMakeTarget[] targets) { - - if (!BuildAction.isSaveAllSet()) - return; - - List projects = new ArrayList(); - for (int i = 0; i < targets.length; ++i) { - IMakeTarget target = targets[i]; - projects.add(target.getContainer().getProject()); - } - - IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); - for (int i = 0; i < windows.length; i++) { - IWorkbenchPage[] pages = windows[i].getPages(); - for (int j = 0; j < pages.length; j++) { - IWorkbenchPage page = pages[j]; - IEditorReference[] editorReferences = page.getEditorReferences(); - for (int k = 0; k < editorReferences.length; k++) { - IEditorPart editor = editorReferences[k].getEditor(false); - if (editor != null && editor.isDirty()) { - IEditorInput input = editor.getEditorInput(); - if (input instanceof IFileEditorInput) { - IFile inputFile = ((IFileEditorInput) input).getFile(); - if (projects.contains(inputFile.getProject())) { - page.saveEditor(editor, false); - } - } - } - } - } - } - } - - static public void runWithProgressDialog(Shell shell, IMakeTarget[] targets) { - ProgressMonitorDialog pd = new ProgressMonitorDialog(shell); - try { - TargetBuild.run(true, pd, targets); - } catch (InvocationTargetException e) { - MakeUIPlugin.errorDialog(shell, "Target Build Error", "Error Building Target", e); - } - } - - static public void run(boolean fork, IRunnableContext context, final IMakeTarget[] targets) throws InvocationTargetException { - try { - saveAllResources(targets); - - context.run(fork, true, new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - monitor.beginTask("Building Targets...", targets.length); - for( int i = 0; i < targets.length; i++) { - targets[i].build(new SubProgressMonitor(monitor, 1)); - } - } - }; - MakeUIPlugin.getWorkspace().run(runnable, monitor); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } catch (OperationCanceledException e) { - throw new InterruptedException(e.getMessage()); - } - } - }); - } catch (InterruptedException e) { - return; - } - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetListViewerPart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetListViewerPart.java deleted file mode 100644 index ae02f6e1397..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/TargetListViewerPart.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.eclipse.cdt.make.ui; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetManager; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.internal.ui.part.StructuredViewerPart; -import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; - -public class TargetListViewerPart extends StructuredViewerPart { - - private TableViewer tableViewer; - private IMakeTarget fSelectedTarget; - private final int ADD_TARGET = 0; - private final int REMOVE_TARGET = 1; - private final int EDIT_TARGET = 2; - private IContainer fContainer; - - public TargetListViewerPart(IContainer container) { - super(new String[] { "Add Target...", "Remove Target", "Edit Target..." }); - fContainer = container; - } - - protected StructuredViewer createStructuredViewer(Composite parent, int style) { - tableViewer = new TableViewer(parent, SWT.SINGLE | SWT.BORDER); - Table table = (Table) tableViewer.getControl(); - TableLayout layout = new TableLayout(); - - layout.addColumnData(new ColumnWeightData(50)); - TableColumn tc = new TableColumn(table, SWT.NONE, 0); - tc.setText("Targets"); - - layout.addColumnData(new ColumnWeightData(50)); - tc = new TableColumn(table, SWT.NONE, 1); - tc.setText("Location"); - - table.setLayout(layout); - table.setHeaderVisible(true); - - tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - TargetListViewerPart.this.selectionChanged((IStructuredSelection) e.getSelection()); - } - }); - tableViewer.setContentProvider(new MakeContentProvider(true)); - tableViewer.addFilter(new ViewerFilter() { - public boolean select(Viewer viewer, Object parentElement, Object element) { - return (element instanceof IMakeTarget); - } - }); - tableViewer.setLabelProvider(new MakeLabelProvider(fContainer.getProjectRelativePath())); - tableViewer.setInput(fContainer); - - return tableViewer; - } - - protected void buttonSelected(Button button, int index) { - try { - switch (index) { - case ADD_TARGET : - { - MakeTargetDialog dialog = new MakeTargetDialog(getControl().getShell(), fContainer); - dialog.open(); - } - break; - case REMOVE_TARGET : - IMakeTargetManager manager = MakeCorePlugin.getDefault().getTargetManager(); - manager.removeTarget((IMakeTarget) ((IStructuredSelection) getViewer().getSelection()).getFirstElement()); - break; - case EDIT_TARGET : - { - MakeTargetDialog dialog = - new MakeTargetDialog( - getControl().getShell(), - (IMakeTarget) ((IStructuredSelection) getViewer().getSelection()).getFirstElement()); - dialog.open(); - } - - break; - } - } catch (CoreException e) { - MakeUIPlugin.errorDialog(getControl().getShell(), "Error", "Error", e); - } - } - - protected void selectionChanged(IStructuredSelection selection) { - fSelectedTarget = (IMakeTarget) selection.getFirstElement(); - if (getViewer() != null) { - updateEnabledState(); - } - } - - public void setSelectedTarget(IMakeTarget target) { - fSelectedTarget = target; - if (tableViewer != null) { - tableViewer.setSelection(new StructuredSelection(fSelectedTarget), false); - } - } - - public IMakeTarget getSelectedTarget() { - return fSelectedTarget; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.make.internal.ui.part.SharedPart#updateEnabledState() - */ - protected void updateEnabledState() { - super.updateEnabledState(); - setButtonEnabled(REMOVE_TARGET, fSelectedTarget != null && isEnabled()); - setButtonEnabled(EDIT_TARGET, fSelectedTarget != null && isEnabled()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.make.internal.ui.part.SharedPart#createControl(org.eclipse.swt.widgets.Composite, int, int) - */ - public void createControl(Composite parent, int style, int span) { - super.createControl(parent, style, span); - updateEnabledState(); - if (getViewer() != null && fSelectedTarget != null) { - getViewer().setSelection(new StructuredSelection(fSelectedTarget)); - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractTargetAction.java deleted file mode 100644 index e154c6716ba..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractTargetAction.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Created on 25-Sep-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui.actions; - -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.actions.ActionDelegate; - -public abstract class AbstractTargetAction - extends ActionDelegate - implements IObjectActionDelegate, IWorkbenchWindowActionDelegate { - private IWorkbenchPart fPart; - private IWorkbenchWindow fWindow; - private IContainer fContainer; - - protected Shell getShell() { - if (fPart != null) { - return fPart.getSite().getShell(); - } else if (fWindow != null) { - return fWindow.getShell(); - } - return MakeUIPlugin.getActiveWorkbenchShell(); - } - - protected IContainer getSelectedContainer() { - return fContainer; - } - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - fPart = targetPart; - } - - public void init(IWorkbenchWindow window) { - fWindow = window; - } - - public void selectionChanged(IAction action, ISelection selection) { - boolean enabled = false; - if (selection instanceof IStructuredSelection) { - IStructuredSelection sel = (IStructuredSelection) selection; - Object obj = sel.getFirstElement(); - if (obj instanceof ICElement) { - if ( obj instanceof ICContainer) { - fContainer = (IContainer) ((ICContainer) obj).getUnderlyingResource(); - } else { - obj = ((ICElement)obj).getResource(); - if ( obj != null) { - fContainer = ((IResource)obj).getParent(); - } - } - } else if (obj instanceof IResource) { - if (obj instanceof IContainer) { - fContainer = (IContainer) obj; - } else { - fContainer = ((IResource)obj).getParent(); - } - } else { - fContainer = null; - } - if (fContainer != null && MakeCorePlugin.getDefault().getTargetManager().hasTargetBuilder(fContainer.getProject())) { - enabled = true; - } - } - action.setEnabled(enabled); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetAction.java deleted file mode 100644 index 4d0691504ca..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetAction.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Created on 25-Jul-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui.actions; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.dialogs.BuildTargetDialog; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.window.Window; - -public class BuildTargetAction extends AbstractTargetAction { - - public void run(IAction action) { - IContainer container = getSelectedContainer(); - if (container != null) { - BuildTargetDialog dialog = new BuildTargetDialog(getShell(), container); - String name = null; - try { - name = (String) container.getSessionProperty(new QualifiedName(MakeUIPlugin.getUniqueIdentifier(), "lastTarget")); - } catch (CoreException e) { - } - if ( name != null) { - IPath path = new Path(name); - name = path.segment(path.segmentCount() - 1); - IContainer targetContainer; - if ( path.segmentCount() > 1) { - path = path.removeLastSegments(1); - targetContainer = (IContainer) container.findMember(path); - } else { - targetContainer = container; - } - IMakeTarget target = MakeCorePlugin.getDefault().getTargetManager().findTarget(targetContainer, name); - if (target != null) - dialog.setTarget(target); - } - if (dialog.open() == Window.OK) { - IMakeTarget target = dialog.getTarget(); - if (target != null) { - try { - IPath path = target.getContainer().getProjectRelativePath().removeFirstSegments(container.getProjectRelativePath().segmentCount()); - path = path.append(target.getName()); - container.setSessionProperty( - new QualifiedName(MakeUIPlugin.getUniqueIdentifier(), "lastTarget"), - path.toString()); - } catch (CoreException e1) { - } - } - } - } - } - - - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateTargetAction.java deleted file mode 100644 index 9505072608e..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateTargetAction.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Created on 25-Jul-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui.actions; - -import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; - -public class CreateTargetAction extends AbstractTargetAction { - - public void run(IAction action) { - if ( getSelectedContainer() != null ) { - MakeTargetDialog dialog; - try { - dialog = new MakeTargetDialog(getShell(), getSelectedContainer()); - dialog.open(); - } catch (CoreException e) { - } - } - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java deleted file mode 100644 index 628861584e3..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Created on 25-Jul-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui.actions; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Vector; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetManager; -import org.eclipse.cdt.make.core.MakeBuilder; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeProjectNature; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.wizards.UpdateMakeProjectWizard; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate { - - private ISelection fSelection; - - public void dispose() { - } - - public void init(IWorkbenchWindow window) { - } - - public void run(IAction action) { - if (fSelection instanceof IStructuredSelection) { - Object[] elems = ((IStructuredSelection) fSelection).toArray(); - ArrayList projects = new ArrayList(elems.length); - - for (int i = 0; i < elems.length; i++) { - Object elem = elems[i]; - IProject project = null; - - if (elem instanceof IFile) { - IFile file = (IFile) elem; - project = file.getProject(); - } else if (elem instanceof IProject) { - project = (IProject) elem; - } else if (elem instanceof ICProject) { - project = ((ICProject) elem).getProject(); - } - if (project != null) { - projects.add(project); - } - } - - final IProject[] projectArray = (IProject[]) projects.toArray(new IProject[projects.size()]); - - UpdateMakeProjectWizard wizard = new UpdateMakeProjectWizard(projectArray); - WizardDialog dialog = new WizardDialog(MakeUIPlugin.getActiveWorkbenchShell(), wizard); - dialog.open(); - } - - } - - public static IProject[] getOldProjects() { - IProject[] project = MakeUIPlugin.getWorkspace().getRoot().getProjects(); - Vector result = new Vector(); - try { - for (int i = 0; i < project.length; i++) { - if (isOldProject(project[i])) { - result.add(project[i]); - } - } - } catch (CoreException e) { - MakeUIPlugin.logException(e); - } - - return (IProject[]) result.toArray(new IProject[result.size()]); - } - - protected static boolean isOldProject(IProject project) throws CoreException { - if (project.isAccessible()) { - IProjectDescription desc = project.getDescription(); - ICommand builder[] = desc.getBuildSpec(); - for (int j = 0; j < builder.length; j++) { - if (builder[j].getBuilderName().equals(MakeCorePlugin.OLD_BUILDER_ID)) { - return true; - } - } - } - return false; - } - - static public void run(boolean fork, IRunnableContext context, final IProject[] projects) { - try { - context.run(fork, true, new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - doProjectUpdate(monitor, projects); - } - }; - MakeUIPlugin.getWorkspace().run(runnable, monitor); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } catch (OperationCanceledException e) { - throw new InterruptedException(e.getMessage()); - } - } - }); - } catch (InterruptedException e) { - return; - } catch (InvocationTargetException e) { - MakeUIPlugin.logException(e, "Error", "Error updating Make Projects"); - } - } - - public static class TargetConvertVisitor implements IResourceProxyVisitor { - private final int TOTAL_WORK = 100; - private int halfWay = TOTAL_WORK / 2; - private int currentIncrement = 4; - private int nextProgress = currentIncrement; - private int worked = 0; - IProgressMonitor monitor; - - public TargetConvertVisitor(IProgressMonitor monitor) { - this.monitor = monitor; - monitor.beginTask("Converting Make Targets...", TOTAL_WORK); - } - - public boolean visit(IResourceProxy proxy) throws CoreException { - try { - if (proxy.getType() != IResource.FOLDER && proxy.getType() != IResource.PROJECT) { - return false; - } - IContainer container = (IContainer) proxy.requestResource(); - monitor.subTask(container.getProjectRelativePath().toString()); - QualifiedName qName = new QualifiedName("org.eclipse.cdt.make", "goals"); - String goal = container.getPersistentProperty(qName); - if (goal != null) { - goal = goal.trim(); - IMakeTargetManager manager = MakeCorePlugin.getDefault().getTargetManager(); - String[] builder = manager.getTargetBuilders(container.getProject()); - IMakeTarget target = manager.createTarget(container.getProject(), goal, builder[0]); - target.setBuildTarget(goal); - manager.addTarget(container, target); - container.setPersistentProperty(qName, null); - } - return true; - } finally { - if (--nextProgress <= 0) { - //we have exhausted the current increment, so report progress - monitor.worked(1); - worked++; - if (worked >= halfWay) { - //we have passed the current halfway point, so double the - //increment and reset the halfway point. - currentIncrement *= 2; - halfWay += (TOTAL_WORK - halfWay) / 2; - } - //reset the progress counter to another full increment - nextProgress = currentIncrement; - } - - } - } - } - - protected static void doProjectUpdate(IProgressMonitor monitor, IProject[] project) throws CoreException { - monitor.beginTask("Updating make Projects...", project.length * 4); - try { - for (int i = 0; i < project.length; i++) { - // remove old builder - project[i].refreshLocal(IResource.DEPTH_ONE, new SubProgressMonitor(monitor, 1)); - MakeProjectNature.removeFromBuildSpec( - project[i], - MakeCorePlugin.OLD_BUILDER_ID, - new SubProgressMonitor(monitor, 1)); - - // convert .cdtproject - CCorePlugin.getDefault().mapCProjectOwner(project[i], MakeCorePlugin.MAKE_PROJECT_ID, true); - // add new nature - MakeProjectNature.addNature(project[i], new SubProgressMonitor(monitor, 1)); - - // move existing build properties to new - IMakeBuilderInfo newInfo = MakeCorePlugin.createBuildInfo(project[i], MakeBuilder.BUILDER_ID); - final int LOCATION = 0, FULL_ARGS = 1, INC_ARGS = 2, STOP_ERORR = 3, USE_DEFAULT = 4; - QualifiedName[] qName = new QualifiedName[USE_DEFAULT + 1]; - qName[LOCATION] = new QualifiedName(CCorePlugin.PLUGIN_ID, "buildLocation"); - qName[FULL_ARGS] = new QualifiedName(CCorePlugin.PLUGIN_ID, "buildFullArguments"); - qName[INC_ARGS] = new QualifiedName(CCorePlugin.PLUGIN_ID, "buildIncrementalArguments"); - qName[STOP_ERORR] = new QualifiedName(CCorePlugin.PLUGIN_ID, "stopOnError"); - qName[USE_DEFAULT] = new QualifiedName(CCorePlugin.PLUGIN_ID, "useDefaultBuildCmd"); - - String property = project[i].getPersistentProperty(qName[LOCATION]); - if (property != null) { - newInfo.setBuildCommand(new Path(property)); - } - property = project[i].getPersistentProperty(qName[FULL_ARGS]); - if (property != null) { - newInfo.setBuildArguments(property); - } - property = project[i].getPersistentProperty(qName[STOP_ERORR]); - if (property != null) { - newInfo.setStopOnError(Boolean.valueOf(property).booleanValue()); - } - property = project[i].getPersistentProperty(qName[USE_DEFAULT]); - if (property != null) { - newInfo.setUseDefaultBuildCmd(Boolean.valueOf(property).booleanValue()); - } - for (int j = 0; j < qName.length; j++) { - project[i].setPersistentProperty(qName[j], null); - } - - IProgressMonitor subMon = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - project[i].accept(new TargetConvertVisitor(subMon), 0); - monitor.worked(1); - } - } finally { - monitor.done(); - } - } - - public void selectionChanged(IAction action, ISelection selection) { - boolean enabled = false; - fSelection = selection; - if (fSelection instanceof IStructuredSelection) { - Object sel = ((IStructuredSelection) fSelection).getFirstElement(); - if (sel instanceof IAdaptable) { - IResource res = (IResource) ((IAdaptable) sel).getAdapter(IResource.class); - try { - if (res instanceof IProject && isOldProject((IProject) res)) { - enabled = true; - } - } catch (CoreException e) { - } - } - } - action.setEnabled(enabled); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java deleted file mode 100644 index 45d95edbe6c..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java +++ /dev/null @@ -1,643 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * QNX Software Systems - Move to Make plugin -***********************************************************************/ -package org.eclipse.cdt.make.ui.dialogs; - -import java.util.ArrayList; -import java.util.StringTokenizer; - -import org.eclipse.cdt.internal.ui.util.SWTUtil; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeScannerInfo; -import org.eclipse.cdt.make.core.MakeScannerProvider; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.IMakeHelpContextIds; -import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.help.WorkbenchHelp; - -public class BuildPathInfoBlock extends AbstractCOptionPage { - private static final int PROJECT_LIST_MULTIPLIER = 10; - - private static final String PREF_SYMBOLS = "ScannerSymbols"; - private static final String PREF_INCLUDES = "ScannerIncludes"; - private static final String PREFIX = "BuildPathInfoBlock"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String PATHS = PREFIX + ".paths"; //$NON-NLS-1$ - private static final String SYMBOLS = PREFIX + ".symbols"; //$NON-NLS-1$ - private static final String BROWSE = PREFIX + ".browse"; //$NON-NLS-1$ - private static final String PATH_TITLE = BROWSE + ".path"; //$NON-NLS-1$ - private static final String EDIT_PATH_TITLE = BROWSE + ".path.edit"; //$NON-NLS-1$ - private static final String PATH_LABEL = BROWSE + ".path.label"; //$NON-NLS-1$ - private static final String SYMBOL_TITLE = BROWSE + ".symbol"; //$NON-NLS-1$ - private static final String EDIT_SYMBOL_TITLE = BROWSE + ".symbol.edit"; //$NON-NLS-1$ - private static final String SYMBOL_LABEL = BROWSE + ".symbol.label"; //$NON-NLS-1$ - private static final String NEW = "BuildPropertyCommon.label.new"; //$NON-NLS-1$ - private static final String EDIT = "BuildPropertyCommon.label.edit"; //$NON-NLS-1$ - private static final String REMOVE = "BuildPropertyCommon.label.remove"; //$NON-NLS-1$ - private static final String UP = "BuildPropertyCommon.label.up"; //$NON-NLS-1$ - private static final String DOWN = "BuildPropertyCommon.label.down"; //$NON-NLS-1$ - - private List pathList; - private List symbolList; - private Composite pathButtonComp; - private Button addPath; - private Button editPath; - private Button removePath; - private Button pathUp; - private Button pathDown; - private Composite symbolButtonComp; - private Button addSymbol; - private Button editSymbol; - private Button removeSymbol; - private Button symbolUp; - private Button symbolDown; - private Shell shell; - - public BuildPathInfoBlock() { - super(MakeUIPlugin.getResourceString(LABEL)); - setDescription("Set the include paths and preprocessor symbols for this project"); - } - - private void createPathListButtons(Composite parent) { - // Create a composite for the buttons - pathButtonComp = ControlFactory.createComposite(parent, 1); - pathButtonComp.setFont(parent.getFont()); - - // Add the buttons - addPath = ControlFactory.createPushButton(pathButtonComp, MakeUIPlugin.getResourceString(NEW)); - addPath.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleAddPath(); - } - }); - addPath.setEnabled(true); - addPath.setFont(parent.getFont()); - addPath.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(addPath); - - editPath = ControlFactory.createPushButton(pathButtonComp, MakeUIPlugin.getResourceString(EDIT)); - editPath.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - editPathListItem(); - } - }); - editPath.setEnabled(true); - editPath.setFont(parent.getFont()); - editPath.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(editPath); - - removePath = ControlFactory.createPushButton(pathButtonComp, MakeUIPlugin.getResourceString(REMOVE)); - removePath.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleRemovePath(); - } - }); - removePath.setFont(parent.getFont()); - removePath.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(removePath); - - pathUp = ControlFactory.createPushButton(pathButtonComp, MakeUIPlugin.getResourceString(UP)); - pathUp.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handlePathUp(); - } - }); - pathUp.setFont(parent.getFont()); - pathUp.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(pathUp); - - pathDown = ControlFactory.createPushButton(pathButtonComp, MakeUIPlugin.getResourceString(DOWN)); - pathDown.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handlePathDown(); - } - }); - pathDown.setFont(parent.getFont()); - pathDown.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(pathDown); - - } - - private void createPathListControl(Composite parent, int numColumns) { - // Create the list - pathList = new List(parent, SWT.BORDER | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL); - pathList.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - enablePathButtons(); - } - }); - pathList.addMouseListener(new MouseAdapter() { - public void mouseDoubleClick(MouseEvent e) { - editPathListItem(); - } - }); - - // Make it occupy the first 2 columns - GridData gd = new GridData(GridData.FILL_BOTH); - gd.grabExcessHorizontalSpace = true; - gd.horizontalSpan = numColumns - 1; - gd.heightHint = getDefaultFontHeight(pathList, PROJECT_LIST_MULTIPLIER); - pathList.setLayoutData(gd); - pathList.setFont(parent.getFont()); - - } - - /** - * Get the defualt widget height for the supplied control. - * @return int - * @param control - the control being queried about fonts - * @param lines - the number of lines to be shown on the table. - */ - private static int getDefaultFontHeight(Control control, int lines) { - FontData[] viewerFontData = control.getFont().getFontData(); - int fontHeight = 10; - - //If we have no font data use our guess - if (viewerFontData.length > 0) - fontHeight = viewerFontData[0].getHeight(); - return lines * fontHeight; - } - - private void createSymbolListButtons(Composite parent) { - // Create a composite for the buttons - symbolButtonComp = ControlFactory.createComposite(parent, 1); - symbolButtonComp.setFont(parent.getFont()); - - // Add the buttons - addSymbol = ControlFactory.createPushButton(symbolButtonComp, MakeUIPlugin.getResourceString(NEW)); - addSymbol.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleAddSymbol(); - } - }); - addSymbol.setEnabled(true); - addSymbol.setFont(parent.getFont()); - addSymbol.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(addSymbol); - - editSymbol = ControlFactory.createPushButton(symbolButtonComp, MakeUIPlugin.getResourceString(EDIT)); - editSymbol.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - editSymbolListItem(); - } - }); - editSymbol.setEnabled(true); - editSymbol.setFont(parent.getFont()); - editSymbol.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(editSymbol); - - removeSymbol = ControlFactory.createPushButton(symbolButtonComp, MakeUIPlugin.getResourceString(REMOVE)); - removeSymbol.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleRemoveSymbol(); - } - }); - removeSymbol.setFont(parent.getFont()); - removeSymbol.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(removeSymbol); - - symbolUp = ControlFactory.createPushButton(symbolButtonComp, MakeUIPlugin.getResourceString(UP)); - symbolUp.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleSymbolUp(); - } - }); - symbolUp.setFont(parent.getFont()); - symbolUp.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(symbolUp); - - symbolDown = ControlFactory.createPushButton(symbolButtonComp, MakeUIPlugin.getResourceString(DOWN)); - symbolDown.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleSymbolDown(); - } - }); - symbolDown.setFont(parent.getFont()); - symbolDown.setLayoutData(new GridData()); - SWTUtil.setButtonDimensionHint(symbolDown); - } - - private void createSymbolListControl(Composite parent, int numColumns) { - // Create the list - symbolList = new List(parent, SWT.BORDER | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL); - symbolList.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - enableSymbolButtons(); - } - }); - symbolList.addMouseListener(new MouseAdapter() { - public void mouseDoubleClick(MouseEvent e) { - editSymbolListItem(); - } - }); - - // Make it occupy the first n-1 columns - GridData gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = numColumns - 1; - gd.grabExcessHorizontalSpace = true; - gd.heightHint = getDefaultFontHeight(pathList, PROJECT_LIST_MULTIPLIER); - symbolList.setLayoutData(gd); - symbolList.setFont(parent.getFont()); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.IWizardTab#doRun(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IProgressMonitor) - */ - public void performApply(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - if (getContainer().getProject() != null) { - // Store the paths and symbols - monitor.beginTask("Setting Scanner Info", 3); - MakeScannerInfo info = MakeScannerProvider.getDefault().getMakeScannerInfo(getContainer().getProject(), false); - info.setIncludePaths(getPathListContents()); - monitor.worked(1); - info.setPreprocessorSymbols(getSymbolListContents()); - monitor.worked(1); - info.update(); - monitor.done(); - } else { - setIncludes(MakeCorePlugin.getDefault().getPluginPreferences()); - setSymbols(MakeCorePlugin.getDefault().getPluginPreferences()); - } - } - - public void performDefaults() { - pathList.removeAll(); - symbolList.removeAll(); - if (getContainer().getProject() != null) { - pathList.setItems(getIncludes(MakeCorePlugin.getDefault().getPluginPreferences())); - symbolList.setItems(getSymbols(MakeCorePlugin.getDefault().getPluginPreferences())); - } - getContainer().updateContainer(); - } - - private void setSymbols(Preferences prefs) { - prefs.setValue(PREF_SYMBOLS, stringArrayToString(getSymbolListContents())); - } - - private void setIncludes(Preferences prefs) { - prefs.setValue(PREF_INCLUDES, stringArrayToString(getPathListContents())); - } - - private String stringArrayToString(String[] strings) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < strings.length; i++) { - buf.append(strings[i]).append(';'); - } - return buf.toString(); - } - - private String[] getSymbols(Preferences prefs) { - String syms = prefs.getString(PREF_SYMBOLS); - return parseStringToList(syms); - } - - private String[] getIncludes(Preferences prefs) { - String syms = prefs.getString(PREF_INCLUDES); - return parseStringToList(syms); - } - - private String[] parseStringToList(String syms) { - if (syms != null && syms.length() > 0) { - StringTokenizer tok = new StringTokenizer(syms, ";"); - ArrayList list = new ArrayList(tok.countTokens()); - while (tok.hasMoreElements()) { - list.add(tok.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - return new String[0]; - } - - /* - * Double-click handler to allow edit of path information - */ - protected void editPathListItem() { - // Edit the selection index - int index = pathList.getSelectionIndex(); - if (index != -1) { - String selItem = pathList.getItem(index); - if (selItem != null) { - InputDialog dialog = - new InputDialog( - shell, - MakeUIPlugin.getResourceString(EDIT_PATH_TITLE), - MakeUIPlugin.getResourceString(PATH_LABEL), - selItem, - null); - String newItem = null; - if (dialog.open() == InputDialog.OK) { - newItem = dialog.getValue(); - if (newItem != null && !newItem.equals(selItem)) { - pathList.setItem(index, newItem); - } - } - } - } - } - - /* - * Double-click handler to allow edit of symbol information - */ - protected void editSymbolListItem() { - // Edit the selection index - int index = symbolList.getSelectionIndex(); - if (index != -1) { - String selItem = symbolList.getItem(index); - if (selItem != null) { - InputDialog dialog = - new InputDialog( - shell, - MakeUIPlugin.getResourceString(EDIT_SYMBOL_TITLE), - MakeUIPlugin.getResourceString(SYMBOL_LABEL), - selItem, - null); - String newItem = null; - if (dialog.open() == InputDialog.OK) { - newItem = dialog.getValue(); - if (newItem != null && !newItem.equals(selItem)) { - symbolList.setItem(index, newItem); - } - } - } - } - } - - /* - * Enables the buttons on the path control if the right conditions are met - */ - void enablePathButtons() { - // Enable the remove button if there is at least 1 item in the list - int items = pathList.getItemCount(); - if (items > 0) { - editPath.setEnabled(true); - removePath.setEnabled(true); - // Enable the up/down buttons depending on what item is selected - int index = pathList.getSelectionIndex(); - pathUp.setEnabled(items > 1 && index > 0); - pathDown.setEnabled(items > 1 && index < (items - 1)); - } else { - editPath.setEnabled(false); - removePath.setEnabled(false); - pathUp.setEnabled(false); - pathDown.setEnabled(false); - } - } - - void enableSymbolButtons() { - // Enable the remove button if there is at least 1 item in the list - int items = symbolList.getItemCount(); - if (items > 0) { - editSymbol.setEnabled(true); - removeSymbol.setEnabled(true); - // Enable the up/down buttons depending on what item is selected - int index = symbolList.getSelectionIndex(); - symbolUp.setEnabled(items > 1 && index > 0); - symbolDown.setEnabled(items > 1 && index < (items - 1)); - } else { - editSymbol.setEnabled(false); - removeSymbol.setEnabled(false); - symbolUp.setEnabled(false); - symbolDown.setEnabled(false); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.IWizardTab#getControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - // Create the composite control for the tab - int tabColumns = 3; - Font font = parent.getFont(); - Composite composite = ControlFactory.createComposite(parent, tabColumns); - composite.setFont(font); - GridData gd; - setControl(composite); - - WorkbenchHelp.setHelp(getControl(), IMakeHelpContextIds.MAKE_PATH_SYMBOL_SETTINGS); - - // Create a label for the include paths control - Label paths = ControlFactory.createLabel(composite, MakeUIPlugin.getResourceString(PATHS)); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = tabColumns; - paths.setLayoutData(gd); - paths.setFont(font); - - //Create the list and button controls - createPathListControl(composite, tabColumns); - createPathListButtons(composite); - enablePathButtons(); - - // Create a label for the symbols control - Label symbols = ControlFactory.createLabel(composite, MakeUIPlugin.getResourceString(SYMBOLS)); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = tabColumns; - symbols.setLayoutData(gd); - symbols.setFont(font); - - // Create list and button controls for symbols - createSymbolListControl(composite, tabColumns); - createSymbolListButtons(composite); - enableSymbolButtons(); - - setListContents(); - pathList.select(0); - enablePathButtons(); - symbolList.select(0); - enableSymbolButtons(); - } - - private String[] getPathListContents() { - return pathList.getItems(); - } - - private String[] getSymbolListContents() { - return symbolList.getItems(); - } - - protected void handleAddPath() { - // Popup an entry dialog - InputDialog dialog = new InputDialog(shell, MakeUIPlugin.getResourceString(PATH_TITLE), MakeUIPlugin.getResourceString(PATH_LABEL), "", null); //$NON-NLS-1$ - String path = null; - if (dialog.open() == InputDialog.OK) { - path = dialog.getValue(); - } - if (path != null && path.length() > 0) { - pathList.add(path); - pathList.select(pathList.getItemCount() - 1); - enablePathButtons(); - } - } - - protected void handleAddSymbol() { - // Popup an entry dialog - InputDialog dialog = new InputDialog(shell, MakeUIPlugin.getResourceString(SYMBOL_TITLE), MakeUIPlugin.getResourceString(SYMBOL_LABEL), "", null); //$NON-NLS-1$ - String symbol = null; - if (dialog.open() == InputDialog.OK) { - symbol = dialog.getValue(); - } - if (symbol != null && symbol.length() > 0) { - symbolList.add(symbol); - symbolList.select(symbolList.getItemCount() - 1); - enableSymbolButtons(); - } - } - - protected void handlePathDown() { - // Get the selection index - int index = pathList.getSelectionIndex(); - int items = pathList.getItemCount(); - if (index == -1 || index == items - 1) { - return; - } - // Swap the items in the list - String selItem = pathList.getItem(index); - pathList.remove(index); - if (index + 1 == items) { - pathList.add(selItem); - } else { - pathList.add(selItem, ++index); - } - - // Keep the swapped item selected - pathList.select(index); - enablePathButtons(); - } - - protected void handlePathUp() { - // Get the selection index - int index = pathList.getSelectionIndex(); - if (index == -1 || index == 0) { - return; - } - // Swap the items in the list - String selItem = pathList.getItem(index); - pathList.remove(index); - pathList.add(selItem, --index); - - // Keep the index selected - pathList.select(index); - enablePathButtons(); - } - - protected void handleRemovePath() { - // Get the selection index - int index = pathList.getSelectionIndex(); - if (index == -1) { - return; - } - - // Remove the element at that index - pathList.remove(index); - index = index - 1 < 0 ? 0 : index - 1; - pathList.select(index); - - // Check if the buttons should still be enabled - enablePathButtons(); - } - - protected void handleRemoveSymbol() { - // Get the selection index - int index = symbolList.getSelectionIndex(); - if (index == -1) { - return; - } - // Remove the item at that index - symbolList.remove(index); - index = index - 1 < 0 ? 0 : index - 1; - symbolList.select(index); - // Check if the button state should be toggled - enableSymbolButtons(); - } - - protected void handleSymbolDown() { - // Get the selection index - int index = symbolList.getSelectionIndex(); - int items = symbolList.getItemCount(); - if (index == -1 || index == items - 1) { - return; - } - // Swap the items in the list - String selItem = symbolList.getItem(index); - symbolList.remove(index); - if (index + 1 == items) { - symbolList.add(selItem); - } else { - symbolList.add(selItem, ++index); - } - - // Keep the swapped item selected - symbolList.select(index); - enableSymbolButtons(); - } - - protected void handleSymbolUp() { - // Get the selection index - int index = symbolList.getSelectionIndex(); - if (index == -1 || index == 0) { - return; - } - // Swap the items in the list - String selItem = symbolList.getItem(index); - symbolList.remove(index); - symbolList.add(selItem, --index); - - // Keep the index selected - symbolList.select(index); - enableSymbolButtons(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.IWizardTab#isValid() - */ - public boolean isValid() { - // Info on this page is not critical - return true; - } - - private void setListContents() { - if (getContainer().getProject() != null) { - MakeScannerInfo info; - try { - info = MakeScannerProvider.getDefault().getMakeScannerInfo(getContainer().getProject(), false); - pathList.setItems(info.getIncludePaths()); - symbolList.setItems(info.getPreprocessorSymbols()); - } catch (CoreException e) { - } - } else { - pathList.setItems(getIncludes(MakeCorePlugin.getDefault().getPluginPreferences())); - symbolList.setItems(getSymbols(MakeCorePlugin.getDefault().getPluginPreferences())); - } - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildTargetDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildTargetDialog.java deleted file mode 100644 index f9fd94f3e54..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildTargetDialog.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.eclipse.cdt.make.ui.dialogs; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.ui.TargetBuild; -import org.eclipse.cdt.make.ui.TargetListViewerPart; -import org.eclipse.core.resources.IContainer; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -public class BuildTargetDialog extends Dialog { - private TargetListViewerPart targetPart; - private IContainer fContainer; - - public BuildTargetDialog(Shell shell, IContainer container) { - super(shell); - fContainer = container; - targetPart = new TargetListViewerPart(fContainer); - } - - public void setTarget(IMakeTarget target) { - targetPart.setSelectedTarget(target); - } - - public IMakeTarget getTarget() { - return targetPart.getSelectedTarget(); - } - - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Build Targets"); - } - - protected void createButtonsForButtonBar(Composite parent) { - // create Build and Cancel buttons by default - createButton(parent, IDialogConstants.OK_ID, "Build", true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - getButton(IDialogConstants.OK_ID).setEnabled(targetPart.getSelectedTarget() != null); - } - - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - ((GridLayout) composite.getLayout()).numColumns = 2; - Label title = new Label(composite, SWT.NONE); - GridData gd = new GridData(); - gd.horizontalSpan = 2; - title.setLayoutData(gd); - title.setText("Make Targets for: " + fContainer.getFullPath().toString().substring(1)); - targetPart.createControl(composite, SWT.NULL, 2); - - gd = (GridData) targetPart.getControl().getLayoutData(); - gd.heightHint = convertHeightInCharsToPixels(15); - gd.widthHint = convertWidthInCharsToPixels(50); - targetPart.getControl().setLayoutData(gd); - targetPart.getViewer().addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent event) { - okPressed(); - } - }); - targetPart.getViewer().addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - getButton(IDialogConstants.OK_ID).setEnabled(targetPart.getSelectedTarget() != null); - } - }); - return composite; - } - - protected void okPressed() { - IMakeTarget selected = targetPart.getSelectedTarget(); - super.okPressed(); - if (selected != null) { - TargetBuild.runWithProgressDialog(getParentShell(), new IMakeTarget[] { selected }); - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java deleted file mode 100644 index ad9a0f0a360..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/MakeTargetDialog.java +++ /dev/null @@ -1,361 +0,0 @@ -/******************************************************************************* - * Created on 22-Aug-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: QNX Software Systems - Initial API and implementation - ******************************************************************************/ -package org.eclipse.cdt.make.ui.dialogs; - -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetManager; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.internal.ui.MessageLine; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class MakeTargetDialog extends Dialog { - - protected MessageLine fStatusLine; - private static final String TARGET_PREFIX = "TargetBlock"; //$NON-NLS-1$ - private static final String TARGET_NAME_LABEL = TARGET_PREFIX + ".target.label"; - - private static final String BUILD_ARGUMENT_PREFIX = "BuildTarget"; //$NON-NLS-1$ - private static final String BUILD_ARGUMENT_GROUP = BUILD_ARGUMENT_PREFIX + ".target.group_label"; - private static final String BUILD_ARGUMENT_LABEL = BUILD_ARGUMENT_PREFIX + ".target.label"; - - private static final String SETTING_PREFIX = "SettingsBlock"; //$NON-NLS-1$ - - private static final String MAKE_SETTING_GROUP = SETTING_PREFIX + ".makeSetting.group_label"; //$NON-NLS-1$ - private static final String MAKE_SETTING_STOP_ERROR = SETTING_PREFIX + ".makeSetting.stopOnError"; //$NON-NLS-1$ - - private static final String MAKE_CMD_GROUP = SETTING_PREFIX + ".makeCmd.group_label"; //$NON-NLS-1$ - private static final String MAKE_CMD_USE_DEFAULT = SETTING_PREFIX + ".makeCmd.use_default"; //$NON-NLS-1$ - private static final String MAKE_CMD_LABEL = SETTING_PREFIX + ".makeCmd.label"; //$NON-NLS-1$ - - Text targetNameText; - Button stopOnErrorButton; - Text commandText; - Button defButton; - Text targetText; - - IMakeTargetManager fTargetManager; - IContainer fContainer; - - private IPath buildCommand; - private boolean isDefaultCommand; - private boolean isStopOnError; - private String buildArguments; - private String targetString; - private String targetName; - private String targetBuildID; - protected IMakeTarget fTarget; - - /** - * @param parentShell - */ - public MakeTargetDialog(Shell parentShell, IMakeTarget target) throws CoreException { - this(parentShell, target.getContainer()); - fTarget = target; - isStopOnError = target.isStopOnError(); - isDefaultCommand = target.isDefaultBuildCmd(); - buildCommand = target.getBuildCommand(); - buildArguments = target.getBuildArguments(); - targetName = target.getName(); - targetString = target.getBuildTarget(); - targetBuildID = target.getTargetBuilderID(); - } - - /** - * @param parentShell - */ - public MakeTargetDialog(Shell parentShell, IContainer container) throws CoreException { - super(parentShell); - fContainer = container; - fTargetManager = MakeCorePlugin.getDefault().getTargetManager(); - String[] id = fTargetManager.getTargetBuilders(container.getProject()); - if (id.length == 0) { - throw new CoreException( - new Status(IStatus.ERROR, MakeUIPlugin.getUniqueIdentifier(), -1, "Not target builders on the project", null)); - } - targetBuildID = id[0]; - IMakeBuilderInfo buildInfo = - MakeCorePlugin.createBuildInfo(container.getProject(), fTargetManager.getBuilderID(targetBuildID)); - isStopOnError = buildInfo.isStopOnError(); - isDefaultCommand = buildInfo.isDefaultBuildCmd(); - buildCommand = buildInfo.getBuildCommand(); - buildArguments = buildInfo.getBuildArguments(); - targetString = buildInfo.getIncrementalBuildTarget(); - } - - protected void configureShell(Shell newShell) { - String title; - if (fTarget == null) { - title = "Create Make target."; - } else { - title = "Modify Make target,"; - } - newShell.setText(title); - super.configureShell(newShell); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - initializeDialogUnits(composite); - - String title; - if (fTarget == null) { - title = "Create a new Make target."; - } else { - title = "Modify a Make target,"; - } - - fStatusLine = new MessageLine(composite); - fStatusLine.setAlignment(SWT.LEFT); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.widthHint = convertWidthInCharsToPixels(50); - fStatusLine.setLayoutData(gd); - fStatusLine.setMessage(title); - - createNameControl(composite); - createTargetControl(composite); - createBuildCmdControls(composite); - createSettingControls(composite); - return composite; - } - - protected void createNameControl(Composite parent) { - Composite composite = ControlFactory.createComposite(parent, 2); - ((GridLayout) composite.getLayout()).makeColumnsEqualWidth = false; - ((GridLayout) composite.getLayout()).horizontalSpacing = 0; - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Label label = ControlFactory.createLabel(composite, MakeUIPlugin.getResourceString(TARGET_NAME_LABEL)); - ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING; - ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false; - targetNameText = ControlFactory.createTextField(composite, SWT.SINGLE | SWT.BORDER); - ((GridData) (targetNameText.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (targetNameText.getLayoutData())).grabExcessHorizontalSpace = true; - targetNameText.addListener(SWT.Modify, new Listener() { - public void handleEvent(Event e) { - String newName = targetNameText.getText().trim(); - if (newName.equals("")) { - fStatusLine.setErrorMessage("Must specify a target name."); - getButton(IDialogConstants.OK_ID).setEnabled(false); - } else if ( - fTarget != null - && fTarget.getName().equals(newName) - || fTargetManager.findTarget(fContainer, newName) == null) { - fStatusLine.setErrorMessage(null); - getButton(IDialogConstants.OK_ID).setEnabled(true); - } else { - fStatusLine.setErrorMessage("Target with that name already exits"); - getButton(IDialogConstants.OK_ID).setEnabled(false); - } - } - }); - } - - protected void createSettingControls(Composite parent) { - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_SETTING_GROUP), 1); - stopOnErrorButton = new Button(group, SWT.CHECK); - stopOnErrorButton.setText(MakeUIPlugin.getResourceString(MAKE_SETTING_STOP_ERROR)); - if (isStopOnError) { - stopOnErrorButton.setSelection(true); - } - if (isDefaultCommand) { - stopOnErrorButton.setEnabled(true); - } else { - stopOnErrorButton.setEnabled(false); - } - } - - protected void createBuildCmdControls(Composite parent) { - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_CMD_GROUP), 1); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.horizontalSpacing = 0; - layout.makeColumnsEqualWidth = false; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT)); - defButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (defButton.getSelection() == true) { - commandText.setEnabled(false); - stopOnErrorButton.setEnabled(true); - } else { - commandText.setEnabled(true); - stopOnErrorButton.setEnabled(false); - } - } - }); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - defButton.setLayoutData(gd); - Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(MAKE_CMD_LABEL)); - ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING; - ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false; - commandText = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - ((GridData) (commandText.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (commandText.getLayoutData())).grabExcessHorizontalSpace = true; - commandText.addListener(SWT.Modify, new Listener() { - public void handleEvent(Event e) { - if (commandText.getText().equals("")) { - fStatusLine.setErrorMessage("Must specify a build command"); - } - } - }); - if (buildCommand != null) { - StringBuffer cmd = new StringBuffer(buildCommand.toOSString()); - if (!isDefaultCommand) { - String args = buildArguments; - if (args != null && !args.equals("")) { //$NON-NLS-1$ - cmd.append(" "); //$NON-NLS-1$ - cmd.append(args); - } - } - commandText.setText(cmd.toString()); - } - if (isDefaultCommand) { - commandText.setEnabled(false); - } else { - commandText.setEnabled(true); - } - defButton.setSelection(isDefaultCommand); - } - - private void createTargetControl(Composite parent) { - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(BUILD_ARGUMENT_GROUP), 1); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = false; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(BUILD_ARGUMENT_LABEL)); - ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING; - ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false; - targetText = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - ((GridData) (targetText.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (targetText.getLayoutData())).grabExcessHorizontalSpace = true; - targetText.setText(targetString); - } - - protected void createButtonsForButtonBar(Composite parent) { - if (fTarget != null) { - createButton(parent, IDialogConstants.OK_ID, "Update", true); - } else { - createButton(parent, IDialogConstants.OK_ID, "Create", true); - } - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - //do this here because setting the text will set enablement on the ok button - targetNameText.setFocus(); - if (targetName != null) { - targetNameText.setText(targetName); - } else { - targetNameText.setText(generateUniqueName(targetString)); - } - targetNameText.selectAll(); - } - - private String generateUniqueName(String targetString) { - String newName = targetString; - int i = 0; - while(fTargetManager.findTarget(fContainer, newName) != null) { - i++; - newName = targetString + " (" + Integer.toString(i) + ")"; - } - return newName; - } - - private boolean isStopOnError() { - return stopOnErrorButton.getSelection(); - } - - private boolean useDefaultBuildCmd() { - return defButton.getSelection(); - } - - private String getBuildLine() { - if (commandText != null) { - String cmd = commandText.getText(); - if (cmd != null) - return cmd.trim(); - } - return null; - } - - protected void okPressed() { - IMakeTarget target = fTarget; - try { - if (fTarget == null) { - target = fTargetManager.createTarget(fContainer.getProject(), targetNameText.getText().trim(), targetBuildID); - } - - target.setStopOnError(isStopOnError()); - target.setUseDefaultBuildCmd(useDefaultBuildCmd()); - if (!useDefaultBuildCmd()) { - String bldLine = getBuildLine(); - int start = 0; - int end = -1; - if (!bldLine.startsWith("\"")) { //$NON-NLS-1$ - end = bldLine.indexOf(' '); - } else { - start = 1; - end = bldLine.indexOf('"', 1); - } - IPath path; - if (end == -1) { - path = new Path(bldLine); - } else { - path = new Path(bldLine.substring(start, end)); - } - target.setBuildCommand(path); - String args = ""; //$NON-NLS-1$ - if (end != -1) { - args = bldLine.substring(end + 1); - } - target.setBuildArguments(args); - } - target.setBuildTarget(targetText.getText().trim()); - - if (fTarget == null) { - fTargetManager.addTarget(fContainer, target); - } else { - if (!target.getName().equals(targetNameText.getText().trim())) { - fTargetManager.renameTarget(target, targetNameText.getText().trim()); - } - } - } catch (CoreException e) { - MakeUIPlugin.errorDialog(getShell(), "Make Target Error", "Error adding target", e); - } - super.okPressed(); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java deleted file mode 100644 index 002dfbaa748..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java +++ /dev/null @@ -1,395 +0,0 @@ -package org.eclipse.cdt.make.ui.dialogs; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.IMakeHelpContextIds; -import org.eclipse.cdt.ui.dialogs.AbstractCOptionPage; -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ContainerSelectionDialog; -import org.eclipse.ui.help.WorkbenchHelp; - -public class SettingsBlock extends AbstractCOptionPage { - - private static final String PREFIX = "SettingsBlock"; //$NON-NLS-1$ - private static final String MAKE_LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String MAKE_MESSAGE = PREFIX + ".message"; //$NON-NLS-1$ - - private static final String MAKE_SETTING_GROUP = PREFIX + ".makeSetting.group_label"; //$NON-NLS-1$ - private static final String MAKE_SETTING_STOP_ERROR = PREFIX + ".makeSetting.stopOnError"; //$NON-NLS-1$ - - private static final String MAKE_CMD_GROUP = PREFIX + ".makeCmd.group_label"; //$NON-NLS-1$ - private static final String MAKE_CMD_USE_DEFAULT = PREFIX + ".makeCmd.use_default"; //$NON-NLS-1$ - private static final String MAKE_CMD_LABEL = PREFIX + ".makeCmd.label"; //$NON-NLS-1$ - - private static final String MAKE_WORKBENCH_BUILD_GROUP = PREFIX + ".makeWorkbench.group_label"; //$NON-NLS-1$ - private static final String MAKE_WORKBENCH_BUILD_TYPE = PREFIX + ".makeWorkbench.type"; //$NON-NLS-1$ - private static final String MAKE_WORKBENCH_BUILD_TARGET = PREFIX + ".makeWorkbench.target"; //$NON-NLS-1$ - private static final String MAKE_WORKBENCH_BUILD_AUTO = PREFIX + ".makeWorkbench.auto"; //$NON-NLS-1$ - private static final String MAKE_WORKBENCH_BUILD_INCR = PREFIX + ".makeWorkbench.incremental"; //$NON-NLS-1$ - private static final String MAKE_WORKBENCH_BUILD_FULL = PREFIX + ".makeWorkbench.full"; //$NON-NLS-1$ - - private static final String MAKE_BUILD_DIR_GROUP = PREFIX + ".makeDir.group_label"; //$NON-NLS-1$ - private static final String MAKE_BUILD_DIR_LABEL = PREFIX + ".makeDir.label"; //$NON-NLS-1$ - private static final String MAKE_BUILD_DIR_BROWSE = PREFIX + ".makeDir.browse"; //$NON-NLS-1$ - - Button stopOnErrorButton; - - Button defButton; - Text buildCommand; - - Text buildLocation; - - Text targetFull; - Text targetIncr; - Text targetAuto; - Button fullButton; - Button incrButton; - Button autoButton; - - private IMakeBuilderInfo fBuildInfo; - private Preferences fPrefs; - private String fBuilderID; - - public SettingsBlock(Preferences prefs, String builderID) { - super(MakeUIPlugin.getResourceString(MAKE_LABEL)); - setDescription(MakeUIPlugin.getResourceString(MAKE_MESSAGE)); - fPrefs = prefs; - fBuilderID = builderID; - } - - protected void createSettingControls(Composite parent) { - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_SETTING_GROUP), 1); - stopOnErrorButton = new Button(group, SWT.CHECK); - stopOnErrorButton.setText(MakeUIPlugin.getResourceString(MAKE_SETTING_STOP_ERROR)); - if (fBuildInfo.isStopOnError()) { - stopOnErrorButton.setSelection(true); - } - } - - protected void createBuildCmdControls(Composite parent) { - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_CMD_GROUP), 1); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = false; - layout.horizontalSpacing = 0; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT)); - defButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (defButton.getSelection() == true) { - buildCommand.setEnabled(false); - stopOnErrorButton.setEnabled(true); - getContainer().updateContainer(); - } else { - buildCommand.setEnabled(true); - stopOnErrorButton.setEnabled(false); - getContainer().updateContainer(); - } - } - }); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - defButton.setLayoutData(gd); - Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(MAKE_CMD_LABEL)); - ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING; - ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false; - buildCommand = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - ((GridData) (buildCommand.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (buildCommand.getLayoutData())).grabExcessHorizontalSpace = true; - buildCommand.addListener(SWT.Modify, new Listener() { - public void handleEvent(Event e) { - getContainer().updateContainer(); - } - }); - if (fBuildInfo.getBuildCommand() != null) { - StringBuffer cmd = new StringBuffer(fBuildInfo.getBuildCommand().toOSString()); - if (!fBuildInfo.isDefaultBuildCmd()) { - String args = fBuildInfo.getBuildArguments(); - if (args != null && !args.equals("")) { //$NON-NLS-1$ - cmd.append(" "); //$NON-NLS-1$ - cmd.append(args); - } - } - buildCommand.setText(cmd.toString()); - } - if (fBuildInfo.isDefaultBuildCmd()) { - buildCommand.setEnabled(false); - } else { - stopOnErrorButton.setEnabled(false); - } - defButton.setSelection(fBuildInfo.isDefaultBuildCmd()); - } - - protected void createWorkBenchBuildControls(Composite parent) { - SelectionAdapter selectionAdapter = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - targetAuto.setEnabled(autoButton.getSelection()); - targetFull.setEnabled(fullButton.getSelection()); - targetIncr.setEnabled(incrButton.getSelection()); - getContainer().updateContainer(); - } - - }; - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_GROUP), 1); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = false; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Label label = new Label(group, SWT.NONE); - label.setText(MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_TYPE)); - label = new Label(group, SWT.NONE); - label.setText(MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_TARGET)); - autoButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_AUTO)); - autoButton.addSelectionListener(selectionAdapter); - autoButton.setSelection(fBuildInfo.isAutoBuildEnable()); - targetAuto = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - targetAuto.setText(fBuildInfo.getAutoBuildTarget()); - ((GridData) (targetAuto.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (targetAuto.getLayoutData())).grabExcessHorizontalSpace = true; - incrButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_INCR)); - incrButton.addSelectionListener(selectionAdapter); - incrButton.setSelection(fBuildInfo.isIncrementalBuildEnabled()); - targetIncr = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - targetIncr.setText(fBuildInfo.getIncrementalBuildTarget()); - ((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true; - fullButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_FULL)); - fullButton.addSelectionListener(selectionAdapter); - fullButton.setSelection(fBuildInfo.isFullBuildEnabled()); - targetFull = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - targetFull.setText(fBuildInfo.getFullBuildTarget()); - ((GridData) (targetFull.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (targetFull.getLayoutData())).grabExcessHorizontalSpace = true; - selectionAdapter.widgetSelected(null); - } - - protected void createBuilderWorkingDirControls(Composite parent) { - Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_GROUP), 1); - GridLayout layout = new GridLayout(); - layout.numColumns = 3; - layout.makeColumnsEqualWidth = false; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_LABEL)); - ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING; - ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false; - buildLocation = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER); - ((GridData) (buildLocation.getLayoutData())).horizontalAlignment = GridData.FILL; - ((GridData) (buildLocation.getLayoutData())).grabExcessHorizontalSpace = true; - buildLocation.addListener(SWT.Modify, new Listener() { - public void handleEvent(Event e) { - getContainer().updateContainer(); - } - }); - Button browse = new Button(group, SWT.NONE); - browse.setText(MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_BROWSE)); - browse.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - ContainerSelectionDialog dialog = - new ContainerSelectionDialog( - getShell(), - getContainer().getProject(), - true, - "Selection Locations to build from."); - if (dialog.open() == ContainerSelectionDialog.OK) { - Object[] selection = dialog.getResult(); - if (selection.length > 0) { - buildLocation.setText(((IPath) selection[0]).toOSString()); - } - } - } - }); - buildLocation.setText(fBuildInfo.getBuildLocation().toOSString()); - } - - public void createControl(Composite parent) { - Composite composite = ControlFactory.createComposite(parent, 1); - setControl(composite); - - WorkbenchHelp.setHelp(getControl(), IMakeHelpContextIds.MAKE_BUILDER_SETTINGS); - - if (fBuildInfo == null) { - ControlFactory.createEmptySpace(composite); - ControlFactory.createLabel(composite, "Missing builder information on project."); - return; - } - - createBuildCmdControls(composite); - createSettingControls(composite); - createWorkBenchBuildControls(composite); - - if (getContainer().getProject() != null) { - createBuilderWorkingDirControls(composite); - } - } - - public boolean isValid() { - if (defButton != null && defButton.getSelection() != true) { - String cmd = getBuildLine(); - if (cmd == null || cmd.length() == 0) { - return false; - } - } - return true; - } - - public void performApply(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - IWorkspace workspace = MakeUIPlugin.getWorkspace(); - // To avoid multi-build - IWorkspaceRunnable operation = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - monitor.beginTask("Applying Settings...", 1); - IMakeBuilderInfo info; - if (getContainer().getProject() != null) { - info = MakeCorePlugin.createBuildInfo(getContainer().getProject(), fBuilderID); - } else { - info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, false); - } - info.setStopOnError(isStopOnError()); - info.setUseDefaultBuildCmd(useDefaultBuildCmd()); - if (!useDefaultBuildCmd()) { - String bldLine = getBuildLine(); - int start = 0; - int end = -1; - if (!bldLine.startsWith("\"")) { //$NON-NLS-1$ - end = bldLine.indexOf(' '); - } else { - start = 1; - end = bldLine.indexOf('"', 1); - } - IPath path; - if (end == -1) { - path = new Path(bldLine); - } else { - path = new Path(bldLine.substring(start, end)); - } - info.setBuildCommand(path); - String args = ""; //$NON-NLS-1$ - if (end != -1) { - args = bldLine.substring(end + 1); - } - info.setBuildArguments(args); - } - info.setAutoBuildEnable(autoButton.getSelection()); - info.setAutoBuildTarget(targetAuto.getText().trim()); - info.setIncrementalBuildEnable(incrButton.getSelection()); - info.setIncrementalBuildTarget(targetIncr.getText().trim()); - info.setFullBuildEnable(fullButton.getSelection()); - info.setFullBuildTarget(targetFull.getText().trim()); - if (buildLocation != null) { - info.setBuildLocation(new Path(buildLocation.getText().trim())); - } - } - }; - workspace.run(operation, monitor); - } - - public void performDefaults() { - IMakeBuilderInfo info; - if (getContainer().getProject() != null) { - info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, false); - } else { - info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, true); - } - if (info.isStopOnError()) - stopOnErrorButton.setSelection(true); - else - stopOnErrorButton.setSelection(false); - if (info.getBuildCommand() != null) { - StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString()); - if (!info.isDefaultBuildCmd()) { - String args = info.getBuildArguments(); - if (args != null && !args.equals("")) { //$NON-NLS-1$ - cmd.append(" "); //$NON-NLS-1$ - cmd.append(args); - } - } - buildCommand.setText(cmd.toString()); - } - if (info.isDefaultBuildCmd()) { - buildCommand.setEnabled(false); - stopOnErrorButton.setEnabled(true); - } else { - buildCommand.setEnabled(true); - stopOnErrorButton.setEnabled(false); - } - defButton.setSelection(info.isDefaultBuildCmd()); - autoButton.setSelection(info.isAutoBuildEnable()); - targetAuto.setText(info.getAutoBuildTarget()); - incrButton.setSelection(info.isIncrementalBuildEnabled()); - targetIncr.setText(info.getIncrementalBuildTarget()); - fullButton.setSelection(info.isFullBuildEnabled()); - targetFull.setText(info.getFullBuildTarget()); - } - - private boolean isStopOnError() { - return stopOnErrorButton.getSelection(); - } - - private boolean useDefaultBuildCmd() { - return defButton.getSelection(); - } - - private String getBuildLine() { - if (buildCommand != null) { - String cmd = buildCommand.getText(); - if (cmd != null) - return cmd.trim(); - } - return null; - } - - public void setContainer(ICOptionContainer container) { - super.setContainer(container); - if (getContainer().getProject() != null) { - try { - fBuildInfo = MakeCorePlugin.createBuildInfo(getContainer().getProject(), fBuilderID); - } catch (CoreException e) { - } - } else { - fBuildInfo = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, false); - } - } - - public String getErrorMessage() { - if (!useDefaultBuildCmd()) { - String cmd = getBuildLine(); - if (cmd == null || cmd.length() == 0) { - return "Must enter a build command"; - } - } - return null; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/AddTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/AddTargetAction.java deleted file mode 100644 index a80a1fa95c1..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/AddTargetAction.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.cdt.make.ui.views; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.List; - -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.SelectionListenerAction; - -public class AddTargetAction extends SelectionListenerAction { - - Shell shell; - IResource resource; - - public AddTargetAction(Shell shell) { - super("Add Build Target"); - this.shell = shell; - - setToolTipText("Add Build Target"); - MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_MAKE_TARGET_ADD); - } - - public void run() { - if (canAdd()) { - try { - MakeTargetDialog dialog = new MakeTargetDialog(shell, (IContainer) getStructuredSelection().getFirstElement()); - dialog.open(); - } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); - } - } - - } - - protected boolean updateSelection(IStructuredSelection selection) { - return super.updateSelection(selection) && canAdd(); - } - - private boolean canAdd() { - List elements = getStructuredSelection().toList(); - if (elements.size() > 1 || elements.size() < 1) { - return false; - } - if (elements.get(0) instanceof IContainer) { - return true; - } - return false; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/BuildTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/BuildTargetAction.java deleted file mode 100644 index 54b2538acfa..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/BuildTargetAction.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.cdt.make.ui.views; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.ui.TargetBuild; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.SelectionListenerAction; - -public class BuildTargetAction extends SelectionListenerAction { - - Shell shell; - IResource resource; - - public BuildTargetAction(Shell shell) { - super("Build Target"); - this.shell = shell; - - setToolTipText("Build Target"); - MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_MAKE_TARGET_BUILD); - } - - public void run() { - if (canBuild()) { - IMakeTarget[] targets = (IMakeTarget[]) getSelectedElements().toArray(new IMakeTarget[0]); - TargetBuild.runWithProgressDialog(shell, targets); - } - } - - protected boolean updateSelection(IStructuredSelection selection) { - return super.updateSelection(selection) && canBuild(); - } - - private boolean canBuild() { - List elements = getSelectedElements(); - if (elements.size() > 0) { - Iterator iterator = elements.iterator(); - while (iterator.hasNext()) { - if (!(iterator.next() instanceof IMakeTarget)) { - return false; - } - } - return true; - } - return false; - } - - private List getSelectedElements() { - return getStructuredSelection().toList(); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java deleted file mode 100644 index 99d1aeb6dd7..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.eclipse.cdt.make.ui.views; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.text.MessageFormat; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.core.IMakeTargetManager; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.SelectionListenerAction; - -public class DeleteTargetAction extends SelectionListenerAction { - - Shell shell; - IResource resource; - - public DeleteTargetAction(Shell shell) { - super("Delete Build Target"); - this.shell = shell; - - setToolTipText("Delete Build Target"); - MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_MAKE_TARGET_DELETE); - } - - /** - * Asks the user to confirm a delete operation. - * - * @return true if the user says to go ahead, and false - * if the deletion should be abandoned - */ - boolean confirmDelete() { - List targets = getTargetsToDelete(); - String title; - String msg; - if (targets.size() == 1) { - title = "Confirm Target Deletion"; - IMakeTarget target = (IMakeTarget) targets.get(0); - msg = MessageFormat.format("Are you sure you want to delete ''{0}''?", new Object[] { target.getName()}); - } else { - title = "Confirm Multiple Target Deletion"; - msg = - MessageFormat.format( - "Are you sure you want to delete these {0} targets?", - new Object[] { new Integer(targets.size())}); - } - return MessageDialog.openQuestion(shell, title, msg); - } - - public void run() { - if (canDelete() && confirmDelete() == false) - return; - List targets = getTargetsToDelete(); - IMakeTargetManager manager = MakeCorePlugin.getDefault().getTargetManager(); - Iterator iter = targets.iterator(); - try { - while (iter.hasNext()) { - manager.removeTarget((IMakeTarget) iter.next()); - } - } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Target Remove Error", "Error deleting build target", e); - } - } - - protected boolean updateSelection(IStructuredSelection selection) { - return super.updateSelection(selection) && canDelete(); - } - - /** - * @return - */ - private List getTargetsToDelete() { - return getStructuredSelection().toList(); - } - - /** - * @return - */ - private boolean canDelete() { - List elements = getStructuredSelection().toList(); - if (elements.size() > 0) { - Iterator iterator = elements.iterator(); - while (iterator.hasNext()) { - if (!(iterator.next() instanceof IMakeTarget)) { - return false; - } - } - return true; - } - return false; - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/EditTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/EditTargetAction.java deleted file mode 100644 index 60ab60fca52..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/EditTargetAction.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.cdt.make.ui.views; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.List; - -import org.eclipse.cdt.make.core.IMakeTarget; -import org.eclipse.cdt.make.internal.ui.MakeUIImages; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.SelectionListenerAction; - -public class EditTargetAction extends SelectionListenerAction { - - Shell shell; - IResource resource; - - public EditTargetAction(Shell shell) { - super("Edit Build Target"); - this.shell = shell; - - setToolTipText("Edit Build Target"); - MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_MAKE_TARGET_EDIT); - } - - public void run() { - if (canRename()) { - MakeTargetDialog dialog; - try { - dialog = new MakeTargetDialog(shell, (IMakeTarget) getStructuredSelection().getFirstElement()); - dialog.open(); - } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); - } - } - } - - protected boolean updateSelection(IStructuredSelection selection) { - return super.updateSelection(selection) && canRename(); - } - - private boolean canRename() { - List elements = getStructuredSelection().toList(); - if (elements.size() > 1 || elements.size() < 1) { - return false; - } - if (elements.get(0) instanceof IMakeTarget) { - return true; - } - return false; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java deleted file mode 100644 index 59723ac833c..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java +++ /dev/null @@ -1,156 +0,0 @@ -package org.eclipse.cdt.make.ui.views; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.ui.*; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.part.DrillDownAdapter; -import org.eclipse.ui.part.ViewPart; - -public class MakeView extends ViewPart { - - private BuildTargetAction buildTargetAction; - private EditTargetAction editTargetAction; - private DeleteTargetAction deleteTargetAction; - AddTargetAction addTargetAction; - TreeViewer viewer; - DrillDownAdapter drillDownAdapter; - - public MakeView() { - super(); - } - - /** - * @see IWorkbenchPart#setFocus() - */ - public void setFocus() { - viewer.getTree().setFocus(); - } - - /** - * @see ContentOutlinePage#createControl - */ - public void createPartControl(Composite parent) { - viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - viewer.setUseHashlookup(true); - viewer.setContentProvider(new MakeContentProvider()); - viewer.setLabelProvider(new MakeLabelProvider()); - - drillDownAdapter = new DrillDownAdapter(viewer); - - viewer.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent event) { - handleDoubleClick(event); - } - }); - viewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - handleSelectionChanged(event); - } - }); - viewer.getControl().addKeyListener(new KeyAdapter() { - public void keyPressed(KeyEvent event) { - if (event.character == SWT.DEL && event.stateMask == 0) { - handleDeleteKeyPressed(); - } - } - }); - - viewer.setContentProvider(new MakeContentProvider()); - viewer.setLabelProvider(new MakeLabelProvider()); - viewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); - getSite().setSelectionProvider(viewer); - - makeActions(); - hookContextMenu(); - contributeToActionBars(); - } - - private void makeActions() { - buildTargetAction = new BuildTargetAction(viewer.getControl().getShell()); - addTargetAction = new AddTargetAction(viewer.getControl().getShell()); - deleteTargetAction = new DeleteTargetAction(viewer.getControl().getShell()); - editTargetAction = new EditTargetAction(viewer.getControl().getShell()); - } - private void contributeToActionBars() { - IActionBars bars = getViewSite().getActionBars(); - fillLocalPullDown(bars.getMenuManager()); - fillLocalToolBar(bars.getToolBarManager()); - } - - private void fillLocalToolBar(IToolBarManager toolBar) { - drillDownAdapter.addNavigationActions(toolBar); - toolBar.add(buildTargetAction); - } - - private void fillLocalPullDown(IMenuManager manager) { - } - - - private void hookContextMenu() { - MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ - menuMgr.setRemoveAllWhenShown(true); - menuMgr.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager manager) { - MakeView.this.fillContextMenu(manager); - updateActions((IStructuredSelection) viewer.getSelection()); - } - }); - Menu menu = menuMgr.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); -// getSite().registerContextMenu(menuMgr, viewer); - } - - - protected void fillContextMenu(IMenuManager manager) { - manager.add(buildTargetAction); - manager.add(addTargetAction); - manager.add(deleteTargetAction); - manager.add(editTargetAction); - manager.add(new Separator()); - drillDownAdapter.addNavigationActions(manager); - - // Other plug-ins can contribute there actions here -// manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } - - protected void handleDeleteKeyPressed() { - deleteTargetAction.run(); - } - - protected void handleDoubleClick(DoubleClickEvent event) { - buildTargetAction.run(); - } - - void handleSelectionChanged(SelectionChangedEvent event) { - IStructuredSelection sel = (IStructuredSelection) event.getSelection(); - updateActions(sel); - } - - void updateActions(IStructuredSelection sel) { - addTargetAction.selectionChanged(sel); - buildTargetAction.selectionChanged(sel); - deleteTargetAction.selectionChanged(sel); - editTargetAction.selectionChanged(sel); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java deleted file mode 100644 index e42817f83d1..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.eclipse.cdt.make.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.ui.wizards.conversion.ConversionWizard; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -/** - * This wizard provides a method by which the user can - * add a C nature to a project that previously had no nature associated with it. - */ -public class ConvertToMakeProjectWizard extends ConversionWizard { - - private static final String WZ_TITLE = "WizardMakeProjectConversion.title"; //$NON-NLS-1$ - private static final String WZ_DESC = "WizardMakeProjectConversion.description"; //$NON-NLS-1$ - private static final String PREFIX = "WizardMakeConversion"; //$NON-NLS-1$ - private static final String WINDOW_TITLE = "WizardMakeConversion.windowTitle"; //$NON-NLS-1$ - - /** - * ConvertToStdMakeConversionWizard Wizard constructor - */ - public ConvertToMakeProjectWizard() { - this(getWindowTitleResource(), getWzDescriptionResource()); - } - /** - * ConvertToStdMakeConversionWizard Wizard constructor - * - * @param title - * @param desc - */ - public ConvertToMakeProjectWizard(String title, String desc) { - super(title, desc); - } - - /** - * Method getWzDescriptionResource, allows Wizard description label value - * to be changed by subclasses - * - * @return String - */ - protected static String getWzDescriptionResource() { - return MakeUIPlugin.getResourceString(WZ_DESC); - } - - /** - * Method getWzTitleResource, allows Wizard description label value - * to be changed by subclasses - * - * @return String - */ - protected static String getWzTitleResource() { - return MakeUIPlugin.getResourceString(WZ_TITLE); - } - - /** - * Method getWindowTitleResource, allows Wizard Title label value to be - * changed by subclasses - * - * @return String - */ - protected static String getWindowTitleResource() { - return MakeUIPlugin.getResourceString(WINDOW_TITLE); - } - - /** - * Method getPrefix, allows prefix value to be changed by subclasses - * - * @return String - */ - protected static String getPrefix() { - return PREFIX; - } - - /** - * Method addPages adds our Simple to C conversion Wizard page. - * - * @see Wizard#createPages - */ - public void addPages() { - addPage(mainPage = new ConvertToMakeProjectWizardPage(getPrefix())); - } - - public String getProjectID() { - return MakeCorePlugin.MAKE_PROJECT_ID; - } - - protected void doRun(IProgressMonitor monitor) throws CoreException { - monitor.beginTask("Converting to Make Project...", 2); - try { - super.doRun(new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java deleted file mode 100644 index 377139beafd..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.eclipse.cdt.make.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.make.core.MakeProjectNature; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.ui.wizards.conversion.ConvertProjectWizardPage; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard; - -/** - * - * ConvertToStdMakeProjectWizardPage - * Standard main page for a wizard that adds a C project Nature to a project with no nature associated with it. - * This conversion is one way in that the project cannot be converted back (i.e have the nature removed). - * - * @author Judy N. Green - * @since Aug 6, 2002 - *

- * Example useage: - *

- * mainPage = new ConvertToStdMakeProjectWizardPage("ConvertProjectPage");
- * mainPage.setTitle("Project Conversion");
- * mainPage.setDescription("Add C or C++ a Nature to a project.");
- * 
- *

- */ -public class ConvertToMakeProjectWizardPage extends ConvertProjectWizardPage { - - private static final String WZ_TITLE = "WizardMakeProjectConversion.title"; //$NON-NLS-1$ - private static final String WZ_DESC = "WizardMakeProjectConversion.description"; //$NON-NLS-1$ - - /** - * Constructor for ConvertToStdMakeProjectWizardPage. - * @param pageName - */ - public ConvertToMakeProjectWizardPage(String pageName) { - super(pageName); - } - - /** - * Method getWzTitleResource returns the correct Title Label for this class - * overriding the default in the superclass. - */ - protected String getWzTitleResource(){ - return MakeUIPlugin.getResourceString(WZ_TITLE); - } - - /** - * Method getWzDescriptionResource returns the correct description - * Label for this class overriding the default in the superclass. - */ - protected String getWzDescriptionResource(){ - return MakeUIPlugin.getResourceString(WZ_DESC); - } - - /** - * Method isCandidate returns true for all projects. - * - * @param project - * @return boolean - */ - public boolean isCandidate(IProject project) { - return true; // all - } - - public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException { - monitor.beginTask("Converting Make project...", 3); - try { - super.convertProject(project, new SubProgressMonitor(monitor, 1), projectID); - MakeProjectNature.addNature(project, new SubProgressMonitor(monitor, 1)); - CCorePlugin.getDefault().mapCProjectOwner(project, projectID, true); - } finally { - monitor.done(); - } - } - - public void createControl(Composite parent) { - super.createControl(parent); - IStructuredSelection sel = ((BasicNewResourceWizard)getWizard()).getSelection(); - if ( sel != null) { - tableViewer.setCheckedElements(sel.toArray()); - setPageComplete(validatePage()); - } - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java deleted file mode 100644 index 3d14e8d9fd0..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.eclipse.cdt.make.ui.wizards; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.internal.ui.MakeProjectOptionBlock; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.cdt.ui.dialogs.ReferenceBlock; -import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock; -import org.eclipse.cdt.ui.wizards.NewCProjectWizard; -import org.eclipse.cdt.ui.wizards.NewCProjectWizardOptionPage; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Preferences; - -/** - * Standard main page for a wizard that is creates a project resource. - *

- * This page may be used by clients as-is; it may be also be subclassed to suit. - *

- *

- * Example useage: - *

- * mainPage = new CProjectWizardPage("basicCProjectPage");
- * mainPage.setTitle("Project");
- * mainPage.setDescription("Create a new project resource.");
- * 
- *

- */ -public class MakeProjectWizardOptionPage extends NewCProjectWizardOptionPage { - - public class MakeWizardOptionBlock extends MakeProjectOptionBlock { - - public MakeWizardOptionBlock(ICOptionContainer parent) { - super(parent); - } - - protected void addTabs() { - addTab(new ReferenceBlock()); - super.addTabs(); - } - } - - public MakeProjectWizardOptionPage(String title, String description) { - super("MakeProjectSettingsPage"); //$NON-NLS-1$ - setTitle(title); - setDescription(description); - } - - protected TabFolderOptionBlock createOptionBlock() { - return new MakeWizardOptionBlock(this); - } - - public IProject getProject() { - return ((NewCProjectWizard)getWizard()).getNewProject(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreference() - */ - public Preferences getPreferences() { - return MakeUIPlugin.getDefault().getPluginPreferences(); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java deleted file mode 100644 index 90147413725..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.eclipse.cdt.make.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -/** - */ -public class NewMakeCCProjectWizard extends NewMakeProjectWizard { - - private static final String WZ_TITLE = "MakeCCWizard.title"; //$NON-NLS-1$ - private static final String WZ_DESC = "MakeCCWizard.description"; //$NON-NLS-1$ - - private static final String WZ_SETTINGS_TITLE = "MakeCCWizard.title"; //$NON-NLS-1$ - private static final String WZ_SETTINGS_DESC = "MakeCCWizard.description"; //$NON-NLS-1$ - - public NewMakeCCProjectWizard() { - super(MakeUIPlugin.getResourceString(WZ_TITLE), MakeUIPlugin.getResourceString(WZ_DESC)); - } - - public void addPages() { - super.addPages(); - addPage( - fOptionPage = - new MakeProjectWizardOptionPage( - MakeUIPlugin.getResourceString(WZ_SETTINGS_TITLE), - MakeUIPlugin.getResourceString(WZ_SETTINGS_DESC))); - } - - protected void doRun(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(MakeUIPlugin.getResourceString("MakeCCWizard.task_name"), 10); //$NON-NLS-1$ - super.doRun(new SubProgressMonitor(monitor, 9)); - // Add C++ Nature. - if (newProject != null) { - // Add C++ Nature to the newly created project. - CCorePlugin.getDefault().convertProjectFromCtoCC(newProject, new SubProgressMonitor(monitor, 1)); - } - monitor.done(); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java deleted file mode 100644 index dc55fddf9e0..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.cdt.make.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; - -/** - */ -public class NewMakeCProjectWizard extends NewMakeProjectWizard { - - private static final String WZ_TITLE = "MakeCWizard.title"; //$NON-NLS-1$ - private static final String WZ_DESC = "MakeCWizard.description"; //$NON-NLS-1$' - - private static final String WZ_SETTINGS_TITLE = "MakeCWizardSettings.title"; //$NON-NLS-1$ - private static final String WZ_SETTINGS_DESC = "MakeCWizardSettings.description"; //$NON-NLS-1$' - - public NewMakeCProjectWizard() { - super(MakeUIPlugin.getResourceString(WZ_TITLE), MakeUIPlugin.getResourceString(WZ_DESC)); - } - - public void addPages() { - super.addPages(); - addPage( - fOptionPage = - new MakeProjectWizardOptionPage( - MakeUIPlugin.getResourceString(WZ_SETTINGS_TITLE), - MakeUIPlugin.getResourceString(WZ_SETTINGS_DESC))); - } - -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java deleted file mode 100644 index 66b2758952c..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.cdt.make.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeProjectNature; -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.ui.wizards.NewCProjectWizard; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -/** - */ -public abstract class NewMakeProjectWizard extends NewCProjectWizard { - - protected MakeProjectWizardOptionPage fOptionPage; - - public NewMakeProjectWizard(String title, String desc) { - super(title, desc); - } - - protected void doRunPrologue(IProgressMonitor monitor) { - } - - protected void doRunEpilogue(IProgressMonitor monitor) { - } - - protected void doRun(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(MakeUIPlugin.getResourceString("MakeCWizard.task_name"), 10); //$NON-NLS-1$ - - // super.doRun() just creates the project and does not assign a builder to it. - super.doRun(new SubProgressMonitor(monitor, 5)); - - MakeProjectNature.addNature(getProjectHandle(), new SubProgressMonitor(monitor, 1)); - - // Modify the project based on what the user has selected - if (newProject != null) { - fOptionPage.performApply(new SubProgressMonitor(monitor, 4)); - monitor.done(); - } - } - - public String getProjectID() { - return MakeCorePlugin.MAKE_PROJECT_ID; - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizard.java deleted file mode 100644 index e7cbae594f3..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizard.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Created on 28-Jul-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui.wizards; - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.ui.actions.*; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.wizard.Wizard; - -public class UpdateMakeProjectWizard extends Wizard { - private static final String MAKE_UPDATE_WINDOW_TITLE = "MakeWizardUpdate.window_title"; //$NON-NLS-1$ - - private UpdateMakeProjectWizardPage page1; - private IProject[] selected; - - public UpdateMakeProjectWizard(IProject[] selected) { - setDefaultPageImageDescriptor(null); - setWindowTitle(MakeUIPlugin.getResourceString(MAKE_UPDATE_WINDOW_TITLE)); - setNeedsProgressMonitor(true); - this.selected = selected; - } - - public boolean performFinish() { - Object[] finalSelected = page1.getSelected(); - - IProject[] projectArray = new IProject[finalSelected.length]; - System.arraycopy(finalSelected, 0, projectArray, 0, finalSelected.length); - UpdateMakeProjectAction.run(true, getContainer(), projectArray); - return true; - } - - public void addPages() { - page1 = new UpdateMakeProjectWizardPage(selected); - addPage(page1); - } -} diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java deleted file mode 100644 index 497fb0b8e0d..00000000000 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Created on 28-Jul-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.make.ui.wizards; - -import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; -import org.eclipse.cdt.make.internal.ui.part.WizardCheckboxTablePart; -import org.eclipse.cdt.make.internal.ui.wizards.StatusWizardPage; -import org.eclipse.cdt.make.ui.actions.UpdateMakeProjectAction; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -public class UpdateMakeProjectWizardPage extends StatusWizardPage { - - private static final String MAKE_UPDATE_TITLE = "MakeWizardUpdatePage.title"; //$NON-NLS-1$ - private static final String MAKE_UPDATE_DESCRIPTION = "MakeWizardUpdatePage.description"; //$NON-NLS-1$ - - private IProject[] selected; - private CheckboxTableViewer makeProjectListViewer; - private TablePart tablePart; - - public class MakeProjectContentProvider implements IStructuredContentProvider { - public Object[] getElements(Object parent) { - return UpdateMakeProjectAction.getOldProjects(); - } - - public void dispose() { - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - } - - class TablePart extends WizardCheckboxTablePart { - public TablePart(String mainLabel) { - super(mainLabel); - } - public void updateCounter(int count) { - super.updateCounter(count); - dialogChanged(); - } - protected StructuredViewer createStructuredViewer(Composite parent, int style) { - StructuredViewer viewer = super.createStructuredViewer(parent, style); - return viewer; - } - } - - public UpdateMakeProjectWizardPage(IProject[] selected) { - super("UpdateMakeProjectWizardPage", true); //$NON-NLS-1$ - setTitle(MakeUIPlugin.getResourceString(MAKE_UPDATE_TITLE)); - setDescription(MakeUIPlugin.getResourceString(MAKE_UPDATE_DESCRIPTION)); - this.selected = selected; - tablePart = new TablePart("Project list"); - } - - public void dispose() { - super.dispose(); - } - - public void createControl(Composite parent) { - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginWidth = 5; - container.setLayout(layout); - - tablePart.createControl(container); - makeProjectListViewer = tablePart.getTableViewer(); - makeProjectListViewer.setContentProvider(new MakeProjectContentProvider()); - makeProjectListViewer.setLabelProvider(new WorkbenchLabelProvider()); - - GridData gd = (GridData) tablePart.getControl().getLayoutData(); - gd.heightHint = 300; - gd.widthHint = 300; - - makeProjectListViewer.setInput(MakeUIPlugin.getWorkspace().getRoot()); - tablePart.setSelection(selected); - setControl(container); - Dialog.applyDialogFont(container); - } - - public void storeSettings() { - } - - public Object[] getSelected() { - return tablePart.getSelection(); - } - - void dialogChanged() { - IStatus genStatus = validatePlugins(); - updateStatus(genStatus); - } - - - private IStatus validatePlugins() { - Object[] allModels = UpdateMakeProjectAction.getOldProjects(); - if (allModels == null || allModels.length == 0) { - return createStatus(IStatus.ERROR, "No projects to update"); - } - if (tablePart.getSelectionCount() == 0) { - return createStatus(IStatus.ERROR, "No projects selected"); - } - return createStatus(IStatus.OK, ""); //$NON-NLS-1$ - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/.classpath b/build/org.eclipse.cdt.managedbuilder.core/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/build/org.eclipse.cdt.managedbuilder.core/.cvsignore b/build/org.eclipse.cdt.managedbuilder.core/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/build/org.eclipse.cdt.managedbuilder.core/.project b/build/org.eclipse.cdt.managedbuilder.core/.project deleted file mode 100644 index 35661dd74df..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.managedbuilder.core - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog b/build/org.eclipse.cdt.managedbuilder.core/ChangeLog deleted file mode 100644 index 72fbc83ea20..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/ChangeLog +++ /dev/null @@ -1,301 +0,0 @@ -2003-10-23 Bogdan Gheorghe - Updated the indexManager.perfomConcurrentJob call in MakefileGenerator - -2003-10-03 Sean Evoy - Fix for critical bug 44134. - - The problem lies in how the makefile is generated when a build target - references other projects. The makefile creates a command to change to - the build directory of the referenced project and call $(MAKE) there, i.e. - cd ; $(MAKE) clean all - - The problem arises when the directory change fails. As of RC0, the command - after the semi-colon is evaluated. Unfortunately, it evaluates to a recursive - make call in the build directory of the build target and 'make' will keep - invoking more 'make's until Eclipse runs out of memory. With a manual build, - the user can still cancel the build. When autobuild is turned on, they cannot. - The only way to shut down Eclipse under that scenario is to kill it, and when - it restarts, autobuild is still enabled and the problem repeats. - - The solution is to NOT perform the 'make' command if the 'cd' fails, i.e. - cd && $(MAKE) clean all - - When the dependencies are generated this way, the 'cd' will fail as will the - build. The final tweak is to ignore the 'cd' failure and allow the rest of - the build to continue, i.e. - -cd && $(MAKE) clean all - - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - -2003-10-01 Sean Evoy - Final fix for bugs 44020. - The problem lay with the way that new projects were being created when the - root configuration of the project had tool references overriding options. - What the new configuration should have been doing is making a personal copy - of the tool reference and its options. Instead, they were all sharing the - parents. Seems simple enough now that I found it. - - OptionReference provides a method to retreive its option (so new - OptionReferences can be cloned). - * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java - - Configuration now behaves correctly when it is created from another configuration. - * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java - -2003-10-01 Sean Evoy - Fix for bugs 43490 (trivial), 44020, and 43980. - Added a new field to the schema for a tool. The attribute manages a list of - project natures that the tool should be filtered against in the build model - and UI. - * schema/ManagedBuildTools.exsd - - Updated the ITool interface and its mplementors to pay attention to this new - attribute when loading from a plugin file. Clients can querry for a numeric - constant indicating the filter. - * src/org/eclipse/cdt/managedbuilder/core/ITool.java - * src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java - * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java - - All the methods in managed build manager that access information stored in a tool - first check that the tool is valid for the project nature. - * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java - - Put a safety check in the option reference constructor when reading one in from - a project file. I the option reference is to an option not managed by the build - model, the constructor does not add itself to the runtime representation of the - model. - * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java - - In preparation for 44020, each new target created is assigned a truly random ID. - * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java - -2003-09-30 Sean Evoy - Fix for bug 41826. - - Finished the use case for changing header files and triggering a build. I had - to add a new attribute to the build model schema to allow a build information - client to determine that a file is considered a header file. - * schema/ManagedBuildTools.exsd - - The ITool, and its implementors now have a method to test if an extension is - considered to belong to a header file. The Tool also pays attention to the new - attribute when it reads itself in from the plugin file. - * src/org/eclipse/cdt/managedbuilder/core/ITool.java - * src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java - * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java - - There is a method for clients of this information on the BuildInfo interface and - its implementor. - * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java - * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java - - The builder had to be tweaked in order to behave correctly on a build of an - empty project or non-managed projects. - * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java - - The makefile generator had to be tweaked to properly add folders that are effected - by header file changes. - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - -2003-09-26 Sean Evoy - A partial implementation for bug 41826. This patch contains the logic to properly - respond in the face of the following project changes: - - 1. A generated project element, such as the build target or an intermediate file, - is deleted in the build project, or any projects it references. - 2. The build settings change in the build project or any projects it - references. - - In order to actually do this correctly, I had to stop being so precious during the - build. The makefile generator was was calculating the "build needed" state as it - walked the change delta. However, the Eclipse core has already determined that I - need to do a build. Further, as I discovered earlier, it doesn't always pass what - has changed in referenced projects as part of the delta. Essentially, that means I - will never be able to fully calculate the change set in the makefile generator's - delta visitor, and to even approximate a decent set of cases, the logic would quickly - bog down in complexity. - - The solution is to trust Eclipse and alway invoke make when my incremental builder - is called. At worst, if there is no significant change, make will execute and - report nothing to be done. - - The modified makefile builder no longer asks the makefile generator if it should - build. It also no longer cares if the change set is empty (make will report that). - Since it responds to changes in referenced project's build information, it also - scrubs all relevant projects after building. Since a build might involve building - referenced project elements, those projects get their project views refreshed after - build. The build markers for referenced projects are removed prior to build. - * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java - - The makefile generator has been simplified. The resource delta visitor logic no - longer trie to decide if a build should occur. The method to ask has been removed. - The class no longer throws an exception if the change set is empty. I am also a bit - more careful to call make with the right targets if a referenced project is built. - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - -2003-09-26 Sean Evoy - I added a fix to the builder and makefile generator to properly handle the following case. - Project A depends on Project B. Something changes in project B and the user requests - that A be built. Inthis case, the incremental builder is invoked, but it is passed a - 0-length delta on the top resource. Now, the logic of the builder is to treat that case as a - build event that triggers no makefile regeneration, just an invocation of make. - - Now handles the case where there is no flag applied to the make command and just - passes the targets as arguments. - * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java - - The makefile generator now considers the case where the delta is for a project resource - and has no children. If so, it flags that a build is needed but no makefile generation - occurs. It also throws a new exception if the top makefile is not saved. - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - -2003-09-25 Sean Evoy - A patch to resolve the problem with refreshing the project after a build, or - bug 42522 if you care about those sorts of things. The managed make builder was - calling refresh at inside a bad if statement. I corrected that and projects - refresh correctly. Of course, if you have the wrong binary parser selected you are - hosed. You will also notice that the string constants have been changed to - resolve to a different name. The standard builder uses this name and I wanted - to minimize the possibility of problems later. - * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java - - Prepended "Managed" to the externalized string identifiers to avoid future overlap - with the standard build system. Had to update the makefile generator to use the - new identifiers. - * src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - - Changed the signature of the 'getMakeArguments' to return a string instead of an - array so the builder can invoke make with the user-specified args. I also changed - the logic of the getMakeCommand method in the implementor so that it only returns - a string containing the command itself. - * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java - * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java - - Explicitly trim all arrays to size before converting them to String[] for Options - and Tools. - *src/org/eclipse/cdt/managedbuilder/internal/core/Option.java - * src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java - - Fixed a missing bit of logic in the Configuration when a user-object option is - deleted. Now the build model really does get rid of the the value. - * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java - -2003-09-25 Sean Evoy - This patch contains a lot of changes needed to implement fixes for 42648 and - 43122. - - For 42648, the schema for the the target had to be modified to include a - comma-separated list of valid host platforms. - * schema/ManagedBuildTools.exsd - - The target had to be updated to properly read in and understand this info, and - the interface had to be updated to return a list to the clients in the UI. The - target was also changed slightly. It now uses a safer accessor method to get at - the list of tools it maintains. I have also stopped persisting non-variant info - to the project file on serialize. There are elements of the target that are not - subject to change by the user (yet) so they should not be saved. - * src/org/eclipse/cdt/managedbuilder/core/ITarget.java - * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java - - For 43122, I started by simply adding a tool reference to the configurations. - The tool reference had option references for debug and optimization levels. It - should have worked, but the model was not handling the inheritance properly. The - JUnit tests were not finding it because of how they were configured. It was most - evident in the UI. So, the way configurations and tool reference search for - overridden option references had to be modified. While I was in there, I cleaned - up some of the accessor and iteration code in ToolReference and OptionReference. - - For the configuration, the only significant change was a new search method to - find all option references for a given tool, no matter where they are stored. - The method had to consider what was overridden in a child config, what was added by - a child config, and what the parent (or parents) define. - * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java - - Option reference now pays attention to overidden values in the plugin file. Until - now, it only handled the overrides in the project file. - * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java - - The ToolReference now distinguishes between local option references which it - manages directly, and option references held by tool references in the parent(s) - of its owner. It only serializes its own references, but when asked for options - relating to the tool it references, it replies with all option references in its - hierarchy. - * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java - - -2003-09-25 Bogdan Gheorghe - Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the - projects that dependend a file. - - Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob - - * src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java - -2003-09-24 Sean Evoy - Changed the implementor of IScannerInfo to answer only absolute paths when asked for - includes paths. Users will specify the includes paths in the managed build UI in such a way - that the compiler will not complain. Either they will use absolute paths, or they will specify - them relative to the build directory. In the second case, it is easier for the managed builder - to convert the paths relative to this directory into absolute paths before replying tha it is for - the client to figure this out. - * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java - -2003-09-23 Sean Evoy - All the work in this patch is for critical bug 43292. In order to manage - configurations, there had to be a method through ITarget to remove - configurations. Also, to support the naming of newly created configurations, - I added a name method to the IConfiguration interface. Finally, the ITarget - needed to support setting (and resetting) the make command to use when building. - * src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java - * src/org/eclipse/cdt/managedbuilder/core/ITarget.java - * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java - -2003-09-19 Sean Evoy - Added a new field to the target specification in the build model to - hard-code the binary parser for project creation. There is a new getter - method in the interface and the implementor contains additional code to - extract the information from a project file or plugin manifest. The - interface also contains new strings to make changing the specification - easier in the future. - * schema/ManagedBuildTools.exsd - * src/org/eclipse/cdt/managedbuilder/core/ITarget.java - * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java - - Fix for bug 41720: libraries are now found for Solaris and Linux - executables. The problem was the executable had no extension and - the client of the build model passed null instead of the empty string. - * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - -2003-09-16 Sean Evoy - Patch contains a fix for bug 43017. Renamed the "addDeps" method to a - more descriptive "addSourceDependencies". Added a flag when the - inter-project dependencies are calculated so that clean and all are - properly passed to the make invocation. Finally, I replaced the hard-coded - 'make' with $(MAKE) - * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java - - It also contains some more work on 41826, specifically on the logic to - implement a rebuild when the build settings change. The builder checks for - a build model change whenever a build is requested and responds appropriately. - The make targets (i.e. 'clean' and 'all') are also calculated differently now. - * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java - - The build model was modified to set a dirty flag when an option changes. I also - made a change to avoid an NPE when the build info was loaded. - * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java - * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java - * src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java - - -2003-09-15 Sean Evoy - First submission of code to new project. Moved the managed builder - source code out of the cdt.core project. This includes the code to - implement the build model, along with the shema and extension point - declaration. Moved the builder, scnanaer info provider and managed - nature definitions into the package as well. - - There are 2 new classes to handle the externalized strings: - * src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java - * src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.core/about.html b/build/org.eclipse.cdt.managedbuilder.core/about.html deleted file mode 100644 index 8c828de2ada..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

10th July, 2002

-

License

-

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

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.core/build.properties b/build/org.eclipse.cdt.managedbuilder.core/build.properties deleted file mode 100644 index 9f95adad610..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - schema/,\ - mngbuildcore.jar -source.mngbuildcore.jar = src/ diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.properties b/build/org.eclipse.cdt.managedbuilder.core/plugin.properties deleted file mode 100644 index 20c7c57bb40..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/plugin.properties +++ /dev/null @@ -1,5 +0,0 @@ -pluginName=C/C++ Managed Builder Core -providerName=Eclipse.org - -GeneratedMakefileCBuilder.name=Generated Makefile Builder -ManagedBuildNature.name=Managed Builder Project \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml deleted file mode 100644 index adbfc6c5bc8..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd deleted file mode 100644 index a2363c30a7a..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/schema/ManagedBuildTools.exsd +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - - - - The managed build information model describes targets, configurations, and toolchains for the build system. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Defines a tool used in the build process. - - - - - - - - - - - A unique identifier for the tool that will be used by the build model. - - - - - - - Human-readable name for the tool to be used in the UI. - - - - - - - A comma-separated list of file extensions that the tool will produce output for. - - - - - - - The extension that the tool will produce from a given input. - - - - - - - The command that invokes the tool. For example, gcc for the Gnu C compiler, or g++ for the Gnu C++ compiler. - - - - - - - An optional flag for tools that allow users to specify a name for the artifact of the tool. For example, the GCC compiler and linker tools typically allow the user to specify the name of the output with the '-o' flag, whereas the archiver that creates libraries does not. - - - - - - - Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be lib<target>.a so 'lib' would be the prefix. - - - - - - - This is an optional field that specifies the class that provides the dependency calculation for a given tool. This field is unused in CDT 1.2. - - - - - - - - - - A comma-separated list of file extensions that are used for header files. Since many other files depend on the interfaces defined in header files, the build system needs to be able to determine that a header file has changed to properly rebuild its dependents. - - - - - - - Filter the display (and use) of the tool by the nature of the project. Selecting a value of 'cnature' insures that the tool will be displayed IFF there is a cnature associated with the project. A ccnature will filter this tool out. If 'ccnature' is selected, the tool will only be available for C++ projects. If 'both' is selected, the tool will be displayed when either nature is present. - - - - - - - - - - - - - - - - - - - - An option is associated with a tool. Options can contain boolean values, a simple text string, a selection from an enumerated list, or a list of values. Options also map the value they contain to a command-line flag, such as '-g' in the case of debugging symbol information for compilers. - - - - - - - - - - - A unique identifier for the option. - - - - - - - A descriptive name for the option. - - - - - - - General options can be one of the following types; 'string' for catch-all entries for options that cannot be easily defined any other way, 'string list' for entries that consist of a list of values such as defined symbols or paths, 'boolean' for options that have two values, and 'enumerated' for options that are one-of a list of values. - -Additional special types exist to flag options of special relevance to the build model; 'include', 'libs', 'userObjs' and 'definedSymbols'. You can pre-populate with optionValues, and they will display in the UI the same way the 'stringList' options do. The build model will look specifically for these value types when clients query for include paths and preprocessor defines. The makefile generator will treat the libs and userObjs entries differently than other stringLists. - - - - - - - - - - - - - - - - - - - - - - - - - - - This is the id of the option category for this option. The id can be the id of the tool which is also a category. - - - - - - - Specifies the default value for the option if the 'value' field is blank. For enumerated options the optionEnums will be searched for the default. For string list options, all defined optionValues will be treated as defaults. For boolean values, specify truth using the string 'true'. All other strings will be treated as false. - - - - - - - An optional value that specifies the actual command that will be passed to the tool on the command line. - - - - - - - - - - Defines a single value of an enumerated option. - - - - - - - Unique identifier for the option enumeration. - - - - - - - A descriptive name for the enumeration. - - - - - - - Flags this enumerated value as the default to apply to the option if the user has not changed the setting. - - - - - - - The command that the enumerated value translates to on the command line. - - - - - - - - - - A configuration is used to gather together certain default tools and options to build target a certain way. For example, a "Debug" configuration might supply tools with the options set to build with debugging symbols, whereas a "Release" configuration would supply tools with options set to create the best performance. - - - - - - - - - - Unique identifier for the configuration. - - - - - - - A descriptive name for the configuration to be used in the UI. - - - - - - - - - - This is reserved for future use. It currently gets instantiated for saving tool settings. - - - - - - - - - - - - - - - - - - - - Option references hold onto information the user has changed through the UI. Not all fields will be populated, depending on the option type the reference overrides. For example, the 'name' field is used by enumerated options only. - - - - - - - The ID of the option the reference is for. - - - - - - - - - - - - - - - - - - - - - - - - Represents a type of resource that is the target of the build process, for example, a Linux Library. A target contains a sequence of tool definitions and configurations. Targets are arranged in an inheritance hierarchy where a target inherits the list of tools from it's parent and can add to or override tools in this list. - - - - - - - - - - - Used by the build model to uniquely identify the target. - - - - - - - A human-readable target name, such as 'Linux Executable'. This will be the name the user sees displayed in the UI. - - - - - - - This is a UI property. If set to true, users should not be able to create project configurations targeted at this target. - - - - - - - The id of a target that this tool inherits from. - - - - - - - This is the name of the final build artifact associated with the target. The user will specify this is the UI, so there is no need to supply a default value. - - - - - - - This is the extensionthat will be applied to any build artifact created by the target. - - - - - - - A an optional field that flags a target as a test-only target. If true, the target will not appear in the UI. - - - - - - - This attribute maintains the command that removes files for a particular target. For example, on POSIX targets like Linuc, Solaris, or Cygwin, the command would be <code>rm -rf</code> whereas on Win32 platforms it would be <code>del /F /S /Q</code> - - - - - - - - - - - - - - - - - - - - - Set this to the ID of the binary parser for the output format of your target. Currently there are only 2 choices: org.eclipse.cdt.core.ELF for *nix targets, and "org.eclipse.cdt.core.PE" for targets that build for Windows, like Cygwin. - - - - - - - This field is used by the managed build system to decide when to show the user the target. The value should be a comma-separated list. Current values are "win32", "linux", and "solaris". - - - - - - - - - - An optional, but useful, mechanism for grouping options together. - - - - - - - Used by the build model to uniquely identify the option category. - - - - - - - A human-readable category name, such as 'Preprocessor Options'. This will be the name the user sees displayed in the UI. - - - - - - - Option categories can be nested inside other option categories. This is the ID of the owner of the category. - - - - - - - - - - A value for defining individual elements of a list option. - - - - - - - The contents of the list item. - - - - - - - This attribute flags the list value as a built-in value as opposed to something the user has entered. Built-ins will not be passed to clients that generate command lines (like the makefile generator). However, clients that need to take these settings into account (like the indexing service), will receive these settings. These values will appear grey in the UI. - - - - - - - - - - - - 1.2 - - - - - - - - - The following is an example of the extension point usage: -<p> -<pre> - <extension - id="buildExample" - name="Tools for Build Example" - point="org.eclipse.cdt.core.ManagedBuildInfo"> - <target - makeFlags="-k" - isTest="false" - cleanCommand="rm -rf" - name="Executable" - defaultExtension=".exe" - isAbstract="false" - makeCommand="make" - id="example.target.executable"> - <tool - sources="C" - name="Compiler" - outputFlag="-o" - outputs="exe" - command="g++" - id="executable.compiler"> - <optionCategory - owner="executable.compiler" - name="Flags" - id="compiler.category.flags"> - </optionCategory> - <option - defaultValue="-c" - name="Compiler Flags" - category="compiler.category.flags" - valueType="string" - id="category.flags.comp_flags"> - </option> - </tool> - <configuration - name="Default" - id="example.config.default"> - </configuration> - </target> - </extension> -</pre> - - - - - - - - - - - - - - - - - - An implementation of this extension point is supplied in <samp>org.eclipse.cdt.ui</samp> - - - - - - - - - Copyright (c) 2003 IBM Corporation and others. -All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available on the <a href="http://www.eclipse.org/legal/cpl-v10.html"> Eclipse</a> website. - - - - diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildException.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildException.java deleted file mode 100644 index 98f8506d1cf..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildException.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -public class BuildException extends Exception { - - public BuildException(String msg) { - super(msg); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java deleted file mode 100644 index 96c0cd1bcf2..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -public interface IBuildObject { - // Schema element names - public static final String ID = "id"; - public static final String NAME = "name"; - - public String getId(); - public String getName(); - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java deleted file mode 100644 index 840b3d80e49..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java +++ /dev/null @@ -1,83 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import org.eclipse.core.resources.IResource; - -public interface IConfiguration extends IBuildObject { - // Schema element names - public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$ - public static final String TOOL_REF = "toolReference"; //$NON-NLS-1$ - public static final String PARENT = "parent"; //$NON-NLS-1$ - - /** - * Returns the target for this configuration. - * - * @return - */ - public ITarget getTarget(); - - /** - * Returns the resource that owns the target that owns the configuration. - * @return - */ - public IResource getOwner(); - - /** - * Answers the configuration that the receiver is based on. - * - * @return - */ - public IConfiguration getParent(); - - /** - * Returns the tools that are used in this configuration. - * - * @return - */ - public ITool[] getTools(); - - /** - * Sets the name of the receiver to the value specified in the argument - * - * @param name - */ - public void setName(String name); - - /** - * Sets the value of a boolean option for this configuration. - * - * @param option The option to change. - * @param value The value to apply to the option. - * @throws BuildException - */ - public void setOption(IOption option, boolean value) - throws BuildException; - - /** - * Sets the value of a string option for this configuration. - * - * @param option The option that will be effected by change. - * @param value The value to apply to the option. - */ - public void setOption(IOption option, String value) - throws BuildException; - - /** - * Sets the value of a list option for this configuration. - * - * @param option The option to change. - * @param value The values to apply to the option. - */ - public void setOption(IOption option, String[] value) - throws BuildException; - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java deleted file mode 100644 index fe4b3621b36..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.eclipse.cdt.managedbuilder.core; - -import java.util.List; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -public interface IManagedBuildInfo { - - /** - * Add a new target to the build information for the receiver - * - * @param target - */ - public void addTarget(ITarget target); - - /** - * Answers true if the build system knows how to - * build a file with the extension passed in the argument. - * - * @param srcExt - * @return - */ - public boolean buildsFileType(String srcExt); - - /** - * Returns the name of the artifact to build for the receiver. - * - * @return - */ - public String getBuildArtifactName(); - - /** - * Answers the command needed to remove files on the build machine - * - * @return - */ - public String getCleanCommand(); - - /** - * Answers the name of the default configuration, for example Debug - * or Release. - * - * @return - */ - public String getConfigurationName(); - - /** - * Answers a String array containing the names of all the configurations - * defined for the project's current target. - * - * @return - */ - public String[] getConfigurationNames(); - - /** - * Get the default configuration associated with the receiver - * - * @return - */ - public IConfiguration getDefaultConfiguration(ITarget target); - - - /** - * Returns the default target in the receiver. - * - * @return - */ - public ITarget getDefaultTarget(); - - /** - * Answers the extension that will be built by the current configuration - * for the extension passed in the argument or null. - * - * @param resourceName - * @return - */ - public String getOutputExtension(String resourceExtension); - - /** - * Answers the flag to be passed to the build tool to produce a specific output - * or an empty String if there is no special flag. For example, the - * GCC tools use the '-o' flag to produce a named output, for example - * gcc -c foo.c -o foo.o - * - * @param outputExt - * @return - */ - public String getOutputFlag(String outputExt); - - /** - * Get the target specified in the argument. - * - * @param id - * @return - */ - public ITarget getTarget(String id); - - /** - * Answers the prefix that should be prepended to the name of the build - * artifact. For example, a library foo, should have the prefix 'lib' and - * the extension '.a', so the final goal would be 'libfoo.a' - * - * @param extension - * @return - */ - public String getOutputPrefix(String outputExtension); - - /** - * Get all of the targets associated with the receiver. - * - * @return - */ - public List getTargets(); - - /** - * Returns a String containing the flags, including - * those overridden by the user, for the tool that handles the - * type of source file defined by the argument. - * - * @param extension - * @return - */ - public String getFlagsForSource(String extension); - - /** - * Returns a String containing the flags, including - * those overridden by the user, for the tool that handles the - * type of target defined by the argument. - * - * @param extension - * @return - */ - public String getFlagsForTarget(String extension); - - /** - * Answers the libraries the project links in. - * - * @param extension - * @return - */ - public String[] getLibsForTarget(String extension); - - /** - * Answers a String containing the arguments to be passed to make. - * For example, if the user has selected a build that keeps going on error, the - * answer would contain {"-k"}. - * - * @return String - */ - public String getMakeArguments(); - - /** - * Answers a String containing the make command invocation - * for the default target/configuration. - */ - public String getMakeCommand(); - - /** - * Returns a String containing the command-line invocation - * for the tool associated with the source extension. - * - * @param extension the file extension of the file to be built - * @return String - */ - public String getToolForSource(String extension); - - /** - * Returns a String containing the command-line invocation - * for the tool associated with the target extension. - * - * @param extension - * @return - */ - public String getToolForTarget(String extension); - - /** - * Answers a String array containing the contents of the - * user objects option, if one is defined for the target. - * - * @param extension the file ecxtension of the build target - * @return - */ - public String[] getUserObjectsForTarget(String extension); - - /** - * Answers true if the build model has been changed by the user. - * - * @return boolean - */ - public boolean isDirty(); - - /** - * Answers true if the extension matches one of the special - * file extensions the tools for the target consider to be a header file. - * - * @param ext the file extension of the resource - * @return boolean - */ - public boolean isHeaderFile(String ext); - - /** - * Set the dirty flag for the build model to the value of the argument. - * - * @param isDirty - */ - public void setDirty(boolean isDirty); - - /** - * Set the primary configuration for the receiver. - * - * @param configuration The IConfiguration that will be used as the default - * for all building. - */ - public void setDefaultConfiguration(IConfiguration configuration); - - /** - * Set the primary target for the receiver. - * - * @param target - */ - public void setDefaultTarget(ITarget target); -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java deleted file mode 100644 index 4c483d8fe97..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java +++ /dev/null @@ -1,180 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -/** - * - */ -public interface IOption extends IBuildObject { - // Type for the value of the option - public static final int BOOLEAN = 0; - public static final int ENUMERATED = 1; - public static final int STRING = 2; - public static final int STRING_LIST = 3; - public static final int INCLUDE_PATH = 4; - public static final int PREPROCESSOR_SYMBOLS = 5; - public static final int LIBRARIES = 6; - public static final int OBJECTS = 7; - - // Schema attribute names for option elements - public static final String CATEGORY = "category"; - public static final String COMMAND = "command"; - public static final String DEFAULT_VALUE = "defaultValue"; - public static final String ENUM_VALUE = "enumeratedOptionValue"; - public static final String IS_DEFAULT = "isDefault"; - public static final String LIST_VALUE = "listOptionValue"; - public static final String TYPE_BOOL = "boolean"; - public static final String TYPE_ENUM = "enumerated"; - public static final String TYPE_INC_PATH = "includePath"; - public static final String TYPE_LIB = "libs"; - public static final String TYPE_STRING = "string"; - public static final String TYPE_STR_LIST = "stringList"; - public static final String TYPE_USER_OBJS = "userObjs"; - public static final String VALUE_TYPE = "valueType"; - - // Schema attribute names for listOptionValue elements - public static final String LIST_ITEM_VALUE = "value"; - public static final String LIST_ITEM_BUILTIN = "builtIn"; - - - /** - * If this option is defined as an enumeration, this function returns - * the list of possible values for that enum. - * - * If this option is not defined as an enumeration, it returns null. - * - * @return String [] - */ - public String [] getApplicableValues(); - - /** - * Answers the value for a boolean option. - * - * @return boolean - * @throws BuildException - */ - public boolean getBooleanValue() throws BuildException; - - /** - * Answers an array of strings containing the built-in values - * defined for a stringList, includePaths, definedSymbols, or libs - * option. If none have been defined, the array will be empty but - * never null. - * - * @return String[] - */ - public String[] getBuiltIns(); - - /** - * Returns the category for this option. - * - * @return IOptionCategory - */ - public IOptionCategory getCategory(); - - /** - * Answers a String containing the actual command line - * option associated with the option - * - * @return String - */ - public String getCommand(); - - /** - * Answers the user-defined preprocessor symbols. - * - * @return String[] - * @throws BuildException - */ - public String[] getDefinedSymbols() throws BuildException; - - /** - * Answers the command associated with the enumeration name. For - * example, if the enumeration name was 'Default' for the debug - * level option of the Gnu compiler, and the plugin manifest defined - * that as -g, then the return value would be a String containing "-g" - * - * @return - */ - public String getEnumCommand (String name); - - /** - * Answers an array of String containing the includes paths - * defined in the build model. - * - * @return String[] - * @throws BuildException - */ - public String[] getIncludePaths() throws BuildException; - - - /** - * Answers an array or Strings containing the libraries - * that must be linked into the project. - * - * @return String[] - * @throws BuildException - */ - public String[] getLibraries() throws BuildException ; - - /** - * Answers a String containing the selected enumeration in an - * enumerated option. For an option that has not been changed by the user, - * the receiver will answer with the default defined in the plugin manifest. - * If the user has modified the selection, the receiver will answer with the - * overridden selection. - * - * @return String - * @throws BuildException - */ - public String getSelectedEnum () throws BuildException; - - /** - * Returns the current value for this option if it is a List of Strings. - * - * @return String [] - * @throws BuildException - */ - public String [] getStringListValue() throws BuildException; - - /** - * Returns the current value for this option if it is a String - * - * @return String - * @throws BuildException - */ - public String getStringValue() throws BuildException; - - /** - * Returns the tool defining this option. - * - * @return ITool - */ - public ITool getTool(); - - - /** - * Answers all of the user-defined object files that must be linked with - * the final build target. - * - * @return - * @throws BuildException - */ - public String [] getUserObjects() throws BuildException; - - /** - * Get the type for the value of the option. - * - * @return int - */ - public int getValueType(); - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java deleted file mode 100644 index 5067a92de36..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -/** - * - */ -public interface IOptionCategory extends IBuildObject { - - // Schema element names - public static final String PARENT = "parent"; - - /** - * Returns the list of children of this node in the option category tree - * - * @return - */ - public IOptionCategory[] getChildCategories(); - - /** - * Returns the options in this category for a given configuration. - * - * @param tool - * @return - */ - public IOption[] getOptions(IConfiguration configuration); - - /** - * Returns the category that owns this category, or null if this is the - * top category for a tool. - * - * @return - */ - public IOptionCategory getOwner(); - - /** - * Returns the tool that ultimately owns this category. - * - * @return - */ - public ITool getTool(); -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java deleted file mode 100644 index ef7395aba71..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java +++ /dev/null @@ -1,185 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import org.eclipse.core.resources.IResource; - -/** - * This class represents targets for the managed build process. A target - * is some type of resource built using a given collection of tools. - */ -public interface ITarget extends IBuildObject { - public static final String TARGET_ELEMENT_NAME = "target"; //$NON-NLS-1$ - public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$ - public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$ - public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$ - public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$ - public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$ - public static final String IS_TEST = "isTest"; //$NON-NLS-1$ - public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$ - public static final String OS_LIST = "osList"; //$NON-NLS-1$ - public static final String PARENT = "parent"; //$NON-NLS-1$ - - /** - * Creates a configuration for the target populated with the tools and - * options settings from the parent configuration. As options and tools - * change in the parent, unoverridden values are updated in the child - * config as well. - * - * @param parent The IConfiguration to use as a settings template - * @param id The unique id the new configuration will have - * @return IConfiguration - */ - public IConfiguration createConfiguration(IConfiguration parent, String id); - - /** - * Creates a new configuration for the target. It is populated with - * the tools defined for that target and options set at their defaults. - * - * @param id id for this configuration. - * @return IConfiguration - */ - public IConfiguration createConfiguration(String id); - - /** - * Get the name of the final build artifact. - * - * @return String - */ - public String getArtifactName(); - - /** - * Answers the unique ID of the binary parser associated with the target. - * - * @return String - */ - public String getBinaryParserId(); - - /** - * Answers the OS-specific command to remove files created by the build - * - * @return String - */ - public String getCleanCommand(); - - /** - * Returns all of the configurations defined by this target. - * - * @return IConfiguration[] - */ - public IConfiguration[] getConfigurations(); - - /** - * Get the default extension that should be applied to build artifacts - * created by this target. - * - * @return String - */ - public String getDefaultExtension(); - - /** - * Answers the name of the make utility for the target. - * - * @return String - */ - public String getMakeCommand(); - - /** - * Returns the configuration with the given id, or null if not found. - * - * @param id - * @return IConfiguration - */ - public IConfiguration getConfiguration(String id); - - /** - * Gets the resource that this target is applied to. - * - * @return IResource - */ - public IResource getOwner(); - - /** - * Answers the ITarget that is the parent of the receiver. - * - * @return ITarget - */ - public ITarget getParent(); - - /** - * Answers an array of operating systems the target can be created on. - * - * @return String[] - */ - public String[] getTargetOSList(); - - /** - * Returns the list of platform specific tools associated with this - * platform. - * - * @return ITool[] - */ - public ITool[] getTools(); - - - /** - * Answers true if the receiver has a make command that differs from its - * parent specification. - * - * @return boolean - */ - public boolean hasOverridenMakeCommand(); - - /** - * Returns whether this target is abstract. - * @return boolean - */ - public boolean isAbstract(); - - /** - * Answers true if the receiver is a target that is defined - * for testing purposes only, else false. A test target will - * not be shown in the UI but can still be manipulated programmatically. - * - * @return boolean - */ - public boolean isTestTarget(); - - /** - * Removes the configuration with the ID specified in the argument. - * - * @param id - */ - public void removeConfiguration(String id); - - /** - * Resets the make command in the receiver to the value specified in - * its parent. - * - */ - public void resetMakeCommand(); - - /** - * Set the name of the artifact that will be produced when the receiver - * is built. - * - * @param name - */ - public void setBuildArtifact(String name); - - /** - * Sets the make command for the receiver to the value in the argument. - * - * @param command - */ - public void setMakeCommand(String command); - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java deleted file mode 100644 index dcc2fea7b29..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java +++ /dev/null @@ -1,151 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -/** - * - */ -public interface ITool extends IBuildObject { - // Schema element names - public static final String COMMAND = "command"; //$NON-NLS-1$ - public static final String INTERFACE_EXTS = "headerExtensions"; //$NON-NLS-1$ - public static final String NATURE = "natureFilter"; //$NON-NLS-1$ - public static final String OPTION = "option"; //$NON-NLS-1$ - public static final String OPTION_CAT = "optionCategory"; //$NON-NLS-1$ - public static final String OPTION_REF = "optionReference"; //$NON-NLS-1$ - public static final String OUTPUT_FLAG = "outputFlag"; //$NON-NLS-1$ - public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$ - public static final String OUTPUTS = "outputs"; //$NON-NLS-1$ - public static final String SOURCES = "sources"; //$NON-NLS-1$ - public static final String TOOL_ELEMENT_NAME = "tool"; //$NON-NLS-1$ - public static final String WHITE_SPACE = " "; //$NON-NLS-1$ - - public static final int FILTER_C = 0; - public static final int FILTER_CC = 1; - public static final int FILTER_BOTH = 2; - - /** - * Return true if the receiver builds files with the - * specified extension, else false. - * - * @param extension file extension of the source - * @return boolean - */ - public boolean buildsFileType(String extension); - - /** - * Answers a constant corresponding to the project nature the tool should be used - * for. Possible answers are: - * - *
- *
ITool.FILTER_C - *
The tool should only be displayed for C projects. Notes: even - * though a C++ project has a C nature, this flag will mask the tool for C++ - * projects. - *
ITool.FILTER_CC - *
The tool should only be displayed for C++ projects. - *
ITool.FILTER_BOTH - *
The tool should be displayed for projects with both natures. - *
- * - * @return int - */ - public int getNatureFilter(); - - /** - * Get a particular option. - * - * @param id unique identifier of the option to search for - * @return IOption - */ - public IOption getOption(String id); - - /** - * Answers the options that may be customized for this tool. - * - * @return IOption[] - */ - public IOption[] getOptions(); - - /** - * Answer the output extension the receiver will create from the input, - * or null if the tool does not understand that extension. - * - * @param inputExtension The extension of the source file. - * @return String - */ - public String getOutputExtension(String inputExtension); - - /** - * Answers the argument that must be passed to a specific tool in order to - * control the name of the output artifact. For example, the GCC compile and - * linker use '-o', while the archiver does not. - * - * @return String - */ - public String getOutputFlag(); - - /** - * Answers the prefix that the tool should prepend to the name of the build artifact. - * For example, a librarian usually prepends 'lib' to the target.a - * @return String - */ - public String getOutputPrefix(); - - /** - * Return the target that defines this tool, if applicable - * @return ITarget - */ - public ITarget getTarget(); - - /** - * Answers the command-line invocation defined for the receiver. - * - * @return String - */ - public String getToolCommand(); - - /** - * Answers the additional command line arguments the user has specified for - * the tool. - * - * @return String - */ - public String getToolFlags() throws BuildException ; - - /** - * Options are organized into categories for UI purposes. - * These categories are organized into a tree. This is the root - * of that tree. - * - * @return IOptionCategory - */ - public IOptionCategory getTopOptionCategory(); - - /** - * Answers true if the tool considers the file extension to be - * one associated with a header file. - * - * @param ext file extension of the source - * @return boolean - */ - public boolean isHeaderFile(String ext); - - /** - * Answers true if the receiver builds a file with the extension specified - * in the argument, else false. - * - * @param outputExtension extension of the file being produced by a tool - * @return boolean - */ - public boolean producesFileType(String outputExtension); - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java deleted file mode 100644 index 6d39ed13638..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java +++ /dev/null @@ -1,555 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.core; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.xerces.dom.DocumentImpl; -import org.apache.xml.serialize.Method; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.Serializer; -import org.apache.xml.serialize.SerializerFactory; -import org.eclipse.cdt.core.AbstractCExtension; -import org.eclipse.cdt.core.parser.*; -import org.eclipse.cdt.managedbuilder.internal.core.Configuration; -import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.internal.core.Target; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.QualifiedName; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * This is the main entry point for getting at the build information - * for the managed build system. - */ -public class ManagedBuildManager extends AbstractCExtension implements IScannerInfoProvider { - - private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo"); - private static final String ROOT_ELEM_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$ - private static final String FILE_NAME = ".cdtbuild"; //$NON-NLS-1$ - private static final ITarget[] emptyTargets = new ITarget[0]; - public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + "ManagedBuildManager"; //$NON-NLS-1$ - public static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$ - - // Targets defined by extensions (i.e., not associated with a resource) - private static boolean extensionTargetsLoaded = false; - private static List extensionTargets; - private static Map extensionTargetMap; - - // Listeners interested in build model changes - private static Map buildModelListeners; - - /** - * Returns the list of targets that are defined by this project, - * projects referenced by this project, and by the extensions. - * - * @param project - * @return - */ - public static ITarget[] getDefinedTargets(IProject project) { - // Make sure the extensions are loaded - loadExtensions(); - - // Get the targets for this project and all referenced projects - List definedTargets = null; - // To Do - - // Create the array and copy the elements over - int size = extensionTargets != null ? - extensionTargets.size() + (definedTargets != null ? definedTargets.size() : 0) : - 0; - - ITarget[] targets = new ITarget[size]; - - int n = 0; - for (int i = 0; i < extensionTargets.size(); ++i) - targets[n++] = (ITarget)extensionTargets.get(i); - - if (definedTargets != null) - for (int i = 0; i < definedTargets.size(); ++i) - targets[n++] = (ITarget)definedTargets.get(i); - - return targets; - } - - /** - * @return - */ - public static Map getExtensionTargetMap() { - if (extensionTargetMap == null) { - extensionTargetMap = new HashMap(); - } - return extensionTargetMap; - } - - /** - * Returns the targets owned by this project. If none are owned, - * an empty array is returned. - * - * @param project - * @return - */ - public static ITarget[] getTargets(IResource resource) { - IManagedBuildInfo buildInfo = getBuildInfo(resource); - - if (buildInfo != null) { - List targets = buildInfo.getTargets(); - return (ITarget[])targets.toArray(new ITarget[targets.size()]); - } else { - return emptyTargets; - } - } - - - /** - * Answers the result of a best-effort search to find a target with the - * specified ID, or null if one is not found. - * - * @param resource - * @param id - * @return - */ - public static ITarget getTarget(IResource resource, String id) { - ITarget target = null; - // Check if the target is spec'd in the build info for the resource - if (resource != null) { - IManagedBuildInfo buildInfo = getBuildInfo(resource); - if (buildInfo != null) - target = buildInfo.getTarget(id); - } - // OK, check the extension map - if (target == null) { - target = (ITarget)getExtensionTargetMap().get(id); - } - return target; - } - - /** - * Creates a new target for the resource based on the parentTarget. - * - * @param resource - * @param parentTarget - * @return new ITarget with settings based on the parent passed in the arguments - * @throws BuildException - */ - public static ITarget createTarget(IResource resource, ITarget parentTarget) - throws BuildException - { - IResource owner = parentTarget.getOwner(); - - if (owner != null && owner.equals(resource)) - // Already added - return parentTarget; - - if (resource instanceof IProject) { - // Must be an extension target (why?) - if (owner != null) - throw new BuildException("addTarget: owner not null"); - } else { - // Owner must be owned by the project containing this resource - if (owner == null) - throw new BuildException("addTarget: null owner"); - if (!owner.equals(resource.getProject())) - throw new BuildException("addTarget: owner not project"); - } - - // Passed validation - return new Target(resource, parentTarget); - } - - /** - * Sets the default configuration for the project. Note that this will also - * update the default target if needed. - * - * @param project - * @param newDefault - */ - public static void setDefaultConfiguration(IProject project, IConfiguration newDefault) { - if (project == null || newDefault == null) { - return; - } - // Set the default in build information for the project - IManagedBuildInfo info = getBuildInfo(project); - if (info != null) { - info.setDefaultConfiguration(newDefault); - } - } - - /** - * @param config - * @param option - */ - private static void setDirty(IConfiguration config, IOption option) { - // Set the build info dirty so builder will rebuild - IResource resource = config.getOwner(); - IManagedBuildInfo info = getBuildInfo(resource); - info.setDirty(true); - - // Continue if change is something that effect the scanner - if (!(option.getValueType() == IOption.INCLUDE_PATH - || option.getValueType() == IOption.PREPROCESSOR_SYMBOLS)) { - return; - } - // Figure out if there is a listener for this change - List listeners = (List) getBuildModelListeners().get(resource); - if (listeners == null) { - return; - } - ListIterator iter = listeners.listIterator(); - while (iter.hasNext()) { - ((IScannerInfoChangeListener)iter.next()).changeNotification(resource, (IScannerInfo)getBuildInfo(resource, false)); - } - } - - /** - * Set the string value for an option for a given config. - * - * @param config The configuration the option belongs to. - * @param option The option to set the value for. - * @param value The boolean that the option should contain after the change. - */ - public static void setOption(IConfiguration config, IOption option, boolean value) { - try { - config.setOption(option, value); - setDirty(config, option); - } catch (BuildException e) { - return; - } - } - - /** - * Set the string value for an option for a given config. - * - * @param config The configuration the option belongs to. - * @param option The option to set the value for. - * @param value The value that the option should contain after the change. - */ - public static void setOption(IConfiguration config, IOption option, String value) { - try { - config.setOption(option, value); - setDirty(config, option); - } catch (BuildException e) { - return; - } - } - - /** - * Set the string array value for an option for a given config. - * - * @param config The configuration the option belongs to. - * @param option The option to set the value for. - * @param value The values the option should contain after the change. - */ - public static void setOption(IConfiguration config, IOption option, String[] value) { - try { - config.setOption(option, value); - setDirty(config, option); - } catch (BuildException e) { - return; - } - } - - /** - * Saves the build information associated with a project and all resources - * in the project to the build info file. - * - * @param project - */ - public static void saveBuildInfo(IProject project) { - // Create document - Document doc = new DocumentImpl(); - Element rootElement = doc.createElement(ROOT_ELEM_NAME); - doc.appendChild(rootElement); - - // Save the build info - ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project); - if (buildInfo != null) - buildInfo.serialize(doc, rootElement); - - // Save the document - ByteArrayOutputStream s = new ByteArrayOutputStream(); - OutputFormat format = new OutputFormat(); - format.setIndenting(true); - format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$ - String xml = null; - try { - Serializer serializer - = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(s, "UTF8"), format); - serializer.asDOMSerializer().serialize(doc); - xml = s.toString("UTF8"); //$NON-NLS-1$ - IFile rscFile = project.getFile(FILE_NAME); - InputStream inputStream = new ByteArrayInputStream(xml.getBytes()); - // update the resource content - if (rscFile.exists()) { - rscFile.setContents(inputStream, IResource.FORCE, null); - } else { - rscFile.create(inputStream, IResource.FORCE, null); - } - } catch (Exception e) { - return; - } - } - - /** - * @param resource - */ - public static void removeBuildInfo(IResource resource) { - try { - resource.setSessionProperty(buildInfoProperty, null); - } catch (CoreException e) { - } - } - - /** - * Resets the build information for the project and configuration specified in the arguments. - * The build information will contain the settings defined in the plugin manifest. - * - * @param project - * @param configuration - */ - public static void resetConfiguration(IProject project, IConfiguration configuration) { - // Make sure the extensions are loaded - loadExtensions(); - - // Find out the parent of the configuration - IConfiguration parentConfig = configuration.getParent(); - // Find the parent target the configuration - ITarget parentTarget = parentConfig.getTarget(); - - // Get the extension point information - IExtensionPoint extensionPoint = ManagedBuilderCorePlugin.getDefault().getDescriptor().getExtensionPoint(EXTENSION_POINT_ID); - IExtension[] extensions = extensionPoint.getExtensions(); - for (int i = 0; i < extensions.length; ++i) { - IExtension extension = extensions[i]; - IConfigurationElement[] elements = extension.getConfigurationElements(); - for (int j = 0; j < elements.length; ++j) { - IConfigurationElement element = elements[j]; - if (element.getName().equals(ITarget.TARGET_ELEMENT_NAME) && - element.getAttribute(ITarget.ID).equals(parentTarget.getId())) { - // We have the parent target so get the definition for the parent config - IConfigurationElement[] targetElements = element.getChildren(); - for (int k = 0; k < targetElements.length; ++k) { - IConfigurationElement targetElement = targetElements[k]; - if (targetElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME) && - targetElement.getAttribute(IConfiguration.ID).equals(parentConfig.getId())) { - // We now have the plugin element the target was originally based on - ((Configuration)configuration).reset(targetElement); - } - } - } - } - } - } - - // Private stuff - - public static void addExtensionTarget(Target target) { - if (extensionTargets == null) { - extensionTargets = new ArrayList(); - } - - extensionTargets.add(target); - getExtensionTargetMap().put(target.getId(), target); - } - - private static ManagedBuildInfo loadBuildInfo(IProject project) { - ManagedBuildInfo buildInfo = null; - IFile file = project.getFile(FILE_NAME); - if (!file.exists()) - return null; - - try { - InputStream stream = file.getContents(); - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(stream); - Node rootElement = document.getFirstChild(); - if (rootElement.getNodeName().equals(ROOT_ELEM_NAME)) { - buildInfo = new ManagedBuildInfo(project, (Element)rootElement); - project.setSessionProperty(buildInfoProperty, buildInfo); - } - } catch (Exception e) { - buildInfo = null; - } - - return buildInfo; - } - - private static void loadExtensions() { - if (extensionTargetsLoaded) - return; - extensionTargetsLoaded = true; - - IExtensionPoint extensionPoint = ManagedBuilderCorePlugin.getDefault().getDescriptor().getExtensionPoint(EXTENSION_POINT_ID); - IExtension[] extensions = extensionPoint.getExtensions(); - for (int i = 0; i < extensions.length; ++i) { - IExtension extension = extensions[i]; - IConfigurationElement[] elements = extension.getConfigurationElements(); - for (int j = 0; j < elements.length; ++j) { - IConfigurationElement element = elements[j]; - if (element.getName().equals(ITarget.TARGET_ELEMENT_NAME)) { - new Target(element); - } - } - } - } - - /** - * @param project - * @return - */ - public static boolean manages(IResource resource) { - // The managed build manager manages build information for the - // resource IFF it it is a project and has a build file with the proper - // root element - IProject project = null; - if (resource instanceof IProject){ - project = (IProject)resource; - } else if (resource instanceof IFile) { - project = ((IFile)resource).getProject(); - } else { - return false; - } - IFile file = project.getFile(FILE_NAME); - if (file.exists()) { - try { - InputStream stream = file.getContents(); - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(stream); - Node rootElement = document.getFirstChild(); - if (rootElement.getNodeName().equals(ROOT_ELEM_NAME)) { - return true; - } - } catch (Exception e) { - return false; - } - } - return false; - } - - private static ManagedBuildInfo findBuildInfo(IResource resource, boolean create) { - // Make sure the extension information is loaded first - loadExtensions(); - ManagedBuildInfo buildInfo = null; - try { - buildInfo = (ManagedBuildInfo)resource.getSessionProperty(buildInfoProperty); - } catch (CoreException e) { - return buildInfo; - } - - if (buildInfo == null && resource instanceof IProject) { - buildInfo = loadBuildInfo((IProject)resource); - } - - if (buildInfo == null && create) { - try { - buildInfo = new ManagedBuildInfo(resource); - resource.setSessionProperty(buildInfoProperty, buildInfo); - } catch (CoreException e) { - buildInfo = null; - } - } - - return buildInfo; - } - - public static IManagedBuildInfo getBuildInfo(IResource resource, boolean create) { - return (IManagedBuildInfo) findBuildInfo(resource, create); - } - - public static IManagedBuildInfo getBuildInfo(IResource resource) { - return (IManagedBuildInfo) findBuildInfo(resource, false); - } - - /* - * @return - */ - private static Map getBuildModelListeners() { - if (buildModelListeners == null) { - buildModelListeners = new HashMap(); - } - return buildModelListeners; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource) - */ - public IScannerInfo getScannerInformation(IResource resource) { - return (IScannerInfo) getBuildInfo(resource, false); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#subscribe(org.eclipse.cdt.core.parser.IScannerInfoChangeListener) - */ - public synchronized void subscribe(IResource resource, IScannerInfoChangeListener listener) { - IResource project = null; - if (resource instanceof IProject) { - project = resource; - } else if (resource instanceof IFile) { - project = ((IFile)resource).getProject(); - } else { - return; - } - // Get listeners for this resource - Map map = getBuildModelListeners(); - List list = (List) map.get(project); - if (list == null) { - // Create a new list - list = new ArrayList(); - } - if (!list.contains(listener)) { - // Add the new listener for the resource - list.add(listener); - map.put(project, list); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScannerInfoProvider#unsubscribe(org.eclipse.cdt.core.parser.IScannerInfoChangeListener) - */ - public synchronized void unsubscribe(IResource resource, IScannerInfoChangeListener listener) { - IResource project = null; - if (resource instanceof IProject) { - project = resource; - } else if (resource instanceof IFile) { - project = ((IFile)resource).getProject(); - } else { - return; - } - // Remove the listener - Map map = getBuildModelListeners(); - List list = (List) map.get(project); - if (list != null && !list.isEmpty()) { - // The list is not empty so try to remove listener - list.remove(listener); - map.put(project, list); - } - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java deleted file mode 100644 index a671aea8511..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.managedbuilder.core; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.Plugin; - - -public class ManagedBuilderCorePlugin extends Plugin { - //The shared instance. - private static ManagedBuilderCorePlugin plugin; - //Resource bundle. - private static ResourceBundle resourceBundle; - - /** - * @param descriptor - */ - public ManagedBuilderCorePlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - try { - resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.managedbuilder.internal.core.PluginResources"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - /** - * Returns the shared instance. - */ - public static ManagedBuilderCorePlugin getDefault() { - return plugin; - } - - - public static String getResourceString(String key) { - try { - return resourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!"; - } catch (NullPointerException e) { - return "#" + key + "#"; - } - } - - public static String getFormattedString(String key, String arg) { - return MessageFormat.format(getResourceString(key), new String[] { arg }); - } - - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(getResourceString(key), args); - } - - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.managedbuilder.core"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java deleted file mode 100644 index 235167976e8..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java +++ /dev/null @@ -1,182 +0,0 @@ -package org.eclipse.cdt.managedbuilder.core; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Vector; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Plugin; - -public class ManagedCProjectNature implements IProjectNature { - public static final String BUILDER_NAME = "genmakebuilder"; - public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; - private static final String MNG_NATURE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".managedBuildNature"; - private IProject project; - - /** - * Utility method for adding a managed nature to a project. - * - * @param proj the project to add the managed nature to. - * @param monitor a progress monitor to indicate the duration of the operation, or - * null if progress reporting is not required. - */ - public static void addManagedNature(IProject project, IProgressMonitor monitor) throws CoreException { - addNature(project, MNG_NATURE_ID, monitor); - } - - public static void addManagedBuilder(IProject project, IProgressMonitor monitor) throws CoreException { - // Add the builder to the project - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - - // TODO Remove this when the new StandardBuild nature adds the cbuilder - for (int i = 0; i < commands.length; i++) { - ICommand command = commands[i]; - if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) { - // Remove the command - Vector vec = new Vector(Arrays.asList(commands)); - vec.removeElementAt(i); - vec.trimToSize(); - ICommand[] tempCommands = (ICommand[]) vec.toArray(new ICommand[commands.length-1]); - description.setBuildSpec(tempCommands); - break; - } - } - - commands = description.getBuildSpec(); - boolean found = false; - // See if the builder is already there - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(getBuilderID())) { - found = true; - break; - } - } - if (!found) { - //add builder to project - ICommand command = description.newCommand(); - command.setBuilderName(getBuilderID()); - ICommand[] newCommands = new ICommand[commands.length + 1]; - // Add it before other builders. - System.arraycopy(commands, 0, newCommands, 1, commands.length); - newCommands[0] = command; - description.setBuildSpec(newCommands); - project.setDescription(description, null); - } - } - - /** - * Utility method for adding a nature to a project. - * - * @param proj the project to add the nature to. - * @param natureId the id of the nature to assign to the project - * @param monitor a progress monitor to indicate the duration of the operation, or - * null if progress reporting is not required. - */ - public static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = project.getDescription(); - String[] prevNatures = description.getNatureIds(); - for (int i = 0; i < prevNatures.length; i++) { - if (natureId.equals(prevNatures[i])) - return; - } - String[] newNatures = new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length] = natureId; - description.setNatureIds(newNatures); - project.setDescription(description, monitor); - } - - /** - * Get the correct builderID - */ - public static String getBuilderID() { - Plugin plugin = (Plugin)ManagedBuilderCorePlugin.getDefault(); - IPluginDescriptor descriptor = plugin.getDescriptor(); - if (descriptor.getExtension(BUILDER_NAME) != null) { - return descriptor.getUniqueIdentifier() + "." + BUILDER_NAME; - } - return BUILDER_ID; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#configure() - */ - public void configure() throws CoreException { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#deconfigure() - */ - public void deconfigure() throws CoreException { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#getProject() - */ - public IProject getProject() { - // Just return the project associated with the nature - return project; - } - - - /** - * Utility method to remove the managed nature from a project. - * - * @param project to remove the managed nature from - * @param mon progress monitor to indicate the duration of the operation, or - * null if progress reporting is not required. - * @throws CoreException - */ - public static void removeManagedNature(IProject project, IProgressMonitor mon) throws CoreException { - removeNature(project, MNG_NATURE_ID, mon); - } - - /** - * Utility method for removing a project nature from a project. - * - * @param proj the project to remove the nature from - * @param natureId the nature id to remove - * @param monitor a progress monitor to indicate the duration of the operation, or - * null if progress reporting is not required. - */ - public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = project.getDescription(); - String[] prevNatures = description.getNatureIds(); - List newNatures = new ArrayList(Arrays.asList(prevNatures)); - newNatures.remove(natureId); - description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()])); - project.setDescription(description, monitor); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject) - */ - public void setProject(IProject project) { - // Set the project for the nature - this.project = project; - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java deleted file mode 100644 index 482e691ebd5..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.core; - -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.IBuildObject; - -public class BuildObject implements IBuildObject { - - protected String id; - protected String name; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId() - */ - public String getId() { - return id; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#setId(java.lang.String) - */ - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#getName() - */ - public String getName() { - return name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#setName(java.lang.String) - */ - public void setName(String name) { - this.name = name; - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java deleted file mode 100644 index a223de8147c..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java +++ /dev/null @@ -1,459 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.internal.core; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * - */ -public class Configuration extends BuildObject implements IConfiguration { - - private ITarget target; - private IConfiguration parent; - private List toolReferences; - - /** - * A fresh new configuration for a target. - * - * @param target - * @param id - */ - public Configuration(Target target, String id) { - this.id = id; - this.target = target; - - target.addConfiguration(this); - } - - /** - * Create a new configuration based on one already defined. - * - * @param target The Target the receiver will be added to. - * @param parent The IConfiguration to copy the settings from. - * @param id A unique ID for the configuration. - */ - public Configuration(Target target, IConfiguration parent, String id) { - this.id = id; - this.name = parent.getName(); - this.target = target; - this.parent = parent; - - // Check that the tool and the project match - IProject project = (IProject) target.getOwner(); - - // Get the tool references from the parent - List parentToolRefs = ((Configuration)parent).getLocalToolReferences(); - Iterator iter = parentToolRefs.listIterator(); - while (iter.hasNext()) { - ToolReference toolRef = (ToolReference)iter.next(); - - // Make a new ToolReference based on the tool in the ref - ToolReference newRef = new ToolReference(this, toolRef.getTool()); - List optRefs = toolRef.getLocalOptionRefs(); - Iterator optIter = optRefs.listIterator(); - while (optIter.hasNext()) { - OptionReference optRef = (OptionReference)optIter.next(); - IOption opt = optRef.getOption(); - try { - switch (opt.getValueType()) { - case IOption.BOOLEAN: - new OptionReference(newRef, opt).setValue(optRef.getBooleanValue()); - break; - case IOption.STRING: - new OptionReference(newRef, opt).setValue(optRef.getStringValue()); - break; - case IOption.ENUMERATED: - new OptionReference(newRef, opt).setValue(optRef.getSelectedEnum()); - break; - case IOption.STRING_LIST : - new OptionReference(newRef, opt).setValue(optRef.getStringListValue()); - break; - case IOption.INCLUDE_PATH : - new OptionReference(newRef, opt).setValue(optRef.getIncludePaths()); - break; - case IOption.PREPROCESSOR_SYMBOLS : - new OptionReference(newRef, opt).setValue(optRef.getDefinedSymbols()); - break; - case IOption.LIBRARIES : - new OptionReference(newRef, opt).setValue(optRef.getLibraries()); - break; - case IOption.OBJECTS : - new OptionReference(newRef, opt).setValue(optRef.getUserObjects()); - break; - } - } catch (BuildException e) { - continue; - } - } - } - - target.addConfiguration(this); - } - - /** - * Create a new Configuration based on the specification in the plugin manifest. - * - * @param target The Target the receiver will be added to. - * @param element The element from the manifest that contains the default configuration settings. - */ - public Configuration(Target target, IConfigurationElement element) { - this.target = target; - - // id - setId(element.getAttribute(IConfiguration.ID)); - - // hook me up - target.addConfiguration(this); - - // name - setName(element.getAttribute(IConfiguration.NAME)); - - IConfigurationElement[] configElements = element.getChildren(); - for (int l = 0; l < configElements.length; ++l) { - IConfigurationElement configElement = configElements[l]; - if (configElement.getName().equals(IConfiguration.TOOL_REF)) { - new ToolReference(this, configElement); - } - } - } - - /** - * Build a configuration from the project manifest file. - * - * @param target The Target the configuration belongs to. - * @param element The element from the manifest that contains the overridden configuration information. - */ - public Configuration(Target target, Element element) { - this.target = target; - - // id - setId(element.getAttribute(IConfiguration.ID)); - - // hook me up - target.addConfiguration(this); - - // name - if (element.hasAttribute(IConfiguration.NAME)) - setName(element.getAttribute(IConfiguration.NAME)); - - if (element.hasAttribute(IConfiguration.PARENT)) { - // See if the target has a parent - ITarget targetParent = target.getParent(); - // If so, then get my parent from it - if (targetParent != null) { - parent = targetParent.getConfiguration(element.getAttribute(IConfiguration.PARENT)); - } - else { - parent = null; - } - } - - NodeList configElements = element.getChildNodes(); - for (int i = 0; i < configElements.getLength(); ++i) { - Node configElement = configElements.item(i); - if (configElement.getNodeName().equals(IConfiguration.TOOL_REF)) { - new ToolReference(this, (Element)configElement); - } - } - - } - - /** - * Persist receiver to project file. - * - * @param doc - * @param element - */ - public void serialize(Document doc, Element element) { - element.setAttribute(IConfiguration.ID, id); - - if (name != null) - element.setAttribute(IConfiguration.NAME, name); - - if (parent != null) - element.setAttribute(IConfiguration.PARENT, parent.getId()); - - // Serialize only the tool references defined in the configuration - Iterator iter = getLocalToolReferences().listIterator(); - while (iter.hasNext()) { - ToolReference toolRef = (ToolReference) iter.next(); - Element toolRefElement = doc.createElement(IConfiguration.TOOL_REF); - element.appendChild(toolRefElement); - toolRef.serialize(doc, toolRefElement); - } - } - - /* (non-javadoc) - * A safety method to avoid NPEs. It answers the tool reference list in the - * receiver. It does not look at the tool references defined in the parent. - * - * @return List - */ - protected List getLocalToolReferences() { - if (toolReferences == null) { - toolReferences = new ArrayList(); - } - return toolReferences; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#getName() - */ - public String getName() { - return (name == null && parent != null) ? parent.getName() : name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#getTools() - */ - public ITool[] getTools() { - ITool[] tools = parent != null - ? parent.getTools() - : target.getTools(); - - // Validate that the tools correspond to the nature - IProject project = (IProject)target.getOwner(); - if (project != null) { - List validTools = new ArrayList(); - - // The target is associated with a real project - for (int i = 0; i < tools.length; ++i) { - ITool tool = tools[i]; - // Make sure the tool filter and project nature agree - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - try { - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - validTools.add(tool); - } - } catch (CoreException e) { - continue; - } - break; - case ITool.FILTER_CC: - try { - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - validTools.add(tool); - } - } catch (CoreException e) { - continue; - } - break; - case ITool.FILTER_BOTH: - validTools.add(tool); - break; - } - } - // Now put the valid tools back into the array - tools = (ITool[]) validTools.toArray(new ITool[validTools.size()]); - } - - // Replace tools with local overrides - for (int i = 0; i < tools.length; ++i) { - ITool tool = tools[i]; - if (tool == null) { - // May have been filtered out - continue; - } - ToolReference ref = getToolReference(tools[i]); - if (ref != null) - tools[i] = ref; - } - - return tools; - } - - /** - * @param targetElement - */ - public void reset(IConfigurationElement element) { - // I just need to reset the tool references - getLocalToolReferences().clear(); - IConfigurationElement[] configElements = element.getChildren(); - for (int l = 0; l < configElements.length; ++l) { - IConfigurationElement configElement = configElements[l]; - if (configElement.getName().equals(IConfiguration.TOOL_REF)) { - new ToolReference(this, configElement); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#getParent() - */ - public IConfiguration getParent() { - return parent; - } - - /* (non-javadoc) - * - * @param tool - * @return List - */ - protected List getOptionReferences(ITool tool) { - List references = new ArrayList(); - - // Get all the option references I add for this tool - ToolReference toolRef = getToolReference(tool); - if (toolRef != null) { - references.addAll(toolRef.getLocalOptionRefs()); - } - - // See if there is anything that my parents add that I don't - if (parent != null) { - List temp = ((Configuration)parent).getOptionReferences(tool); - Iterator iter = temp.listIterator(); - while (iter.hasNext()) { - OptionReference ref = (OptionReference) iter.next(); - if (!references.contains(ref)) { - references.add(ref); - } - } - } - - return references; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#getTarget() - */ - public ITarget getTarget() { - return (target == null && parent != null) ? parent.getTarget() : target; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#getOwner() - */ - public IResource getOwner() { - return getTarget().getOwner(); - } - - /** - * Returns the reference for a given tool or null if one is not - * found. - * - * @param tool - * @return ToolReference - */ - private ToolReference getToolReference(ITool tool) { - // See if the receiver has a reference to the tool - ToolReference ref = null; - Iterator iter = getLocalToolReferences().listIterator(); - while (iter.hasNext()) { - ToolReference temp = (ToolReference)iter.next(); - if (temp.references(tool)) { - ref = temp; - break; - } - } - - return ref; - } - - public void addToolReference(ToolReference toolRef) { - getLocalToolReferences().add(toolRef); - } - - public OptionReference createOptionReference(IOption option) { - if (option instanceof OptionReference) { - OptionReference optionRef = (OptionReference)option; - ToolReference toolRef = optionRef.getToolReference(); - if (toolRef.getConfiguration().equals(this)) - return optionRef; - else { - toolRef = new ToolReference(this, toolRef); - return toolRef.createOptionReference(option); - } - } else { - ToolReference toolRef = getToolReference(option.getTool()); - if (toolRef == null) - toolRef = new ToolReference(this, option.getTool()); - return toolRef.createOptionReference(option); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, boolean) - */ - public void setOption(IOption option, boolean value) throws BuildException { - // Is there a delta - if (option.getBooleanValue() != value) - createOptionReference(option).setValue(value); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String) - */ - public void setOption(IOption option, String value) throws BuildException { - String oldValue; - // Check whether this is an enumerated option - if (option.getValueType() == IOption.ENUMERATED) { - oldValue = option.getSelectedEnum(); - } - else { - oldValue = option.getStringValue(); - } - if (!oldValue.equals(value)) - createOptionReference(option).setValue(value); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String[]) - */ - public void setOption(IOption option, String[] value) throws BuildException { - // Is there a delta - String[] oldValue; - switch (option.getValueType()) { - case IOption.STRING_LIST : - oldValue = option.getStringListValue(); - break; - case IOption.INCLUDE_PATH : - oldValue = option.getIncludePaths(); - break; - case IOption.PREPROCESSOR_SYMBOLS : - oldValue = option.getDefinedSymbols(); - break; - case IOption.LIBRARIES : - oldValue = option.getLibraries(); - break; - case IOption.OBJECTS : - oldValue = option.getUserObjects(); - break; - default : - oldValue = new String[0]; - break; - } - if(!Arrays.equals(value, oldValue)) - createOptionReference(option).setValue(value); - } - - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java deleted file mode 100644 index c60ede4c2fd..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java +++ /dev/null @@ -1,442 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.core; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Enumeration; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CommandLauncher; -import org.eclipse.cdt.core.ConsoleOutputStream; -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.model.ICModelMarker; -import org.eclipse.cdt.core.resources.ACBuilder; -import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; - -public class GeneratedMakefileBuilder extends ACBuilder { - // String constants - private static final String MESSAGE = "ManagedMakeBuilder.message"; //$NON-NLS-1$ - private static final String BUILD_ERROR = MESSAGE + ".error"; //$NON-NLS-1$ - private static final String REFRESH_ERROR = BUILD_ERROR + ".refresh"; //$NON-NLS-1$ - private static final String BUILD_FINISHED = MESSAGE + ".finished"; //$NON-NLS-1$ - private static final String INCREMENTAL = MESSAGE + ".incremental"; //$NON-NLS-1$ - private static final String MAKE = MESSAGE + ".make"; //$NON-NLS-1$ - private static final String REBUILD = MESSAGE + ".rebuild"; //$NON-NLS-1$ - private static final String START = MESSAGE + ".starting"; //$NON-NLS-1$ - private static final String REFRESH = MESSAGE + ".updating"; //$NON-NLS-1$ - private static final String MARKERS = MESSAGE + ".creating.markers"; //$NON-NLS-1$ - - // Local variables - protected List resourcesToBuild; - protected List ruleList; - - - public class ResourceDeltaVisitor implements IResourceDeltaVisitor { - private boolean buildNeeded = false; - - public boolean visit(IResourceDelta delta) throws CoreException { - IResource resource = delta.getResource(); - // If the project has changed, then a build is needed and we can stop - if (resource != null && resource.getProject() == getProject()) { - buildNeeded = true; - return false; - } - - return true; - } - - public boolean shouldBuild() { - return buildNeeded; - } - } - - /** - * - */ - public GeneratedMakefileBuilder() { - } - - /* (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 { - String statusMsg = ManagedBuilderCorePlugin.getFormattedString(START, getProject().getName()); - if (statusMsg != null) { - monitor.subTask(statusMsg); - } - - // Get the build information - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject()); - - if (kind == IncrementalProjectBuilder.FULL_BUILD || info.isDirty()) { - fullBuild(monitor, info); - } - else if (kind == IncrementalProjectBuilder.AUTO_BUILD && info.isDirty()) { - fullBuild(monitor, info); - } - else { - // Create a delta visitor to make sure we should be rebuilding - ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); - IResourceDelta delta = getDelta(getProject()); - if (delta == null) { - fullBuild(monitor, info); - } - else { - delta.accept(visitor); - if (visitor.shouldBuild()) { - incrementalBuild(delta, info, monitor); - } - } - } - - // Scrub the build info of all the projects participating in the build - info.setDirty(false); - IProject[] deps = getProject().getReferencedProjects(); - for (int i = 0; i < deps.length; i++) { - IProject project = deps[i]; - IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(project); - // May not be a managed project - if (depInfo != null) { - depInfo.setDirty(false); - } - } - - // Ask build mechanism to compute deltas for project dependencies next time - return deps; - } - - /** - * Check whether the build has been canceled. Cancellation requests - * propagated to the caller by throwing OperationCanceledException. - * - * @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException() - */ - public void checkCancel(IProgressMonitor monitor) { - if (monitor != null && monitor.isCanceled()) { - throw new OperationCanceledException(); - } - } - - /** - * @param monitor - */ - protected void fullBuild(IProgressMonitor monitor, IManagedBuildInfo info) throws CoreException { - // Always need one of these bad boys - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - // Regenerate the makefiles for any managed projects this project depends on - IProject[] deps = getProject().getReferencedProjects(); - for (int i = 0; i < deps.length; i++) { - IProject depProject = deps[i]; - if (ManagedBuildManager.manages(depProject)) { - IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(depProject); - MakefileGenerator generator = new MakefileGenerator(depProject, depInfo, monitor); - try { - generator.regenerateMakefiles(); - } catch (CoreException e) { - // Throw the exception back to the builder - throw e; - } - } - } - - // Need to report status to the user - String statusMsg = ManagedBuilderCorePlugin.getFormattedString(REBUILD, getProject().getName()); - monitor.subTask(statusMsg); - - // Regenerate the makefiles for this project - MakefileGenerator generator = new MakefileGenerator(getProject(), info, monitor); - try { - generator.regenerateMakefiles(); - } catch (CoreException e) { - // Throw the exception back to the builder - throw e; - } - - // Now call make - IPath topBuildDir = generator.getTopBuildDir(); - if (topBuildDir != null) { - invokeMake(true, topBuildDir.removeFirstSegments(1), info, monitor); - } else { - monitor.done(); - } - } - - /* (non-javadoc) - * Answers an array of strings with the proper make targets - * - * @param fullBuild - * @return - */ - protected String[] getMakeTargets(boolean fullBuild) { - List args = new ArrayList(); - if (fullBuild) { - args.add("clean"); - } - args.add("all"); - return (String[])args.toArray(new String[args.size()]); - } - - /** - * @return - */ - protected List getResourcesToBuild() { - if (resourcesToBuild == null) { - resourcesToBuild = new ArrayList(); - } - return resourcesToBuild; - } - - /* (non-javadoc) - * Answers the list of build rules that have been assembled. If there are none, - * answers an empty list, never null - * - * @return - */ - protected List getRuleList() { - if (ruleList == null) { - ruleList = new ArrayList(); - } - return ruleList; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.resources.ACBuilder#getWorkingDirectory() - */ - public IPath getWorkingDirectory() { - IProject currProject = getProject(); - IPath workingDirectory = currProject.getLocation(); - return workingDirectory; - } - - /** - * @param delta - * @param monitor - */ - protected void incrementalBuild(IResourceDelta delta, IManagedBuildInfo info, IProgressMonitor monitor) throws CoreException { - // Rebuild the resource tree in the delta - String statusMsg = null; - - // Need to report status to the user - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - statusMsg = ManagedBuilderCorePlugin.getFormattedString(INCREMENTAL, getProject().getName()); - monitor.subTask(statusMsg); - - // Regenerate the makefiles for any managed projects this project depends on - IProject[] deps = getProject().getReferencedProjects(); - for (int i = 0; i < deps.length; i++) { - IProject depProject = deps[i]; - if (ManagedBuildManager.manages(depProject)) { - IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(depProject); - MakefileGenerator generator = new MakefileGenerator(depProject, depInfo, monitor); - try { - generator.regenerateMakefiles(); - } catch (CoreException e) { - // Throw the exception back to the builder - throw e; - } - } - } - - // Ask the makefile generator to generate any makefiles needed to build delta - MakefileGenerator generator = new MakefileGenerator(getProject(), info, monitor); - try { - generator.generateMakefiles(delta); - } catch (CoreException e) { - // Throw the exception back to the builder - throw e; - } - - // Run the build - IPath buildDir = new Path(info.getConfigurationName()); - invokeMake(false, buildDir, info, monitor); - } - - protected void invokeMake(boolean fullBuild, IPath buildDir, IManagedBuildInfo info, IProgressMonitor monitor) { - // Get the project and make sure there's a monitor to cancel the build - IProject currentProject = getProject(); - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - // Figure out the working directory for the build and make sure there is a makefile there - IPath workingDirectory = getWorkingDirectory().append(buildDir); - IWorkspace workspace = currentProject.getWorkspace(); - if (workspace == null) { - return; - } - IWorkspaceRoot root = workspace.getRoot(); - if (root == null) { - return; - } - IPath makefile = workingDirectory.addTrailingSeparator().append(MakefileGenerator.MAKEFILE_NAME); - if (root.getFileForLocation(makefile) == null) { - return; - } - - // Flag to the user that make is about to be called - IPath makeCommand = new Path(info.getMakeCommand()); - if (makeCommand != null) { - String[] msgs = new String[2]; - msgs[0] = makeCommand.toString(); - msgs[1] = currentProject.getName(); - monitor.beginTask(ManagedBuilderCorePlugin.getFormattedString(MAKE, msgs), IProgressMonitor.UNKNOWN); - - // Get a build console for the project - IConsole console = CCorePlugin.getDefault().getConsole(); - console.start(currentProject); - ConsoleOutputStream consoleOutStream = console.getOutputStream(); - - // Remove all markers for this project - removeAllMarkers(currentProject); - IProject[] deps = currentProject.getReferencedProjects(); - for (int i = 0; i < deps.length; i++) { - IProject project = deps[i]; - removeAllMarkers(project); - } - - // Get the arguments to be passed to make from build model - ArrayList makeArgs = new ArrayList(); - String args = info.getMakeArguments(); - if (args.length() > 0) { - makeArgs.add(args); - } - makeArgs.addAll(Arrays.asList(getMakeTargets(fullBuild))); - String[] makeTargets = (String[]) makeArgs.toArray(new String[makeArgs.size()]); - - // Get a launcher for the make command - String errMsg = null; - CommandLauncher launcher = new CommandLauncher(); - launcher.showCommand(true); - - // Set the environmennt, some scripts may need the CWD var to be set. - Properties props = launcher.getEnvironment(); - props.put("CWD", workingDirectory.toOSString()); //$NON-NLS-1$ - props.put("PWD", workingDirectory.toOSString()); //$NON-NLS-1$ - String[] env = null; - ArrayList envList = new ArrayList(); - Enumeration names = props.propertyNames(); - if (names != null) { - while (names.hasMoreElements()) { - String key = (String) names.nextElement(); - envList.add(key + "=" + props.getProperty(key)); //$NON-NLS-1$ - } - env = (String[]) envList.toArray(new String[envList.size()]); - } - - // Hook up an error parser - ErrorParserManager epm = new ErrorParserManager(this); - epm.setOutputStream(consoleOutStream); - OutputStream stdout = epm.getOutputStream(); - OutputStream stderr = epm.getOutputStream(); - - // Launch make - Process proc = launcher.execute(makeCommand, makeTargets, env, workingDirectory); - if (proc != null) { - try { - // Close the input of the process since we will never write to it - proc.getOutputStream().close(); - } catch (IOException e) { - } - - if (launcher.waitAndRead(stdout, stderr, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)) != CommandLauncher.OK) { - errMsg = launcher.getErrorMessage(); - } - - // Force a resync of the projects without allowing the user to cancel. - // This is probably unkind, but short of this there is no way to insure - // the UI is up-to-date with the build results - monitor.subTask(ManagedBuilderCorePlugin.getResourceString(REFRESH)); - try { - currentProject.refreshLocal(IResource.DEPTH_INFINITE, null); - for (int j = 0; j < deps.length; ++j) { - IProject project = deps[j]; - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - } catch (CoreException e) { - monitor.subTask(ManagedBuilderCorePlugin.getResourceString(REFRESH_ERROR)); - } - } else { - errMsg = launcher.getErrorMessage(); - } - - // Report either the success or failure of our mission - StringBuffer buf = new StringBuffer(); - if (errMsg != null && errMsg.length() > 0) { - String errorDesc = ManagedBuilderCorePlugin.getResourceString(BUILD_ERROR); - buf.append(errorDesc); - buf.append(System.getProperty("line.separator", "\n")); - buf.append("(").append(errMsg).append(")"); - } else { - // Report a successful build - String successMsg = ManagedBuilderCorePlugin.getFormattedString(BUILD_FINISHED, currentProject.getName()); - buf.append(successMsg); - buf.append(System.getProperty("line.separator", "\n")); - } - - // Write message on the console - consoleOutStream.write(buf.toString().getBytes()); - consoleOutStream.flush(); - stdout.close(); - stderr.close(); - - monitor.subTask(ManagedBuilderCorePlugin.getResourceString(MARKERS)); //$NON-NLS-1$ - epm.reportProblems(); - } - } catch (Exception e) { - CCorePlugin.log(e); - forgetLastBuiltState(); - } finally { - monitor.done(); - } - } - - private void removeAllMarkers(IProject project) throws CoreException { - IWorkspace workspace = project.getWorkspace(); - - // remove all markers - IMarker[] markers = project.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); - if (markers != null) { - workspace.deleteMarkers(markers); - } - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java deleted file mode 100644 index aadd19e8233..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java +++ /dev/null @@ -1,968 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.core; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.io.ByteArrayInputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.model.Util; -import org.eclipse.cdt.internal.core.search.PathCollector; -import org.eclipse.cdt.internal.core.search.PatternSearchJob; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.matching.CSearchPattern; -import org.eclipse.cdt.internal.core.sourcedependency.DependencyQueryJob; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; - -public class MakefileGenerator { - // String constants for messages - private static final String MESSAGE = "ManagedMakeBuilder.message"; //$NON-NLS-1$ - private static final String BUILD_ERROR = MESSAGE + ".error"; //$NON-NLS-1$ - private static final String COMMENT = "ManagedMakeBuilder.comment"; //$NON-NLS-1$ - private static final String MOD_LIST = COMMENT + ".module.list"; //$NON-NLS-1$ - private static final String SRC_LISTS = COMMENT + ".source.list"; //$NON-NLS-1$ - private static final String MOD_RULES = COMMENT + ".build.rule"; //$NON-NLS-1$ - private static final String MOD_INCL = COMMENT + ".module.make.includes"; //$NON-NLS-1$ - private static final String DEP_INCL = COMMENT + ".module.dep.includes"; //$NON-NLS-1$ - private static final String AUTO_DEP = COMMENT + ".autodeps"; //$NON-NLS-1$ - - // String constants for makefile contents - protected static final String COLON = ":"; - protected static final String DEPFILE_NAME = "subdir.dep"; //$NON-NLS-1$ - protected static final String DOT = "."; - protected static final String MAKEFILE_NAME = "makefile"; //$NON-NLS-1$ - protected static final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$ - protected static final String LINEBREAK = "\\"; - protected static final String NEWLINE = System.getProperty("line.separator"); - protected static final String LOGICAL_AND = "&&"; - protected static final String SEPARATOR = "/"; - protected static final String TAB = "\t"; - protected static final String WHITESPACE = " "; - protected static final String WILDCARD = "%"; - - // Local variables needed by generator - protected IManagedBuildInfo info; - protected List modifiedList; - protected IProgressMonitor monitor; - protected List subdirList; - protected IProject project; - protected List ruleList; - protected IPath topBuildDir; - private String target; - private String extension; - - /** - * This class is used to recursively walk the project and determine which - * modules contribute buildable source files. - */ - protected class ResourceProxyVisitor implements IResourceProxyVisitor { - private MakefileGenerator generator; - private IManagedBuildInfo info; - - /** - * Constructs a new resource proxy visitor to quickly visit project - * resources. - */ - public ResourceProxyVisitor(MakefileGenerator generator, IManagedBuildInfo info) { - this.generator = generator; - this.info = info; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy) - */ - public boolean visit(IResourceProxy proxy) throws CoreException { - // No point in proceeding, is there - if (generator == null) { - return false; - } - - // Is this a resource we should even consider - if (proxy.getType() == IResource.FILE) { - // Check extension to see if build model should build this file - IResource resource = proxy.requestResource(); - String ext = resource.getFileExtension(); - if (info.buildsFileType(ext)) { - if (!generator.isGeneratedResource(resource)) { - generator.appendBuildSubdirectory(resource); - } - } - return false; - } - - // Recurse into subdirectories - return true; - } - - } - - public class ResourceDeltaVisitor implements IResourceDeltaVisitor { - private MakefileGenerator generator; - private IManagedBuildInfo info; - - /** - * - */ - public ResourceDeltaVisitor(MakefileGenerator generator, IManagedBuildInfo info) { - this.generator = generator; - this.info = info; - } - - /* (non-javadoc) - * Answers a list of resource names in the workspace that depend on the resource - * specified in the argument. - * - * @param resource the root of the dependency tree - * @return IResource[] - */ - private IResource[] findDependencies(IResource resource) { - PathCollector pathCollector = new PathCollector(); - ICSearchScope scope = SearchEngine.createWorkspaceScope(); - CSearchPattern pattern = CSearchPattern.createPattern(resource.getLocation().toOSString(), ICSearchConstants.INCLUDE, ICSearchConstants.REFERENCES, ICSearchConstants.EXACT_MATCH, true); - IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); - indexManager.performConcurrentJob( - new PatternSearchJob( - (CSearchPattern) pattern, - scope, - pathCollector, - indexManager), - ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, - null, null); - - // We will get back an array of resource names relative to the workspace - String[] deps = pathCollector.getPaths(); - - // Convert them to something useful - List depList = new ArrayList(); - IResource res = null; - IWorkspaceRoot root = null; - if (generator.project != null) { - root = generator.project.getWorkspace().getRoot(); - } - for (int index = 0; index < deps.length; ++index) { - res = root.findMember(deps[index]); - if (res != null) { - depList.add(res); - } - } - - return (IResource[]) depList.toArray(new IResource[depList.size()]); - } - - private void handleHeaderDependency(IResource resource, boolean moved) { - // If this is a move and the resource is external to the project, touch that resource - if (resource.getProject().equals(generator.project)) { - generator.appendModifiedSubdirectory(resource); - } else { - if (moved) { - try { - resource.touch(new NullProgressMonitor()); - } catch (CoreException e) { - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta) - */ - public boolean visit(IResourceDelta delta) throws CoreException { - // Should the visitor keep iterating in current directory - boolean keepLooking = false; - IResource resource = delta.getResource(); - - // What kind of resource change has occurred - if (resource.getType() == IResource.FILE) { - String ext = resource.getFileExtension(); - boolean moved = false; - switch (delta.getKind()) { - case IResourceDelta.ADDED: - moved = delta.getFlags() == IResourceDelta.MOVED_TO; - if (!generator.isGeneratedResource(resource)) { - // This is a source file so just add its container - if (info.buildsFileType(ext)) { - generator.appendModifiedSubdirectory(resource); - } else if (info.isHeaderFile(ext)) { - // Add the container of the resource and any resources that depend on it - generator.appendModifiedSubdirectory(resource); - IResource[] deps = findDependencies(resource); - for (int i = 0; i < deps.length; ++i){ - handleHeaderDependency(deps[i], moved); - } - } - } - break; - case IResourceDelta.REMOVED: - moved = delta.getFlags() == IResourceDelta.MOVED_FROM; - if (!generator.isGeneratedResource(resource)) { - // This is a source file so just add its container - if (info.buildsFileType(ext)) { - generator.appendModifiedSubdirectory(resource); - } else if (info.isHeaderFile(ext)) { - // Add the container of the resource and any resources that depend on it - generator.appendModifiedSubdirectory(resource); - IResource[] deps = findDependencies(resource); - for (int i = 0; i < deps.length; ++i){ - handleHeaderDependency(deps[i], moved); - } - } - } - break; - case IResourceDelta.CHANGED: - if (!generator.isGeneratedResource(resource)) { - if (info.buildsFileType(ext)) { - keepLooking = true; - } else if (info.isHeaderFile(ext)) { - // Add the container of the resource and any resources that depend on it - generator.appendModifiedSubdirectory(resource); - IResource[] deps= findDependencies(resource); - for (int i = 0; i < deps.length; ++i){ - handleHeaderDependency(deps[i], moved); - } - // That does it for this directory, so don't bother to keep looking - } - } - break; - default: - keepLooking = true; - break; - } - } if (resource.getType() == IResource.PROJECT) { - // If there is a zero-length delta, something the project depends on has changed so just call make - IResourceDelta[] children = delta.getAffectedChildren(); - if (children != null && children.length > 0) { - keepLooking = true; - } - } else { - // If the resource is part of the generated directory structure don't recurse - if (!generator.isGeneratedResource(resource)) { - keepLooking = true; - } - } - - return keepLooking; - } - } - - /** - * @param project - * @param info - * @param monitor - */ - public MakefileGenerator(IProject project, IManagedBuildInfo info, IProgressMonitor monitor) { - super(); - // Save the project so we can get path and member information - this.project = project; - // Save the monitor reference for reporting back to the user - this.monitor = monitor; - // Get the build info for the project - this.info = info; - // Get the name of the build target - target = info.getBuildArtifactName(); - // Get its extension - extension = (new Path(target)).getFileExtension(); - if (extension == null) { - extension = new String(); - } - } - - /* (non-javadoc) - * Calculates dependencies for all the source files in the argument. A source - * file can depend on any number of header files, so the dependencies have to - * be added to its dependency list. - * - * @param module - * @return - */ - protected StringBuffer addSourceDependencies(IContainer module) throws CoreException { - // Calculate the new directory relative to the build output - IPath moduleRelativePath = module.getProjectRelativePath(); - String relativePath = moduleRelativePath.toString(); - relativePath += relativePath.length() == 0 ? "" : SEPARATOR; - - // Create the buffer to hold the output for the module and a dep calculator - StringBuffer buffer = new StringBuffer(); - buffer.append(ManagedBuilderCorePlugin.getResourceString(AUTO_DEP) + NEWLINE); - IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); - - /* - * Visit each resource in the folder that we have a rule to build. - * The dependency output for each resource will be in the format - * /. : ... - * with long lines broken. - */ - IResource[] resources = module.members(); - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - if (resource.getType() == IResource.FILE) { - String inputExt = resource.getFileExtension(); - if (info.buildsFileType(inputExt)) { - // Get the filename without an extension - String fileName = resource.getFullPath().removeFileExtension().lastSegment(); - if (fileName == null) continue; - String outputExt = info.getOutputExtension(inputExt); - if (outputExt != null) { - fileName += DOT + outputExt; - } - // ASk the dep generator to find all the deps for this resource - ArrayList dependencies = new ArrayList(); - try { - indexManager.performConcurrentJob(new DependencyQueryJob(project, (IFile)resource, indexManager, dependencies), ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null, null); - } catch (Exception e) { - continue; - } - if (dependencies.size() == 0) continue; - buffer.append(relativePath + fileName + COLON + WHITESPACE); - Iterator iter = dependencies.listIterator(); - while (iter.hasNext()) { - buffer.append(LINEBREAK + NEWLINE); - String path = (String)iter.next(); - buffer.append(path + WHITESPACE); - } - buffer.append(NEWLINE); - } - } - } - return buffer; - } - - /* (non-javadoc) - * @param buffer - * @param info - */ - protected StringBuffer addMacros() { - StringBuffer buffer = new StringBuffer(); - - // Add the ROOT macro - buffer.append("ROOT := .." + NEWLINE); - - // Get the clean command from the build model - buffer.append("RM := "); - buffer.append(info.getCleanCommand() + NEWLINE + NEWLINE); - - buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); - buffer.append("C_SRCS := " + NEWLINE); - buffer.append("CC_SRCS := " + NEWLINE); - buffer.append("CXX_SRCS := " + NEWLINE); - buffer.append("CAPC_SRCS := " + NEWLINE); - buffer.append("CPP_SRCS := " + NEWLINE + NEWLINE); - - // Add the libraries this project depends on - buffer.append("LIBS := "); - String[] libs = info.getLibsForTarget(extension); - for (int i = 0; i < libs.length; i++) { - String string = libs[i]; - buffer.append(LINEBREAK + NEWLINE + string); - } - buffer.append(NEWLINE + NEWLINE); - - // Add the extra user-specified objects - buffer.append("USER_OBJS := "); - String[] userObjs = info.getUserObjectsForTarget(extension); - for (int j = 0; j < userObjs.length; j++) { - String string = userObjs[j]; - buffer.append(LINEBREAK + NEWLINE + string); - } - buffer.append(NEWLINE + NEWLINE); - - buffer.append("OBJS = $(C_SRCS:$(ROOT)/%.c=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CAPC_SRCS:$(ROOT)/%.C=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o)" + NEWLINE); - return (buffer.append(NEWLINE)); - } - - /* (non-javadoc) - * @return - */ - protected StringBuffer addSubdirectories() { - StringBuffer buffer = new StringBuffer(); - // Add the comment - buffer.append(ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE); - buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE); - - // Get all the module names - ListIterator iter = getSubdirList().listIterator(); - while (iter.hasNext()) { - IContainer container = (IContainer) iter.next(); - // Check the special case where the module is the project root - if (container.getFullPath() == project.getFullPath()) { - buffer.append("." + WHITESPACE + LINEBREAK + NEWLINE); - } else { - IPath path = container.getProjectRelativePath(); - buffer.append(path.toString() + WHITESPACE + LINEBREAK + NEWLINE); - } - } - - // Now add the makefile instruction to include all the subdirectory makefile fragments - buffer.append(NEWLINE); - buffer.append(ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE); - buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE); - - buffer.append(NEWLINE + NEWLINE); - return buffer; - } - - - /* (non-javadoc) - * Answers a StringBuffer containing all of the sources contributed by - * a container to the build. - * - * @param module - * @return StringBuffer - */ - protected StringBuffer addSources(IContainer module) throws CoreException { - // Calculate the new directory relative to the build output - IPath moduleRelativePath = module.getProjectRelativePath(); - String relativePath = moduleRelativePath.toString(); - relativePath += relativePath.length() == 0 ? "" : SEPARATOR; - - // String buffers - StringBuffer buffer = new StringBuffer(); - StringBuffer cBuffer = new StringBuffer("C_SRCS += " + LINEBREAK + NEWLINE); - cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); - StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE); - ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); - StringBuffer cxxBuffer = new StringBuffer("CXX_SRCS += \\" + NEWLINE); - cxxBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); - StringBuffer capcBuffer = new StringBuffer("CAPC_SRCS += \\" + NEWLINE); - capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); - StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE); - cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); - StringBuffer ruleBuffer = new StringBuffer(ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE); - - // Put the comment in - buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); - - // Visit the resources in this folder - IResource[] resources = module.members(); - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - if (resource.getType() == IResource.FILE) { - String ext = resource.getFileExtension(); - if (info.buildsFileType(ext)) { - if (new String("c").equals(ext)) { - cBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE); - } else if (new String("cc").equalsIgnoreCase(ext)) { - ccBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE); - } else if (new String("cxx").equalsIgnoreCase(ext)) { - cxxBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE); - } else if (new String("C").equals(ext)) { - capcBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE); - } else { - cppBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE); - } - - // Try to add the rule for the file - addRule(relativePath, ruleBuffer, resource); - } - } - } - - // Finish the commands in the buffers - buffer.append(cBuffer.append("}" + NEWLINE + NEWLINE)); - buffer.append(ccBuffer.append("}" + NEWLINE + NEWLINE)); - buffer.append(cxxBuffer.append("}" + NEWLINE + NEWLINE)); - buffer.append(capcBuffer.append("}" + NEWLINE + NEWLINE)); - buffer.append(cppBuffer.append("}" + NEWLINE + NEWLINE)); - - return buffer.append(ruleBuffer + NEWLINE); - } - - /* (non-javadoc) - * Answers a StrinBuffer containing all of the required targets to - * properly build the project. - * - * @return StringBuffer - */ - protected StringBuffer addTargets(boolean rebuild) { - StringBuffer buffer = new StringBuffer(); - - // Assemble the information needed to generate the targets - String cmd = info.getToolForTarget(extension); - String flags = info.getFlagsForTarget(extension); - String outflag = info.getOutputFlag(extension); - String outputPrefix = info.getOutputPrefix(extension); - String targets = rebuild ? "clean all" : "all"; - - // Get all the projects the build target depends on - IProject[] deps = null; - try { - deps = project.getReferencedProjects(); - } catch (CoreException e) { - // There are 2 exceptions; the project does not exist or it is not open - // and neither conditions apply if we are building for it .... - } - - // Write out the all target first in case someone just runs make - // all: targ_ [deps] - String defaultTarget = "all:"; - if (deps.length > 0) { - defaultTarget += WHITESPACE + "deps"; - } - buffer.append(defaultTarget + WHITESPACE + outputPrefix + target + NEWLINE); - buffer.append(NEWLINE); - - /* - * The build target may depend on other projects in the workspace. These are - * captured in the deps target: - * deps: - * ; $(MAKE) [clean all | all]> - */ - List managedProjectOutputs = new ArrayList(); - if (deps.length > 0) { - buffer.append("deps:" + NEWLINE); - if (deps != null) { - for (int i = 0; i < deps.length; i++) { - IProject dep = deps[i]; - String buildDir = dep.getLocation().toString(); - String depTargets = targets; - if (ManagedBuildManager.manages(dep)) { - // Add the current configuration to the makefile path - IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(dep); - buildDir += SEPARATOR + depInfo.getConfigurationName(); - - // Extract the build artifact to add to the dependency list - String depTarget = depInfo.getBuildArtifactName(); - String depExt = (new Path(depTarget)).getFileExtension(); - String depPrefix = depInfo.getOutputPrefix(depExt); - if (depInfo.isDirty()) { - depTargets = "clean all"; - } - managedProjectOutputs.add(buildDir + SEPARATOR + depPrefix + depTarget); - } - buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE); - } - } - buffer.append(NEWLINE); - } - - /* - * Write out the target rule as: - * targ_.: $(OBJS) [ ... ] - * $(BUILD_TOOL) $(FLAGS) $(OUTPUT_FLAG) $@ $(OBJS) $(USER_OBJS) $(LIB_DEPS) - */ - buffer.append(outputPrefix + target + COLON + WHITESPACE + "$(OBJS)"); - Iterator iter = managedProjectOutputs.listIterator(); - while (iter.hasNext()) { - buffer.append(WHITESPACE + (String)iter.next()); - } - buffer.append(NEWLINE); - buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$(OBJS) $(USER_OBJS) $(LIBS)"); - buffer.append(NEWLINE + NEWLINE); - - // Always add a clean target - buffer.append("clean:" + NEWLINE); - buffer.append(TAB + "-$(RM)" + WHITESPACE + "$(OBJS)" + WHITESPACE + outputPrefix + target + NEWLINE + NEWLINE); - - buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE); - - buffer.append(ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE); - buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE); - return buffer; - } - - /* (non-javadoc) - * - * @param relativePath - * @param buffer - * @param resource - */ - protected void addRule(String relativePath, StringBuffer buffer, IResource resource) { - String rule = null; - String cmd = null; - String buildFlags = null; - String inputExtension = null; - String outputExtension = null; - String outflag = null; - String outputPrefix = null; - - // Is there a special rule for this file - if (false) { - } - else { - // Get the extension of the resource - inputExtension = resource.getFileExtension(); - // ASk the build model what it will produce from this - outputExtension = info.getOutputExtension(inputExtension); - /* - * Create the pattern rule in the format - * /%.o: $(ROOT)//%.cpp - * $(CC) $(CFLAGS) $(OUTPUT_FLAG) $@ $< - * - * Note that CC CFLAGS and OUTPUT_FLAG all come from the build model - * and are resolved to a real command before writing to the module - * makefile, so a real command might look something like - * source1/%.o: $(ROOT)/source1/%.cpp - * g++ -g -O2 -c -I/cygdrive/c/eclipse/workspace/Project/headers -o $@ $< - */ - rule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + "$(ROOT)" + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension; - } - - // Check if the rule is listed as something we already generated in the makefile - if (!getRuleList().contains(rule)) { - // Add it to the list - getRuleList().add(rule); - - // Add the rule and command to the makefile - buffer.append(rule + NEWLINE); - cmd = info.getToolForSource(inputExtension); - buildFlags = info.getFlagsForSource(inputExtension); - outflag = info.getOutputFlag(outputExtension); - outputPrefix = info.getOutputPrefix(outputExtension); - buffer.append(TAB + cmd + WHITESPACE + buildFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + "$@" + WHITESPACE + "$<" + NEWLINE + NEWLINE); - } - } - - /** - * Adds the container of the argument to the list of folders in the project that - * contribute source files to the build. The resource visitor has already established - * that the build model knows how to build the files. It has also checked that - * the resource is not generated as part of the build. - * - * @param resource - */ - public void appendBuildSubdirectory(IResource resource) { - IContainer container = resource.getParent(); - if (!getSubdirList().contains(container)) { - getSubdirList().add(container); - } - - } - - /** - * Adds the container of the argument to a list of subdirectories that are part - * of an incremental rebuild of the project. The makefile fragments for these - * directories will be regenerated as a result of the build. - * - * @param resource - */ - public void appendModifiedSubdirectory(IResource resource) { - IContainer container = resource.getParent(); - if (!getModifiedList().contains(container)) { - getModifiedList().add(container); - } - } - - /** - * Check whether the build has been cancelled. Cancellation requests - * propagated to the caller by throwing OperationCanceledException. - * - * @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException() - */ - public void checkCancel() { - if (monitor != null && monitor.isCanceled()) { - throw new OperationCanceledException(); - } - } - - - /** - * Clients call this method when an incremental rebuild is required. The argument - * contains a set of resource deltas that will be used to determine which - * subdirectories need a new makefile and dependency list (if any). - * - * @param delta - * @throws CoreException - */ - public void generateMakefiles(IResourceDelta delta) throws CoreException { - /* - * Let's do a sanity check right now. - * - * 1. This is an incremental build, so if the top-level directory is not - * there, then a rebuild is needed. - */ - IFolder folder = project.getFolder(info.getConfigurationName()); - if (!folder.exists()) { - regenerateMakefiles(); - return; - } - - // Visit the resources in the delta and compile a list of subdirectories to regenerate - ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(this, info); - delta.accept(visitor); - - // See if the user has cancelled the build - checkCancel(); - - // The top-level makefile needs this information - ResourceProxyVisitor resourceVisitor = new ResourceProxyVisitor(this, info); - project.accept(resourceVisitor, IResource.NONE); - checkCancel(); - - // Regenerate any fragments that are missing for the exisiting directories NOT modified - Iterator iter = getSubdirList().listIterator(); - while (iter.hasNext()) { - IContainer subdirectory = (IContainer)iter.next(); - if (!getModifiedList().contains(subdirectory)) { - // Make sure a fragment makefile and dependency file exist - IFile makeFragment = project.getFile(subdirectory.getFullPath().addTrailingSeparator().append(MODFILE_NAME)); - IFile depFragment = project.getFile(subdirectory.getFullPath().addTrailingSeparator().append(DEPFILE_NAME)); - if (!makeFragment.exists() || !depFragment.exists()) { - // If one or both are missing, then add it to the list to be generated - getModifiedList().add(subdirectory); - } - } - } - - // Re-create the top-level makefile - topBuildDir = createDirectory(info.getConfigurationName()); - IPath makefilePath = topBuildDir.addTrailingSeparator().append(MAKEFILE_NAME); - IFile makefileHandle = createFile(makefilePath); - populateTopMakefile(makefileHandle, false); - checkCancel(); - - // Regenerate any fragments for modified directories - iter = getModifiedList().listIterator(); - while (iter.hasNext()) { - populateFragmentMakefile((IContainer) iter.next()); - checkCancel(); - } - } - - /* (non-javadoc) - * - * @return List - */ - private List getModifiedList() { - if (modifiedList == null) { - modifiedList = new ArrayList(); - } - return modifiedList; - } - - /* (non-javadoc) - * Answers the list of known build rules. This keeps me from generating duplicate - * rules for known file extensions. - * - * @return List - */ - private List getRuleList() { - if (ruleList == null) { - ruleList = new ArrayList(); - } - return ruleList; - } - - /* (non-javadoc) - * Answers the list of subdirectories contributing source code to the build - * - * @return List - */ - private List getSubdirList() { - if (subdirList == null) { - subdirList = new ArrayList(); - } - return subdirList; - } - - /* (non-javadoc) - * @param string - * @return IPath - */ - private IPath createDirectory(String dirName) throws CoreException { - // Create or get the handle for the build directory - IFolder folder = project.getFolder(dirName); - if (!folder.exists()) { - - // Make sure that parent folders exist - IPath parentPath = (new Path(dirName)).removeLastSegments(1); - // Assume that the parent exists if the path is empty - if (!parentPath.isEmpty()) { - IFolder parent = project.getFolder(parentPath); - if (!parent.exists()) { - createDirectory(parentPath.toString()); - } - } - - // Now make the requested folder - try { - folder.create(true, true, null); - } - catch (CoreException e) { - if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) - folder.refreshLocal(IResource.DEPTH_ZERO, null); - else - throw e; - } - } - return folder.getFullPath(); - } - - /* (non-javadoc) - * @param makefilePath - * @param monitor - * @return IFile - */ - private IFile createFile(IPath makefilePath) throws CoreException { - // Create or get the handle for the makefile - IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot(); - IFile newFile = root.getFileForLocation(makefilePath); - if (newFile == null) { - newFile = root.getFile(makefilePath); - } - // Create the file if it does not exist - ByteArrayInputStream contents = new ByteArrayInputStream(new byte[0]); - try { - newFile.create(contents, false, monitor); - } - catch (CoreException e) { - // If the file already existed locally, just refresh to get contents - if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) - newFile.refreshLocal(IResource.DEPTH_ZERO, null); - else - throw e; - } - - return newFile; - } - - /** - * Answers the IPath of the top directory generated for the build - * output, or null if none has been generated. - * - * @return IPath - */ - public IPath getTopBuildDir() { - return topBuildDir; - } - - /** - * Answers true if the argument is found in a generated container - * @param resource - * @return boolean - */ - public boolean isGeneratedResource(IResource resource) { - // Is this a generated directory ... - IPath path = resource.getProjectRelativePath(); - String[] configNames = info.getConfigurationNames(); - for (int i = 0; i < configNames.length; i++) { - String name = configNames[i]; - IPath root = new Path(name); - // It is if it is a root of the resource pathname - if (root.isPrefixOf(path)) return true; - } - - return false; - } - - /* (non-javadoc) - * Create the entire contents of the makefile. - * - * @param fileHandle The file to place the contents in. - * @param rebuild FLag signalling that the user is doing a full rebuild - * @throws CoreException - */ - protected void populateTopMakefile(IFile fileHandle, boolean rebuild) throws CoreException { - StringBuffer buffer = new StringBuffer(); - - // Add the macro definitions - buffer.append(addMacros()); - - // Append the module list - buffer.append(addSubdirectories()); - - // Add targets - buffer.append(addTargets(rebuild)); - - // Save the file - Util.save(buffer, fileHandle); - } - - /* (non-javadoc) - * @param module - * @throws CoreException - */ - protected void populateFragmentMakefile(IContainer module) throws CoreException { - // Calcualte the new directory relative to the build output - IPath moduleRelativePath = module.getProjectRelativePath(); - IPath buildRoot = getTopBuildDir().removeFirstSegments(1); - if (buildRoot == null) { - return; - } - IPath moduleOutputPath = buildRoot.append(moduleRelativePath); - - // Now create the directory - IPath moduleOutputDir = createDirectory(moduleOutputPath.toString()); - - // Create a module makefile - IFile modMakefile = createFile(moduleOutputDir.addTrailingSeparator().append(MODFILE_NAME)); - StringBuffer makeBuf = new StringBuffer(); - makeBuf.append(addSources(module)); - - // Create a module dep file - IFile modDepfile = createFile(moduleOutputDir.addTrailingSeparator().append(DEPFILE_NAME)); - StringBuffer depBuf = new StringBuffer(); - depBuf.append(addSourceDependencies(module)); - - // Save the files - Util.save(makeBuf, modMakefile); - Util.save(depBuf, modDepfile); - } - - - /** - * @throws CoreException - */ - public void regenerateMakefiles() throws CoreException { - // Visit the resources in the project - ResourceProxyVisitor visitor = new ResourceProxyVisitor(this, info); - project.accept(visitor, IResource.NONE); - - // See if the user has cancelled the build - checkCancel(); - - // Populate the makefile if any source files have been found in the project - if (getSubdirList().isEmpty()) { - return; - } - - // Create the top-level directory for the build output - topBuildDir = createDirectory(info.getConfigurationName()); - - // Create the top-level makefile - IPath makefilePath = topBuildDir.addTrailingSeparator().append(MAKEFILE_NAME); - IFile makefileHandle = createFile(makefilePath); - - populateTopMakefile(makefileHandle, true); - checkCancel(); - - // Now populate the module makefiles - ListIterator iter = getSubdirList().listIterator(); - while (iter.hasNext()) { - populateFragmentMakefile((IContainer)iter.next()); - checkCancel(); - } - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java deleted file mode 100644 index 7edafd91490..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java +++ /dev/null @@ -1,870 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.core; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo { - - // Local variables - private boolean isDirty; - private IResource owner; - private Map targetMap; - private List targets; - private Map defaultConfigurations; - private ITarget defaultTarget; - - public ManagedBuildInfo(IResource owner) { - targetMap = new HashMap(); - targets = new ArrayList(); - defaultConfigurations = new HashMap(); - this.owner = owner; - } - - public ManagedBuildInfo(IResource owner, Element element) { - this(owner); - - // The id of the default configuration - String defaultTargetId = null; - List configIds = new ArrayList(); - Node child = element.getFirstChild(); - while (child != null) { - if (child.getNodeName().equals("target")) { - new Target(this, (Element)child); - } else if (child.getNodeName().equals("defaultConfig")) { - // We may not have read the config in yet, so just cache it - configIds.add(((Element)child).getAttribute("id")); - } else if (child.getNodeName().equals("defaultTarget")) { - defaultTargetId = ((Element)child).getAttribute("id"); - } - child = child.getNextSibling(); - } - // All the available targets have been read in - defaultTarget = (ITarget) targetMap.get(defaultTargetId); - // Now we have a misserable O(N^2) operation (oh well, the data sets are small) - ListIterator stringIter = configIds.listIterator(); - while (stringIter.hasNext()){ - String confId = (String) stringIter.next(); - ListIterator targIter = targets.listIterator(); - while (targIter.hasNext()) { - Target targ = (Target) targIter.next(); - IConfiguration conf = targ.getConfiguration(confId); - if (conf != null) { - defaultConfigurations.put(targ.getId(), conf); - break; - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#addTarget(org.eclipse.cdt.core.build.managed.ITarget) - */ - public void addTarget(ITarget target) { - targetMap.put(target.getId(), target); - targets.add(target); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#buildsFileType(java.lang.String) - */ - public boolean buildsFileType(String srcExt) { - // Make sure the owner is treated as a project for the duration - IProject project = (IProject)owner; - - // Check to see if there is a rule to build a file with this extension - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.buildsFileType(srcExt); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.buildsFileType(srcExt); - } - break; - case ITool.FILTER_BOTH: - return tool.buildsFileType(srcExt); - } - } catch (CoreException e) { - continue; - } - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getBuildArtifactName() - */ - public String getBuildArtifactName() { - // Get the default target and use its value - String name = getDefaultTarget().getArtifactName(); - return name == null ? new String() : name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getCleanCommand() - */ - public String getCleanCommand() { - // Get from the model - String command = new String(); - ITarget target = getDefaultTarget(); - command = target.getCleanCommand(); - return command; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getConfigurationName() - */ - public String getConfigurationName() { - // Return the human-readable name of the default configuration - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - return config == null ? new String() : config.getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getConfigurationNames() - */ - public String[] getConfigurationNames() { - ArrayList configNames = new ArrayList(); - IConfiguration[] configs = getDefaultTarget().getConfigurations(); - for (int i = 0; i < configs.length; i++) { - IConfiguration configuration = configs[i]; - configNames.add(configuration.getName()); - } - configNames.trimToSize(); - return (String[])configNames.toArray(new String[configNames.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getDefaultConfiguration() - */ - public IConfiguration getDefaultConfiguration(ITarget target) { - // Get the default config associated with the defalt target - IConfiguration config = (IConfiguration) defaultConfigurations.get(target.getId()); - - // If null, look up the first configuration associated with the target - if (config == null) { - IConfiguration[] configs = getDefaultTarget().getConfigurations(); - if (configs.length > 0) { - config = configs[0]; - } - } - return config; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getDefaultTarget() - */ - public ITarget getDefaultTarget() { - if (defaultTarget == null) { - defaultTarget = (ITarget) targets.get(0); - } - return defaultTarget; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols() - */ - public Map getDefinedSymbols() { - IProject project = (IProject)owner; - // Return the defined symbols for the default configuration - HashMap symbols = new HashMap(); - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int i = 0; i < tools.length; i++) { - ITool tool = tools[i]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_CC: - if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_BOTH: - break; - } - } catch (CoreException e) { - continue; - } - // Now extract the valid tool's options - IOption[] opts = tool.getOptions(); - for (int j = 0; j < opts.length; j++) { - IOption option = opts[j]; - if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) { - try { - ArrayList symbolList = new ArrayList(); - symbolList.addAll(Arrays.asList(option.getBuiltIns())); - symbolList.addAll(Arrays.asList(option.getDefinedSymbols())); - Iterator iter = symbolList.listIterator(); - while (iter.hasNext()) { - String symbol = (String) iter.next(); - if (symbol.length() == 0){ - continue; - } - String key = new String(); - String value = new String(); - int index = symbol.indexOf("="); - if (index != -1) { - key = symbol.substring(0, index).trim(); - value = symbol.substring(index + 1).trim(); - } else { - key = symbol.trim(); - } - symbols.put(key, value); - } - - } catch (BuildException e) { - // we should never get here - continue; - } - } - } - } - return symbols; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getFlagsForSource(java.lang.String) - */ - public String getFlagsForSource(String extension) { - IProject project = (IProject)owner; - - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - if (tool.buildsFileType(extension)) { - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolFlags(); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolFlags(); - } - break; - case ITool.FILTER_BOTH: - return tool.getToolFlags(); - } - } catch (CoreException e) { - continue; - } catch (BuildException e) { - // Give it your best shot with the next tool - continue; - } - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolFlags(java.lang.String) - */ - public String getFlagsForTarget(String extension) { - IProject project = (IProject)owner; - // Treat null extensions as an empty string - String ext = extension == null ? new String() : extension; - - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - if (tool.producesFileType(ext)) { - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolFlags(); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolFlags(); - } - break; - case ITool.FILTER_BOTH: - return tool.getToolFlags(); - } - } catch (CoreException e) { - continue; - } catch (BuildException e) { - // Give it your best shot with the next tool - continue; - } - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths() - */ - public String[] getIncludePaths() { - IProject project = (IProject)owner; - - // Return the include paths for the default configuration - ArrayList paths = new ArrayList(); - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - IPath root = owner.getLocation().addTrailingSeparator().append(config.getName()); - ITool[] tools = config.getTools(); - for (int i = 0; i < tools.length; i++) { - ITool tool = tools[i]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_CC: - if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_BOTH: - break; - } - } catch (CoreException e) { - continue; - } - // The tool checks out for this project, get its options - IOption[] opts = tool.getOptions(); - for (int j = 0; j < opts.length; j++) { - IOption option = opts[j]; - if (option.getValueType() == IOption.INCLUDE_PATH) { - try { - // Get all the built-in paths from the option - paths.addAll(Arrays.asList(option.getBuiltIns())); - // Get all the user-defined paths from the option as absolute paths - String[] userPaths = option.getIncludePaths(); - for (int index = 0; index < userPaths.length; ++index) { - IPath userPath = new Path(userPaths[index]); - if (userPath.isAbsolute()) { - paths.add(userPath.toOSString()); - } else { - IPath absPath = root.addTrailingSeparator().append(userPath); - paths.add(absPath.makeAbsolute().toOSString()); - } - } - } catch (BuildException e) { - // we should never get here, but continue anyway - continue; - } - } - } - } - paths.trimToSize(); - return (String[])paths.toArray(new String[paths.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getLibsForTarget(java.lang.String) - */ - public String[] getLibsForTarget(String extension) { - IProject project = (IProject)owner; - - ArrayList libs = new ArrayList(); - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_CC: - if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_BOTH: - break; - } - } catch (CoreException e) { - continue; - } - // The tool is OK for this project nature - if (tool.producesFileType(extension)) { - IOption[] opts = tool.getOptions(); - // Look for the lib option type - for (int i = 0; i < opts.length; i++) { - IOption option = opts[i]; - if (option.getValueType() == IOption.LIBRARIES) { - try { - String command = option.getCommand(); - String[] allLibs = option.getLibraries(); - for (int j = 0; j < allLibs.length; j++) { - String string = allLibs[j]; - libs.add(command + string); - } - } catch (BuildException e) { - continue; - } - } - } - } - } - libs.trimToSize(); - return (String[])libs.toArray(new String[libs.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeArguments() - */ - public String getMakeArguments() { - String arguments = new String(); - - // The make command may or may not have any flags - ITarget target = getDefaultTarget(); - String command = target.getMakeCommand(); - - // If it does, the flags will be everything between the '-' and the next space - int indexOfArgs = command.indexOf('-'); - if (indexOfArgs != - 1) { - try { - String argsAndTargs = command.substring(indexOfArgs); - int indexOfTargs = argsAndTargs.indexOf(' '); - arguments = (indexOfTargs != -1) ? - argsAndTargs.substring(0, indexOfTargs) : - argsAndTargs; - // Make sure the arg list does not contain f or C - - } catch (IndexOutOfBoundsException e) { - } - } - - return arguments.trim(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeCommand() - */ - public String getMakeCommand() { - String command = new String(); - ITarget target = getDefaultTarget(); - command = target.getMakeCommand(); - - // There may actually be arguments, so just get everything up to the first '-' - int indexOfArgs = command.indexOf('-'); - if (indexOfArgs != -1) { - // Return ecverything up to the first argument as the command - return command.substring(0, indexOfArgs).trim(); - } else { - return command.trim(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputExtension(java.lang.String) - */ - public String getOutputExtension(String resourceExtension) { - IProject project = (IProject)owner; - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getOutputExtension(resourceExtension); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getOutputExtension(resourceExtension); - } - break; - case ITool.FILTER_BOTH: - return tool.getOutputExtension(resourceExtension); - } - } catch (CoreException e) { - continue; - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputFlag() - */ - public String getOutputFlag(String outputExt) { - IProject project = (IProject)owner; - // Treat null extension as an empty string - String ext = outputExt == null ? new String() : outputExt; - - // Get all the tools for the current config - String flags = new String(); - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_CC: - if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_BOTH: - break; - } - } catch (CoreException e) { - continue; - } - // It's OK - if (tool.producesFileType(ext)) { - flags = tool.getOutputFlag(); - } - } - return flags; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputPrefix(java.lang.String) - */ - public String getOutputPrefix(String outputExtension) { - IProject project = (IProject)owner; - // Treat null extensions as empty string - String ext = outputExtension == null ? new String() : outputExtension; - - // Get all the tools for the current config - String flags = new String(); - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_CC: - if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_BOTH: - break; - } - } catch (CoreException e) { - continue; - } - if (tool.producesFileType(ext)) { - flags = tool.getOutputPrefix(); - } - } - return flags; - } - - public IResource getOwner() { - return owner; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getTarget(org.eclipse.cdt.core.build.managed.IConfiguration) - */ - public ITarget getTarget(String id) { - return (ITarget) targetMap.get(id); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getTargets(org.eclipse.cdt.core.build.managed.IConfiguration) - */ - public List getTargets() { - return targets; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolForSource(java.lang.String) - */ - public String getToolForSource(String extension) { - IProject project = (IProject)owner; - - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - if (tool.buildsFileType(extension)) { - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolCommand(); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolCommand(); - } - break; - case ITool.FILTER_BOTH: - return tool.getToolCommand(); - } - } catch (CoreException e) { - continue; - } - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolInvocation(java.lang.String) - */ - public String getToolForTarget(String extension) { - IProject project = (IProject)owner; - - // Treat a null argument as an empty string - String ext = extension == null ? new String() : extension; - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - if (tool.producesFileType(ext)) { - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolCommand(); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.getToolCommand(); - } - break; - case ITool.FILTER_BOTH: - return tool.getToolCommand(); - } - } catch (CoreException e) { - continue; - } - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getUserObjectsForTarget(java.lang.String) - */ - public String[] getUserObjectsForTarget(String extension) { - IProject project = (IProject)owner; - ArrayList objs = new ArrayList(); - // Get all the tools for the current config - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (!project.hasNature(CProjectNature.C_NATURE_ID) || project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_CC: - if (!project.hasNature(CCProjectNature.CC_NATURE_ID)) { - continue; - } - break; - case ITool.FILTER_BOTH: - break; - } - } catch (CoreException e) { - continue; - } - // The tool is OK for this project nature - if (tool.producesFileType(extension)) { - IOption[] opts = tool.getOptions(); - // Look for the user object option type - for (int i = 0; i < opts.length; i++) { - IOption option = opts[i]; - if (option.getValueType() == IOption.OBJECTS) { - try { - objs.addAll(Arrays.asList(option.getUserObjects())); - } catch (BuildException e) { - continue; - } - } - } - } - } - objs.trimToSize(); - return (String[])objs.toArray(new String[objs.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isDirty() - */ - public boolean isDirty() { - return isDirty; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isHeaderFile(java.lang.String) - */ - public boolean isHeaderFile(String ext) { - IProject project = (IProject)owner; - - // Check to see if there is a rule to build a file with this extension - IConfiguration config = getDefaultConfiguration(getDefaultTarget()); - ITool[] tools = config.getTools(); - for (int index = 0; index < tools.length; index++) { - ITool tool = tools[index]; - try { - // Make sure the tool is right for the project - switch (tool.getNatureFilter()) { - case ITool.FILTER_C: - if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.isHeaderFile(ext); - } - break; - case ITool.FILTER_CC: - if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { - return tool.isHeaderFile(ext); - } - break; - case ITool.FILTER_BOTH: - return tool.isHeaderFile(ext); - } - } catch (CoreException e) { - continue; - } - } - return false; - } - - /** - * Write the contents of the build model to the persistent store specified in the - * argument. - * - * @param doc - * @param element - */ - public void serialize(Document doc, Element element) { - // Write out each target and their default config - for (int i = 0; i < targets.size(); ++i) { - Element targetElement = doc.createElement("target"); - element.appendChild(targetElement); - ((Target)targets.get(i)).serialize(doc, targetElement); - IConfiguration config = getDefaultConfiguration((ITarget)targets.get(i)); - if (config != null) { - Element configEl = doc.createElement("defaultConfig"); - element.appendChild(configEl); - configEl.setAttribute("id", config.getId()); - } - } - // Persist the default target - if (getDefaultTarget() != null){ - Element targEl = doc.createElement("defaultTarget"); - element.appendChild(targEl); - targEl.setAttribute("id", getDefaultTarget().getId()); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setDefaultConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration) - */ - public void setDefaultConfiguration(IConfiguration configuration) { - // Get the target associated with the argument - ITarget target = configuration.getTarget(); - // Make sure it is the default - setDefaultTarget(target); - defaultConfigurations.put(target.getId(), configuration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setDefaultTarget(org.eclipse.cdt.core.build.managed.ITarget) - */ - public void setDefaultTarget(ITarget target) { - if (defaultTarget != null && defaultTarget.getId().equals(target.getId())) { - return; - } - defaultTarget = target; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setDirty(boolean) - */ - public void setDirty(boolean isDirty) { - this.isDirty = isDirty; - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java deleted file mode 100644 index adb5019b83c..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java +++ /dev/null @@ -1,347 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.internal.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.core.runtime.IConfigurationElement; - -public class Option extends BuildObject implements IOption { - // Static default return values - private static final String EMPTY_STRING = new String(); - private static final String[] EMPTY_STRING_ARRAY = new String[0]; - - // Private bookeeping attributes - private List builtIns; - private IOptionCategory category; - private String command; - private String defaultEnumName; - private Map enumCommands; - private ITool tool; - private Object value; - private int valueType; - - - public Option(ITool tool) { - this.tool = tool; - } - - public Option(Tool tool, IConfigurationElement element) { - this(tool); - - // Get the unique id of the option - setId(element.getAttribute(ID)); - - // Hook me up to a tool - tool.addOption(this); - - // Get the option Name (this is what the user will see in the UI) - setName(element.getAttribute(NAME)); - - // Options can be grouped into categories - String categoryId = element.getAttribute(CATEGORY); - if (categoryId != null) - setCategory(tool.getOptionCategory(categoryId)); - - // Get the command defined for the option - command = element.getAttribute(COMMAND); - - // Options hold different types of values - String valueTypeStr = element.getAttribute(VALUE_TYPE); - if (valueTypeStr == null) - valueType = -1; - else if (valueTypeStr.equals(TYPE_STRING)) - valueType = STRING; - else if (valueTypeStr.equals(TYPE_STR_LIST)) - valueType = STRING_LIST; - else if (valueTypeStr.equals(TYPE_BOOL)) - valueType = BOOLEAN; - else if (valueTypeStr.equals(TYPE_ENUM)) - valueType = ENUMERATED; - else if (valueTypeStr.equals(TYPE_INC_PATH)) - valueType = INCLUDE_PATH; - else if (valueTypeStr.equals(TYPE_LIB)) - valueType = LIBRARIES; - else if (valueTypeStr.equals(TYPE_USER_OBJS)) - valueType = OBJECTS; - else - valueType = PREPROCESSOR_SYMBOLS; - - // Now get the actual value - enumCommands = new HashMap(); - switch (valueType) { - case BOOLEAN: - // Convert the string to a boolean - value = new Boolean(element.getAttribute(DEFAULT_VALUE)); - break; - case STRING: - // Just get the value out of the option directly - value = element.getAttribute(DEFAULT_VALUE); - break; - case ENUMERATED: - List enumList = new ArrayList(); - IConfigurationElement[] enumElements = element.getChildren(ENUM_VALUE); - for (int i = 0; i < enumElements.length; ++i) { - String optName = enumElements[i].getAttribute(NAME); - String optCommand = enumElements[i].getAttribute(COMMAND); - enumList.add(optName); - enumCommands.put(optName, optCommand); - Boolean isDefault = new Boolean(enumElements[i].getAttribute(IS_DEFAULT)); - if (isDefault.booleanValue()) { - defaultEnumName = optName; - } - } - value = enumList; - break; - case STRING_LIST: - case INCLUDE_PATH: - case PREPROCESSOR_SYMBOLS: - case LIBRARIES: - case OBJECTS: - List valueList = new ArrayList(); - builtIns = new ArrayList(); - IConfigurationElement[] valueElements = element.getChildren(LIST_VALUE); - for (int i = 0; i < valueElements.length; ++i) { - IConfigurationElement valueElement = valueElements[i]; - Boolean isBuiltIn = new Boolean(valueElement.getAttribute(LIST_ITEM_BUILTIN)); - if (isBuiltIn.booleanValue()) { - builtIns.add(valueElement.getAttribute(LIST_ITEM_VALUE)); - } - else { - valueList.add(valueElement.getAttribute(LIST_ITEM_VALUE)); - } - } - value = valueList; - break; - default : - break; - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getApplicableValues() - */ - public String[] getApplicableValues() { - List enumValues = (List)value; - return enumValues != null - ? (String[])enumValues.toArray(new String[enumValues.size()]) - : EMPTY_STRING_ARRAY; - } - - public boolean getBooleanValue() { - Boolean bool = (Boolean) value; - return bool.booleanValue(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getBuiltIns() - */ - public String[] getBuiltIns() { - // Return the list of built-ins as an array - return builtIns == null ? - EMPTY_STRING_ARRAY: - (String[])builtIns.toArray(new String[builtIns.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getCategory() - */ - public IOptionCategory getCategory() { - return category != null ? category : getTool().getTopOptionCategory(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getCommand() - */ - public String getCommand() { - return command; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols() - */ - public String[] getDefinedSymbols() throws BuildException { - if (valueType != PREPROCESSOR_SYMBOLS) { - throw new BuildException("bad value type"); - } - ArrayList v = (ArrayList)value; - if (v == null) { - return EMPTY_STRING_ARRAY; - } else { - v.trimToSize(); - return (String[]) v.toArray(new String[v.size()]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String) - */ - public String getEnumCommand(String name) { - String cmd = (String) enumCommands.get(name); - return cmd == null ? EMPTY_STRING : cmd; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getIncludePaths() - */ - public String[] getIncludePaths() throws BuildException { - if (valueType != INCLUDE_PATH) { - throw new BuildException("bad value type"); - } - ArrayList v = (ArrayList)value; - if (v == null) { - return EMPTY_STRING_ARRAY; - } else { - v.trimToSize(); - return (String[]) v.toArray(new String[v.size()]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getLibraries() - */ - public String[] getLibraries() throws BuildException { - if (valueType != LIBRARIES) { - throw new BuildException("bad value type"); - } - ArrayList v = (ArrayList)value; - if (v == null) { - return EMPTY_STRING_ARRAY; - } else { - v.trimToSize(); - return (String[]) v.toArray(new String[v.size()]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue() - */ - public String getSelectedEnum() throws BuildException { - if (valueType != ENUMERATED) { - throw new BuildException("bad value type"); - } - return defaultEnumName == null ? EMPTY_STRING : defaultEnumName; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue() - */ - public String[] getStringListValue() throws BuildException { - if (valueType != STRING_LIST) { - throw new BuildException("bad value type"); - } - ArrayList v = (ArrayList)value; - if (v == null) { - return EMPTY_STRING_ARRAY; - } else { - v.trimToSize(); - return (String[]) v.toArray(new String[v.size()]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getStringValue() - */ - public String getStringValue() throws BuildException { - if (valueType != STRING) { - throw new BuildException("bad value type"); - } - return value == null ? EMPTY_STRING : (String)value; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getTool() - */ - public ITool getTool() { - return tool; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IOption#getUserObjects() - */ - public String[] getUserObjects() throws BuildException { - if (valueType != OBJECTS) { - throw new BuildException("bad value type"); - } - // This is the right puppy, so return its list value - ArrayList v = (ArrayList)value; - if (v == null) { - return EMPTY_STRING_ARRAY; - } else { - v.trimToSize(); - return (String[]) v.toArray(new String[v.size()]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getValueType() - */ - public int getValueType() { - return valueType; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory) - */ - public void setCategory(IOptionCategory category) { - this.category = category; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#setStringValue(org.eclipse.cdt.core.build.managed.IConfiguration, java.lang.String) - */ - public IOption setValue(IConfiguration config, String value) - throws BuildException - { - if (valueType != IOption.STRING - || valueType != ENUMERATED) - throw new BuildException("Bad value for type"); - - if (config == null) { - this.value = value; - return this; - } else { - // Magic time - return null; - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#setStringValue(org.eclipse.cdt.core.build.managed.IConfiguration, java.lang.String[]) - */ - public IOption setValue(IConfiguration config, String[] value) - throws BuildException - { - if (valueType != STRING_LIST - || valueType != INCLUDE_PATH - || valueType != PREPROCESSOR_SYMBOLS - || valueType != LIBRARIES - || valueType != OBJECTS) - throw new BuildException("Bad value for type"); - - if (config == null) { - this.value = value; - return this; - } else { - // More magic - return null; - } - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java deleted file mode 100644 index 11ad290022b..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java +++ /dev/null @@ -1,120 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.internal.core; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * - */ -public class OptionCategory extends BuildObject implements IOptionCategory { - - private IOptionCategory owner; - private List children; - - private static final IOptionCategory[] emtpyCategories = new IOptionCategory[0]; - - public OptionCategory(IOptionCategory owner) { - this.owner = owner; - } - - public OptionCategory(Tool tool, IConfigurationElement element) { - String parentId = element.getAttribute(IOptionCategory.PARENT); - if (parentId != null) - owner = tool.getOptionCategory(element.getAttribute(IOptionCategory.PARENT)); - else - owner = tool; - - // id - setId(element.getAttribute(IOptionCategory.ID)); - - // Name - setName(element.getAttribute(IOptionCategory.NAME)); - - // Hook me in - if (owner instanceof Tool) - ((Tool)owner).addChildCategory(this); - else - ((OptionCategory)owner).addChildCategory(this); - - tool.addOptionCategory(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getChildCategories() - */ - public IOptionCategory[] getChildCategories() { - if (children != null) - return (IOptionCategory[])children.toArray(new IOptionCategory[children.size()]); - else - return emtpyCategories; - } - - public void addChildCategory(OptionCategory category) { - if (children == null) - children = new ArrayList(); - children.add(category); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOwner() - */ - public IOptionCategory getOwner() { - return owner; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getTool() - */ - public ITool getTool() { - // This will stop at the Tool's top category - return owner.getTool(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptions(org.eclipse.cdt.core.build.managed.ITool) - */ - public IOption[] getOptions(IConfiguration configuration) { - ITool tool = getTool(); - if (configuration != null) { - // TODO don't like this much - ITool[] tools = configuration.getTools(); - for (int i = 0; i < tools.length; ++i) { - if (tools[i] instanceof ToolReference) { - if (((ToolReference)tools[i]).references(tool)) { - tool = tools[i]; - break; - } - } else if (tools[i].equals(tool)) - break; - } - } - - IOption[] allOptions = tool.getOptions(); - List myOptions = new ArrayList(); - - for (int i = 0; i < allOptions.length; ++i) { - IOption option = allOptions[i]; - if (option.getCategory().equals(this)) - myOptions.add(option); - } - - return (IOption[])myOptions.toArray(new IOption[myOptions.size()]); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java deleted file mode 100644 index b1bd81e8820..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java +++ /dev/null @@ -1,469 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.internal.core; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.core.runtime.IConfigurationElement; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * - */ -public class OptionReference implements IOption { - - // List of built-in values a tool defines - private List builtIns; - // Used for all option references that override the command - private String command; - // The option this reference overrides - private IOption option; - // The owner of the reference - private ToolReference owner; - // The actual value of the reference - private Object value; - - /** - * Constructor called when the option reference is created from an - * existing IOption - * - * @param owner - * @param option - */ - public OptionReference(ToolReference owner, IOption option) { - this.owner = owner; - this.option = option; - - // Until the option reference is changed, all values will be extracted from original option - owner.addOptionReference(this); - } - - /** - * This constructor will be called when the receiver is created from - * the settings found in an extension point. - * - * @param owner - * @param element - */ - public OptionReference(ToolReference owner, IConfigurationElement element) { - this.owner = owner; - option = owner.getTool().getOption(element.getAttribute(ID)); - - owner.addOptionReference(this); - - // value - switch (option.getValueType()) { - case BOOLEAN: - value = new Boolean(element.getAttribute(DEFAULT_VALUE)); - break; - case STRING: - value = element.getAttribute(DEFAULT_VALUE); - break; - case ENUMERATED: - String temp = element.getAttribute(DEFAULT_VALUE); - if (temp == null) { - try { - temp = option.getSelectedEnum(); - } catch (BuildException e) { - temp = new String(); - } - } - value = temp; - break; - case STRING_LIST: - case INCLUDE_PATH: - case PREPROCESSOR_SYMBOLS: - case LIBRARIES: - case OBJECTS: - List valueList = new ArrayList(); - builtIns = new ArrayList(); - IConfigurationElement[] valueElements = element.getChildren(LIST_VALUE); - for (int i = 0; i < valueElements.length; ++i) { - IConfigurationElement valueElement = valueElements[i]; - Boolean isBuiltIn = new Boolean(valueElement.getAttribute(LIST_ITEM_BUILTIN)); - if (isBuiltIn.booleanValue()) { - builtIns.add(valueElement.getAttribute(LIST_ITEM_VALUE)); - } - else { - valueList.add(valueElement.getAttribute(LIST_ITEM_VALUE)); - } } - value = valueList; - break; - } - } - - /** - * Created from project file. - * - * @param owner - * @param element - */ - public OptionReference(ToolReference owner, Element element) { - this.owner = owner; - option = owner.getTool().getOption(element.getAttribute(ID)); - - // Bail now if there's no option for the reference - if (option == null) { - return; - } - - // Hook the reference up - owner.addOptionReference(this); - - // value - switch (option.getValueType()) { - case BOOLEAN: - value = new Boolean(element.getAttribute(DEFAULT_VALUE)); - break; - case STRING: - case ENUMERATED: - value = (String) element.getAttribute(DEFAULT_VALUE); - break; - case STRING_LIST: - case INCLUDE_PATH: - case PREPROCESSOR_SYMBOLS: - case LIBRARIES: - case OBJECTS: - List valueList = new ArrayList(); - builtIns = new ArrayList(); - NodeList nodes = element.getElementsByTagName(LIST_VALUE); - for (int i = 0; i < nodes.getLength(); ++i) { - Node node = nodes.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Boolean isBuiltIn = new Boolean(((Element)node).getAttribute(LIST_ITEM_BUILTIN)); - if (isBuiltIn.booleanValue()) { - builtIns.add(((Element)node).getAttribute(LIST_ITEM_VALUE)); - } else { - valueList.add(((Element)node).getAttribute(LIST_ITEM_VALUE)); - } - } - } - value = valueList; - break; - } - - } - - /** - * Persist receiver to project file. - * - * @param doc - * @param element - */ - public void serialize(Document doc, Element element) { - element.setAttribute(ID, option.getId()); - - // value - switch (option.getValueType()) { - case BOOLEAN: - element.setAttribute(DEFAULT_VALUE, ((Boolean)value).toString()); - break; - case STRING: - case ENUMERATED: - element.setAttribute(DEFAULT_VALUE, (String)value); - break; - case STRING_LIST: - case INCLUDE_PATH: - case PREPROCESSOR_SYMBOLS: - case LIBRARIES: - case OBJECTS: - ArrayList stringList = (ArrayList)value; - ListIterator iter = stringList.listIterator(); - while (iter.hasNext()) { - Element valueElement = doc.createElement(LIST_VALUE); - valueElement.setAttribute(LIST_ITEM_VALUE, (String)iter.next()); - valueElement.setAttribute(LIST_ITEM_BUILTIN, "false"); - element.appendChild(valueElement); - } - // Serialize the built-ins that have been overridden - if (builtIns != null) { - iter = builtIns.listIterator(); - while (iter.hasNext()) { - Element valueElement = doc.createElement(LIST_VALUE); - valueElement.setAttribute(LIST_ITEM_VALUE, (String)iter.next()); - valueElement.setAttribute(LIST_ITEM_BUILTIN, "true"); - element.appendChild(valueElement); - } - } - break; - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getApplicableValues() - */ - public String[] getApplicableValues() { - return option.getApplicableValues(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getCategory() - */ - public IOptionCategory getCategory() { - return option.getCategory(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getCommand() - */ - public String getCommand() { - return option.getCommand(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols() - */ - public String[] getDefinedSymbols() throws BuildException { - if (value == null) - return option.getDefinedSymbols(); - else if (getValueType() == PREPROCESSOR_SYMBOLS) { - ArrayList list = (ArrayList)value; - return (String[]) list.toArray(new String[list.size()]); - } - else - throw new BuildException("bad value type"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String) - */ - public String getEnumCommand(String name) { - return option.getEnumCommand(name); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId() - */ - public String getId() { - // A reference has the same id as the option it references - return option.getId(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getIncludePaths() - */ - public String[] getIncludePaths() throws BuildException { - if (value == null) - return option.getIncludePaths(); - else if (getValueType() == INCLUDE_PATH) { - ArrayList list = (ArrayList)value; - return (String[]) list.toArray(new String[list.size()]); - } - else - throw new BuildException("bad value type"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getLibraries() - */ - public String[] getLibraries() throws BuildException { - if (value == null) - return option.getLibraries(); - else if (getValueType() == LIBRARIES) { - ArrayList list = (ArrayList)value; - return (String[]) list.toArray(new String[list.size()]); - } - else - throw new BuildException("bad value type"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#getName() - */ - public String getName() { - // A reference has the same name as the option it references - return option.getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getBooleanValue() - */ - public boolean getBooleanValue() throws BuildException { - if (value == null){ - return option.getBooleanValue(); - } - else if (getValueType() == BOOLEAN) { - Boolean bool = (Boolean) value; - return bool.booleanValue(); - } else { - throw new BuildException("bad value type"); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getBuiltIns() - */ - public String[] getBuiltIns() { - // Return any overridden built-ins here, or the default set - // from the option this is a reference to - return builtIns == null ? - option.getBuiltIns(): - (String[])builtIns.toArray(new String[builtIns.size()]); - } - - public IOption getOption() { - return option; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue() - */ - public String getSelectedEnum() throws BuildException { - if (value == null) { - // Return the default defined for the enumeration in the manifest. - return option.getSelectedEnum(); - } else if (getValueType() == ENUMERATED) { - // Value will contain the human-readable name of the enum - return (String) value; - } else { - throw new BuildException("bad value type"); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue() - */ - public String[] getStringListValue() throws BuildException { - if (value == null) - return option.getStringListValue(); - else if (getValueType() == STRING_LIST) { - ArrayList list = (ArrayList)value; - return (String[]) list.toArray(new String[list.size()]); - } - else - throw new BuildException("bad value type"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getStringValue() - */ - public String getStringValue() throws BuildException { - if (value == null) - return option.getStringValue(); - else if (getValueType() == STRING) - return (String)value; - else - throw new BuildException("bad value type"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getTool() - */ - public ITool getTool() { - return owner; - } - - /** - * Answers the tool reference that contains the receiver. - * - * @return ToolReference - */ - public ToolReference getToolReference() { - return owner; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IOption#getUserObjects() - */ - public String[] getUserObjects() throws BuildException { - if (value == null) - return option.getDefinedSymbols(); - else if (getValueType() == OBJECTS) { - ArrayList list = (ArrayList)value; - return (String[]) list.toArray(new String[list.size()]); - } - else - throw new BuildException("bad value type"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOption#getValueType() - */ - public int getValueType() { - return option.getValueType(); - } - - /** - * Answers true if the receiver is a reference to the - * IOption specified in the argument, esle answers false. - * - * @param target - * @return boolean - */ - public boolean references(IOption target) { - if (equals(target)) { - // we are the target - return true; - } else if (option instanceof OptionReference) { - // check the reference we are overriding - return ((OptionReference)option).references(target); - } else { - // the real reference - return option.equals(target); - } - } - - /** - * Sets the boolean value of the receiver to the value specified in the argument. - * If the receive is not a reference to a boolean option, method will throw an - * exception. - * - * @param value - * @throws BuildException - */ - public void setValue(boolean value) throws BuildException { - if (getValueType() == BOOLEAN) - this.value = new Boolean(value); - else - throw new BuildException("bad value type"); - } - - /** - * @param value - * @throws BuildException - */ - public void setValue(String value) throws BuildException { - if (getValueType() == STRING || getValueType() == ENUMERATED) - this.value = value; - else - throw new BuildException("bad value type"); - } - - /** - * Sets the value of the receiver to be an array of items. - * - * @param value An array of strings to place in the option reference. - * @throws BuildException - */ - public void setValue(String [] value) throws BuildException { - if (getValueType() == STRING_LIST - || getValueType() == INCLUDE_PATH - || getValueType() == PREPROCESSOR_SYMBOLS - || getValueType() == LIBRARIES - || getValueType() == OBJECTS) { - // Just replace what the option reference is holding onto - this.value = new ArrayList(Arrays.asList(value)); - } - else - throw new BuildException("bad value type"); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties deleted file mode 100644 index 0558db5c999..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties +++ /dev/null @@ -1,27 +0,0 @@ -########################################################################## -# Copyright (c) 2002,2003 Rational Software Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v0.5 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v05.html -# -# Contributors: -# IBM Rational Software - Initial API and implementation -########################################################################## - -# Generated makefile builder messages -ManagedMakeBuilder.message.starting = Starting the build for project {0} -ManagedMakeBuilder.message.rebuild = Regenerating makefiles for project {0} -ManagedMakeBuilder.message.incremental = Updating makefiles for project {0} -ManagedMakeBuilder.message.updating = Updating project files... -ManagedMakeBuilder.message.make = Calling {0} for project {1} -ManagedMakeBuilder.message.creating.markers = Generating markers... -ManagedMakeBuilder.message.error = Build error -ManagedMakeBuilder.message.error.refresh = Error refreshing project. -ManagedMakeBuilder.message.finished = Build complete for project {0} -ManagedMakeBuilder.comment.module.list = # Every subdirectory with source files must be described here -ManagedMakeBuilder.comment.source.list = # Each subdirectory must contribute its source files here -ManagedMakeBuilder.comment.build.rule = # Each subdirectory must supply rules for building sources it contributes -ManagedMakeBuilder.comment.module.make.includes = # Include the makefiles for each source subdirectory -ManagedMakeBuilder.comment.module.dep.includes = # Include automatically-generated dependency list: -ManagedMakeBuilder.comment.autodeps = # Automatically-generated dependency list: diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java deleted file mode 100644 index 4ad06f66327..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java +++ /dev/null @@ -1,526 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.core; - -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.StringTokenizer; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IConfigurationElement; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -public class Target extends BuildObject implements ITarget { - - // Build model elements that come from the plugin or project files - private String artifactName; - private String binaryParserId; - private String cleanCommand; - private Map configMap; - private List configurations; - private String defaultExtension; - private boolean isAbstract = false; - private boolean isTest = false; - private String makeCommand; - private IResource owner; - private ITarget parent; - private List targetOSList; - private Map toolMap; - private List toolList; - - private static final IConfiguration[] emptyConfigs = new IConfiguration[0]; - private static final String EMPTY_STRING = new String(); - - public Target(IResource owner) { - this.owner = owner; - } - - /** - * Create a target owned by a resource based on a parent target - * - * @param owner - * @param parent - */ - public Target(IResource owner, ITarget parent) { - // Make the owner of the target the project resource - this(owner); - - // Copy the parent's identity - this.parent = parent; - Random r = new Random(); - r.setSeed(System.currentTimeMillis()); - int id = r.nextInt(); - if (id < 0) { - id *= -1; - } - setId(owner.getName() + "." + parent.getId() + "." + id); - setName(parent.getName()); - this.artifactName = parent.getArtifactName(); - this.binaryParserId = parent.getBinaryParserId(); - this.defaultExtension = parent.getDefaultExtension(); - this.isTest = parent.isTestTarget(); - this.cleanCommand = parent.getCleanCommand(); - - // Hook me up - IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner, true); - buildInfo.addTarget(this); - } - - /** - * This constructor is called to create a target defined by an extension point in - * a plugin manifest file. - * - * @param element - */ - public Target(IConfigurationElement element) { - // id - setId(element.getAttribute(ID)); - - // hook me up - ManagedBuildManager.addExtensionTarget(this); - - // Get the target name - setName(element.getAttribute(NAME)); - - // Get the name of the build artifact associated with target (usually - // in the plugin specification). - artifactName = element.getAttribute(ARTIFACT_NAME); - - // Get the ID of the binary parser - binaryParserId = element.getAttribute(BINARY_PARSER); - - // Get the default extension - defaultExtension = element.getAttribute(DEFAULT_EXTENSION); - - // parent - String parentId = element.getAttribute(PARENT); - if (parentId != null) { - parent = ManagedBuildManager.getTarget(null, parentId); - // copy over the parents configs - IConfiguration[] parentConfigs = parent.getConfigurations(); - for (int i = 0; i < parentConfigs.length; ++i) - addConfiguration(parentConfigs[i]); - } - - // isAbstract - isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT))); - - // Is this a test target - isTest = ("true".equals(element.getAttribute(IS_TEST))); - - // Get the clean command - cleanCommand = element.getAttribute(CLEAN_COMMAND); - if (cleanCommand == null) { - // See if it defined in the parent - cleanCommand = parent.getCleanCommand(); - } - - // Get the make command - makeCommand = element.getAttribute(MAKE_COMMAND); - if (makeCommand == null) { - // See if it defined in the parent - makeCommand = parent.getMakeCommand(); - } - - // Get the comma-separated list of valid OS - String os = element.getAttribute(OS_LIST); - if (os != null) { - targetOSList = new ArrayList(); - StringTokenizer tokens = new StringTokenizer(os, ","); - while (tokens.hasMoreTokens()) { - targetOSList.add(tokens.nextToken().trim()); - } - } - - IConfigurationElement[] targetElements = element.getChildren(); - int k; - // Load the tools first - for (k = 0; k < targetElements.length; ++k) { - IConfigurationElement targetElement = targetElements[k]; - if (targetElement.getName().equals(ITool.TOOL_ELEMENT_NAME)) { - new Tool(this, targetElement); - } - } - // Then load the configurations which may have tool references - for (k = 0; k < targetElements.length; ++k) { - IConfigurationElement targetElement = targetElements[k]; - if (targetElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) { - new Configuration(this, targetElement); - } - } - - } - - /** - * Create target from project file. - * - * @param buildInfo - * @param element - */ - public Target(ManagedBuildInfo buildInfo, Element element) { - this(buildInfo.getOwner()); - - // id - setId(element.getAttribute(ID)); - - // hook me up - buildInfo.addTarget(this); - - // name - setName(element.getAttribute(NAME)); - - // Get the name of the build artifact associated with target (should - // contain what the user entered in the UI). - artifactName = element.getAttribute(ARTIFACT_NAME); - - // Get the default extension - defaultExtension = element.getAttribute(DEFAULT_EXTENSION); - - // parent - String parentId = element.getAttribute(PARENT); - if (parentId != null) - parent = ManagedBuildManager.getTarget(null, parentId); - - // isAbstract - if ("true".equals(element.getAttribute(IS_ABSTRACT))) - isAbstract = true; - - // Is this a test target - isTest = ("true".equals(element.getAttribute(IS_TEST))); - - // Get the clean command - cleanCommand = element.getAttribute(CLEAN_COMMAND); - - // Get the make command - if (element.hasAttribute(MAKE_COMMAND)) { - makeCommand = element.getAttribute(MAKE_COMMAND); - } - - Node child = element.getFirstChild(); - while (child != null) { - if (child.getNodeName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) { - new Configuration(this, (Element)child); - } - child = child.getNextSibling(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#removeConfiguration(java.lang.String) - */ - public void removeConfiguration(String id) { - // Remove the specified configuration from the list and map - Iterator iter = configurations.listIterator(); - while (iter.hasNext()) { - IConfiguration config = (IConfiguration)iter.next(); - if (config.getId().equals(id)) { - configurations.remove(config); - configMap.remove(id); - break; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#resetMakeCommand() - */ - public void resetMakeCommand() { - makeCommand = null; - } - - /** - * Persist receiver to project file. - * - * @param doc - * @param element - */ - public void serialize(Document doc, Element element) { - element.setAttribute(ID, getId()); - element.setAttribute(NAME, getName()); - if (parent != null) - element.setAttribute(PARENT, parent.getId()); - element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false"); - element.setAttribute(ARTIFACT_NAME, getArtifactName()); - element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension()); - element.setAttribute(IS_TEST, isTest ? "true" : "false"); - element.setAttribute(CLEAN_COMMAND, getCleanCommand()); - if (makeCommand != null) { - element.setAttribute(MAKE_COMMAND, makeCommand); - } - - if (configurations != null) - for (int i = 0; i < configurations.size(); ++i) { - Configuration config = (Configuration)configurations.get(i); - Element configElement = doc.createElement(IConfiguration.CONFIGURATION_ELEMENT_NAME); - element.appendChild(configElement); - config.serialize(doc, configElement); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#getMakeCommand() - */ - public String getMakeCommand() { - // Return the name of the make utility - return (makeCommand == null) ? parent.getMakeCommand() : makeCommand; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName() - */ - public String getName() { - return (name == null && parent != null) ? parent.getName() : name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#getParent() - */ - public ITarget getParent() { - return parent; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#getTargetOSList() - */ - public String[] getTargetOSList() { - if (targetOSList == null) { - // Ask parent for its list - if (parent != null) { - return parent.getTargetOSList(); - } else { - // I have no parent and no defined list but never return null - return new String[0]; - } - } - return (String[]) targetOSList.toArray(new String[targetOSList.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#getOwner() - */ - public IResource getOwner() { - return owner; - } - - private int getNumTools() { - int n = getToolList().size(); - if (parent != null) - n += ((Target)parent).getNumTools(); - return n; - } - - - private int addToolsToArray(ITool[] toolArray, int start) { - int n = start; - if (parent != null) - n = ((Target)parent).addToolsToArray(toolArray, start); - - for (int i = 0; i < getToolList().size(); ++i) { - toolArray[n++] = (ITool)getToolList().get(i); - } - - return n; - } - - private List getToolList() { - if (toolList == null) { - toolList = new ArrayList(); - toolList.clear(); - } - return toolList; - } - - private Map getToolMap() { - if (toolMap == null) { - toolMap = new HashMap(); - toolMap.clear(); - } - return toolMap; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#getTools() - */ - public ITool[] getTools() { - ITool[] toolArray = new ITool[getNumTools()]; - addToolsToArray(toolArray, 0); - return toolArray; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#hasMakeCommandOverride() - */ - public boolean hasOverridenMakeCommand() { - return (makeCommand != null && !makeCommand.equals(parent.getMakeCommand())); - } - - /** - * @param id - * @return ITool - */ - public ITool getTool(String id) { - ITool result = null; - - // See if receiver has it in list - result = (ITool) getToolMap().get(id); - - // If not, check if parent has it - if (result == null && parent != null) { - result = ((Target)parent).getTool(id); - } - - return result; - } - - /** - * @param tool - */ - public void addTool(ITool tool) { - getToolList().add(tool); - getToolMap().put(tool.getId(), tool); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#getConfigurations() - */ - public IConfiguration[] getConfigurations() { - if (configurations != null) - return (IConfiguration[])configurations.toArray(new IConfiguration[configurations.size()]); - else - return emptyConfigs; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#getDefaultExtension() - */ - public String getDefaultExtension() { - return defaultExtension == null ? EMPTY_STRING : defaultExtension; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#getCleanCommand() - */ - public String getCleanCommand() { - // Return the command used to remove files - return cleanCommand == null ? EMPTY_STRING : cleanCommand; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#getArtifactName() - */ - public String getArtifactName() { - if (artifactName == null) { - // If I have a parent, ask it - if (parent != null) { - return parent.getArtifactName(); - } else { - // I'm it and this is not good! - return EMPTY_STRING; - } - } else { - return artifactName; - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId() - */ - public String getBinaryParserId() { - if (binaryParserId == null) { - // If I have a parent, ask it - if (parent != null) { - return parent.getBinaryParserId(); - } else { - // I'm it and this is not good! - return EMPTY_STRING; - } - } - return binaryParserId; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#getConfiguration() - */ - public IConfiguration getConfiguration(String id) { - return (IConfiguration)configMap.get(id); - } - - /** - * @param configuration - */ - public void addConfiguration(IConfiguration configuration) { - if (configurations == null) { - configurations = new ArrayList(); - configMap = new HashMap(); - } - configurations.add(configuration); - configMap.put(configuration.getId(), configuration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#isAbstract() - */ - public boolean isAbstract() { - return isAbstract; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#isTestTarget() - */ - public boolean isTestTarget() { - return isTest; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#createConfiguration() - */ - public IConfiguration createConfiguration(String id) { - return new Configuration(this, id); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#createConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration) - */ - public IConfiguration createConfiguration(IConfiguration parent, String id) { - return new Configuration(this, parent, id); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITarget#setBuildArtifact(java.lang.String) - */ - public void setBuildArtifact(String name) { - if (name != null) { - artifactName = name; - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITarget#setMakeCommand(java.lang.String) - */ - public void setMakeCommand(String command) { - if (command != null && !getMakeCommand().equals(command)) { - makeCommand = command; - } - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java deleted file mode 100644 index 828eea82bf1..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ /dev/null @@ -1,411 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.internal.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.core.runtime.IConfigurationElement; - -/** - * Represents a tool that can be invoked during a build. - * Note that this class implements IOptionCategory to represent the top - * category. - */ -public class Tool extends BuildObject implements ITool, IOptionCategory { - - private static final String DEFAULT_SEPARATOR = ","; - private static final IOptionCategory[] EMPTY_CATEGORIES = new IOptionCategory[0]; - private static final IOption[] EMPTY_OPTIONS = new IOption[0]; - - private Map categoryMap; - private List childOptionCategories; - private String command; - private List inputExtensions; - private List interfaceExtensions; - private int natureFilter; - private Map optionMap; - private List options; - private String outputExtension; - private String outputFlag; - private String outputPrefix; - private ITarget target; - - public Tool(Target target) { - this.target = target; - } - - /** - * Constructor to create a new tool in the build model based on the information - * defined in the plugin.xml manifest. - * - * @param target The target the receiver will belong to. - * @param element The element containing the information. - */ - public Tool(Target target, IConfigurationElement element) { - this(target); - - // id - setId(element.getAttribute(ITool.ID)); - - // hook me up - target.addTool(this); - - // name - setName(element.getAttribute(ITool.NAME)); - - // Get the nature filter - String nature = element.getAttribute(NATURE); - if (nature == null || "both".equals(nature)) { - natureFilter = FILTER_BOTH; - } else if ("cnature".equals(nature)) { - natureFilter = FILTER_C; - } else if ("ccnature".equals(nature)) { - natureFilter = FILTER_CC; - } else { - natureFilter = FILTER_BOTH; - } - - // Get the supported input file extension - String inputs = element.getAttribute(ITool.SOURCES) == null ? - new String() : - element.getAttribute(ITool.SOURCES); - StringTokenizer tokenizer = new StringTokenizer(inputs, DEFAULT_SEPARATOR); - while (tokenizer.hasMoreElements()) { - getInputExtensions().add(tokenizer.nextElement()); - } - - // Get the interface (header file) extensions - String headers = element.getAttribute(INTERFACE_EXTS); - if (headers == null) { - headers = new String(); - } - tokenizer = new StringTokenizer(headers, DEFAULT_SEPARATOR); - while (tokenizer.hasMoreElements()) { - getInterfaceExtensions().add(tokenizer.nextElement()); - } - - // Get the output extension - outputExtension = element.getAttribute(ITool.OUTPUTS) == null ? - new String() : - element.getAttribute(ITool.OUTPUTS); - - // Get the tool invocation - command = element.getAttribute(ITool.COMMAND) == null ? - new String() : - element.getAttribute(ITool.COMMAND); - - // Get the flag to control output - outputFlag = element.getAttribute(ITool.OUTPUT_FLAG) == null ? - new String() : - element.getAttribute(ITool.OUTPUT_FLAG); - - // Get the output prefix - outputPrefix = element.getAttribute(ITool.OUTPUT_PREFIX) == null ? - new String() : - element.getAttribute(ITool.OUTPUT_PREFIX); - - // set up the category map - categoryMap = new HashMap(); - addOptionCategory(this); - - // Check for options - IConfigurationElement[] toolElements = element.getChildren(); - for (int l = 0; l < toolElements.length; ++l) { - IConfigurationElement toolElement = toolElements[l]; - if (toolElement.getName().equals(ITool.OPTION)) { - new Option(this, toolElement); - } else if (toolElement.getName().equals(ITool.OPTION_CAT)) { - new OptionCategory(this, toolElement); - } - } - } - - public IOptionCategory getOptionCategory(String id) { - return (IOptionCategory)categoryMap.get(id); - } - - void addOptionCategory(IOptionCategory category) { - categoryMap.put(category.getId(), category); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#handlesFileType(java.lang.String) - */ - public boolean buildsFileType(String extension) { - if (extension == null) { - return false; - } - return getInputExtensions().contains(extension); - } - - void addChildCategory(IOptionCategory category) { - if (childOptionCategories == null) - childOptionCategories = new ArrayList(); - childOptionCategories.add(category); - } - - public IOption[] getOptions() { - if (options != null) - return (IOption[])options.toArray(new IOption[options.size()]); - else - return EMPTY_OPTIONS; - } - - public void addOption(Option option) { - if (options == null) { - options = new ArrayList(); - optionMap = new HashMap(); - } - options.add(option); - optionMap.put(option.getId(), option); - } - - public IOptionCategory getTopOptionCategory() { - return this; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getChildCategories() - */ - public IOptionCategory[] getChildCategories() { - if (childOptionCategories != null) - return (IOptionCategory[])childOptionCategories.toArray(new IOptionCategory[childOptionCategories.size()]); - else - return EMPTY_CATEGORIES; - } - - /* (non-Javadoc) - * Safe accessor method to retrieve the list of valid source extensions - * the receiver know how to build. - * - * @return List - */ - private List getInputExtensions() { - if (inputExtensions == null) { - inputExtensions = new ArrayList(); - } - return inputExtensions; - } - - private List getInterfaceExtensions() { - if (interfaceExtensions == null) { - interfaceExtensions = new ArrayList(); - } - return interfaceExtensions; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#createChildCategory() - */ - public IOptionCategory createChildCategory() { - IOptionCategory category = new OptionCategory(this); - - if (childOptionCategories == null) - childOptionCategories = new ArrayList(); - childOptionCategories.add(category); - - return category; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOutputFlag() - */ - public String getOutputFlag() { - return outputFlag == null ? new String() : outputFlag.trim(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOutputPrefix() - */ - public String getOutputPrefix() { - return outputPrefix == null ? new String() : outputPrefix.trim(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOwner() - */ - public IOptionCategory getOwner() { - return null; - } - - public ITarget getTarget() { - return target; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getTool() - */ - public ITool getTool() { - return this; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getToolCommand() - */ - public String getToolCommand() { - return command.trim(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getToolFlags() - */ - public String getToolFlags() throws BuildException { - // Get all of the options - StringBuffer buf = new StringBuffer(); - IOption[] opts = getOptions(); - for (int index = 0; index < opts.length; index++) { - IOption option = opts[index]; - switch (option.getValueType()) { - case IOption.BOOLEAN : - if (option.getBooleanValue()) { - buf.append(option.getCommand() + WHITE_SPACE); - } - break; - - case IOption.ENUMERATED : - String enum = option.getEnumCommand(option.getSelectedEnum()); - if (enum.length() > 0) { - buf.append(enum + WHITE_SPACE); - } - break; - - case IOption.STRING : - String val = option.getStringValue(); - if (val.length() > 0) { - buf.append(val + WHITE_SPACE); - } - break; - - case IOption.STRING_LIST : - String listCmd = option.getCommand(); - String[] list = option.getStringListValue(); - for (int j = 0; j < list.length; j++) { - String temp = list[j]; - buf.append(listCmd + temp + WHITE_SPACE); - } - break; - - case IOption.INCLUDE_PATH : - String incCmd = option.getCommand(); - String[] paths = option.getIncludePaths(); - for (int j = 0; j < paths.length; j++) { - String temp = paths[j]; - buf.append(incCmd + temp + WHITE_SPACE); - } - break; - - case IOption.PREPROCESSOR_SYMBOLS : - String defCmd = option.getCommand(); - String[] symbols = option.getDefinedSymbols(); - for (int j = 0; j < symbols.length; j++) { - String temp = symbols[j]; - buf.append(defCmd + temp + WHITE_SPACE); - } - break; - - default : - break; - } - - } - - return buf.toString().trim(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptions(org.eclipse.cdt.core.build.managed.ITool) - */ - public IOption[] getOptions(IConfiguration configuration) { - ITool tool = this; - if (configuration != null) { - // TODO don't like this much - ITool[] tools = configuration.getTools(); - for (int i = 0; i < tools.length; ++i) { - if (tools[i] instanceof ToolReference) { - if (((ToolReference)tools[i]).references(tool)) { - tool = tools[i]; - break; - } - } else if (tools[i].equals(tool)) - break; - } - } - - IOption[] allOptions = tool.getOptions(); - ArrayList myOptions = new ArrayList(); - - for (int i = 0; i < allOptions.length; ++i) { - IOption option = allOptions[i]; - if (option.getCategory().equals(this)) - myOptions.add(option); - } - - myOptions.trimToSize(); - return (IOption[])myOptions.toArray(new IOption[myOptions.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITool#getNatureFilter() - */ - public int getNatureFilter() { - return natureFilter; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOption(java.lang.String) - */ - public IOption getOption(String id) { - return (IOption)optionMap.get(id); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOutput(java.lang.String) - */ - public String getOutputExtension(String inputExtension) { - // Examine the list of input extensions - ListIterator iter = getInputExtensions().listIterator(); - while (iter.hasNext()) { - if (((String)iter.next()).equals(inputExtension)) { - return outputExtension; - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITool#isHeaderFile(java.lang.String) - */ - public boolean isHeaderFile(String ext) { - if (ext == null) { - return false; - } - return getInterfaceExtensions().contains(ext); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#producesFileType(java.lang.String) - */ - public boolean producesFileType(String outputExtension) { - return this.outputExtension.equals(outputExtension); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java deleted file mode 100644 index 91a13233d3c..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java +++ /dev/null @@ -1,398 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.managedbuilder.internal.core; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.core.runtime.IConfigurationElement; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * - */ -public class ToolReference implements ITool { - - private ITool parent; - private IConfiguration owner; - private List optionReferences; - private Map optionRefMap; - - /** - * Created a tool reference on the fly based on an existing tool. - * - * @param owner The Configuration the receiver will be added to. - * @param parent The ITooltool the reference will be based on. - */ - public ToolReference(Configuration owner, ITool parent) { - this.owner = owner; - this.parent = parent; - - owner.addToolReference(this); - } - - /** - * Adds the option reference specified in the argument to the receiver. - * - * @param optionRef - */ - public void addOptionReference(OptionReference optionRef) { - getLocalOptionRefs().add(optionRef); - } - - /** - * Created tool reference from an extension defined in a plugin manifest. - * - * @param owner The Configuration the receiver will be added to. - * @param element The element containing build information for the reference. - */ - public ToolReference(Configuration owner, IConfigurationElement element) { - this.owner = owner; - - parent = ((Target)owner.getTarget()).getTool(element.getAttribute(ID)); - - owner.addToolReference(this); - - IConfigurationElement[] toolElements = element.getChildren(); - for (int m = 0; m < toolElements.length; ++m) { - IConfigurationElement toolElement = toolElements[m]; - if (toolElement.getName().equals(ITool.OPTION_REF)) { - new OptionReference(this, toolElement); - } - } - } - - /** - * Create a new tool reference based on information contained in a project file. - * - * @param owner The Configuration the receiver will be added to. - * @param element The element defined in the project file containing build information - * for the receiver. - */ - public ToolReference(Configuration owner, Element element) { - this.owner = owner; - - Target parentTarget = (Target)owner.getTarget(); - parent = ((Target)parentTarget.getParent()).getTool(element.getAttribute("id")); - - owner.addToolReference(this); - - NodeList configElements = element.getChildNodes(); - for (int i = 0; i < configElements.getLength(); ++i) { - Node configElement = configElements.item(i); - if (configElement.getNodeName().equals(ITool.OPTION_REF)) { - new OptionReference(this, (Element)configElement); - } - } - } - - /** - * Persist receiver to project file. - * - * @param doc The persistent store for the reference information. - * @param element The root element in the store the receiver must use - * to persist settings. - */ - public void serialize(Document doc, Element element) { - element.setAttribute(ITool.ID, parent.getId()); - Iterator iter = getLocalOptionRefs().listIterator(); - while (iter.hasNext()) { - OptionReference optionRef = (OptionReference) iter.next(); - Element optionRefElement = doc.createElement(ITool.OPTION_REF); - element.appendChild(optionRefElement); - optionRef.serialize(doc, optionRefElement); - } - } - - public IConfiguration getConfiguration() { - return owner; - } - - public ITool getTool() { - return parent; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getToolCommand() - */ - public String getToolCommand() { - return parent.getToolCommand(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getToolFlags() - */ - public String getToolFlags() throws BuildException { - // Get all of the options - StringBuffer buf = new StringBuffer(); - IOption[] opts = getOptions(); - for (int index = 0; index < opts.length; index++) { - IOption option = opts[index]; - switch (option.getValueType()) { - case IOption.BOOLEAN : - if (option.getBooleanValue()) { - buf.append(option.getCommand() + WHITE_SPACE); - } - break; - - case IOption.ENUMERATED : - String enum = option.getEnumCommand(option.getSelectedEnum()); - if (enum.length() > 0) { - buf.append(enum + WHITE_SPACE); - } - break; - - case IOption.STRING : - String val = option.getStringValue(); - if (val.length() > 0) { - buf.append(val + WHITE_SPACE); - } - break; - - case IOption.STRING_LIST : - String cmd = option.getCommand(); - String[] list = option.getStringListValue(); - for (int j = 0; j < list.length; j++) { - String temp = list[j]; - buf.append(cmd + temp + WHITE_SPACE); - } - break; - - case IOption.INCLUDE_PATH : - String incCmd = option.getCommand(); - String[] paths = option.getIncludePaths(); - for (int j = 0; j < paths.length; j++) { - String temp = paths[j]; - buf.append(incCmd + temp + WHITE_SPACE); - } - break; - - case IOption.PREPROCESSOR_SYMBOLS : - String defCmd = option.getCommand(); - String[] symbols = option.getDefinedSymbols(); - for (int j = 0; j < symbols.length; j++) { - String temp = symbols[j]; - buf.append(defCmd + temp + WHITE_SPACE); - } - break; - - default : - break; - } - - } - - return buf.toString().trim(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#createOption() - */ - public IOption createOption() { - - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOptions() - */ - public IOption[] getOptions() { - IOption[] options = parent.getOptions(); - - // Replace with our references - for (int i = 0; i < options.length; ++i) { - OptionReference ref = getOptionReference(options[i]); - if (ref != null) - options[i] = ref; - } - - return options; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOutputFlag() - */ - public String getOutputFlag() { - // The tool reference does not override this value - return parent.getOutputFlag(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOutputPrefix() - */ - public String getOutputPrefix() { - // The tool reference does not override this value - return parent.getOutputPrefix(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getTarget() - */ - public ITarget getTarget() { - return owner.getTarget(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getTopOptionCategory() - */ - public IOptionCategory getTopOptionCategory() { - // The tool reference does not override this value - return parent.getTopOptionCategory(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITool#isHeaderFile(java.lang.String) - */ - public boolean isHeaderFile(String ext) { - // The tool reference does not override this value - return parent.isHeaderFile(ext); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#producesFileType(java.lang.String) - */ - public boolean producesFileType(String outputExtension) { - // The tool reference does not override this value - return parent.producesFileType(outputExtension); - } - - protected List getAllOptionRefs() { - // First get all the option references this tool reference contains - return ((Configuration)owner).getOptionReferences(parent); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#getId() - */ - public String getId() { - // The tool reference does not override this value - return parent.getId(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.IBuildObject#getName() - */ - public String getName() { - // The tool reference does not override this value - return parent.getName(); - } - - /** - * Answers true if the reference is a reference to the - * tool specified in the argument. - * - * @param target the tool that should be tested - * @return boolean - */ - public boolean references(ITool target) { - if (equals(target)) { - // we are the target - return true; - } - else if (parent instanceof ToolReference) { - // check the reference we are overriding - return ((ToolReference)parent).references(target); - } - else if (target instanceof ToolReference) { - return parent.equals(((ToolReference)target).parent); - } - else { - // the real reference - return parent.equals(target); - } - } - - /* (non-javadoc) - * Answers an option reference that overrides the option, or null - * - * @param option - * @return OptionReference - */ - private OptionReference getOptionReference(IOption option) { - // Get all the option references for this option - Iterator iter = getAllOptionRefs().listIterator(); - while (iter.hasNext()) { - OptionReference optionRef = (OptionReference) iter.next(); - if (optionRef.references(option)) - return optionRef; - } - - return null; - } - - protected List getLocalOptionRefs() { - if (optionReferences == null) { - optionReferences = new ArrayList(); - optionReferences.clear(); - } - return optionReferences; - } - - /** - * Answers a reference to the option. If the reference does not exist, - * a new reference is created. - * - * @param option - * @return OptionReference - */ - public OptionReference createOptionReference(IOption option) { - // Check if the option reference already exists - OptionReference ref = getOptionReference(option); - if (ref == null) { - ref = new OptionReference(this, option); - } - return ref; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#handlesFileType(java.lang.String) - */ - public boolean buildsFileType(String extension) { - // The tool reference does not override this value - return parent.buildsFileType(extension); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.managedbuilder.core.ITool#getNatureFilter() - */ - public int getNatureFilter() { - // The tool reference does not override this value - return parent.getNatureFilter(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOption(java.lang.String) - */ - public IOption getOption(String id) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.build.managed.ITool#getOutput(java.lang.String) - */ - public String getOutputExtension(String inputExtension) { - // The tool reference does not override this value - return parent.getOutputExtension(inputExtension); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/.classpath b/build/org.eclipse.cdt.managedbuilder.ui/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/build/org.eclipse.cdt.managedbuilder.ui/.cvsignore b/build/org.eclipse.cdt.managedbuilder.ui/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/build/org.eclipse.cdt.managedbuilder.ui/.project b/build/org.eclipse.cdt.managedbuilder.ui/.project deleted file mode 100644 index 859042cc435..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/.project +++ /dev/null @@ -1,31 +0,0 @@ - - - org.eclipse.cdt.managedbuilder.ui - - - org.eclipse.cdt.core - org.eclipse.cdt.managedbuilder.core - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog b/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog deleted file mode 100644 index 3b6c2c858a2..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/ChangeLog +++ /dev/null @@ -1,164 +0,0 @@ -2003-11-10 Tanya Wolff - - I18N-Externalized strings from plugin.xml. - I18N-Added keys & strings to plugin.properties. - Fixed an id error in linux c compiler debugger options. - * plugin.xml - * plugin.properties - -2003-11-11 Sean Evoy - Work to implement bugzilla 44841: - Added a scrollbar to the list control inside the custom list field editor. - Also added an Edit button to the field editor to make it easier for keyboard-only - accessibility. - - Work for bugzilla 44451: - Changed the method that prompts user for information so that if the user cancels - with an empty input dialog, the method always returns an empty string. The responsibility - now rests with the caller to test the return value for length > 0 to decide whether or - not to add string to the list. - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java - - Moved string constants from core UI plugin to build UI plugin. These values are duplicated - in the standadrd make UI plugin anyway, so the argument for keeping them in a common - plugin seems pretty weak. This removes another dependency between the builder UI and - common UI plugin. I did have to change the string resource lookup method in a few of - the UI implementation classes that use the constants. - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java - -2003-10-17 Tom Tromey - - Changed -werror to -Werror - * plugin.xml - -2003-10-14 Alain Magloire - - ICOptionPage was added a new method - Preferences getPreferences(); - This is needed to get the preference store when saving - On the plugin. We had the equivalent for project - IProject getProject(); - - * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage - -2003-10-01 Sean Evoy - Fix for bugs 43490 (trivial), 44020, and 43980. - A massive change has occurred in the plugin file. I added new C tools that apply - only to projects with C natures. I also added option overrides in the default - configurations for these new tools. The trivial fix for the new C project wizard - involved changing the icon entry in the plugin file. - * plugin.xml - - In preparation for 44020, each new configuration created is assigned a truly - random ID. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java - - Removed a tooltip that was not being populated properly. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java - -2003-09-30 Sean Evoy - Fix for bug 41826. - - Updated the tool specifications for Win32, Linux, and Solaris so that header - file extension info is available. - * plugin.xml - -2003-09-25 Sean Evoy - For bug (really an enhancement request)43756, I added the word default to a - widget label to try and make it clear that a new configuration will be based - on default values, not user-overridden stuff. It remains to be seen if this - actually helps, but it seems reasonable. - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - - For bug 43220 I now display a widget just for user objects. - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java - - I also reordered the plugin definition for the linker tools, and moved some of - the option labels to the plugin property file. I also added a user object option - to each linker tool definition. - * plugin.properties - * plugin.xml - -2003-09-25 Sean Evoy - This patch contains a lot of changes needed to implement fixes for 42648 and - 43122. - - The properties file has been updated to externalize some of the option labels - to try and address some of the concern about continuity between UIs on - different platforms. - * plugin.properties - - There are changes in the plugin XML file to accomodate showing the targets - only on the correct host platform. Option names have bee replaced with - externalized equivalents where possible. The release and debug configurations - for each configuration now apply "reasonable" defaults for debug and optimization - option. Finally, the Cygwinb tool specification has been brought closer to those - for *nix. - * plugin.xml - - Only targets that correspond to the host platforms are shown in the drop-down - list. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java - -2003-09-23 Sean Evoy - I added a fix for critical bug 43439. The new project wizard is ready to be hooked - up to the help system content on F1. There is a new file with the string constant - the doc project will use to map the widget to a help file. - * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java - * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java - - In support of the fix for critical bug 43292, I added a new set of widgets to - the ManageConfigDialog implementation. I added new string literals in the properties - file for the plugin. There are obviously new event handlers for the Manage dialog. - It displays the make command for the target, the name of the build artifact, and - a list of current and deleted configurations. There is no way to add new targets. - Users can restore deleted configurations up until they click OK. The client of this - dialog has been changed to properly respond to the changes. The NewConfigurationDialog - now displays an externalized string in the title bar. - * plugin.xml - * plugin.properties - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java - * src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java - -2003-09-19 Sean Evoy - Removed the binary parser selection tab from the new class wizard. Updated the - page description externalized string. - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java - - Added the hard-coded binary parser info to the defined targets. - * plugin.xml - - Fixed the event handling for add/remove in the list widget for build settings pages. - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java - -2003-09-16 Sean Evoy - Changed the initialization and button status logic so the list buttons are - enabled correctly on start-up and that the fist item in the list (if - any) is selected. Also changed the "Add" event handler to properly enable - the buttons and set the list selection. - - * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java - -2003-09-15 Sean Evoy - First submission of code to new project. Moved all the managed - builder-specific UI elements out of the cdt.ui project. This - includes the icons, and externalized strings. - - There are 2 new classes to handle the externalized strings and image - files: - * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties - * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java - * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java - - The property pages have been modified to use a mix of externalized - strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project - wizard has been reimplemented using the new C project classes added by - QNX September 12, 2003. The UI itself has not changed. \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.ui/about.html b/build/org.eclipse.cdt.managedbuilder.ui/about.html deleted file mode 100644 index 8c828de2ada..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

About This Content

- -

10th July, 2002

-

License

-

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

- -

Contributions

- -

If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

- -

If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

- - - \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.ui/build.properties b/build/org.eclipse.cdt.managedbuilder.ui/build.properties deleted file mode 100644 index 7258fc9dfd4..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - icons/,\ - mgdbuildui.jar -source.mgdbuildui.jar = src/ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-buildconfig.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-buildconfig.gif deleted file mode 100644 index bb64374a7be..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-buildconfig.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-deleteconfig.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-deleteconfig.gif deleted file mode 100644 index a06106af2d8..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-deleteconfig.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-editconfig.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-editconfig.gif deleted file mode 100644 index 820079ad6ba..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-editconfig.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-newconfig.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-newconfig.gif deleted file mode 100644 index 5b04a5e4610..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/action-newconfig.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/build_configs.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/build_configs.gif deleted file mode 100644 index bb64374a7be..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/build_configs.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-category.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-category.gif deleted file mode 100644 index 690bba071fc..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-category.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-compiler.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-compiler.gif deleted file mode 100644 index 20e7baed143..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-compiler.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-debug.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-debug.gif deleted file mode 100644 index 3052a80cd67..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-debug.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-librarian.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-librarian.gif deleted file mode 100644 index f966fc39d9b..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-librarian.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-linker.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-linker.gif deleted file mode 100644 index 91eec0f7dae..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-linker.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-preprocessor.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-preprocessor.gif deleted file mode 100644 index 082e49fbe66..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-preprocessor.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-profile.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-profile.gif deleted file mode 100644 index 45d614829bf..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-profile.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-release.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-release.gif deleted file mode 100644 index b7b23708e09..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-release.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-tool.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-tool.gif deleted file mode 100644 index 33981a5dbf1..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/build16/config-tool.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngc_app.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngc_app.gif deleted file mode 100644 index beefb8ee95d..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngc_app.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngcc_app.gif b/build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngcc_app.gif deleted file mode 100644 index 85e3f72d33c..00000000000 Binary files a/build/org.eclipse.cdt.managedbuilder.ui/icons/full/wizban/newmngcc_app.gif and /dev/null differ diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties deleted file mode 100644 index ecc2ffcaea3..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties +++ /dev/null @@ -1,75 +0,0 @@ -pluginName=C/C++ Managed Builder UI -providerName=Eclipse.org - -# The Wizards -MngCWizard.name=Managed Make C Project -MngCWizard.description=Create a new C project and let Eclipse create and manage the makefile -MngCCWizard.name=Managed Make C++ Project -MngCCWizard.description=Create a new C++ project and let Eclipse create and manage the makefile - -# Build Model Names -ConfigName.Rel=Release -ConfigName.Dbg=Debug -ToolName.preprocessor = Preprocessor -ToolName.compiler.c = C Compiler -ToolName.compiler.cpp = C++ Compiler -ToolName.archiver = Archiver -ToolName.linker.c = C Linker -ToolName.linker.cpp = C++ Linker -OptionCategory.Symbols = Symbols -OptionCategory.Preproc = Preprocessor -OptionCategory.Dirs = Directories -OptionCategory.General = General -OptionCategory.Optimize=Optimization -OptionCategory.Debug=Debugging -OptionCategory.Warn=Warnings -OptionCategory.Misc=Miscellaneous -OptionCategory.Libs=Libraries - -Option.Posix.PreprocOnly=Preprocess only (-E) -Option.Posix.Nostdinc=Do not search system directories (-nostdinc) - -Option.Posix.DefSym=Defined symbols (-D) -Option.Posix.UndefSym=Undefined symbols (-U) - -Option.Posix.InclPaths=Include Paths (-I) - -Option.Posix.OptLevel=Optimization Level -Option.Posix.Optimize.None=None (-O0) -Option.Posix.Optimize.Optimize=Optimize (-O1) -Option.Posix.Optimize.More=Optimize more (-O2) -Option.Posix.Optimize.Most=Optimize most (-O3) -Option.Posix.Optimize.Flags=Other optimization flags - -Option.Posix.DebugLevel=Debug Level -Option.Posix.Debug.None=None -Option.Posix.Debug.Min=Minimal (-g1) -Option.Posix.Debug.Def=Default (-g) -Option.Posix.Debug.Max=Maximum (-g3) -Option.Posix.Debug.Other=Other debugging flags -Option.Posix.Debug.gprof=Generate gprof information (-pg) -Option.Posix.Debug.prof=Generate prof information (-p) - -Option.Posix.Warn.Syntax=Check syntax only (-fsyntax-only) -Option.Posix.Warn.Pedandic=Pedantic (-pedantic) -Option.Posix.Warn.PedErrors=Pedantic warnings as errors (-pedantic-errors) -Option.Posix.Warn.nowarn=Inhibit all warnings (-w) -Option.Posix.Warn.allwarn=All warnings (-Wall) -Option.Posix.Warn.toerrs=Warnings as errors (-Werror) - -Option.Posix.Verbose=Verbose (-v) -Option.OtherFlags=Other flags -Option.Posix.Ansi=Support ANSI programs (-ansi) - -Option.Posix.Linker.NoStartFiles=Do not use standard start files (-nostartfiles) -Option.Posix.Linker.NoDefLibs=Do not use default libraries (-nodefaultlibs) -Option.Posix.Linker.NoStdLibs=No startup or default libs (-nostdlib) -Option.Posix.Linker.Strip=Remove symbol table (-s) -Option.Posix.Linker.Static=No shared libraries (-static) -Option.Posix.Linker.XLinker=Other options (-Xlinker [option]) -Option.Posix.Linker.Flags=Linker flags -Option.Posix.Libs=Libraries (-l) -Option.Posix.Libsearch=Library search path (-L) -Option.Posix.UserObjs=Other objects - -Option.Posix.Archiver.Flags=Archiver flags diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml deleted file mode 100644 index 32c43178444..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml +++ /dev/null @@ -1,3755 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - %MngCCWizard.description - - - - - %MngCWizard.description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java deleted file mode 100644 index b2f4bb4e4d1..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.ui; - -import org.eclipse.cdt.ui.CUIPlugin; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -public interface ManagedBuilderHelpContextIds { - public static final String PREFIX= CUIPlugin.PLUGIN_ID + "."; - - // Wizard pages - public static final String MAN_PROJ_PLATFORM_HELP = PREFIX + "man_proj_platform_help"; - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java deleted file mode 100644 index 338ade77584..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.ui; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.cdt.ui.*; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; - -/** - * Bundle of all images used by the C plugin. - */ -public class ManagedBuilderUIImages { - - // The plugin registry - private static ImageRegistry imageRegistry = new ImageRegistry(); - - // Subdirectory (under the package containing this class) where 16 color images are - private static URL fgIconBaseURL; - static { - try { - fgIconBaseURL= new URL(ManagedBuilderUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); - } catch (MalformedURLException e) { - CUIPlugin.getDefault().log(e); - } - } - private static final String NAME_PREFIX= ManagedBuilderUIPlugin.getUniqueIdentifier() + '.'; - private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length(); - private static final String T= "full/"; - - public static final String T_BUILD= T + "build16/"; - - - - // For the managed build images - public static final String IMG_BUILD_CONFIG = NAME_PREFIX + "build_configs.gif"; - public static final ImageDescriptor DESC_BUILD_CONFIG = createManaged(T_BUILD, IMG_BUILD_CONFIG); - public static final String IMG_BUILD_COMPILER = NAME_PREFIX + "config-compiler.gif"; - public static final ImageDescriptor DESC_BUILD_COMPILER = createManaged(T_BUILD, IMG_BUILD_COMPILER); - public static final String IMG_BUILD_LINKER = NAME_PREFIX + "config-linker.gif"; - public static final ImageDescriptor DESC_BUILD_LINKER = createManaged(T_BUILD, IMG_BUILD_LINKER); - public static final String IMG_BUILD_LIBRARIAN = NAME_PREFIX + "config-librarian.gif"; - public static final ImageDescriptor DESC_BUILD_LIBRARIAN = createManaged(T_BUILD, IMG_BUILD_LIBRARIAN); - public static final String IMG_BUILD_COMMAND = NAME_PREFIX + "config-command.gif"; - public static final ImageDescriptor DESC_BUILD_COMMAND = createManaged(T_BUILD, IMG_BUILD_COMMAND); - public static final String IMG_BUILD_PREPROCESSOR = NAME_PREFIX + "config-preprocessor.gif"; - public static final ImageDescriptor DESC_BUILD_PREPROCESSOR = createManaged(T_BUILD, IMG_BUILD_PREPROCESSOR); - public static final String IMG_BUILD_TOOL = NAME_PREFIX + "config-tool.gif"; - public static final ImageDescriptor DESC_BUILD_TOOL = createManaged(T_BUILD, IMG_BUILD_TOOL); - public static final String IMG_BUILD_CAT = NAME_PREFIX + "config-category.gif"; - public static final ImageDescriptor DESC_BUILD_CAT = createManaged(T_BUILD, IMG_BUILD_CAT); - - - private static ImageDescriptor createManaged(String prefix, String name) { - return createManaged(imageRegistry, prefix, name); - } - - private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) { - ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH))); - registry.put(name, result); - return result; - } - - public static Image get(String key) { - return imageRegistry.get(key); - } - - private static ImageDescriptor create(String prefix, String name) { - return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); - } - - private static URL makeIconFileURL(String prefix, String name) { - StringBuffer buffer= new StringBuffer(prefix); - buffer.append(name); - try { - return new URL(fgIconBaseURL, buffer.toString()); - } catch (MalformedURLException e) { - CUIPlugin.getDefault().log(e); - return null; - } - } - - /** - * Sets all available image descriptors for the given action. - */ - public static void setImageDescriptors(IAction action, String type, String relPath) { - relPath= relPath.substring(NAME_PREFIX_LENGTH); - action.setDisabledImageDescriptor(create(T + "d" + type, relPath)); - action.setHoverImageDescriptor(create(T + "c" + type, relPath)); - action.setImageDescriptor(create(T + "e" + type, relPath)); - } - - /** - * Helper method to access the image registry from the JavaPlugin class. - */ - static ImageRegistry getImageRegistry() { - return imageRegistry; - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java deleted file mode 100644 index 69b6aa23029..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.ui; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.Plugin; - - -public class ManagedBuilderUIPlugin extends Plugin { - //The shared instance. - private static ManagedBuilderUIPlugin plugin; - //Resource bundle. - private static ResourceBundle resourceBundle; - - /** - * @param descriptor - */ - public ManagedBuilderUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - try { - resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.managedbuilder.internal.ui.PluginResources"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - /** - * Returns the shared instance. - */ - public static ManagedBuilderUIPlugin getDefault() { - return plugin; - } - - public static String getResourceString(String key) { - try { - return resourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!"; - } catch (NullPointerException e) { - return "#" + key + "#"; - } - } - - public static String getFormattedString(String key, String arg) { - return MessageFormat.format(getResourceString(key), new String[] { arg }); - } - - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(getResourceString(key), args); - } - - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.managedbuilder.ui"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedProjectOptionBlock.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedProjectOptionBlock.java deleted file mode 100644 index ed3feeacccf..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedProjectOptionBlock.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.cdt.managedbuilder.internal.ui; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock; - -public class ManagedProjectOptionBlock extends TabFolderOptionBlock { - - /** - * @param parent - */ - public ManagedProjectOptionBlock(ICOptionContainer parent) { - super(parent); - // TODO Auto-generated constructor stub - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock#addTabs() - */ - protected void addTabs() { - // TODO Auto-generated method stub - - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties deleted file mode 100644 index 2dacaefb7cb..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties +++ /dev/null @@ -1,79 +0,0 @@ -######################################### -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -######################################### - -# ------- NewProjectCreationPluginPage------- - -MngMakeProjectWizard.op_error=Managed Make Error -MngMakeProjectWizard.title=Managed Make Project -MngMakeProjectWizard.description=Create a new Managed Make project. -#MngMakeProjectWizardSettings.title=Managed Make Settings -#MngMakeProjectWizardSettings.description=Define the Managed Make build settings. -MngMakeProjectWizard.message.add_nature=Adding Managed Nature -MngMakeProjectWizard.message.add_builder=Adding Makefile Generator -MngMakeProjectWizard.message.save=Saving new build options - -MngCWizard.title=Managed Make C Project -MngCWizard.description=Create a new Managed Make C project. -MngCWizardSettings.title=Managed Make C Settings -MngCWizardSettings.description=Define the Managed Make C build settings. - -MngCCWizard.title=Managed Make C++ Project -MngCCWizard.description=Create a new Managed Make C++ Project. -MngCCWizard.message.creating=Creating a new C++ Project with a makefile generator -MngCCWizardSettings.title=Managed Make C++ Settings -MngCCWizardSettings.description=Define the Managed Make C++ build settings. - -# -- Strings for the platform selection page -- -MngMakeProjectWizard.config.title=Select a Target -MngMakeProjectWizard.config.desc=Select the platform and configurations you wish to deploy on -PlatformBlock.label.platform=Platform: -PlatformBlock.label.configs=Configurations: - -# -- Strings for the additional options tab -MngMakeProjectWizard.options.title=Additional Project Settings -MngMakeProjectWizard.options.desc=Defined the inter-project dependencies, if any. - -# ----------- Configuration Selection Page ----------- -BuildPropertyPage.label.Platform=Platform: -BuildPropertyPage.label.Configuration=Configuration: -BuildPropertyPage.label.Active=Active configuration -BuildPropertyPage.label.Settings=Configuration settings -BuildPropertyPage.label.AddConfButton=Manage... -BuildPropertyPage.label.ToolTree=Tools -BuildPropertyPage.label.ToolOptions=Options -BuildPropertyPage.tip.platform=Select a platform for the project -BuildPropertyPage.tip.config=Select the configuration to edit -BuildPropertyPage.tip.addconf=Add configurations for the platform -BuildPropertyPage.tip.remconf=Remove configurations for the platform -BuildPropertyPage.manage.title=Manage - -# ----------- New Configuration ----------- -NewConfiguration.label.name=Configuration name: -NewConfiguration.label.copy=Copy default settings from: -NewConfiguration.error.title=Error -NewConfiguration.error.duplicateName=A configuration named "{0}" already exists. - -# ----------- Target/Config management dialog ----------------- -ManageConfig.label.makecmdgroup=Make command -ManageConfig.label.makecmddef=Use default command -ManageConfig.label.output.group=Build output -ManageConfig.label.output.label=Artifact name: -ManageConfig.label.configs=Manage configurations -ManageConfig.label.restore=Restore -ManageConfig.label.configs.current=Current: -ManageConfig.label.configs.deleted=Deleted: -ManageConfig.label.new.config.dialog=Create - -# ----------- Build Property Common ----------- -BuildPropertyCommon.label.title=Enter Value -BuildPropertyCommon.label.new=New... -BuildPropertyCommon.label.remove=Remove -BuildPropertyCommon.label.up=Up -BuildPropertyCommon.label.down=Down -BuildPropertyCommon.label.editVar=Edit... -BuildPropertyCommon.label.addVar=Add -BuildPropertyCommon.label.message=Value: -BuildPropertyCommon.label.browse=Browse... -BuildPropertyCommon.label.configs=Defined configurations: diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java deleted file mode 100644 index 5cb300916b2..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class BrowseEntryDialog extends Dialog { - // String constants - private static final String PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String BROWSE = LABEL + ".browse"; //$NON-NLS-1$ - - /** - * The title of the dialog. - */ - private String title = ""; - - /** - * The message to display, or null if none. - */ - private String message = ""; - - /** - * The input value; the empty string by default. - */ - private String value = ""; - - /** - * Error message label widget. - */ - private Label errorMessageLabel; - - // Widgets - private Button btnBrowse = null; - private Button btnOK = null; - private Text text = null; - - /** - * Creates an input dialog with OK, Cancel, and a Browse button. - * - * @param shell the parent shell - * @param dialogTitle the title of the dialog or null if none - * @param dialogMessage the dialog message, or null if none - * @param initialValue the initial input value, or null if none - * (equivalent to the empty string) - */ - public BrowseEntryDialog(Shell shell, String dialogTitle, String dialogMessage, String initialValue) { - super(shell); - // We are editing the value argument if it is not an empty string - if (dialogTitle != null) { - title = dialogTitle; - } - // Cache the message to be shown in the label - if (dialogMessage != null) { - message = dialogMessage; - } - // Value for the text widget - if (initialValue != null) { - value = initialValue; - } - } - - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected void buttonPressed(int buttonId) { - if (buttonId == IDialogConstants.OK_ID) { - value = text.getText().trim(); - } else { - value = null; - } - super.buttonPressed(buttonId); - } - - /* (non-Javadoc) - * Method declared in Window. - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (title != null) - shell.setText(title); - } - - protected Control createDialogArea(Composite parent) { - Composite composite = ControlFactory.createComposite(parent, 4); - - // Create the label - if (message != null) { - Label label = new Label(composite, SWT.WRAP); - label.setText(message); - GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); - gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); - gd.horizontalSpan = 4; - label.setLayoutData(gd); - label.setFont(parent.getFont()); - } - - text = new Text(composite, SWT.SINGLE | SWT.BORDER); - GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 3; - text.setLayoutData(gd); - text.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateButtonState(); - } - }); - - // Instantiate the browse button - btnBrowse = ControlFactory.createPushButton(composite, ManagedBuilderUIPlugin.getResourceString(BROWSE)); - setButtonLayoutData(btnBrowse); - btnBrowse.addSelectionListener(new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - handleBrowsePressed(); - } - }); - - return composite; - } - - protected void createButtonsForButtonBar(Composite parent) { - // create OK and Cancel buttons by default - btnOK = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - - text.setFocus(); - if (value != null) { - text.setText(value); - } - updateButtonState(); - } - - protected String getValue() { - return value; - } - - protected void handleBrowsePressed() { - // Popup a file browser widget - DirectoryDialog dialog = new DirectoryDialog(getShell()); - // Create a hint if text widget contains value - String widgetText; - if ((widgetText = text.getText().trim()).length() > 0) { - dialog.setFilterPath(widgetText); - } - // Open the selection dialog and populate the widget - String directory; - if ((directory = dialog.open()) != null) { - /* - * TODO: Convert the dialog to the proper format for platform (i.e. - * if platform.pathStyle == Platform.POSIX then swap \\ to / ) - */ - text.setText(directory.trim()); - updateButtonState(); - } - } - - protected void updateButtonState() { - if (btnOK != null) - btnOK.setEnabled(text.getText().trim().length() > 0); - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java deleted file mode 100644 index 8288407edd5..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionComboFieldEditor.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -public class BuildOptionComboFieldEditor extends FieldEditor { - - // Widgets and bookeeping variables - private Combo optionSelector; - private String [] options = new String[0]; - private String selected; - - /** - * @param name - * @param label - * @param opts - * @param sel - * @param parent - */ - public BuildOptionComboFieldEditor (String name, String label, String [] opts, String sel, Composite parent) { - init(name, label); - options = opts; - selected = sel; - createControl(parent); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) - */ - protected void adjustForNumColumns(int numColumns) { - // For now grab the excess space - GridData gd = (GridData)optionSelector.getLayoutData(); - gd.horizontalSpan = numColumns - 1; - gd.grabExcessHorizontalSpace = true; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int) - */ - protected void doFillIntoGrid(Composite parent, int numColumns) { - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = numColumns; - parent.setLayoutData(gd); - - // Add the label - Label label = getLabelControl(parent); - GridData labelData = new GridData(); - labelData.horizontalSpan = 1; - labelData.grabExcessHorizontalSpace = false; - label.setLayoutData(labelData); - - // Now add the combo selector - optionSelector = ControlFactory.createSelectCombo(parent, options, selected); - GridData selectorData = (GridData) optionSelector.getLayoutData(); - selectorData.horizontalSpan = numColumns - 1; - selectorData.grabExcessHorizontalSpace = true; - optionSelector.setLayoutData(selectorData); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doLoad() - */ - protected void doLoad() { - // Retrieve the option string from the store - String values = getPreferenceStore().getString(getPreferenceName()); - - // Convert it to a string array - options = BuildToolsSettingsStore.parseString(values); - optionSelector.removeAll(); - optionSelector.setItems(options); - - // Set the index of selection in the combo box - int index = optionSelector.indexOf(selected); - optionSelector.select(index >= 0 ? index : 0); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() - */ - protected void doLoadDefault() { - doLoad(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doStore() - */ - protected void doStore() { - // Save the selected item in the store - int index = optionSelector.getSelectionIndex(); - String selected = index == -1 ? new String() : optionSelector.getItem(index); - getPreferenceStore().setValue(getPreferenceName(), selected); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() - */ - public int getNumberOfControls() { - // There is just the label from the parent and the combo - return 2; - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java deleted file mode 100644 index 22e80dc56e1..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java +++ /dev/null @@ -1,440 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Widget; - -public class BuildOptionListFieldEditor extends FieldEditor { - // Label constants - private static final String TITLE = "BuildPropertyCommon.label.title"; //$NON-NLS-1$ - private static final String NEW = "BuildPropertyCommon.label.new"; //$NON-NLS-1$ - private static final String REMOVE = "BuildPropertyCommon.label.remove"; //$NON-NLS-1$ - private static final String UP = "BuildPropertyCommon.label.up"; //$NON-NLS-1$ - private static final String DOWN = "BuildPropertyCommon.label.down"; //$NON-NLS-1$ - private static final String EDIT = "BuildPropertyCommon.label.editVar"; //$NON-NLS-1$ - - // UI constants - private static final int VERTICAL_DIALOG_UNITS_PER_CHAR = 8; - private static final int HORIZONTAL_DIALOG_UNITS_PER_CHAR = 4; - private static final int LIST_HEIGHT_IN_CHARS = 10; - private static final int LIST_HEIGHT_IN_DLUS = - LIST_HEIGHT_IN_CHARS * VERTICAL_DIALOG_UNITS_PER_CHAR; - - // The top-level control for the field editor. - private Composite top; - // The list of tags. - private List list; - - // The group control for the list and button composite - private Group controlGroup; - - private String fieldName; - private SelectionListener selectionListener; - - // The button for adding the contents of the text field to the list - private Button addButton; - // The button for swapping the currently-selected list item down - private Button downButton; - // The button to start the edit process - private Button editButton; - // The button for removing the currently-selected list item. - private Button removeButton; - // The button for swapping the currently selected item up - private Button upButton; - - /** - * @param name the name of the preference this field editor works on - * @param labelText the label text of the field editor - * @param parent the parent of the field editor's control - */ - public BuildOptionListFieldEditor (String name, String labelText, Composite parent) { - super(name, labelText, parent); - this.fieldName = labelText; - } - - /* (non-Javadoc) - * Event handler for the addButton widget - */ - protected void addPressed() { - setPresentsDefaultValue(false); - // Prompt user for a new item - String input = getNewInputObject(); - - // Add it to the list - if (input != null && input.length() > 0) { - int index = list.getSelectionIndex(); - if (index >= 0) { - list.add(input, index + 1); - list.setSelection(index + 1); - } - else { - list.add(input, 0); - list.setSelection(0); - } - selectionChanged(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) - */ - protected void adjustForNumColumns(int numColumns) { - ((GridData)top.getLayoutData()).horizontalSpan = numColumns; - } - - /* (non-Javadoc) - * Creates the Add, Remove, Up, and Down button in the button composite. - * - * @param container the box for the buttons - */ - private void createButtons(Composite container) { - addButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(NEW)); - editButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(EDIT)); - removeButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(REMOVE)); - upButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(UP)); - downButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(DOWN)); - } - - /** - * @param items - * @return - */ - protected String createList(String[] items) { - return BuildToolsSettingsStore.createList(items); - } - - /* (non-Javadoc) - * Rather than using the ControlFactory helper methods, this field - * editor is using this helper method. Other field editors use a similar - * set of method calls, so this seems like the safest approach - * - * @param parent the button composite - * @param label the label to place in the button - * @return - */ - private Button createPushButton(Composite parent, String label) { - Button button = new Button(parent, SWT.PUSH); - button.setText(label); - button.setFont(parent.getFont()); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.heightHint = convertVerticalDLUsToPixels(button, IDialogConstants.BUTTON_HEIGHT); - int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH); - data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); - button.setLayoutData(data); - button.addSelectionListener(getSelectionListener()); - return button; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int) - */ - protected void doFillIntoGrid(Composite parent, int numColumns) { - top = parent; - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = numColumns; - top.setLayoutData(gd); - - controlGroup = ControlFactory.createGroup(top, getLabelText(), 2); - GridData groupData = new GridData(GridData.FILL_HORIZONTAL); - groupData.horizontalSpan = numColumns; - controlGroup.setLayoutData(groupData); - - // Make the list - list = new List(controlGroup, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - - // Create a grid data that takes up the extra space in the dialog and spans one column. - GridData listData = new GridData(GridData.FILL_HORIZONTAL); - listData.heightHint = - convertVerticalDLUsToPixels(list, LIST_HEIGHT_IN_DLUS); - listData.horizontalSpan = 1; - - list.setLayoutData(listData); - list.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - selectionChanged(); - } - }); - - list.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - list = null; - } - }); - list.addMouseListener(new MouseAdapter() { - public void mouseDoubleClick(MouseEvent e) { - // Popup the editor on the selected item from the list - editSelection(); - } - }); - - // Create a composite for the buttons - Composite buttonGroup = new Composite(controlGroup, SWT.NONE); - GridData buttonData = new GridData(); - buttonData.horizontalSpan = 1; - buttonData.verticalAlignment = GridData.BEGINNING; - buttonGroup.setLayoutData(buttonData); - - GridLayout buttonLayout = new GridLayout(); - buttonLayout.numColumns = 1; - buttonLayout.marginHeight = 0; - buttonLayout.marginWidth = 0; - buttonGroup.setLayout(buttonLayout); - - buttonGroup.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - addButton = null; - editButton = null; - removeButton = null; - upButton = null; - downButton = null; - } - }); - - // Create the buttons - createButtons(buttonGroup); - } - - /* (non-Javadoc) - * Creates a selection listener that handles the selection events - * for the button controls and single-click events in the list to - * trigger a selection change. - */ - public void createSelectionListener() { - selectionListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - Widget widget = event.widget; - if (widget == addButton) { - addPressed(); - } else if (widget == editButton) { - editPressed(); - } else if (widget == removeButton) { - removePressed(); - } else if (widget == upButton) { - upPressed(); - } else if (widget == downButton) { - downPressed(); - } else if (widget == list) { - selectionChanged(); - } - } - - }; - } - - - - /* (non-Javadoc) - * Event handler for the down button - */ - protected void downPressed() { - swap(false); - } - - private void editPressed() { - editSelection(); - } - - /* (non-Javadoc) - * - */ - protected void editSelection() { - // Edit the selection index - int index = list.getSelectionIndex(); - if (index != -1) { - String selItem = list.getItem(index); - if (selItem != null) { - InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, selItem, null); - String newItem = null; - if (dialog.open() == InputDialog.OK) { - newItem = dialog.getValue(); - if (newItem != null && !newItem.equals(selItem)) { - list.setItem(index, newItem); - selectionChanged(); - } - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doLoad() - */ - protected void doLoad() { - if (list != null) { - String s = getPreferenceStore().getString(getPreferenceName()); - String[] array = parseString(s); - for (int i = 0; i < array.length; i++){ - list.add(array[i]); - } - list.setSelection(0); - selectionChanged(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() - */ - protected void doLoadDefault() { - if (list != null) { - list.removeAll(); - String s = getPreferenceStore().getDefaultString(getPreferenceName()); - String[] array = parseString(s); - for (int i = 0; i < array.length; i++){ - list.add(array[i]); - } - list.setSelection(0); - selectionChanged(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doStore() - */ - protected void doStore() { - String s = createList(list.getItems()); - if (s != null) - getPreferenceStore().setValue(getPreferenceName(), s); - } - - protected String getNewInputObject() { - // Create a dialog to prompt for a new symbol or path - InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String(), null); - String input = new String(); - if (dialog.open() == InputDialog.OK) { - input = dialog.getValue(); - } - return input; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() - */ - public int getNumberOfControls() { - // The group control has a list and buttons so we want it to get at - // least 2 columns to display in. - return 2; - } - - /* (non-Javadoc) - * Returns this field editor's selection listener. - * The listener is created if nessessary. - * - * @return the selection listener - */ - private SelectionListener getSelectionListener() { - if (selectionListener == null) - createSelectionListener(); - return selectionListener; - } - - /* (non-Javadoc) - * Returns this field editor's shell. - * - * @return the shell - */ - protected Shell getShell() { - if (addButton == null) - return null; - return addButton.getShell(); - } - - /* (non-Javadoc) - * @param stringList - * @return - */ - protected String[] parseString(String stringList) { - return BuildToolsSettingsStore.parseString(stringList); - } - - /* (non-Javadoc) - * Event handler for the removeButton selected event - */ - protected void removePressed() { - // Remove the selected item from the list - setPresentsDefaultValue(false); - int index = list.getSelectionIndex(); - if (index >= 0) { - list.remove(index); - list.setSelection(index - 1); - selectionChanged(); - } - } - - /* (non-Javadoc) - * Clean up the list and button control states after the event - * handlers fire. - */ - protected void selectionChanged() { - int index = list.getSelectionIndex(); - int size = list.getItemCount(); - - // Enable the edit button if there is at least one item in the list - editButton.setEnabled(size > 0); - // Enable the remove button if there is at least one item in the list - removeButton.setEnabled(size > 0); - // Enable the up button IFF there is more than 1 item and selection index is not first item - upButton.setEnabled(size > 1 && index > 0); - // Enable the down button IFF there is more than 1 item and selection index not last item - downButton.setEnabled(size > 1 && index >= 0 && index < size - 1); - } - - /* (non-Javadoc) - * Swaps the location of two list elements. If the argument is true - * the list item is swapped with the item preceeding it in the list. Otherwise - * it is swapped with the item following it. - * - * @param moveUp - */ - private void swap(boolean moveUp) { - setPresentsDefaultValue(false); - int index = list.getSelectionIndex(); - int target = moveUp ? index - 1 : index + 1; - - if (index >= 0) { - String[] selection = list.getSelection(); - Assert.isTrue(selection.length == 1); - list.remove(index); - list.add(selection[0], target); - list.setSelection(target); - } - selectionChanged(); - } - - /* (non-Javadoc) - * Event handler for the up button. It simply swaps the selected - * item with the list item above it. - */ - protected void upPressed() { - swap(true); - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java deleted file mode 100644 index b317069dc04..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java +++ /dev/null @@ -1,619 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -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 java.util.Random; -import java.util.Set; -import java.util.SortedMap; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.preference.IPreferencePageContainer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Layout; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchPropertyPage; -import org.eclipse.ui.dialogs.PropertyPage; - -public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropertyPage, IPreferencePageContainer { - /* - * String constants - */ - private static final String PREFIX = "BuildPropertyPage"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String NAME_LABEL = LABEL + ".NameText"; //$NON-NLS-1$ - private static final String BUILD_TOOLS_LABEL = LABEL + ".BuildToolTree"; //$NON-NLS-1$ - private static final String PLATFORM_LABEL = LABEL + ".Platform"; //$NON-NLS-1$ - private static final String CONFIG_LABEL = LABEL + ".Configuration"; //$NON-NLS-1$ - private static final String ACTIVE_LABEL = LABEL + ".Active"; //$NON-NLS-1$ - private static final String SETTINGS_LABEL = LABEL + ".Settings"; //$NON-NLS-1$ - private static final String TREE_LABEL = LABEL + ".ToolTree"; //$NON-NLS-1$ - private static final String OPTIONS_LABEL = LABEL + ".ToolOptions"; //$NON-NLS-1$ - private static final String ADD_CONF = LABEL + ".AddConfButton"; //$NON-NLS-1$ - private static final String TIP = PREFIX + ".tip"; //$NON-NLS-1$ - private static final String PLAT_TIP = TIP + ".platform"; //$NON-NLS-1$ - private static final String CONF_TIP = TIP + ".config"; //$NON-NLS-1$ - private static final String ADD_TIP = TIP + ".addconf"; //$NON-NLS-1$ - private static final String MANAGE_TITLE = PREFIX + ".manage.title"; //$NON-NLS-1$ - private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 20, 30 }; - - /* - * Dialog widgets - */ - private Combo targetSelector; - private Combo configSelector; - private Button manageConfigs; - private TreeViewer optionList; - private SashForm sashForm; - private Group sashGroup; - private Composite settingsPageContainer; - private ScrolledComposite containerSC; - - /* - * Bookeeping variables - */ - private ITarget [] targets; - private ITarget selectedTarget; - private IConfiguration [] configurations; - private IConfiguration selectedConfiguration; - private BuildToolSettingsPage currentSettingsPage; - private Map configToPageListMap; - private BuildToolsSettingsStore settingsStore; - private IOptionCategory selectedCategory; - private Point lastShellSize; - - /** - * The minimum page size; 200 by 200 by default. - * - * @see #setMinimumPageSize - */ - private Point minimumPageSize = new Point(200, 200); - - /** - * Layout for the page container. - * - */ - private class PageLayout extends Layout { - public void layout(Composite composite, boolean force) { - Rectangle rect = composite.getClientArea(); - Control[] children = composite.getChildren(); - for (int i = 0; i < children.length; i++) { - children[i].setSize(rect.width, rect.height); - } - } - public Point computeSize(Composite composite, int wHint, int hHint, boolean force) { - if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) { - return new Point(wHint, hHint); - } - int x = minimumPageSize.x; - int y = minimumPageSize.y; - - Control[] children = composite.getChildren(); - for (int i = 0; i < children.length; i++) { - Point size = children[i].computeSize(SWT.DEFAULT, SWT.DEFAULT, force); - x = Math.max(x, size.x); - y = Math.max(y, size.y); - } - if (wHint != SWT.DEFAULT) { - x = wHint; - } - if (hHint != SWT.DEFAULT) { - y = hHint; - } - return new Point(x, y); - } - } - - /** - * Default constructor - */ - public BuildPropertyPage() { - configToPageListMap = new HashMap(); - } - - protected Control createContents(Composite parent) { - // Initialize the key data - targets = ManagedBuildManager.getTargets(getProject()); - - // Create the container we return to the property page editor - Composite composite = ControlFactory.createComposite(parent, 1); - GridData gd; - - // Add a config selection area - Group configGroup = ControlFactory.createGroup(composite, ManagedBuilderUIPlugin.getResourceString(ACTIVE_LABEL), 1); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.grabExcessHorizontalSpace = true; - configGroup.setLayoutData(gd); - // Use the form layout inside the group composite - FormLayout form = new FormLayout(); - form.marginHeight = 5; - form.marginWidth = 5; - configGroup.setLayout(form); - - Label platformLabel = ControlFactory.createLabel(configGroup, ManagedBuilderUIPlugin.getResourceString(PLATFORM_LABEL)); - targetSelector = ControlFactory.createSelectCombo(configGroup, getPlatformNames(), null); - targetSelector.addListener(SWT.Selection, new Listener () { - public void handleEvent(Event e) { - handleTargetSelection(); - } - }); - targetSelector.setToolTipText(ManagedBuilderUIPlugin.getResourceString(PLAT_TIP)); - Label configLabel = ControlFactory.createLabel(configGroup, ManagedBuilderUIPlugin.getResourceString(CONFIG_LABEL)); - configSelector = new Combo(configGroup, SWT.READ_ONLY|SWT.DROP_DOWN); - configSelector.addListener(SWT.Selection, new Listener () { - public void handleEvent(Event e) { - handleConfigSelection(); - } - }); - configSelector.setToolTipText(ManagedBuilderUIPlugin.getResourceString(CONF_TIP)); - manageConfigs = ControlFactory.createPushButton(configGroup, ManagedBuilderUIPlugin.getResourceString(ADD_CONF)); - manageConfigs.setToolTipText(ManagedBuilderUIPlugin.getResourceString(ADD_TIP)); - manageConfigs.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleManageConfig(); - } - }); - // Now do the form layout for the widgets - FormData fd = new FormData(); - // Anchor the labels in the centre of their respective combos - fd.top = new FormAttachment(targetSelector, 0, SWT.CENTER); - platformLabel.setLayoutData(fd); - fd = new FormData(); - fd.top = new FormAttachment(configSelector, 0, SWT.CENTER); - configLabel.setLayoutData(fd); - // Anchor platform combo left to the config selector - fd = new FormData(); - fd.left = new FormAttachment(configSelector, 0, SWT.LEFT); - fd.right = new FormAttachment(100, 0); - targetSelector.setLayoutData(fd); - // Anchor button right to combo and left to group - fd = new FormData(); - fd.top = new FormAttachment(configSelector, 0, SWT.CENTER); - fd.right = new FormAttachment(100,0); - manageConfigs.setLayoutData(fd); - // Anchor config combo left 5 pixels from label, top 5% below the centre, and right to the button - fd = new FormData(); - fd.left = new FormAttachment(configLabel, 5); - fd.top = new FormAttachment(55,0); - fd.right = new FormAttachment(manageConfigs, -5 , SWT.LEFT); - configSelector.setLayoutData(fd); - - // Create the sash form - sashGroup = ControlFactory.createGroup(composite, ManagedBuilderUIPlugin.getResourceString(SETTINGS_LABEL), 1); - sashGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); - sashForm = new SashForm(sashGroup, SWT.NONE); - sashForm.setOrientation(SWT.HORIZONTAL); - sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 5; - layout.marginWidth = 5; - sashForm.setLayout(layout); - - createSelectionArea(sashForm); - createEditArea(sashForm); - initializeSashForm(); - - // Do not call this until the widgets are constructed - handleTargetSelection(); - return composite; - } - - /* (non-Javadoc) - * Add the tabs relevant to the project to edit area tab folder. - */ - protected void createEditArea(Composite parent) { - containerSC = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); - containerSC.setExpandHorizontal(true); - containerSC.setExpandVertical(true); - - // Add a container for the build settings page - settingsPageContainer = new Composite(containerSC, SWT.NULL); - settingsPageContainer.setLayout(new PageLayout()); - - containerSC.setContent(settingsPageContainer); - containerSC.setMinSize(settingsPageContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT)); - settingsPageContainer.layout(); - } - - protected void createSelectionArea (Composite parent) { - // Create a label and list viewer - Composite composite = ControlFactory.createComposite(parent, 1); - optionList = new TreeViewer(composite, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER); - optionList.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - handleOptionSelection(); - } - }); - optionList.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); - optionList.setLabelProvider(new ToolListLabelProvider()); - } - - /** - * Method displayOptionsForTool. - * @param toolReference - */ - private void displayOptionsForCategory(IOptionCategory category) { - // Do nothing if the selected category is is unchanged - if (category == selectedCategory) { - return; - } - selectedCategory = category; - - // Cache the current build setting page - BuildToolSettingsPage oldPage = currentSettingsPage; - currentSettingsPage = null; - - // Create a new settings page if necessary - List pages = getPagesForConfig(); - ListIterator iter = pages.listIterator(); - while (iter.hasNext()) { - BuildToolSettingsPage page = (BuildToolSettingsPage) iter.next(); - if (page.getCategory().equals(category)) { - currentSettingsPage = page; - break; - } - } - if (currentSettingsPage == null) { - currentSettingsPage = new BuildToolSettingsPage(selectedConfiguration, category); - pages.add(currentSettingsPage); - currentSettingsPage.setContainer(this); - if (currentSettingsPage.getControl() == null) { - currentSettingsPage.createControl(settingsPageContainer); - } - } - - // Make all the other pages invisible - Control[] children = settingsPageContainer.getChildren(); - Control currentControl = currentSettingsPage.getControl(); - for (int i = 0; i < children.length; i++) { - if (children[i] != currentControl) - children[i].setVisible(false); - } - currentSettingsPage.setVisible(true); - if (oldPage != null) - oldPage.setVisible(false); - - // Set the size of the scrolled area - containerSC.setMinSize(currentSettingsPage.computeSize()); - settingsPageContainer.layout(); - } - - /* (non-Javadoc) - * @return an array of names for the configurations defined for the chosen target - */ - private String [] getConfigurationNames () { - String [] names = new String[configurations.length]; - for (int index = 0; index < configurations.length; ++index) { - names[index] = configurations[index].getName(); - } - return names; - } - - /** - * @return - */ - protected Point getLastShellSize() { - if (lastShellSize == null) { - Shell shell = getShell(); - if (shell != null) - lastShellSize = shell.getSize(); - } - return lastShellSize; - } - - private List getPagesForConfig() { - List pages = (List) configToPageListMap.get(selectedConfiguration.getId()); - if (pages == null) { - pages = new ArrayList(); - configToPageListMap.put(selectedConfiguration.getId(), pages); - } - return pages; - } - - private String [] getPlatformNames() { - String [] names = new String[targets.length]; - for (int index = 0; index < targets.length; ++index) { - names[index] = targets[index].getName(); - } - return names; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePageContainer#getPreferenceStore() - */ - public IPreferenceStore getPreferenceStore() - { - return settingsStore; - } - - private IProject getProject() { - Object element= getElement(); - if (element != null && element instanceof IProject) { - return (IProject)element; - } - return null; - } - - /** - * @return - */ - public IConfiguration getSelectedConfiguration() { - return selectedConfiguration; - } - - /* - * Event Handlers - */ - private void handleConfigSelection () { - // If there is nothing in config selection widget just bail - if (configSelector.getItemCount() == 0) return; - - // Cache the selected config - selectedConfiguration = configurations[configSelector.getSelectionIndex()]; - - // Set the content provider for the list viewer - ToolListContentProvider provider = new ToolListContentProvider(); - optionList.setContentProvider(provider); - optionList.setInput(selectedConfiguration); - optionList.expandAll(); - - // Recreate the settings store for the configuration - settingsStore = new BuildToolsSettingsStore(selectedConfiguration); - - // Select the first tool or option category in the list that has options - Object[] elements = provider.getElements(selectedConfiguration); - Object primary = elements.length > 0 ? elements[0] : null; - - if (primary != null && primary instanceof ITool) { - // Check to see if there are any options. - ITool tool = (ITool)primary; - IOptionCategory top = tool.getTopOptionCategory(); - IOption[] topOpts = top.getOptions(selectedConfiguration); - if (topOpts != null && topOpts.length == 0) { - // Get the children categories and start looking - IOptionCategory[] children = top.getChildCategories(); - for (int i = 0; i < children.length; i++) { - IOptionCategory category = children[i]; - IOption[] catOpts = category.getOptions(selectedConfiguration); - if (catOpts != null && catOpts.length > 0) { - primary = category; - break; - } - } - } - } - - if (primary != null) { - optionList.setSelection(new StructuredSelection(primary)); - } - } - - // Event handler for the manage configuration button event - private void handleManageConfig () { - ManageConfigDialog manageDialog = new ManageConfigDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(MANAGE_TITLE), selectedTarget); - if (manageDialog.open() == ManageConfigDialog.OK) { - boolean updateConfigs = false; - - // Get the build output name - String newBuildOutput = manageDialog.getBuildArtifactName(); - if (!selectedTarget.getArtifactName().equals(newBuildOutput)) { - selectedTarget.setBuildArtifact(newBuildOutput); - } - - // Get the new make command - if (manageDialog.useDefaultMakeCommand()) { - // This is a cheap assignment to null so do it to be doubly sure - selectedTarget.resetMakeCommand(); - } else { - String makeCommand = manageDialog.getMakeCommand(); - selectedTarget.setMakeCommand(makeCommand); - } - - // Check to see if any configurations have to be deleted - List deletedConfigs = manageDialog.getDeletedConfigIds(); - Iterator iter = deletedConfigs.listIterator(); - while (iter.hasNext()) { - String id = (String)iter.next(); - - // Remove the configurations from the target - selectedTarget.removeConfiguration(id); - - // Clean up the UI - configurations = selectedTarget.getConfigurations(); - configSelector.removeAll(); - configSelector.setItems(getConfigurationNames()); - configSelector.select(0); - updateConfigs = true; - } - - // Check to see if any have to be added - SortedMap newConfigs = manageDialog.getNewConfigs(); - Set keys = newConfigs.keySet(); - Iterator keyIter = keys.iterator(); - Random r = new Random(); - r.setSeed(System.currentTimeMillis()); - while (keyIter.hasNext()) { - String name = (String) keyIter.next(); - IConfiguration parent = (IConfiguration) newConfigs.get(name); - if (parent != null) { - int id = r.nextInt(); - if (id < 0) { - id *= -1; - } - String newId = parent.getId() + "." + id; - IConfiguration newConfig = selectedTarget.createConfiguration(parent, newId); - newConfig.setName(name); - // Update the config lists - configurations = selectedTarget.getConfigurations(); - configSelector.removeAll(); - configSelector.setItems(getConfigurationNames()); - configSelector.select(configSelector.indexOf(name)); - updateConfigs = true; - } - } - if (updateConfigs){ - handleConfigSelection(); - } - } - return; - } - - private void handleOptionSelection() { - // Get the selection from the tree list - IStructuredSelection selection = (IStructuredSelection) optionList.getSelection(); - - // Set the option page based on the selection - Object element = selection.getFirstElement(); - if (element instanceof IOptionCategory) { - displayOptionsForCategory((IOptionCategory)element); - } - } - - private void handleTargetSelection() { - // Is there anything in the selector widget - if (targetSelector.getItemCount() == 0) { - manageConfigs.setEnabled(false); - return; - } - - // Enable the manage button - manageConfigs.setEnabled(true); - - // Cache the platform at the selection index - selectedTarget = targets[targetSelector.getSelectionIndex()]; - - // Update the contents of the configuration widget - populateConfigurations(); - } - - /* - * (non-javadoc) - * Initialize the relative weights (widths) of the 2 sides of the sash. - */ - protected void initializeSashForm() { - sashForm.setWeights(DEFAULT_SASH_WEIGHTS); - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() { - // Empty the page list - List pages = getPagesForConfig(); - pages.clear(); - - // Get the build manager to reset build info for project - ManagedBuildManager.resetConfiguration(getProject(), getSelectedConfiguration()); - - // Recreate the settings store for the configuration - settingsStore = new BuildToolsSettingsStore(getSelectedConfiguration()); - - // Reset the category selection and run selection event handler - selectedCategory = null; - handleOptionSelection(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - // Force each settings page to update - List pages = getPagesForConfig(); - ListIterator iter = pages.listIterator(); - while (iter.hasNext()) { - BuildToolSettingsPage page = (BuildToolSettingsPage) iter.next(); - page.performOk(); - } - - // Write out the build model info - ManagedBuildManager.setDefaultConfiguration(getProject(), getSelectedConfiguration()); - ManagedBuildManager.saveBuildInfo(getProject()); - return true; - } - - private void populateConfigurations() { - // If the config select widget is not there yet, just stop - if (configSelector == null) return; - - // Find the configurations defined for the platform - configurations = selectedTarget.getConfigurations(); - - // Clear and replace the contents of the selector widget - configSelector.removeAll(); - configSelector.setItems(getConfigurationNames()); - - // Make sure the active configuration is selected - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject()); - IConfiguration defaultConfig = info.getDefaultConfiguration(selectedTarget); - int index = configSelector.indexOf(defaultConfig.getName()); - configSelector.select(index == -1 ? 0 : index); - handleConfigSelection(); - } - - /** - * @see org.eclipse.jface.preference.IPreferencePageContainer#updateButtons() - */ - public void updateButtons() { - } - /** - * @see org.eclipse.jface.preference.IPreferencePageContainer#updateMessage() - */ - public void updateMessage() { - } - /** - * @see org.eclipse.jface.preference.IPreferencePageContainer#updateTitle() - */ - public void updateTitle() { - } -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java deleted file mode 100644 index a61611ce11c..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.graphics.Point; - -public class BuildToolSettingsPage extends FieldEditorPreferencePage { - - // Variables to help map this page back to an option category and tool - private IConfiguration configuration; - private IOptionCategory category; - - BuildToolSettingsPage(IConfiguration configuration, IOptionCategory category) { - // Must be a grid layout and we don't want another set of buttons - super(GRID); - noDefaultAndApplyButton(); - - // Cache the option category this page is created for - this.configuration = configuration; - this.category = category; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#computeSize() - */ - public Point computeSize() { - // TODO Auto-generated method stub - return super.computeSize(); - } - - /** - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() { - // Get the preference store for the build settings - IPreferenceStore settings = getPreferenceStore(); - setPreferenceStore(settings); - - // Iterate over the options in the category and create a field editor for each - IOption[] options = category.getOptions(configuration); - for (int index = 0; index < options.length; ++index) { - // Get the option - IOption opt = options[index]; - // Figure out which type the option is and add a proper field editor for it - switch (opt.getValueType()) { - case IOption.STRING : - StringFieldEditor stringField = new StringFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent()); - addField(stringField); - break; - case IOption.BOOLEAN : - BooleanFieldEditor booleanField = new BooleanFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent()); - addField(booleanField); - break; - case IOption.ENUMERATED : - String sel; - try { - sel = opt.getSelectedEnum(); - } catch (BuildException e) { - // If we get this exception, then the option type is wrong - break; - } - BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(opt.getId(), opt.getName(), opt.getApplicableValues(), sel, getFieldEditorParent()); - addField(comboField); - break; - case IOption.STRING_LIST : - case IOption.INCLUDE_PATH : - case IOption.PREPROCESSOR_SYMBOLS : - case IOption.LIBRARIES : - case IOption.OBJECTS: - BuildOptionListFieldEditor listField = new BuildOptionListFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent()); - addField(listField); - break; - default : - SummaryFieldEditor summaryField = new SummaryFieldEditor(opt.getId(), opt.getName(), category.getTool(), getFieldEditorParent()); - addField(summaryField); - break; -// default : -// break; - } - } - } - - /** - * @return the option category the page was created for - */ - public IOptionCategory getCategory() { - return category; - } - - /** - * @see IPreferencePage#performOk() - */ - public boolean performOk() { - // Write the field editor contents out to the preference store - boolean ok = super.performOk(); - - // Write the preference store values back to the build model - IOption[] options = category.getOptions(configuration); - for (int i = 0; i < options.length; i++) { - IOption option = options[i]; - - // Transfer value from preference store to options - switch (option.getValueType()) { - case IOption.BOOLEAN : - boolean boolVal = getPreferenceStore().getBoolean(option.getId()); - ManagedBuildManager.setOption(configuration, option, boolVal); - break; - case IOption.ENUMERATED : - String enumVal = getPreferenceStore().getString(option.getId()); - ManagedBuildManager.setOption(configuration, option, enumVal); - break; - case IOption.STRING : - String strVal = getPreferenceStore().getString(option.getId()); - ManagedBuildManager.setOption(configuration, option, strVal); - break; - case IOption.STRING_LIST : - case IOption.INCLUDE_PATH : - case IOption.PREPROCESSOR_SYMBOLS : - case IOption.LIBRARIES : - case IOption.OBJECTS: - String listStr = getPreferenceStore().getString(option.getId()); - String[] listVal = BuildToolsSettingsStore.parseString(listStr); - ManagedBuildManager.setOption(configuration, option, listVal); - break; - default : - break; - } - } - - return ok; - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java deleted file mode 100644 index ab25886350b..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java +++ /dev/null @@ -1,441 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.ListenerList; -import org.eclipse.jface.util.PropertyChangeEvent; - -public class BuildToolsSettingsStore implements IPreferenceStore { - public static final String DEFAULT_SEPERATOR = ";"; - - // List of listeners on the property store - private ListenerList listenerList; - private Map optionMap; - private boolean dirtyFlag; - private IConfiguration owner; - - public BuildToolsSettingsStore (IConfiguration config) { - listenerList = new ListenerList(); - dirtyFlag = false; - owner = config; - - // Now populate the options map - populateOptionMap(); - } - - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) - */ - public void addPropertyChangeListener(IPropertyChangeListener listener) { - listenerList.add(listener); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#contains(java.lang.String) - */ - public boolean contains(String name) { - return getOptionMap().containsKey(name); - } - - /** - * Answers a String containing the strings passed in the - * argument separated by the DEFAULT_SEPERATOR - * - * @param items An array of strings - * @return - */ - public static String createList(String[] items) { - StringBuffer path = new StringBuffer(""); //$NON-NLS-1$ - - for (int i = 0; i < items.length; i++) { - path.append(items[i]); - if (i < (items.length - 1)) { - path.append(DEFAULT_SEPERATOR); - } - } - return path.toString(); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#firePropertyChangeEvent(java.lang.String, java.lang.Object, java.lang.Object) - */ - public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { - Object[] listeners = listenerList.getListeners(); - if (listeners.length > 0 && (oldValue == null || !oldValue.equals(newValue))) - { - PropertyChangeEvent pe = new PropertyChangeEvent(this, name, oldValue, newValue); - for (int i = 0; i < listeners.length; ++i) - { - IPropertyChangeListener l = (IPropertyChangeListener)listeners[i]; - l.propertyChange( pe ); - } - } - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getBoolean(java.lang.String) - */ - public boolean getBoolean(String name) { - Object b = getOptionMap().get(name); - if (b instanceof Boolean) - { - return ((Boolean)b).booleanValue(); - } - return false; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultBoolean(java.lang.String) - */ - public boolean getDefaultBoolean(String name) { - return false; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultDouble(java.lang.String) - */ - public double getDefaultDouble(String name) { - return 0; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultFloat(java.lang.String) - */ - public float getDefaultFloat(String name) { - return 0; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultInt(java.lang.String) - */ - public int getDefaultInt(String name) { - return 0; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultLong(java.lang.String) - */ - public long getDefaultLong(String name) { - return 0; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultString(java.lang.String) - */ - public String getDefaultString(String name) { - return new String(); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getDouble(java.lang.String) - */ - public double getDouble(String name) { - return getDefaultDouble(name); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getFloat(java.lang.String) - */ - public float getFloat(String name) { - return getDefaultFloat(name); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getInt(java.lang.String) - */ - public int getInt(String name) { - return getDefaultInt(name); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getLong(java.lang.String) - */ - public long getLong(String name) { - return getDefaultLong(name); - } - - /* (non-javadoc) - * Answers the map containing the strings associated with each option - * ID. - * - * @return - */ - private Map getOptionMap() { - if (optionMap == null) { - optionMap = new HashMap(); - } - return optionMap; - } - - private void getOptionsForCategory(IOptionCategory cat) { - IOptionCategory [] children = cat.getChildCategories(); - // If there are child categories, add their options - for (int i = 0; i < children.length; ++i) { - getOptionsForCategory(children[i]); - } - // Else get the options for this category and add them to the map - IOption [] options = cat.getOptions(owner); - for (int j = 0; j < options.length; ++j) { - IOption opt = options[j]; - String name = opt.getId(); - Object value; - // Switch on the type of option - switch (opt.getValueType()) { - case IOption.BOOLEAN : - try { - value = new Boolean(opt.getBooleanValue()); - } catch (BuildException e) { - // Exception occurs if there's an option value type mismatch - break; - } - getOptionMap().put(name, value); - break; - - case IOption.ENUMERATED : - value = createList(opt.getApplicableValues()); - getOptionMap().put(name, value); - break; - - case IOption.STRING : - try { - value = opt.getStringValue(); - } catch (BuildException e) { - break; - } - getOptionMap().put(name, value); - break; - - case IOption.STRING_LIST : - try { - value = createList(opt.getStringListValue()); - } catch (BuildException e) { - break; - } - getOptionMap().put(name, value); - break; - case IOption.INCLUDE_PATH : - try { - value = createList(opt.getIncludePaths()); - } catch (BuildException e) { - break; - } - getOptionMap().put(name, value); - break; - case IOption.PREPROCESSOR_SYMBOLS : - try { - value = createList(opt.getDefinedSymbols()); - } catch (BuildException e) { - break; - } - getOptionMap().put(name, value); - break; - case IOption.LIBRARIES : - try { - value = createList(opt.getLibraries()); - } catch (BuildException e) { - break; - } - getOptionMap().put(name, value); - break; - case IOption.OBJECTS : - try { - value = createList(opt.getUserObjects()); - } catch (BuildException e) { - break; - } - getOptionMap().put(name, value); - break; - default : - break; - } - } - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#getString(java.lang.String) - */ - public String getString(String name) { - Object s = getOptionMap().get(name); - - if ( s instanceof String ) - { - return (String)s; - } - return getDefaultString(name); - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#isDefault(java.lang.String) - */ - public boolean isDefault(String name) { - return false; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#needsSaving() - */ - public boolean needsSaving() { - return dirtyFlag; - } - - public static String[] parseString(String stringList) { - StringTokenizer tokenizer = new StringTokenizer(stringList, BuildToolsSettingsStore.DEFAULT_SEPERATOR); - ArrayList list = new ArrayList(); - while (tokenizer.hasMoreElements()) { - list.add(tokenizer.nextElement()); - } - return (String[]) list.toArray(new String[list.size()]); - } - - /** - * - */ - private void populateOptionMap() { - // Each configuration has a list of tools - ITool [] tools = owner.getTools(); - for (int index = 0; index < tools.length; ++index) { - ITool tool = tools[index]; - IOptionCategory cat = tool.getTopOptionCategory(); - getOptionsForCategory(cat); - } - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#putValue(java.lang.String, java.lang.String) - */ - public void putValue(String name, String value) { - Object oldValue = getOptionMap().get(name); - if (oldValue == null || !oldValue.equals(value)) - { - getOptionMap().put(name, value); - setDirty(true); - } - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) - */ - public void removePropertyChangeListener(IPropertyChangeListener listener) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, double) - */ - public void setDefault(String name, double value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, float) - */ - public void setDefault(String name, float value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, int) - */ - public void setDefault(String name, int value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, long) - */ - public void setDefault(String name, long value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, java.lang.String) - */ - public void setDefault(String name, String defaultObject) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, boolean) - */ - public void setDefault(String name, boolean value) { - } - - protected void setDirty( boolean isDirty ) - { - dirtyFlag = isDirty; - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setToDefault(java.lang.String) - */ - public void setToDefault(String name) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, double) - */ - public void setValue(String name, double value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, float) - */ - public void setValue(String name, float value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, int) - */ - public void setValue(String name, int value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, long) - */ - public void setValue(String name, long value) { - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, java.lang.String) - */ - public void setValue(String name, String value) { - Object oldValue = getString(name); - if (oldValue == null || !oldValue.equals(value)) - { - getOptionMap().put(name, value); - setDirty(true); - firePropertyChangeEvent(name, oldValue, value); - } - } - - /** - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, boolean) - */ - public void setValue(String name, boolean value) { - boolean oldValue = getBoolean(name); - if (oldValue != value) - { - getOptionMap().put(name, new Boolean(value)); - setDirty(true); - firePropertyChangeEvent(name, new Boolean(oldValue), new Boolean(value)); - } - - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java deleted file mode 100644 index ddad7215c23..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java +++ /dev/null @@ -1,466 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.ArrayList; -import java.util.SortedMap; -import java.util.TreeMap; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class ManageConfigDialog extends Dialog { - // String constants - private static final String CMN_PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$ - private static final String CMN_LABEL = CMN_PREFIX + ".label"; //$NON-NLS-1$ - private static final String NEW = CMN_LABEL + ".new"; //$NON-NLS-1$ - private static final String REMOVE = CMN_LABEL + ".remove"; //$NON-NLS-1$ - private static final String PREFIX = "ManageConfig"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String RESTORE = LABEL + ".restore"; //$NON-NLS-1$ - private static final String GROUP = LABEL + ".makecmdgroup"; //$NON-NLS-1$ - private static final String DEF_BTN = LABEL + ".makecmddef"; //$NON-NLS-1$ - private static final String OUTPUT_GROUP = LABEL + ".output.group"; //$NON-NLS-1$ - private static final String OUTPUT_LABEL = LABEL + ".output.label"; //$NON-NLS-1$ - private static final String CONFIGS = LABEL + ".configs"; //$NON-NLS-1$ - private static final String CURRENT_CONFIGS = CONFIGS + ".current"; //$NON-NLS-1$ - private static final String DELETED_CONFIGS = CONFIGS + ".deleted"; //$NON-NLS-1$ - private static final String CONF_DLG = LABEL + ".new.config.dialog"; //$NON-NLS-1$ - - // The name of the build artifact - private String buildArtifact; - // The list of configurations to delete - private SortedMap deletedConfigs; - // Map of configuration names and ids - private SortedMap existingConfigs; - // The make command associated with the target - private String makeCommand; - // The target the configs belong to - private ITarget managedTarget; - // Map of new configurations chosen by the user - private SortedMap newConfigs; - // The title of the dialog. - private String title = ""; - // State of the check box on exit - private boolean useDefaultMake; - - // Widgets - protected Text buildArtifactEntry; - protected List currentConfigList; - protected List deletedConfigList; - protected Button makeCommandDefault; - protected Text makeCommandEntry; - protected Button newBtn; - protected Button okBtn; - protected Button removeBtn; - protected Button restoreBtn; - - /** - * @param parentShell - */ - protected ManageConfigDialog(Shell parentShell, String title, ITarget target) { - super(parentShell); - this.title = title; - this.managedTarget = target; - - // Figure out the default make command - makeCommand = managedTarget.getMakeCommand(); - - // Get the name of the build artifact - buildArtifact = managedTarget.getArtifactName(); - - // Get the defined configurations from the target - getExistingConfigs().clear(); - IConfiguration [] configs = managedTarget.getConfigurations(); - for (int i = 0; i < configs.length; i++) { - IConfiguration configuration = configs[i]; - getExistingConfigs().put(configuration.getName(), configuration.getId()); - } - - getDeletedConfigs().clear(); - getNewConfigs().clear(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) - */ - protected void buttonPressed(int buttonId) { - if (buttonId == IDialogConstants.OK_ID) { - useDefaultMake = makeCommandDefault.getSelection(); - makeCommand = makeCommandEntry.getText().trim(); - buildArtifact = buildArtifactEntry.getText().trim(); - } else { - useDefaultMake = true; - buildArtifact = managedTarget.getArtifactName(); - } - super.buttonPressed(buttonId); - } - - /* (non-Javadoc) - * Method declared in Window. - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (title != null) - shell.setText(title); - } - - protected void createButtonsForButtonBar(Composite parent) { - // create OK and Cancel buttons by default - okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - - updateButtons(); - } - - protected Control createDialogArea(Composite parent) { - Composite comp = ControlFactory.createComposite(parent, 1); - - // Create a group for the build output - Group outputGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(OUTPUT_GROUP), 1); - outputGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); - Label outputLabel = ControlFactory.createLabel(outputGroup, ManagedBuilderUIPlugin.getResourceString(OUTPUT_LABEL)); - outputLabel.setLayoutData(new GridData()); - buildArtifactEntry = ControlFactory.createTextField(outputGroup); - buildArtifactEntry.setText(buildArtifact); - buildArtifactEntry.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - buildArtifactEntry = null; - } - }); - - // Create the make command group area - Group makeCommandGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(GROUP), 1); - GridData gd = new GridData(GridData.FILL_BOTH); - makeCommandGroup.setLayoutData(gd); - makeCommandDefault = ControlFactory.createCheckBox(makeCommandGroup, ManagedBuilderUIPlugin.getResourceString(DEF_BTN)); - setButtonLayoutData(makeCommandDefault); - makeCommandDefault.setSelection(!managedTarget.hasOverridenMakeCommand()); - makeCommandDefault.addSelectionListener(new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - handleUseDefaultPressed(); - } - }); - makeCommandDefault.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - makeCommandDefault = null; - } - }); - makeCommandEntry = ControlFactory.createTextField(makeCommandGroup); - makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); - makeCommandEntry.setText(makeCommand); - makeCommandEntry.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - makeCommandEntry = null; - } - }); - - - // Create the config list group area - Group configListGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(CONFIGS), 3); - gd = new GridData(GridData.FILL_BOTH); - configListGroup.setLayoutData(gd); - - // Create the 2 labels first to align the buttons and list controls - Label currentConfigLabel = ControlFactory.createLabel(configListGroup, ManagedBuilderUIPlugin.getResourceString(CURRENT_CONFIGS)); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - currentConfigLabel.setLayoutData(gd); - Label deletedConfigLabel = ControlFactory.createLabel(configListGroup, ManagedBuilderUIPlugin.getResourceString(DELETED_CONFIGS)); - deletedConfigLabel.setLayoutData(new GridData()); - - // Create the current config list - Composite currentComp = ControlFactory.createComposite(configListGroup, 1); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 1; - currentComp.setLayoutData(gd); - currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); - gd = new GridData(GridData.FILL_BOTH); - gd.widthHint = 100; - currentConfigList.setLayoutData(gd); - currentConfigList.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - currentConfigList = null; - } - }); - - // Create a composite for the buttons - Composite buttonBar = ControlFactory.createComposite(configListGroup, 1); - buttonBar.setLayoutData(new GridData()); - - newBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(NEW)); - setButtonLayoutData(newBtn); - newBtn.addSelectionListener(new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - handleNewPressed(); - } - }); - newBtn.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - newBtn = null; - } - }); - removeBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(REMOVE)); - setButtonLayoutData(removeBtn); - removeBtn.addSelectionListener(new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - handleRemovePressed(); - } - }); - removeBtn.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - removeBtn = null; - } - }); - restoreBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(RESTORE)); - setButtonLayoutData(restoreBtn); - restoreBtn.addSelectionListener(new SelectionAdapter () { - public void widgetSelected(SelectionEvent e) { - handleRestorePressed(); - } - }); - restoreBtn.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - restoreBtn = null; - } - }); - - // Create the deleted config list - Composite deletedComp = ControlFactory.createComposite(configListGroup, 1); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 1; - deletedComp.setLayoutData(gd); - deletedConfigList = new List(deletedComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); - gd = new GridData(GridData.FILL_BOTH); - gd.widthHint = 100; - deletedConfigList.setLayoutData(gd); - deletedConfigList.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - deletedConfigList = null; - } - }); - - // Do the final widget prep - currentConfigList.setItems(getConfigurationNames()); - currentConfigList.select(0); - newBtn.setFocus(); - return comp; - } - - /** - * - */ - protected void handleUseDefaultPressed() { - // If the state of the button is unchecked, then we want to enable the edit widget - makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); - } - - /** - * Answers the value in the build artifact entry widget. - * - * @return - */ - public String getBuildArtifactName() { - return buildArtifact; - } - - private String [] getConfigurationNames() { - return (String[]) getExistingConfigs().keySet().toArray(new String[getExistingConfigs().size()]); - } - - /* (non-javadoc) - * Answers a SortedMap of IConfiguration names to unique IDs. - * - * @return - */ - protected SortedMap getDeletedConfigs() { - if (deletedConfigs == null) { - deletedConfigs = new TreeMap(); - } - return deletedConfigs; - } - - /** - * Answers a List of unique IDs corresponding to the IConfigurations - * the user wishes to remove from the ITarget - * @return - */ - public ArrayList getDeletedConfigIds() { - return new ArrayList(getDeletedConfigs().values()); - } - - protected SortedMap getExistingConfigs() { - if (existingConfigs == null) { - existingConfigs = new TreeMap(); - } - return existingConfigs; - } - - /** - * Answers the value in the make command entry widget. - * - * @return - */ - public String getMakeCommand() { - return makeCommand; - } - - /** - * Answers a map of configuration names to IConfiguration. - * The name is selected by the user and should be unique for the target - * it will be added to. The configuration is the what the new - * configuration will be based on. - * - * @return Map - */ - public SortedMap getNewConfigs() { - if (newConfigs == null) { - newConfigs = new TreeMap(); - } - return newConfigs; - } - - /* - * @return the IProject associated with the target - */ - private IProject getProject() { - return managedTarget.getOwner().getProject(); - } - - /* - * Event handler for the add button - */ - protected void handleNewPressed() { - // Find the defined target - ITarget parentTarget = null; - ITarget [] targets = ManagedBuildManager.getDefinedTargets(getProject()); - for (int i = 0; i < targets.length; i++) { - ITarget target = targets[i]; - if (target.getId().equals(managedTarget.getParent().getId())) { - parentTarget = target; - break; - } - } - // Get all the predefined configs - IConfiguration [] allDefinedConfigs = null; - if (parentTarget != null) { - allDefinedConfigs = parentTarget.getConfigurations(); - } - - // There should be predefined configurations .... - if (allDefinedConfigs != null && allDefinedConfigs.length != 0) { - NewConfigurationDialog dialog = new NewConfigurationDialog(getShell(), - allDefinedConfigs, - managedTarget, - ManagedBuilderUIPlugin.getResourceString(CONF_DLG)); - if (dialog.open() == NewConfigurationDialog.OK) { - // Get the new name and configuration to base the new config on - String newConfigName = dialog.getNewName(); - getNewConfigs().put(newConfigName, dialog.getParentConfiguration()); - currentConfigList.add(newConfigName); - currentConfigList.setSelection(currentConfigList.getItemCount() - 1); - } - } - - // Update the buttons based on the choices - updateButtons(); - } - - /* (non-javadoc) - * Event handler for the remove button - */ - protected void handleRemovePressed() { - // Determine which configuration was selected - int selectionIndex = currentConfigList.getSelectionIndex(); - if (selectionIndex != -1){ - String selectedConfigName = currentConfigList.getItem(selectionIndex); - String selectedConfigId = null; - - // If this is a newly added config, remove it from that map - if (getNewConfigs().containsKey(selectedConfigName)) { - selectedConfigId = (String) getNewConfigs().get(selectedConfigName); - getNewConfigs().remove(selectedConfigName); - } - - // If it is not a new item, the ID is in the existing list - selectedConfigId = (String) getExistingConfigs().get(selectedConfigName); - getDeletedConfigs().put(selectedConfigName, selectedConfigId); - - // Clean up the UI lists - currentConfigList.remove(selectionIndex); - currentConfigList.setSelection(selectionIndex - 1); - deletedConfigList.add(selectedConfigName); - deletedConfigList.setSelection(deletedConfigList.getItemCount() - 1); - updateButtons(); - } - } - - /* (non-javadoc) - * Event handler for the restore button - */ - protected void handleRestorePressed() { - // Determine which configuration was selected - int selectionIndex = deletedConfigList.getSelectionIndex(); - // Move the selected element from the deleted list to the current list - if (selectionIndex != -1){ - // Get the name of the item to delete - String selectedConfigName = deletedConfigList.getItem(selectionIndex); - String selectedConfigId = (String) getDeletedConfigs().get(selectedConfigName); - - // If this was a new config (it won't be in the existing list) then add it back there - if (!getExistingConfigs().containsKey(selectedConfigName)) { - getNewConfigs().put(selectedConfigName, selectedConfigId); - } - - // Remove it from the deleted map - getDeletedConfigs().remove(selectedConfigName); - - // Clean up the UI - deletedConfigList.remove(selectionIndex); - deletedConfigList.setSelection(selectionIndex - 1); - currentConfigList.add(selectedConfigName); - currentConfigList.setSelection(currentConfigList.getItemCount()); - updateButtons(); - } - } - - private void updateButtons() { - // Disable the remove button if there is only 1 configuration - removeBtn.setEnabled(currentConfigList.getItemCount() > 1); - // Enable the restore button if there is anything in the deleted list - restoreBtn.setEnabled(deletedConfigList.getItemCount() > 0); - } - - public boolean useDefaultMakeCommand () { - return useDefaultMake; - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java deleted file mode 100644 index 2a98b4a464d..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java +++ /dev/null @@ -1,219 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -public class NewConfigurationDialog extends Dialog { - // String constants - private static final String PREFIX = "NewConfiguration"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String ERROR = PREFIX + ".error"; //$NON-NLS-1$ - private static final String NAME = LABEL + ".name"; //$NON-NLS-1$ - private static final String COPY = LABEL + ".copy"; //$NON-NLS-1$ - private static final String TITLE = ERROR + ".title"; //$NON-NLS-1$ - private static final String DUPLICATE = ERROR + ".duplicateName"; //$NON-NLS-1$ - - // Widgets - private Combo configSelector; - private Button btnOk; - private Text configName; - - // Bookeeping - private IConfiguration[] definedConfigurations; - private IConfiguration parentConfig; - private ITarget target; - private String newName; - private String [] allNames; - private String title = ""; - - - /** - * @param parentShell - */ - protected NewConfigurationDialog(Shell parentShell, IConfiguration[] configs, ITarget managedTarget, String title) { - super(parentShell); - this.title = title; - setShellStyle(getShellStyle()|SWT.RESIZE); - newName = new String(); - parentConfig = null; - definedConfigurations = configs == null ? new IConfiguration[0] : configs; - allNames = getConfigurationNames(); - this.target = managedTarget; - } - - /* (non-Javadoc) - * Method declared on Dialog. Cache the name and base config selections. - * We don't have to worry that the index or name is wrong because we - * enable the OK button IFF those conditions are met. - */ - protected void buttonPressed(int buttonId) { - if (buttonId == IDialogConstants.OK_ID) { - newName = configName.getText().trim(); - String baseConfigName = configSelector.getItem(configSelector.getSelectionIndex()); - for (int i = 0; i < definedConfigurations.length; i++) { - IConfiguration config = definedConfigurations[i]; - if (config.getName().equals(baseConfigName)) { - parentConfig = config; - break; - } - } - } else { - newName = null; - parentConfig = null; - } - super.buttonPressed(buttonId); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (title != null) - shell.setText(title); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) - */ - protected void createButtonsForButtonBar(Composite parent) { - btnOk = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - configName.setFocus(); - if (configName != null) { - configName.setText(newName); - } - updateButtonState(); - } - - protected Control createDialogArea(Composite parent) { - Composite composite = ControlFactory.createComposite(parent, 3); - GridData gd; - - // Add a label and a text widget - Label nameLabel = ControlFactory.createLabel(composite, ManagedBuilderUIPlugin.getResourceString(NAME)); - gd = new GridData(); - gd.horizontalSpan = 1; - nameLabel.setLayoutData(gd); - configName = ControlFactory.createTextField(composite); - gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - configName.setLayoutData(gd); - configName.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateButtonState(); - } - }); - - // Add a label and combo box to select the base config - Label configLabel = ControlFactory.createLabel(composite, ManagedBuilderUIPlugin.getResourceString(COPY)); - gd = new GridData(); - gd.horizontalSpan = 1; - configLabel.setLayoutData(gd); - configSelector = ControlFactory.createSelectCombo(composite, allNames, newName); - gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - configSelector.setLayoutData(gd); - configSelector.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateButtonState(); - } - }); - - return composite; - } - - /** - * @return the IConfiguration the user selected as - * the parent of the new configuration. - */ - public IConfiguration getParentConfiguration() { - return parentConfig; - } - - /* - * Returns an array of configuration names - */ - private String [] getConfigurationNames() { - String [] names = new String[definedConfigurations.length]; - for (int index = 0; index < definedConfigurations.length; ++index) { - IConfiguration config = definedConfigurations[index]; - names[index] = config.getName(); - } - return names; - } - - /** - * @return String containing the name chosen by the user for the - * new configuration. - */ - public String getNewName() { - return newName; - } - - protected boolean isDuplicateName(String newName) { - // Return true if there is already a config of that name defined on the target - IConfiguration [] configs = target.getConfigurations(); - for (int index = 0; index < configs.length; index++) { - IConfiguration configuration = configs[index]; - if (configuration.getName() == newName) { - return true; - } - } - return false; - } - - /* - * Enable the OK button if there is a valid name in the text widget - * and there is a valid selection in the base configuration combo - */ - private void updateButtonState() { - if (btnOk != null) { - int selectionIndex = configSelector.getSelectionIndex(); - btnOk.setEnabled(validateName() && selectionIndex != -1); - } - } - - private boolean validateName() { - String currentName = configName.getText().trim(); - int nameLength = currentName.length(); - // Make sure the name is not a duplicate - if (isDuplicateName(currentName)) { - MessageDialog.openError(getShell(), - ManagedBuilderUIPlugin.getResourceString(TITLE), - ManagedBuilderUIPlugin.getFormattedString(DUPLICATE, currentName)); //$NON-NLS-1$ - return false; - } - // TODO make sure there are no invalid chars in name - return (nameLength > 0); - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java deleted file mode 100644 index ad2ed4c10c8..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -public class SummaryFieldEditor extends FieldEditor { - // Whitespace character - private static final String WHITESPACE = " "; - - // The top level composite - protected Composite parent; - // The tool this category belongs to - protected ITool tool; - // The text widget to hold summary of all commands for the tool - protected Text summary; - - /** - * @param name - * @param labelText - * @param parent - */ - public SummaryFieldEditor(String name, String labelText, ITool tool, Composite parent) { - super(name, labelText, parent); - this.tool = tool; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) - */ - protected void adjustForNumColumns(int numColumns) { - // For now grab the excess space - GridData gd = (GridData) summary.getLayoutData(); - gd.horizontalSpan = numColumns - 1; - gd.grabExcessHorizontalSpace = true; - gd.grabExcessVerticalSpace = true; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int) - */ - protected void doFillIntoGrid(Composite parent, int numColumns) { - this.parent = parent; - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = numColumns; - this.parent.setLayoutData(gd); - - // Add the label - Label label = getLabelControl(parent); - GridData labelData = new GridData(); - labelData.horizontalSpan = numColumns; - label.setLayoutData(labelData); - - // Create the multi-line, read-only field - summary = new Text(parent, SWT.MULTI|SWT.READ_ONLY|SWT.WRAP); - GridData summaryData = new GridData(GridData.FILL_BOTH); - summaryData.horizontalSpan = numColumns; - summary.setLayoutData(summaryData); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doLoad() - */ - protected void doLoad() { - // Look at the data store for every option defined for the tool -// IOption[] options = tool.getOptions(); -// for (int index = 0; index < options.length; ++index) { -// IOption option = options[index]; -// String command = option.getCommand(); -// if (command == null) { -// command = ""; -// } -// String id = option.getId(); -// String values = getPreferenceStore().getString(id); -// String[] valuesList = BuildToolsSettingsStore.parseString(values); -// for (int j = 0; j < valuesList.length; ++j) { -// String entry = valuesList[j]; -// summary.append(command + entry + WHITESPACE); -// } -// } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() - */ - protected void doLoadDefault() { - doLoad(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#doStore() - */ - protected void doStore() { - // This is a read-only summary field, so don't store data - return; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() - */ - public int getNumberOfControls() { - // There is just the label from the parent and the text field - return 2; - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java deleted file mode 100644 index 2114a8f88c3..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListContentProvider.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Timesys - Initial API and implementation - * IBM Rational Software - * *********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; - -public class ToolListContentProvider implements ITreeContentProvider{ - private static Object[] EMPTY_ARRAY = new Object[0]; - private IConfiguration root; - - /** - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() { - } - - /** - * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) - */ - public Object[] getChildren(Object parentElement) { - // If parent is configuration, return a list of its option categories - if (parentElement instanceof IConfiguration) { - IConfiguration config = (IConfiguration)parentElement; - ITool [] tools = config.getTools(); - IOptionCategory [] categories = new IOptionCategory[tools.length]; - // The categories are accessed through the tool - for (int index = 0; index < tools.length; ++index) { - categories[index] = tools[index].getTopOptionCategory(); - } - return categories; - } else if (parentElement instanceof IOptionCategory) { - // Categories can have child categories - IOptionCategory cat = (IOptionCategory)parentElement; - IOptionCategory [] children = cat.getChildCategories(); - if (children == null) { - return EMPTY_ARRAY; - } else { - return children; - } - } else { - return EMPTY_ARRAY; - } - } - - /** - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) - */ - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - /** - * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) - */ - public Object getParent(Object element) { - if (element instanceof IOptionCategory) { - // Find the parent category - IOptionCategory cat = (IOptionCategory)element; - IOptionCategory parent = cat.getOwner(); - // Then we need to get the configuration we belong to - if (parent == null) { - ITool tool = cat.getTool(); - return root; - } - return parent; - } - return null; - } - - /** - * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) - */ - public boolean hasChildren(Object element) { - return getChildren(element).length > 0; - } - - /** - * @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) { - root = (IConfiguration) newInput; - } -} - diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java deleted file mode 100644 index f1b1d7311c7..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.properties; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIImages; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; - -class ToolListLabelProvider extends LabelProvider { - private final Image IMG_TOOL = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_TOOL); - private final Image IMG_CAT = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_CAT); - private static final String TREE_LABEL = "BuildPropertyPage.label.ToolTree"; //$NON-NLS-1$ - - public Image getImage(Object element) { - // If the element is a configuration, return the folder image - if (element instanceof IOptionCategory) { - IOptionCategory cat = (IOptionCategory)element; - IOptionCategory [] children = cat.getChildCategories(); - if (children.length > 0){ - return IMG_TOOL; - } else { - return IMG_CAT; - } - } else { - throw unknownElement(element); - } - - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object) - */ - public String getText(Object element) { - if (element instanceof IOptionCategory) { - IOptionCategory cat = (IOptionCategory)element; - return cat.getName(); - } - else { - throw unknownElement(element); - } - } - - protected RuntimeException unknownElement(Object element) { - return new RuntimeException("Unknown type of element in tree of type " + element.getClass().getName()); - } -} \ No newline at end of file diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java deleted file mode 100644 index 4d8a8bd566a..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderHelpContextIds; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Table; -import org.eclipse.ui.help.WorkbenchHelp; - -public class CProjectPlatformPage extends WizardPage { - /* - * Bookeeping variables - */ - private ArrayList selectedConfigurations; - protected ITarget selectedTarget; - protected String[] targetNames; - protected ArrayList targets; - - /* - * Dialog variables and string constants - */ - protected Combo platformSelection; - protected CheckboxTableViewer tableViewer; - private static final String PREFIX = "PlatformBlock"; //$NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ - private static final String TIP = PREFIX + ".tip"; //$NON-NLS-1$ - private static final String PLATFORM_TIP = TIP + ".platform"; //$NON-NLS-1$ - private static final String PLATFORM_LABEL = LABEL + ".platform"; //$NON-NLS-1$ - private static final String CONFIG_LABEL = LABEL + ".configs"; //$NON-NLS-1$ - - /** - * Constructor. - * @param wizard - * @param pageName - */ - public CProjectPlatformPage(String pageName) { - super(pageName); - setPageComplete(false); - populateTargets(); - selectedTarget = null; - selectedConfigurations = new ArrayList(0); - } - - /** - * @see org.eclipse.jface.wizard.IWizardPage#canFlipToNextPage() - */ - public boolean canFlipToNextPage() { - return validatePage(); - } - - /** - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - // Create the composite control for the tab - Composite composite = ControlFactory.createComposite(parent, 6); - - // Create the platform selection label and combo widgets - Label platformLabel = ControlFactory.createLabel(composite, ManagedBuilderUIPlugin.getResourceString(PLATFORM_LABEL)); - platformLabel.setLayoutData(new GridData()); - - platformSelection = ControlFactory.createSelectCombo(composite, targetNames, null); -// platformSelection.setToolTipText(ManagedBuilderUIPlugin.getResourceString(PLATFORM_TIP)); - platformSelection.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - handleTargetSelection(); - } - }); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 5; - platformSelection.setLayoutData(gd); - - // Create a check box table of valid configurations - Label configLabel = ControlFactory.createLabel(composite, ManagedBuilderUIPlugin.getResourceString(CONFIG_LABEL)); - configLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Table table = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.MULTI - | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 6; - table.setLayoutData(gd); - table.setHeaderVisible(true); - table.setLinesVisible(false); - - // Add a table layout to the table - TableLayout tableLayout = new TableLayout(); - table.setHeaderVisible(false); - table.setLayout(tableLayout); - - // Add the viewer - tableViewer = new CheckboxTableViewer(table); - tableViewer.setLabelProvider(new ConfigurationLabelProvider()); - tableViewer.setContentProvider(new ConfigurationContentProvider()); - tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - // will default to false until a selection is made - handleConfigurationSelectionChange(); - } - }); - - // Select the first target in the list - handleTargetSelection(); - - // Setup the help information - WorkbenchHelp.setHelp(composite, ManagedBuilderHelpContextIds.MAN_PROJ_PLATFORM_HELP); - - // Do the nasty - setErrorMessage(null); - setMessage(null); - setControl(composite); - } - - public IConfiguration[] getSelectedConfigurations() { - return (IConfiguration[]) selectedConfigurations.toArray(new IConfiguration[selectedConfigurations.size()]); - } - - /** - * Returns the name of the selected platform. - * - * @return String containing platform name or null if an invalid selection - * has been made. - */ - public ITarget getSelectedTarget() { - return selectedTarget; - } - - private void handleConfigurationSelectionChange() { - // Get the selections from the table viewer - selectedConfigurations.clear(); - selectedConfigurations.addAll(Arrays.asList(tableViewer.getCheckedElements())); - } - - /** - * Returns whether this page's controls currently all contain valid - * values. - * - * @return true if all controls are valid, and - * false if at least one is invalid - */ - protected void handleTargetSelection() { - /* - * The index in the combo is the offset into the target list - */ - int index; - if (platformSelection != null - && (index = platformSelection.getSelectionIndex()) != -1) { - selectedTarget = (ITarget) targets.get(index); - } - populateConfigurations(); - setPageComplete(validatePage()); - } - - /** - * Populate the table viewer with the known configurations. - * By default, all the configurations are selected. - */ - private void populateConfigurations() { - // Make the root of the content provider the new target - tableViewer.setInput(selectedTarget); - tableViewer.setAllChecked(true); - handleConfigurationSelectionChange(); - } - - private void populateTargetNames() { - targetNames = new String[targets.size()]; - ListIterator iter = targets.listIterator(); - int index = 0; - while (iter.hasNext()) { - targetNames[index++] = ((ITarget) iter.next()).getName(); - } - } - - private void populateTargets() { - // Get a list of platforms defined by plugins - ITarget[] allTargets = ManagedBuildManager.getDefinedTargets(null); - targets = new ArrayList(); - String os = BootLoader.getOS(); - // Add all of the concrete targets to the target list - for (int index = 0; index < allTargets.length; ++index) { - ITarget target = allTargets[index]; - if (!target.isAbstract() && !target.isTestTarget()) { - List targetOSList = Arrays.asList(target.getTargetOSList()); - if (targetOSList.contains(os)) { - targets.add(target); - } - } - } - targets.trimToSize(); - populateTargetNames(); - } - - /** - * @return - */ - private boolean validatePage() { - // TODO Auto-generated method stub - return true; - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationContentProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationContentProvider.java deleted file mode 100644 index 27db61034bd..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationContentProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; - -public class ConfigurationContentProvider implements IStructuredContentProvider { - // The contents of the parent of the table is a list of configurations - public Object[] getElements(Object parent) { - // The content is a list of configurations - IConfiguration[] configs = ((ITarget) parent).getConfigurations(); - return (configs.length == 0) ? new Object[0] : configs; - } - - public void dispose() { - } - - public void inputChanged( - Viewer viewer, - Object oldInput, - Object newInput) { - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationLabelProvider.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationLabelProvider.java deleted file mode 100644 index 229c1bfbc7c..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConfigurationLabelProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIImages; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; - -public class ConfigurationLabelProvider extends LabelProvider implements ITableLabelProvider { - private final Image IMG_CFG = - ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_CONFIG); - - // - public String getColumnText(Object obj, int index) { - if (obj instanceof IConfiguration) { - return ((IConfiguration) obj).getName(); - } - return new String(); - } - - public Image getColumnImage(Object obj, int index) { - return IMG_CFG; - } -} - diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCCProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCCProjectWizard.java deleted file mode 100644 index f03be1dab46..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCCProjectWizard.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -public class NewManagedCCProjectWizard extends NewManagedProjectWizard { - private static final String WZ_TITLE = "MngCCWizard.title"; //$NON-NLS-1$ - private static final String WZ_DESC = "MngCCWizard.description"; //$NON-NLS-1$ - private static final String SETTINGS_TITLE = "MngCCWizardSettings.title"; //$NON-NLS-1$ - private static final String SETTINGS_DESC = "MngCCWizardSettings.description"; //$NON-NLS-1$ - private static final String MSG_CREATE = "MngCCWizard.message.creating"; //$NON-NLS-1$ - - public NewManagedCCProjectWizard() { - this(ManagedBuilderUIPlugin.getResourceString(WZ_TITLE), ManagedBuilderUIPlugin.getResourceString(WZ_DESC)); - } - - public NewManagedCCProjectWizard(String title, String desc) { - super(title, desc); - } - - public void addPages() { - // Add the default page for all new managed projects - super.addPages(); - } - - protected void doRun(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(ManagedBuilderUIPlugin.getResourceString(MSG_CREATE), 8); //$NON-NLS-1$ - super.doRun(new SubProgressMonitor(monitor, 7)); - // Add C++ Nature. - if (newProject != null) { - // Add C++ Nature to the newly created project. - CCorePlugin.getDefault().convertProjectFromCtoCC(newProject, new SubProgressMonitor(monitor, 1)); - } - monitor.done(); - } -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java deleted file mode 100644 index d935a187ba3..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; - -public class NewManagedCProjectWizard extends NewManagedProjectWizard { - // String constants - private static final String WZ_TITLE = "MngCWizard.title"; - private static final String WZ_DESC = "MngCWizard.description"; - private static final String SETTINGS_TITLE= "MngCWizardSettings.title"; //$NON-NLS-1$ - private static final String SETTINGS_DESC= "MngCWizardSettings.description"; //$NON-NLS-1$ - - public NewManagedCProjectWizard() { - this(ManagedBuilderUIPlugin.getResourceString(WZ_TITLE), ManagedBuilderUIPlugin.getResourceString(WZ_DESC)); - } - - public NewManagedCProjectWizard(String title, String description) { - super(title, description); - } - - public void addPages() { - // Add the default page for all new managed projects - super.addPages(); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java deleted file mode 100644 index 11a21b25bbb..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock; -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.cdt.ui.dialogs.ReferenceBlock; -import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock; -import org.eclipse.cdt.ui.wizards.NewCProjectWizard; -import org.eclipse.cdt.ui.wizards.NewCProjectWizardOptionPage; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Preferences; - -public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage { - - public class ManagedWizardOptionBlock extends ManagedProjectOptionBlock { - - public ManagedWizardOptionBlock(ICOptionContainer parent) { - super(parent); - } - - protected void addTabs() { - addTab(new ReferenceBlock()); - } - } - - /** - * @param pageName - */ - public NewManagedProjectOptionPage(String pageName) { - super(pageName); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.NewCProjectWizardOptionPage#createOptionBlock() - */ - protected TabFolderOptionBlock createOptionBlock() { - return new ManagedWizardOptionBlock(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject() - */ - public IProject getProject() { - return ((NewCProjectWizard)getWizard()).getNewProject(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreferenceStore() - */ - public Preferences getPreferences() { - return ManagedBuilderUIPlugin.getDefault().getPluginPreferences(); - } - -} diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java deleted file mode 100644 index 968f821f726..00000000000 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java +++ /dev/null @@ -1,180 +0,0 @@ -package org.eclipse.cdt.managedbuilder.ui.wizards; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation - * **********************************************************************/ - -import java.util.Random; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature; -import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; -import org.eclipse.cdt.ui.wizards.NewCProjectWizard; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - - -public class NewManagedProjectWizard extends NewCProjectWizard { - - /* (non-Javadoc) - * String constants - */ - protected static final String PREFIX = "MngMakeProjectWizard"; //$NON-NLS-1$ - protected static final String OP_ERROR = PREFIX + ".op_error"; //$NON-NLS-1$ - protected static final String WZ_TITLE = PREFIX + ".title"; //$NON-NLS-1$ - protected static final String WZ_DESC = PREFIX + ".description"; //$NON-NLS-1$ - protected static final String CONF_TITLE = PREFIX + ".config.title"; //$NON-NLS-1$ - protected static final String CONF_DESC = PREFIX + ".config.desc"; //$NON-NLS-1$ - protected static final String OPTIONS_TITLE = PREFIX + ".options.title"; //$NON-NLS-1$ - protected static final String OPTIONS_DESC = PREFIX + ".options.desc"; //$NON-NLS-1$ - protected static final String MSG_ADD_NATURE = PREFIX + ".message.add_nature"; //$NON-NLS-1$ - protected static final String MSG_ADD_BUILDER = PREFIX + ".message.add_builder"; //$NON-NLS-1$ - protected static final String MSG_SAVE = PREFIX + ".message.save"; //$NON-NLS-1$ - protected static final String SETTINGS_TITLE = "MngMakeWizardSettings.title"; //$NON-NLS-1$ - protected static final String SETTINGS_DESC = "MngMakeWizardSettings.description"; //$NON-NLS-1$ - - // Wizard pages - protected CProjectPlatformPage targetConfigurationPage; - protected NewManagedProjectOptionPage optionPage; - - public NewManagedProjectWizard() { - this(ManagedBuilderUIPlugin.getResourceString(WZ_TITLE), ManagedBuilderUIPlugin.getResourceString(WZ_DESC)); - } - - public NewManagedProjectWizard(String title, String description) { - super(title, description); - } - - public void addPages() { - // Add the default page for all new projects - super.addPages(); - - // Add the configuration selection page - targetConfigurationPage = new CProjectPlatformPage(PREFIX); - targetConfigurationPage.setTitle(ManagedBuilderUIPlugin.getResourceString(CONF_TITLE)); - targetConfigurationPage.setDescription(ManagedBuilderUIPlugin.getResourceString(CONF_DESC)); - addPage(targetConfigurationPage); - - // Add the options (tabbed) page - optionPage = new NewManagedProjectOptionPage(PREFIX); - optionPage.setTitle(ManagedBuilderUIPlugin.getResourceString(OPTIONS_TITLE)); - optionPage.setDescription(ManagedBuilderUIPlugin.getResourceString(OPTIONS_DESC)); - addPage(optionPage); - } - - protected void doRun(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - // super.doRun() just creates the project and does not assign a builder to it. - super.doRun(new SubProgressMonitor(monitor, 5)); - - // Add the managed build nature - try { - monitor.subTask(ManagedBuilderUIPlugin.getResourceString(MSG_ADD_NATURE)); - ManagedCProjectNature.addManagedNature(newProject, new SubProgressMonitor(monitor, 1)); - } catch (CoreException e) { - // Bail out of the project creation - } - // Add the builder - try { - monitor.subTask(ManagedBuilderUIPlugin.getResourceString(MSG_ADD_BUILDER)); - ManagedCProjectNature.addManagedBuilder(newProject, new SubProgressMonitor(monitor, 1)); - } catch (CoreException e) { - // Bail out of the project creation - } - - // Modify the project settings - if (newProject != null) { - optionPage.performApply(new SubProgressMonitor(monitor, 2)); - } - - // Add the target to the project - ITarget newTarget = null; - try { - ITarget parent = targetConfigurationPage.getSelectedTarget(); - newTarget = ManagedBuildManager.createTarget(newProject, parent); - if (newTarget != null) { - String artifactName = newProject.getName(); - artifactName += parent.getDefaultExtension().length() == 0 ? "" : "." + parent.getDefaultExtension(); - newTarget.setBuildArtifact(artifactName); - IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations(); - Random r = new Random(); - r.setSeed(System.currentTimeMillis()); - for (int i = 0; i < selectedConfigs.length; i++) { - IConfiguration config = selectedConfigs[i]; - int id = r.nextInt(); - if (id < 0) { - id *= -1; - } - newTarget.createConfiguration(config, config.getId() + "." + id); - } - // Now add the first config in the list as the default - IConfiguration[] newConfigs = newTarget.getConfigurations(); - if (newConfigs.length > 0) { - ManagedBuildManager.setDefaultConfiguration(newProject, newConfigs[0]); - } - } - } catch (BuildException e) { - // TODO Flag the error to the user - } - - // Associate the project with the managed builder so the clients can get proper information - try { - ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(newProject); - desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID); - desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY); - - desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID); - // org.eclipse.cdt.core.ELF or "org.eclipse.cdt.core.PE" - desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, newTarget.getBinaryParserId()); - } catch (CoreException e) { - // TODO Flag the error to the user - } - - // Save the build options - monitor.subTask(ManagedBuilderUIPlugin.getResourceString(MSG_SAVE)); - ManagedBuildManager.saveBuildInfo(newProject); - monitor.done(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#doRunPrologue(org.eclipse.core.runtime.IProgressMonitor) - */ - protected void doRunPrologue(IProgressMonitor monitor) { - // Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#doRunEpilogue(org.eclipse.core.runtime.IProgressMonitor) - */ - protected void doRunEpilogue(IProgressMonitor monitor) { - // Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#getProjectID() - */ - public String getProjectID() { - return "org.eclipse.cdt.make.core.make"; -// return ManagedBuilderCorePlugin.getUniqueIdentifier() + ".make"; //$NON-NLS-1$ - } - -} diff --git a/core/org.eclipse.cdt.core.aix/.classpath b/core/org.eclipse.cdt.core.aix/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/core/org.eclipse.cdt.core.aix/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core/org.eclipse.cdt.core.aix/.cvsignore b/core/org.eclipse.cdt.core.aix/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/core/org.eclipse.cdt.core.aix/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/core/org.eclipse.cdt.core.aix/.project b/core/org.eclipse.cdt.core.aix/.project deleted file mode 100644 index 8edd1404d74..00000000000 --- a/core/org.eclipse.cdt.core.aix/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.core.aix - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/core/org.eclipse.cdt.core.aix/.template b/core/org.eclipse.cdt.core.aix/.template deleted file mode 100644 index d65e0f4481d..00000000000 --- a/core/org.eclipse.cdt.core.aix/.template +++ /dev/null @@ -1,4 +0,0 @@ - -
-

Tips on working with this plug-in project

  • For the view of the new plug-in at a glance, go to the Overview.
  • You can test the contributions of this plug-in by launching another instance of the workbench. On the Run menu, click Run As and choose Run-time Workbench from the available choices.
  • You can add more functionality to this plug-in by adding extensions using the New Extension Wizard.
  • The plug-in project contains Java code that you can debug. Place breakpoints in Java classes. On the Run menu, select Debug As and choose Run-time Workbench from the available choices.
  • -
    diff --git a/core/org.eclipse.cdt.core.aix/build.properties b/core/org.eclipse.cdt.core.aix/build.properties deleted file mode 100644 index cd23d6f7e18..00000000000 --- a/core/org.eclipse.cdt.core.aix/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.cdtaix.jar = src/ -bin.includes = fragment.xml,\ - *.jar,\ - cdtaix.jar diff --git a/core/org.eclipse.cdt.core.aix/fragment.properties b/core/org.eclipse.cdt.core.aix/fragment.properties deleted file mode 100644 index e4c8f54ee81..00000000000 --- a/core/org.eclipse.cdt.core.aix/fragment.properties +++ /dev/null @@ -1,2 +0,0 @@ -fragmentName=C/C++ Development Tools Core AIX Fragment -providerName=Eclipse.org diff --git a/core/org.eclipse.cdt.core.aix/fragment.xml b/core/org.eclipse.cdt.core.aix/fragment.xml deleted file mode 100644 index 1c871220772..00000000000 --- a/core/org.eclipse.cdt.core.aix/fragment.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.aix/library/.cvsignore b/core/org.eclipse.cdt.core.aix/library/.cvsignore deleted file mode 100644 index 5761abcfdf0..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.o diff --git a/core/org.eclipse.cdt.core.aix/library/Makefile b/core/org.eclipse.cdt.core.aix/library/Makefile deleted file mode 100644 index cd384722c65..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# makefile for libspawner.so - -#set JDK_INCLUDES -JDK_INCLUDES=/usr/java131/include - -CC=xlc -CFLAGS = -I. -I$(JDK_INCLUDES) -#CFLAGS +=-fpic -D_REENTRANT - -LIB_NAME_SPAWNER = libspawner.so -LIB_NAME_FULL_SPAWNER = ../os/aix/ppc/libspawner.so -OBJS_SPAWNER=spawner.o io.o exec_unix.o pfind.o - -LIB_NAME_PTY = libpty.so -LIB_NAME_FULL_PTY = ../os/aix/ppc/libpty.so -OBJS_PTY=openpty.o pty.o ptyio.o - -all: $(LIB_NAME_FULL_SPAWNER) $(LIB_NAME_FULL_PTY) - -$(LIB_NAME_FULL_SPAWNER): $(OBJS_SPAWNER) - mkdir -p ../os/aix/ppc - $(CC) -G -o $(LIB_NAME_FULL_SPAWNER) $(OBJS_SPAWNER) -lc - -$(LIB_NAME_FULL_PTY): $(OBJS_PTY) - $(CC) -G -o $(LIB_NAME_FULL_PTY) $(OBJS_PTY) - -clean : - $(RM) $(OBJS_SPAWNER) $(LIB_NAME_FULL_SPAWNER) - $(RM) $(OBJS_PTY) $(LIB_NAME_FULL_PTY) diff --git a/core/org.eclipse.cdt.core.aix/library/PTY.h b/core/org.eclipse.cdt.core.aix/library/PTY.h deleted file mode 100644 index fabf58152d0..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/PTY.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTY */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTY -#define _Included_org_eclipse_cdt_utils_pty_PTY -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTY - * Method: forkpty - * Signature: ()I - */ -JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_forkpty - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/PTYInputStream.h b/core/org.eclipse.cdt.core.aix/library/PTYInputStream.h deleted file mode 100644 index e7349272b56..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/PTYInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE -#define org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/PTYOutputStream.h b/core/org.eclipse.cdt.core.aix/library/PTYOutputStream.h deleted file mode 100644 index fb28491060e..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/PTYOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/Spawner.h b/core/org.eclipse.cdt.core.aix/library/Spawner.h deleted file mode 100644 index 01ffb3cc1b2..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/Spawner.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_Spawner */ - -#ifndef _Included_com_qnx_tools_utils_spawner_Spawner -#define _Included_com_qnx_tools_utils_spawner_Spawner -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv *, jobject, jint, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/SpawnerInputStream.h b/core/org.eclipse.cdt.core.aix/library/SpawnerInputStream.h deleted file mode 100644 index 3b32d2b2806..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/SpawnerInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE -#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/SpawnerOutputStream.h b/core/org.eclipse.cdt.core.aix/library/SpawnerOutputStream.h deleted file mode 100644 index f835947e060..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/SpawnerOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/exec0.h b/core/org.eclipse.cdt.core.aix/library/exec0.h deleted file mode 100644 index abfadb1fe82..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/exec0.h +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include -#include -#include -#include - -extern pid_t exec0(const char *path, char *const argv[], - char *const envp[], const char *dirpath, - int channels[3] ); - -extern int wait0(pid_t pid); diff --git a/core/org.eclipse.cdt.core.aix/library/exec_unix.c b/core/org.eclipse.cdt.core.aix/library/exec_unix.c deleted file mode 100644 index 14bb203b93a..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/exec_unix.c +++ /dev/null @@ -1,135 +0,0 @@ -#include "exec0.h" -#include -#include -#include -#include -#include -#include -#include - -/* from pfind.c */ -extern char *pfind(const char *name); - -pid_t -exec0(const char *path, char *const argv[], char *const envp[], - const char *dirpath, int channels[3]) -{ - int pipe0[2], pipe1[2], pipe2[2]; - pid_t childpid; - char *full_path; - - /* - * We use pfind() to check that the program exists and is an executable. - * If not pass the error up. Also execve() wants a full path. - */ - full_path = pfind(path); - if (full_path == NULL) { - fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : ""); - return -1; - } - - /* - * Make sure we can create our pipes before forking. - */ - if (channels != NULL) { - if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) { - fprintf(stderr, "%s(%d): returning due to error.\n", - __FUNCTION__, __LINE__); - free(full_path); - return -1; - } - } - - childpid = fork(); - - if (childpid < 0) { - fprintf(stderr, "%s(%d): returning due to error: %s\n", - __FUNCTION__, __LINE__, strerror(errno)); - free(full_path); - return -1; - } else if (childpid == 0) { /* child */ - char *ptr; - - chdir(dirpath); - - if (channels != NULL) { - /* Close the write end of pipe0 */ - if (close(pipe0[1]) == -1) - perror("close(pipe0[1])"); - - /* Close the read end of pipe1 */ - if (close(pipe1[0]) == -1) - perror("close(pipe1[0])"); - - /* Close the read end of pipe2 */ - if (close(pipe2[0]) == -1) - perror("close(pipe2[0]))"); - - /* redirections */ - dup2(pipe0[0], STDIN_FILENO); /* dup stdin */ - dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */ - dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ - } - - /* Close all the fd's in the child */ - { - int fdlimit = sysconf(_SC_OPEN_MAX); - int fd = 3; - - while (fd < fdlimit) - close(fd++); - } - - if (envp[0] == NULL) { - execv(full_path, argv); - } else { - execve(full_path, argv, envp); - } - - _exit(127); - - } else if (childpid != 0) { /* parent */ - - char b; - - if (channels != NULL) { - /* close the read end of pipe1 */ - if (close(pipe0[0]) == -1) - perror("close(pipe0[0])"); - - /* close the write end of pipe2 */ - if (close(pipe1[1]) == -1) - perror("close(pipe1[1])"); - - /* close the write end of pipe2 */ - if (close(pipe2[1]) == -1) - perror("close(pipe2[1])"); - - channels[0] = pipe0[1]; /* Output Stream. */ - channels[1] = pipe1[0]; /* Input Stream. */ - channels[2] = pipe2[0]; /* Input Stream. */ - } - - free(full_path); - return childpid; - } - - free(full_path); - return -1; /*NOT REACHED */ -} - - -int wait0(pid_t pid) -{ - int status; - int val = -1; - - if (pid < 0 || waitpid(pid, &status, 0) < 0) - return -1; - - if (WIFEXITED(status)) { - val = WEXITSTATUS(status); - } - - return val; -} diff --git a/core/org.eclipse.cdt.core.aix/library/io.c b/core/org.eclipse.cdt.core.aix/library/io.c deleted file mode 100644 index aa98d55429b..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/io.c +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */ -/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.aix/library/openpty.c b/core/org.eclipse.cdt.core.aix/library/openpty.c deleted file mode 100644 index 28f5363cf1d..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/openpty.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/** - * This is taken from R. W. Stevens book. - * Alain Magloire. - */ - -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); - -int -openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) -{ - char line[20]; - line[0]=0; - *amaster = ptym_open(line); - if (*amaster < 0) - return -1; - *aslave = ptys_open(*amaster, line); - if (*aslave < 0) { - close(*amaster); - return -1; - } - if (name) - strcpy(name, line); -#ifndef TCSAFLUSH -#define TCSAFLUSH TCSETAF -#endif - if (termp) - (void) tcsetattr(*aslave, TCSAFLUSH, termp); -#ifdef TIOCSWINSZ - if (winp) - (void) ioctl(*aslave, TIOCSWINSZ, (char *)winp); -#endif - return 0; -} - -int -ptym_open(char * pts_name) -{ - int fdm; - char *ptr; - - strcpy(pts_name, "/dev/ptmx"); - fdm = getpt(); - if (fdm < 0) - return -1; - if (grantpt(fdm) < 0) { /* grant access to slave */ - close(fdm); - return -2; - } - if (unlockpt(fdm) < 0) { /* clear slave's lock flag */ - close(fdm); - return -3; - } - ptr = ptsname(fdm); - if (ptr == NULL) { /* get slave's name */ - close (fdm); - return -4; - } - strcpy(pts_name, ptr); /* return name of slave */ - return fdm; /* return fd of master */ -} - -int -ptys_open(int fdm, char * pts_name) -{ - int fds; - /* following should allocate controlling terminal */ - fds = open(pts_name, O_RDWR); - if (fds < 0) { - close(fdm); - return -5; - } - if (ioctl(fds, I_PUSH, "ptem") < 0) { - printf("pterm:%s\n", strerror(errno)); - close(fdm); - close(fds); - return -6; - } - if (ioctl(fds, I_PUSH, "ldterm") < 0) { - printf("ldterm %s\n", strerror(errno)); - close(fdm); - close(fds); - return -7; - } - return fds; -} diff --git a/core/org.eclipse.cdt.core.aix/library/openpty.h b/core/org.eclipse.cdt.core.aix/library/openpty.h deleted file mode 100644 index fd7b7be1b2f..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/openpty.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#ifndef _OPENPTY_H -#define _OPENPTY_H -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); -#endif diff --git a/core/org.eclipse.cdt.core.aix/library/pfind.c b/core/org.eclipse.cdt.core.aix/library/pfind.c deleted file mode 100644 index d13dae5f0e2..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/pfind.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * pfind.c - Search for a binary in $PATH. - */ - -#include -#include -#include -#include -#include - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - - -char * pfind(const char *name) -{ - char *tok; - char *sp; - char *path; - char fullpath[PATH_MAX+1]; - - /* Sanity check. */ - if (name == NULL) { - fprintf(stderr, "pfind(): Null argument.\n"); - return NULL; - } - - /* For absolute name or name with a path, check if it is an executable. */ - if (name[0] == '/' || name[0] == '.') { - if (access(name, X_OK | R_OK) == 0) { - return strdup(name); - } - return NULL; - } - - /* Search in the PATH environment. */ - path = getenv("PATH" ); - - if (path == NULL || strlen(path) <= 0) { - fprintf(stderr, "Unable to get $PATH.\n"); - return NULL; - } - - /* The value return by getenv() is readonly */ - path = strdup(path); - - tok = strtok_r(path, ":", &sp); - while (tok != NULL) { - snprintf(fullpath, sizeof(fullpath) - 1, "%s/%s", tok, name); - - if (access(fullpath, X_OK | R_OK) == 0) { - free(path); - return strdup(fullpath); - } - - tok = strtok_r( NULL, ":", &sp ); - } - - free(path); - return NULL; -} - -#ifdef BUILD_WITH_MAIN -int main(int argc, char **argv) -{ - int i; - char *fullpath; - - for (i=1; i= 0) { - /* Get a reference to the obj's class */ - cls = (*env)->GetObjectClass(env, jobj); - - /* Set the master fd. */ - fid = (*env)->GetFieldID(env, cls, "master", "I"); - if (fid == NULL) { - return NULL; - } - (*env)->SetIntField(env, jobj, fid, (jint)master); - - /* Create a new String for the slave. */ - jstr = (*env)->NewStringUTF(env, line); - } - return jstr; -} diff --git a/core/org.eclipse.cdt.core.aix/library/ptyio.c b/core/org.eclipse.cdt.core.aix/library/ptyio.c deleted file mode 100644 index 67d7594154d..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/ptyio.c +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class _org_eclipse_cdt_utils_pty_PTYInputStream */ -/* Header for class _org_eclipse_cdt_utils_pty_PTYOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - /* Ignore the error for now, the debugger will attempt - * to close this multiple time. */ -#if 0 - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); -#endif - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.aix/library/spawner.c b/core/org.eclipse.cdt.core.aix/library/spawner.c deleted file mode 100644 index 58bf85a74ed..00000000000 --- a/core/org.eclipse.cdt.core.aix/library/spawner.c +++ /dev/null @@ -1,218 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "exec0.h" -#include - - -#define DEBUGIT 0 - - -/* - * Header for class org_eclipse_cdt_utils_spawner_Spawner - */ - - -#if DEBUGIT -static void print_array(char **c_array) -{ - if (c_array) { - char **p = c_array; - for (; *p; p++) { - if (*p) { - fprintf(stderr, " %s", *p); - } - } - } else { - fprintf(stderr, "null"); - } - fprintf(stderr, "\n"); -} -#endif - - -static char **alloc_c_array(JNIEnv * env, jobjectArray j_array) -{ - int i; - jint c_array_size = (*env)->GetArrayLength(env, j_array); - char **c_array = calloc(c_array_size + 1, sizeof(*c_array)); - - if (c_array == NULL) - return NULL; - - for (i = 0; i < c_array_size; i++) { - jstring j_str = - (jstring) (*env)->GetObjectArrayElement(env, j_array, i); - const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL); - c_array[i] = (char *) strdup(c_str); - (*env)->ReleaseStringUTFChars(env, j_str, c_str); - (*env)->DeleteLocalRef(env, j_str); - } - - return c_array; -} - - -static void free_c_array(char **c_array) -{ - if (c_array) { - char **p = c_array; - for (; *p; p++) { - if (*p) { - free(*p); - } - } - free(c_array); - } -} - - -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj, - jobjectArray jcmd, - jobjectArray jenv, - jstring jdir) -{ - const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); - char **cmd; - char **envp; - pid_t pid = -1; - - cmd = alloc_c_array(env, jcmd); - if (cmd == NULL) - goto bail_out; - - envp = alloc_c_array(env, jenv); - if (envp == NULL) - goto bail_out; - -#if DEBUGIT - fprintf(stderr, "command:"); - print_array(cmd); - fprintf(stderr, "Envp:"); - print_array(envp); - fprintf(stderr, "dirpath: %s\n", dirpath); -#endif - - pid = exec0(cmd[0], cmd, envp, dirpath, NULL); - if (pid < 0) - goto bail_out; - - bail_out: - (*env)->ReleaseStringUTFChars(env, jdir, dirpath); - if (cmd) - free_c_array(cmd); - if (envp) - free_c_array(envp); - return pid; -} - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj, - jobjectArray jcmd, - jobjectArray jenv, - jstring jdir, - jintArray jchannels) -{ - jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); - const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); - char **cmd; - char **envp; - int fd[3]; - pid_t pid = -1; - - if (channels == NULL) - goto bail_out; - - cmd = alloc_c_array(env, jcmd); - if (cmd == NULL) - goto bail_out; - - envp = alloc_c_array(env, jenv); - if (envp == NULL) - goto bail_out; - -#if DEBUGIT - fprintf(stderr, "command:"); - print_array(cmd); - fprintf(stderr, "Envp:"); - print_array(envp); - fprintf(stderr, "dirpath: %s\n", dirpath); -#endif - - pid = exec0(cmd[0], cmd, envp, dirpath, fd); - if (pid < 0) - goto bail_out; - - channels[0] = fd[0]; - channels[1] = fd[1]; - channels[2] = fd[2]; - - bail_out: - (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); - (*env)->ReleaseStringUTFChars(env, jdir, dirpath); - if (cmd) - free_c_array(cmd); - if (envp) - free_c_array(envp); - return pid; -} - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj, - jint pid, jint sig) -{ - int status = -1; - - switch (sig) { - case 0: /* NOOP */ - status = kill(pid, 0); - break; - - case 2: /* INTERRUPT */ - status = kill(pid, SIGINT); - break; - - case 9: /* KILL */ - status = kill(pid, SIGKILL); - break; - - case 15: /* TERM */ - status = kill(pid, SIGTERM); - break; - - default: - status = kill(pid, sig); /* WHAT ?? */ - break; - } - - return status; -} - - - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env, - jobject jobj, jint pid) -{ - return wait0(pid); -} diff --git a/core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessInfo.java b/core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessInfo.java deleted file mode 100644 index 11556bf5859..00000000000 --- a/core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.aix; - -import org.eclipse.cdt.core.IProcessInfo; - -/** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ProcessInfo implements IProcessInfo { - - int pid; - String name; - - public ProcessInfo(String pidString, String name) { - try { - pid = Integer.parseInt(pidString); - } catch (NumberFormatException e) { - } - this.name = name; - } - - public ProcessInfo(int pid, String name) { - this.pid = pid; - this.name = name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getPid() - */ - public int getPid() { - return pid; - } - -} diff --git a/core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessList.java b/core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessList.java deleted file mode 100644 index 9f58364d9a9..00000000000 --- a/core/org.eclipse.cdt.core.aix/src/org/eclipse/cdt/internal/core/aix/ProcessList.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.eclipse.cdt.internal.core.aix; - -import java.io.File; -import java.io.FileReader; -import java.io.FilenameFilter; -import java.io.IOException; - -import org.eclipse.cdt.core.IProcessInfo; -import org.eclipse.cdt.core.IProcessList; - -/** - * Insert the type's description here. - * @see IProcessList - */ -public class ProcessList implements IProcessList { - - ProcessInfo[] empty = new ProcessInfo[0]; - - public ProcessList() { - } - - /** - * Insert the method's description here. - * @see IProcessList#getProcessList - */ - public IProcessInfo [] getProcessList() { - File proc = new File("/proc"); - File[] pidFiles = null; - - // We are only interrested in the pid so filter the rest out. - try { - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - boolean isPID = false; - try { - Integer.parseInt(name); - isPID = true; - } catch (NumberFormatException e) { - } - return isPID; - } - }; - pidFiles = proc.listFiles(filter); - } catch (SecurityException e) { - } - - ProcessInfo[] processInfo = empty; - if (pidFiles != null) { - processInfo = new ProcessInfo[pidFiles.length]; - for (int i = 0; i < pidFiles.length; i++) { - File cmdLine = new File(pidFiles[i], "cmdline"); - StringBuffer line = new StringBuffer(); - try { - FileReader reader = new FileReader(cmdLine); - int c; - while ((c = reader.read()) > 0) { - line.append((char)c); - } - } catch (IOException e) { - } - String name = line.toString(); - if (name.length() == 0) { - name = "Unknown"; - } - processInfo[i] = new ProcessInfo(pidFiles[i].getName(), name); - } - } else { - pidFiles = new File[0]; - } - return processInfo; - } -} diff --git a/core/org.eclipse.cdt.core.linux/.classpath b/core/org.eclipse.cdt.core.linux/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/core/org.eclipse.cdt.core.linux/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core/org.eclipse.cdt.core.linux/.cvsignore b/core/org.eclipse.cdt.core.linux/.cvsignore deleted file mode 100644 index 693869726de..00000000000 --- a/core/org.eclipse.cdt.core.linux/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -doc diff --git a/core/org.eclipse.cdt.core.linux/.project b/core/org.eclipse.cdt.core.linux/.project deleted file mode 100644 index 43f20bda72b..00000000000 --- a/core/org.eclipse.cdt.core.linux/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.core.linux - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.core.linux/ChangeLog b/core/org.eclipse.cdt.core.linux/ChangeLog deleted file mode 100644 index 18ba693e86e..00000000000 --- a/core/org.eclipse.cdt.core.linux/ChangeLog +++ /dev/null @@ -1,32 +0,0 @@ -2003-02-01 Alain Magloire - - * library/ptyio.c: Do not throw any exception. - * os/linux/x86/libpty.so: Rebuild. - * os/linux/x86/libspawner.so: Rebuild. - -2003-01-31 Tom Tromey - - * library/Makefile (OS): New macro. - (ARCH): Likewise. - (JDK_INCLUDES, JDK_OS_INCLUDES): Define; don't check to see if - they are set externally. - (INSTALL_DIR): New macro. - (LIB_NAME_FULL_SPAWNER): Use it. - (LIB_NAME_FULL_PTY): Likewise. - ($(LIB_NAME_FULL_SPAWNER)): Make output directory. - ($(LIB_NAME_FULL_PTY)): Likewise. - -2002-10-15 Alain Magloire - - Runtime.getRuntime().exec(..) would throw an exception - if the program does not exist or is not an executabe. - Spawner should do the same. - - library/pfind.c (pfind): Check also for fullpath - with access() system call. - - library/exec_unix.c (exec0): Always call pfind() - to check if the program exists. - - os/linux/x86/libspawner.so: Rebuild. - diff --git a/core/org.eclipse.cdt.core.linux/build.properties b/core/org.eclipse.cdt.core.linux/build.properties deleted file mode 100644 index 6e10a326c55..00000000000 --- a/core/org.eclipse.cdt.core.linux/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/,\ - cdt_linux.jar -src.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/ -source.cdt_linux.jar = src/ diff --git a/core/org.eclipse.cdt.core.linux/fragment.properties b/core/org.eclipse.cdt.core.linux/fragment.properties deleted file mode 100644 index c620850e892..00000000000 --- a/core/org.eclipse.cdt.core.linux/fragment.properties +++ /dev/null @@ -1,2 +0,0 @@ -fragmentName=C/C++ Development Tools Core Linux Fragment -providerName=Eclipse.org diff --git a/core/org.eclipse.cdt.core.linux/fragment.xml b/core/org.eclipse.cdt.core.linux/fragment.xml deleted file mode 100644 index d3a0ee15859..00000000000 --- a/core/org.eclipse.cdt.core.linux/fragment.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.linux/library/.cvsignore b/core/org.eclipse.cdt.core.linux/library/.cvsignore deleted file mode 100644 index 5761abcfdf0..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.o diff --git a/core/org.eclipse.cdt.core.linux/library/Makefile b/core/org.eclipse.cdt.core.linux/library/Makefile deleted file mode 100644 index 8b5010ac532..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# makefile for libspawner.so - -ifeq ($(JAVA_HOME),) -$(warning JAVA_HOME not set in environment) -endif - -# Defaults which can be overridden. -OS = linux -ARCH = x86 - -JDK_INCLUDES= $(JAVA_HOME)/include -JDK_OS_INCLUDES= $(JAVA_HOME)/include/$(OS) - -CC=gcc -CPPFLAGS = -I. -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES) -CFLAGS +=-fpic -D_REENTRANT - -INSTALL_DIR = ../os/$(OS)/$(ARCH) - -LIB_NAME_SPAWNER = libspawner.so -LIB_NAME_FULL_SPAWNER = $(INSTALL_DIR)/libspawner.so -OBJS_SPAWNER=spawner.o io.o exec_unix.o pfind.o - -LIB_NAME_PTY = libpty.so -LIB_NAME_FULL_PTY = $(INSTALL_DIR)/libpty.so -OBJS_PTY= openpty.o pty.o ptyio.o - -OBJS = $(OBJS_SPAWNER) $(OBJS_PTY) - -all: $(LIB_NAME_FULL_SPAWNER) $(LIB_NAME_FULL_PTY) - -rebuild: clean all - -$(LIB_NAME_FULL_SPAWNER) : $(OBJS_SPAWNER) - mkdir -p $(INSTALL_DIR) - $(CC) -g -shared -Wl,-soname,$(LIB_NAME_SPAWNER) -o $(LIB_NAME_FULL_SPAWNER) $(OBJS_SPAWNER) -lc - -$(LIB_NAME_FULL_PTY): $(OBJS_PTY) - mkdir -p $(INSTALL_DIR) - $(CC) -g -shared -Wl,-soname,$(LIB_NAME_PTY) -o $(LIB_NAME_FULL_PTY) $(OBJS_PTY) - -clean : - $(RM) $(OBJS_SPAWNER) $(LIB_NAME_FULL_SPAWNER) - $(RM) $(OBJS_PTY) $(LIB_NAME_FULL_PTY) diff --git a/core/org.eclipse.cdt.core.linux/library/PTY.h b/core/org.eclipse.cdt.core.linux/library/PTY.h deleted file mode 100644 index fabf58152d0..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/PTY.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTY */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTY -#define _Included_org_eclipse_cdt_utils_pty_PTY -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTY - * Method: forkpty - * Signature: ()I - */ -JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_forkpty - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/PTYInputStream.h b/core/org.eclipse.cdt.core.linux/library/PTYInputStream.h deleted file mode 100644 index e7349272b56..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/PTYInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE -#define org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/PTYOutputStream.h b/core/org.eclipse.cdt.core.linux/library/PTYOutputStream.h deleted file mode 100644 index fb28491060e..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/PTYOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/Spawner.h b/core/org.eclipse.cdt.core.linux/library/Spawner.h deleted file mode 100644 index 01ffb3cc1b2..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/Spawner.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_Spawner */ - -#ifndef _Included_com_qnx_tools_utils_spawner_Spawner -#define _Included_com_qnx_tools_utils_spawner_Spawner -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv *, jobject, jint, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h b/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h deleted file mode 100644 index 3b32d2b2806..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/SpawnerInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE -#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h b/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h deleted file mode 100644 index f835947e060..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/SpawnerOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/exec0.h b/core/org.eclipse.cdt.core.linux/library/exec0.h deleted file mode 100644 index abfadb1fe82..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/exec0.h +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include -#include -#include -#include - -extern pid_t exec0(const char *path, char *const argv[], - char *const envp[], const char *dirpath, - int channels[3] ); - -extern int wait0(pid_t pid); diff --git a/core/org.eclipse.cdt.core.linux/library/exec_unix.c b/core/org.eclipse.cdt.core.linux/library/exec_unix.c deleted file mode 100644 index 14bb203b93a..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/exec_unix.c +++ /dev/null @@ -1,135 +0,0 @@ -#include "exec0.h" -#include -#include -#include -#include -#include -#include -#include - -/* from pfind.c */ -extern char *pfind(const char *name); - -pid_t -exec0(const char *path, char *const argv[], char *const envp[], - const char *dirpath, int channels[3]) -{ - int pipe0[2], pipe1[2], pipe2[2]; - pid_t childpid; - char *full_path; - - /* - * We use pfind() to check that the program exists and is an executable. - * If not pass the error up. Also execve() wants a full path. - */ - full_path = pfind(path); - if (full_path == NULL) { - fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : ""); - return -1; - } - - /* - * Make sure we can create our pipes before forking. - */ - if (channels != NULL) { - if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) { - fprintf(stderr, "%s(%d): returning due to error.\n", - __FUNCTION__, __LINE__); - free(full_path); - return -1; - } - } - - childpid = fork(); - - if (childpid < 0) { - fprintf(stderr, "%s(%d): returning due to error: %s\n", - __FUNCTION__, __LINE__, strerror(errno)); - free(full_path); - return -1; - } else if (childpid == 0) { /* child */ - char *ptr; - - chdir(dirpath); - - if (channels != NULL) { - /* Close the write end of pipe0 */ - if (close(pipe0[1]) == -1) - perror("close(pipe0[1])"); - - /* Close the read end of pipe1 */ - if (close(pipe1[0]) == -1) - perror("close(pipe1[0])"); - - /* Close the read end of pipe2 */ - if (close(pipe2[0]) == -1) - perror("close(pipe2[0]))"); - - /* redirections */ - dup2(pipe0[0], STDIN_FILENO); /* dup stdin */ - dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */ - dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ - } - - /* Close all the fd's in the child */ - { - int fdlimit = sysconf(_SC_OPEN_MAX); - int fd = 3; - - while (fd < fdlimit) - close(fd++); - } - - if (envp[0] == NULL) { - execv(full_path, argv); - } else { - execve(full_path, argv, envp); - } - - _exit(127); - - } else if (childpid != 0) { /* parent */ - - char b; - - if (channels != NULL) { - /* close the read end of pipe1 */ - if (close(pipe0[0]) == -1) - perror("close(pipe0[0])"); - - /* close the write end of pipe2 */ - if (close(pipe1[1]) == -1) - perror("close(pipe1[1])"); - - /* close the write end of pipe2 */ - if (close(pipe2[1]) == -1) - perror("close(pipe2[1])"); - - channels[0] = pipe0[1]; /* Output Stream. */ - channels[1] = pipe1[0]; /* Input Stream. */ - channels[2] = pipe2[0]; /* Input Stream. */ - } - - free(full_path); - return childpid; - } - - free(full_path); - return -1; /*NOT REACHED */ -} - - -int wait0(pid_t pid) -{ - int status; - int val = -1; - - if (pid < 0 || waitpid(pid, &status, 0) < 0) - return -1; - - if (WIFEXITED(status)) { - val = WEXITSTATUS(status); - } - - return val; -} diff --git a/core/org.eclipse.cdt.core.linux/library/io.c b/core/org.eclipse.cdt.core.linux/library/io.c deleted file mode 100644 index aa98d55429b..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/io.c +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */ -/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.linux/library/openpty.c b/core/org.eclipse.cdt.core.linux/library/openpty.c deleted file mode 100644 index 28f5363cf1d..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/openpty.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/** - * This is taken from R. W. Stevens book. - * Alain Magloire. - */ - -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); - -int -openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) -{ - char line[20]; - line[0]=0; - *amaster = ptym_open(line); - if (*amaster < 0) - return -1; - *aslave = ptys_open(*amaster, line); - if (*aslave < 0) { - close(*amaster); - return -1; - } - if (name) - strcpy(name, line); -#ifndef TCSAFLUSH -#define TCSAFLUSH TCSETAF -#endif - if (termp) - (void) tcsetattr(*aslave, TCSAFLUSH, termp); -#ifdef TIOCSWINSZ - if (winp) - (void) ioctl(*aslave, TIOCSWINSZ, (char *)winp); -#endif - return 0; -} - -int -ptym_open(char * pts_name) -{ - int fdm; - char *ptr; - - strcpy(pts_name, "/dev/ptmx"); - fdm = getpt(); - if (fdm < 0) - return -1; - if (grantpt(fdm) < 0) { /* grant access to slave */ - close(fdm); - return -2; - } - if (unlockpt(fdm) < 0) { /* clear slave's lock flag */ - close(fdm); - return -3; - } - ptr = ptsname(fdm); - if (ptr == NULL) { /* get slave's name */ - close (fdm); - return -4; - } - strcpy(pts_name, ptr); /* return name of slave */ - return fdm; /* return fd of master */ -} - -int -ptys_open(int fdm, char * pts_name) -{ - int fds; - /* following should allocate controlling terminal */ - fds = open(pts_name, O_RDWR); - if (fds < 0) { - close(fdm); - return -5; - } - if (ioctl(fds, I_PUSH, "ptem") < 0) { - printf("pterm:%s\n", strerror(errno)); - close(fdm); - close(fds); - return -6; - } - if (ioctl(fds, I_PUSH, "ldterm") < 0) { - printf("ldterm %s\n", strerror(errno)); - close(fdm); - close(fds); - return -7; - } - return fds; -} diff --git a/core/org.eclipse.cdt.core.linux/library/openpty.h b/core/org.eclipse.cdt.core.linux/library/openpty.h deleted file mode 100644 index fd7b7be1b2f..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/openpty.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#ifndef _OPENPTY_H -#define _OPENPTY_H -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); -#endif diff --git a/core/org.eclipse.cdt.core.linux/library/pfind.c b/core/org.eclipse.cdt.core.linux/library/pfind.c deleted file mode 100644 index d13dae5f0e2..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/pfind.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * pfind.c - Search for a binary in $PATH. - */ - -#include -#include -#include -#include -#include - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - - -char * pfind(const char *name) -{ - char *tok; - char *sp; - char *path; - char fullpath[PATH_MAX+1]; - - /* Sanity check. */ - if (name == NULL) { - fprintf(stderr, "pfind(): Null argument.\n"); - return NULL; - } - - /* For absolute name or name with a path, check if it is an executable. */ - if (name[0] == '/' || name[0] == '.') { - if (access(name, X_OK | R_OK) == 0) { - return strdup(name); - } - return NULL; - } - - /* Search in the PATH environment. */ - path = getenv("PATH" ); - - if (path == NULL || strlen(path) <= 0) { - fprintf(stderr, "Unable to get $PATH.\n"); - return NULL; - } - - /* The value return by getenv() is readonly */ - path = strdup(path); - - tok = strtok_r(path, ":", &sp); - while (tok != NULL) { - snprintf(fullpath, sizeof(fullpath) - 1, "%s/%s", tok, name); - - if (access(fullpath, X_OK | R_OK) == 0) { - free(path); - return strdup(fullpath); - } - - tok = strtok_r( NULL, ":", &sp ); - } - - free(path); - return NULL; -} - -#ifdef BUILD_WITH_MAIN -int main(int argc, char **argv) -{ - int i; - char *fullpath; - - for (i=1; i= 0) { - /* Get a reference to the obj's class */ - cls = (*env)->GetObjectClass(env, jobj); - - /* Set the master fd. */ - fid = (*env)->GetFieldID(env, cls, "master", "I"); - if (fid == NULL) { - return NULL; - } - (*env)->SetIntField(env, jobj, fid, (jint)master); - - /* Create a new String for the slave. */ - jstr = (*env)->NewStringUTF(env, line); - } - return jstr; -} diff --git a/core/org.eclipse.cdt.core.linux/library/ptyio.c b/core/org.eclipse.cdt.core.linux/library/ptyio.c deleted file mode 100644 index 67d7594154d..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/ptyio.c +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class _org_eclipse_cdt_utils_pty_PTYInputStream */ -/* Header for class _org_eclipse_cdt_utils_pty_PTYOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - /* Ignore the error for now, the debugger will attempt - * to close this multiple time. */ -#if 0 - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); -#endif - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.linux/library/spawner.c b/core/org.eclipse.cdt.core.linux/library/spawner.c deleted file mode 100644 index 58bf85a74ed..00000000000 --- a/core/org.eclipse.cdt.core.linux/library/spawner.c +++ /dev/null @@ -1,218 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "exec0.h" -#include - - -#define DEBUGIT 0 - - -/* - * Header for class org_eclipse_cdt_utils_spawner_Spawner - */ - - -#if DEBUGIT -static void print_array(char **c_array) -{ - if (c_array) { - char **p = c_array; - for (; *p; p++) { - if (*p) { - fprintf(stderr, " %s", *p); - } - } - } else { - fprintf(stderr, "null"); - } - fprintf(stderr, "\n"); -} -#endif - - -static char **alloc_c_array(JNIEnv * env, jobjectArray j_array) -{ - int i; - jint c_array_size = (*env)->GetArrayLength(env, j_array); - char **c_array = calloc(c_array_size + 1, sizeof(*c_array)); - - if (c_array == NULL) - return NULL; - - for (i = 0; i < c_array_size; i++) { - jstring j_str = - (jstring) (*env)->GetObjectArrayElement(env, j_array, i); - const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL); - c_array[i] = (char *) strdup(c_str); - (*env)->ReleaseStringUTFChars(env, j_str, c_str); - (*env)->DeleteLocalRef(env, j_str); - } - - return c_array; -} - - -static void free_c_array(char **c_array) -{ - if (c_array) { - char **p = c_array; - for (; *p; p++) { - if (*p) { - free(*p); - } - } - free(c_array); - } -} - - -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj, - jobjectArray jcmd, - jobjectArray jenv, - jstring jdir) -{ - const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); - char **cmd; - char **envp; - pid_t pid = -1; - - cmd = alloc_c_array(env, jcmd); - if (cmd == NULL) - goto bail_out; - - envp = alloc_c_array(env, jenv); - if (envp == NULL) - goto bail_out; - -#if DEBUGIT - fprintf(stderr, "command:"); - print_array(cmd); - fprintf(stderr, "Envp:"); - print_array(envp); - fprintf(stderr, "dirpath: %s\n", dirpath); -#endif - - pid = exec0(cmd[0], cmd, envp, dirpath, NULL); - if (pid < 0) - goto bail_out; - - bail_out: - (*env)->ReleaseStringUTFChars(env, jdir, dirpath); - if (cmd) - free_c_array(cmd); - if (envp) - free_c_array(envp); - return pid; -} - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj, - jobjectArray jcmd, - jobjectArray jenv, - jstring jdir, - jintArray jchannels) -{ - jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); - const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); - char **cmd; - char **envp; - int fd[3]; - pid_t pid = -1; - - if (channels == NULL) - goto bail_out; - - cmd = alloc_c_array(env, jcmd); - if (cmd == NULL) - goto bail_out; - - envp = alloc_c_array(env, jenv); - if (envp == NULL) - goto bail_out; - -#if DEBUGIT - fprintf(stderr, "command:"); - print_array(cmd); - fprintf(stderr, "Envp:"); - print_array(envp); - fprintf(stderr, "dirpath: %s\n", dirpath); -#endif - - pid = exec0(cmd[0], cmd, envp, dirpath, fd); - if (pid < 0) - goto bail_out; - - channels[0] = fd[0]; - channels[1] = fd[1]; - channels[2] = fd[2]; - - bail_out: - (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); - (*env)->ReleaseStringUTFChars(env, jdir, dirpath); - if (cmd) - free_c_array(cmd); - if (envp) - free_c_array(envp); - return pid; -} - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj, - jint pid, jint sig) -{ - int status = -1; - - switch (sig) { - case 0: /* NOOP */ - status = kill(pid, 0); - break; - - case 2: /* INTERRUPT */ - status = kill(pid, SIGINT); - break; - - case 9: /* KILL */ - status = kill(pid, SIGKILL); - break; - - case 15: /* TERM */ - status = kill(pid, SIGTERM); - break; - - default: - status = kill(pid, sig); /* WHAT ?? */ - break; - } - - return status; -} - - - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env, - jobject jobj, jint pid) -{ - return wait0(pid); -} diff --git a/core/org.eclipse.cdt.core.linux/os/linux/x86/libpty.so b/core/org.eclipse.cdt.core.linux/os/linux/x86/libpty.so deleted file mode 100644 index b1477a6d7ef..00000000000 Binary files a/core/org.eclipse.cdt.core.linux/os/linux/x86/libpty.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.linux/os/linux/x86/libspawner.so b/core/org.eclipse.cdt.core.linux/os/linux/x86/libspawner.so deleted file mode 100644 index dc9c532785e..00000000000 Binary files a/core/org.eclipse.cdt.core.linux/os/linux/x86/libspawner.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessInfo.java b/core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessInfo.java deleted file mode 100644 index 597c9e408fa..00000000000 --- a/core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.linux; - -import org.eclipse.cdt.core.IProcessInfo; - -/** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ProcessInfo implements IProcessInfo { - - int pid; - String name; - - public ProcessInfo(String pidString, String name) { - try { - pid = Integer.parseInt(pidString); - } catch (NumberFormatException e) { - } - this.name = name; - } - - public ProcessInfo(int pid, String name) { - this.pid = pid; - this.name = name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getPid() - */ - public int getPid() { - return pid; - } - -} diff --git a/core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessList.java b/core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessList.java deleted file mode 100644 index 13025a072ee..00000000000 --- a/core/org.eclipse.cdt.core.linux/src/org/eclipse/cdt/internal/core/linux/ProcessList.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.eclipse.cdt.internal.core.linux; - -import java.io.File; -import java.io.FileReader; -import java.io.FilenameFilter; -import java.io.IOException; - -import org.eclipse.cdt.core.IProcessInfo; -import org.eclipse.cdt.core.IProcessList; - -/** - * Insert the type's description here. - * @see IProcessList - */ -public class ProcessList implements IProcessList { - - ProcessInfo[] empty = new ProcessInfo[0]; - - public ProcessList() { - } - - /** - * Insert the method's description here. - * @see IProcessList#getProcessList - */ - public IProcessInfo [] getProcessList() { - File proc = new File("/proc"); - File[] pidFiles = null; - - // We are only interrested in the pid so filter the rest out. - try { - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - boolean isPID = false; - try { - Integer.parseInt(name); - isPID = true; - } catch (NumberFormatException e) { - } - return isPID; - } - }; - pidFiles = proc.listFiles(filter); - } catch (SecurityException e) { - } - - ProcessInfo[] processInfo = empty; - if (pidFiles != null) { - processInfo = new ProcessInfo[pidFiles.length]; - for (int i = 0; i < pidFiles.length; i++) { - File cmdLine = new File(pidFiles[i], "cmdline"); - StringBuffer line = new StringBuffer(); - try { - FileReader reader = new FileReader(cmdLine); - int c; - while ((c = reader.read()) > 0) { - line.append((char)c); - } - } catch (IOException e) { - } - String name = line.toString(); - if (name.length() == 0) { - name = "Unknown"; - } - processInfo[i] = new ProcessInfo(pidFiles[i].getName(), name); - } - } else { - pidFiles = new File[0]; - } - return processInfo; - } -} diff --git a/core/org.eclipse.cdt.core.qnx/.classpath b/core/org.eclipse.cdt.core.qnx/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/core/org.eclipse.cdt.core.qnx/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core/org.eclipse.cdt.core.qnx/.cvsignore b/core/org.eclipse.cdt.core.qnx/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/core/org.eclipse.cdt.core.qnx/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/core/org.eclipse.cdt.core.qnx/.project b/core/org.eclipse.cdt.core.qnx/.project deleted file mode 100644 index 9aa2652590a..00000000000 --- a/core/org.eclipse.cdt.core.qnx/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.core.qnx - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.core.qnx/ChangeLog b/core/org.eclipse.cdt.core.qnx/ChangeLog deleted file mode 100644 index bc1026602d8..00000000000 --- a/core/org.eclipse.cdt.core.qnx/ChangeLog +++ /dev/null @@ -1,30 +0,0 @@ -2002-11-12 Alain Magloire - - Fix Pr 26005 - * library/spawner/spawner.c (waitFor): - The waitFor(int) JNI on QNX is returning the PID of the - process rather then the status of the process - on exit. - Patch from Chris Mckillop. - -2002-11-04 Alain Magloire - - * library/pty/pty.c: New file. - * library/pty/ptyio.c: New file. - * library/pty/openpty.c: New file. - * library/pty/openpty.h: New file. - * library/pty/PTY.h: new File. - * library/pty/PTYInputStream.h: new File. - * library/pty/PTYOutputStream.h: new File. - -2002-10-17 Alain Magloire - - * os/qnx/x86/libspawner.so: Regenarated. - Thanks to Alex Chapiro. - -2002-10-17 Alain Magloire - - * library/spawner.c (exec0) : This function was - leaking memory at every call, the environment array - and the argument array was not free(). There is no - need to do the strdup() of cwd. diff --git a/core/org.eclipse.cdt.core.qnx/build.properties b/core/org.eclipse.cdt.core.qnx/build.properties deleted file mode 100644 index ef4622fb432..00000000000 --- a/core/org.eclipse.cdt.core.qnx/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/,\ - cdt_qnx.jar -source.cdt_qnx.jar = src/ -src.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/ diff --git a/core/org.eclipse.cdt.core.qnx/fragment.properties b/core/org.eclipse.cdt.core.qnx/fragment.properties deleted file mode 100644 index 67fc3e5e2d8..00000000000 --- a/core/org.eclipse.cdt.core.qnx/fragment.properties +++ /dev/null @@ -1,2 +0,0 @@ -fragmentName=C/C++ Development Tools Core QNX Fragment -providerName=Eclipse.org diff --git a/core/org.eclipse.cdt.core.qnx/fragment.xml b/core/org.eclipse.cdt.core.qnx/fragment.xml deleted file mode 100644 index ed85a434ce3..00000000000 --- a/core/org.eclipse.cdt.core.qnx/fragment.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.qnx/library/.cvsignore b/core/org.eclipse.cdt.core.qnx/library/.cvsignore deleted file mode 100644 index 33ec1741ee8..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -*.o -*.so -*.a diff --git a/core/org.eclipse.cdt.core.qnx/library/Makefile b/core/org.eclipse.cdt.core.qnx/library/Makefile deleted file mode 100644 index 0f36af0e691..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=ALL -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/Makefile b/core/org.eclipse.cdt.core.qnx/library/pty/Makefile deleted file mode 100644 index 959e9b2292f..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=CPU -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/PTY.h b/core/org.eclipse.cdt.core.qnx/library/pty/PTY.h deleted file mode 100644 index fabf58152d0..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/PTY.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTY */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTY -#define _Included_org_eclipse_cdt_utils_pty_PTY -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTY - * Method: forkpty - * Signature: ()I - */ -JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_forkpty - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/PTYInputStream.h b/core/org.eclipse.cdt.core.qnx/library/pty/PTYInputStream.h deleted file mode 100644 index e7349272b56..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/PTYInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE -#define org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/PTYOutputStream.h b/core/org.eclipse.cdt.core.qnx/library/pty/PTYOutputStream.h deleted file mode 100644 index fb28491060e..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/PTYOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/common.mk b/core/org.eclipse.cdt.core.qnx/library/pty/common.mk deleted file mode 100644 index 40fc9cca6c7..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/common.mk +++ /dev/null @@ -1,14 +0,0 @@ -ifndef QCONFIG -QCONFIG=qconfig.mk -endif -include $(QCONFIG) - -include $(MKFILES_ROOT)/qtargets.mk - -ifeq ($(OS),nto) -ifeq ($(IVEHOME),) -IVEHOME:=/opt/vame/ive/bin -endif -EXTRA_INCVPATH+=$(IVEHOME)/include -endif - diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/openpty.c b/core/org.eclipse.cdt.core.qnx/library/pty/openpty.c deleted file mode 100644 index b1660a13b78..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/openpty.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/** - * This is taken from R. W. Stevens book. - * Alain Magloire. - */ - -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); - -int -openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) -{ - char line[20]; - line[0]=0; - *amaster = ptym_open(line); - if (*amaster < 0) - return -1; - *aslave = ptys_open(*amaster, line); - if (*aslave < 0) { - close(*amaster); - return -1; - } - if (name) - strcpy(name, line); -#ifndef TCSAFLUSH -#define TCSAFLUSH TCSETAF -#endif - if (termp) - (void) tcsetattr(*aslave, TCSAFLUSH, termp); -#ifdef TIOCSWINSZ - if (winp) - (void) ioctl(*aslave, TIOCSWINSZ, (char *)winp); -#endif - return 0; -} - -int -ptym_open(char * pts_name) -{ - char *ptr1, *ptr2; - int fdm; - - strcpy(pts_name, "/dev/ptyXY"); - /* array index: 012345689 (for references in following code) */ - for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1 != 0; ptr1++) { - pts_name[8] = *ptr1; - for (ptr2 = "0123456789abcdef"; *ptr2 != 0; ptr2++) { - pts_name[9] = *ptr2; - /* try to open master */ - fdm = open(pts_name, O_RDWR); - if (fdm < 0) { - if (errno == ENOENT) {/* different from EIO */ - return -1; /* out of pty devices */ - } else { - continue; /* try next pty device */ - } - } - pts_name[5] = 't'; /* chage "pty" to "tty" */ - return fdm; /* got it, return fd of master */ - } - } - return -1; /* out of pty devices */ -} - -int -ptys_open(int fdm, char * pts_name) -{ - int gid, fds; - struct group *grptr; - - grptr = getgrnam("tty"); - if (grptr != NULL) { - gid = grptr->gr_gid; - } else { - gid = -1; /* group tty is not in the group file */ - } - - /* following two functions don't work unless we're root */ - chown(pts_name, getuid(), gid); - chmod(pts_name, S_IRUSR | S_IWUSR | S_IWGRP); - fds = open(pts_name, O_RDWR); - if (fds < 0) { - close(fdm); - return -1; - } - return fds; -} diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/openpty.h b/core/org.eclipse.cdt.core.qnx/library/pty/openpty.h deleted file mode 100644 index fd7b7be1b2f..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/openpty.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#ifndef _OPENPTY_H -#define _OPENPTY_H -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/pty.c b/core/org.eclipse.cdt.core.qnx/library/pty/pty.c deleted file mode 100644 index 4b9e682c3ee..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/pty.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "PTY.h" -#include "openpty.h" - -/* - * Class: org_eclipse_cdt_utils_pty_PTY - * Method: forkpty - * Signature: ()I - */ -JNIEXPORT jstring JNICALL -Java_org_eclipse_cdt_utils_pty_PTY_forkpty (JNIEnv *env, jobject jobj) { - jfieldID fid; /* Store the field ID */ - jstring jstr = NULL; - int master = -1; - char line[1024]; /* FIXME: Should be enough */ - jclass cls; - - line[0] = '\0'; - - master = ptym_open(line); - if (master >= 0) { - /* Get a reference to the obj's class */ - cls = (*env)->GetObjectClass(env, jobj); - - /* Set the master fd. */ - fid = (*env)->GetFieldID(env, cls, "master", "I"); - if (fid == NULL) { - return NULL; - } - (*env)->SetIntField(env, jobj, fid, (jint)master); - - /* Create a new String for the slave. */ - jstr = (*env)->NewStringUTF(env, line); - } - return jstr; -} diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/ptyio.c b/core/org.eclipse.cdt.core.qnx/library/pty/ptyio.c deleted file mode 100644 index 0024cf0a1b3..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/ptyio.c +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class _org_eclipse_cdt_utils_pty_PTYInputStream */ -/* Header for class _org_eclipse_cdt_utils_pty_PTYOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/x86/Makefile b/core/org.eclipse.cdt.core.qnx/library/pty/x86/Makefile deleted file mode 100644 index 6a18617612e..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/x86/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.qnx/library/pty/x86/so/Makefile b/core/org.eclipse.cdt.core.qnx/library/pty/x86/so/Makefile deleted file mode 100644 index cc399272607..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/pty/x86/so/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/Makefile b/core/org.eclipse.cdt.core.qnx/library/spawner/Makefile deleted file mode 100644 index 959e9b2292f..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=CPU -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/Spawner.h b/core/org.eclipse.cdt.core.qnx/library/spawner/Spawner.h deleted file mode 100644 index 287c8370ab0..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/Spawner.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_Spawner */ - -#ifndef _Included_com_qnx_tools_utils_spawner_Spawner -#define _Included_com_qnx_tools_utils_spawner_Spawner -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv *, jobject, jint, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerInputStream.h b/core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerInputStream.h deleted file mode 100644 index ecf8f8c6a78..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE -#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerOutputStream.h b/core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerOutputStream.h deleted file mode 100644 index 444d71c698c..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/SpawnerOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/common.mk b/core/org.eclipse.cdt.core.qnx/library/spawner/common.mk deleted file mode 100644 index 40fc9cca6c7..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/common.mk +++ /dev/null @@ -1,14 +0,0 @@ -ifndef QCONFIG -QCONFIG=qconfig.mk -endif -include $(QCONFIG) - -include $(MKFILES_ROOT)/qtargets.mk - -ifeq ($(OS),nto) -ifeq ($(IVEHOME),) -IVEHOME:=/opt/vame/ive/bin -endif -EXTRA_INCVPATH+=$(IVEHOME)/include -endif - diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/iostream.c b/core/org.eclipse.cdt.core.qnx/library/spawner/iostream.c deleted file mode 100644 index a840a1667b1..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/iostream.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright, 2002, QNX Software Systems Ltd. All Rights Reserved - - * This source code has been published by QNX Software Systems - * Ltd. (QSSL). However, any use, reproduction, modification, distribution - * or transfer of this software, or any software which includes or is based - * upon any of this code, is only permitted if expressly authorized by a - * written license agreement from QSSL. Contact the QNX Developer's Network - * or contact QSSL's legal department for more information. - * - * - * iostream.c - * - * This is a JNI implementation of access to standard i/o streams - */ -#include -#include -#include -#include -#include - -#include "SpawnerInputStream.h" -#include "SpawnerOutputStream.h" - - -#include "jni.h" - - -void ThrowByName(JNIEnv *env, const char *name, const char *msg); - -#define BUFF_SIZE (1024) - -/* Inaccessible static: skipBuffer */ -/* - * Class: SpawnerInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 - (JNIEnv * env, jobject proc, jint fd, jbyteArray buf, jint len) -{ - unsigned char tmpBuf[BUFF_SIZE]; - int nBuffOffset = 0; -// printf("Come to read0\n"); - while(len > nBuffOffset) - { - int nReadLen = min(len - nBuffOffset, BUFF_SIZE); - int nread; - nread = read(fd, tmpBuf, nReadLen); - if(nread > 0) - (*env) -> SetByteArrayRegion(env, buf, nBuffOffset, nReadLen, tmpBuf); - else - break; - nBuffOffset += nread; - if(nread != nReadLen) - break; - } -// printf("Leave read with %i bytes read\n", nBuffOffset); - return nBuffOffset; // This is a real full readed length - -} - -/* - * Class: SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 - (JNIEnv * env, jobject proc, jint fd) -{ - return close(fd); -} - -/* - * Class: SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv * env, jobject proc, jint fd, jbyteArray buf, jint len) -{ - unsigned char tmpBuf[BUFF_SIZE]; - int nBuffOffset = 0; -// int rc = 0; -// printf("Come to write0, len = %i\n", len); - while(len > nBuffOffset) - { - int nWriteLen = min(len - nBuffOffset, BUFF_SIZE); - (*env) -> GetByteArrayRegion(env, buf, nBuffOffset, nWriteLen, tmpBuf); -// printf("Write %i bytes; last byte = %#x\n", nWriteLen, (int)tmpBuf[nWriteLen - 1]); - if(nWriteLen != write(fd, tmpBuf, nWriteLen)) - { -// printf("Error: written %i bytes; errno = %i, fd = %i, len = %i ", nWriteLen, errno, fd, rc); - ThrowByName(env, "java/io/IOException", strerror(errno)); - } - nBuffOffset += nWriteLen; - } - return 0; -} - -/* - * Class: SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv * env, jobject proc, jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c b/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c deleted file mode 100644 index a6c1cef581f..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/spawner.c +++ /dev/null @@ -1,266 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Spawner.h" - -typedef JNIEXPORT void * (JNICALL * JVM_GetThreadInterruptEvent)(); -typedef JNIEXPORT char * (JNICALL * JVM_NativePath)(const char *); - -void ThrowByName(JNIEnv *env, const char *name, const char *msg); -void * GetJVMProc(char * vmlib, char * procName); - -static void * hVM = NULL; /* Java Virtual Machine handler. */ - -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv * env, jobject proc, jobjectArray cmdArray, jobjectArray envp, jstring dir, jintArray channels) -{ - int fd_map[3]; /* File descriptors. */ - int fd_ret[3]; /* File descriptors that we return to Java. */ - int fd[2]; /* Pipe open structure. */ - int i; - int nParms = 0;/* Number of parameters. */ - int nEnvs = 0;/* Number of environment variables. */ - char ** pParms = NULL; /* Parameters. */ - char ** pEnvs = NULL; /* Environment variables. */ - char * pCommand = NULL; /* Command to execute. */ - char cwd[PATH_MAX + 1]; /* Current working directory. */ - pid_t pid; /* Process ID. */ - struct inheritance inherit; - - if ((cmdArray == NULL) || ((nParms = (*env)->GetArrayLength(env, cmdArray)) == 0)) - ThrowByName(env, "java/lang/IOException", "No command line specified"); - - for (i = 0; i < 3; ++i) { - if (EOK != pipe(fd)) - ThrowByName(env, "java/io/IOException", "Cannot create pipe for spawner"); - if (0 == i) { - fd_map[i] = fd[0]; - fd_ret[i] = fd[1]; - } else { - fd_map[i] = fd[1]; - fd_ret[i] = fd[0]; - } - } - - if (nParms > 0) { - pParms = malloc(sizeof(char *) * (nParms + 1)); - for (i = 0; i < nParms; ++i) { - jobject item = (*env)->GetObjectArrayElement(env, cmdArray, i); - const char *str = (*env)->GetStringUTFChars(env, item, 0); - if (i == 0) - pCommand = strdup(str); - pParms[i] = strdup(str); - (*env)->ReleaseStringUTFChars(env, item, str); - } - pParms[i] = NULL; - } - - nEnvs = (*env) -> GetArrayLength(env, envp); - if (nEnvs > 0) { - pEnvs = malloc(sizeof(char *) * (nEnvs + 1)); - for (i = 0; i < nEnvs; ++i) { - jobject item = (*env)->GetObjectArrayElement(env, envp, i); - const char *str = (*env)->GetStringUTFChars(env, item, 0); - pEnvs[i] = strdup(str); - (*env)->ReleaseStringUTFChars(env, item, str); - } - pEnvs[i] = NULL; - } - - if (dir != 0) { - char *item = (char *)(*env)->GetStringUTFChars(env, dir, 0); - getcwd(cwd, sizeof(cwd)); - chdir(item); - (*env)->ReleaseStringUTFChars(env, dir, item); - } - - /* Nothing for now. */ - memset(&inherit, 0, sizeof(inherit)); - inherit.flags = SPAWN_SETGROUP; - inherit.pgroup = SPAWN_NEWPGROUP; - - pid = spawnp(pCommand, 3, fd_map, &inherit, pParms, pEnvs); - - if (dir != 0) /* Restore working directory. */ - chdir(cwd); - - for (i = 0; i < 3; ++i) { - close(fd_map[i]); - } - - if (-1 == pid) { /* Failed - close pipes. */ - for (i = 0; i < 3; ++i) { - close(fd_ret[i]); - } - } else { /* Success - return pipes to Java. */ - (*env) -> SetIntArrayRegion(env, channels, 0, 3, fd_ret); - } - - /* Free Parameters. */ - if (pParms != NULL) { - int j; - for (j = 0; pParms[j] != NULL; j++) { - if (pParms[j] != NULL) { - free(pParms[j]); - } - } - free(pParms); - } - - /* Free Environment variables. */ - if (pEnvs != NULL) { - int j; - for (j = 0; pEnvs[j] != NULL; j++) { - if (pEnvs[j] != NULL) { - free(pEnvs[j]); - } - } - free(pEnvs); - } - - /* Free Command to execute. */ - if (pCommand != NULL) { - free(pCommand); - } - - return pid; - -} - -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv * env, jobject proc, jobjectArray cmdArray, jobjectArray envp, jstring dir) -{ - int i; - int nParms = 0;// Number of parameters - int nEnvs = 0;// Number of environment variables - char ** pParms = NULL; // Parameters - char ** pEnvs = NULL; // Environment variables - char * pCommand = NULL; // Command to execute - char * pwd = 0; // Process working directory - char cwd[PATH_MAX + 1]; // Current working directory - pid_t pid; // Process ID - struct inheritance inherit; - - if ((cmdArray == 0) || ((nParms = (*env) -> GetArrayLength(env, cmdArray)) == 0)) - ThrowByName(env, "java/lang/NullPointerException", "No command line specified"); - - if(nParms > 0) - { - pParms = malloc(sizeof(char *) * (nParms + 1)); - for(i = 0; i < nParms; ++i) - { - jobject item = (*env) -> GetObjectArrayElement(env, cmdArray, i); - const char * str = (*env) -> GetStringUTFChars(env, item, 0); - if(i == 0) - pCommand = strdup(str); - pParms[i] = strdup(str); - (*env) -> ReleaseStringUTFChars(env, item, str); - } - pParms[i] = NULL; - } - nEnvs = (*env) -> GetArrayLength(env, envp); - if(nEnvs > 0) - { - pEnvs = malloc(sizeof(char *) * (nEnvs + 1)); - for(i = 0; i < nEnvs; ++i) - { - jobject item = (*env) -> GetObjectArrayElement(env, envp, i); - const char * str = (*env) -> GetStringUTFChars(env, item, 0); - pEnvs[i] = strdup(str); - (*env) -> ReleaseStringUTFChars(env, item, str); - } - pEnvs[i] = NULL; - } - - if (dir != 0) - { - char * item; - pwd = strdup(item = (char *)(*env) -> GetStringUTFChars(env, dir, 0)); - getcwd(cwd, sizeof(cwd)); - chdir(pwd); - (*env) -> ReleaseStringUTFChars(env, dir, item); - } - - // Nothing for now - memset(&inherit, 0, sizeof(inherit)); - inherit.flags = SPAWN_SETGROUP; - inherit.pgroup = SPAWN_NEWPGROUP; - - - pid = spawnp(pCommand, 0, NULL, &inherit, pParms, pEnvs); - - - if(dir != 0) // Restore working directory - chdir(cwd); - - return pid; - -} - -/* - * Class: com_qnx_tools_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv * env, jobject proc, jint pid, jint sig) -{ - return kill(pid, sig); -} - -/* - * Class: com_qnx_tools_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv * env, jobject proc, jint pid) -{ - int ret; - int val = -1; - - ret = waitpid(pid, &stat_loc, WEXITED); - if (ret == -1 && errno == EINTR) { - // Throw an exception here. - } - if (WIFEXITED(stat_loc)) { - val = WEXITSTATUS(stat_loc); - } - return val; -} - - -// Utilities - -void ThrowByName(JNIEnv *env, const char *name, const char *msg) -{ - jclass cls = (*env)->FindClass(env, name); - - if (cls != 0) /* Otherwise an exception has already been thrown */ - (*env)->ThrowNew(env, cls, msg); - - /* It's a good practice to clean up the local references. */ - (*env)->DeleteLocalRef(env, cls); -} - - - -void * GetJVMProc(char * vmlib, char * procName) -{ - if(NULL == vmlib) - vmlib = "libj9vm14.so"; - if((NULL == hVM) || (NULL == procName)) - { - if(NULL == (hVM = dlopen(vmlib, 0))) - return NULL; - } - return dlsym(hVM, procName); -} diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/x86/Makefile b/core/org.eclipse.cdt.core.qnx/library/spawner/x86/Makefile deleted file mode 100644 index 6a18617612e..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/x86/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.qnx/library/spawner/x86/so/Makefile b/core/org.eclipse.cdt.core.qnx/library/spawner/x86/so/Makefile deleted file mode 100644 index cc399272607..00000000000 --- a/core/org.eclipse.cdt.core.qnx/library/spawner/x86/so/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.qnx/os/qnx/x86/libpty.so b/core/org.eclipse.cdt.core.qnx/os/qnx/x86/libpty.so deleted file mode 100644 index 6af6b21e775..00000000000 Binary files a/core/org.eclipse.cdt.core.qnx/os/qnx/x86/libpty.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.qnx/os/qnx/x86/libspawner.so b/core/org.eclipse.cdt.core.qnx/os/qnx/x86/libspawner.so deleted file mode 100644 index 8744bb15a6c..00000000000 Binary files a/core/org.eclipse.cdt.core.qnx/os/qnx/x86/libspawner.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessInfo.java b/core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessInfo.java deleted file mode 100644 index a72e310e324..00000000000 --- a/core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.qnx; - -import org.eclipse.cdt.core.IProcessInfo; - -/** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ProcessInfo implements IProcessInfo { - - int pid; - String name; - - public ProcessInfo(String pidString, String name) { - try { - pid = Integer.parseInt(pidString); - } catch (NumberFormatException e) { - } - this.name = name; - } - - public ProcessInfo(int pid, String name) { - this.pid = pid; - this.name = name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getPid() - */ - public int getPid() { - return pid; - } - -} diff --git a/core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessList.java b/core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessList.java deleted file mode 100644 index 87eae3fd318..00000000000 --- a/core/org.eclipse.cdt.core.qnx/src/org/eclipse/cdt/internal/core/qnx/ProcessList.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.eclipse.cdt.internal.core.qnx; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.IProcessInfo; -import org.eclipse.cdt.core.IProcessList; -import org.eclipse.cdt.utils.spawner.ProcessFactory; - -/** - * Insert the type's description here. - * @see IProcessList - */ -public class ProcessList implements IProcessList { - - ProcessInfo[] empty = new ProcessInfo[0]; - - public ProcessList() { - } - - /** - * Insert the method's description here. - * @see IProcessList#getProcessList - */ - public IProcessInfo [] getProcessList() { - Process pidin; - BufferedReader pidinOutput; - String[] args = {"pidin", "-fan" }; - - try { - pidin = ProcessFactory.getFactory().exec(args); - pidinOutput = new BufferedReader(new InputStreamReader(pidin.getInputStream())); - } catch(Exception e) { - return getProcessListPureJava(); - } - - //Read the output and parse it into an array list - ArrayList procInfo = new ArrayList(); - - String pidStr, nameStr, lastline; - try { - while((lastline = pidinOutput.readLine()) != null) { - //The format of the output should be - //PID a/slash/delimited/name - - StringTokenizer tok = new StringTokenizer(lastline.trim()); - pidStr = tok.nextToken(); - if(pidStr == null || pidStr.charAt(0) < '0' || pidStr.charAt(0) > '9') { - continue; - } - - nameStr = tok.nextToken(); - - int index = nameStr.lastIndexOf('/'); - if(index != -1) { - nameStr = nameStr.substring(index + 1); - } - - procInfo.add(new ProcessInfo(pidStr, nameStr)); - } - - pidin.destroy(); - } catch(Exception e) { - /* Ignore */ - } finally { - pidin.destroy(); - } - - return (IProcessInfo [])procInfo.toArray(new IProcessInfo[procInfo.size()]); - } - - /** - * This is our current backup strategy for getting the pid list - * (reading /proc directly). Currently the exename is not implemented - * so the names will all show up as unknown, but at least you get a - * pid list. - */ - private IProcessInfo [] getProcessListPureJava() { - File proc = new File("/proc"); - File[] pidFiles = null; - - // We are only interrested in the pid so filter the rest out. - try { - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - boolean isPID = false; - try { - Integer.parseInt(name); - isPID = true; - } catch (NumberFormatException e) { - } - return isPID; - } - }; - pidFiles = proc.listFiles(filter); - } catch (SecurityException e) { - } - - ProcessInfo[] processInfo = empty; - if (pidFiles != null) { - processInfo = new ProcessInfo[pidFiles.length]; - for (int i = 0; i < pidFiles.length; i++) { - File cmdLine = new File(pidFiles[i], "exename"); - StringBuffer line = new StringBuffer(); - try { - FileReader reader = new FileReader(cmdLine); - int c; - while ((c = reader.read()) > 0) { - line.append((char)c); - } - } catch (IOException e) { - } - String name = line.toString(); - if (name.length() == 0) { - name = "Unknown"; - } - processInfo[i] = new ProcessInfo(pidFiles[i].getName(), name); - } - } else { - pidFiles = new File[0]; - } - return processInfo; - } -} diff --git a/core/org.eclipse.cdt.core.solaris/.classpath b/core/org.eclipse.cdt.core.solaris/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/core/org.eclipse.cdt.core.solaris/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core/org.eclipse.cdt.core.solaris/.cvsignore b/core/org.eclipse.cdt.core.solaris/.cvsignore deleted file mode 100644 index 693869726de..00000000000 --- a/core/org.eclipse.cdt.core.solaris/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -doc diff --git a/core/org.eclipse.cdt.core.solaris/.project b/core/org.eclipse.cdt.core.solaris/.project deleted file mode 100644 index d02ba7f9f05..00000000000 --- a/core/org.eclipse.cdt.core.solaris/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.core.solaris - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.core.solaris/ChangeLog b/core/org.eclipse.cdt.core.solaris/ChangeLog deleted file mode 100644 index 1208d1bd582..00000000000 --- a/core/org.eclipse.cdt.core.solaris/ChangeLog +++ /dev/null @@ -1,26 +0,0 @@ -2002-10-16 Alain Magloire - - * library/pfind.c: Reformat to be Unix format. - check with access() that the program is an executable. - - * library/exec_unix.c: Reformat to be Unix format. - Check with pfind() that the program is an executable. - - * os/solaris/sparc/libspawner.so: regenerated. - -2002-10-15 Alain Magloire - - * src/../internal/core/solaris/ProcessList.java: - (getProcessList): Trim the line before parsing it. - -2002-10-15 Alain Magloire - - Implement the ProcessList extension point for Solaris, by - spawning "ps -e -o pid,arg". This is use when - attaching to a running process with gdb. - - * src/org/eclipse/cdt/internal/core/solaris: - New Source folder created. - * src/../internal/core/solaris/ProcessInfo.java - src/../internal/core/solaris/ProcessList.java: - New file implements IProcessFactory. \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.solaris/build.properties b/core/org.eclipse.cdt.core.solaris/build.properties deleted file mode 100644 index 3c308d2f2d2..00000000000 --- a/core/org.eclipse.cdt.core.solaris/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/,\ - cdt_solaris.jar -src.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/ -source.cdt_solaris.jar = src/ diff --git a/core/org.eclipse.cdt.core.solaris/fragment.properties b/core/org.eclipse.cdt.core.solaris/fragment.properties deleted file mode 100644 index 0c7f66fa26f..00000000000 --- a/core/org.eclipse.cdt.core.solaris/fragment.properties +++ /dev/null @@ -1,2 +0,0 @@ -fragmentName=C/C++ Development Tools Core Solaris Fragment -providerName=Eclipse.org diff --git a/core/org.eclipse.cdt.core.solaris/fragment.xml b/core/org.eclipse.cdt.core.solaris/fragment.xml deleted file mode 100644 index 26b2ebec6fe..00000000000 --- a/core/org.eclipse.cdt.core.solaris/fragment.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.solaris/library/.cvsignore b/core/org.eclipse.cdt.core.solaris/library/.cvsignore deleted file mode 100644 index 5761abcfdf0..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.o diff --git a/core/org.eclipse.cdt.core.solaris/library/Makefile b/core/org.eclipse.cdt.core.solaris/library/Makefile deleted file mode 100644 index 034a966cfb7..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# makefile for libspawner.so - -#set JDK_INCLUDES -JDK_INCLUDES=/usr/java/include -JDK_OS_INCLUDES=/usr/java/include/solaris - -CC=gcc -CPPFLAGS = -I. -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES) -CFLAGS +=-fpic -D_REENTRANT - -LIB_NAME_SPAWNER = libspawner.so -LIB_NAME_FULL_SPAWNER = ../os/solaris/sparc/libspawner.so -OBJS_SPAWNER=spawner.o io.o exec_unix.o pfind.o - -LIB_NAME_PTY = libpty.so -LIB_NAME_FULL_PTY = ../os/solaris/sparc/libpty.so -OBJS_PTY=openpty.o pty.o ptyio.o - -all: $(LIB_NAME_FULL_SPAWNER) $(LIB_NAME_FULL_PTY) - -$(LIB_NAME_FULL_SPAWNER): $(OBJS_SPAWNER) - $(CC) -g -shared -Wl,-soname,$(LIB_NAME_SPAWNER) -o $(LIB_NAME_FULL_SPAWNER) $(OBJS_SPAWNER) -lc - -$(LIB_NAME_FULL_PTY): $(OBJS_PTY) - $(CC) -g -shared -Wl,-soname,$(LIB_NAME_PTY) -o $(LIB_NAME_FULL_PTY) $(OBJS_PTY) - -clean : - $(RM) $(OBJS_SPAWNER) $(LIB_NAME_FULL_SPAWNER) - $(RM) $(OBJS_PTY) $(LIB_NAME_FULL_PTY) diff --git a/core/org.eclipse.cdt.core.solaris/library/PTY.h b/core/org.eclipse.cdt.core.solaris/library/PTY.h deleted file mode 100644 index fabf58152d0..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/PTY.h +++ /dev/null @@ -1,21 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTY */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTY -#define _Included_org_eclipse_cdt_utils_pty_PTY -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTY - * Method: forkpty - * Signature: ()I - */ -JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_forkpty - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/PTYInputStream.h b/core/org.eclipse.cdt.core.solaris/library/PTYInputStream.h deleted file mode 100644 index e7349272b56..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/PTYInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE -#define org_eclipse_cdt_utils_pty_PTYInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/PTYOutputStream.h b/core/org.eclipse.cdt.core.solaris/library/PTYOutputStream.h deleted file mode 100644 index fb28491060e..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/PTYOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */ - -#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/Spawner.h b/core/org.eclipse.cdt.core.solaris/library/Spawner.h deleted file mode 100644 index 01ffb3cc1b2..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/Spawner.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_Spawner */ - -#ifndef _Included_com_qnx_tools_utils_spawner_Spawner -#define _Included_com_qnx_tools_utils_spawner_Spawner -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv *, jobject, jint, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/SpawnerInputStream.h b/core/org.eclipse.cdt.core.solaris/library/SpawnerInputStream.h deleted file mode 100644 index 3b32d2b2806..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/SpawnerInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE -#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/SpawnerOutputStream.h b/core/org.eclipse.cdt.core.solaris/library/SpawnerOutputStream.h deleted file mode 100644 index f835947e060..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/SpawnerOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/exec0.h b/core/org.eclipse.cdt.core.solaris/library/exec0.h deleted file mode 100644 index 32b01526e36..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/exec0.h +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include -#include - -extern pid_t exec0(const char *path, char *const argv[], - char *const envp[], const char *dirpath, - int channels[3] ); - -extern int wait0(pid_t pid); diff --git a/core/org.eclipse.cdt.core.solaris/library/exec_unix.c b/core/org.eclipse.cdt.core.solaris/library/exec_unix.c deleted file mode 100644 index 3c3db7926b0..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/exec_unix.c +++ /dev/null @@ -1,135 +0,0 @@ -#include "exec0.h" -#include -#include -#include -#include -#include -#include -#include - -/* from pfind.c */ -extern char *pfind(const char *name); - -pid_t -exec0(const char *path, char *const argv[], char *const envp[], - const char *dirpath, int channels[3]) -{ - int pipe0[2], pipe1[2], pipe2[2]; - pid_t childpid; - char *full_path; - - /* - * We use pfind() to check that the program exists and is an executable. - * If not pass the error up. - */ - full_path = pfind(path); - if (full_path == NULL) { - fprintf(stderr, "Unable to find full path for \"%s\"\n", path); - return -1; - } - - /* - * Make sure we can create our pipes before forking. - */ - if (channels != NULL) { - if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) { - fprintf(stderr, "%s(%d): returning due to error.\n", - __FUNCTION__, __LINE__); - free(full_path); - return -1; - } - } - - childpid = fork1(); - - if (childpid < 0) { - fprintf(stderr, "%s(%d): returning due to error: %s\n", - __FUNCTION__, __LINE__, strerror(errno)); - free(full_path); - return -1; - } else if (childpid == 0) { /* child */ - char *ptr; - - chdir(dirpath); - - if (channels != NULL) { - /* Close the write end of pipe0 */ - if (close(pipe0[1]) == -1) - perror("close(pipe0[1])"); - - /* Close the read end of pipe1 */ - if (close(pipe1[0]) == -1) - perror("close(pipe1[0])"); - - /* Close the read end of pipe2 */ - if (close(pipe2[0]) == -1) - perror("close(pipe2[0]))"); - - /* redirections */ - dup2(pipe0[0], STDIN_FILENO); /* dup stdin */ - dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */ - dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ - } - - /* Close all the fd's in the child */ - { - int fdlimit = sysconf(_SC_OPEN_MAX); - int fd = 3; - - while (fd < fdlimit) - close(fd++); - } - - if (envp[0] == NULL) { - execv(full_path, argv); - } else { - execve(full_path, argv, envp); - } - - _exit(127); - - } else if (childpid != 0) { /* parent */ - - char b; - - if (channels != NULL) { - /* close the read end of pipe1 */ - if (close(pipe0[0]) == -1) - perror("close(pipe0[0])"); - - /* close the write end of pipe2 */ - if (close(pipe1[1]) == -1) - perror("close(pipe1[1])"); - - /* close the write end of pipe2 */ - if (close(pipe2[1]) == -1) - perror("close(pipe2[1])"); - - channels[0] = pipe0[1]; /* Output Stream. */ - channels[1] = pipe1[0]; /* Input Stream. */ - channels[2] = pipe2[0]; /* Input Stream. */ - } - - free(full_path); - return childpid; - } - - free(full_path); - return -1; /*NOT REACHED */ -} - - -int wait0(pid_t pid) -{ - int status; - int val = -1; - - if (pid < 0 || waitpid(pid, &status, 0) < 0) - return -1; - - if (WIFEXITED(status)) { - val = WEXITSTATUS(status); - } - - return val; -} diff --git a/core/org.eclipse.cdt.core.solaris/library/io.c b/core/org.eclipse.cdt.core.solaris/library/io.c deleted file mode 100644 index f81ff6db9df..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/io.c +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class org_eclipse_cdt_utils_spawner_SpawnerInputStream */ -/* Header for class org_eclipse_cdt_utils_spawner_SpawnerOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.solaris/library/openpty.c b/core/org.eclipse.cdt.core.solaris/library/openpty.c deleted file mode 100644 index e3908ff42d5..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/openpty.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/** - * This is taken from R. W. Stevens book. - * Alain Magloire. - */ - -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); - -int -openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) -{ - char line[20]; - line[0]=0; - *amaster = ptym_open(line); - if (*amaster < 0) - return -1; - *aslave = ptys_open(*amaster, line); - if (*aslave < 0) { - close(*amaster); - return -1; - } - if (name) - strcpy(name, line); -#ifndef TCSAFLUSH -#define TCSAFLUSH TCSETAF -#endif - if (termp) - (void) tcsetattr(*aslave, TCSAFLUSH, termp); -#ifdef TIOCSWINSZ - if (winp) - (void) ioctl(*aslave, TIOCSWINSZ, (char *)winp); -#endif - return 0; -} - -int -ptym_open(char * pts_name) -{ - int fdm; - char *ptr; - - strcpy(pts_name, "/dev/ptmx"); - fdm = open(pts_name, O_RDWR); - if (fdm < 0) - return -1; - if (fdm < 0) - return -1; - if (grantpt(fdm) < 0) { /* grant access to slave */ - close(fdm); - return -2; - } - if (unlockpt(fdm) < 0) { /* clear slave's lock flag */ - close(fdm); - return -3; - } - ptr = ptsname(fdm); - if (ptr == NULL) { /* get slave's name */ - close (fdm); - return -4; - } - strcpy(pts_name, ptr); /* return name of slave */ - return fdm; /* return fd of master */ -} - -int -ptys_open(int fdm, char * pts_name) -{ - int fds; - /* following should allocate controlling terminal */ - fds = open(pts_name, O_RDWR); - if (fds < 0) { - close(fdm); - return -5; - } - if (ioctl(fds, I_PUSH, "ptem") < 0) { - printf("pterm:%s\n", strerror(errno)); - close(fdm); - close(fds); - return -6; - } - if (ioctl(fds, I_PUSH, "ldterm") < 0) { - printf("ldterm %s\n", strerror(errno)); - close(fdm); - close(fds); - return -7; - } - return fds; -} diff --git a/core/org.eclipse.cdt.core.solaris/library/openpty.h b/core/org.eclipse.cdt.core.solaris/library/openpty.h deleted file mode 100644 index fd7b7be1b2f..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/openpty.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -#ifndef _OPENPTY_H -#define _OPENPTY_H -int ptym_open (char *pts_name); -int ptys_open (int fdm, char * pts_name); -#endif diff --git a/core/org.eclipse.cdt.core.solaris/library/pfind.c b/core/org.eclipse.cdt.core.solaris/library/pfind.c deleted file mode 100644 index 7f7300c4954..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/pfind.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * pfind.c - Search for a binary in $PATH. - */ - -#include -#include -#include -#include -#include - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - - -char *pfind(const char *name) -{ - char *tok; - char *sp; - char *path; - char fullpath[PATH_MAX+1]; - - if (name == NULL) { - fprintf(stderr, "pfind(): Null argument.\n"); - return NULL; - } - - /* For absolute namer or name with a path, check if it is an executable. */ - if (name[0] == '/' || name[0] == '.') { - if (access(name, X_OK | R_OK) == 0) { - return strdup(name); - } - return NULL; - } - - /* Search in the PATH environment. */ - path = getenv("PATH"); - if (path == NULL || strlen(path) <= 0) { - fprintf(stderr, "Unable to get $PATH.\n"); - return NULL; - } - - // The value return by getenv() is readonly */ - path = strdup(path); - - tok = strtok_r(path, ":", &sp); - while (tok != NULL) { - snprintf(fullpath, sizeof(fullpath) - 1, "%s/%s", tok, name); - - if (access(fullpath, X_OK | R_OK) == 0) { - free(path); - return strdup(fullpath); - } - - tok = strtok_r(NULL, ":", &sp); - } - - free(path); - return NULL; -} - -#ifdef BUILD_WITH_MAIN -int main(int argc, char **argv) -{ - int i; - char *fullpath; - - for (i = 1; i= 0) { - /* Get a reference to the obj's class */ - cls = (*env)->GetObjectClass(env, jobj); - - /* Set the master fd. */ - fid = (*env)->GetFieldID(env, cls, "master", "I"); - if (fid == NULL) { - return NULL; - } - (*env)->SetIntField(env, jobj, fid, (jint)master); - - /* Create a new String for the slave. */ - jstr = (*env)->NewStringUTF(env, line); - } - return jstr; -} diff --git a/core/org.eclipse.cdt.core.solaris/library/ptyio.c b/core/org.eclipse.cdt.core.solaris/library/ptyio.c deleted file mode 100644 index 0024cf0a1b3..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/ptyio.c +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include -#include -#include - -/* Header for class _org_eclipse_cdt_utils_pty_PTYInputStream */ -/* Header for class _org_eclipse_cdt_utils_pty_PTYOutputStream */ - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int fd; - int status; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = read( fd, data, data_len ); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - if (status == 0) { - /* EOF. */ - status = -1; - } else if (status == -1) { - /* Error, toss an exception */ - jclass exception = (*env)->FindClass(env, "java/io/IOException"); - if (exception == NULL) { - /* Give up. */ - return -1; - } - (*env)->ThrowNew(env, exception, "read error"); - } - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: write0 - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0(JNIEnv * env, - jobject jobj, - jint jfd, - jbyteArray buf, - jint buf_len) -{ - int status; - int fd; - jbyte *data; - int data_len; - - data = (*env)->GetByteArrayElements(env, buf, 0); - data_len = buf_len; - fd = jfd; - - status = write(fd, data, data_len); - (*env)->ReleaseByteArrayElements(env, buf, data, 0); - - return status; -} - - -/* - * Class: org_eclipse_cdt_utils_pty_PTYOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNIEnv * env, - jobject jobj, - jint fd) -{ - return close(fd); -} diff --git a/core/org.eclipse.cdt.core.solaris/library/spawner.c b/core/org.eclipse.cdt.core.solaris/library/spawner.c deleted file mode 100644 index 2671bcd1f0c..00000000000 --- a/core/org.eclipse.cdt.core.solaris/library/spawner.c +++ /dev/null @@ -1,219 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "exec0.h" -#include - - -#define DEBUGIT 0 - - -/* - * Header for class com_qnx_utils_spawner_Spawner - */ - - -#if DEBUGIT -static void print_array(char **c_array) -{ - if (c_array) { - char **p = c_array; - for (; *p; p++) { - if (*p) { - fprintf(stderr, " %s", *p); - } - } - } else { - fprintf(stderr, "null"); - } - fprintf(stderr, "\n"); -} -#endif - - -static char **alloc_c_array(JNIEnv * env, jobjectArray j_array) -{ - int i; - jint c_array_size = (*env)->GetArrayLength(env, j_array); - char **c_array = calloc(c_array_size + 1, sizeof(*c_array)); - - if (c_array == NULL) - return NULL; - - for (i = 0; i < c_array_size; i++) { - jstring j_str = - (jstring) (*env)->GetObjectArrayElement(env, j_array, i); - const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL); - c_array[i] = (char *) strdup(c_str); - (*env)->ReleaseStringUTFChars(env, j_str, c_str); - (*env)->DeleteLocalRef(env, j_str); - } - - return c_array; -} - - -static void free_c_array(char **c_array) -{ - if (c_array) { - char **p = c_array; - for (; *p; p++) { - if (*p) { - free(*p); - } - } - free(c_array); - } -} - - -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj, - jobjectArray jcmd, - jobjectArray jenv, - jstring jdir) -{ - const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); - char **cmd; - char **envp; - int fd[3]; - pid_t pid = -1; - - cmd = alloc_c_array(env, jcmd); - if (cmd == NULL) - goto bail_out; - - envp = alloc_c_array(env, jenv); - if (envp == NULL) - goto bail_out; - -#if DEBUGIT - fprintf(stderr, "command:"); - print_array(cmd); - fprintf(stderr, "Envp:"); - print_array(envp); - fprintf(stderr, "dirpath: %s\n", dirpath); -#endif - - pid = exec0(cmd[0], cmd, envp, dirpath, NULL); - if (pid < 0) - goto bail_out; - - bail_out: - (*env)->ReleaseStringUTFChars(env, jdir, dirpath); - if (cmd) - free_c_array(cmd); - if (envp) - free_c_array(envp); - return pid; -} - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj, - jobjectArray jcmd, - jobjectArray jenv, - jstring jdir, - jintArray jchannels) -{ - jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); - const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); - char **cmd; - char **envp; - int fd[3]; - pid_t pid = -1; - - if (channels == NULL) - goto bail_out; - - cmd = alloc_c_array(env, jcmd); - if (cmd == NULL) - goto bail_out; - - envp = alloc_c_array(env, jenv); - if (envp == NULL) - goto bail_out; - -#if DEBUGIT - fprintf(stderr, "command:"); - print_array(cmd); - fprintf(stderr, "Envp:"); - print_array(envp); - fprintf(stderr, "dirpath: %s\n", dirpath); -#endif - - pid = exec0(cmd[0], cmd, envp, dirpath, fd); - if (pid < 0) - goto bail_out; - - channels[0] = fd[0]; - channels[1] = fd[1]; - channels[2] = fd[2]; - - bail_out: - (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); - (*env)->ReleaseStringUTFChars(env, jdir, dirpath); - if (cmd) - free_c_array(cmd); - if (envp) - free_c_array(envp); - return pid; -} - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj, - jint pid, jint sig) -{ - int status = -1; - - switch (sig) { - case 0: /* NOOP */ - status = kill(pid, 0); - break; - - case 2: /* INTERRUPT */ - status = kill(pid, SIGINT); - break; - - case 9: /* KILL */ - status = kill(pid, SIGKILL); - break; - - case 15: /* TERM */ - status = kill(pid, SIGTERM); - break; - - default: - status = kill(pid, sig); /* WHAT ?? */ - break; - } - - return status; -} - - - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env, - jobject jobj, jint pid) -{ - return wait0(pid); -} diff --git a/core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libpty.so b/core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libpty.so deleted file mode 100644 index 33ba3c70d63..00000000000 Binary files a/core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libpty.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libspawner.so b/core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libspawner.so deleted file mode 100644 index 70f2acab3c1..00000000000 Binary files a/core/org.eclipse.cdt.core.solaris/os/solaris/sparc/libspawner.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessInfo.java b/core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessInfo.java deleted file mode 100644 index 7455dbbbfb4..00000000000 --- a/core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.solaris; - -import org.eclipse.cdt.core.IProcessInfo; - -/** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ProcessInfo implements IProcessInfo { - - int pid; - String name; - - public ProcessInfo(String pidString, String name) { - try { - pid = Integer.parseInt(pidString); - } catch (NumberFormatException e) { - } - this.name = name; - } - - public ProcessInfo(int pid, String name) { - this.pid = pid; - this.name = name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getPid() - */ - public int getPid() { - return pid; - } - -} diff --git a/core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessList.java b/core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessList.java deleted file mode 100644 index 311bac138ba..00000000000 --- a/core/org.eclipse.cdt.core.solaris/src/org/eclipse/cdt/internal/core/solaris/ProcessList.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.eclipse.cdt.internal.core.solaris; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.ArrayList; - -import org.eclipse.cdt.core.IProcessInfo; -import org.eclipse.cdt.core.IProcessList; -import org.eclipse.cdt.utils.spawner.ProcessFactory; - -/** - * Insert the type's description here. - * @see IProcessList - */ -public class ProcessList implements IProcessList { - - ProcessInfo[] empty = new ProcessInfo[0]; - - public ProcessList() { - } - - /** - * Insert the method's description here. - * @see IProcessList#getProcessList - */ - public IProcessInfo [] getProcessList() { - Process ps; - BufferedReader psOutput; - String[] args = {"/usr/bin/ps", "-e", "-o", "pid,args"}; - - try { - ps = ProcessFactory.getFactory().exec(args); - psOutput = new BufferedReader(new InputStreamReader(ps.getInputStream())); - } catch(Exception e) { - return new IProcessInfo[0]; - } - - //Read the output and parse it into an array list - ArrayList procInfo = new ArrayList(); - - try { - String lastline; - while ((lastline = psOutput.readLine()) != null) { - //The format of the output should be - //PID space name - - lastline = lastline.trim(); - int index = lastline.indexOf(' '); - if (index != -1) { - String pidString = lastline.substring(0, index).trim(); - try { - int pid = Integer.parseInt(pidString); - String arg = lastline.substring(index + 1); - procInfo.add(new ProcessInfo(pid, arg)); - } catch (NumberFormatException e) { - } - } - } - - } catch(Exception e) { - /* Ignore */ - } - - ps.destroy(); - return (IProcessInfo [])procInfo.toArray(new IProcessInfo[procInfo.size()]); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/.classpath b/core/org.eclipse.cdt.core.tests/.classpath deleted file mode 100644 index 362b81cae72..00000000000 --- a/core/org.eclipse.cdt.core.tests/.classpath +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.tests/.cvsignore b/core/org.eclipse.cdt.core.tests/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/core/org.eclipse.cdt.core.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/core/org.eclipse.cdt.core.tests/.project b/core/org.eclipse.cdt.core.tests/.project deleted file mode 100644 index 873e177f7c8..00000000000 --- a/core/org.eclipse.cdt.core.tests/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.cdt.core.tests - - - org.eclipse.cdt.core - org.eclipse.cdt.make.core - org.eclipse.cdt.managedbuilder.core - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - - diff --git a/core/org.eclipse.cdt.core.tests/ChangeLog b/core/org.eclipse.cdt.core.tests/ChangeLog deleted file mode 100644 index 113307aa711..00000000000 --- a/core/org.eclipse.cdt.core.tests/ChangeLog +++ /dev/null @@ -1,1326 +0,0 @@ -2004-01-13 John Camelon - Updated ContextualParseTest to accommodate bugfixes 48909 & 49702. - -2004-01-08 Andrew Niefer - Added CompleteParseASTTest.testBug43110_XRef - Added ParserSymbolTableTest.testBug43110_Ellipses - Added ParserSymbolTableTest.testBug43110_EllipsesRanking - Added ParserSymbolTableTest.testBug43110_EllipsesRanking_2 - -2004-01-08 Andrew Niefer - Added CompleteParseASTTest::testBug48307_FriendFunction_1 - Added CompleteParseASTTest::testBug48307_FriendFunction_2 - -2004-01-06 Andrew Niefer - Added ContextualParseTest::testCompletionLookup_LookupKindTHIS - -2004-01-06 John Camelon - Added CompleteParseASTTest::testBug43110() and QuickParseASTTests::testBug43110(). - -2003-12-31 Hoda Amer - Small change to test parameters with initial clause in ITemplateTest - -2003-12-22 Hoda Amer - Temporary disabled completion proposal test until a better test is written. - -2003-12-17 Andrew Niefer - test changes for content assist - added ContextualParseTest.testCompletionLookup_FriendClass_1() - added ContextualParseTest.testCompletionLookup_FriendClass_2() - added ContextualParseTest.testCompletionLookup_ParametersAsLocalVariables() - modified ParserSymbolTableTest.testVisibilityDetermination() - -2003-12-17 Hoda Amer - Small modifications to cope with the new interfaces - -2003-12-15 Andrew Niefer - added ContextualParseTest.testCompletionLookup_Unqualified - added ContextualParseTest.testCompletionLookup_Qualified - added ContextualParseTest.testCompletionLookup_Pointer - -2003-12-12 John Camelon - Updated testBaseCase_SimpleDeclaration() for keyword assertions. - -2003-12-11 John Camelon - Expanded ContextualParseTest::testBaseCase(). - Updated tests to deal with new signatures/exceptions. - -2003-12-11 Alain Magloire - - New test files for the ICPathEntry in core model. - - * model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java - -2003-12-09 Andrew Niefer - added ParserSymbolTableTests.testVisibilityDetermination() - added ParserSymbolTableTests.testPrefixFiltering - -2003-12-09 Hoda Amer - Modified the Completion Proposal test to include case sensitivity - in the order of proposals. - -2003-12-09 John Camelon - Added ContextualParseTest.java and some test cases. - -2003-12-04 John Camelon - Removed some warnings. - Moved testBug39678() from ASTFailedTests to QuickParseASTTests. - -2003-12-03 Andrew Niefer - -modified FailedCompleteParseASTTest.testPMDotStarPointerToMemberFunction_Bug43242 - .testPMArrowStarPointerToMemberFunction_Bug43242 - .testPMDotStar_bug43579 - .testPMArrowStar_bug43579 - -created: FailedCompleteParseASTTest.testBug47926 - CompleteParseASTTest.testQualifiedLookup - ParserSymbolTableTest.testPrefixLookup_Ambiguities - ParserSymbolTableTest.testQualifiedUnqualifiedLookup - -modified resources/search/classDecl.cpp & include.h - -created FunctionMethodPatternTests.testLookupForDefinition - - -2003-11-27 Andrew Niefer - tests for Symbol table prefix lookup - ParserSymbolTableTest.testBug46882 - ParserSymbolTableTest.testPrefixLookup_Unqualified - ParserSymbolTableTest.testPrefixLookup_Qualified - ParserSymbolTableTest.testPrefixLookup_Inheritance - -2003-11-27 Andrew Niefer - add CompleteParseASTTest.testBug47624() - -2003-11-18 Andrew Niefer - update ParserSymbolTableTest to reflect refactoring of Declaration into 4 separate classes. - -2003-11-13 Hoda Amer - Added CompleteParseASTTest::testBug44342(): Failure to dereference function calls after a . or an -> - Moved testErrorHandling_1() to FailedCompleteParseASTTest - Added FailedCompleteParseASTTest::testBug44340():Inline functions fail to resolve references - -2003-11-06 Andrew Niefer - Remove dependancy on cdt.internal.ui.search.CSearchResultCollector in BaseSearchTest and DependencyTests - -2003-11-07 John Camelon - Moved testBug39554() from ASTFailedTests to QuickParseASTTests. - -2003-11-05 John Camelon - Added CompleteParseASTTest::testBug44838(). - Added CompleteParseASTTest::testBug46165(). - Added ScannerTestCase::testBug45551(). - -2003-11-05 John Camelon - Updated parser clients to use new ParserFactory (stand-alone parser work item). - -2003-11-05 John Camelon - Updated parser clients to use new IProblem strategy. - -2003-10-28 Andrew Niefer - Added testBug44510() to CompleteParseASTTest - Added testBug44925() to CompleteParseASTTest - Added testBug44510() to ParserSymbolTableTest - -2003-10-24 John Camelon - Added testBug45476() to ScannerTestCase. - Added testBug45477() to ScannerTestCase. - -2003-10-24 John Camelon - Moved testBug39542() from ASTFailedTests to QuickParseASTTests. - Moved testBug39549() from ASTFailedTests to QuickParseASTTests. - Added testCDesignatedInitializers() to CompleteParseASTTests. - Moved testBug39551A() from ASTFailedTests to QuickParseASTTests. - Moved testBug39551B() from ASTFailedTests to QuickParseASTTests. - Added testCBool() to QuickParseASTTests. - Added testBug39551A(), testBug39551B() and testCBool to CompleteParseTests. - -2003-10-22 Hoda Amer - Added offset checking in CModelElementsTest - -2003-10-21 John Camelon - Moved testBug40007() from ASTFailedTests to QuickParseASTTests. - Added QuickParseASTTests::testBug40759(). - Added QuickParseASTTests::testBug44633(). - Added ScannerTestCase::testBug44305(). - Added QuickParseASTTests::testBug41935(). - Moved testBug39525() from ASTFailedTests to QuickParseASTTests. - Added ScannerTestCase::testBug45287(). - Moved testBug39528() from ASTFailedTests to QuickParseASTTests. - Moved testBug39538() from ASTFailedTests to QuickParseASTTests. - Added QuickParseASTTests::testBug39536(). - Moved testBug39536A() from ASTFailedTests to QuickParseASTTests. - Moved testBug39536B() from ASTFailedTests to QuickParseASTTests. - -2003-10-20 David Inglis - - use project owner ID in plugin class - * build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java - - set gnu elf parser since it can read the debug info. - * model/org/eclipse/cdt/core/model/tests/BinaryTests.java - -2003-10-01 Andrew Niefer - added testBug43951 to CompleteParseASTTest - -2003-10-01 Andrew Niefer - modified OtherPatternTests.testBug42911() and renamed it testBug42911_43988 - -2003-10-01 Andrew Niefer - added testBug43450 to ManagedBuildTests.java - added a user include to plugin.xml - -2003-09-30 Sean Evoy - Fix for bug 41826. - Updated the plugin file so that tool specifications have the new attribute - for header files. The test for the managed builder now insure that those - values are properly read. - * plugin.xml - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-09-30 John Camelon - Updated CompleteParseASTTest::testBug42872() - Moved FailedCompleteParseASTTest::testBug43503() to CompleteParseASTTest::testBug43503A(). - -2003-09-30 Andrew Niefer - added testBug43503_AmbiguousUsing() and testBug43503_UnableToResolveFunction() to - ParserSymbolTableTest - -2003-09-30 Andrew Niefer - Updated OtherPatternTests::testMacroPattern() to test for bug43862 - -2003-09-29 Andrew Niefer - added testBug43062 and testConstructorDestructor to FunctionMethodPatternTests - modified resources/search/classDecl.cpp & include.h to include more operators and a constructor - & destructor - -2003-09-29 Hoda Amer - -Added testBug43679_A() & testBug43679_B() to CompleteParseASTTest - -Renamed FailedCompleteParseASTExpressionTest to FailedCompleteParseASTTest - -Added FailedCompleteParseASTTest::testBug43503() - -2003-09-29 Andrew Niefer - added testBug42911 to OtherPatternTests - -2003-09-29 Andrew Niefer - added testbug43834() to ParserSymbolTableTest - -2003-09-29 John Camelon - Added testErrorHandling_1() to CompleteParseASTTest.java. - -2003-09-26 John Camelon - Added QuickParseASTTests::testBug43644() & testBug43062(). - Moved ASTFailedTests::testBug39531() to QuickParseASTTests. - -2003-09-25 Sean Evoy - Bug 43220 test for the new option type and retrieval methods. - * plugin.xml - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-09-25 Andrew Niefer - -bug43129 - Cannot search for definitions of global variables - -added testbug43129() in OtherPatternTests - * resources/search/include.h - * resources/search/classDecl.cpp - * search/org/eclipse/cdt/core/search/tests/OtherPatternTests.java - -2003-09-25 Bogdan Gheorghe - - separated dependency tests from the indexer tests - - modified the AutomatedIntegrationSuite to include new dependency - tests - - added the following tests: - * testDepTable - * testDepSourceChangeTree - * testDepHeaderChangeTree - * testDepHeaderChangeReindex - * testDepSourceChangeTable - * testDepHeaderChangeTable - -2003-09-25 Hoda Amer - Enabled CompleteParseASTExpressionTest.testPostfixTypenameIdentifier() - -2003-09-25 Andrew Niefer - added testNoResourceSearching() to OtherPatternTests - -2003-09-24 Hoda Amer - Added testNewTypeId(), testCastExpression(), testPostfixDynamicCast(), - testPostfixReinterpretCast(), testPostfixStaticCast(), and testPostfixConstCast() - to CompleteParseASTExpressionTest. - -2003-09-24 Sean Evoy - Changed the implementor of IScannerInfo to answer only absolute paths when asked for - includes paths. As a result, the managed builder test had to be updated to expect paths - in an OS-specific format. - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-09-24 John Camelon - Added testBug43375() to CompleteParseASTTest. - Moved testConditionalExpressionWithReferencesB_Bug43106 from failed tests to passed tests. - Moved testPMDotStar() and testPMArrowStar to failed tests w/defect number 43579. - -2003-09-23 John Camelon - Replaced ASTFailedTests::testBug39504A() with CompleteParseASTTest::testBug39504(). - Moved testPostfixTypeIdExpression2() && testPostfixTypeIdTypeId2() to CompleteParseASTExpressionTest. - Restructured expression reference tests so that the order of arrival will not cause JUnit failures. - -2003-09-23 Andrew Niefer - Added FunctionMethodPatternTests.testBug43498() - -2003-09-23 Hoda Amer - Added CompleteParseASTTest.testBug43373() - Added QuickParseASTTests.testBug43371() - -2003-09-23 Sean Evoy - As part of the fix for critical bug 43292, I had to add functionality to - the build model to remove configurations through an ITarget, and to set, - reset, and flag as default the make command associated with an ITarget. I - have updated the managed build test "testConfigurations" to exercise the - remove functionality. I added a test, "testMakeCommandManipulation" to - exercise the new make command functions in the interface. - * plugin.xml - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-09-22 Bogdan Gheorghe - - modified CompletionProposalsTests, BaseSearchTest - to avoid using isEnabled for the IndexManager - - Reordered the IndexManagerTests suite to allow all - tests to be run - -2003-09-22 Andrew Niefer - - modified resources/cfiles/CompletionProposalsTestStart.cpp - - modified CompletionProposalsTest.testCompletionProposals - - updated calls to SearchEngine.search - -2003-09-19 Sean Evoy - Updated the build test to check the binary parser specification in the - target specification. - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-09-18 Andrew Niefer - - removed testConditionalExpression_Bug43159 from FailedCompleteParseASTExpressionTest - and uncommented it (testConditionalExpression) in CompleteParseASTExpressionTest - - uncommented the following tests in CompleteParseASTExpressionTest : - testPostfixSubscript, testPostfixSubscriptA, testPostfixSubscriptB, - testPostfixSubscriptWithReferences - - updated ParserSymbolTableTests to use new addOperatorExpression function - - added testDerivedReference, testAddCopyConstructor to ParserSymbolTableTests - - fixed warning in ClassDeclarationPatternTests - -2003-09-17 Hoda Amer - Added more success test cases to CompleteParseASTExpressionTest - and more failure test cases to FailedCompleteParseASTExpressionTest - in testing PM_DOTSTAR, PM_ARROWSTAR, CONDITIONALEXPRESSION - -2003-09-16 Andrew Niefer - - modified resources/search/classDecl.cpp & include.h to include some operators - - added testOperators_bug43063_bug42979() to MethodDeclarationPatternTests - - added testParameterREferences to OtherPatternTests - -2003-09-16 Bogdan Gheorghe - Added asserts to all index lookups in IndexManagerTests - Fixed testAddNewFileToIndex - -2003-09-16 Hoda Amer - Added CompleteParseASTExpressionTest.testPrimaryThis() - -2003-09-15 John Camelon - Moved ASTFailedTests::testBug39556() to QuickParseASTTests. - Cleaned up some warnings in parser tests. - -2003-09-15 Andrew Niefer - added testGetConditionalOperand_bug43106 to ParserSymbolTableTests - -2003-09-15 John Camelon - Added CompleteParseASTTest::testBug42979(). - Updated CompleteParseASTTest::testAndrewsExample(). - -2003-09-13 Andrew Niefer - - added testBadParameterInfo to ParserSymbolTableTest - -2003-09-12 Hoda Amer - - Added lots of test cases to CompleteParseASTExpressionTest - -2003-09-12 John Camelon - Created QuickParseASTTests::testBug42985(). - Moved LokiFailures::testBug40419() to QuickParseASTTests. - Deleted LokiFailures as it was empty. - -2003-09-11 Andrew Niefer - Created search/SearchTestSuite - Added SearchTestSuite to AutomatedIntegrationSuite and removed the individual search tests - Added testReferencesInFunction to ClassDeclarationPatternTests - Modified resources/search/classDecl.cpp - Modified testNamespaceReferenceInClassBaseClause, testMacroPattern, testEnumerators, - testEnumeratorReferences in OtherPatternTests to test the Match result strings - -2003-09-11 John Camelon - Added CompleteParseASTTest::testBug42840() & testBug42872(). - Moved testBug39504B(), testBug39505A() & testBug39505B() from failed to QuickParse tests. - -2003-09-10 Sean Evoy - Added a test for resetting the value of a configuration to the defaults defined in the - plugin file. Work completed to resolve [Bug 41412] Restore Default in Managed Build - project's settings Not Working. - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-09-09 Hoda Amer - Moved three failed tests (bugs #42822, #42823, & #42822B) - from FailedCompleteParseASTExpressionTest to CompleteParseASTExpressionTest - -2003-09-09 John Camelon - Updated ScannerTestCase to keep up to date wrt ScannerException updates. - -2003-09-09 Andrew Niefer - Modified resources/search/classDecl.cpp - - to include more function declarations to test parameter matching - - to include an enumerator reference to test enumerators - Added testMethodDeclarationParameterMatching to FunctionMethodPatternTests.java - Added testEnumeratorReferences to OtherPatternTests - -2003-09-09 Hoda Amer - -Seperated the Expression result type test in a new file : completeParseASTExpressionTests. - -Added more test cases for simple types. - -Added FailedCompleteParseASTExpressionTest for failed reference tests. - -2003-09-08 John Camelon - Added CompleteParseASTTest::testThrowStatement(), testScoping(), testEnumeratorReferences(). - Removed LineNumberTest source as it is obsolete. - -2003-09-08 Andrew Niefer - Modified calls to ParserFactory to specify which language to use - Add CC nature to projects in BaseSearchTest & IndexManagerTests - -2003-09-05 Hoda Amer - Added tests to CompleteParseASTTest to test the expression result type - for function calls that reference variables with pointers (bug#42453). - -2003-09-05 John Camelon - Added CompleteParseASTTest::testSimpleIfStatement(), testSimpleWhileStatement(). - testSimpleSwitchStatement(), testSimpleDoStatement(). - -2003-09-05 Andrew Niefer - Added testEnumerators to OtherPatternTests.java - Modified resources/search/classDecl.cpp to include some enumerators - -2003-09-05 John Camelon - Updated CompleteParseASTTest::testSimpleForLoop() - -2003-09-04 John Camelon - Updated ASTFailedTests::testBug39702() to fail more accurately. - Added testSimpleFunctionBody(), testSimpleForLoop() to CompleteParseASTTest.java. - -2003-09-04 Andrew Niefer - Added testBug42541 to CompleParseASTTests.java - -2003-09-04 Hoda Amer - Call to ASTExpression getTypeId() changed to getTypeIdString(). - -2003-09-03 Andrew Niefer - Modified ParserSymbolTableTest.testConstructors to test > 2 constructors - -2003-09-03 John Camelon - Added testBug41445() to CompleteParseASTTests.java. - -2003-09-02 Hoda Amer - Modified CCompletionProposalsTest to complete on a body file - that includes a header file. - -2003-09-02 Andrew Niefer - added ParserSymbolTableTest.testNamespaceAlias() - added ParserSymbolTableTest.testUsingNamespaceAlias() - -2003-08-28 Andrew Niefer - Modified BaseSearchTest.setup to properly include the "include.h" file - -2003-08-28 Hoda Amer - - Added to completeParseASTTest testQualifiedNameReferences(), - testIsConstructor() and testIsDestructor(). - -2003-08-28 John Camelon - Moved bug39535 from failedTests to quickParse success tests. - -2003-08-25 John Camelon - Moved testBug39526() from ASTFailedTests.java to QuickParseASTTests.java. - Moved testBug41520() from FullParseFailedTests.java to CompleteParseASTTest.java - -2003-08-25 John Camelon - Updated TranslationUnitTests to not include K&R testing. - -2003-08-25 John Camelon - Added QuickParseASTTests::testBug39530(). - -2003-08-21 Hoda Amer - Enabled some tests in the IStructureTests, namely: - testGetFields(), testGetField(), testGetMethods(), testGetMethod(), - testIsAbstract(), testGetBaseTypes(), and testGetAccessControl(). - -2003-08-19 Sean Evoy - In order to properly support the indexing feature, the scanner has to - function as well as the version that ships with the toolset if possible. - This is made difficult by the fact that we are trying to be tool-agnostic. - One of the things that the scanner should take into account when it runs - is the "built-in" symbols and search paths that are defined for a compiler - in a given toolchain. While we need to come up with a standard mechanism - for the CDT in the future, the managed build system can provide a work-around - in the near-term. The easiest solution is to add an optional attribute to a - list element that flags the item as a built-in value. When clients like - the indexer query the build model, they will receive the union of the built-in - values and the user-defined values. - - Added built-in information to the existing plugin definition. Also added a - new include path and defined symol for updated test cases. - * plugin.xml - - Updated the test cases to check that built-ins defined in the plugin manifest - are properly read and dealt with during project creation and persisting settings. - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - -2003-08-20 Hoda Amer - Added testNewExpressions() to CompleteParseASTTest to test new expression's references. - -2003-08-14 John Camelon - Removed warnings from AutomatedIntegrationSuite.java (removing implicit accessor generation). - -2003-08-14 John Camelon - Added CompleteParseASTTest::testArrayModExpression(), testPointerVariable() & - testExceptionSpecification(). - -2003-08-13 John Camelon - Added testBug41520() to FullParseFailedTests.java. - Added testConstructorChain() to CompleteParseASTTest.java - -2003-08-13 John Camelon - Added testSimpleExpression(), testParameterExpressions() && - testNestedNamespaceExpression() to CompleteParseASTTest.java. - -2003-08-13 Sean Evoy - Renamed the 'AllBuildTest' class to 'ManagedBuildTest' and updated the - integration suite class. - * suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java - - This class is renamed. It also has a renamed method 'testProjectCreation' - that creates a project the same way the new project wizard does. It uses - the new discovery mechanism to find the scanner info provider. - * build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java - - Uses the new discovery mechanism to find the scanner info provider. - * build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java - -2003-08-12 Bogdan Gheorghe - Changed the order of tests in AutomatedIntegrationSuite to have - the indexing tests run last (the last indexing test shuts down - the indexing thread). - -2003-08-12 John Camelon - Added CompleteParseASTTest::testForewardDeclarationWithUsage(). - -2003-08-12 Hoda Amer - Added CompletionProposalsTest to the suit to test the generation - of completion proposals. - -2003-08-12 Bogdan Gheorghe - - Changed testVariableIndexPrefix, testVariableDeclaration to - reflect changes to the var search pattern - -2003-08-11 Andrew Niefer - - Added testMacroPattern to OtherPatternTests - - Changed the function tests to use new function/method pattern - -2003-08-11 Bogdan Gheorghe - - Added testMacros to IndexManagerTests - -2003-08-05 Andrew Niefer - - refactoring Parser Symbol Table function names - - added ParserSymbolTableTest.testConstructors() - -2003-08-01 Andrew Niefer - Added resources/search/header.h - Added ClassDeclarationPatternTests.testHeadersVisitedTwice() - Modified other search tests to reflect ICSearchResultCollector changes - -2003-07-31 Andrew Niefer - Added ParserSymbolTableTest.testForwardClassDeclaration - Added ParserSymbolTableTest.testForwardDeclarationUsedAsFunctionParam - -2003-07-31 Victor Mozgin - Moved testBug39540() from ASTFailedTests.java to QuickParseASTTests.java. - -2003-07-30 Hoda Amer - The CModelElementsTests has the pointer to function test back in its original place - (a variable) - -2003-07-30 Sean Evoy - * plugin.xml: - Updated the attribute names to reflect changes to the ManagedBuildInfo - extension point schema. - -2003-07-30 Victor Mozgin - Moved testBug39532() from ASTFailedTests.java to QuickParseASTTests.java. - -2003-07-29 John Camelon - Updated QuickParseASTTests for pointer to function updates. - Updated CompleteParseASTTests for typedef work. - -2003-07-28 Victor Mozgin - Moved testBug39546() from ASTFailedTests.java to QuickParseASTTests.java. - -2008-07-28 Andrew Niefer - -changes to resources/search/classDecl.cpp - -new search tests: - ClassDeclarationPatternTests.testClassReferenceInFieldType - ClassDeclarationPatternTests.testClassReferences - ClassDeclarationPatternTests.testEnumerationReferenceVisibleByInheritance - ClassDeclarationPatternTests.testGloballyQualifiedItem - ClassDeclarationPatternTests.testTypeReferenceVisibleByUsingDirective - FunctionMethodPatternTests.testMethodDeclaration - FunctionMethodPatternTests.testMethodDeclarationWithParams - OtherPatternTests.testFieldDeclaration - OtherPatternTests.testNamespaceDeclaration - OtherPatternTests.testNamespaceReferenceInClassBaseClause - OtherPatternTests.testNamespaceReferenceInUsingDirective - OtherPatternTests.testVariableDeclaration - -2003-07-28 John Camelon - Added/moved tests as necessary for bugfix 40842 & 40843. - -2003-07-28 Sean Evoy - In order to meet certain internal guidelines and to test the makefile - generator, the build model replied to some answers with hard-coded information. - This patch moves the information into the build model. - - * plugin.xml: - Added information to the target tags to test inheritence and - overridding the make command and clean command attributes. - - * build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java: - Added code to test the make command and clean command attributes in - Targets. Also added a test to insure that sub-sub targets inherit settings - properly. - -2003-07-28 Andrew Niefer - This patch creates a new failing test class : FullParseFailedTests. This - is for writing failed tests on the parser doing COMPLETE_PARSE. - -2003-07-28 Victor Mozgin - Moved testBug39537() from ASTFailedTests.java to QuickParseASTTests.java. - -2003-07-27 John Camelon - Fixed failedTests::testBug40714() to fail properly. - -2003-07-25 Bogdan Gheorghe - Added new indexer test for refs - -2003-07-25 Victor Mozgin - Moved testBug39553() from ASTFailedTests.java to QuickParseASTTests.java. - Fixed IIncludeTest.h and IIncludeTests.java with #include macro tests. - -2003-07-24 John Camelon - Updated CompleteParseASTTests for Method/Field updates. - Fixed TortureTest's parser mode switch (was always QuickParsing). - -2003-07-24 Hoda Amer - Moved part of the CModelElementsTest (Templates of Variables ) to the failed tests. - Moved the same test (Templates of Variables) from ITemplateTests to failed tests. - -2003-07-24 Hoda Amer - This patch updates the CModelBuilder to use the AST instead of the DOM. - -2003-07-24 John Camelon - Updated CompleteParseASTTests. - -2003-07-23 Andrew Niefer - -Created search/BaseSearchTest to handle creating projects and setting them up to use the indexer - -removed ClassSpecifierSearchTests, its functionality is now in BaseSearchTest - -modified ClassDeclarationPatternTests to extend BaseSearchTest - -added FunctionMethodPatternTests - -added OtherPatternTests - -modified indexer/IndexManagerTests.testIndexContents - -2003-07-22 John Camelon - Updated CompleteParseASTTests. - -2003-07-21 Bogdan Gheorghe - Added new indexer test for newly added declarations - -2003-07-21 John Camelon - Created CompleteParseASTTest and added it to ParserTestSuite. - -2003-07-18 John Camelon - Updated ParserSymbolTableTests to remove dependencies on parser.ast.full classes. - Updated Parser test suites for updates to ParserFactory. - -2003-07-18 John Camelon - Wrote new tests in QuickParseASTQualifiedNameTest.java and added it to ParserTestSuite's suite. - -2003-07-18 Peter Graves - Removed un-needed file that was using a Java 1.4 reserved keyword (assert) - -2003-07-17 John Camelon - Rewrote the entire DOMTests suite to now be AST tests. - Removed DOMTests, BaseDOMTest, DOMFailedTests after methods were migrated to QuickParseASTTests & ASTFailedTests. - Made sure every parser failed test had a defect number associated with it. - -2003-07-17 Victor Mozgin - Added PerformanceTests.java (not included into AutomatedIntegrationSuite). - Moved testBug39523() from DOMFailedTest.java to PerformanceTests.java. - Moved testBug39550() from DOMFailedTest.java to DOMTests.java. - Moved testBug39552A() and testBug39552B()from DOMFailedTest.java to DOMTests.java. - TortureTest overrides timeout value for a very time-consuming test ('concat1.C'). - -2003-07-15 Victor Mozgin - Moved testBug39349() from DOMFailedTest.java to DOMTests.java. - Moved testBug39544() from DOMFailedTest.java to DOMTests.java. - -2003-07-14 Victor Mozgin - Added failed tests that correspond to recently reported PRs. - -2003-07-11 Bogdan Gheorghe - Added ClassSpecifierSearchTest - -2003-07-08 John Camelon - Updated IScanner, clients & implementations to use IScannerInfo. - -2003-07-07 John Camelon - Update ClassDeclarationPatternTests::testBug39652(). - -2003-07-04 John Camelon - Moved testBug39652() from failed search tests to ClassDeclarationPatternTests. - -2003-07-04 Andrew Niefer - Added new source Folder search - Added search/ClassDeclarationPatternTests::testMatchSimpleDeclaration - Added search/ClassDeclarationPatternTests::testMatchNamespaceNestedDeclaration - Added new resource folder search & containing file classDecl.cpp - Added new failures package ord.eclipse.cdt.core.search.failedTests - Added new failing test PatternsFailedTests::testBug39652 - - * Note that ClassDeclarationPatternTests and PatternsFailedTests both must be run as plugin tests - -2003-07-03 Bogdan Gheorghe - Added IndexManagerTest::testAddNewFileToIndex() - Added IndexManagerTest::testRemoveProjectFromIndex() - Added IndexManagerTest::testRemoveFileFromIndex() - -2003-07-03 Sean Evoy - New test suite that exercises the standard make build system including the new - IScannerInfoListener and IScannerInfoProvider interfaces. - - Changes to the existing managed build test suite include tests of the new - IScannerInfoxxx interface discovery, subscription, and change notification methods. - - * build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java - * build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java - -2003-07-02 Victor Mozgin - Added DOMTests::testBug39501(). - Improved filtering of expected failures/inconclusives in TortureTest. - -2003-06-30 John Camelon - Added DOMTests::testAssignmentExpression() - Added PreprocessorConditionalTest to ParserTestSuite. - -2003-06-28 John Camelon - Completed Quickparse expression representation. - Updated ExpressionEvaluation and associated tests. - -2003-06-26 John Camelon - Update IASTExpression. - Move Parser.Backtrack and Parser.EndOfFile to external interface. - -2003-06-25 John Camelon - Added DOMFailedTest::testBug39349(). - Added DOMTests::testBug39348(). - -2003-06-25 John Camelon - Create new interface and support for calculating lineNumber/offset mapping. - Updated IASTClassSpecifier for qualified name query. - Began structuring expressions and declarators in Parser for ISourceElementRequestor. - Updated other packages to use new interfaces. - Updated automatedtests/torture test to use new line number information. - -2003-06-24 John Camelon - Updates for ISourceElementRequestor - elaborated types & enumerations. - -2003-06-23 John Camelon - Factory/constructor signature updates. - -2003-06-17 Victor Mozgin - Added MacroTests.java (invocation in AllCoreTests). - Added MacroTests.c to resources. - -2003-06-17 Sean Evoy - Moved the ManagedBuildInfo extension point from the plugin file in org.eclipse.cdt.ui.tests - Added new options to sub target for include paths and preprocessor symbols - Added test for IManagedBuildPathInfo - * build/org/eclipse/cdt/core/build/managed/tests/AllBuildTests.java - -2003-06-17 Brent Nicolle - Added Interface tests of IStructure.java. - -2003-06-17 Victor Mozgin - Added DeclaratorsTests.java (invocation in AllCoreTests). - Added DeclaratorsTests.cpp to org.eclipse.cdt.core.model.tests.resources. - -2003-06-16 Victor Mozgin - Added testOldKRFunctionDeclarations() to DOMTests. - Added testKRFunctionDeclarations() to TranslationUnitTests. - -2003-06-16 Vladimir Hirsl - Added /build, /parser, /failures and /suite directories to the library. - Copied resources from /model/org.eclipse.cdt.core.model.tests.resources - to /model/org/clipse/cdt/core/model/tests/resources/cmodel. - Added class AISResultPrinter to format test results. - Class AutomatedIntegrationSuite now implements IPlatformRunnable. - -2003-06-14 Victor Mozgin - Moved testBugSingleton192() from LokiFailures to DOMTests. - Added testPointersToMembers() and testPointersToMemberFunctions() to DOMTests. - Added testBug36290() and testBug36931() to DOMTests. - -2003-06-13 John Camelon - Added Class/Base infrastructure to public interfaces & requestor callback. - Moved many internal interfaces to external packages. - Organized imports. - -2003-06-13 Victor Mozgin - Renamed NullParserCallback into NullSourceElementRequester in AutomatedFramework. - -2003-06-13 John Camelon - Merged ParserSymbolTable branch back into HEAD. - -2003-06-12 John Camelon - Get rest of JUnit tests working, will merge back to HEAD branch. - -2003-06-12 John Camelon - Introduction of ASTFactory strategy, some restructuring of packages and interfaces. - -2003-06-11 Victor Mozgin - Old Java TestCase.txt and TestCase2.txt for partioning testing have been replaced with C/C++ files. - Modified AutomatedIntegrationSuite.java so it doesn't produce JUnit warning anymore. - All tests in org.eclipse.cdt.ui.tests should pass now. - -3003-06-11 Peter Graves - Update the test.xml to get the location of org.eclipse.test from a property - if set. If the property is not set, it will default to the old value. - -2003-06-11 Victor Mozgin - Added TortureTest to test CDT C++ parser with GCC testsuites. - GCC testsuites are not included. - -2003-06-10 John Camelon - Futher pursuit of the golden hammer, symbol table integration. - -2003-06-10 Brent Nicolle - Added some Interface tests of (IInclude, IMacro, IStructure). - Made sure all the Test Suites have names in the JUnit hierarchy. - -2003-06-09 John Camelon - First step in replacing IParserCallback with ISourceElementRequestor. - -2003-06-09 Victor Mozgin - Moved testBug36769() from ACEFailedTest.java to DOMTests.java. - Removed ACEFailedTest.java as it is empty now. - Added DOMTests.testBug36769B(). - -2003-06-09 Victor Mozgin - Moved testBug36932() from DOMFailedTest.java to DOMTests.java. - Added DOMTests.testBug36932B() and DOMTests.testBug36932C(). - -2003-06-09 Victor Mozgin - Moved testBug36701() from ScannerFailedTests.java to ScannerTestCase.java. - Renamed it to testBug36701A() and fixed it. - Added ScannerTestCase.testBug36701B(). - -2003-06-07 Victor Mozgin - Moved testBug36766A(), testBug36766B() & testBug36766C() from STLFailedTests.java to DOMTests.java. - Renamed them to testBug36766and36769x(), as they cover both PRs. - Added testBug36766and36769D() - test for templated destructor. - -2003-06-05 John Camelon - Moved testBug23478A() & testBug23478B() from failed tests to TranslationUnitTests.java. - Removed TranslationUnitFailedTests.java as it was empty. - -2003-05-29 Andrew Niefer - Modified tests to support eType & PtrOp changes in core - Added ParserSymbolTableTest::testTemplateParameterAsParent - Added ParserSymbolTableTest::testTemplateInstanceAsParent - Added ParserSymbolTableTest::testTemplateParameterDefaults - Added ParserSymbolTableTest::testTemplateParameterAsFunctionArgument - started ParserSymbolTableTest::incompletetestTemplateSpecialization - -2003-05-26 John Camelon - Rollback PST/Parser integration. - -2003-05-13 Andrew Niefer - Modified ParserSymbolTableTest to use new interface - -2003-05-08 Andrew Niefer - Added ParserSymbolTableTest::testMarkRollback - -2003-05-06 John Camelon - Further integration of SymbolTable into Parser, some refactoring. - -2003-05-05 John Camelon/Andrew Niefer - Added CrossReferenceTests to ParserTestSuite to test symbol-table/DOM interworking. - -2003-05-05 Andrew Niefer - Rewrote ParserSymbolTableTest to reflect structural changes to the symbol table. - -2003-05-01 Andrew Niefer - Updated FractionalAutomatedTest to use threads - Modified ScannerTestCase::testBug36287 - Added ScannerTestCase::testBug37011 - Added ScannerTestCase::testOtherPreprocessorDefines - -2003-04-28 John Camelon - Moved testBug36730() & testBug37019() from DOMFailedTests to DOMTests. - -2003-04-28 Andrew Niefer - Added DOMFailedTest::testBug37019 - Added DOMFailedTest::testBug36932 - Added ScannerFailedTest::testBug37011 - -2003-04-28 John Camelon - Added DOMTests::testOrder(). - -2003-04-28 Peter Graves - * model/org/eclipse/cdt/core/model/tests/BinaryTests: - Updated to remove a few small errors, and deal with some changes - to the core CDT - -2003-04-27 John Camelon - Added testBug36932() to DOMTests. - Moved testBugFunctor758() from LokiFailures to DOMTests. - Moved testBug36704() from DOMFailedTest to DOMTests. - Moved testBug36699() from DOMFailedTest to DOMTests. - Moved testBug36691() from DOMFailedTest to DOMTests. - -2003-04-25 Andrew Niefer - Moved ACEFailedTest::testBug36771 to DOMTests - Moved DOMFailedTest::testBug36714 to DOMTests - Updated ScannerTestCase::testBug36816 - -2003-04-25 John Camelon - Added DOMTests::testBug36852(). - Added DOMTests::testBug36764(). - Moved DOMFailedTests::testBug36702() to DOMTests(). - -2003-04-24 John Camelon - Moved fixed tests from FailedTests to DOMTests. - Added DOMTests::testBug36799(). - Cleaned up tests to reduce amount of code necessary to maintain these things. - -2003-04-24 John Camelon - Moved fixed tests from FailedTests to DOMTests. - Added LokiFailures.java to failed tests directory. - -2003-04-24 Andrew Niefer - Added AutomatedFramework.java - Added FractionalAutomatedTest (which derives from AutomatedFramework) - Refactored AutomatedTest to derive from AutomatdFramework - Added ScannerTestCase.testBug36816 - Added ScannerTestCase.testBug36255 - -2003-04-24 John Camelon - Fixed Java 1.3 compliance issue w/AutomatedTest.java - Fixed False failure in HelloWorld.java. - -2003-04-21 John Camelon - Updated DOMTests::testBug36247(). - Moved testBug36692(), testBug36703(), testBug36708(), testBug36707(), testBug36689() - and testBug36690() from DOMFailedTests to DOMTests and updated them. - -2003-04-20 John Camelon - Added DOMTests::testBug36551(). - Adjusted AutomatedTest to turn on line numbering. - Added DOMFailedTests and 11 failed test cases. - -2003-04-17 Andrew Niefer - Added ScannerTestCase::testBug36695() - Moved ScannerFailedTest::testBug36521 to ScannerTestCase::testBug36521() - Moved ScannerFailedTest::testBug36509 to ScannerTestCase::testBug36509() - Moved ScannerFailedTest::testBug36475 to ScannerTestCase::testBug36475() - Updated ScannerTestCase::testBug36047 - Updated ScannerTestCase::testBug36045 - -2003-04-17 John Camelon - Updated DOMTests::testBug36600(). - Updated LineNumberTest::testDOMLineNos(). - Added DOMTests::testBug36559(). - -2003-04-17 Andrew Niefer - Added AutomatedTest - Added resources.cFiles - Added resources.cppFiles - -2003-04-16 John Camelon - Added DOMTests::testBug36532(). - Added DOMTests::testBug36432(). - Added DOMTests::testBug36594(). - Added DOMTests::testBug36600(). - Added DOMTests::testArrayOfPointerToFunctions(). - -2003-04-15 John Camelon - Added ScannerTestCase::testBug36434(). - Added ScannerTestCase::testMultipleLines(). - Added ParserTestSuite. - Added LineNumberTest. - Updated CModelElementsTests to set the Nature of the C++ project appropriately. - -2003-04-15 Andrew Niefer - Moved ScannerFailedTest::testBug36047 to ScannerTestCase::testBug36047 - Added ScannerFailedTest::testBug36475 - -2003-04-13 John Camelon - Added DOMTests::testPointersToFunctions. - -2003-04-11 John Camelon - Added DOMTests::testBug36247(). - -2003-04-11 Andrew Niefer - Moved ScannerFailedTest::testBug36316 to ScannerTestCase::testBug36316 - Added ScannerFailedTest::testBug36047 - Added ScannerTestCase::testNestedRecursiveDefines - -2003-04-10 John Camelon - Added DOMTests::testBug36237(). - -2003-04-09 John Camelon - Removed all the old Code Model Builder source that was no longer being used (NewModelBuilder.java, etc.). - Moved all the files in parser.util directory to the dom. - Organized imports. - Added DOMTests::testTemplateDeclarationOfMethod(). - Added DOMTests::testBug36250(). - Added DOMTests::testBug36240(). - Added DOMTests::testBug36254(). - -2003-04-09 John Camelon - Updated ScannerTest::testBug36045(). - Added ScannerTest::testBug36287(). - Added DOMTests::testBug36288(). - -2003-04-06 Andrew Niefer - Added ParserSymbolTableTest::testOverloadRanking() - -2003-04-04 Alain Magloire - * src/org/eclipse/cdt/testplugin/util/VerifyDialog.java: - Remove some warnings. - -2003-04-03 John Camelon - Updated ScannerTest::testSimpleIfdef() for bug36019. - Updated ScannerTest::testNumerics() for bug36020. - Added ScannerTest::testBug36045(). - Updated DOMTests::testTemplateDeclaration() for template grammar updates. - -2003-04-01 Andrew Niefer - ParserSymbolTableTest. modifications to using declaration tests to reflect changes in the - symbol table. Also added testUserDefinedConversionSequences() - -2003-04-01 John Camelon - Added testBug35906() to DOMTests. - -2003-03-31 John Camelon - Added testStruct() to DOMTests. - Added test35892()to ScannerTest. - -2003-03-31 Andrew Niefer - In ParserSymbolTableTest, renamed testFunctionResolution_2() to testFunctionResolution_PointersAndBaseClasses(), - and modified to reflect changes in function resolution. - Added testFunctionResolution_TypedefsAndPointers(). - -2003-03-31 John Camelon - Added testWeirdStrings() and testNumerics() to ScannerTestCase. - Added testTemplateSpecialization(), testTemplateDeclaration(), testBug26467(), - testTypedef() and testTemplateInstantiation() to DOMTests. - -2003-03-28 John Camelon - Added testConstructorChain() and testASMDefinition() to DOMTests. - -2003-03-27 Alain Magloire - Changes were done in the Core Model API, the hierarchy is now - ICModel - ICProject - ICContainer - ITranslationUnit - IArchive - IBinary - We adjust the tests. - * model/org/eclipse/cdt/core/model/tests/ArchiveTests.java - * model/org/eclipse/cdt/core/model/tests/BinaryTests.java - * model/org/eclipse/cdt/core/model/tests/TranslationUniTests.java - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - -2003-03-26 Andrew Niefer - In ParserSymbolTableTest : - updated all tests to reflect TypeInfo changes - Added testFunctionResolution() & testFunctionResolution_2() in - -2003-03-25 John Camelon - Added testDeclSpecifier(), testNamespaceDefinition(), testLinkageSpecification(), - testUsingClauses() and testEnumSpecifier() to DOMTests. - -2003-03-23 John Camelon - Added ptrOperator() test to DOMTests. - Added testFunctionModifiers() test to DOMTests. - Added testArrays() test to DOMTests. - -2003-03-20 Alain Magloire - - Patch from Amer Hoda, tests for the CElement deltas for Translation Units. - * model/org/eclipse/cdt/core/model/tests/ElementDeltaTest.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-19 Alain Magloire - Patch from Amer Hoda, introducing a simple test for the core model. - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-18 John Camelon - Updated DOMTests to validate simple case of a function declaration with multiple parameters. - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - -2003-03-11 John Camelon - Updated DOMTests for core.internal.parser change of merging DeclarationSpecifier and DeclSpecifier - Organized imports - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - * parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java - -2003-03-10 John Camelon - Added macro pasting tests - -2003-03-06 Andrew Niefer - Added tests for exercising Namespaces & using directives in new parser's symbol table - -2003-03-04 Doug Schaefer - This is a pretty big patch, but it is the merge of the NewParser1 branch into the HEAD branch. lder "parser") - JUnit tests for testing various pieces (source folder "parser" in cdt.ui.tests. - -2003-01-29 Peter Graves - - Fixed the warnings when accessing static methods - * src/org/eclipse/cdt/testplugin/util/DialogCheck.java: - * src/org/eclipse/cdt/testplugin/CTestPlugin.java - * src/org/eclipse/cdt/testplugin/TestWorkbench.java - * ChangeLog: make all entries have the same formatting - -2002-12-17 Peter Graves - - * plugin.xml,test.xml: Some simple cleanups to remove refrences to the jdt and - to move closer to automated running - -2002-11-27 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java: - Use CoreModel.getDefault(). - -2002-10-30 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java (testGetNatureID): - The fields and the methods use in this test was removed from the CoreModel class. - (testHasNature): The method use in this case was refactor in the classes - CProjectNature and CCProjectNature, fix the test. - -2002-10-18 Peter Graves - - src/org/eclipse/cdt/testplugin/CProjectHelper.jada - Cleanup of the CProjectHelper file to remove unused imports, commeted out code etc. - -======= -2003-04-21 Andrew Niefer - Added DOMFailedTests::testBug36713() - Added DOMFailedTests::testBug36714() - Added DOMFailedTests::testBug36717() - Added DOMFailedTests::testBug36730() - -2003-04-21 Andrew Niefer - Added ScannerTestCase::testBug36695() - Moved ScannerFailedTest::testBug36521 to ScannerTestCase::testBug36521() - Moved ScannerFailedTest::testBug36509 to ScannerTestCase::testBug36509() - Moved ScannerFailedTest::testBug36475 to ScannerTestCase::testBug36475() - Updated ScannerTestCase::testBug36047 - Updated ScannerTestCase::testBug36045 - -2003-04-20 John Camelon - Added DOMTests::testBug36551(). - Adjusted AutomatedTest to turn on line numbering. - Added DOMFailedTests and 11 failed test cases. - -2003-04-17 John Camelon - Updated DOMTests::testBug36600(). - Updated LineNumberTest::testDOMLineNos(). - Added DOMTests::testBug36559(). - -2003-04-17 Andrew Niefer - Added AutomatedTest - Added resources.cFiles - Added resources.cppFiles - -2003-04-16 John Camelon - Added DOMTests::testBug36532(). - Added DOMTests::testBug36432(). - Added DOMTests::testBug36594(). - Added DOMTests::testBug36600(). - Added DOMTests::testArrayOfPointerToFunctions(). - -2003-04-15 John Camelon - Added ScannerTestCase::testBug36434(). - Added ScannerTestCase::testMultipleLines(). - Added ParserTestSuite. - Added LineNumberTest. - Updated CModelElementsTests to set the Nature of the C++ project appropriately. - -2003-04-15 Andrew Niefer - Moved ScannerFailedTest::testBug36047 to ScannerTestCase::testBug36047 - Added ScannerFailedTest::testBug36475 - -2003-04-13 John Camelon - Added DOMTests::testPointersToFunctions. - -2003-04-11 John Camelon - Added DOMTests::testBug36247(). - -2003-04-11 Andrew Niefer - Moved ScannerFailedTest::testBug36316 to ScannerTestCase::testBug36316 - Added ScannerFailedTest::testBug36047 - Added ScannerTestCase::testNestedRecursiveDefines - -2003-04-10 John Camelon - Added DOMTests::testBug36237(). - -2003-04-09 John Camelon - Removed all the old Code Model Builder source that was no longer being used (NewModelBuilder.java, etc.). - Moved all the files in parser.util directory to the dom. - Organized imports. - Added DOMTests::testTemplateDeclarationOfMethod(). - Added DOMTests::testBug36250(). - Added DOMTests::testBug36240(). - Added DOMTests::testBug36254(). - -2003-04-09 John Camelon - Updated ScannerTest::testBug36045(). - Added ScannerTest::testBug36287(). - Added DOMTests::testBug36288(). - -2003-04-06 Andrew Niefer - Added ParserSymbolTableTest::testOverloadRanking() - -2003-04-04 Alain Magloire - * src/org/eclipse/cdt/testplugin/util/VerifyDialog.java: - Remove some warnings. - -2003-04-03 John Camelon - Updated ScannerTest::testSimpleIfdef() for bug36019. - Updated ScannerTest::testNumerics() for bug36020. - Added ScannerTest::testBug36045(). - Updated DOMTests::testTemplateDeclaration() for template grammar updates. - -2003-04-01 Andrew Niefer - ParserSymbolTableTest. modifications to using declaration tests to reflect changes in the - symbol table. Also added testUserDefinedConversionSequences() - -2003-04-01 John Camelon - Added testBug35906() to DOMTests. - -2003-03-31 John Camelon - Added testStruct() to DOMTests. - Added test35892()to ScannerTest. - -2003-03-31 Andrew Niefer - In ParserSymbolTableTest, renamed testFunctionResolution_2() to testFunctionResolution_PointersAndBaseClasses(), - and modified to reflect changes in function resolution. - Added testFunctionResolution_TypedefsAndPointers(). - -2003-03-31 John Camelon - Added testWeirdStrings() and testNumerics() to ScannerTestCase. - Added testTemplateSpecialization(), testTemplateDeclaration(), testBug26467(), - testTypedef() and testTemplateInstantiation() to DOMTests. - -2003-03-28 John Camelon - Added testConstructorChain() and testASMDefinition() to DOMTests. - -2003-03-27 Alain Magloire - Changes were done in the Core Model API, the hierarchy is now - ICModel - ICProject - ICContainer - ITranslationUnit - IArchive - IBinary - We adjust the tests. - * model/org/eclipse/cdt/core/model/tests/ArchiveTests.java - * model/org/eclipse/cdt/core/model/tests/BinaryTests.java - * model/org/eclipse/cdt/core/model/tests/TranslationUniTests.java - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - -2003-03-26 Andrew Niefer - In ParserSymbolTableTest : - updated all tests to reflect TypeInfo changes - Added testFunctionResolution() & testFunctionResolution_2() in - -2003-03-25 John Camelon - Added testDeclSpecifier(), testNamespaceDefinition(), testLinkageSpecification(), - testUsingClauses() and testEnumSpecifier() to DOMTests. - -2003-03-23 John Camelon - Added ptrOperator() test to DOMTests. - Added testFunctionModifiers() test to DOMTests. - Added testArrays() test to DOMTests. - -2003-03-20 Alain Magloire - - Patch from Amer Hoda, tests for the CElement deltas for Translation Units. - * model/org/eclipse/cdt/core/model/tests/ElementDeltaTest.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-19 Alain Magloire - Patch from Amer Hoda, introducing a simple test for the core model. - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-18 John Camelon - Updated DOMTests to validate simple case of a function declaration with multiple parameters. - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - -2003-03-11 John Camelon - Updated DOMTests for core.internal.parser change of merging DeclarationSpecifier and DeclSpecifier - Organized imports - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - * parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java - -2003-03-10 John Camelon - Added macro pasting tests - -2003-03-06 Andrew Niefer - Added tests for exercising Namespaces & using directives in new parser's symbol table - -2003-03-04 Doug Schaefer - This is a pretty big patch, but it is the merge of the NewParser1 branch into the HEAD branch. lder "parser") - JUnit tests for testing various pieces (source folder "parser" in cdt.ui.tests. - -2003-01-29 Peter Graves - - Fixed the warnings when accessing static methods - * src/org/eclipse/cdt/testplugin/util/DialogCheck.java: - * src/org/eclipse/cdt/testplugin/CTestPlugin.java - * src/org/eclipse/cdt/testplugin/TestWorkbench.java - * ChangeLog: make all entries have the same formatting - -2002-12-17 Peter Graves - - * plugin.xml,test.xml: Some simple cleanups to remove refrences to the jdt and - to move closer to automated running - -2002-11-27 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java: - Use CoreModel.getDefault(). - -2002-10-30 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java (testGetNatureID): - The fields and the methods use in this test was removed from the CoreModel class. - (testHasNature): The method use in this case was refactor in the classes - CProjectNature and CCProjectNature, fix the test. - -2002-10-18 Peter Graves - - src/org/eclipse/cdt/testplugin/CProjectHelper.jada - Cleanup of the CProjectHelper file to remove unused imports, commeted out code etc. - diff --git a/core/org.eclipse.cdt.core.tests/about.html b/core/org.eclipse.cdt.core.tests/about.html deleted file mode 100644 index fad1e4a429b..00000000000 --- a/core/org.eclipse.cdt.core.tests/about.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -About - - - -

    About This Content

    - -

    20th June, 2002

    -

    License

    -

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

    - -

    Third Party Content

    - -

    The Content includes items that may be have been sourced from third parties as follows:

    - -

    JUnit 3.7

    -

    The plug-in is based on software developed by JUnit.org. Your use of JUnit 3.7 in both source and binary code -form contained in the plug-in is subject to the terms and conditions of the IBM Public License 1.0 which is available at -http://oss.software.ibm.com/developerworks/opensource/license10.html. -The source code is located in testresources/junit37-noUI-src.zip.

    - -

    i) IBM effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

    -

    ii) IBM effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

    -

    iii) IBM states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.

    - -

    Contributions

    - -

    If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

    - -

    If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

    - - - \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/build.properties b/core/org.eclipse.cdt.core.tests/build.properties deleted file mode 100644 index 2980d5f01c9..00000000000 --- a/core/org.eclipse.cdt.core.tests/build.properties +++ /dev/null @@ -1,20 +0,0 @@ -bin.includes = plugin.xml,\ - about.html,\ - plugin.properties,\ - cdtcoretests.jar,\ - test.xml,\ - resources/ -src.includes = plugin.xml,\ - about.html,\ - plugin.properties,\ - test.xml,\ - resources/ -about.html = -source.cdtcoretests.jar = build/,\ - failures/,\ - model/,\ - parser/,\ - resources/,\ - suite/,\ - indexer/,\ - search/ diff --git a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java b/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java deleted file mode 100644 index deea26f711b..00000000000 --- a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java +++ /dev/null @@ -1,991 +0,0 @@ -/********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - **********************************************************************/ -package org.eclipse.cdt.core.build.managed.tests; - -import java.io.ByteArrayInputStream; -import java.io.StringReader; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.IOptionCategory; -import org.eclipse.cdt.managedbuilder.core.ITarget; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature; -import org.eclipse.cdt.managedbuilder.internal.core.OptionReference; -import org.eclipse.cdt.managedbuilder.internal.core.ToolReference; -import org.eclipse.cdt.testplugin.FileManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -public class ManagedBuildTests extends TestCase { - private static final boolean boolVal = true; - private static final String PROJECT_ID = CCorePlugin.PLUGIN_ID + ".make"; - private static final String testConfigId = "test.config.override"; - private static final String testConfigName = "Tester"; - private static final String enumVal = "Another Enum"; - private static final String[] listVal = {"_DEBUG", "/usr/include", "libglade.a"}; - private static final String projectName = "ManagedBuildTest"; - private static final String rootExt = "toor"; - private static final String stringVal = "-c -Wall"; - private static final String subExt = "bus"; - - public ManagedBuildTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(ManagedBuildTests.class.getName()); - - suite.addTest(new ManagedBuildTests("testExtensions")); - suite.addTest(new ManagedBuildTests("testProjectCreation")); - suite.addTest(new ManagedBuildTests("testConfigurations")); - suite.addTest(new ManagedBuildTests("testConfigurationReset")); - suite.addTest(new ManagedBuildTests("testTargetBuildArtifact")); - suite.addTest(new ManagedBuildTests("testMakeCommandManipulation")); - suite.addTest(new ManagedBuildTests("testScannerInfoInterface")); - suite.addTest(new ManagedBuildTests("testBug43450")); - suite.addTest(new ManagedBuildTests("cleanup")); - - return suite; - } - - /** - * Navigates through the build info as defined in the extensions - * defined in this plugin - */ - public void testExtensions() throws Exception { - ITarget testRoot = null; - ITarget testSub = null; - ITarget testSubSub = null; - - // Note secret null parameter which means just extensions - ITarget[] targets = ManagedBuildManager.getDefinedTargets(null); - - for (int i = 0; i < targets.length; ++i) { - ITarget target = targets[i]; - - if (target.getName().equals("Test Root")) { - testRoot = target; - checkRootTarget(testRoot, "x"); - } else if (target.getName().equals("Test Sub")) { - testSub = target; - checkSubTarget(testSub); - } else if (target.getName().equals("Test Sub Sub")) { - testSubSub = target; - checkSubSubTarget(testSubSub); - } - } - // All these targets are defines in the plugin files, so none - // of them should be null at this point - assertNotNull(testRoot); - assertNotNull(testSub); - assertNotNull(testSubSub); - } - - /** - * This test exercises the interface the ITarget exposes to manipulate - * its make command. - */ - public void testMakeCommandManipulation () { - String oldMakeCmd = "make"; - String newMakeCmd = "Ant"; - - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - } catch (CoreException e) { - fail("Failed to open project in 'testMakeCommandManipulation': " + e.getLocalizedMessage()); - } - assertNotNull(project); - - // Now open the root target - ITarget[] targets = ManagedBuildManager.getTargets(project); - assertEquals(1, targets.length); - - // Does it have a default make command - assertFalse(targets[0].hasOverridenMakeCommand()); - assertEquals(oldMakeCmd, targets[0].getMakeCommand()); - - // Change it - targets[0].setMakeCommand(newMakeCmd); - assertEquals(newMakeCmd, targets[0].getMakeCommand()); - assertTrue(targets[0].hasOverridenMakeCommand()); - - // Reset it - targets[0].resetMakeCommand(); - assertFalse(targets[0].hasOverridenMakeCommand()); - assertEquals(oldMakeCmd, targets[0].getMakeCommand()); - } - - - /** - * The purpose of this test is to exercise the build path info interface. - * To get to that point, a new target/config has to be created in the test - * project and the default configuration changed. - * - * @throws CoreException - */ - public void testScannerInfoInterface(){ - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - } catch (CoreException e) { - fail("Failed to open project in 'testScannerInfoInterface': " + e.getLocalizedMessage()); - } - - //These are the expected path settings - final String[] expectedPaths = new String[5]; - // This first path is a built-in, so it will not be manipulated by build manager - expectedPaths[0] = "/usr/gnu/include"; - expectedPaths[1] = (new Path("/usr/include")).toOSString(); - expectedPaths[2] = (new Path("/opt/gnome/include")).toOSString(); - expectedPaths[3] = (new Path("C:\\home\\tester/include")).toOSString(); - expectedPaths[4] = project.getLocation().append( "Sub Config\\\"..\\includes\"" ).toOSString(); - - // Create a new target in the project based on the sub target - ITarget baseTarget = ManagedBuildManager.getTarget(project, "test.sub"); - assertNotNull(baseTarget); - ITarget newTarget = null; - try { - newTarget = ManagedBuildManager.createTarget(project, baseTarget); - } catch (BuildException e) { - fail("Failed adding new target to project: " + e.getLocalizedMessage()); - } - assertNotNull(newTarget); - // Copy over the configs - IConfiguration[] baseConfigs = baseTarget.getConfigurations(); - for (int i = 0; i < baseConfigs.length; ++i) { - newTarget.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i); - } - - // Change the default configuration to the sub config - IConfiguration[] configs = newTarget.getConfigurations(); - assertEquals(4, configs.length); - IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); - buildInfo.setDefaultConfiguration(newTarget.getConfiguration(configs[3].getId())); - - // Use the plugin mechanism to discover the supplier of the path information - IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider"); - if (extensionPoint == null) { - fail("Failed to retrieve the extension point ScannerInfoProvider."); - } - - // Find the first IScannerInfoProvider that supplies build info for the project - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project); - assertNotNull(provider); - - // Check the build information right away - IScannerInfo currentSettings = provider.getScannerInformation(project); - Map currentSymbols = currentSettings.getDefinedSymbols(); - // It should simply contain the built-in - assertTrue(currentSymbols.containsKey("BUILTIN")); - assertEquals((String)currentSymbols.get("BUILTIN"), ""); - String[] currentPaths = currentSettings.getIncludePaths(); - assertTrue(Arrays.equals(expectedPaths, currentPaths)); - - // Now subscribe (note that the method will be called after a change - provider.subscribe(project, new IScannerInfoChangeListener () { - public void changeNotification(IResource project, IScannerInfo info) { - // Test the symbols: expect "BUILTIN" from the manifest, and "DEBUG" and "GNOME=ME" - // from the overidden settings - Map definedSymbols = info.getDefinedSymbols(); - assertTrue(definedSymbols.containsKey("BUILTIN")); - assertTrue(definedSymbols.containsKey("DEBUG")); - assertTrue(definedSymbols.containsKey("GNOME")); - assertTrue(definedSymbols.containsValue("ME")); - assertEquals((String)definedSymbols.get("BUILTIN"), ""); - assertEquals((String)definedSymbols.get("DEBUG"), ""); - assertEquals((String)definedSymbols.get("GNOME"), "ME"); - // Test the includes path - String[] actualPaths = info.getIncludePaths(); - assertTrue(Arrays.equals(expectedPaths, actualPaths)); - } - }); - - // Add some defined symbols programmatically - String[] expectedSymbols = {"DEBUG", "GNOME = ME "}; - IConfiguration defaultConfig = buildInfo.getDefaultConfiguration(newTarget); - ITool[] tools = defaultConfig.getTools(); - ITool subTool = null; - for (int i = 0; i < tools.length; i++) { - ITool tool = tools[i]; - if("tool.sub".equalsIgnoreCase(tool.getId())) { - subTool = tool; - break; - } - } - assertNotNull(subTool); - IOption symbolOpt = null; - IOption[] opts = subTool.getOptions(); - for (int i = 0; i < opts.length; i++) { - IOption option = opts[i]; - if (option.getValueType() == IOption.PREPROCESSOR_SYMBOLS) { - symbolOpt = option; - break; - } - } - assertNotNull(symbolOpt); - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertFalse(info.isDirty()); - ManagedBuildManager.setOption(defaultConfig, symbolOpt, expectedSymbols); - assertTrue(info.isDirty()); - info.setDirty(false); - assertFalse(info.isDirty()); - } - - /** - * Create a new configuration based on one defined in the plugin file. - * Overrides all of the configuration settings. Saves, closes, and reopens - * the project. Then calls a method to check the overridden options. - * - * Tests creating a new configuration. - * Tests setting options. - * Tests persisting overridden options between project sessions. - * - */ - public void testConfigurations() throws CoreException, BuildException { - String rootName = "Root Config"; - String overrideName = "Root Override Config"; - String completeOverrideName = "Complete Override Config"; - - // Open the test project - IProject project = createProject(projectName); - - // Make sure there is one and only one target with 2 configs - ITarget[] definedTargets = ManagedBuildManager.getTargets(project); - assertEquals(1, definedTargets.length); - ITarget rootTarget = definedTargets[0]; - IConfiguration[] definedConfigs = rootTarget.getConfigurations(); - assertEquals(3, definedConfigs.length); - IConfiguration baseConfig = definedConfigs[0]; - assertEquals(definedConfigs[0].getName(), rootName); - assertEquals(definedConfigs[1].getName(), overrideName); - assertEquals(definedConfigs[2].getName(), completeOverrideName); - - // Create a new configuration and test the rename function - IConfiguration newConfig = rootTarget.createConfiguration(baseConfig, testConfigId); - assertEquals(4, rootTarget.getConfigurations().length); - newConfig.setName(testConfigName); - assertEquals(newConfig.getId(), testConfigId); - assertEquals(newConfig.getName(), testConfigName); - - // There is only one tool - ITool[] definedTools = newConfig.getTools(); - assertEquals(1, definedTools.length); - ITool rootTool = definedTools[0]; - - // Override options in the new configuration - IOptionCategory topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - IOption[] options = topCategory.getOptions(null); - assertEquals(2, options.length); - ManagedBuildManager.setOption(newConfig, options[0], listVal); - ManagedBuildManager.setOption(newConfig, options[1], boolVal); - - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - options = categories[0].getOptions(null); - assertEquals(2, options.length); - ManagedBuildManager.setOption(newConfig, options[0], stringVal); - ManagedBuildManager.setOption(newConfig, options[1], enumVal); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project); - project.close(null); - ManagedBuildManager.removeBuildInfo(project); - project.open(null); - - // Test the values in the new configuration - checkOptionReferences(project); - - // Now delete the new configuration and test the target - definedTargets = ManagedBuildManager.getTargets(project); - assertEquals(1, definedTargets.length); - rootTarget = definedTargets[0]; - definedConfigs = rootTarget.getConfigurations(); - assertEquals(4, definedConfigs.length); - rootTarget.removeConfiguration(testConfigId); - definedConfigs = rootTarget.getConfigurations(); - assertEquals(3, definedConfigs.length); - assertEquals(definedConfigs[0].getName(), rootName); - assertEquals(definedConfigs[1].getName(), overrideName); - } - - public void testConfigurationReset() { - // Open the test project - IProject project = null; - try { - project = createProject(projectName); - } catch (CoreException e) { - fail("Failed to open project: " + e.getLocalizedMessage()); - } - - // Get the default configuration - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertNotNull(info); - ITarget defaultTarget = info.getDefaultTarget(); - assertNotNull(defaultTarget); - IConfiguration defaultConfig = info.getDefaultConfiguration(defaultTarget); - assertNotNull(defaultConfig); - - // See if it still contains the overridden values (see testProjectCreation()) - try { - checkRootTarget(defaultTarget, "z"); - } catch (BuildException e1) { - fail("Overridden root target check failed: " + e1.getLocalizedMessage()); - } - - // Reset the config and retest - ManagedBuildManager.resetConfiguration(project, defaultConfig); - try { - checkRootTarget(defaultTarget, "x"); - } catch (BuildException e2) { - fail("Reset root target check failed: " + e2.getLocalizedMessage()); - } - } - - /** - * @throws CoreException - * @throws BuildException - */ - public void testProjectCreation() throws BuildException { - // Create new project - IProject project = null; - try { - project = createProject(projectName); - // Now associate the builder with the project - addManagedBuildNature(project); - } catch (CoreException e) { - fail("Test failed on project creation: " + e.getLocalizedMessage()); - } - // There should not be any targets defined for this project yet - assertEquals(0, ManagedBuildManager.getTargets(project).length); - - // Find the base target definition - ITarget targetDef = ManagedBuildManager.getTarget(project, "test.root"); - assertNotNull(targetDef); - - // Create the target for our project that builds a dummy executable - ITarget newTarget = ManagedBuildManager.createTarget(project, targetDef); - assertEquals(newTarget.getName(), targetDef.getName()); - assertFalse(newTarget.equals(targetDef)); - String buildArtifactName = projectName + "." + newTarget.getDefaultExtension(); - newTarget.setBuildArtifact(buildArtifactName); - - ITarget[] targets = ManagedBuildManager.getTargets(project); - assertEquals(1, targets.length); - ITarget target = targets[0]; - assertEquals(target, newTarget); - assertFalse(target.equals(targetDef)); - - // Copy over the configs - IConfiguration defaultConfig = null; - IConfiguration[] configs = targetDef.getConfigurations(); - for (int i = 0; i < configs.length; ++i) { - // Make the first configuration the default - if (i == 0) { - defaultConfig = target.createConfiguration(configs[i], target.getId() + "." + i); - } else { - target.createConfiguration(configs[i], target.getId() + "." + i); - } - } - ManagedBuildManager.setDefaultConfiguration(project, defaultConfig); - checkRootTarget(target, "x"); - - // Override the "String Option in Category" option value - configs = target.getConfigurations(); - ITool[] tools = configs[0].getTools(); - IOptionCategory topCategory = tools[0].getTopOptionCategory(); - IOptionCategory[] categories = topCategory.getChildCategories(); - IOption[] options = categories[0].getOptions(configs[0]); - configs[0].setOption(options[0], "z"); - options = categories[0].getOptions(null); - assertEquals("x", options[0].getStringValue()); - options = categories[0].getOptions(configs[0]); - assertEquals("z", options[0].getStringValue()); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project); - try { - project.close(null); - } catch (CoreException e) { - fail("Failed on project close: " + e.getLocalizedMessage()); - } - ManagedBuildManager.removeBuildInfo(project); - try { - project.open(null); - } catch (CoreException e) { - fail("Failed on project open: " + e.getLocalizedMessage()); - } - - // Test that the default config was remembered - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); - assertEquals(defaultConfig.getId(), info.getDefaultConfiguration(target).getId()); - - // Get the targets - targets = ManagedBuildManager.getTargets(project); - assertEquals(1, targets.length); - // See if the artifact name is remembered - assertEquals(targets[0].getArtifactName(), buildArtifactName); - // Check the rest of the default information - checkRootTarget(targets[0], "z"); - - // Now test the information the makefile builder needs - checkBuildTestSettings(info); - ManagedBuildManager.removeBuildInfo(project); - } - - private void addManagedBuildNature (IProject project) { - // Add the managed build nature - try { - ManagedCProjectNature.addManagedNature(project, new NullProgressMonitor()); - } catch (CoreException e) { - fail("Test failed on adding managed build nature: " + e.getLocalizedMessage()); - } - - // Associate the project with the managed builder so the clients can get proper information - try { - ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project); - desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID); - desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY); - } catch (CoreException e) { - fail("Test failed on adding managed builder as scanner info provider: " + e.getLocalizedMessage()); - } - } - - /** - * Tests the tool settings through the interface the makefile generator - * uses. - * - * @param project - */ - private void checkBuildTestSettings(IManagedBuildInfo info) { - String ext1 = "foo"; - String ext2 = "bar"; - String badExt = "cpp"; - String expectedOutput = "toor"; - String expectedCmd = "doIt"; - - assertNotNull(info); - assertEquals(info.getBuildArtifactName(), projectName + "." + rootExt); - - // There should be a default configuration defined for the project - ITarget buildTarget = info.getDefaultTarget(); - assertNotNull(buildTarget); - IConfiguration buildConfig = info.getDefaultConfiguration(buildTarget); - assertNotNull(buildConfig); - - // The default target should be the same as the one-and-only target in the project - List targets = info.getTargets(); - assertEquals(targets.size(), 1); - ITarget target = (ITarget) targets.get(0); - assertEquals(target, buildTarget); - - // Check that tool handles resources with extensions foo and bar by building a baz - assertEquals(info.getOutputExtension(ext1), expectedOutput); - assertEquals(info.getOutputExtension(ext2), expectedOutput); - - // Check that it ignores others based on filename extensions - assertNull(info.getOutputExtension(badExt)); - - // Now see what the tool command line invocation is for foo and bar - assertEquals(info.getToolForSource(ext1), expectedCmd); - assertEquals(info.getToolForSource(ext2), expectedCmd); - // Make sure that there is no tool to build files of type foo and bar - assertNull(info.getToolForTarget(ext1)); - assertNull(info.getToolForTarget(ext2)); - - // There is no target that builds toor - assertNull(info.getToolForSource(expectedOutput)); - // but there is one that produces it - assertEquals(info.getToolForTarget(expectedOutput), expectedCmd); - - // Now check the build flags - assertEquals(info.getFlagsForSource(ext1), "-La -Lb z -e1"); - assertEquals(info.getFlagsForSource(ext1), info.getFlagsForSource(ext2)); - - } - - /** - * Tests that overridden options are properly read into build model. - * Test that option values that are not overridden remain the same. - * - * @param project The project to get build model information for. - * @throws BuildException - */ - private void checkOptionReferences(IProject project) throws BuildException { - // Get the targets out of the project - ITarget[] definedTargets = ManagedBuildManager.getTargets(project); - assertEquals(1, definedTargets.length); - ITarget rootTarget = definedTargets[0]; - - // Now get the configs - IConfiguration[] definedConfigs = rootTarget.getConfigurations(); - assertEquals(4, definedConfigs.length); - IConfiguration newConfig = rootTarget.getConfiguration(testConfigId); - assertNotNull(newConfig); - - // Now get the tool options and make sure the values are correct - ITool[] definedTools = newConfig.getTools(); - assertEquals(1, definedTools.length); - ITool rootTool = definedTools[0]; - - // Check that the options in the new config contain overridden values - IOption[] rootOptions = rootTool.getOptions(); - assertEquals(4, rootOptions.length); - // First is the new list - assertEquals("List Option in Top", rootOptions[0].getName()); - assertEquals(IOption.STRING_LIST, rootOptions[0].getValueType()); - String[] list = rootOptions[0].getStringListValue(); - assertEquals(3, list.length); - assertTrue(Arrays.equals(listVal, list)); - assertEquals(rootOptions[0].getCommand(), "-L"); - // Next option is a boolean in top - assertEquals("Boolean Option in Top", rootOptions[1].getName()); - assertEquals(IOption.BOOLEAN, rootOptions[1].getValueType()); - assertEquals(boolVal, rootOptions[1].getBooleanValue()); - assertEquals("-b", rootOptions[1].getCommand()); - // Next option is a string category - assertEquals("String Option in Category", rootOptions[2].getName()); - assertEquals(IOption.STRING, rootOptions[2].getValueType()); - assertEquals(stringVal, rootOptions[2].getStringValue()); - // Final option is an enumerated - assertEquals("Enumerated Option in Category", rootOptions[3].getName()); - assertEquals(IOption.ENUMERATED, rootOptions[3].getValueType()); - String selEnum = rootOptions[3].getSelectedEnum(); - assertEquals(enumVal, selEnum); - String[] enums = rootOptions[3].getApplicableValues(); - assertEquals(2, enums.length); - assertEquals("Default Enum", enums[0]); - assertEquals("Another Enum", enums[1]); - assertEquals("-e1", rootOptions[3].getEnumCommand(enums[0])); - assertEquals("-e2", rootOptions[3].getEnumCommand(enums[1])); - assertEquals("-e2", rootOptions[3].getEnumCommand(selEnum)); - } - - /* - * Do a full sanity check on the root target. - */ - private void checkRootTarget(ITarget target, String oicValue) throws BuildException { - // Target stuff - String expectedCleanCmd = "del /myworld"; - String expectedParserId = "org.eclipse.cdt.core.PE"; - String[] expectedOSList = {"win32"}; - assertTrue(target.isTestTarget()); - assertEquals(target.getDefaultExtension(), rootExt); - assertEquals(expectedCleanCmd, target.getCleanCommand()); - assertEquals("make", target.getMakeCommand()); - assertEquals(expectedParserId, target.getBinaryParserId()); - assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList())); - - // Tools - ITool[] tools = target.getTools(); - // Root Tool - ITool rootTool = tools[0]; - assertEquals("Root Tool", rootTool.getName()); - // 4 Options are defined in the root tool - IOption[] options = rootTool.getOptions(); - assertEquals(4, options.length); - // First option is a 3-element list with 1 built-in - assertEquals("List Option in Top", options[0].getName()); - assertEquals(IOption.STRING_LIST, options[0].getValueType()); - String[] valueList = options[0].getStringListValue(); - assertEquals(2, valueList.length); - assertEquals("a", valueList[0]); - assertEquals("b", valueList[1]); - String[] builtInList = options[0].getBuiltIns(); - assertEquals(1, builtInList.length); - assertEquals("c", builtInList[0]); - assertEquals(options[0].getCommand(), "-L"); - // Next option is a boolean in top - assertEquals("Boolean Option in Top", options[1].getName()); - assertEquals(IOption.BOOLEAN, options[1].getValueType()); - assertEquals(false, options[1].getBooleanValue()); - assertEquals("-b", options[1].getCommand()); - // Next option is a string category - assertEquals("String Option in Category", options[2].getName()); - assertEquals(IOption.STRING, options[2].getValueType()); - assertEquals("x", options[2].getStringValue()); - // Final option is an enumerated - assertEquals("Enumerated Option in Category", options[3].getName()); - assertEquals(IOption.ENUMERATED, options[3].getValueType()); - assertEquals("Default Enum", options[3].getSelectedEnum()); - valueList = options[3].getApplicableValues(); - assertEquals(2, valueList.length); - assertEquals("Default Enum", valueList[0]); - assertEquals("Another Enum", valueList[1]); - assertEquals("-e1", options[3].getEnumCommand(valueList[0])); - assertEquals("-e2", options[3].getEnumCommand(valueList[1])); - - // Option Categories - IOptionCategory topCategory = rootTool.getTopOptionCategory(); - assertEquals("Root Tool", topCategory.getName()); - options = topCategory.getOptions(null); - assertEquals(2, options.length); - assertEquals("List Option in Top", options[0].getName()); - assertEquals("Boolean Option in Top", options[1].getName()); - IOptionCategory[] categories = topCategory.getChildCategories(); - assertEquals(1, categories.length); - assertEquals("Category", categories[0].getName()); - options = categories[0].getOptions(null); - assertEquals(2, options.length); - assertEquals("String Option in Category", options[0].getName()); - assertEquals("Enumerated Option in Category", options[1].getName()); - - // There should be 3 defined configs - IConfiguration[] configs = target.getConfigurations(); - assertEquals(3, configs.length); - - // Root Config - IConfiguration rootConfig = configs[0]; - assertEquals("Root Config", rootConfig.getName()); - - // Tool elements - tools = rootConfig.getTools(); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - assertEquals("-r", tools[0].getOutputFlag()); - assertTrue(tools[0].buildsFileType("foo")); - assertTrue(tools[0].buildsFileType("bar")); - assertTrue(tools[0].producesFileType("toor")); - assertEquals("doIt", tools[0].getToolCommand()); - assertEquals("", tools[0].getOutputPrefix()); - // The root tool defines one valid header file extension - assertTrue(rootTool.isHeaderFile("baz")); - assertTrue(tools[0].isHeaderFile("baz")); - assertEquals(ITool.FILTER_C, rootTool.getNatureFilter()); - - // Partially Overriden Configuration - assertEquals("Root Override Config", configs[1].getName()); - tools = configs[1].getTools(); - assertEquals(1, tools.length); - assertTrue(tools[0] instanceof ToolReference); - assertEquals("Root Tool", tools[0].getName()); - topCategory = tools[0].getTopOptionCategory(); - options = topCategory.getOptions(configs[1]); - assertEquals(2, options.length); - assertEquals("List Option in Top", options[0].getName()); - valueList = options[0].getStringListValue(); - assertEquals("a", valueList[0]); - assertEquals("b", valueList[1]); - assertEquals("Boolean Option in Top", options[1].getName()); - assertEquals(true, options[1].getBooleanValue()); - assertEquals("-b", options[1].getCommand()); - categories = topCategory.getChildCategories(); - options = categories[0].getOptions(configs[1]); - assertEquals(2, options.length); - assertEquals("String Option in Category", options[0].getName()); - assertEquals("y", options[0].getStringValue()); - assertEquals("Enumerated Option in Category", options[1].getName()); - valueList = options[1].getApplicableValues(); - assertEquals(2, valueList.length); - assertEquals("Default Enum", valueList[0]); - assertEquals("Another Enum", valueList[1]); - assertEquals("-e1", options[1].getEnumCommand(valueList[0])); - assertEquals("-e2", options[1].getEnumCommand(valueList[1])); - assertEquals(1, tools.length); - assertEquals("Root Tool", tools[0].getName()); - assertEquals("-r", tools[0].getOutputFlag()); - assertTrue(tools[0].buildsFileType("foo")); - assertTrue(tools[0].buildsFileType("bar")); - assertTrue(tools[0].producesFileType("toor")); - assertTrue(tools[0].isHeaderFile("baz")); - assertEquals("doIt", tools[0].getToolCommand()); - - // Completely Overridden configuration - assertEquals("Complete Override Config", configs[2].getName()); - tools = configs[2].getTools(); - assertEquals(1, tools.length); - assertTrue(tools[0] instanceof ToolReference); - assertEquals("Root Tool", tools[0].getName()); - topCategory = tools[0].getTopOptionCategory(); - options = topCategory.getOptions(configs[2]); - assertEquals(2, options.length); - // Check that there's an empty string list and a true boolean (commands should not have changed) - assertTrue(options[0] instanceof OptionReference); - assertEquals("List Option in Top", options[0].getName()); - assertEquals(IOption.STRING_LIST, options[0].getValueType()); - valueList = options[0].getStringListValue(); - assertTrue(valueList.length == 0); - assertEquals("-L", options[0].getCommand()); - assertEquals("Boolean Option in Top", options[1].getName()); - assertTrue(options[1] instanceof OptionReference); - assertEquals("Boolean Option in Top", options[1].getName()); - assertEquals(IOption.BOOLEAN, options[1].getValueType()); - assertEquals(true, options[1].getBooleanValue()); - assertEquals("-b", options[1].getCommand()); - // Check that there's an overridden enumeration and string - categories = topCategory.getChildCategories(); - options = categories[0].getOptions(configs[2]); - assertEquals(2, options.length); - assertTrue(options[0] instanceof OptionReference); - assertEquals("String Option in Category", options[0].getName()); - assertEquals(IOption.STRING, options[0].getValueType()); - assertEquals("overridden", options[0].getStringValue()); - assertTrue(options[1] instanceof OptionReference); - assertEquals("Enumerated Option in Category", options[1].getName()); - assertEquals(IOption.ENUMERATED, options[1].getValueType()); - assertEquals("-e2", options[1].getSelectedEnum()); - } - - /* - * @param testSubSub - */ - private void checkSubSubTarget(ITarget target) { - // Check the inherited clean command - assertEquals("rm -yourworld", target.getCleanCommand()); - // Check that the make command is overridden from parent - assertEquals("nmake", target.getMakeCommand()); - // Make sure we get the proper binary parser - assertEquals("org.eclipse.cdt.core.ELF", target.getBinaryParserId()); - // Make sure the list is inherited - String[] expectedOSList = {"win32","linux","solaris"}; - assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList())); - } - - /* - * Do a sanity check on the values in the sub-target. Most of the - * sanity on the how build model entries are read is performed in - * the root target check, so these tests just verify that the the sub - * target properly inherits from its parent. For the new options - * in the sub target, the test does a sanity check just to be complete. - */ - private void checkSubTarget(ITarget target) throws BuildException { - // Check the overridden clean command - assertEquals("rm -yourworld", target.getCleanCommand()); - // Make sure the target inherits the make command - assertEquals("make", target.getMakeCommand()); - // Make sure the binary parser is hard-coded and available - assertEquals("org.eclipse.cdt.core.PE", target.getBinaryParserId()); - String[] expectedOSList = {"win32","linux","solaris"}; - assertTrue(Arrays.equals(expectedOSList, target.getTargetOSList())); - - // Make sure this is a test target - assertTrue(target.isTestTarget()); - // Make sure the build artifact extension is there - assertEquals(target.getDefaultExtension(), subExt); - - // Get the tools for this target - ITool[] tools = target.getTools(); - // Do we inherit properly from parent - ITool rootTool = tools[0]; - assertEquals("Root Tool", rootTool.getName()); - // Now get the tool defined for this target - ITool subTool = tools[1]; - assertEquals("Sub Tool", subTool.getName()); - // Confirm that it has four options - IOption[] subOpts = subTool.getOptions(); - assertEquals(4, subOpts.length); - assertEquals("", subTool.getOutputFlag()); - assertTrue(subTool.buildsFileType("yarf")); - assertTrue(subTool.producesFileType("bus")); - assertEquals("", subTool.getToolCommand()); - assertEquals("lib", subTool.getOutputPrefix()); - assertTrue(subTool.isHeaderFile("arf")); - assertTrue(subTool.isHeaderFile("barf")); - assertEquals(ITool.FILTER_BOTH, subTool.getNatureFilter()); - - // Do a sanity check on the options - assertEquals("Include Paths", subOpts[0].getName()); - assertEquals(IOption.INCLUDE_PATH, subOpts[0].getValueType()); - String[] incPath = subOpts[0].getIncludePaths(); - assertEquals(2, incPath.length); - assertEquals("/usr/include", incPath[0]); - assertEquals("/opt/gnome/include", incPath[1]); - String[] builtInPaths = subOpts[0].getBuiltIns(); - assertEquals(1, builtInPaths.length); - assertEquals("/usr/gnu/include", builtInPaths[0]); - assertEquals("-I", subOpts[0].getCommand()); - // There are no user-defined preprocessor symbols - assertEquals("Defined Symbols", subOpts[1].getName()); - assertEquals(IOption.PREPROCESSOR_SYMBOLS, subOpts[1].getValueType()); - String[] defdSymbols = subOpts[1].getDefinedSymbols(); - assertEquals(0, defdSymbols.length); - assertEquals("-D", subOpts[1].getCommand()); - // But there is a builtin - String[] builtInSymbols = subOpts[1].getBuiltIns(); - assertEquals(1, builtInSymbols.length); - assertEquals("BUILTIN", builtInSymbols[0]); - assertEquals("More Includes", subOpts[2].getName()); - assertEquals(IOption.INCLUDE_PATH, subOpts[2].getValueType()); - String[] moreIncPath = subOpts[2].getIncludePaths(); - assertEquals(2, moreIncPath.length); - assertEquals("C:\\home\\tester/include", moreIncPath[0]); - assertEquals("-I", subOpts[2].getCommand()); - // Check the user object option - assertEquals("User Objects", subOpts[3].getName()); - assertEquals(IOption.OBJECTS, subOpts[3].getValueType()); - String[] objs = subOpts[3].getUserObjects(); - assertEquals(2, objs.length); - assertEquals("obj1.o", objs[0]); - assertEquals("obj2.o", objs[1]); - - // Get the configs for this target; it should inherit all the configs defined for the parent - IConfiguration[] configs = target.getConfigurations(); - assertEquals(4, configs.length); - IConfiguration rootConfig = configs[0]; - assertEquals("Root Config", rootConfig.getName()); - assertEquals("Root Override Config", configs[1].getName()); - assertEquals("Complete Override Config", configs[2].getName()); - assertEquals("Sub Config", configs[3].getName()); - } - - /** - * Remove all the project information associated with the project used during test. - */ - public void cleanup() { - removeProject(projectName); - } - - /** - * Create a new project named name or return the project in - * the workspace of the same name if it exists. - * - * @param name The name of the project to create or retrieve. - * @return - * @throws CoreException - */ - private IProject createProject(String name) throws CoreException { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject newProjectHandle = root.getProject(name); - IProject project = null; - - if (!newProjectHandle.exists()) { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName()); - //description.setLocation(root.getLocation()); - project = CCorePlugin.getDefault().createCProject(description, newProjectHandle, new NullProgressMonitor(), PROJECT_ID); - } else { - newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, null); - project = newProjectHandle; - } - - if (!project.isOpen()) { - project.open(null); - } - - return project; - } - - /** - * Remove the IProject with the name specified in the argument from the - * receiver's workspace. - * - * @param name - */ - private void removeProject(String name) { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject project = root.getProject(name); - if (project.exists()) { - try { - project.delete(true, false, null); - } catch (CoreException e) { - assertTrue(false); - } - } - } - - /** - * Test that the build artifact of a ITarget can be modified - * programmatically. - */ - public void testTargetBuildArtifact () throws CoreException { - // Open the test project - IProject project = createProject(projectName); - - // Make sure there is one and only one target - ITarget[] definedTargets = ManagedBuildManager.getTargets(project); - assertEquals(1, definedTargets.length); - ITarget rootTarget = definedTargets[0]; - - // Set the build artifact of the target - String ext = rootTarget.getDefaultExtension(); - String name = project.getName() + "." + ext; - rootTarget.setBuildArtifact(name); - - // Save, close, reopen and test again - ManagedBuildManager.saveBuildInfo(project); - project.close(null); - ManagedBuildManager.removeBuildInfo(project); - project.open(null); - - // Make sure there is one and only one target - definedTargets = ManagedBuildManager.getTargets(project); - assertEquals(1, definedTargets.length); - rootTarget = definedTargets[0]; - assertEquals(name, rootTarget.getArtifactName()); - } - - public void testThatAlwaysFails() { - assertTrue(false); - } - - public void testBug43450 () throws Exception{ - IProject project = createProject( projectName ); - - FileManager fileManager = new FileManager(); - - IFolder folder = project.getProject().getFolder( "includes" ); - if( !folder.exists() ){ - folder.create( false, true, null ); - } - - IFile file = project.getProject().getFile( "includes/header.h" ); - if( !file.exists() ){ - file.create( new ByteArrayInputStream( "class A { public : static int i; };".getBytes() ), false, null ); - } - - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project); - IScannerInfo info = provider.getScannerInformation( project ); - ISourceElementRequestor callback = new NullSourceElementRequestor(); - - IScanner scanner = ParserFactory.createScanner( new StringReader( "#include \n int A::i = 1;" ), - "TEST", info, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, callback, null); - - IParser parser = ParserFactory.createParser( scanner, callback, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null ); - assertTrue( parser.parse() ); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java b/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java deleted file mode 100644 index 99b4967cf72..00000000000 --- a/core/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/StandardBuildTests.java +++ /dev/null @@ -1,373 +0,0 @@ -package org.eclipse.cdt.core.build.managed.tests; - -import java.util.Arrays; -import java.util.Map; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoChangeListener; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.make.core.IMakeBuilderInfo; -import org.eclipse.cdt.make.core.MakeBuilder; -import org.eclipse.cdt.make.core.MakeCorePlugin; -import org.eclipse.cdt.make.core.MakeProjectNature; -import org.eclipse.cdt.make.core.MakeScannerInfo; -import org.eclipse.cdt.make.core.MakeScannerProvider; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -public class StandardBuildTests extends TestCase { - private static final String DEFAULT_BUILD_COMMAND = "make"; - private static final String EMPTY_STRING = ""; - private static final boolean OFF = false; - private static final boolean ON = true; - private static final String OVR_BUILD_ARGS = "-f"; - private static final String OVR_BUILD_COMMAND = "/home/tester/bin/nmake"; - private static final String OVR_BUILD_LOCATION = "src"; - private static final String[] OVR_INC_PATHS = {"/test", "C:\\windows", "//dev/home/include"}; - private static final String[] OVR_PREPROC_SYMS = {"_RELEASE", "NO ", " YES=1"}; - private static final String PROJECT_NAME = "StandardBuildTest"; - - private class ScannerListener implements IScannerInfoChangeListener { - private final String[] expectedPaths = {"/usr/include", "/home/tester/include", "/opt/gnome/include"}; - private final String[] expectedSymbols = {"_DEBUG", "TRUE=1", "FALSE ", ""}; - private boolean bNotified = false; - - public void changeNotification(IResource project, IScannerInfo info) { - // Are there any symbols - Map definedSymbols = info.getDefinedSymbols(); - if (!definedSymbols.isEmpty()) { - assertTrue(definedSymbols.containsKey(expectedSymbols[0])); - assertEquals(EMPTY_STRING, (String)definedSymbols.get(expectedSymbols[0])); - assertTrue(definedSymbols.containsKey("TRUE")); - assertEquals("1", (String)definedSymbols.get("TRUE")); - assertFalse(definedSymbols.containsKey(expectedSymbols[2])); - assertTrue(definedSymbols.containsKey(expectedSymbols[2].trim())); - assertEquals(EMPTY_STRING, (String)definedSymbols.get(expectedSymbols[2].trim())); - // We should have discarded the empty string - assertFalse(definedSymbols.containsKey("")); - } - - // What paths have been set - String[] paths = info.getIncludePaths(); - if (paths.length > 0) { - assertTrue(Arrays.equals(expectedPaths, paths)); - } - bNotified = true; - } - /** - * @return - */ - public String[] getExpectedPaths() { - return expectedPaths; - } - - public boolean triggedNotification() { - return bNotified; - } - /** - * @return - */ - public String[] getExpectedSymbols() { - return expectedSymbols; - } - - } - /** - * @param name - */ - public StandardBuildTests(String name) { - super(name); - } - - public static Test suite() { - TestSuite suite = new TestSuite(StandardBuildTests.class.getName()); - - // Add the relevant tests to the suite - suite.addTest(new StandardBuildTests("testProjectCreation")); - suite.addTest(new StandardBuildTests("testProjectSettings")); - suite.addTest(new StandardBuildTests("testProjectConversion")); - suite.addTest(new StandardBuildTests("testScannerListenerInterface")); - suite.addTest(new StandardBuildTests("testProjectCleanup")); - - return suite; - } - - private void checkDefaultProjectSettings(IProject project) throws Exception { - assertNotNull(project); - - // There should not be any include path or defined symbols for the project - MakeScannerInfo scannerInfo = MakeScannerProvider.getDefault().getMakeScannerInfo(project, true); - assertNotNull(scannerInfo); - String[] includePaths = scannerInfo.getIncludePaths(); - assertNotNull(includePaths); - assertEquals(0, includePaths.length); - String[] definedSymbols = scannerInfo.getPreprocessorSymbols(); - assertNotNull(definedSymbols); - assertEquals(0, definedSymbols.length); - - IMakeBuilderInfo builderInfo = MakeCorePlugin.createBuildInfo(project, MakeBuilder.BUILDER_ID); - // Check the rest of the project information - assertEquals(ON, builderInfo.isDefaultBuildCmd()); - assertEquals(OFF,builderInfo.isStopOnError()); - assertEquals(new Path(DEFAULT_BUILD_COMMAND), builderInfo.getBuildCommand()); - assertEquals(EMPTY_STRING, builderInfo.getBuildArguments()); - assertEquals(false, builderInfo.isAutoBuildEnable()); - assertEquals("all", builderInfo.getAutoBuildTarget()); - assertEquals(true, builderInfo.isIncrementalBuildEnabled()); - assertEquals("all", builderInfo.getIncrementalBuildTarget()); - assertEquals(true, builderInfo.isFullBuildEnabled()); - assertEquals("clean all", builderInfo.getFullBuildTarget()); - } - - private void checkOverriddenProjectSettings(IProject project) throws Exception { - assertNotNull(project); - - MakeScannerInfo scannerInfo = MakeScannerProvider.getDefault().getMakeScannerInfo(project, true); - assertNotNull(scannerInfo); - String[] includePaths = scannerInfo.getIncludePaths(); - assertNotNull(includePaths); - assertEquals(3, includePaths.length); - assertTrue(Arrays.equals(includePaths, OVR_INC_PATHS)); - String[] definedSymbols = scannerInfo.getPreprocessorSymbols(); - assertNotNull(definedSymbols); - assertEquals(3, definedSymbols.length); - assertTrue(Arrays.equals(definedSymbols, OVR_PREPROC_SYMS)); - - // Check the rest of the project information - IMakeBuilderInfo builderInfo = MakeCorePlugin.createBuildInfo(project, MakeBuilder.BUILDER_ID); - assertEquals(OFF, builderInfo.isDefaultBuildCmd()); - assertEquals(ON, builderInfo.isStopOnError()); - assertEquals(new Path(OVR_BUILD_COMMAND), builderInfo.getBuildCommand()); - assertEquals(OVR_BUILD_ARGS, builderInfo.getBuildArguments()); - assertEquals(new Path(OVR_BUILD_LOCATION), builderInfo.getBuildLocation()); - } - - /** - * Create a new project named name or return the project in - * the workspace of the same name if it exists. - * - * @param name The name of the project to create or retrieve. - * @return - * @throws CoreException - */ - private IProject createProject(String name) throws CoreException { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject project = root.getProject(name); - if (!project.exists()) { - project.create(null); - } else { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - if (!project.isOpen()) { - project.open(null); - } - - return project; - } - - /** - * Remove the IProject with the name specified in the argument from the - * receiver's workspace. - * - * @param name - */ - private void removeProject(String name) { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IProject project = root.getProject(name); - if (project.exists()) { - try { - project.delete(true, false, null); - } catch (CoreException e) { - assertTrue(false); - } - } - } - - /** - * Remove all the project information associated with the project used during test. - */ - public void testProjectCleanup() { - removeProject(PROJECT_NAME); - } - - public void testProjectConversion() throws Exception { - // Open the project - IProject project = null; - try { - project = createProject(PROJECT_NAME); - } catch (CoreException e) { - fail("StandardBuildTest testProjectConversion failed opening project: " + e.getLocalizedMessage()); - } - assertNotNull(project); - - // Check the settings (they should be the override values) - checkOverriddenProjectSettings(project); - - // Now convert the project - try { - CCorePlugin.getDefault().convertProjectFromCtoCC(project, new NullProgressMonitor()); - } catch (CoreException e) { - fail("StandardBuildTest testProjectConversion failed to convert project: " + e.getLocalizedMessage()); - } - - // Close, and Reopen the project - try { - project.close(new NullProgressMonitor()); - } catch (CoreException e) { - fail("StandardBuildTest testProjectConversion failed to close project " + e.getLocalizedMessage()); - } - try { - project.open(new NullProgressMonitor()); - } catch (CoreException e) { - fail ("StandardBuildTest testProjectConversion failed to open project " + e.getLocalizedMessage()); - } - - // Make sure it has a CCNature - try { - project.hasNature(CCProjectNature.CC_NATURE_ID); - } catch (CoreException e) { - fail("StandardBuildTest testProjectConversion failed getting nature: " + e.getLocalizedMessage()); - } - - // Nothing should have changed in the settings - checkOverriddenProjectSettings(project); - } - - /** - * - */ - public void testProjectCreation() throws Exception { - // Create a new project - IProject project = null; - try { - project = createProject(PROJECT_NAME); - // Convert the new project to a standard make project - CCorePlugin.getDefault().convertProjectToCC(project, new NullProgressMonitor(), MakeCorePlugin.MAKE_PROJECT_ID); - MakeProjectNature.addNature(project, null); - } catch (CoreException e) { - fail("StandardBuildTest testProjectCreation failed creating project: " + e.getLocalizedMessage()); - } - assertNotNull(project); - - // Make sure it has a CNature - try { - project.hasNature(CProjectNature.C_NATURE_ID); - } catch (CoreException e) { - fail("StandardBuildTest testProjectCreation failed getting nature: " + e.getLocalizedMessage()); - } - // Make sure it has a MakeNature - try { - project.hasNature(MakeProjectNature.NATURE_ID); - } catch (CoreException e) { - fail("StandardBuildTest testProjectCreation failed getting nature: " + e.getLocalizedMessage()); - } - // Check the default settings - checkDefaultProjectSettings(project); - } - - public void testProjectSettings() throws Exception { - // Get the project - IProject project = null; - try { - project = createProject(PROJECT_NAME); - } catch (CoreException e) { - fail("StandardBuildTest testProjectSettings failed opening project: " + e.getLocalizedMessage()); - } - assertNotNull(project); - - // Change the settings - MakeScannerInfo scannerInfo = MakeScannerProvider.getDefault().getMakeScannerInfo(project, false); - scannerInfo.setIncludePaths(OVR_INC_PATHS); - scannerInfo.setPreprocessorSymbols(OVR_PREPROC_SYMS); - scannerInfo.update(); - - // Use the build info for the rest of the settings - IMakeBuilderInfo builderInfo = MakeCorePlugin.createBuildInfo(project, MakeBuilder.BUILDER_ID); - builderInfo.setStopOnError(ON); - builderInfo.setUseDefaultBuildCmd(OFF); - builderInfo.setBuildCommand(new Path(OVR_BUILD_COMMAND)); - builderInfo.setBuildArguments(OVR_BUILD_ARGS); - builderInfo.setBuildLocation(new Path(OVR_BUILD_LOCATION)); - try { - project.close(new NullProgressMonitor()); - } catch (CoreException e) { - fail("StandardBuildTest testProjectSettings failed to close project " + e.getLocalizedMessage()); - } - try { - project.open(new NullProgressMonitor()); - } catch (CoreException e) { - fail ("StandardBuildTest testProjectSettings failed to open project " + e.getLocalizedMessage()); - } - - // Retest - checkOverriddenProjectSettings(project); - } - - public void testScannerListenerInterface() throws Exception { - // Get the project - IProject project = null; - try { - project = createProject(PROJECT_NAME); - } catch (CoreException e) { - fail("StandardBuildTest testScannerListernerInterface failed opening project: " + e.getLocalizedMessage()); - } - assertNotNull(project); - - // Find the scanner info provider for this project - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project); - assertNotNull(provider); - - // Check out the information we can get through the interface - IScannerInfo currentSettings = provider.getScannerInformation(project); - Map currentSymbols = currentSettings.getDefinedSymbols(); - assertTrue(currentSymbols.containsKey("_RELEASE")); - assertEquals("", currentSymbols.get("_RELEASE")); - assertTrue(currentSymbols.containsKey("YES")); - assertEquals("1", currentSymbols.get("YES")); - assertTrue(currentSymbols.containsKey("NO")); - assertEquals("", currentSymbols.get("NO")); - String[] currentPaths = currentSettings.getIncludePaths(); - assertTrue(Arrays.equals(OVR_INC_PATHS, currentPaths)); - - // Remove what's there - MakeScannerInfo info = MakeScannerProvider.getDefault().getMakeScannerInfo(project, false); - info.setIncludePaths(new String[0]); - info.setPreprocessorSymbols(new String[0]); - info.update(); - // Subscribe - ScannerListener listener = new ScannerListener(); - provider.subscribe(project, listener); - - // Change the settings - info.setIncludePaths(listener.getExpectedPaths()); - info.setPreprocessorSymbols(listener.getExpectedSymbols()); - info.update(); - assertEquals(true, listener.triggedNotification()); - // Unsubscribe - provider.unsubscribe(project, listener); - } -} diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/CModelElementsFailedTests.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/CModelElementsFailedTests.java deleted file mode 100644 index b916bd4d086..00000000000 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/CModelElementsFailedTests.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.eclipse.cdt.core.model.failedTests; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.io.FileInputStream; -import java.util.ArrayList; -import java.util.Map; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.INamespace; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.cdt.internal.core.model.CElement; -import org.eclipse.cdt.internal.core.model.TranslationUnit; -import org.eclipse.cdt.testplugin.CProjectHelper; -import org.eclipse.core.internal.resources.ResourceException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - - -/** - * @author vhirsl - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CModelElementsFailedTests extends TestCase { - - private ICProject fCProject; - private IFile headerFile; - private NullProgressMonitor monitor; - - public static Test suite() { - TestSuite suite= new TestSuite(CModelElementsFailedTests.class.getName()); - suite.addTest(new CModelElementsFailedTests("testBug36379")); - return suite; - } - - public CModelElementsFailedTests(String name) { - super(name); - } - - protected void setUp() throws Exception { - monitor = new NullProgressMonitor(); - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - - fCProject= CProjectHelper.createCProject("TestProject1", "bin"); - headerFile = fCProject.getProject().getFile("CModelElementsTest.h"); - if (!headerFile.exists()) { - try{ - FileInputStream fileIn = new FileInputStream(pluginRoot+ "resources/cfiles/CModelElementsTestStart.h"); - headerFile.create(fileIn,false, monitor); - } catch (CoreException e) { - e.printStackTrace(); - } - } - if (!fCProject.getProject().hasNature(CCProjectNature.CC_NATURE_ID)) { - addNatureToProject(fCProject.getProject(), CCProjectNature.CC_NATURE_ID, null); - } - } - - private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = proj.getDescription(); - String[] prevNatures= description.getNatureIds(); - String[] newNatures= new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length]= natureId; - description.setNatureIds(newNatures); - proj.setDescription(description, monitor); - } - - protected void tearDown() { - try{ - CProjectHelper.delete(fCProject); - } - catch (ResourceException e) {} - catch (CoreException e) {} - } - - public void testBug36379() { - TranslationUnit tu = new TranslationUnit(fCProject, headerFile); - // parse the translation unit to get the elements tree - Map newElement = tu.parse(); // require line numbers - - // tu ---> namespace: MyPackage - ArrayList tuPackages = tu.getChildrenOfType(ICElement.C_NAMESPACE); - - INamespace namespace = (INamespace) tuPackages.get(0); - assertEquals(namespace.getElementName(), new String("MyPackage")); - - // MyPackage ---> class: Hello - ArrayList nsClasses = namespace.getChildrenOfType(ICElement.C_CLASS); - IStructure classHello = (IStructure) nsClasses.get(0); - assertEquals(classHello.getElementName(), new String("Hello")); - - // Bug 36379: parser does not provide line number information for nested definitions - assertEquals(0, ((CElement)classHello).getStartLine()); - assertEquals(0, ((CElement)classHello).getEndLine()); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedDeclaratorsTest.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedDeclaratorsTest.java deleted file mode 100644 index 84c7acf406f..00000000000 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedDeclaratorsTest.java +++ /dev/null @@ -1,168 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model.failedTests; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunction; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.ITypeDef; -import org.eclipse.cdt.core.model.IVariable; -import org.eclipse.cdt.core.model.tests.IntegratedCModelTest; - - - -/** - * @author jcamelon - * - */ -public class FailedDeclaratorsTest extends IntegratedCModelTest -{ - // the defect to track these failures is Bug 40768 - // Problems with nested declarators - static final boolean failedTest = true; - /** - * @see org.eclipse.cdt.internal.core.model.IntegratedCModelTest - */ - public String getSourcefileSubdir() { - return "resources/cmodel/"; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IntegratedCModelTest - */ - public String getSourcefileResource() { - return "DeclaratorsTests.cpp"; - } - - public void testDeclarators_0003() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0003"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_FUNCTION_DECLARATION); - IFunctionDeclaration decl = (IFunctionDeclaration)element; - assertEquals(decl.getSignature(), "decl_0003(char)"); - assertEquals(decl.getReturnType(), "void"); - } - - public void testDeclarators_0006() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0006"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_VARIABLE); - IVariable decl = (IVariable)element; - assertEquals(decl.getTypeName(), "void(*)(char)"); - } - - public void testDeclarators_0007() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0007"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_VARIABLE); - IVariable decl = (IVariable)element; - assertEquals(decl.getTypeName(), "void(*)(char)"); - } - - public void testDeclarators_0011() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0011"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - if( failedTest ) return; // here is the where the failure is - assertEquals(decl.getTypeName(), "void()(char)"); - } - - public void testDeclarators_0012() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0012"); - assertNotNull(element); - if( failedTest ) return; // here is the where the failure is - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - assertEquals(decl.getTypeName(), "void()(char)"); - } - - public void testDeclarators_0013() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0013"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - assertEquals(decl.getTypeName(), "void()(char)"); - } - - public void testDeclarators_0014() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0014"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - if( failedTest ) return; // here is the where the failure is - assertEquals(decl.getTypeName(), "void*()(char)"); - } - - public void testDeclarators_0016() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0016"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - assertEquals(decl.getTypeName(), "void(*)(char)"); - } - - public void testDeclarators_0017() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0017"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - assertEquals(decl.getTypeName(), "void(*)(char)"); - } - - public void testDeclarators_0023() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0023"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_FUNCTION); - IFunction decl = (IFunction)element; - assertEquals(decl.getSignature(), "decl_0023(int)"); - assertEquals(decl.getReturnType(), "void(*(*))(char)"); - } - - public void testDeclarators_0024() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0024"); - if( failedTest ) return; // here is the where the failure is - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_VARIABLE); - IVariable decl = (IVariable)element; - assertEquals(decl.getTypeName(), "void(*(*(*)(int))(float))(char)"); - } - - public void testDeclarators_0031() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0031"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_VARIABLE); - IVariable decl = (IVariable)element; - if( failedTest ) return; // here is the where the failure is - assertEquals(decl.getTypeName(), "int(*)(char(*)(bool))"); - } -} diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedMacroTests.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedMacroTests.java deleted file mode 100644 index 2da94397a19..00000000000 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/model/failedTests/FailedMacroTests.java +++ /dev/null @@ -1,120 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model.failedTests; - -import java.util.Stack; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.tests.IntegratedCModelTest; -import org.eclipse.cdt.internal.core.model.CElement; - -/** - * @author jcamelon - * - */ -public class FailedMacroTests extends IntegratedCModelTest -{ - /** - * - */ - public FailedMacroTests() - { - super(); - // TODO Auto-generated constructor stub - } - /** - * @param name - */ - public FailedMacroTests(String name) - { - super(name); - // TODO Auto-generated constructor stub - } - - /** - * @see org.eclipse.cdt.internal.core.model.IntegratedCModelTest - */ - public String getSourcefileSubdir() { - return "resources/cmodel/"; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IntegratedCModelTest - */ - public String getSourcefileResource() { - return "MacroTests.c"; - } - - private final static boolean failedTest = true; - /* This is a list of elements in the test .c file. It will be used - * in a number of places in the tests - */ - String[] expectedStringList= {"Z", "X", "Y", - "SomeName", "", "A::BCD", "DEFA", "DB", "B::SomeName", - "PINT", "myPINT", "foobar"}; - int[] expectedOffsets={ 8,26,39,55,75,89,114,130,152,187,212,227}; - int[] expectedLengths={ 1, 1, 1, 1, 1, 8, 4, 2, 18, 4, 6, 6}; - /* This is a list of that the types of the above list of elements is - * expected to be. - */ - int[] expectedTypes= { ICElement.C_MACRO, ICElement.C_MACRO, - ICElement.C_MACRO, ICElement.C_STRUCT, - ICElement.C_STRUCT, ICElement.C_VARIABLE, ICElement.C_MACRO, - ICElement.C_MACRO, ICElement.C_VARIABLE, ICElement.C_MACRO, - ICElement.C_VARIABLE, ICElement.C_FUNCTION_DECLARATION}; - - - public void testBug40759 () throws CModelException { - ITranslationUnit myTranslationUnit = getTU(); - ICElement myElement; - Stack missing=new Stack(); - int x; - - for (x=0;x? b;"); - } - public void testBug39701A() throws Exception - { - assertCodeFailsParse("extern template int max (int, int);"); - } - public void testBug39701B() throws Exception - { - assertCodeFailsParse("inline template class Foo;"); - } - public void testBug39701C() throws Exception - { - assertCodeFailsParse("static template class Foo;"); - } - public void testBug39702() throws Exception - { - Writer code = new StringWriter(); - try - { - code.write("signature T {\n"); - code.write(" int f (int);\n"); - code.write(" int f0 () { return f (0); };\n"); - code.write("};\n"); - } - catch (IOException ioe) - { - } - assertCodeFailsFullParse(code.toString()); - } - public void testBug39703() throws Exception - { - Writer code = new StringWriter(); - try - { - code.write( - "/* __extension__ enables GNU C mode for the duration of the declaration. */\n"); - code.write("__extension__ struct G {\n"); - code.write(" struct { char z; };\n"); - code.write(" char g;\n"); - code.write("};\n"); - } - catch (IOException ioe) - { - } - IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)assertSoleDeclaration(code.toString()); - assertEquals( ((IASTClassSpecifier)abs.getTypeSpecifier()).getName(), "G" ); - } - public void testBug39704A() throws Exception - { - assertCodeFailsParse("__declspec (dllimport) int foo;"); - } - - - public void testBug39704B() throws Exception - { - try - { - IASTVariable d = (IASTVariable)assertSoleDeclaration("extern int (* import) (void) __attribute__((dllimport));"); - assertEquals( d.getName(), "__attribute__"); // false assertion - } - catch( ClassCastException cce ) - { - failedAsExpected(); - } - } - public void testBug39704C() throws Exception - { - try - { - IASTFunction f = (IASTFunction)assertSoleDeclaration("int func2 (void) __attribute__((dllexport));"); - assertNotReached(); - assertEquals( f.getName(), "func2"); - } catch( ClassCastException cce ) - { - } - } - public void testBug39704D() throws Exception - { - assertCodeFailsParse("__declspec(dllexport) int func1 (int a) {}"); - } - public void testBug39705() throws Exception - { - assertCodeFailsParse("#ident \"@(#)filename.c 1.3 90/02/12\""); - } - - - public void testBug40422() throws Exception { - // Parse and get the translaton unit - parse("int A::* x = 0;").getDeclarations().next(); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java deleted file mode 100644 index d8cc9031a22..00000000000 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/FailedCompleteParseASTTest.java +++ /dev/null @@ -1,198 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.failedTests; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.tests.CompleteParseBaseTest; -import org.eclipse.cdt.internal.core.parser.ParserException; - -/** - * @author jcamelon - * - */ -public class FailedCompleteParseASTTest extends CompleteParseBaseTest -{ - /** - * - */ - public FailedCompleteParseASTTest() - { - super(); - } - /** - * @param name - */ - public FailedCompleteParseASTTest(String name) - { - super(name); - } - - public void testPMDotStarPointerToMemberFunction_Bug43242() throws Exception - { - //parse no longer passes - try{ - parse ("class A { int m(int); }; \n A a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a.*pm)(5));"); - } catch ( ParserException e ){ - assertTrue( e.getMessage().equals( "FAILURE" ) ); - } -// Iterator i = parse ("class A { int m(int); }; \n A a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a.*pm)(5));").getDeclarations(); -// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); -// Iterator members = getDeclarations(cl); -// IASTMethod method = (IASTMethod)members.next(); -// IASTVariable a = (IASTVariable) i.next(); -// IASTVariable pm = (IASTVariable) i.next(); -// IASTFunction f1 = (IASTFunction) i.next(); -// IASTFunction f2 = (IASTFunction) i.next(); -// IASTVariable x = (IASTVariable) i.next(); -// -// assertAllReferences( 5 /* should be 8 */, -// createTaskList( new Task( cl, 2 /* should be 3 */ ), new Task( method ), new Task( a ), new Task( pm ) /* should be ,new Task( f2 ) */ -// )); - } - public void testPMArrowStarPointerToMemberFunction_Bug43242() throws Exception - { - //parse no longer passes - try{ - parse ("class A { int m(int); }; \n A * a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a->*pm)(5));"); - } catch ( ParserException e ){ - assertTrue( e.getMessage().equals( "FAILURE" ) ); - } -// Iterator i = parse ("class A { int m(int); }; \n A * a; int A::*pm = &A::m; \n int f(){} \n int f(int); \n int x = f((a->*pm)(5));").getDeclarations(); -// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); -// Iterator members = getDeclarations(cl); -// IASTMethod method = (IASTMethod)members.next(); -// IASTVariable a = (IASTVariable) i.next(); -// IASTVariable pm = (IASTVariable) i.next(); -// IASTFunction f1 = (IASTFunction) i.next(); -// IASTFunction f2 = (IASTFunction) i.next(); -// IASTVariable x = (IASTVariable) i.next(); -// -// assertAllReferences( 5 /* should be more */, -// createTaskList( new Task( cl, 2 ), new Task( method ), new Task( a /*, 2 */), new Task( pm )/* ,new Task( f2 )*/)); -// - } - public void testUnaryStarCastexpressionPointerToFunction_Bug43241() throws Exception - { - Iterator i = parse ("int m(int); \n int *pm = &m; \n int f(){} \n int f(int); \n int x = f((*pm)(5));").getDeclarations(); - IASTFunction m = (IASTFunction) i.next(); - IASTVariable pm = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 2 /* should be 3 */, - createTaskList( new Task( m ), new Task( pm ) /* ,new Task( f2 )*/)); - } - - // Kind DELETE_CASTEXPRESSION - // Kind DELETE_VECTORCASTEXPRESSION - // Kind CASTEXPRESSION - // Kind PM_DOTSTAR - public void testPMDotStar_bug43579() throws Exception - { - //parse no longer passes - try{ - parse ( "class A { int m; }; \n A a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a.*pm);" ); - } catch ( ParserException e ){ - assertTrue( e.getMessage().equals( "FAILURE" ) ); - } -// Iterator i = parse ("class A { int m; }; \n A a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a.*pm);").getDeclarations(); -// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); -// IASTVariable a = (IASTVariable) i.next(); -// IASTVariable pm = (IASTVariable) i.next(); -// IASTFunction f1 = (IASTFunction) i.next(); -// IASTFunction f2 = (IASTFunction) i.next(); -// IASTVariable x = (IASTVariable) i.next(); -// assertFalse( i.hasNext() ); -// assertAllReferences( 4 /*should be 5 */, createTaskList( new Task( cl /* , 2 */ ), new Task( a), new Task( pm), new Task( f2))); - } - - // Kind PM_ARROWSTAR - public void testPMArrowStar_bug43579() throws Exception - { - //parse no longer passes - try{ - parse ("class A { int m; }; \n A * a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a->*pm);"); - } catch ( ParserException e ){ - assertTrue( e.getMessage().equals( "FAILURE" ) ); - } -// Iterator i = parse ("class A { int m; }; \n A * a; int A::*pm; \n int f(){} \n int f(int); \n int x = f(a->*pm);").getDeclarations(); -// IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); -// IASTVariable a = (IASTVariable) i.next(); -// IASTVariable pm = (IASTVariable) i.next(); -// IASTFunction f1 = (IASTFunction) i.next(); -// IASTFunction f2 = (IASTFunction) i.next(); -// IASTVariable x = (IASTVariable) i.next(); -// assertFalse( i.hasNext() ); -// assertAllReferences( 4 /*should be 5 */, createTaskList( new Task( cl /* , 2 */ ), new Task( a), new Task( pm), new Task( f2))); - } - - public void testErrorHandling_1() throws Exception - { - Iterator i = parse( "A anA; int x = c; class A {}; A * anotherA = &anA; int b;", false ).getDeclarations(); - IASTVariable x = (IASTVariable)i.next(); - assertEquals( x.getName(), "x"); - IASTClassSpecifier A = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable anotherA = (IASTVariable)i.next(); - assertFalse(i.hasNext()); // should be true - // this variable is skipped because of wrong error handling -// IASTVariable b = (IASTVariable)i.next(); -// assertEquals( b.getName(), "b"); -// assertFalse(i.hasNext()); - } - - public void testBug44340() throws Exception { - try { - // inline function with reference to variables declared after them - IASTScope scope = parse ("class A{ int getX() {return x[1];} int x[10];};"); - Iterator i = scope.getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(classA); - IASTMethod g = (IASTMethod)j.next(); - IASTField x = (IASTField)j.next(); - assertFalse(j.hasNext()); - assertAllReferences( 1, createTaskList( new Task( x ))); - - } catch (ParserException e){ - // parsing fails for now - } - - - } - - public void testBug47926() throws Exception{ - StringBuffer buffer = new StringBuffer(); - buffer.append( "void f () {} \n" ); - buffer.append( "class A { }; \n" ); - buffer.append( "void main() { A * a = new A(); a->f(); } "); - - Iterator i = parse( buffer.toString() ).getDeclarations(); - - IASTFunction f = (IASTFunction) i.next(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - - IASTFunction main = (IASTFunction) i.next(); - - Iterator fnIter = getDeclarations( main ); - IASTVariable a = (IASTVariable) fnIter.next(); - - //there should be no reference to f, but there is - //assertAllReferences( 3, createTaskList( new Task( classA, 2 ), new Task( a ) ) ); - assertAllReferences( 4, createTaskList( new Task( classA, 2 ), new Task( a ), new Task( f ) ) ); - } -} diff --git a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/STLFailedTests.java b/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/STLFailedTests.java deleted file mode 100644 index fcca66c94f5..00000000000 --- a/core/org.eclipse.cdt.core.tests/failures/org/eclipse/cdt/core/parser/failedTests/STLFailedTests.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.failedTests; -import java.io.StringWriter; -import java.io.Writer; - -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.tests.BaseASTTest; - -/** - * @author hamer - */ -public class STLFailedTests extends BaseASTTest { - - public STLFailedTests(String name) { - super(name); - } - - public void testBug36805() throws Exception{ - Writer code = new StringWriter(); - code.write("__STL_BEGIN_NAMESPACE\n"); - code.write("template class char_traits\n"); - code.write(": public __char_traits_base<_CharT, _CharT>\n"); - code.write("{};\n"); - assertCodeFailsParse(code.toString()); - } - - public void testBug40714() throws Exception{ - // templates of variables - Writer code = new StringWriter(); - code.write("template \n"); - code.write("char* default_alloc_template<__threads, __inst>::_S_start_free = 0;\n"); - IASTCompilationUnit cu = parse(code.toString()); - IASTTemplateDeclaration templateDecl = (IASTTemplateDeclaration) cu.getDeclarations().next(); - // should not get this exception - IASTVariable v = (IASTVariable) templateDecl.getOwnedDeclaration(); - assertEquals( v, null ); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/DependencyTests.java b/core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/DependencyTests.java deleted file mode 100644 index 5b9ec6dc680..00000000000 --- a/core/org.eclipse.cdt.core.tests/indexer/org/eclipse/cdt/core/indexer/tests/DependencyTests.java +++ /dev/null @@ -1,710 +0,0 @@ -/* - * Created on Sep 25, 2003 - */ -package org.eclipse.cdt.core.indexer.tests; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Set; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.search.BasicSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.index.impl.IFileDocument; -import org.eclipse.cdt.internal.core.search.PathCollector; -import org.eclipse.cdt.internal.core.search.PatternSearchJob; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.matching.CSearchPattern; -import org.eclipse.cdt.internal.core.sourcedependency.DependencyQueryJob; -import org.eclipse.core.internal.resources.ResourceException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; - - /** - * @author bgheorgh - */ - public class DependencyTests extends TestCase { - IFile file; - IFileDocument fileDoc; - IProject testProject; - NullProgressMonitor monitor; - IndexManager indexManager; - IWorkspace workspace; - BasicSearchResultCollector resultCollector; - SearchEngine searchEngine; - ICSearchScope scope; - - public static Test suite() { - TestSuite suite = new TestSuite(DependencyTests.class.getName()); - - suite.addTest(new DependencyTests("testDependencyTree")); - suite.addTest(new DependencyTests("testDepTable")); - suite.addTest(new DependencyTests("testDepSourceChangeTree")); - suite.addTest(new DependencyTests("testDepHeaderChangeTree")); - suite.addTest(new DependencyTests("testDepHeaderChangeReindex")); - suite.addTest(new DependencyTests("testDepSourceChangeTable")); - suite.addTest(new DependencyTests("testDepHeaderChangeTable")); - return suite; - } - /** - * @param name - */ - public DependencyTests(String name) { - super(name); - // TODO Auto-generated constructor stub - } - /* - * @see TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - //Create temp project - testProject = createProject("DepTestProject"); - if (testProject==null) - fail("Unable to create project"); - - indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); - indexManager.reset(); - - workspace = ResourcesPlugin.getWorkspace(); - - scope = SearchEngine.createWorkspaceScope(); - monitor = new NullProgressMonitor(); - resultCollector = new BasicSearchResultCollector(); - - searchEngine = new SearchEngine(); - } - /* - * @see TestCase#tearDown() - */ - protected void tearDown() { - try { - super.tearDown(); - } catch (Exception e1) { - } - //Delete project - if (testProject.exists()){ - try { - testProject.delete(true,monitor); - } catch (ResourceException e) { - } catch (CoreException e) { - } - } - } - public void testDependencyTree() throws Exception{ - //Add a file to the project - importFile("c.h","resources/dependency/c.h"); - importFile("a.h","resources/dependency/a.h"); - importFile("Inc1.h","resources/dependency/Inc1.h"); - importFile("DepTest.h","resources/dependency/DepTest.h"); - importFile("d.h","resources/dependency/d.h"); - importFile("DepTest2.h","resources/dependency/DepTest2.h"); - IFile depTest = importFile("DepTest.cpp","resources/dependency/DepTest.cpp"); - IFile depTest2 = importFile("DepTest2.cpp","resources/dependency/DepTest2.cpp"); - //Enable indexing on the created project - //By doing this, we force the Dependency Manager to do a g() - - IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); - //indexManager.setEnabled(testProject,true); - - - String[] depTestModel = {File.separator + "DepTestProject" + File.separator + "d.h", File.separator + "DepTestProject" + File.separator + "Inc1.h", File.separator + "DepTestProject" + File.separator + "c.h", File.separator + "DepTestProject" + File.separator + "a.h", File.separator + "DepTestProject" + File.separator + "DepTest.h"}; - String[] depTest2Model = {File.separator + "DepTestProject" + File.separator + "d.h", File.separator + "DepTestProject" + File.separator + "DepTest2.h"}; - - ArrayList includes = new ArrayList(); - indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null,null); - - String[] depTestModelLocal = convertToLocalPath(depTestModel); - String[] depTestIncludes = new String[includes.size()]; - Iterator includesIterator = includes.iterator(); - int i=0; - while(includesIterator.hasNext()){ - depTestIncludes[i] = (String) includesIterator.next(); - i++; - } - - if (depTestModelLocal.length != depTestIncludes.length) - fail("Number of included files differsfrom model"); - - Arrays.sort(depTestModelLocal); - Arrays.sort(depTestIncludes); - - for (i=0;iPreferences>Java>Code Generation>Code and Comments - */ -public class CompletionProposalsTest extends TestCase{ - private final static long MAGIC_NUMBER = 1000; - private ICProject fCProject; - private IFile headerFile; - private IFile bodyFile; - private NullProgressMonitor monitor; - - public static Test suite() { - TestSuite suite= new TestSuite(CompletionProposalsTest.class.getName()); - suite.addTest(new CompletionProposalsTest("testCompletionProposals")); - return suite; - } - - public CompletionProposalsTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - monitor = new NullProgressMonitor(); - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - - fCProject= CProjectHelper.createCProject("TestProject1", "bin"); - bodyFile = fCProject.getProject().getFile("CompletionProposalsTestStart.cpp"); - headerFile = fCProject.getProject().getFile("CompletionProposalsTestStart.h"); - if ((!headerFile.exists()) || (!bodyFile.exists())) { - try{ - FileInputStream bodyFileIn = new FileInputStream(pluginRoot+ "resources/cfiles/CompletionProposalsTestStart.cpp"); - bodyFile.create(bodyFileIn,false, monitor); - FileInputStream headerFileIn = new FileInputStream(pluginRoot+ "resources/cfiles/CompletionProposalsTestStart.h"); - headerFile.create(headerFileIn,false, monitor); - } catch (CoreException e) { - e.printStackTrace(); - } - } - if (!fCProject.getProject().hasNature(CCProjectNature.CC_NATURE_ID)) { - addNatureToProject(fCProject.getProject(), CCProjectNature.CC_NATURE_ID, null); - } - - // use the new indexer - IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); - indexManager.reset(); - - } - - private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = proj.getDescription(); - String[] prevNatures= description.getNatureIds(); - String[] newNatures= new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length]= natureId; - description.setNatureIds(newNatures); - proj.setDescription(description, monitor); - } - - protected void tearDown() { - try{ - CProjectHelper.delete(fCProject); - } - catch (ResourceException e) {} - catch (CoreException e) {} - } - - public void testCompletionProposals(){ - try{ - TranslationUnit headerTu = new TranslationUnit(fCProject, headerFile); - TranslationUnit tu = new TranslationUnit(fCProject, bodyFile); - String buffer = tu.getBuffer().getContents(); - Document document = new Document(buffer); - int pos = buffer.indexOf(" a ") + 2; - CCompletionProcessor completionProcessor = new CCompletionProcessor(null); - IWorkingCopy wc = null; - try{ - wc = tu.getWorkingCopy(); - }catch (CModelException e){ - fail("Failed to get working copy"); - } - ICompletionProposal[] results = completionProcessor.evalProposals(document, pos, wc, null); - try { - Thread.sleep(MAGIC_NUMBER); - } catch (InterruptedException e1) { - fail( "Bogdan's hack did not suffice"); - } - -// assertEquals(results.length, 8); - for (int i = 0; i include - checkInclude(tu); - - // tu ---> macro - checkMacro(tu); - - // tu ---> namespace: MyPackage - ArrayList tuPackages = tu.getChildrenOfType(ICElement.C_NAMESPACE); - INamespace namespace = (INamespace) tuPackages.get(0); - assertEquals(namespace.getElementName(), new String("MyPackage")); - checkElementOffset((CElement)namespace); - checkLineNumbers((CElement)namespace, 8, 130); - checkClass(namespace); - - checkEnums(namespace); - - checkVariables(namespace); - - checkVariableDeclarations(namespace); - - checkFunctions(namespace); - - checkStructs(namespace); - - checkTemplates(namespace); - - checkArrays(tu); - } - - private void checkInclude(IParent tu){ - ArrayList tuIncludes = tu.getChildrenOfType(ICElement.C_INCLUDE); - IInclude inc1 = (IInclude) tuIncludes.get(0); - assertEquals(inc1.getElementName(), new String("stdio.h")); - checkElementOffset((CElement)inc1); - checkLineNumbers((CElement)inc1, 2, 2); - } - - private void checkMacro(IParent tu){ - ArrayList tuMacros = tu.getChildrenOfType(ICElement.C_MACRO); - IMacro mac1 = (IMacro) tuMacros.get(0); - assertEquals(mac1.getElementName(), new String("PRINT")); - checkElementOffset((CElement)mac1); - checkLineNumbers((CElement)mac1, 5, 5); - } - - private void checkClass(IParent namespace){ - // MyPackage ---> class: Hello - ArrayList nsClasses = namespace.getChildrenOfType(ICElement.C_CLASS); - IStructure classHello = (IStructure) nsClasses.get(0); - assertEquals(classHello.getElementName(), new String("Hello")); - checkElementOffset((CElement)classHello); - checkLineNumbers((CElement)classHello, 12, 53); - - // Hello --> field: int x - ArrayList helloFields = classHello.getChildrenOfType(ICElement.C_FIELD); - IField intX = (IField) helloFields.get(0); - assertEquals(intX.getElementName(), new String("x")); - checkElementOffset((CElement)intX); - assertEquals(intX.getTypeName(), new String("int")); - checkLineNumbers((CElement)intX, 17, 17); - - ASTAccessVisibility xVisibility = intX.getVisibility(); - if (xVisibility != ASTAccessVisibility.PROTECTED) - fail("visibility should be protected!"); - - // Hello ---> method: void setX(int X) - ArrayList helloMethods = classHello.getChildrenOfType(ICElement.C_METHOD); - IMethod setX = (IMethod) helloMethods.get(0); - assertEquals(setX.getElementName(), new String("setX")); - checkElementOffset((CElement)setX); - assertEquals(setX.getReturnType(), new String("void")); - checkLineNumbers((CElement)setX, 19, 22); - int setXNumOfParam = setX.getNumberOfParameters(); - if(setXNumOfParam != 1) - fail("setX should have one parameter!"); - String[] setXParamTypes = setX.getParameterTypes(); - String firstParamType = setXParamTypes[0]; - assertEquals(firstParamType, new String("int")); - // TODO : check for the inline here - - checkNestedNamespace(classHello); - } - private void checkNestedNamespace(IParent classHello){ - // Hello ---> namespace: MyNestedPackage - ArrayList helloNamespaces = classHello.getChildrenOfType(ICElement.C_NAMESPACE); - INamespace myNestedPackage = (INamespace) helloNamespaces.get(0); - assertEquals(myNestedPackage.getElementName(), new String("MyNestedPackage")); - checkElementOffset((CElement)myNestedPackage); - checkLineNumbers((CElement)myNestedPackage, 25, 52); - - checkParentNestedClass(myNestedPackage); - checkDerivedNestedClass(myNestedPackage); - } - private void checkParentNestedClass(IParent myNestedPackage){ - // MyNestedPackage ---> class: Y - ArrayList nestedClasses = myNestedPackage.getChildrenOfType(ICElement.C_CLASS); - IStructure classY = (IStructure) nestedClasses.get(0); - assertEquals(classY.getElementName(), new String("Y")); - checkElementOffset((CElement)classY); - checkLineNumbers((CElement)classY, 28, 35); - - // Y ---> constructor: Y - ArrayList yMethods = classY.getChildrenOfType(ICElement.C_METHOD_DECLARATION); - IMethodDeclaration constructor = (IMethodDeclaration) yMethods.get(0); - assertEquals(constructor.getElementName(), new String("Y")); - checkElementOffset((CElement)constructor); - assertTrue (constructor.isConstructor()); - checkLineNumbers((CElement)constructor, 32, 32); - - // Y ---> destructor: ~Y - IMethodDeclaration destructor = (IMethodDeclaration) yMethods.get(1); - assertEquals(destructor.getElementName(), new String("~Y")); - checkElementOffset((CElement)destructor); - assertTrue (destructor.isDestructor()); - checkLineNumbers((CElement)destructor, 34, 34); - // TODO: check for virtual on destructors - - } - - private void checkDerivedNestedClass(IParent myNestedPackage){ - // MyNestedPackage ---> class: X public Y - ArrayList nestedClasses = myNestedPackage.getChildrenOfType(ICElement.C_CLASS); - IStructure classX = (IStructure) nestedClasses.get(1); - assertEquals(classX.getElementName(), new String("X")); - checkElementOffset((CElement)classX); - checkLineNumbers((CElement)classX, 38, 51); - // TODO : Check for base classes here - - // X --> field: B b - ArrayList xFieldChildren = classX.getChildrenOfType(ICElement.C_FIELD); - IField bB = (IField) xFieldChildren.get(0); - assertEquals(bB.getElementName(), new String("b")); - checkElementOffset((CElement)bB); - assertEquals(bB.getTypeName(), new String("B")); - checkLineNumbers((CElement)bB, 42, 42); - ASTAccessVisibility bVisibility = bB.getVisibility(); - if (bVisibility != ASTAccessVisibility.PRIVATE) - fail("visibility should be private!"); - - // X ---> constructor chain: X - ArrayList xMethodChildren = classX.getChildrenOfType(ICElement.C_METHOD); - IMethod xconstructor = (IMethod) xMethodChildren.get(0); - assertEquals(xconstructor.getElementName(), new String("X")); - checkElementOffset((CElement)xconstructor); - assertTrue (xconstructor.isConstructor()); - checkLineNumbers((CElement)xconstructor, 46, 48); - - // X ---> method declaration: doNothing - ArrayList xMethodDeclarations = classX.getChildrenOfType(ICElement.C_METHOD_DECLARATION); - IMethodDeclaration xDoNothing = (IMethodDeclaration) xMethodDeclarations.get(0); - assertEquals(xDoNothing.getElementName(), new String("doNothing")); - checkElementOffset((CElement)xDoNothing); - assertEquals(xDoNothing.getReturnType(), new String("int")); - checkLineNumbers((CElement)xDoNothing, 50, 50); - } - - private void checkEnums(IParent namespace){ - // MyPackage ---> enum: Noname - ArrayList nsEnums = namespace.getChildrenOfType(ICElement.C_ENUMERATION); - IEnumeration enum = (IEnumeration) nsEnums.get(0); - assertEquals(enum.getElementName(), new String("")); - checkElementOffset((CElement)enum); - checkLineNumbers((CElement)enum, 57, 61); - - // enum ---> enumerator: first - ArrayList enumEnumerators = enum.getChildrenOfType(ICElement.C_ENUMERATOR); - IEnumerator first = (IEnumerator) enumEnumerators.get(0); - assertEquals(first.getElementName(), new String("first")); - checkElementOffset((CElement)first); - // enum ---> enumerator: second - IEnumerator second = (IEnumerator) enumEnumerators.get(1); - assertEquals(second.getElementName(), new String("second")); - checkElementOffset((CElement)second); - // enum ---> enumerator: third - IEnumerator third = (IEnumerator) enumEnumerators.get(2); - checkElementOffset((CElement)third); - assertEquals(third.getElementName(), new String("third")); - checkElementOffset((CElement)third); - - // MyPackage ---> enum: MyEnum - IEnumeration myEnum = (IEnumeration) nsEnums.get(1); - assertEquals(myEnum.getElementName(), new String("MyEnum")); - checkElementOffset((CElement)myEnum); - checkLineNumbers((CElement)myEnum, 64, 67); - - // enum ---> enumerator: first - ArrayList myEnumEnumerators = myEnum.getChildrenOfType(ICElement.C_ENUMERATOR); - IEnumerator f = (IEnumerator) myEnumEnumerators.get(0); - assertEquals(f.getElementName(), new String("f")); - checkElementOffset((CElement)f); - // enum ---> enumerator: second - IEnumerator s = (IEnumerator) myEnumEnumerators.get(1); - assertEquals(s.getElementName(), new String("s")); - checkElementOffset((CElement)s); - // enum ---> enumerator: third - IEnumerator t = (IEnumerator) myEnumEnumerators.get(2); - assertEquals(t.getElementName(), new String("t")); - checkElementOffset((CElement)t); - } - - private void checkVariables(IParent namespace){ - // MyPackage ---> int v - ArrayList nsVars = namespace.getChildrenOfType(ICElement.C_VARIABLE); - IVariable var1 = (IVariable) nsVars.get(0); - assertEquals(var1.getElementName(), new String("v")); - checkElementOffset((CElement)var1); - assertEquals(var1.getTypeName(), new String("int")); - checkLineNumbers((CElement)var1, 71, 71); - - // MyPackage ---> unsigned long vuLong - IVariable var2 = (IVariable) nsVars.get(1); - assertEquals(var2.getElementName(), new String("vuLong")); - checkElementOffset((CElement)var2); - assertEquals(var2.getTypeName(), new String("unsigned long int")); - checkLineNumbers((CElement)var2, 73, 73); - - // MyPackage ---> unsigned short vuShort - IVariable var3 = (IVariable) nsVars.get(2); - assertEquals(var3.getElementName(), new String("vuShort")); - checkElementOffset((CElement)var3); - assertEquals(var3.getTypeName(), new String("unsigned short int")); - checkLineNumbers((CElement)var3, 75, 75); - - // MyPackage ---> function pointer: orig_malloc_hook - IVariable vDecl2 = (IVariable) nsVars.get(3); - assertEquals(vDecl2.getElementName(), new String("orig_malloc_hook")); - checkElementOffset((CElement)vDecl2); - assertEquals(vDecl2.getTypeName(), new String ("void*(*)(const char*, int, size_t)")); - checkLineNumbers((CElement)vDecl2, 81, 81); - } - - private void checkVariableDeclarations(IParent namespace){ - // MyPackage ---> extern int evar - ArrayList nsVarDecls = namespace.getChildrenOfType(ICElement.C_VARIABLE_DECLARATION); - IVariableDeclaration vDecl1 = (IVariableDeclaration) nsVarDecls.get(0); - assertEquals(vDecl1.getElementName(), new String("evar")); - checkElementOffset((CElement)vDecl1); - assertEquals(vDecl1.getTypeName(), new String("int")); - checkLineNumbers((CElement)vDecl1, 79, 79); - } - - private void checkFunctions(IParent namespace){ - ArrayList nsFunctionDeclarations = namespace.getChildrenOfType(ICElement.C_FUNCTION_DECLARATION); - - // MyPackage ---> function: void foo() - IFunctionDeclaration f1 = (IFunctionDeclaration) nsFunctionDeclarations.get(0); - assertEquals(f1.getElementName(), new String("foo")); - checkElementOffset((CElement)f1); - assertEquals(f1.getReturnType(), new String("void")); - checkLineNumbers((CElement)f1, 85, 85); - - // MyPackage ---> function: char* foo(int&, char**) - IFunctionDeclaration f2 = (IFunctionDeclaration) nsFunctionDeclarations.get(1); - assertEquals(f2.getElementName(), new String("foo")); - checkElementOffset((CElement)f2); - assertEquals(f2.getReturnType(), new String("char*")); - checkLineNumbers((CElement)f2, 87, 88); - int fooNumOfParam = f2.getNumberOfParameters(); - if(fooNumOfParam != 2) - fail("foo should have two parameter!"); - String[] paramTypes = f2.getParameterTypes(); - assertEquals(paramTypes[0], new String("int&")); - assertEquals(paramTypes[1], new String("char**")); - - // MyPackage ---> function: void boo() {} - ArrayList nsFunctions = namespace.getChildrenOfType(ICElement.C_FUNCTION); - IFunction f3 = (IFunction) nsFunctions.get(0); - assertEquals(f3.getElementName(), new String("boo")); - checkElementOffset((CElement)f3); - assertEquals(f3.getReturnType(), new String("void")); - checkLineNumbers((CElement)f3, 90, 92); - } - - private void checkStructs(IParent namespace){ - // struct with name - ArrayList nsStructs = namespace.getChildrenOfType(ICElement.C_STRUCT); - IStructure struct1 = (IStructure) nsStructs.get(0); - assertEquals(struct1.getElementName(), new String ("MyStruct")); - checkElementOffset((CElement)struct1); - checkLineNumbers((CElement)struct1, 95, 97); - ArrayList struct1Fields = struct1.getChildrenOfType(ICElement.C_FIELD); - IField field1 = (IField) struct1Fields.get(0); - assertEquals(field1.getElementName(), new String("sint")); - checkElementOffset((CElement)field1); - assertEquals(field1.getTypeName(), new String("int")); - checkLineNumbers((CElement)field1, 96, 96); - - if(field1.getVisibility() != ASTAccessVisibility.PUBLIC) - fail("field visibility should be public!"); - - // struct no name - IStructure struct2 = (IStructure) nsStructs.get(1); - assertEquals(struct2.getElementName(), new String ("")); - checkElementOffset((CElement)struct2); - checkLineNumbers((CElement)struct2, 101, 103); - ArrayList struct2Fields = struct2.getChildrenOfType(ICElement.C_FIELD); - IField field2 = (IField) struct2Fields.get(0); - assertEquals(field2.getElementName(), new String("ss")); - checkElementOffset((CElement)field2); - assertEquals(field2.getTypeName(), new String("int")); - checkLineNumbers((CElement)field2, 102, 102); - if(field2.getVisibility() != ASTAccessVisibility.PUBLIC) - fail("field visibility should be public!"); - - // typedefs - ArrayList nsTypeDefs = namespace.getChildrenOfType(ICElement.C_TYPEDEF); - ITypeDef td1 = (ITypeDef) nsTypeDefs.get(0); - assertEquals(td1.getElementName(), new String ("myStruct")); - checkElementOffset((CElement)td1); - assertEquals(td1.getTypeName(), new String ("struct MyStruct")); - checkLineNumbers((CElement)td1, 99, 99); - ITypeDef td2 = (ITypeDef) nsTypeDefs.get(1); - assertEquals(td2.getElementName(), new String ("myTypedef")); - checkElementOffset((CElement)td2); - assertEquals(td2.getTypeName(), new String ("")); - checkLineNumbers((CElement)td2, 101, 103); - - // union - ArrayList nsUnions = namespace.getChildrenOfType(ICElement.C_UNION); - IStructure u0 = (IStructure) nsUnions.get(0); - assertEquals(u0.getElementName(), new String("U")); - checkElementOffset((CElement)u0); - checkLineNumbers((CElement)u0, 105, 107); - ArrayList u0Fields = u0.getChildrenOfType(ICElement.C_FIELD); - IField field3 = (IField) u0Fields.get(0); - assertEquals(field3.getElementName(), new String("U1")); - checkElementOffset((CElement)field3); - assertEquals(field3.getTypeName(), new String("int")); - checkLineNumbers((CElement)field3, 106, 106); - if(field3.getVisibility() != ASTAccessVisibility.PUBLIC) - fail("field visibility should be public!"); - } - - private void checkTemplates(IParent namespace){ - // template function - ArrayList functionTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_FUNCTION); - FunctionTemplate ft = (FunctionTemplate)functionTemplates.get(0); - assertEquals(ft.getElementName(), new String("aTemplatedFunction")); - checkElementOffset((CElement)ft); - String sig = ft.getTemplateSignature(); - assertEquals(ft.getTemplateSignature(), new String("aTemplatedFunction(B) : A")); - checkLineNumbers((CElement)ft, 112, 113); - - // template method - ArrayList nsClasses = namespace.getChildrenOfType(ICElement.C_CLASS); - IStructure enclosingClass = (IStructure) nsClasses.get(1); - checkLineNumbers((CElement)enclosingClass, 114, 118); - ArrayList methodTemplates = enclosingClass.getChildrenOfType(ICElement.C_TEMPLATE_METHOD); - MethodTemplate mt = (MethodTemplate)methodTemplates.get(0); - assertEquals(mt.getElementName(), new String("aTemplatedMethod")); - checkElementOffset((CElement)mt); - assertEquals(mt.getTemplateSignature(), new String("aTemplatedMethod(B) : A")); - checkLineNumbers((CElement)mt, 118, 119); - assertEquals(mt.getVisibility(), ASTAccessVisibility.PUBLIC); - - // template class - ArrayList classTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_CLASS); - StructureTemplate ct = (StructureTemplate)classTemplates.get(0); - assertEquals(ct.getElementName(), new String("myarray")); - checkElementOffset((CElement)ct); - assertEquals(ct.getTemplateSignature(), new String("myarray")); - checkLineNumbers((CElement)ct, 122, 123); - - // template struct - ArrayList structTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_STRUCT); - StructureTemplate st = (StructureTemplate)structTemplates.get(0); - assertEquals(st.getElementName(), new String("mystruct")); - checkElementOffset((CElement)st); - assertEquals(st.getTemplateSignature(), new String("mystruct")); - checkLineNumbers((CElement)st, 125, 126); - - // moved to failed tests - // also commented in the source file - // template variable -// ArrayList variableTemplates = namespace.getChildrenOfType(ICElement.C_TEMPLATE_VARIABLE); -// VariableTemplate vt = (VariableTemplate)variableTemplates.get(0); -// assertEquals(vt.getElementName(), new String("default_alloc_template<__threads,__inst>::_S_start_free")); -// checkElementOffset((CElement)mac1); -// assertEquals(vt.getTemplateSignature(), new String("default_alloc_template<__threads,__inst>::_S_start_free : char*")); -// checkLineNumbers((CElement)vt, 128, 129); - } - - private void checkArrays(IParent tu){ - // array variable - ArrayList variables = tu.getChildrenOfType(ICElement.C_VARIABLE); - IVariable arrayVar = (IVariable) variables.get(0); - assertEquals(arrayVar.getElementName(), new String("myArray")); - checkElementOffset((CElement)arrayVar); - assertEquals(arrayVar.getTypeName(), new String("int[][]")); - checkLineNumbers((CElement)arrayVar, 133, 133); - - // array parameter in function main - ArrayList functions = tu.getChildrenOfType(ICElement.C_FUNCTION); - IFunction mainFunction = (IFunction) functions.get(0); - assertEquals(mainFunction.getElementName(), new String("main")); - checkElementOffset((CElement)mainFunction); - assertEquals(mainFunction.getReturnType(), new String("int")); - checkLineNumbers((CElement)mainFunction, 134, 136); - int NumOfParam = mainFunction.getNumberOfParameters(); - if(NumOfParam != 2) - fail("main should have two parameter!"); - String[] paramTypes = mainFunction.getParameterTypes(); - assertEquals(paramTypes[0], new String("int")); - assertEquals(paramTypes[1], new String("char*[]")); - - } - private void checkLineNumbers(CElement element, int startLine, int endLine){ -// Remove comments when testBug36379() is fixed -// assertEquals(startLine, element.getStartLine()); -// assertEquals(endLine, element.getEndLine()); - } - private void checkElementOffset(CElement element){ - if(element.getElementName().length() > 0 ){ - assertTrue (element.getStartPos() <= element.getIdStartPos()); - assertEquals (element.getIdLength(), element.getElementName().length()); - } - else{ - assertEquals (element.getStartPos(), element.getIdStartPos()); - if(element instanceof ITypeDef) - assertEquals ( element.getIdLength(), ((ITypeDef)element).getTypeName().length()); - else if(element instanceof IEnumeration) - assertEquals ( element.getIdLength(), ((IEnumeration)element).getTypeName().length()); - else if(element instanceof IStructure) - assertEquals ( element.getIdLength(), ((IStructure)element).getTypeName().length()); - } - - } -} diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java deleted file mode 100644 index 19261d83846..00000000000 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.eclipse.cdt.core.model.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.internal.core.model.CModelStatus; -import org.eclipse.core.runtime.CoreException; - -/** - * - * CModelExceptionTest - * - * @author Judy N. Green - * @since Jul 19, 2002 - */ -public class CModelExceptionTest extends TestCase { - // Shared values setup and torn down - private Throwable throwableException; - private CModelStatus cModelStatus; - private CoreException coreException; - - /** - * Constructor for TestCModelException. - * @param name - */ - public CModelExceptionTest(String name) { - super(name); - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected void setUp() { - // create shared resources and setup the test fixture - cModelStatus = new CModelStatus(); - coreException = new CoreException(cModelStatus); - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() { - // release resources here and clean-up - } - - public static TestSuite suite() { - return new TestSuite(CModelExceptionTest.class); - } - - public static void main (String[] args){ - junit.textui.TestRunner.run(suite()); - } - - public void testCreationNoStatus(){ - CModelException testException = new CModelException(coreException); - - // should not be null - assertTrue("TestException is null", (testException != null)); - - // should be the same object inside - assertTrue("Object compare failed", testException.getException() == coreException); - } - public void testCreationWithStatus(){ - CModelException testException = new CModelException(coreException, - ICModelStatusConstants.INDEX_OUT_OF_BOUNDS); - // should not be null - assertTrue("TestException is null", (testException != null)); - - // should not be null - assertTrue("TestException.getStatus() is null", (testException.getStatus() != null)); - - // should have the same status as was set on creation - assertTrue("Object compare failed", testException.getStatus().getCode() == ICModelStatusConstants.INDEX_OUT_OF_BOUNDS); - } - - public void testElementDoesNotExist(){ - CModelException testException = new CModelException(coreException, - ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST); - // should not be null - assertTrue("TestException is null", (testException != null)); - - - // should not exist since this is the value we set on creation - assertTrue("Object unexpectedly exists", testException.doesNotExist()); - } - - public void testElementExists(){ - CModelException testException = new CModelException(coreException, - ICModelStatusConstants.INVALID_CONTENTS); - // should not be null - assertTrue("TestException is null", (testException != null)); - - - // should not exist since this is the value we set on creation - assertTrue("Object unexpectedly does not exist", testException.doesNotExist() == false); - } - - -} diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java deleted file mode 100644 index 2cef670c248..00000000000 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java +++ /dev/null @@ -1,237 +0,0 @@ -package org.eclipse.cdt.core.model.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import java.io.FileInputStream; -import java.io.FileNotFoundException; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.testplugin.CProjectHelper; -import org.eclipse.core.internal.resources.ResourceException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - - -/** - * @author Peter Graves - * - * This file contains a set of generic tests for the core C model. Nothing - * exotic, but should be a small sanity set of tests. - * - */ -public class CModelTests extends TestCase { - IWorkspace workspace; - IWorkspaceRoot root; - IProject project_c, project_cc; - NullProgressMonitor monitor; - String pluginRoot; - - /** - * Constructor for CModelTests. - * @param name - */ - public CModelTests(String name) { - super(name); - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected void setUp() throws CoreException { - /*** - * The test of the tests assume that they have a working workspace - * and workspace root object to use to create projects/files in, - * so we need to get them setup first. - */ - IWorkspaceDescription desc; - workspace= ResourcesPlugin.getWorkspace(); - root= workspace.getRoot(); - monitor = new NullProgressMonitor(); - if (workspace==null) - fail("Workspace was not setup"); - if (root==null) - fail("Workspace root was not setup"); - pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - desc=workspace.getDescription(); - desc.setAutoBuilding(false); - workspace.setDescription(desc); - - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() { - // release resources here and clean-up - } - - public static TestSuite suite() { - return new TestSuite(CModelTests.class); - } - - public static void main (String[] args){ - junit.textui.TestRunner.run(suite()); - } - - - /*** - * The follow are a simple set of tests to make usre the HasC/CCNature calls - * seem to be sane. - * - * Assumes that the CProjectHelper.createCProject properly creates a C - * project with a C nature, but does not add the CC nature. - * It also assums that the AddCCNature call works - * - * @see CProjectHelper#createCProject - * @see CoreModel#addCCNature - */ - public void testHasNature() throws CoreException { - ICProject testProject; - testProject=CProjectHelper.createCProject("naturetest", "none"); - if (testProject==null) - fail("Unable to create project"); - assertTrue("hasCNature works", CoreModel.getDefault().hasCNature(testProject.getProject())); - assertTrue("hasCCNature works without ccnature", !(CoreModel.getDefault().hasCCNature(testProject.getProject()))); - - - CCProjectNature.addCCNature(testProject.getProject(), monitor); - assertTrue("hasCCNature works", (CoreModel.getDefault().hasCCNature(testProject.getProject()))); - - CCProjectNature.removeCCNature(testProject.getProject(), monitor); - CCProjectNature.removeCNature(testProject.getProject(), monitor); - assertTrue("hasCNature works without cnature", !CoreModel.getDefault().hasCNature(testProject.getProject())); - assertTrue("hasCCNature works without ccnature or cnature", !(CoreModel.getDefault().hasCCNature(testProject.getProject()))); - - } - - /*** - * Simple tests to make sure the models file identification methods seem - * to work as expected. - */ - public void testFileType() throws CoreException,FileNotFoundException { - ICProject testProject; - testProject=CProjectHelper.createCProject("filetest", "none"); - if (testProject==null) - fail("Unable to create project"); - - IFile file = testProject.getProject().getFile("exetest_g"); - if (!file.exists()) { - file.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/exe_g"),false, monitor); - - } - /*** - * file should be a binary, executable, not shared or archive - */ - assertTrue("isBinary", CoreModel.getDefault().isBinary(file)); - assertTrue("isExecutable", CoreModel.getDefault().isExecutable(file)); - assertTrue("isSharedLib", !CoreModel.getDefault().isSharedLib(file)); - assertTrue("isArchive", !CoreModel.getDefault().isArchive(file)); - assertTrue("isObject", !CoreModel.getDefault().isObject(file)); - assertTrue("isTranslationUnit", !CoreModel.getDefault().isTranslationUnit(file)); - - - file = testProject.getProject().getFile("exetest.c"); - if (!file.exists()) { - file.create(new FileInputStream(pluginRoot+"resources/exe/main.c"),false, monitor); - - } - /*** - * file should be a translation unit - */ - assertTrue("isBinary", !CoreModel.getDefault().isBinary(file)); - assertTrue("isExecutable", !CoreModel.getDefault().isExecutable(file)); - assertTrue("isSharedLib", !CoreModel.getDefault().isSharedLib(file)); - assertTrue("isArchive", !CoreModel.getDefault().isArchive(file)); - assertTrue("isObject", !CoreModel.getDefault().isObject(file)); - assertTrue("isTranslationUnit", CoreModel.getDefault().isTranslationUnit(file)); - - file = testProject.getProject().getFile("exetest.o"); - if (!file.exists()) { - file.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/main.o"),false, monitor); - - } - /*** - * file should be a object file unit - */ - assertTrue("isBinary", CoreModel.getDefault().isBinary(file)); - assertTrue("isExecutable", !CoreModel.getDefault().isExecutable(file)); - assertTrue("isSharedLib", !CoreModel.getDefault().isSharedLib(file)); - assertTrue("isArchive", !CoreModel.getDefault().isArchive(file)); - assertTrue("isObject", CoreModel.getDefault().isObject(file)); - assertTrue("isTranslationUnit", !CoreModel.getDefault().isTranslationUnit(file)); - - file = testProject.getProject().getFile("liblibtest_g.so"); - if (!file.exists()) { - file.create(new FileInputStream(pluginRoot+"resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor); - - } - /*** - * file should be a sharedlib/binary file - */ - assertTrue("isBinary", CoreModel.getDefault().isBinary(file)); - assertTrue("isExecutable", !CoreModel.getDefault().isExecutable(file)); - assertTrue("isSharedLib", CoreModel.getDefault().isSharedLib(file)); - assertTrue("isArchive", !CoreModel.getDefault().isArchive(file)); - assertTrue("isObject", !CoreModel.getDefault().isObject(file)); - assertTrue("isTranslationUnit", !CoreModel.getDefault().isTranslationUnit(file)); - - file = testProject.getProject().getFile("liblibtest_g.a"); - if (!file.exists()) { - file.create(new FileInputStream(pluginRoot+"resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor); - - } else { - fail("Does not exist?"); - } - /*** - * file should be a archive file - */ - assertTrue("isArchive", CoreModel.getDefault().isArchive(file)); - assertTrue("isBinary:", !CoreModel.getDefault().isBinary(file)); - assertTrue("isExecutable", !CoreModel.getDefault().isExecutable(file)); - assertTrue("isSharedLib", !CoreModel.getDefault().isSharedLib(file)); - assertTrue("isArchive", CoreModel.getDefault().isArchive(file)); - assertTrue("isObject", !CoreModel.getDefault().isObject(file)); - assertTrue("isTranslationUnit", !CoreModel.getDefault().isTranslationUnit(file)); - - - - try{ - testProject.getProject().delete(true,true,monitor); - } - catch (ResourceException e) {} - catch (CoreException e) {} - } - - /**** - * Some simple tests for isValidTranslationUnitName - */ - public void testIsValidTranslationUnitName() throws CoreException { - assertTrue("Invalid C file", !CoreModel.getDefault().isValidTranslationUnitName("notcfile")); - assertTrue("Invalid C file", !CoreModel.getDefault().isValidTranslationUnitName("not.c.file")); - assertTrue("Invalid C file", !CoreModel.getDefault().isValidTranslationUnitName("not.ca")); - assertTrue("Valid C file", CoreModel.getDefault().isValidTranslationUnitName("areal.c")); - } -} diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java deleted file mode 100644 index 6b8604943ab..00000000000 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java +++ /dev/null @@ -1,168 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model.tests; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ElementChangedEvent; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICPathEntry; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IElementChangedListener; -import org.eclipse.cdt.testplugin.CProjectHelper; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -/* - * CPathEntryTest - */ -public class CPathEntryTest extends TestCase { - IWorkspace workspace; - IWorkspaceRoot root; - IProject project_c, project_cc; - NullProgressMonitor monitor; - String pluginRoot; - - class CElementListener implements IElementChangedListener { - - int count = 0; - - void processDelta(ICElementDelta delta) { - if (delta == null) { - return ; - } - int flags = delta.getFlags(); - int kind = delta.getKind(); - if (kind == ICElementDelta.CHANGED ) { - if ((flags & ICElementDelta.F_ADDED_TO_CPATHENTRY) != 0) { - count++; - } - } - ICElementDelta[] affectedChildren= delta.getAffectedChildren(); - for (int i= 0; i < affectedChildren.length; i++) { - processDelta(affectedChildren[i]); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.core.model.IElementChangedListener#elementChanged(org.eclipse.cdt.core.model.ElementChangedEvent) - */ - public void elementChanged(ElementChangedEvent event) { - processDelta(event.getDelta()); - } - - } - - /** - * Constructor for CModelTests. - * - * @param name - */ - public CPathEntryTest(String name) { - super(name); - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - */ - protected void setUp() throws CoreException { - /*************************************************************************************************************************** - * The test of the tests assume that they have a working workspace and workspace root object to use to create - * projects/files in, so we need to get them setup first. - */ - IWorkspaceDescription desc; - workspace = ResourcesPlugin.getWorkspace(); - root = workspace.getRoot(); - monitor = new NullProgressMonitor(); - if (workspace == null) - fail("Workspace was not setup"); - if (root == null) - fail("Workspace root was not setup"); - pluginRoot = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - desc = workspace.getDescription(); - desc.setAutoBuilding(false); - workspace.setDescription(desc); - - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() { - // release resources here and clean-up - } - - public static TestSuite suite() { - return new TestSuite(CPathEntryTest.class); - } - - public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); - } - - /******************************************************************************************************************************* - * Check if the CPathEntry's are generated. - * - * @see CProjectHelper#createCProject - */ - public void testCPathEntries() throws CoreException { - ICProject testProject; - testProject = CProjectHelper.createCProject("cpathtest", "none"); - if (testProject == null) - fail("Unable to create project"); - ICPathEntry[] entries = testProject.getResolvedCPathEntries(); - assertTrue("No cpathentries", entries.length == 0); - entries = new ICPathEntry[3]; - entries[0] = CoreModel.newIncludeEntry(new Path("cpathtest"), new Path("/usr/include"), true); - entries[1] = CoreModel.newIncludeEntry(new Path("cpaththest/foo.c"), new Path("/usr/include"), true); - entries[2] = CoreModel.newLibraryEntry(new Path("/usr/lib/libc.so.1"), null, null, null); - testProject.setRawCPathEntries(entries, new NullProgressMonitor()); - entries = testProject.getResolvedCPathEntries(); - assertTrue("Tree cpathenties", entries.length == 3); - } - - /******************************************************************************************************************************* - * Check if the CPathEntry's are generated. - * - * @see CProjectHelper#createCProject - */ - public void testCPathEntriesDelta() throws CoreException { - ICProject testProject; - testProject = CProjectHelper.createCProject("cpathtest2", "none"); - if (testProject == null) - fail("Unable to create project"); - ICPathEntry[] entries = new ICPathEntry[3]; - entries[0] = CoreModel.newIncludeEntry(new Path("cpathtest"), new Path("/usr/include"), true); - entries[1] = CoreModel.newIncludeEntry(new Path("cpaththest/foo.c"), new Path("/usr/include"), true); - entries[2] = CoreModel.newLibraryEntry(new Path("/usr/lib/libc.so.1"), null, null, null); - final int count = 0; - CElementListener listener = new CElementListener(); - CoreModel.getDefault().addElementChangedListener(listener); - testProject.setRawCPathEntries(entries, new NullProgressMonitor()); - entries = testProject.getResolvedCPathEntries(); - assertTrue("Tree cpathenties", listener.count == 2); - } -} diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/DeclaratorsTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/DeclaratorsTests.java deleted file mode 100644 index 116398fe1be..00000000000 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/DeclaratorsTests.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Created on Jun 9, 2003 - * by bnicolle - */ -package org.eclipse.cdt.core.model.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.ITypeDef; -import org.eclipse.cdt.core.model.IVariable; - - -/** - * @author bnicolle - * - */ -public class DeclaratorsTests extends IntegratedCModelTest { - /** - * @param name - */ - public DeclaratorsTests(String name) { - super(name); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IntegratedCModelTest - */ - public String getSourcefileSubdir() { - return "resources/cmodel/"; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IntegratedCModelTest - */ - public String getSourcefileResource() { - return "DeclaratorsTests.cpp"; - } - - /** - * @returns a test suite named after this class - * containing all its public members named "test*" - */ - public static Test suite() { - TestSuite suite= new TestSuite(DeclaratorsTests.class); - return suite; - } - - - public void testDeclarators_0001() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0001"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_FUNCTION_DECLARATION); - IFunctionDeclaration decl = (IFunctionDeclaration)element; - assertEquals(decl.getSignature(), "decl_0001(char)"); - assertEquals(decl.getReturnType(), "void"); - } - - public void testDeclarators_0002() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0002"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_FUNCTION_DECLARATION); - IFunctionDeclaration decl = (IFunctionDeclaration)element; - assertEquals(decl.getSignature(), "decl_0002(char)"); - assertEquals(decl.getReturnType(), "void"); - } - - - - public void testDeclarators_0004() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0004"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_FUNCTION_DECLARATION); - IFunctionDeclaration decl = (IFunctionDeclaration)element; - assertEquals(decl.getSignature(), "decl_0004(char)"); - assertEquals(decl.getReturnType(), "void*"); - } - - public void testDeclarators_0005() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0005"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_VARIABLE); - IVariable decl = (IVariable)element; - assertEquals(decl.getTypeName(), "void(*)(char)"); - } - - public void testDeclarators_0015() throws CModelException { - ITranslationUnit tu = getTU(); - ICElement element = tu.getElement("decl_0015"); - assertNotNull(element); - assertEquals(element.getElementType(), ICElement.C_TYPEDEF); - ITypeDef decl = (ITypeDef)element; - assertEquals(decl.getTypeName(), "void(*)(char)"); - } -} diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ElementDeltaTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ElementDeltaTests.java deleted file mode 100644 index 530cf440549..00000000000 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ElementDeltaTests.java +++ /dev/null @@ -1,290 +0,0 @@ -package org.eclipse.cdt.core.model.tests; - - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.io.FileInputStream; -import java.util.Iterator; -import java.util.Vector; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ElementChangedEvent; -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IElementChangedListener; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.core.model.TranslationUnit; -import org.eclipse.cdt.testplugin.CProjectHelper; -import org.eclipse.cdt.testplugin.TestPluginLauncher; -import org.eclipse.core.internal.resources.ResourceException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -/** - * Class for testing the C Element Delta Builder. - */ -public class ElementDeltaTests extends TestCase implements IElementChangedListener { - private ICProject fCProject; - private IFile headerFile; - private NullProgressMonitor monitor; - private Vector addedElements; - private Vector removedElements; - private Vector changedElements; - - public static void main(String[] args) { - TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), WorkingCopyTests.class, args); - } - - public static Test suite() { - TestSuite suite= new TestSuite(ElementDeltaTests.class.getName()); - suite.addTest(new ElementDeltaTests("testElementDeltas")); - return suite; - } - - public ElementDeltaTests(String name) { - super(name); - } - - protected void setUp() throws Exception { - monitor = new NullProgressMonitor(); - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - - fCProject= CProjectHelper.createCProject("TestProject1", "bin"); - //Path filePath = new Path(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ fCProject.getPath().toString()+ "/WorkingCopyTest.h"); - headerFile = fCProject.getProject().getFile("WorkingCopyTest.h"); - if (!headerFile.exists()) { - try{ - FileInputStream fileIn = new FileInputStream(pluginRoot+ "resources/cfiles/WorkingCopyTestStart.h"); - headerFile.create(fileIn,false, monitor); - } catch (CoreException e) { - e.printStackTrace(); - } - } - if (!fCProject.getProject().hasNature(CCProjectNature.CC_NATURE_ID)) { - addNatureToProject(fCProject.getProject(), CCProjectNature.CC_NATURE_ID, null); - } - - // register with the model manager to listen to delta changes - CModelManager.getDefault().addElementChangedListener(this); - addedElements = new Vector(10); - removedElements = new Vector(10); - changedElements = new Vector(20); - } - - private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = proj.getDescription(); - String[] prevNatures= description.getNatureIds(); - String[] newNatures= new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length]= natureId; - description.setNatureIds(newNatures); - proj.setDescription(description, monitor); - } - - protected void tearDown() { - try{ - CProjectHelper.delete(fCProject); - } - catch (ResourceException e) {} - catch (CoreException e) {} - } - - - public void testElementDeltas() throws Exception { - ITranslationUnit tu = new TranslationUnit(fCProject, headerFile); - assertNotNull (tu); - IWorkingCopy wc = tu.getWorkingCopy(); - assertNotNull (wc); - assertNotNull (wc.getBuffer()); - assertTrue (wc.exists()); - - // add the class Hello - IBuffer wcBuf = wc.getBuffer(); - wcBuf.setContents ("\n class Hello{ \n};"); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertAddedElement(ICElement.C_CLASS, "Hello"); - assertRemovedElement(ICElement.C_INCLUDE, "stdio.h"); - assertEmptyDelta(); - - // add the field x - wcBuf.setContents ("\n class Hello{\n int x; \n};"); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertChangedElement(ICElement.C_CLASS, "Hello"); - assertAddedElement(ICElement.C_FIELD, "x"); - assertEmptyDelta(); - - // add the method setValue - wcBuf.setContents ("\n class Hello{\n int x; \n void setValue(int val); \n};"); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertChangedElement(ICElement.C_CLASS, "Hello"); - assertAddedElement(ICElement.C_METHOD_DECLARATION, "setValue"); - assertEmptyDelta(); - - // rename x to y - // this is not a change, this is add and remove - wcBuf.setContents ("\n class Hello{\n int y; \n void setValue(int val); \n};"); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertChangedElement(ICElement.C_CLASS, "Hello"); - assertAddedElement(ICElement.C_FIELD, "y"); - assertRemovedElement(ICElement.C_FIELD, "x"); - assertEmptyDelta(); - - // remove the method - wcBuf.setContents ("\n class Hello{\n String y; \n};"); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertChangedElement(ICElement.C_CLASS, "Hello"); - assertChangedElement(ICElement.C_FIELD, "y"); - assertRemovedElement(ICElement.C_METHOD_DECLARATION, "setValue"); - assertEmptyDelta(); - - // remove the field - wcBuf.setContents ("\n class Hello{ \n};"); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertChangedElement(ICElement.C_CLASS, "Hello"); - assertRemovedElement(ICElement.C_FIELD, "y"); - assertEmptyDelta(); - - // remove the class - wcBuf.setContents (""); - wc.reconcile(); - wc.commit(true, monitor); - assertChangedElement(ICElement.C_MODEL, ""); - assertChangedElement(ICElement.C_PROJECT, "TestProject1"); - assertChangedElement(ICElement.C_UNIT, "WorkingCopyTest.h"); - assertRemovedElement(ICElement.C_CLASS, "Hello"); - assertEmptyDelta(); - - wc.destroy(); - assertFalse(wc.exists()); - } - - public void assertAddedElement(int elementType, String elementName){ - if(!isElementInList(elementType, elementName, addedElements)) - fail("Element NOT found in Added list"); - } - public void assertRemovedElement(int elementType, String elementName){ - if(!isElementInList(elementType, elementName, removedElements)) - fail("Element NOT found in Removed list"); - } - public void assertChangedElement(int elementType, String elementName){ - if(!isElementInList(elementType, elementName, changedElements)) - fail("Element NOT found in Changed list"); - } - public void assertEmptyDelta() { - assertTrue(addedElements.isEmpty()); - assertTrue(removedElements.isEmpty()); - assertTrue(changedElements.isEmpty()); - } - public boolean isElementInList(int elementType, String elementName, Vector elementList) { - boolean found = false; - Iterator i = elementList.iterator(); - while( i.hasNext()){ - ICElement element = (ICElement)i.next(); - - if ((element.getElementName().equals(elementName)) && - (element.getElementType() == elementType)){ - // return true; - // just to print the whole list - found = true; - // Remove the element - elementList.remove(element); - break; - } - } - //return false; - return found; - } - - public void elementChanged(ElementChangedEvent event){ - try { - addedElements.clear(); - removedElements.clear(); - changedElements.clear(); - - processDelta(event.getDelta()); - } catch(CModelException e) { - } - } - - protected void processDelta(ICElementDelta delta) throws CModelException { - // check the delta elements - int kind= delta.getKind(); - int flags= delta.getFlags(); - ICElement element= delta.getElement(); - - // handle open and closing of a solution or project - if ((flags & ICElementDelta.F_CLOSED) != 0) { - } - if ((flags & ICElementDelta.F_OPENED) != 0) { - } - if (kind == ICElementDelta.REMOVED) { - removedElements.add(element); - } - if (kind == ICElementDelta.ADDED) { - addedElements.add(element); - } - if (kind == ICElementDelta.CHANGED) { - changedElements.add(element); - - if (flags == ICElementDelta.F_MODIFIERS) { - } - if (flags == ICElementDelta.F_CONTENT) { - } - if (flags == ICElementDelta.F_CHILDREN) { - } - } - - ICElementDelta[] affectedChildren= delta.getAffectedChildren(); - for (int i= 0; i < affectedChildren.length; i++) { - processDelta(affectedChildren[i]); - } - } - -} diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java deleted file mode 100644 index 9da06490c36..00000000000 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java +++ /dev/null @@ -1,212 +0,0 @@ -package org.eclipse.cdt.core.model.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.Flags; -import org.eclipse.cdt.internal.core.model.IConstants; - -/** - * @author Peter Graves - * - * This is a very simple set of sanity tests for the flags class to make sure - * there are no very silly problems in the class. It also verifies that there - * is no overlap in the IConstants. - */ -public class FlagTests extends TestCase { - - int flags[]; - /** - * Constructor for FlagTests. - * @param name - */ - public FlagTests(String name) { - super(name); - } - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected void setUp() { - flags=new int[15]; - flags[0]=IConstants.AccPublic; - flags[1]=IConstants.AccPrivate; - flags[2]=IConstants.AccProtected; - flags[3]=IConstants.AccStatic; - flags[4]=IConstants.AccExtern; - flags[5]=IConstants.AccInline; - flags[6]=IConstants.AccVolatile; - flags[7]=IConstants.AccRegister; - flags[8]=IConstants.AccExplicit; - flags[9]=IConstants.AccExport; - flags[10]=IConstants.AccAbstract; - flags[11]=IConstants.AccMutable; - flags[12]=IConstants.AccAuto; - flags[13]=IConstants.AccVirtual; - flags[14]=IConstants.AccTypename; - - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() { - // release resources here and clean-up - } - - public static TestSuite suite() { - return new TestSuite(FlagTests.class); - } - - public static void main (String[] args){ - junit.textui.TestRunner.run(suite()); - } - - public void testIsStatic() - { - int x; - assertTrue("isStatic with a static", Flags.isStatic(IConstants.AccStatic)); - for (x=0;x::first", - "IsGreaterThan", "Foo::fum" - }; - assertEquals(myExpectedValues.length, arrayElements.size()); - for(int i=0; i::S_start_free" - }; - assertEquals(myExpectedValues.length, arrayElements.size()); - for(int i=0; i", - "nonVector", - "ArrayOverlay", - "fum(int) : void", - "scrum(void) : void", // TODO: deduce the rules of () versus (void), compare below. - "nonVector::first() : const T&", // TODO: where should be? - // TODO: shouldn't signature indicate const function as well? - "IsGreaterThan(X, X) : bool", - "Foo::fum(int) : void", - /*"default_alloc_template::S_start_free : char*",*/ - }; - assertEquals(myExpectedValues.length, arrayElements.size()); - for(int i=0; iPreferences>Java>Code Generation>Code and Comments - */ -public abstract class AutomatedFramework extends TestCase { - - public AutomatedFramework() { - super(); - } - - public AutomatedFramework(String name) { - super(name); - } - - protected abstract AutomatedFramework newTest( String name ); - protected abstract void loadProperties() throws Exception; - public abstract void doFile() throws Throwable; - - private void fillSuite( TestSuite suite, File path ){ - File files[] = null; - if( path.isFile() ){ - files = new File[ 1 ]; - files[0] = path; - } - else - files = path.listFiles(); - - File file = null; - String filePath = null; - int i = 0; - try{ - file = files[ i++ ]; - while( file != null ) - { - if( file.isDirectory() ) - fillSuite( suite, file ); - else if( file.isFile() && nameFilter.accept( file.getParentFile(), file.getName() ) ){ - try{ - filePath = file.getCanonicalPath(); - } catch ( Exception e ){ - continue; - } - - if( filePath.endsWith(".cpp") || filePath.endsWith(".hpp") || - filePath.endsWith(".cc") || filePath.endsWith(".CC") || - filePath.endsWith(".C") || - filePath.endsWith(".hxx") || filePath.endsWith(".hh") ) - { - AutomatedTest.natures.put( filePath, "cpp" ); - } else if( filePath.endsWith(".c") ){ - AutomatedTest.natures.put( filePath, "c" ); - } else { - AutomatedTest.natures.put( filePath, AutomatedTest.defaultNature ); - } - - AutomatedTest.fileList.add( file ); - suite.addTest( newTest( file.getName().replace(',', '_') ) ); - } - file = files[ i++ ]; - } - } catch( ArrayIndexOutOfBoundsException e ){ - //done - } - } - - public void reportFailed() { - fail( "Unable to open " + outputFile + "for output of results." ); - } - - public void propertiesFailed() { - fail( "Unable to load properties file." ); - } - - protected void runTest() throws Throwable { - String name = getName(); - - if( name.equals("propertiesFailed") ) - propertiesFailed(); - else if ( name.equals("reportFailed") ) - reportFailed(); - else - doFile(); - } - - public Test createSuite() { - TestSuite suite = new TestSuite(); - - try{ - loadProperties(); - } catch( Exception e ){ - suite.addTest( newTest( "propertiesFailed") ); - } - - if( outputFile != null && !outputFile.equals("") ){ - try{ - - File output = new File( outputFile ); - - if( output.exists() ){ - output.delete(); - } - - output.createNewFile(); - - report = new FileOutputStream( output ); - - } catch( Exception e ) { - suite.addTest( newTest( "reportFailed" ) ); - } - } - - Set keys = testSources.keySet(); - Iterator iter = keys.iterator(); - int size = keys.size(); - String item = null; - for( int i = size; i > 0; i-- ) - { - item = (String) iter.next(); - File file = new File( item ); - if( file.exists() ){ - defaultNature = (String) testSources.get( item ); - fillSuite( suite, file ); - } - } - - return suite; - } - - protected static ISourceElementRequestor nullCallback = new NullSourceElementRequestor(); - protected static Properties properties = new Properties(); - protected static String defaultNature; - protected static String outputFile = null; - protected static HashMap testSources = new HashMap(); - protected static HashMap natures = new HashMap(); - protected static LinkedList fileList = new LinkedList(); - private static FilenameFilter nameFilter = new Filter(); - protected static FileOutputStream report = null; - - static private class Filter implements FilenameFilter - { - public boolean accept(File dir, String name) { - if( name.endsWith(".cpp") || - name.endsWith(".c") || - name.endsWith(".cc") || - name.endsWith(".CC") || - name.endsWith(".C") || - name.endsWith(".h") || - name.endsWith(".hh") || - name.endsWith(".hpp") || - name.endsWith(".hxx")) - { - return true; - } - else - return false; - } - } - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java deleted file mode 100644 index a1aeed0c6af..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ - -package org.eclipse.cdt.core.parser.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStreamReader; -import java.util.NoSuchElementException; -import java.util.StringTokenizer; - -import junit.framework.AssertionFailedError; -import junit.framework.Test; - -import org.eclipse.cdt.core.parser.ILineOffsetReconciler; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.core.runtime.Path; - - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class AutomatedTest extends AutomatedFramework { - - public AutomatedTest() { - } - public AutomatedTest(String name){ - super(name); - } - - public void doFile() throws Throwable { - assertNotNull( fileList ); - - File file = null; - IParser parser = null; - ILineOffsetReconciler mapping = null; - - try{ - file = (File)fileList.removeFirst(); - FileInputStream stream = new FileInputStream( file ); - - String filePath = file.getCanonicalPath(); - ParserLanguage language = ((String)natures.get( filePath )).equalsIgnoreCase("cpp") ? ParserLanguage.CPP : ParserLanguage.C; - parser = ParserFactory.createParser( ParserFactory.createScanner( new InputStreamReader (stream), filePath, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback, null ), nullCallback, ParserMode.QUICK_PARSE, language, null); - - mapping = ParserFactory.createLineOffsetReconciler( new InputStreamReader( stream ) ); - - assertTrue( parser.parse() ); - } - catch( Throwable e ) - { - String output = null; - if( e instanceof AssertionFailedError ){ - output = file.getCanonicalPath() + ": Parse failed on line "; - output += mapping.getLineNumberForOffset(parser.getLastErrorOffset()) + "\n"; - } else { - output = file.getCanonicalPath() + ": " + e.getClass().toString(); - output += " on line " + mapping.getLineNumberForOffset(parser.getLastErrorOffset()) + "\n"; - } - if( report != null ){ - report.write( output.getBytes() ); - } - - fail( output ); - } - } - - protected AutomatedFramework newTest( String name ){ - return new AutomatedTest( name ); - } - - public static Test suite() - { - AutomatedFramework frame = new AutomatedTest(); - - return frame.createSuite(); - } - - protected void tearDown () throws Exception { - if( fileList != null && fileList.size() == 0 && report != null ){ - report.flush(); - report.close(); - } - } - - protected void loadProperties() throws Exception{ - String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - resourcePath += "resources/parser/AutomatedTest"; - - try{ - FileInputStream propertiesIn = new FileInputStream( resourcePath + "/AutomatedTest.properties"); - properties.load( propertiesIn ); - - outputFile = properties.getProperty( "outputFile", "" ); - String sourceInfo = properties.getProperty( "source", "" ); - if( sourceInfo.equals("") ) - throw new FileNotFoundException(); - else{ - StringTokenizer tokenizer = new StringTokenizer( sourceInfo, "," ); - String str = null, val = null; - try{ - while( tokenizer.hasMoreTokens() ){ - str = tokenizer.nextToken().trim(); - val = tokenizer.nextToken().trim(); - - testSources.put( str, val ); - } - } catch ( NoSuchElementException e ){ - //only way to get here is to have a missing val, assume cpp for that str - testSources.put( str, "cpp" ); - } - - } - } catch ( FileNotFoundException e ){ - testSources.put( resourcePath + "/defaultCpp", "cpp" ); - testSources.put( resourcePath + "/defaultC", "c" ); - } - } - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java deleted file mode 100644 index 4c0950e242c..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java +++ /dev/null @@ -1,174 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; -import java.util.Iterator; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IQuickParseCallback; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ParserException; - -/** - * @author jcamelon - * - */ -public class BaseASTTest extends TestCase -{ - public BaseASTTest( String a ) - { - super( a ); - } - - protected IQuickParseCallback quickParseCallback; - protected IParser parser; - - protected IASTCompilationUnit parse( String code, boolean quick, boolean throwExceptionOnError, ParserLanguage lang ) throws ParserException, ParserFactoryException - { - ParserMode mode = quick ? ParserMode.QUICK_PARSE : ParserMode.COMPLETE_PARSE; - quickParseCallback = ParserFactory.createQuickParseCallback(); - parser = ParserFactory.createParser( ParserFactory.createScanner( new StringReader( code ), "code", new ScannerInfo(), mode, lang, quickParseCallback, null), quickParseCallback, mode, lang, null ); - if( ! parser.parse() && throwExceptionOnError ) - throw new ParserException("Parse failure"); - return quickParseCallback.getCompilationUnit(); - } - - - protected IASTCompilationUnit parse( String code, boolean quick, boolean throwExceptionOnError ) throws ParserException, ParserFactoryException - { - return parse( code, quick, throwExceptionOnError, ParserLanguage.CPP ); - } - - protected IASTCompilationUnit parse( String code )throws ParserException, ParserFactoryException - { - return parse( code, true, true ); - } - - protected IASTCompilationUnit fullParse( String code ) throws ParserException, ParserFactoryException - { - return parse( code, false, true ); - } - - protected IASTDeclaration assertSoleDeclaration( String code ) throws ParserException, ParserFactoryException - { - return assertSoleDeclaration( code, ParserLanguage.CPP ); - } - - protected IASTDeclaration assertSoleDeclaration( String code, ParserLanguage language ) throws ParserException, ParserFactoryException - { - Iterator declarationIter = null; - try - { - declarationIter = parse(code, true, true, language).getDeclarations(); - } - catch (ASTNotImplementedException e1) - { - // TODO Auto-generated catch block - } - - assertNotNull( declarationIter ); - assertTrue( declarationIter.hasNext() ); - IASTDeclaration returnValue = (IASTDeclaration)declarationIter.next(); - assertFalse( declarationIter.hasNext() ); - return returnValue; - } - - public void assertCodeFailsParse( String code ) - { - assertCodeFailsParse( code, true, true, ParserLanguage.CPP ); - } - - public void assertCodeFailsParse(String code, boolean quick, boolean throwOnError, ParserLanguage CPP ) { - boolean testPassed = false; - try { - parse(code, quick, throwOnError, CPP ); - testPassed = true; - fail( "We should not reach this point"); - } catch (Throwable e) { - if (!(e instanceof ParserException)) - fail("Unexpected Error: " + e.getMessage()); - } - if (testPassed) - fail("The expected error did not occur."); - } - - public void assertCodeFailsFullParse(String code) { - boolean testPassed = false; - try { - fullParse(code); - testPassed = true; - fail( "We should not reach this point"); - } catch (Throwable e) { - if (!(e instanceof ParserException)) - fail("Unexpected Error: " + e.getMessage()); - } - if (testPassed) - fail("The expected error did not occur."); - } - - protected void assertSimpleReturnType(IASTFunction function, IASTSimpleTypeSpecifier.Type type) - { - assertEquals( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).getType(), type ); - } - - protected void assertSimpleType(IASTTypedefDeclaration variable, IASTSimpleTypeSpecifier.Type type) - { - assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclarator().getTypeSpecifier()).getType(), type ); - } - - - protected void assertSimpleType(IASTVariable variable, IASTSimpleTypeSpecifier.Type type) - { - assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).getType(), type ); - } - - protected void assertParameterSimpleType(IASTParameterDeclaration variable, IASTSimpleTypeSpecifier.Type type) - { - assertEquals( ((IASTSimpleTypeSpecifier)variable.getTypeSpecifier()).getType(), type ); - } - - protected void failedAsExpected() - { - assertFalse( "The expected error did not occur.", false ); - } - - protected void assertNotReached() - { - fail( "We should not reach this point"); - } - - protected void assertQualifiedName(String [] fromAST, String [] theTruth) - { - assertNotNull( fromAST ); - assertNotNull( theTruth ); - assertEquals( fromAST.length, theTruth.length ); - for( int i = 0; i < fromAST.length; ++i ) - { - assertEquals( fromAST[i], theTruth[i]); - } - } - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java deleted file mode 100644 index 39f7ccacc93..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java +++ /dev/null @@ -1,237 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ - -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerException; -import org.eclipse.cdt.core.parser.ScannerInfo; - -/** - * @author jcamelon - * - */ -public class BaseScannerTest extends TestCase { - - protected IScanner scanner; - - public BaseScannerTest( String x ) - { - super(x); - } - - protected void initializeScanner( String input, ParserMode mode ) throws ParserFactoryException - { - initializeScanner( input, mode, new NullSourceElementRequestor( mode )); - } - - protected void initializeScanner( String input, ParserMode mode, ISourceElementRequestor requestor ) throws ParserFactoryException - { - scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo(), mode, ParserLanguage.CPP, requestor, null ); - } - - protected void initializeScanner(String input) throws ParserFactoryException - { - initializeScanner( input, ParserMode.COMPLETE_PARSE ); - } - - - - public int fullyTokenize() throws Exception - { - try - { - IToken t= scanner.nextToken(); - while (t != null) - { - if (verbose) - System.out.println("Token t = " + t); - - if ((t.getType()> IToken.tLAST)) - System.out.println("Unknown type for token " + t); - t= scanner.nextToken(); - } - } - catch ( EndOfFileException e) - { - } - catch (ScannerException se) - { - throw se; - } - return scanner.getCount(); - } - public void validateIdentifier(String expectedImage) throws ScannerException - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == IToken.tIDENTIFIER); - assertTrue(t.getImage().equals(expectedImage)); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateInteger(String expectedImage) throws ScannerException - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == IToken.tINTEGER); - assertTrue(t.getImage().equals(expectedImage)); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateFloatingPointLiteral(String expectedImage) throws ScannerException - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == IToken.tFLOATINGPT); - assertTrue(t.getImage().equals(expectedImage)); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateChar( char expected )throws ScannerException - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == IToken.tCHAR ); - Character c = new Character( expected ); - assertEquals( t.getImage(), c.toString() ); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateChar( String expected ) throws ScannerException - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == IToken.tCHAR ); - assertEquals( t.getImage(), expected ); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateString( String expectedImage ) throws ScannerException - { - validateString( expectedImage, false ); - } - - public void validateString(String expectedImage, boolean lString ) throws ScannerException - { - try { - IToken t= scanner.nextToken(); - if( lString ) - assertTrue(t.getType() == IToken.tLSTRING); - else - assertTrue(t.getType() == IToken.tSTRING); - assertTrue(t.getImage().equals(expectedImage)); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateToken(int tokenType) throws ScannerException - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == tokenType); - } catch (OffsetLimitReachedException e) { - assertTrue(false); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - public void validateBalance(int expected) - { - assertTrue(scanner.getDepth() == expected); - } - - public void validateBalance() - { - assertTrue(scanner.getDepth() == 0); - } - - public void validateEOF() throws ScannerException - { - try { - assertNull(scanner.nextToken()); - }catch (OffsetLimitReachedException e) { - assertTrue(false); - } catch (EndOfFileException e) { - } - } - - public void validateDefinition(String name, String value) - { - String definition= null; - definition= (String) scanner.getDefinition(name); - assertNotNull(definition); - assertTrue(definition.trim().equals(value)); - } - - public void validateDefinition(String name, int value) - { - String definition= null; - definition= (String) scanner.getDefinition(name); - assertNotNull(definition); - int intValue= (Integer.valueOf((String) definition)).intValue(); - assertEquals(value, intValue); - } - - public void validateAsUndefined(String name) - { - assertNull(scanner.getDefinition(name)); - } - - public static final String EXCEPTION_THROWN = "Exception thrown "; - - public static final String EXPECTED_FAILURE = "This statement should not be reached " - + "as we sent in bad preprocessor input to the scanner"; - - public static final boolean verbose = false; - - - /** - * @param string - */ - protected void validateWideChar(String string) throws Exception - { - try { - IToken t= scanner.nextToken(); - assertTrue(t.getType() == IToken.tLCHAR ); - assertEquals( t.getImage(), string ); - } catch (EndOfFileException e) { - assertTrue(false); - } - } - - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java deleted file mode 100644 index e319868cb1d..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BranchTrackerTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package org.eclipse.cdt.core.parser.tests; - -import java.util.EmptyStackException; - -import junit.framework.TestCase; - -import org.eclipse.cdt.internal.core.parser.BranchTracker; - -/** - * @author jcamelon - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class BranchTrackerTest extends TestCase { - - public BranchTrackerTest( String ignoreMe ) - { - super( ignoreMe ); - } - - public static void assertFalse( boolean input ) - { - assertTrue( input == false ); - } - - public void testIgnore() - { - - BranchTracker bt = new BranchTracker(); - try - { - /* - * #if 0 - * # if 1 - * # elif 1 - * # else - * # endif - * #else - * #endif - */ - - assertFalse( bt.poundif( false ) ); - assertFalse( bt.poundif( true ) ); - assertFalse( bt.poundelif( true ) ); - assertFalse( bt.poundelse() ); - assertFalse( bt.poundendif() ); - assertTrue( bt.poundelse() ); - assertTrue( bt.poundendif() ); - - /* - * #if 0 - * # if 1 - * # elif 1 - * # else - * # endif - * #else - * # if 0 - * # elif 1 - * # elif 0 - * # elif 1 - * # else - * # endif - * #endif - */ - - bt = new BranchTracker(); - assertFalse( bt.poundif( false ) ); - assertFalse( bt.poundif( true )); - assertFalse( bt.poundelif( true ) ); - assertFalse( bt.poundelse() ); - assertFalse( bt.poundendif() ); - assertTrue( bt.poundelse() ); - assertFalse( bt.poundif( false ) ); - assertTrue( bt.poundelif( true ) ); - assertFalse( bt.poundelif( false ) ); - assertFalse( bt.poundelif( true ) ); - assertFalse( bt.poundelse() ); - assertTrue( bt.poundendif() ); - assertTrue( bt.poundendif() ); - assertEquals( 0, bt.getDepth() ); - - /* - * #if 0 - * # if 1 - * # elif 0 - * # elif 1 - * # else - * # endif - * #elif 0 - * # if 0 - * # elif 0 - * # elif 1 - * # else - * # endif - * #elif 1 - * # if 0 - * # elif 0 - * # elif 0 - * # else - * # endif - * #else - * # if 1 - * # elif 0 - * # elif 1 - * # else - * # endif - * #endif - */ - - assertFalse(bt.poundif(false)); - assertFalse(bt.poundif(true)); - assertFalse(bt.poundelif(false)); - assertFalse(bt.poundelif(true)); - assertFalse(bt.poundelse()); - assertFalse( bt.poundendif() ); - assertFalse(bt.poundelif(false)); - assertFalse(bt.poundif(false)); - assertFalse(bt.poundelif(false)); - assertFalse(bt.poundelif(true)); - assertFalse(bt.poundelse()); - assertFalse( bt.poundendif()); - assertTrue(bt.poundelif(true)); - assertFalse(bt.poundif(false)); - assertFalse(bt.poundelif(false)); - assertFalse(bt.poundelif(false)); - assertTrue(bt.poundelse()); - assertTrue( bt.poundendif() ); - assertFalse(bt.poundelse()); - assertFalse(bt.poundif(true)); - assertFalse(bt.poundelif(false)); - assertFalse(bt.poundelif(true)); - assertFalse(bt.poundelse()); - assertFalse( bt.poundendif() ); - assertTrue( bt.poundendif() ); - assertEquals(0, bt.getDepth()); - } catch (EmptyStackException se) { - fail("Unexpected Scanner exception thrown"); - } - } - - public void testSimpleBranches() - { - try - { - /* - * code sequence is - * #if 1 - * #else - * #endif - */ - BranchTracker bt = new BranchTracker(); - assertTrue( bt.poundif( true ) ); - assertFalse( bt.poundelse() ); - assertTrue( bt.poundendif() ); - - /* - * code sequence is - * #if 1 - * # if 0 - * # elif 0 - * # else - * # endif - * #else - * #endif - */ - bt = new BranchTracker(); - assertTrue( bt.poundif( true )); - assertFalse( bt.poundif( false )); - assertFalse( bt.poundelif( false )); - assertTrue( bt.poundelse()); - assertTrue( bt.poundendif() ); - assertFalse( bt.poundelse() ); - assertTrue( bt.poundendif() ); - - /* - * #if 1 - * #elsif 1 - * #elsif 0 - * #else - * #endif - */ - - bt = new BranchTracker(); - assertTrue( bt.poundif( true ) ); - assertFalse( bt.poundelif( true )); - assertFalse( bt.poundelif( false )); - assertFalse( bt.poundelse()); - assertTrue( bt.poundendif() ); - - - } - catch( EmptyStackException se ) - { - fail( "Exception" ); - } - } - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java deleted file mode 100644 index cecab37a0d5..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTExpressionTest.java +++ /dev/null @@ -1,841 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTVariable; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CompleteParseASTExpressionTest extends CompleteParseBaseTest{ - - public CompleteParseASTExpressionTest(String a) - { - super(a); - } - // Kind PRIMARY_EMPTY : void - public void testPrimaryEmpty() throws Exception - { - Iterator i = parse ("int f(char); \n int f(void); \n int x = f();").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences(1, createTaskList( new Task( f2 ) )); - } - // Kind PRIMARY_INTEGER_LITERAL : int - public void testPrimaryIntegerLiteral() throws Exception - { - Iterator i = parse ("int f(int, int); \n int f(int); \n int x = f(1, 2+3);").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f1 ))); - } - // Kind PRIMARY_CHAR_LITERAL : char - public void testPrimaryCharLiteral() throws Exception - { - Iterator i = parse ("int f(char, int); \n int f(char); \n int x = f('c');").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f2 ))); - } - // Kind PRIMARY_FLOAT_LITERAL : float - public void testPrimaryFloatLiteral() throws Exception - { - Iterator i = parse ("int f(char); \n int f(float); \n int x = f(1.13);").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f2 ))); - } - // Kind PRIMARY_STRING_LITERAL : char* - public void testPrimaryStringLiteral() throws Exception - { - Iterator i = parse ("int f(char); \n int f(char*); \n int x = f(\"str\");").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f2 ))); - } - // Kind PRIMARY_BOOLEAN_LITERAL : bool - public void testPrimaryBooleanLiteral() throws Exception - { - Iterator i = parse ("int f(bool); \n int f(float); \n int x = f(true);").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f1 ))); - } - // Kind PRIMARY_THIS : type of inner most enclosing structure scope - public void testPrimaryThis() throws Exception - { - Iterator i = parse ("class A{ int m(); }; A a; \n int f(void); \n int f(A * a); \n int A::m(){ int x = f(this); }").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator members = getDeclarations(cl); - IASTMethod method = (IASTMethod)members.next(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTMethod m = (IASTMethod) i.next(); - Iterator r = callback.getReferences().iterator(); - assertAllReferences( 4, createTaskList( new Task( cl, 3 ), new Task( f2 ))); - } - // Kind PRIMARY_BRACKETED_EXPRESSION : LHS - public void testPrimaryBracketedExpression() throws Exception - { - Iterator i = parse ("int f(int, int); \n int f(int); \n int x = f(1, (2+3));").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f1 ))); - } - // Kind ID_EXPRESSION : type of the ID - public void testIdExpression() throws Exception - { - Iterator i = parse ("class A{}a; \n int f(A a); \n int f(void); \n int x = f(a);").getDeclarations(); - - IASTVariable a = (IASTVariable) i.next(); - IASTClassSpecifier cl = (IASTClassSpecifier)a.getAbstractDeclaration().getTypeSpecifier(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - - assertAllReferences( 3, createTaskList( new Task( cl ), new Task( f1 ),new Task( a ) ) ); - } - // Kind ID_EXPRESSION ( refers to a pointer ) : pointer to type of ID - public void testIdExpressionToPointer() throws Exception - { - Iterator i = parse ("class A {}; \n A * pa; \n int f(A *ia){} \n int f(void); \n int x = f(pa);").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task( cl, 2 ), new Task( f1 ), new Task( a ) ) ); - - } - // Kind POSTFIX_SUBSCRIPT - public void testPostfixSubscript() throws Exception - { - Iterator i = parse ("int pa[10]; \n int f(int ia){} \n int f(void); \n int x = f(pa[1]);").getDeclarations(); - IASTVariable pa = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 2, createTaskList( new Task( f1 ), new Task( pa ) ) ); - } - - public void testPostfixSubscriptA() throws Exception - { - Iterator i = parse ("int pa[10][5] ; \n int f(int ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations(); - IASTVariable pa = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 2, createTaskList( new Task( f1 ), new Task( pa ) ) ); - } - - public void testPostfixSubscriptB() throws Exception - { - Iterator i = parse ("int* pa[10][5] ; \n int f(int* ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations(); - IASTVariable pa = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 2, createTaskList( new Task( f1 ), new Task( pa ) ) ); - } - - public void testPostfixSubscriptWithReferences() throws Exception - { - Iterator i = parse ("class A{}; \n A *pa[10][5] ; \n int f(A* ia){} \n int f(void); \n int x = f(pa[1][2]);").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable pa = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task( cl, 2 ), new Task( pa ), new Task( f1 ))); - } - - // Kind POSTFIX_FUNCTIONCALL : return type of called function - public void testPostfixFunctioncallBug42822() throws Exception - { - Iterator i = parse( "int foo( float b ); int bar( int a, int b ); int test( void ) { int x = bar( foo( 3.0 ), foo( 5.0 ) ) ; }").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction bar = (IASTFunction)i.next(); - i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( bar ), new Task( foo, 2 ))); - } - // Kind POSTFIX_SIMPLETYPE_* : simple type - public void testPostfixSimpletypesBug42823() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "void foo( int anInt, short aShort, double aDouble, float aFloat, char aChar, wchar_t aWchar, signed aSigned, unsigned anUnsigned, bool aBool, long aLong );"); - buffer.append( "void test( void ) { int someInt = foo( int(3), short(4), double(3.0), float(4.0), char( 'a'), wchar_t( 'a' ), signed( 2 ), unsigned( 3 ), bool( false ), long( 3L ) ); }"); - Iterator i = parse( buffer.toString() ).getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction test = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 1, createTaskList( new Task( foo ))); - } - - // Kind POSTFIX_TYPENAME_IDENTIFIER - public void testPostfixTypenameIdentifier() throws Exception{ - Iterator i = parse( "class A {}; \n int foo(); int foo( A a ); \n int x = foo( typename A() );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 3, createTaskList( new Task( cl, 2 ), new Task( f2) ) ); - } - - // Kind POSTFIX_TYPENAME_TEMPLATEID - - // Kind POSTFIX_DOT_IDEXPRESSION : type of member in the scope of the container - public void testPostfixDotExpression() throws Exception{ - Iterator i = parse( "class A {int m;}; \n A a; \n int foo(char); int foo( int ); \n int x = foo( a.m );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - Iterator members = getDeclarations(cl); - IASTField m = (IASTField)members.next(); - assertAllReferences( 4, createTaskList( new Task(cl), new Task(a), new Task(m), new Task(f2) )); - } - // Kind POSTFIX_ARROW_IDEXPRESSION : type of member in the scope of the container - public void testPostfixArrowExpression() throws Exception{ - Iterator i = parse( "class A {int m;}; \n A * a; \n int foo(char); int foo( int ); \n int x = foo( a->m );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - Iterator members = getDeclarations(cl); - IASTField m = (IASTField)members.next(); - assertAllReferences( 4, createTaskList( new Task(cl), new Task(a), new Task(m), new Task(f2) )); - } - // Kind POSTFIX_DOT_TEMPL_IDEXPRESS - // Kind POSTFIX_ARROW_TEMPL_IDEXP - - // Kind POSTFIX_DOT_DESTRUCTOR - // Kind POSTFIX_ARROW_DESTRUCTOR - - // Kind POSTFIX_INCREMENT : LHS - public void testPostfixIncrement() throws Exception - { - Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( x++ ); } ").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTFunction test = (IASTFunction)i.next(); - Iterator subDecls = getDeclarations( test ); - IASTVariable x = (IASTVariable)subDecls.next(); - IASTVariable y = (IASTVariable)subDecls.next(); - assertFalse( subDecls.hasNext() ); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task( x ), new Task( foo2))); - } - // Kind POSTFIX_DECREMENT : LHS - public void testPostfixDecrement() throws Exception - { - Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( x-- ); } ").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTFunction test = (IASTFunction)i.next(); - Iterator subDecls = getDeclarations( test ); - IASTVariable x = (IASTVariable)subDecls.next(); - IASTVariable y = (IASTVariable)subDecls.next(); - assertFalse( subDecls.hasNext() ); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task( x ), new Task( foo2))); - } - // Kind POSTFIX_DYNAMIC_CAST - public void testPostfixDynamicCast() throws Exception{ - Iterator i = parse( "class A {}; class B : public A{}; \n A *a; \n int foo(); int foo( B* ); \n int x = foo( dynamic_cast(a) );").getDeclarations(); - IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 6, createTaskList( new Task( cla, 2 ), new Task( clb, 2), new Task(a), new Task(f2))); - } - // Kind POSTFIX_REINTERPRET_CAST - public void testPostfixReinterpretCast() throws Exception{ - Iterator i = parse( "int *a; \n int foo(); int foo( double* ); \n int x = foo( reinterpret_cast(a) );").getDeclarations(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(a), new Task(f2))); - } - // Kind POSTFIX_STATIC_CAST - public void testPostfixStaticCast() throws Exception{ - Iterator i = parse( "int a; \n int foo(); int foo( char ); \n int x = foo( static_cast(a) );").getDeclarations(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(a), new Task(f2))); - } - // Kind POSTFIX_CONST_CAST - public void testPostfixConstCast() throws Exception{ - Iterator i = parse( "const int a; \n int foo(); int foo( int * ); \n int x = foo( const_cast(&a) );").getDeclarations(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(a), new Task(f2))); - } - // Kind POSTFIX_TYPEID_EXPRESSION : LHS - public void testPostfixTypeIdExpression() throws Exception{ - Iterator i = parse( "int foo(char); int foo( int ); \n int x = foo( typeid(5) );").getDeclarations(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 1, createTaskList( new Task( f2 ))); - } - // Kind POSTFIX_TYPEID_EXPRESSION : type of the ID - public void testPostfixTypeIdExpression2() throws Exception{ - Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(a) );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task(cl, 2),new Task(a),new Task(f1))); - } - // Kind POSTFIX_TYPEID_TYPEID : type of the ID - public void testPostfixTypeIdTypeId() throws Exception{ - Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(A) );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task(cl, 3), new Task(f1))); - } - // Kind POSTFIX_TYPEID_TYPEID : type of the ID - public void testPostfixTypeIdTypeId2() throws Exception{ - Iterator i = parse( "class A {}; \n A a; \n int foo(A); int foo( int ); \n int x = foo( typeid(const A) );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task(cl, 3), new Task(f1))); - } - // Kind UNARY_INCREMENT : LHS - public void testUnaryIncrement() throws Exception - { - Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( ++x ); } ").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTFunction test = (IASTFunction)i.next(); - Iterator subDecls = getDeclarations( test ); - IASTVariable x = (IASTVariable)subDecls.next(); - IASTVariable y = (IASTVariable)subDecls.next(); - assertFalse( subDecls.hasNext() ); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(foo2), new Task(x) )); - } - // Kind UNARY_DECREMENT : LHS - public void testUnaryDecrement() throws Exception - { - Iterator i = parse( "void foo(); int foo( int ); void test( void ) { int x = 5; int y = foo( --x ); } ").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTFunction test = (IASTFunction)i.next(); - Iterator subDecls = getDeclarations( test ); - IASTVariable x = (IASTVariable)subDecls.next(); - IASTVariable y = (IASTVariable)subDecls.next(); - assertFalse( subDecls.hasNext() ); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(foo2), new Task(x) )); - } - // Kind UNARY_STAR_CASTEXPRESSION : LHS + t_pointer - public void testUnaryStarCastExpression() throws Exception - { - Iterator i = parse ("class A {}; \n A * pa; \n int f(A ia){} \n int f(void); \n int x = f(*pa);").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task(cl, 2 ), new Task( a ), new Task(f1) )); - } - // Kind UNARY_AMPSND_CASTEXPRESSION : LHS + t_reference - public void testUnaryAmpersandCastExpression() throws Exception - { - Iterator i = parse ("class A {}; \n A * pa; \n int f(A ** ia){} \n int f(void); \n int x = f(&pa);").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable a = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertAllReferences( 4, createTaskList( new Task(cl, 2 ), new Task( a ), new Task(f1) )); - } - // Kind UNARY_PLUS_CASTEXPRESSION : LHS - public void testUnaryPlusCastExpression() throws Exception { - Iterator i = parse( "void foo(); int foo( int ); int x = foo( +5 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 1, createTaskList( new Task( foo2 ))); - } - // Kind UNARY_MINUS_CASTEXPRESSION : LHS - public void testUnaryMinusCastExpression() throws Exception { - Iterator i = parse( "void foo(); int foo( int ); int x = foo( -5 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 1, createTaskList( new Task( foo2 ))); - } - // Kind UNARY_NOT_CASTEXPRESSION : LHS - public void testUnaryNotCastExpression() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); bool b=true; int x = foo( !b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task( b ), new Task( foo2 ))); - } - // Kind UNARY_TILDE_CASTEXPRESSION : LHS - public void testTildeNotCastExpression() throws Exception { - Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( ~x );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable x = (IASTVariable)i.next(); - IASTVariable y = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task( x ), new Task( foo2 ))); - } - // Kind UNARY_SIZEOF_UNARYEXPRESSION : unsigned int - public void testUnarySizeofUnaryExpression() throws Exception { - Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( sizeof(5) );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable x = (IASTVariable)i.next(); - IASTVariable y = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 1, createTaskList( new Task( foo2 ))); - } - // Kind UNARY_SIZEOF_TYPEID : unsigned int - public void testUnarySizeofTypeId() throws Exception { - Iterator i = parse( "void foo(); int foo( int ); int x = 5; int y = foo( sizeof(x) );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable x = (IASTVariable)i.next(); - IASTVariable y = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task( x ), new Task( foo2 ))); - } - // Kind NEW_NEWTYPEID - // Kind NEW_TYPEID - public void testNewTypeId() throws Exception { - Iterator i = parse( "class A{}; void foo(); int foo( A * a ); int x = foo( new A() );").getDeclarations(); - IASTClassSpecifier cl = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( cl, 2), new Task( foo2 ))); - } - - // Kind DELETE_CASTEXPRESSION - // Kind DELETE_VECTORCASTEXPRESSION - - // Kind CASTEXPRESSION - public void testCastExpression() throws Exception{ - Iterator i = parse( "class A {}; class B : public A{}; \n B *b; \n int foo(); int foo( A* ); \n int x = foo( (A*)b );").getDeclarations(); - IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable b = (IASTVariable) i.next(); - IASTFunction f1 = (IASTFunction) i.next(); - IASTFunction f2 = (IASTFunction) i.next(); - IASTVariable x = (IASTVariable) i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 6, createTaskList( new Task( cla, 3 ), new Task( clb, 1), new Task(b), new Task(f2))); - } - - // Kind PM_DOTSTAR - // failed - - // Kind PM_ARROWSTAR - // failed - - // Kind MULTIPLICATIVE_MULTIPLY : usual arithmetic conversions - public void testMultiplicativeMultiply() throws Exception { - Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( a * b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 3 ); - assertAllReferences( 3, createTaskList( new Task(a), new Task(b), new Task( foo2 ) ) ); - } - // Kind MULTIPLICATIVE_DIVIDE : usual arithmetic conversions - public void testMultiplicativeDivide() throws Exception { - Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b / a );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task(a), new Task(b), new Task( foo2 ) ) ); - } - // Kind MULTIPLICATIVE_MODULUS : usual arithmetic conversions - public void testMultiplicativeModulus() throws Exception { - Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b % a );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task(a), new Task(b), new Task( foo2 ) ) ); - } - // Kind ADDITIVE_PLUS : usual arithmetic conversions - public void testAdditivePlus() throws Exception { - Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b + a );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task(a), new Task(b), new Task( foo2 ) ) ); - } - // Kind ADDITIVE_MINUS : usual arithmetic conversions - public void testAdditiveMinus() throws Exception { - Iterator i = parse( "int foo(int); int foo( float ); int a = 3; float b=5.1 ; int x = foo( b - a );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task(a), new Task(b), new Task( foo2 ) ) ); - } - // Kind SHIFT_LEFT : LHS - public void testShiftLeft() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a << 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(a), new Task( foo1 ) ) ); - } - // Kind SHIFT_RIGHT : LHS - public void testShiftRight() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a >> 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(a), new Task( foo1 ) ) ); - } - // Kind RELATIONAL_LESSTHAN : bool - public void testRelationalLessThan() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b < 3 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(b), new Task( foo2 ) ) ); - } - // Kind RELATIONAL_GREATERTHAN : bool - public void testRelationalGreaterThan() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b > 3 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(b), new Task( foo2 ) ) ); - } - // Kind RELATIONAL_LESSTHANEQUALTO : bool - public void testRelationalLessThanOrEqual() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b <= 3 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(b), new Task( foo2 ) ) ); - } - // Kind RELATIONAL_GREATERTHANEQUALTO : bool - public void testRelationalGreaterThanOrEqual() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b >= 3 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(b), new Task( foo2 ) ) ); - } - // Kind EQUALITY_EQUALS : bool - public void testEqualityEquals() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b == 3 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(b), new Task( foo2 ) ) ); - } - // Kind EQUALITY_NOTEQUALS : bool - public void testEqualityNotEquals() throws Exception { - Iterator i = parse( "void foo(); int foo( bool ); int b=5; int x = foo( b != 3 );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 2, createTaskList( new Task(b), new Task( foo2 ) ) ); - } - // Kind ANDEXPRESSION : usual arithmetic conversions - public void testAndExpression() throws Exception { - Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a & b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( a ), new Task(b), new Task( foo2 ) ) ); - } - // Kind EXCLUSIVEOREXPRESSION : usual arithmetic conversions - public void testExclusiveOrExpression() throws Exception { - Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a ^ b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( a ), new Task(b), new Task( foo2 ) ) ); - } - // Kind INCLUSIVEOREXPRESSION : : usual arithmetic conversions - public void testInclusiveOrExpression() throws Exception { - Iterator i = parse( "int foo(); int foo( int ); int a = 3; int b= 5; int x = foo( a | b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( a ), new Task(b), new Task( foo2 ) ) ); - } - // Kind LOGICALANDEXPRESSION : bool - public void testLogicalAndExpression() throws Exception { - Iterator i = parse( "int foo(); int foo( bool ); bool a = true; bool b= false; int x = foo( a && b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( a ), new Task(b), new Task( foo2 ) ) ); - } - // Kind LOGICALOREXPRESSION : bool - public void testLogicalOrExpression() throws Exception { - Iterator i = parse( "int foo(); int foo( bool ); bool a = true; bool b= false; int x = foo( a || b );").getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 3, createTaskList( new Task( a ), new Task(b), new Task( foo2 ) ) ); - } - // Kind CONDITIONALEXPRESSION : conditional Expression Conversions - public void testConditionalExpression() throws Exception { - Iterator i = parse( "int foo(bool); int foo(int); int a = 10, b = 4, c = 2; int x = foo( a > 5 ? b : c );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable c = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 4, createTaskList( new Task( a ), new Task(b), new Task( c ), new Task( foo2 ) ) ); - } - // Kind CONDITIONALEXPRESSION with references : conditional Expression Conversions - public void testConditionalExpressionWithReferencesA() throws Exception { - Iterator i = parse( "class A{}; class B : public A{}; int foo(); int foo(A*); A *a ; B *b; int c = 0; int x = foo( c > 5 ? b : a );").getDeclarations(); - IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable c = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(8, createTaskList( new Task( cla, 3 ), new Task( clb ), new Task( c ), new Task( b ), new Task( a ), new Task( foo2 )) ); - } - public void testConditionalExpressionWithReferencesB_Bug43106() throws Exception { - Iterator i = parse( "class A{}; class B : public A{}; int foo(); int foo(A&); A a ; B b; int c = 0; int x = foo( c > 5 ? b : a );").getDeclarations(); - IASTClassSpecifier cla = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTClassSpecifier clb = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable b = (IASTVariable)i.next(); - IASTVariable c = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 8, - createTaskList( new Task( cla, 3 ), new Task( clb ), new Task( c), new Task( b ), new Task( a ), new Task( foo2) )); - } - // Kind THROWEXPRESSION - - // Kind ASSIGNMENTEXPRESSION_NORMAL : LHS - public void testAssignmentExpressionNormal() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a = 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_PLUS : LHS - public void testAssignmentExpressionPlus() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a += 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_MINUS : LHS - public void testAssignmentExpressionMinus() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a -= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_MULT : LHS - public void testAssignmentExpressionMulti() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a *= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_DIV : LHS - public void testAssignmentExpressionDiv() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a /= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_MOD : LHS - public void testAssignmentExpressionMod() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a %= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_LSHIFT : LHS - public void testAssignmentExpressionLShift() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a >>= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_RSHIFT : LHS - public void testAssignmentExpressionRShift() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a <<= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_AND : LHS - public void testAssignmentExpressionAnd() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a &= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_OR : LHS - public void testAssignmentExpressionOr() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a |= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind ASSIGNMENTEXPRESSION_XOR : LHS - public void testAssignmentExpressionXOr() throws Exception { - Iterator i = parse( "int foo(int); int foo( bool ); int a = 10; int x = foo( a ^= 5 );").getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)i.next(); - IASTVariable x = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences(2, createTaskList( new Task(a), new Task(foo1) )); - } - // Kind EXPRESSIONLIST : list of LHS, RHS - // Already tested with each test trying to find a reference to function. - - - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java deleted file mode 100644 index d2c571990c1..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ /dev/null @@ -1,1207 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringWriter; -import java.io.Writer; -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupResult; -import org.eclipse.cdt.internal.core.parser.ParserException; - - -/** - * @author jcamelon - * - */ -public class CompleteParseASTTest extends CompleteParseBaseTest -{ - /** - * @param a - */ - public CompleteParseASTTest(String a) - { - super(a); - } - - public void testEmptyCompilationUnit() throws Exception - { - IASTScope compilationUnit = parse( "// no real code "); - assertNotNull( compilationUnit ); - assertFalse( compilationUnit.getDeclarations().hasNext() ); - } - - public void testSimpleNamespace() throws Exception - { - Iterator declarations = parse( "namespace A { }").getDeclarations(); - IASTNamespaceDefinition namespaceDefinition = (IASTNamespaceDefinition)declarations.next(); - assertEquals( namespaceDefinition.getName(), "A" ); - assertFalse( getDeclarations( namespaceDefinition ).hasNext() ); - } - - public void testMultipleNamespaceDefinitions() throws Exception - { - Iterator declarations = parse( "namespace A { } namespace A { }").getDeclarations(); - IASTNamespaceDefinition namespaceDefinition = (IASTNamespaceDefinition)declarations.next(); - assertEquals( namespaceDefinition.getName(), "A" ); - namespaceDefinition = (IASTNamespaceDefinition)declarations.next(); - assertEquals( namespaceDefinition.getName(), "A" ); - assertFalse( getDeclarations( namespaceDefinition ).hasNext() ); - } - - public void testNestedNamespaceDefinitions() throws Exception - { - Iterator declarations = parse( "namespace A { namespace B { } }").getDeclarations(); - IASTNamespaceDefinition namespaceDefinition = (IASTNamespaceDefinition)declarations.next(); - assertEquals( namespaceDefinition.getName(), "A" ); - assertFalse( declarations.hasNext() ); - Iterator subDeclarations = getDeclarations( namespaceDefinition ); - IASTNamespaceDefinition subDeclaration = (IASTNamespaceDefinition)subDeclarations.next(); - assertEquals( subDeclaration.getName(), "B" ); - assertFalse( subDeclarations.hasNext() ); - } - - public void testEmptyClassDeclaration() throws Exception - { - Iterator declarations = parse( "class A { };").getDeclarations(); - IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)declarations.next(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)abs.getTypeSpecifier(); - assertEquals( classSpec.getName(), "A"); - assertFalse( getDeclarations( classSpec ).hasNext() ); - assertFalse( declarations.hasNext() ); - } - - public void testSimpleSubclass() throws Exception - { - Iterator declarations = parse( "class A { }; class B : public A { };").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - Iterator parentClasses = classB.getBaseClauses(); - IASTBaseSpecifier baseClass = (IASTBaseSpecifier)parentClasses.next(); - assertEquals( classA, baseClass.getParentClassSpecifier() ); - assertEquals( baseClass.getParentClassName(), "A"); - assertEquals( baseClass.getAccess(), ASTAccessVisibility.PUBLIC); - assertFalse( baseClass.isVirtual() ); - } - - public void testNestedSubclass() throws Exception - { - Iterator declarations = parse( "namespace N { class A { }; } class B : protected virtual N::A { };").getDeclarations(); - IASTNamespaceDefinition namespaceDefinition = (IASTNamespaceDefinition)declarations.next(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)getDeclarations( namespaceDefinition).next() ).getTypeSpecifier(); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - Iterator baseClauses = classB.getBaseClauses(); - IASTBaseSpecifier baseClass = (IASTBaseSpecifier)baseClauses.next(); - assertEquals( classA, baseClass.getParentClassSpecifier() ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testSimpleVariable() throws Exception - { - Iterator declarations = parse( "int x;").getDeclarations(); - IASTVariable v = (IASTVariable)declarations.next(); - assertEquals( v.getName(), "x"); - assertEquals( ((IASTSimpleTypeSpecifier)v.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - } - - public void testSimpleClassReferenceVariable() throws Exception - { - Iterator declarations = parse( "class A { }; A x;").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTVariable v = (IASTVariable)declarations.next(); - assertEquals( v.getName(), "x"); - assertEquals( ((IASTSimpleTypeSpecifier)v.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier(), classA ); - } - - public void testNestedClassReferenceVariable() throws Exception - { - Iterator declarations = parse( "namespace N { class A { }; } N::A x;").getDeclarations(); - IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)declarations.next(); - Iterator iter = getDeclarations( namespace ); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)iter.next()).getTypeSpecifier(); - IASTVariable v = (IASTVariable)declarations.next(); - assertEquals( v.getName(), "x"); - assertEquals( ((IASTSimpleTypeSpecifier)v.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier(), classA ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testMultipleDeclaratorsVariable() throws Exception - { - Iterator declarations = parse( "class A { }; A x, y, z;").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTVariable v = (IASTVariable)declarations.next(); - assertEquals( v.getName(), "x"); - assertEquals( ((IASTSimpleTypeSpecifier)v.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier(), classA ); - assertEquals( callback.getReferences().size(), 3 ); - Iterator i = callback.getReferences().iterator(); - while( i.hasNext() ) - assertEquals( ((IASTReference)i.next()).getReferencedElement(), classA ); - } - - public void testSimpleField() throws Exception - { - Iterator declarations = parse( "class A { double x; };").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - Iterator fields =getDeclarations(classA); - IASTField f = (IASTField)fields.next(); - assertEquals( f.getName(), "x" ); - assertEquals( ((IASTSimpleTypeSpecifier)f.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.DOUBLE ); - } - - public void testUsingClauses() throws Exception - { - Iterator declarations = parse( "namespace A { namespace B { int x; class C { static int y = 5; }; } } \n using namespace A::B;\n using A::B::x;using A::B::C;using A::B::C::y;").getDeclarations(); - IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)declarations.next(); - IASTNamespaceDefinition namespaceB = (IASTNamespaceDefinition)getDeclarations( namespaceA ).next(); - Iterator i = getDeclarations( namespaceB ); - IASTVariable variableX = (IASTVariable)i.next(); - IASTClassSpecifier classC = ((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier()); - IASTField fieldY = (IASTField)getDeclarations( classC ).next(); - assertQualifiedName( fieldY.getFullyQualifiedName(), new String [] { "A", "B", "C", "y" } ); - IASTUsingDirective directive = (IASTUsingDirective)declarations.next(); - assertEquals( directive.getNamespaceDefinition(), namespaceB ); - IASTUsingDeclaration declaration = (IASTUsingDeclaration)declarations.next(); - assertEquals( declaration.getUsingType(), variableX ); - declaration = (IASTUsingDeclaration)declarations.next(); - assertEquals( declaration.getUsingType(), classC ); - declaration = (IASTUsingDeclaration)declarations.next(); - assertEquals( declaration.getUsingType(), fieldY ); - assertEquals( callback.getReferences().size(), 12 ); - - } - - public void testEnumerations() throws Exception - { - Iterator declarations = parse( "namespace A { enum E { e1, e2, e3 }; E varE;}").getDeclarations(); - IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)declarations.next(); - Iterator namespaceMembers = getDeclarations( namespaceA ); - IASTEnumerationSpecifier enumE = (IASTEnumerationSpecifier)((IASTAbstractTypeSpecifierDeclaration)namespaceMembers.next()).getTypeSpecifier(); - assertEquals( enumE.getName(), "E"); - assertQualifiedName( enumE.getFullyQualifiedName(), new String [] { "A", "E" } ); - Iterator enumerators = enumE.getEnumerators(); - IASTEnumerator enumerator_e1 = (IASTEnumerator)enumerators.next(); - IASTEnumerator enumerator_e2 = (IASTEnumerator)enumerators.next(); - IASTEnumerator enumerator_e3 = (IASTEnumerator)enumerators.next(); - assertFalse( enumerators.hasNext() ); - assertEquals( enumerator_e1.getName(), "e1"); - assertEquals( enumerator_e2.getName(), "e2"); - assertEquals( enumerator_e3.getName(), "e3"); - IASTVariable varE = (IASTVariable)namespaceMembers.next(); - assertEquals( ((IASTSimpleTypeSpecifier)varE.getAbstractDeclaration().getTypeSpecifier()).getTypeSpecifier(), enumE ); - } - - public void testSimpleFunction() throws Exception - { - Iterator declarations = parse( "void foo( void );").getDeclarations(); - IASTFunction function = (IASTFunction)declarations.next(); - assertEquals( function.getName(), "foo" ); - assertEquals( callback.getReferences().size(), 0 ); - } - - public void testSimpleFunctionWithTypes() throws Exception - { - Iterator declarations = parse( "class A { public: \n class B { }; }; const A::B & foo( A * myParam );").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTFunction function = (IASTFunction)declarations.next(); - assertEquals( callback.getReferences().size(), 3 ); - } - - public void testSimpleMethod() throws Exception - { - Iterator declarations = parse( "class A { void foo(); };").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTMethod method = (IASTMethod)getDeclarations( classA ).next(); - assertEquals( method.getName(), "foo" ); - } - - public void testSimpleMethodWithTypes() throws Exception - { - Iterator declarations = parse( "class U { }; class A { U foo( U areDumb ); };").getDeclarations(); - IASTClassSpecifier classU = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTMethod method = (IASTMethod)getDeclarations( classA ).next(); - assertEquals( method.getName(), "foo" ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testUsingDeclarationWithFunctionsAndMethods() throws Exception - { - Iterator declarations = parse( "namespace N { int foo(void); } class A { static int bar(void); }; using N::foo; using ::A::bar;" ).getDeclarations(); - IASTNamespaceDefinition namespaceN = (IASTNamespaceDefinition)declarations.next(); - IASTFunction fooFunction = (IASTFunction)(getDeclarations(namespaceN).next()); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTMethod methodM = (IASTMethod)(getDeclarations(classA).next()); - IASTUsingDeclaration using1 = (IASTUsingDeclaration)declarations.next(); - IASTUsingDeclaration using2 = (IASTUsingDeclaration)declarations.next(); - assertEquals( callback.getReferences().size(), 4 ); - Iterator references = callback.getReferences().iterator(); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), namespaceN ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), fooFunction ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), classA ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), methodM ); - } - - public void testLinkageSpec() throws Exception - { - IASTLinkageSpecification linkage = (IASTLinkageSpecification)parse( "extern \"C\" { int foo(); }").getDeclarations().next(); - Iterator i = getDeclarations( linkage ); - IASTFunction f = (IASTFunction)i.next(); - assertEquals( f.getName(),"foo"); - } - - - public void testBogdansExample() throws Exception - { - IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)parse( "namespace A { namespace B { enum e1{e_1,e_2}; int x; class C { static int y = 5; }; }} ").getDeclarations().next(); - IASTNamespaceDefinition namespaceB = (IASTNamespaceDefinition)(getDeclarations(namespaceA).next()); - Iterator subB = getDeclarations( namespaceB ); - IASTEnumerationSpecifier enumE1 = (IASTEnumerationSpecifier)((IASTAbstractTypeSpecifierDeclaration)subB.next()).getTypeSpecifier(); - Iterator enumerators = enumE1.getEnumerators(); - IASTEnumerator enumeratorE_1 = (IASTEnumerator)enumerators.next(); - assertEquals( enumeratorE_1.getOwnerEnumerationSpecifier(), enumE1 ); - IASTVariable variableX = (IASTVariable)subB.next(); - IASTClassSpecifier classC = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)subB.next()).getTypeSpecifier(); - } - - public void testAndrewsExample() throws Exception - { - Iterator declarations = parse( "namespace N{ class A {}; } using namespace N; class B: public A{};").getDeclarations(); - IASTNamespaceDefinition namespaceN = (IASTNamespaceDefinition)declarations.next(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)getDeclarations( namespaceN ).next()).getTypeSpecifier(); - IASTUsingDirective usingClause = (IASTUsingDirective)declarations.next(); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTBaseSpecifier baseSpec = (IASTBaseSpecifier)classB.getBaseClauses().next(); - assertEquals( baseSpec.getParentClassSpecifier(), classA ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testSimpleTypedef() throws Exception - { - Iterator iter = parse( "typedef int myInt;\n myInt var;").getDeclarations(); - IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)iter.next(); - assertEquals( typedef.getName(), "myInt"); - assertEquals( ((IASTSimpleTypeSpecifier)typedef.getAbstractDeclarator().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - IASTVariable v = (IASTVariable)iter.next(); - assertEquals( v.getName(), "var"); - assertEquals( callback.getReferences().size(), 1 ); - } - - public void testComplexTypedef() throws Exception - { - Iterator declarations = parse( "class A{ }; typedef A ** A_DOUBLEPTR;").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)declarations.next(); - assertEquals( ((IASTSimpleTypeSpecifier)typedef.getAbstractDeclarator().getTypeSpecifier()).getTypeSpecifier(), classA ); - assertEquals( callback.getReferences().size(), 1 ); - } - - - protected void assertQualifiedName(String [] fromAST, String [] theTruth) - { - assertNotNull( fromAST ); - assertNotNull( theTruth ); - assertEquals( fromAST.length, theTruth.length ); - for( int i = 0; i < fromAST.length; ++i ) - { - assertEquals( fromAST[i], theTruth[i]); - } - } - - public void testBug40842() throws Exception{ - Writer code = new StringWriter(); - - code.write("class A {} a;\n"); - Iterator i = parse(code.toString()).getDeclarations(); - IASTVariable instanceA = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 0 ); - } - - public void testNestedClassname() throws Exception - { - Iterator declarations = parse( "namespace A { } \n class A::B { };").getDeclarations(); - IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)declarations.next(); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - assertEquals( classB.getOwnerScope(), namespaceA ); - assertEquals( callback.getReferences().size(), 1 ); - } - - public void testForwardDeclaration() throws Exception - { - Iterator i = parse( "class forward;").getDeclarations(); - assertTrue( i.hasNext() ); - IASTAbstractTypeSpecifierDeclaration d = (IASTAbstractTypeSpecifierDeclaration)i.next(); - IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)d.getTypeSpecifier(); - assertEquals( elab.getName(), "forward"); - assertEquals( elab.getClassKind(), ASTClassKind.CLASS ); - } - - public void testElaboratedType() throws Exception - { - Iterator i = parse( "class A; class A * a;").getDeclarations(); - IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - assertEquals( elab.getName(), "A" ); - IASTVariable variableA = (IASTVariable)i.next(); - assertEquals( variableA.getName(), "a"); - assertEquals( variableA.getAbstractDeclaration().getTypeSpecifier(), elab ); - } - - public void testForewardDeclarationWithUsage() throws Exception - { - Iterator declarations = parse( "class A; A * anA;class A { };").getDeclarations(); - IASTAbstractTypeSpecifierDeclaration forewardDecl = (IASTAbstractTypeSpecifierDeclaration)declarations.next(); - IASTVariable variable = (IASTVariable)declarations.next(); - IASTAbstractTypeSpecifierDeclaration classDecl = (IASTAbstractTypeSpecifierDeclaration)declarations.next(); - IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)forewardDecl.getTypeSpecifier(); - IASTClassSpecifier clasSpec = (IASTClassSpecifier)classDecl.getTypeSpecifier(); - assertEquals( elab.getName(), clasSpec.getName() ); - String [] fqnClass = clasSpec.getFullyQualifiedName(); - String [] fqnElab = elab.getFullyQualifiedName(); - assertEquals( fqnClass.length, fqnElab.length ); - for( int i = 0; i < fqnClass.length; ++i ) - assertEquals( fqnClass[i], fqnElab[i]); - assertEquals( callback.getReferences().size(), 1 ); - assertEquals( callback.getForewardDecls().size(), 1 ); - IASTClassReference ref = (IASTClassReference)callback.getReferences().get(0); - assertTrue( ref.getReferencedElement() instanceof IASTElaboratedTypeSpecifier ); - assertEquals( ref.getReferencedElement(), elab ); - } - - - public void testASM() throws Exception - { - IASTASMDefinition asm = (IASTASMDefinition)parse( "asm ( \"blah blah blah\" );" ).getDeclarations().next(); - assertEquals( asm.getBody(), "blah blah blah"); - } - - public void testOverride() throws Exception - { - Iterator i = parse( "void foo();\n void foo( int );\n").getDeclarations(); - IASTFunction f1 = (IASTFunction)i.next(); - IASTFunction f2 = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - } - - public void testSimpleExpression() throws Exception - { - Iterator i = parse( "int x; int y = x;").getDeclarations(); - IASTVariable varX = (IASTVariable)i.next(); - IASTVariable varY = (IASTVariable)i.next(); - assertEquals( callback.getReferences().size(), 1 ); - } - - public void testParameterExpressions() throws Exception - { - Iterator i = parse( "int x = 5; void foo( int sub = x ) { }").getDeclarations(); - IASTVariable varX = (IASTVariable)i.next(); - IASTFunction funFoo = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 1 ); - } - - public void testNestedNamespaceExpression() throws Exception - { - Iterator i = parse( "namespace A { int x = 666; } int y = A::x;").getDeclarations(); - IASTNamespaceDefinition namespaceA = (IASTNamespaceDefinition)i.next(); - IASTVariable variableY = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testConstructorChain() throws Exception - { - Iterator i = parse( "int x = 5;\n class A \n{ public : \n int a; \n A() : a( x ) { } };").getDeclarations(); - IASTVariable variableX = (IASTVariable)i.next(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - assertFalse( i.hasNext() ); - Iterator s = getDeclarations( classA ); - IASTField fieldA = (IASTField)s.next(); - IASTMethod methodA = (IASTMethod)s.next(); - assertFalse( s.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - IASTFieldReference reference1 = (IASTFieldReference)callback.getReferences().get(0); - IASTVariableReference reference2 = (IASTVariableReference)callback.getReferences().get(1); - assertEquals( reference1.getReferencedElement(), fieldA ); - assertEquals( reference2.getReferencedElement(), variableX ); - } - - public void testArrayModExpression() throws Exception - { - Iterator i = parse( "const int x = 5; int y [ x ]; ").getDeclarations(); - IASTVariable varX = (IASTVariable)i.next(); - IASTVariable varY = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 1 ); - } - - - public void testPointerVariable() throws Exception - { - Iterator i = parse( "class A { }; A * anA;").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable varAnA = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 1 ); - IASTClassReference ref = (IASTClassReference)callback.getReferences().get(0); - assertEquals( ref.getReferencedElement(), classA ); - } - - public void testExceptionSpecification() throws Exception - { - Iterator i = parse( "class A { }; void foo( void ) throw ( A );").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction function = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 1 ); - IASTClassReference ref = (IASTClassReference)callback.getReferences().get(0); - assertEquals( ref.getReferencedElement(), classA ); - } - - public void testNewExpressions() throws Exception - { - Iterator declarations = parse( "int A; int B; int C; int D; int P; int*p = new (P) (A)[B][C][D];" ).getDeclarations(); - IASTVariable variableA = (IASTVariable)declarations.next(); - IASTVariable variableB = (IASTVariable)declarations.next(); - IASTVariable variableC = (IASTVariable)declarations.next(); - IASTVariable variableD = (IASTVariable)declarations.next(); - IASTVariable variableP = (IASTVariable)declarations.next(); - IASTVariable variablep = (IASTVariable)declarations.next(); - assertEquals( callback.getReferences().size(), 5 ); - Iterator references = callback.getReferences().iterator(); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), variableA ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), variableP ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), variableB ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), variableC ); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), variableD ); - } - - public void testBug41520() throws Exception - { - Iterator i = parse( "const int x = 666; const int y( x );").getDeclarations(); - IASTVariable variableX = (IASTVariable)i.next(); - IASTVariable variableY = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - } - - public void testNewXReferences() throws Exception - { - Iterator declarations = parse( "const int max = 5;\n int * x = new int[max];").getDeclarations(); - IASTVariable max = (IASTVariable) declarations.next(); - IASTVariable x = (IASTVariable) declarations.next(); - assertFalse( declarations.hasNext() ); - assertEquals( callback.getReferences().size(), 1 ); - IASTVariableReference maxRef = (IASTVariableReference) callback.getReferences().get(0); - assertEquals( maxRef.getReferencedElement(), max ); - } - - public void testQualifiedNameReferences() throws Exception - { - try { // This is to prove that there are no exceptions - // Used to cause AST Semantic exception - Iterator i = parse( "class A{ class B{ class C { public: int cMethod(); }; }; }; \n int A::B::C::cMethod() {}; \n" ).getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(classA); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)j.next()).getTypeSpecifier(); - Iterator k = getDeclarations(classB); - IASTClassSpecifier classC = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)k.next()).getTypeSpecifier(); - - // Note : this used to be considered a function, not a method - IASTMethod method = (IASTMethod)i.next(); - - assertEquals( callback.getReferences().size(), 3 ); - Iterator references = callback.getReferences().iterator(); - assertEquals( ((IASTClassReference)references.next()).getReferencedElement(), classA ); - assertEquals( ((IASTClassReference)references.next()).getReferencedElement(), classB ); - assertEquals( ((IASTClassReference)references.next()).getReferencedElement(), classC ); - }catch (Exception e){ - fail(); - } - } - - public void testIsConstructor() throws Exception - { - Iterator i = parse( "class A{ public: A(); }; \n A::A() {}; \n" ).getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTMethod method = (IASTMethod)i.next(); - assertTrue (method.isConstructor()); - } - - public void testIsDestructor() throws Exception - { - Iterator i = parse( "class A{ public: ~A(); }; \n A::~A() {}; \n" ).getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTMethod method = (IASTMethod)i.next(); - assertTrue (method.isDestructor()); - } - - public void testBug41445() throws Exception - { - Iterator i = parse( "class A { }; namespace N { class B : public A { struct A {}; }; }").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTNamespaceDefinition namespaceN = (IASTNamespaceDefinition)i.next(); - Iterator sub = getDeclarations( namespaceN ); - IASTClassSpecifier classB = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)sub.next()).getTypeSpecifier(); - IASTClassSpecifier structA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)( getDeclarations( classB ).next())).getTypeSpecifier(); - } - - public void testSimpleFunctionBody() throws Exception - { - Iterator i = parse( "class A { int f1(); }; const int x = 4; int f() { return x; } int A::f1() { return x; }").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTMethod method_prototype = (IASTMethod)getDeclarations(classA).next(); - IASTVariable x = (IASTVariable) i.next(); - IASTFunction function_f = (IASTFunction) i.next(); - IASTMethod method_f = (IASTMethod)i.next(); - assertEquals( method_f.getName(), method_prototype.getName() ); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 3 ); - IASTVariableReference referenceX = (IASTVariableReference) callback.getReferences().get(0); - assertEquals( referenceX.getReferencedElement(), x ); - IASTClassReference referenceA = (IASTClassReference) callback.getReferences().get(1); - assertEquals( referenceA.getReferencedElement(), classA ); - referenceX = (IASTVariableReference) callback.getReferences().get(2); - assertEquals( referenceX.getReferencedElement(), x ); - } - - - public void testSimpleForLoop() throws Exception - { - Iterator i = parse( "const int FIVE = 5; void f() { int x = 0; for( int i = 0; i < FIVE; ++i ) { x += i; } }").getDeclarations(); - IASTVariable five = (IASTVariable) i.next(); - IASTFunction f = (IASTFunction) i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 5 ); - i = parse( "const int FIVE = 5; void f() { int x = 0; for( int i = 0; i < FIVE; ++i ) x += i; }").getDeclarations(); - five = (IASTVariable) i.next(); - f = (IASTFunction) i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 5 ); - - i = parse( "class A { }; void f() { for( int i = 0; i < (A*)0; ++i ) { A anA; } }").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - f = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 4 ); - } - - public void testBug42541() throws Exception - { - Iterator i = parse( "union{ int v; char a; } id;" ).getDeclarations(); - IASTVariable id = (IASTVariable)i.next(); - - IASTClassSpecifier union = (IASTClassSpecifier) id.getAbstractDeclaration().getTypeSpecifier(); - Iterator sub = getDeclarations( union ); - IASTField intV = (IASTField)sub.next(); - IASTField charA = (IASTField)sub.next(); - } - - - - public void testSimpleIfStatement() throws Exception - { - Iterator i = parse( "const bool T = true; int foo() { if( T ) { return 5; } else if( ! T ) return 20; else { return 10; } }").getDeclarations(); - IASTVariable t = (IASTVariable)i.next(); - IASTFunction foo = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testSimpleWhileStatement() throws Exception - { - Iterator i = parse( "const bool T = true; void foo() { int x = 0; while( T ) { ++x; if( x == 100 ) break; } }").getDeclarations(); - IASTVariable t = (IASTVariable)i.next(); - IASTFunction foo = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 3 ); - } - - public void testSimpleSwitchStatement() throws Exception - { - Iterator i = parse( "const int x = 5; const int y = 10; void foo() { switch( x ) { case 1: break; case 2: goto blah; case y: continue; default: break;} }").getDeclarations(); - IASTVariable x = (IASTVariable)i.next(); - IASTVariable y = (IASTVariable)i.next(); - IASTFunction foo = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testSimpleDoStatement() throws Exception - { - Iterator i = parse( "const int x = 3; int counter = 0; void foo() { do { ++counter; } while( counter != x ); } ").getDeclarations(); - IASTVariable x = (IASTVariable)i.next(); - IASTVariable counter = (IASTVariable)i.next(); - IASTFunction foo = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 3 ); - } - - public void testThrowStatement() throws Exception - { - Iterator i = parse( "class A { }; void foo() throw ( A ) { throw A; throw; } ").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction functionF = (IASTFunction)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - for( int j = 0; j < 2; ++j ) - assertEquals( ((IASTReference)callback.getReferences().get(j) ).getReferencedElement(), classA ); - } - - public void testScoping() throws Exception - { - Iterator i = parse( "void foo() { int x = 3; if( x == 1 ) { int x = 4; } else int x = 2; }").getDeclarations(); - IASTFunction f = (IASTFunction)i.next(); - Iterator subDeclarations = getDeclarations(f); - IASTVariable topX = (IASTVariable)subDeclarations.next(); - assertEquals( topX.getInitializerClause().getAssigmentExpression().getLiteralString(), "3"); - assertEquals( topX.getName(), "x"); - assertFalse( subDeclarations.hasNext() ); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 1 ); - assertEquals( ((IASTReference)callback.getReferences().get(0)).getReferencedElement(), topX ); - - Iterator level1 = getNestedScopes( f ); - IASTCodeScope codeScope = (IASTCodeScope)level1.next(); - Iterator subSubDeclarations = getDeclarations(codeScope); - IASTVariable secondX = (IASTVariable)subSubDeclarations.next(); - assertEquals( secondX.getInitializerClause().getAssigmentExpression().getLiteralString(), "4"); - codeScope = (IASTCodeScope)level1.next(); - assertFalse( level1.hasNext() ); - subSubDeclarations = getDeclarations(codeScope); - IASTVariable thirdX = (IASTVariable)subSubDeclarations.next(); - assertEquals( thirdX.getInitializerClause().getAssigmentExpression().getLiteralString(), "2"); - - } - - public void testEnumeratorReferences() throws Exception - { - Iterator i = parse( "enum E { e1, e2, e3 }; E anE = e1;").getDeclarations(); - IASTEnumerationSpecifier enumE = (IASTEnumerationSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable anE = (IASTVariable)i.next(); - IASTEnumerator e1 = (IASTEnumerator)enumE.getEnumerators().next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - assertEquals( ((IASTReference)callback.getReferences().get(0)).getReferencedElement(), enumE ); - assertEquals( ((IASTReference)callback.getReferences().get(1)).getReferencedElement(), e1 ); - } - - public void testBug42840() throws Exception - { - Iterator i = parse( "void foo(); void foo() { } class SearchMe { };").getDeclarations(); - IASTFunction fooDeclaration = (IASTFunction)i.next(); - IASTFunction fooDefinition = (IASTFunction)i.next(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - assertFalse( i.hasNext() ); - assertTrue( callback.getReferences().isEmpty()); - - i = parse( "class A { void f ( A ); }; void A::f( A ){ return; }" ).getDeclarations(); - classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTMethod fooMethodDefinition = (IASTMethod)i.next(); - assertFalse( i.hasNext() ); - Iterator subIterator = getDeclarations( classSpec ); - IASTMethod fooMethodDeclaration = (IASTMethod)subIterator.next(); - assertFalse( subIterator.hasNext()); - Iterator references = callback.getReferences().iterator(); - assertEquals( callback.getReferences().size(), 3 ); - for( int j = 0; j < 3; ++j) - assertEquals( ((IASTReference)callback.getReferences().get( j )).getReferencedElement(), classSpec ); - - } - - public void testBug42872() throws Exception - { - Iterator i = parse( "struct B {}; struct D : B {}; void foo(D* dp) { B* bp = dynamic_cast(dp); }" ).getDeclarations(); - IASTClassSpecifier structB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTClassSpecifier structD = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction foo = (IASTFunction)i.next(); - IASTVariable bp = (IASTVariable)getDeclarations(foo).next(); - assertFalse( i.hasNext() ); - } - - public void testBug43503A() throws Exception { - Iterator i = parse("class SD_01 { void f_SD_01() {}}; int main(){ SD_01 * a = new SD_01(); a->f_SD_01(); } ").getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(classA); - IASTMethod f = (IASTMethod)j.next(); - assertFalse(j.hasNext()); - IASTFunction main = (IASTFunction) i.next(); - assertFalse(i.hasNext()); - Iterator k = getDeclarations(main); - assertTrue(k.hasNext()); - } - - - public void testBug42979() throws Exception - { - Writer code = new StringWriter(); - code.write( "class OperatorOverload{\n" ); - code.write( "public:\n" ); - code.write( " bool operator==( const class OperatorOverload& that )\n" ); - code.write( " { return true; }\n" ); - code.write( " bool operator!=( const class OperatorOverload& that );\n" ); - code.write( "}; \n" ); - - code.write( "bool OperatorOverload::operator!=( const class OperatorOverload& that )\n" ); - code.write( "{ return false; }\n" ); - - Iterator i = parse( code.toString() ).getDeclarations(); - IASTClassSpecifier classOp = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator subDeclarations = getDeclarations(classOp); - IASTMethod operatorEqualsDeclaration = (IASTMethod)subDeclarations.next(); - IASTMethod operatorNotEqualsDeclaration = (IASTMethod)subDeclarations.next(); - IASTMethod operatorNotEqualDefinition = (IASTMethod)i.next(); - assertEquals( operatorNotEqualDefinition.getName(), operatorNotEqualsDeclaration.getName() ); - assertFalse( i.hasNext()); - assertEquals( callback.getReferences().size(), 4 ); - for( int j =0; j < 4; ++j ) - assertFalse( classOp.getNameOffset() == ((IASTReference)callback.getReferences().get(j)).getOffset() ); - } - /** - * class A { static int x; } int A::x = 5; - */ - public void testBug43373() throws Exception - { - try { // This is to prove that there are no exceptions - // Used to cause AST Semantic exception - Iterator i = parse( "class A { static int x; }; int A::x = 5;" ).getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(classA); - IASTField field1 = (IASTField) j.next(); - // Note : this used to be considered a variable, not a field - IASTField field2 = (IASTField)i.next(); - - assertEquals( callback.getReferences().size(), 1 ); - Iterator references = callback.getReferences().iterator(); - assertEquals( ((IASTReference)references.next()).getReferencedElement(), classA ); - assertTrue (field1.getVisiblity() == field2.getVisiblity()); - }catch (Exception e){ - fail(); - } - } - - public void testBug39504() throws Exception - { - Iterator i = parse( "const int w = 2; int x[ 5 ]; int y = sizeof (x[w]);" ).getDeclarations(); - IASTVariable varW = (IASTVariable)i.next(); - IASTVariable varX = (IASTVariable)i.next(); - IASTVariable vary = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertEquals( callback.getReferences().size(), 2 ); - } - - public void testBug43375() throws Exception - { - IASTVariable varX = (IASTVariable)parse( "extern int x;").getDeclarations().next(); - assertTrue( varX.isExtern() ); - } - - public void testBug43503() throws Exception - { - StringBuffer buff = new StringBuffer(); - - buff.append( "class SD_02 {"); - buff.append( " public:"); - buff.append( " void f_SD_02();"); - buff.append( " };"); - buff.append( "class SD_01 {\n"); - buff.append( " public:\n"); - buff.append( " SD_02 *next;"); // REFERENCE SD_02 - buff.append( " void f_SD_01();\n"); - buff.append( "};\n"); - buff.append( "int main(){\n"); - buff.append( " SD_01 a = new SD_01();\n"); // REFERENCE SD_01 * 2 - buff.append( " a->f_SD_01();\n"); // REFERENCE a && REFERENCE f_SD_01 - buff.append( "}\n"); - buff.append( "void SD_01::f_SD_01()\n"); // REFERENCE SD_01 - buff.append( "{\n"); - buff.append( " next->f_SD_02();\n"); // REFERENCE next && reference f_SD_02 - buff.append( "}\n"); - Iterator i = parse( buff.toString() ).getDeclarations(); - IASTClassSpecifier SD_02 = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTMethod f_SD_02 = (IASTMethod)getDeclarations( SD_02 ).next(); - IASTClassSpecifier SD_01 = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTField next= (IASTField)getDeclarations( SD_01 ).next(); - IASTFunction main = (IASTFunction)i.next(); - IASTVariable a = (IASTVariable)getDeclarations(main).next(); - IASTMethod f_SD_01 = (IASTMethod)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 8, createTaskList( new Task( SD_02), new Task( SD_01, 3 ), new Task( a ), new Task( f_SD_01 ), new Task( f_SD_02 ), new Task( next ) )); - } - - public void testBug43679_A () throws Exception - { - try{ // this used to throw a null pointer exception - Iterator i = parse( "struct Sample { int size() const; }; extern const Sample * getSample(); int trouble() { return getSample()->size(); } ", false ).getDeclarations(); - IASTClassSpecifier A = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(A); - IASTMethod s = (IASTMethod) j.next(); - assertFalse (j.hasNext()); - IASTFunction g = (IASTFunction) i.next(); - IASTFunction t = (IASTFunction) i.next(); - assertFalse (i.hasNext()); - Iterator ref = callback.getReferences().iterator(); - assertAllReferences( 3, createTaskList( new Task(A) , new Task( s ) , new Task (g) )); - - } catch(Exception e){ - fail(); - } - } - public void testBug43679_B () throws Exception - { - try{ // this used to throw a class cast exception - Iterator i = parse( "struct Sample{int size() const; }; struct Sample; ", false ).getDeclarations(); - IASTClassSpecifier A = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(A); - IASTMethod s = (IASTMethod) j.next(); - assertFalse (j.hasNext()); - IASTAbstractTypeSpecifierDeclaration forwardDecl = (IASTAbstractTypeSpecifierDeclaration)i.next(); - assertFalse (i.hasNext()); - Iterator ref = callback.getReferences().iterator(); - assertFalse (ref.hasNext()); - - } catch(Exception e){ - fail(); - } - } - - public void testBug43951() throws Exception - { - Iterator i = parse( "class B{ B(); ~B(); }; B::B(){} B::~B(){}", false ).getDeclarations(); - - IASTClassSpecifier b = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - assertEquals( b.getName(), "B"); - IASTMethod constructor = (IASTMethod) i.next(); - assertEquals( constructor.getName(), "B" ); - assertTrue( constructor.previouslyDeclared() ); - } - - public void testBug44342() throws Exception { - try{ - IASTScope scope = parse("class A { void f(){} void f(int){} }; int main(){ A * a = new A(); a->f();} "); - Iterator i = scope.getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator j = getDeclarations(classA); - IASTMethod f = (IASTMethod)j.next(); - IASTMethod f2 = (IASTMethod)j.next(); - assertFalse(j.hasNext()); - IASTFunction main = (IASTFunction) i.next(); - assertFalse(i.hasNext()); - Iterator k = getDeclarations(main); - assertTrue(k.hasNext()); - IASTVariable a = (IASTVariable)k.next(); - Iterator ref = callback.getReferences().iterator(); - assertAllReferences( 4, createTaskList( new Task(classA , 2) , new Task( a ) , new Task (f) )); - - }catch (ParserException e){ - // parsing fails for now - fail(); - } - } - - - public void testCDesignatedInitializers() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "struct Inner { int a,b,c; };"); - buffer.append( "struct A { int x; int y[]; struct Inner innerArray[]; int z []; };"); - buffer.append( "struct A myA = { .x = 4, .y[3] = 4, .y[4] = 3, .innerArray[0].a = 3, .innerArray[1].b = 5, .innerArray[2].c=6, .z = { 1,4,5} };"); - Iterator i = parse( buffer.toString(), true, ParserLanguage.C ).getDeclarations(); - IASTClassSpecifier Inner = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator members = getDeclarations(Inner); - IASTField a = (IASTField)members.next(); - IASTField b = (IASTField)members.next(); - IASTField c = (IASTField)members.next(); - assertFalse( members.hasNext()); - IASTClassSpecifier A = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - members = getDeclarations( A ); - IASTField x = (IASTField)members.next(); - IASTField y = (IASTField)members.next(); - IASTField innerArray = (IASTField)members.next(); - IASTField z = (IASTField)members.next(); - assertFalse( members.hasNext() ); - IASTVariable myA = (IASTVariable)i.next(); - assertFalse( i.hasNext() ); - assertAllReferences( 12, createTaskList( new Task( A ), - new Task( x ), - new Task( y, 2 ), - new Task( Inner ), - new Task( innerArray, 3), - new Task( a ), - new Task( b ), - new Task( c ), - new Task( z ) ) ); - } - - public void testBug39551A() throws Exception - { - IASTFunction function = (IASTFunction)parse("extern float _Complex conjf (float _Complex);", true, ParserLanguage.C).getDeclarations().next(); - assertEquals( function.getName(), "conjf"); - assertTrue( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).isComplex() ); - } - - public void testBug39551B() throws Exception - { - IASTVariable variable = (IASTVariable)parse("_Imaginary double id = 99.99 * __I__;", true, ParserLanguage.C).getDeclarations().next(); - assertEquals( variable.getName(), "id"); - assertTrue( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).isImaginary() ); - } - - public void testCBool() throws Exception - { - IASTVariable variable = (IASTVariable)parse( "_Bool x;", true, ParserLanguage.C ).getDeclarations().next(); - assertEquals( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type._BOOL ); - } - - public void testBug44510() throws Exception - { - Iterator i = parse( "int initialize(); " + - "int initialize( char ){} " + - "int initialize(){ return 1; } " + - "void main(){ int i = initialize(); }" ).getDeclarations(); - - IASTFunction function1 = (IASTFunction) i.next(); - assertEquals( function1.previouslyDeclared(), false ); - - IASTFunction function2 = (IASTFunction) i.next(); - assertEquals( function2.previouslyDeclared(), false ); - - IASTFunction function3 = (IASTFunction) i.next(); - assertEquals( function3.previouslyDeclared(), true ); - - IASTFunction main = (IASTFunction) i.next(); - assertFalse( i.hasNext() ); - - assertAllReferences( 1, createTaskList( new Task( function3 ) ) ); - } - - public void testBug44925() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "class MyClass { };"); - buffer.append( "class MyClass myObj1;"); - buffer.append( "enum MyEnum { Item1 };"); - buffer.append( "enum MyEnum myObj2;"); - Iterator i = parse( buffer.toString() ).getDeclarations(); - - IASTClassSpecifier MyClass = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable myObj1 = (IASTVariable) i.next(); - IASTEnumerationSpecifier MyEnum = (IASTEnumerationSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTVariable myObj2 = (IASTVariable) i.next(); - - assertFalse( i.hasNext() ); - - assertAllReferences( 2, createTaskList( new Task( MyClass ), new Task( MyEnum ) ) ); - } - - public void testBug44838() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "class A { int myX; A( int x ); };\n"); - buffer.append( "A::A( int x ) : myX( x ) { if( x == 5 ) myX++; }\n"); - Iterator i = parse( buffer.toString() ).getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTField myX = (IASTField)getDeclarations( classA ).next(); - IASTMethod constructor = (IASTMethod)i.next(); - IASTParameterDeclaration parmX = (IASTParameterDeclaration)constructor.getParameters().next(); - assertTrue( constructor.isConstructor()); - assertFalse(i.hasNext()); - } - - public void testBug46165() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "class A { int myX; A( int x ); };\n"); - buffer.append( "A::A( int x ) : myX( x ) { if( x == 5 ) myX++; }\n"); - Iterator i = parse( buffer.toString() ).getDeclarations(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTField myX = (IASTField)getDeclarations( classA ).next(); - IASTMethod constructor = (IASTMethod)i.next(); - IASTParameterDeclaration parmX = (IASTParameterDeclaration)constructor.getParameters().next(); - assertTrue( constructor.isConstructor()); - assertAllReferences( 4, createTaskList( new Task( classA ), new Task( myX, 2 ), new Task( parmX ))); - assertFalse(i.hasNext()); - } - - public void testBug47624() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "struct s { }; \n" ); - buffer.append( "void f ( int s ) { \n" ); - buffer.append( " struct s sInstance; \n" ); - buffer.append( "}\n"); - - Iterator i = parse( buffer.toString() ).getDeclarations(); - IASTClassSpecifier structS = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction function = (IASTFunction) i.next(); - Iterator fnIter = getDeclarations( function ); - IASTVariable sInstance = (IASTVariable) fnIter.next(); - IASTElaboratedTypeSpecifier elaborated = (IASTElaboratedTypeSpecifier) sInstance.getAbstractDeclaration().getTypeSpecifier(); - assertFalse( fnIter.hasNext() ); - - assertAllReferences( 1, createTaskList( new Task( structS ) ) ); - assertFalse( i.hasNext() ); - } - - public void testQualifiedLookup() throws Exception{ - //this is meant to test that on a->f, the lookup for f is qualified - //the namespace is necessary because of bug 47926 - StringBuffer buffer = new StringBuffer(); - buffer.append( "namespace N {" ); - buffer.append( " void f () {} \n" ); - buffer.append( " class A { }; \n" ); - buffer.append( "}" ); - buffer.append( "void main() { N::A * a = new N::A(); a->f(); } "); - - Iterator i = parse( buffer.toString() ).getDeclarations(); - - IASTNamespaceDefinition namespace = (IASTNamespaceDefinition) i.next(); - Iterator nsIter = getDeclarations( namespace ); - - IASTFunction f = (IASTFunction) nsIter.next(); - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)nsIter.next()).getTypeSpecifier(); - - assertFalse( nsIter.hasNext() ); - - IASTFunction main = (IASTFunction) i.next(); - - Iterator fnIter = getDeclarations( main ); - IASTVariable a = (IASTVariable) fnIter.next(); - - assertAllReferences( 5, createTaskList( new Task( namespace, 2 ), new Task( classA, 2 ), new Task( a ) ) ); - } - - public void testBug43110() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append("void x( int y, ... );\n"); - buffer.append("void y( int x... );\n"); - buffer.append("void z(...);"); - Iterator i = parse(buffer.toString() ).getDeclarations(); - while( i.hasNext() ) - assertTrue( ((IASTFunction)i.next()).takesVarArgs() ); - } - - public void testBug43110_XRef() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( "void foo( ... ) {}\n" ); - buffer.append( "void main( ){ foo( 1 ); }\n" ); - - Iterator i = parse( buffer.toString() ).getDeclarations(); - IASTFunction foo = (IASTFunction)i.next(); - assertTrue( foo.takesVarArgs() ); - assertAllReferences( 1, createTaskList( new Task( foo ) ) ); - - buffer = new StringBuffer(); - buffer.append( "void foo( ... ) {}\n" ); - buffer.append( "void foo( int x ) {}\n" ); - buffer.append( "void main( ){ foo( 1 ); }\n" ); - - i = parse( buffer.toString() ).getDeclarations(); - IASTFunction foo1 = (IASTFunction)i.next(); - IASTFunction foo2 = (IASTFunction)i.next(); - assertTrue( foo1.takesVarArgs() ); - assertFalse( foo2.takesVarArgs() ); - assertAllReferences( 1, createTaskList( new Task( foo2 ) ) ); - - buffer = new StringBuffer(); - buffer.append( "void foo( ... ) {}\n" ); - buffer.append( "void foo( int x = 1) {}\n" ); - buffer.append( "void main( ){ foo(); }\n" ); - - i = parse( buffer.toString() ).getDeclarations(); - foo1 = (IASTFunction)i.next(); - foo2 = (IASTFunction)i.next(); - assertTrue( foo1.takesVarArgs() ); - assertFalse( foo2.takesVarArgs() ); - assertAllReferences( 1, createTaskList( new Task( foo2 ) ) ); - - buffer = new StringBuffer(); - buffer.append( "void foo( int x ... ) {}\n" ); - buffer.append( "void main( ){ foo( 1, 2, 'a' ); }\n" ); - - i = parse( buffer.toString() ).getDeclarations(); - foo = (IASTFunction)i.next(); - assertTrue( foo.takesVarArgs() ); - assertAllReferences( 1, createTaskList( new Task( foo ) ) ); - } - - public void testBug48307_FriendFunction_1() throws Exception { - StringWriter writer = new StringWriter(); - writer.write( "class A{ public : void foo(); }; " ); - writer.write( "class B{ "); - writer.write( " private : int aPrivate;" ); - writer.write( " friend void A::foo(); "); - writer.write( "};" ); - writer.write( "void A::foo(){}" ); - - Iterator i = parse( writer.toString() ).getDeclarations(); - - IASTClassSpecifier classA = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTMethod method = (IASTMethod) i.next(); - - LookupResult result = method.lookup( "a", new IASTNode.LookupKind[] { IASTNode.LookupKind.ALL }, classB ); - - assertEquals( result.getResultsSize(), 1 ); - IASTField field = (IASTField) result.getNodes().next(); - assertEquals( field.getName(), "aPrivate" ); - } - - public void testBug48307_FriendFunction_2() throws Exception { - StringWriter writer = new StringWriter(); - writer.write( "void global();" ); - writer.write( "class B{ "); - writer.write( " private : int aPrivate;" ); - writer.write( " friend void global(); "); - writer.write( "};" ); - writer.write( "void global(){}" ); - - Iterator i = parse( writer.toString() ).getDeclarations(); - - IASTFunction functionDecl = (IASTFunction) i.next(); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - IASTFunction functionDef = (IASTFunction) i.next(); - - LookupResult result = functionDef.lookup( "a", new IASTNode.LookupKind[] { IASTNode.LookupKind.ALL }, classB ); - - assertEquals( result.getResultsSize(), 1 ); - IASTField field = (IASTField) result.getNodes().next(); - assertEquals( field.getName(), "aPrivate" ); - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java deleted file mode 100644 index c618405dce0..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java +++ /dev/null @@ -1,899 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.Stack; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; -import org.eclipse.cdt.internal.core.parser.ParserException; - -/** - * @author jcamelon - * - */ -public class CompleteParseBaseTest extends TestCase -{ - /** - * - */ - public CompleteParseBaseTest() - { - super(); - // TODO Auto-generated constructor stub - } - /** - * @param name - */ - public CompleteParseBaseTest(String name) - { - super(name); - // TODO Auto-generated constructor stub - } - public static class Scope implements IASTScope - { - private List decls = new ArrayList(); - private final IASTScope scope; - public Scope( IASTScope scope ) - { - this.scope = scope; - } - - public void addDeclaration( IASTDeclaration d ) - { - decls.add(d); - } - - public Iterator getDeclarations() - { - return decls.iterator(); - } - - /** - * @return - */ - public IASTScope getScope() - { - - return scope; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNode#lookup(java.lang.String, org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind, org.eclipse.cdt.core.parser.ast.IASTNode) - */ - public LookupResult lookup(String prefix, LookupKind[] kind, IASTNode context) throws LookupException { - // TODO Auto-generated method stub - return null; - } - - } - - public static class CodeScope extends Scope implements IASTCodeScope - { - private List nestedScopes = new ArrayList(); - /** - * @param scope - */ - public CodeScope(IASTCodeScope scope) - { - super(scope); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getOwnerCodeScope() - */ - public IASTCodeScope getOwnerCodeScope() - { - return ((IASTCodeScope)getScope()).getOwnerCodeScope(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - public void addNewScope( IASTCodeScope s ) - { - nestedScopes.add( s ); - } - - public Iterator getCodeBlocks() - { - return nestedScopes.iterator(); - } - } - - public static class FullParseCallback implements ISourceElementRequestor - { - private List references = new ArrayList(); - private List forewardDecls = new ArrayList(); - private Stack inclusions = new Stack(); - private Scope compilationUnit; - - public FullParseCallback() - { -// System.out.println( "NEW"); -// System.out.println(); - } - - public void finalize() - { -// System.out.println( ); - } - - public IASTScope getCompilationUnit() - { - return compilationUnit; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable) - */ - public void acceptVariable(IASTVariable variable) - { - getCurrentScope().addDeclaration( variable ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void acceptFunctionDeclaration(IASTFunction function) - { - getCurrentScope().addDeclaration(function); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective) - */ - public void acceptUsingDirective(IASTUsingDirective usageDirective) - { - getCurrentScope().addDeclaration(usageDirective); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration) - */ - public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration) - { - getCurrentScope().addDeclaration(usageDeclaration); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptASMDefinition(org.eclipse.cdt.core.parser.ast.IASTASMDefinition) - */ - public void acceptASMDefinition(IASTASMDefinition asmDefinition) - { - getCurrentScope().addDeclaration(asmDefinition); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefDeclaration(org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration) - */ - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) - { - getCurrentScope().addDeclaration(typedef); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier) - */ - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration) - */ - public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) - { - getCurrentScope().addDeclaration( abstractDeclaration ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void enterFunctionBody(IASTFunction function) - { - pushCodeScope( function ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void exitFunctionBody(IASTFunction function) - { - popScope(); - getCurrentScope().addDeclaration(function); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) - { - pushScope( compilationUnit ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) - { - pushInclusion( inclusion ); - } - - /** - * @param inclusion - */ - private void pushInclusion(IASTInclusion inclusion) - { - inclusions.push( inclusion ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) - { - pushScope( namespaceDefinition ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#entesrClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void enterClassSpecifier(IASTClassSpecifier classSpecification) - { - pushScope( classSpecification ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) - { - pushScope( linkageSpec ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) - { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void enterTemplateSpecialization(IASTTemplateSpecialization specialization) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void acceptMethodDeclaration(IASTMethod method) - { - getCurrentScope().addDeclaration( method ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void enterMethodBody(IASTMethod method) - { - pushCodeScope(method); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void exitMethodBody(IASTMethod method) - { - popScope(); - getCurrentScope().addDeclaration(method); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField) - */ - public void acceptField(IASTField field) - { - getCurrentScope().addDeclaration(field); - - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void exitTemplateDeclaration(IASTTemplateDeclaration declaration) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec) - { - popScope(); - getCurrentScope().addDeclaration(linkageSpec); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void exitClassSpecifier(IASTClassSpecifier classSpecification) - { - popScope(); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) - { - popScope(); - getCurrentScope().addDeclaration(namespaceDefinition); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion(IASTInclusion inclusion) - { - popInclusion(); - } - - /** - * - */ - private void popInclusion() - { - inclusions.pop(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void exitCompilationUnit(IASTCompilationUnit compilationUnit) - { - this.compilationUnit = popScope(); - } - - - - private Stack scopes = new Stack(); - protected Scope getCurrentScope() - { - return (Scope)scopes.peek(); - } - - protected CodeScope getCurrentCodeScope() - { - return (CodeScope)scopes.peek(); - } - - protected Scope popScope() - { - Scope s = (Scope)scopes.pop(); - h.put( s.getScope(), s ); - return s; - } - - protected void pushScope( IASTScope scope ) - { - scopes.push( new Scope( scope )); - } - - Hashtable h = new Hashtable(); - - public Scope lookup( IASTScope s) - { - return (Scope)h.get(s); - } - - public CodeScope lookup( IASTCodeScope s ) - { - return (CodeScope)h.get(s); - } - - - List problems = new ArrayList(); - - public Iterator getProblems() { - return problems.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem) - */ - public boolean acceptProblem(IProblem problem) - { - problems.add( problem ); - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro) - */ - public void acceptMacro(IASTMacro macro) - { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassReference) - */ - public void acceptClassReference(IASTClassReference reference) - { - processReference( reference ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference) - */ - public void acceptTypedefReference(IASTTypedefReference reference) - { - processReference( reference ); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference) - */ - public void acceptNamespaceReference(IASTNamespaceReference reference) - { - processReference( reference ); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumerationReference(IASTEnumerationReference reference) - { - processReference( reference ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference) - */ - public void acceptVariableReference(IASTVariableReference reference) - { - processReference( reference ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference) - */ - public void acceptFunctionReference(IASTFunctionReference reference) - { - processReference(reference); - } - - protected void processReference(IASTReference reference) - { - references.add( reference ); -// System.out.println( "Callback received Reference to " + reference.getName() + " @ offset " + reference.getOffset() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference) - */ - public void acceptFieldReference(IASTFieldReference reference) - { - processReference( reference ); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference) - */ - public void acceptMethodReference(IASTMethodReference reference) - { - processReference( reference ); - - } - - public List getReferences() - { - return references; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier) - */ - public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType) - { - forewardDecls.add( elaboratedType ); - } - /** - * @return - */ - public List getForewardDecls() - { - return forewardDecls; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void enterCodeBlock(IASTCodeScope scope) { - pushCodeScope( scope ); - } - - /** - * @param scope - */ - protected void pushCodeScope(IASTCodeScope scope) - { - scopes.push( new CodeScope( scope ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void exitCodeBlock(IASTCodeScope scope) { - popScope(); - getCurrentCodeScope().addNewScope(scope); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumeratorReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumeratorReference(IASTEnumeratorReference reference) - { - processReference( reference ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference) - */ - public void acceptParameterReference(IASTParameterReference reference) - { - processReference( reference ); - } - - } - - protected Iterator getNestedScopes( IASTCodeScope scope ) - { - CodeScope s = callback.lookup( scope ); - if( s != null ) - return s.getCodeBlocks(); - return null; - - } - protected Iterator getDeclarations(IASTScope scope) - { - Scope s = callback.lookup( scope ); - if( s != null ) - return s.getDeclarations(); - return null; - } - protected FullParseCallback callback; - - protected IASTScope parse( String code ) throws ParserException, ParserFactoryException - { - return parse( code, true, ParserLanguage.CPP ); - } - - protected IASTScope parse( String code, boolean throwOnError ) throws ParserException, ParserFactoryException - { - return parse( code, throwOnError, ParserLanguage.CPP ); - } - - protected IASTScope parse(String code, boolean throwOnError, ParserLanguage language) throws ParserException, ParserFactoryException - { - callback = new FullParseCallback(); - IParser parser = ParserFactory.createParser( - ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(), - ParserMode.COMPLETE_PARSE, language, callback, null ), callback, ParserMode.COMPLETE_PARSE, language, null - ); - if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE"); - return callback.getCompilationUnit(); - } - - protected void assertReferences( - ISourceElementCallbackDelegate element, - int expectedDistinctReferenceCount, - boolean allowDuplicates ) - { - Set matches = new HashSet(); - Iterator allReferences = callback.getReferences().iterator(); - while( allReferences.hasNext() ) - { - IASTReference r = (IASTReference)allReferences.next(); - if( r.getReferencedElement() == element ) - { - if( ! matches.add( r ) && ! allowDuplicates ) - fail( "Duplicate reference found for ISourceElementCallbackDelegate: " + element + " @ offset " + r.getOffset() ); - } - else - { - if( r.getReferencedElement() instanceof IASTQualifiedNameElement && - element instanceof IASTQualifiedNameElement ) - { - if( qualifiedNamesEquals( - ((IASTQualifiedNameElement)r.getReferencedElement()).getFullyQualifiedName(), - ((IASTQualifiedNameElement)element).getFullyQualifiedName() - ) - ) - { - - if( ! matches.add( r ) && ! allowDuplicates ) - fail( "Duplicate reference found for ISourceElementCallbackDelegate: " + element + " @ offset " + r.getOffset() ); - } - - } - } - } - - assertEquals( expectedDistinctReferenceCount, matches.size() ); - } - - protected static class Task - { - private final boolean unique; - private final int count; - private final ISourceElementCallbackDelegate element; - - - public Task( ISourceElementCallbackDelegate element, int referenceCount, boolean distinct ) - { - this.element = element; - this.count = referenceCount; - this.unique = distinct; - } - - public Task( ISourceElementCallbackDelegate element, int referenceCount ) - { - this( element, referenceCount, true ); - } - - public Task( ISourceElementCallbackDelegate element ) - { - this( element, 1, false ); - } - - /** - * @return - */ - public int getCount() - { - return count; - } - - /** - * @return - */ - public ISourceElementCallbackDelegate getElement() - { - return element; - } - - /** - * @return - */ - public boolean isUnique() - { - return unique; - } - - } - - protected void assertReferenceTask( Task task ) - { - assertReferences( task.getElement(), task.getCount(), task.isUnique() ); - } - - protected void assertAllReferences( int count, List tasks ) - { - assertEquals( callback.getReferences().size(), count ); - if( tasks == null ) return; - Iterator i = tasks.iterator(); - while( i.hasNext() ) - { - assertReferenceTask( (Task)i.next() ); - } - } - - protected List createTaskList( Task t1 ) - { - List result = new ArrayList(); - result.add( t1 ); - return result; - } - - protected List createTaskList( Task t1, Task t2 ) - { - List result = createTaskList(t1); - result.add( t2 ); - return result; - } - - protected List createTaskList( Task t1, Task t2, Task t3 ) - { - List result = createTaskList(t1, t2); - result.add( t3 ); - return result; - } - - protected List createTaskList( Task t1, Task t2, Task t3, Task t4 ) - { - List result = createTaskList(t1, t2, t3); - result.add( t4 ); - return result; - } - - protected List createTaskList( Task t1, Task t2, Task t3, Task t4, Task t5 ) - { - List result = createTaskList(t1, t2, t3, t4); - result.add( t5 ); - return result; - } - /** - * @param task - * @param task2 - * @param task3 - * @param task4 - * @param task5 - * @param task6 - * @return - */ - protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6) - { - List result = createTaskList( task, task2, task3, task4, task5 ); - result.add( task6 ); - return result; - } - - protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6, Task task7) - { - List result = createTaskList( task, task2, task3, task4, task5, task6 ); - result.add( task7 ); - return result; - } - - protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6, Task task7, Task task8 ) - { - List result = createTaskList( task, task2, task3, task4, task5, task6, task7 ); - result.add( task8 ); - return result; - } - - protected List createTaskList(Task task, Task task2, Task task3, Task task4, Task task5, Task task6, Task task7, Task task8, Task task9 ) - { - List result = createTaskList( task, task2, task3, task4, task5, task6, task7, task8 ); - result.add( task9 ); - return result; - } - - public boolean qualifiedNamesEquals( String [] fromAST, String [] theTruth) - { - if( fromAST == null || theTruth == null ) return false; - if( fromAST.length != theTruth.length ) return false; - for( int i = 0; i < fromAST.length; ++i ) - { - if( !( fromAST[i].equals( theTruth[i] ) ) ) - return false; - } - return true; - } - - protected void assertQualifiedName(String [] fromAST, String [] theTruth) - { - assertTrue( qualifiedNamesEquals( fromAST, theTruth )); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ContextualParseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ContextualParseTest.java deleted file mode 100644 index 5c0f0647a44..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ContextualParseTest.java +++ /dev/null @@ -1,565 +0,0 @@ -/* - * Created on Dec 8, 2003 - * - * To change the template for this generated file go to Window - Preferences - - * Java - Code Generation - Code and Comments - */ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind; -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupResult; -import org.eclipse.cdt.internal.core.parser.ParserLogService; - -/** - * @author jcamelon - * - * To change the template for this generated type comment go to Window - - * Preferences - Java - Code Generation - Code and Comments - */ -public class ContextualParseTest extends CompleteParseBaseTest { - - - public ContextualParseTest(String name) { - super(name); - } - - protected IASTCompletionNode parse(String code, int offset) - throws Exception { - IParserLogService log = new ParserLogService(); - callback = new FullParseCallback(); - IParser parser = null; - - parser = - ParserFactory.createParser( - ParserFactory.createScanner( - new StringReader(code), - "completion-test", - new ScannerInfo(), - ParserMode.CONTEXTUAL_PARSE, - ParserLanguage.CPP, - callback, - log), - callback, - ParserMode.CONTEXTUAL_PARSE, - ParserLanguage.CPP, - log); - - return parser.parse( offset ); - - } - - public void testBaseCase_SimpleDeclaration() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "class ABC " ); - writer.write( "{int x;}; " ); - writer.write( "AB\n\n" ); - - IASTCompletionNode node = null; - Iterator keywords = null; - - node = parse( writer.toString(), 21); - assertNotNull( node ); - assertNotNull( node.getCompletionPrefix() ); - assertEquals( node.getCompletionScope(), ((Scope)callback.getCompilationUnit()).getScope() ); - assertEquals( node.getCompletionPrefix(), "A"); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.VARIABLE_TYPE ); - keywords = node.getKeywords(); - assertFalse( keywords.hasNext() ); - - node = parse( writer.toString(), 12); - assertNotNull( node ); - assertNotNull( node.getCompletionPrefix() ); - assertTrue( node.getCompletionScope() instanceof IASTClassSpecifier ); - assertEquals( node.getCompletionPrefix(), "i"); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.FIELD_TYPE ); - keywords = node.getKeywords(); - assertTrue( keywords.hasNext() ); - assertEquals( (String) keywords.next(), "inline"); - assertEquals( (String) keywords.next(), "int"); - assertFalse( keywords.hasNext() ); - - node = parse( writer.toString(), 22); - assertNotNull( node ); - assertNotNull( node.getCompletionPrefix() ); - assertEquals( node.getCompletionScope(), ((Scope)callback.getCompilationUnit()).getScope() ); - assertEquals( node.getCompletionPrefix(), "AB"); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.VARIABLE_TYPE ); - keywords = node.getKeywords(); - assertFalse( keywords.hasNext() ); - - node = parse( writer.toString(), 6); - assertNotNull( node ); - assertNotNull( node.getCompletionPrefix() ); - assertEquals( node.getCompletionScope(), ((Scope)callback.getCompilationUnit()).getScope() ); - assertEquals( node.getCompletionPrefix(), ""); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.USER_SPECIFIED_NAME ); - keywords = node.getKeywords(); - assertFalse( keywords.hasNext() ); - } - - public void testCompletionLookup_Unqualified() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "int aVar; " ); - writer.write( "void foo( ) { " ); - writer.write( " int anotherVar; " ); - writer.write( " a " ); - writer.write( "} " ); - - String code = writer.toString(); - - for( int i = 0; i < 2; ++i ) - { - int index = ( i == 0 ? code.indexOf( " a " ) + 2 : code.indexOf( " a ") + 1 ); - - IASTCompletionNode node = parse( code, index ); - assertNotNull( node ); - - String prefix = node.getCompletionPrefix(); - assertNotNull( prefix ); - assertTrue( node.getCompletionScope() instanceof IASTFunction ); - assertEquals( prefix, i == 0 ? "a" :"" ); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.STATEMENT_START ); - - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.ALL; - LookupResult result = node.getCompletionScope().lookup( prefix, kinds, node.getCompletionContext() ); - assertEquals( result.getPrefix(), prefix ); - - Iterator iter = result.getNodes(); - - IASTVariable anotherVar = (IASTVariable) iter.next(); - if( i != 0 ) - { - IASTFunction foo = (IASTFunction) iter.next(); - assertEquals( foo.getName(), "foo"); - } - IASTVariable aVar = (IASTVariable) iter.next(); - - assertFalse( iter.hasNext() ); - assertEquals( anotherVar.getName(), "anotherVar" ); - assertEquals( aVar.getName(), "aVar" ); - } - } - - public void testCompletionLookup_Qualified() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "int aVar; " ); - writer.write( "struct D{ " ); - writer.write( " int aField; " ); - writer.write( " void aMethod(); " ); - writer.write( "}; " ); - writer.write( "void foo(){" ); - writer.write( " D d; " ); - writer.write( " d.a " ); - writer.write( "}\n" ); - - String code = writer.toString(); - int index = code.indexOf( "d.a" ); - - IASTCompletionNode node = parse( code, index + 3 ); - assertNotNull( node ); - - String prefix = node.getCompletionPrefix(); - assertNotNull( prefix ); - assertEquals( prefix, "a" ); - - assertTrue( node.getCompletionScope() instanceof IASTFunction ); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.MEMBER_REFERENCE ); - assertNotNull( node.getCompletionContext() ); - assertTrue( node.getCompletionContext() instanceof IASTClassSpecifier ); - - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.ALL; - LookupResult result = node.getCompletionScope().lookup( prefix, kinds, node.getCompletionContext() ); - assertEquals( result.getPrefix(), prefix ); - - Iterator iter = result.getNodes(); - - IASTMethod aMethod = null; - IASTField aField = null; - - //we can't currently predict the order in this case - for( int i = 1; i <= 2; i++ ){ - IASTNode astNode = (IASTNode) iter.next(); - if( astNode instanceof IASTMethod ){ - aMethod = (IASTMethod) astNode; - } else{ - aField = (IASTField) astNode; - } - } - - assertFalse( iter.hasNext() ); - - assertEquals( aMethod.getName(), "aMethod" ); - assertEquals( aField.getName(), "aField" ); - } - - public void testMemberCompletion_Arrow() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "class A {" ); - writer.write( " public: void aPublicBaseMethod();" ); - writer.write( " private: void aPrivateBaseMethod();" ); - writer.write( "};" ); - writer.write( "class B : public A {" ); - writer.write( " public: void aMethod();" ); - writer.write( "};" ); - writer.write( "void foo(){" ); - writer.write( " B * b = new B();" ); - writer.write( " b-> \n" ); - - String code = writer.toString(); - int index = code.indexOf( "b->" ); - - IASTCompletionNode node = parse( code, index + 3 ); - assertNotNull(node); - assertEquals( node.getCompletionPrefix(), "" ); - - assertEquals(node.getCompletionKind(), IASTCompletionNode.CompletionKind.MEMBER_REFERENCE); - assertTrue(node.getCompletionScope() instanceof IASTFunction ); - assertEquals( ((IASTFunction)node.getCompletionScope()).getName(), "foo" ); - assertTrue(node.getCompletionContext() instanceof IASTClassSpecifier ); - assertEquals( ((IASTClassSpecifier)node.getCompletionContext()).getName(), "B" ); - } - - public void testMemberCompletion_Dot() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "class A {" ); - writer.write( " public: void aPublicBaseMethod();" ); - writer.write( " private: void aPrivateBaseMethod();" ); - writer.write( "};" ); - writer.write( "class B : public A {" ); - writer.write( " public: void aMethod();" ); - writer.write( "};" ); - writer.write( "void foo(){" ); - writer.write( " B b;" ); - writer.write( " b. \n" ); - - String code = writer.toString(); - int index = code.indexOf( "b." ); - - IASTCompletionNode node = parse( code, index + 2 ); - assertNotNull(node); - assertEquals( node.getCompletionPrefix(), "" ); - - assertEquals(node.getCompletionKind(), IASTCompletionNode.CompletionKind.MEMBER_REFERENCE); - assertTrue(node.getCompletionScope() instanceof IASTFunction ); - assertEquals( ((IASTFunction)node.getCompletionScope()).getName(), "foo" ); - assertTrue(node.getCompletionContext() instanceof IASTClassSpecifier ); - assertEquals( ((IASTClassSpecifier)node.getCompletionContext()).getName(), "B" ); - } - - - public void testCompletionLookup_Pointer() throws Exception{ - StringWriter writer = new StringWriter(); - writer.write( "class A {" ); - writer.write( " public: void aPublicBaseMethod();" ); - writer.write( " private: void aPrivateBaseMethod();" ); - writer.write( "};" ); - writer.write( "class B : public A {" ); - writer.write( " public: void aMethod();" ); - writer.write( "};" ); - writer.write( "void foo(){" ); - writer.write( " B * b = new B();" ); - writer.write( " b->a \n" ); - - for( int i = 0; i < 2; ++i ) - { - String code = writer.toString(); - - int index; - - index = (i == 0 )? (code.indexOf( "b->a" )+4) :(code.indexOf( "b->") + 3); - - IASTCompletionNode node = parse( code, index); - - assertNotNull( node ); - String prefix = node.getCompletionPrefix(); - - assertEquals( prefix, ( i == 0 ) ? "a" :""); - - assertTrue( node.getCompletionScope() instanceof IASTFunction ); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.MEMBER_REFERENCE ); - assertNotNull( node.getCompletionContext() ); - assertTrue( node.getCompletionContext() instanceof IASTClassSpecifier ); - - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.METHODS; - LookupResult result = node.getCompletionScope().lookup( prefix, kinds, node.getCompletionContext() ); - assertEquals( result.getPrefix(), prefix ); - - Iterator iter = result.getNodes(); - IASTMethod method = (IASTMethod) iter.next(); - IASTMethod baseMethod = (IASTMethod) iter.next(); - - assertFalse( iter.hasNext() ); - - assertEquals( method.getName(), "aMethod" ); - assertEquals( baseMethod.getName(), "aPublicBaseMethod" ); - } - } - - public void testCompletionLookup_FriendClass_1() throws Exception{ - StringWriter writer = new StringWriter(); - writer.write( "class A {" ); - writer.write( " private: void aPrivateMethod();" ); - writer.write( " friend class C;" ); - writer.write( "};" ); - - writer.write( "class C {" ); - writer.write( " void foo();" ); - writer.write( "};" ); - - writer.write( "void C::foo(){" ); - writer.write( " A a;" ); - writer.write( " a.a \n" ); - - String code = writer.toString(); - int index = code.indexOf( "a.a" ); - - IASTCompletionNode node = parse( code, index + 3 ); - - assertNotNull( node ); - - String prefix = node.getCompletionPrefix(); - assertEquals( prefix, "a" ); - - assertTrue( node.getCompletionScope() instanceof IASTFunction ); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.MEMBER_REFERENCE ); - assertNotNull( node.getCompletionContext() ); - assertTrue( node.getCompletionContext() instanceof IASTClassSpecifier ); - - LookupResult result = node.getCompletionScope().lookup( prefix, new IASTNode.LookupKind [] { IASTNode.LookupKind.METHODS }, node.getCompletionContext() ); - assertEquals( result.getPrefix(), prefix ); - - Iterator iter = result.getNodes(); - assertTrue( iter.hasNext() ); - - IASTMethod method = (IASTMethod) iter.next(); - - assertFalse( iter.hasNext() ); - - assertEquals( method.getName(), "aPrivateMethod" ); - } - - public void testCompletionLookup_FriendClass_2() throws Exception{ - StringWriter writer = new StringWriter(); - writer.write( "class C {" ); - writer.write( " void foo();" ); - writer.write( "};" ); - writer.write( "class A {" ); - writer.write( " private: void aPrivateMethod();" ); - writer.write( " friend class C;" ); - writer.write( "};" ); - - writer.write( "void C::foo(){" ); - writer.write( " A a;" ); - writer.write( " a.a \n" ); - - String code = writer.toString(); - int index = code.indexOf( "a.a" ); - - IASTCompletionNode node = parse( code, index + 3 ); - - assertNotNull( node ); - - String prefix = node.getCompletionPrefix(); - assertEquals( prefix, "a" ); - - assertTrue( node.getCompletionScope() instanceof IASTFunction ); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.MEMBER_REFERENCE ); - assertNotNull( node.getCompletionContext() ); - assertTrue( node.getCompletionContext() instanceof IASTClassSpecifier ); - - LookupResult result = node.getCompletionScope().lookup( prefix, new IASTNode.LookupKind [] { IASTNode.LookupKind.METHODS }, node.getCompletionContext() ); - assertEquals( result.getPrefix(), prefix ); - - Iterator iter = result.getNodes(); - assertTrue( iter.hasNext() ); - - IASTMethod method = (IASTMethod) iter.next(); - - assertFalse( iter.hasNext() ); - - assertEquals( method.getName(), "aPrivateMethod" ); - } - - - public void testCompletionLookup_ParametersAsLocalVariables() throws Exception{ - StringWriter writer = new StringWriter(); - writer.write( "int foo( int aParameter ){" ); - writer.write( " int aLocal;" ); - writer.write( " if( aLocal != 0 ){" ); - writer.write( " int aBlockLocal;" ); - writer.write( " a \n" ); - - String code = writer.toString(); - int index = code.indexOf( " a " ); - - IASTCompletionNode node = parse( code, index + 2 ); - - assertNotNull( node ); - - String prefix = node.getCompletionPrefix(); - assertEquals( prefix, "a" ); - - assertTrue( node.getCompletionScope() instanceof IASTCodeScope ); - assertEquals( node.getCompletionKind(), IASTCompletionNode.CompletionKind.STATEMENT_START ); - assertNull( node.getCompletionContext() ); - - LookupResult result = node.getCompletionScope().lookup( prefix, new IASTNode.LookupKind [] { IASTNode.LookupKind.LOCAL_VARIABLES }, node.getCompletionContext() ); - assertEquals( result.getPrefix(), prefix ); - - Iterator iter = result.getNodes(); - - IASTVariable aBlockLocal = (IASTVariable) iter.next(); - IASTVariable aLocal = (IASTVariable) iter.next(); - IASTParameterDeclaration aParameter = (IASTParameterDeclaration) iter.next(); - - assertFalse( iter.hasNext() ); - - assertEquals( aBlockLocal.getName(), "aBlockLocal" ); - assertEquals( aLocal.getName(), "aLocal" ); - assertEquals( aParameter.getName(), "aParameter" ); - } - - public void testCompletionLookup_LookupKindTHIS() throws Exception{ - StringWriter writer = new StringWriter(); - writer.write( "int aGlobalVar;" ); - writer.write( "namespace NS { " ); - writer.write( " int aNamespaceFunction(){}" ); - writer.write( " class Base { " ); - writer.write( " protected: int aBaseField;" ); - writer.write( " };" ); - writer.write( " class Derived : public Base {" ); - writer.write( " int aMethod();" ); - writer.write( " };" ); - writer.write( "}" ); - writer.write( "int NS::Derived::aMethod(){"); - writer.write( " int aLocal;" ); - writer.write( " a "); - - String code = writer.toString(); - int index = code.indexOf( " a " ); - - IASTCompletionNode node = parse( code, index + 2 ); - - assertNotNull( node ); - - assertEquals( node.getCompletionPrefix(), "a" ); - assertTrue( node.getCompletionScope() instanceof IASTMethod ); - - LookupResult result = node.getCompletionScope().lookup( node.getCompletionPrefix(), - new IASTNode.LookupKind[] { IASTNode.LookupKind.THIS }, - node.getCompletionContext() ); - - assertEquals( result.getResultsSize(), 2 ); - - Iterator iter = result.getNodes(); - IASTMethod method = (IASTMethod) iter.next(); - IASTField field = (IASTField) iter.next(); - assertFalse( iter.hasNext() ); - assertEquals( method.getName(), "aMethod" ); - assertEquals( field.getName(), "aBaseField" ); - - result = node.getCompletionScope().lookup( node.getCompletionPrefix(), - new IASTNode.LookupKind[] { IASTNode.LookupKind.THIS, IASTNode.LookupKind.METHODS }, - node.getCompletionContext() ); - - assertEquals( result.getResultsSize(), 1 ); - iter = result.getNodes(); - method = (IASTMethod) iter.next(); - assertFalse( iter.hasNext() ); - assertEquals( method.getName(), "aMethod" ); - } - - public void testCompletionInConstructor() throws Exception - { - Writer writer = new StringWriter(); - writer.write("class SimpleTest{"); - writer.write(" public:"); - writer.write("SimpleTest();"); - writer.write("~SimpleTest();"); - writer.write("int a, b, c, aa, bb, cc, abc;"); - writer.write("};"); - writer.write("SimpleTest::~SimpleTest()"); - writer.write("{}"); - writer.write("SimpleTest::SimpleTest()"); - writer.write("{"); - writer.write("/**/a"); - writer.write("}"); - - IASTCompletionNode node = parse( writer.toString(), writer.toString().indexOf("/**/a") + 5 ); - assertNotNull(node); - assertEquals(node.getCompletionPrefix(), "a"); - assertTrue(node.getCompletionScope() instanceof IASTMethod); - IASTMethod inquestion = (IASTMethod)node.getCompletionScope(); - assertEquals( inquestion.getName(), "SimpleTest"); - assertTrue(inquestion.isConstructor()); - - assertEquals(node.getCompletionKind(), IASTCompletionNode.CompletionKind.STATEMENT_START ); - assertNull(node.getCompletionContext()); - LookupKind[] kinds = new LookupKind[ 1 ]; - kinds[0] = LookupKind.FIELDS; - - LookupResult result = inquestion.lookup( "a", kinds, null ); - assertEquals(result.getResultsSize(), 3 ); - } - - public void testCompletionInDestructor() throws Exception - { - Writer writer = new StringWriter(); - writer.write("class SimpleTest{"); - writer.write(" public:"); - writer.write("SimpleTest();"); - writer.write("~SimpleTest();"); - writer.write("int a, b, c, aa, bb, cc, abc;"); - writer.write("};"); - writer.write("SimpleTest::SimpleTest()"); - writer.write("{}"); - writer.write("SimpleTest::~SimpleTest()"); - writer.write("{"); - writer.write("/**/a"); - writer.write("}"); - - IASTCompletionNode node = parse( writer.toString(), writer.toString().indexOf("/**/a") + 5 ); - assertNotNull(node); - assertEquals(node.getCompletionPrefix(), "a"); - assertTrue(node.getCompletionScope() instanceof IASTMethod); - IASTMethod inquestion = (IASTMethod)node.getCompletionScope(); - assertEquals( inquestion.getName(), "~SimpleTest"); - assertTrue(inquestion.isDestructor()); - - assertEquals(node.getCompletionKind(), IASTCompletionNode.CompletionKind.STATEMENT_START ); - assertNull(node.getCompletionContext()); - LookupKind[] kinds = new LookupKind[ 1 ]; - kinds[0] = LookupKind.FIELDS; - - LookupResult result = inquestion.lookup( "a", kinds, null ); - assertEquals(result.getResultsSize(), 3 ); - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java deleted file mode 100644 index 68072d7394f..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ScannerInfo; - -public class ExprEvalTest extends TestCase { - - public static Test suite() { - return new TestSuite(ExprEvalTest.class); - } - - public ExprEvalTest(String name) { - super(name); - } - - public void runTest(String code, int expectedValue) throws Exception { - - final NullSourceElementRequestor nullCallback = new NullSourceElementRequestor(); - IParser parser = ParserFactory.createParser(ParserFactory.createScanner( new StringReader( code ), getClass().getName(), new ScannerInfo(), null, ParserLanguage.CPP, nullCallback, null ), nullCallback, ParserMode.QUICK_PARSE, ParserLanguage.CPP, null ); - IASTExpression expression = parser.expression(null); - assertEquals(expectedValue, expression.evaluateExpression()); - } - - public void testInteger() throws Exception { - runTest("5;", 5); - runTest( "33;", 33 ); - } - - public void testNot() throws Exception - { - runTest( "!1;", 0 ); - runTest( "!0;", 1 ); - runTest( "!4;", 0 ); - runTest( "!!4;", 1 ); - } - - public void testMultiplicational() throws Exception - { - runTest( "3 * 4;", 12 ); - runTest( "55 * 2;", 110 ); - runTest( "4 / 3;", 1 ); - runTest( "100/4;", 25 ); - runTest( "8 % 2;", 0 ); - runTest( "8 % 3;", 2 ); - } - - public void testAdditive() throws Exception - { - runTest( "4 + 4;", 8 ); - runTest( "4 - 4;", 0 ); - } - - public void testLogicalAnd() throws Exception - { - runTest( "4 && 5;", 1 ); - runTest( "0 && 5;", 0 ); - runTest( "5 && 0;", 0 ); - runTest( "0 && 0;", 0 ); - } - - public void testLogicalOr() throws Exception - { - runTest( "4 || 5;", 1 ); - runTest( "0 || 5;", 1 ); - runTest( "5 || 0;", 1 ); - runTest( "0 || 0;", 0 ); - } - - public void testRelational() throws Exception { - runTest("1 < 2;", 1); - runTest("2 < 1;", 0); - runTest("2 == 1 + 1;", 1); - runTest("2 != 1 + 1;", 0); - } - - public void testBracketed() throws Exception { - runTest("2 * (3 + 4);", 14); - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java deleted file mode 100644 index 615499b4ec3..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java +++ /dev/null @@ -1,258 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.NoSuchElementException; -import java.util.StringTokenizer; - -import junit.framework.Test; - -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.core.runtime.Path; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class FractionalAutomatedTest extends AutomatedFramework { - - public FractionalAutomatedTest() { - super(); - } - - public FractionalAutomatedTest(String name) { - super(name); - } - - protected AutomatedFramework newTest( String name ){ - return new FractionalAutomatedTest( name ); - } - protected void loadProperties() throws Exception{ - String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - resourcePath += "resources/parser/AutomatedTest"; - - try{ - FileInputStream propertiesIn = new FileInputStream( resourcePath + "/FractionalAutomatedTest.properties"); - properties.load( propertiesIn ); - - outputFile = properties.getProperty( "outputFile", "" ); - String sourceInfo = properties.getProperty( "source", "" ); - - stepSize = Integer.parseInt( properties.getProperty( "stepSize", "50" ) ); - windowSize = Integer.parseInt( properties.getProperty( "windowSize", "200" ) ); - timeOut = Integer.parseInt( properties.getProperty( "timeOut", "5000" )); - outputDir = properties.getProperty( "outDir", "" ); - - if( sourceInfo.equals("") ) - throw new FileNotFoundException(); - else{ - StringTokenizer tokenizer = new StringTokenizer( sourceInfo, "," ); - String str = null, val = null; - try{ - while( tokenizer.hasMoreTokens() ){ - str = tokenizer.nextToken().trim(); - val = tokenizer.nextToken().trim(); - - testSources.put( str, val ); - } - } catch ( NoSuchElementException e ){ - //only way to get here is to have a missing val, assume cpp for that str - testSources.put( str, "cpp" ); - } - - } - } catch ( FileNotFoundException e ){ - testSources.put( resourcePath + "/defaultCpp", "cpp" ); - testSources.put( resourcePath + "/defaultC", "c" ); - } - } - - public static Test suite() - { - AutomatedFramework frame = new FractionalAutomatedTest(); - - return frame.createSuite(); - } - - static private String outputFile( String code ) { - if( outputDir == null || outputDir.equals("") ) - return ""; - - File output = new File( outputDir ); - - try{ - if( output.exists() ){ - if( output.isFile() ){ - output.delete(); - output.createNewFile(); - FileOutputStream stream = new FileOutputStream( output ); - stream.write( code.getBytes() ); - stream.flush(); - stream.close(); - return outputDir; - } - } else { - output.mkdir(); - } - File file = new File( outputDir + "/" + failures++ + ".tmp" ); - if( file.exists() ) - file.delete(); - file.createNewFile(); - FileOutputStream stream = new FileOutputStream( file ); - stream.write( code.getBytes() ); - stream.flush(); - stream.close(); - - return file.getCanonicalPath(); - - } catch ( Exception e ) - {} - return ""; - } - - static public void reportHang( String code, String file ){ - String output = outputFile( code.toString() ); - if( output.equals("") ) - output = "Parser hang while parsing " + file + "\n"; - else - output = "Parser hang while parsing " + output + "\n"; - - if( report != null ){ - try{ - report.write( output.getBytes() ); - } catch ( IOException e ) {} - } - - fail( output ); - } - - static public void reportException( String code, String file, String exception ){ - String output = outputFile( code.toString() ); - - if( output.equals("") ) - output = exception.getClass().toString() + " encountered in " + file + "\n"; - else - output = exception.getClass().toString() + " encountered in " + output + "\n"; - - if( report != null ){ - try{ - report.write( output.getBytes() ); - } catch ( IOException e ) {} - } - - fail( output ); - } - - public void doFile() throws Throwable { - assertNotNull( fileList ); - - File file = (File)fileList.removeFirst(); - FileInputStream stream = new FileInputStream( file ); - - String filePath = file.getCanonicalPath(); - String nature = (String)natures.get( filePath ); - - boolean cppNature = nature.equalsIgnoreCase("cpp"); - - StringWriter code = new StringWriter(); - - ParseThread thread = new ParseThread(); - - byte b[] = new byte[stepSize]; - int n = stream.read( b ); - while( n != -1 ){ - code.write( new String( b ) ); - - thread.code = code.toString(); - thread.cppNature = cppNature; - thread.start(); - thread.join( timeOut ); - - if( thread.isAlive() ){ - //Use deprecated Thread.stop() for now - //alternative is to create a callback which could stop the parse on a flag - //by throwing something, but that has the disadvantage of being unable to - //stop any loops that don't involve callbacks. - thread.stop(); - reportHang( code.toString(), filePath ); - } else if( thread.result != null ) { - reportException( code.toString(), filePath, thread.result ); - } - - n = stream.read( b ); - } - - String fullCode = code.toString(); - String windowedCode = null; - int length = fullCode.length(); - int curPos = 0; - - while( curPos + windowSize < length){ - windowedCode = fullCode.substring( 0, curPos ); - windowedCode += "\n" + fullCode.substring( curPos + windowSize, length ); - - thread.code = windowedCode; - thread.cppNature = cppNature; - thread.file = filePath; - thread.start(); - thread.join( timeOut ); - - if( thread.isAlive() ) - { - thread.stop(); - reportHang( windowedCode, filePath ); - } else if( thread.result != null ) { - reportException( windowedCode, filePath, thread.result ); - } - - curPos += stepSize; - } - } - - static class ParseThread extends Thread{ - public String code; - public boolean cppNature; - public String file; - public String result; - - public void run(){ - try{ - result = null; - ParserLanguage language = cppNature ? ParserLanguage.CPP : ParserLanguage.C; - IParser parser = ParserFactory.createParser( - ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback, null ), nullCallback, ParserMode.QUICK_PARSE, language, null ); - - parser.parse(); - } catch ( Exception e ){ - result = e.getClass().toString(); - } - } - } - - static protected int stepSize = 50; - static protected int windowSize = 200; - static protected int timeOut = 5000; - static protected String outputDir = null; - static protected int failures = 0; -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java deleted file mode 100644 index 959053770fe..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java +++ /dev/null @@ -1,3437 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.core.parser.tests; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType; -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind; -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTClassSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTCompilationUnit; -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTField; -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTableException; -import org.eclipse.cdt.internal.core.parser.pst.StandardSymbolExtension; -import org.eclipse.cdt.internal.core.parser.pst.TemplateInstance; -import org.eclipse.cdt.internal.core.parser.pst.TypeFilter; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.Mark; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo.OperatorExpression; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo.PtrOp; - - - -/** - * @author aniefer - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ParserSymbolTableTest extends TestCase { - - public ParserSymbolTable table = null; - - public ParserSymbolTableTest( String arg ) - { - super( arg ); - } - - public ParserSymbolTable newTable(){ - return newTable( ParserLanguage.CPP ); - } - - public ParserSymbolTable newTable( ParserLanguage language ){ - table = new ParserSymbolTable( language ); - return table; - } - /** - * testSimpleAdd. - * Add a declaration to the table and confirm it is there. - * - * @throws Exception - */ - public void testSimpleAdd() throws Exception{ - newTable(); //create the symbol table - - ISymbol x = table.newSymbol( "x" ); - IContainerSymbol compUnit = table.getCompilationUnit(); - compUnit.addSymbol( x ); - - Map declarations = compUnit.getContainedSymbols(); - assertEquals( 1, declarations.size() ); - - Iterator iter = declarations.values().iterator(); - ISymbol contained = (ISymbol) iter.next(); - - assertEquals( false, iter.hasNext() ); - assertEquals( x, contained ); - assertEquals( contained.getName(), "x" ); - } - - /** - * testSimpleLookup - * Add a declaration to the table, then look it up. - * @throws Exception - */ - public void testSimpleLookup() throws Exception{ - newTable(); //new symbol table - - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); - table.getCompilationUnit().addSymbol( x ); - - ISymbol look = table.getCompilationUnit().lookup( "x" ); - - assertEquals( x, look ); - } - - public void testLookupNonExistant() throws Exception{ - newTable(); - - ISymbol look = table.getCompilationUnit().lookup("boo"); - assertEquals( look, null ); - } - - public void testSimpleSetGetObject() throws Exception{ - newTable(); - - IContainerSymbol x = table.newContainerSymbol( "x", TypeInfo.t_namespace ); - - ISymbolASTExtension extension = new StandardSymbolExtension(x,null); - - x.setASTExtension( extension ); - - table.getCompilationUnit().addSymbol( x ); - - ISymbol look = table.getCompilationUnit().lookup( "x" ); - - assertEquals( look.getASTExtension(), extension ); - } - - /** - * testHide - * test that a declaration in a scope hides declarations in containing - * scopes - * @throws Exception - */ - public void testHide() throws Exception{ - newTable(); - - ISymbol firstX = table.newSymbol("x"); - table.getCompilationUnit().addSymbol( firstX ); - - IDerivableContainerSymbol firstClass = table.newDerivableContainerSymbol("class"); - firstClass.setType( TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( firstClass ); - - ISymbol look = firstClass.lookup( "x" ); - assertEquals( look, firstX ); - - ISymbol secondX = table.newSymbol("x"); - firstClass.addSymbol( secondX ); - - look = firstClass.lookup( "x" ); - assertEquals( look, secondX ); - - look = table.getCompilationUnit().lookup( "x" ); - assertEquals( look, firstX ); - } - - /** - * testContainingScopeLookup - * test lookup of something declared in the containing scope - * @throws Exception - */ - public void testContainingScopeLookup() throws Exception{ - newTable(); - - ISymbol x = table.newSymbol("x"); - table.getCompilationUnit().addSymbol( x ); - - IDerivableContainerSymbol decl = table.newDerivableContainerSymbol("class"); - decl.setType( TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( decl ); - - ISymbol look = decl.lookup( "x" ); - - assertEquals( x, look ); - } - - /** - * testParentLookup - * test lookup of a variable declaration in the parent - * - * @throws Exception - */ - public void testParentLookup() throws Exception{ - newTable(); - - IDerivableContainerSymbol parent = table.newDerivableContainerSymbol("parent"); - parent.setType( TypeInfo.t_class ); - - IDerivableContainerSymbol class1 = table.newDerivableContainerSymbol("class"); - class1.setType( TypeInfo.t_class ); - class1.addParent( parent ); - - ISymbol decl = table.newSymbol( "x", TypeInfo.t_int ); - parent.addSymbol( decl ); - - table.getCompilationUnit().addSymbol( parent ); - table.getCompilationUnit().addSymbol( class1 ); - - ISymbol look = class1.lookup( "x" ); - assertEquals( look, decl ); - } - - /** - * testAmbiguousParentLookup - * calls testParentLookup - * - * tests that if a variable is declared in two parents that the lookup - * returns an ambiguous result. - * - * @throws Exception - */ - public void testAmbiguousParentLookup() throws Exception{ - testParentLookup(); - - IDerivableContainerSymbol parent2 = table.newDerivableContainerSymbol("parent2"); - table.getCompilationUnit().addSymbol( parent2 ); - - IDerivableContainerSymbol class1 = (IDerivableContainerSymbol) table.getCompilationUnit().lookup( "class" ); - class1.addParent( parent2 ); - - ISymbol decl = table.newSymbol( "x", TypeInfo.t_int ); - parent2.addSymbol( decl ); - - try{ - class1.lookup( "x" ); - assertTrue( false ); - } - catch ( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - } - - /** - * - * @throws Exception - * test for circular inheritance - */ - public void testCircularParentLookup() throws Exception{ - newTable(); - - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a"); - table.getCompilationUnit().addSymbol( a ); - - IDerivableContainerSymbol b = table.newDerivableContainerSymbol("b"); - b.addParent( a ); - table.getCompilationUnit().addSymbol( b ); - - a.addParent( b ); - - try{ - a.lookup("foo"); - assertTrue( false ); - } catch ( ParserSymbolTableException e) { - assertEquals( e.reason, ParserSymbolTableException.r_CircularInheritance ); - } - - } - /** - * testVirtualParentLookup - * - * @throws Exception - * tests lookup of name in virtual baseclass C - * - * C - * / \ - * A B - * \ / - * class - */ - public void testVirtualParentLookup() throws Exception{ - newTable(); - - IDerivableContainerSymbol decl = table.newDerivableContainerSymbol("class"); - IDerivableContainerSymbol c = table.newDerivableContainerSymbol("C"); - - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("A"); - a.addParent( c, true, ASTAccessVisibility.PUBLIC, 3, null ); - - IDerivableContainerSymbol b = table.newDerivableContainerSymbol("B"); - b.addParent( c, true, ASTAccessVisibility.PUBLIC, 6, null ); - - decl.addParent( a ); - decl.addParent( b ); - - IContainerSymbol compUnit = table.getCompilationUnit(); - compUnit.addSymbol( c ); - - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); - c.addSymbol( x ); - - compUnit.addSymbol( decl ); - compUnit.addSymbol( a ); - compUnit.addSymbol( b ); - - ISymbol look = decl.lookup( "x" ); - - assertEquals( look, x ); - } - - /** - * testAmbiguousVirtualParentLookup - * @throws Exception - * - * tests lookup of name in base class C in the following hierarchy - * C C - * / \ | - * A B D - * \ / / - * class - */ - public void testAmbiguousVirtualParentLookup() throws Exception{ - testVirtualParentLookup(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol cls = (IDerivableContainerSymbol) compUnit.lookup("class"); - IDerivableContainerSymbol c = (IDerivableContainerSymbol) compUnit.lookup("C"); - IDerivableContainerSymbol d = table.newDerivableContainerSymbol("D"); - - d.addParent( c ); - cls.addParent( d ); - - compUnit.addSymbol( d ); - - try{ - cls.lookup( "x" ); - assertTrue( false ); - } - catch( ParserSymbolTableException e){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - } - - /** - * testStaticEnumParentLookup - * - * @throws Exception - * - * D D - * | | - * B C - * \ / - * A - * - * Things defined in D are not ambiguous if they are static or an enum - */ - public void testStaticEnumParentLookup() throws Exception{ - newTable(); - - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a" ); - IDerivableContainerSymbol b = table.newDerivableContainerSymbol( "b" ); - IDerivableContainerSymbol c = table.newDerivableContainerSymbol( "c" ); - IDerivableContainerSymbol d = table.newDerivableContainerSymbol( "d" ); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - compUnit.addSymbol( a ); - compUnit.addSymbol( b ); - compUnit.addSymbol( c ); - compUnit.addSymbol( d ); - - IContainerSymbol enum = table.newContainerSymbol( "enum", TypeInfo.t_enumeration ); - - ISymbol enumerator = table.newSymbol( "enumerator", TypeInfo.t_enumerator ); - - ISymbol stat = table.newSymbol( "static", TypeInfo.t_int ); - stat.getTypeInfo().setBit( true, TypeInfo.isStatic ); - - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); - - d.addSymbol( enum ); - d.addSymbol( stat ); - d.addSymbol( x ); - - enum.addSymbol( enumerator ); - - a.addParent( b ); - a.addParent( c ); - b.addParent( d ); - c.addParent( d ); - - try{ - a.lookup( "enumerator" ); - assertTrue( true ); - } - catch ( ParserSymbolTableException e){ - assertTrue( false ); - } - - try{ - a.lookup( "static" ); - assertTrue( true ); - } - catch ( ParserSymbolTableException e){ - assertTrue( false ); - } - - try{ - a.lookup( "x" ); - assertTrue( false ); - } - catch ( ParserSymbolTableException e){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - } - - /** - * testElaboratedLookup - * @throws Exception - * test lookup of hidden names using elaborated type spec - */ - public void testElaboratedLookup() throws Exception{ - newTable(); - - IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "class" ); - cls.setType( TypeInfo.t_class ); - - IDerivableContainerSymbol struct = table.newDerivableContainerSymbol("struct"); - struct.setType( TypeInfo.t_struct ); - - IContainerSymbol union = table.newContainerSymbol("union"); - union.setType( TypeInfo.t_union ); - - IDerivableContainerSymbol hideCls = table.newDerivableContainerSymbol( "class" ); - IDerivableContainerSymbol hideStruct = table.newDerivableContainerSymbol("struct"); - IContainerSymbol hideUnion = table.newContainerSymbol("union"); - - IDerivableContainerSymbol a = table.newDerivableContainerSymbol("a"); - IDerivableContainerSymbol b = table.newDerivableContainerSymbol("b"); - - a.addSymbol(hideCls); - a.addSymbol(hideStruct); - a.addSymbol(hideUnion); - - a.addParent( b ); - - b.addSymbol(cls); - b.addSymbol(struct); - b.addSymbol(union); - - table.getCompilationUnit().addSymbol( a ); - table.getCompilationUnit().addSymbol( b ); - - ISymbol look = a.elaboratedLookup( TypeInfo.t_class, "class" ); - assertEquals( look, cls ); - look = a.elaboratedLookup( TypeInfo.t_struct, "struct" ); - assertEquals( look, struct ); - look = a.elaboratedLookup( TypeInfo.t_union, "union" ); - assertEquals( look, union ); - } - - /** - * testDeclarationType - * @throws Exception - * test the use of ParserSymbolTable.Declaration type in the scenario - * A a; - * a.member <=...>; - * where A was previously declared - */ - public void testDeclarationType() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - //pre-condition - IContainerSymbol A = table.newContainerSymbol("A"); - compUnit.addSymbol(A); - - ISymbol member = table.newSymbol("member"); - A.addSymbol(member); - - //at time of "A a;" - ISymbol look = compUnit.lookup("A"); - assertEquals( look, A ); - ISymbol a = table.newSymbol("a"); - a.setTypeSymbol( look ); - compUnit.addSymbol( a ); - - //later "a.member" - look = compUnit.lookup("a"); - assertEquals( look, a ); - IContainerSymbol type = (IContainerSymbol) look.getTypeSymbol(); - assertEquals( type, A ); - - look = type.lookup("member"); - assertEquals( look, member ); - } - - /** - * - * @throws Exception - * - * struct stat { - * //... - * } - * int stat( struct stat* ); - * void f() - * { - * struct stat *ps; - * stat(ps); - * } - */ - public void testFunctionHidesClass() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol struct = table.newDerivableContainerSymbol("stat"); - struct.setType( TypeInfo.t_struct ); - compUnit.addSymbol( struct ); - - IParameterizedSymbol function = table.newParameterizedSymbol( "stat" ); - function.setType( TypeInfo.t_function ); - compUnit.addSymbol( function ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - f.setType( TypeInfo.t_function ); - compUnit.addSymbol( f ); - - ISymbol look = f.elaboratedLookup( TypeInfo.t_struct, "stat" ); - assertEquals( look, struct ); - - look = f.lookup( "stat" ); - assertEquals( look, function ); - } - - /** - * - * @throws Exception - * - * namespace A { - * int i; - * namespace B { - * namespace C{ - * int i; - * } - * using namespace A::B::C; - * void f1() { - * i = 5; //OK, C::i visible and hides A::i - * } - * } - * namespace D{ - * using namespace B; - * using namespace C; - * void f2(){ - * i = 5; //ambiguous, B::C and A::i - * } - * } - * void f3() { - * i = 5; //uses A::i - * } - * } - * void f4(){ - * i = 5; //no i is visible here - * } - * - */ - public void testUsingDirectives_1() throws Exception{ - newTable(); - - IContainerSymbol nsA = table.newContainerSymbol("A"); - nsA.setType( TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( nsA ); - - ISymbol nsA_i = table.newSymbol("i"); - nsA.addSymbol( nsA_i ); - - IContainerSymbol nsB = table.newContainerSymbol("B"); - nsB.setType( TypeInfo.t_namespace ); - nsA.addSymbol( nsB ); - - IContainerSymbol nsC = table.newContainerSymbol("C"); - nsC.setType( TypeInfo.t_namespace ); - nsB.addSymbol( nsC ); - - ISymbol nsC_i = table.newSymbol("i"); - nsC.addSymbol( nsC_i ); - - ISymbol look = nsB.lookup("C"); - assertEquals( look, nsC ); - nsB.addUsingDirective( nsC ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol("f"); - f1.setType( TypeInfo.t_function ); - - nsB.addSymbol( f1 ); - - look = f1.lookup( "i" ); - assertEquals( look, nsC_i ); //C::i visible and hides A::i - - IContainerSymbol nsD = table.newContainerSymbol("D"); - nsD.setType( TypeInfo.t_namespace ); - nsA.addSymbol( nsD ); - - look = nsD.lookup("B"); - assertEquals( look, nsB ); - nsD.addUsingDirective( nsB ); - - look = nsD.lookup("C"); - assertEquals( look, nsC ); - nsD.addUsingDirective( nsC ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f2" ); - f2.setType( TypeInfo.t_function ); - nsD.addSymbol( f2 ); - - try - { - look = f2.lookup( "i" ); - assertTrue( false ); - } - catch ( ParserSymbolTableException e ) - { - //ambiguous B::C::i and A::i - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - - IParameterizedSymbol f3 = table.newParameterizedSymbol("f3"); - f3.setType( TypeInfo.t_function ); - nsA.addSymbol( f3 ); - - look = f3.lookup("i"); - assertEquals( look, nsA_i ); //uses A::i - - IParameterizedSymbol f4 = table.newParameterizedSymbol("f4"); - f4.setType( TypeInfo.t_function ); - table.getCompilationUnit().addSymbol( f4 ); - - look = f4.lookup("i"); - assertEquals( look, null );//neither i is visible here. - } - /** - * - * @throws Exception - * - * namespace M { - * int i; - * } - * namespace N { - * int i; - * using namespace M; - * } - * - * void f() { - * using namespace N; - * i = 7; //error, both M::i and N::i are visible - * N::i = 5; //ok, i directly declared in N, using M not - * considered (since this is a qualified lookup) - * } - * - */ - public void testTransitiveUsingDirective() throws Exception - { - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol nsM = table.newContainerSymbol( "M" ); - nsM.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( nsM ); - - ISymbol nsM_i = table.newSymbol("i"); - nsM.addSymbol( nsM_i ); - - IContainerSymbol nsN = table.newContainerSymbol( "N" ); - nsN.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( nsN ); - - ISymbol nsN_i = table.newSymbol("i"); - nsN.addSymbol( nsN_i ); - nsN.addUsingDirective( nsM ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - compUnit.addSymbol( f ); - - f.addUsingDirective( nsN ); - - ISymbol look = null; - try - { - look = f.lookup( "i" ); - assertTrue( false ); - } - catch ( ParserSymbolTableException e ) - { - //ambiguous, both M::i and N::i are visible. - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - - look = f.lookupNestedNameSpecifier("N"); - assertEquals( look, nsN ); - - look = ((IContainerSymbol) look).qualifiedLookup("i"); //ok - assertEquals( look, nsN_i ); - } - - /** - * - * @throws Exception - * The same declaration found more than once is not an ambiguity - * namespace A{ - * int a; - * } - * namespace B{ - * using namespace A; - * } - * namespace C{ - * using namespace A; - * } - * - * namespace BC{ - * using namespace B; - * using namespace C; - * } - * - * void f(){ - * BC::a++; //ok - * } - */ - public void testUsing_SameDeclarationTwice() throws Exception - { - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol nsA = table.newContainerSymbol("A"); - nsA.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsA ); - - ISymbol a = table.newSymbol("a"); - nsA.addSymbol( a ); - - IContainerSymbol nsB = table.newContainerSymbol("B"); - nsB.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsB ); - nsB.addUsingDirective( nsA ); - - IContainerSymbol nsC = table.newContainerSymbol("C"); - nsC.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsC ); - nsC.addUsingDirective( nsA ); - - IContainerSymbol nsBC = table.newContainerSymbol("BC"); - nsBC.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsBC ); - nsBC.addUsingDirective( nsB ); - nsBC.addUsingDirective( nsC ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - f.setType(TypeInfo.t_function); - compUnit.addSymbol( f ); - - ISymbol look = f.lookupNestedNameSpecifier("BC"); - assertEquals( look, nsBC ); - look = ((IContainerSymbol)look).qualifiedLookup("a"); - assertEquals( look, a ); - } - - /** - * - * @throws Exception - * - * namespace B { - * int b; - * } - * namespace A { - * using namespace B; - * int a; - * } - * namespace B { - * using namespace A; - * } - * - * void f(){ - * A::a++; //ok - * A::b++; //ok - * B::a++; //ok - * B::b++; //ok - * } - */ - public void testUsing_SearchedOnce() throws Exception - { - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol nsB = table.newContainerSymbol( "B" ); - nsB.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsB ); - - ISymbol b = table.newSymbol("b"); - nsB.addSymbol( b ); - - IContainerSymbol nsA = table.newContainerSymbol( "A" ); - nsA.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsA ); - - nsA.addUsingDirective( nsB ); - - ISymbol a = table.newSymbol("a"); - nsA.addSymbol( a ); - - nsB.addUsingDirective( nsA ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - compUnit.addSymbol(f); - - IContainerSymbol lookA = f.lookupNestedNameSpecifier("A"); - assertEquals( lookA, nsA ); - - ISymbol look = lookA.qualifiedLookup("a"); - assertEquals( look, a ); - - look = lookA.qualifiedLookup("b"); - assertEquals( look, b ); - - IContainerSymbol lookB = f.lookupNestedNameSpecifier("B"); - look = lookB.qualifiedLookup("a"); - assertEquals( look, a ); - - look = lookB.qualifiedLookup("b"); - assertEquals( look, b ); - } - - /** - * we pass if we don't go into an infinite loop. - * TBD: we need a mechanism to detect failure of this - * test instead of just looping forever. - * - * @throws Exception - * - * namespace A{ - * } - * namespace B{ - * using namespace A; - * } - * namespace A{ - * using namespace B; - * } - * void f(){ - * using namespace A; - * using namespace B; - * i = 1; //not declared anywhere. - * } - */ - public void testUsing_SearchedOnce_2() throws Exception - { - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol nsA = table.newContainerSymbol( "A" ); - nsA.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsA ); - - IContainerSymbol nsB = table.newContainerSymbol( "B" ); - nsB.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsB ); - nsB.addUsingDirective( nsA ); - - nsA.addUsingDirective( nsB ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - compUnit.addSymbol(f); - f.addUsingDirective(nsA); - f.addUsingDirective(nsB); - - ISymbol look = f.lookup("i"); - assertEquals( look, null ); - } - - /** - * During lookup of a qualified namespace member name, if the lookup finds - * more than one declaration of the member, non-type names hide class or - * enumeration names if and only if the declarations are from the same - * namespace - * @throws Exception - * - * namespace A { - * struct x { }; - * int x; - * int y; - * } - * namespace B { - * struct y { }; - * } - * - * namespace C { - * using namespace A; - * using namespace B; - * - * int i = C::x; //ok, finds A::x - * int j = C::y; //ambiguous, A::y or B::y - * } - */ - public void testNamespaceMemberHiding() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol nsA = table.newContainerSymbol("A"); - nsA.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( nsA ); - - IContainerSymbol structX = table.newContainerSymbol("x"); - structX.setType( TypeInfo.t_struct ); - nsA.addSymbol( structX ); - - ISymbol intX = table.newSymbol("x"); - intX.setType( TypeInfo.t_int ); - nsA.addSymbol( intX ); - - ISymbol intY = table.newSymbol("y"); - intY.setType( TypeInfo.t_int ); - nsA.addSymbol( intY ); - - IContainerSymbol nsB = table.newContainerSymbol("B"); - nsB.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( nsB ); - IContainerSymbol structY = table.newContainerSymbol("y"); - structY.setType( TypeInfo.t_struct ); - nsB.addSymbol( structY ); - - IContainerSymbol nsC = table.newContainerSymbol("C"); - nsC.setType( TypeInfo.t_namespace); - compUnit.addSymbol( nsC ); - - ISymbol look = nsC.lookup("A"); - assertEquals( look, nsA ); - nsC.addUsingDirective( nsA ); - - look = nsC.lookup("B"); - assertEquals( look, nsB ); - nsC.addUsingDirective( nsB ); - - //lookup C::x - look = nsC.lookupNestedNameSpecifier("C"); - assertEquals( look, nsC ); - look = ((IContainerSymbol)look).qualifiedLookup( "x" ); - assertEquals( look, intX ); - - //lookup C::y - look = nsC.lookupNestedNameSpecifier("C"); - assertEquals( look, nsC ); - - try{ - look = ((IContainerSymbol)look).qualifiedLookup( "y" ); - assertTrue(false); - } catch ( ParserSymbolTableException e ) { - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - } - - /** - * In a definition for a namespace member in which the declarator-id is a - * qualified-id, given that the qualified-id for the namespace member has - * the form "nested-name-specifier unqualified-id", the unqualified-id shall - * name a member of the namespace designated by the nested-name-specifier. - * - * namespace A{ - * namespace B{ - * void f1(int); - * } - * using namespace B; - * } - * void A::f1(int) { ... } //ill-formed, f1 is not a member of A - */ - public void testLookupMemberForDefinition() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol nsA = table.newContainerSymbol( "A" ); - nsA.setType( TypeInfo.t_namespace ); - compUnit.addSymbol( nsA ); - - IContainerSymbol nsB = table.newContainerSymbol( "B" ); - nsB.setType( TypeInfo.t_namespace ); - nsA.addSymbol( nsB ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol("f1"); - f1.setType( TypeInfo.t_function ); - nsB.addSymbol( f1 ); - - nsA.addUsingDirective( nsB ); - - IContainerSymbol lookA = compUnit.lookupNestedNameSpecifier( "A" ); - assertEquals( nsA, lookA ); - - ISymbol look = lookA.lookupMemberForDefinition( "f1" ); - assertEquals( look, null ); - - //but notice if you wanted to do A::f1 as a function call, it is ok - look = lookA.qualifiedLookup( "f1" ); - assertEquals( look, f1 ); - } - - /** - * testUsingDeclaration - * @throws Exception - * 7.3.3-4 A using-declaration used as a member-declaration shall refer to a - * member of a base-class of the class being defined, shall refer to a - * member of an anonymous union that is a member of a base class of the - * class being defined or shall refer to an enumerator for an enumeration - * type that is a member of a base class of the class being defined - * - * struct B { - * void f( char ); - * enum E { e }; - * union { int x; }; - * }; - * class C { - * int g(); - * } - * struct D : B { - * using B::f; //ok, B is a base class of D - * using B::e; //ok, e is an enumerator in base class B - * using B::x; //ok, x is an union member of base class B - * using C::g; //error, C isn't a base class of D - * } - */ - public void testUsingDeclaration() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol("B"); - B.setType( TypeInfo.t_struct ); - compUnit.addSymbol( B ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - f.setType( TypeInfo.t_function ); - B.addSymbol( f ); - - IContainerSymbol E = table.newContainerSymbol( "E" ); - E.setType( TypeInfo.t_enumeration ); - B.addSymbol( E ); - - ISymbol e = table.newSymbol( "e" ); - e.setType( TypeInfo.t_enumerator ); - E.addSymbol( e ); - - /** - * TBD: Anonymous unions are not yet implemented - */ - - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); - C.setType( TypeInfo.t_class ); - compUnit.addSymbol( C ); - - IParameterizedSymbol g = table.newParameterizedSymbol( "g" ); - g.setType( TypeInfo.t_function ); - C.addSymbol( g ); - - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D" ); - D.setType( TypeInfo.t_struct ); - ISymbol look = compUnit.lookup( "B" ); - assertEquals( look, B ); - D.addParent( B ); - - compUnit.addSymbol( D ); - - IContainerSymbol lookB = D.lookupNestedNameSpecifier("B"); - assertEquals( lookB, B ); - - D.addUsingDeclaration( "f", lookB ); - D.addUsingDeclaration( "e", lookB ); - - //TBD anonymous union - //D.addUsingDeclaration( "x", lookB ); - - look = D.lookupNestedNameSpecifier("C"); - assertEquals( look, C ); - - try{ - D.addUsingDeclaration( "g", C ); - assertTrue( false ); - } - catch ( ParserSymbolTableException exception ){ - assertTrue( true ); - } - } - - /** - * testUsingDeclaration_2 - * @throws Exception - * 7.3.3-9 The entity declared by a using-declaration shall be known in the - * context using it according to its definition at the point of the using- - * declaration. Definitions added to the namespace after the using- - * declaration are not considered when a use of the name is made. - * - * namespace A { - * void f(int); - * } - * using A::f; - * - * namespace A { - * void f(char); - * } - * void foo(){ - * f('a'); //calls f( int ) - * } - * void bar(){ - * using A::f; - * f('a'); //calls f( char ); - * } - */ - public void testUsingDeclaration_2() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol A = table.newContainerSymbol( "A", TypeInfo.t_namespace ); - compUnit.addSymbol( A ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f1.addParameter( TypeInfo.t_int, 0, null, false ); - A.addSymbol( f1 ); - - ISymbol look = compUnit.lookupNestedNameSpecifier("A"); - assertEquals( look, A ); - - IParameterizedSymbol usingF = (IParameterizedSymbol) compUnit.addUsingDeclaration( "f", A ); - - look = compUnit.lookup("A"); - assertEquals( look, A ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol("f"); - f2.setType( TypeInfo.t_function ); - f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f2.addParameter( TypeInfo.t_char, 0, null, false ); - - A.addSymbol( f2 ); - - IParameterizedSymbol foo = table.newParameterizedSymbol("foo"); - foo.setType( TypeInfo.t_function ); - compUnit.addSymbol( foo ); - - LinkedList paramList = new LinkedList(); - TypeInfo param = new TypeInfo( TypeInfo.t_char, 0, null ); - paramList.add( param ); - - look = foo.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, usingF ); - assertTrue( usingF.hasSameParameters( f1 ) ); - - IParameterizedSymbol bar = table.newParameterizedSymbol( "bar" ); - bar.setType( TypeInfo.t_function ); - bar.addParameter( TypeInfo.t_char, 0, null, false ); - compUnit.addSymbol( bar ); - - look = bar.lookupNestedNameSpecifier( "A" ); - assertEquals( look, A ); - bar.addUsingDeclaration( "f", A ); - - look = bar.unqualifiedFunctionLookup( "f", paramList ); - assertTrue( look != null ); - assertTrue( ((IParameterizedSymbol) look).hasSameParameters( f2 ) ); - } - - /** - * testThisPointer - * @throws Exception - * In the body of a nonstatic member function... the type of this of a class - * X is X*. If the member function is declared const, the type of this is - * const X*, if the member function is declared volatile, the type of this - * is volatile X*.... - */ - public void testThisPointer() throws Exception{ - newTable(); - - IDerivableContainerSymbol cls = table.newDerivableContainerSymbol( "class", TypeInfo.t_class ); - - IParameterizedSymbol fn = table.newParameterizedSymbol("function"); - fn.setType( TypeInfo.t_function ); - fn.getTypeInfo().addPtrOperator( new PtrOp( PtrOp.t_undef, true, false ) ); - //fn.setCVQualifier( ParserSymbolTable.TypeInfo.cvConst ); - - table.getCompilationUnit().addSymbol( cls ); - cls.addSymbol( fn ); - - ISymbol look = fn.lookup("this"); - assertTrue( look != null ); - - assertEquals( look.getType(), TypeInfo.t_type ); - assertEquals( look.getTypeSymbol(), cls ); - assertEquals( ((PtrOp)look.getPtrOperators().iterator().next()).getType(), TypeInfo.PtrOp.t_pointer ); - assertTrue( ((PtrOp)look.getPtrOperators().iterator().next()).isConst() ); - assertEquals( look.getContainingSymbol(), fn ); - } - - /** - * testEnumerator - * @throws Exception - * Following the closing brace of an enum-specifier, each enumerator has the - * type of its enumeration. - * The enum-name and each enumerator declared by an enum-specifier is - * declared in the scope that immediately contains the enum-specifier - */ - public void testEnumerator() throws Exception{ - newTable(); - - IContainerSymbol cls = table.newContainerSymbol("class"); - cls.setType( TypeInfo.t_class ); - - IContainerSymbol enumeration = table.newContainerSymbol("enumeration"); - enumeration.setType( TypeInfo.t_enumeration ); - - table.getCompilationUnit().addSymbol( cls ); - cls.addSymbol( enumeration ); - - ISymbol enumerator = table.newSymbol( "enumerator" ); - enumerator.setType( TypeInfo.t_enumerator ); - enumeration.addSymbol( enumerator ); - - ISymbol look = cls.lookup( "enumerator" ); - assertEquals( look, enumerator ); - assertEquals( look.getContainingSymbol(), cls ); - assertEquals( look.getTypeSymbol(), enumeration ); - } - - /** - * - * @throws Exception - * - * namespace NS{ - * class T {}; - * void f( T ); - * } - * NS::T parm; - * int main(){ - * f( parm ); //ok, calls NS::f - * } - */ - public void testArgumentDependentLookup() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol NS = table.newContainerSymbol("NS"); - NS.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( NS ); - - IDerivableContainerSymbol T = table.newDerivableContainerSymbol("T"); - T.setType( TypeInfo.t_class ); - - NS.addSymbol( T ); - - IParameterizedSymbol f = table.newParameterizedSymbol("f"); - f.setType( TypeInfo.t_function ); - f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - - ISymbol look = NS.lookup( "T" ); - assertEquals( look, T ); - f.addParameter( look, null, false ); - - NS.addSymbol( f ); - - look = compUnit.lookupNestedNameSpecifier( "NS" ); - assertEquals( look, NS ); - look = NS.qualifiedLookup( "T" ); - assertEquals( look, T ); - - ISymbol param = table.newSymbol("parm"); - param.setType( TypeInfo.t_type ); - param.setTypeSymbol( look ); - compUnit.addSymbol( param ); - - IParameterizedSymbol main = table.newParameterizedSymbol("main"); - main.setType( TypeInfo.t_function ); - main.setReturnType( table.newSymbol( "", TypeInfo.t_int ) ); - compUnit.addSymbol( main ); - - LinkedList paramList = new LinkedList(); - look = main.lookup( "parm" ); - assertEquals( look, param ); - TypeInfo p = new TypeInfo( TypeInfo.t_type, 0, look ); - paramList.add( p ); - - look = main.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f ); - } - - /** - * testArgumentDependentLookup_2 - * @throws Exception - * in the following, NS2 is an associated namespace of class B which is an - * associated namespace of class A, so we should find f in NS2, we should - * not find f in NS1 because usings are ignored for associated scopes. - * - * - * namespace NS1{ - * void f( void * ){}; - * } - * namespace NS2{ - * using namespace NS1; - * class B {}; - * void f( void * ){}; - * } - * - * class A : public NS2::B {}; - * - * A a; - * f( &a ); - * - */ - public void testArgumentDependentLookup_2() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IContainerSymbol NS1 = table.newContainerSymbol( "NS1" ); - NS1.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( NS1 ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f1.addParameter( TypeInfo.t_void, 0, new PtrOp( PtrOp.t_pointer ), false ); - NS1.addSymbol( f1 ); - - IContainerSymbol NS2 = table.newContainerSymbol( "NS2" ); - NS2.setType( TypeInfo.t_namespace ); - - compUnit.addSymbol( NS2 ); - - ISymbol look = NS2.lookup( "NS1" ); - assertEquals( look, NS1 ); - NS2.addUsingDirective( NS1 ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); - B.setType( TypeInfo.t_class ); - NS2.addSymbol( B ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); - f2.setType( TypeInfo.t_function ); - f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f2.addParameter( TypeInfo.t_void, 0, new PtrOp( PtrOp.t_pointer ), false ); - NS2.addSymbol( f2 ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); - A.setType( TypeInfo.t_class ); - look = compUnit.lookupNestedNameSpecifier( "NS2" ); - assertEquals( look, NS2 ); - - look = NS2.qualifiedLookup( "B" ); - assertEquals( look, B ); - A.addParent( B ); - - compUnit.addSymbol( A ); - - look = compUnit.lookup( "A" ); - assertEquals( look, A ); - ISymbol a = table.newSymbol( "a" ); - a.setType( TypeInfo.t_type ); - a.setTypeSymbol( look ); - compUnit.addSymbol( a ); - - LinkedList paramList = new LinkedList(); - look = compUnit.lookup( "a" ); - assertEquals( look, a ); - TypeInfo param = new TypeInfo( look.getType(), 0, look, null, false ); - //new PtrOp( PtrOp.t_reference ) - param.addOperatorExpression( OperatorExpression.addressof ); - paramList.add( param ); - - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f2 ); - } - - /** - * testFunctionOverloading - * @throws Exception - * Note that this test has been contrived to not strain the resolution as - * that aspect is not yet complete. - * - * class C - * { - * void foo( int i ); - * void foo( int i, char c ); - * void foo( int i, char c, C * ptr ); - * } - * - * C * c = new C; - * c->foo( 1 ); - * c->foo( 1, 'a' ); - * c->foo( 1, 'a', c ); - * - */ - - public void testFunctionOverloading() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); - C.setType( TypeInfo.t_class ); - compUnit.addSymbol(C); - - IParameterizedSymbol f1 = table.newParameterizedSymbol("foo"); - f1.setType( TypeInfo.t_function ); - f1.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f1.addParameter( TypeInfo.t_int, 0, null, false ); - C.addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol("foo"); - f2.setType( TypeInfo.t_function ); - f2.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f2.addParameter( TypeInfo.t_int, 0, null, false ); - f2.addParameter( TypeInfo.t_char, 0, null, false ); - C.addSymbol( f2 ); - - IParameterizedSymbol f3 = table.newParameterizedSymbol("foo"); - f3.setType( TypeInfo.t_function ); - f3.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - f3.addParameter( TypeInfo.t_int, 0, null, false ); - f3.addParameter( TypeInfo.t_char, 0, null, false ); - f3.addParameter( C, new PtrOp( PtrOp.t_pointer ), false ); - C.addSymbol( f3 ); - - ISymbol look = compUnit.lookup("C"); - assertEquals( look, C ); - - ISymbol c = table.newSymbol("c"); - c.setType( TypeInfo.t_type ); - c.setTypeSymbol( look ); - c.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); - compUnit.addSymbol( c ); - - look = compUnit.lookup( "c" ); - assertEquals( look, c ); - assertEquals( look.getTypeSymbol(), C ); - - LinkedList paramList = new LinkedList(); - - TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); - TypeInfo p2 = new TypeInfo( TypeInfo.t_char, 0, null ); - TypeInfo p3 = new TypeInfo( TypeInfo.t_type, 0, c ); - - paramList.add( p1 ); - look = C.memberFunctionLookup( "foo", paramList ); - assertEquals( look, f1 ); - - paramList.add( p2 ); - look = C.memberFunctionLookup( "foo", paramList ); - assertEquals( look, f2 ); - - paramList.add( p3 ); - look = C.memberFunctionLookup( "foo", paramList ); - assertEquals( look, f3 ); - } - - /** - * - * @throws Exception - * test basic function resolution - * - * void f( int i ); - * void f( char c = 'c' ); - * - * f( 1 ); //calls f( int ); - * f( 'b' ); //calls f( char ); - * f(); //calls f( char ); - */ - public void testFunctionResolution() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IParameterizedSymbol f1 = table.newParameterizedSymbol("f"); - f1.setType( TypeInfo.t_function ); - f1.addParameter( TypeInfo.t_int, 0, null, false ); - compUnit.addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol("f"); - f2.setType( TypeInfo.t_function ); - f2.addParameter( TypeInfo.t_char, 0, null, true ); - compUnit.addSymbol( f2 ); - - LinkedList paramList = new LinkedList(); - TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); - paramList.add( p1 ); - - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f1 ); - - paramList.clear(); - TypeInfo p2 = new TypeInfo( TypeInfo.t_char, 0, null ); - paramList.add( p2 ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f2 ); - - paramList.clear(); - TypeInfo p3 = new TypeInfo( TypeInfo.t_bool, 0, null ); - paramList.add( p3 ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f1 ); - - look = compUnit.unqualifiedFunctionLookup( "f", null ); - assertEquals( look, f2 ); - } - - /** - * - * @throws Exception - * - * class A { }; - * class B : public A {}; - * class C : public B {}; - * - * void f ( A * ); - * void f ( B * ); - * - * A* a = new A(); - * C* c = new C(); - * - * f( a ); //calls f( A * ); - * f( c ); //calls f( B * ); - */ - public void testFunctionResolution_PointersAndBaseClasses() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); - A.setType( TypeInfo.t_class ); - compUnit.addSymbol( A ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); - B.setType( TypeInfo.t_class ); - B.addParent( A ); - compUnit.addSymbol( B ); - - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C" ); - C.setType( TypeInfo.t_class ); - C.addParent( B ); - compUnit.addSymbol( C ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); - f1.setType( TypeInfo.t_function ); - f1.addParameter( A, new PtrOp( PtrOp.t_pointer ), false ); - compUnit.addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); - f2.setType( TypeInfo.t_function ); - f2.addParameter( B, new PtrOp( PtrOp.t_pointer ), false ); - compUnit.addSymbol( f2 ); - - ISymbol a = table.newSymbol( "a" ); - a.setType( TypeInfo.t_type ); - a.setTypeSymbol( A ); - a.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); - - ISymbol c = table.newSymbol( "c" ); - c.setType( TypeInfo.t_type ); - c.setTypeSymbol( C ); - c.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); - - LinkedList paramList = new LinkedList(); - TypeInfo p1 = new TypeInfo( TypeInfo.t_type, 0, a ); - paramList.add( p1 ); - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f1 ); - - paramList.clear(); - TypeInfo p2 = new TypeInfo( TypeInfo.t_type, 0, c ); - paramList.add( p2 ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f2 ); - } - - /** - * - * @throws Exception - * - * class A {}; - * typedef B A *; - * - * void f( A * ); - * void f( A ); - * - * A a; - * B b; - * A [] array; - * - * f( a ); //calls f( A ); - * f( &a ); //calls f( A * ); - * f( b ); //calls f( A * ); - * f( *b ); //calls f( A ); - * f( array ); //calls f( A * ); - */ - public void testFunctionResolution_TypedefsAndPointers() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); - A.setType( TypeInfo.t_class ); - compUnit.addSymbol( A ); - - ISymbol B = table.newSymbol( "B" ); - B.setType( TypeInfo.t_type ); - B.setTypeSymbol( A ); - B.getTypeInfo().setBit( true, TypeInfo.isTypedef ); - B.addPtrOperator( new PtrOp( PtrOp.t_pointer, false, false ) ); - compUnit.addSymbol( B ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); - f1.setType( TypeInfo.t_function ); - f1.addParameter( A, new PtrOp( PtrOp.t_pointer ), false ); - compUnit.addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); - f2.setType( TypeInfo.t_function ); - f2.addParameter( A, null, false ); - compUnit.addSymbol( f2 ); - - ISymbol a = table.newSymbol( "a" ); - a.setType( TypeInfo.t_type ); - a.setTypeSymbol( A ); - compUnit.addSymbol( a ); - - ISymbol b = table.newSymbol( "b" ); - b.setType( TypeInfo.t_type ); - b.setTypeSymbol( B ); - compUnit.addSymbol( b ); - - ISymbol array = table.newSymbol( "array" ); - array.setType( TypeInfo.t_type ); - array.setTypeSymbol( A ); - array.addPtrOperator( new PtrOp( PtrOp.t_array, false, false ) ); - - LinkedList paramList = new LinkedList(); - TypeInfo p = new TypeInfo( TypeInfo.t_type, 0, a ); - paramList.add( p ); - - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f2 ); - - p.addOperatorExpression( OperatorExpression.addressof ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f1 ); - - p.setTypeSymbol( b ); - p.getOperatorExpressions().clear(); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f1 ); - - p.addOperatorExpression( OperatorExpression.indirection ); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f2 ); - - p.setTypeSymbol( array ); - p.getOperatorExpressions().clear(); - look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f1 ); - - } - - /** - * - * @throws Exception - * - * class A {}; - * - * class B - * { - * B( A a ){ }; - * }; - * - * void f( B b ){}; - * - * A a; - * f( a ); - */ - public void testUserDefinedConversionSequences() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); - A.setType( TypeInfo.t_class ); - compUnit.addSymbol( A ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); - B.setType( TypeInfo.t_class ); - compUnit.addSymbol( B ); - - IParameterizedSymbol constructor = table.newParameterizedSymbol("B"); - constructor.setType( TypeInfo.t_constructor ); - constructor.addParameter( A, null, false ); - B.addConstructor( constructor ); - - IParameterizedSymbol f = table.newParameterizedSymbol( "f" ); - f.setType( TypeInfo.t_function ); - f.addParameter( B, null, false ); - compUnit.addSymbol( f ); - - ISymbol a = table.newSymbol( "a" ); - a.setType( TypeInfo.t_type ); - a.setTypeSymbol( A ); - compUnit.addSymbol( a ); - - LinkedList paramList = new LinkedList(); - TypeInfo p = new TypeInfo( TypeInfo.t_type, 0, a ); - paramList.add( p ); - - ISymbol look = compUnit.unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f ); - } - - /** - * - * @throws Exception - * - * void f( const int *, short ); - * void f( int *, int ); - * - * int i; - * short s; - * - * void main() { - * f( &i, s ); //ambiguous because &i->int* is better than &i->const int * - * //but s-> short is better than s->int - * f( &i, 1L ); //calls f(int *, int) because &i->int* is better than &i->const int * - * //and 1L->short and 1L->int are indistinguishable - * f( &i, 'c' ); //calls f( int*, int) because &i->int * is better than &i->const int * - * //and c->int is better than c->short - * f( (const)&i, 1L ); //calls f(const int *, short ) because const &i->int* is better than &i->int * - * //and 1L->short and 1L->int are indistinguishable - * } - */ - public void testOverloadRanking() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); - f1.setType( TypeInfo.t_function ); - f1.addParameter( TypeInfo.t_int, 0, new PtrOp( PtrOp.t_pointer, true, false ), false ); - f1.addParameter( TypeInfo.t_int, TypeInfo.isShort, null, false ); - - compUnit.addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); - f2.setType( TypeInfo.t_function ); - f2.addParameter( TypeInfo.t_int, 0, new PtrOp( PtrOp.t_pointer ), false ); - f2.addParameter( TypeInfo.t_int, 0, null, false ); - compUnit.addSymbol( f2 ); - - ISymbol i = table.newSymbol( "i" ); - i.setType( TypeInfo.t_int ); - compUnit.addSymbol( i ); - - ISymbol s = table.newSymbol( "s" ); - s.setType( TypeInfo.t_int ); - s.getTypeInfo().setBit( true, TypeInfo.isShort ); - compUnit.addSymbol( s ); - - IParameterizedSymbol main = table.newParameterizedSymbol( "main" ); - main.setType( TypeInfo.t_function ); - compUnit.addSymbol( main ); - - LinkedList params = new LinkedList(); - TypeInfo p1 = new TypeInfo( TypeInfo.t_type, 0, i ); - p1.addOperatorExpression( OperatorExpression.addressof ); - TypeInfo p2 = new TypeInfo( TypeInfo.t_type, 0, s ); - params.add( p1 ); - params.add( p2 ); - - ISymbol look = null; - - try{ - look = main.unqualifiedFunctionLookup( "f", params ); - assertTrue( false ); - } catch ( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - - params.clear(); - TypeInfo p3 = new TypeInfo( TypeInfo.t_int, TypeInfo.isLong, null ); - params.add( p1 ); - params.add( p3 ); - look = main.unqualifiedFunctionLookup( "f", params ); - assertEquals( look, f2 ); - - params.clear(); - TypeInfo p4 = new TypeInfo( TypeInfo.t_char, 0, null ); - params.add( p1 ); - params.add( p4 ); - look = main.unqualifiedFunctionLookup( "f", params ); - assertEquals( look, f2 ); - - params.clear(); - p1.addPtrOperator( new PtrOp( PtrOp.t_undef, true, false ) ); - //((PtrOp)p1.getPtrOperators().iterator().next()).setConst( true ); - params.add( p1 ); - params.add( p3 ); - look = main.unqualifiedFunctionLookup( "f", params ); - assertEquals( look, f1 ); - - } - - /** - * - * @throws Exception - * - * class B; - * class A { A( B& ); }; - * class B { operator A(); }; - * - * void f(A){} - * - * B b; - * f( b ); //ambiguous because b->A via constructor or conversion - * - * class C { C( B& ); }; - * - * void f(C){} - * - * f( b ); //ambiguous because b->C via constructor and b->a via constructor/conversion - * - * void f(B){} - * - * f( b ); //calls f(B) - */ - - public void testUserDefinedConversionByOperator() throws Exception{ - newTable(); - - IContainerSymbol compUnit = table.getCompilationUnit(); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B" ); - B.setType( TypeInfo.t_class ); - - compUnit.addSymbol( B ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A" ); - A.setType( TypeInfo.t_class ); - compUnit.addSymbol( A ); - - IParameterizedSymbol constructA = table.newParameterizedSymbol( "A" ); - constructA.setType( TypeInfo.t_constructor ); - constructA.addParameter( B, new PtrOp( PtrOp.t_reference ), false ); - A.addConstructor( constructA ); - - IParameterizedSymbol operator = table.newParameterizedSymbol( "operator A" ); - operator.setType( TypeInfo.t_function ); - B.addSymbol( operator ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f" ); - f1.setType( TypeInfo.t_function ); - f1.addParameter( A, null, false ); - compUnit.addSymbol( f1 ); - - ISymbol b = table.newSymbol( "b" ); - b.setType( TypeInfo.t_type ); - b.setTypeSymbol( B ); - - LinkedList params = new LinkedList(); - TypeInfo p1 = new TypeInfo( TypeInfo.t_type, 0, b ); - params.add( p1 ); - - ISymbol look = null; - - try{ - look = compUnit.unqualifiedFunctionLookup( "f", params ); - assertTrue( false ); - } catch( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - - IDerivableContainerSymbol C = table.newDerivableContainerSymbol("C"); - C.setType( TypeInfo.t_class ); - compUnit.addSymbol( C ); - - IParameterizedSymbol constructC = table.newParameterizedSymbol("C"); - constructC.setType( TypeInfo.t_constructor ); - constructC.addParameter( B, new PtrOp( PtrOp.t_reference ), false ); - C.addConstructor( constructC ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f" ); - f2.setType( TypeInfo.t_function ); - f2.addParameter( C, null, false ); - compUnit.addSymbol( f2 ); - - try{ - look = compUnit.unqualifiedFunctionLookup( "f", params ); - assertTrue( false ); - } catch( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f" ); - f3.setType( TypeInfo.t_function ); - f3.addParameter( B, null, false ); - compUnit.addSymbol( f3 ); - - look = compUnit.unqualifiedFunctionLookup( "f", params ); - assertEquals( look, f3 ); - } - - public void testMarkRollback() throws Exception{ - newTable(); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol("A"); - A.setType( TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( A ); - - Mark mark = table.setMark(); - - ISymbol f = table.newSymbol("f"); - A.addSymbol( f ); - - ISymbol look = A.lookup("f"); - assertEquals( look, f ); - - assertTrue( table.rollBack( mark ) ); - - look = A.lookup("f"); - assertEquals( look, null ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol("B"); - B.setType( TypeInfo.t_class ); - - mark = table.setMark(); - table.getCompilationUnit().addSymbol( B ); - Mark mark2 = table.setMark(); - A.addParent( B ); - Mark mark3 = table.setMark(); - - IParameterizedSymbol C = table.newParameterizedSymbol("C"); - C.addParameter( TypeInfo.t_class, 0, null, false ); - - assertEquals( C.getParameterList().size(), 1 ); - table.rollBack( mark3 ); - assertEquals( C.getParameterList().size(), 0 ); - assertEquals( A.getParents().size(), 1 ); - table.rollBack( mark2 ); - assertEquals( A.getParents().size(), 0 ); - - assertFalse( table.commit( mark2 ) ); - assertFalse( table.rollBack( mark2 ) ); - - B.setType( TypeInfo.t_namespace ); - - mark = table.setMark(); - C.addUsingDirective( B ); - assertEquals( C.getUsingDirectives().size(), 1 ); - table.rollBack( mark ); - assertEquals( C.getUsingDirectives().size(), 0 ); - } - - /** - * - * @throws Exception - * - * template < class T > class A : public T {}; - * - * class B - * { - * int i; - * } - * - * A a; - * a.i; //finds B::i; - */ - public void testTemplateParameterAsParent() throws Exception{ - newTable(); - - IParameterizedSymbol template = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol param = table.newSymbol( "T", TypeInfo.t_undef ); - template.addParameter( param ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - template.addSymbol( A ); - A.addParent( param ); - - table.getCompilationUnit().addSymbol( template ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); - B.addSymbol( i ); - - TypeInfo type = new TypeInfo( TypeInfo.t_class, 0, B ); - LinkedList args = new LinkedList(); - args.add( type ); - - TemplateInstance instance = table.getCompilationUnit().templateLookup( "A", args ); - assertEquals( instance.getInstantiatedSymbol(), A ); - - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); - a.setTypeSymbol( instance ); - - table.getCompilationUnit().addSymbol( a ); - - ISymbol look = table.getCompilationUnit().lookup( "a" ); - - assertEquals( look, a ); - - ISymbol symbol = a.getTypeSymbol(); - assertEquals( symbol, instance ); - - look = ((IContainerSymbol)instance.getInstantiatedSymbol()).lookup( "i" ); - assertEquals( look, i ); - } - - /** - * - * @throws Exception - * - * template < class T > class A { T t; } - * class B : public A< int > { } - * - * B b; - * b.t; //finds A::t, will be type int - */ - public void testTemplateInstanceAsParent() throws Exception{ - newTable(); - - IParameterizedSymbol template = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol param = table.newSymbol( "T", TypeInfo.t_undef ); - template.addParameter( param ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); - - ISymbol look = template.lookup( "T" ); - assertEquals( look, param ); - - t.setTypeSymbol( param ); - - template.addSymbol( A ); - A.addSymbol( t ); - table.getCompilationUnit().addSymbol( template ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - - TypeInfo type = new TypeInfo( TypeInfo.t_int, 0 , null ); - LinkedList args = new LinkedList(); - args.add( type ); - - look = table.getCompilationUnit().templateLookup( "A", args ); - assertTrue( look instanceof TemplateInstance ); - - B.addParent( look ); - table.getCompilationUnit().addSymbol( B ); - - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); - b.setTypeSymbol( B ); - table.getCompilationUnit().addSymbol( b ); - - look = table.getCompilationUnit().lookup( "b" ); - assertEquals( look, b ); - - look = ((IDerivableContainerSymbol) b.getTypeSymbol()).lookup( "t" ); - assertTrue( look instanceof TemplateInstance ); - - TemplateInstance instance = (TemplateInstance) look; - assertEquals( instance.getInstantiatedSymbol(), t ); - assertTrue( instance.isType( TypeInfo.t_int ) ); - - } - - /** - * The scope of a template-parameter extends from its point of declaration - * until the end of its template. In particular, a template parameter can be used - * in the declaration of a subsequent template-parameter and its default arguments. - * @throws Exception - * - * template< class T, class U = T > class X - * { - * T t; - * U u; - * }; - * - * X< char > x; - * x.t; - * x.u; - */ - public void testTemplateParameterDefaults() throws Exception{ - newTable(); - - IParameterizedSymbol template = table.newParameterizedSymbol( "X", TypeInfo.t_template ); - - ISymbol paramT = table.newSymbol( "T", TypeInfo.t_undef ); - template.addParameter( paramT ); - - ISymbol look = template.lookup( "T" ); - assertEquals( look, paramT ); - ISymbol paramU = table.newSymbol( "U", TypeInfo.t_undef ); - paramU.getTypeInfo().setDefault( new TypeInfo( TypeInfo.t_type, 0, look ) ); - template.addParameter( paramU ); - - IDerivableContainerSymbol X = table.newDerivableContainerSymbol( "X", TypeInfo.t_class ); - template.addSymbol( X ); - - look = X.lookup( "T" ); - assertEquals( look, paramT ); - ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); - t.setTypeSymbol( look ); - X.addSymbol( t ); - - look = X.lookup( "U" ); - assertEquals( look, paramU ); - ISymbol u = table.newSymbol( "u", TypeInfo.t_type ); - u.setTypeSymbol( look ); - X.addSymbol( u ); - - table.getCompilationUnit().addSymbol( template ); - - TypeInfo type = new TypeInfo( TypeInfo.t_char, 0, null ); - LinkedList args = new LinkedList(); - args.add( type ); - look = table.getCompilationUnit().templateLookup( "X", args ); - assertTrue( look instanceof TemplateInstance ); - - TemplateInstance instance = (TemplateInstance) look; - look = ((IDerivableContainerSymbol) instance.getInstantiatedSymbol()).lookup( "t" ); - - assertTrue( look instanceof TemplateInstance ); - assertTrue( ((TemplateInstance) look).isType( TypeInfo.t_char ) ); - - look = ((IDerivableContainerSymbol) instance.getInstantiatedSymbol()).lookup( "u" ); - assertTrue( look instanceof TemplateInstance ); - assertTrue( ((TemplateInstance) look).isType( TypeInfo.t_char ) ); - } - - /** - * - * @throws Exception - * template < class T > class A { - * T t; - * }; - * class B {}; - * void f( char c ) {} - * void f( A b ) { ... } - * void f( int i ) {} - * - * A a; - * f( a ); //calls f( A ) - * - */ - public void testTemplateParameterAsFunctionArgument() throws Exception{ - newTable(); - - IParameterizedSymbol template = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol paramT = table.newSymbol( "T", TypeInfo.t_undef ); - template.addParameter( paramT ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - template.addSymbol( A ); - - ISymbol t = table.newSymbol( "t", TypeInfo.t_type ); - t.setTypeSymbol( paramT ); - A.addSymbol( t ); - - table.getCompilationUnit().addSymbol( template ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( B ); - - IParameterizedSymbol temp = (IParameterizedSymbol) table.getCompilationUnit().lookup( "A" ); - assertEquals( temp, template ); - - LinkedList args = new LinkedList(); - TypeInfo arg = new TypeInfo( TypeInfo.t_type, 0, B ); - args.add( arg ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.addParameter( TypeInfo.t_char, 0, null, false ); - table.getCompilationUnit().addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f2.addParameter( temp.instantiate( args ), null, false ); - table.getCompilationUnit().addSymbol( f2 ); - - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f3.addParameter( TypeInfo.t_int, 0, null, false ); - table.getCompilationUnit().addSymbol( f3 ); - - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); - a.setTypeSymbol( temp.instantiate( args ) ); - table.getCompilationUnit().addSymbol( a ); - - LinkedList params = new LinkedList(); - params.add( new TypeInfo( TypeInfo.t_type, 0, a ) ); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", params ); - assertEquals( look, f2 ); - - } - - /** - * - * template < class T1, class T2, int I > class A {} //#1 - * template < class T, int I > class A < T, T*, I > {} //#2 - * template < class T1, class T2, int I > class A < T1*, T2, I > {} //#3 - * template < class T > class A < int, T*, 5 > {} //#4 - * template < class T1, class T2, int I > class A < T1, T2*, I > {} //#5 - * - * A a1; //uses #1 - * A a2; //uses #2, T is int, I is 1 - * A a3; //uses #4, T is char - * A a4; //uses #5, T is int, T2 is char, I is1 - * A a5; //ambiguous, matches #3 & #5. - * - * @throws Exception - */ - //TODO - public void incompletetestTemplateSpecialization() throws Exception{ - newTable(); - - IDerivableContainerSymbol cls1 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls2 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls3 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls4 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol cls5 = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - - IParameterizedSymbol template1 = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol T1p1 = table.newSymbol( "T1", TypeInfo.t_undef ); - ISymbol T1p2 = table.newSymbol( "T2", TypeInfo.t_undef ); - ISymbol T1p3 = table.newSymbol( "I", TypeInfo.t_int ); - template1.addParameter( T1p1 ); - template1.addParameter( T1p2 ); - template1.addParameter( T1p3 ); - template1.addSymbol( cls1 ); - table.getCompilationUnit().addSymbol( template1 ); - - IParameterizedSymbol template2 = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol T2p1 = table.newSymbol( "T", TypeInfo.t_undef ); - ISymbol T2p2 = table.newSymbol( "I", TypeInfo.t_int ); - template2.addParameter( T2p1 ); - template2.addParameter( T2p2 ); - ISymbol T2a1 = table.newSymbol( "T", TypeInfo.t_undef ); - ISymbol T2a2 = table.newSymbol( "T", TypeInfo.t_undef ); - T2a2.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - ISymbol T2a3 = table.newSymbol( "I", TypeInfo.t_int ); - template2.addArgument( T2a1 ); - template2.addArgument( T2a2 ); - template2.addArgument( T2a3 ); - template2.addSymbol( cls2 ); - template1.addSpecialization( template2 ); - - IParameterizedSymbol template3 = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol T3p1 = table.newSymbol( "T1", TypeInfo.t_undef ); - ISymbol T3p2 = table.newSymbol( "T2", TypeInfo.t_undef ); - ISymbol T3p3 = table.newSymbol( "I", TypeInfo.t_int ); - template3.addParameter( T3p1 ); - template3.addParameter( T3p2 ); - template3.addParameter( T3p3 ); - ISymbol T3a1 = table.newSymbol( "T1", TypeInfo.t_undef ); - T3a1.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - ISymbol T3a2 = table.newSymbol( "T2", TypeInfo.t_undef ); - ISymbol T3a3 = table.newSymbol( "I", TypeInfo.t_int ); - template3.addArgument( T3a1 ); - template3.addArgument( T3a2 ); - template3.addArgument( T3a3 ); - template3.addSymbol( cls3 ); - template1.addSpecialization( template3 ); - - IParameterizedSymbol template4 = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol T4p1 = table.newSymbol( "T", TypeInfo.t_undef ); - template4.addParameter( T4p1 ); - - ISymbol T4a1 = table.newSymbol( "", TypeInfo.t_int ); - ISymbol T4a2 = table.newSymbol( "T", TypeInfo.t_undef ); - T4a2.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - ISymbol T4a3 = table.newSymbol( "", TypeInfo.t_int ); - T4a3.getTypeInfo().setDefault( new Integer(5) ); - template4.addArgument( T4a1 ); - template4.addArgument( T4a2 ); - template4.addArgument( T4a3 ); - template4.addSymbol( cls4 ); - template1.addSpecialization( template4 ); - - IParameterizedSymbol template5 = table.newParameterizedSymbol( "A", TypeInfo.t_template ); - ISymbol T5p1 = table.newSymbol( "T1", TypeInfo.t_undef ); - ISymbol T5p2 = table.newSymbol( "T2", TypeInfo.t_undef ); - ISymbol T5p3 = table.newSymbol( "I", TypeInfo.t_int ); - template5.addParameter( T5p1 ); - template5.addParameter( T5p2 ); - template5.addParameter( T5p3 ); - ISymbol T5a1 = table.newSymbol( "T1", TypeInfo.t_undef ); - ISymbol T5a2 = table.newSymbol( "T2", TypeInfo.t_undef ); - T5a1.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - ISymbol T5a3 = table.newSymbol( "I", TypeInfo.t_int ); - template5.addArgument( T5a1 ); - template5.addArgument( T5a2 ); - template5.addArgument( T5a3 ); - template5.addSymbol( cls5 ); - template1.addSpecialization( template5 ); - - IParameterizedSymbol a = (IParameterizedSymbol) table.getCompilationUnit().lookup( "A" ); - - LinkedList args = new LinkedList(); - - args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, new Integer(1) ) ); - - TemplateInstance a1 = a.instantiate( args ); - assertEquals( a1.getInstantiatedSymbol(), cls1 ); - - args.clear(); - args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, new Integer(1) ) ); - - TemplateInstance a2 = a.instantiate( args ); - assertEquals( a2.getInstantiatedSymbol(), cls2 ); - - args.clear(); - args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - args.add( new TypeInfo( TypeInfo.t_char, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, new Integer(5) ) ); - TemplateInstance a3 = a.instantiate( args ); - assertEquals( a3.getInstantiatedSymbol(), cls4 ); - - args.clear(); - args.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - args.add( new TypeInfo( TypeInfo.t_char, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, new Integer(1) ) ); - TemplateInstance a4 = a.instantiate( args ); - assertEquals( a4.getInstantiatedSymbol(), cls5 ); - - args.clear(); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, new PtrOp( PtrOp.t_pointer ), false ) ); - args.add( new TypeInfo( TypeInfo.t_int, 0, null, null, new Integer(2) ) ); - - try{ - a.instantiate( args ); - } catch ( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - } - - /** - * class A; - * - * A * a; - * - * class A {}; - * - * @throws Exception - */ - public void testForwardClassDeclaration() throws Exception{ - newTable(); - - ISymbol forwardSymbol = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - forwardSymbol.setIsForwardDeclaration( true ); - - table.getCompilationUnit().addSymbol( forwardSymbol ); - - /*...*/ - - ISymbol lookup = table.getCompilationUnit().lookup( "A" ); - ISymbol otherLookup = table.getCompilationUnit().elaboratedLookup( TypeInfo.t_class, "A" ); - - assertEquals( lookup, otherLookup ); - assertEquals( lookup, forwardSymbol ); - - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); - a.setTypeSymbol( forwardSymbol ); - a.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - - table.getCompilationUnit().addSymbol( a ); - - /*...*/ - - lookup = table.getCompilationUnit().lookup( "A" ); - IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - assertTrue( lookup.isForwardDeclaration() ); - lookup.setTypeSymbol( classA ); - - table.getCompilationUnit().addSymbol( classA ); - - lookup = table.getCompilationUnit().lookup( "a" ); - assertEquals( lookup, a ); - assertEquals( a.getTypeSymbol(), classA ); - - lookup = table.getCompilationUnit().lookup( "A" ); - assertEquals( lookup, classA ); - - lookup = table.getCompilationUnit().elaboratedLookup( TypeInfo.t_class, "A" ); - assertEquals( lookup, classA ); - } - - /** - * class A; - * - * class B { - * static void f( A * ); - * static void f( int ); - * }; - * - * A* a1; - * - * class A {}; - * - * void B::f( A * ) {} - * void B::f( int ) {} - * - * A* a2; - * - * B::f( a1 ); - * B::f( a2 ); - * - * @throws Exception - */ - public void testForwardDeclarationUsedAsFunctionParam() throws Exception{ - newTable(); - - ISymbol forwardSymbol = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - forwardSymbol.setIsForwardDeclaration( true ); - table.getCompilationUnit().addSymbol( forwardSymbol ); - - /*...*/ - - IDerivableContainerSymbol classB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - - IParameterizedSymbol fn1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - ISymbol lookup = table.getCompilationUnit().lookup( "A" ); - assertEquals( lookup, forwardSymbol ); - fn1.addParameter( lookup, new PtrOp( PtrOp.t_pointer ), false ); - fn1.getTypeInfo().setBit( true, TypeInfo.isStatic ); - classB.addSymbol( fn1 ); - - IParameterizedSymbol fn2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - fn2.addParameter( TypeInfo.t_int, 0, null, false ); - fn2.getTypeInfo().setBit( true, TypeInfo.isStatic ); - classB.addSymbol( fn2 ); - - table.getCompilationUnit().addSymbol( classB ); - - /*...*/ - - ISymbol a1 = table.newSymbol( "a1", TypeInfo.t_type ); - lookup = table.getCompilationUnit().lookup( "A" ); - assertEquals( lookup, forwardSymbol ); - a1.setTypeSymbol( lookup ); - a1.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - - table.getCompilationUnit().addSymbol( a1 ); - - /*...*/ - - lookup = table.getCompilationUnit().lookup( "A" ); - IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - assertTrue( lookup.isForwardDeclaration() ); - lookup.setTypeSymbol( classA ); - table.getCompilationUnit().addSymbol( classA ); - - /*..*/ - ISymbol a2 = table.newSymbol( "a2", TypeInfo.t_type ); - lookup = table.getCompilationUnit().lookup( "A" ); - assertEquals( lookup, classA ); - a2.setTypeSymbol( lookup ); - a2.addPtrOperator( new PtrOp( PtrOp.t_pointer ) ); - - table.getCompilationUnit().addSymbol( a2 ); - - /*..*/ - - LinkedList paramList = new LinkedList(); - TypeInfo p1 = new TypeInfo( TypeInfo.t_type, 0, a1 ); - paramList.add( p1 ); - ISymbol look = classB.memberFunctionLookup( "f", paramList ); - assertEquals( look, fn1 ); - - paramList.clear(); - p1 = new TypeInfo( TypeInfo.t_type, 0, a2 ); - paramList.add( p1 ); - look = classB.memberFunctionLookup( "f", paramList ); - assertEquals( look, fn1 ); - } - - public void testConstructors() throws Exception{ - newTable(); - - IDerivableContainerSymbol classA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - - IParameterizedSymbol constructor1 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); - constructor1.addParameter( classA, new PtrOp( PtrOp.t_reference ), false ); - - IParameterizedSymbol constructor2 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); - constructor2.addParameter( TypeInfo.t_int, 0, null, false ); - - IParameterizedSymbol constructor3 = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); - constructor3.addParameter( TypeInfo.t_char, 0, null, false ); - - classA.addConstructor( constructor1 ); - classA.addConstructor( constructor2 ); - classA.addConstructor( constructor3 ); - - assertEquals( classA.getConstructors().size(), 3 ); - - IParameterizedSymbol cloned = (IParameterizedSymbol) constructor2.clone(); - try{ - classA.addConstructor( cloned ); - } catch ( ParserSymbolTableException e ) { - assertEquals( e.reason, ParserSymbolTableException.r_InvalidOverload ); - } - - LinkedList paramList = new LinkedList(); - paramList.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - - ISymbol lookup = classA.lookupConstructor( paramList ); - - assertEquals( lookup, constructor2 ); - } - - /** - * - * @throws Exception - * - * namespace A - * { - * int x; - * } - * namespace B = A; - * - * ++B::x; - */ - public void testNamespaceAlias() throws Exception{ - newTable(); - - IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( NSA ); - - ISymbol x = table.newSymbol( "x", TypeInfo.t_int ); - NSA.addSymbol( x ); - - IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); - NSB.setTypeSymbol( NSA ); //alias B to A - - table.getCompilationUnit().addSymbol( NSB ); - - ISymbol lookup = table.getCompilationUnit().lookup( "B" ); - assertEquals( lookup, NSB ); - - lookup = NSB.lookup( "x" ); - assertEquals( lookup, x ); - } - - /** - * - * @throws Exception - * namespace A - * { - * void f( ); - * } - * namespace B = A; - * - * B::f(); - * - * using namespace B; - * f(); - */ - public void testUsingNamespaceAlias() throws Exception{ - newTable(); - - IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( NSA ); - - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - - NSA.addSymbol( f ); - - IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); - NSB.setTypeSymbol( NSA ); - table.getCompilationUnit().addSymbol( NSB ); - - //look for function that has no parameters - LinkedList paramList = new LinkedList(); - ISymbol look = NSB.qualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f ); - - table.getCompilationUnit().addUsingDirective( NSB ); - - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); - assertEquals( look, f ); - } - - /** - * - * @throws Exception - * - * The general rule is that when you set a TypeInfo's type to be t_type, you - * should set the type symbol to be something. This is to test that the function - * resolution can handle a bad typeInfo that has a null symbol without throwing a NPE - */ - public void testBadParameterInfo() throws Exception{ - newTable(); - - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f.setReturnType( table.newSymbol( "", TypeInfo.t_void ) ); - - IDerivableContainerSymbol a = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( a ); - - f.addParameter( a, null, false ); - - table.getCompilationUnit().addSymbol( f ); - - LinkedList paramList = new LinkedList (); - - TypeInfo param = new TypeInfo( TypeInfo.t_type, 0, null ); - - paramList.add( param ); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); - - assertEquals( look, null ); - - ISymbol intermediate = table.newSymbol( "", TypeInfo.t_type ); - - param.setTypeSymbol( intermediate ); - - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", paramList ); - - assertEquals( look, null ); - } - - /** - * class A { - * A ( C ) {}; - * } a; - * class B : public A {} b; - * class C { - * C ( A ) {}; - * } c; - * - * isTrue ? &a : &b; //expect type = 2nd operand ( A ) - * isTrue ? &a : &c; //expect null, neither converts - * isTrue ? a : c; //expect exception, both convert - * - * @throws Exception - */ - public void testGetConditionalOperand_bug43106() throws Exception{ - newTable(); - - IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - - clsB.addParent( clsA ); - - table.getCompilationUnit().addSymbol( clsA ); - table.getCompilationUnit().addSymbol( clsB ); - - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); - a.setTypeSymbol( clsA ); - - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); - b.setTypeSymbol( clsB ); - - table.getCompilationUnit().addSymbol( a ); - table.getCompilationUnit().addSymbol( b ); - - TypeInfo secondOp = new TypeInfo( TypeInfo.t_type, 0, a ); - secondOp.addOperatorExpression( OperatorExpression.addressof ); - TypeInfo thirdOp = new TypeInfo( TypeInfo.t_type, 0, b ); - thirdOp.addOperatorExpression( OperatorExpression.addressof ); - - TypeInfo returned = ParserSymbolTable.getConditionalOperand( secondOp, thirdOp ); - assertEquals( returned, secondOp ); - - IDerivableContainerSymbol clsC = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( clsC ); - ISymbol c = table.newSymbol( "c", TypeInfo.t_type ); - c.setTypeSymbol( clsC ); - table.getCompilationUnit().addSymbol( c ); - - TypeInfo anotherOp = new TypeInfo( TypeInfo.t_type, 0, c ); - anotherOp.addOperatorExpression( OperatorExpression.addressof ); - - returned = ParserSymbolTable.getConditionalOperand( secondOp, anotherOp ); - assertEquals( returned, null ); - - IParameterizedSymbol constructorA = table.newParameterizedSymbol( "A", TypeInfo.t_constructor ); - constructorA.addParameter( clsC, null, false ); - clsA.addConstructor( constructorA ); - - IParameterizedSymbol constructorC = table.newParameterizedSymbol( "C", TypeInfo.t_constructor ); - constructorC.addParameter( clsA, null, false ); - clsC.addConstructor( constructorC ); - - secondOp.getOperatorExpressions().clear(); - anotherOp.getOperatorExpressions().clear(); - try{ - - returned = ParserSymbolTable.getConditionalOperand( secondOp, anotherOp ); - assertTrue( false ); - } catch ( ParserSymbolTableException e ){ - //good - } - } - - /** - * - * @throws Exception - * class A {}; - * class B : public A {} b; - * class C : private A {} c; - * int f ( A & ); - * - * int i = f ( b ); //calls f( A & ); - * - * int f ( B & ); - * i = f( b ); //now calls f( B& ); - * - * i = f( c ); //exception, A is not an accessible base class - */ - public void testDerivedReference() throws Exception{ - newTable(); - - IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - IDerivableContainerSymbol clsC = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); - - clsB.addParent( clsA ); - clsC.addParent( clsA, false, ASTAccessVisibility.PRIVATE, 0, null ); - - ISymbol b = table.newSymbol("b", TypeInfo.t_type ); - b.setTypeSymbol( clsB ); - - ISymbol c = table.newSymbol("c", TypeInfo.t_type ); - c.setTypeSymbol( clsC ); - - table.getCompilationUnit().addSymbol( clsA ); - table.getCompilationUnit().addSymbol( clsB ); - table.getCompilationUnit().addSymbol( clsC ); - table.getCompilationUnit().addSymbol( b ); - table.getCompilationUnit().addSymbol( c ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.addParameter( clsA, new PtrOp( PtrOp.t_reference ), false ); - table.getCompilationUnit().addSymbol( f1 ); - - LinkedList parameters = new LinkedList(); - TypeInfo param = new TypeInfo( TypeInfo.t_type, 0, b ); - parameters.add( param ); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); - assertEquals( look, f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f2.addParameter( clsB, new PtrOp( PtrOp.t_reference ), false ); - table.getCompilationUnit().addSymbol( f2 ); - - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); - assertEquals( look, f2 ); - - parameters.clear(); - param = new TypeInfo( TypeInfo.t_type, 0, c ); - parameters.add( param ); - try{ - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); - assertTrue( false ); - } catch ( ParserSymbolTableException e ){ - //good - } - } - - /** - * - * @throws Exception - * - * class A { - * private : - * A ( const A & ) {} - * } a; - * - * class B : public A { - * } b; - * - * 1 > 2 ? a : b; //fails, b can't be converted to a without the A( const A & ) copy constructor - * ----------------------- - * class A { - * A ( const A & ) {} - * } a; - * class B : public A {} b; - * - * 1 > 2 ? a : b; //succeeds, b can be converted to a using copy constructor - * - */ - public void testAddCopyConstructor() throws Exception { - newTable(); - - IDerivableContainerSymbol clsA = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( clsA ); - - ISymbol a = table.newSymbol( "a", TypeInfo.t_type ); - a.setTypeSymbol( clsA ); - table.getCompilationUnit().addSymbol( a ); - - IDerivableContainerSymbol clsB = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - clsB.addParent( clsA ); - table.getCompilationUnit().addSymbol( clsB ); - - ISymbol b = table.newSymbol( "b", TypeInfo.t_type ); - b.setTypeSymbol( clsB ); - table.getCompilationUnit().addSymbol( b ); - - TypeInfo secondOp = new TypeInfo( TypeInfo.t_type, 0, a, null, false ); - TypeInfo thirdOp = new TypeInfo( TypeInfo.t_type, 0, b, null, false ); - - TypeInfo returned = ParserSymbolTable.getConditionalOperand( secondOp, thirdOp ); - assertEquals( returned, null ); - - clsA.addCopyConstructor(); - clsB.addCopyConstructor(); - - returned = ParserSymbolTable.getConditionalOperand( secondOp, thirdOp ); - assertEquals( returned, secondOp ); - } - - public void testbug43834() throws Exception{ - newTable(); - - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - table.getCompilationUnit().addSymbol( f ); - - LinkedList parameters = new LinkedList(); - TypeInfo param = new TypeInfo( TypeInfo.t_void, 0, null ); - parameters.add( param ); - - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); - assertEquals( look, f ); - - f.addParameter( TypeInfo.t_void, 0, null, false ); - - parameters.clear(); - - look = table.getCompilationUnit().unqualifiedFunctionLookup( "f", parameters ); - assertEquals( look, f ); - } - - /** - * - * namespace A{ - * void f(); - * } - * namespace B{ - * int f; - * } - * namespace C{ - * using namespace A; - * using namespace B; - * using f; //ambiguous, int f or void f()? - * } - */ - public void testBug43503_AmbiguousUsing() throws Exception{ - newTable(); - IContainerSymbol NSA = table.newContainerSymbol( "A", TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( NSA ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - NSA.addSymbol( f1 ); - - IContainerSymbol NSB = table.newContainerSymbol( "B", TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( NSB ); - - ISymbol f2 = table.newSymbol( "f", TypeInfo.t_int ); - NSB.addSymbol( f2 ); - - IContainerSymbol NSC = table.newContainerSymbol( "C", TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( NSC ); - NSC.addUsingDirective( NSA ); - NSC.addUsingDirective( NSB ); - - try{ - NSC.addUsingDeclaration( "f" ); - assertTrue( false ); - } catch ( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_Ambiguous ); - } - } - - /** - * void f( void ); - * void f( int ); - * - * void * pF = &f; //lookup without function parameters, should be ambiguous - * @throws Exception - */ - public void testBug43503_UnableToResolveFunction() throws Exception{ - newTable(); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f2.addParameter( TypeInfo.t_int, 0, null, false ); - - table.getCompilationUnit().addSymbol( f1 ); - table.getCompilationUnit().addSymbol( f2 ); - - try{ - table.getCompilationUnit().lookup( "f" ); - assertTrue( false ); - } catch( ParserSymbolTableException e ){ - assertEquals( e.reason, ParserSymbolTableException.r_UnableToResolveFunction ); - } - - } - - /** - * int initialize(); - * int initialize(){ - * return 3; - * } - * - * int i = initialize(); - * - * @throws Exception - */ - public void testBug44510() throws Exception{ - newTable(); - - IParameterizedSymbol init1 = table.newParameterizedSymbol( "initialize", TypeInfo.t_function ); - - table.getCompilationUnit().addSymbol( init1 ); - - IParameterizedSymbol init2 = table.newParameterizedSymbol( "initialize", TypeInfo.t_function ); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "initialize", new LinkedList() ); - assertEquals( look, init1 ); - - init1.getTypeInfo().setIsForwardDeclaration( true ); - init1.setTypeSymbol( init2 ); - - table.getCompilationUnit().addSymbol( init2 ); - - look = table.getCompilationUnit().unqualifiedFunctionLookup( "initialize", new LinkedList() ); - - assertEquals( look, init2 ); - } - - /** - * class A { - * void f( int ) {} - * void f( ) {} - * }; - * class B : public A { - * void f( char ) { } - * } b; - * - * b.f( 1 ); //calls B::f - * b.f(); //error - * @throws Exception - */ - public void testBug46882() throws Exception{ - newTable(); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - - table.getCompilationUnit().addSymbol( A ); - - IParameterizedSymbol f1 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f1.addParameter( TypeInfo.t_int, 0, null, false ); - A.addSymbol( f1 ); - - IParameterizedSymbol f2 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - A.addSymbol( f2 ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - B.addParent( A ); - - table.getCompilationUnit().addSymbol( B ); - - IParameterizedSymbol f3 = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - f3.addParameter( TypeInfo.t_char, 0, null, false ); - B.addSymbol( f3 ); - - List params = new LinkedList(); - params.add( new TypeInfo( TypeInfo.t_int, 0, null ) ); - - ISymbol look = B.qualifiedFunctionLookup( "f", params ); - assertEquals( look, f3 ); - - params.clear(); - look = B.qualifiedFunctionLookup( "f", params ); - assertEquals( look, null ); - } - - /** - * int aVar; - * void foo( ) { - * int anotherVar; - * a(CTRL+SPACE) - * } - */ - public void testPrefixLookup_Unqualified() throws Exception { - newTable(); - - ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); - table.getCompilationUnit().addSymbol( aVar ); - - IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); - table.getCompilationUnit().addSymbol( foo ); - - ISymbol anotherVar = table.newSymbol( "anotherVar", TypeInfo.t_int ); - foo.addSymbol( anotherVar ); - - List results = foo.prefixLookup( null, "a", false ); - assertTrue( results != null ); - assertEquals( results.size(), 2 ); - - assertTrue( results.contains( aVar ) ); - assertTrue( results.contains( anotherVar ) ); - } - - /** - * int aVar; //not a member of D, not reported - * - * class D{ - * int aField; - * void aMethod(); - * }; - * - * D d; - * d.a(CTRL+SPACE) - */ - public void testPrefixLookup_Qualified() throws Exception { - newTable(); - - ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); - table.getCompilationUnit().addSymbol( aVar ); - - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( D ); - - ISymbol aField = table.newSymbol( "aField", TypeInfo.t_int ); - IParameterizedSymbol aMethod = table.newParameterizedSymbol( "aMethod", TypeInfo.t_function ); - - D.addSymbol( aField ); - D.addSymbol( aMethod ); - - List results = D.prefixLookup( null, "a", true ); - - assertTrue( results != null ); - assertEquals( results.size(), 2 ); - - assertTrue( !results.contains( aVar ) ); - assertTrue( results.contains( aField ) ); - assertTrue( results.contains( aMethod ) ); - } - - /** - * class A { - * int aVar - * int anotherVar; //hidden, not reported - * void af (); //hidden, not reported - * }; - * - * class B : public A { - * int anotherVar; - * void af( char ); - * } b; - * - * b.a(CTRL+SPACE) - * @throws Exception - */ - public void testPrefixLookup_Inheritance() throws Exception { - newTable(); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( A ); - - ISymbol aVar = table.newSymbol( "aVar", TypeInfo.t_int ); - ISymbol anotherVar1 = table.newSymbol( "anotherVar", TypeInfo.t_int ); - A.addSymbol( aVar ); - A.addSymbol( anotherVar1 ); - - IParameterizedSymbol af1 = table.newParameterizedSymbol( "af", TypeInfo.t_function ); - A.addSymbol( af1 ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - B.addParent( A ); - - table.getCompilationUnit().addSymbol( B ); - - ISymbol anotherVar2 = table.newSymbol( "anotherVar", TypeInfo.t_int ); - B.addSymbol( anotherVar2 ); - - IParameterizedSymbol af2 = table.newParameterizedSymbol( "af", TypeInfo.t_function ); - af2.addParameter( TypeInfo.t_char, 0, null, false ); - B.addSymbol( af2 ); - - - List results = B.prefixLookup( null, "a", true ); - - assertTrue( results != null ); - assertEquals( results.size(), 3 ); - assertTrue( ! results.contains( anotherVar1 ) ); - assertTrue( ! results.contains( af1 ) ); - assertTrue( results.contains( aVar ) ); - assertTrue( results.contains( anotherVar2 ) ); - assertTrue( results.contains( af2 ) ); - } - - /** - * int aa; - * namespace { - * namespace U { - * int a; - * } - * namespace V{ - * int a; - * } - * namespace W{ - * int a; - * } - * - * void f(){ - * using namespace U; - * using namespace V; - * using namespace W; - * a(CTRL+SPACE) - * } - * } - * - * @throws Exception - */ - public void testPrefixLookup_Ambiguities() throws Exception{ - newTable(); - - ISymbol aa = table.newSymbol( "aa", TypeInfo.t_int ); - table.getCompilationUnit().addSymbol( aa ); - - IContainerSymbol ns = table.newContainerSymbol( "", TypeInfo.t_namespace ); - table.getCompilationUnit().addSymbol( ns ); - - IContainerSymbol U = table.newContainerSymbol( "U", TypeInfo.t_namespace ); - ns.addSymbol( U ); - ISymbol a1 = table.newSymbol( "a", TypeInfo.t_int ); - U.addSymbol( a1 ); - - IContainerSymbol V = table.newContainerSymbol( "V", TypeInfo.t_namespace ); - ns.addSymbol( V ); - ISymbol a2 = table.newSymbol( "a", TypeInfo.t_int ); - V.addSymbol( a2 ); - - IContainerSymbol W = table.newContainerSymbol( "W", TypeInfo.t_namespace ); - ns.addSymbol( W ); - ISymbol a3 = table.newSymbol( "a", TypeInfo.t_int ); - W.addSymbol( a3 ); - - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - ns.addSymbol( f ); - - f.addUsingDirective( U ); - f.addUsingDirective( V ); - f.addUsingDirective( W ); - - List results = f.prefixLookup( null, "a", false ); - - assertTrue( results != null ); - assertEquals( results.size(), 1 ); - assertTrue( results.contains( aa ) ); - } - - /** - * int i; - * class A { - * void g(){ - * A a; - * a.i++; //fail qualified lookup, no i in A - * i++; //success unqualified lookup - * } - * }; - * - * @throws Exception - */ - public void testQualifiedUnqualifiedLookup() throws Exception{ - newTable(); - - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); - table.getCompilationUnit().addSymbol( i ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( A ); - - IParameterizedSymbol g = table.newParameterizedSymbol( "g", TypeInfo.t_function ); - A.addSymbol( g ); - - assertEquals( null, A.qualifiedLookup( "i" ) ); - assertEquals( i, g.lookup( "i" ) ); - } - - /** - * class D { }; - * class A { - * public: static int i; - * private: static int j; - * friend class D; - * }; - * class B : private A {}; - * class C : public B, public A {}; - * - * - * @throws Exception - */ - public void testVisibilityDetermination() throws Exception{ - newTable(); - - IDerivableContainerSymbol D = table.newDerivableContainerSymbol( "D", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( D ); - - IDerivableContainerSymbol A = table.newDerivableContainerSymbol( "A", TypeInfo.t_class ); - ISymbol i = table.newSymbol( "i", TypeInfo.t_int ); - ISymbol j = table.newSymbol( "j", TypeInfo.t_int ); - - table.getCompilationUnit().addSymbol( A ); - - ISymbol friend = A.lookupForFriendship( "D" ); - assertEquals( friend, D ); - A.addFriend( friend ); - - A.addSymbol( i ); - A.addSymbol( j ); - - IASTCompilationUnit compUnit = new ASTCompilationUnit(table.getCompilationUnit() ); - ISymbolASTExtension cuExtension = new StandardSymbolExtension( table.getCompilationUnit(), (ASTSymbol) compUnit ); - table.getCompilationUnit().setASTExtension( cuExtension ); - - IASTClassSpecifier clsSpec = new ASTClassSpecifier( A, ASTClassKind.CLASS, ClassNameType.IDENTIFIER, ASTAccessVisibility.PUBLIC, 0, 0, 0, new ArrayList( ) ); - ISymbolASTExtension clsExtension = new StandardSymbolExtension( A, (ASTSymbol) clsSpec ); - A.setASTExtension( clsExtension ); - - IASTField field = new ASTField(i, null, null, null, 0, 0, 0, new ArrayList(), false, null, ASTAccessVisibility.PUBLIC ); - ISymbolASTExtension extension = new StandardSymbolExtension( i, (ASTSymbol) field ); - i.setASTExtension( extension ); - - field = new ASTField(i, null, null, null, 0, 0, 0, new ArrayList(), false, null, ASTAccessVisibility.PRIVATE ); - extension = new StandardSymbolExtension( j, (ASTSymbol) field ); - j.setASTExtension( extension ); - - IDerivableContainerSymbol B = table.newDerivableContainerSymbol( "B", TypeInfo.t_class ); - B.addParent( A, false, ASTAccessVisibility.PRIVATE, 0, null ); - table.getCompilationUnit().addSymbol( B ); - - IDerivableContainerSymbol C = table.newDerivableContainerSymbol( "C", TypeInfo.t_class ); - C.addParent( B ); - C.addParent( A ); - table.getCompilationUnit().addSymbol( C ); - - assertTrue( table.getCompilationUnit().isVisible( i, A ) ); - assertFalse( table.getCompilationUnit().isVisible( i, B ) ); - assertTrue( table.getCompilationUnit().isVisible(i, C ) ); - assertTrue( D.isVisible( j, A ) ); - assertFalse( D.isVisible( j, B ) ); - } - - /** - * struct a1{}; - * void aFoo() {} - * int aa; - * class A2{ - * struct a3 {}; - * int a3; - * void aF(); - * void f() { - * int aLocal; - * A(CTRL+SPACE) - * }; - * }; - * @throws Exception - */ - public void testPrefixFiltering() throws Exception{ - newTable(); - IDerivableContainerSymbol a1 = table.newDerivableContainerSymbol( "a1", TypeInfo.t_struct ); - table.getCompilationUnit().addSymbol( a1 ); - - IParameterizedSymbol aFoo = table.newParameterizedSymbol( "aFoo", TypeInfo.t_function ); - table.getCompilationUnit().addSymbol( aFoo ); - - ISymbol aa = table.newSymbol( "aa", TypeInfo.t_int ); - table.getCompilationUnit().addSymbol( aa ); - - IDerivableContainerSymbol A2 = table.newDerivableContainerSymbol( "A2", TypeInfo.t_class ); - table.getCompilationUnit().addSymbol( A2 ); - - IDerivableContainerSymbol a3 = table.newDerivableContainerSymbol( "a3", TypeInfo.t_struct ); - A2.addSymbol( a3 ); - - ISymbol a3_int = table.newSymbol( "a3", TypeInfo.t_int ); - A2.addSymbol( a3_int ); - - IParameterizedSymbol aF = table.newParameterizedSymbol( "aF", TypeInfo.t_function ); - A2.addSymbol( aF ); - - IParameterizedSymbol f = table.newParameterizedSymbol( "f", TypeInfo.t_function ); - A2.addSymbol( f ); - - ISymbol aLocal = table.newSymbol( "aLocal", TypeInfo.t_int ); - f.addSymbol( aLocal ); - - List results = f.prefixLookup( new TypeFilter( LookupKind.STRUCTURES ), "A", false ); - - assertEquals( results.size(), 3 ); - - assertTrue( results.contains( a1 ) ); - assertTrue( results.contains( A2 ) ); - assertTrue( results.contains( a3 ) ); - - results = f.prefixLookup( null, "a", false ); - assertEquals( results.size(), 7 ); - assertTrue( results.contains( aF ) ); - assertTrue( results.contains( A2 ) ); - assertTrue( results.contains( a3_int ) ); - assertTrue( results.contains( a1 ) ); - assertTrue( results.contains( aFoo ) ); - assertTrue( results.contains( aa ) ); - assertTrue( results.contains( aLocal ) ); - - results = f.prefixLookup( new TypeFilter( LookupKind.FUNCTIONS ), "a", false ); - assertEquals( results.size(), 1 ); - assertTrue( results.contains( aFoo ) ); - - results = f.prefixLookup( new TypeFilter( LookupKind.METHODS ), "a", false ); - assertEquals( results.size(), 1 ); - assertTrue( results.contains( aF ) ); - - results = f.prefixLookup( new TypeFilter( LookupKind.LOCAL_VARIABLES ), "a", false ); - assertEquals( results.size(), 1 ); - assertTrue( results.contains( aLocal ) ); - - results = f.prefixLookup( new TypeFilter( LookupKind.VARIABLES ), "a", false ); - assertEquals( results.size(), 1 ); - assertTrue( results.contains( aa ) ); - - results = f.prefixLookup( new TypeFilter( LookupKind.FIELDS), "a", false ); - assertEquals( results.size(), 1 ); - assertTrue( results.contains( a3_int ) ); - }; - - /** - * void foo( ... ){ } - * - * foo( 1 ); - * - * @throws Exception - */ - public void testBug43110_Ellipses() throws Exception{ - newTable(); - - IParameterizedSymbol foo = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); - foo.setHasVariableArgs( true ); - - table.getCompilationUnit().addSymbol( foo ); - - List params = new LinkedList(); - - TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); - params.add( p1 ); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); - - assertEquals( foo, look ); - } - - /** - * void foo( ... ) {}; //#1 - * void foo( int i ) {}; //#2 - * - * foo( 1 ); // calls foo #2 - * @throws Exception - */ - public void testBug43110_EllipsesRanking() throws Exception{ - newTable(); - - IParameterizedSymbol foo1 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); - foo1.setHasVariableArgs( true ); - - table.getCompilationUnit().addSymbol( foo1 ); - - IParameterizedSymbol foo2 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); - foo2.addParameter( TypeInfo.t_int, 0, null, false ); - table.getCompilationUnit().addSymbol( foo2 ); - - List params = new LinkedList(); - - TypeInfo p1 = new TypeInfo( TypeInfo.t_int, 0, null ); - params.add( p1 ); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); - - assertEquals( foo2, look ); - } - - /** - * void foo( int i = 0 ) {}; //#1 - * void foo( ... ) {}; //#2 - * - * foo(); //calls #1 - * @throws Exception - */ - public void testBug43110_ElipsesRanking_2() throws Exception{ - newTable(); - - IParameterizedSymbol foo1 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); - foo1.addParameter( TypeInfo.t_int, 0, null, true ); - table.getCompilationUnit().addSymbol( foo1 ); - - IParameterizedSymbol foo2 = table.newParameterizedSymbol( "foo", TypeInfo.t_function ); - foo2.setHasVariableArgs( true ); - table.getCompilationUnit().addSymbol( foo2 ); - - List params = new LinkedList(); - - ISymbol look = table.getCompilationUnit().unqualifiedFunctionLookup( "foo", params ); - - assertEquals( foo1, look ); - } -} - diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java deleted file mode 100644 index 611d167b975..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.tests.CModelElementsTests; - -/** - * @author jcamelon - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ParserTestSuite extends TestCase { - public static Test suite() { - TestSuite suite= new TestSuite(ParserTestSuite.class.getName()); - suite.addTestSuite(BranchTrackerTest.class); - suite.addTestSuite(ScannerTestCase.class); - suite.addTestSuite(ExprEvalTest.class); - suite.addTestSuite(QuickParseASTTests.class); - suite.addTestSuite(ParserSymbolTableTest.class); - suite.addTestSuite(CModelElementsTests.class); - suite.addTestSuite(ContextualParseTest.class); -// suite.addTestSuite(MacroTests.class); - suite.addTestSuite( PreprocessorTest.class ); - suite.addTestSuite( PreprocessorConditionalTest.class ); - suite.addTestSuite( QuickParseASTQualifiedNameTest.class); - suite.addTestSuite( CompleteParseASTTest.class ); - suite.addTestSuite( CompleteParseASTExpressionTest.class ); - return suite; - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java deleted file mode 100644 index e625ec00f2c..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PerformanceTests.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; - -import org.eclipse.cdt.core.parser.tests.BaseASTTest; - -/** - * @author vmozgin - * - */ -public class PerformanceTests extends BaseASTTest -{ - public PerformanceTests(String name) - { - super(name); - } - - public void testBug39523() throws Exception - { - Writer code = new StringWriter(); - try { - code.write("#define e0 \"a\"\n"); - code.write("#define e1 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0\n"); - code.write("#define e2 e1 e1 e1 e1 e1 e1 e1 e1 e1 e1\n"); - code.write("#define e3 e2 e2 e2 e2 e2 e2 e2 e2 e2 e2\n"); - code.write("#define e4 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3\n"); - code.write("#define e5 e4 e4 e4 e4 e4 e4 e4 e4 e4 e4\n"); - code.write("void foo() { (void)(e5); }\n"); - } catch( IOException ioe ){} - - parse(code.toString()); - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java deleted file mode 100644 index f357873703a..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerException; -import org.eclipse.cdt.core.parser.ScannerInfo; - -/** - * @author jcamelon - * - */ -public class PreprocessorConditionalTest extends BaseScannerTest -{ - - private ISourceElementRequestor nullSourceElementRequestor = new NullSourceElementRequestor(); - - - protected void initializeScanner(String input, Map definitions ) throws Exception - { - scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo( definitions, null), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, nullSourceElementRequestor, null ); - } - - - protected void evaluateConditionalsPositive( String conditional, Map definitions ) throws Exception - { - - StringBuffer buff = new StringBuffer(); - buff.append( "#if " ); - buff.append( conditional ); - buff.append( "\n int x;\n#else\n#error NEVER\n#endif\n"); - initializeScanner( buff.toString(), definitions ); - evaluate(); - } - - protected void evaluateConditionalsNegative( String conditional, Map definitions )throws Exception - { - - StringBuffer buff = new StringBuffer(); - buff.append( "#if " ); - buff.append( conditional ); - buff.append( "\n#error NEVER\n#else\n int x;\n#endif\n"); - initializeScanner( buff.toString(), definitions ); - evaluate(); - } - - /** - * - */ - private void evaluate() - { - try - { - validateToken( IToken.t_int ); - validateIdentifier( "x"); - validateToken( IToken.tSEMI ); - scanner.nextToken(); - fail( "Should have hit EOF by now"); - } - catch( ScannerException se ) - { - fail( "Got #error, should not have gotten that."); - } - catch( OffsetLimitReachedException olre ) - { - fail( "Should never have reached OffsetLimitReachedException"); - } - catch( EndOfFileException eof ) - { - // expected - } - } - - - /** - * @param x - */ - public PreprocessorConditionalTest(String x) - { - super(x); - } - - public void testConditionals()throws Exception - { - Map definitions = new HashMap(); - definitions.put( "DEFED", "" ); - definitions.put( "VALUE", "30 "); - - evaluateConditionalsPositive( "defined( DEFED )", definitions ); - evaluateConditionalsNegative( "defined( NOTDEFED )", definitions ); - - evaluateConditionalsNegative( "! defined( DEFED )", definitions ); - evaluateConditionalsPositive( "! defined( NOTDEFED )", definitions ); - - evaluateConditionalsPositive( "defined( VALUE ) && VALUE == 30", definitions ); - evaluateConditionalsNegative( "defined( VALUE ) && VALUE == 40", definitions ); - - - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java deleted file mode 100644 index b8be417bb46..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringReader; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.parser.IPreprocessor; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ScannerInfo; - -/** - * @author jcamelon - * - */ -public class PreprocessorTest extends TestCase { - - public static class Callback extends NullSourceElementRequestor - { - private List enteredInc = new ArrayList(), exitedInc = new ArrayList(); - - public boolean asExpected( int balance ) - { - return( ( enteredInc.size() - exitedInc.size() ) == balance ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) { - enteredInc.add( inclusion ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion(IASTInclusion inclusion) { - exitedInc.add( inclusion ); - } - } - - public PreprocessorTest( String name ) - { - super( name ); - } - - public void testSimpleExample() - { - Callback c = new Callback(); - IPreprocessor p = setupPreprocessor( "#include ", - null, // NOTE -- to demonstrate simple example, this should be set up with the info from the - // build properties - null, c ); - p.process(); - c.asExpected(0); - } - - public IPreprocessor setupPreprocessor( String text, List includePaths, Map defns, ISourceElementRequestor rq ) - { - IPreprocessor p = ParserFactory.createPreprocessor( new StringReader( text ), "test", new ScannerInfo( defns, - includePaths == null ? null : (String [])includePaths.toArray()), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, rq, null ); - return p; - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java deleted file mode 100644 index 3263c72e394..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTQualifiedNameTest.java +++ /dev/null @@ -1,114 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; - -/** - * @author jcamelon - * - */ -public class QuickParseASTQualifiedNameTest extends BaseASTTest -{ - /** - * @param a - */ - public QuickParseASTQualifiedNameTest(String a) - { - super(a); - } - - public void testNamespace() throws Exception - { - IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)assertSoleDeclaration("namespace A { namespace B { int x; } }"); - assertQualifiedName( namespace.getFullyQualifiedName(), new String [] {"A" } ); - IASTNamespaceDefinition namespace2 = (IASTNamespaceDefinition)namespace.getDeclarations().next(); - assertQualifiedName( namespace2.getFullyQualifiedName(), new String [] { "A", "B" } ); - - } - - public void testClass() throws Exception - { - IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)assertSoleDeclaration( "class A { class B { int a; }; };"); - IASTClassSpecifier classSpec = (IASTClassSpecifier)abs.getTypeSpecifier(); - assertQualifiedName( classSpec.getFullyQualifiedName(), new String [] { "A" } ); - Iterator subDecls = classSpec.getDeclarations(); - abs = (IASTAbstractTypeSpecifierDeclaration)subDecls.next(); - assertFalse( subDecls.hasNext() ); - classSpec = (IASTClassSpecifier)abs.getTypeSpecifier(); - assertQualifiedName( classSpec.getFullyQualifiedName(), new String [] { "A", "B" } ); - } - - public void testEnum() throws Exception - { - Iterator declarations = parse( "class A { enum E1 { enumerator = 1 }; };\n namespace N { enum E2 { enumerator = 4 }; }\n" ).getDeclarations(); - IASTAbstractTypeSpecifierDeclaration abs = (IASTAbstractTypeSpecifierDeclaration)declarations.next(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)abs.getTypeSpecifier(); - IASTEnumerationSpecifier enumSpec = (IASTEnumerationSpecifier)(((IASTAbstractTypeSpecifierDeclaration)classSpec.getDeclarations().next()).getTypeSpecifier()); - assertQualifiedName( enumSpec.getFullyQualifiedName(), new String[] { "A", "E1" } ); - IASTNamespaceDefinition nms = (IASTNamespaceDefinition)declarations.next(); - enumSpec = (IASTEnumerationSpecifier)(((IASTAbstractTypeSpecifierDeclaration)nms.getDeclarations().next()).getTypeSpecifier()); - assertQualifiedName( enumSpec.getFullyQualifiedName(), new String[] { "N", "E2" } ); - assertFalse( declarations.hasNext() ); - } - - public void testVariable() throws Exception - { - IASTNamespaceDefinition topNMS = (IASTNamespaceDefinition)assertSoleDeclaration("namespace A { int x; namespace B { int y; } }"); - Iterator level1 = topNMS.getDeclarations(); - IASTVariable var = (IASTVariable)level1.next(); - assertQualifiedName( var.getFullyQualifiedName(), new String[] {"A","x"}); - Iterator level2 = ((IASTNamespaceDefinition)level1.next()).getDeclarations(); - assertFalse( level1.hasNext()); - var = (IASTVariable)level2.next(); - assertQualifiedName( var.getFullyQualifiedName(), new String[] {"A","B","y"}); - } - - public void testTypedef() throws Exception - { - IASTNamespaceDefinition topNMS = (IASTNamespaceDefinition) - assertSoleDeclaration("namespace FLEA { typedef int GODS_INT; class ANTHONY { typedef ANTHONY * tonyPointer; }; }"); - Iterator level1 = topNMS.getDeclarations(); - assertQualifiedName( ((IASTTypedefDeclaration)level1.next()).getFullyQualifiedName(), new String [] { "FLEA", "GODS_INT" } ); - assertQualifiedName( ((IASTTypedefDeclaration)((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)level1.next()).getTypeSpecifier()).getDeclarations().next()).getFullyQualifiedName(), new String [] { "FLEA", "ANTHONY", "tonyPointer" } ); - } - - - public void testMembers() throws Exception - { - IASTNamespaceDefinition topNMS = - (IASTNamespaceDefinition)assertSoleDeclaration( "namespace John { class David { int Shannon; void Camelon(); }; } "); - Iterator members = - ((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)topNMS.getDeclarations().next()).getTypeSpecifier()).getDeclarations(); - assertQualifiedName( ((IASTField)members.next()).getFullyQualifiedName(), new String[] { "John", "David", "Shannon" } ); - assertQualifiedName( ((IASTMethod)members.next()).getFullyQualifiedName(), new String[] { "John", "David", "Camelon" } ); - } - - public void testFunction() throws Exception - { - IASTNamespaceDefinition topNMS = - (IASTNamespaceDefinition)assertSoleDeclaration( "namespace Bogdan { void Wears(); namespace Fancy { int Pants(); } }" ); - Iterator members = topNMS.getDeclarations(); - assertQualifiedName( ((IASTFunction)members.next()).getFullyQualifiedName(), new String[] { "Bogdan", "Wears" } ); - assertQualifiedName( ((IASTFunction)((IASTNamespaceDefinition)members.next()).getDeclarations().next()).getFullyQualifiedName(), new String[] { "Bogdan", "Fancy", "Pants" } ); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java deleted file mode 100644 index 04fa8c01631..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java +++ /dev/null @@ -1,2033 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.tests; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ParserException; -/** - * @author jcamelon - * - */ -public class QuickParseASTTests extends BaseASTTest -{ - public QuickParseASTTests(String a) - { - super(a); - } - /** - * Test code: int x = 5; - * Purpose: to test the simple decaration in it's simplest form. - */ - public void testIntGlobal() throws Exception - { - // Parse and get the translation Unit - IASTCompilationUnit translationUnit = parse("int x = 5;"); - Iterator i = translationUnit.getDeclarations(); - assertTrue(i.hasNext()); - IASTVariable var = (IASTVariable)i.next(); - assertTrue( - var.getAbstractDeclaration().getTypeSpecifier() - instanceof IASTSimpleTypeSpecifier); - assertTrue( - ((IASTSimpleTypeSpecifier)var - .getAbstractDeclaration() - .getTypeSpecifier()) - .getType() - == IASTSimpleTypeSpecifier.Type.INT); - assertEquals(var.getName(), "x"); - assertNotNull(var.getInitializerClause()); - assertNotNull(var.getInitializerClause().getAssigmentExpression()); - assertFalse(i.hasNext()); - } - /** - * Test code: class A { } a; - * Purpose: tests the use of a classSpecifier in - */ - public void testEmptyClass() throws Exception - { - // Parse and get the translation unit - Writer code = new StringWriter(); - code.write("class A { } a;"); - IASTCompilationUnit translationUnit = parse(code.toString()); - Iterator i = translationUnit.getDeclarations(); - assertTrue(i.hasNext()); - IASTVariable var = (IASTVariable)i.next(); - assertEquals(var.getName(), "a"); - assertTrue( - var.getAbstractDeclaration().getTypeSpecifier() - instanceof IASTClassSpecifier); - IASTClassSpecifier classSpec = - (IASTClassSpecifier)var.getAbstractDeclaration().getTypeSpecifier(); - assertEquals(classSpec.getName(), "A"); - assertFalse(classSpec.getDeclarations().hasNext()); - assertFalse(i.hasNext()); - } - /** - * Test code: class A { public: int x; }; - * Purpose: tests a declaration in a class scope. - */ - public void testSimpleClassMember() throws Exception - { - // Parse and get the translaton unit - Writer code = new StringWriter(); - code.write("class A { public: int x; };"); - IASTCompilationUnit cu = parse(code.toString()); - Iterator i = cu.getDeclarations(); - assertTrue(i.hasNext()); - IASTAbstractTypeSpecifierDeclaration declaration = - (IASTAbstractTypeSpecifierDeclaration)i.next(); - assertFalse(i.hasNext()); - assertTrue( - declaration.getTypeSpecifier() instanceof IASTClassSpecifier); - assertTrue( - ((IASTClassSpecifier)declaration.getTypeSpecifier()).getClassKind() - == ASTClassKind.CLASS); - Iterator j = - ((IASTClassSpecifier)declaration.getTypeSpecifier()) - .getDeclarations(); - assertTrue(j.hasNext()); - IASTField field = (IASTField)j.next(); - assertFalse(j.hasNext()); - assertTrue(field.getName().equals("x")); - assertTrue( - field.getAbstractDeclaration().getTypeSpecifier() - instanceof IASTSimpleTypeSpecifier); - assertTrue( - ((IASTSimpleTypeSpecifier)field - .getAbstractDeclaration() - .getTypeSpecifier()) - .getType() - == IASTSimpleTypeSpecifier.Type.INT); - } - public void testNamespaceDefinition() throws Exception - { - for (int i = 0; i < 2; ++i) - { - IASTCompilationUnit translationUnit; - if (i == 0) - translationUnit = parse("namespace KingJohn { int x; }"); - else - translationUnit = parse("namespace { int x; }"); - Iterator iter = translationUnit.getDeclarations(); - assertTrue(iter.hasNext()); - IASTNamespaceDefinition namespaceDefinition = - (IASTNamespaceDefinition)iter.next(); - assertFalse(iter.hasNext()); - if (i == 0) - assertTrue(namespaceDefinition.getName().equals("KingJohn")); - else - assertEquals(namespaceDefinition.getName(), ""); - Iterator j = namespaceDefinition.getDeclarations(); - assertTrue(j.hasNext()); - IASTVariable var = (IASTVariable)j.next(); - assertFalse(j.hasNext()); - assertTrue( - var.getAbstractDeclaration().getTypeSpecifier() - instanceof IASTSimpleTypeSpecifier); - assertTrue( - ((IASTSimpleTypeSpecifier)var - .getAbstractDeclaration() - .getTypeSpecifier()) - .getType() - == IASTSimpleTypeSpecifier.Type.INT); - assertEquals(var.getName(), "x"); - } - } - - public void testLinkageSpecification() throws Exception - { - for( int i = 0; i < 2; ++i ) - { - IASTCompilationUnit compilationUnit; - if( i == 0 ) - compilationUnit = parse("extern \"C\" { int x(void); }"); - else - compilationUnit = parse("extern \"ADA\" int x(void);"); - - Iterator declarations = compilationUnit.getDeclarations(); - assertTrue( declarations.hasNext() ); - IASTLinkageSpecification linkage = (IASTLinkageSpecification)declarations.next(); - assertFalse( declarations.hasNext() ); - - if( i == 0 ) - assertEquals( "C", linkage.getLinkageString() ); - else - assertEquals( "ADA", linkage.getLinkageString() ); - - Iterator subDeclarations = linkage.getDeclarations(); - assertTrue( subDeclarations.hasNext() ); - IASTFunction function = (IASTFunction)subDeclarations.next(); - assertFalse( subDeclarations.hasNext()); - - assertEquals( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( function.getName(), "x"); - - Iterator parameters = function.getParameters(); - assertTrue( parameters.hasNext() ); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.VOID ); - assertEquals( parm.getName(), "" ); - } - } - - public void testEnumSpecifier() throws Exception - { - Writer code = new StringWriter(); - code.write( "enum { yo, go = 3, away };\n"); - code.write( "enum hasAString { last = 666 };"); - IASTCompilationUnit translationUnit = parse( code.toString() ); - Iterator declarations = translationUnit.getDeclarations(); - - for( int i = 0; i < 2; ++i ) - { - assertTrue( declarations.hasNext() ); - IASTAbstractTypeSpecifierDeclaration abstractDeclaration = (IASTAbstractTypeSpecifierDeclaration)declarations.next(); - IASTEnumerationSpecifier enumerationSpec = (IASTEnumerationSpecifier)abstractDeclaration.getTypeSpecifier(); - if( i == 0 ) - assertEquals( enumerationSpec.getName(), "" ); - else - assertEquals( enumerationSpec.getName(), "hasAString" ); - Iterator j = enumerationSpec.getEnumerators(); - - if( i == 0 ) - { - IASTEnumerator enumerator1 = (IASTEnumerator)j.next(); - assertEquals( enumerator1.getName(), "yo"); - assertNull( enumerator1.getInitialValue() ); - IASTEnumerator enumerator2 = (IASTEnumerator)j.next(); - assertNotNull( enumerator2.getInitialValue() ); - assertEquals( enumerator2.getInitialValue().getLiteralString(), "3"); - assertEquals( enumerator2.getInitialValue().getExpressionKind(), IASTExpression.Kind.PRIMARY_INTEGER_LITERAL ); - assertEquals( enumerator2.getName(), "go"); - IASTEnumerator enumerator3 = (IASTEnumerator)j.next(); - assertEquals( enumerator3.getName(), "away"); - assertNull( enumerator3.getInitialValue() ); - assertFalse( j.hasNext() ); - } - else - { - IASTEnumerator enumerator2 = (IASTEnumerator)j.next(); - assertNotNull( enumerator2.getInitialValue() ); - assertEquals( enumerator2.getInitialValue().getLiteralString(), "666"); - assertEquals( enumerator2.getInitialValue().getExpressionKind(), IASTExpression.Kind.PRIMARY_INTEGER_LITERAL ); - assertEquals( enumerator2.getName(), "last"); - assertFalse( j.hasNext() ); - } - } - } - - public void testTypedef() throws Exception - { - Iterator i = parse( "typedef const struct A * const cpStructA;").getDeclarations(); - IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)i.next(); - assertFalse( i.hasNext() ); - assertTrue( typedef.getAbstractDeclarator().isConst() ); - assertTrue( typedef.getAbstractDeclarator().getTypeSpecifier() instanceof IASTElaboratedTypeSpecifier ); - IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)typedef.getAbstractDeclarator().getTypeSpecifier(); - assertEquals( elab.getName(), "A"); - assertEquals( elab.getClassKind(), ASTClassKind.STRUCT ); - assertTrue( typedef.getAbstractDeclarator().getPointerOperators().hasNext() ); - Iterator pIter = (Iterator)typedef.getAbstractDeclarator().getPointerOperators(); - ASTPointerOperator po =(ASTPointerOperator)pIter.next(); - assertEquals( po, ASTPointerOperator.CONST_POINTER ); - assertFalse( pIter.hasNext() ); - assertEquals( typedef.getName(), "cpStructA"); - - } - - public void testUsingClauses() throws Exception - { - Writer code = new StringWriter(); - - code.write("using namespace A::B::C;\n"); - code.write("using namespace C;\n"); - code.write("using B::f;\n"); - code.write("using ::f;\n"); - code.write("using typename crap::de::crap;"); - Iterator declarations = parse(code.toString()).getDeclarations(); - - IASTUsingDirective usingDirective = (IASTUsingDirective)declarations.next(); - assertEquals( usingDirective.getNamespaceName(), "A::B::C" ); - - usingDirective = (IASTUsingDirective)declarations.next(); - assertEquals( usingDirective.getNamespaceName(), "C" ); - - IASTUsingDeclaration usingDeclaration = (IASTUsingDeclaration)declarations.next(); - assertEquals( usingDeclaration.usingTypeName(), "B::f" ); - - usingDeclaration = (IASTUsingDeclaration)declarations.next(); - assertEquals( usingDeclaration.usingTypeName(), "::f" ); - usingDeclaration = (IASTUsingDeclaration)declarations.next(); - assertEquals( usingDeclaration.usingTypeName(), "crap::de::crap" ); - assertTrue( usingDeclaration.isTypename() ); - - assertFalse( declarations.hasNext()); - } - - /** - * Test code: class A : public B, private C, virtual protected D { public: int x, y; float a,b,c; } - * Purpose: tests a declaration in a class scope. - */ - public void testSimpleClassMembers() throws Exception { - // Parse and get the translaton unit - Writer code = new StringWriter(); - code.write("class A : public B, private C, virtual protected D { public: int x, y; float a,b,c; };"); - Iterator declarations = parse( code.toString() ).getDeclarations(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - assertFalse( declarations.hasNext() ); - Iterator baseClauses = classSpec.getBaseClauses(); - IASTBaseSpecifier baseSpec = (IASTBaseSpecifier)baseClauses.next(); - assertEquals( baseSpec.getParentClassName(), "B" ); - assertEquals( baseSpec.getAccess(), ASTAccessVisibility.PUBLIC ); - baseSpec = (IASTBaseSpecifier)baseClauses.next(); - assertEquals( baseSpec.getParentClassName(), "C" ); - assertEquals( baseSpec.getAccess(), ASTAccessVisibility.PRIVATE); - baseSpec = (IASTBaseSpecifier)baseClauses.next(); - assertEquals( baseSpec.getAccess(), ASTAccessVisibility.PROTECTED ); - assertTrue( baseSpec.isVirtual() ); - assertEquals( baseSpec.getParentClassName(), "D" ); - assertFalse( baseClauses.hasNext() ); - - Iterator members = classSpec.getDeclarations(); - IASTField field = (IASTField)members.next(); - assertEquals( ((IASTSimpleTypeSpecifier)field.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( field.getName(), "x" ); - - field = (IASTField)members.next(); - assertEquals( ((IASTSimpleTypeSpecifier)field.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( field.getName(), "y" ); - - field = (IASTField)members.next(); - assertEquals( ((IASTSimpleTypeSpecifier)field.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.FLOAT ); - assertEquals( field.getName(), "a" ); - field = (IASTField)members.next(); - assertEquals( ((IASTSimpleTypeSpecifier)field.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.FLOAT ); - assertEquals( field.getName(), "b" ); - field = (IASTField)members.next(); - assertEquals( ((IASTSimpleTypeSpecifier)field.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.FLOAT ); - assertEquals( field.getName(), "c" ); - assertFalse( members.hasNext() ); - - } - - /** - * Test code: int myFunction( void ); - */ - public void testSimpleFunctionDeclaration() throws Exception - { - // Parse and get the translaton unit - Writer code = new StringWriter(); - code.write("void myFunction( void );"); - Iterator declarations = parse( code.toString()).getDeclarations(); - IASTFunction f1 = (IASTFunction)declarations.next(); - assertFalse( declarations.hasNext() ); - assertEquals( f1.getName(), "myFunction"); - assertEquals( ((IASTSimpleTypeSpecifier)f1.getReturnType().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.VOID ); - Iterator parameters = f1.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertEquals( parm.getName(), "" ); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.VOID ); - - } - - /** - * Test code: bool myFunction( int parm1 = 3 * 4, double parm2 ); - * @throws Exception - */ - public void testFunctionDeclarationWithParameters() throws Exception - { - // Parse and get the translaton unit - Writer code = new StringWriter(); - code.write("bool myFunction( int parm1 = 3 * 4, double parm2 );"); - Iterator declarations = parse(code.toString()).getDeclarations(); - IASTFunction f1 = (IASTFunction)declarations.next(); - assertFalse( declarations.hasNext() ); - assertEquals( f1.getName(), "myFunction"); - assertEquals( ((IASTSimpleTypeSpecifier)f1.getReturnType().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.BOOL ); - Iterator parameters = f1.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertEquals( parm.getName(), "parm1" ); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( parm.getDefaultValue().getAssigmentExpression().getExpressionKind(), IASTExpression.Kind.MULTIPLICATIVE_MULTIPLY ); - - parm = (IASTParameterDeclaration)parameters.next(); - assertEquals( parm.getName(), "parm2" ); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.DOUBLE ); - assertNull( parm.getDefaultValue() ); - assertFalse( parameters.hasNext()); - - } - - public void testAssignmentExpressions() throws Exception - { - parse( "int x = y = z = 5;"); - } - - public void testBug39348() throws Exception - { - parse("unsigned char a[sizeof (struct sss)];"); - } - - public void testBug39501() throws Exception - { - parse("struct A { A() throw (int); };"); - } - - public void testBug39349() throws Exception - { - parse( "enum foo { foo1 = 0, foo2 = 0xffffffffffffffffULL, foo3 = 0xf0fffffffffffffeLLU };" ); - } - - public void testBug39544() throws Exception { - parse("wchar_t wc = L'X';"); - } - - public void testBug36290() throws Exception { - parse("typedef void ( A:: * pMethod ) ( void ); "); - parse("typedef void (boo) ( void ); "); - parse("typedef void boo (void); "); - } - - public void testBug36769B() throws Exception { - parse("class X { operator int(); } \n"); - parse("class X { operator int*(); } \n"); - parse("class X { operator int&(); } \n"); - parse("class X { operator A(); } \n"); - parse("class X { operator A*(); } \n"); - parse("class X { operator A&(); } \n"); - - parse("X::operator int() { } \n"); - parse("X::operator int*() { } \n"); - parse("X::operator int&() { } \n"); - parse("X::operator A() { } \n"); - parse("X::operator A*() { } \n"); - parse("X::operator A&() { } \n"); - - parse("template class X { operator int(); } \n"); - parse("template class X { operator int*(); } \n"); - parse("template class X { operator int&(); } \n"); - parse("template class X { operator A(); } \n"); - parse("template class X { operator A*(); } \n"); - parse("template class X { operator A&(); } \n"); - - parse("template X::operator int() { } \n"); - parse("template X::operator int*() { } \n"); - parse("template X::operator int&() { } \n"); - parse("template X::operator A() { } \n"); - parse("template X::operator A*() { } \n"); - parse("template X::operator A&() { } \n"); - } - public void testBug36932C() throws Exception { - parse("X::X( ) : var( new int ) {}"); - parse("X::X( ) : var( new int(5) ) {}"); - parse("X::X( ) : var( new int(B) ) {}"); - parse("X::X( ) : var( new int(B,C) ) {}"); - parse("X::X( ) : var( new int[5] ) {}"); - parse("X::X( ) : var( new int[5][10] ) {}"); - parse("X::X( ) : var( new int[B] ) {}"); - parse("X::X( ) : var( new int[B][C][D] ) {}"); - - parse("X::X( ) : var( new A ) {}"); - parse("X::X( ) : var( new A(5) ) {}"); - parse("X::X( ) : var( new A(B) ) {}"); - parse("X::X( ) : var( new A(B,C) ) {}"); - parse("X::X( ) : var( new A[5] ) {}"); - parse("X::X( ) : var( new A[5][10] ) {}"); - parse("X::X( ) : var( new A[B] ) {}"); - parse("X::X( ) : var( new A[B][C][D] ) {}"); - - parse("X::X( ) : var( new (int) ) {}"); - parse("X::X( ) : var( new (int)(5) ) {}"); - parse("X::X( ) : var( new (int)(B) ) {}"); - parse("X::X( ) : var( new (int)(B,C) ) {}"); - parse("X::X( ) : var( new (int)[5] ) {}"); - parse("X::X( ) : var( new (int)[5][10] ) {}"); - parse("X::X( ) : var( new (int)[B] ) {}"); - parse("X::X( ) : var( new (int)[B][C][D] ) {}"); - - parse("X::X( ) : var( new (A) ) {}"); - parse("X::X( ) : var( new (A)(5) ) {}"); - parse("X::X( ) : var( new (A)(B) ) {}"); - parse("X::X( ) : var( new (A)(B,C) ) {}"); - parse("X::X( ) : var( new (A)[5] ) {}"); - parse("X::X( ) : var( new (A)[5][10] ) {}"); - parse("X::X( ) : var( new (A)[B] ) {}"); - parse("X::X( ) : var( new (A)[B][C][D] ) {}"); - - parse("X::X( ) : var( new (0) int ) {}"); - parse("X::X( ) : var( new (0) int(5) ) {}"); - parse("X::X( ) : var( new (0) int(B) ) {}"); - parse("X::X( ) : var( new (0) int(B,C) ) {}"); - parse("X::X( ) : var( new (0) int[5] ) {}"); - parse("X::X( ) : var( new (0) int[5][10] ) {}"); - parse("X::X( ) : var( new (0) int[B] ) {}"); - parse("X::X( ) : var( new (0) int[B][C][D] ) {}"); - - parse("X::X( ) : var( new (0) A ) {}"); - parse("X::X( ) : var( new (0) A(5) ) {}"); - parse("X::X( ) : var( new (0) A(B) ) {}"); - parse("X::X( ) : var( new (0) A(B,C) ) {}"); - parse("X::X( ) : var( new (0) A[5] ) {}"); - parse("X::X( ) : var( new (0) A[5][10] ) {}"); - parse("X::X( ) : var( new (0) A[B] ) {}"); - parse("X::X( ) : var( new (0) A[B][C][D] ) {}"); - - parse("X::X( ) : var( new (0) (int) ) {}"); - parse("X::X( ) : var( new (0) (int)(5) ) {}"); - parse("X::X( ) : var( new (0) (int)(B) ) {}"); - parse("X::X( ) : var( new (0) (int)(B,C) ) {}"); - parse("X::X( ) : var( new (0) (int)[5] ) {}"); - parse("X::X( ) : var( new (0) (int)[5][10] ) {}"); - parse("X::X( ) : var( new (0) (int)[B] ) {}"); - parse("X::X( ) : var( new (0) (int)[B][C][D] ) {}"); - - parse("X::X( ) : var( new (0) (A) ) {}"); - parse("X::X( ) : var( new (0) (A)(5) ) {}"); - parse("X::X( ) : var( new (0) (A)(B) ) {}"); - parse("X::X( ) : var( new (0) (A)(B,C) ) {}"); - parse("X::X( ) : var( new (0) (A)[5] ) {}"); - parse("X::X( ) : var( new (0) (A)[5][10] ) {}"); - parse("X::X( ) : var( new (0) (A)[B] ) {}"); - parse("X::X( ) : var( new (0) (A)[B][C][D] ) {}"); - - parse("X::X( ) : var( new (P) int ) {}"); - parse("X::X( ) : var( new (P) int(5) ) {}"); - parse("X::X( ) : var( new (P) int(B) ) {}"); - parse("X::X( ) : var( new (P) int(B,C) ) {}"); - parse("X::X( ) : var( new (P) int[5] ) {}"); - parse("X::X( ) : var( new (P) int[5][10] ) {}"); - parse("X::X( ) : var( new (P) int[B] ) {}"); - parse("X::X( ) : var( new (P) int[B][C][D] ) {}"); - - parse("X::X( ) : var( new (P) A ) {}"); - parse("X::X( ) : var( new (P) A(5) ) {}"); - parse("X::X( ) : var( new (P) A(B) ) {}"); - parse("X::X( ) : var( new (P) A(B,C) ) {}"); - parse("X::X( ) : var( new (P) A[5] ) {}"); - parse("X::X( ) : var( new (P) A[5][10] ) {}"); - parse("X::X( ) : var( new (P) A[B] ) {}"); - parse("X::X( ) : var( new (P) A[B][C][D] ) {}"); - - parse("X::X( ) : var( new (P) (int) ) {}"); - parse("X::X( ) : var( new (P) (int)(5) ) {}"); - parse("X::X( ) : var( new (P) (int)(B) ) {}"); - parse("X::X( ) : var( new (P) (int)(B,C) ) {}"); - parse("X::X( ) : var( new (P) (int)[5] ) {}"); - parse("X::X( ) : var( new (P) (int)[5][10] ) {}"); - parse("X::X( ) : var( new (P) (int)[B] ) {}"); - parse("X::X( ) : var( new (P) (int)[B][C][D] ) {}"); - - parse("X::X( ) : var( new (P) (A) ) {}"); - parse("X::X( ) : var( new (P) (A)(5) ) {}"); - parse("X::X( ) : var( new (P) (A)(B) ) {}"); - parse("X::X( ) : var( new (P) (A)(B,C) ) {}"); - parse("X::X( ) : var( new (P) (A)[5] ) {}"); - parse("X::X( ) : var( new (P) (A)[5][10] ) {}"); - parse("X::X( ) : var( new (P) (A)[B] ) {}"); - parse("X::X( ) : var( new (P) (A)[B][C][D] ) {}"); - } - - - public void testBugSingleton192() throws Exception { - parse("int Test::* pMember_;" ); - } - public void testBug36931() throws Exception { - parse("A::nested::nested(){}; "); - parse("int A::nested::foo() {} "); - parse("int A::nested::operator+() {} "); - parse("A::nested::operator int() {} "); - parse("static const int A::nested::i = 1; "); - - parse("template A::nested::nested(){}; "); - parse("template int A::nested::foo() {} "); - parse("template int A::nested::operator+() {} "); - parse("template A::nested::operator int() {} "); - } - - public void testBug37019() throws Exception { - parse("static const A a( 1, 0 );"); - } - - public void testBug36766and36769A() throws Exception { - Writer code = new StringWriter(); - code.write("template \n"); - code.write("rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,\n"); - code.write("const allocator_type& __a): _Base(__a)\n"); - code.write("{}\n"); - parse(code.toString()); - } - - public void testBug36766and36769B() throws Exception { - Writer code = new StringWriter(); - code.write("template\n"); - code.write("bool _Rope_insert_char_consumer<_CharT>::operator()\n"); - code.write("(const _CharT* __leaf, size_t __n)\n"); - code.write("{}\n"); - parse(code.toString()); - } - - public void testBug36766and36769C() throws Exception { - Writer code = new StringWriter(); - code.write("template \n"); - code.write("_Rope_char_ref_proxy<_CharT, _Alloc>&\n"); - code.write( - "_Rope_char_ref_proxy<_CharT, _Alloc>::operator= (_CharT __c)\n"); - code.write("{}\n"); - parse(code.toString()); - } - - public void testBug36766and36769D() throws Exception { - Writer code = new StringWriter(); - code.write("template \n"); - code.write("rope<_CharT, _Alloc>::~rope()\n"); - code.write("{}\n"); - parse(code.toString()); - } - - public void testBug36932A() throws Exception { - parse("A::A( ) : var( new char [ (unsigned)bufSize ] ) {}"); - } - - public void testBug36932B() throws Exception { - parse(" p = new int; "); - parse(" p = new int(5); "); - parse(" p = new int(B); "); - parse(" p = new int(B,C); "); - parse(" p = new int[5]; "); - parse(" p = new int[5][10]; "); - parse(" p = new int[B]; "); - parse(" p = new int[B][C][D]; "); - - parse(" p = new A; "); - parse(" p = new A(5); "); - parse(" p = new A(B); "); - parse(" p = new A(B,C); "); - parse(" p = new A[5]; "); - parse(" p = new A[5][10]; "); - parse(" p = new A[B]; "); - parse(" p = new A[B][C][D]; "); - - parse(" p = new (int); "); - parse(" p = new (int)(5); "); - parse(" p = new (int)(B); "); - parse(" p = new (int)(B,C); "); - parse(" p = new (int)[5]; "); - parse(" p = new (int)[5][10]; "); - parse(" p = new (int)[B]; "); - parse(" p = new (int)[B][C][D]; "); - - parse(" p = new (A); "); - parse(" p = new (A)(5); "); - parse(" p = new (A)(B); "); - parse(" p = new (A)(B,C); "); - parse(" p = new (A)[5]; "); - parse(" p = new (A)[5][10]; "); - parse(" p = new (A)[B]; "); - parse(" p = new (A)[B][C][D]; "); - - parse(" p = new (0) int; "); - parse(" p = new (0) int(5); "); - parse(" p = new (0) int(B); "); - parse(" p = new (0) int(B,C); "); - parse(" p = new (0) int[5]; "); - parse(" p = new (0) int[5][10]; "); - parse(" p = new (0) int[B]; "); - parse(" p = new (0) int[B][C][D]; "); - - parse(" p = new (0) A; "); - parse(" p = new (0) A(5); "); - parse(" p = new (0) A(B); "); - parse(" p = new (0) A(B,C); "); - parse(" p = new (0) A[5]; "); - parse(" p = new (0) A[5][10]; "); - parse(" p = new (0) A[B]; "); - parse(" p = new (0) A[B][C][D]; "); - - parse(" p = new (0) (int); "); - parse(" p = new (0) (int)(5); "); - parse(" p = new (0) (int)(B); "); - parse(" p = new (0) (int)(B,C); "); - parse(" p = new (0) (int)[5]; "); - parse(" p = new (0) (int)[5][10]; "); - parse(" p = new (0) (int)[B]; "); - parse(" p = new (0) (int)[B][C][D]; "); - - parse(" p = new (0) (A); "); - parse(" p = new (0) (A)(5); "); - parse(" p = new (0) (A)(B); "); - parse(" p = new (0) (A)(B,C); "); - parse(" p = new (0) (A)[5]; "); - parse(" p = new (0) (A)[5][10]; "); - parse(" p = new (0) (A)[B]; "); - parse(" p = new (0) (A)[B][C][D]; "); - - parse(" p = new (P) int; "); - parse(" p = new (P) int(5); "); - parse(" p = new (P) int(B); "); - parse(" p = new (P) int(B,C); "); - parse(" p = new (P) int[5]; "); - parse(" p = new (P) int[5][10]; "); - parse(" p = new (P) int[B]; "); - parse(" p = new (P) int[B][C][D]; "); - - parse(" p = new (P) A; "); - parse(" p = new (P) A(5); "); - parse(" p = new (P) A(B); "); - parse(" p = new (P) A(B,C); "); - parse(" p = new (P) A[5]; "); - parse(" p = new (P) A[5][10]; "); - parse(" p = new (P) A[B]; "); - parse(" p = new (P) A[B][C][D]; "); - - parse(" p = new (P) (int); "); - parse(" p = new (P) (int)(5); "); - parse(" p = new (P) (int)(B); "); - parse(" p = new (P) (int)(B,C); "); - parse(" p = new (P) (int)[5]; "); - parse(" p = new (P) (int)[5][10]; "); - parse(" p = new (P) (int)[B]; "); - parse(" p = new (P) (int)[B][C][D]; "); - - parse(" p = new (P) (A); "); - parse(" p = new (P) (A)(5); "); - parse(" p = new (P) (A)(B); "); - parse(" p = new (P) (A)(B,C); "); - parse(" p = new (P) (A)[5]; "); - parse(" p = new (P) (A)[5][10]; "); - parse(" p = new (P) (A)[B]; "); - parse(" p = new (P) (A)[B][C][D]; "); - } - - public void testBug36769A() throws Exception { - Writer code = new StringWriter(); - code.write("template cls::operator op &() const {}\n"); - code.write("template cls::cls() {}\n"); - code.write("template cls::~cls() {}\n"); - - parse( code.toString()); - } - - public void testBug36714() throws Exception { - Writer code = new StringWriter(); - code.write("unsigned long a = 0UL;\n"); - code.write("unsigned long a2 = 0L; \n"); - - parse( code.toString() ); - } - - public void testBugFunctor758() throws Exception { - parse( "template Functor(Fun fun) : spImpl_(new FunctorHandler(fun)){}" ); - } - - public void testBug36932() throws Exception - { - parse( "A::A(): b( new int( 5 ) ), b( new B ), c( new int ) {}" ); - } - - public void testBug36704() throws Exception { - Writer code = new StringWriter(); - code.write( "template \n" ); - code.write( "struct Length< Typelist >\n" ); - code.write( "{\n" ); - code.write( "enum { value = 1 + Length::value };\n" ); - code.write( "};\n" ); - parse(code.toString()); - } - - public void testBug36699() throws Exception { - Writer code = new StringWriter(); - code.write( - "template < template class ThreadingModel = DEFAULT_THREADING,\n"); - code.write("std::size_t chunkSize = DEFAULT_CHUNK_SIZE,\n"); - code.write( - "std::size_t maxSmallObjectSize = MAX_SMALL_OBJECT_SIZE >\n"); - code.write("class SmallObject : public ThreadingModel<\n"); - code.write( - "SmallObject >\n"); - code.write("{};\n"); - parse(code.toString()); - } - - public void testBug36691() throws Exception { - Writer code = new StringWriter(); - code.write("template \n"); - code.write( - "typename H::template Rebind::Result& Field(H& obj)\n"); - code.write("{ return obj; }\n"); - parse(code.toString()); - } - - - public void testBug39554() throws Exception - { - parse("_Pragma(\"foobar\")", true, true, ParserLanguage.C ); - } - - public void testBug36702() throws Exception - { - Writer code = new StringWriter(); - code.write( "void mad_decoder_init(struct mad_decoder *, void *,\n" ); - code.write( " enum mad_flow (*)(void *, struct mad_stream *),\n" ); - code.write( " enum mad_flow (*)(void *, struct mad_header const *),\n" ); - code.write( " enum mad_flow (*)(void *,\n" ); - code.write( " struct mad_stream const *,\n" ); - code.write( " struct mad_frame *),\n" ); - code.write( " enum mad_flow (*)(void *,\n" ); - code.write( " struct mad_header const *,\n" ); - code.write( " struct mad_pcm *),\n" ); - code.write( " enum mad_flow (*)(void *,\n" ); - code.write( " struct mad_stream *,\n" ); - code.write( " struct mad_frame *),\n" ); - code.write( " enum mad_flow (*)(void *, void *, unsigned int *)\n" ); - code.write( ");\n" ); - - parse( code.toString() ); - - } - - public void testBug36852() throws Exception - { - Writer code = new StringWriter(); - code.write( "int CBT::senseToAllRect( double id_standardQuot = DOSE, double id_minToleranz =15.0,\n" ); - code.write( "double id_maxToleranz = 15.0, unsigned int iui_minY = 0, \n" ); - code.write( "unsigned int iui_maxY = HEIGHT );\n" ); - parse( code.toString() ); - } - - public void testBug36689() throws Exception { - Writer code = new StringWriter(); - code.write("template\n"); - code.write("<\n"); - code.write("class AbstractFact,\n"); - code.write( - "template class Creator = OpNewFactoryUnit,\n"); - code.write("class TList = typename AbstractFact::ProductList\n"); - code.write(">\n"); - code.write("class ConcreteFactory\n"); - code.write(": public GenLinearHierarchy<\n"); - code.write( - "typename TL::Reverse::Result, Creator, AbstractFact>\n"); - code.write("{\n"); - code.write("public:\n"); - code.write( - "typedef typename AbstractFact::ProductList ProductList;\n"); - code.write("typedef TList ConcreteProductList;\n"); - code.write("};\n"); - parse(code.toString()); - } - - public void testBug36707() throws Exception { - parse("enum { exists = sizeof(typename H::Small) == sizeof((H::Test(H::MakeT()))) };"); - } - - public void testBug36717() throws Exception { - parse("enum { eA = A::b };"); - } - - public void testBug36693() throws Exception { - parse("FixedAllocator::Chunk* FixedAllocator::VicinityFind(void* p){}"); - } - - public void testWeirdExpression() throws Exception - { - parse( "int x = rhs.spImpl_.get();"); - } - - public void testBug36696() throws Exception { - Writer code = new StringWriter(); - code.write( - "template RefCounted(const RefCounted& rhs)\n"); - code.write( - ": pCount_(reinterpret_cast(rhs).pCount_) {}\n"); - parse(code.toString()); - } - - public void testArrayOfPointerToFunctions() throws Exception - { - parse( "unsigned char (*main_data)[MAD_BUFFER_MDLEN];"); - } - - public void testBug36073() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "class A{\n" ); - writer.write( "int x;\n" ); - writer.write( "public:\n" ); - writer.write( "A(const A&);\n" ); - writer.write( "};\n" ); - writer.write( "A::A(const A&v) : x(v.x) { }\n" ); - parse( writer.toString() ); - } - - - public void testTemplateSpecialization() throws Exception - { - Iterator declarations = parse( "template<> class stream { /* ... */ };").getDeclarations(); - IASTClassSpecifier specifier = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)((IASTTemplateSpecialization)declarations.next()).getOwnedDeclaration()).getTypeSpecifier(); - assertFalse( declarations.hasNext()); - assertEquals( specifier.getName(), "stream"); - assertFalse( specifier.getDeclarations().hasNext() ); - } - - public void testTemplateInstantiation() throws Exception - { - Iterator declarations = parse( "template class Array;").getDeclarations(); - IASTElaboratedTypeSpecifier specifier = (IASTElaboratedTypeSpecifier)((IASTAbstractTypeSpecifierDeclaration)((IASTTemplateInstantiation)declarations.next()).getOwnedDeclaration()).getTypeSpecifier(); - assertFalse( declarations.hasNext() ); - assertEquals( specifier.getName(), "Array"); - assertEquals( specifier.getClassKind(), ASTClassKind.CLASS ); - } - - /** - * Test code: "class A { int floor( double input ), someInt; };" - */ - public void testMultipleDeclarators() throws Exception - { - // Parse and get the translaton unit - Iterator declarations = parse("class A { int floor( double input ), someInt; };").getDeclarations(); - Iterator members = ((IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier()).getDeclarations(); - assertFalse( declarations.hasNext() ); - IASTMethod decl1 = (IASTMethod)members.next(); - assertEquals( ((IASTSimpleTypeSpecifier)decl1.getReturnType().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - Iterator parameters = decl1.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.DOUBLE ); - assertFalse( parameters.hasNext()); - assertEquals( parm.getName(), "input"); - - IASTField decl2 = (IASTField)members.next(); - assertEquals( decl2.getName(), "someInt"); - assertEquals( ((IASTSimpleTypeSpecifier)decl2.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - assertFalse( members.hasNext()); - } - - public void testFunctionModifiers() throws Exception - { - Iterator declarations = parse( "class A {virtual void foo( void ) const throw ( yay, nay, we::dont::care ) = 0;};").getDeclarations(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - assertFalse( declarations.hasNext()); - Iterator members = classSpec.getDeclarations(); - IASTMethod method = (IASTMethod)members.next(); - assertFalse( members.hasNext() ); - assertTrue( method.isVirtual()); - assertEquals( method.getName(), "foo"); - assertEquals( ((IASTSimpleTypeSpecifier)method.getReturnType().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.VOID ); - Iterator parameters = method.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.VOID ); - assertFalse( parameters.hasNext()); - assertEquals( parm.getName(), ""); - assertTrue( method.isConst() ); - assertTrue( method.isPureVirtual() ); - assertNotNull( method.getExceptionSpec() ); - Iterator exceptions = method.getExceptionSpec().getTypeIds(); - assertEquals( (String)exceptions.next(), "yay"); - assertEquals( (String)exceptions.next(), "nay"); - assertEquals( (String)exceptions.next(), "we::dont::care"); - assertFalse( exceptions.hasNext() ); - } - - - public void testArrays() throws Exception - { - Iterator declarations = parse("int x [5][];").getDeclarations(); - IASTVariable x = (IASTVariable)declarations.next(); - assertFalse( declarations.hasNext() ); - assertEquals( ((IASTSimpleTypeSpecifier)x.getAbstractDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( x.getName(), "x"); - Iterator arrayMods = x.getAbstractDeclaration().getArrayModifiers(); - IASTArrayModifier mod = (IASTArrayModifier)arrayMods.next(); - assertEquals( mod.getExpression().getExpressionKind(), IASTExpression.Kind.PRIMARY_INTEGER_LITERAL ); - assertEquals( mod.getExpression().getLiteralString(), "5" ); - mod = (IASTArrayModifier)arrayMods.next(); - assertNull( mod.getExpression()); - assertFalse( arrayMods.hasNext() ); - } - - public void testElaboratedParms() throws Exception - { - Iterator declarations = parse( "int x( struct A myA ) { /* junk */ }" ).getDeclarations(); - IASTFunction f = (IASTFunction)declarations.next(); - assertSimpleReturnType( f, IASTSimpleTypeSpecifier.Type.INT ); - Iterator parms = f.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parms.next(); - assertFalse( parms.hasNext()); - assertEquals( parm.getName(), "myA"); - assertEquals( ((IASTElaboratedTypeSpecifier)parm.getTypeSpecifier()).getName(), "A" ); - assertEquals( ((IASTElaboratedTypeSpecifier)parm.getTypeSpecifier()).getClassKind(), ASTClassKind.STRUCT ); - assertFalse( declarations.hasNext()); - } - - public void testMemberDeclarations() throws Exception - { - Writer code = new StringWriter(); - code.write( "class A {\n" ); - code.write( "public:\n"); - code.write( " int is0;\n" ); - code.write( "private:\n"); - code.write( " int is1;\n" ); - code.write( "protected:\n"); - code.write( " int is2;\n" ); - code.write( "};"); - Iterator declarations = parse( code.toString()).getDeclarations(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - assertFalse(declarations.hasNext()); - Iterator members = classSpec.getDeclarations(); - for( int i = 0; i < 3; ++i ) - { - IASTField field = (IASTField)members.next(); - assertEquals( field.getName(), "is"+ new Integer( i ).toString()); - ASTAccessVisibility visibility = null; - switch( i ) - { - case 0: - visibility = ASTAccessVisibility.PUBLIC; - break; - - case 1: - visibility = ASTAccessVisibility.PRIVATE; - break; - - default: - visibility = ASTAccessVisibility.PROTECTED; - break; - } - assertEquals( field.getVisiblity(), visibility ); - } - assertFalse( members.hasNext()); - } - - public void testPointerOperators() throws Exception - { - Iterator declarations = parse("int * x = 0, & y, * const * volatile * z;").getDeclarations(); - for( int i = 0; i < 3; ++i ) - { - IASTVariable v = (IASTVariable)declarations.next(); - assertSimpleType( v, IASTSimpleTypeSpecifier.Type.INT ); - Iterator pointerOperators = v.getAbstractDeclaration().getPointerOperators(); - ASTPointerOperator pointerOp = (ASTPointerOperator)pointerOperators.next(); - - switch( i ) - { - case 0: - assertEquals( v.getName(), "x"); - assertEquals( pointerOp, ASTPointerOperator.POINTER ); - assertFalse( pointerOperators.hasNext()); - break; - case 1: - assertEquals( v.getName(), "y"); - assertEquals( pointerOp, ASTPointerOperator.REFERENCE); - assertFalse( pointerOperators.hasNext()); - break; - case 2: - assertEquals( v.getName(), "z"); - assertEquals( pointerOp, ASTPointerOperator.CONST_POINTER ); - assertEquals( pointerOperators.next(), ASTPointerOperator.VOLATILE_POINTER ); - assertEquals( pointerOperators.next(), ASTPointerOperator.POINTER ); - assertFalse( pointerOperators.hasNext()); - break; - } - } - assertFalse( declarations.hasNext() ); - } - - public void testBug26467() throws Exception - { - StringWriter code = new StringWriter(); - code.write( "struct foo { int fooInt; char fooChar; };\n" ); - code.write( "typedef struct foo fooStruct;\n" ); - code.write( "typedef struct { int anonInt; char anonChar; } anonStruct;\n" ); - Iterator declarations = parse( code.toString()).getDeclarations(); - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - assertEquals( classSpec.getClassKind(), ASTClassKind.STRUCT); - assertEquals( classSpec.getName(), "foo" ); - Iterator members = classSpec.getDeclarations(); - IASTField field = (IASTField)members.next(); - assertSimpleType(field, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( field.getName(), "fooInt"); - field = (IASTField)members.next(); - assertSimpleType(field, IASTSimpleTypeSpecifier.Type.CHAR ); - assertEquals( field.getName(), "fooChar"); - assertFalse( members.hasNext()); - IASTTypedefDeclaration firstTypeDef = (IASTTypedefDeclaration)declarations.next(); - assertEquals( ((IASTElaboratedTypeSpecifier)firstTypeDef.getAbstractDeclarator().getTypeSpecifier()).getClassKind(), ASTClassKind.STRUCT ); - assertEquals( ((IASTElaboratedTypeSpecifier)firstTypeDef.getAbstractDeclarator().getTypeSpecifier()).getName(), "foo"); - assertEquals( firstTypeDef.getName(), "fooStruct"); - IASTTypedefDeclaration secondTypeDef = (IASTTypedefDeclaration)declarations.next(); - classSpec = (IASTClassSpecifier)secondTypeDef.getAbstractDeclarator().getTypeSpecifier(); - assertEquals( classSpec.getClassKind(), ASTClassKind.STRUCT); - assertEquals( classSpec.getName(), "" ); - members = classSpec.getDeclarations(); - field = (IASTField)members.next(); - assertSimpleType(field, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( field.getName(), "anonInt"); - field = (IASTField)members.next(); - assertSimpleType(field, IASTSimpleTypeSpecifier.Type.CHAR ); - assertEquals( field.getName(), "anonChar"); - assertFalse( members.hasNext()); - assertEquals( secondTypeDef.getName(), "anonStruct"); - - } - - public void testASMDefinition() throws Exception - { - Iterator declarations = parse( "asm( \"mov ep1 ds2\");" ).getDeclarations(); - IASTASMDefinition asm = (IASTASMDefinition)declarations.next(); - assertFalse( declarations.hasNext()); - assertEquals( asm.getBody(), "mov ep1 ds2"); - } - - public void testConstructorChain() throws Exception - { - Iterator declarations = parse( "TrafficLight_Actor::TrafficLight_Actor( RTController * rtg_rts, RTActorRef * rtg_ref ) : RTActor( rtg_rts, rtg_ref ), myId( 0 ) {}" ).getDeclarations(); - declarations.next(); // cannot properly do this test now with new callback structure in quickparse mode - } - - public void testBug36237() throws Exception - { - parse( "A::A():B( (char *)0 ){}" ); - } - - public void testBug36532() throws Exception - { - try - { - parse( "template\n#define DEF VALUE\n"); - IASTCompilationUnit tu = parse( code.toString() ); - assertFalse( tu.getDeclarations().hasNext()); - Iterator inclusions = quickParseCallback.getInclusions(); - Iterator macros = quickParseCallback.getMacros(); - - IASTInclusion i = (IASTInclusion)inclusions.next(); - assertFalse( inclusions.hasNext()); - - assertEquals( i.getName(), "stdio.h"); - assertEquals( i.getStartingOffset(), 0 ); - assertEquals( i.getNameOffset(), 10 ); - assertEquals( i.getEndingOffset(), 19 ); - - - IASTMacro m = (IASTMacro)macros.next(); - assertEquals( m.getName(), "DEF" ); - assertEquals( m.getStartingOffset(), 19 ); - assertEquals( m.getNameOffset(), 27 ); - assertEquals( m.getEndingOffset(), 18 + 19); - } - - public void testTemplateDeclarationOfFunction() throws Exception - { - Iterator declarations = parse( "template A aTemplatedFunction( B bInstance );").getDeclarations(); - IASTTemplateDeclaration templateDeclaration = (IASTTemplateDeclaration)declarations.next(); - assertFalse( declarations.hasNext()); - Iterator templateParms = templateDeclaration.getTemplateParameters(); - IASTTemplateParameter parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.CLASS ); - assertEquals( parm.getIdentifier(), "A"); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.TYPENAME ); - assertEquals( parm.getIdentifier(), "B"); - assertEquals( parm.getDefaultValueIdExpression(), "C" ); - IASTFunction f = (IASTFunction)templateDeclaration.getOwnedDeclaration(); - assertEquals( f.getName(), "aTemplatedFunction" ); - assertSimpleReturnType( f, IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ); - assertEquals( ((IASTSimpleTypeSpecifier)f.getReturnType().getTypeSpecifier()).getTypename(), "A" ); - Iterator parameters = f.getParameters(); - IASTParameterDeclaration parmDeclaration = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertEquals( parmDeclaration.getName(), "bInstance"); - assertEquals( ((IASTSimpleTypeSpecifier)parmDeclaration.getTypeSpecifier()).getType(),IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ); - assertEquals( ((IASTSimpleTypeSpecifier)parmDeclaration.getTypeSpecifier()).getTypename(), "B" ); - } - - public void testTemplateDeclarationOfClass() throws Exception { - Iterator declarations = parse( "template class, template class AClass> class myarray { /* ... */ };").getDeclarations(); - IASTTemplateDeclaration templateDeclaration = (IASTTemplateDeclaration)declarations.next(); - assertFalse( declarations.hasNext()); - Iterator templateParms = templateDeclaration.getTemplateParameters(); - IASTTemplateParameter parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.CLASS ); - assertEquals( parm.getIdentifier(), "T"); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.TYPENAME ); - assertEquals( parm.getIdentifier(), "Tibor"); - assertEquals( parm.getDefaultValueIdExpression(), "junk"); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.CLASS ); - assertEquals( parm.getIdentifier(), ""); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.TYPENAME ); - assertEquals( parm.getIdentifier(), ""); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.PARAMETER ); - assertEquals( parm.getParameterDeclaration().getName(), "x"); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getParameterDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.INT ); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.PARAMETER ); - assertEquals( parm.getParameterDeclaration().getName(), "y"); - assertEquals( ((IASTSimpleTypeSpecifier)parm.getParameterDeclaration().getTypeSpecifier()).getType(), IASTSimpleTypeSpecifier.Type.FLOAT ); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.TEMPLATE_LIST); - assertEquals( parm.getIdentifier(), ""); - Iterator subParms = parm.getTemplateParameters(); - parm = (IASTTemplateParameter)subParms.next(); - assertFalse( subParms.hasNext() ); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.CLASS ); - assertEquals( parm.getIdentifier(), "Y" ); - parm = (IASTTemplateParameter)templateParms.next(); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.TEMPLATE_LIST); - assertEquals( parm.getIdentifier(), "AClass"); - subParms = parm.getTemplateParameters(); - parm = (IASTTemplateParameter)subParms.next(); - assertFalse( subParms.hasNext() ); - assertEquals( parm.getTemplateParameterKind(), IASTTemplateParameter.ParamKind.CLASS ); - assertEquals( parm.getIdentifier(), "A" ); - assertFalse( templateParms.hasNext() ); - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)templateDeclaration.getOwnedDeclaration()).getTypeSpecifier(); - assertEquals( classSpec.getName(), "myarray"); - assertFalse( classSpec.getDeclarations().hasNext() ); - } - - public void testBug35906() throws Exception - { - StringWriter code = new StringWriter(); - code.write( "void TTest::MTest() {}\n" ); - code.write( "struct TTest::STest *TTest::FTest (int i) {}\n" ); - Iterator declarations = parse( code.toString() ).getDeclarations(); - IASTFunction f = (IASTFunction)declarations.next(); - assertEquals( f.getName(), "TTest::MTest"); - assertSimpleReturnType( f, IASTSimpleTypeSpecifier.Type.VOID ); - f = (IASTFunction)declarations.next(); - assertFalse( declarations.hasNext()); - assertEquals( f.getName(), "TTest::FTest"); - assertEquals( ((IASTElaboratedTypeSpecifier)f.getReturnType().getTypeSpecifier()).getClassKind(), ASTClassKind.STRUCT ); - assertEquals( ((IASTElaboratedTypeSpecifier)f.getReturnType().getTypeSpecifier()).getName(), "TTest::STest"); - Iterator pointerOperators = f.getReturnType().getPointerOperators(); - assertEquals( pointerOperators.next(), ASTPointerOperator.POINTER ); - assertFalse( pointerOperators.hasNext() ); - Iterator parameters = f.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertEquals( parm.getName(), "i"); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.INT ); - } - - public void testBug36288() throws Exception - { - Iterator declarations = parse( "int foo() {}\nlong foo2(){}" ).getDeclarations(); - IASTFunction f = (IASTFunction)declarations.next(); - assertSimpleReturnType( f, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( f.getName(), "foo"); - f = (IASTFunction)declarations.next(); - assertSimpleReturnType( f, IASTSimpleTypeSpecifier.Type.INT ); - assertTrue( ((IASTSimpleTypeSpecifier)f.getReturnType().getTypeSpecifier()).isLong() ); - assertEquals( f.getName(), "foo2"); - assertFalse( declarations.hasNext() ); - } - - public void testBug36250() throws Exception - { - Iterator declarations = parse( "int f( int = 0 );").getDeclarations(); - IASTFunction f = (IASTFunction)declarations.next(); - assertFalse( declarations.hasNext() ); - assertSimpleReturnType( f, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( f.getName(), "f"); - Iterator parameters = f.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( parm.getName(), "" ); - assertEquals( parm.getDefaultValue().getKind(), IASTInitializerClause.Kind.ASSIGNMENT_EXPRESSION ); - assertEquals( parm.getDefaultValue().getAssigmentExpression().getExpressionKind(), IASTExpression.Kind.PRIMARY_INTEGER_LITERAL ); - assertEquals( parm.getDefaultValue().getAssigmentExpression().getLiteralString(), "0" ); - } - - public void testBug36240() throws Exception - { - Iterator declarations = parse( "A & A::operator=( A ){}").getDeclarations(); - IASTFunction f = (IASTFunction)declarations.next(); - IASTSimpleTypeSpecifier typeSpec = (IASTSimpleTypeSpecifier)f.getReturnType().getTypeSpecifier(); - assertEquals( typeSpec.getType(), IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ); - assertEquals( typeSpec.getTypename(), "A"); - Iterator pointerOps = f.getReturnType().getPointerOperators(); - assertEquals( (ASTPointerOperator)pointerOps.next(), ASTPointerOperator.REFERENCE ); - assertFalse( pointerOps.hasNext() ); - assertEquals( f.getName(), "A::operator ="); - Iterator parms = f.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parms.next(); - assertEquals( parm.getName(), "" ); - typeSpec = (IASTSimpleTypeSpecifier)parm.getTypeSpecifier(); - assertEquals( typeSpec.getType(), IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ); - assertEquals( typeSpec.getTypename(), "A" ); - } - - public void testBug36254() throws Exception - { - Iterator declarations = parse( "unsigned i;\nvoid f( unsigned p1 = 0 );").getDeclarations(); - IASTVariable v = (IASTVariable)declarations.next(); - assertSimpleType( v, IASTSimpleTypeSpecifier.Type.INT); - assertTrue( ((IASTSimpleTypeSpecifier)v.getAbstractDeclaration().getTypeSpecifier()).isUnsigned() ); - IASTFunction f = (IASTFunction)declarations.next(); - assertSimpleReturnType(f, IASTSimpleTypeSpecifier.Type.VOID ); - assertEquals( f.getName(), "f"); - Iterator parms = f.getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parms.next(); - assertEquals( parm.getName(), "p1"); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.INT ); - assertTrue( ((IASTSimpleTypeSpecifier)parm.getTypeSpecifier()).isUnsigned() ); - assertEquals( parm.getDefaultValue().getKind(), IASTInitializerClause.Kind.ASSIGNMENT_EXPRESSION ); - assertEquals( parm.getDefaultValue().getAssigmentExpression().getExpressionKind(), IASTExpression.Kind.PRIMARY_INTEGER_LITERAL ); - assertEquals( parm.getDefaultValue().getAssigmentExpression().getLiteralString(), "0" ); - assertFalse( declarations.hasNext()); - } - - public void testBug36432() throws Exception - { - Writer code = new StringWriter(); - code.write( "#define CMD_GET \"g\"\n" ); - code.write( "#define CMD_ACTION \"a\"\n" ); - code.write( "#define CMD_QUIT \"q\"\n" ); - code.write( "static const memevent_cmd_func memevent_cmd_funcs[sizeof memevent_cmds - 1] = {\n"); - code.write( "memevent_get,\n"); - code.write( "memevent_action,\n"); - code.write( "memevent_quit,\n"); - code.write( "};\n"); - parse( code.toString() ); - } - - public void testBug36594() throws Exception - { - parse( "const int n = sizeof(A) / sizeof(B);"); - } - - public void testBug36794() throws Exception - { - parse( "template<> class allocator {};"); - Iterator i = quickParseCallback.iterateOffsetableElements(); - while( i.hasNext() ) - assertNotNull( i.next() ); - } - - public void testBug36799() throws Exception - { - parse( "static const int __WORD_BIT = int(CHAR_BIT*sizeof(unsigned int));"); - } - - - public void testBug36764() throws Exception - { - parse( "struct{ int x : 4; int y : 8; };" ); - } - - public void testOrder() throws Exception - { - Writer code = new StringWriter(); - code.write( "#define __SGI_STL_INTERNAL_ALGOBASE_H\n" ); - code.write( "#include \n" ); - code.write( "template \n" ); - code.write( "inline void swap(_Tp& __a, _Tp& __b) {\n" ); - code.write( "__STL_REQUIRES(_Tp, _Assignable);\n" ); - code.write( "_Tp __tmp = __a;\n" ); - code.write( "__a = __b;\n" ); - code.write( "__b = __tmp;\n" ); - code.write( "}\n" ); - - parse( code.toString() ); - Iterator i = quickParseCallback.iterateOffsetableElements(); - assertTrue( i.hasNext() ); - assertTrue( i.next() instanceof IASTMacro ); - assertTrue( i.hasNext() ); - assertTrue( i.next() instanceof IASTInclusion ); - assertTrue( i.hasNext() ); - assertTrue( i.next() instanceof IASTDeclaration ); - assertFalse( i.hasNext() ); - } - - public void testBug36771() throws Exception { - Writer code = new StringWriter(); - code.write("#include /**/ \"foo.h\"\n"); - - parse( code.toString() ); - - Iterator includes = quickParseCallback.getInclusions(); - - IASTInclusion include = (IASTInclusion)includes.next(); - assertTrue( include.getName().equals("foo.h") ); - assertFalse( includes.hasNext() ); - } - - - public void testBug36811() throws Exception - { - Writer code = new StringWriter(); - code.write( "using namespace std;\n" ); - code.write( "class Test {};" ); - parse( code.toString() ); - Iterator i = quickParseCallback.iterateOffsetableElements(); - while( i.hasNext() ) - assertNotNull( i.next() ); - } - - public void testBug36708() throws Exception { - Iterator declarations = parse("enum { isPointer = PointerTraits::result };").getDeclarations(); - IASTEnumerationSpecifier enumSpec = (IASTEnumerationSpecifier)((IASTAbstractTypeSpecifierDeclaration)declarations.next()).getTypeSpecifier(); - assertFalse( declarations.hasNext() ); - Iterator enumerators = enumSpec.getEnumerators(); - IASTEnumerator enumerator = (IASTEnumerator)enumerators.next(); - assertFalse( enumerators.hasNext() ); - assertEquals( enumerator.getName(), "isPointer"); - assertEquals( enumerator.getInitialValue().getExpressionKind(), IASTExpression.Kind.ID_EXPRESSION ); - assertEquals( enumerator.getInitialValue().getIdExpression(), "PointerTraits::result"); - } - - public void testBug36690() throws Exception { - parse("Functor(const Functor& rhs) : spImpl_(Impl::Clone(rhs.spImpl_.get())){}").getDeclarations(); - } - - public void testBug36703() throws Exception { - parse("const std::type_info& Get() const;"); - } - - public void testBug36692() throws Exception { - Writer code = new StringWriter(); - code.write("template \n"); - code.write("void SetLongevity(T* pDynObject, unsigned int longevity,\n"); - code.write("Destroyer d = Private::Deleter::Delete){}\n"); - parse(code.toString()); - } - - public void testBug36551() throws Exception - { - Writer code = new StringWriter(); - code.write( "class TextFrame {\n" ); - code.write( "BAD_MACRO()\n"); - code.write( "};"); - parse( code.toString(), true, false ); - } - - public void testBug36247() throws Exception - { - Writer code = new StringWriter(); - code.write( "class A {\n" ); - code.write( "INLINE_DEF int f ();\n" ); - code.write( "INLINE_DEF A g ();" ); - code.write( "INLINE_DEF A * h ();" ); - code.write( "INLINE_DEF A & unlock( void );"); - code.write( "};" ); - parse(code.toString()); - } - - public void testStruct() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "struct mad_bitptr { unsigned char const *byte;\n" ); - writer.write( "unsigned short cache;\n unsigned short left;};" ); - parse( writer.toString() ); - } - - public void testBug36559() throws Exception - { - Writer code = new StringWriter(); - code.write( "namespace myNameSpace {\n" ); - code.write( "template class B {};\n" ); - code.write( "template<> class B {};\n" ); - code.write( "}\n" ); - parse( code.toString() ); - } - - public void testPointersToFunctions() throws Exception - { - Writer code = new StringWriter(); - code.write( "void (*name)( void );\n"); - code.write( "static void * (* const orig_malloc_hook)(const char *file, int line, size_t size);\n"); - - Iterator declarations = parse( code.toString() ).getDeclarations(); - IASTVariable p2f = (IASTVariable)declarations.next(); - assertSimpleType( p2f, IASTSimpleTypeSpecifier.Type.VOID ); - assertEquals( p2f.getName(), "name" ); - Iterator parameters = p2f.getAbstractDeclaration().getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.VOID ); - assertEquals( parm.getName(), "" ); - - p2f = (IASTVariable)declarations.next(); - assertSimpleType( p2f, IASTSimpleTypeSpecifier.Type.VOID ); - assertTrue( p2f.isStatic() ); - Iterator rtPo = p2f.getAbstractDeclaration().getPointerOperators(); - assertEquals( rtPo.next(), ASTPointerOperator.POINTER ); - assertFalse( rtPo.hasNext() ); - parameters = p2f.getAbstractDeclaration().getParameters(); - parm = (IASTParameterDeclaration)parameters.next(); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.CHAR ); - assertEquals( parm.getName(), "file" ); - assertTrue( parm.isConst() ); - assertTrue( parm.getPointerOperators().hasNext() ); - parm = (IASTParameterDeclaration)parameters.next(); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( parm.getName(), "line" ); - parm = (IASTParameterDeclaration)parameters.next(); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ); - assertEquals( parm.getName(), "size" ); - assertFalse( parameters.hasNext() ); - } - - public void testBug36600() throws Exception - { - IASTVariable p2f = (IASTVariable)parse( "enum mad_flow (*input_func)(void *, struct mad_stream *);").getDeclarations().next(); - IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier)p2f.getAbstractDeclaration().getTypeSpecifier(); - assertEquals( elab.getName(), "mad_flow"); - assertEquals( elab.getClassKind(), ASTClassKind.ENUM ); - assertEquals( p2f.getName(), "input_func"); - Iterator parms = p2f.getAbstractDeclaration().getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parms.next(); - assertEquals( parm.getName(), "" ); - assertEquals( parm.getPointerOperators().next(), ASTPointerOperator.POINTER); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.VOID); - parm = (IASTParameterDeclaration)parms.next(); - assertEquals( parm.getName(), "" ); - assertEquals( parm.getPointerOperators().next(), ASTPointerOperator.POINTER); - elab = (IASTElaboratedTypeSpecifier)parm.getTypeSpecifier(); - assertEquals( elab.getName(), "mad_stream"); - assertEquals( elab.getClassKind(), ASTClassKind.STRUCT ); - - - } - - public void testBug36713() throws Exception { - Writer code = new StringWriter(); - code.write("A ( * const fPtr) (void *); \n"); - code.write("A (* const fPtr2) ( A * ); \n"); - parse(code.toString()).getDeclarations(); - } - - // K&R Test hasn't been ported from DOMTests - // still need to figure out how to represent these in the AST -// public void testOldKRFunctionDeclarations() throws Exception -// { -// // Parse and get the translaton unit -// Writer code = new StringWriter(); -// code.write("bool myFunction( parm1, parm2, parm3 )\n"); -// code.write("const char* parm1;\n"); -// code.write("int (*parm2)(float);\n"); -// code.write("{}"); -// TranslationUnit translationUnit = parse(code.toString()); -// -// // Get the declaration -// List declarations = translationUnit.getDeclarations(); -// assertEquals(1, declarations.size()); -// SimpleDeclaration simpleDeclaration = (SimpleDeclaration)declarations.get(0); -// assertEquals( simpleDeclaration.getDeclSpecifier().getType(), DeclSpecifier.t_bool ); -// List declarators = simpleDeclaration.getDeclarators(); -// assertEquals( 1, declarators.size() ); -// Declarator functionDeclarator = (Declarator)declarators.get( 0 ); -// assertEquals( functionDeclarator.getName().toString(), "myFunction" ); -// -// ParameterDeclarationClause pdc = functionDeclarator.getParms(); -// assertNotNull( pdc ); -// List parameterDecls = pdc.getDeclarations(); -// assertEquals( 3, parameterDecls.size() ); -// ParameterDeclaration parm1 = (ParameterDeclaration)parameterDecls.get( 0 ); -// assertNotNull( parm1.getDeclSpecifier().getName() ); -// assertEquals( "parm1", parm1.getDeclSpecifier().getName().toString() ); -// List parm1Decls = parm1.getDeclarators(); -// assertEquals( 1, parm1Decls.size() ); -// -// ParameterDeclaration parm2 = (ParameterDeclaration)parameterDecls.get( 1 ); -// assertNotNull( parm2.getDeclSpecifier().getName() ); -// assertEquals( "parm2", parm2.getDeclSpecifier().getName().toString() ); -// List parm2Decls = parm2.getDeclarators(); -// assertEquals( 1, parm2Decls.size() ); -// -// ParameterDeclaration parm3 = (ParameterDeclaration)parameterDecls.get( 2 ); -// assertNotNull( parm3.getDeclSpecifier().getName() ); -// assertEquals( "parm3", parm3.getDeclSpecifier().getName().toString() ); -// List parm3Decls = parm3.getDeclarators(); -// assertEquals( 1, parm3Decls.size() ); -// -// OldKRParameterDeclarationClause clause = pdc.getOldKRParms(); -// assertNotNull( clause ); -// assertEquals( clause.getDeclarations().size(), 2 ); -// SimpleDeclaration decl1 = (SimpleDeclaration)clause.getDeclarations().get(0); -// assertEquals( decl1.getDeclarators().size(), 1 ); -// assertTrue(decl1.getDeclSpecifier().isConst()); -// assertFalse(decl1.getDeclSpecifier().isVolatile()); -// assertEquals( decl1.getDeclSpecifier().getType(), DeclSpecifier.t_char); -// Declarator declarator1 = (Declarator)decl1.getDeclarators().get( 0 ); -// assertEquals( declarator1.getName().toString(), "parm1" ); -// List ptrOps1 = declarator1.getPointerOperators(); -// assertNotNull( ptrOps1 ); -// assertEquals( 1, ptrOps1.size() ); -// PointerOperator po1 = (PointerOperator)ptrOps1.get(0); -// assertNotNull( po1 ); -// assertFalse( po1.isConst() ); -// assertFalse( po1.isVolatile() ); -// assertEquals( po1.getType(), PointerOperator.t_pointer ); -// -// SimpleDeclaration declaration = (SimpleDeclaration)clause.getDeclarations().get(1); -// assertEquals( declaration.getDeclSpecifier().getType(), DeclSpecifier.t_int ); -// assertEquals( declaration.getDeclarators().size(), 1); -// assertNull( ((Declarator)declaration.getDeclarators().get(0)).getName() ); -// assertNotNull( ((Declarator)declaration.getDeclarators().get(0)).getDeclarator() ); -// assertEquals( ((Declarator)declaration.getDeclarators().get(0)).getDeclarator().getName().toString(), "parm2" ); -// ParameterDeclarationClause clause2 = ((Declarator)declaration.getDeclarators().get(0)).getParms(); -// assertEquals( clause2.getDeclarations().size(), 1 ); -// assertEquals( ((ParameterDeclaration)clause2.getDeclarations().get(0)).getDeclarators().size(), 1 ); -// assertNull( ((Declarator)((ParameterDeclaration)clause2.getDeclarations().get(0)).getDeclarators().get(0)).getName() ); -// assertEquals( ((ParameterDeclaration)clause2.getDeclarations().get(0)).getDeclSpecifier().getType(), DeclSpecifier.t_float ); -// } - - public void testPointersToMemberFunctions() throws Exception - { - IASTVariable p2m = (IASTVariable)parse("void (A::*name)(void);").getDeclarations().next(); - assertSimpleType( p2m, IASTSimpleTypeSpecifier.Type.VOID ); - assertEquals( p2m.getName(), "A::name"); - assertEquals( p2m.getAbstractDeclaration().getPointerToFunctionOperator(), ASTPointerOperator.POINTER); - Iterator parameters = p2m.getAbstractDeclaration().getParameters(); - IASTParameterDeclaration parm = (IASTParameterDeclaration)parameters.next(); - assertFalse( parameters.hasNext() ); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.VOID ); - assertEquals( parm.getName(), "" ); - } - - public void testBug39550() throws Exception - { - parse("double x = 0x1.fp1;").getDeclarations().next(); - } - - public void testBug39552A() throws Exception - { - Writer code = new StringWriter(); - - code.write("%:define glue(x, y) x %:%: y /* #define glue(x, y) x ## y. */\n"); - code.write("#ifndef glue\n"); - code.write("#error glue not defined!\n"); - code.write("#endif\n"); - - code.write("%:define str(x) %:x /* #define str(x) #x */\n"); - - code.write("int main (int argc, char *argv<::>) /* argv[] */\n"); - code.write("glue (<, %) /* { */\n"); - code.write(" /* di_str[] = */\n"); - code.write(" const char di_str glue(<, :)glue(:, >) = str(%:%:<::><%%>%:);\n"); - code.write(" /* Check the glue macro actually pastes, and that the spelling of\n"); - code.write(" all digraphs is preserved. */\n"); - code.write(" if (glue(strc, mp) (di_str, \"%:%:<::><%%>%:\"))\n"); - code.write(" err (\"Digraph spelling not preserved!\");\n"); - code.write(" return 0;\n"); - code.write("glue (%, >) /* } */\n"); - - parse(code.toString()); - } - - public void testBug39552B() throws Exception - { - Writer code = new StringWriter(); - - code.write("??=include \n"); - code.write("??=define TWELVE 1??/\n"); - code.write("2\n"); - - code.write("static const char str??(??) = \"0123456789??/n\";\n"); - - code.write("int\n"); - code.write("main(void)\n"); - code.write("??<\n"); - code.write(" unsigned char x = 5;\n"); - code.write(" if (sizeof str != TWELVE)\n"); - code.write(" abort ();\n"); - code.write(" /* Test ^=, the only multi-character token to come from trigraphs. */\n"); - code.write(" x ??'= 3;\n"); - code.write(" if (x != 6)\n"); - code.write(" abort ();\n"); - code.write(" if ((5 ??! 3) != 7)\n"); - code.write(" abort ();\n"); - code.write(" return 0;\n"); - code.write("??>\n"); - - parse(code.toString()); - } - - public void testBug39553() throws Exception - { - parse("#define COMP_INC \"foobar.h\" \n" + "#include COMP_INC"); - assertTrue( quickParseCallback.getInclusions().hasNext() ); - } - - public void testBug39537() throws Exception - { - parse("typedef foo<(U::id > 0)> foobar;"); - assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() ); - } - - public void testBug39546() throws Exception - { - parse("signed char c = (signed char) 0xffffffff;"); - assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() ); - } - - public void testIndirectDeclarators() throws Exception - { - IASTVariable v = (IASTVariable)parse( "void (*x)( int );").getDeclarations().next(); - assertEquals( v.getName(), "x"); - assertSimpleType( v, IASTSimpleTypeSpecifier.Type.VOID ); - assertParameterSimpleType( (IASTParameterDeclaration)v.getAbstractDeclaration().getParameters().next(), IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( v.getAbstractDeclaration().getPointerToFunctionOperator(), ASTPointerOperator.POINTER ); - - v = (IASTVariable)parse( "const int * (* const something)( const int * const * const );").getDeclarations().next(); - assertEquals( v.getName(), "something"); - assertEquals( v.getAbstractDeclaration().getPointerToFunctionOperator(), ASTPointerOperator.CONST_POINTER); - assertTrue( v.getAbstractDeclaration().isConst() ); - assertSimpleType( v, IASTSimpleTypeSpecifier.Type.INT ); - assertEquals( v.getAbstractDeclaration().getPointerOperators().next(), ASTPointerOperator.POINTER ); - IASTParameterDeclaration parm = (IASTParameterDeclaration)v.getAbstractDeclaration().getParameters().next(); - assertParameterSimpleType( parm, IASTSimpleTypeSpecifier.Type.INT ); - Iterator pointerOps = parm.getPointerOperators(); - assertEquals( pointerOps.next(), ASTPointerOperator.CONST_POINTER ); - assertEquals( pointerOps.next(), ASTPointerOperator.CONST_POINTER ); - assertFalse( pointerOps.hasNext() ); - - IASTTypedefDeclaration typedef = (IASTTypedefDeclaration)parse( "typedef void (*life)(int);").getDeclarations().next(); - assertEquals( typedef.getName(), "life"); - assertSimpleType( typedef, IASTSimpleTypeSpecifier.Type.VOID ); - assertParameterSimpleType( (IASTParameterDeclaration)typedef.getAbstractDeclarator().getParameters().next(), IASTSimpleTypeSpecifier.Type.INT ); - - IASTFunction f = (IASTFunction)parse( "void (f)(void);").getDeclarations().next(); - assertEquals( f.getName(), "f"); - - typedef = (IASTTypedefDeclaration)parse( "typedef void (life)(int);").getDeclarations().next(); - assertEquals( typedef.getName(), "life"); - - } - - public void testBug39532() throws Exception - { - parse("class N1::N2::B : public A {};"); - assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() ); - } - - public void testBug39540() throws Exception - { - parse("class {} const null;"); - assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() ); - } - - public void testBug39530() throws Exception - { - parse( "X sPassed(-1)"); - } - - public void testBug39526() throws Exception - { - parse("UnitList unit_list (String(\"keV\"));"); - } - - public void testBug39535() throws Exception - { - parse("namespace bar = foo;"); - } - - public void testBug39504B() throws Exception - { - parse("int y = sizeof (int*);"); - } - public void testBug39505A() throws Exception - { - parse("int AD::* gp_down = static_cast(gp_stat);"); - } - public void testBug39505B() throws Exception - { - parse("int* gp_down = static_cast(gp_stat);"); - } - - public void testBug42985() throws Exception - { - parse( "const int x = 4; int y = ::x;"); - } - - public void testBug40419() throws Exception - { - Writer code = new StringWriter(); - try - { - code.write( "template struct SuperSubclass {\n" ); - code.write( "enum { value = (::Loki::Conversion::exists && \n" ); - code.write( "!::Loki::Conversion::sameType) }; };" ); - } catch( IOException ioe ){} - parse( code.toString() ); - } - - public void testBug39556() throws Exception - { - parse("int *restrict ip_fn (void);", true, true, ParserLanguage.C).getDeclarations().next(); - - } - - /** - * Test code: struct Example { Example(); Example(int); ~Example();}; - * Purpose: tests a declaration in a class scope. - */ - public void testBug43371 () throws Exception - { - // Parse and get the translaton unit - Writer code = new StringWriter(); - code.write("struct Example { Example(); Example(int); ~Example();};"); - IASTCompilationUnit cu = parse(code.toString()); - Iterator i = cu.getDeclarations(); - assertTrue(i.hasNext()); - IASTAbstractTypeSpecifierDeclaration declaration = - (IASTAbstractTypeSpecifierDeclaration)i.next(); - assertFalse(i.hasNext()); - assertTrue( declaration.getTypeSpecifier() instanceof IASTClassSpecifier); - assertTrue(((IASTClassSpecifier)declaration.getTypeSpecifier()).getClassKind()== ASTClassKind.STRUCT); - Iterator j =((IASTClassSpecifier)declaration.getTypeSpecifier()).getDeclarations(); - assertTrue(j.hasNext()); - IASTMethod m1 = (IASTMethod)j.next(); - IASTMethod m2 = (IASTMethod)j.next(); - IASTMethod m3 = (IASTMethod)j.next(); - assertFalse(j.hasNext()); - assertTrue(m1.getVisiblity() == ASTAccessVisibility.PUBLIC); - assertTrue(m2.getVisiblity() == ASTAccessVisibility.PUBLIC); - assertTrue(m3.getVisiblity() == ASTAccessVisibility.PUBLIC); - } - - public void testBug43644() throws Exception - { - Iterator i = parse( "void foo();{ int x; }", true, false ).getDeclarations(); - IASTFunction f = (IASTFunction)i.next(); - assertEquals( f.getName(), "foo"); - assertFalse( i.hasNext() ); - } - - public void testBug43062() throws Exception - { - Iterator i = parse( "class X { operator short (); operator int unsigned(); operator int signed(); };").getDeclarations(); - IASTClassSpecifier classX = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - assertFalse( i.hasNext() ); - Iterator members = classX.getDeclarations(); - IASTMethod shortMethod = (IASTMethod)members.next(); - IASTMethod unsignedMethod = (IASTMethod)members.next(); - IASTMethod signedMethod = (IASTMethod)members.next(); - assertFalse( members.hasNext() ); - assertEquals( shortMethod.getName(), "operator short"); - assertEquals( unsignedMethod.getName(), "operator int unsigned"); - assertEquals( signedMethod.getName(), "operator int signed"); - } - - public void testBug39531() throws Exception - { - parse("class AString { operator char const *() const; };"); - } - - public void testBug40007() throws Exception - { - assertCodeFailsParse("int y = #;"); - } - - public void testBug40759() throws Exception - { - IASTClassSpecifier classSpec = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)assertSoleDeclaration( "#define X SomeName \n class X {};" )).getTypeSpecifier(); - assertEquals( classSpec.getNameOffset() + 1, classSpec.getNameEndOffset() ); - assertEquals( classSpec.getName(), "SomeName"); - } - - public void testBug44633() throws Exception - { - Writer writer = new StringWriter(); - writer.write( "template class A {};\n" ); - writer.write( "class B { template friend class A;\n" ); - writer.write( "void method();\n" ); - writer.write( "};\n" ); - Iterator i = parse( writer.toString() ).getDeclarations(); - - assertTrue( i.next() instanceof IASTTemplateDeclaration ); - IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier(); - Iterator members = classB.getDeclarations(); - assertTrue (members.next() instanceof IASTTemplateDeclaration ); - assertTrue( members.next() instanceof IASTMethod ); - assertFalse( i.hasNext() ); - } - - public void testBug39525() throws Exception - { - parse("C &(C::*DD)(const C &x) = &C::operator=;"); - } - - public void testBug41935() throws Exception - { - Iterator i = parse( "namespace A { int x; } namespace B = A;" ).getDeclarations(); - assertTrue( i.next() instanceof IASTNamespaceDefinition ); - IASTNamespaceAlias a = (IASTNamespaceAlias)i.next(); - assertEquals( a.getName(), "B" ); - assertFalse( i.hasNext() ); - } - - public void testBug39528() throws Exception - { - Writer code = new StringWriter(); - try - { - code.write("struct B: public A {\n"); - code.write(" A a;\n"); - code.write(" B() try : A(1), a(2)\n"); - code.write(" { throw 1; }\n"); - code.write(" catch (...)\n"); - code.write(" { if (c != 3) r |= 1; }\n"); - code.write("};\n"); - } - catch (IOException ioe) - { - } - IASTClassSpecifier structB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)assertSoleDeclaration(code.toString())).getTypeSpecifier(); - Iterator members = structB.getDeclarations(); - IASTField a = (IASTField)members.next(); - IASTMethod b = (IASTMethod)members.next(); - assertFalse( members.hasNext() ); - assertTrue( b.hasFunctionTryBlock() ); - } - - public void testBug39538() throws Exception - { - parse("template C::operator int ();"); - } - - public void testBug39536() throws Exception - { - Writer writer = new StringWriter(); - writer.write( "template\n" ); - writer.write( "class X {\n" ); - writer.write( "X(); // This fails \n" ); - writer.write( "inline X(int); // This also fails \n" ); - writer.write( "inline ~X(); // This works fine \n" ); - writer.write( "};\n" ); - IASTTemplateDeclaration template = (IASTTemplateDeclaration)assertSoleDeclaration( writer.toString() ); - IASTClassSpecifier X = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)template.getOwnedDeclaration()).getTypeSpecifier(); - Iterator members = X.getDeclarations(); - IASTMethod defaultCons = (IASTMethod)members.next(); - IASTMethod inlinedCons = (IASTMethod)members.next(); - IASTMethod destructor = (IASTMethod)members.next(); - assertFalse( members.hasNext() ); - } - - public void testBug39536A() throws Exception - { - IASTTemplateDeclaration template = (IASTTemplateDeclaration)parse("template class X { X(); };").getDeclarations().next(); - IASTClassSpecifier classX = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)template.getOwnedDeclaration()).getTypeSpecifier(); - IASTDeclaration d = (IASTDeclaration)classX.getDeclarations().next(); - assertTrue( d instanceof IASTMethod); - } - public void testBug39536B() throws Exception - { - parse("template class X { inline X(int); };"); - } - - public void testBug39542() throws Exception - { - parse("void f(int a, struct {int b[a];} c) {}"); - } - - //Here starts C99-specific section - public void testBug39549() throws Exception - { - parse("struct X x = { .b = 40, .z = { sizeof(X), 42 }, .t[3] = 2, .t.f[3].x = A * B };", true, true, ParserLanguage.C); - // with trailing commas - parse("struct X x = { .b = 40, .z = { sizeof(X), 42,}, .t[3] = 2, .t.f[3].x = A * B ,};", true, true, ParserLanguage.C); - } - - public void testBug39551A() throws Exception - { - IASTFunction function = (IASTFunction)parse("extern float _Complex conjf (float _Complex);", true, true, ParserLanguage.C).getDeclarations().next(); - assertEquals( function.getName(), "conjf"); - assertTrue( ((IASTSimpleTypeSpecifier)function.getReturnType().getTypeSpecifier()).isComplex() ); - } - - public void testBug39551B() throws Exception - { - IASTVariable variable = (IASTVariable)parse("_Imaginary double id = 99.99 * __I__;", true, true, ParserLanguage.C).getDeclarations().next(); - assertEquals( variable.getName(), "id"); - assertTrue( ((IASTSimpleTypeSpecifier)variable.getAbstractDeclaration().getTypeSpecifier()).isImaginary() ); - } - - public void testCBool() throws Exception - { - IASTVariable variable = (IASTVariable)assertSoleDeclaration( "_Bool x;", ParserLanguage.C ); - assertSimpleType( variable, IASTSimpleTypeSpecifier.Type._BOOL ); - } - - public void testBug39678() throws Exception - { - IASTVariable variable = (IASTVariable) assertSoleDeclaration("char *s = L\"a\" \"b\";"); - IASTExpression exp = variable.getInitializerClause().getAssigmentExpression(); - assertEquals( exp.getLiteralString(), "ab"); - } - - public void testBug43110() throws Exception - { - IASTFunction function = (IASTFunction) assertSoleDeclaration( "void x( int y, ... );"); - assertTrue( function.takesVarArgs() ); - function = (IASTFunction) assertSoleDeclaration( "void x( int y... );"); - assertTrue( function.takesVarArgs() ); - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java deleted file mode 100644 index 5949a616bd3..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java +++ /dev/null @@ -1,1532 +0,0 @@ -package org.eclipse.cdt.core.parser.tests; - -import java.io.StringWriter; -import java.io.Writer; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IMacroDescriptor; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerException; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.internal.core.parser.Token; - -/** - * @author jcamelon - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ScannerTestCase extends BaseScannerTest -{ - public class TableRow - { - private int[] values; - private int length; - - public TableRow(int[] v) - { - length= v.length; - values= new int[length]; - System.arraycopy(v, 0, values, 0, length); - } - - public String toString() - { - StringBuffer s= new StringBuffer(); - for (int i= 0; i < length; ++i) - { - s.append("var").append(i).append("=").append(values[i]).append(" "); - } - return s.toString(); - } - - public String symbolName(int index) - { - return "DEFINITION" + index; - } - - public int symbolValue(int index) - { - return new Long(Math.round(Math.pow(index, index))).intValue(); - } - - public String generateCode() - { - if (length < 2) - { - return "Array must have at least 2 elements"; - } - int numberOfElsifs= length - 1; - StringBuffer buffer= new StringBuffer(); - buffer.append("#if ").append(values[0]).append("\n#\tdefine "); - buffer.append(symbolName(0)).append(" ").append(symbolValue(0)); - for (int i= 0; i < numberOfElsifs; ++i) - buffer - .append("\n#elif ") - .append(values[1 + i]) - .append("\n#\tdefine ") - .append(symbolName(i + 1)) - .append(" ") - .append(symbolValue(i + 1)); - buffer - .append("\n#else \n#\tdefine ") - .append(symbolName(length)) - .append(" ") - .append(symbolValue(length)) - .append("\n#endif"); - return buffer.toString(); - } - - public int selectWinner() - { - for (int i= 0; i < values.length; ++i) - { - if (values[i] != 0) - { - return i; - } - } - return length; - } - /** - * Returns the length. - * @return int - */ - public int getLength() - { - return length; - } - - } - - public class TruthTable - { - private int numberOfVariables; - private int numberOfRows; - public TableRow[] rows; - - public TruthTable(int n) - { - numberOfVariables= n; - numberOfRows= new Long(Math.round(Math.pow(2, n))).intValue(); - - rows= new TableRow[numberOfRows]; - for (int i= 0; i < numberOfRows; ++i) - { - String Z= Integer.toBinaryString(i); - - int[] input= new int[numberOfVariables]; - for (int j= 0; j < numberOfVariables; ++j) - { - int padding= numberOfVariables - Z.length(); - int k= 0; - for (; k < padding; ++k) - { - input[k]= 0; - } - for (int l= 0; l < Z.length(); ++l) - { - char c= Z.charAt(l); - int value= Character.digit(c, 10); - input[k++]= value; - } - } - rows[i]= new TableRow(input); - } - } - /** - * Returns the numberOfRows. - * @return int - */ - public int getNumberOfRows() - { - return numberOfRows; - } - - } - - public final static boolean doIncludeStdio= false; - public final static boolean doIncludeWindowsH= false; - public final static boolean doIncludeWinUserH= false; - - public final static int SIZEOF_TRUTHTABLE = 10; - - - public void testWeirdStrings() throws Exception - { - try - { - initializeScanner( "Living Life L\"LONG\""); - validateIdentifier( "Living" ); - validateIdentifier( "Life" ); - validateString("LONG", true); - validateEOF(); - } - catch( ScannerException se ) - { - fail(EXCEPTION_THROWN + se.toString()); - } - - } - - - public void testNumerics()throws Exception - { - try - { - initializeScanner("3.0 0.9 .5 3. 4E5 2.01E-03 ..."); - validateFloatingPointLiteral( "3.0"); - validateFloatingPointLiteral( "0.9"); - validateFloatingPointLiteral( ".5"); - validateFloatingPointLiteral( "3."); - validateFloatingPointLiteral( "4E5"); - validateFloatingPointLiteral( "2.01E-03" ); - validateToken( IToken.tELLIPSIS ); - validateEOF(); - } - catch( ScannerException se ) - { - fail(EXCEPTION_THROWN + se.toString()); - } - - } - - - /** - * Constructor for ScannerTestCase. - * @param name - */ - public ScannerTestCase(String name) - { - super(name); - } - - public void testPreprocessorDefines()throws Exception - { - try - { - initializeScanner("#define SIMPLE_NUMERIC 5\nint x = SIMPLE_NUMERIC"); - validateToken(IToken.t_int); - validateDefinition("SIMPLE_NUMERIC", "5"); - validateIdentifier("x"); - validateToken(IToken.tASSIGN); - validateInteger("5"); - validateEOF(); - - initializeScanner("#define SIMPLE_STRING \"This is a simple string.\"\n\nconst char * myVariable = SIMPLE_STRING;"); - validateToken(IToken.t_const); - validateDefinition("SIMPLE_STRING", "\"This is a simple string.\""); - validateToken(IToken.t_char); - validateToken(IToken.tSTAR); - validateIdentifier("myVariable"); - validateToken(IToken.tASSIGN); - validateString("This is a simple string."); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define FOOL 5 \n int tryAFOOL = FOOL + FOOL;"); - - validateToken(IToken.t_int); - validateIdentifier("tryAFOOL"); - validateToken(IToken.tASSIGN); - validateInteger("5"); - validateToken(IToken.tPLUS); - validateInteger("5"); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define FOOL 5 \n int FOOLer = FOOL;"); - - validateToken(IToken.t_int); - validateIdentifier("FOOLer"); - validateToken(IToken.tASSIGN); - validateInteger("5"); - validateToken(IToken.tSEMI); - validateEOF(); - - // the case we were failing against in ctype.h - // this is a definition, not a macro! - initializeScanner("#define _ALPHA (0x0100|_UPPER|_LOWER)"); - validateEOF(); - validateDefinition("_ALPHA", "(0x0100|_UPPER|_LOWER)"); - - // test for comments after the macro - initializeScanner("#define NO_COMMENT// ignore me"); - validateEOF(); - validateDefinition("NO_COMMENT", ""); - - initializeScanner("#define NO_COMMENT/* ignore me*/"); - validateEOF(); - validateDefinition("NO_COMMENT", ""); - - initializeScanner("#define ANSWER 42 // i think"); - validateEOF(); - validateDefinition("ANSWER", "42"); - - initializeScanner("#define ANSWER 42 /* i think */"); - validateEOF(); - validateDefinition("ANSWER", "42"); - - initializeScanner("#define MULTILINE 3 /* comment \n that goes more than one line */"); - validateEOF(); - validateDefinition("MULTILINE", "3"); - - initializeScanner("#define MULTICOMMENT X /* comment1 */ + Y /* comment 2 */"); - validateEOF(); - validateDefinition("MULTICOMMENT", "X + Y"); - - for (int i= 0; i < 7; ++i) - { - switch (i) - { - case 0 : - initializeScanner("#define SIMPLE_STRING This is a simple string.\n"); - break; - case 1 : - initializeScanner("# define SIMPLE_NUMERIC 5\n"); - break; - case 2 : - initializeScanner("# define SIMPLE_NUMERIC 5\n"); - break; - case 3 : - initializeScanner("#define SIMPLE_STRING \"This is a simple string.\"\n"); - break; - case 4 : - initializeScanner("#define SIMPLE_STRING This is a simple string.\n"); - break; - case 5 : - initializeScanner("#define FLAKE\n\nFLAKE"); - break; - case 6 : - initializeScanner("#define SIMPLE_STRING This is a simple string.\\\n Continue please."); - break; - } - validateEOF(); - - switch (i) - { - case 0 : - validateDefinition( - "SIMPLE_STRING", - "This is a simple string."); - break; - case 1 : - validateDefinition("SIMPLE_NUMERIC", "5"); - break; - case 2 : - validateDefinition("SIMPLE_NUMERIC", "5"); - break; - case 3 : - validateDefinition( - "SIMPLE_STRING", - "\"This is a simple string.\""); - break; - case 4 : - validateDefinition( - "SIMPLE_STRING", - "This is a simple string."); - break; - case 5 : - validateDefinition("FLAKE", ""); - break; - case 6 : - validateDefinition( - "SIMPLE_STRING", - "This is a simple string. Continue please."); - } - } - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - public void prepareForWindowsRH() - { - scanner.addIncludePath( - "C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include"); - scanner.addDefinition("_WIN32_WINNT", "0x0300"); - scanner.addDefinition("WINVER", "0x0400"); - scanner.addDefinition("_WIN32_WINDOWS", "0x0300"); - scanner.addDefinition("_MSC_VER", "1200"); - } - - public void prepareForWindowsH() - { - scanner.addIncludePath( - "C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include"); - scanner.addDefinition("_MSC_VER", "1200"); - scanner.addDefinition("__cplusplus", "1"); - scanner.addDefinition("__STDC__", "1"); - scanner.addDefinition("_WIN32", ""); - scanner.addDefinition( "__midl", "1000" ); - scanner.addDefinition("_WIN32_WINNT", "0x0300"); - scanner.addDefinition("WINVER", "0x0400"); - scanner.addDefinition( "_M_IX86", "300"); - scanner.addDefinition( "_INTEGRAL_MAX_BITS", "64"); - } - - public void prepareForStdio() - { - scanner.addIncludePath( - "C:\\Program Files\\Microsoft Visual Studio\\VC98\\Include"); - scanner.addDefinition("_MSC_VER", "1100"); - scanner.addDefinition("__STDC__", "1"); - scanner.addDefinition("_INTEGRAL_MAX_BITS", "64"); - scanner.addDefinition("_WIN32", ""); - scanner.addDefinition( "_M_IX86", "300"); - } - - public void testConcatenation() - { - try - { - initializeScanner("#define F1 3\n#define F2 F1##F1\nint x=F2;"); - validateToken(IToken.t_int); - validateDefinition("F1", "3"); - validateDefinition( "F2", "F1##F1"); - validateIdentifier("x"); - validateToken(IToken.tASSIGN); - validateInteger("33"); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define PREFIX RT_\n#define RUN PREFIX##Run"); - validateEOF(); - validateDefinition( "PREFIX", "RT_" ); - validateDefinition( "RUN", "PREFIX##Run" ); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - try - { - initializeScanner( "#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name\n DECLARE_HANDLE( joe )" ); - validateToken( IToken.t_struct ); - validateIdentifier( "joe__"); - validateToken( IToken.tLBRACE); - validateToken( IToken.t_int ); - validateIdentifier( "unused"); - validateToken( IToken.tSEMI ); - validateToken( IToken.tRBRACE ); - validateToken( IToken.tSEMI ); - validateToken( IToken.t_typedef ); - validateToken( IToken.t_struct ); - validateIdentifier( "joe__" ); - validateToken( IToken.tSTAR ); - validateIdentifier( "joe"); - validateEOF(); - } - catch( Exception e ) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - public void testSimpleIfdef() - { - try - { - - initializeScanner("#define SYMBOL 5\n#ifdef SYMBOL\nint counter(SYMBOL);\n#endif"); - - validateToken(IToken.t_int); - validateIdentifier("counter"); - validateToken(IToken.tLPAREN); - validateInteger("5"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define SYMBOL 5\n#ifndef SYMBOL\nint counter(SYMBOL);\n#endif"); - validateEOF(); - - initializeScanner("#ifndef DEFINED\n#define DEFINED 100\n#endif\nint count = DEFINED;"); - validateToken(IToken.t_int); - validateDefinition("DEFINED", "100"); - - validateIdentifier("count"); - validateToken(IToken.tASSIGN); - validateInteger("100"); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#ifndef DEFINED\n#define DEFINED 100\n#endif\nint count = DEFINED;"); - scanner.addDefinition("DEFINED", "101"); - - validateDefinition("DEFINED", "101"); - validateToken(IToken.t_int); - validateIdentifier("count"); - validateToken(IToken.tASSIGN); - validateInteger("101"); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner( "/* NB: This is #if 0'd out */"); - validateEOF(); - - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - public void testMultipleLines() throws Exception - { - Writer code = new StringWriter(); - code.write( "#define COMPLEX_MACRO 33 \\\n"); - code.write( " + 44\n\nCOMPLEX_MACRO"); - initializeScanner( code.toString() ); - validateInteger( "33" ); - validateToken( IToken.tPLUS ); - validateInteger( "44" ); - } - - public void testSlightlyComplexIfdefStructure() - { - try - { - initializeScanner("#ifndef BASE\n#define BASE 10\n#endif\n#ifndef BASE\n#error BASE is defined\n#endif"); - validateEOF(); - validateBalance(); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - try - { - initializeScanner("#ifndef ONE\n#define ONE 1\n#ifdef TWO\n#define THREE ONE + TWO\n#endif\n#endif\nint three(THREE);"); - - validateToken(IToken.t_int); - validateDefinition("ONE", "1"); - validateAsUndefined("TWO"); - validateAsUndefined("THREE"); - validateIdentifier("three"); - validateToken(IToken.tLPAREN); - validateIdentifier("THREE"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateEOF(); - validateBalance(); - - initializeScanner("#ifndef ONE\n#define ONE 1\n#ifdef TWO\n#define THREE ONE + TWO\n#endif\n#endif\nint three(THREE);"); - scanner.addDefinition("TWO", "2"); - validateToken(IToken.t_int); - validateDefinition("ONE", "1"); - validateDefinition("TWO", "2"); - validateDefinition("THREE", "ONE + TWO"); - - validateIdentifier("three"); - validateToken(IToken.tLPAREN); - validateInteger("1"); - validateToken(IToken.tPLUS); - validateInteger("2"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateEOF(); - validateBalance(); - - initializeScanner("#ifndef FOO\n#define FOO 4\n#else\n#undef FOO\n#define FOO 6\n#endif"); - validateEOF(); - validateBalance(); - validateDefinition("FOO", "4"); - - initializeScanner("#ifndef FOO\n#define FOO 4\n#else\n#undef FOO\n#define FOO 6\n#endif"); - scanner.addDefinition("FOO", "2"); - validateEOF(); - validateBalance(); - validateDefinition("FOO", "6"); - - initializeScanner("#ifndef ONE\n# define ONE 1\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#else\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#endif\n"); - validateEOF(); - validateBalance(); - validateDefinition("ONE", "1"); - validateDefinition("TWO", "ONE + ONE"); - - initializeScanner("#ifndef ONE\n# define ONE 1\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#else\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#endif\n"); - scanner.addDefinition("ONE", "one"); - validateEOF(); - validateBalance(); - validateDefinition("ONE", "one"); - validateDefinition("TWO", "ONE + ONE"); - - initializeScanner("#ifndef ONE\n# define ONE 1\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#else\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#endif\n"); - scanner.addDefinition("ONE", "one"); - scanner.addDefinition("TWO", "two"); - validateEOF(); - validateBalance(); - - validateDefinition("ONE", "one"); - validateDefinition("TWO", "2"); - - initializeScanner("#ifndef ONE\n# define ONE 1\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#else\n# ifndef TWO\n# define TWO ONE + ONE \n# else\n# undef TWO\n# define TWO 2 \n# endif\n#endif\n"); - scanner.addDefinition("TWO", "two"); - validateEOF(); - validateBalance(); - - validateDefinition("ONE", "1"); - validateDefinition("TWO", "2"); - - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - public void testIfs() - { - try - { - initializeScanner("#if 0\n#error NEVER\n#endif\n"); - validateEOF(); - validateBalance(); - - initializeScanner("#define X 5\n#define Y 7\n#if (X < Y)\n#define Z X + Y\n#endif"); - validateEOF(); - validateBalance(); - validateDefinition("X", "5"); - validateDefinition("Y", "7"); - validateDefinition("Z", "X + Y"); - - initializeScanner("#if T < 20\n#define Z T + 1\n#endif"); - scanner.addDefinition("X", "5"); - scanner.addDefinition("Y", "7"); - scanner.addDefinition("T", "X + Y"); - validateEOF(); - validateBalance(); - validateDefinition("X", "5"); - validateDefinition("Y", "7"); - validateDefinition("T", "X + Y"); - validateDefinition("Z", "T + 1"); - - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - try - { - initializeScanner("#if ( 10 / 5 ) != 2\n#error 10/5 seems to not equal 2 anymore\n#endif\n"); - validateEOF(); - validateBalance(); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - try - { - initializeScanner("#ifndef FIVE \n#define FIVE 5\n#endif \n#ifndef TEN\n#define TEN 2 * FIVE\n#endif\n#if TEN != 10\n#define MISTAKE 1\n#error Five does not equal 10\n#endif\n"); - scanner.addDefinition("FIVE", "55"); - validateEOF(); - fail(EXPECTED_FAILURE); - } - catch (ScannerException se) - { - validateBalance(1); - validateDefinition("FIVE", "55"); - validateDefinition("TEN", "2 * FIVE"); - validateDefinition("MISTAKE", "1"); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - try - { - initializeScanner("#if ((( FOUR / TWO ) * THREE )< FIVE )\n#error 6 is not less than 5 \n#endif\n#if ( ( FIVE * ONE ) != (( (FOUR) + ONE ) * ONE ) )\n#error 5 should equal 5\n#endif \n"); - - scanner.addDefinition("ONE", "1"); - scanner.addDefinition("TWO", "(ONE + ONE)"); - scanner.addDefinition("THREE", "(TWO + ONE)"); - scanner.addDefinition("FOUR", "(TWO * TWO)"); - scanner.addDefinition("FIVE", "(THREE + TWO)"); - - validateEOF(); - validateBalance(); - validateDefinition("ONE", "1"); - validateDefinition("TWO", "(ONE + ONE)"); - validateDefinition("THREE", "(TWO + ONE)"); - validateDefinition("FOUR", "(TWO * TWO)"); - validateDefinition("FIVE", "(THREE + TWO)"); - - TruthTable table= new TruthTable(SIZEOF_TRUTHTABLE); - int numberOfRows= table.getNumberOfRows(); - TableRow[] rows= table.rows; - - for (int i= 0; i < numberOfRows; ++i) - { - TableRow row= rows[i]; - String code= row.generateCode(); - if (verbose) - System.out.println("\n\nRow " + i + " has code\n" + code); - initializeScanner(code); - validateEOF(); - validateBalance(); - validateAllDefinitions(row); - } - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - try - { - initializeScanner("#if ! 0\n#error Correct!\n#endif"); - scanner.nextToken(); - fail(EXPECTED_FAILURE); - } - catch (ScannerException se) - { - validateBalance(1); - assertEquals( se.getProblem().getID(), IProblem.PREPROCESSOR_POUND_ERROR); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - public void testPreprocessorMacros() - { - try - { - initializeScanner("#define GO(x) x+1\nint y(5);\ny = GO(y);"); - validateToken(IToken.t_int); - validateIdentifier("y"); - validateToken(IToken.tLPAREN); - validateInteger("5"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - - IMacroDescriptor descriptor= - (IMacroDescriptor) scanner.getDefinition("GO"); - List parms= descriptor.getParameters(); - assertNotNull(parms); - assertTrue(parms.size() == 1); - String parm1= (String) parms.get(0); - assertTrue(parm1.equals("x")); - List expansion= descriptor.getTokenizedExpansion(); - assertNotNull(parms); - assertTrue(expansion.size() == 3); - assertTrue(((Token) expansion.get(0)).type == IToken.tIDENTIFIER); - assertTrue(((Token) expansion.get(0)).getImage().equals("x")); - assertTrue(((Token) expansion.get(1)).type == IToken.tPLUS); - assertTrue(((Token) expansion.get(2)).type == IToken.tINTEGER); - assertTrue(((Token) expansion.get(2)).getImage().equals("1")); - - validateIdentifier("y"); - validateToken(IToken.tASSIGN); - validateIdentifier("y"); - validateToken(IToken.tPLUS); - validateInteger("1"); - validateToken(IToken.tSEMI); - validateEOF(); - validateBalance(); - - initializeScanner( - "#define ONE 1\n" - + "#define SUM(a,b,c,d,e,f,g) ( a + b + c + d + e + f + g )\n" - + "int daSum = SUM(ONE,3,5,7,9,11,13);"); - validateToken(IToken.t_int); - validateIdentifier("daSum"); - validateToken(IToken.tASSIGN); - validateToken(IToken.tLPAREN); - validateInteger("1"); - validateToken(IToken.tPLUS); - validateInteger("3"); - validateToken(IToken.tPLUS); - validateInteger("5"); - validateToken(IToken.tPLUS); - validateInteger("7"); - validateToken(IToken.tPLUS); - validateInteger("9"); - validateToken(IToken.tPLUS); - validateInteger("11"); - validateToken(IToken.tPLUS); - validateInteger("13"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateEOF(); - - IMacroDescriptor macro= (IMacroDescriptor) scanner.getDefinition("SUM"); - List params= macro.getParameters(); - assertNotNull(params); - assertTrue(params.size() == 7); - - List tokens= macro.getTokenizedExpansion(); - assertNotNull(tokens); - assertTrue(tokens.size() == 15); - - initializeScanner("#define LOG( format, var1) printf( format, var1 )\nLOG( \"My name is %s\", \"Bogdan\" );\n"); - validateIdentifier("printf"); - validateToken(IToken.tLPAREN); - validateString("My name is %s"); - validateToken(IToken.tCOMMA); - validateString("Bogdan"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define INCR( x ) ++x\nint y(2);\nINCR(y);"); - validateToken(IToken.t_int); - validateIdentifier("y"); - validateToken(IToken.tLPAREN); - validateInteger("2"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateToken(IToken.tINCR); - validateIdentifier("y"); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define CHECK_AND_SET( x, y, z ) if( x ) { \\\n y = z; \\\n }\n\nCHECK_AND_SET( 1, balance, 5000 );\nCHECK_AND_SET( confused(), you, dumb );"); - validateToken(IToken.t_if); - validateToken(IToken.tLPAREN); - validateInteger("1"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tLBRACE); - validateIdentifier("balance"); - validateToken(IToken.tASSIGN); - validateInteger("5000"); - validateToken(IToken.tSEMI); - validateToken(IToken.tRBRACE); - validateToken(IToken.tSEMI); - - validateToken(IToken.t_if); - validateToken(IToken.tLPAREN); - validateIdentifier("confused"); - validateToken(IToken.tLPAREN); - validateToken(IToken.tRPAREN); - validateToken(IToken.tRPAREN); - validateToken(IToken.tLBRACE); - validateIdentifier("you"); - validateToken(IToken.tASSIGN); - validateIdentifier("dumb"); - validateToken(IToken.tSEMI); - validateToken(IToken.tRBRACE); - validateToken(IToken.tSEMI); - validateEOF(); - - initializeScanner("#define ON 7\n#if defined(ON)\nint itsOn = ON;\n#endif"); - validateToken(IToken.t_int); - validateBalance(1); - validateIdentifier("itsOn"); - validateToken(IToken.tASSIGN); - validateInteger("7"); - validateToken(IToken.tSEMI); - validateEOF(); - validateBalance(); - - initializeScanner("#if defined( NOTHING ) \nint x = NOTHING;\n#endif"); - validateEOF(); - validateBalance(); - - - - - - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - public void testQuickScan() throws EndOfFileException, ParserFactoryException - { - try - { - initializeScanner( "#if X + 5 < 7\n int found = 1;\n#endif", ParserMode.QUICK_PARSE ); - validateToken( IToken.t_int ); - validateIdentifier( "found" ); - validateToken( IToken.tASSIGN ); - validateInteger( "1"); - validateToken( IToken.tSEMI ); - validateEOF(); - - } - catch( ScannerException se ) - { - fail( EXCEPTION_THROWN + se.getMessage() ); - } - - try - { - initializeScanner( "#if 0\n int error = 666;\n#endif" ); - validateEOF(); - } - catch( ScannerException se ) - { - fail( EXCEPTION_THROWN + se.getMessage() ); - } - - } - - public void testInclusions() - { - try - { - if (doIncludeStdio) - { - initializeScanner("#include "); - prepareForStdio(); - int count= fullyTokenize(); - if (verbose) - System.out.println( - "For stdio.h, Scanner produced " + count + " tokens"); - validateBalance(); - - initializeScanner("#include \\\n<\\\nstdio.h \\\n>"); - prepareForStdio(); - count= fullyTokenize(); - if (verbose) - System.out.println( - "For stdio.h, Scanner produced " + count + " tokens"); - } - - if (doIncludeWindowsH) - { - initializeScanner("#include "); - prepareForWindowsH(); - int count= fullyTokenize(); - - validateBalance(); - } - - if (doIncludeWinUserH) - { - initializeScanner("#include "); - prepareForWindowsRH(); - validateEOF(); - validateBalance(); - } - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - } - - public void testOtherPreprocessorCommands() throws ParserFactoryException - { - try - { - initializeScanner("#\n#\t\n#define MAX_SIZE 1024\n#\n# "); - validateEOF(); - validateDefinition("MAX_SIZE", "1024"); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - - for (int i= 0; i < 4; ++i) - { - switch (i) - { - case 0 : - initializeScanner("# ape"); - break; - case 1 : - initializeScanner("# #"); - break; - case 2 : - initializeScanner("# 32"); - break; - case 3 : - initializeScanner("# defines"); - break; - } - - try - { - validateEOF(); - fail(EXPECTED_FAILURE); - } - catch (ScannerException se) - { - validateBalance(); - } - catch (Exception e) - { - fail(EXCEPTION_THROWN + e.toString()); - } - } - - } - - public void validateAllDefinitions(TableRow row) - { - int winner= row.selectWinner(); - int rowLength= row.getLength(); - for (int i= 0; i <= rowLength; ++i) - { - if (i == winner) - validateDefinition(row.symbolName(i), row.symbolValue(i)); - else - validateAsUndefined(row.symbolName(i)); - } - } - - public void testBug36287() throws Exception - { - initializeScanner( "X::X( const X & rtg_arg ) : U( rtg_arg ) , Z( rtg_arg.Z ) , er( rtg_arg.er ){}" ); - validateIdentifier("X"); - validateToken( IToken.tCOLONCOLON); - validateIdentifier("X"); - validateToken( IToken.tLPAREN ); - validateToken( IToken.t_const ); - validateIdentifier("X"); - validateToken( IToken.tAMPER ); - validateIdentifier( "rtg_arg"); - validateToken( IToken.tRPAREN ); - validateToken( IToken.tCOLON ); - validateIdentifier( "U"); - validateToken( IToken.tLPAREN ); - validateIdentifier( "rtg_arg"); - validateToken( IToken.tRPAREN ); - validateToken( IToken.tCOMMA ); - validateIdentifier( "Z"); - validateToken( IToken.tLPAREN ); - validateIdentifier( "rtg_arg"); - validateToken( IToken.tDOT ); - validateIdentifier( "Z"); - validateToken( IToken.tRPAREN ); - validateToken( IToken.tCOMMA ); - validateIdentifier( "er"); - validateToken( IToken.tLPAREN ); - validateIdentifier( "rtg_arg"); - validateToken( IToken.tDOT ); - validateIdentifier( "er"); - validateToken( IToken.tRPAREN ); - validateToken( IToken.tLBRACE); - validateToken( IToken.tRBRACE); - validateEOF(); - - initializeScanner( "foo.*bar"); - validateIdentifier("foo"); - validateToken( IToken.tDOTSTAR ); - validateIdentifier("bar"); - validateEOF(); - - initializeScanner( "foo...bar"); - validateIdentifier("foo"); - validateToken( IToken.tELLIPSIS ); - validateIdentifier("bar"); - validateEOF(); - } - - public void testBug35892() throws ParserFactoryException - { - try - { - initializeScanner( "'c'" ); - validateChar( 'c' ); - validateEOF(); - } - catch( ScannerException se ) - { - fail( EXCEPTION_THROWN + se.getMessage() ); - } - } - - public void testBug36045() throws Exception - { - StringBuffer buffer = new StringBuffer(); - buffer.append( '"' ); - buffer.append( '\\'); - buffer.append( '"'); - buffer.append( '"'); - - buffer.append( '"'); - buffer.append( '\\'); - buffer.append( '\\'); - buffer.append( '"'); - buffer.append( "\n\n"); - initializeScanner( buffer.toString()); - validateString( "\\\"\\\\"); - } - - public void testConditionalWithBraces() throws ParserFactoryException - { - try - { - for( int i = 0; i < 4; ++i ) - { - initializeScanner( "int foobar(int a) { if(a == 0) {\n#ifdef THIS\n} else {}\n#elif THAT\n} else {}\n#endif\nreturn 0;}" ); - switch( i ) - { - case 0: - scanner.addDefinition( "THIS", "1"); - scanner.addDefinition( "THAT", "1" ); - break; - case 1: - scanner.addDefinition( "THIS", "1"); - scanner.addDefinition( "THAT", "0" ); - break; - case 2: - scanner.addDefinition( "THAT", "1" ); - break; - case 3: - scanner.addDefinition( "THAT", "0" ); - break; - } - - validateToken( IToken.t_int ); - validateIdentifier( "foobar"); - validateToken( IToken.tLPAREN ); - validateToken( IToken.t_int ); - validateIdentifier( "a" ); - validateToken( IToken.tRPAREN ); - validateToken( IToken.tLBRACE ); - validateToken( IToken.t_if ); - validateToken( IToken.tLPAREN ); - validateIdentifier( "a" ); - validateToken( IToken.tEQUAL ); - validateInteger( "0" ); - validateToken( IToken.tRPAREN ); - validateToken( IToken.tLBRACE ); - - if( i <= 1 ) - { - validateToken( IToken.tRBRACE ); - validateToken( IToken.t_else ); - validateToken( IToken.tLBRACE ); - validateToken( IToken.tRBRACE ); - } - - if( i == 2 ) - { - validateToken( IToken.tRBRACE ); - validateToken( IToken.t_else ); - validateToken( IToken.tLBRACE ); - validateToken( IToken.tRBRACE ); - } - - validateToken( IToken.t_return ); - validateInteger( "0"); - validateToken( IToken.tSEMI ); - validateToken( IToken.tRBRACE ); - validateEOF(); - } - } catch( ScannerException se ) - { - fail(EXCEPTION_THROWN + se.toString()); - } - } - - public void testNestedRecursiveDefines() throws Exception - { - initializeScanner( "#define C B A\n#define B C C\n#define A B\nA" ); - - validateIdentifier("B"); - validateDefinition("A", "B"); - validateDefinition("B", "C C"); - validateDefinition("C", "B A"); - validateIdentifier("A"); - validateIdentifier("B"); - validateIdentifier("A"); - validateEOF(); - } - - public void testBug36316() throws Exception - { - initializeScanner( "#define A B->A\nA" ); - - validateIdentifier("B"); - validateDefinition("A", "B->A"); - validateToken(IToken.tARROW); - validateIdentifier("A"); - validateEOF(); - } - - public void testBug36434() throws Exception - { - initializeScanner( "#define X(Y)"); - validateEOF(); - IMacroDescriptor macro = (IMacroDescriptor)scanner.getDefinition( "X" ); - assertNotNull( macro ); - assertEquals( macro.getParameters().size(), 1 ); - assertEquals( (String)macro.getParameters().get(0), "Y" ); - assertEquals( macro.getTokenizedExpansion().size(), 0 ); - } - - public void testBug36047() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "# define MAD_VERSION_STRINGIZE(str) #str\n" ); - writer.write( "# define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num)\n" ); - writer.write( "# define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) \".\" \\\n" ); - writer.write( " MAD_VERSION_STRING(MAD_VERSION_MINOR) \".\" \\\n" ); - writer.write( " MAD_VERSION_STRING(MAD_VERSION_PATCH) \".\" \\\n" ); - writer.write( " MAD_VERSION_STRING(MAD_VERSION_EXTRA)\n" ); - writer.write( "# define MAD_VERSION_MAJOR 2\n" ); - writer.write( "# define MAD_VERSION_MINOR 1\n" ); - writer.write( "# define MAD_VERSION_PATCH 3\n" ); - writer.write( "# define MAD_VERSION_EXTRA boo\n" ); - writer.write( "MAD_VERSION\n" ); - initializeScanner( writer.toString() ); - - validateString( "2.1.3.boo" ); - - validateEOF(); - } - - public void testBug36475() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( " \"A\" \"B\" \"C\" " ); - - initializeScanner( writer.toString() ); - - validateString( "ABC" ); - validateEOF(); - } - - public void testBug36509() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write("#define debug(s, t) printf(\"x\" # s \"= %d, x\" # t \"= %s\", \\\n"); - writer.write(" x ## s, x ## t) \n"); - writer.write("debug(1, 2);"); - - initializeScanner( writer.toString() ); - //printf("x1=%d, x2= %s", x1, x2); - validateIdentifier( "printf" ); - validateToken( IToken.tLPAREN ); - validateString("x1= %d, x2= %s"); - validateToken(IToken.tCOMMA); - validateIdentifier("x1"); - validateToken(IToken.tCOMMA); - validateIdentifier("x2"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - validateEOF(); - } - - public void testBug36695() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write("\'\\4\' \'\\n\'"); - initializeScanner( writer.toString() ); - - validateChar( "\\4" ); - validateChar( "\\n" ); - validateEOF(); - } - - public void testBug36521() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write("#define str(s) # s\n"); - writer.write("fputs(str(strncmp(\"abc\\0d\", \"abc\", \'\\4\')\n"); - writer.write(" == 0), s);\n"); - - initializeScanner( writer.toString() ); - validateIdentifier("fputs"); - validateToken(IToken.tLPAREN); - validateString("strncmp(\\\"abc\\\\0d\\\", \\\"abc\\\", '\\\\4') == 0"); - validateToken(IToken.tCOMMA); - validateIdentifier("s"); - validateToken(IToken.tRPAREN); - validateToken(IToken.tSEMI); - } - - public void testBug36770() throws Exception - { - StringWriter writer = new StringWriter(); - writer.write( "#define A 0\n" ); - writer.write( "#if ( A == 1 )\n"); - writer.write( "# define foo 1\n"); - writer.write( "#else\n"); - writer.write( "# define foo 2\n"); - writer.write( "#endif\n"); - writer.write( "foo\n"); - initializeScanner( writer.toString() ); - validateInteger( "2" ); - validateEOF(); - } - - public void testBug36816() throws Exception - { - initializeScanner( "#include \"foo.h" ); - try{ - validateEOF(); - } catch ( ScannerException e ){ - assertTrue( e.getProblem().getID() == IProblem.PREPROCESSOR_INVALID_DIRECTIVE ); - } - - initializeScanner( "#include \n" ); - - Callback callback = new Callback( ParserMode.QUICK_PARSE ); - initializeScanner( buffer.toString(), ParserMode.QUICK_PARSE, callback ); - validateEOF(); - assertEquals( callback.problems.size(), 0 ); - assertEquals( callback.inclusions.size(), 1 ); - assertEquals( callback.inclusions.get(0), "stdio.h"); - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java deleted file mode 100644 index 630b25a72fa..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java +++ /dev/null @@ -1,295 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.core.parser.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.NoSuchElementException; -import java.util.StringTokenizer; - -import junit.framework.AssertionFailedError; -import junit.framework.Test; - -import org.eclipse.cdt.core.parser.ILineOffsetReconciler; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.core.runtime.Path; - - -/** - * @author vmozgin - * - * Automated parser test framework, to use with GCC testsuites - */ -public class TortureTest extends FractionalAutomatedTest { - - static protected boolean isEnabled = false; - static protected boolean quickParse = true; - - public TortureTest () { - super(); - } - - public TortureTest (String name) { - super(name); - } - - protected AutomatedFramework newTest (String name){ - return new TortureTest (name); - } - - protected void loadProperties() throws Exception{ - String resourcePath = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - resourcePath += "resources/parser/TortureTest"; - - try { - FileInputStream propertiesIn = new FileInputStream(resourcePath + "/TortureTest.properties"); - properties.load (propertiesIn); - - isEnabled = properties.getProperty("enabled", "false").equalsIgnoreCase("true"); - quickParse = properties.getProperty("quickParse", "true").equalsIgnoreCase("true"); - - String sourceInfo = properties.getProperty("source", ""); - - stepSize = Integer.parseInt(properties.getProperty("stepSize", "25000")); - outputFile = properties.getProperty("outputFile", ""); - timeOut = Integer.parseInt(properties.getProperty("timeOut", "60000")); - outputDir = properties.getProperty("outDir", ""); - - if (sourceInfo.equals("")) - throw new FileNotFoundException(); - else { - StringTokenizer tokenizer = new StringTokenizer(sourceInfo, ","); - String str = null, val = null; - try { - while (tokenizer.hasMoreTokens()) { - str = tokenizer.nextToken().trim(); - val = tokenizer.nextToken().trim(); - - testSources.put(str, val); - } - } catch (NoSuchElementException e){ - //only way to get here is to have a missing val, assume cpp for that str - testSources.put(str, "cpp"); - } - - } - } catch (FileNotFoundException e){ - testSources.put(resourcePath, "cpp"); - } - - if (!isEnabled) testSources.clear(); - } - - - public static Test suite() - { - AutomatedFramework frame = new TortureTest(); - return frame.createSuite(); - } - - - static protected void reportException (Throwable e, String file, IParser parser, ILineOffsetReconciler mapping){ - String output = null; - int lineNumber = -1; - - try { - lineNumber = mapping.getLineNumberForOffset(parser.getLastErrorOffset()); - } catch (Exception ex) {} - - if (e instanceof AssertionFailedError) { - output = file + ": Parse failed on line "; - output += lineNumber + "\n"; - } else { - output = file + ": " + e.getClass().toString(); - output += " on line " + lineNumber + "\n"; - } - try { - if (report != null) { - report.write(output.getBytes()); - } - } catch (IOException ex) {} - - fail(output); - } - - - static protected boolean isExpectedToPass (String testCode, File file) - { - String fileName = file.getName(); - - // Filter out gcc-specific tests that are not easy to detect automatically - if ( fileName.equals("init-2.c") - || fileName.equals("init-3.c") - || fileName.equals("struct-ini-4.c")) { - - // gcc-specific (and deprecated) designated initializers - // struct { int e1, e2; } v = { e2: 0 }; - - return false; - } - - if ( fileName.equals("stmtexpr3.C")) { - - // statements in expressions - // B() : a(({ 1; })) {} - - return false; - } - - if ( fileName.equals("widechar-1.c")) { - - // concatenation of incompatible literals - // char *s = L"a" "b"; - - return false; - } - - if ( fileName.equals("bf-common.h") - || fileName.equals("class-tests-1.h") - || fileName.equals("unclaimed-category-1.h")) { - - // ObjectiveC header file - - return false; - } - - // Process some DejaGNU instructions - if (testCode.indexOf("{ dg-error") >= 0) return false; - if (testCode.indexOf("// ERROR") >= 0) return false; - if (testCode.indexOf("- ERROR") >= 0) return false; - if (testCode.indexOf("// XFAIL") >= 0) return false; - if (testCode.indexOf("- XFAIL") >= 0) return false; - if (testCode.indexOf("{ xfail") >= 0) return false; - if (testCode.indexOf("{ dg-preprocess") >= 0) return false; - if (testCode.indexOf("{ dg-do preprocess") >= 0) return false; - - // gcc extensions - if (testCode.indexOf("__attribute") >= 0) return false; - if (testCode.indexOf("__extension") >= 0) return false; - if (testCode.indexOf("__restrict") >= 0) return false; - if (testCode.indexOf("__const") >= 0) return false; - if (testCode.indexOf("__declspec") >= 0) return false; - if (testCode.indexOf("__alignof") >= 0) return false; - if (testCode.indexOf("__label") >= 0) return false; - if (testCode.indexOf("__real") >= 0) return false; - if (testCode.indexOf("__imag") >= 0) return false; - if (testCode.indexOf("extern template") >= 0) return false; - if (testCode.indexOf("inline template") >= 0) return false; - if (testCode.indexOf("static template") >= 0) return false; - if (testCode.indexOf("typeof") >= 0) return false; - if (testCode.indexOf(" asm") >= 0) return false; - if (testCode.indexOf(") return") >= 0) return false; - if (testCode.indexOf("#ident") >= 0) return false; - - // These are expected errors (not marked in the code) - if (testCode.indexOf("#include_next") >= 0) return false; - - // Long long literals are part of ANSI C99 - // if (containsLongLongLiterals(testCode)) return false; - - if (testCode.indexOf("{ dg-do run") >= 0) return true; - if (testCode.indexOf("{ dg-do link") >= 0) return true; - - return true; - } - - - public void doFile() throws Throwable { - int timeOut = FractionalAutomatedTest.timeOut; - - assertNotNull (fileList); - - File file = (File)fileList.removeFirst(); - FileInputStream stream = new FileInputStream(file); - - String filePath = file.getCanonicalPath(); - String nature = (String)natures.get(filePath); - - StringWriter code = new StringWriter(); - - byte b[] = new byte[stepSize]; - int n = stream.read(b); - while( n != -1 ){ - code.write(new String(b)); - n = stream.read(b); - } - - String testCode = code.toString(); - - if ( file.getName().equals("concat1.C")) { - // This is a really time-consuming test, - // override timeout - timeOut = 600000; - } - - if (isExpectedToPass(testCode, file)) { - ParseThread thread = new ParseThread(); - - thread.quickParse = quickParse; - thread.code = testCode; - thread.cppNature = nature.equalsIgnoreCase("cpp"); - thread.file = filePath; - - thread.start(); - thread.join(timeOut); - - if (thread.isAlive()) { - thread.stop(); - reportHang(testCode, filePath); - } else if (thread.result != null) { - reportException(thread.result, filePath, thread.parser, thread.mapping); - } - } else { - // gcc probably didn't expect this test to pass. - // It doesn't mean that it should pass CDT parser, - // as it is more relaxed - // Result - 'inconclusive', but we report 'pass' - assertTrue(true); - } - } - - - - static class ParseThread extends Thread { - public ILineOffsetReconciler mapping = null; - public String code; - public boolean cppNature; - public String file; - public Throwable result = null; - public IParser parser = null; - public boolean quickParse = true; - - public void run(){ - try { - ParserMode parserMode = quickParse ? ParserMode.QUICK_PARSE : ParserMode.COMPLETE_PARSE; - ParserLanguage language = cppNature ? ParserLanguage.CPP : ParserLanguage.C; - parser = ParserFactory.createParser( - ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), parserMode, language, nullCallback, null ), nullCallback, parserMode, language, null); - - mapping = ParserFactory.createLineOffsetReconciler( new StringReader( code ) ); - - assertTrue(parser.parse()); - } - catch( Throwable e ) - { - result = e; - } - } - } -} diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java deleted file mode 100644 index 0221d0d25c0..00000000000 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java +++ /dev/null @@ -1,138 +0,0 @@ -package org.eclipse.cdt.core.parser.tests; - -import java.io.IOException; -import java.io.StringWriter; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; - -import org.apache.xerces.dom.DocumentImpl; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * This class implements a utility that will walk through an object - * and it's children and create an XML file for it. - */ -public class XMLDumper { - - public static class Test { - private String msg = "hi"; - - public String getMsg() { - return msg; - } - - public Test self = this; - } - - public static void main(String [] args) { - Test test = new Test(); - XMLDumper dumper = new XMLDumper(test); - Document document = dumper.getDocument(); - - OutputFormat format = new OutputFormat( document ); //Serialize DOM - StringWriter stringOut = new StringWriter(); //Writer will be a String - XMLSerializer serial = new XMLSerializer( stringOut, format ); - - try { - serial.asDOMSerializer(); // As a DOM Serializer - serial.serialize( document.getDocumentElement() ); - System.out.println( "STRXML = " + stringOut.toString() ); //Spit out DOM as a String - } catch (IOException e) { - System.out.println(e); - } - - } - - private int id = 0; - private HashMap map = new HashMap(); - private Document document = new DocumentImpl(); - - public Document getDocument() { - return document; - } - - public XMLDumper(Object obj) { - document.appendChild(createObject(obj)); - } - - private Element createObject(Object obj) { - Class cls = obj.getClass(); - String clsName = cls.getName(); - clsName = clsName.replace('$', '.'); - - Element element = document.createElement(clsName); - map.put(obj, new Integer(id)); - element.setAttribute("id",String.valueOf(id++)); - - Field [] fields = cls.getDeclaredFields(); - for (int i = 0; i < fields.length; ++i) { - Field field = fields[i]; - int modifiers = field.getModifiers(); - - // Skip over static fields - if (Modifier.isStatic(modifiers)) - continue; - - // Skip fields that start with an underscore - if (field.getName().charAt(0) == '_') - continue; - - Object value = null; - - String fieldName = field.getName(); - if (Modifier.isPublic(modifiers)) { - try { - value = field.get(obj); - } catch (Exception e) { - value = e; - } - } else { - String methodName = "get" + - fieldName.substring(0, 1).toUpperCase() + - fieldName.substring(1); - - Method method = null; - try { - method = cls.getMethod(methodName, null); - } catch (NoSuchMethodException e) { - continue; - } - - try { - value = method.invoke(obj, null); - } catch (Exception e) { - value = e; - } - } - - Element fieldElement = document.createElement(fieldName); - element.appendChild(fieldElement); - - if (value == null) - return element; - - Class type = field.getType(); - if (String.class.isAssignableFrom(type)) - fieldElement.appendChild(document.createTextNode((String)value)); - else if (Integer.class.isAssignableFrom(type)) - fieldElement.appendChild(document.createTextNode(((Integer)value).toString())); - else if (Exception.class.isAssignableFrom(type)) - fieldElement.appendChild(document.createTextNode(value.toString())); - else { - Object v = map.get(value); - if (v != null) - fieldElement.setAttribute("refid", v.toString()); - else - fieldElement.appendChild(createObject(value)); - } - - } - - return element; - } -} diff --git a/core/org.eclipse.cdt.core.tests/plugin.xml b/core/org.eclipse.cdt.core.tests/plugin.xml deleted file mode 100644 index 78da7d8c3ac..00000000000 --- a/core/org.eclipse.cdt.core.tests/plugin.xml +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h b/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h deleted file mode 100644 index 3f7ead3b7a0..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cfiles/CModelElementsTestStart.h +++ /dev/null @@ -1,138 +0,0 @@ -// include -#include - -// macro -#define PRINT(string,msg) printf(string, msg) - -//namespace -namespace MyPackage -{ - // check class - // class - class Hello - { - // protected visibility - protected: - // field - int x; - // method - inline void setX(int X) - { - x = X; - }; - // check nested pachage - // nested namespace - namespace MyNestedPackage { - // check parent nested class - // nested class - class Y - { // public visibility - public: - // constructor - Y(); - // virtual destructor - virtual ~Y(); - }; - // check derived nested class - // derived class - class X : public Y { - // private visibility - private: - // private field - B b; - - public: - // constructor chain - X(int x) : yy(x) { - cout << "In consturctor\n"; - } - // method declaration - int doNothing(); - }; - } - }; - - // check enums - // enum without name - enum { - first, - second, - third - } - ; - // enum with name - enum MyEnum { - f, - s, - t }; - - // check variables - // variable - int v; - // unsigned long variable - unsigned long vuLong; - // unsigned short variable - unsigned short vuShort; - - // check variable declarations - // variable declaration - extern int evar; - // function pointer - static void * (*orig_malloc_hook)(const char *file, int line, size_t size); - - // check functions - // simple function declaration - void foo(); - // function declaration with parameters - char* foo(int& x, - char**y); - // simple function definition - void boo(){ - int g = 0; - }; - // check Structs - // struct - struct MyStruct{ - int sint; - }; - // typedef and elaborated types - typedef struct MyStruct myStruct; - // typedef - typedef struct{ - int ss; - } myTypedef; - // unions - union U{ - int U1; - }; - - - // check templates - // template function - template - A aTemplatedFunction( B bInstance ); - // template method - class enclosing { - // public visibility - public: - template - A aTemplatedMethod( B bInstance ); - }; - // template class - template - class myarray { /* */ }; - // template struct - template - struct mystruct { /* */ }; - // template variable -// template -// char* default_alloc_template<__threads, __inst>::_S_start_free = 0; -}; - // check arrays - // arrays - int myArray [5][]; - int main(int argc, char * argv[]) - { - } - - diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.cpp b/core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.cpp deleted file mode 100644 index 66aaa4b68e3..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "CompletionProposalsTestStart.h" - -#define AMacro(x) x+1 - -int aVariable = 0; -bool aFunction(); - -enum anEnumeration { - first, - second, - third -}; - -struct AStruct{ - int aStructField; -}; - -void foo(){ - int aLocalDeclaration = 1; -} - -void anotherClass::anotherMethod(){ - a -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.h b/core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.h deleted file mode 100644 index 82035a992cd..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cfiles/CompletionProposalsTestStart.h +++ /dev/null @@ -1,11 +0,0 @@ -class aClass { -public: - int aField; - int aMethod(); -}; - -class anotherClass { -public: - int anotherField; - void anotherMethod(); -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c b/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c deleted file mode 100644 index d5b78ac9a0b..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cfiles/TranslationUnits.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -/******** - * This is a sample C file that will be used in testing the TranslationUnit - * class. It has a specific structure that will be looked for within the - * test case. - * This file is only ment to contain various C elements, and may not compile - * into a running application (but should be valid C) - */ - -#include -#include - -/* A function prototype */ -int func2p(void); - -/* A global variable */ -int globalvar; - -/* A enumeration */ -enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4}; - -/* A structure. This also includes a typedef around the strcture def - * which at the time of writing was not picked up. - */ -typedef struct mystruct { - int a; - char b; - long c; -} mystruct_t; - -/* A union */ -union myunion { - int x; - char y; - long z; -}; - -/* A typedef */ -typedef struct mystruct mytype; - - -/* A couple functions */ - -void * func1(void) -{ - return(NULL); -} - - -int func2(void) -{ - return(0); -} - -int main(int argc, char ** argv) -{ - int var1; - printf("Hello world\n"); -} - - -void func3() -{ - printf("This is not really here\n"); -} - - diff --git a/core/org.eclipse.cdt.core.tests/resources/cfiles/WorkingCopyTestStart.h b/core/org.eclipse.cdt.core.tests/resources/cfiles/WorkingCopyTestStart.h deleted file mode 100644 index 10b222ccb50..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cfiles/WorkingCopyTestStart.h +++ /dev/null @@ -1,2 +0,0 @@ -#include - diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp b/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp deleted file mode 100644 index f0d2c7e98c7..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cmodel/DeclaratorsTests.cpp +++ /dev/null @@ -1,24 +0,0 @@ -void decl_0001(char); -void (decl_0002)(char); -void ((decl_0003))(char); - -void *decl_0004(char); -void (*decl_0005)(char); -void (*(decl_0006))(char); -void ((*decl_0007))(char); - -typedef void decl_0011(char); -typedef void (decl_0012)(char); -typedef void ((decl_0013))(char); - -typedef void *decl_0014(char); -typedef void (*decl_0015)(char); -typedef void (*(decl_0016))(char); -typedef void ((*decl_0017))(char); - -typedef void decl_0021(char); -void (*decl_0022)(char); -void (*(*decl_0023(int a)))(char) { return &decl_0021; } -void (*(*(*((decl_0024)))(int))(float))(char); - -int (*decl_0031)(char(*yyy)(bool)); diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h b/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h deleted file mode 100644 index 04b6e419a44..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cmodel/IIncludeTest.h +++ /dev/null @@ -1,42 +0,0 @@ -// include -#include -#include "whatever.h" -#include -#include -#include "Program Files/space.h" -#include "../up1dir.h" -#include "./samedir.h" -#include "different_extension1.hpp" -#include "different_extension2.hh" -#include "different_extension3.x" -#include -# include "whitespace_after_hash" - #include "whitespace_before_hash" - -// failure cases: -#include garbage -#include "resync_after_bad_parse_1" -#include -#include "resync_after_bad_parse_2" -#include "one" "two" "three" -#include "resync_after_bad_parse_3" - -// from the Spec: - -// from [C, 6.10.p8] -// should fail -#define EMPTY -EMPTY #include "invalid.h" - -// from [C, 6.10.2.p8]: -// should equal #include "myInclude1.h" -#define MYINCFILE "myInclude1.h" -#include MYINCFILE - -// from [C, 6.10.3.5.p6]: -// should equal #include "vers2.h" -#define INCFILE(x) vers ## x -#define xstr(x) str(x) -#define str(x) #x -#include xstr(INCFILE(2).h) - diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h b/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h deleted file mode 100644 index a5bf320efab..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cmodel/IMacroTest.h +++ /dev/null @@ -1,4 +0,0 @@ -// macro -#define SINGLETON -#define NUMBER 1 -#define PRINT(string,msg) printf(string, msg) diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/IStructure.c b/core/org.eclipse.cdt.core.tests/resources/cmodel/IStructure.c deleted file mode 100644 index c46b043df41..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cmodel/IStructure.c +++ /dev/null @@ -1,88 +0,0 @@ -// IStructure -struct testStruct1 { - char m_field1; - char* m_field2; - unsigned char m_field3; - int m_field4; - unsigned m_field5; - void* m_field6; - - void method1(); - struct testStruct1 method2( char* in_field2, int in_field4 ) {} - // this is very C++: - testStruct1( char* in_field2, int in_field4 ) {} - ~testStruct1() {} -}; - -struct testStruct2 { -}; - -struct testStruct3 { -} aTestStruct3; - -// no semicolon, parser should recover -struct testStruct4NoSemicolon { -} - -// forward declaration -struct testStruct5; - -// variable declaration using predefined struct. -struct testStruct6 aTestStruct6; - -struct { - int x; -} testAnonymousStructObject1; - -struct { - int x; -} testAnonymousStructObject2= {1}; - -// to resync the parser if necessary -struct testStruct7 { -}; - -// an inner struct -struct testStruct8 { - struct testStruct9Inner { - int x; - }; - struct testStruct10Inner { - int y; - struct testStruct11Inner { - int z; - }; - }; -}; - -union testUnion1 { - char m_field1; - char* m_field2; - unsigned char m_field3; - int m_field4; - unsigned m_field5; - void* m_field6; -}; - -class testClass1 { -}; - -class testClass2NoSemicolon { -} - -class testClass3 { -}; - -class testClass4Abstract { - void aNonVirtual(); - virtual void aVirtual(); - virtual void aPureVirtual()=0; -}; - -class testClass5 -: public testClass1, protected testClass3, private testClass4Abstract { -}; - -// to resync the parser if necessary -class testClass6 { -}; diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp b/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp deleted file mode 100644 index 367a36c7011..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cmodel/ITemplate.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// TEMPLATE_STRUCT -template -struct Map -{ - Key* keys; - Value* values; - SortAlgorithm* sortAlgorithm; - Map(); -}; - -// TEMPLATE_CLASS -template class nonVector { - private: - T* head; - - public: - nonVector() { head =new T(); } - int length() { return 1; } - T& first() { return *head; } - const T& first() const; -}; - -// TEMPLATE_UNION -template -union ArrayOverlay { - public: - X x[size]; - Y y[size]; - - static int numArrays; -}; - - -// TEMPLATE_METHODS -class TemplateContainer { - // these are in an enclosing class - template void fum(int i); - template void scrum(void) {}; -}; - -// TEMPLATE_FUNCTION -template const T& nonVector::first() const -{ - return *head; -} - -template bool IsGreaterThan(X,X); - -template void Foo::fum(int i) {} - -// TEMPLATE_VARIABLES -template char* default_alloc_template::S_start_free = 0; - -// an instantiation, not a template: -complex cf(0,0); -//template > -//Dictionary* TheSpellCheckDictionary; - -int success; - - diff --git a/core/org.eclipse.cdt.core.tests/resources/cmodel/MacroTests.c b/core/org.eclipse.cdt.core.tests/resources/cmodel/MacroTests.c deleted file mode 100644 index 07e30d6eeec..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/cmodel/MacroTests.c +++ /dev/null @@ -1,24 +0,0 @@ -#define Z struct -#define X Z -#define Y SomeName - -X Y -{ - -}; - - -X{ -}; - -int A :: BCD = 1; - -#define DEFA B -#define DB( x ) x - -int DEFA :: DB(Y) = 1; - -#define PINT const int * - -PINT myPINT; -PINT foobar( void ); diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp deleted file mode 100644 index 828a3aca6cf..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "DepTest.h" -#include "d.h" - -DepTest::DepTest() -{}; -DepTest::~DepTest() -{}; - diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h deleted file mode 100644 index c008086c156..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "Inc1.h" -#include "a.h" -class DepTest{ -public: - - DepTest(); - ~DepTest(); -}; diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp deleted file mode 100644 index 6f3000e6df3..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "DepTest2.h" -#include "d.h" - -DepTest2::DepTest2() -{}; -DepTest2::~DepTest2() -{}; - diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h deleted file mode 100644 index 6f084a69b11..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest2.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "d.h" - -class DepTest2{ -public: - - DepTest2(); - ~DepTest2(); -}; diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp deleted file mode 100644 index cc0d9ba24ee..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "DepTest3.h" - -DepTest3::DepTest3() -{}; -DepTest3::~DepTest3() -{}; - diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h b/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h deleted file mode 100644 index b4b47ce40e4..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/DepTest3.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "a.h" - -class DepTest3{ -public: - - DepTest3(); - ~DepTest3(); -}; diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h b/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h deleted file mode 100644 index 7bfbe592caa..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/Inc1.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "c.h" - -class X -{ - public: - X(){}; - ~X(){}; -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/a.h b/core/org.eclipse.cdt.core.tests/resources/dependency/a.h deleted file mode 100644 index 3c66f940fc1..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/a.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "c.h" - -class Z -{ - public: - Z(){}; - ~Z(){}; -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/c.h b/core/org.eclipse.cdt.core.tests/resources/dependency/c.h deleted file mode 100644 index bc82542a695..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/c.h +++ /dev/null @@ -1,6 +0,0 @@ -class Y -{ - public: - Y(){}; - ~Y(){}; -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/dependency/d.h b/core/org.eclipse.cdt.core.tests/resources/dependency/d.h deleted file mode 100644 index 8dcf01a87d2..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/dependency/d.h +++ /dev/null @@ -1,6 +0,0 @@ -class d -{ - public: - d(){}; - ~d(){}; -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/Makefile b/core/org.eclipse.cdt.core.tests/resources/exe/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/common.mk b/core/org.eclipse.cdt.core.tests/resources/exe/common.mk deleted file mode 100644 index 6e21c521623..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/common.mk +++ /dev/null @@ -1,7 +0,0 @@ -ifndef QCONFIG -QCONFIG=qconfig.mk -endif -include $(QCONFIG) -USEFILE= -LIBS+=socket -include $(MKFILES_ROOT)/qtargets.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/main.c b/core/org.eclipse.cdt.core.tests/resources/exe/main.c deleted file mode 100644 index 62952639754..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() -{ - printf("Hello there\n"); - return(0); -} diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/Makefile b/core/org.eclipse.cdt.core.tests/resources/exe/ppc/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/Makefile b/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/Makefile deleted file mode 100644 index 2c760893e32..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/exe_g b/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/exe_g deleted file mode 100644 index 1c54db11d20..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/exe_g and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/main.o b/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/main.o deleted file mode 100644 index 41e9e97110e..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/main.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test.o b/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test.o deleted file mode 100644 index 9a35dfb2cf9..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test2.o b/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test2.o deleted file mode 100644 index bae3191b475..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/ppc/be.g/test2.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/test.c b/core/org.eclipse.cdt.core.tests/resources/exe/test.c deleted file mode 100644 index 23baffafb31..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/test.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - - -int func1 (void) -{ - printf("This is func1\n"); - return(1); -} - -char * func2(void) -{ - printf("This is func2\n"); - return(0); -} diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/test2.c b/core/org.eclipse.cdt.core.tests/resources/exe/test2.c deleted file mode 100644 index 7b26241b059..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/test2.c +++ /dev/null @@ -1,13 +0,0 @@ -#include - -int test2func1(void) -{ - printf("This is a function in the second object\n"); - return(1); -} - -int test2func2(void) -{ - printf("This is another function in the second object\n"); - return(2); -} diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/Makefile b/core/org.eclipse.cdt.core.tests/resources/exe/x86/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/x86/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/Makefile b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/Makefile deleted file mode 100644 index 2c760893e32..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/exe_g b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/exe_g deleted file mode 100644 index 465e16de33d..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/exe_g and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/main.o b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/main.o deleted file mode 100644 index 8c61c21f50d..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/main.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test.o b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test.o deleted file mode 100644 index 5f956885cbf..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test2.o b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test2.o deleted file mode 100644 index aa8de348603..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o.g/test2.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/Makefile b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/Makefile deleted file mode 100644 index 2c760893e32..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/exe b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/exe deleted file mode 100644 index d13631162d7..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/exe and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/main.o b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/main.o deleted file mode 100644 index a5c78c1ca4e..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/main.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test.o b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test.o deleted file mode 100644 index 357c3985ea1..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test2.o b/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test2.o deleted file mode 100644 index 52e88a7397b..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exe/x86/o/test2.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/Makefile b/core/org.eclipse.cdt.core.tests/resources/exebig/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exebig/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/common.mk b/core/org.eclipse.cdt.core.tests/resources/exebig/common.mk deleted file mode 100644 index 80c1e67f6f8..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exebig/common.mk +++ /dev/null @@ -1,7 +0,0 @@ -ifndef QCONFIG -QCONFIG=qconfig.mk -endif -include $(QCONFIG) -USEFILE= - -include $(MKFILES_ROOT)/qtargets.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/main.c b/core/org.eclipse.cdt.core.tests/resources/exebig/main.c deleted file mode 100644 index ce93b899e09..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exebig/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -int bigArray[100]; -int x[10]={1,2,3,4,5,6,7,8,9,0}; -int main() -{ - printf("Hello there\n"); - return(0); -} diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/Makefile b/core/org.eclipse.cdt.core.tests/resources/exebig/x86/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/Makefile b/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/Makefile deleted file mode 100644 index 2c760893e32..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/exebig_g b/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/exebig_g deleted file mode 100644 index 3aacf6267c5..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/exebig_g and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/main.o b/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/main.o deleted file mode 100644 index e7d818de524..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/exebig/x86/o.g/main.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp b/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp deleted file mode 100644 index 5fb91b9ce50..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//#include "StdAfx.h" -#include "DocumentManager.h" - -CDocumentManager::CDocumentManager(void) -{ -} - -CDocumentManager::~CDocumentManager(void) -{ -} - -void CDocumentManager::addToControlMap(UINT threadID, IUnknown * theControl) -{ - _controlMap.insert(MUL2IUnk_Pair(threadID,theControl)); -} - -void CDocumentManager::getControl(ULONG threadID, IUnknown ** theControl) -{ - if (_controlMap.find(threadID) != _controlMap.end()) - { - theControl = &_controlMap[threadID]; - } - - -} diff --git a/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.h b/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.h deleted file mode 100644 index 868c2281986..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/indexer/DocumentManager.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include - -typedef map MUL2IUnk; -typedef pair MUL2IUnk_Pair; - -class CDocumentManager -{ -public: - CDocumentManager(void); - ~CDocumentManager(void); - -private: - MUL2IUnk _controlMap; - -public: - void addToControlMap(UINT threadID, IUnknown * theControl); - void getControl(ULONG threadID, IUnknown ** theControl); -}; diff --git a/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp b/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp deleted file mode 100644 index da47fd6b304..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/indexer/extramail.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include -#include -#include -#include - -#define PRINT(a,b) cout<<(a)<<(b) -#define CASE break;case -#define MAX(a,b) (((a)>(b))?(a):(b)) - -typedef int int32; - -static void doSomething(); - -namespace Z{ - int x; - namespace X{ - namespace Y{ - enum test{cool,hi,bye,why}; - class Mail - { - public: - Mail(){} - virtual void print()=0; //Pure Virtual Function, forces redefinition - protected: - float postage; - char *type; - friend ostream& operator << (ostream& os, Mail *m); - }; - - class postcard : public Mail - { - public: - postcard(): Mail(){postage = 0.20; type = "Postcard";} - void print(){cout << type << ": $" << setiosflags(ios::fixed) - <print(); - } - //Overloaded << - for(int x =0; x type - << ": $" << m->postage < -#include -#include -#include - -class Mail -{ -public: -Mail(){} -virtual void print()=0; //Pure Virtual Function, forces redefinition -protected: -float postage; -char *type; -friend ostream& operator << (ostream& os, Mail *m); -}; - -class postcard : public Mail -{ -public: -postcard(): Mail(){postage = 0.20; type = "Postcard";} -void print(){cout << type << ": $" << setiosflags(ios::fixed) - <print(); -} -//Overloaded << - for(int x =0; x type -<< ": $" << m->postage < -# source = , -# Multiple source properties may be concatenated. -# By default, no outputFile is produced. -# By default, the test will use: -# source = ./defaultC, c -# source = ./defaultCpp, cpp - -#outputFile = Z:\\CDT\\reportRTS.txt -#source = Z:/V651/Release/C++/TargetRTS, cpp - -#source = D:/temp/test, cpp diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/FractionalAutomatedTest.properties b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/FractionalAutomatedTest.properties deleted file mode 100644 index 45ccd56ab5b..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/FractionalAutomatedTest.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Format of this property file is: -# outputFile = -# source = , -# Multiple source properties may be concatenated. -# By default, no outputFile is produced. -# By default, the test will use: -# source = ./defaultC, c -# source = ./defaultCpp, cpp -# -# outputFile = Z:\\CDT\\reportFrac.txt -#source = Z:/V651/Release/C++/TargetRTS, cpp -#source = D:/temp/test, cpp -#source = Z:/CDT/test/include, cpp \ -# Z:/CDT/test/src, cpp -#source = D:\\ACE+TAO\\ACE_wrappers, cpp -# source = D:\\ACE+TAO\\ACE_wrappers\\ace\\config-psos-diab-mips.h, cpp -# outDir = Z:\\CDT\\temp diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c deleted file mode 100644 index e7d2a2e016f..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.c +++ /dev/null @@ -1,43 +0,0 @@ -#include - -const SimpleStruct simpleStruct = -{ - 1 - , "mySimple" - , 0.1232 -}; - -#define SIZEOF( A, B ) sizeof( A.B ) - -const OtherStruct array[] = -{ - { -#if FOO - "foo" -#else - "bar" -#endif - , SIZEOF( simpleStruct, num ) - , &t_int - , 0 - } - , { - "name" - , SIZEOF( simpleStruct, floatnum ) - , &t_float - , 1 - } -}; - - -void SimpleStruct_construct( struct SimpleStruct * const this ) -{ - this->num = 1; - this->name = "boo"; - this->floatNum = 1.5; -} - -int ConnectParams_doSomething( const struct SimpleStruct * const this ) -{ - return 1; -} diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h deleted file mode 100644 index 96e8ef0a741..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultC/Simple.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef SIMPLE_H -#define SIMPLE_H - -struct SimpleStruct -{ - int num; - char name[ ]; - float floatNum; -}; - - -void SimpleStruct_construct( struct SimpleStruct * const this ); - -int SimpleStruct_doSomething( const struct SimpleStruct * const this ); - -#endif /* SIMPLE_H */ - diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp deleted file mode 100644 index 4b4055ade2d..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include - -#include - -#define NULL (void *)0 - -SimpleClass::SimpleClass( void ) -{ - init( NULL ); -} - -SimpleClass::~SimpleClass( void ) -{ -} - -SimpleClass::SimpleClass( const SimpleClass & arg ) -{ - //TODO: copy constructor -} - -SimpleClass & SimpleClass::operator=( const SimpleClass & arg ) -{ - if( this != &arg ) - { - } - return *this; -} - - -void SimpleClass::init( void * foo) -{ -} - -InnerStruct & SimpleClass::getInner( void ) -{ - return inner; -} diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h b/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h deleted file mode 100644 index e22c5eefbd0..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/AutomatedTest/defaultCpp/Simple.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef SIMPLE_H -#define SIMPLE_H - -class OtherClass; - -class SimpleClass -{ -public: - SimpleClass( void ); - SimpleClass( const SimpleClass & arg ); - - virtual ~SimpleClass( void ); - - SimpleClass & operator=( const SimpleClass & arg ); - -private: - struct InnerStruct - { - inline InnerStruct( int a ){ _a = a; } - inline ~InnerStruct( void ){} - unsigned int _a; - }; - - InnerStruct inner; - - void init( void * ); - -public: - InnerStruct & getInner( void ); -}; - -#endif /* SIMPLE_H */ diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h b/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h deleted file mode 100644 index 16b506364f0..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/LineNumberTest.h +++ /dev/null @@ -1,43 +0,0 @@ -// inclusion begins and ends on line 2 -#include - -// simple macro begins and ends on line 5; ANOTHER on line 6 -#define SIMPLE_MACRO simple -#define ANOTHER -// namespace begins on line 7, ends on line 22 -namespace MyPackage{ - // class specification begins on line 10, ends on line 21 - class Hello{ - protected: - // simple declaration begins and ends on line 13 - int x; - // simple declaration begins and ends on line 15 - void setX(int X); - public: - // simple declaration begins on line 18 and ends on line 20 - Hello( void ) : x - ( 5 ) { - } - }; -} - -// simple declaration begins on line 25 and ends on line 27 -int * - y = - 0; - -// complex macro begins on line 30 and ends on line 31 -#define COMPLEX_MACRO 33 \ - + 44 - -// template declaration begins on line 34 and ends on line 35 -template - A createA( void ); - -// enumeration begins on line 38 and ends on line 43 -enum { - one, // enumerator begins and ends on line 39 - two, // enumerator begins and ends on line 40 - three // enumerator begins on line 41, ends on line 42 - = 4 -}; \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/.cvsignore b/core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/.cvsignore deleted file mode 100644 index 813113959cf..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -TortureTest.properties \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/ReadMe-TortureText.txt b/core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/ReadMe-TortureText.txt deleted file mode 100644 index 87c1c0884f1..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/parser/TortureTest/ReadMe-TortureText.txt +++ /dev/null @@ -1,31 +0,0 @@ -Usage: -By default, torture testing is disabled. To enable it, create a 'TortureTest.properties' in 'org.eclipse.cdt.ui.tests\parser\org\eclipse\cdt\core\parser\resources'. - -If you don't have GCC testsuites, it does nothing. Then go and grab your latest version of GCC testsuites -(for instance, ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-3.3/gcc-testsuite-3.3.tar.gz). -Unpack testsuites under - - org.eclipse.cdt.core.tests/resources/parser/TortureTest/default - -or elsewhere, but then you'll need to create a 'TortureTest.properties'. -That's it, you can run TortureTest in JUnit Plugin mode. Don't run all ui.tests with torture-test enabled, as apparently it is included several times (anyone knows why?) -, and it's A LOT of test cases. - -You can copy the rest of the file to create a TortureTest.properties and uncomment out/edit the default values as specified here. - -# By default, torture testing is disabled -# Uncomment to enable -#enabled=true - -# Default location is org.eclipse.cdt.core.tests/resources/parser/TortureTest/default -#source=/your/gcc/testsuite/installation/directory - -# Chunks for reading files -#stepSize=25000 - -# Timeout for individual cases, ms -# Need a large enough value, as some files are non-trivial -#timeOut=60000 - -# Quick parse, or not -#quickParse=true diff --git a/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp b/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp deleted file mode 100644 index 50954fd50b8..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/search/classDecl.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "include.h" - -#define FOO bar - -class Heal{}; - -class A { - A() {} - ~A(){} - class B { - void f( A ); - void f( A & ); - void f( A* ); - void f( int &, const char [], A ** ); - }; -}; - -namespace NS { - namespace NS2{ - struct a{}; - } - class B: public A { - public: - struct AA {}; - enum e { - One, - Two, - Three - }; - - void f(){ - using namespace NS2; - a aStruct; - } - - - - AA anotherStruct; - }; - union u{ } ; -} - -namespace NS3{ - class C : public NS::B { - e eE = One; - }; -} - -A::B b1; - -typedef NS::B NS_B; -NS_B b2; - -union u{ -}; - -class AClassForFoo {}; - -AClassForFoo foo( AClassForFoo ){ - AClassForFoo b; - return b; -} - -Head * Head::operator *= ( int index ){ - return array[ index ]; -} - -Head * Head::operator += ( int index ){ - return array[ index ]; -} - -extern int externalInt; -extern int externalIntWithInitializer = 2; -extern "C" int externCInt; -extern "C" int externCIntWithInitializer = 3; - -void forwardFunction() { } -void normalFunction() { } - -void DeclsAndDefns::forwardMethod(){ } - -int DeclsAndDefns::staticField = 5; - - diff --git a/core/org.eclipse.cdt.core.tests/resources/search/include.h b/core/org.eclipse.cdt.core.tests/resources/search/include.h deleted file mode 100644 index 1df7c093c2f..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/search/include.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef INCLUDE_H -#define INCLUDE_H - -class Head { - Head ** array; - - Head * operator *= ( int index ); - Head * operator * ( int index ){ return array[ index ]; } - Head * operator += ( int index ); - - operator const short & (); - operator short (); - operator short int (); - -}; - -class DeclsAndDefns{ - static int staticField; - int nonStaticField; - - void forwardMethod(); - void inlineMethod() {} -}; - -void forwardFunction(); - - -class Direction{ - void turn(); -}; -class Right : public Direction { - void turn() { } -}; -#endif \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/Makefile b/core/org.eclipse.cdt.core.tests/resources/testlib/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/common.mk b/core/org.eclipse.cdt.core.tests/resources/testlib/common.mk deleted file mode 100644 index dd99ed569bc..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/common.mk +++ /dev/null @@ -1,6 +0,0 @@ -ifndef QCONFIG -QCONFIG=qconfig.mk -endif -include $(QCONFIG) - -include $(MKFILES_ROOT)/qtargets.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/test.c b/core/org.eclipse.cdt.core.tests/resources/testlib/test.c deleted file mode 100644 index 23baffafb31..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/test.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - - -int func1 (void) -{ - printf("This is func1\n"); - return(1); -} - -char * func2(void) -{ - printf("This is func2\n"); - return(0); -} diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/test2.c b/core/org.eclipse.cdt.core.tests/resources/testlib/test2.c deleted file mode 100644 index 7b26241b059..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/test2.c +++ /dev/null @@ -1,13 +0,0 @@ -#include - -int test2func1(void) -{ - printf("This is a function in the second object\n"); - return(1); -} - -int test2func2(void) -{ - printf("This is another function in the second object\n"); - return(2); -} diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/Makefile b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/Makefile deleted file mode 100644 index 0e22650c04c..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/Makefile b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/Makefile deleted file mode 100644 index 2c760893e32..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/libtestlib_g.a b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/libtestlib_g.a deleted file mode 100644 index 06377b5ef2f..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/libtestlib_g.a and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test.o b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test.o deleted file mode 100644 index a12942b1527..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test2.o b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test2.o deleted file mode 100644 index 87e730cd7c5..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/a.g/test2.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/Makefile b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/Makefile deleted file mode 100644 index 2c760893e32..00000000000 --- a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_g.so b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_g.so deleted file mode 100644 index c0e76f7695b..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_g.so and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_gS.a b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_gS.a deleted file mode 100644 index b03c33bdc91..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/libtestlib_gS.a and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test.o b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test.o deleted file mode 100644 index c9009cb22dc..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test2.o b/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test2.o deleted file mode 100644 index a13bcd826b8..00000000000 Binary files a/core/org.eclipse.cdt.core.tests/resources/testlib/x86/so.g/test2.o and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/BaseSearchTest.java b/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/BaseSearchTest.java deleted file mode 100644 index 464e0694831..00000000000 --- a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/BaseSearchTest.java +++ /dev/null @@ -1,185 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 22, 2003 - */ -package org.eclipse.cdt.core.search.tests; - -import java.io.FileInputStream; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.search.BasicSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.testplugin.FileManager; -import org.eclipse.core.internal.resources.ResourceException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class BaseSearchTest extends TestCase implements ICSearchConstants { - - ICSearchScope scope; - IFile file; - IProject testProject; - NullProgressMonitor monitor; - IWorkspace workspace; - BasicSearchResultCollector resultCollector; - SearchEngine searchEngine; - FileManager fileManager; - - public BaseSearchTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - (CCorePlugin.getDefault().getCoreModel().getIndexManager()).reset(); - monitor = new NullProgressMonitor(); - - workspace = ResourcesPlugin.getWorkspace(); - - //Create temp project - testProject = createProject("SearchTestProject"); - - if (testProject == null) - fail("Unable to create project"); - - //Create file manager - fileManager = new FileManager(); - - //Add a file to the project - //importFile("mail.cpp", "resources/indexer/mail.cpp"); - importFile("classDecl.cpp", "resources/search/classDecl.cpp"); - importFile("include.h", "resources/search/include.h"); - - scope = SearchEngine.createWorkspaceScope(); - - resultCollector = new BasicSearchResultCollector(); - - searchEngine = new SearchEngine(); - } - - protected void tearDown() { - try { - super.tearDown(); - } catch (Exception e1) { - } - //Delete project - if (testProject.exists()){ - try { - fileManager.closeAllFiles(); - testProject.delete(true,monitor); - } catch (ResourceException e) { - } catch (CoreException e) { - } - } - } - - private IProject createProject(String projectName) throws CoreException { - IWorkspaceRoot root = workspace.getRoot(); - IProject project = root.getProject(projectName); - IProject cproject = null; - try{ - - if( !project.exists() ) { - project.create( null ); - } else { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - if( !project.isOpen() ) { - project.open( null ); - } - - //Fill out a project description - IPath defaultPath = Platform.getLocation(); - IPath newPath = project.getFullPath(); - - if (defaultPath.equals(newPath)) - newPath = null; - - IProjectDescription description = workspace.newProjectDescription(project.getName()); - - description.setLocation(newPath); - - //Create the project - cproject = CCorePlugin.getDefault().createCProject( description, - project, - monitor, - CCorePlugin.PLUGIN_ID + ".make"); - - if( !project.hasNature(CCProjectNature.CC_NATURE_ID) ){ - addNatureToProject(project, CCProjectNature.CC_NATURE_ID, null); - } - } - catch (CoreException e){ - cproject = project; - cproject.open(null); - } - - return cproject; - - - } - - private void importFile(String fileName, String resourceLocation)throws Exception{ - //Obtain file handle - file = testProject.getProject().getFile(fileName); - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - //Create file input stream - - if (!file.exists()){ - file.create(new FileInputStream(pluginRoot + resourceLocation),false,monitor); - fileManager.addFile(file); - } - - } - - private void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = proj.getDescription(); - - String[] prevNatures = description.getNatureIds(); - String[] newNatures = new String[ prevNatures.length + 1 ]; - - System.arraycopy( prevNatures, 0, newNatures, 0, prevNatures.length ); - newNatures[ prevNatures.length ] = natureId; - description.setNatureIds( newNatures ); - proj.setDescription( description, monitor ); - } - - protected void search(IWorkspace workspace, ICSearchPattern pattern, ICSearchScope scope, ICSearchResultCollector collector) { - searchEngine.search( workspace, pattern, scope, collector, false ); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java b/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java deleted file mode 100644 index 4d017bfd66e..00000000000 --- a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.java +++ /dev/null @@ -1,282 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 3, 2003 - */ -package org.eclipse.cdt.core.search.tests; - -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.search.matching.ClassDeclarationPattern; -import org.eclipse.cdt.internal.core.search.matching.OrPattern; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ClassDeclarationPatternTests extends BaseSearchTest implements ICSearchConstants { - - public ClassDeclarationPatternTests(String name) { - super(name); - } - - public void testMatchSimpleDeclaration(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A", TYPE, DECLARATIONS, true ); - - assertTrue( pattern instanceof ClassDeclarationPattern ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); //TODO was 2, changed for bug 41445 - } - - public void testMatchNamespaceNestedDeclaration(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "NS::B", TYPE, DECLARATIONS, true ); - - assertTrue( pattern instanceof ClassDeclarationPattern ); - - ClassDeclarationPattern clsPattern = (ClassDeclarationPattern)pattern; - - assertTrue( CharOperation.equals( new char[] { 'B' }, clsPattern.getName() ) ); - assertTrue( clsPattern.getContainingTypes().length == 1 ); - assertTrue( CharOperation.equals( new char[] { 'N', 'S' }, clsPattern.getContainingTypes()[0] ) ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - } - - public void testBug39652() { - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A::B", TYPE, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - - /* Test should find 1 match */ - assertTrue( matches != null ); - assertTrue( matches.size() == 1 ); - - pattern = SearchEngine.createSearchPattern( "NS::NS2::a", TYPE, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertTrue( matches != null ); - - pattern = SearchEngine.createSearchPattern( "NS::B::AA", TYPE, DECLARATIONS, true ); //TODO was NS::B::A, changed for bug 41445 - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertTrue( matches != null ); - } - - public void testMatchStruct(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "AA", STRUCT, DECLARATIONS, true ); //TODO was A, changed for bug 41445 - - assertTrue( pattern instanceof ClassDeclarationPattern ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "NS::B::AA", TYPE, DECLARATIONS, true ); //TODO was 2, changed for bug 41445 - search( workspace, pattern, scope, resultCollector ); - - Set matches2 = resultCollector.getSearchResults(); - assertTrue( matches2 != null ); - assertEquals( matches2.size(), 1 ); - - Iterator iter = matches.iterator(); - Iterator iter2 = matches2.iterator(); - - IMatch match = (IMatch)iter.next(); - IMatch match2 = (IMatch)iter2.next(); - - //assertTrue( match.path.equals( match2.path ) ); - assertEquals( match.getStartOffset(), match2.getStartOffset() ); - assertEquals( match.getEndOffset(), match2.getEndOffset() ); - } - - public void testWildcardQualification() { - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::*::A", TYPE, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 0 ); - - pattern = SearchEngine.createSearchPattern( "NS::*::A", TYPE, DECLARATIONS, false ); - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); //TODO was 1, changed for bug 41445 - } - - public void testElaboratedType(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "struct AA", TYPE, DECLARATIONS, true ); //TODO was 2, changed for bug 41445 - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "union u", TYPE, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - - pattern = SearchEngine.createSearchPattern( "union ::*::u", TYPE, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - } - - public void testClassIndexPrefix(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "struct A::B::*::c", TYPE, DECLARATIONS, true ); - assertTrue( pattern instanceof ClassDeclarationPattern ); - - ClassDeclarationPattern clsPattern = (ClassDeclarationPattern)pattern; - assertEquals( CharOperation.compareWith( "typeDecl/S/c/".toCharArray(), clsPattern.indexEntryPrefix() ), 0); - - clsPattern = (ClassDeclarationPattern) SearchEngine.createSearchPattern( "class ::*::A::B::c", TYPE, DECLARATIONS, true ); - assertEquals( CharOperation.compareWith( "typeDecl/C/c/B/A/".toCharArray(), clsPattern.indexEntryPrefix() ), 0); - - clsPattern = (ClassDeclarationPattern) SearchEngine.createSearchPattern( "enum ::RT*::c", TYPE, REFERENCES, true ); - assertEquals( CharOperation.compareWith( "typeRef/E/c/RT".toCharArray(), clsPattern.indexEntryPrefix() ), 0); - - clsPattern = (ClassDeclarationPattern) SearchEngine.createSearchPattern( "union A::B::c", TYPE, REFERENCES, false ); - assertEquals( CharOperation.compareWith( "typeRef/U/".toCharArray(), clsPattern.indexEntryPrefix() ), 0); - } - - public void testGloballyQualifiedItem(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::A", TYPE, DECLARATIONS, true ); - assertTrue( pattern instanceof ClassDeclarationPattern ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "::u", TYPE, DECLARATIONS, true ); - assertTrue( pattern instanceof ClassDeclarationPattern ); - - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 1 ); - } - - public void testClassReferences(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::A", TYPE, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 6 ); - } - - public void testClassReferenceInFieldType(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::NS::B::AA", TYPE, REFERENCES, true ); //TODO was A, changed for bug 41445 - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getParentName().equals( "NS::B" ) ); - } - - public void testTypeReferenceVisibleByUsingDirective(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::NS::NS2::a", STRUCT, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getParentName().equals( "NS::B" ) ); - } - - public void testEnumerationReferenceVisibleByInheritance(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::NS::B::e", ENUM, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getParentName().equals( "NS3::C" ) ); - } - - public void testHeadersVisitedTwice(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "Hea*", CLASS, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - //1 for Heal, 1 for Head - assertEquals( matches.size(), 2 ); - } - - public void testAllOccurences(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A", TYPE, ALL_OCCURRENCES, true ); - assertTrue( pattern instanceof OrPattern ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 7 ); - } - - public void testReferencesInFunction(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "AClassForFoo", CLASS, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 3 ); - - Iterator iter = matches.iterator(); - - while( iter.hasNext() ){ - IMatch match = (IMatch) iter.next(); - - assertTrue( match.getName().equals("foo(AClassForFoo)") ); - assertTrue( match.getParentName().equals("") ); - } - } - - public void testbug42902_TypeDefs(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern("NS_B", TYPEDEF, ALL_OCCURRENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 2 ); - } -} - diff --git a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/FunctionMethodPatternTests.java b/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/FunctionMethodPatternTests.java deleted file mode 100644 index 16f094cb8ee..00000000000 --- a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/FunctionMethodPatternTests.java +++ /dev/null @@ -1,206 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 23, 2003 - */ -package org.eclipse.cdt.core.search.tests; - -import java.util.Set; - -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.search.matching.MethodDeclarationPattern; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class FunctionMethodPatternTests extends BaseSearchTest { - - /** - * @param name - */ - public FunctionMethodPatternTests(String name) { - super(name); - // TODO Auto-generated constructor stub - } - - public void testFunctionIndexPrefix(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "c()", FUNCTION, DECLARATIONS, true ); - - MethodDeclarationPattern functionPattern = (MethodDeclarationPattern)pattern; - assertEquals( CharOperation.compareWith( "functionDecl/c".toCharArray(), functionPattern.indexEntryPrefix() ), 0); - - functionPattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "rt*()", FUNCTION, DECLARATIONS, true ); - assertEquals( CharOperation.compareWith( "functionDecl/rt".toCharArray(), functionPattern.indexEntryPrefix() ), 0); - - functionPattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "Ac", FUNCTION, REFERENCES, false ); - assertEquals( CharOperation.compareWith( "functionRef/".toCharArray(), functionPattern.indexEntryPrefix() ), 0); - } - - public void testMethodIndexPrefix(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A::B::c", METHOD, DECLARATIONS, true ); - assertTrue( pattern instanceof MethodDeclarationPattern ); - - MethodDeclarationPattern methodPattern = (MethodDeclarationPattern)pattern; - assertEquals( CharOperation.compareWith( "methodDecl/c/B/A".toCharArray(), methodPattern.indexEntryPrefix() ), 0); - - methodPattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "::*::A::B::c", METHOD, DECLARATIONS, true ); - assertEquals( CharOperation.compareWith( "methodDecl/c/B/A/".toCharArray(), methodPattern.indexEntryPrefix() ), 0); - - methodPattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "::RT*::c", METHOD, REFERENCES, true ); - assertEquals( CharOperation.compareWith( "methodRef/c/RT".toCharArray(), methodPattern.indexEntryPrefix() ), 0); - - methodPattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "A::B::c", METHOD, REFERENCES, false ); - assertEquals( CharOperation.compareWith( "methodRef/".toCharArray(), methodPattern.indexEntryPrefix() ), 0); - } - - public void testMethodDeclaration() { - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A::B::f", METHOD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 4 ); - } - - public void testMethodDeclarationWithParams() { - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A::B::f( A )", METHOD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 1 ); - } - - public void testMethodDeclarationParameterMatching(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "f( A & )", METHOD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "f( A * )", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "f( int &, const char [], A** )", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - } - - public void testOperators_bug43063_bug42979(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "operator \\*", METHOD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - IMatch match1 = (IMatch) matches.iterator().next(); - - pattern = SearchEngine.createSearchPattern( "operator \\*", METHOD, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - IMatch match2 = (IMatch) matches.iterator().next(); - - assertTrue( match1.getStartOffset() == match2.getStartOffset() ); - - pattern = SearchEngine.createSearchPattern( "operator \\*=", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - match1 = (IMatch) matches.iterator().next(); - - pattern = SearchEngine.createSearchPattern( "operator \\*=", METHOD, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - match2 = (IMatch) matches.iterator().next(); - - assertTrue( match1.getStartOffset() != match2.getStartOffset() ); - - pattern = SearchEngine.createSearchPattern( "operator *", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 6 ); //3 in classDecl.cpp - } - - public void testBug43498(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "operator ?elete", METHOD, DECLARATIONS, true ); - - assertTrue( pattern instanceof MethodDeclarationPattern ); - MethodDeclarationPattern methodPattern = (MethodDeclarationPattern) pattern; - - char [] string = new char[] {'o','p','e','r','a','t','o','r',' ','?','e','l','e','t','e'}; - assertTrue( CharOperation.equals( string, methodPattern.getSimpleName() ) ); - - pattern = SearchEngine.createSearchPattern( "operator delete", METHOD, DECLARATIONS, true ); - assertTrue( pattern instanceof MethodDeclarationPattern ); - methodPattern = (MethodDeclarationPattern) pattern; - string = new char[] {'o','p','e','r','a','t','o','r',' ','d','e','l','e','t','e'}; - assertTrue( CharOperation.equals( string, methodPattern.getSimpleName() ) ); - - pattern = SearchEngine.createSearchPattern( "word?word", METHOD, DECLARATIONS, true ); - assertTrue( pattern instanceof MethodDeclarationPattern ); - methodPattern = (MethodDeclarationPattern) pattern; - - string = new char[] {'w','o','r','d','?','w','o','r','d'}; - assertTrue( CharOperation.equals( string, methodPattern.getSimpleName() ) ); - } - - public void testBug43062(){ - MethodDeclarationPattern pattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "operator const short &", METHOD, DECLARATIONS, true ); - char [] string = new char [] { 'o','p','e','r','a','t','o','r',' ','c','o','n','s','t',' ','s','h','o','r','t',' ','&' }; - assertTrue( CharOperation.equals( string, pattern.getSimpleName() ) ); - - pattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "operator short", METHOD, DECLARATIONS, true ); - string = new char [] { 'o','p','e','r','a','t','o','r',' ','s','h','o','r','t' }; - assertTrue( CharOperation.equals( string, pattern.getSimpleName() ) ); - - pattern = (MethodDeclarationPattern) SearchEngine.createSearchPattern( "operator short int", METHOD, DECLARATIONS, true ); - string = new char [] { 'o','p','e','r','a','t','o','r',' ','s','h','o','r','t',' ','i','n','t' }; - assertTrue( CharOperation.equals( string, pattern.getSimpleName() ) ); - } - - public void testConstructorDestructor(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "~A", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - } - - public void testLookupForDefinition(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "turn", METHOD, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - - pattern = SearchEngine.createSearchPattern( "Direction::turn", METHOD, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 0 ); - } -} diff --git a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/OtherPatternTests.java b/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/OtherPatternTests.java deleted file mode 100644 index faea9bf7be9..00000000000 --- a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/OtherPatternTests.java +++ /dev/null @@ -1,366 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 23, 2003 - */ -package org.eclipse.cdt.core.search.tests; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Set; -import java.util.TreeSet; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.search.BasicSearchMatch; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.search.AcceptMatchOperation; -import org.eclipse.cdt.internal.core.search.matching.FieldDeclarationPattern; -import org.eclipse.cdt.internal.core.search.matching.MatchLocator; -import org.eclipse.cdt.internal.core.search.matching.NamespaceDeclarationPattern; -import org.eclipse.cdt.internal.core.search.matching.OrPattern; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class OtherPatternTests extends BaseSearchTest { - - /** - * @param name - */ - public OtherPatternTests(String name) { - super(name); - // TODO Auto-generated constructor stub - } - - public void testNamespaceIndexPrefix(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A::B::c", NAMESPACE, DECLARATIONS, true ); - assertTrue( pattern instanceof NamespaceDeclarationPattern ); - - NamespaceDeclarationPattern nsPattern = (NamespaceDeclarationPattern)pattern; - assertEquals( CharOperation.compareWith( "namespaceDecl/c/B/A".toCharArray(), nsPattern.indexEntryPrefix() ), 0); - - nsPattern = (NamespaceDeclarationPattern) SearchEngine.createSearchPattern( "::*::A::B::c", NAMESPACE, DECLARATIONS, true ); - assertEquals( CharOperation.compareWith( "namespaceDecl/c/B/A/".toCharArray(), nsPattern.indexEntryPrefix() ), 0); - - nsPattern = (NamespaceDeclarationPattern) SearchEngine.createSearchPattern( "::RT*::c", NAMESPACE, REFERENCES, true ); - assertEquals( CharOperation.compareWith( "namespaceRef/c/RT".toCharArray(), nsPattern.indexEntryPrefix() ), 0); - - nsPattern = (NamespaceDeclarationPattern) SearchEngine.createSearchPattern( "A::B::c", NAMESPACE, REFERENCES, false ); - assertEquals( CharOperation.compareWith( "namespaceRef/".toCharArray(), nsPattern.indexEntryPrefix() ), 0); - } - - public void testVariableIndexPrefix(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "c", VAR, DECLARATIONS, true ); - assertTrue( pattern instanceof FieldDeclarationPattern ); - - FieldDeclarationPattern variablePattern = (FieldDeclarationPattern)pattern; - assertEquals( CharOperation.compareWith( "typeDecl/V/c".toCharArray(), variablePattern.indexEntryPrefix() ), 0); - - variablePattern = (FieldDeclarationPattern) SearchEngine.createSearchPattern( "rt*", VAR, DECLARATIONS, true ); - assertEquals( CharOperation.compareWith( "typeDecl/V/rt".toCharArray(), variablePattern.indexEntryPrefix() ), 0); - - variablePattern = (FieldDeclarationPattern) SearchEngine.createSearchPattern( "Ac", VAR, REFERENCES, false ); - assertEquals( CharOperation.compareWith( "typeRef/V/".toCharArray(), variablePattern.indexEntryPrefix() ), 0); - - variablePattern = (FieldDeclarationPattern) SearchEngine.createSearchPattern( "A?c", VAR, REFERENCES, true ); - assertEquals( CharOperation.compareWith( "typeRef/V/A".toCharArray(), variablePattern.indexEntryPrefix() ), 0); - } - - public void testFieldIndexPrefix(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "A::B::c", FIELD, DECLARATIONS, true ); - assertTrue( pattern instanceof FieldDeclarationPattern ); - - FieldDeclarationPattern fieldPattern = (FieldDeclarationPattern)pattern; - assertEquals( CharOperation.compareWith( "fieldDecl/c/B/A".toCharArray(), fieldPattern.indexEntryPrefix() ), 0); - - fieldPattern = (FieldDeclarationPattern) SearchEngine.createSearchPattern( "::*::A::B::c", FIELD, DECLARATIONS, true ); - assertEquals( CharOperation.compareWith( "fieldDecl/c/B/A/".toCharArray(), fieldPattern.indexEntryPrefix() ), 0); - - fieldPattern = (FieldDeclarationPattern) SearchEngine.createSearchPattern( "::RT*::c", FIELD, REFERENCES, true ); - assertEquals( CharOperation.compareWith( "fieldRef/c/RT".toCharArray(), fieldPattern.indexEntryPrefix() ), 0); - - fieldPattern = (FieldDeclarationPattern) SearchEngine.createSearchPattern( "A::B::c", FIELD, REFERENCES, false ); - assertEquals( CharOperation.compareWith( "fieldRef/".toCharArray(), fieldPattern.indexEntryPrefix() ), 0); - } - - public void testNamespaceDeclaration(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "NS*", NAMESPACE, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 3 ); - } - - public void testNamespaceReferenceInUsingDirective() { - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::NS::NS2", NAMESPACE, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getParentName().equals( "NS::B" ) ); - } - - public void testNamespaceReferenceInClassBaseClause(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "::NS", NAMESPACE, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - - TreeSet sorted = new TreeSet( matches ); - - Iterator iter = sorted.iterator(); - IMatch match = (IMatch) iter.next(); - - assertTrue( match.getName().equals( "C" ) ); - assertTrue( match.getParentName().equals( "NS3" )); - match = (IMatch) iter.next(); - assertTrue( match.getName().equals( "NS_B" ) ); - assertTrue( match.getParentName().equals( "" )); - } - - public void testFieldDeclaration(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "a*Struct", FIELD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getParentName().equals( "NS::B" ) ); - } - - public void testVariableDeclaration(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "b?", VAR, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getParentName().equals( "" ) ); - } - - public void testOrPattern(){ - OrPattern orPattern = new OrPattern(); - orPattern.addPattern( SearchEngine.createSearchPattern( "::NS::B::e", ENUM, REFERENCES, true ) ); - orPattern.addPattern( SearchEngine.createSearchPattern( "Hea*", CLASS, DECLARATIONS, true ) ); - - search( workspace, orPattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - - assertEquals( matches.size(), 3 ); - - orPattern = new OrPattern(); - orPattern.addPattern( SearchEngine.createSearchPattern( "b?", VAR, DECLARATIONS, true ) ); - orPattern.addPattern( SearchEngine.createSearchPattern( "a*Struct", FIELD, DECLARATIONS, true ) ); - orPattern.addPattern( SearchEngine.createSearchPattern( "::NS::NS2", NAMESPACE, REFERENCES, true ) ); - orPattern.addPattern( SearchEngine.createSearchPattern( "A::B::f( A )", METHOD, DECLARATIONS, true ) ); - - search( workspace, orPattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 5 ); - } - - public void testMacroPattern(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "FOO", MACRO, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getName().equals( "FOO" ) ); - assertTrue( match.getParentName().equals( "" )); - - pattern = SearchEngine.createSearchPattern( "FOO", MACRO, ALL_OCCURRENCES, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - } - - public void testEnumerators(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "One", FIELD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getName().equals( "One" ) ); - assertTrue( match.getParentName().equals( "NS::B" )); - - pattern = SearchEngine.createSearchPattern( "NS::B::Two", FIELD, DECLARATIONS, true ); - - search( workspace, pattern, scope, resultCollector ); - - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - match = (IMatch) matches.iterator().next(); - assertTrue( match.getName().equals( "Two" ) ); - assertTrue( match.getParentName().equals( "NS::B" ) ); - } - - public void testEnumeratorReferences(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "One", FIELD, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - IMatch match = (IMatch) matches.iterator().next(); - assertTrue( match.getName().equals( "eE" ) ); - assertTrue( match.getParentName().equals( "NS3::C" )); - } - - public void testParameterReferences(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "index", VAR, REFERENCES, true ); - - search( workspace, pattern, scope, resultCollector ); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 3 ); - } - - public void testBug43129(){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "externalInt", VAR, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "externalInt", VAR, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 0 ); - - pattern = SearchEngine.createSearchPattern( "externalIntWithInitializer", VAR, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "externalIntWithInitializer", VAR, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "externCInt", VAR, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "externCInt", VAR, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 0 ); - - pattern = SearchEngine.createSearchPattern( "externCIntWithInitializer", VAR, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "externCIntWithInitializer", VAR, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "forwardFunction", FUNCTION, ALL_OCCURRENCES, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - - pattern = SearchEngine.createSearchPattern( "normalFunction", FUNCTION, DECLARATIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "normalFunction", FUNCTION, DEFINITIONS, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 1 ); - - pattern = SearchEngine.createSearchPattern( "forwardMethod", METHOD, ALL_OCCURRENCES, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - - pattern = SearchEngine.createSearchPattern( "staticField", FIELD, ALL_OCCURRENCES, true ); - search( workspace, pattern, scope, resultCollector ); - matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 2 ); - } - - public void testNoResourceSearching(){ - String pluginRoot = org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - String path = pluginRoot + "resources/search/include.h"; - - ICSearchPattern pattern = SearchEngine.createSearchPattern( "Head", CLASS, REFERENCES, true ); - - resultCollector.aboutToStart(); - - ArrayList matchesList = new ArrayList(); - MatchLocator matchLocator = new MatchLocator( pattern, resultCollector, scope, monitor ); - matchLocator.locateMatches( new String [] { path }, workspace, null, matchesList); - - AcceptMatchOperation acceptMatchOp = new AcceptMatchOperation(resultCollector, matchesList); - try { - CCorePlugin.getWorkspace().run(acceptMatchOp,null); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // - //resultCollector.done(); - - Set matches = resultCollector.getSearchResults(); - assertEquals( matches.size(), 4 ); - } - - public void testBug42911_43988(){ - BasicSearchMatch match1 = new BasicSearchMatch(); - BasicSearchMatch match2 = new BasicSearchMatch(); - - assertTrue( match1.equals( match2 ) ); - assertTrue( match2.equals( match1 ) ); - - match1.setName( "IWasSaying" ); - match1.setParentName( "boo" ); - match1.setReturnType( "urns" ); - - assertFalse( match1.equals( match2 ) ); - assertFalse( match2.equals( match1 ) ); - - match2.setName( "IWasSaying" ); - match2.setParentName( "boo" ); - match2.setReturnType( "urns" ); - - assertTrue( match1.equals( match2 ) ); - } -} diff --git a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java b/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java deleted file mode 100644 index 9e099a55684..00000000000 --- a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.search.tests; - -import java.io.FileInputStream; -import java.io.InputStreamReader; - -import junit.framework.TestCase; - -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.core.runtime.Path; - -/** - * @author jcamelon - * - */ -public class ParseTestOnSearchFiles extends TestCase -{ - private String pluginRoot; - private FileInputStream fileIn; - private String name; - /** - * - */ - public ParseTestOnSearchFiles() - { - super(); - } - /** - * @param name - */ - public ParseTestOnSearchFiles(String name) - { - super(name); - } - - protected void setUp() throws Exception { - pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.core.tests").find(new Path("/")).getFile(); - name = pluginRoot+ "resources/search/classDecl.cpp"; - fileIn = new FileInputStream(name); - } - - public void testParseOfAndrewsFile() throws Exception - { - ISourceElementRequestor requestor = new NullSourceElementRequestor(); - IScanner scanner = ParserFactory.createScanner( new InputStreamReader( fileIn ), name, new ScannerInfo(), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, requestor, null ); - IParser parser = ParserFactory.createParser( scanner, requestor, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null ); - assertTrue( parser.parse() ); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/SearchTestSuite.java b/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/SearchTestSuite.java deleted file mode 100644 index bcb00fa2231..00000000000 --- a/core/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/SearchTestSuite.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ - -package org.eclipse.cdt.core.search.tests; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class SearchTestSuite extends TestCase { - public static Test suite() { - TestSuite suite= new TestSuite(SearchTestSuite.class.getName()); - - suite.addTestSuite(ClassDeclarationPatternTests.class); - suite.addTestSuite(FunctionMethodPatternTests.class); - suite.addTestSuite(OtherPatternTests.class); - suite.addTestSuite(ParseTestOnSearchFiles.class); - return suite; - } -} diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AISResultPrinter.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AISResultPrinter.java deleted file mode 100644 index ad73bc20531..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AISResultPrinter.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Created on Jun 5, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.core.suite; - -import java.io.PrintStream; - -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.textui.ResultPrinter; - -/** - * @author vhirsl - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class AISResultPrinter extends ResultPrinter { - - /** - * @param writer - */ - public AISResultPrinter(PrintStream writer) { - super(writer); - } - - /* (non-Javadoc) - * @see junit.framework.TestListener#addFailure(junit.framework.Test, junit.framework.AssertionFailedError) - */ - public void addFailure(Test test, AssertionFailedError t) { - super.addFailure(test, t); - getWriter().print("---> "); - } - - /* (non-Javadoc) - * @see junit.framework.TestListener#addError(junit.framework.Test, java.lang.Throwable) - */ - public void addError(Test test, Throwable t) { - super.addError(test, t); - getWriter().print("---> "); - } - - /* (non-Javadoc) - * @see junit.framework.TestListener#startTest(junit.framework.Test) - */ - public void startTest(Test test) { - getWriter().print("."); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java deleted file mode 100644 index 9587fa716ce..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Created on May 16, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.core.suite; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.build.managed.tests.ManagedBuildTests; -import org.eclipse.cdt.core.build.managed.tests.StandardBuildTests; -import org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest; -import org.eclipse.cdt.core.indexer.tests.DependencyTests; -import org.eclipse.cdt.core.indexer.tests.IndexManagerTests; -import org.eclipse.cdt.core.model.failedTests.CModelElementsFailedTests; -import org.eclipse.cdt.core.model.tests.AllCoreTests; -import org.eclipse.cdt.core.model.tests.BinaryTests; -import org.eclipse.cdt.core.model.tests.ElementDeltaTests; -import org.eclipse.cdt.core.model.tests.WorkingCopyTests; -import org.eclipse.cdt.core.parser.failedTests.ASTFailedTests; -import org.eclipse.cdt.core.parser.failedTests.FailedCompleteParseASTTest; -import org.eclipse.cdt.core.parser.failedTests.STLFailedTests; -import org.eclipse.cdt.core.parser.tests.ParserTestSuite; -import org.eclipse.cdt.core.search.tests.SearchTestSuite; - -/** - * @author vhirsl - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class AutomatedIntegrationSuite extends TestSuite { - - public AutomatedIntegrationSuite() {} - - public AutomatedIntegrationSuite(Class theClass, String name) { - super(theClass, name); - } - - public AutomatedIntegrationSuite(Class theClass) { - super(theClass); - } - - public AutomatedIntegrationSuite(String name) { - super(name); - } - - public static Test suite() { - final AutomatedIntegrationSuite suite = new AutomatedIntegrationSuite(); - - // Add all success tests - suite.addTest(ManagedBuildTests.suite()); - suite.addTest(StandardBuildTests.suite()); - suite.addTest(ParserTestSuite.suite()); - suite.addTest(AllCoreTests.suite()); - suite.addTest(BinaryTests.suite()); - suite.addTest(ElementDeltaTests.suite()); - suite.addTest(WorkingCopyTests.suite()); - suite.addTest(SearchTestSuite.suite()); - suite.addTestSuite( CompletionProposalsTest.class); - suite.addTest(DependencyTests.suite()); - //Indexer Tests need to be run after any indexer client tests - //as the last test shuts down the indexing thread - suite.addTest(IndexManagerTests.suite()); - // Last test to trigger report generation - - // Add all failed tests - suite.addTestSuite(ASTFailedTests.class); - suite.addTestSuite(STLFailedTests.class); - suite.addTestSuite(CModelElementsFailedTests.class); - suite.addTestSuite(FailedCompleteParseASTTest.class); - - return suite; - } - -} diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/RunTests.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/RunTests.java deleted file mode 100644 index 1a697c1bc14..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/RunTests.java +++ /dev/null @@ -1,217 +0,0 @@ -package org.eclipse.cdt.core.suite; - -import java.io.FileOutputStream; -import java.io.PrintStream; - -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestListener; -import junit.framework.TestResult; - -import org.eclipse.core.boot.IPlatformRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.Platform; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.testing.ITestHarness; -import org.eclipse.ui.testing.TestableObject; -import org.w3c.dom.CDATASection; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.ProcessingInstruction; - -/** - * @see IPlatformRunnable - */ -public class RunTests implements IPlatformRunnable, ITestHarness, TestListener { - - private TestableObject testableObject; - private PrintStream stream; - private String testReport; - private String pluginName = "org.eclipse.cdt.core.tests"; - Document doc; - Element testRun; - Element testSuite; - Element testClass; - Element test; - - /** - * - */ - public RunTests() { - } - - /** - * @see IPlatformRunnable#run - */ - public Object run(Object args) throws Exception { - - stream = System.out; - - String [] sargs = (String[])args; - - for (int i = 0; i 0) { - IConfigurationElement[] runs = elements[0].getChildren("run"); - if (runs.length > 0) { - Object runnable = runs[0].createExecutableExtension("class"); - if (runnable instanceof IPlatformRunnable) - return (IPlatformRunnable) runnable; - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.testing.ITestHarness#runTests() - */ - public void runTests() { - testableObject.testingStarting(); - testableObject.runTest(new Runnable() { - public void run() { - TestResult results = new TestResult(); - results.addListener(RunTests.this); - - try { - doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); - - ProcessingInstruction pi = doc.createProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"" + testReport +"\""); - doc.appendChild(pi); - - testRun = doc.createElement("testRun"); - doc.appendChild(testRun); - testRun.setAttribute("name", pluginName); - - startSuite(AutomatedIntegrationSuite.class.getName()); - AutomatedIntegrationSuite.suite().run(results); - currentTest = null; - - results.removeListener(RunTests.this); - results.stop(); - - Transformer transformer = TransformerFactory.newInstance().newTransformer(); - transformer.transform(new DOMSource(doc), new StreamResult(stream)); - } catch (Throwable t) { - System.out.println("runTests failed"); - t.printStackTrace(); - } - } - }); - testableObject.testingFinished(); - } - - // Test Listener methods - - Throwable failure; - - /* (non-Javadoc) - * @see junit.framework.TestListener#addError(junit.framework.Test, java.lang.Throwable) - */ - public void addError(Test test, Throwable t) { - failure = t; - } - - /* (non-Javadoc) - * @see junit.framework.TestListener#addFailure(junit.framework.Test, junit.framework.AssertionFailedError) - */ - public void addFailure(Test test, AssertionFailedError t) { - failure = t; - } - - /* (non-Javadoc) - * @see junit.framework.TestListener#endTest(junit.framework.Test) - */ - public void endTest(Test t) { - double time = (System.currentTimeMillis() - startTime) / 1000.0; - - test.setAttribute("time", String.valueOf(time)); - - String result; - if (failure == null) - result = "pass"; - else { - CDATASection data = doc.createCDATASection(failure.toString()); - test.appendChild(data); - - if (failure instanceof AssertionFailedError) - result = "failed"; - else - result = "error"; - } - - test.setAttribute("result", result); - - failure = null; - } - - private Class currentTest; - - private long startTime; - - /* (non-Javadoc) - * @see junit.framework.TestListener#startTest(junit.framework.Test) - */ - public void startTest(Test t) { - if (t.getClass() != currentTest) { - currentTest = t.getClass(); - testClass = doc.createElement("testClass"); - testSuite.appendChild(testClass); - testClass.setAttribute("name", currentTest.getName()); - } - - test = doc.createElement("test"); - testClass.appendChild(test); - String name = t.toString(); - name = name.substring(0, name.indexOf('(')); - test.setAttribute("name", name); - - startTime = System.currentTimeMillis(); - } - - // Report Generator - - private void startSuite(String name) { - testSuite = doc.createElement("testSuite"); - testRun.appendChild(testSuite); - testSuite.setAttribute("name", name); - } - -} diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CElementDecorator.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CElementDecorator.java deleted file mode 100644 index b6b239f11a9..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CElementDecorator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import org.eclipse.swt.graphics.Image; - -import org.eclipse.jface.viewers.ILabelDecorator; -import org.eclipse.jface.viewers.LabelProvider; - -/** - * Allows to test decorators for Java elements - */ -public class CElementDecorator extends LabelProvider implements ILabelDecorator { - - /* - * @see ILabelDecorator#decorateImage(Image, Object) - */ - public Image decorateImage(Image image, Object element) { - return null; - } - - /* - * @see ILabelDecorator#decorateText(String, Object) - */ - public String decorateText(String text, Object element) { - return text + "*"; - } -} diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CProjectHelper.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CProjectHelper.java deleted file mode 100644 index 94f95e7ee6f..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/CProjectHelper.java +++ /dev/null @@ -1,259 +0,0 @@ -package org.eclipse.cdt.testplugin; - -import java.lang.reflect.InvocationTargetException; -import java.util.zip.ZipFile; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.ui.dialogs.IOverwriteQuery; -import org.eclipse.ui.wizards.datatransfer.ImportOperation; -import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider; - -/** - * Helper methods to set up a ICProject. - */ -public class CProjectHelper { - - /** - * Creates a ICProject. - */ - public static ICProject createCProject(String projectName, String binFolderName) throws CoreException { - IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); - IProject project= root.getProject(projectName); - if (!project.exists()) { - project.create(null); - } else { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - if (!project.isOpen()) { - project.open(null); - } - - if (!project.hasNature(CProjectNature.C_NATURE_ID)) { - String projectId = CCorePlugin.PLUGIN_ID + ".make"; - CCorePlugin.getDefault().mapCProjectOwner(project, projectId, false); - addNatureToProject(project, CProjectNature.C_NATURE_ID, null); - } - - ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project); - - return cproject; - } - - /** - * Removes a ICProject. - */ - public static void delete(ICProject cproject) throws CoreException { - - try { - cproject.getProject().delete(true, true, null); - } catch (CoreException e) { - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - - } - finally{ - cproject.getProject().delete(true, true, null); - } - - } - - - } - - - /** - * Adds a source container to a ICProject. - */ - public static ICContainer addSourceContainer(ICProject cproject, String containerName) throws CoreException { - IProject project= cproject.getProject(); - ICContainer container= null; - if (containerName == null || containerName.length() == 0) { - container= CModelManager.getDefault().create(project); - } else { - IFolder folder= project.getFolder(containerName); - if (!folder.exists()) { - folder.create(false, true, null); - } - container= CModelManager.getDefault().create(folder); - } - - return container; - } - - /** - * Adds a source container to a ICProject and imports all files contained - * in the given Zip file. - */ - public static ICContainer addSourceContainerWithImport(ICProject cproject, String containerName, ZipFile zipFile) throws InvocationTargetException, CoreException { - ICContainer root= addSourceContainer(cproject, containerName); - importFilesFromZip(zipFile, root.getPath(), null); - return root; - } - - /** - * Removes a source folder from a ICProject. - */ - public static void removeSourceContainer(ICProject cproject, String containerName) throws CoreException { - IFolder folder= cproject.getProject().getFolder(containerName); - folder.delete(true, null); - } - - - - /** - * Attempts to find an archive with the given name in the workspace - */ - public static IArchive findArchive(ICProject testProject,String name) { - int x; - IArchive[] myArchives; - IArchiveContainer archCont; - /*** - * Since ArchiveContainer.getArchives does not wait until - * all the archives in the project have been parsed before - * returning the list, we have to do a sync ArchiveContainer.getChildren - * first to make sure we find all the archives. - */ - archCont=testProject.getArchiveContainer(); - - myArchives=archCont.getArchives(); - if (myArchives.length<1) - return(null); - for (x=0;xPreferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.testplugin; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; - -/** - * @author bgheorgh - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class FileManager { - ArrayList fileHandles; - - public FileManager(){ - fileHandles = new ArrayList(); - } - - public void addFile(IFile file){ - fileHandles.add(file); - } - - public void closeAllFiles() throws CoreException{ - Iterator iter = fileHandles.iterator(); - while (iter.hasNext()){ - IFile tempFile = (IFile) iter.next(); - tempFile.refreshLocal(IResource.DEPTH_INFINITE,null); - - try { - tempFile.delete(true,null); - } catch (CoreException e) { - try { - Thread.sleep(2000); - } catch (InterruptedException e1) { - - } - finally{ - tempFile.delete(true,null); - } - - } - - } - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/Main.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/Main.java deleted file mode 100644 index a6d6af47ca0..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/Main.java +++ /dev/null @@ -1,528 +0,0 @@ -package org.eclipse.cdt.testplugin; - -// copied from startup.jar. planned to be removed soon - - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.net.*; -import java.lang.reflect.*; -import java.io.*; -import java.util.*; -/** - * Startup class for Eclipse. Creates a class loader using - * supplied URL of platform installation, loads and calls - * the Eclipse Boot Loader. The startup arguments are as follows: - *
    - *
    - * -application <id>: the identifier of the application to run - *
    - *
    - * -boot <location>: the location, expressed as a URL, of the platform's boot.jar - *
    - *
    - * -consolelog : enables log to the console. Handy when combined with -debug - *
    - *
    - * -data <location>: sets the workspace location and the default location for projects - *
    - *
    - * -debug [options file]: turns on debug mode for the platform and optionally specifies a location - * for the .options file. This file indicates what debug points are available for a - * plug-in and whether or not they are enabled. If a location is not specified, the platform searches - * for the .options file under the install directory - *
    - *
    - * -dev [entries]: turns on dev mode and optionally specifies comma-separated class path entries - * which are added to the class path of each plug-in - *
    - *
    - * -keyring <location>: the location of the authorization database on disk. This argument - * has to be used together with the -password argument - *
    - *
    - * -password <passwd>: the password for the authorization database - *
    - *
    - * -plugins <location>: The arg is a URL pointing to a file which specs the plugin - * path for the platform. The file is in property file format where the keys are user-defined - * names and the values are comma separated lists of either explicit paths to plugin.xml - * files or directories containing plugins. (e.g., .../eclipse/plugins). - *
    - *
    - * -ws <window system>: sets the window system value - *
    - *
    - */ -public class Main { - /** - * Indicates whether this instance is running in debug mode. - */ - protected boolean debug = false; - - /** - * The location of the launcher to run. - */ - protected String bootLocation = null; - - /** - * The identifier of the application to run. - */ - protected String application; - - /** - * The path for finding find plugins. - */ - protected URL pluginPathLocation; - - /** - * The boot path location. - */ - protected String location; - - /** - * Indicates whether items for UNinstallation should be looked for. - */ - protected boolean uninstall = false; - - /** - * The item to be uninstalled. - */ - protected String uninstallCookie; - - /** - * The class path entries. - */ - protected String devClassPath = null; - - /** - * Indicates whether this instance is running in development mode. - */ - protected boolean inDevelopmentMode = false; - - // static token describing how to take down the splash screen - private static String endSplash = null; - - // constants - private static final String APPLICATION = "-application"; - private static final String BOOT = "-boot"; - private static final String DEBUG = "-debug"; - private static final String DEV = "-dev"; - private static final String ENDSPLASH = "-endsplash"; - private static final String UNINSTALL = "-uninstall"; - private static final String PI_BOOT = "org.eclipse.core.boot"; - private static final String BOOTLOADER = "org.eclipse.core.boot.BootLoader"; - private static final String UPDATELOADER = "org.eclipse.core.internal.boot.LaunchInfo"; - - // The project containing the boot loader code. This is used to construct - // the correct class path for running in VAJ and VAME. - private static final String PROJECT_NAME = "Eclipse Core Boot"; - - private static boolean inVAJ; - static { - try { - Class.forName("com.ibm.uvm.lang.ProjectClassLoader"); - inVAJ = true; - } catch (Exception e) { - inVAJ = false; - } - } - private static boolean inVAME; - static { - try { - Class.forName("com.ibm.eclipse.core.VAME"); - inVAME = true; - } catch (Exception e) { - inVAME = false; - } - } - -/** - * Executes the launch. - * - * @return the result of performing the launch - * @param args command-line arguments - * @exception Exception thrown if a problem occurs during the launch - */ -protected Object basicRun(String[] args) throws Exception { - Class clazz = getBootLoader(bootLocation); - Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, URL.class, String.class, String[].class }); - try { - return method.invoke(clazz, new Object[] { application, pluginPathLocation, location, args }); - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof Error) - throw (Error) e.getTargetException(); - else - throw e; - } -} - -/** - * Returns the result of converting a list of comma-separated tokens into an array - * - * @return the array of string tokens - * @param prop the initial comma-separated string - */ -private String[] getArrayFromList(String prop) { - if (prop == null || prop.trim().equals("")) - return new String[0]; - Vector list = new Vector(); - StringTokenizer tokens = new StringTokenizer(prop, ","); - while (tokens.hasMoreTokens()) { - String token = tokens.nextToken().trim(); - if (!token.equals("")) - list.addElement(token); - } - return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[0]); -} -/** - * Creates and returns a platform BootLoader which can be used to start - * up and run the platform. The given base, if not null, - * is the location of the boot loader code. If the value is null - * then the boot loader is located relative to this class. - * - * @return the new boot loader - * @param base the location of the boot loader - */ -public Class getBootLoader(String base) throws Exception { - URLClassLoader loader = new URLClassLoader(getBootPath(base), null); - return loader.loadClass(BOOTLOADER); -} -/** - * Returns the URL-based class path describing where the boot classes - * are located when running in development mode. - * - * @return the url-based class path - * @param base the base location - * @exception MalformedURLException if a problem occurs computing the class path - */ -protected URL[] getDevPath(URL base) throws MalformedURLException { - URL url; - String devBase = base.toExternalForm(); - if (!inDevelopmentMode) { - url = new URL(devBase + "boot.jar"); - return new URL[] {url}; - } - String[] locations = getArrayFromList(devClassPath); - ArrayList result = new ArrayList(locations.length); - for (int i = 0; i < locations.length; i++) { - String spec = devBase + locations[i]; - char lastChar = spec.charAt(spec.length() - 1); - if ((spec.endsWith(".jar") || (lastChar == '/' || lastChar == '\\'))) - url = new URL (spec); - else - url = new URL(spec + "/"); - //make sure URL exists before adding to path - if (new java.io.File(url.getFile()).exists()) - result.add(url); - } - url = new URL(devBase + "boot.jar"); - if (new java.io.File(url.getFile()).exists()) - result.add(url); - return (URL[])result.toArray(new URL[result.size()]); -} - -/** - * Returns the URL-based class path describing where the boot classes are located. - * - * @return the url-based class path - * @param base the base location - * @exception MalformedURLException if a problem occurs computing the class path - */ -protected URL[] getBootPath(String base) throws MalformedURLException { - URL url = null; - // if the given location is not null, assume it is correct and use it. - if (base != null) { - url = new URL(base); - if (debug) - System.out.println("Boot URL: " + url.toExternalForm()); - return new URL[] {url}; - } - // Create a URL based on the location of this class' code. - // strip off jar file and/or last directory to get - // to the directory containing projects. - URL[] result = null; - url = getClass().getProtectionDomain().getCodeSource().getLocation(); - String path = url.getFile(); - if (path.endsWith(".jar")) - path = path.substring(0, path.lastIndexOf("/")); - else - if (path.endsWith("/")) - path = path.substring(0, path.length() - 1); - if (inVAJ || inVAME) { - int ix = path.lastIndexOf("/"); - path = path.substring(0, ix + 1); - path = path + PROJECT_NAME + "/"; - url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); - result = new URL[] {url}; - } else { - path = searchForPlugins(path); - path = searchForBoot(path); - // add on any dev path elements - url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); - result = getDevPath(url); - } - if (debug) { - System.out.println("Boot URL:"); - for (int i = 0; i < result.length; i++) - System.out.println(" " + result[i].toExternalForm()); - } - return result; -} - -/** - * Searches for a plugins root starting at a given location. If one is - * found then this location is returned; otherwise an empty string is - * returned. - * - * @return the location where plugins were found, or an empty string - * @param start the location to begin searching at - */ -protected String searchForPlugins(String start) { - File path = new File(start); - while (path != null) { - File test = new File(path, "plugins"); - if (test.exists()) - return test.toString(); - path = path.getParentFile(); - path = (path == null || path.length() == 1) ? null : path; - } - return ""; -} -/** - * Searches for a boot directory starting at a given location. If one - * is found then this location is returned; otherwise an empty string - * is returned. - * - * @return the location where plugins were found, or an empty string - * @param start the location to begin searching at - */ -protected String searchForBoot(String start) { - FileFilter filter = new FileFilter() { - public boolean accept(File candidate) { - return candidate.getName().startsWith(PI_BOOT); - } - }; - File[] boots = new File(start).listFiles(filter); - String result = null; - String maxVersion = null; - for (int i = 0; i < boots.length; i++) { - String name = boots[i].getName(); - int index = name.lastIndexOf('_'); - if (index == -1) { - result = boots[i].getAbsolutePath(); - i = boots.length; - } else { - if (index > 0) { - String version = name.substring(index + 1); - if (maxVersion == null) { - result = boots[i].getAbsolutePath(); - maxVersion = version; - } else - if (maxVersion.compareTo(version) == -1) { - result = boots[i].getAbsolutePath(); - maxVersion = version; - } - } - } - } - if (result == null) - throw new RuntimeException("Could not find bootstrap code. Check location of boot plug-in or specify -boot."); - return result.replace(File.separatorChar, '/') + "/"; -} -/** - * Returns the update loader for the given boot path. - * - * @return the update loader - * @param base the boot path base - * @exception Exception thrown is a problem occurs determining this loader - */ -public Class getUpdateLoader(String base) throws Exception { - URLClassLoader loader = new URLClassLoader(getBootPath(base), null); - return loader.loadClass(UPDATELOADER); -} -/** - * Runs the platform with the given arguments. The arguments must identify - * an application to run (e.g., -application com.example.application). - * After running the application System.exit(N) is executed. - * The value of N is derived from the value returned from running the application. - * If the application's return value is an Integer, N is this value. - * In all other cases, N = 0. - *

    - * Clients wishing to run the platform without a following System.exit - * call should use run(). - * - * @see #run - * - * @param args the command line arguments - */ -public static void main(String[] args) { - Object result = null; - try { - result = new Main().run(args); - } catch (Throwable e) { - // try and take down the splash screen. - endSplash(); - System.out.println("Exception launching the Eclipse Platform:"); - e.printStackTrace(); - } - int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0; - System.exit(exitCode); -} -/** - * Tears down the currently-displayed splash screen. - */ -public static void endSplash() { - if (endSplash == null) - return; - try { - Runtime.getRuntime().exec(endSplash); - } catch (Exception e) { - } -} - -/** - * Runs this launcher with the arguments specified in the given string. - * - * @param argString the arguments string - * @exception Exception thrown if a problem occurs during launching - */ -public static void main(String argString) throws Exception { - Vector list = new Vector(5); - for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) - list.addElement((String) tokens.nextElement()); - main((String[]) list.toArray(new String[list.size()])); -} - -/** - * Processes the command line arguments - * - * @return the arguments to pass through to the launched application - * @param args the command line arguments - */ -protected String[] processCommandLine(String[] args) throws Exception { - int[] configArgs = new int[100]; - configArgs[0] = -1; // need to initialize the first element to something that could not be an index. - int configArgIndex = 0; - for (int i = 0; i < args.length; i++) { - boolean found = false; - // check for args without parameters (i.e., a flag arg) - // check if debug should be enabled for the entire platform - if (args[i].equalsIgnoreCase(DEBUG)) { - debug = true; - // passed thru this arg (i.e., do not set found = true - continue; - } - - // check if development mode should be enabled for the entire platform - // If this is the last arg or there is a following arg (i.e., arg+1 has a leading -), - // simply enable development mode. Otherwise, assume that that the following arg is - // actually some additional development time class path entries. This will be processed below. - if (args[i].equalsIgnoreCase(DEV) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) { - inDevelopmentMode = true; - // do not mark the arg as found so it will be passed through - continue; - } - - // done checking for args. Remember where an arg was found - if (found) { - configArgs[configArgIndex++] = i; - continue; - } - // check for args with parameters. If we are at the last argument or if the next one - // has a '-' as the first character, then we can't have an arg with a parm so continue. - if (i == args.length - 1 || args[i + 1].startsWith("-")) - continue; - String arg = args[++i]; - - // look for the laucher to run - if (args[i - 1].equalsIgnoreCase(BOOT)) { - bootLocation = arg; - found = true; - } - - // look for the development mode and class path entries. - if (args[i - 1].equalsIgnoreCase(DEV)) { - inDevelopmentMode = true; - devClassPath = arg; - continue; - } - - // look for the application to run - if (args[i - 1].equalsIgnoreCase(APPLICATION)) { - application = arg; - found = true; - } - - // look for token to use to end the splash screen - if (args[i - 1].equalsIgnoreCase(ENDSPLASH)) { - endSplash = arg; - continue; - } - - // look for items to uninstall - if (args[i - 1].equalsIgnoreCase(UNINSTALL)) { - uninstall = true; - uninstallCookie = arg; - found = true; - } - - // done checking for args. Remember where an arg was found - if (found) { - configArgs[configArgIndex++] = i - 1; - configArgs[configArgIndex++] = i; - } - } - // remove all the arguments consumed by this argument parsing - if (configArgIndex == 0) - return args; - String[] passThruArgs = new String[args.length - configArgIndex]; - configArgIndex = 0; - int j = 0; - for (int i = 0; i < args.length; i++) { - if (i == configArgs[configArgIndex]) - configArgIndex++; - else - passThruArgs[j++] = args[i]; - } - return passThruArgs; -} -/** - * Runs the application to be launched. - * - * @return the return value from the launched application - * @param args the arguments to pass to the application - * @exception thrown if a problem occurs during launching - */ -public Object run(String[] args) throws Exception { - String[] passThruArgs = processCommandLine(args); - if (uninstall) - return updateRun(UNINSTALL, uninstallCookie, passThruArgs); - else - return basicRun(passThruArgs); -} -/** - * Performs an update run. - * - * @return the return value from the update loader - * @param flag flag to give to the update loader - * @param value value to give to the update loader - * @param args arguments to give to the update loader. - * @exception Exception thrown if a problem occurs during execution - */ -protected Object updateRun(String flag, String value, String[] args) throws Exception { - Class clazz = getUpdateLoader(bootLocation); - Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, String.class, String.class, String[].class }); - try { - return method.invoke(clazz, new Object[] { flag, value, location, args }); - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof Error) - throw (Error) e.getTargetException(); - else - throw e; - } -} -} diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/NewMain.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/NewMain.java deleted file mode 100644 index 66161e7a7bf..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/NewMain.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URL; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.Vector; - -/** - * Application is responsible for calling core launch api - */ - -public class NewMain extends Main { - private static final String DEFAULT_APPLICATION= "org.eclipse.ui.workbench"; - - - public NewMain(String application, String location, URL pluginPathLocation, String bootLocation, boolean debug) throws IOException { - this.application= application; - this.location= location; - this.pluginPathLocation= pluginPathLocation; - this.bootLocation= bootLocation; - } - - public static void main(String[] args) { - try { - String location= getLocationFromProperties("platform"); - new NewMain(DEFAULT_APPLICATION, location, null, null, true).run(args); - } catch (Throwable e) { - System.out.println("Exception launching the Eclipse Platform UI:"); - e.printStackTrace(); - } - System.exit(0); - } - - - /** - * Run this launcher with the arguments specified in the given string. - * This is a short cut method for people running the launcher from - * a scrapbook (i.e., swip-and-doit facility). - */ - public static void main(String argString) throws Exception { - Vector list= new Vector(5); - for (StringTokenizer tokens= new StringTokenizer(argString, " "); tokens.hasMoreElements();) - list.addElement((String) tokens.nextElement()); - main((String[]) list.toArray(new String[list.size()])); - } - - public static String getLocationFromProperties(String key) { - Properties properties= new Properties(); - try { - FileInputStream fis= new FileInputStream(getSettingsFile()); - properties.load(fis); - return properties.getProperty(key); - } catch (IOException e) { - } - return null; - } - - private static File getSettingsFile() { - String home= System.getProperty("user.home"); - if (home == null) { - System.out.println("Home dir not defined"); - return null; - } - return new File(home, "eclipse-workspaces.properties"); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/TestPluginLauncher.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/TestPluginLauncher.java deleted file mode 100644 index 4ee939df6b5..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/TestPluginLauncher.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import java.net.URL; - -/** - * Helper class to launch a test - */ -public class TestPluginLauncher { - - public static final String APP_NAME= "org.eclipse.jdt.ui.tests.app"; - - public static void run(String location, Class testCase, String[] args) { - run(APP_NAME, location, testCase, args); - } - - public static void run(String application, String location, Class testCase, String[] args) { - try { - String bootLocation= getBootLocation(); - int nArgs= args.length; - String[] newArgs= new String[4 + nArgs]; - newArgs[0]= testCase.getName(); - for (int i= 0; i < nArgs; i++) { - newArgs[1 + i]= args[i]; - } - newArgs[1 + nArgs]= "-dev"; - newArgs[1 + nArgs + 1]= "bin"; - newArgs[1 + nArgs + 2]= "-debug"; - NewMain newMain= new NewMain(application, location, null, bootLocation, false); - newMain.run(newArgs); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static String getLocationFromProperties(String key) { - return NewMain.getLocationFromProperties(key); - } - - public static String getLocationFromProperties() { - return NewMain.getLocationFromProperties("tests"); - } - - public static String getBootLocation() { - URL url= TestPluginLauncher.class.getResource("TestPluginLauncher.class"); - String s= url.toString(); - int index= s.indexOf("/org.eclipse.jdt.ui.tests"); - if (index == -1) - throw new IllegalArgumentException(); - s= s.substring(0, index); - s= s + "/org.eclipse.core.boot/boot.jar"; - return s; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java deleted file mode 100644 index 2a6e8fe44bd..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.cdt.testplugin.util; - - -import java.util.ArrayList; - - -public class AccessibilityTestPass implements IDialogTestPass { - private static final int CHECKLIST_SIZE = 5; - - /** - * @see IDialogTestPass#title() - */ - public String title() { - return "Test Pass: Accessibility"; - } - /** - * @see IDialogTestPass#description() - */ - public String description() { - return "Verify the accessibility of the dialogs."; - } - /** - * @see IDialogTestPass#label() - */ - public String label() { - return "&Accessibility"; - } - /** - * @see IDialogTestPass#checkListTexts() - */ - public ArrayList checkListTexts() { - ArrayList list = new ArrayList(CHECKLIST_SIZE); - list.add("&1) all widgets are accessible by tabbing."); - list.add("&2) forwards and backwards tabbing is in a logical order"); - list.add("&3) all the widgets with labels have an appropriate mnemonic."); - list.add("&4) there are no duplicate mnemonics."); - list.add("&5) selectable widgets can be selected using the spacebar."); - return list; - } - /** - * @see IDialogTestPass#failureTexts() - * Size of the return array must be the same size as the checkListTexts' - * ArrayList. - */ - public String[] failureTexts() { - String[] failureText = new String[CHECKLIST_SIZE]; - failureText[0] = "Some widgets aren't accessible by tabbing."; - failureText[1] = "Tabbing order is illogical."; - failureText[2] = "Missing or inappropriate mnemonics."; - failureText[3] = "Duplicate mnemonics."; - failureText[4] = "Some widgets cannot be selected using the spacebar."; - return failureText; - } - /** - * @see IDialogTestPass#queryText() - */ - public String queryText() { - return "Is the accessibility of the dialog acceptable?"; - } - /** - * @see IDialogTestPass#getID() - */ - public int getID() { - return VerifyDialog.TEST_ACCESS; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStrings.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStrings.java deleted file mode 100644 index d7cc8c48187..00000000000 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/testplugin/util/ExpectedStrings.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.eclipse.cdt.testplugin.util; - - -import java.util.Stack; -/** - * @author Peter Graves - * - * This utility class maintains a list of strings, and as a tests finds strings - * in a structure/list, it will maintain a list of unfound/extra strings. - */ -public class ExpectedStrings { - - public String [] expStrings; - private boolean[] foundStrings; - private Stack extraStrings; /* A stack of the unecpected strings we - * recieved - */ - private boolean extra; - - /** - * Constructor for ExpectedStrings. - */ - public ExpectedStrings() { - } - /** - * Constructor for ExpectedStrings that accepts a list of strings that - * we expect to get. - */ - public ExpectedStrings(String[] values) { - int x; - expStrings=new String[values.length]; - for (x=0;x= 0) ) { - TEST_TYPE = TEST_SIZING; - } - _failureText = ""; - _dialogTests[0] = new SizingTestPass(); - _dialogTests[1] = new FocusTestPass(); - _dialogTests[2] = new AccessibilityTestPass(); - } - - /* (non-Javadoc) - * Method declared on Window. - */ - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Dialog Verification"); - setShellStyle(SWT.NONE); - } - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected void createButtonsForButtonBar(Composite parent) { - _yesButton = createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true); - _noButton = createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false); - } - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected void buttonPressed(int buttonId) { - if (IDialogConstants.YES_ID == buttonId) { - setReturnCode(IDialogConstants.YES_ID); - if (_testDialog.getShell() != null) { - _testDialog.close(); - } - close(); - } else if (IDialogConstants.NO_ID == buttonId) { - handleFailure(); - } - } - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected Control createDialogArea(Composite parent) { - // top level composite - Composite parentComposite = (Composite)super.createDialogArea(parent); - - - // create a composite with standard margins and spacing - Composite composite = new Composite(parentComposite, SWT.NONE); - composite.setSize(SIZING_WIDTH, SWT.DEFAULT); - GridLayout layout = new GridLayout(); - layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); - layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - - createTestSelectionGroup(composite); - createCheckListGroup(composite); - - - _queryLabel = new Label(composite, SWT.NONE); - _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - initializeTest(); - return composite; - } - /* - * Group for selecting type of test. - */ - private void createTestSelectionGroup(Composite parent) { - Group group = new Group(parent, SWT.SHADOW_NONE); - group.setText("Testing:"); - group.setLayout( new GridLayout() ); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - group.setLayoutData(data); - - for (int i = 0; i < _dialogTests.length; i++) { - Button radio = new Button(group, SWT.RADIO); - radio.setText( _dialogTests[i].label() ); - final int testID = _dialogTests[i].getID(); - radio.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TEST_TYPE = testID; - initializeTest(); - _yesButton.setEnabled(true); - } - }); - if ( TEST_TYPE == _dialogTests[i].getID() ) { - radio.setSelection(true); - } - } - } - /* - * Initializes the checklist with empty checks. - */ - private void createCheckListGroup(Composite parent) { - Group group = new Group(parent, SWT.SHADOW_NONE); - group.setText("Verify that:"); - group.setLayout( new GridLayout() ); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - group.setLayoutData(data); - - int checkListSize = 0; - for (int i = 0; i < _dialogTests.length; i++) { - int size = _dialogTests[i].checkListTexts().size(); - if (size > checkListSize) { - checkListSize = size; - } - } - _checkList = new Button[checkListSize]; - SelectionAdapter selectionAdapter = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - checkYesEnable(); - } - }; - for (int i = 0; i < checkListSize; i++) { - _checkList[i] = new Button(group, SWT.CHECK); - _checkList[i].addSelectionListener(selectionAdapter); - data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.grabExcessHorizontalSpace = true; - _checkList[i].setLayoutData(data); - } - } - /* - * Disables the yes button if any of the items in the checklist - * are unchecked. Enables the yes button otherwise. - */ - void checkYesEnable() { - boolean enable = true; - for (int i = 0; i < _checkList.length; i++) { - if ( !_checkList[i].getSelection() ) { - enable = false; - } - } - _yesButton.setEnabled(enable); - } - /* - * Initializes the checklist, banner texts, and query label - */ - void initializeTest() { - IDialogTestPass test = _dialogTests[TEST_TYPE]; - setTitle( test.title() ); - setMessage( test.description() ); - Iterator iterator = test.checkListTexts().iterator(); - for (int i = 0; i < _checkList.length; i++) { - if ( iterator.hasNext() ) { - _checkList[i].setText( iterator.next().toString() ); - _checkList[i].setVisible(true); - _checkList[i].update(); - } else { - _checkList[i].setVisible(false); - _checkList[i].update(); - } - _checkList[i].setSelection(true); - } - _queryLabel.setText( test.queryText() ); - } - public String getFailureText() { - return _failureText; - } - /* - * Can't open the verification dialog without a specified - * test dialog, this simply returns a failure and prevents - * opening. Should use open(Dialog) instead. - * - */ - public int open() { - _failureText = "Testing dialog is required, use VerifyDialog::open(Dialog)"; - return IDialogConstants.NO_ID; - } - /* - * Opens the verification dialog to test the specified dialog. - */ - public int open(Dialog testDialog) { - if (getShell() == null) { - create(); - } - getShell().setLocation(0, 0); - getShell().setSize(Math.max(SIZING_WIDTH, getShell().getSize().x), getShell().getSize().y); - _testDialog = testDialog; - if (_testDialog.getShell() == null) { - _testDialog.create(); - } - _testDialogSize = _testDialog.getShell().getSize(); - openNewTestDialog(); - - return super.open(); - } - /* - * Opens the dialog to be verified. - */ - private void openNewTestDialog() { - if (_testDialog.getShell() == null) { - _testDialog.create(); - } - _testDialog.setBlockOnOpen(false); - _testDialog.getShell().setLocation(getShell().getSize().x + 1, 0); - _testDialog.getShell().setSize(_testDialogSize); - _testDialog.getShell().addShellListener(new ShellAdapter() { - public void shellClosed(ShellEvent e) { - e.doit = false; - } - - }); - _testDialog.open(); - } - /* - * The test dialog failed, open the failure dialog. - */ - private void handleFailure() { - IDialogTestPass test = _dialogTests[TEST_TYPE]; - StringBuffer text = new StringBuffer(); - String label = test.label(); - label = label.substring(0, label.indexOf("&")) + - label.substring(label.indexOf("&") + 1); - text.append(label). - append(" failed on the "). - append(SWT.getPlatform()). - append(" platform:\n"); - - String failureMessages[] = test.failureTexts(); - for (int i = 0; i < test.checkListTexts().size(); i++) { - if ( !_checkList[i].getSelection() ) { - text.append("- ").append(failureMessages[i]).append("\n"); - } - } - FailureDialog dialog = new FailureDialog( getShell() ); - dialog.create(); - //String temp = text.toString(); - dialog.setText( text.toString() ); - if (dialog.open() == IDialogConstants.OK_ID) { - _failureText = dialog.toString(); - setReturnCode(IDialogConstants.NO_ID); - if (_testDialog.getShell() != null) { - _testDialog.close(); - } - close(); - } - } - /* - * In case the shell was closed by a means other than - * the NO button. - */ - protected void handleShellCloseEvent() { - handleFailure(); - } -} - - diff --git a/core/org.eclipse.cdt.core.tests/test.xml b/core/org.eclipse.cdt.core.tests/test.xml deleted file mode 100644 index baaed837370..00000000000 --- a/core/org.eclipse.cdt.core.tests/test.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.win32/.classpath b/core/org.eclipse.cdt.core.win32/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/core/org.eclipse.cdt.core.win32/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/core/org.eclipse.cdt.core.win32/.cvsignore b/core/org.eclipse.cdt.core.win32/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/core/org.eclipse.cdt.core.win32/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/core/org.eclipse.cdt.core.win32/.project b/core/org.eclipse.cdt.core.win32/.project deleted file mode 100644 index 0c2dc05e8ad..00000000000 --- a/core/org.eclipse.cdt.core.win32/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.core.win32 - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.core.win32/ChangeLog b/core/org.eclipse.cdt.core.win32/ChangeLog deleted file mode 100644 index fffce6ca5d4..00000000000 --- a/core/org.eclipse.cdt.core.win32/ChangeLog +++ /dev/null @@ -1,104 +0,0 @@ -2003-08-29 Alex Chapiro - - This patch just increase command line buffer up to OS limit (2K). It also - replaces java/lang/Exception to java/io/IOException in order to unify error - processing. - - * library/Win32ProcessEx.c - * library/starter/starter.cpp - * library/spawner.dsw - * os/win32/x86/spawner.dll - * os/win32/x86/starter.exe - -2003-04-30 Alex Chapiro - - * library/listtasks: new Folder - * library/listtasks/listtasks.cpp: New file. - * library/listtasks/listtasks.dsp: New file. - * library/listtasks/listtasks.dsw: New file. - * library/listtasks/listtasks.h: New file. - * library/listtasks/StdAfx.cpp: New file. - * library/listtasks/StdAfx.h: New file. - * os/win32/x86/listtasks.exe: Rebuild - -2003-04-30 Alain Magloire - - * src/org/eclipse/cdt/internal/core/win32/ProcessList.java (parseTaskList): - New method parsing the windows XP executable. - (parseListTasks): New method parsing the executable that comes with CDT. - -2003-04-24 Alex Chapiro - - * os/win32/x86/spawner.dll: Rebuild - * library/Win32ProcessEx.c: - Include additionnal functionality for interruption. - * library/Spawner.h: - Fix the headers. - * library/raise.c: - New file, implements interruption function. - * src/library/spawner.dsp: - Update, new file raise.c added. - -2003-02-25 Alex Chapiro - - Fix for this type of problem: - make CFLAGS="-D jek " - - * os/win32/x86/spawner.dll: Rebuild - * os/win32/x86/starter.exe: Rebuild - * library/starter/starter.cpp: - Fix problem with embedded quotation - * library/Win32ProcessEx.c: - Fix problem with embedded quotation. - -2003-01-27 Alex Chapiro - - * os/win32/x86/spawner.dll: Rebuild - * library/Win32ProcessEx.c: Synchronization error fix. - -2003-01-23 Alex Chapiro - - * os/win32/x86/spawner.dll: Rebuild - * os/win32/x86/starter.exe: Rebuild - * library/starter/starter.cpp: - Correct quotation escaped. - * library/Win32ProcessEx.c: - Correct quotation escaped. - -2003-01-17 Alex Chapiro - - * os/win32/x86/spawner.dll: Rebuild - * os/win32/x86/starter.exe: Rebuild - * library/starter/starter.cpp (copyTo): - Check for overflow. - * library/Win32ProcessEx.c (..exec1 exec0): - Dynamically allocate environment buffer to avoid overflow. - Check for overflow. - -2003-01-13 Alex Chapiro - - * os/win32/x86/spawner.dll: Rebuild. - * os/win32/x86/starter.exe: Rebuild. - * library/Win32ProcessEx.c: Quoting of spaces when calling starter. - * library/starter/starter.cpp: Quoting of spaces when calling the executable. - -2002-11-06 Alex Chapiro - - * library/Win32ProcessEx.c: - This is a fixing of Bug 25808. New binary attached. - * os/win32/x86/spawner.dll: Recompiled. - -2002-11-06 Alex Chapiro - - * library/Win32ProcessEx.c (GetJVMProc): Removed. - This is a fixing of Bug 25808. - Remove not portable fragment of code (conversion start directory to native - format) relying on passing of correct argument from Spawner.java. Attached - also find spawner.dll (Win32) - -2002-10-21 Alain Magloire - - * library/Win32ProcessEx.c (waitFor): Get the exit value of the process - not starter.exe - * os/win32/x86/spawner.dll: Recompiled. - Patch from Alex Chapiro, for bug 25111. diff --git a/core/org.eclipse.cdt.core.win32/build.properties b/core/org.eclipse.cdt.core.win32/build.properties deleted file mode 100644 index 776fc95bb2e..00000000000 --- a/core/org.eclipse.cdt.core.win32/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/,\ - cdt_win32.jar -src.includes = fragment.xml,\ - fragment.properties,\ - about.html,\ - os/ -source.cdt_win32.jar = src/ diff --git a/core/org.eclipse.cdt.core.win32/fragment.properties b/core/org.eclipse.cdt.core.win32/fragment.properties deleted file mode 100644 index 8f7213ce156..00000000000 --- a/core/org.eclipse.cdt.core.win32/fragment.properties +++ /dev/null @@ -1,2 +0,0 @@ -fragmentName=C/C++ Development Tools Core Win32 Fragment -providerName=Eclipse.org diff --git a/core/org.eclipse.cdt.core.win32/fragment.xml b/core/org.eclipse.cdt.core.win32/fragment.xml deleted file mode 100644 index 05f75f8bc55..00000000000 --- a/core/org.eclipse.cdt.core.win32/fragment.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core.win32/library/Spawner.h b/core/org.eclipse.cdt.core.win32/library/Spawner.h deleted file mode 100644 index 3641bd88ca6..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/Spawner.h +++ /dev/null @@ -1,48 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_eclipse_cdt_utils_spawner_Spawner */ - -#ifndef _Included_org_eclipse_cdt_utils_spawner_Spawner -#define _Included_org_eclipse_cdt_utils_spawner_Spawner -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec0 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: exec1 - * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring); - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: raise - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv *, jobject, jint, jint); - - -/* - * Class: org_eclipse_cdt_utils_spawner_Spawner - * Method: waitFor - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv *, jobject, jint); - -int interruptProcess(int pid); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.win32/library/SpawnerInputStream.h b/core/org.eclipse.cdt.core.win32/library/SpawnerInputStream.h deleted file mode 100644 index 7ab967353eb..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/SpawnerInputStream.h +++ /dev/null @@ -1,32 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream -#ifdef __cplusplus -extern "C" { -#endif -#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE -#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L -/* Inaccessible static: skipBuffer */ -/* - * Class: com_qnx_tools_utils_spawner_SpawnerInputStream - * Method: read0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_com_qnx_tools_utils_spawner_SpawnerInputStream_read0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: com_qnx_tools_utils_spawner_SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_com_qnx_tools_utils_spawner_SpawnerInputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.win32/library/SpawnerOutputStream.h b/core/org.eclipse.cdt.core.win32/library/SpawnerOutputStream.h deleted file mode 100644 index 7470e533c9a..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/SpawnerOutputStream.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */ - -#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_qnx_tools_utils_spawner_SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_com_qnx_tools_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv *, jobject, jint, jbyteArray, jint); - -/* - * Class: com_qnx_tools_utils_spawner_SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_com_qnx_tools_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/core/org.eclipse.cdt.core.win32/library/StdAfx.c b/core/org.eclipse.cdt.core.win32/library/StdAfx.c deleted file mode 100644 index dc7550edf6d..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/StdAfx.c +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -// stdafx.cpp : source file that includes just the standard includes -// spawner.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/core/org.eclipse.cdt.core.win32/library/StdAfx.h b/core/org.eclipse.cdt.core.win32/library/StdAfx.h deleted file mode 100644 index 3ec5e93c719..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/StdAfx.h +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__9D84F180_36E5_47D6_96AB_22723242789C__INCLUDED_) -#define AFX_STDAFX_H__9D84F180_36E5_47D6_96AB_22723242789C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include - -#include - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__9D84F180_36E5_47D6_96AB_22723242789C__INCLUDED_) diff --git a/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c b/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c deleted file mode 100644 index a78d83b2766..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/Win32ProcessEx.c +++ /dev/null @@ -1,817 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -/* - * Win32ProcessEx.c - * - * This is a JNI implementation of spawner - */ -#include "stdafx.h" -#include -#include -#include -#include "Spawner.h" - - -#include "jni.h" -#include "io.h" - -// #define DEBUG_MONITOR - -#define PIPE_SIZE 512 -#define MAX_CMD_SIZE 2049 -#define MAX_ENV_SIZE 4096 - -#define MAX_PROCS (100) - -typedef JNIEXPORT void * (JNICALL * JVM_GetThreadInterruptEvent)(); -typedef JNIEXPORT char * (JNICALL * JVM_NativePath)(const char *); - -typedef struct _procInfo { - int pid; // Process ID - int uid; // quasi-unique process ID - HANDLE eventBreak; - HANDLE eventWait; - HANDLE eventTerminate; -} procInfo_t, * pProcInfo_t; - -static int procCounter = 0; - - -JNIEXPORT void JNICALL ThrowByName(JNIEnv *env, const char *name, const char *msg); -pProcInfo_t createProcInfo(); -pProcInfo_t findProcInfo(int pid); -unsigned int _stdcall waitProcTermination(void* pv) ; -static int copyTo(char * target, const char * source, int cpyLenght, int availSpace); -static void cleanUpProcBlock(pProcInfo_t pCurProcInfo); - - - -typedef enum { - SIG_NOOP, - SIG_HUP, - SIG_INT, - SIG_KILL = 9, - SIG_TERM = 15, -} signals; - -extern CRITICAL_SECTION cs; - - -extern TCHAR path[MAX_PATH]; - -static HMODULE hVM = NULL; - - -static pProcInfo_t pInfo = NULL; - - -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec0 - (JNIEnv * env, jobject process, jobjectArray cmdarray, jobjectArray envp, jstring dir, jintArray channels) -{ - - HANDLE hread[3], hwrite[3]; - SECURITY_ATTRIBUTES sa; - PROCESS_INFORMATION pi = {0}; - STARTUPINFO si; - DWORD flags = 0; - char * cwd = NULL; - LPVOID envBlk = NULL; - int ret = 0; - char szCmdLine[MAX_CMD_SIZE]; - int nBlkSize = MAX_ENV_SIZE; - char * szEnvBlock = (char *)malloc(nBlkSize); - jsize nCmdTokens = 0; - jsize nEnvVars = 0; - int i; - int nPos; - pProcInfo_t pCurProcInfo; - DWORD dwThreadId; - char eventBreakName[20]; - char eventWaitName[20]; - char eventTerminateName[20]; -#ifdef DEBUG_MONITOR - char buffer[1000]; -#endif - - if((HIBYTE(LOWORD(GetVersion()))) & 0x80) - { - ThrowByName(env, "java/io/IOException", "Does not support Windows 3.1/95/98/Me"); - return 0; - } - - if (cmdarray == 0) - { - ThrowByName(env, "java/lang/NullPointerException", "No command line specified"); - return 0; - } - - sa.nLength = sizeof(sa); - sa.lpSecurityDescriptor = 0; - sa.bInheritHandle = TRUE; - - memset(hread, 0, sizeof(hread)); - memset(hwrite, 0, sizeof(hwrite)); - if (!(CreatePipe(&hread[0], &hwrite[0], &sa, PIPE_SIZE) && - CreatePipe(&hread[1], &hwrite[1], &sa, PIPE_SIZE) && - CreatePipe(&hread[2], &hwrite[2], &sa, PIPE_SIZE))) - { - CloseHandle(hread[0]); - CloseHandle(hread[1]); - CloseHandle(hread[2]); - CloseHandle(hwrite[0]); - CloseHandle(hwrite[1]); - CloseHandle(hwrite[2]); - ThrowByName(env, "java/io/IOException", "CreatePipe"); - return 0; - } - - nCmdTokens = (*env) -> GetArrayLength(env, cmdarray); - nEnvVars = (*env) -> GetArrayLength(env, envp); - - pCurProcInfo = createProcInfo(); - - if(NULL == pCurProcInfo) - { - ThrowByName(env, "java/io/IOException", "Too many processes"); - return 0; - } - - - sprintf(eventBreakName, "SABreak%p", pCurProcInfo); - sprintf(eventWaitName, "SAWait%p", pCurProcInfo); - sprintf(eventTerminateName, "SATerm%p", pCurProcInfo); - pCurProcInfo -> eventBreak = CreateEvent(NULL, TRUE, FALSE, eventBreakName); - ResetEvent(pCurProcInfo -> eventBreak); - pCurProcInfo -> eventWait = CreateEvent(NULL, TRUE, FALSE, eventWaitName); - pCurProcInfo -> eventTerminate = CreateEvent(NULL, TRUE, FALSE, eventTerminateName); - ResetEvent(pCurProcInfo -> eventTerminate); - - nPos = sprintf(szCmdLine, "%sstarter.exe %s %s %s ", path, eventBreakName, eventWaitName, eventTerminateName); - - // Prepare command line - for(i = 0; i < nCmdTokens; ++i) - { - jobject item = (*env) -> GetObjectArrayElement(env, cmdarray, i); - jsize len = (*env) -> GetStringUTFLength(env, item); - int nCpyLen; - const char * str = (*env) -> GetStringUTFChars(env, item, 0); - if(NULL != str) - { - if(0 > (nCpyLen = copyTo(szCmdLine + nPos, str, len, MAX_CMD_SIZE - nPos))) - { - ThrowByName(env, "java/io/IOException", "Too long command line"); - return 0; - } - nPos += nCpyLen; - szCmdLine[nPos] = ' '; - ++nPos; - (*env) -> ReleaseStringUTFChars(env, item, str); - } - } - - szCmdLine[nPos] = '\0'; - - // Prepare environment block - if (nEnvVars > 0) - { - nPos = 0; - for(i = 0; i < nEnvVars; ++i) - { - jobject item = (*env) -> GetObjectArrayElement(env, envp, i); - jsize len = (*env) -> GetStringUTFLength(env, item); - const char * str = (*env) -> GetStringUTFChars(env, item, 0); - if(NULL != str) - { - while((nBlkSize - nPos) <= (len + 2)) // +2 for two '\0' - { - nBlkSize += MAX_ENV_SIZE; - szEnvBlock = (char *)realloc(szEnvBlock, nBlkSize); - if(NULL == szEnvBlock) - { - ThrowByName(env, "java/io/IOException", "Not enough memory"); - return 0; - } -#ifdef DEBUG_MONITOR - sprintf(buffer, "Realloc environment block; new length is %i \n", nBlkSize); - OutputDebugString(buffer); -#endif - - } - strncpy(szEnvBlock + nPos, str, len); - nPos += len; - szEnvBlock[nPos] = '\0'; - ++nPos; - (*env) -> ReleaseStringUTFChars(env, item, str); - } - } - szEnvBlock[nPos] = '\0'; - envBlk = szEnvBlock; - } - - - - if (dir != 0) - { - const char * str = (*env) -> GetStringUTFChars(env, dir, 0); - if(NULL != str) - { - cwd = strdup(str); - (*env) -> ReleaseStringUTFChars(env, dir, str); - } - } - - - memset(&si, 0, sizeof(si)); - si.cb = sizeof(si); - si.dwFlags |= STARTF_USESTDHANDLES; - si.dwFlags |= STARTF_USESHOWWINDOW; - si.wShowWindow = SW_HIDE; // Processes in the Process Group are hidden - si.hStdInput = hread[0]; - si.hStdOutput = hwrite[1]; - si.hStdError = hwrite[2]; - - - - - SetHandleInformation(hwrite[0], HANDLE_FLAG_INHERIT, FALSE); - SetHandleInformation(hread[1], HANDLE_FLAG_INHERIT, FALSE); - SetHandleInformation(hread[2], HANDLE_FLAG_INHERIT, FALSE); - - flags = CREATE_NEW_CONSOLE; - flags |= CREATE_NO_WINDOW; - -#ifdef DEBUG_MONITOR - OutputDebugString(szCmdLine); -#endif - - ret = CreateProcess(0, /* executable name */ - szCmdLine, /* command line */ - 0, /* process security attribute */ - 0, /* thread security attribute */ - TRUE, /* inherits system handles */ - flags, /* normal attached process */ - envBlk, /* environment block */ - cwd, /* change to the new current directory */ - &si, /* (in) startup information */ - &pi); /* (out) process information */ - - - - if(NULL != cwd) - free(cwd); - - free(szEnvBlock); - - CloseHandle(hread[0]); - CloseHandle(hwrite[1]); - CloseHandle(hwrite[2]); - - - if (!ret) - { - LPTSTR lpMsgBuf; - - CloseHandle(hwrite[0]); - CloseHandle(hread[1]); - CloseHandle(hread[2]); - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - ThrowByName(env, "java/io/IOException", lpMsgBuf); - // Free the buffer. - LocalFree( lpMsgBuf ); - cleanUpProcBlock(pCurProcInfo); - ret = -1; - } - else - { - int file_handles[3]; - HANDLE h[2]; - int what; - - CloseHandle(pi.hThread); - CloseHandle(pi.hProcess); - - EnterCriticalSection(&cs); - - pCurProcInfo -> pid = pi.dwProcessId; - h[0] = pCurProcInfo -> eventWait; - h[1] = (HANDLE)_beginthreadex(NULL, 0, waitProcTermination, - (void *) pi.dwProcessId, 0, (UINT*) &dwThreadId); - - what = WaitForMultipleObjects(2, h, FALSE, INFINITE); - if((what != WAIT_OBJECT_0) && (pCurProcInfo -> pid > 0)) // CreateProcess failed - { -#ifdef DEBUG_MONITOR - sprintf(buffer, "Process %i failed\n", pi.dwProcessId); - OutputDebugString(buffer); -#endif - cleanUpProcBlock(pCurProcInfo); - ThrowByName(env, "java/io/IOException", "Launching failed"); - } - else - { -#ifdef DEBUG_MONITOR - sprintf(buffer, "Process %i created\n", pi.dwProcessId); - OutputDebugString(buffer); -#endif - ret = (long)(pCurProcInfo -> uid); - file_handles[0] = (int)hwrite[0]; - file_handles[1] = (int)hread[1]; - file_handles[2] = (int)hread[2]; - (*env) -> SetIntArrayRegion(env, channels, 0, 3, file_handles); - } - CloseHandle(h[1]); - LeaveCriticalSection(&cs); - - } - - - return ret; - -} - - -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec1 - (JNIEnv * env, jobject process, jobjectArray cmdarray, jobjectArray envp, jstring dir) -{ - - SECURITY_ATTRIBUTES sa; - PROCESS_INFORMATION pi = {0}; - STARTUPINFO si; - DWORD flags = 0; - char * cwd = NULL; - LPVOID envBlk = NULL; - int ret = 0; - jsize nCmdTokens = 0; - jsize nEnvVars = 0; - int i; - int nPos; - char szCmdLine[MAX_CMD_SIZE]; - int nBlkSize = MAX_ENV_SIZE; - char * szEnvBlock = (char *)malloc(nBlkSize); - - - sa.nLength = sizeof(sa); - sa.lpSecurityDescriptor = 0; - sa.bInheritHandle = TRUE; - - - nCmdTokens = (*env) -> GetArrayLength(env, cmdarray); - nEnvVars = (*env) -> GetArrayLength(env, envp); - - nPos = 0; - - // Prepare command line - for(i = 0; i < nCmdTokens; ++i) - { - jobject item = (*env) -> GetObjectArrayElement(env, cmdarray, i); - jsize len = (*env) -> GetStringUTFLength(env, item); - int nCpyLen; - const char * str = (*env) -> GetStringUTFChars(env, item, 0); - if(NULL != str) - { - if(0 > (nCpyLen = copyTo(szCmdLine + nPos, str, len, MAX_CMD_SIZE - nPos))) - { - ThrowByName(env, "java/io/IOException", "Too long command line"); - return 0; - } - nPos += nCpyLen; - szCmdLine[nPos] = ' '; - ++nPos; - (*env) -> ReleaseStringUTFChars(env, item, str); - } - } - - szCmdLine[nPos] = '\0'; - - // Prepare environment block - if (nEnvVars > 0) - { - nPos = 0; - for(i = 0; i < nEnvVars; ++i) - { - jobject item = (*env) -> GetObjectArrayElement(env, envp, i); - jsize len = (*env) -> GetStringUTFLength(env, item); - const char * str = (*env) -> GetStringUTFChars(env, item, 0); - if(NULL != str) - { - while((nBlkSize - nPos) <= (len + 2)) // +2 for two '\0' - { - nBlkSize += MAX_ENV_SIZE; - szEnvBlock = (char *)realloc(szEnvBlock, nBlkSize); - if(NULL == szEnvBlock) - { - ThrowByName(env, "java/io/IOException", "Not enough memory"); - return 0; - } - } - strncpy(szEnvBlock + nPos, str, len); - nPos += len; - szEnvBlock[nPos] = '\0'; - ++nPos; - (*env) -> ReleaseStringUTFChars(env, item, str); - } - } - szEnvBlock[nPos] = '\0'; - envBlk = szEnvBlock; - } - - - - if (dir != 0) - { - const char * str = (*env) -> GetStringUTFChars(env, dir, 0); - if(NULL != str) - { - cwd = strdup(str); - (*env) -> ReleaseStringUTFChars(env, dir, str); - } - } - - - memset(&si, 0, sizeof(si)); - si.cb = sizeof(si); - - - - - - flags = CREATE_NEW_CONSOLE; - - ret = CreateProcess(0, /* executable name */ - szCmdLine, /* command line */ - 0, /* process security attribute */ - 0, /* thread security attribute */ - TRUE, /* inherits system handles */ - flags, /* normal attached process */ - envBlk, /* environment block */ - cwd, /* change to the new current directory */ - &si, /* (in) startup information */ - &pi); /* (out) process information */ - - - - if(NULL != cwd) - free(cwd); - free(szEnvBlock); - - if (!ret) - { - LPTSTR lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - ThrowByName(env, "java/io/IOException", lpMsgBuf); - // Free the buffer. - LocalFree( lpMsgBuf ); - ret = -1; - } - else - { - CloseHandle(pi.hThread); - CloseHandle(pi.hProcess); - ret = (long)pi.dwProcessId; //hProcess; - } - - - return ret; - -} - - -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise - (JNIEnv * env, jobject process, jint uid, jint signal) -{ - jint ret = 0; - - HANDLE hProc; - pProcInfo_t pCurProcInfo = findProcInfo(uid); -#ifdef DEBUG_MONITOR - char buffer[100]; -#endif - - if(NULL == pCurProcInfo) { - if(SIG_INT == signal) { // Try another way - return interruptProcess(uid) ; - } - return -1; - } - -#ifdef DEBUG_MONITOR - sprintf(buffer, "Spawner received signal %i for process %i\n", signal, pCurProcInfo -> pid); - OutputDebugString(buffer); -#endif - - hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, pCurProcInfo -> pid); - - if(NULL == hProc) - return -1; - - switch(signal) - { - case SIG_NOOP: - // Wait 0 msec -just check if the process has been still running - ret = ((WAIT_TIMEOUT == WaitForSingleObject(hProc, 0)) ? 0 : -1); - break; - case SIG_HUP: - // Temporary do nothing - ret = 0; - break; - case SIG_KILL: - case SIG_TERM: -#ifdef DEBUG_MONITOR - sprintf(buffer, "Spawner received KILL or TERM signal for process %i\n", pCurProcInfo -> pid); - OutputDebugString(buffer); -#endif - SetEvent(pCurProcInfo -> eventTerminate); -#ifdef DEBUG_MONITOR - OutputDebugString("Spawner signalled KILL event\n"); -#endif - ret = 0; - break; - case SIG_INT: - ResetEvent(pCurProcInfo -> eventWait); - PulseEvent(pCurProcInfo -> eventBreak); - ret = (WaitForSingleObject(pCurProcInfo -> eventWait, 100) == WAIT_OBJECT_0); - break; - default: - break; - } - - CloseHandle(hProc); - return ret; - - -} - - - -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor - (JNIEnv * env, jobject process, jint uid) -{ - long exit_code; - int what=0; - HANDLE hProc; - pProcInfo_t pCurProcInfo = findProcInfo(uid); - - if(NULL == pCurProcInfo) - return -1; - - hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, pCurProcInfo -> pid); - - if(NULL == hProc) - return -1; - - what = WaitForSingleObject(hProc, INFINITE); - - - if (what == WAIT_OBJECT_0) - { - GetExitCodeProcess(hProc, &exit_code); - } - - - if(hProc) - CloseHandle(hProc); - - return exit_code; -} - - - - - -// Utilities - -JNIEXPORT void JNICALL -ThrowByName(JNIEnv *env, const char *name, const char *msg) -{ - jclass cls = (*env)->FindClass(env, name); - - if (cls != 0) /* Otherwise an exception has already been thrown */ - (*env)->ThrowNew(env, cls, msg); - - /* It's a good practice to clean up the local references. */ - (*env)->DeleteLocalRef(env, cls); -} - - - - -pProcInfo_t createProcInfo() -{ - int i; - pProcInfo_t p = NULL; - - EnterCriticalSection(&cs); - - if(NULL == pInfo) - { - pInfo = malloc(sizeof(procInfo_t) * MAX_PROCS); - memset(pInfo, 0, sizeof(procInfo_t) * MAX_PROCS); - } - - for(i = 0; i < MAX_PROCS; ++i) - { - if(pInfo[i].pid == 0) - { - pInfo[i].pid = -1; - pInfo[i].uid = ++procCounter; - p = pInfo + i; - break; - } - } - - LeaveCriticalSection(&cs); - - return p; -} - -pProcInfo_t findProcInfo(int uid) -{ - int i; - pProcInfo_t p = NULL; - if(NULL == pInfo) - return NULL; - - for(i = 0; i < MAX_PROCS; ++i) - { - if(pInfo[i].uid == uid) - { - p = pInfo + i; - break; - } - } - - return p; -} - -void cleanUpProcBlock(pProcInfo_t pCurProcInfo) -{ - if(0 != pCurProcInfo -> eventBreak) - { - CloseHandle(pCurProcInfo -> eventBreak); - pCurProcInfo -> eventBreak = 0; - } - if(0 != pCurProcInfo -> eventWait) - { - CloseHandle(pCurProcInfo -> eventWait); - pCurProcInfo -> eventWait = 0; - } - if(0 != pCurProcInfo -> eventTerminate) - { - CloseHandle(pCurProcInfo -> eventTerminate); - pCurProcInfo -> eventTerminate = 0; - } - - pCurProcInfo -> pid = 0; -} - -unsigned int _stdcall waitProcTermination(void* pv) -{ - int i; - int pid = (int)pv; - DWORD rc = 0; -#ifdef DEBUG_MONITOR - char buffer[1000]; -#endif - - HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); - - if(NULL == hProc) - { -#ifdef DEBUG_MONITOR - sprintf(buffer, "waitProcTermination: cannot get handler for PID %i (error %i)\n", pid, GetLastError()); - OutputDebugString(buffer); -#endif - } - else - { - WaitForSingleObject(hProc, INFINITE); -#ifdef DEBUG_MONITOR - sprintf(buffer, "Process PID %i terminated\n", pid); - OutputDebugString(buffer); -#endif - } - - for(i = 0; i < MAX_PROCS; ++i) - { - if(pInfo[i].pid == pid) - { - if(WaitForSingleObject(pInfo[i].eventWait, 1) == WAIT_OBJECT_0) // Correct finish - { -#ifdef DEBUG_MONITOR - sprintf(buffer, "waitProcTermination: set PID %i to 0\n", pid, GetLastError()); - OutputDebugString(buffer); -#endif - cleanUpProcBlock(pInfo + i); - } - break; - } // Otherwise failed because was not started - } - - CloseHandle(hProc); - - - return 0; -} - -// Return number of bytes in target or -1 in case of error -int copyTo(char * target, const char * source, int cpyLength, int availSpace) -{ - BOOL bSlash = FALSE; - int i = 0, j = 0; - int totCpyLength = cpyLength; - -#define QUOTATION_DO 0 -#define QUOTATION_DONE 1 -#define QUOTATION_NONE 2 - - int nQuotationMode = 0; - - - - if(availSpace <= cpyLength) // = to reserve space for final '\0' - return -1; - - if(('\"' == *source) && ('\"' == *(source + cpyLength - 1))) - { - nQuotationMode = QUOTATION_DONE; - } - else - if(strchr(source, ' ') == NULL) - { - // No reason to quotate term becase it doesn't have embedded spaces - nQuotationMode = QUOTATION_NONE; - } - else - { - // Needs to be quotated - nQuotationMode = QUOTATION_DO; - *target = '\"'; - ++j; - } - - - for(; i < cpyLength; ++i, ++j) - { - if(source[i] == '\\') - bSlash = TRUE; - else - { - // Don't escape embracing quotation marks - if((source[i] == '\"') && !((nQuotationMode == QUOTATION_DONE) && ((i == 0) || (i == (cpyLength - 1))) ) ) - { - if(!bSlash) // If still not escaped - { - if(j == availSpace) - return -1; - target[j] = '\\'; - ++j; - } - } - bSlash = FALSE; - } - - if(j == availSpace) - return -1; - target[j] = source[i]; - } - - if(nQuotationMode == QUOTATION_DO) - { - if(j == availSpace) - return -1; - target[j] = '\"'; - ++j; - } - - return j; -} - diff --git a/core/org.eclipse.cdt.core.win32/library/iostream.c b/core/org.eclipse.cdt.core.win32/library/iostream.c deleted file mode 100644 index faae3c11120..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/iostream.c +++ /dev/null @@ -1,143 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -/* - * This is a JNI implementation of access to standard i/o streams - */ -#include "stdafx.h" -#include -#include -#include "SpawnerInputStream.h" -#include "SpawnerOutputStream.h" - - -#include "jni.h" -#include "io.h" - - -JNIEXPORT void JNICALL ThrowByName(JNIEnv *env, const char *name, const char *msg); - -#define BUFF_SIZE (1024) - -/* Inaccessible static: skipBuffer */ -/* - * Class: SpawnerInputStream - * Method: read0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 - (JNIEnv * env, jobject proc, jint fd, jbyteArray buf, jint len) -{ - BYTE tmpBuf[BUFF_SIZE]; - int nBuffOffset = 0; - - while(len > nBuffOffset) - { - int nNumberOfBytesToRead = min(len - nBuffOffset, BUFF_SIZE); - int nNumberOfBytesRead; - if(0 == ReadFile((HANDLE)fd, tmpBuf, nNumberOfBytesToRead, &nNumberOfBytesRead, NULL )) - { - LPTSTR lpMsgBuf; - int err = GetLastError(); - - if(err == ERROR_BROKEN_PIPE) // Pipe was closed - return 0; - if(err != ERROR_MORE_DATA) // Otherwise error means just that there are more data - { // than buffer can accept - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - - ThrowByName(env, "java/io/IOException", lpMsgBuf); - LocalFree( lpMsgBuf ); - return 0; - } - } - if(nNumberOfBytesRead > 0) - (*env) -> SetByteArrayRegion(env, buf, nBuffOffset, nNumberOfBytesRead, tmpBuf); - else - break; - nBuffOffset += nNumberOfBytesRead; - if(nNumberOfBytesRead != nNumberOfBytesToRead) - break; - } - return nBuffOffset; // This is a real full readed length - -} - -/* - * Class: SpawnerInputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 - (JNIEnv * env, jobject proc, jint fd) -{ - return (CloseHandle((HANDLE)fd) ? 0 : -1); -} - -/* - * Class: SpawnerOutputStream - * Method: write0 - * Signature: (I[BI)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 - (JNIEnv * env, jobject proc, jint fd, jbyteArray buf, jint len) -{ - BYTE tmpBuf[BUFF_SIZE]; - int nBuffOffset = 0; - - while(len > nBuffOffset) - { - int nNumberOfBytesToWrite = min(len - nBuffOffset, BUFF_SIZE); - int nNumberOfBytesWritten; - (*env) -> GetByteArrayRegion(env, buf, nBuffOffset, nNumberOfBytesToWrite, tmpBuf); - if(0 == WriteFile((HANDLE)fd, tmpBuf, nNumberOfBytesToWrite, &nNumberOfBytesWritten, NULL)) - { - LPTSTR lpMsgBuf; - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - - ThrowByName(env, "java/io/IOException", lpMsgBuf); - LocalFree( lpMsgBuf ); - return 0; - } - nBuffOffset += nNumberOfBytesWritten; - } - return 0; -} - -/* - * Class: SpawnerOutputStream - * Method: close0 - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 - (JNIEnv * env, jobject proc, jint fd) -{ - return (CloseHandle((HANDLE)fd) ? 0 : -1); -} diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp b/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp deleted file mode 100644 index 1dde80a9f18..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// ProcList.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h b/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h deleted file mode 100644 index a2b1670daf0..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/listtasks/StdAfx.h +++ /dev/null @@ -1,29 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_) -#define AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_) diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp deleted file mode 100644 index fa3327f2d27..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -// ProcList.cpp : Defines the entry point for the console application. -// - -#include "stdafx.h" - -#include "listtasks.h" -#include -#include -#include -#include - -using namespace std; - -typedef struct -{ - DWORD dwPID ; - PROCENUMPROC lpProc ; - DWORD lParam ; - BOOL bEnd ; -} EnumInfoStruct ; - -BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16, - PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) ; - -BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) ; - -int main(int argc, char* argv[]) -{ - EnumProcs(OutProcInfo, 0); - return 0; -} - - - -/********************* -EnumProc.cpp -*********************/ - -// The EnumProcs function takes a pointer to a callback function -// that will be called once per process in the system providing -// process EXE filename and process ID. -// Callback function definition: -// BOOL CALLBACK Proc( DWORD dw, LPCSTR lpstr, LPARAM lParam ) ; -// -// lpProc -- Address of callback routine. -// -// lParam -- A user-defined LPARAM value to be passed to -// the callback routine. -BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) -{ - OSVERSIONINFO osver ; - HINSTANCE hInstLib ; - HINSTANCE hInstLib2 ; - HANDLE hSnapShot ; - PROCESSENTRY32 procentry ; - BOOL bFlag ; - LPDWORD lpdwPIDs ; - DWORD dwSize, dwSize2, dwIndex ; - HMODULE hMod ; - HANDLE hProcess ; - char szFileName[ MAX_PATH ] ; - EnumInfoStruct sInfo ; - - // ToolHelp Function Pointers. - HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ; - BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ; - BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ; - - // PSAPI Function Pointers. - BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * ); - BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *, - DWORD, LPDWORD ); - DWORD (WINAPI *lpfGetModuleFileNameEx)( HANDLE, HMODULE, - LPTSTR, DWORD ); - - // VDMDBG Function Pointers. - INT (WINAPI *lpfVDMEnumTaskWOWEx)( DWORD, - TASKENUMPROCEX fp, LPARAM ); - - - // Check to see if were running under Windows95 or - // Windows NT. - osver.dwOSVersionInfoSize = sizeof( osver ) ; - if( !GetVersionEx( &osver ) ) - { - return FALSE ; - } - - // If Windows NT: - if( osver.dwPlatformId == VER_PLATFORM_WIN32_NT ) - { - - // Load library and get the procedures explicitly. We do - // this so that we don't have to worry about modules using - // this code failing to load under Windows 95, because - // it can't resolve references to the PSAPI.DLL. - hInstLib = LoadLibraryA( "PSAPI.DLL" ) ; - if( hInstLib == NULL ) - return FALSE ; - - hInstLib2 = LoadLibraryA( "VDMDBG.DLL" ) ; - if( hInstLib2 == NULL ) - return FALSE ; - - // Get procedure addresses. - lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*)) - GetProcAddress( hInstLib, "EnumProcesses" ) ; - lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *, - DWORD, LPDWORD)) GetProcAddress( hInstLib, - "EnumProcessModules" ) ; - lpfGetModuleFileNameEx =(DWORD (WINAPI *)(HANDLE, HMODULE, - LPTSTR, DWORD )) GetProcAddress( hInstLib, - "GetModuleFileNameExA" ) ; - lpfVDMEnumTaskWOWEx =(INT(WINAPI *)( DWORD, TASKENUMPROCEX, - LPARAM))GetProcAddress( hInstLib2, "VDMEnumTaskWOWEx" ); - if( lpfEnumProcesses == NULL || - lpfEnumProcessModules == NULL || - lpfGetModuleFileNameEx == NULL || - lpfVDMEnumTaskWOWEx == NULL) - { - FreeLibrary( hInstLib ) ; - FreeLibrary( hInstLib2 ) ; - return FALSE ; - } - - // Call the PSAPI function EnumProcesses to get all of the - // ProcID's currently in the system. - // NOTE: In the documentation, the third parameter of - // EnumProcesses is named cbNeeded, which implies that you - // can call the function once to find out how much space to - // allocate for a buffer and again to fill the buffer. - // This is not the case. The cbNeeded parameter returns - // the number of PIDs returned, so if your buffer size is - // zero cbNeeded returns zero. - // NOTE: The "HeapAlloc" loop here ensures that we - // actually allocate a buffer large enough for all the - // PIDs in the system. - dwSize2 = 256 * sizeof( DWORD ) ; - lpdwPIDs = NULL ; - do - { - if( lpdwPIDs ) - { - HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ; - dwSize2 *= 2 ; - } - lpdwPIDs = (LPDWORD)HeapAlloc( GetProcessHeap(), 0, dwSize2 ); - if( lpdwPIDs == NULL ) - { - FreeLibrary( hInstLib ) ; - FreeLibrary( hInstLib2 ) ; - return FALSE ; - } - if( !lpfEnumProcesses( lpdwPIDs, dwSize2, &dwSize ) ) - { - HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ; - FreeLibrary( hInstLib ) ; - FreeLibrary( hInstLib2 ) ; - return FALSE ; - } - }while( dwSize == dwSize2 ) ; - - // How many ProcID's did we get? - dwSize /= sizeof( DWORD ) ; - - // Loop through each ProcID. - for( dwIndex = 0 ; dwIndex < dwSize ; dwIndex++ ) - { - szFileName[0] = 0 ; - // Open the process (if we can... security does not - // permit every process in the system). - hProcess = OpenProcess( - PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, - FALSE, lpdwPIDs[ dwIndex ] ) ; - if( hProcess != NULL ) - { - // Here we call EnumProcessModules to get only the - // first module in the process this is important, - // because this will be the .EXE module for which we - // will retrieve the full path name in a second. - if( lpfEnumProcessModules( hProcess, &hMod, - sizeof( hMod ), &dwSize2 ) ) - { - // Get Full pathname: - if( !lpfGetModuleFileNameEx( hProcess, hMod, - szFileName, sizeof( szFileName ) ) ) - { - szFileName[0] = 0 ; - } - } - CloseHandle( hProcess ) ; - } - // Regardless of OpenProcess success or failure, we - // still call the enum func with the ProcID. - if(!lpProc( lpdwPIDs[dwIndex], 0, szFileName, lParam)) - break ; - - // Did we just bump into an NTVDM? - if( _stricmp( szFileName+(strlen(szFileName)-9), - "NTVDM.EXE")==0) - { - // Fill in some info for the 16-bit enum proc. - sInfo.dwPID = lpdwPIDs[dwIndex] ; - sInfo.lpProc = lpProc ; - sInfo.lParam = lParam ; - sInfo.bEnd = FALSE ; - // Enum the 16-bit stuff. - lpfVDMEnumTaskWOWEx( lpdwPIDs[dwIndex], - (TASKENUMPROCEX) Enum16, - (LPARAM) &sInfo); - - // Did our main enum func say quit? - if(sInfo.bEnd) - break ; - } - } - - HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ; - FreeLibrary( hInstLib2 ) ; - - // If Windows 95: - }else if( osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) - { - - - hInstLib = LoadLibraryA( "Kernel32.DLL" ) ; - if( hInstLib == NULL ) - return FALSE ; - - // Get procedure addresses. - // We are linking to these functions of Kernel32 - // explicitly, because otherwise a module using - // this code would fail to load under Windows NT, - // which does not have the Toolhelp32 - // functions in the Kernel 32. - lpfCreateToolhelp32Snapshot= - (HANDLE(WINAPI *)(DWORD,DWORD)) - GetProcAddress( hInstLib, - "CreateToolhelp32Snapshot" ) ; - lpfProcess32First= - (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) - GetProcAddress( hInstLib, "Process32First" ) ; - lpfProcess32Next= - (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) - GetProcAddress( hInstLib, "Process32Next" ) ; - if( lpfProcess32Next == NULL || - lpfProcess32First == NULL || - lpfCreateToolhelp32Snapshot == NULL ) - { - FreeLibrary( hInstLib ) ; - return FALSE ; - } - - // Get a handle to a Toolhelp snapshot of the systems - // processes. - hSnapShot = lpfCreateToolhelp32Snapshot( - TH32CS_SNAPPROCESS, 0 ) ; - if( hSnapShot == INVALID_HANDLE_VALUE ) - { - FreeLibrary( hInstLib ) ; - return FALSE ; - } - - // Get the first process' information. - procentry.dwSize = sizeof(PROCESSENTRY32) ; - bFlag = lpfProcess32First( hSnapShot, &procentry ) ; - - // While there are processes, keep looping. - while( bFlag ) - { - // Call the enum func with the filename and ProcID. - if(lpProc( procentry.th32ProcessID, 0, - procentry.szExeFile, lParam )) - { - procentry.dwSize = sizeof(PROCESSENTRY32) ; - bFlag = lpfProcess32Next( hSnapShot, &procentry ); - }else - bFlag = FALSE ; - } - - - }else - return FALSE ; - - // Free the library. - FreeLibrary( hInstLib ) ; - - return TRUE ; -} - -BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16, - PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) -{ - BOOL bRet ; - - EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined ; - - bRet = psInfo->lpProc( psInfo->dwPID, hTask16, pszFileName, - psInfo->lParam ) ; - - if(!bRet) - { - psInfo->bEnd = TRUE ; - } - - return !bRet; -} - -BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) -{ - cout << setw(10) << pid << '\t' << procName << '\n'; - return TRUE; -} diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp deleted file mode 100644 index d14d3c49bc1..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="listtasks" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=listtasks - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "listtasks.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "listtasks.mak" CFG="listtasks - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "listtasks - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "listtasks - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "listtasks - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "listtasks - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "listtasks - Win32 Release" -# Name "listtasks - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\listtasks.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# ADD CPP /Yc"stdafx.h" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\listtasks.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw deleted file mode 100644 index 329bd2f44e0..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "listtasks"=.\listtasks.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h b/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h deleted file mode 100644 index 78976917f13..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.h +++ /dev/null @@ -1,12 +0,0 @@ -#include - -#ifndef __LISTTASKS_H -#define __LISTTASKS_H - -typedef BOOL (CALLBACK *PROCENUMPROC)( DWORD, WORD, LPSTR, - LPARAM ) ; - -BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) ; - - -#endif \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.win32/library/raise.c b/core/org.eclipse.cdt.core.win32/library/raise.c deleted file mode 100644 index ebe0172f585..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/raise.c +++ /dev/null @@ -1,180 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -/* - * This is a JNI implementation of spawner - */ -#include "stdafx.h" -#include "Spawner.h" - - -#include "jni.h" - -extern void JNICALL ThrowByName(JNIEnv *env, const char *name, const char *msg); - -// #define DEBUG_MONITOR - -static HWND consoleHWND; - -static BOOL CALLBACK -find_child_console (HWND hwnd, LPARAM arg) -{ - DWORD thread_id; - DWORD process_id; - DWORD pid = arg; - - thread_id = GetWindowThreadProcessId (hwnd, &process_id); - if (process_id == pid) - { - char window_class[32]; - - GetClassName (hwnd, window_class, sizeof (window_class)); - if (strcmp (window_class, "ConsoleWindowClass") == 0) - { - consoleHWND = hwnd; - return FALSE; - } - } - /* keep looking */ - return TRUE; -} - -/* -JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_raise__Ljava_lang_Object_2 - (JNIEnv * env, jobject process, jobject jpid) -{ - jint pid; - jclass integerClass = (*env) -> FindClass(env, "java/lang/Integer"); - jmethodID intValue; - if(NULL == integerClass) { - ThrowByName(env, "java/lang/IOException", "Cannot find Integer class"); - return -1; - } - if(!((*env) -> IsInstanceOf(env, jpid, integerClass))) { - ThrowByName(env, "java/lang/IOException", "Wrong argument"); - return -1; - } - - intValue = (*env) -> GetMethodID(env, integerClass, "intValue", "()I"); - if(NULL == intValue) { - ThrowByName(env, "java/lang/IOException", "Cannot find intValue method in Integer class"); - return -1; - } - - pid = (*env) -> CallIntMethod(env, jpid, intValue); - - return interruptProcess(pid); - -} -*/ - -int interruptProcess(int pid) -{ -#ifdef DEBUG_MONITOR - char buffer[1000]; -#endif - int rc; - // Try another method - rc = 0; - consoleHWND = NULL; - -#ifdef DEBUG_MONITOR - sprintf(buffer, "Try to interrupt process %i\n", pid); - OutputDebugString(buffer); -#endif - EnumWindows (find_child_console, (LPARAM) pid); - - if(NULL != consoleHWND) - { - BYTE control_scan_code = (BYTE) MapVirtualKey (VK_CONTROL, 0); - /* Fake Ctrl-C for SIGINT, and Ctrl-Break for SIGQUIT. */ - BYTE vk_c_code = 'C'; - BYTE vk_break_code = VK_CANCEL; - BYTE c_scan_code = (BYTE) MapVirtualKey (vk_c_code, 0); - BYTE break_scan_code = (BYTE) MapVirtualKey (vk_break_code, 0); - HWND foreground_window; - - - foreground_window = GetForegroundWindow (); - if (foreground_window) - { - /* NT 5.0, and apparently also Windows 98, will not allow - a Window to be set to foreground directly without the - user's involvement. The workaround is to attach - ourselves to the thread that owns the foreground - window, since that is the only thread that can set the - foreground window. */ - DWORD foreground_thread, child_thread; - foreground_thread = - GetWindowThreadProcessId (foreground_window, NULL); - if (foreground_thread == GetCurrentThreadId () - || !AttachThreadInput (GetCurrentThreadId (), - foreground_thread, TRUE)) - foreground_thread = 0; - - child_thread = GetWindowThreadProcessId (consoleHWND, NULL); - if (child_thread == GetCurrentThreadId () - || !AttachThreadInput (GetCurrentThreadId (), - child_thread, TRUE)) - child_thread = 0; - - /* Set the foreground window to the child. */ - if (SetForegroundWindow (consoleHWND)) - { - /* - if(0 != c_scan_code) { - // Generate keystrokes as if user had typed Ctrl-C. - keybd_event (VK_CONTROL, control_scan_code, 0, 0); - keybd_event (vk_c_code, c_scan_code, 0, 0); - keybd_event (vk_c_code, c_scan_code, KEYEVENTF_KEYUP, 0); - keybd_event (VK_CONTROL, control_scan_code, KEYEVENTF_KEYUP, 0); - } - */ - /* Sleep for a bit to give time for respond */ - Sleep (100); - if(0 != break_scan_code) { - /* Generate keystrokes as if user had typed Ctrl-Break */ - keybd_event (VK_CONTROL, control_scan_code, 0, 0); - keybd_event (vk_break_code, break_scan_code, KEYEVENTF_EXTENDEDKEY, 0); - keybd_event (vk_break_code, break_scan_code, - KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); - keybd_event (VK_CONTROL, control_scan_code, KEYEVENTF_KEYUP, 0); - } - - /* Sleep for a bit to give time for respond */ - Sleep (100); - - SetForegroundWindow (foreground_window); - } - /* Detach from the foreground and child threads now that - the foreground switching is over. */ - if (foreground_thread) - AttachThreadInput (GetCurrentThreadId (), - foreground_thread, FALSE); - if (child_thread) - AttachThreadInput (GetCurrentThreadId (), - child_thread, FALSE); -#ifdef DEBUG_MONITOR - sprintf(buffer, "Sent Ctrl-C & Ctrl-Break to process %i\n", pid); - OutputDebugString(buffer); -#endif - } - } -#ifdef DEBUG_MONITOR - else { - sprintf(buffer, "Cannot find console for process %i\n", pid); - - OutputDebugString(buffer); - } -#endif - - return rc; -} - diff --git a/core/org.eclipse.cdt.core.win32/library/spawner.c b/core/org.eclipse.cdt.core.win32/library/spawner.c deleted file mode 100644 index 42217ae985a..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/spawner.c +++ /dev/null @@ -1,51 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -// spawner.cpp : Defines the entry point for the DLL application. -// - -#include "stdafx.h" - - -CRITICAL_SECTION cs; - -TCHAR path[MAX_PATH + 1] = {_T('\0') }; - - -BOOL APIENTRY DllMain( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - { - LPTSTR p; - InitializeCriticalSection(&cs); - GetModuleFileName(hModule, path, MAX_PATH); - p = _tcsrchr(path, _T('\\')); - if(NULL != p) - *(p + 1) = _T('\0'); - else - _tcscat(path, "\\"); - } - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - DeleteCriticalSection(&cs); - break; - } - return TRUE; -} - - diff --git a/core/org.eclipse.cdt.core.win32/library/spawner.dep b/core/org.eclipse.cdt.core.win32/library/spawner.dep deleted file mode 100644 index c6ec05e32ac..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/spawner.dep +++ /dev/null @@ -1,18 +0,0 @@ -# Microsoft Developer Studio Generated Dependency File, included by spawner.mak - -.\iostream.c : \ - "$(JAVA_HOME)\include\jni.h"\ - "$(JAVA_HOME)\include\win32\jni_md.h"\ - ".\SpawnerInputStream.h"\ - ".\SpawnerOutputStream.h"\ - - -.\StdAfx.c : \ - ".\StdAfx.h"\ - - -.\Win32ProcessEx.c : \ - "$(JAVA_HOME)\include\jni.h"\ - "$(JAVA_HOME)\include\win32\jni_md.h"\ - ".\Spawner.h"\ - diff --git a/core/org.eclipse.cdt.core.win32/library/spawner.dsp b/core/org.eclipse.cdt.core.win32/library/spawner.dsp deleted file mode 100644 index 272158054a9..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/spawner.dsp +++ /dev/null @@ -1,181 +0,0 @@ -# Microsoft Developer Studio Project File - Name="spawner" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=spawner - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "spawner.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "spawner.mak" CFG="spawner - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "spawner - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "spawner - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "spawner - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /Gz /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Yu"stdafx.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /Gz /MD /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /FR /Yu"stdafx.h" /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /map /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "spawner - Win32 Release" -# Name "spawner - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\iostream.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -# ADD CPP /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\raise.c -# End Source File -# Begin Source File - -SOURCE=.\spawner.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -# ADD CPP /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -# ADD CPP /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" /Yc"stdafx.h" - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -# ADD CPP /Yc"stdafx.h" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\Win32ProcessEx.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -# ADD CPP /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\Spawner.h -# End Source File -# Begin Source File - -SOURCE=.\SpawnerInputStream.h -# End Source File -# Begin Source File - -SOURCE=.\SpawnerOutputStream.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/core/org.eclipse.cdt.core.win32/library/spawner.dsw b/core/org.eclipse.cdt.core.win32/library/spawner.dsw deleted file mode 100644 index f22469884e4..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/spawner.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "spawner"=.\spawner.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/core/org.eclipse.cdt.core.win32/library/spawner.mak b/core/org.eclipse.cdt.core.win32/library/spawner.mak deleted file mode 100644 index 26a7063ac52..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/spawner.mak +++ /dev/null @@ -1,264 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on spawner.dsp -!IF "$(CFG)" == "" -CFG=spawner - Win32 Release -!MESSAGE No configuration specified. Defaulting to spawner - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "spawner - Win32 Release" && "$(CFG)" != "spawner - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "spawner.mak" CFG="spawner - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "spawner - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "spawner - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "spawner - Win32 Release" - -OUTDIR=..\os\win32\x86 -INTDIR=.\ -# Begin Custom Macros - -OutDir=..\os\win32\x86 -# End Custom Macros - -ALL : "$(OUTDIR)\spawner.dll" - - -CLEAN : - -@erase "$(INTDIR)\iostream.obj" - -@erase "$(INTDIR)\spawner.obj" - -@erase "$(INTDIR)\spawner.pch" - -@erase "$(INTDIR)\StdAfx.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\Win32ProcessEx.obj" - -@erase "$(OUTDIR)\spawner.dll" - -@erase "$(OUTDIR)\spawner.exp" - -@erase "$(OUTDIR)\spawner.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /Gz /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\spawner.pdb" /machine:I386 /out:"$(OUTDIR)\spawner.dll" /implib:"$(OUTDIR)\spawner.lib" -LINK32_OBJS= \ - "$(INTDIR)\iostream.obj" \ - "$(INTDIR)\spawner.obj" \ - "$(INTDIR)\StdAfx.obj" \ - "$(INTDIR)\Win32ProcessEx.obj" - -"$(OUTDIR)\spawner.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -OUTDIR=..\os\win32\x86 -INTDIR=.\ -# Begin Custom Macros -OutDir=..\os\win32\x86 -# End Custom Macros - -ALL : "$(OUTDIR)\spawner.dll" - - -CLEAN : - -@erase "$(INTDIR)\iostream.obj" - -@erase "$(INTDIR)\iostream.sbr" - -@erase "$(INTDIR)\spawner.obj" - -@erase "$(INTDIR)\spawner.pch" - -@erase "$(INTDIR)\spawner.sbr" - -@erase "$(INTDIR)\StdAfx.obj" - -@erase "$(INTDIR)\StdAfx.sbr" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(INTDIR)\Win32ProcessEx.obj" - -@erase "$(INTDIR)\Win32ProcessEx.sbr" - -@erase "$(OUTDIR)\spawner.dll" - -@erase "$(OUTDIR)\spawner.exp" - -@erase "$(OUTDIR)\spawner.ilk" - -@erase "$(OUTDIR)\spawner.lib" - -@erase "$(OUTDIR)\spawner.map" - -@erase "$(OUTDIR)\spawner.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /Gz /MD /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\spawner.pdb" /map:"$(INTDIR)\spawner.map" /debug /machine:I386 /out:"$(OUTDIR)\spawner.dll" /implib:"$(OUTDIR)\spawner.lib" /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\iostream.obj" \ - "$(INTDIR)\spawner.obj" \ - "$(INTDIR)\StdAfx.obj" \ - "$(INTDIR)\Win32ProcessEx.obj" - -"$(OUTDIR)\spawner.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(NO_EXTERNAL_DEPS)" != "1" -!IF EXISTS("spawner.dep") -!INCLUDE "spawner.dep" -!ELSE -!MESSAGE Warning: cannot find "spawner.dep" -!ENDIF -!ENDIF - - -!IF "$(CFG)" == "spawner - Win32 Release" || "$(CFG)" == "spawner - Win32 Debug" -SOURCE=.\iostream.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -CPP_SWITCHES=/nologo /Gz /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\iostream.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\spawner.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -CPP_SWITCHES=/nologo /Gz /MD /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\iostream.obj" "$(INTDIR)\iostream.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\spawner.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\spawner.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -CPP_SWITCHES=/nologo /Gz /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\spawner.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\spawner.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -CPP_SWITCHES=/nologo /Gz /MD /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\spawner.obj" "$(INTDIR)\spawner.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\spawner.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\StdAfx.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -CPP_SWITCHES=/nologo /Gz /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Fp"$(INTDIR)\spawner.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\StdAfx.obj" "$(INTDIR)\spawner.pch" : $(SOURCE) "$(INTDIR)" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -CPP_SWITCHES=/nologo /Gz /MD /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\spawner.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" "$(INTDIR)\spawner.pch" : $(SOURCE) "$(INTDIR)" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\Win32ProcessEx.c - -!IF "$(CFG)" == "spawner - Win32 Release" - -CPP_SWITCHES=/nologo /Gz /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /I "E:\Java\jdk1.3.1\include" /I "E:\Java\jdk1.3.1\include\Win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\Win32ProcessEx.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\spawner.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "spawner - Win32 Debug" - -CPP_SWITCHES=/nologo /Gz /MD /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\Win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SPAWNER_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\spawner.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c - -"$(INTDIR)\Win32ProcessEx.obj" "$(INTDIR)\Win32ProcessEx.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\spawner.pch" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - - -!ENDIF - diff --git a/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp b/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp deleted file mode 100644 index 8b41e40a30c..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/starter/starter.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -/* - * starter.c - * - * This is a small utility for windows spawner - */ - - -//#define UNICODE -//#define _UNICODE - -#define STRICT -#include -#include -#include -#include - -// #define DEBUG_MONITOR -#define MAX_CMD_LINE_LENGTH (2049) - -int copyTo(char * target, const char * source, int cpyLength, int availSpace); - -/////////////////////////////////////////////////////////////////////////////// -BOOL WINAPI HandlerRoutine( DWORD dwCtrlType) // control signal type -{ - BOOL ret = TRUE; - switch(dwCtrlType) - { - case CTRL_C_EVENT: - break; - case CTRL_BREAK_EVENT: - break; - case CTRL_CLOSE_EVENT: - ret = FALSE; - break; - case CTRL_LOGOFF_EVENT: - ret = FALSE; - break; - case CTRL_SHUTDOWN_EVENT: - ret = FALSE; - break; - default: - break; - } - return ret; -} - - - -extern "C" int _tmain(int argc, TCHAR* argv[]) { - - // Make sure that we've been passed the right number of arguments - if (argc < 5) { - _tprintf(__TEXT("Usage: %s (Three InheritableEventHandles) (CommandLineToSpawn)\n"), - argv[0]); - return(0); - } - - // Construct the full command line - TCHAR szCmdLine[MAX_CMD_LINE_LENGTH] = { 0 }; - int nPos = 0; - - for(int i = 4; i < argc; ++i) - { - int nCpyLen; - if(0 > (nCpyLen = copyTo(szCmdLine + nPos, argv[i], _tcslen(argv[i]), MAX_CMD_LINE_LENGTH - nPos))) - { -#ifdef DEBUG_MONITOR - OutputDebugString("Not enough space to build command line\n"); -#endif - return 0; - } - nPos += nCpyLen; - szCmdLine[nPos] = _T(' '); - ++nPos; - } - szCmdLine[nPos] = _T('\0'); - - STARTUPINFO si = { sizeof(si) }; - PROCESS_INFORMATION pi = { 0 }; - DWORD dwExitCode = 0; -#ifdef DEBUG_MONITOR - int currentPID = GetCurrentProcessId(); - char buffer[MAX_CMD_LINE_LENGTH]; -#endif - - BOOL exitProc = FALSE; - HANDLE waitEvent = OpenEvent(EVENT_ALL_ACCESS, TRUE, argv[2]); - HANDLE h[3]; - h[0] = OpenEvent(EVENT_ALL_ACCESS, TRUE, argv[1]); - h[2] = OpenEvent(EVENT_ALL_ACCESS, TRUE, argv[3]); // This is a terminate event - SetConsoleCtrlHandler(HandlerRoutine, TRUE); - -#ifdef DEBUG_MONITOR - sprintf(buffer, "starter start command: %s\n", szCmdLine); - OutputDebugString(buffer); -#endif - -// OutputDebugString(szCmdLine); - // Spawn the other processes as part of this Process Group - BOOL f = CreateProcess(NULL, szCmdLine, NULL, NULL, TRUE, - 0, NULL, NULL, &si, &pi); - - if (f) - { - SetEvent(waitEvent); // Means thar process has been spawned - CloseHandle(pi.hThread); - h[1] = pi.hProcess; - - while(!exitProc) - { - // Wait for the spawned-process to die or for the event - // indicating that the processes should be forcibly killed. - switch (WaitForMultipleObjects(3, h, FALSE, INFINITE)) - { - case WAIT_OBJECT_0 + 0: // Send Ctrl-C -#ifdef DEBUG_MONITOR - sprintf(buffer, "starter (PID %i) received CTRL-C event\n", currentPID); - OutputDebugString(buffer); -#endif - GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); - SetEvent(waitEvent); - break; - - case WAIT_OBJECT_0 + 1: // App terminated normally - // Make it's exit code our exit code -#ifdef DEBUG_MONITOR - sprintf(buffer, "starter: launched process has been terminated(PID %i)\n", currentPID); - OutputDebugString(buffer); -#endif - GetExitCodeProcess(pi.hProcess, &dwExitCode); - exitProc = TRUE; - break; - case WAIT_OBJECT_0 + 2: // Kill -#ifdef DEBUG_MONITOR - sprintf(buffer, "starter received KILL event (PID %i)\n", currentPID); - OutputDebugString(buffer); -#endif - GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); - TerminateProcess(h[1], 0); - exitProc = TRUE; - break; - default: - // Unexpected code - LPTSTR lpMsgBuf; - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - OutputDebugString(lpMsgBuf); - // Free the buffer. - LocalFree( lpMsgBuf ); - exitProc = TRUE; - break; - } - - } - CloseHandle(pi.hProcess); - } - - CloseHandle(waitEvent); - CloseHandle(h[0]); - CloseHandle(h[2]); - - return(dwExitCode); -} - -// Return number of bytes in target or -1 in case of error -int copyTo(LPTSTR target, LPCTSTR source, int cpyLength, int availSpace) -{ - BOOL bSlash = FALSE; - int i = 0, j = 0; - int totCpyLength = cpyLength; - -#define QUOTATION_DO 0 -#define QUOTATION_DONE 1 -#define QUOTATION_NONE 2 - - int nQuotationMode = 0; - if(availSpace <= cpyLength) // = to reserve space for '\0' - return -1; - - if((_T('\"') == *source) && (_T('\"') == *(source + cpyLength - 1))) - { - // Already done - nQuotationMode = QUOTATION_DONE; - } - else - if(_tcschr(source, _T(' ')) == NULL) - { - // No reason to quotate term becase it doesn't have embedded spaces - nQuotationMode = QUOTATION_NONE; - } - else - { - // Needs to be quotated - nQuotationMode = QUOTATION_DO; - *target = _T('\"'); - ++j; - } - - for(; i < cpyLength; ++i, ++j) - { - if(source[i] == _T('\\')) - bSlash = TRUE; - else - // Don't escape embracing quotation marks - if((source[i] == _T('\"')) && !((nQuotationMode == QUOTATION_DONE) && ((i == 0) || (i == (cpyLength - 1))) ) ) - { - if(!bSlash) - { - if(j == availSpace) - return -1; - target[j] = _T('\\'); - ++j; - } - bSlash = FALSE; - } - else - bSlash = FALSE; - - if(j == availSpace) - return -1; - target[j] = source[i]; - } - - if(nQuotationMode == QUOTATION_DO) - { - if(j == availSpace) - return -1; - target[j] = _T('\"'); - ++j; - } - return j; -} - - - -//////////////////////////////// End of File ////////////////////////////////// diff --git a/core/org.eclipse.cdt.core.win32/library/starter/starter.dep b/core/org.eclipse.cdt.core.win32/library/starter/starter.dep deleted file mode 100644 index 3f69f7967a6..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/starter/starter.dep +++ /dev/null @@ -1,5 +0,0 @@ -# Microsoft Developer Studio Generated Dependency File, included by starter.mak - -.\starter.cpp : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - diff --git a/core/org.eclipse.cdt.core.win32/library/starter/starter.mak b/core/org.eclipse.cdt.core.win32/library/starter/starter.mak deleted file mode 100644 index 1dc8277dcab..00000000000 --- a/core/org.eclipse.cdt.core.win32/library/starter/starter.mak +++ /dev/null @@ -1,156 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on starter.dsp -!IF "$(CFG)" == "" -CFG=starter - Win32 Release -!MESSAGE No configuration specified. Defaulting to starter - Win32 Release -!ENDIF - -!IF "$(CFG)" != "starter - Win32 Release" && "$(CFG)" != "starter - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "starter.mak" CFG="starter - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "starter - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "starter - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "starter - Win32 Release" - -OUTDIR=..\..\os\win32\x86 -INTDIR=.\ -# Begin Custom Macros - -OutDir=..\..\os\win32\x86 -# End Custom Macros - -ALL : "$(OUTDIR)\starter.exe" - - -CLEAN : - -@erase "$(INTDIR)\starter.obj" - -@erase "$(INTDIR)\starter.sbr" - -@erase "$(INTDIR)\vc60.idb" - - -@erase "$(OUTDIR)\starter.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\starter.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\starter.pdb" /machine:I386 /out:"$(OUTDIR)\starter.exe" -LINK32_OBJS= \ - "$(INTDIR)\starter.obj" - -"$(OUTDIR)\starter.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "starter - Win32 Debug" - -OUTDIR=..\..\os\win32\x86 -INTDIR=.\ -# Begin Custom Macros - -OutDir=..\..\os\win32\x86 -# End Custom Macros - -ALL : "$(OUTDIR)\starter.exe" - - -CLEAN : - -@erase "$(INTDIR)\starter.obj" - -@erase "$(INTDIR)\vc60.idb" - -@erase "$(INTDIR)\vc60.pdb" - -@erase "$(OUTDIR)\starter.exe" - -@erase "$(OUTDIR)\starter.ilk" - -@erase "$(OUTDIR)\starter.pdb" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\starter.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\starter.pdb" /debug /machine:I386 /out:"$(OUTDIR)\starter.exe" /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\starter.obj" - -"$(OUTDIR)\starter.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(INTDIR)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - - - - -!IF "$(CFG)" == "starter - Win32 Release" || "$(CFG)" == "starter - Win32 Debug" -SOURCE=.\starter.cpp - -!IF "$(CFG)" == "starter - Win32 Release" - - -"$(INTDIR)\starter.obj" "$(INTDIR)\starter.sbr" : $(SOURCE) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "starter - Win32 Debug" - - -"$(INTDIR)\starter.obj" : $(SOURCE) "$(INTDIR)" - - -!ENDIF - - -!ENDIF - diff --git a/core/org.eclipse.cdt.core.win32/os/win32/x86/listtasks.exe b/core/org.eclipse.cdt.core.win32/os/win32/x86/listtasks.exe deleted file mode 100644 index a31d3b20967..00000000000 Binary files a/core/org.eclipse.cdt.core.win32/os/win32/x86/listtasks.exe and /dev/null differ diff --git a/core/org.eclipse.cdt.core.win32/os/win32/x86/spawner.dll b/core/org.eclipse.cdt.core.win32/os/win32/x86/spawner.dll deleted file mode 100644 index 771fd664dad..00000000000 Binary files a/core/org.eclipse.cdt.core.win32/os/win32/x86/spawner.dll and /dev/null differ diff --git a/core/org.eclipse.cdt.core.win32/os/win32/x86/starter.exe b/core/org.eclipse.cdt.core.win32/os/win32/x86/starter.exe deleted file mode 100644 index 38dd37c649d..00000000000 Binary files a/core/org.eclipse.cdt.core.win32/os/win32/x86/starter.exe and /dev/null differ diff --git a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessInfo.java b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessInfo.java deleted file mode 100644 index 13c88e07aaf..00000000000 --- a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.win32; - -import org.eclipse.cdt.core.IProcessInfo; - -/** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ProcessInfo implements IProcessInfo { - - int pid; - String name; - - public ProcessInfo(String pidString, String name) { - try { - pid = Integer.parseInt(pidString); - } catch (NumberFormatException e) { - } - this.name = name; - } - - public ProcessInfo(int pid, String name) { - this.pid = pid; - this.name = name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.IProcessInfo#getPid() - */ - public int getPid() { - return pid; - } - -} diff --git a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java deleted file mode 100644 index 6ffe99c723e..00000000000 --- a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/ProcessList.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.eclipse.cdt.internal.core.win32; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.IProcessInfo; -import org.eclipse.cdt.core.IProcessList; -import org.eclipse.cdt.utils.spawner.ProcessFactory; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.model.PluginDescriptorModel; -import org.eclipse.core.runtime.model.PluginFragmentModel; - -/* - * Currently this will only work for Windows XP since tasklist - * is only shipped on XP. This could change to some JNI - * call out to get the list since the source to 'tlist' is - * on the msdn web site but that can be done later. - */ - -public class ProcessList implements IProcessList { - - private IProcessInfo[] NOPROCESS = new IProcessInfo[0]; - - public IProcessInfo[] getProcessList() { - Process p = null; - String command = null; - InputStream in = null; - IPluginDescriptor desc = CCorePlugin.getDefault().getDescriptor(); - if (desc instanceof PluginDescriptorModel) { - PluginDescriptorModel model = (PluginDescriptorModel) desc; - PluginFragmentModel[] fragments = model.getFragments(); - for (int i = 0; i < fragments.length; i++) { - String location = fragments[i].getLocation(); - try { - URL url = new URL(location + "/os/" + BootLoader.getOS() + "/" + BootLoader.getOSArch()); - File path = new File(url.getFile(), "listtasks.exe"); - if (path.exists()) { - command = path.getCanonicalPath(); - break; - } - } catch (MalformedURLException e1) { - } catch (IOException e) { - } - } - } - if (command != null) { - try { - p = ProcessFactory.getFactory().exec(command); - in = p.getInputStream(); - InputStreamReader reader = new InputStreamReader(in); - return parseListTasks(reader); - } catch (IOException e) { - } - } - return NOPROCESS; - } - - public IProcessInfo[] parseListTasks(InputStreamReader reader) { - BufferedReader br = new BufferedReader(reader); - ArrayList processList = new ArrayList(); - try { - String line; - while ((line = br.readLine()) != null) { - int tab = line.indexOf('\t'); - if (tab != -1) { - String proc = line.substring(0, tab).trim(); - String name = line.substring(tab).trim(); - try { - int pid = Integer.parseInt(proc); - processList.add(new ProcessInfo(pid, name)); - } catch (NumberFormatException e) { - name = null; - } - } - } - } catch (IOException e) { - } - return (IProcessInfo[]) processList.toArray(new IProcessInfo[processList.size()]); - } -} diff --git a/core/org.eclipse.cdt.core/.classpath b/core/org.eclipse.cdt.core/.classpath deleted file mode 100644 index 5234ce90362..00000000000 --- a/core/org.eclipse.cdt.core/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core/.cvsignore b/core/org.eclipse.cdt.core/.cvsignore deleted file mode 100644 index 693869726de..00000000000 --- a/core/org.eclipse.cdt.core/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -doc diff --git a/core/org.eclipse.cdt.core/.options b/core/org.eclipse.cdt.core/.options deleted file mode 100644 index f90da88b7f6..00000000000 --- a/core/org.eclipse.cdt.core/.options +++ /dev/null @@ -1,25 +0,0 @@ -org.eclipse.cdt.core/debug=true - -# Reports model builder activity -org.eclipse.cdt.core/debug/model=false - -# Reports parser activity -org.eclipse.cdt.core/debug/parser=false - -# Reports contentAssist activity -org.eclipse.cdt.core/debug/contentassist=false - -# Reports background indexer activity: indexing, saving index file, index queries -org.eclipse.cdt.core/debug/indexmanager=false - -# Reports search activity -org.eclipse.cdt.core/debug/search=false - -# Reports encoded index entries -org.eclipse.cdt.core/debug/indexer=false - -# Reports search matches -org.eclipse.cdt.core/debug/matchlocator=false - -# Reports delta processor tree activity -org.eclipse.cdt.core/debug/deltaprocessor=false diff --git a/core/org.eclipse.cdt.core/.project b/core/org.eclipse.cdt.core/.project deleted file mode 100644 index 95eceb11fac..00000000000 --- a/core/org.eclipse.cdt.core/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.cdt.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog deleted file mode 100644 index 5e510d08578..00000000000 --- a/core/org.eclipse.cdt.core/ChangeLog +++ /dev/null @@ -1,2232 +0,0 @@ -2004-01-13 Alain Magloire - - Small fix on in the elf parser, we have to check for - Elf.Symbol.SHN_HIPROC, Elf.Symbol.SHN_LOPROC - that the st_shndx field is not is in this range. - - * utils/org/eclipse/cdt/utils/elf/ElfHelper.java - -2004-1-5 David Inglis - - PR 49851 - Fixed deadlock when binary parser was changed while binary runner was running - for that project. - - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - -2004-01-09 Alain Magloire - - * utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java - Fix bug in finding the symbols. - * utils/org/eclipse/cdt/utils/coff/parser/Symbol.java - Implement ISymbol.java - -2004-01-09 Alain Magloire - - * src/org/eclipse/cdt/core/IBinaryParser.java - Added ISymbol.getSize(). - * utils/org/eclipse/cdt/utils/elf/Elf.java - Fix bug in finding the symbols. - * utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java - Fix bug in finding the symbols. - * utils/org/eclipse/cdt/utils/elf/parser/Symbol.java - Implement ISymbol.java - * utils/org/eclipse/cdt/utils/stabs/Stabs.java - New Methods. - * utils/org/eclipse/cdt/utils/stabs/StabAddre2line.java - Work in progress. - -2004-01-08 Hoda Amer - Added Content assist log capabilities - -2004-01-06 Alain Magloire - - Simple draft implementation of stabs debug format parsing. - Not ready. - - * utils/org/eclipse/cdt/utils/stabs: New package implementing - Stabs debug format parsing. - -2003-12-29 Hoda Amer - Content Assist Work : Moved ICompletionRequestor from core to ui - -2003-12-19 Alain Magloire - - Added a getCommandLine() method on the CommandLauncher - to help PR 41417. - - * src/org/eclipse/cdt/core/CommandLauncher.java - -2003-12-16 Alain Magloire - - PR 48921. - On windows, Object files (*.o) does not have a - particular signature we have to compare to the known - CPU flags part of COFF - - * utils/org/eclipse/cdt/utils/coff/parser/PEParser.java - -2003-12-15 Alain Magloire - - Patch from Thomas F. - Update to classify ld warnings as warning markers instead - of "problem" marker - - * src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java - -2003-12-11 David Inglis - Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=48596 - - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - -2003-12-11 Alain Magloire - - Call the super() constructor. - - * model/org/eclipse/cdt/internal/core/model/SetCPathEntriesOperation.java - -2003-12-04 David Inglis - Fixed bug# 48063 - - * src/org/eclipse/cdt/core/CCorePlugin.java - -2003-12-03 Hoda Amer - Content Assist work :Moved CompletionEngine out of CDT core - -2003-11-27 Hoda Amer - Content Assist work : Added an ICompletionRequestor interface - and a CompletionRequestorAdaptor classe. - -2003-11-20 Alain Magloire - - The profiler need to get the line number of the offset within - a Symbol. We provide this functionnality. - - * src/org/eclipse/cdt/IBinaryParser.java - * utils/org/eclipse/cdt/utils/elf/parser/Symbol.java - * utils/org/eclipse/cdt/utils/coff/parser/Symbol.java - -2003-11-20 Alain Magloire - - Remove of methods that are JVM 1.4.x - * model/org/eclipse/cdt/internal/core/model/Binary.java - -2003-11-19 Alain Magloire - - Improve performance on the binary parser, and fix a JUnit test. - - * model/org/eclipose/cdt/internal/core/model/Binary.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java - -2003-11-19 Hoda Amer - Added a completion engine class. - -2003-11-18 Alain Magloire - - Attempt to address performance problems from the binary parser - on big projects. The problem is that files are open multiple - times to detect if they are binaries or archives. We can - not really rely on the filename or extension. A new method - as been added to the IBinaryParser interface, isBinary() - taken an intial byte[]. - - * model/org/eclipse/cdt/internal/core/model/Binary.java - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - * model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/IBinaryParser.java - * utils/org/eclipse/cdt/utils/coff/PE.java - * utils/org/eclipse/cdt/utils/coff/PEArchive.java - * utils/org/eclipse/cdt/utils/coff/parser/ARMember.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java - * utils/org/eclipse/cdt/utils/coff/parser/PEParser.java - * utils/org/eclipse/cdt/utils/coff/parser/Symbol.java - * utils/org/eclipse/cdt/utils/elf/AR.java - * utils/org/eclipse/cdt/utils/elf/parser/ARMember.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java - * utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java - * utils/org/eclipse/cdt/utils/elf/parser/Symbol.java - -2003-11-17 Doug Schaefer - Nothing just testing the commit logs - -2003-11-13 David Inglis - Fixed #46431 - * utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java - -2003-11-06 David Inglis - - Fix for 45835 also changed binary runner control to stop running when project closes/open/deleted - - * model/org/eclipse/cdt/internal/core/CModelManager.java - * model/org/eclipse/cdt/internal/core/BinaryRunner.java - -2003-11-06 David Inglis - - Futher changes for 45736 - - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - - -2003-10-29 David Inglis - - Fix for 45734 & 45736, Though this only addresses a small part on the later. - - Prevents child element creation when releasing parent element - Prevent binary file check when have already obtained a translation unit. - - * model/org/eclipse/cdt/internal/core/CModelManager.java - -2003-10-29 Alain Magloire - - Fix for PR 45733 - - The BinaryContainer and the ArchiveContainer were not deleted - when the CProject was release. - - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - * model/org/eclipse/cdt/internal/core/model/CProject.java -2003-10-27 Alain Magloire - - Fix PR45609: - IWorkspaceRoot.getFileForLocation() does not work well when - the resource is linked, we should fall back to - IWorkspaceRoot.findFilesForLocation(). - - * src/org/eclipse/cdt/core/ErrorParserManager.java - -2003-10-23 Alain Magloire - - Firing deltas on cpathentries modifications. - - * model/org/eclipse/cdt/core/model/ICElementDelta.java: - * model/org/eclipse/cdt/core/model/ICProject.java: - * model/org/eclipse/cdt/internal/core/model/CProject.java: - * model/org/eclipse/cdt/internal/core/model/core/CProject.java - * model/org/eclipse/cdt/internal/core/model/core/SetCPathEntriesOperation.java - * model/org/eclipse/cdt/internal/core/model/core/LibraryReferenceArchive.java - * model/org/eclipse/cdt/internal/core/model/core/LibraryReferenceShared.java - * model/org/eclipse/cdt/internal/core/model/core/LibraryReference.java - * model/org/eclipse/cdt/internal/core/model/core/Archive.java - * model/org/eclipse/cdt/internal/core/model/core/Binary.java - * model/org/eclipse/cdt/internal/core/model/core/CPathEntry.java - * model/org/eclipse/cdt/internal/core/model/core/ACPathEntry.java - -2003-10-23 Alain Magloire - - Remove the old Implementation of ICPathEntry and use the new one. - - * src/org/eclipse/cdt/core/ICPathEntry.java: Removed. - * src/org/eclipse/cdt/internal/core/CPathEntry.java: Removed. - * src/org/eclipse/cdt/internal/core/CDescription.java: Removed. - * src/org/eclipse/cdt/core/CCorePlugin.java: Removed. - * model/org/eclipse/cdt/core/model/ICProject.java - * model/org/eclipse/cdt/internal/core/model/core/CProject.java - * model/org/eclipse/cdt/internal/core/model/core/SetCPathEntriesOperation.java - * model/org/eclipse/cdt/internal/core/model/core/LibraryReferenceArchive.java - * model/org/eclipse/cdt/internal/core/model/core/LibraryReferenceShared.java - * model/org/eclipse/cdt/internal/core/model/core/LibraryReference.java - * model/org/eclipse/cdt/internal/core/model/core/Archive.java - * model/org/eclipse/cdt/internal/core/model/core/Binary.java - * model/org/eclipse/cdt/internal/core/model/core/CPathEntry.java - -2003-10-22 Hoda Amer - Fix for bug#40759: Offsets of macroexpansions are not correct - Fix for bug#44633: Outline View : CModelBuilder quits on templated friends - -2003-10-21 Alain Magloire - - Moving the implementation of the ICPathEntry in the Core Model - new files: - - * model/org/eclipse/cdt/core/model/IIncludeEntry.java - * model/org/eclipse/cdt/internal/core/model/IncludeEntry.java - * model/org/eclipse/cdt/core/model/IMacroEntry.java - * model/org/eclipse/cdt/internal/core/model/IIncludeEntry.java - * model/org/eclipse/cdt/core/model/ICPathEntry.java - * model/org/eclipse/cdt/internal/core/model/CPathEntry.java - * model/org/eclipse/cdt/core/model/ILibraryEntry.java - * model/org/eclipse/cdt/internal/core/model/LibraryEntry.java - * model/org/eclipse/cdt/core/model/ISourceEntry.java - * model/org/eclipse/cdt/internal/core/model/SourceEntry.java - -2003-10-20 Hoda Amer - Fixed bug#44507 outline flickers with CDT1.2 RC0 - Returned a boolean from IWorkingCopy.reconcile() indicating - if there was a real change. - -2003-10-20 David Inglis - fixed junit breakage - testGetSoname() - * utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java - -2003-10-18 Alain Magloire - - Implement a Cygwin PE parser where addr2line, c++filt - cygpath can be set. Remove the old implementation - in the core model. - - * plugin.xml: Advertise the new Cygwin PE parser. - - * utils/org/eclipse/cdt/utils/coff/parser/BinaryFile.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryExcutable.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryShared.java - * utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java - * utils/org/eclipse/cdt/utils/ICygwinToolsProvider.java - - * model/org/eclipse/cdt/internal/model/parser/PEBinaryFile.java - * model/org/eclipse/cdt/internal/model/parser/ElfBinaryFile.java - * model/org/eclipse/cdt/internal/model/parser/PEBinaryArchive.java - * model/org/eclipse/cdt/internal/model/parser/ElfBinaryArchive.java - Removed - -2003-10-17 Alain Magloire - - A proposed fix from c_ravikanth@xxxx, for a more meaningfull - error message. - PR 44160 - - * utils/org/eclipse/cdt/utils/spawner/Spawner.java - -2003-10-14 Alain Magloire - - Change the scheme slightly to keep on looking for pattern - for exampel - /c/stuff/C:/filename:12 error - in Cygwin this error would never be found now we keep on - trying. - - * src/org/eclipse/cdt/intenal/errorparsers/GCCErrorParser.java - -2003-10-14 Alain Magloire - - Always fetch the addr2line/c++path in the .cdtproject - - * utils/org/eclipse/cdt/utils/elf/BinaryFile.java - * utils/org/eclipse/cdt/utils/elf/BinaryObject.java - * utils/org/eclipse/cdt/utils/elf/BinaryArchive.java - * utils/org/eclipse/cdt/utils/elf/ElfParser.java - * utils/org/eclipse/cdt/utils/elf/GNUElfParser.java - -2003-10-07 Alain Magloire - - More work on the GNU Elf Binary parser. - Move some calls that extends the Addr2line class. - - * utils/org/eclipse/cdt/utils/elf/BinaryFile.java - * utils/org/eclipse/cdt/utils/elf/BinaryObject.java - * utils/org/eclipse/cdt/utils/elf/BinaryArchive.java - * utils/org/eclipse/cdt/utils/elf/ElfParser.java - * utils/org/eclipse/cdt/utils/elf/GNUElfParser.java - * utils/org/eclipse/cdt/utils/Addr2line.java - -2003-10-06 Alain Magloire - - Implementation of the GNU Elf parser, where you can - change the path of the external commands: addr2line and cppfilt. - - * plugin.xml: Enable the GNU Elf Parser. - * utils/org/eclipse/cdt/utils/elf/BinaryFile.java - * utils/org/eclipse/cdt/utils/elf/BinaryObject.java - * utils/org/eclipse/cdt/utils/elf/BinaryArchive.java - * utils/org/eclipse/cdt/utils/Addr2line.java - * utils/org/eclipse/cdt/utils/elf/CPPFilt.java - -2003-10-01 Bogdan Gheorghe - - Changed DeltaProcessor.updateDependencies to use the CModelManager - header file definitions - - Modified CDTLogWriter: increased max log file size to 10MB; got rid of - the stack dumps; added flush to CDTLogWriter - - * src/org/eclipse/cdt/internal/core/CDTLogWriter.java - -2003-10-01 Rob Jackson - - Avoid a NPE when processing non-absolute FILE references in elf binaries - - * model/org/eclipse/cdt/intenal/core/model/BinaryElement.java - -2003-09-30 Bogdan Gheorghe - - - Created CDTLogWriter class - - Added CDTLogWriter startup/shutdown to CCorePlugin - - Changed Util class to make use of ICLogConstants to distinguish - between PDE and CDT logs. - - Modified the Buffer class to log errors to the CDT log - - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/ICLogConstants.java - * src/org/eclipse/cdt/internal/core/CDTLogWriter.java - * model/org/eclipse/cdt/internal/core/model/Util.java - * model/org/eclipse/cdt/internal/core/model/Buffer.java - -2003-09-25 Bogdan Gheorghe - - - Got rid of refs to old dependency service; restructured - index request section - - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/model/CoreModel.java - * src/org/eclipse/cdt/internal/core/model/CModelManager.java - * src/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - -2003-09-24 Alain Magloire - - With the removal of the old CDT parser, there was no - need to keep this method around - parser(InputStream in) - in the TranslationUnit. The parser content is retrieve via - the IBuffer now. The method - parser() - calss the CModelBuilder directly. - - * src/org/eclipse/cdt/internal/core/model/TranslationUnit.java - -2003-09-24 Alain Magloire - - * src/org/eclipse/cdt/core/ErrorParserManager.java - Possible NPE fix, when hitting cancel. - -2003-09-24 David Inglis - - * src/org/eclipse/cdt/internal/core/CExtensionInfo.java - null should removed attributes. - - * src/org/eclipse/cdt/internal/core/CDescriptor.java - Fixed bug# 43533 - - * model/org/eclipse/cdt/internal/core/model/Binary.java - Help with slow IBinary interface. - -2003-09-22 Bogdan Gheorghe - - Took out old CTags code from CCorePlugin - - * org.eclipse.cdt.core.CCorePlugin - -2003-09-19 Hoda Amer - Solution to bug#43162 : Code Assist not showing the right return value: - Saved a function return value string in the BasicSearchMatch object. - Created a new package org.eclipse.cdt.internal.core.parser.util and - added ASTUtil class with static methods to help convert an ASTFunction - return type from IASTAbstractDeclaration to String. Note that this was - previously implemented in the CModelBuilder. I just moved it to a common - library for others (BasicSearchMatch) to use. - -2003-09-16 Alain Magloire - - Putting the draft work to do a special binary parser - that the addr2line and c++filt command could be set - via extension in the ui. - - * utils/org/eclipse/cdt/utils/elf/parser/GNUElfParser.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryFile.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryExecutable.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java - * utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java - * utils/org/eclipse/cdt/utils/elf/parser/ARMember.java - -2003-09-16 David Inglis - - Deprecate old make builder - - * src/org/eclipse/cdt/core/resources/MakeUtil.java - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/CProjectNature.java - -2003-09-12 Alain Magloire - Patch from Bogdan Gheorghe, it corrected a NPE, when dealing with file extensions. - In a Unix enviroment binaries do not have extensions also some C++ headers - do not have extension, for example "cstdio" etc .. The patch guard agains null. - - Second part added debug loggin trace - - * .options - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - * src/org/eclipse/cdt/core/CCorePlugin.java - -2003-09-12 Keith Campbell - Added missing dependency on org.eclipse.team.core (this plugin defines extensions - to org.eclipse.team.core.fileTypes and org.eclipse.team.core.ignore). - * .classpath - * .project - * plugin.xml - -2003-09-10 Sean Evoy - Work completed to resolve [Bug 41412] "Restore Default in Managed Build project's - settings Not Working". The configuration now has a reset method that removes - any user settings and replaces them with the values defined in the plugin - manifest. The Configuration class also has a new, safe accessor for getting - at the defined tool references. Replaced all the checks for null with the accessor. - Added some string constants to the IConfiguration and ITarget interfaces - so manifest element lookup will be easier to maintain should the element names change. - Switched the Target class to use the new string constants during element lookup. - Added back a method in IConfiguration to lookup the parent configuration (which is the - plugin element I need to do the reset). - * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java - * build/org/eclipse/cdt/core/build/managed/IConfiguration.java - * build/org/eclipse/cdt/core/build/managed/ITarget.java - * build/org/eclipse/cdt/core/build/managed/ITool.java - * build/org/eclipse/cdt/internal/core/build/managed/Target.java - - Work to resolve [Bug 42735] "Manage Make will try to generate makefile for Release or - Debug directory". Added a new method to return all the configuration names so - the generator will know that the directory / should be ignored. - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java - * build/org/eclipse/cdt/core/build/managed/IManagedBuildInfo.java - - Work to partially implement incremental build. New incremental build logic in the - incrementalBuild() method in the GeneratedMakefileBuilder class. It now calls a - specialized method in the makefile generator that calculates and generates the - needed makefiles and fragments. It then calls build if there are any changes worthy - of a build. - * src/org/eclipse/cdt/internal/core/GeneratedMakefileBuilder.java - * src/org/eclipse/cdt/internal/core/MakefileGenerator.java - -2003-09-05 Bogdan Gheorghe - - Hooked in the dependency checking on file changes in Delta - Processor.java. When a header files' contents change we look - up the referencing files in the dep tree table and reindex them. - - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - -2003-09-05 Alain Magloire - - The PTY classes are using one instance of the master fd for Input/Output/Error - Streams. We need to wrap the fd access, to not throw IOException on multiple close. - - * utils/org/eclipse/cdt/utils/pty/PTY.java - * utils/org/eclipse/cdt/utils/pty/PTYInputStream.java - * utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java - -2003-09-04 Hoda Amer - - Added references to variables in solution of bug#42453:Expression result types not computed - - Solution to bug#42560: Class Cast Exception during Method definition - -2003-09-04 Alain Magloire - - The IProgressMonitor.setCancelled() is incorrect, it tries to access - widget withour wrapping things in Display.async(). Even if the IProgressMonitor - is a "core" Class. We workaround this by not using the method. - - PR 42501. When the clock setting is incorrect GNU Make will throw something like: - make: *** Warning: clock File`...` has modification in the future - It was show as an error. Thanks to Brent for the catch. - - * src/org/eclipse/cdt/internal/core/CBuilder.java - * src/org/eclipse/cdt/internal/core/errorparsers/MakeErrorParser.java - -2003-09-04 Hoda Amer - - Changed the ASTExpression of the complete package to store the - whole ITOkenDuple for the typeId instead of just the string. - - Changed the ASTExpression in both quick and complete packages and - deleted the "id" parameter. - - Added partial solution to bug #42453:Expression result types not computed. - Now they are computed for simple types only. - -2003-09-03 David Inglis - Added shared preference key for error parsers - - * src/org/eclipse/cdt/core/ErrorParserManager.java - -2003-09-01 Alain Magloire - - Typo in the class signature. - - * plugin.xml - -2003-08-31 Alain Magloire - - Add method to save the ErrorParsers - Change ErrorParserManger to use the extension point for the ErrorParser. - - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/ErrorParserManager.java - -2003-08-31 Alain Magloire - - Add method to retrieve the Error Parsers in the CCorePlugin. - Add extension point for the ErrorParser. - - * src/org/eclipse/cdt/core/CCorePlugin.java - * plugin.xml - * plugin.properties - -2003-08-28 Alain Magloire - - Change the TranslationUnit to not always assume that it has a valid - IResource/IFile. - * model/org/eclipse/cdt/internal/core/model/TranslationUnit.java - -2003-08-28 Hoda Amer - Solution to bugs #39961 & #39968: - -Template Union missing an icon - -Template parameter signature documentation - -2003-08-28 Hoda Amer - - Added resolving references in a method's qualified name - in Complete parse mode. - Example (.cpp file ): The method "A::B::C::aMethod(){};" - used to be an IASTFunction, with name = "A::B::C::aMethod". - Now is an IASTMethod, with name = "aMethod", and references to - class A, class B and class C. - - Added the checking for "isConstructor" and "isDestructor" - for an IASTMethod in complete parse mode. - -2003-08-26 Bogdan Gheorghe - - Modified start up code to set debug trace options - - Added trace debug statements to CModelBuilder. - - Added IDebugLogConstants which contain ids for all - Util.debugLog clients (currently Parser and CModelBuidler) - - Modified Util.java to make use of IDebugLogConstants - -2003-08-25 Hoda Amer - Modified the IASTFactory to take three expression lists - for the createNewDescriptor() instead of just one. - They are : newPlacementExpressions, newTypeIdExpressions, and - newInitializerExpressions. - -2003-08-25 John Camelon - Updated Structure.java to keep JDK 1.3 compliance. - -2003-08-21 Hoda Amer - - C Model cleanups + solutions to bug#38985 & bug#38986 - getField(String) Implemented - getFields() Implemented - getMethod(String) Implemented - getMethods() Implemented - isAbstract() Implemented - getBaseTypes() Has been replaced by getSuperClassesNames() - getAccessControl(int) Has been replaced by getSuperClassAccess(String name) - - Added some methods to IMethodDeclaration, namely: - isFriend(), isInline(), isVirtual(), and isPureVirtual(). - -2003-08-20 Alain Magloire - - When doing the IPlugin.shutdown(). We have to make - sure that the binarySearch threads are terminated. - - * src/org/eclipse/cdt/internal/core/model/BinaryRunner.java - -2003-08-19 Sean Evoy - In order to properly support the indexing feature, the scanner has to - function as well as the version that ships with the toolset if possible. - This is made difficult by the fact that we are trying to be tool-agnostic. - One of the things that the scanner should take into account when it runs - is the "built-in" symbols and search paths that are defined for a compiler - in a given toolchain. While we need to come up with a standard mechanism - for the CDT in the future, the managed build system can provide a work-around - in the near-term. The easiest solution is to add an optional attribute to a - list element that flags the item as a built-in value. When clients like - the indexer query the build model, they will receive the union of the built-in - values and the user-defined values. - - Updated the comment for the IScannerInfo::getIncludesPaths() method to - explain the content of the return value. - * parser/org/eclipse/cdt/core/parser/IScannerInfo.java - - Added code to answer the built-ins when IScannerInfo methods are called. - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java - - Updated the schema to include the new attribute - * schema/ManagedBuildTools.exsd - - Added a public method to extract the built-in values for an option. - * build/org/eclipse/cdt/core/build/managed/IOption.java - - Added the code to read, store and persist the built-in list values - differently than standard list elements. Also added code to answer - those built-ins to conform to the interface change. - * build/org/eclipse/cdt/internal/core/build/managed/Option.java - * build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java - -2003-08-20 Hoda Amer - Modified the parser's newExpression() to send all its sub expressions - to the newDescriptor and check on each expression to find references - in the CompleteParserASTFactory.createExpression(). - -2003-08-13 Sean Evoy - Changed text generated into makefile comments from the rather abstract - term 'module' to the more meaningful 'subdirectory'. - * src/org/eclipse/cdt/internal/core/CCorePluginResources.properties - - Added place-holder macro for LIBS and changed the source file look-up code to - ignore source it finds in generated directories during a build, even if it has a tool - that says it builds for it. - * src/org/eclipse/cdt/internal/core/MakefileGenerator.java - - Changed class to deal with build targets that do not specify an extension - (like POSIX executables). - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java - * build/org/eclipse/cdt/internal/core/build/managed/Tool.java - -2003-08-13 Sean Evoy - The major change in the increment of work is the new discovery mechanism - that clients will use to find the IScannerInfoProvider for a project. - Rather than a simple extension point which requires the client to iterate - over all registered providers, the CExtension feature will be used to - register the provider at project creation time, and to find the provider - at runtime. - - Changed the plugin entries for the two builders currently described. The - schema for the ScannerInfoProvider was removed, and the plugin description - was converted to work with the CExtension feature. - * plugin.xml - * schema/ScannerInfoProvider.exsd (removed) - - Added a method to find and create the provider described in the extension point. - Used by clients at runtime to discover the provider. - * src/org/eclipse/cdt/core/CCorePlugin.java - - Changed the IScannerInfoProvider interface by removing the 'managesResource' - method (no more iteration required) and adding a method so clients can get - build information as soon as they get the provider and before they subscribe. - * parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java - - Updated the two classes that implemet the interface and made them inherit from - AbstractCExtension in order to be managed by the CExtension feature. - * build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java - * build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java - -2003-08-12 Hoda Amer - Moved CharOperations and Utils from internal.core.search to internal.core - Added CConventions class to validate class names - Used the new search (indexer) for Code completion in CCompletionProcessor - -2003-08-11 Andrew Niefer - Added getSharedWorkingCopies to CCorePlugin. - -2003-08-10 Sean Evoy - Fix for Bug 41274. Was not saving the library option properly because the value type - of the option was not recognized. - * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java - -2003-07-30 Hoda Amer - The C Model recognizes pointers to functions. - -2003-07-30 Sean Evoy - The managed build model is going to go through a bit of change over the next while. - In order to make that more manageable, I have moved all the hard-coded strings used - to access the XML elements of the extension point definition into the appropriate - interface classes. - - * build/org/eclipse/cdt/core/build/managed/IBuildObject.java - * build/org/eclipse/cdt/core/build/managed/IConfiguration.java - * build/org/eclipse/cdt/core/build/managed/IOption.java - * build/org/eclipse/cdt/core/build/managed/IOptionCategory.java - * build/org/eclipse/cdt/core/build/managed/ITool.java - * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java - * build/org/eclipse/cdt/internal/core/build/managed/Option.java - * build/org/eclipse/cdt/internal/core/build/managed/OptionCategory.java - * build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java - * build/org/eclipse/cdt/internal/core/build/managed/Tool.java - * build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java: - Moved the hard-coded strings used to access the XML elements into appropropriate interfaces. - - * schema/ManagedBuildTools.exsd: - Renamed four attributes optionRef->optionReference, toolRef->toolReference, - optionValue->listOptionValue, and optionEnum->enumeratedOptionValue. In the first - 2 cases, I was just trying to remove the tech-ese from the names. In the later 2, I - tried to use a more descriptive name. - -2003-07-29 Alain Magloire - - To discover if an application has debug info for DWARF-2 format - we look for section ".debug*" - - * utils/org/eclipse/cdt/utils/Elf/elf.java - -2003-07-28 Sean Evoy - In order to meet certain internal guidelines and to test the makefile - generator, the build model replied to some answers with hard-coded information. - This patch moves the information into the build model. - - * schema/ManagedBuildTools.exsd - * build/org/eclipse/cdt/core/build/managed/ITarget.java - * build/org/eclipse/cdt/internal/core/build/managed/Target.java - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java: - Added code to correctly extract and persist the make command and clean - command from a Target/ITarget. Added the attributes to the schema. Removed - the hard-coded answers from the ManagedBuildManager. - - * src/org/eclipse/cdt/internal/core/GeneratedMakefileBuilder.java: - Removed two methods that were no longer invoked from the builder. - - * src/org/eclipse/cdt/internal/core/MakefileGenerator.java: - Corrected a bug in the makefile generator whereby the output prefix was applied - twice to library targets, i.e. liblibfoo.a instead of libfoo.a. - - -2003-07-24 Sean Evoy - * src/org/eclipse/cdt/internal/core/MakefileGenerator.java: - Added code to place interproject dependencies in target build rule, - added code to properly put output prefixes on library names, and - added code to put library link arguments at the end of the depednency list - - * build/org/eclipse/cdt/core/build/managed/IManagedBuildInfo.java - * build/org/eclipse/cdt/core/build/managed/IOption.java - * build/org/eclipse/cdt/core/build/managed/ITool.java - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java - * build/org/eclipse/cdt/internal/core/build/managed/Option.java - * build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java - * build/org/eclipse/cdt/internal/core/build/managed/Tool.java - * build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java: - Added code to managed output prefixes for tools like the librarian. Added code - to manage the library options differently. Removed some hard-coding of tool - information, such as the output flag. - - *schema/ManagedBuildTools.exsd: - New attributes on tool for output flag and prefix. New value type enum for option - to handle libs differently. - -2003-07-24 Sean Evoy - Changes introduced to make the managed build system work with - multi-folder project. - - * src/org/eclipse/cdt/core/ManagedCProjectNature.java: - now removes the cbuilder from a project before it adds its - own builder. This is a temporary fix to stop the managed build - system from building a project twice. When the new StandardBuildNature - is introduced, this code will be removed. - - * src/org/eclipse/cdt/internal/core/CCorePluginResources.properties: - New builder messages added. - - * src/org/eclipse/cdt/internal/core/GeneratedMakefileBuilder.java: - Moved the actual directory and file creation to a delegate class. - - * src/org/eclipse/cdt/internal/core/MakefileGenerator.java: - New class that does the grunt work of creating build output directories - and makefiles. - - * build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java: - Short-term changes to make it possible for build info clients to get the - path and symbol information. When a permanent mechanism is implemented - for clients to discover this information, these methods (IScannerInfoxxx) - will be removed. - - * build/org/eclipse/cdt/core/build/managed/IManagedBuildInfo.java - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java: - Some minor changes have been made to extract more information from the - build model. Currently, the values are hard-coded to simplify some integration - testing. This will be addressed in the next patch. - -2003-07-24 Alain Magloire - - * utils/org/eclipse/cdt/utils/Elf.java: - Added a case for motorola 68000 CPU. - -2003-07-24 Hoda Amer - Clean up of CModelBuilder - -2003-07-23 Hoda Amer - Updated the CModelBuilder to use the AST instead of the DOM - -2003-07-16 Alain Magloire - - Patch from Alex Chapiro - Fix an evident bug in CProjectNature implementation of - removeFromBuildSpec method. - - * CProjectNature.java - -2003-07-16 Alain Magloire - - Patch from Thomas Fletcher. - Update the core MakeUtil class with a method to support inline replacement - of a make target with a different make target. - - * src/org/eclipse/cdt/core/resources/MakeUtil.java - -2003-07-04 Victor Mozgin - Added CTaskTagsReconciler. - -2003-07-03 Bogdan Gheorghe - Added support for adding individual source files to the - index. - - Added support for removing projects/individual files from - index. - - * src/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - - Added a method to cancel indexing requests when a project is - deleted. - - Changed create(ICElement parent, IFile file, IBinaryFile bin) to - check if a file is a TranslationUnit before doing anything else. - This was done to fix Bug 39574. - - * src/org/eclipse/cdt/internal/core/model/CModelManager.java - -2003-07-03 Sean Evoy - New schema and extension point for registering an interface - between the build system (managed and standard) and the scanner - clients that need it (like the indexer). - * plugin.xml - * schema/ScannerInfoProvider.exsd - - Added some documentation to the schema for managed build information - * schema/ManagedBuildTools.exsd - - Added three new interfaces for getting build information for the scanner. - IScannerInfo contains the actual information the scanner needs and is passed - to the scanner by the build model. IScannerInfoChangeListener is the interface - that must be implemented by the scanner client that uses the IScannerInfo. - IScannerInfoProvider is the interface implemented by the build model. It is - registered through an extension point so clients can discover providers at - run time. IScannerInfoListener implementors subscribe and unsubscribe with the - provider and the provider passes them the IScannerInfo when it changes. - * parser/org/eclipse/cdt/core/parser/IScannerInfo.java - * parser/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java - * parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java - - Changed the name of some of the managed build system elements. - * build/org/eclipse/cdt/core/build/managed/IManagedBuildInfo.java - - This resulted in superficial changes to the Target and ManagedBuildManager - * build/org/eclipse/cdt/internal/core/build/managed/Target.java - - Implemented the new scanner interfaces in the managed system - * build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java - * build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java - - Added a new manager for the standard make system that implements the new - scanner interfaces. This manager uses the .cdtbuild file to persist - include path and symbol information (in otherwords, real build information). - Like the managed build manager, it also gives clients access to the build - information associated with a project. It does not effect the older preferences - which are still managed by the CNature. - * build/org/eclipse/cdt/core/build/standard/StandardBuildManager.java - - Removed the responsibiolity for includes paths and symbols from CNature - added in last patch. - * src/org/eclipse/cdt/core/CProjectNature.java - - Added code for persisting the standard build information for includes paths and - symbols in a file, and implemented the IScannerInfo interface in the BuildInfoFactory. - Did not rename it, although ... - * src/org/eclipse/cdt/core/BuildInfoFactory.java - - I did rename the interface it implements since it was the only reference - * src/org/eclipse/cdt/core/resources/IStandardBuildInfo.java - - - -2003-06-26 Sean Evoy - Added methods to add and extract include paths and preprocessor - symbols from standard make C and C++ projects. - - Getter and setter methods in: - * src/org/eclipse/cdt/core/BuildInfoFactory.java - * src/org/eclipse/cdt/core/CProjectNature.java - - Added new constant for comma-separated lists - * src/org/eclipse/cdt/core/resources/IBuildInfo.java - -2003-06-25 Bogdan Gheorghe - - * src/org/eclipse/cdt/core/CCorePlugin.java - Start the new indexer thread on startup - * src/org/eclipse/cdt/core/model/CoreModel.java - Added some methods to access the IndexManager - * src/org/eclipse/cdt/internal/core/model/CModelManager.java - Added some methods to access the IndexManager - * src/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - Added IndexManager member - -2003-06-24 Alain Magloire - - Patch form ando@park.ruru.ne.jp, to deal - with different file cases i.e. TEST.C vs test.c - On windows. - - * src/org/eclipse/cdt/core/ErrorParserManager.java - -2003-06-24 Alain Magloire - - * src/org/eclipse/cdt/internal/errorparser/GCCErrorParser.java: - New scheme to detect, preprocessor errors. - * src/org/eclipse/cdt/core/ErrorParserManager.java: - Provide a scratch buffer for the error parser classes. - -2003-06-20 Sean Evoy - Added two new value types to the ManagedBuildTools schema for include paths - and defined symbols. - - Added interface so clients can query build model for include paths and - defined symbols - * build/org/eclipse/cdt/core/build/managed/ManagedBuildManager.java - * build/org/eclipse/cdt/core/build/managed/IManagedBuildPathInfo.java - * build/org/eclipse/cdt/internal/core/build/managed/ResourceBuildInfo.java - - Changed code in build model to support these new value types - * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java - * build/org/eclipse/cdt/internal/core/build/managed/Option.java - * build/org/eclipse/cdt/core/build/managed/IOption.java - * build/org/eclipse/cdt/internal/core/build/managed/OptionReference.java - * build/org/eclipse/cdt/internal/core/build/managed/Tool.java - * build/org/eclipse/cdt/internal/core/build/managed/ToolReference.java - - -2003-06-19 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/CModelManager.java: - (shutdown): Deregister the listener from the Workspace. - -2003-06-16 Victor Mozgin - Implemented support for old K&R-style C function declarations. - Added oldKRParametersBegin() and oldKRParametersEnd() to DOMBuilder. - Added OldKRParameterDeclarationClause.java to dom/org/eclipse/cdt/internal/core/dom. - Added handling of OldKRParameterDeclarationClause to ParameterDeclarationClause. - -2003-06-14 Victor Mozgin - Added support for pointers to members to DOMBuilder. - Added new kind of pointer operator : t_pointer_to_member (PointerOperator). - Added nameSpecifier field and set/get operations to PointerOperator. - -2003-06-13 Andrew Niefer - Added search\org.eclipse.cdt.core.search - search\org.eclipse.cdt.internal.core.search - search\org.eclipse.cdt.internal.core.search.matching - search\org.eclipse.cdt.internal.core.search.processing - with skeleton classes based on the JDT search as a beginning for - implementing C/CPP search. - -2003-06-06 Sean Evoy - - Added new interface, IResourceBuildInfo, so clients could - be shielded from future implementation changes. - - ManagedBuildManager class has been updated to return an - interface, IResourceBuildInfo, instead of the implementing - class. - - For ITool, I added a method to determine if the tool produces - an output based on a file extension, and one to determine if - it builds an input based on a file extension. I added a method - to determine what the output file extension of a build will - be based on an input extension. Finally, I added a method to - extract a tool command and one to extract its flags. - - For ITarget, I added more information about the build artifact. - I have added artifact name and default extension attributes to - the target schema. The artifact name is intended to hold the - name the user has selected as the final build object - (i.e. test.exe, foo.so, etc). The default extension will be - used by the toolchain provider to specify a default extension - for the final build object (i.e. .dll.a for Cygwin shared libs - vs .so for Linux shared libs). There are getter and setter - methods for the name of the final build artifact. There is also a - method to extract the default extension that is built for targets - of this type. - - The build model schema was updated to reflect these new bit of - information. - - The GeneratedMakefileBuilder was updated to extract this information - and to create a new rule for each input to the build artifact. - - The resource build information store now remembers the top - configuration for a target as selected by the user in the UI. - This is needed by the makefile generator and in persisted in the - project build file. - - The test has been updated to reflect these changes. - -2003-06-05 Alain Magloire - - PR #38380, partially fix; would need more detail form - the C Parser to know if the include is <...> or "..." - - * model/org/eclipse/cdt/internal/core/model/Include.java - (getIncludeName): implemented. - -2003-05-29 Alain Magloire - - PR 38239 - BinaryContainer.getBinaries() was returning empty [] - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - (getBinaryRunner): return the runner if is already instanciated. - -2003-05-29 David Inglis - * utils/org/eclipse/cdt/utils/elf/Elf.java - fixed toString buf for Sestion. - added findSesctionByName() method - fixed bug where reading DYN section would fail for mips - * utils/org/eclipse/cdt/utils/elf/ElfHelper.java - use new findSectionByName. - cleaup - -2003-04-29 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/parser/PEParser.java (getBinary): - Catch if path == null. - * model/org/eclipse/cdt/internal/core/model/Archive.java (isReadOnly): - Always return true for binary. - -2003-04-29 Alain Magloire - - PR 37064 - - * model/org/eclipse/cdt/internal/core/model/DelatProcessor.java (close): - New method, close the openable when content changed to flush the cache. - (contentChanged): Remove only use elementChanged(). - * model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java (getBinary): - Catch if path == null. - -2003-04-25 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/Binary.java (getNeededSharedLibs): - JUnit faileds tests. getNeededSharedLibs() should also return for executable. - (isReadOnly): is always true for executable. - -2003-04-24 Alain Magloire - - * utils/org/eclipse/cdt/utils/spawner/Spawner.java (raise): - Change the scope to be public. - -2003-04-12 Alain Magloire - - Bug 36624 - The latest changes broke the old parser, we still need the old parser - until the new one is rock solid. - - * model/org/eclipse/cdt/internal/core/model/TranslationUnit.java: - -2003-04-12 Alain Magloire - - Bug 36424, - The Binaries/Archives were not deleted in the virtual containers. - - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java: - createElement() checks for the binaries in the virtual containers also. - * mode/org/eclipse/cdt/internal/core/model/CModelManager.java: - Remove unused methods. - -2003-04-09 Alain Magloire - - Give a chance to the manager to initialize and shutdown gracefully. - The CCorePlugin will call the managers, indexer, coreModel, CDescriptorManager - startup() method and shutdown() method. - - * src/org/eclipse/cdt/core/CCorePlugin.java: - Call {IndexModel,CoreModel}.{startup,shutdown}(). - * model/org/eclipse/cdt/core/model/CoreModel.java: - New methods startup/shutdown. - * model/org/eclipse/cdt/internal/core/mode/CModelManager.java: - implement startup/shutdown. - * index/org/eclipse/cdt/core/model/IndexModel.java: - New methods startup/shutdown. - -2003-04-08 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java: - Bug fix, deltas were not generated for non C-Resources. - -2003-04-02 Alain Magloire - - First draft on implementing LibraryReference. - - * model/org/eclipse/cdt/core/model/ICProject.java: - * model/org/eclipse/cdt/internal/core/model/CProject.java: - New method getLibraryReferences(). - * model/org/eclipse/cdt/internal/core/model/LibraryReference.java: - New class. - - * src/org/eclipse/cdt/internal/core/CDescriptor.java: - Bug fix in readProjectDescription(); fPathEntries was not initialized - and decodePathEntry() was call with the wrong argument. - -2003-04-01 Alain Magloire - - Implement SourceRefence and SourceManipulation for IBinary, this is - done in BinaryElement, BinaryFunction, BinaryVariable. - - * model/org/eclipse/cdt/internal/core/model/Binary.java: - * model/org/eclipse/cdt/internal/core/model/BinaryFunction.java: - * model/org/eclipse/cdt/internal/core/model/BinaryVariable.java: - * model/org/eclipse/cdt/internal/core/model/BinaryElement.java: - - Corrected typo ISymbol.getAdress() should be ISymbol.getAddress(). - * model/org/eclipse/cdt/internal/core/model/parser/Symbol.java: - * src/org/eclipse/cdt/core/IBinaryParser.java: - -2003-04-01 Alain Magloire - - Patch form Hoda. - IStructure extends IVariableDeclaration. - INamespace extends IParent. - - * model/org/eclipse/cdt/core/model/IStructure.java - * model/org/eclipse/cdt/core/model/INamespace.java - -2003-04-01 Alain Magloire - - Phasing out the classes ICResource and ICFile. - They were no longer part of the C Model. - - * model/org/eclipse/cdt/core/model/ICFile.java: - * model/org/eclipse/cdt/core/mode/ICResource.java: - * model/org/eclipse/cdt/internal/core/model/CFile.java: - Removed. - -2003-03-30 Alain Magloire - - First phase of the rewrite on how we treat Binary/Archive in the CoreModel - This included suggestions from Chris Songer on augmenting the binary methods - to include the address; - IBinary - IBinaryModule - IBinaryFunction - IBinaryVariable - IBinaryElement - - * model/org/eclipse/cdt/core/model/IBinaryElement.java: - * model/org/eclipse/cdt/core/model/IBinaryModule.java: - * model/org/eclipse/cdt/core/model/IBinaryVariable.java: - * model/org/eclipse/cdt/core/model/IBinaryFunction.java: - New Classes. - - * model/org/eclipse/cdt/internal/core/model/Binary.java: - * model/org/eclipse/cdt/internal/core/model/Archive.java: - * model/org/eclipse/cdt/internal/core/model/BinaryModule.java: - * model/org/eclipse/cdt/internal/core/model/BinaryFunction.java: - * model/org/eclipse/cdt/internal/core/model/BinaryVariable.java: - * model/org/eclipse/cdt/internal/core/model/BinaryElement.java: - Implement the IBinaryElement classes. - - - * model/org/eclipse/cdt/internal/core/model/CElement.java: - * model/org/eclipse/cdt/internal/core/model/CModelCache.java: - * model/org/eclipse/cdt/internal/core/model/Openable.java: - * model/org/eclipse/cdt/internal/core/model/Parent.java: - Change the CModelCache to save in the LRU the binaries. - - * model/org/eclipse/cdt/internal/core/model/parser/ElfBinaryFile.java: - * model/org/eclipse/cdt/internal/core/model/parser/PEBinaryFile.java: - * model/org/eclipse/cdt/internal/core/model/parser/Symbol.java: - Implement the method getAddress(). - Suggested by Chris Songer - - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java: - * model/org/eclipse/cdt/internal/core/model/CModelManager.java: - Fix bug, the event was fired for the non-C resources. - - * src/org/eclipse/cdt/core/CCorePlugin.java: - New method getDefaultBinaryParser(). - - * src/org/eclipse/cdt/core/IBinaryParser.java: - Added method getAddress() to ISymbol - Suggested by Chris Songer - -2003-03-28 David Inglis - - * src/org/eclipse/cdt/core/AbstractCExtension.java - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/ICDescriptor.java - * src/org/eclipse/cdt/core/ICExtension.java - * src/org/eclipse/cdt/core/ICExtensionReference.java - * src/org/eclipse/cdt/core/ICOwner.java - * src/org/eclipse/cdt/core/ICOwnerInfo.java - * src/org/eclipse/cdt/core/ICPathEntry.java - * src/org/eclipse/cdt/internal/CCorePluginResources.properties - * src/org/eclipse/cdt/internal/core/CDescriptor.java - * src/org/eclipse/cdt/internal/core/CDescriptorManager.java - * src/org/eclipse/cdt/internal/core/CExtensionInfo.java - * src/org/eclipse/cdt/internal/core/CExtensionReference.java - * src/org/eclipse/cdt/internal/core/COwner.java - * src/org/eclipse/cdt/internal/core/CPathEntry.java - * src/org/eclipse/cdt/internal/core/InternalCExtension.java - - Add new ICPathEntry interface with peristancy, access is via the ICDecriptor - which uses the .cdtproject file for the store. creation is through CCorePlugin. - - - included is some copyright header changes and the move of the properties file - to 'internal' - -2003-03-27 Alain Magloire - * model/org/eclipse/cdt/internal/core/model/BinaryContainer.java: - * model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java: - Name is now "Binaries" and "Archives", lib and bin was confusing. - -2003-03-27 Alain Magloire - - The ICElement.getResource() should not throw a CModelException, it returns null or the the resource. - This makes us consistent with JDT/IJavaElement.getResource(); - -2003-03-27 Alain Magloire - - Some changes in the Core Model to make it closer to JDT, the hierarchy is now: - ICModel - ICProject - ICContainer - ITranslationUnit - IArchive - IBinary - - All the C Resources above implements IParent, ICElement and IOpenable. - The rationale is that in the old hierarchy, we were putting things in the model - that the did not belong to the a C/C++ Model, for example a "README" file - was map to CFile or CResource bloating the LRU cache, those resources did - not contribute any info to the model and would make the indexer job more - complex. A new method been added getNonCResources() to retrieve those elements. - Note CResource, CFolder, CFile are removed. - Also refactors: - - ICOpenable to IOpenable - - ICRoot to ICModel - - ICRootInfo to ICModelInfo - - Move internal/core/model/IBuffer* classes to core/model/IBuffer* - - * index/org/eclipse/cdt/internal/core/index/IndexManager.java - * model/org/eclipse/cdt/core/model/BufferChangedEvent.java - * model/org/eclipse/cdt/core/model/CoreModel.java - * model/org/eclipse/cdt/core/model/IArchive.java - * model/org/eclipse/cdt/core/model/IArchiveContainer.java - * model/org/eclipse/cdt/core/model/IBinary.java - * model/org/eclipse/cdt/core/model/IBinaryContainer.java - * model/org/eclipse/cdt/core/model/IBinaryContainer.java - * model/org/eclipse/cdt/core/model/IBuffer.java - * model/org/eclipse/cdt/core/model/IBufferChangedListener.java - * model/org/eclipse/cdt/core/model/ICContainer.java - * model/org/eclipse/cdt/core/model/ICElement.java - * model/org/eclipse/cdt/core/model/ICFile.java - * model/org/eclipse/cdt/core/model/ICFolder.java - * model/org/eclipse/cdt/core/model/ICModel.java - * model/org/eclipse/cdt/core/model/ICOpenable.java - * model/org/eclipse/cdt/core/model/ICProject.java - * model/org/eclipse/cdt/core/model/ICResource.java - * model/org/eclipse/cdt/core/model/ICRoot.java - * model/org/eclipse/cdt/core/model/IOpenable.java - * model/org/eclipse/cdt/core/model/ITranslationUnit.java - * model/org/eclipse/cdt/internal/core/model/Archive.java - * model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java - * model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java - * model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java - * model/org/eclipse/cdt/internal/core/model/Binary.java - * model/org/eclipse/cdt/internal/core/model/BinaryContainer.java - * model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java - * model/org/eclipse/cdt/internal/core/model/BinaryInfo.java - * model/org/eclipse/cdt/internal/core/model/BinaryRunner.java - * model/org/eclipse/cdt/internal/core/model/Buffer.java - * model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java - * model/org/eclipse/cdt/internal/core/model/BufferManager.java - * model/org/eclipse/cdt/internal/core/model/CContainer.java - * model/org/eclipse/cdt/internal/core/model/CContainerInfo.java - * model/org/eclipse/cdt/internal/core/model/CElement.java - * model/org/eclipse/cdt/internal/core/model/CElementDelta.java - * model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java - * model/org/eclipse/cdt/internal/core/model/CElementInfo.java - * model/org/eclipse/cdt/internal/core/model/CFile.java - * model/org/eclipse/cdt/internal/core/model/CFileInfo.java - * model/org/eclipse/cdt/internal/core/model/CFolder.java - * model/org/eclipse/cdt/internal/core/model/CFolderInfo.java - * model/org/eclipse/cdt/internal/core/model/CModel.java - * model/org/eclipse/cdt/internal/core/model/CModelCache.java - * model/org/eclipse/cdt/internal/core/model/CModelInfo.java - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - * model/org/eclipse/cdt/internal/core/model/CModelOperation.java - * model/org/eclipse/cdt/internal/core/model/CProject.java - * model/org/eclipse/cdt/internal/core/model/CProjectInfo.java - * model/org/eclipse/cdt/internal/core/model/CResource.java - * model/org/eclipse/cdt/internal/core/model/CResourceInfo.java - * model/org/eclipse/cdt/internal/core/model/CRoot.java - * model/org/eclipse/cdt/internal/core/model/CRootInfo.java - * model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java - * model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java - * model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java - * model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java - * model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java - * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java - * model/org/eclipse/cdt/internal/core/model/ElementCache.java - * model/org/eclipse/cdt/internal/core/model/FieldInfo.java - * model/org/eclipse/cdt/internal/core/model/FunctionInfo.java - * model/org/eclipse/cdt/internal/core/model/IBuffer.java - * model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java - * model/org/eclipse/cdt/internal/core/model/IBufferFactory.java - * model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java - * model/org/eclipse/cdt/internal/core/model/Openable.java - * model/org/eclipse/cdt/internal/core/model/OpenableInfo.java - * model/org/eclipse/cdt/internal/core/model/Parent.java - * model/org/eclipse/cdt/internal/core/model/SourceManipulation.java - * model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java - * model/org/eclipse/cdt/internal/core/model/TranslationUnit.java - * model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java - - -2003-03-20 Alain Magloire - - Patch from Amer Hoda - This patch adds the functionnality of the C Element Deltas for translation - unit. It figures the addes/deleted C elements with each elementChanged event. - - * model/org/eclipse/cdt/internal/core/model/CElement.java: - New method isIdentical(). - * model/org/eclipse/cdt/internal/core/model/CElementDeltabuilder.java: - First implementation. - * model/org/eclipse/cdt/internal/core/model/SourceManipulation.java: - New method hasSameContentAs() and getModifiers(). - -2003-03-19 Alain Magloire - - Patch from Amer Hoda. - Introducing the WorkingCopy in the Core Model. - Those changes introduce the same functionnality as JDT. - - All CElements have a common way of opening/modifying the source. In other words and - opening of Translation Unit (ITranslationUnit) is done via the buffer mechanism - To commit changes isConsistent and makeConsistent must be called. - - The Core Model maintains an LRU cache of open elements, and automatically closes elements - as they are swapped out of the cache to make room for other elements. - Elements with unsaved changes are never removed from the cache, and thus, if the client - maintains many open elements with unsaved changes, the LRU cache can grow in size - (in this case the cache is not bounded). However, as elements - are saved, the cache will shrink back to its original bounded size. - - * model/org/eclipse/cdt/core/model/ElementChangeEvent.java - * model/org/eclipse/cdt/core/model/ICOpenable.java - * model/org/eclipse/cdt/core/model/ICResource.java - * model/org/eclipse/cdt/core/model/ITranslationUnit.java - - * model/org/eclipse/cdt/internal/core/model/Buffer.java - * model/org/eclipse/cdt/internal/core/model/BufferChangedEvent.java - * model/org/eclipse/cdt/internal/core/model/CElement.java - * model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java - * model/org/eclipse/cdt/internal/core/model/CElementInfo.java - * model/org/eclipse/cdt/internal/core/model/CFile.java - * model/org/eclipse/cdt/internal/core/model/CFolder.java - * model/org/eclipse/cdt/internal/core/model/CModelCache.java - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - * model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java - * model/org/eclipse/cdt/internal/core/model/CProject.java - * model/org/eclipse/cdt/internal/core/model/CResource.java - * model/org/eclipse/cdt/internal/core/model/CRoot.java - * model/org/eclipse/cdt/internal/core/model/CElementCache.java - * model/org/eclipse/cdt/internal/core/model/IBuffer.java - * model/org/eclipse/cdt/internal/core/model/IBufferChangedListener.java - * model/org/eclipse/cdt/internal/core/model/IBufferFactory.java - * model/org/eclipse/cdt/internal/core/model/TranslationUnit.java - * model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java - * model/org/eclipse/cdt/internal/core/model/Util.java - * model/org/eclipse/cdt/internal/core/model/WorkingCopy.java - * model/org/eclipse/cdt/internal/core/model/WorkingCopyInfo.java - - - * model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java - * model/org/eclipse/cdt/internal/core/util/ILRUCache.java - * model/org/eclipse/cdt/internal/core/util/LRUCacheEnumeration.java - * model/org/eclipse/cdt/internal/core/util/OverFlowingLRUCache.java - * model/org/eclipse/cdt/internal/core/util/ToStringSorter.java - -2003-03-12 Alain Magloire - - * utils/org/eclipse/cdt/utils/elf/Elf.java: - Do a better check when looking for the nearest symbol, a validation - is to check if the line number is "0", zero is invalid and keep on iterating. - -2003-03-11 Alain Magloire - - * utils/org/eclipse/cdt/utils/elf/Elf.java (Symbol:getLineInfo): - The address value may not align with the debug information, for example when - adding Profiling etc .. we try to get the nearest symbol as a fallback. - We've seen this behaviour on PPC and ARM boards. - * utils/org/eclipse/cdt/utils/CPPFilt.java: - Remove unused fields. - -2003-02-26 Alain Magloire - - The second part to finish the cdt-core-home/docs/binaryparser.html - proposal. The plugin.xml changed to reflect this, new format. - - - - - - - - - - - - - - The binary parser type is now save in the ".cdtproject". - - * src/org/eclipse/cdt/core/IBinaryParserConfiguration.java: - * src/org/eclipse/cdt/internal/core/BinaryParserConfiguration.java: - Removed. - - * src/org/eclipse/cdt/internal/core/CDescriptorManager.java - (getDescriptor): Call autosave(). - * src/org/eclipse/cdt/internal/core/CDescriptor.java - (create): Bug fix - (get): Bug fix - (remove): Bug fix - - * model/org/eclipse/cdt/internal/core/model/parser/ElParser.java: - * model/org/eclipse/cdt/internal/core/model/parser/PEParser.java: - Extends AbstractCDescriptor. - * model/org/eclipse/cdt/core/internal/core/model/NullBinaryParser.java: - New file. - * model/org/eclipse/cdt/core/internal/core/model/CModelManager.java: - * model/org/eclipse/cdt/core/model/CoreModel.java - (resetBinaryParser): New method. - (getBinaryParserFormat): removed. - (setBinaryParserFormat): removed. - (setDefaultBinaryParserFormat): removed. - (getDefaultBinaryParserFormat): removed. - -2003-02-26 Alain Magloire - - A new proposal was make, see cdt-core-home/docs/binaryparser.html - it changed the the signature: - public interface IBinaryParser { - IBinary getBinary(IPath path); - } - - The getBinary() method no longer takes an IFile, this was necessary - to allow the binary parser code to work on files outside of the - workspace. The correspondign implementation is updated. - - * model/org/eclipse/cdt/internal/core/model/ElfBinaryArchive.java - * model/org/eclipse/cdt/internal/core/model/ElfBinaryFile.java - * model/org/eclipse/cdt/internal/core/model/ElfParser.java - * model/org/eclipse/cdt/internal/core/model/PEBinaryArchive.java - * model/org/eclipse/cdt/internal/core/model/PEBinaryFile.java - * model/org/eclipse/cdt/internal/core/model/PEBParser.java - - * model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java - * model/org/eclipse/cdt/internal/core/model/BinaryInfo.java - * model/org/eclipse/cdt/internal/core/model/CModelManager.java - -2003-02-26 David Inglis - * model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java - * model/org/eclipse/cdt/internal/core/model/BinaryContainer.java - Remove warning. - - * model/org/eclipse/cdt/internal/core/model/parser/ElfBinaryArchive.java - * model/org/eclipse/cdt/internal/core/model/parser/ElfBinaryFile.java - * utils/org/eclipse/cdt/utils/elf/AR.java - Improve IBinaryObject creation from IArchive (big speed improvment) - - -2003-02-24 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/Marker.java: - Removed, this file was implementing IMarker. - -2003-02-24 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/Resource.java: - Removed, this file was implementing IResource. - -2003-02-23 Alain Magloire - - Remove implementations of IResource and IContainer. - - * model/org/eclipse/cdt/internal/core/model/Container.java: - * model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java: - * model/org/eclipse/cdt/internal/core/model/parser/BinaryFileAdapter.java: - Files removed. - * model/org/eclipse/cdt/internal/core/model/Archive.java: - * model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java: - * model/org/eclipse/cdt/internal/core/model/BinaryInfo.java: - Remove references to BinaryFileAdapter. - -2003-02-19 David Inglis - - * src/org/eclipse/cdt/core/CCorePlugin.java - * src/org/eclipse/cdt/core/ICDescriptor.java - * src/org/eclipse/cdt/core/ICExtensionReference.java - * src/org/eclipse/cdt/core/ICOwner.java - * src/org/eclipse/cdt/internal/core/CDescriptor.java - * src/org/eclipse/cdt/internal/core/CDescriptorManager.java - * src/org/eclipse/cdt/internal/core/CExtensionReference.java - * src/org/eclipse/cdt/internal/core/make/MakeProject.java - General cleanup of CDT extensions interfaces from review with Alain. - -2003-02-17 Doug Schaefer - - Merged in Sam Robb's source for the build model. The source can be - found in the build source folder. There are new extension point schema - in the schema folder. As well a number of extension points and extensions - have been added to the plugin.xml file. - -2003-02-13 Alain Magloire - - * src/org/eclipse/cdt/core/CCorePlugin.java: - * src/org/eclipse/cdt/internal/core/make/Makebuilder.java: - Comment out reference to the Builder, for now. - - * builder/org/eclipse/cdt/core/builder/CIncrementalBuilder.java: - Comment reference to the CCorePlugin. - -2003-02-05 Doug Schaefer - - * src/org/eclipse/cdt/internal/parser.generated: - Fix for hang on destructors in namespaces - -2003-02-01 Alain Magloire - - Cleanups and suggestions for Hoda. - - * mode/org/eclipse/cdt/core/model/ITemplate.java: - New File. - * model/org/eclipse/cdt/core/model/IField.java: - Now extedns IVariableDeclaration. - * model/org/eclipse/cdt/core/model/IMethodDeclaration.java: - Extends IFunctionDeclaration. - * model/org/eclipse/cdt/core/model/IVariableLocal.java: - Removed. - -2003-01-29 Alain Magloire - - * index/org/eclipse/cdt/internal/core/index/IndexManager.java (shutdown): - Typo was calling Thread.interrupted() instead of Thread.interrupt(). - (delay): No longer static. - * src/org/eclipse/cdt/core/ErrorParserManger.java (readPreferences): - Use Class.forName(). - * src/org/eclipse/cdt/internal/core/CDescriptorManager.java (resourceChanged): - Remove useless declarations. - -2003-01-29 Alain Magloire - - * utils/org/eclipse/cdt/utils/elf/Elf.java: - * utils/org/eclipse/cdt/utils/coff/Coff.java - * utils/org/eclipse/cdt/utils/coff/PE.java - Cleanup some warnings when accessing static fields. - -2003-01-29 Alain Magloire - - * model/org/eclipse/cdt/core/model/CoreModel.java (addElementChangedListeners): - remove static qualifier. - (removeElementChangedListeners): remove static qualifier. - -2003-01-23 Alain Magloire - - Cleanups proposed by Amer Hoda. - - * model/org/eclipse/cdt/core/model/ICRoot.java: No need to extend ICElement - * model/org/eclipse/cdt/core/model/ICProject.java: No need to extend ICElement - * model/org/eclipse/cdt/core/model/ICFolder.java: No need to extend ICElement - * model/org/eclipse/cdt/core/model/ICFile.java: No need to extend ICElement - * model/org/eclipse/cdt/core/model/IMethod.java: Extends ICFunction. - -2003-01-23 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/CModelManager.java (getHeaderExtensions): Returns possible C/C++ header extensions name. - (getSourceExtensions): Returns possible C/C++ extension. - (getTranslationUnitExtensions): Returns possible C/C++ extension. - * model/org/eclipse/cdt/core/model/CoreModel.java: - (getHeaderExtensions): New method. - (getSourceExtensions): New method. - (getTranslationUnitExtensions): New method. - -2003-01-23 Alain Magloire - - Changes proposed by Amer Hoda. - - * model/org/eclipse/cdt/internal/core/model/Structure.java: - Extends IVariableDeclaration instead of IVariable. - * model/org/eclipse/cdt/core/model/IStructure.java: - Extends IVariableDeclaration instead of IVariable. - -2003-01-17 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/parser/ElfBinaryFile.java (addSymbols): - The catch IOException was at the wrong place. - -2002-12-23 Alain Magloire - - * src/org/eclipse/cdt/internal/core/CBuilder.java (invokeMake): - NPE check the return of launcher.execute(), the executables - may not be found. - -2002-12-20 Alain Magloire - - Bug fix, We use a feature of GNU make to help track the directories - Entering Directory '...' - Leaving Directory '...' - It looks like sometimes we loose track, or GNU make does not show - a "Leaving Directory" this may actually depend on how it was spawn, - you can suppress the message. If you loose track we popDirectories() - and try to recover. - - * src/org/eclipse/cdt/core/ErrorParserManager.java (popDirectory): - Is throwing NoSuchElement, check the size of the stack first. - - * src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java (processLine): - Recover when loosing track. - -2002-12-19 Alain Magloire - - * model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java (getFile): - Check getParent() it may return null. - (getFolder): Check getParent(), it may return null. - -2002-12-19 Alain Magloire - - * src/org/eclipse/cdt/core/ErrorParserManager.java (findFilePath): - The workspace will throw an Exception if the file - is not within the workspace, catch it. - (getWorkingDirectory): fallback to the location - of the project if no working directory. - - * src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java (processLine): - Ignore errors that does not match the pattern. - -2002-12-13 Alain Magloire - - * src/org/eclipse/cdt/core/CommandLauncher.java (waitAndRead): - Remove hack for J9 VM, filled a PR to IBM about their VM. - Only delay when there is nothing to read. - -2002-12-13 Alain Magloire - - Building will never write to the process. having things like - all: - b='a'; read b; echo $$b - could hang the IDE, since the process is waiting for input. - to go around, the input of the process is explicitely close. - - * src/.../internal/core/CBuilder.java (invokeMake): Close the - Output stream of the process, since we will never write to it. - -2002-12-13 David Inglis - Update cdt to be eclipse 2.1 ready. - - * model/.../internal/core/model/Marker.java: added getCreationTime() - * model/.../internal/core/model/Resource.java: added isLinked() - * model/.../internal/core/model/parser/BinaryContainerAdapter.java: added createLink() - * model/.../internal/core/model/parser/BinaryFileAdapter.java: added createLink() - - -2002-12-10 Alain Magloire - - * src/org/eclipse/cdt/core/CCommandLauncher.java (waitAndRead): - Check if the buffer is not null in available(). - -2002-12-10 Alain Magloire - - There is a bug in IMB j9 VM in the PipedInputStream class, when the - buffer is full it is returning 0 instead of buffer.length. We - go around by overloading the available() method. This should - be remove once the bug is fix. - - * src/org.eclipse.cdt.core/CCommandLauncher.java (waitAndRead): - overload available() method in the input stream. - Set the error message correctly when the command is canceled. - -2002-12-06 Alain Magloire - - * indexer/.../internal/core/index/CTagsentry.java (parse): Remove - The parsing was wrong for Exuberant Ctags. - -2002-11-27 Alain Magloire - - * utils/.../utils/coff/PE.java (getAttribute): - Quick fix to return the save value for CPU "x86" instead of "i386" - -2002-11-27 Alain Magloire - - * model/.../cdt/core/model/CoreModel.java: - Remove the static qualifiers and force people to use getDefault(). - (getBinaryParserFormat): New method to retrieve the format of a project. - (setBinaryParserFormat): New method to set the format of a project. - (getDefaultBinaryParserFormat): New method to retrieve the default format. - (setDefaultBinaryParserFormat): New method to set the default format. - * model/.../cdt/core/model/IBinaryParser.java: Move to be is the src directory. - * model/.../cdt/core/model/ICElementDelta.java: New Flag for the binary parser. - * model/.../internal/core/model/parser/BinaryContainerAdapter.java: - * model/.../internal/core/model/parser/BinaryFileAdapter.java: - * model/.../internal/core/model/parser/ElfBinaryArchive.java: - * model/.../internal/core/model/parser/ElfBinaryFile.java: - * model/.../internal/core/model/parser/PEBinaryArchive.java: - * model/.../internal/core/model/parser/PEBinaryFile.java: - * model/.../internal/core/model/parser/PEParser.java: - * model/.../internal/core/model/parser/ElfParser.java: - * model/.../internal/core/model/parser/Symbol.java: - * model/.../internal/core/model/ArchiveInfo.java: - * model/.../internal/core/model/BinaryInfo.java: - Organize imports. - * model/.../internal/core/model/CElementDelta.java (binaryParserChanged): - New method. - * model/.../internal/core/model/CModelManager.java (releaseCElement): - Remove the children of a container in the hashmap. - (getDefaultBinaryParserFormat): Return the default format. - (setDefaultBinaryParserFormat): set the default format. - (setBinaryParserFormat): remove the all the children and fire a binary parser change. - - * src/../cdt/core/CCorePlugin.java (getBinaryParserConfigurations): - New method to search for the extension points. - * src/../cdt/core/IBinaryParser.java: New file - * src/../cdt/core/IBinaryParserConfiguration.java: New file - * src/../internal/cdt/core/BinaryParserConfiguration.java: New file - - * plugin.xml: Binary parsers extension points. - - -2002-11-23 Alain Magloire - - * model/.../cdt/core/model/CoreModel.java (getBinaryParser): - New methods to retrieve the parser for a project. - * model/.../cdt/core/model/IBinaryParser.java (getFormat): - New method return the format supported. - * model/.../internal/core/model/CModelManager.java (getBinaryParser): - New methods to retrieve the parser for a project. - * model/.../internal/core/model/parser/ElfBinaryFile.java: - Move the Symbol class out so it can be shared. - * model/.../internal/core/model/parser/ElfParser.java (getFormat): - New method. - * model/.../internal/core/model/parser/PEBinaryArchive.java: New file. - * model/.../internal/core/model/parser/PEBinaryFile.java: New file. - * model/.../internal/core/model/parser/PEParser.java: New file. - * model/.../internal/core/model/parser/Symbol.java: New file. - - * src/.../cdt/core/CCorePlugin.java (getBinaryParser): - New Methods to retrieve the extension-point. - - * utils/.../cdt/utils/coff/Coff.java : - Parse the symbols. - * utils/.../cdt/utils/coff/PE.java (getAttribute): - New helper method/class Attribute. - * utils/.../cdt/utils/coff/PEArchive.java : - New File. - * utils/.../cdt/utils/elf/AR.java (finalize): - Make sure we do not leak fds. - * utils/.../cdt/utils/elf/Elf.java (finalize): - Make sure we do not leak fds. - - * plugin.xml: Define two "parser" extension-point. - - -2002-11-22 Alain Magloire - - * src/.../cdt/core/CommandLauncher.java (waitAndRead): - Make sure we drain the pipes. - (printCommandLine): Use the line.separator property. - * src/org/eclipse/cdt/ErrorParserManager.java - Check if outputStream is not null before using it. - (write): must be synchronized. - (checkLine): Break the buffer per line and pass it to processLine(). - Takes an argument to flush when we are done(on close()). - * src/.../internal/core/CBuilder.java (invokeMake): - We have to call close() the same number of times we call - ErrorParserManager.getOutputStream(). Move the ErrorParerManager.reportProblem() - after the close. - * src/.../internal/CCorePluginResources.properties: Updated. - -2002-11-22 Alain Magloire - - The C Builder on error would clear the build. - The side effect of that is on every BuildAll - or Rebuild on the workspace, it will try to - rebuild the projects since it has not states. - It seems to work fine for JDT, where the builder - has full control and can quickly make a decision - The situation is not the same for the CDT, where we - spawn an external tool (make) even if nothing changes - i.e. the Makefiles rules when properly done will see, - it still seems sloppy. So we remove this behaviour. - - * src/.../internal/core/CBuilder.java (invokeMake): - Not to clear the state when errors. - -2002-11-22 Alain Magloire - - * src/.../cdt/core/model/IBinary.java (isCore): - New method. - * src/.../cdt/core/model/IBinaryParser.java (CORE): - New type core. - * src/.../internal/core/model/parser/ElfBinaryFile.java (getType): - case for CORE. - * src/.../internal/core/model/Binary.java (isCore): - New method. - * src/.../internal/core/model/BinaryInfo.java (isCore): - New method. - * src/.../internal/core/model/CModelManager.java (isBinary): - Check for core. - * util/.../utils/elf/Elf.java (getAttributes): Check for Core. - -2002-11-22 David Inglis - * src/.../cdt/core/CommandLauncher.java: - Make CommandLauncher.waitAndRead do the stream writing, since ui components - process this stream, and this method may be call in a ui thread. - -2002-11-20 David Inglis - * src/.../internal/core/CBuilder.java: - fix AUTO_BUILDs so that the builder only builds when the resources change - in the project. - -2002-11-20 David Inglis - * plugin.xml - fixed bug #26640 - -2002-11-19 Alain Magloire - - * src/.../internal/core/model/CModelManager.java (resourceChanged): - Do nothing for PRE_DELETE and PRE_BUILD events for now. - -2002-11-16 Alain Magloire - - * src/.../model/IBinaryParser.java: New Interface for Binary parsers - extension-points. - * src/.../model/ICElement.java (getResource): New method added. - * src/.../internal/core/model/parser/BinaryContainerAdapter.java: - New file adapting an archive to a IContainer. - * src/.../internal/core/model/parser/BinaryFiledapter.java: - New file adapting a binary to a IFile. - * src/.../internal/core/model/parser/ElfBinaryArchive.java: - New file implements IBinaryArchive. - * src/.../internal/core/model/parser/ElfBinaryFile.java: - New file implements IBinaryObject etc ... - * src/.../internal/core/model/parser/ElfBinaryFile.java: - New file implements IBinaryParser. - * src/.../internal/core/model/Archive.java (isArchive): Removed. - (getResource): Added. - * src/.../internal/core/model/ArchiveContainer.java (getChildren): - Use new method CProject.setBinaryRunner(). - * src/.../internal/core/model/ArchiveInfo.java: - rewritten to use IBinarParser interface. - * src/.../internal/core/model/BinaryContainer.java (getChildren): - Use new method CProject.setBinaryRunner(). - * src/.../internal/core/model/BinaryInfo.java: - rewritten to use IBinarParser interface. - * src/.../internal/core/model/BinaryRunner.java: New File - replace the ElfRunner.java. - * src/.../internal/core/model/CProject.java: Rename the function - with *Elf* Binary. - * src/.../internal/core/model/ElfRunner.java: Rename to BinaryRunner.java - * src/.../internal/core/model/CElement.java: Use getResource() instead of - getCorrespondingResource(). - * src/.../internal/core/model/CModelManager.java (ReleaseCElement): - Bug fix was not passing the key to hash.remove(). - (isShared): Use IBinaryParser. - (isExecutable): Use IBinaryParser. - (isArchive): Use IBinaryParser. - * src/.../internal/core/model/Container.java: New file - * src/.../internal/core/model/Resource.java: New file - * src/.../internal/core/model/Marker.java: New file - * src/.../internal/core/model/SourceManipulation.java (getResource): New method. - * src/.../internal/core/model/Parent.java (getResource): New method. - * plugin.xml: Indentation. - - - -2002-11-13 Alain Magloire - - * src/.../internal/errorparsers/GCCErrorParser.java (processLine): - Remove the "warning :" prepend substring since the error is already mark. - Remove debuging println()s. - -2002-11-13 Alain Magloire - - * src/.../internal/errorparsers/GCCErrorParser.java (processLine): - Fix check if the column is valid i.e. a number. - -2002-11-13 Judy Green - - *src/org/eclipse/cdt/core/CCProjectNature.java - added configure() to overwrite CNatures implementation which adds a default CBuilder. - We now check that a project having a CCNature added already has a CNature - Throws a CoreException if not. - - *src/org/eclipse/cdt/core/CCorePlugin.java - Added a static va CDT_PROJECT_NATURE_ID_MISMATCH to indicate the condition - described above in configure() - - Cleaned up the convert methods to ensure that extra calls to add a - CBuilder are not called. - -2002-11-13 Alain Magloire - - * src/.../internal/errorparsers/GCCErrorParser.java (processLine): - The full semantics seems to be: - filename:lineno:column:error_description - we did not take to account that the preprocessor - was putting the column also. - -2002-11-13 Alain Magloire - - * src/.../internal/core/CBuilder.java (invokeMake): - Always parse the argument for errors even when the - build was cancelled. - -2002-11-12 Alain Magloire - - * index/.../internal/core/index/CTagsRunner.java (run): - Remove the quick start code, not necessary. - * index/.../core/index/IndexModel.java (setEnabled): - Check if it was already enabled. - -2002-11-12 Alain Magloire - - * index/.../internal/core/index/IndexManager.java (removeConatiner): - Change the signature of the function to take IContainer. - (removeResource): Also remove the request from the requestList. - * index/.../internal/core/index/RequestList.java (removeItem): - new method. - -2002-11-12 Alain Magloire - - * index/.../core/index/IndexModel.java (isEnabled): - New method check if indexing is enable for a project. - (setEnabled) : enable/disable indexing for a project. - (removeResource): New method, remove resource from the list. - * index/.../internal/core/index/IndexManager.java (addContainer): - Check if resource is enable for indexing. - (addFile): Check if resource is enable for indexing. - - -2002-11-12 David Inglis - - * model/.../internal/core/model/CModelManager.java,v - fixed model.create(IPath) method so it returns a element which - actually exits - -2002-11-08 Judy N. Green - * src/org/eclipse/cdt/internal/core/COwner.java - fixed check in constructor to throw error when ownerID is invalid - - * src/org/eclipse/cdt/internal/core/CDescriptor.java - made all constants static and changed visibility of DESCRIPTION_FILE_NAME - to package to be used by tge CDescriptorManager - - * src/org/eclipse/cdt/internal/core/CDescriptorManager.java - Added to event in order to catch when the .cdtprject file is deleted. - delete reference to the CDT project Descriptor when a missing file is detected. - - Added new public method removeExistingCdtProjectFile(IProject project), required when converting a project. - -2002-11-06 Alain Magloire - - * src/org/eclipse/cdt/ErrorParserManager.java (parse): - Unused code removed. - (checkLine): String.trim() the line to remove trailing - newline. - * src/org/eclipse/cdt/internal/errorparser/MakeErrorParser.java (processLine): - When there is no resources set the lineno to -1. - -2002-11-06 David Inglis - * index/org/eclipse/cdt/internal/core/index/CTagsRunner.java - fixed NPE when projects are deleted. - - * src/org/eclipse/cdt/core/ErrorParserManager.java - fixed NPE when file exits outside of workspace - - * utils/org/eclipse/cdt/utils/elf/Elf.java - fixed out of memory failure on bad elf files - -2002-11-06 Alain Magloire - - Deal with some issues of PR 25756. - - * src/.../internal.errorparsers.java (processLine): - When the file is not found append not prepend the name - of the file in the description. - The check for "(Each undeclared ...)" was done at the - wrong place. - - * src/.../ErrorParserManager.java (findFileName): - Check if the file is absolute or relative. - -2002-11-05 Alain Magloire - - * utils/.../utils/coff: New folder. - * utils/.../utils/coff/Coff.java: First implementation - of a generic COFF binary file parser. - * utils/.../utils/coff/Exe.java: First implementation of - a generic EXE binary file parser. - * utils/.../utils/PE.java: First implementation of a generic - PE coff format parser. - -2002-11-05 Alain Magloire - - * src/.../ErrorParserManager.java (parse): - Trim the line of unwanted trailing spaces. - -2002-11-01 Alain Magloire - - * model/../internal/core/mode/CProject.java (findElement): - Check if the path is Absolute or relative before creating the - element. - -2002-11-01 David Inglis - - * utils/org/eclipse/cdt/utils/elf/Elf.java - change getCPU to return cpu only and not append endian ("le" or "be"). - -2002-10-31 Alain Magloire - - * src/.../ErrorParserManager.java (findFilePath): - Check if the file exists to not to return a phantom resource. - -2002-10-30 Alain Magloire - - * src/.../CProjectNature.java (removeNature): Utility - function to remove a nature from a project. - (removeCNature): Utility method to remove the C Nature. - * src/.../CCProjectNature.java (removeCCNature): Utility - method to remove the CC nature. - -2002-10-25 Alain Magloire - - * index/.../internal/core/index/CTagsCmd.java: Indentation. - * index/.../internal/core/index/CTagsRunner.java: Implements Runnable. - * index/.../internal/core/index/IndexManager.java (init): - Set the indexer thread, thread.setDaemon(true). - -2002-10-28 David Inglis - - * src/.../core/resources/ACBuilder.java - Added check for duplicate markers. - * src/.../internal/core/CBuilder.java - Added check for canceled build and throws OperationCanceledException exception - -2002-10-25 Alain Magloire - - The debugger needs to know the endian of a binary. For example - int the memory view, to do format. - - * model/.../model/IBinary (isLittleEndian): New method - returns the endian. - * model/.../internal/core/model/Binary.java (isLittleEndian): New method. - * model/.../internal/core/model/BinaryInfo.java (isLittleEndian): New - method implemented by calling Elf. - * utils/.../utils/elf/Elf.java (Elf.Attribute.isLittleEndian): New - method return the endian. - -2002-10-23 Alain Magloire - - * src/.../core/resource/ACBuilder.java (mapMarkerSeverity): - New method to convert IMarkerGenerator to IMarker. - * src/.../core/ErrorParserManager.java: New file. - * src/.../core/IErrorParser.java: New file. - * src/.../core/IMarkerGenerator.java: Define a set of new fields: - IMarkerGenerator.SEVERITY_INFO - IMarkerGenerator.SEVERITY_WARNING - IMarkerGenerator.SEVERITY_ERROR_RESOURCE - IMarkerGenerator.SEVERITY_ERROR_BUILD - IMarkerGenerator.SEVERITY_INFO - * src/.../core/erroparsers: Removed - * src/.../core/erroparsers/ErrorParserManager.java: Removed - * src/.../core/erroparsers/IErrorParser.java: Removed - * src/.../internal/core/CBuilder.java (invokeMake): new field - fatalBuild to check return of ErrorParserManager.reporProblems(). - * src/.../internal/core/ProcessClosure.java (isAlive): the test - shoule be an || the errorstream __or__ the outputstream thread - is alive. - * src/.../internal/errorparsers/GASErrorParser.java (processLine): - * src/.../internal/errorparsers/GCCErrorParser.java (processLine): - * src/.../internal/errorparsers/GLDErrorParser.java (processLine): - * src/.../internal/errorparsers/VCErrorParser.java (processLine): - Use the IMarkerGenerator fields. - * src/.../internal/errorparsers/MakeErrorParser.java (processLine): - Catch GNU Make build errors, something like: - "make: *** No targets specified and no makefile found. Stop." - -2002-10-23 David Inglis - - Error parsing is now done as the streams from the commands - are read, this reduces memory usage during the build - process, and we can now add options to the build console to - only keep 'n' lines of output, again reducing the memory - usage. Also refactored IErrorParser and ErrorParserManager out - of internal. - - * src/.../errorparser/ErrorParserManager.java: - * src/.../errorparser/IErrorParser.java: - * src/.../internal/errorparser/GASErrorParser.java: - * src/.../internal/errorparser/GCCErrorParser.java: - * src/.../internal/errorparser/GLDErrorParser.java: - * src/.../internal/errorparser/MakeErrorParser.java: - * src/.../internal/errorparser/VCErrorParser.java: - * src/.../internal/core/CBuilder.java: - * src/.../internal/core/ProcessCloseure.java: - * src/.../core/ConsoleOutputStream.java: - - -2002-10-22 Alain Magloire - - * src/.../internal/parser/LinePositionInputStream.java: - We use a BufferedInputStream to limit the number of reads. - -2002-10-16 Alain Magloire - - Some of the native functions were throwing exceptions - particularly on the windows platform and it was not - clearly advertise. Eclipse uses a tool to externalize strings, - to prevent this, strings need a comment "//$NON-NLS-1$". - - This also incorporated some fixes by Alex Chapiro, in - Spawner.Reaper Thread an exception can be thrown for - example if the application does not exist, the reaper - thread will catch the IOException an notify spawner of - the failure by setting pid = -1; - - * utils/../utils/pty/PTYInputStream.java (close0): - Advertise that we can throw an IOException. - * utils/../utils/pty/PTYOutputStream.java (close): Put - the "$NON-NLS-1$" magic. - (write0): Advertise we can throw IOException. - (close0): Advertise we can throw IOException. - * utils/../utils/spawner/ProcessFactory.java: Reformat. - * utils/../utils/spawner/Spawner.java (Reaper): - The run method when calling exec0 did not catch the exception. - And the waitFor() should not be done on a pid == -1; - * utils/../utils/spawner/SpawnerInputStream.java: Reformat. - * utils/../utils/spawner/SpawnerOutputStream.java: Reformat. - -2002-10-15 Alain Magloire - - By making the native methods package scope, the - compiler will not generate synthetic accessor - methods to access them in the Reaper inner class - - * utils/../utils/spawner/Spawner.java (exec0): - (exec1): Change scope to be package. - (raise): Change scope to be package. - (waitFor): Change scope to be package. - -2002-10-13 Alain Magloire - - Boosting the compiler error level to get unused imports. - - * model/../internal/core/model/ArchiveContainer.java: - * model/../core/model/BinaryContainer.java: - * model/../core/model/CElementDelta.java: - * model/../core/model/CModelManager.java: - * model/../core/model/CResourceInfo.java: - Remove unused imports. - - * src/../core/resources/ACBuilder.java: - * src/../internal/core/CBuilder.java: - Remove unused imports. - -2002-10-15 David Inglis - * model/../core/model/CoreModel.java - * model/../internal/core/model/CModelManager.java - * model/../internal/core/model/CModelStatus.java - - Clean up model - - removed plugin and nature id from model - refernce core plugin and nature classes for ID. - - removed unsed methods in model for adding/removing - natures. - -2002-10-15 David Inglis - * src/../internal/core/CBuilder.java - - Fixed builder to return referenced projects so that eclipse - builder will build increamentaly build projects when they change. - Handle "clean" target as special so the build state is cleared allowing - the next increamental build to come in as a full build. - diff --git a/core/org.eclipse.cdt.core/about.html b/core/org.eclipse.cdt.core/about.html deleted file mode 100644 index 8c828de2ada..00000000000 --- a/core/org.eclipse.cdt.core/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

    About This Content

    - -

    10th July, 2002

    -

    License

    -

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

    - -

    Contributions

    - -

    If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

    - -

    If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

    - - - \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/build.properties b/core/org.eclipse.cdt.core/build.properties deleted file mode 100644 index 6801ee61f26..00000000000 --- a/core/org.eclipse.cdt.core/build.properties +++ /dev/null @@ -1,37 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - cdtparser.jar,\ - cdtcore.jar,\ - .options -jars.compile.order = cdtparser.jar,\ - cdtcore.jar -src.includes = about.html,\ - schema/,\ - ChangeLog,\ - build.properties,\ - utils/,\ - src/,\ - search/,\ - plugin.xml,\ - plugin.properties,\ - parser/,\ - model/,\ - index/,\ - doc/,\ - dependency/,\ - .options -javadoc.packages = org.eclipse.cdt.core.*,\ - org.eclipse.cdt.core.index.*,\ - org.eclipse.cdt.core.model.*,\ - org.eclipse.cdt.core.resources.*,\ - org.eclipse.cdt.utils.*,\ - org.eclipse.cdt.utils.elf.*,\ - org.eclipse.cdt.utils.spawner.* -source.cdtcore.jar = index/,\ - model/,\ - src/,\ - utils/,\ - search/,\ - dependency/ -source.cdtparser.jar = parser/ diff --git a/core/org.eclipse.cdt.core/dependency/ChangeLog b/core/org.eclipse.cdt.core/dependency/ChangeLog deleted file mode 100644 index fc524c19ee5..00000000000 --- a/core/org.eclipse.cdt.core/dependency/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -2003-11-10 Bogdan Gheorghe - - Added a null resource check in UpdateDependency to fix up - a potential NPE in the test suite - -2003-10-23 Bogdan Gheorghe - - Added UpdateDependency job - -2003-09-25 Bogdan Gheorghe - - As a result of folding the dependency service into the indexer - have removed the following files: - - * src/org/eclipse/cdt/internal/core/sourcedependency/AddFileToDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyManager.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequest.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequestor.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencySelector.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/EntireProjectDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/IDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/IPreprocessorOutput.java - * src/org/eclipse/cdt/internal/core/sourcedependency/ISourceDependency.java - * src/org/eclipse/cdt/internal/core/sourcedependency/PreprocessorOutput.java - * src/org/eclipse/cdt/internal/core/sourcedependency/RemoveFromDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntry.java - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntryHashedArray.java - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/InMemoryTree.java - - - -2003-09-22 Bogdan Gheorghe - - Took out enable section for DependencyManager - -2003-09-11 Bogdan Gheorghe - - Added null guard to DependencyManager.getDependencyTree(), - DependencyTree.getFileDependencies() - -2003-09-08 Andrew Niefer - - Modified calls to ParserFactory to specify which language to use - - Modified IDependencyTree.add to take ParserLanguage as a parameter so that it can - be passed on when creating the preprocessor - -2003-07-23 Bogdan Gheorghe - - Added initial dependency implementation - - * src/org/eclipse/cdt/internal/core/sourcedependency/AddFileToDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyManager.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DenpendencyQueryJob.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequest.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequestor.java - * src/org/eclipse/cdt/internal/core/sourcedependency/DependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/EntireProjectDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/IDependencyTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/IPreprocessorOutput.java - * src/org/eclipse/cdt/internal/core/sourcedependency/ISourceDependency.java - * src/org/eclipse/cdt/internal/core/sourcedependency/PreprocessorOutput.java - - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntry.java - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntryHashedArray.java - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/InMemoryTree.java - * src/org/eclipse/cdt/internal/core/sourcedependency/impl/Node.java - -- - \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/DependencyQueryJob.java b/core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/DependencyQueryJob.java deleted file mode 100644 index be478daf835..00000000000 --- a/core/org.eclipse.cdt.core/dependency/org/eclipse/cdt/internal/core/sourcedependency/DependencyQueryJob.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Created on Jul 23, 2003 - */ -package org.eclipse.cdt.internal.core.sourcedependency; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.impl.BlocksIndexInput; -import org.eclipse.cdt.internal.core.index.impl.IFileDocument; -import org.eclipse.cdt.internal.core.index.impl.IncludeEntry; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IndexSelector; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.indexing.ReadWriteMonitor; -import org.eclipse.cdt.internal.core.search.processing.IJob; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; - -/** - * @author bgheorgh - */ -public class DependencyQueryJob implements IJob { - - IProject project; - IFile file; - ArrayList includeFiles; - IndexManager indexManager; - protected IndexSelector indexSelector; - protected long executionTime = 0; - - public DependencyQueryJob(IProject project, IFile file, IndexManager inMan, List includeFiles) { - this.project = project; - this.file = file; - this.indexManager = inMan; - this.includeFiles = (ArrayList) includeFiles; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.processing.IJob#belongsTo(java.lang.String) - */ - public boolean belongsTo(String jobFamily) { - // TODO Auto-generated method stub - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.processing.IJob#cancel() - */ - public void cancel() {} - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.processing.IJob#execute(org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean execute(IProgressMonitor progressMonitor) { - if ((project == null) ||(file == null)) return false; - // - if (progressMonitor != null && progressMonitor.isCanceled()) - throw new OperationCanceledException(); - boolean isComplete = COMPLETE; - executionTime = 0; - if (this.indexSelector == null) { - this.indexSelector = - new IndexSelector(SearchEngine.createWorkspaceScope(), null, false, this.indexManager); - } - IIndex[] searchIndexes = this.indexSelector.getIndexes(); - try { - int max = searchIndexes.length; - if (progressMonitor != null) { - progressMonitor.beginTask("", max); //$NON-NLS-1$ - } - for (int i = 0; i < max; i++) { - isComplete &= getFileDeps(searchIndexes[i], progressMonitor); - if (progressMonitor != null) { - if (progressMonitor.isCanceled()) { - throw new OperationCanceledException(); - } else { - progressMonitor.worked(1); - } - } - } - if (JobManager.VERBOSE) { - JobManager.verbose("-> execution time: " + executionTime + "ms - " + this);//$NON-NLS-1$//$NON-NLS-2$ - } - return isComplete; - } finally { - if (progressMonitor != null) { - progressMonitor.done(); - } - } - } - - /** - * @param index - * @param progressMonitor - * @return - */ - public boolean getFileDeps(IIndex index, IProgressMonitor progressMonitor){ - - if (progressMonitor != null && progressMonitor.isCanceled()) - throw new OperationCanceledException(); - -// IIndex inMemIndex = indexManager.peekAtIndex(new Path(((Index)index).toString.substring("Index for ".length()).replace('\\','/'))); -// if (inMemIndex != index) { -// System.out.println("SANITY CHECK: search job using obsolete index: ["+index+ "] instead of: ["+inMemIndex+"]"); -// } - - if (index == null) - return COMPLETE; - ReadWriteMonitor monitor = indexManager.getMonitorFor(index); - if (monitor == null) - return COMPLETE; // index got deleted since acquired - try { - monitor.enterRead(); // ask permission to read - - /* if index has changed, commit these before querying */ - if (index.hasChanged()) { - try { - monitor.exitRead(); // free read lock - monitor.enterWrite(); // ask permission to write - this.indexManager.saveIndex(index); - } catch (IOException e) { - return FAILED; - } finally { - monitor.exitWriteEnterRead(); // finished writing and reacquire read permission - } - } - long start = System.currentTimeMillis(); - // - IndexInput input = new BlocksIndexInput(index.getIndexFile()); - try { - input.open(); - findDep(input); - } finally { - input.close(); - } - // - //String[] tempFiles = this.indexManager.getFileDependencies(project,file); -// if (tempFiles != null){ -// System.out.println("DQJOB File Deps : " + tempFiles.length); -// for (int i=0; iPreferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.sourcedependency; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.search.PathCollector; -import org.eclipse.cdt.internal.core.search.PatternSearchJob; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.matching.CSearchPattern; -import org.eclipse.cdt.internal.core.search.processing.IJob; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -/** - * @author bgheorgh - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class UpdateDependency implements IJob { - PathCollector pathCollector; - IResource resource; - - /** - * @param resource - */ - public UpdateDependency(IResource resource) { - this.resource = resource; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.processing.IJob#belongsTo(java.lang.String) - */ - public boolean belongsTo(String jobFamily) { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.processing.IJob#cancel() - */ - public void cancel() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.processing.IJob#execute(org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean execute(IProgressMonitor progress) { - if (resource == null) return false; - - PathCollector pathCollector = new PathCollector(); - //SubProgressMonitor subMonitor = (progressMonitor == null ) ? null : new SubProgressMonitor( progressMonitor, 5 ); - ICSearchScope scope = SearchEngine.createWorkspaceScope(); - CSearchPattern pattern = CSearchPattern.createPattern(resource.getLocation().toOSString(),ICSearchConstants.INCLUDE, ICSearchConstants.REFERENCES,ICSearchConstants.EXACT_MATCH,true); - IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); - indexManager.performConcurrentJob( - new PatternSearchJob( - (CSearchPattern) pattern, - scope, - pathCollector, - indexManager - ), - ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, - null, - this ); - - String[] iPath = pathCollector.getPaths(); - for (int i=0;i - *
    - * For example:
    - *
      - *
    1. -	 *    array = { 'a', 'b' }
      -	 *    suffix = 'c'
      -	 *    => result = { 'a', 'b' , 'c' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = null
      -	 *    suffix = 'c'
      -	 *    => result = { 'c' }
      -	 * 
    4. - *
    - * - * @param array the array that is concanated with the suffix character - * @param suffix the suffix character - * @return the new array - */ - public static final char[] append(char[] array, char suffix) { - if (array == null) - return new char[] { suffix }; - int length = array.length; - System.arraycopy(array, 0, array = new char[length + 1], 0, length); - array[length] = suffix; - return array; - } - /** - * Append the given subarray to the target array starting at the given index in the target array. - * The start of the subarray is inclusive, the end is exclusive. - * Answers a new target array if it needs to grow, otherwise answers the same target array. - *
    - * For example:
    - *
      - *
    1. -	 *    target = { 'a', 'b', '0' }
      -	 *    index = 2
      -	 *    array = { 'c', 'd' }
      -	 *    start = 0
      -	 *    end = 1
      -	 *    => result = { 'a', 'b' , 'c' }
      -	 * 
      - *
    2. - *
    3. -	 *    target = { 'a', 'b' }
      -	 *    index = 2
      -	 *    array = { 'c', 'd' }
      -	 *    start = 0
      -	 *    end = 1
      -	 *    => result = { 'a', 'b' , 'c', '0', '0' , '0' } (new array)
      -	 * 
    4. - *
    5. -	 *    target = { 'a', 'b', 'c' }
      -	 *    index = 1
      -	 *    array = { 'c', 'd', 'e', 'f' }
      -	 *    start = 1
      -	 *    end = 4
      -	 *    => result = { 'a', 'd' , 'e', 'f', '0', '0', '0', '0' } (new array)
      -	 * 
    6. - *
    - * - * @param target the given target - * @param index the given index - * @param array the given array - * @param start the given start index - * @param end the given end index - * - * @return the new array - * @throws NullPointerException if the target array is null - */ - public static final char[] append(char[] target, int index, char[] array, int start, int end) { - int targetLength = target.length; - int subLength = end-start; - int newTargetLength = subLength+index; - if (newTargetLength > targetLength) { - System.arraycopy(target, 0, target = new char[newTargetLength*2], 0, index); - } - System.arraycopy(array, start, target, index, subLength); - return target; - } - /** - * Answers the concatenation of the two arrays. It answers null if the two arrays are null. - * If the first array is null, then the second array is returned. - * If the second array is null, then the first array is returned. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = null
      -	 *    => result = null
      -	 * 
      - *
    2. - *
    3. -	 *    first = { { ' a' } }
      -	 *    second = null
      -	 *    => result = { { ' a' } }
      -	 * 
      - *
    4. - *
    5. -	 *    first = null
      -	 *    second = { { ' a' } }
      -	 *    => result = { { ' a' } }
      -	 * 
      - *
    6. - *
    7. -	 *    first = { { ' b' } }
      -	 *    second = { { ' a' } }
      -	 *    => result = { { ' b' }, { ' a' } }
      -	 * 
      - *
    8. - *
    - * - * @param first the first array to concatenate - * @param second the second array to concatenate - * @return the concatenation of the two arrays, or null if the two arrays are null. - */ - public static final char[][] arrayConcat(char[][] first, char[][] second) { - if (first == null) - return second; - if (second == null) - return first; - - int length1 = first.length; - int length2 = second.length; - char[][] result = new char[length1 + length2][]; - System.arraycopy(first, 0, result, 0, length1); - System.arraycopy(second, 0, result, length1, length2); - return result; - } - /** - * Answers a new array adding the second array at the end of first array. - * It answers null if the first and second are null. - * If the first array is null, then a new array char[][] is created with second. - * If the second array is null, then the first array is returned. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = { 'a' }
      -	 *    => result = { { ' a' } }
      -	 * 
      - *
    2. -	 *    first = { { ' a' } }
      -	 *    second = null
      -	 *    => result = { { ' a' } }
      -	 * 
      - *
    3. - *
    4. -	 *    first = { { ' a' } }
      -	 *    second = { ' b' }
      -	 *    => result = { { ' a' } , { ' b' } }
      -	 * 
      - *
    5. - *
    - * - * @param first the first array to concatenate - * @param second the array to add at the end of the first array - * @return a new array adding the second array at the end of first array, or null if the two arrays are null. - */ - public static final char[][] arrayConcat(char[][] first, char[] second) { - if (second == null) - return first; - if (first == null) - return new char[][] { second }; - - int length = first.length; - char[][] result = new char[length + 1][]; - System.arraycopy(first, 0, result, 0, length); - result[length] = second; - return result; - } - - /** - * Compares the contents of the two arrays array and prefix. Returns - *
      - *
    • zero if the array starts with the prefix contents
    • - *
    • the difference between the first two characters that are not equal
    • - *
    • one if array length is lower than the prefix length and that the prefix starts with the - * array contents.
    • - *
    - *

    - * For example: - *

      - *
    1. -	 *    array = null
      -	 *    prefix = null
      -	 *    => result = NullPointerException
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'a', 'b', 'c', 'd', 'e' }
      -	 *    prefix = { 'a', 'b', 'c'}
      -	 *    => result = 0
      -	 * 
      - *
    4. - *
    5. -	 *    array = { 'a', 'b', 'c', 'd', 'e' }
      -	 *    prefix = { 'a', 'B', 'c'}
      -	 *    => result = 32
      -	 * 
      - *
    6. - *
    7. -	 *    array = { 'd', 'b', 'c', 'd', 'e' }
      -	 *    prefix = { 'a', 'b', 'c'}
      -	 *    => result = 3
      -	 * 
      - *
    8. - *
    9. -	 *    array = { 'a', 'b', 'c', 'd', 'e' }
      -	 *    prefix = { 'd', 'b', 'c'}
      -	 *    => result = -3
      -	 * 
      - *
    10. - *
    11. -	 *    array = { 'a', 'a', 'c', 'd', 'e' }
      -	 *    prefix = { 'a', 'e', 'c'}
      -	 *    => result = -4
      -	 * 
      - *
    12. - *
    - *

    - * - * @param array the given array - * @param prefix the given prefix - * @return the result of the comparison - * @exception NullPointerException if either array or prefix is null - */ - public static final int compareWith(char[] array, char[] prefix) { - int arrayLength = array.length; - int prefixLength = prefix.length; - int min = Math.min(arrayLength, prefixLength); - int i = 0; - while (min-- != 0) { - char c1 = array[i]; - char c2 = prefix[i++]; - if (c1 != c2) - return c1 - c2; - } - if (prefixLength == i) - return 0; - return 1; - } - /** - * Answers the concatenation of the two arrays. It answers null if the two arrays are null. - * If the first array is null, then the second array is returned. - * If the second array is null, then the first array is returned. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = { 'a' }
      -	 *    => result = { ' a' }
      -	 * 
      - *
    2. - *
    3. -	 *    first = { ' a' }
      -	 *    second = null
      -	 *    => result = { ' a' }
      -	 * 
      - *
    4. - *
    5. -	 *    first = { ' a' }
      -	 *    second = { ' b' }
      -	 *    => result = { ' a' , ' b' }
      -	 * 
      - *
    6. - *
    - * - * @param first the first array to concatenate - * @param second the second array to concatenate - * @return the concatenation of the two arrays, or null if the two arrays are null. - */ - public static final char[] concat(char[] first, char[] second) { - if (first == null) - return second; - if (second == null) - return first; - - int length1 = first.length; - int length2 = second.length; - char[] result = new char[length1 + length2]; - System.arraycopy(first, 0, result, 0, length1); - System.arraycopy(second, 0, result, length1, length2); - return result; - } - /** - * Answers the concatenation of the three arrays. It answers null if the three arrays are null. - * If first is null, it answers the concatenation of second and third. - * If second is null, it answers the concatenation of first and third. - * If third is null, it answers the concatenation of first and second. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = { 'a' }
      -	 *    third = { 'b' }
      -	 *    => result = { ' a', 'b' }
      -	 * 
      - *
    2. - *
    3. -	 *    first = { 'a' }
      -	 *    second = null
      -	 *    third = { 'b' }
      -	 *    => result = { ' a', 'b' }
      -	 * 
      - *
    4. - *
    5. -	 *    first = { 'a' }
      -	 *    second = { 'b' }
      -	 *    third = null
      -	 *    => result = { ' a', 'b' }
      -	 * 
      - *
    6. - *
    7. -	 *    first = null
      -	 *    second = null
      -	 *    third = null
      -	 *    => result = null
      -	 * 
      - *
    8. - *
    9. -	 *    first = { 'a' }
      -	 *    second = { 'b' }
      -	 *    third = { 'c' }
      -	 *    => result = { 'a', 'b', 'c' }
      -	 * 
      - *
    10. - *
    - * - * @param first the first array to concatenate - * @param second the second array to concatenate - * @param third the third array to concatenate - * - * @return the concatenation of the three arrays, or null if the three arrays are null. - */ - public static final char[] concat( - char[] first, - char[] second, - char[] third) { - if (first == null) - return concat(second, third); - if (second == null) - return concat(first, third); - if (third == null) - return concat(first, second); - - int length1 = first.length; - int length2 = second.length; - int length3 = third.length; - char[] result = new char[length1 + length2 + length3]; - System.arraycopy(first, 0, result, 0, length1); - System.arraycopy(second, 0, result, length1, length2); - System.arraycopy(third, 0, result, length1 + length2, length3); - return result; - } - /** - * Answers the concatenation of the two arrays inserting the separator character between the two arrays. - * It answers null if the two arrays are null. - * If the first array is null, then the second array is returned. - * If the second array is null, then the first array is returned. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = { 'a' }
      -	 *    separator = '/'
      -	 *    => result = { ' a' }
      -	 * 
      - *
    2. - *
    3. -	 *    first = { ' a' }
      -	 *    second = null
      -	 *    separator = '/'
      -	 *    => result = { ' a' }
      -	 * 
      - *
    4. - *
    5. -	 *    first = { ' a' }
      -	 *    second = { ' b' }
      -	 *    separator = '/'
      -	 *    => result = { ' a' , '/', 'b' }
      -	 * 
      - *
    6. - *
    - * - * @param first the first array to concatenate - * @param second the second array to concatenate - * @param separator the character to insert - * @return the concatenation of the two arrays inserting the separator character - * between the two arrays , or null if the two arrays are null. - */ - public static final char[] concat( - char[] first, - char[] second, - char separator) { - if (first == null) - return second; - if (second == null) - return first; - - int length1 = first.length; - if (length1 == 0) - return second; - int length2 = second.length; - if (length2 == 0) - return first; - - char[] result = new char[length1 + length2 + 1]; - System.arraycopy(first, 0, result, 0, length1); - result[length1] = separator; - System.arraycopy(second, 0, result, length1 + 1, length2); - return result; - } - /** - * Answers the concatenation of the three arrays inserting the sep1 character between the - * two arrays and sep2 between the last two. - * It answers null if the three arrays are null. - * If the first array is null, then it answers the concatenation of second and third inserting - * the sep2 character between them. - * If the second array is null, then it answers the concatenation of first and third inserting - * the sep1 character between them. - * If the third array is null, then it answers the concatenation of first and second inserting - * the sep1 character between them. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    sep1 = '/'
      -	 *    second = { 'a' }
      -	 *    sep2 = ':'
      -	 *    third = { 'b' }
      -	 *    => result = { ' a' , ':', 'b' }
      -	 * 
      - *
    2. - *
    3. -	 *    first = { 'a' }
      -	 *    sep1 = '/'
      -	 *    second = null
      -	 *    sep2 = ':'
      -	 *    third = { 'b' }
      -	 *    => result = { ' a' , '/', 'b' }
      -	 * 
      - *
    4. - *
    5. -	 *    first = { 'a' }
      -	 *    sep1 = '/'
      -	 *    second = { 'b' }
      -	 *    sep2 = ':'
      -	 *    third = null
      -	 *    => result = { ' a' , '/', 'b' }
      -	 * 
      - *
    6. - *
    7. -	 *    first = { 'a' }
      -	 *    sep1 = '/'
      -	 *    second = { 'b' }
      -	 *    sep2 = ':'
      -	 *    third = { 'c' }
      -	 *    => result = { ' a' , '/', 'b' , ':', 'c' }
      -	 * 
      - *
    8. - *
    - * - * @param first the first array to concatenate - * @param sep1 the character to insert - * @param second the second array to concatenate - * @param sep2 the character to insert - * @param third the second array to concatenate - * @return the concatenation of the three arrays inserting the sep1 character between the - * two arrays and sep2 between the last two. - */ - public static final char[] concat( - char[] first, - char sep1, - char[] second, - char sep2, - char[] third) { - if (first == null) - return concat(second, third, sep2); - if (second == null) - return concat(first, third, sep1); - if (third == null) - return concat(first, second, sep1); - - int length1 = first.length; - int length2 = second.length; - int length3 = third.length; - char[] result = new char[length1 + length2 + length3 + 2]; - System.arraycopy(first, 0, result, 0, length1); - result[length1] = sep1; - System.arraycopy(second, 0, result, length1 + 1, length2); - result[length1 + length2 + 1] = sep2; - System.arraycopy(third, 0, result, length1 + length2 + 2, length3); - return result; - } - /** - * Answers a new array with prepending the prefix character and appending the suffix - * character at the end of the array. If array is null, it answers a new array containing the - * prefix and the suffix characters. - *
    - *
    - * For example:
    - *
      - *
    1. -	 *    prefix = 'a'
      -	 *    array = { 'b' }
      -	 *    suffix = 'c'
      -	 *    => result = { 'a', 'b' , 'c' }
      -	 * 
      - *
    2. - *
    3. -	 *    prefix = 'a'
      -	 *    array = null
      -	 *    suffix = 'c'
      -	 *    => result = { 'a', 'c' }
      -	 * 
    4. - *
    - * - * @param prefix the prefix character - * @param array the array that is concanated with the prefix and suffix characters - * @param suffix the suffix character - * @return the new array - */ - public static final char[] concat(char prefix, char[] array, char suffix) { - if (array == null) - return new char[] { prefix, suffix }; - - int length = array.length; - char[] result = new char[length + 2]; - result[0] = prefix; - System.arraycopy(array, 0, result, 1, length); - result[length + 1] = suffix; - return result; - } - /** - * Answers the concatenation of the given array parts using the given separator between each - * part and appending the given name at the end. - *
    - *
    - * For example:
    - *
      - *
    1. -	 *    name = { 'c' }
      -	 *    array = { { 'a' }, { 'b' } }
      -	 *    separator = '.'
      -	 *    => result = { 'a', '.', 'b' , '.', 'c' }
      -	 * 
      - *
    2. - *
    3. -	 *    name = null
      -	 *    array = { { 'a' }, { 'b' } }
      -	 *    separator = '.'
      -	 *    => result = { 'a', '.', 'b' }
      -	 * 
    4. - *
    5. -	 *    name = { ' c' }
      -	 *    array = null
      -	 *    separator = '.'
      -	 *    => result = { 'c' }
      -	 * 
    6. - *
    - * - * @param name the given name - * @param array the given array - * @param separator the given separator - * @return the concatenation of the given array parts using the given separator between each - * part and appending the given name at the end - */ - public static final char[] concatWith( - char[] name, - char[][] array, - char separator) { - int nameLength = name == null ? 0 : name.length; - if (nameLength == 0) - return concatWith(array, separator); - - int length = array == null ? 0 : array.length; - if (length == 0) - return name; - - int size = nameLength; - int index = length; - while (--index >= 0) - if (array[index].length > 0) - size += array[index].length + 1; - char[] result = new char[size]; - index = size; - for (int i = length - 1; i >= 0; i--) { - int subLength = array[i].length; - if (subLength > 0) { - index -= subLength; - System.arraycopy(array[i], 0, result, index, subLength); - result[--index] = separator; - } - } - System.arraycopy(name, 0, result, 0, nameLength); - return result; - } - /** - * Answers the concatenation of the given array parts using the given separator between each - * part and appending the given name at the end. - *
    - *
    - * For example:
    - *
      - *
    1. -	 *    name = { 'c' }
      -	 *    array = { { 'a' }, { 'b' } }
      -	 *    separator = '.'
      -	 *    => result = { 'a', '.', 'b' , '.', 'c' }
      -	 * 
      - *
    2. - *
    3. -	 *    name = null
      -	 *    array = { { 'a' }, { 'b' } }
      -	 *    separator = '.'
      -	 *    => result = { 'a', '.', 'b' }
      -	 * 
    4. - *
    5. -	 *    name = { ' c' }
      -	 *    array = null
      -	 *    separator = '.'
      -	 *    => result = { 'c' }
      -	 * 
    6. - *
    - * - * @param array the given array - * @param name the given name - * @param separator the given separator - * @return the concatenation of the given array parts using the given separator between each - * part and appending the given name at the end - */ - public static final char[] concatWith( - char[][] array, - char[] name, - char separator) { - int nameLength = name == null ? 0 : name.length; - if (nameLength == 0) - return concatWith(array, separator); - - int length = array == null ? 0 : array.length; - if (length == 0) - return name; - - int size = nameLength; - int index = length; - while (--index >= 0) - if (array[index].length > 0) - size += array[index].length + 1; - char[] result = new char[size]; - index = 0; - for (int i = 0; i < length; i++) { - int subLength = array[i].length; - if (subLength > 0) { - System.arraycopy(array[i], 0, result, index, subLength); - index += subLength; - result[index++] = separator; - } - } - System.arraycopy(name, 0, result, index, nameLength); - return result; - } - /** - * Answers the concatenation of the given array parts using the given separator between each part. - *
    - *
    - * For example:
    - *
      - *
    1. -	 *    array = { { 'a' }, { 'b' } }
      -	 *    separator = '.'
      -	 *    => result = { 'a', '.', 'b' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = null
      -	 *    separator = '.'
      -	 *    => result = { }
      -	 * 
    4. - *
    - * - * @param array the given array - * @param separator the given separator - * @return the concatenation of the given array parts using the given separator between each part - */ - public static final char[] concatWith(char[][] array, char separator) { - int length = array == null ? 0 : array.length; - if (length == 0) - return CharOperation.NO_CHAR; - - int size = length - 1; - int index = length; - while (--index >= 0) { - if (array[index].length == 0) - size--; - else - size += array[index].length; - } - if (size <= 0) - return CharOperation.NO_CHAR; - char[] result = new char[size]; - index = length; - while (--index >= 0) { - length = array[index].length; - if (length > 0) { - System.arraycopy( - array[index], - 0, - result, - (size -= length), - length); - if (--size >= 0) - result[size] = separator; - } - } - return result; - } - /** - * Answers true if the array contains an occurrence of character, false otherwise. - * - *
    - *
    - * For example: - *
      - *
    1. -	 *    character = 'c'
      -	 *    array = { { ' a' }, { ' b' } }
      -	 *    result => false
      -	 * 
      - *
    2. - *
    3. -	 *    character = 'a'
      -	 *    array = { { ' a' }, { ' b' } }
      -	 *    result => true
      -	 * 
      - *
    4. - *
    - * - * @param character the character to search - * @param array the array in which the search is done - * @return true if the array contains an occurrence of character, false otherwise. - * @exception NullPointerException if array is null. - */ - public static final boolean contains(char character, char[][] array) { - for (int i = array.length; --i >= 0;) { - char[] subarray = array[i]; - for (int j = subarray.length; --j >= 0;) - if (subarray[j] == character) - return true; - } - return false; - } - /** - * Answers true if the array contains an occurrence of character, false otherwise. - * - *
    - *
    - * For example: - *
      - *
    1. -	 *    character = 'c'
      -	 *    array = { ' b'  }
      -	 *    result => false
      -	 * 
      - *
    2. - *
    3. -	 *    character = 'a'
      -	 *    array = { ' a' , ' b' }
      -	 *    result => true
      -	 * 
      - *
    4. - *
    - * - * @param character the character to search - * @param array the array in which the search is done - * @return true if the array contains an occurrence of character, false otherwise. - * @exception NullPointerException if array is null. - */ - public static final boolean contains(char character, char[] array) { - for (int i = array.length; --i >= 0;) - if (array[i] == character) - return true; - return false; - } - /** - * Answers a deep copy of the toCopy array. - * - * @param toCopy the array to copy - * @return a deep copy of the toCopy array. - */ - public static final char[][] deepCopy(char[][] toCopy) { - int toCopyLength = toCopy.length; - char[][] result = new char[toCopyLength][]; - for (int i = 0; i < toCopyLength; i++) { - char[] toElement = toCopy[i]; - int toElementLength = toElement.length; - char[] resultElement = new char[toElementLength]; - System.arraycopy(toElement, 0, resultElement, 0, toElementLength); - result[i] = resultElement; - } - return result; - } - /** - * Return true if array ends with the sequence of characters contained in toBeFound, - * otherwise false. - *
    - *
    - * For example: - *
      - *
    1. -	 *    array = { 'a', 'b', 'c', 'd' }
      -	 *    toBeFound = { 'b', 'c' }
      -	 *    result => false
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'a', 'b', 'c' }
      -	 *    toBeFound = { 'b', 'c' }
      -	 *    result => true
      -	 * 
      - *
    4. - *
    - * - * @param array the array to check - * @param toBeFound the array to find - * @return true if array ends with the sequence of characters contained in toBeFound, - * otherwise false. - * @exception NullPointerException if array is null or toBeFound is null - */ - public static final boolean endsWith(char[] array, char[] toBeFound) { - int i = toBeFound.length; - int j = array.length - i; - - if (j < 0) - return false; - while (--i >= 0) - if (toBeFound[i] != array[i + j]) - return false; - return true; - } - /** - * Answers true if the two arrays are identical character by character, otherwise false. - * The equality is case sensitive. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = null
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    first = { { } }
      -	 *    second = null
      -	 *    result => false
      -	 * 
      - *
    4. - *
    5. -	 *    first = { { 'a' } }
      -	 *    second = { { 'a' } }
      -	 *    result => true
      -	 * 
      - *
    6. - *
    7. -	 *    first = { { 'A' } }
      -	 *    second = { { 'a' } }
      -	 *    result => false
      -	 * 
      - *
    8. - *
    - * @param first the first array - * @param second the second array - * @return true if the two arrays are identical character by character, otherwise false - */ - public static final boolean equals(char[][] first, char[][] second) { - if (first == second) - return true; - if (first == null || second == null) - return false; - if (first.length != second.length) - return false; - - for (int i = first.length; --i >= 0;) - if (!equals(first[i], second[i])) - return false; - return true; - } - /** - * If isCaseSensite is true, answers true if the two arrays are identical character - * by character, otherwise false. - * If it is false, answers true if the two arrays are identical character by - * character without checking the case, otherwise false. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = null
      -	 *    isCaseSensitive = true
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    first = { { } }
      -	 *    second = null
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    4. - *
    5. -	 *    first = { { 'A' } }
      -	 *    second = { { 'a' } }
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    6. - *
    7. -	 *    first = { { 'A' } }
      -	 *    second = { { 'a' } }
      -	 *    isCaseSensitive = false
      -	 *    result => true
      -	 * 
      - *
    8. - *
    - * - * @param first the first array - * @param second the second array - * @param isCaseSensitive check whether or not the equality should be case sensitive - * @return true if the two arrays are identical character by character according to the value - * of isCaseSensitive, otherwise false - */ - public static final boolean equals( - char[][] first, - char[][] second, - boolean isCaseSensitive) { - - if (isCaseSensitive) { - return equals(first, second); - } - if (first == second) - return true; - if (first == null || second == null) - return false; - if (first.length != second.length) - return false; - - for (int i = first.length; --i >= 0;) - if (!equals(first[i], second[i], false)) - return false; - return true; - } - /** - * Answers true if the two arrays are identical character by character, otherwise false. - * The equality is case sensitive. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = null
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    first = { }
      -	 *    second = null
      -	 *    result => false
      -	 * 
      - *
    4. - *
    5. -	 *    first = { 'a' }
      -	 *    second = { 'a' }
      -	 *    result => true
      -	 * 
      - *
    6. - *
    7. -	 *    first = { 'a' }
      -	 *    second = { 'A' }
      -	 *    result => false
      -	 * 
      - *
    8. - *
    - * @param first the first array - * @param second the second array - * @return true if the two arrays are identical character by character, otherwise false - */ - public static final boolean equals(char[] first, char[] second) { - if (first == second) - return true; - if (first == null || second == null) - return false; - if (first.length != second.length) - return false; - - for (int i = first.length; --i >= 0;) - if (first[i] != second[i]) - return false; - return true; - } - /** - * If isCaseSensite is true, answers true if the two arrays are identical character - * by character, otherwise false. - * If it is false, answers true if the two arrays are identical character by - * character without checking the case, otherwise false. - *
    - *
    - * For example: - *
      - *
    1. -	 *    first = null
      -	 *    second = null
      -	 *    isCaseSensitive = true
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    first = { }
      -	 *    second = null
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    4. - *
    5. -	 *    first = { 'A' }
      -	 *    second = { 'a' }
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    6. - *
    7. -	 *    first = { 'A' }
      -	 *    second = { 'a' }
      -	 *    isCaseSensitive = false
      -	 *    result => true
      -	 * 
      - *
    8. - *
    - * - * @param first the first array - * @param second the second array - * @param isCaseSensitive check whether or not the equality should be case sensitive - * @return true if the two arrays are identical character by character according to the value - * of isCaseSensitive, otherwise false - */ - public static final boolean equals( - char[] first, - char[] second, - boolean isCaseSensitive) { - - if (isCaseSensitive) { - return equals(first, second); - } - if (first == second) - return true; - if (first == null || second == null) - return false; - if (first.length != second.length) - return false; - - for (int i = first.length; --i >= 0;) - if (Character.toLowerCase(first[i]) - != Character.toLowerCase(second[i])) - return false; - return true; - } - /** - * If isCaseSensite is true, the equality is case sensitive, otherwise it is case insensitive. - * - * Answers true if the name contains the fragment at the starting index startIndex, otherwise false. - *
    - *
    - * For example: - *
      - *
    1. -	 *    fragment = { 'b', 'c' , 'd' }
      -	 *    name = { 'a', 'b', 'c' , 'd' }
      -	 *    startIndex = 1
      -	 *    isCaseSensitive = true
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    fragment = { 'b', 'c' , 'd' }
      -	 *    name = { 'a', 'b', 'C' , 'd' }
      -	 *    startIndex = 1
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    4. - *
    5. -	 *    fragment = { 'b', 'c' , 'd' }
      -	 *    name = { 'a', 'b', 'C' , 'd' }
      -	 *    startIndex = 0
      -	 *    isCaseSensitive = false
      -	 *    result => false
      -	 * 
      - *
    6. - *
    7. -	 *    fragment = { 'b', 'c' , 'd' }
      -	 *    name = { 'a', 'b'}
      -	 *    startIndex = 0
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    8. - *
    - * - * @param fragment the fragment to check - * @param second the array to check - * @param startIndex the starting index - * @param isCaseSensitive check whether or not the equality should be case sensitive - * @return true if the name contains the fragment at the starting index startIndex according to the - * value of isCaseSensitive, otherwise false. - * @exception NullPointerException if fragment or name is null. - */ - public static final boolean fragmentEquals( - char[] fragment, - char[] name, - int startIndex, - boolean isCaseSensitive) { - - int max = fragment.length; - if (name.length < max + startIndex) - return false; - if (isCaseSensitive) { - for (int i = max; - --i >= 0; - ) // assumes the prefix is not larger than the name - if (fragment[i] != name[i + startIndex]) - return false; - return true; - } - for (int i = max; - --i >= 0; - ) // assumes the prefix is not larger than the name - if (Character.toLowerCase(fragment[i]) - != Character.toLowerCase(name[i + startIndex])) - return false; - return true; - } - /** - * Answers a hashcode for the array - * - * @param array the array for which a hashcode is required - * @return the hashcode - * @exception NullPointerException if array is null - */ - public static final int hashCode(char[] array) { - int hash = 0; - int offset = 0; - int length = array.length; - if (length < 16) { - for (int i = length; i > 0; i--) - hash = (hash * 37) + array[offset++]; - } else { - // only sample some characters - int skip = length / 8; - for (int i = length; i > 0; i -= skip, offset += skip) - hash = (hash * 39) + array[offset]; - } - return hash & 0x7FFFFFFF; - } - /** - * Answers true if c is a whitespace according to the JLS (\u000a, \u000c, \u000d, \u0009), otherwise false. - *
    - *
    - * For example: - *
      - *
    1. -	 *    c = ' '
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    c = '\u3000'
      -	 *    result => false
      -	 * 
      - *
    4. - *
    - * - * @param c the character to check - * @return true if c is a whitespace according to the JLS, otherwise false. - */ - public static boolean isWhitespace(char c) { - switch (c) { - case 10 : /* \ u000a: LINE FEED */ - case 12 : /* \ u000c: FORM FEED */ - case 13 : /* \ u000d: CARRIAGE RETURN */ - case 32 : /* \ u0020: SPACE */ - case 9 : /* \ u0009: HORIZONTAL TABULATION */ - return true; - default : - return false; - } - } - /** - * Answers the first index in the array for which the corresponding character is - * equal to toBeFound. Answers -1 if no occurrence of this character is found. - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    result => 2
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'e'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    result => -1
      -	 * 
      - *
    4. - *
    - * - * @param toBeFound the character to search - * @param array the array to be searched - * @return the first index in the array for which the corresponding character is - * equal to toBeFound, -1 otherwise - * @exception NullPointerException if array is null - */ - public static final int indexOf(char toBeFound, char[] array) { - for (int i = 0; i < array.length; i++) - if (toBeFound == array[i]) - return i; - return -1; - } - /** - * Answers the first index in the array for which the corresponding character is - * equal to toBeFound starting the search at index start. - * Answers -1 if no occurrence of this character is found. - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    start = 2
      -	 *    result => 2
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    start = 3
      -	 *    result => -1
      -	 * 
      - *
    4. - *
    5. -	 *    toBeFound = 'e'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    start = 1
      -	 *    result => -1
      -	 * 
      - *
    6. - *
    - * - * @param toBeFound the character to search - * @param array the array to be searched - * @param start the starting index - * @return the first index in the array for which the corresponding character is - * equal to toBeFound, -1 otherwise - * @exception NullPointerException if array is null - * @exception ArrayIndexOutOfBoundsException if start is lower than 0 - */ - public static final int indexOf(char toBeFound, char[] array, int start) { - for (int i = start; i < array.length; i++) - if (toBeFound == array[i]) - return i; - return -1; - } - /** - * Answers the last index in the array for which the corresponding character is - * equal to toBeFound starting from the end of the array. - * Answers -1 if no occurrence of this character is found. - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd' , 'c', 'e' }
      -	 *    result => 4
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'e'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    result => -1
      -	 * 
      - *
    4. - *
    - * - * @param toBeFound the character to search - * @param array the array to be searched - * @return the last index in the array for which the corresponding character is - * equal to toBeFound starting from the end of the array, -1 otherwise - * @exception NullPointerException if array is null - */ - public static final int lastIndexOf(char toBeFound, char[] array) { - for (int i = array.length; --i >= 0;) - if (toBeFound == array[i]) - return i; - return -1; - } - /** - * Answers the last index in the array for which the corresponding character is - * equal to toBeFound stopping at the index startIndex. - * Answers -1 if no occurrence of this character is found. - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    startIndex = 2
      -	 *    result => 2
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd', 'e' }
      -	 *    startIndex = 3
      -	 *    result => -1
      -	 * 
      - *
    4. - *
    5. -	 *    toBeFound = 'e'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    startIndex = 0
      -	 *    result => -1
      -	 * 
      - *
    6. - *
    - * - * @param toBeFound the character to search - * @param array the array to be searched - * @param startIndex the stopping index - * @return the last index in the array for which the corresponding character is - * equal to toBeFound stopping at the index startIndex, -1 otherwise - * @exception NullPointerException if array is null - * @exception ArrayIndexOutOfBoundsException if startIndex is lower than 0 - */ - public static final int lastIndexOf( - char toBeFound, - char[] array, - int startIndex) { - for (int i = array.length; --i >= startIndex;) - if (toBeFound == array[i]) - return i; - return -1; - } - /** - * Answers the last index in the array for which the corresponding character is - * equal to toBeFound starting from endIndex to startIndex. - * Answers -1 if no occurrence of this character is found. - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    startIndex = 2
      -	 *    endIndex = 2
      -	 *    result => 2
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'c'
      -	 *    array = { ' a', 'b', 'c', 'd', 'e' }
      -	 *    startIndex = 3
      -	 *    endIndex = 4
      -	 *    result => -1
      -	 * 
      - *
    4. - *
    5. -	 *    toBeFound = 'e'
      -	 *    array = { ' a', 'b', 'c', 'd' }
      -	 *    startIndex = 0
      -	 *    endIndex = 3
      -	 *    result => -1
      -	 * 
      - *
    6. - *
    - * - * @param toBeFound the character to search - * @param array the array to be searched - * @param startIndex the stopping index - * @param endIndex the starting index - * @return the last index in the array for which the corresponding character is - * equal to toBeFound starting from endIndex to startIndex, -1 otherwise - * @exception NullPointerException if array is null - * @exception ArrayIndexOutOfBoundsException if endIndex is greater or equals to array length or starting is lower than 0 - */ - public static final int lastIndexOf( - char toBeFound, - char[] array, - int startIndex, - int endIndex) { - for (int i = endIndex; --i >= startIndex;) - if (toBeFound == array[i]) - return i; - return -1; - } - /** - * Answers the last portion of a name given a separator. - *
    - *
    - * For example, - *
    -	 * 	lastSegment("java.lang.Object".toCharArray(),'.') --> Object
    -	 * 
    - * - * @param array the array - * @param separator the given separator - * @return the last portion of a name given a separator - * @exception NullPointerException if array is null - */ - final static public char[] lastSegment(char[] array, char separator) { - int pos = lastIndexOf(separator, array); - if (pos < 0) - return array; - return subarray(array, pos + 1, array.length); - } - /** - * Answers true if the pattern matches the given name, false otherwise. This char[] pattern matching - * accepts wild-cards '*' and '?'. - * - * When not case sensitive, the pattern is assumed to already be lowercased, the - * name will be lowercased character per character as comparing. - * If name is null, the answer is false. - * If pattern is null, the answer is true if name is not null. - *
    - *
    - * For example: - *
      - *
    1. -	 *    pattern = { '?', 'b', '*' }
      -	 *    name = { 'a', 'b', 'c' , 'd' }
      -	 *    isCaseSensitive = true
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    pattern = { '?', 'b', '?' }
      -	 *    name = { 'a', 'b', 'c' , 'd' }
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    4. - *
    5. -	 *    pattern = { 'b', '*' }
      -	 *    name = { 'a', 'b', 'c' , 'd' }
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    6. - *
    - * - * @param pattern the given pattern - * @param name the given name - * @param isCaseSensitive flag to know whether or not the matching should be case sensitive - * @return true if the pattern matches the given name, false otherwise - */ - public static final boolean match( - char[] pattern, - char[] name, - boolean isCaseSensitive) { - - if (name == null) - return false; // null name cannot match - if (pattern == null) - return true; // null pattern is equivalent to '*' - - return match( - pattern, - 0, - pattern.length, - name, - 0, - name.length, - isCaseSensitive, true); - } - /** - * Answers true if the a sub-pattern matches the subpart of the given name, false otherwise. - * char[] pattern matching, accepting wild-cards '*' and '?'. Can match only subset of name/pattern. - * end positions are non-inclusive. - * The subpattern is defined by the patternStart and pattternEnd positions. - * When not case sensitive, the pattern is assumed to already be lowercased, the - * name will be lowercased character per character as comparing. - *
    - *
    - * For example: - *
      - *
    1. -	 *    pattern = { '?', 'b', '*' }
      -	 *    patternStart = 1
      -	 *    patternEnd = 3
      -	 *    name = { 'a', 'b', 'c' , 'd' }
      -	 *    nameStart = 1
      -	 *    nameEnd = 4
      -	 *    isCaseSensitive = true
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    pattern = { '?', 'b', '*' }
      -	 *    patternStart = 1
      -	 *    patternEnd = 2
      -	 *    name = { 'a', 'b', 'c' , 'd' }
      -	 *    nameStart = 1
      -	 *    nameEnd = 2
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    4. - *
    - * - * @param pattern the given pattern - * @param patternStart the given pattern start - * @param patternEnd the given pattern end - * @param name the given name - * @param nameStart the given name start - * @param nameEnd the given name end - * @param isCaseSensitive flag to know if the matching should be case sensitive - * @return true if the a sub-pattern matches the subpart of the given name, false otherwise - */ - public static final boolean match( - char[] pattern, - int patternStart, - int patternEnd, - char[] name, - int nameStart, - int nameEnd, - boolean isCaseSensitive){ - - return match( pattern, patternStart, patternEnd, name, nameStart, nameEnd, isCaseSensitive, false ); - } - - - public static final boolean match( - char[] pattern, - int patternStart, - int patternEnd, - char[] name, - int nameStart, - int nameEnd, - boolean isCaseSensitive, - boolean allowEscaping) { - - if (name == null) - return false; // null name cannot match - if (pattern == null) - return true; // null pattern is equivalent to '*' - int iPattern = patternStart; - int iName = nameStart; - - if (patternEnd < 0) - patternEnd = pattern.length; - if (nameEnd < 0) - nameEnd = name.length; - - /* check first segment */ - char patternChar = 0; - boolean isEscaped = false; - while ((iPattern < patternEnd) && - ( (patternChar = pattern[iPattern]) != '*' || - (patternChar == '*' && isEscaped) ) ) { - - if( allowEscaping && pattern[iPattern] == '\\' && !isEscaped ){ - iPattern++; - isEscaped = true; - continue; - } else isEscaped = false; - - if (iName == nameEnd) - return false; - if (patternChar - != (isCaseSensitive - ? name[iName] - : Character.toLowerCase(name[iName])) - && patternChar != '?') { - return false; - } - iName++; - iPattern++; - patternChar = 0; - } - /* check sequence of star+segment */ - int segmentStart; - if (patternChar == '*') { - segmentStart = ++iPattern; // skip star - } else { - segmentStart = 0; // force iName check - } - int prefixStart = iName; - checkSegment : while (iName < nameEnd) { - if (iPattern == patternEnd) { - iPattern = segmentStart; // mismatch - restart current segment - iName = ++prefixStart; - continue checkSegment; - } - /* segment is ending */ - if ((patternChar = pattern[iPattern]) == '*') { - segmentStart = ++iPattern; // skip start - if (segmentStart == patternEnd) { - return true; - } - prefixStart = iName; - continue checkSegment; - } - /* check current name character */ - if ((isCaseSensitive ? name[iName] : Character.toLowerCase(name[iName])) - != patternChar - && patternChar != '?') { - iPattern = segmentStart; // mismatch - restart current segment - iName = ++prefixStart; - continue checkSegment; - } - iName++; - iPattern++; - } - - return (segmentStart == patternEnd) - || (iName == nameEnd && iPattern == patternEnd) - || (iPattern == patternEnd - 1 && pattern[iPattern] == '*'); - } - /** - * Answers true if the pattern matches the filepath using the pathSepatator, false otherwise. - * - * Path char[] pattern matching, accepting wild-cards '**', '*' and '?' (using Ant directory tasks - * conventions, also see "http://jakarta.apache.org/ant/manual/dirtasks.html#defaultexcludes"). - * Path pattern matching is enhancing regular pattern matching in supporting extra rule where '**' represent - * any folder combination. - * Special rules: - * - foo\ is equivalent to foo\** - * - *.java is equivalent to **\*.java - * When not case sensitive, the pattern is assumed to already be lowercased, the - * name will be lowercased character per character as comparing. - * - * @param pattern the given pattern - * @param filepath the given path - * @param isCaseSensitive to find out whether or not the matching should be case sensitive - * @param pathSeparator the given path separator - * @return true if the pattern matches the filepath using the pathSepatator, false otherwise - */ - public static final boolean pathMatch( - char[] pattern, - char[] filepath, - boolean isCaseSensitive, - char pathSeparator) { - - if (filepath == null) - return false; // null name cannot match - if (pattern == null) - return true; // null pattern is equivalent to '*' - - // special case: pattern foo is equivalent to **\foo (not absolute) - boolean freeLeadingDoubleStar; - - // offsets inside pattern - int pSegmentStart, pLength = pattern.length; - - if (freeLeadingDoubleStar = pattern[0] != pathSeparator){ - pSegmentStart = 0; - } else { - pSegmentStart = 1; - } - int pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart+1); - if (pSegmentEnd < 0) pSegmentEnd = pLength; - - // special case: pattern foo\ is equivalent to foo\** - boolean freeTrailingDoubleStar = pattern[pLength - 1] == pathSeparator; - - // offsets inside filepath - int fSegmentStart, fLength = filepath.length; - if (filepath[0] != pathSeparator){ - fSegmentStart = 0; - } else { - fSegmentStart = 1; - } - if (fSegmentStart != pSegmentStart) { - return false; // both must start with a separator or none. - } - int fSegmentEnd = CharOperation.indexOf(pathSeparator, filepath, fSegmentStart+1); - if (fSegmentEnd < 0) fSegmentEnd = fLength; - - // first segments - while (pSegmentStart < pLength - && !freeLeadingDoubleStar - && !(pSegmentEnd == pLength && freeTrailingDoubleStar - || (pSegmentEnd == pSegmentStart + 2 - && pattern[pSegmentStart] == '*' - && pattern[pSegmentStart + 1] == '*'))) { - - if (fSegmentStart >= fLength) - return false; - if (!CharOperation - .match( - pattern, - pSegmentStart, - pSegmentEnd, - filepath, - fSegmentStart, - fSegmentEnd, - isCaseSensitive)) { - return false; - } - - // jump to next segment - pSegmentEnd = - CharOperation.indexOf( - pathSeparator, - pattern, - pSegmentStart = pSegmentEnd + 1); - // skip separator - if (pSegmentEnd < 0) - pSegmentEnd = pLength; - - fSegmentEnd = - CharOperation.indexOf( - pathSeparator, - filepath, - fSegmentStart = fSegmentEnd + 1); - // skip separator - if (fSegmentEnd < 0) fSegmentEnd = fLength; - } - - /* check sequence of doubleStar+segment */ - int pSegmentRestart; - if ((pSegmentStart >= pLength && freeTrailingDoubleStar) - || (pSegmentEnd == pSegmentStart + 2 - && pattern[pSegmentStart] == '*' - && pattern[pSegmentStart + 1] == '*')) { - pSegmentEnd = - CharOperation.indexOf( - pathSeparator, - pattern, - pSegmentStart = pSegmentEnd + 1); - // skip separator - if (pSegmentEnd < 0) pSegmentEnd = pLength; - pSegmentRestart = pSegmentStart; - } else { - if (pSegmentStart >= pLength) return fSegmentStart >= fLength; // true if filepath is done too. - pSegmentRestart = 0; // force fSegmentStart check - } - int fSegmentRestart = fSegmentStart; - checkSegment : while (fSegmentStart < fLength) { - - if (pSegmentStart >= pLength) { - if (freeTrailingDoubleStar) return true; - // mismatch - restart current path segment - pSegmentEnd = - CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentRestart); - if (pSegmentEnd < 0) pSegmentEnd = pLength; - - fSegmentRestart = - CharOperation.indexOf(pathSeparator, filepath, fSegmentRestart + 1); - // skip separator - if (fSegmentRestart < 0) { - fSegmentRestart = fLength; - } else { - fSegmentRestart++; - } - fSegmentEnd = - CharOperation.indexOf(pathSeparator, filepath, fSegmentStart = fSegmentRestart); - if (fSegmentEnd < 0) fSegmentEnd = fLength; - continue checkSegment; - } - - /* path segment is ending */ - if (pSegmentEnd == pSegmentStart + 2 - && pattern[pSegmentStart] == '*' - && pattern[pSegmentStart + 1] == '*') { - pSegmentEnd = - CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1); - // skip separator - if (pSegmentEnd < 0) pSegmentEnd = pLength; - pSegmentRestart = pSegmentStart; - fSegmentRestart = fSegmentStart; - if (pSegmentStart >= pLength) return true; - continue checkSegment; - } - /* chech current path segment */ - if (!CharOperation.match( - pattern, - pSegmentStart, - pSegmentEnd, - filepath, - fSegmentStart, - fSegmentEnd, - isCaseSensitive)) { - // mismatch - restart current path segment - pSegmentEnd = - CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentRestart); - if (pSegmentEnd < 0) pSegmentEnd = pLength; - - fSegmentRestart = - CharOperation.indexOf(pathSeparator, filepath, fSegmentRestart + 1); - // skip separator - if (fSegmentRestart < 0) { - fSegmentRestart = fLength; - } else { - fSegmentRestart++; - } - fSegmentEnd = - CharOperation.indexOf(pathSeparator, filepath, fSegmentStart = fSegmentRestart); - if (fSegmentEnd < 0) fSegmentEnd = fLength; - continue checkSegment; - } - // jump to next segment - pSegmentEnd = - CharOperation.indexOf( - pathSeparator, - pattern, - pSegmentStart = pSegmentEnd + 1); - // skip separator - if (pSegmentEnd < 0) - pSegmentEnd = pLength; - - fSegmentEnd = - CharOperation.indexOf( - pathSeparator, - filepath, - fSegmentStart = fSegmentEnd + 1); - // skip separator - if (fSegmentEnd < 0) - fSegmentEnd = fLength; - } - - return (pSegmentRestart >= pSegmentEnd) - || (fSegmentStart >= fLength && pSegmentStart >= pLength) - || (pSegmentStart == pLength - 2 - && pattern[pSegmentStart] == '*' - && pattern[pSegmentStart + 1] == '*') - || (pSegmentStart == pLength && freeTrailingDoubleStar); - } - /** - * Answers the number of occurrences of the given character in the given array, 0 if any. - * - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'b'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => 3
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'c'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => 0
      -	 * 
      - *
    4. - *
    - * - * @param toBeFound the given character - * @param array the given array - * @return the number of occurrences of the given character in the given array, 0 if any - * @exception NullPointerException if array is null - */ - public static final int occurencesOf(char toBeFound, char[] array) { - int count = 0; - for (int i = 0; i < array.length; i++) - if (toBeFound == array[i]) - count++; - return count; - } - /** - * Answers the number of occurrences of the given character in the given array starting - * at the given index, 0 if any. - * - *
    - *
    - * For example: - *
      - *
    1. -	 *    toBeFound = 'b'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    start = 2
      -	 *    result => 2
      -	 * 
      - *
    2. - *
    3. -	 *    toBeFound = 'c'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    start = 0
      -	 *    result => 0
      -	 * 
      - *
    4. - *
    - * - * @param toBeFound the given character - * @param array the given array - * @return the number of occurrences of the given character in the given array, 0 if any - * @exception NullPointerException if array is null - * @exception ArrayIndexOutOfBoundsException if start is lower than 0 - */ - public static final int occurencesOf( - char toBeFound, - char[] array, - int start) { - int count = 0; - for (int i = start; i < array.length; i++) - if (toBeFound == array[i]) - count++; - return count; - } - /** - * Answers true if the given name starts with the given prefix, false otherwise. - * The comparison is case sensitive. - *
    - *
    - * For example: - *
      - *
    1. -	 *    prefix = { 'a' , 'b' }
      -	 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    prefix = { 'a' , 'c' }
      -	 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => false
      -	 * 
      - *
    4. - *
    - * - * @param prefix the given prefix - * @param name the given name - * @return true if the given name starts with the given prefix, false otherwise - * @exception NullPointerException if the given name is null or if the given prefix is null - */ - public static final boolean prefixEquals(char[] prefix, char[] name) { - - int max = prefix.length; - if (name.length < max) - return false; - for (int i = max; - --i >= 0; - ) // assumes the prefix is not larger than the name - if (prefix[i] != name[i]) - return false; - return true; - } - /** - * Answers true if the given name starts with the given prefix, false otherwise. - * isCaseSensitive is used to find out whether or not the comparison should be case sensitive. - *
    - *
    - * For example: - *
      - *
    1. -	 *    prefix = { 'a' , 'B' }
      -	 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    isCaseSensitive = false
      -	 *    result => true
      -	 * 
      - *
    2. - *
    3. -	 *    prefix = { 'a' , 'B' }
      -	 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    isCaseSensitive = true
      -	 *    result => false
      -	 * 
      - *
    4. - *
    - * - * @param prefix the given prefix - * @param name the given name - * @param isCaseSensitive to find out whether or not the comparison should be case sensitive - * @return true if the given name starts with the given prefix, false otherwise - * @exception NullPointerException if the given name is null or if the given prefix is null - */ - public static final boolean prefixEquals( - char[] prefix, - char[] name, - boolean isCaseSensitive) { - - int max = prefix.length; - if (name.length < max) - return false; - if (isCaseSensitive) { - for (int i = max; - --i >= 0; - ) // assumes the prefix is not larger than the name - if (prefix[i] != name[i]) - return false; - return true; - } - - for (int i = max; - --i >= 0; - ) // assumes the prefix is not larger than the name - if (Character.toLowerCase(prefix[i]) - != Character.toLowerCase(name[i])) - return false; - return true; - } - /** - * Replace all occurrence of the character to be replaced with the remplacement character in the - * given array. - *
    - *
    - * For example: - *
      - *
    1. -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    toBeReplaced = 'b'
      -	 *    replacementChar = 'a'
      -	 *    result => No returned value, but array is now equals to { 'a' , 'a', 'a', 'a', 'a', 'a' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    toBeReplaced = 'c'
      -	 *    replacementChar = 'a'
      -	 *    result => No returned value, but array is now equals to { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 * 
      - *
    4. - *
    - * - * @param array the given array - * @param toBeReplaced the character to be replaced - * @param replacementChar the replacement character - * @exception NullPointerException if the given array is null - */ - public static final void replace( - char[] array, - char toBeReplaced, - char replacementChar) { - if (toBeReplaced != replacementChar) { - for (int i = 0, max = array.length; i < max; i++) { - if (array[i] == toBeReplaced) - array[i] = replacementChar; - } - } - } - /** - * Answers a new array of characters with substitutions. No side-effect is operated on the original - * array, in case no substitution happened, then the result is the same as the - * original one. - *
    - *
    - * For example: - *
      - *
    1. -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    toBeReplaced = { 'b' }
      -	 *    replacementChar = { 'a', 'a' }
      -	 *    result => { 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    toBeReplaced = { 'c' }
      -	 *    replacementChar = { 'a' }
      -	 *    result => { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 * 
      - *
    4. - *
    - * - * @param the given array - * @param toBeReplaced characters to be replaced - * @param the replacement characters - * @return a new array of characters with substitutions or the given array if none - * @exception NullPointerException if the given array is null - */ - public static final char[] replace( - char[] array, - char[] toBeReplaced, - char[] replacementChars) { - - int max = array.length; - int replacedLength = toBeReplaced.length; - int replacementLength = replacementChars.length; - - int[] starts = new int[5]; - int occurrenceCount = 0; - - if (!equals(toBeReplaced, replacementChars)) { - - next : for (int i = 0; i < max; i++) { - int j = 0; - while (j < replacedLength) { - if (i + j == max) - continue next; - if (array[i + j] != toBeReplaced[j++]) - continue next; - } - if (occurrenceCount == starts.length) { - System.arraycopy( - starts, - 0, - starts = new int[occurrenceCount * 2], - 0, - occurrenceCount); - } - starts[occurrenceCount++] = i; - } - } - if (occurrenceCount == 0) - return array; - char[] result = - new char[max - + occurrenceCount * (replacementLength - replacedLength)]; - int inStart = 0, outStart = 0; - for (int i = 0; i < occurrenceCount; i++) { - int offset = starts[i] - inStart; - System.arraycopy(array, inStart, result, outStart, offset); - inStart += offset; - outStart += offset; - System.arraycopy( - replacementChars, - 0, - result, - outStart, - replacementLength); - inStart += replacedLength; - outStart += replacementLength; - } - System.arraycopy(array, inStart, result, outStart, max - inStart); - return result; - } - /** - * Return a new array which is the split of the given array using the given divider and triming each subarray to remove - * whitespaces equals to ' '. - *
    - *
    - * For example: - *
      - *
    1. -	 *    divider = 'b'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => { { 'a' }, {  }, { 'a' }, { 'a' } }
      -	 * 
      - *
    2. - *
    3. -	 *    divider = 'c'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
      -	 * 
      - *
    4. - *
    5. -	 *    divider = 'b'
      -	 *    array = { 'a' , ' ', 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => { { 'a' }, {  }, { 'a' }, { 'a' } }
      -	 * 
      - *
    6. - *
    7. -	 *    divider = 'c'
      -	 *    array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' }
      -	 *    result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
      -	 * 
      - *
    8. - *
    - * - * @param divider the given divider - * @param array the given array - * @return a new array which is the split of the given array using the given divider and triming each subarray to remove - * whitespaces equals to ' ' - */ - public static final char[][] splitAndTrimOn(char divider, char[] array) { - int length = array == null ? 0 : array.length; - if (length == 0) - return NO_CHAR_CHAR; - - int wordCount = 1; - for (int i = 0; i < length; i++) - if (array[i] == divider) - wordCount++; - char[][] split = new char[wordCount][]; - int last = 0, currentWord = 0; - for (int i = 0; i < length; i++) { - if (array[i] == divider) { - int start = last, end = i - 1; - while (start < i && array[start] == ' ') - start++; - while (end > start && array[end] == ' ') - end--; - split[currentWord] = new char[end - start + 1]; - System.arraycopy( - array, - start, - split[currentWord++], - 0, - end - start + 1); - last = i + 1; - } - } - int start = last, end = length - 1; - while (start < length && array[start] == ' ') - start++; - while (end > start && array[end] == ' ') - end--; - split[currentWord] = new char[end - start + 1]; - System.arraycopy( - array, - start, - split[currentWord++], - 0, - end - start + 1); - return split; - } - /** - * Return a new array which is the split of the given array using the given divider. - *
    - *
    - * For example: - *
      - *
    1. -	 *    divider = 'b'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => { { 'a' }, {  }, { 'a' }, { 'a' } }
      -	 * 
      - *
    2. - *
    3. -	 *    divider = 'c'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    result => { { 'a', 'b', 'b', 'a', 'b', 'a' } }
      -	 * 
      - *
    4. - *
    5. -	 *    divider = 'c'
      -	 *    array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' }
      -	 *    result => { { ' ', 'a', 'b', 'b', 'a', 'b', 'a', ' ' } }
      -	 * 
      - *
    6. - *
    - * - * @param divider the given divider - * @param array the given array - * @return a new array which is the split of the given array using the given divider - */ - public static final char[][] splitOn(char divider, char[] array) { - int length = array == null ? 0 : array.length; - if (length == 0) - return NO_CHAR_CHAR; - - int wordCount = 1; - for (int i = 0; i < length; i++) - if (array[i] == divider) - wordCount++; - char[][] split = new char[wordCount][]; - int last = 0, currentWord = 0; - for (int i = 0; i < length; i++) { - if (array[i] == divider) { - split[currentWord] = new char[i - last]; - System.arraycopy( - array, - last, - split[currentWord++], - 0, - i - last); - last = i + 1; - } - } - split[currentWord] = new char[length - last]; - System.arraycopy(array, last, split[currentWord], 0, length - last); - return split; - } - /** - * Return a new array which is the split of the given array using the given divider. The given end - * is exclusive and the given start is inclusive. - *
    - *
    - * For example: - *
      - *
    1. -	 *    divider = 'b'
      -	 *    array = { 'a' , 'b', 'b', 'a', 'b', 'a' }
      -	 *    start = 2
      -	 *    end = 5
      -	 *    result => { {  }, {  }, { 'a' } }
      -	 * 
      - *
    2. - *
    - * - * @param divider the given divider - * @param array the given array - * @param start the given starting index - * @param end the given ending index - * @return a new array which is the split of the given array using the given divider - * @exception ArrayIndexOutOfBoundsException if start is lower than 0 or end is greater than the array length - */ - public static final char[][] splitOn( - char divider, - char[] array, - int start, - int end) { - int length = array == null ? 0 : array.length; - if (length == 0 || start > end) - return NO_CHAR_CHAR; - - int wordCount = 1; - for (int i = start; i < end; i++) - if (array[i] == divider) - wordCount++; - char[][] split = new char[wordCount][]; - int last = start, currentWord = 0; - for (int i = start; i < end; i++) { - if (array[i] == divider) { - split[currentWord] = new char[i - last]; - System.arraycopy( - array, - last, - split[currentWord++], - 0, - i - last); - last = i + 1; - } - } - split[currentWord] = new char[end - last]; - System.arraycopy(array, last, split[currentWord], 0, end - last); - return split; - } - /** - * Answers a new array which is a copy of the given array starting at the given start and - * ending at the given end. The given start is inclusive and the given end is exclusive. - * Answers null if start is greater than end, if start is lower than 0 or if end is greater - * than the length of the given array. If end equals -1, it is converted to the array length. - *
    - *
    - * For example: - *
      - *
    1. -	 *    array = { { 'a' } , { 'b' } }
      -	 *    start = 0
      -	 *    end = 1
      -	 *    result => { { 'a' } }
      -	 * 
      - *
    2. - *
    3. -	 *    array = { { 'a' } , { 'b' } }
      -	 *    start = 0
      -	 *    end = -1
      -	 *    result => { { 'a' }, { 'b' } }
      -	 * 
      - *
    4. - *
    - * - * @param array the given array - * @param start the given starting index - * @param end the given ending index - * @return a new array which is a copy of the given array starting at the given start and - * ending at the given end - * @exception NullPointerException if the given array is null - */ - public static final char[][] subarray(char[][] array, int start, int end) { - if (end == -1) - end = array.length; - if (start > end) - return null; - if (start < 0) - return null; - if (end > array.length) - return null; - - char[][] result = new char[end - start][]; - System.arraycopy(array, start, result, 0, end - start); - return result; - } - /** - * Answers a new array which is a copy of the given array starting at the given start and - * ending at the given end. The given start is inclusive and the given end is exclusive. - * Answers null if start is greater than end, if start is lower than 0 or if end is greater - * than the length of the given array. If end equals -1, it is converted to the array length. - *
    - *
    - * For example: - *
      - *
    1. -	 *    array = { 'a' , 'b' }
      -	 *    start = 0
      -	 *    end = 1
      -	 *    result => { 'a' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'a', 'b' }
      -	 *    start = 0
      -	 *    end = -1
      -	 *    result => { 'a' , 'b' }
      -	 * 
      - *
    4. - *
    - * - * @param array the given array - * @param start the given starting index - * @param end the given ending index - * @return a new array which is a copy of the given array starting at the given start and - * ending at the given end - * @exception NullPointerException if the given array is null - */ - public static final char[] subarray(char[] array, int start, int end) { - if (end == -1) - end = array.length; - if (start > end) - return null; - if (start < 0) - return null; - if (end > array.length) - return null; - - char[] result = new char[end - start]; - System.arraycopy(array, start, result, 0, end - start); - return result; - } - /** - * Answers the result of a char[] conversion to lowercase. Answers null if the given chars array is null. - *
    - * NOTE: If no conversion was necessary, then answers back the argument one. - *
    - *
    - * For example: - *
      - *
    1. -	 *    chars = { 'a' , 'b' }
      -	 *    result => { 'a' , 'b' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'A', 'b' }
      -	 *    result => { 'a' , 'b' }
      -	 * 
      - *
    4. - *
    - * - * @param chars the chars to convert - * @return the result of a char[] conversion to lowercase - */ - final static public char[] toLowerCase(char[] chars) { - if (chars == null) - return null; - int length = chars.length; - char[] lowerChars = null; - for (int i = 0; i < length; i++) { - char c = chars[i]; - char lc = Character.toLowerCase(c); - if ((c != lc) || (lowerChars != null)) { - if (lowerChars == null) { - System.arraycopy( - chars, - 0, - lowerChars = new char[length], - 0, - i); - } - lowerChars[i] = lc; - } - } - return lowerChars == null ? chars : lowerChars; - } - /** - * Answers a new array removing leading and trailing spaces (' '). Answers the given array if there is no - * space characters to remove. - *
    - *
    - * For example: - *
      - *
    1. -	 *    chars = { ' ', 'a' , 'b', ' ',  ' ' }
      -	 *    result => { 'a' , 'b' }
      -	 * 
      - *
    2. - *
    3. -	 *    array = { 'A', 'b' }
      -	 *    result => { 'A' , 'b' }
      -	 * 
      - *
    4. - *
    - * - * @param chars the given array - * @return a new array removing leading and trailing spaces (' ') - */ - final static public char[] trim(char[] chars) { - - if (chars == null) - return null; - - int start = 0, length = chars.length, end = length - 1; - while (start < length && chars[start] == ' ') { - start++; - } - while (end > start && chars[end] == ' ') { - end--; - } - if (start != 0 || end != length - 1) { - return subarray(chars, start, end + 1); - } - return chars; - } - /** - * Answers a string which is the concatenation of the given array using the '.' as a separator. - *
    - *
    - * For example: - *
      - *
    1. -	 *    array = { { 'a' } , { 'b' } }
      -	 *    result => "a.b"
      -	 * 
      - *
    2. - *
    3. -	 *    array = { { ' ',  'a' } , { 'b' } }
      -	 *    result => " a.b"
      -	 * 
      - *
    4. - *
    - * - * @param chars the given array - * @return a string which is the concatenation of the given array using the '.' as a separator - */ - final static public String toString(char[][] array) { - char[] result = concatWith(array, '.'); - return new String(result); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java deleted file mode 100644 index a384a3a3808..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/Util.java +++ /dev/null @@ -1,399 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.HashSet; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -public class Util { - - private final static char[] DOUBLE_QUOTES = "''".toCharArray(); //$NON-NLS-1$ - private final static char[] SINGLE_QUOTE = "'".toCharArray(); //$NON-NLS-1$ - private static final int DEFAULT_READING_SIZE = 8192; - - /* Bundle containing messages */ - protected static ResourceBundle bundle; - private final static String bundleName = "org.eclipse.cdt.internal.core.messages"; //$NON-NLS-1$ - static { - relocalize(); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given strings. - */ - public static String bind(String id, String binding1, String binding2) { - return bind(id, new String[] {binding1, binding2}); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given string. - */ - public static String bind(String id, String binding) { - return bind(id, new String[] {binding}); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given string values. - */ - public static String bind(String id, String[] bindings) { - if (id == null) - return "No message available"; //$NON-NLS-1$ - String message = null; - try { - message = bundle.getString(id); - } catch (MissingResourceException e) { - // If we got an exception looking for the message, fail gracefully by just returning - // the id we were looking for. In most cases this is semi-informative so is not too bad. - return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$ - } - // for compatibility with MessageFormat which eliminates double quotes in original message - char[] messageWithNoDoubleQuotes = - CharOperation.replace(message.toCharArray(), DOUBLE_QUOTES, SINGLE_QUOTE); - message = new String(messageWithNoDoubleQuotes); - - if (bindings == null) - return message; - int length = message.length(); - int start = -1; - int end = length; - StringBuffer output = new StringBuffer(80); - while (true) { - if ((end = message.indexOf('{', start)) > -1) { - output.append(message.substring(start + 1, end)); - if ((start = message.indexOf('}', end)) > -1) { - int index = -1; - try { - index = Integer.parseInt(message.substring(end + 1, start)); - output.append(bindings[index]); - } catch (NumberFormatException nfe) { - output.append(message.substring(end + 1, start + 1)); - } catch (ArrayIndexOutOfBoundsException e) { - output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$ - } - } else { - output.append(message.substring(end, length)); - break; - } - } else { - output.append(message.substring(start + 1, length)); - break; - } - } - return output.toString(); - } - /** - * Lookup the message with the given ID in this catalog - */ - public static String bind(String id) { - return bind(id, (String[])null); - } - /** - * Creates a NLS catalog for the given locale. - */ - public static void relocalize() { - try { - bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault()); - } catch(MissingResourceException e) { - System.out.println("Missing resource : " + bundleName.replace('.', '/') + ".properties for locale " + Locale.getDefault()); //$NON-NLS-1$//$NON-NLS-2$ - throw e; - } - } - - /** - * Returns the contents of the given file as a byte array. - * @throws IOException if a problem occured reading the file. - */ - public static byte[] getFileByteContent(File file) throws IOException { - InputStream stream = null; - try { - stream = new BufferedInputStream(new FileInputStream(file)); - return getInputStreamAsByteArray(stream, (int) file.length()); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - } - /** - * Returns the contents of the given file as a char array. - * When encoding is null, then the platform default one is used - * @throws IOException if a problem occured reading the file. - */ - public static char[] getFileCharContent(File file, String encoding) throws IOException { - InputStream stream = null; - try { - stream = new BufferedInputStream(new FileInputStream(file)); - return Util.getInputStreamAsCharArray(stream, (int) file.length(), encoding); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - } - } - } - } - - /** - * Returns the given input stream's contents as a byte array. - * If a length is specified (ie. if length != -1), only length bytes - * are returned. Otherwise all bytes in the stream are returned. - * Note this doesn't close the stream. - * @throws IOException if a problem occured reading the stream. - */ - public static byte[] getInputStreamAsByteArray(InputStream stream, int length) - throws IOException { - byte[] contents; - if (length == -1) { - contents = new byte[0]; - int contentsLength = 0; - int amountRead = -1; - do { - int amountRequested = Math.max(stream.available(), DEFAULT_READING_SIZE); // read at least 8K - - // resize contents if needed - if (contentsLength + amountRequested > contents.length) { - System.arraycopy( - contents, - 0, - contents = new byte[contentsLength + amountRequested], - 0, - contentsLength); - } - - // read as many bytes as possible - amountRead = stream.read(contents, contentsLength, amountRequested); - - if (amountRead > 0) { - // remember length of contents - contentsLength += amountRead; - } - } while (amountRead != -1); - - // resize contents if necessary - if (contentsLength < contents.length) { - System.arraycopy( - contents, - 0, - contents = new byte[contentsLength], - 0, - contentsLength); - } - } else { - contents = new byte[length]; - int len = 0; - int readSize = 0; - while ((readSize != -1) && (len != length)) { - // See PR 1FMS89U - // We record first the read size. In this case len is the actual read size. - len += readSize; - readSize = stream.read(contents, len, length - len); - } - } - - return contents; - } - - /** - * Returns the given input stream's contents as a character array. - * If a length is specified (ie. if length != -1), only length chars - * are returned. Otherwise all chars in the stream are returned. - * Note this doesn't close the stream. - * @throws IOException if a problem occured reading the stream. - */ - public static char[] getInputStreamAsCharArray(InputStream stream, int length, String encoding) - throws IOException { - InputStreamReader reader = null; - reader = encoding == null - ? new InputStreamReader(stream) - : new InputStreamReader(stream, encoding); - char[] contents; - if (length == -1) { - contents = CharOperation.NO_CHAR; - int contentsLength = 0; - int amountRead = -1; - do { - int amountRequested = Math.max(stream.available(), DEFAULT_READING_SIZE); // read at least 8K - - // resize contents if needed - if (contentsLength + amountRequested > contents.length) { - System.arraycopy( - contents, - 0, - contents = new char[contentsLength + amountRequested], - 0, - contentsLength); - } - - // read as many chars as possible - amountRead = reader.read(contents, contentsLength, amountRequested); - - if (amountRead > 0) { - // remember length of contents - contentsLength += amountRead; - } - } while (amountRead != -1); - - // resize contents if necessary - if (contentsLength < contents.length) { - System.arraycopy( - contents, - 0, - contents = new char[contentsLength], - 0, - contentsLength); - } - } else { - contents = new char[length]; - int len = 0; - int readSize = 0; - while ((readSize != -1) && (len != length)) { - // See PR 1FMS89U - // We record first the read size. In this case len is the actual read size. - len += readSize; - readSize = reader.read(contents, len, length - len); - } - // See PR 1FMS89U - // Now we need to resize in case the default encoding used more than one byte for each - // character - if (len != length) - System.arraycopy(contents, 0, (contents = new char[len]), 0, len); - } - - return contents; - } - - - /** - * Helper method - returns the targeted item (IResource if internal or java.io.File if external), - * or null if unbound - * Internal items must be referred to using container relative paths. - */ - public static Object getTarget(IContainer container, IPath path, boolean checkResourceExistence) { - - if (path == null) return null; - - // lookup - inside the container - if (path.getDevice() == null) { // container relative paths should not contain a device - // (see http://dev.eclipse.org/bugs/show_bug.cgi?id=18684) - // (case of a workspace rooted at d:\ ) - IResource resource = container.findMember(path); - if (resource != null){ - if (!checkResourceExistence ||resource.exists()) return resource; - return null; - } - } - - // if path is relative, it cannot be an external path - // (see http://dev.eclipse.org/bugs/show_bug.cgi?id=22517) - if (!path.isAbsolute()) return null; - - // lookup - outside the container - File externalFile = new File(path.toOSString()); - if (!checkResourceExistence) { - return externalFile; - } else if (existingExternalFiles.contains(externalFile)) { - return externalFile; - } else { - if (externalFile.exists()) { - // cache external file - existingExternalFiles.add(externalFile); - return externalFile; - } - } - - return null; - } - /** - * A set of java.io.Files used as a cache of external jars that - * are known to be existing. - * Note this cache is kept for the whole session. - */ - public static HashSet existingExternalFiles = new HashSet(); - - /* - * Returns whether the given resource matches one of the exclusion patterns. - * - * @see IClasspathEntry#getExclusionPatterns - */ - public final static boolean isExcluded(IResource resource, char[][] exclusionPatterns) { - IPath path = resource.getFullPath(); - // ensure that folders are only excluded if all of their children are excluded - if (resource.getType() == IResource.FOLDER) - path = path.append("*"); //$NON-NLS-1$ - return isExcluded(path, exclusionPatterns); - } - - /* - * Returns whether the given resource path matches one of the exclusion - * patterns. - * - * @see IClasspathEntry#getExclusionPatterns - */ - public final static boolean isExcluded(IPath resourcePath, char[][] exclusionPatterns) { - if (exclusionPatterns == null) return false; - char[] path = resourcePath.toString().toCharArray(); - for (int i = 0, length = exclusionPatterns.length; i < length; i++) - if (CharOperation.pathMatch(exclusionPatterns[i], path, true, '/')) - return true; - return false; - } - /** - * @param string - * @return - */ - public static boolean isCCFileName(String fileName) { - String[] sourceExtensions = CModelManager.sourceExtensions; - String[] headerExtensions = CModelManager.headerExtensions; - - int dot =fileName.lastIndexOf("."); - - //No extension, give benefit of doubt - if (dot == -1) - return true; - - //Extract extension - String extension = ""; - if (dot + 1 <= fileName.length()) - extension = fileName.substring(dot + 1); - - for (int i=0; iIDocument represent a data source, e.g. a File (FileDocument), - * an IFile (IFileDocument), - * or other kinds of data sources (URL, ...). An IIndexer indexes anIDocument. - */ - -public interface IDocument { - /** - * Returns the content of the document, in a byte array. - */ - byte[] getByteContent() throws IOException; - /** - * Returns the content of the document, in a char array. - */ - char[] getCharContent() throws IOException; - /** - * Returns the encoding for this document - */ - String getEncoding(); - /** - * returns the name of the document (e.g. its path for a File, or its relative path - * in the workbench for an IFile). - */ - String getName(); - /** - * Returns the content of the document, as a String. - */ - public String getStringContent() throws IOException; - /** - * Returns the type of the document. - */ - String getType(); -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IEntryResult.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IEntryResult.java deleted file mode 100644 index 3df76889235..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IEntryResult.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index; - -public interface IEntryResult { - public int[] getFileReferences(); - public char[] getWord(); -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndex.java deleted file mode 100644 index 583c32cd1b8..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndex.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index; - -import java.io.File; -import java.io.IOException; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; - -/** - * An IIndex is the interface used to generate an index file, and to make queries on - * this index. - */ - -public interface IIndex { - /** - * Adds the given document to the index. - */ - void add(IDocument document, IIndexer indexer) throws IOException; - /** - * Empties the index. - */ - void empty() throws IOException; - /** - * Returns the index file on the disk. - */ - File getIndexFile(); - /** - * Returns the number of documents indexed. - */ - int getNumDocuments() throws IOException; - /** - * Returns the number of unique words indexed. - */ - int getNumWords() throws IOException; - /** - * Returns the path corresponding to a given document number - */ - String getPath(int documentNumber) throws IOException; - /** - * Ansers true if has some changes to save. - */ - boolean hasChanged(); - /** - * Returns the paths of the documents containing the given word. - */ - IQueryResult[] query(String word) throws IOException; - /** - * Returns all entries for a given word. - */ - IEntryResult[] queryEntries(char[] pattern) throws IOException; - /** - * Returns the paths of the documents whose names contain the given word. - */ - IQueryResult[] queryInDocumentNames(String word) throws IOException; - /** - * Returns the paths of the documents containing the given word prefix. - */ - IQueryResult[] queryPrefix(char[] prefix) throws IOException; - /** - * Removes the corresponding document from the index. - */ - void remove(String documentName) throws IOException; - /** - * Saves the index on the disk. - */ - void save() throws IOException; - /** - * @param path - * @return - */ - String[] getFileDependencies(IPath path) throws IOException; - String[] getFileDependencies(IFile file) throws IOException; - -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexer.java deleted file mode 100644 index 688b98cf2e3..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexer.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index; - -/** - * An IIndexer indexes ONE document at each time. It adds the document names and - * the words references to an IIndex. Each IIndexer can index certain types of document, and should - * not index the other files. - */ -public interface IIndexer { - /** - * Returns the file types the IIndexer handles. - */ - - String[] getFileTypes(); - /** - * Indexes the given document, adding the document name and the word references - * to this document to the given IIndex.The caller should use - * shouldIndex() first to determine whether this indexer handles - * the given type of file, and only call this method if so. - */ - - void index(IDocument document, IIndexerOutput output) throws java.io.IOException; - /** - * Sets the document types the IIndexer handles. - */ - - public void setFileTypes(String[] fileTypes); - /** - * Returns whether the IIndexer can index the given document or not. - */ - - public boolean shouldIndex(IDocument document); -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java deleted file mode 100644 index 19d575bb697..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index; - -/** - * This class represents the output from an indexer to an index - * for a single document. - */ - -public interface IIndexerOutput { - public void addDocument(IDocument document); - public void addRef(char[] word); - public void addRef(String word); - //For Dep Tree - public void addIncludeRef(char[] word); - public void addIncludeRef(String word); - public void addRelatives(String inclusion, String parent); -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IQueryResult.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IQueryResult.java deleted file mode 100644 index aceba9ec005..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/IQueryResult.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index; - -public interface IQueryResult { - String getPath(); -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/StringMatcher.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/StringMatcher.java deleted file mode 100644 index 48135ae87ad..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/StringMatcher.java +++ /dev/null @@ -1,389 +0,0 @@ -package org.eclipse.cdt.internal.core.index; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.util.Vector; - -public class StringMatcher { - protected String fPattern; - protected int fLength; // pattern length - protected boolean fIgnoreWildCards; - protected boolean fIgnoreCase; - protected boolean fHasLeadingStar; - protected boolean fHasTrailingStar; - protected String fSegments[]; //the given pattern is split into * separated segments - - /* boundary value beyond which we don't need to search in the text */ - protected int fBound= 0; - - protected static final char fSingleWildCard= '\u0000'; - - public static class Position { - int start; //inclusive - int end; //exclusive - public Position(int start, int end) { - this.start= start; - this.end= end; - } - public int getStart() { - return start; - } - public int getEnd() { - return end; - } - } - - /** - * Find the first occurrence of the pattern between startend(exclusive). - * @param text, the String object to search in - * @param start, the starting index of the search range, inclusive - * @param end, the ending index of the search range, exclusive - * @return an StringMatcher.Position object that keeps the starting - * (inclusive) and ending positions (exclusive) of the first occurrence of the - * pattern in the specified range of the text; return null if not found or subtext - * is empty (start==end). A pair of zeros is returned if pattern is empty string - * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc" - * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned - */ - - public StringMatcher.Position find(String text, int start, int end) { - if (fPattern == null || text == null) - throw new IllegalArgumentException(); - - int tlen= text.length(); - if (start < 0) - start= 0; - if (end > tlen) - end= tlen; - if (end < 0 || start >= end) - return null; - if (fLength == 0) - return new Position(start, start); - if (fIgnoreWildCards) { - int x= posIn(text, start, end); - if (x < 0) - return null; - return new Position(x, x + fLength); - } - - int segCount= fSegments.length; - if (segCount == 0) //pattern contains only '*'(s) - return new Position(start, end); - - int curPos= start; - int matchStart= -1; - for (int i= 0; i < segCount && curPos < end; ++i) { - String current= fSegments[i]; - int nextMatch= regExpPosIn(text, curPos, end, current); - if (nextMatch < 0) - return null; - if (i == 0) - matchStart= nextMatch; - curPos= nextMatch + current.length(); - } - return new Position(matchStart, curPos); - } - /** - * StringMatcher constructor takes in a String object that is a simple - * pattern which may contain *  for 0 and many characters and - * ?  for exactly one character. Also takes as parameter a boolean object - * specifying if case should be ignored - * @deprecated Use StringMatcher(pattern, ignoreCase, ignoreWildCards). - */ - public StringMatcher(String aPattern, boolean ignoreCase) { - this(aPattern, ignoreCase, false); - } - /** - * StringMatcher constructor takes in a String object that is a simple - * pattern which may contain *  for 0 and many characters and - * ?  for exactly one character. - * - * Literal '*' and '?' characters must be escaped in the pattern - * e.g., "\*" means literal "*", etc. - * - * Escaping any other character (including the escape character itself), - * just results in that character in the pattern. - * e.g., "\a" means "a" and "\\" means "\" - * - * If invoking the StringMatcher with string literals in Java, don't forget - * escape characters are represented by "\\". - * - * @param aPattern the pattern to match text against - * @param ignoreCase if true, case is ignored - * @param ignoreWildCards if true, wild cards and their escape sequences are ignored - * (everything is taken literally). - */ - public StringMatcher(String aPattern, boolean ignoreCase, boolean ignoreWildCards) { - fIgnoreCase= ignoreCase; - fIgnoreWildCards= ignoreWildCards; - fLength= aPattern.length(); - - /* convert case */ - if (fIgnoreCase) { - fPattern= aPattern.toUpperCase(); - } else { - fPattern= aPattern; - } - - if (fIgnoreWildCards) { - parseNoWildCards(); - } else { - parseWildCards(); - } - } - /** - * Given the starting (inclusive) and the ending (exclusive) poisitions in the - * text, determine if the given substring matches with aPattern - * @return true if the specified portion of the text matches the pattern - * @param String text, a String object that contains the substring to match - * @param int start marks the starting position (inclusive) of the substring - * @param int end marks the ending index (exclusive) of the substring - */ - public boolean match(String text, int start, int end) { - if (null == fPattern || null == text) - throw new IllegalArgumentException(); - - if (start > end) - return false; - - if (fIgnoreWildCards) - return fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); - int segCount= fSegments.length; - if (segCount == 0) //pattern contains only '*'(s) or empty pattern - return true; - if (start == end) - return fLength == 0; - if (fLength == 0) - return start == end; - - int tlen= text.length(); - if (start < 0) - start= 0; - if (end > tlen) - end= tlen; - - int tCurPos= start; - int bound= end - fBound; - if (bound < 0) - return false; - int i= 0; - String current= fSegments[i]; - int segLength= current.length(); - - /* process first segment */ - if (!fHasLeadingStar) { - if (!regExpRegionMatches(text, start, current, 0, segLength)) { - return false; - } else { - ++i; - tCurPos= tCurPos + segLength; - } - } - - /* process middle segments */ - for (; i < segCount && tCurPos <= bound; ++i) { - current= fSegments[i]; - int currentMatch; - int k= current.indexOf(fSingleWildCard); - if (k < 0) { - currentMatch= textPosIn(text, tCurPos, end, current); - if (currentMatch < 0) - return false; - } else { - currentMatch= regExpPosIn(text, tCurPos, end, current); - if (currentMatch < 0) - return false; - } - tCurPos= currentMatch + current.length(); - } - - /* process final segment */ - if (!fHasTrailingStar && tCurPos != end) { - int clen= current.length(); - return regExpRegionMatches(text, end - clen, current, 0, clen); - } - return i == segCount; - } - /** - * match the given text with the pattern - * @return true if matched eitherwise false - * @param text, a String object - */ - public boolean match(String text) { - return match(text, 0, text.length()); - } - /** - * This method parses the given pattern into segments seperated by wildcard '*' characters. - * Since wildcards are not being used in this case, the pattern consists of a single segment. - */ - private void parseNoWildCards() { - fSegments= new String[1]; - fSegments[0]= fPattern; - fBound= fLength; - } - /** - * This method parses the given pattern into segments seperated by wildcard '*' characters. - * @param p, a String object that is a simple regular expression with *  and/or ?  - */ - private void parseWildCards() { - if (fPattern.startsWith("*")) //$NON-NLS-1$ - fHasLeadingStar= true; - if (fPattern.endsWith("*")) { //$NON-NLS-1$ - /* make sure it's not an escaped wildcard */ - if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') { - fHasTrailingStar= true; - } - } - - Vector temp= new Vector(); - - int pos= 0; - StringBuffer buf= new StringBuffer(); - while (pos < fLength) { - char c= fPattern.charAt(pos++); - switch (c) { - case '\\' : - if (pos >= fLength) { - buf.append(c); - } else { - char next= fPattern.charAt(pos++); - /* if it's an escape sequence */ - if (next == '*' || next == '?' || next == '\\') { - buf.append(next); - } else { - /* not an escape sequence, just insert literally */ - buf.append(c); - buf.append(next); - } - } - break; - case '*' : - if (buf.length() > 0) { - /* new segment */ - temp.addElement(buf.toString()); - fBound += buf.length(); - buf.setLength(0); - } - break; - case '?' : - /* append special character representing single match wildcard */ - buf.append(fSingleWildCard); - break; - default : - buf.append(c); - } - } - - /* add last buffer to segment list */ - if (buf.length() > 0) { - temp.addElement(buf.toString()); - fBound += buf.length(); - } - - fSegments= new String[temp.size()]; - temp.copyInto(fSegments); - } - /** - * @param text, a string which contains no wildcard - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int posIn(String text, int start, int end) { //no wild card in pattern - int max= end - fLength; - - if (!fIgnoreCase) { - int i= text.indexOf(fPattern, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i= start; i <= max; ++i) { - if (text.regionMatches(true, i, fPattern, 0, fLength)) - return i; - } - - return -1; - } - /** - * @param text, a simple regular expression that may only contain '?'(s) - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @param p, a simple regular expression that may contains '?' - * @param caseIgnored, wether the pattern is not casesensitive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int regExpPosIn(String text, int start, int end, String p) { - int plen= p.length(); - - int max= end - plen; - for (int i= start; i <= max; ++i) { - if (regExpRegionMatches(text, i, p, 0, plen)) - return i; - } - return -1; - } - /** - * - * @return boolean - * @param text, a String to match - * @param start, int that indicates the starting index of match, inclusive - * @param end int that indicates the ending index of match, exclusive - * @param p, String, String, a simple regular expression that may contain '?' - * @param ignoreCase, boolean indicating wether code>p is case sensitive - */ - protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) { - while (plen-- > 0) { - char tchar= text.charAt(tStart++); - char pchar= p.charAt(pStart++); - - /* process wild cards */ - if (!fIgnoreWildCards) { - /* skip single wild cards */ - if (pchar == fSingleWildCard) { - continue; - } - } - if (pchar == tchar) - continue; - if (fIgnoreCase) { - char tc= Character.toUpperCase(tchar); - if (tc == pchar) - continue; - } - return false; - } - return true; - } - /** - * @param text, the string to match - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @param code>p, a string that has no wildcard - * @param ignoreCase, boolean indicating wether code>p is case sensitive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int textPosIn(String text, int start, int end, String p) { - - int plen= p.length(); - int max= end - plen; - - if (!fIgnoreCase) { - int i= text.indexOf(p, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i= 0; i <= max; ++i) { - if (text.regionMatches(true, i, p, 0, plen)) - return i; - } - - return -1; - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Block.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Block.java deleted file mode 100644 index c2b1360af1c..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Block.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; -import java.io.RandomAccessFile; - -/** - * A block is a container that can hold information (a list of file names, a list of - * words, ...), be saved on the disk and loaded in memory. - */ - -public abstract class Block { - /** - * Size of the block - */ - protected int blockSize; - - /** - * Field in which the information is stored - */ - protected Field field; - - public Block(int blockSize) { - this.blockSize= blockSize; - field= new Field(blockSize); - } - /** - * Empties the block. - */ - public void clear() { - field.clear(); - } - /** - * Flushes the block - */ - public void flush() { - } - /** - * Loads the block with the given number in memory, reading it from a RandomAccessFile. - */ - public void read(RandomAccessFile raf, int blockNum) throws IOException { - raf.seek(blockNum * (long) blockSize); - raf.readFully(field.buffer()); - } - /** - * Writes the block in a RandomAccessFile, giving it a block number. - */ - public void write(RandomAccessFile raf, int blockNum) throws IOException { - raf.seek(blockNum * (long) blockSize); - raf.write(field.buffer()); - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java deleted file mode 100644 index 7cebcc52297..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java +++ /dev/null @@ -1,474 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.ArrayList; - -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.IQueryResult; -import org.eclipse.cdt.internal.core.util.LRUCache; - -/** - * This input is used for reading indexes saved using a BlocksIndexOutput. - */ -public class BlocksIndexInput extends IndexInput { - public static final int CACHE_SIZE= 16; // Cache 16 blocks of 8K each, for a cache size of 128K - protected FileListBlock currentFileListBlock; - protected int currentFileListBlockNum; - protected int currentIndexBlockNum; - protected IndexBlock currentIndexBlock; - protected IndexBlock currentIncludeIndexBlock; - private RandomAccessFile raf; - protected File indexFile; - protected LRUCache blockCache; - protected boolean opened= false; - protected IndexSummary summary; - - public BlocksIndexInput(File inputFile) { - this.indexFile= inputFile; - blockCache= new LRUCache(CACHE_SIZE); - } - /** - * @see IndexInput#clearCache() - */ - public void clearCache() { - blockCache= new LRUCache(CACHE_SIZE); - } - /** - * @see IndexInput#close() - */ - public void close() throws IOException { - if (opened) { - summary= null; - opened= false; - if (raf != null) - raf.close(); - } - } - /** - * @see IndexInput#getCurrentFile() - */ - public IndexedFile getCurrentFile() throws IOException { - if (!hasMoreFiles()) - return null; - IndexedFile file= null; - if ((file= currentFileListBlock.getFile(filePosition)) == null) { - currentFileListBlockNum= summary.getBlockNumForFileNum(filePosition); - currentFileListBlock= getFileListBlock(currentFileListBlockNum); - file= currentFileListBlock.getFile(filePosition); - } - return file; - } - /** - * Returns the entry corresponding to the given word. - */ - protected WordEntry getEntry(char[] word) throws IOException { - int blockNum= summary.getBlockNumForWord(word); - if (blockNum == -1) return null; - IndexBlock block= getIndexBlock(blockNum); - return block.findExactEntry(word); - } - /** - * Returns the FileListBlock with the given number. - */ - protected FileListBlock getFileListBlock(int blockNum) throws IOException { - Integer key= new Integer(blockNum); - Block block= (Block) blockCache.get(key); - if (block != null && block instanceof FileListBlock) - return (FileListBlock) block; - FileListBlock fileListBlock= new FileListBlock(IIndexConstants.BLOCK_SIZE); - fileListBlock.read(raf, blockNum); - blockCache.put(key, fileListBlock); - return fileListBlock; - } - /** - * Returns the IndexBlock (containing words) with the given number. - */ - protected IndexBlock getIndexBlock(int blockNum) throws IOException { - Integer key= new Integer(blockNum); - Block block= (Block) blockCache.get(key); - if (block != null && block instanceof IndexBlock) - return (IndexBlock) block; - IndexBlock indexBlock= new GammaCompressedIndexBlock(IIndexConstants.BLOCK_SIZE); - indexBlock.read(raf, blockNum); - blockCache.put(key, indexBlock); - return indexBlock; - } - /** - * @see IndexInput#getIndexedFile(int) - */ - public IndexedFile getIndexedFile(int fileNum) throws IOException { - int blockNum= summary.getBlockNumForFileNum(fileNum); - if (blockNum == -1) - return null; - FileListBlock block= getFileListBlock(blockNum); - return block.getFile(fileNum); - } - /** - * @see IndexInput#getIndexedFile(IDocument) - */ - public IndexedFile getIndexedFile(IDocument document) throws java.io.IOException { - setFirstFile(); - String name= document.getName(); - while (hasMoreFiles()) { - IndexedFile file= getCurrentFile(); - String path= file.getPath(); - if (path.equals(name)) - return file; - moveToNextFile(); - } - return null; - } - /** - * Returns the list of numbers of files containing the given word. - */ - - protected int[] getMatchingFileNumbers(char[] word) throws IOException { - int blockNum= summary.getBlockNumForWord(word); - if (blockNum == -1) - return new int[0]; - IndexBlock block= getIndexBlock(blockNum); - WordEntry entry= block.findExactEntry(word); - return entry == null ? new int[0] : entry.getRefs(); - } - /** - * @see IndexInput#getNumFiles() - */ - public int getNumFiles() { - return summary.getNumFiles(); - } - /** - * @see IndexInput#getNumWords() - */ - public int getNumWords() { - return summary.getNumWords(); - } - /** - * @see IndexInput#getNumIncludes() - */ - public int getNumIncludes() { - return summary.getNumIncludes(); - } - /** - * @see IndexInput#getSource() - */ - public Object getSource() { - return indexFile; - } - /** - * Initialises the blocksIndexInput - */ - protected void init() throws IOException { - clearCache(); - setFirstFile(); - setFirstWord(); - setFirstInclude(); - } - /** - * @see IndexInput#moveToNextFile() - */ - public void moveToNextFile() throws IOException { - filePosition++; - } - /** - * @see IndexInput#moveToNextWordEntry() - */ - public void moveToNextWordEntry() throws IOException { - wordPosition++; - if (!hasMoreWords()) { - return; - } - //if end of the current block, we load the next one. - boolean endOfBlock= !currentIndexBlock.nextEntry(currentWordEntry); - if (endOfBlock) { - currentIndexBlock= getIndexBlock(++currentIndexBlockNum); - currentIndexBlock.nextEntry(currentWordEntry); - } - } - /** - * @see IndexInput#open() - */ - - public void open() throws IOException { - if (!opened) { - raf= new SafeRandomAccessFile(indexFile, "r"); //$NON-NLS-1$ - String sig= raf.readUTF(); - if (!sig.equals(IIndexConstants.SIGNATURE)) - throw new IOException(Util.bind("exception.wrongFormat")); //$NON-NLS-1$ - int summaryBlockNum= raf.readInt(); - raf.seek(summaryBlockNum * (long) IIndexConstants.BLOCK_SIZE); - summary= new IndexSummary(); - summary.read(raf); - init(); - opened= true; - } - } - /** - * @see IndexInput#query(String) - */ - public IQueryResult[] query(String word) throws IOException { - open(); - int[] fileNums= getMatchingFileNumbers(word.toCharArray()); - int size= fileNums.length; - IQueryResult[] files= new IQueryResult[size]; - for (int i= 0; i < size; ++i) { - files[i]= getIndexedFile(fileNums[i]); - } - return files; - } - /** - * If no prefix is provided in the pattern, then this operation will have to walk - * all the entries of the whole index. - */ - public IEntryResult[] queryEntriesMatching(char[] pattern/*, boolean isCaseSensitive*/) throws IOException { - open(); - - if (pattern == null || pattern.length == 0) return null; - int[] blockNums = null; - int firstStar = CharOperation.indexOf('*', pattern); - switch (firstStar){ - case -1 : - WordEntry entry = getEntry(pattern); - if (entry == null) return null; - return new IEntryResult[]{ new EntryResult(entry.getWord(), entry.getRefs()) }; - case 0 : - blockNums = summary.getAllBlockNums(); - break; - default : - char[] prefix = CharOperation.subarray(pattern, 0, firstStar); - blockNums = summary.getBlockNumsForPrefix(prefix); - } - if (blockNums == null || blockNums.length == 0) return null; - - IEntryResult[] entries = new IEntryResult[5]; - int count = 0; - for (int i = 0, max = blockNums.length; i < max; i++) { - IndexBlock block = getIndexBlock(blockNums[i]); - block.reset(); - boolean found = false; - WordEntry entry = new WordEntry(); - while (block.nextEntry(entry)) { - if (CharOperation.match(entry.getWord(), pattern, true)) { - if (count == entries.length){ - System.arraycopy(entries, 0, entries = new IEntryResult[count*2], 0, count); - } - entries[count++] = new EntryResult(entry.getWord(), entry.getRefs()); - found = true; - } else { - if (found) break; - } - } - } - if (count != entries.length){ - System.arraycopy(entries, 0, entries = new IEntryResult[count], 0, count); - } - return entries; - } - public IEntryResult[] queryEntriesPrefixedBy(char[] prefix) throws IOException { - open(); - - int blockLoc = summary.getFirstBlockLocationForPrefix(prefix); - if (blockLoc < 0) return null; - - IEntryResult[] entries = new IEntryResult[5]; - int count = 0; - while(blockLoc >= 0){ - IndexBlock block = getIndexBlock(summary.getBlockNum(blockLoc)); - block.reset(); - boolean found = false; - WordEntry entry = new WordEntry(); - while (block.nextEntry(entry)) { - if (CharOperation.prefixEquals(prefix, entry.getWord())) { - if (count == entries.length){ - System.arraycopy(entries, 0, entries = new IEntryResult[count*2], 0, count); - } - entries[count++] = new EntryResult(entry.getWord(), entry.getRefs()); - found = true; - } else { - if (found) break; - } - } - /* consider next block ? */ - blockLoc = summary.getNextBlockLocationForPrefix(prefix, blockLoc); - } - if (count == 0) return null; - if (count != entries.length){ - System.arraycopy(entries, 0, entries = new IEntryResult[count], 0, count); - } - return entries; - } - public IQueryResult[] queryFilesReferringToPrefix(char[] prefix) throws IOException { - open(); - - int blockLoc = summary.getFirstBlockLocationForPrefix(prefix); - if (blockLoc < 0) return null; - - // each filename must be returned already once - org.eclipse.cdt.internal.core.search.HashtableOfInt fileMatches = new org.eclipse.cdt.internal.core.search.HashtableOfInt(20); - int count = 0; - while(blockLoc >= 0){ - IndexBlock block = getIndexBlock(summary.getBlockNum(blockLoc)); - block.reset(); - boolean found = false; - WordEntry entry = new WordEntry(); - while (block.nextEntry(entry)) { - if (CharOperation.prefixEquals(prefix, entry.getWord()/*, isCaseSensitive*/)) { - int [] refs = entry.getRefs(); - for (int i = 0, max = refs.length; i < max; i++){ - int ref = refs[i]; - if (!fileMatches.containsKey(ref)){ - count++; - fileMatches.put(ref, getIndexedFile(ref)); - } - } - found = true; - } else { - if (found) break; - } - } - /* consider next block ? */ - blockLoc = summary.getNextBlockLocationForPrefix(prefix, blockLoc); - } - /* extract indexed files */ - IQueryResult[] files = new IQueryResult[count]; - Object[] indexedFiles = fileMatches.valueTable; - for (int i = 0, index = 0, max = indexedFiles.length; i < max; i++){ - IndexedFile indexedFile = (IndexedFile) indexedFiles[i]; - if (indexedFile != null){ - files[index++] = indexedFile; - } - } - return files; - } - /** - * @see IndexInput#queryInDocumentNames(String) - */ - public IQueryResult[] queryInDocumentNames(String word) throws IOException { - open(); - ArrayList matches= new ArrayList(); - setFirstFile(); - while (hasMoreFiles()) { - IndexedFile file= getCurrentFile(); - if (file.getPath().indexOf(word) != -1) - matches.add(file); - moveToNextFile(); - } - IQueryResult[] match= new IQueryResult[matches.size()]; - matches.toArray(match); - return match; - } - /** - * @see IndexInput#setFirstFile() - */ - - protected void setFirstFile() throws IOException { - filePosition= 1; - if (getNumFiles() > 0) { - currentFileListBlockNum= summary.getBlockNumForFileNum(1); - currentFileListBlock= getFileListBlock(currentFileListBlockNum); - } - } - /** - * @see IndexInput#setFirstWord() - */ - - protected void setFirstWord() throws IOException { - wordPosition= 1; - if (getNumWords() > 0) { - currentIndexBlockNum= summary.getFirstWordBlockNum(); - currentIndexBlock= getIndexBlock(currentIndexBlockNum); - currentWordEntry= new WordEntry(); - currentIndexBlock.reset(); - currentIndexBlock.nextEntry(currentWordEntry); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.index.impl.IndexInput#moveToNextIncludeEntry() - */ - public void moveToNextIncludeEntry() throws IOException { - includePosition++; - if (!hasMoreIncludes()) { - return; - } - //if end of the current block, we load the next one. - boolean endOfBlock= !currentIncludeIndexBlock.nextEntry(currentIncludeEntry); - if (endOfBlock) { - currentIncludeIndexBlock= getIndexBlock(++currentIndexBlockNum); - currentIncludeIndexBlock.nextEntry(currentWordEntry); - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.index.impl.IndexInput#setFirstInclude() - */ - protected void setFirstInclude() throws IOException { - includePosition= 1; - if (getNumIncludes() > 0) { - currentIndexBlockNum= summary.getFirstIncludeBlockNum(); - currentIncludeIndexBlock= getIndexBlock(currentIndexBlockNum); - currentIncludeEntry= new IncludeEntry(0); - currentIncludeIndexBlock.reset(); - currentIncludeIndexBlock.nextEntry(currentIncludeEntry); - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.index.impl.IndexInput#queryIncludeEntries() - */ - public IncludeEntry[] queryIncludeEntries() { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.index.impl.IndexInput#queryIncludeEntries(int) - */ - public IncludeEntry[] queryIncludeEntries(int fileNum) throws IOException { - open(); - - if (fileNum < 0) return null; - int[] blockNums = null; - blockNums = summary.getBlockNumsForIncludes(); - - if (blockNums == null || blockNums.length == 0) return null; - - IncludeEntry[] entries = new IncludeEntry[5]; - int count = 0; - for (int i = 0, max = blockNums.length; i < max; i++) { - IndexBlock block = getIndexBlock(blockNums[i]); - block.reset(); - boolean found = false; - IncludeEntry entry = new IncludeEntry(0); - - while (block.nextEntry(entry)) { - if (count == entries.length){ - System.arraycopy(entries, 0, entries = new IncludeEntry[count*2], 0, count); - } - for (int j=0; j - * - Signature of the file;
    - * - FileListBlocks;
    - * - IndexBlocks;
    - * - Summary of the index. - */ - -public class BlocksIndexOutput extends IndexOutput { - - protected RandomAccessFile indexOut; - protected int blockNum; - protected boolean opened= false; - protected File indexFile; - - protected FileListBlock fileListBlock; - protected IndexBlock indexBlock; - protected IndexBlock includeIndexBlock; - - protected int numWords= 0; - protected int numFiles= 0; - protected int numIncludes= 0; - protected IndexSummary summary; - - protected boolean firstInBlock; - protected boolean firstIndexBlock; - protected boolean firstFileListBlock; - protected boolean firstIncludeIndexBlock; - - public BlocksIndexOutput(File indexFile) { - this.indexFile= indexFile; - summary= new IndexSummary(); - blockNum= 1; - firstInBlock= true; - firstIndexBlock= true; - firstFileListBlock= true; - firstIncludeIndexBlock=true; - } - /** - * @see IndexOutput#addFile - */ - public void addFile(IndexedFile indexedFile) throws IOException { - if (firstFileListBlock) { - firstInBlock= true; - fileListBlock= new FileListBlock(IIndexConstants.BLOCK_SIZE); - firstFileListBlock= false; - } - if (fileListBlock.addFile(indexedFile)) { - if (firstInBlock) { - summary.addFirstFileInBlock(indexedFile, blockNum); - firstInBlock= false; - } - numFiles++; - } else { - if (fileListBlock.isEmpty()) { - return; - } - flushFiles(); - addFile(indexedFile); - } - } - /** - * @see IndexOutput#addWord - */ - public void addWord(WordEntry entry) throws IOException { - if (firstIndexBlock) { - indexBlock= new GammaCompressedIndexBlock(IIndexConstants.BLOCK_SIZE); - firstInBlock= true; - firstIndexBlock= false; - } - if (entry.getNumRefs() == 0) - return; - if (indexBlock.addEntry(entry)) { - if (firstInBlock) { - summary.addFirstWordInBlock(entry.getWord(), blockNum); - firstInBlock= false; - } - numWords++; - } else { - if (indexBlock.isEmpty()) { - return; - } - flushWords(); - addWord(entry); - } - } - /** - * @see IndexOutput#addInclude - */ - public void addInclude(IncludeEntry entry) throws IOException { - if (firstIncludeIndexBlock) { - includeIndexBlock= new GammaCompressedIndexBlock(IIndexConstants.BLOCK_SIZE); - firstInBlock= true; - firstIncludeIndexBlock= false; - } - if (entry.getNumRefs() == 0) - return; - if (includeIndexBlock.addIncludeEntry(entry)) { - if (firstInBlock) { - summary.addFirstIncludeInBlock(entry.getFile(), blockNum); - firstInBlock= false; - } - numIncludes++; - } else { - if (includeIndexBlock.isEmpty()) { - return; - } - flushIncludes(); - addInclude(entry); - } - } - /** - * @see IndexOutput#close - */ - public void close() throws IOException { - if (opened) { - indexOut.close(); - summary= null; - numFiles= 0; - opened= false; - } - } - /** - * @see IndexOutput#flush - */ - public void flush() throws IOException { - - summary.setNumFiles(numFiles); - summary.setNumWords(numWords); - summary.setNumIncludes(numIncludes); - indexOut.seek(blockNum * (long) IIndexConstants.BLOCK_SIZE); - summary.write(indexOut); - indexOut.seek(0); - indexOut.writeUTF(IIndexConstants.SIGNATURE); - indexOut.writeInt(blockNum); - } - /** - * Writes the current fileListBlock on the disk and initialises it - * (when it's full or it's the end of the index). - */ - protected void flushFiles() throws IOException { - if (!firstFileListBlock - && fileListBlock != null) { - fileListBlock.flush(); - fileListBlock.write(indexOut, blockNum++); - fileListBlock.clear(); - firstInBlock= true; - } - } - /** - * Writes the current indexBlock on the disk and initialises it - * (when it's full or it's the end of the index). - */ - protected void flushWords() throws IOException { - if (!firstInBlock - && indexBlock != null) { // could have added a document without any indexed word, no block created yet - indexBlock.flush(); - indexBlock.write(indexOut, blockNum++); - indexBlock.clear(); - firstInBlock= true; - } - } - /** - * - */ - protected void flushIncludes() throws IOException { - if (!firstInBlock - && includeIndexBlock != null) { // could have added a document without any indexed word, no block created yet - includeIndexBlock.flush(); - includeIndexBlock.write(indexOut, blockNum++); - includeIndexBlock.clear(); - firstInBlock= true; - } - - } - /** - * @see IndexOutput#getDestination - */ - public Object getDestination() { - return indexFile; - } - /** - * @see IndexOutput#open - */ - public void open() throws IOException { - if (!opened) { - summary= new IndexSummary(); - numFiles= 0; - numWords= 0; - numIncludes=0; - blockNum= 1; - firstInBlock= true; - firstIndexBlock= true; - firstFileListBlock= true; - firstIncludeIndexBlock=true; - indexOut= new SafeRandomAccessFile(this.indexFile, "rw"); //$NON-NLS-1$ - opened= true; - } - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java deleted file mode 100644 index 507616bd99a..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java +++ /dev/null @@ -1,343 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.UTFDataFormatException; - -public class CodeByteStream { - protected byte[] bytes; - protected int byteOffset= 0; - protected int bitOffset= 0; - protected int markByteOffset= -1; - protected int markBitOffset= -1; - - public CodeByteStream() { - this(16); - } - public CodeByteStream(byte[] bytes) { - this.bytes= bytes; - } - public CodeByteStream(int initialByteLength) { - bytes= new byte[initialByteLength]; - } - public int byteLength() { - return (bitOffset + 7) / 8 + byteOffset; - } - public byte[] getBytes(int startOffset, int endOffset) { - int byteLength= byteLength(); - if (startOffset > byteLength || endOffset > byteLength || startOffset > endOffset) - throw new IndexOutOfBoundsException(); - int length= endOffset - startOffset; - byte[] result= new byte[length]; - System.arraycopy(bytes, startOffset, result, 0, length); - if (endOffset == byteLength && bitOffset != 0) { - int mask= (1 << bitOffset) - 1; - result[length - 1] &= (mask << 8 - bitOffset); - } - return result; - } - protected void grow() { - byte[] newBytes= new byte[bytes.length * 2 + 1]; - System.arraycopy(bytes, 0, newBytes, 0, bytes.length); - bytes= newBytes; - } - public void mark() { - markByteOffset= byteOffset; - markBitOffset= bitOffset; - } - /** - * Reads a single bit (value == 0 or == 1). - */ - public int readBit() { - int value= (bytes[byteOffset] >> (7 - bitOffset)) & 1; - if (++bitOffset >= 8) { - bitOffset= 0; - ++byteOffset; - } - return value; - } - /** - * Read up to 32 bits from the stream. - */ - public int readBits(int numBits) { - int value= 0; - while (numBits > 0) { - int bitsToRead= 8 - bitOffset; - if (bitsToRead > numBits) - bitsToRead= numBits; - int mask= (1 << bitsToRead) - 1; - value |= ((bytes[byteOffset] >> (8 - bitOffset - bitsToRead)) & mask) << (numBits - bitsToRead); - numBits -= bitsToRead; - bitOffset += bitsToRead; - if (bitOffset >= 8) { - bitOffset -= 8; - byteOffset += 1; - } - } - return value; - } - public final int readByte() { - - // no need to rebuild byte value from bit sequences - if (bitOffset == 0) return bytes[byteOffset++] & 255; - - int value= 0; - int numBits = 8; - while (numBits > 0) { - int bitsToRead= 8 - bitOffset; - if (bitsToRead > numBits) - bitsToRead= numBits; - int mask= (1 << bitsToRead) - 1; - value |= ((bytes[byteOffset] >> (8 - bitOffset - bitsToRead)) & mask) << (numBits - bitsToRead); - numBits -= bitsToRead; - bitOffset += bitsToRead; - if (bitOffset >= 8) { - bitOffset -= 8; - byteOffset += 1; - } - } - return value; - } - /** - * Reads a value using Gamma coding. - */ - public int readGamma() { - int numBits= readUnary(); - return readBits(numBits - 1) | (1 << (numBits - 1)); - } - public char[] readUTF() throws UTFDataFormatException { - int utflen= readByte(); - if (utflen == 255) { - // long UTF - int high = readByte(); - int low = readByte(); - utflen = (high << 8) + low; - } - char str[]= new char[utflen]; - int count= 0; - int strlen= 0; - while (count < utflen) { - int c= readByte(); - int char2, char3; - switch (c >> 4) { - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - // 0xxxxxxx - count++; - str[strlen++]= (char) c; - break; - case 12 : - case 13 : - // 110x xxxx 10xx xxxx - count += 2; - if (count > utflen) - throw new UTFDataFormatException(); - char2= readByte(); - if ((char2 & 0xC0) != 0x80) - throw new UTFDataFormatException(); - str[strlen++]= (char) (((c & 0x1F) << 6) | (char2 & 0x3F)); - break; - case 14 : - // 1110 xxxx 10xx xxxx 10xx xxxx - count += 3; - if (count > utflen) - throw new UTFDataFormatException(); - char2= readByte(); - char3= readByte(); - if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) - throw new UTFDataFormatException(); - str[strlen++]= (char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0)); - break; - default : - // 10xx xxxx, 1111 xxxx - throw new UTFDataFormatException(); - } - } - if (strlen < utflen) - System.arraycopy(str, 0, str= new char[strlen], 0, strlen); - return str; - } - /** - * Reads a value in unary. - */ - public int readUnary() { - int value= 1; - int mask= 1 << (7 - bitOffset); - while ((bytes[byteOffset] & mask) != 0) { - ++value; - if (++bitOffset >= 8) { - bitOffset= 0; - ++byteOffset; - mask= 0x80; - } else { - mask >>>= 1; - } - } - // skip the 0 bit - if (++bitOffset >= 8) { - bitOffset= 0; - ++byteOffset; - } - return value; - } - public void reset() { - byteOffset= bitOffset= 0; - markByteOffset= markBitOffset= -1; - } - public void reset(byte[] bytes) { - this.bytes= bytes; - reset(); - } - public void reset(byte[] bytes, int byteOffset) { - reset(bytes); - this.byteOffset= byteOffset; - } - public boolean resetToMark() { - if (markByteOffset == -1) - return false; - byteOffset= markByteOffset; - bitOffset= markBitOffset; - markByteOffset= markBitOffset= -1; - return true; - } - public void skipBits(int numBits) { - int newOffset= byteOffset * 8 + bitOffset + numBits; - if (newOffset < 0 || (newOffset + 7) / 8 >= bytes.length) - throw new IllegalArgumentException(); - byteOffset= newOffset / 8; - bitOffset= newOffset % 8; - } - public byte[] toByteArray() { - return getBytes(0, byteLength()); - } - /** - * Writes a single bit (value == 0 or == 1). - */ - public void writeBit(int value) { - bytes[byteOffset] |= (value & 1) << (7 - bitOffset); - if (++bitOffset >= 8) { - bitOffset= 0; - if (++byteOffset >= bytes.length) - grow(); - } - } - /** - * Write up to 32 bits to the stream. - * The least significant numBits bits of value are written. - */ - public void writeBits(int value, int numBits) { - while (numBits > 0) { - int bitsToWrite= 8 - bitOffset; - if (bitsToWrite > numBits) - bitsToWrite= numBits; - int shift= 8 - bitOffset - bitsToWrite; - int mask= ((1 << bitsToWrite) - 1) << shift; - bytes[byteOffset]= (byte) ((bytes[byteOffset] & ~mask) | (((value >>> (numBits - bitsToWrite)) << shift) & mask)); - numBits -= bitsToWrite; - bitOffset += bitsToWrite; - if (bitOffset >= 8) { - bitOffset -= 8; - if (++byteOffset >= bytes.length) - grow(); - } - } - } - public void writeByte(int value) { - writeBits(value, 8); - } - /** - * Writes the given value using Gamma coding, in which positive integer x - * is represented by coding floor(log2(x) in unary followed by the value - * of x - 2**floor(log2(x)) in binary. - * The value must be >= 1. - */ - public void writeGamma(int value) { - if (value < 1) - throw new IllegalArgumentException(); - int temp= value; - int numBits= 0; - while (temp != 0) { - temp >>>= 1; - ++numBits; - } - writeUnary(numBits); - writeBits(value, numBits - 1); - } - public void writeUTF(char[] str, int start, int end) { - int utflen= 0; - for (int i= start; i < end; i++) { - int c= str[i]; - if ((c >= 0x0001) && (c <= 0x007F)) { - utflen++; - } else if (c > 0x07FF) { - utflen += 3; - } else { - utflen += 2; - } - } - if (utflen < 255) { - writeByte(utflen & 0xFF); - } else if (utflen > 65535) { - throw new IllegalArgumentException(); - } else { - writeByte(255); // marker for long UTF - writeByte((utflen >>> 8) & 0xFF); // high byte - writeByte((utflen >>> 0) & 0xFF); // low byte - } - for (int i= start; i < end; i++) { - int c= str[i]; - if ((c >= 0x0001) && (c <= 0x007F)) { - writeByte(c); - } else if (c > 0x07FF) { - writeByte(0xE0 | ((c >> 12) & 0x0F)); - writeByte(0x80 | ((c >> 6) & 0x3F)); - writeByte(0x80 | ((c >> 0) & 0x3F)); - } else { - writeByte(0xC0 | ((c >> 6) & 0x1F)); - writeByte(0x80 | ((c >> 0) & 0x3F)); - } - } - } - /** - * Write the given value in unary. The value must be >= 1. - */ - public void writeUnary(int value) { - if (value < 1) - throw new IllegalArgumentException(); - int mask= 1 << (7 - bitOffset); - // write N-1 1-bits - while (--value > 0) { - bytes[byteOffset] |= mask; - if (++bitOffset >= 8) { - bitOffset= 0; - if (++byteOffset >= bytes.length) - grow(); - mask= 0x80; - } else { - mask >>>= 1; - } - } - // write a 0-bit - bytes[byteOffset] &= ~mask; - if (++bitOffset >= 8) { - bitOffset= 0; - if (++byteOffset >= bytes.length) - grow(); - } - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java deleted file mode 100644 index 32867e1cec8..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; - - -public class EntryResult implements IEntryResult { - private char[] word; - private int[] fileRefs; - -public EntryResult(char[] word, int[] refs) { - this.word = word; - this.fileRefs = refs; -} -public boolean equals(Object anObject){ - - if (this == anObject) { - return true; - } - if ((anObject != null) && (anObject instanceof EntryResult)) { - EntryResult anEntryResult = (EntryResult) anObject; - if (!CharOperation.equals(this.word, anEntryResult.word)) return false; - - int length; - int[] refs, otherRefs; - if ((length = (refs = this.fileRefs).length) != (otherRefs = anEntryResult.fileRefs).length) return false; - for (int i = 0; i < length; i++){ - if (refs[i] != otherRefs[i]) return false; - } - return true; - } - return false; - -} -public int[] getFileReferences() { - return fileRefs; -} -public char[] getWord() { - return word; -} -public int hashCode(){ - return CharOperation.hashCode(word); -} -public String toString(){ - StringBuffer buffer = new StringBuffer(word.length * 2); - buffer.append("EntryResult: word="); //$NON-NLS-1$ - buffer.append(word); - buffer.append(", refs={"); //$NON-NLS-1$ - for (int i = 0; i < fileRefs.length; i++){ - if (i > 0) buffer.append(','); - buffer.append(' '); - buffer.append(fileRefs[i]); - } - buffer.append(" }"); //$NON-NLS-1$ - return buffer.toString(); -} -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Field.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Field.java deleted file mode 100644 index 9b4cfa2911e..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Field.java +++ /dev/null @@ -1,381 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.UTFDataFormatException; - -public class Field { - protected byte[] buffer; // contents - protected int offset; // offset of the field within the byte array - protected int length; // length of the field - - /** - * ByteSegment constructor comment. - */ - public Field(byte[] bytes) { - this.buffer= bytes; - this.offset= 0; - this.length= bytes.length; - } - /** - * ByteSegment constructor comment. - */ - public Field(byte[] bytes, int length) { - this.buffer= bytes; - this.offset= 0; - this.length= length; - } - /** - * ByteSegment constructor comment. - */ - public Field(byte[] bytes, int offset, int length) { - this.buffer= bytes; - this.offset= offset; - this.length= length; - } - /** - * Creates a new field containing an empty buffer of the given length. - */ - public Field(int length) { - this.buffer= new byte[length]; - this.offset= 0; - this.length= length; - } - public byte[] buffer() { - return buffer; - } - public Field buffer(byte[] buffer) { - this.buffer= buffer; - return this; - } - public Field clear() { - clear(buffer, offset, length); - return this; - } - protected static void clear(byte[] buffer, int offset, int length) { - int n= offset; - for (int i= 0; i < length; i++) { - buffer[n]= 0; - n++; - } - } - public Field clear(int length) { - clear(buffer, offset, length); - return this; - } - public Field clear(int offset, int length) { - clear(buffer, this.offset + offset, length); - return this; - } - protected static int compare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2) { - int n= Math.min(length1, length2); - for (int i= 0; i < n; i++) { - int j1= buffer1[offset1 + i] & 255; - int j2= buffer2[offset2 + i] & 255; - if (j1 > j2) - return 1; - if (j1 < j2) - return -1; - } - if (length1 > n) { - for (int i= n; i < length1; i++) - if (buffer1[offset1 + i] != 0) - return 1; - return 0; - } - for (int i= n; i < length2; i++) - if (buffer2[offset2 + i] != 0) - return -1; - return 0; - } - public static int compare(Field f1, Field f2) { - return compare(f1.buffer, f1.offset, f1.length, f2.buffer, f2.offset, f2.length); - } - // copy bytes from one offset to another within the field - public Field copy(int fromOffset, int toOffset, int length) { - System.arraycopy(buffer, offset + fromOffset, buffer, offset + toOffset, length); - return this; - } - public Field dec(int n) { - offset -= n; - return this; - } - public byte[] get() { - byte[] result= new byte[length]; - System.arraycopy(buffer, offset, result, 0, length); - return result; - } - public byte[] get(int offset, int length) { - byte[] result= new byte[length]; - System.arraycopy(buffer, this.offset + offset, result, 0, length); - return result; - } - public Field getField(int offset, int length) { - return new Field(buffer, this.offset + offset, length); - } - public int getInt1() { - return buffer[this.offset]; - } - public int getInt1(int offset) { - return buffer[this.offset + offset]; - } - public int getInt2() { - int i= this.offset; - int v= buffer[i++]; - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getInt2(int offset) { - int i= this.offset + offset; - int v= buffer[i++]; - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getInt3() { - int i= this.offset; - int v= buffer[i++]; - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getInt3(int offset) { - int i= this.offset + offset; - int v= buffer[i++]; - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getInt4() { - int i= this.offset; - int v= buffer[i++]; - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getInt4(int offset) { - int i= this.offset + offset; - int v= buffer[i++]; - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getUInt1() { - return buffer[this.offset] & 255; - } - public int getUInt1(int offset) { - return buffer[this.offset + offset] & 255; - } - public int getUInt2() { - int i= this.offset; - int v= (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getUInt2(int offset) { - int i= this.offset + offset; - int v= (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getUInt3() { - int i= this.offset; - int v= (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public int getUInt3(int offset) { - int i= this.offset + offset; - int v= (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - v= (v << 8) | (buffer[i++] & 255); - return v; - } - public char[] getUTF(int offset) throws UTFDataFormatException { - int pos= this.offset + offset; - int utflen= getUInt2(pos); - pos += 2; - char str[]= new char[utflen]; - int count= 0; - int strlen= 0; - while (count < utflen) { - int c= buffer[pos++] & 0xFF; - int char2, char3; - switch (c >> 4) { - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - // 0xxxxxxx - count++; - str[strlen++]= (char) c; - break; - case 12 : - case 13 : - // 110x xxxx 10xx xxxx - count += 2; - if (count > utflen) - throw new UTFDataFormatException(); - char2= buffer[pos++] & 0xFF; - if ((char2 & 0xC0) != 0x80) - throw new UTFDataFormatException(); - str[strlen++]= (char) (((c & 0x1F) << 6) | (char2 & 0x3F)); - break; - case 14 : - // 1110 xxxx 10xx xxxx 10xx xxxx - count += 3; - if (count > utflen) - throw new UTFDataFormatException(); - char2= buffer[pos++] & 0xFF; - char3= buffer[pos++] & 0xFF; - if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) - throw new UTFDataFormatException(); - str[strlen++]= (char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0)); - break; - default : - // 10xx xxxx, 1111 xxxx - throw new UTFDataFormatException(); - } - } - if (strlen < utflen) - System.arraycopy(str, 0, str= new char[strlen], 0, strlen); - return str; - } - public Field inc(int n) { - offset += n; - return this; - } - public int length() { - return length; - } - public Field length(int length) { - this.length= length; - return this; - } - /** - Returns the offset into the underlying byte array that this field is defined over. - */ - public int offset() { - return offset; - } - public Field offset(int offset) { - this.offset= offset; - return this; - } - public Field pointTo(int offset) { - return new Field(buffer, this.offset + offset, 0); - } - public Field put(byte[] b) { - return put(0, b); - } - public Field put(int offset, byte[] b) { - System.arraycopy(b, 0, buffer, this.offset + offset, b.length); - return this; - } - public Field put(int offset, Field f) { - System.arraycopy(f.buffer, f.offset, buffer, this.offset + offset, f.length); - return this; - } - public Field put(Field f) { - System.arraycopy(f.buffer, f.offset, buffer, offset, f.length); - return this; - } - public Field putInt1(int n) { - buffer[offset]= (byte) (n); - return this; - } - public Field putInt1(int offset, int n) { - buffer[this.offset + offset]= (byte) (n); - return this; - } - public Field putInt2(int n) { - int i= offset; - buffer[i++]= (byte) (n >> 8); - buffer[i++]= (byte) (n >> 0); - return this; - } - public Field putInt2(int offset, int n) { - int i= this.offset + offset; - buffer[i++]= (byte) (n >> 8); - buffer[i++]= (byte) (n >> 0); - return this; - } - public Field putInt3(int n) { - int i= offset; - buffer[i++]= (byte) (n >> 16); - buffer[i++]= (byte) (n >> 8); - buffer[i++]= (byte) (n >> 0); - return this; - } - public Field putInt3(int offset, int n) { - int i= this.offset + offset; - buffer[i++]= (byte) (n >> 16); - buffer[i++]= (byte) (n >> 8); - buffer[i++]= (byte) (n >> 0); - return this; - } - public Field putInt4(int n) { - int i= offset; - buffer[i++]= (byte) (n >> 24); - buffer[i++]= (byte) (n >> 16); - buffer[i++]= (byte) (n >> 8); - buffer[i++]= (byte) (n >> 0); - return this; - } - public Field putInt4(int offset, int n) { - int i= this.offset + offset; - buffer[i++]= (byte) (n >> 24); - buffer[i++]= (byte) (n >> 16); - buffer[i++]= (byte) (n >> 8); - buffer[i++]= (byte) (n >> 0); - return this; - } - public int putUTF(int offset, char[] str) { - int strlen= str.length; - int utflen= 0; - for (int i= 0; i < strlen; i++) { - int c= str[i]; - if ((c >= 0x0001) && (c <= 0x007F)) { - utflen++; - } else if (c > 0x07FF) { - utflen += 3; - } else { - utflen += 2; - } - } - if (utflen > 65535) - throw new IllegalArgumentException(); - int pos= this.offset + offset; - buffer[pos++]= (byte) ((utflen >>> 8) & 0xFF); - buffer[pos++]= (byte) ((utflen >>> 0) & 0xFF); - for (int i= 0; i < strlen; i++) { - int c= str[i]; - if ((c >= 0x0001) && (c <= 0x007F)) { - buffer[pos++]= ((byte) c); - } else if (c > 0x07FF) { - buffer[pos++]= ((byte) (0xE0 | ((c >> 12) & 0x0F))); - buffer[pos++]= ((byte) (0x80 | ((c >> 6) & 0x3F))); - buffer[pos++]= ((byte) (0x80 | ((c >> 0) & 0x3F))); - } else { - buffer[pos++]= ((byte) (0xC0 | ((c >> 6) & 0x1F))); - buffer[pos++]= ((byte) (0x80 | ((c >> 0) & 0x3F))); - } - } - return 2 + utflen; - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/FileListBlock.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/FileListBlock.java deleted file mode 100644 index cf746b72478..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/FileListBlock.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; -import java.util.ArrayList; - -public class FileListBlock extends Block { - - protected int offset= 0; - protected String prevPath= null; - protected String[] paths= null; - - public FileListBlock(int blockSize) { - super(blockSize); - } - /** - * add the name of the indexedfile to the buffr of the field. - * The name is not the entire name of the indexedfile, but the - * difference between its name and the name of the previous indexedfile ... - */ - public boolean addFile(IndexedFile indexedFile) { - int offset= this.offset; - if (isEmpty()) { - field.putInt4(offset, indexedFile.getFileNumber()); - offset += 4; - } - String path= indexedFile.getPath(); - int prefixLen= prevPath == null ? 0 : Util.prefixLength(prevPath, path); - int sizeEstimate= 2 + 2 + (path.length() - prefixLen) * 3; - if (offset + sizeEstimate > blockSize - 2) - return false; - field.putInt2(offset, prefixLen); - offset += 2; - char[] chars= new char[path.length() - prefixLen]; - path.getChars(prefixLen, path.length(), chars, 0); - offset += field.putUTF(offset, chars); - this.offset= offset; - prevPath= path; - return true; - } - public void clear() { - reset(); - super.clear(); - } - public void flush() { - if (offset > 0) { - field.putInt2(offset, 0); - field.putInt2(offset + 2, 0); - offset= 0; - } - } - public IndexedFile getFile(int fileNum) throws IOException { - IndexedFile resp= null; - try { - String[] paths= getPaths(); - int i= fileNum - field.getInt4(0); - resp= new IndexedFile(paths[i], fileNum); - } catch (Exception e) { - //fileNum too big - } - return resp; - } - /** - * Creates a vector of paths reading the buffer of the field. - */ - protected String[] getPaths() throws IOException { - if (paths == null) { - ArrayList v= new ArrayList(); - int offset= 4; - char[] prevPath= null; - for (;;) { - int prefixLen= field.getUInt2(offset); - offset += 2; - int utfLen= field.getUInt2(offset); - char[] path= field.getUTF(offset); - offset += 2 + utfLen; - if (prefixLen != 0) { - char[] temp= new char[prefixLen + path.length]; - System.arraycopy(prevPath, 0, temp, 0, prefixLen); - System.arraycopy(path, 0, temp, prefixLen, path.length); - path= temp; - } - if (path.length == 0) - break; - v.add(new String(path)); - prevPath= path; - } - paths= new String[v.size()]; - v.toArray(paths); - } - return paths; - } - public boolean isEmpty() { - return offset == 0; - } - public void reset() { - offset= 0; - prevPath= null; - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java deleted file mode 100644 index fce8d1733c0..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java +++ /dev/null @@ -1,190 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.UTFDataFormatException; - -/** - * Uses prefix coding on words, and gamma coding of document numbers differences. - */ -public class GammaCompressedIndexBlock extends IndexBlock { - CodeByteStream writeCodeStream= new CodeByteStream(); - CodeByteStream readCodeStream; - char[] prevWord= null; - int offset= 0; - - public GammaCompressedIndexBlock(int blockSize) { - super(blockSize); - readCodeStream= new CodeByteStream(field.buffer()); - } - /** - * @see IndexBlock#addEntry - */ - public boolean addEntry(WordEntry entry) { - writeCodeStream.reset(); - encodeEntry(entry, prevWord, writeCodeStream); - if (offset + writeCodeStream.byteLength() > this.blockSize - 2) { - return false; - } - byte[] bytes= writeCodeStream.toByteArray(); - field.put(offset, bytes); - offset += bytes.length; - prevWord= entry.getWord(); - return true; - } - protected void encodeEntry(WordEntry entry, char[] prevWord, CodeByteStream codeStream) { - char[] word= entry.getWord(); - int prefixLen= prevWord == null ? 0 : Util.prefixLength(prevWord, word); - codeStream.writeByte(prefixLen); - codeStream.writeUTF(word, prefixLen, word.length); - int n= entry.getNumRefs(); - codeStream.writeGamma(n); - int prevRef= 0; - for (int i= 0; i < n; ++i) { - int ref= entry.getRef(i); - if (ref <= prevRef) - throw new IllegalArgumentException(); - codeStream.writeGamma(ref - prevRef); - prevRef= ref; - } - } - /** - * @see IndexBlock#addEntry - */ - public boolean addIncludeEntry(IncludeEntry entry) { - writeCodeStream.reset(); - encodeEntry(entry, prevWord, writeCodeStream); - if (offset + writeCodeStream.byteLength() > this.blockSize - 2) { - return false; - } - byte[] bytes= writeCodeStream.toByteArray(); - field.put(offset, bytes); - offset += bytes.length; - prevWord= entry.getFile(); - return true; - } - /** - * @param entry - * @param prevWord - * @param writeCodeStream - */ - protected void encodeEntry(IncludeEntry entry, char[] prevWord, CodeByteStream codeStream) { - char[] file= entry.getFile(); - int prefixLen= prevWord == null ? 0 : Util.prefixLength(prevWord, file); - codeStream.writeByte(prefixLen); - codeStream.writeUTF(file, prefixLen, file.length); - int n= entry.getNumRefs(); - codeStream.writeGamma(n); - int prevRef= 0; - for (int i= 0; i < n; ++i) { - int ref= entry.getRef(i); - if (ref <= prevRef) - throw new IllegalArgumentException(); - codeStream.writeGamma(ref - prevRef); - prevRef= ref; - } - - } - /** - * @see IndexBlock#flush - */ - public void flush() { - if (offset > 0) { - field.putInt2(offset, 0); - offset= 0; - prevWord= null; - } - } - /** - * @see IndexBlock#isEmpty - */ - public boolean isEmpty() { - return offset == 0; - } - /** - * @see IndexBlock#nextEntry - */ - public boolean nextEntry(WordEntry entry) { - try { - readCodeStream.reset(field.buffer(), offset); - int prefixLength= readCodeStream.readByte(); - char[] word= readCodeStream.readUTF(); - if (prevWord != null && prefixLength > 0) { - char[] temp= new char[prefixLength + word.length]; - System.arraycopy(prevWord, 0, temp, 0, prefixLength); - System.arraycopy(word, 0, temp, prefixLength, word.length); - word= temp; - } - if (word.length == 0) { - return false; - } - entry.reset(word); - int n= readCodeStream.readGamma(); - int prevRef= 0; - for (int i= 0; i < n; ++i) { - int ref= prevRef + readCodeStream.readGamma(); - if (ref < prevRef) - throw new InternalError(); - entry.addRef(ref); - prevRef= ref; - } - offset= readCodeStream.byteLength(); - prevWord= word; - return true; - } catch (UTFDataFormatException e) { - return false; - } - } - /** - * @see IndexBlock#nextEntry - */ - public boolean nextEntry(IncludeEntry entry) { - try { - readCodeStream.reset(field.buffer(), offset); - int prefixLength= readCodeStream.readByte(); - char[] file= readCodeStream.readUTF(); - if (prevWord != null && prefixLength > 0) { - char[] temp= new char[prefixLength + file.length]; - System.arraycopy(prevWord, 0, temp, 0, prefixLength); - System.arraycopy(file, 0, temp, prefixLength, file.length); - file= temp; - } - if (file.length == 0) { - return false; - } - entry.reset(file); - int n= readCodeStream.readGamma(); - int prevRef= 0; - for (int i= 0; i < n; ++i) { - int ref= prevRef + readCodeStream.readGamma(); - if (ref < prevRef) - throw new InternalError(); - entry.addRef(ref); - prevRef= ref; - } - offset= readCodeStream.byteLength(); - prevWord= file; - return true; - } catch (UTFDataFormatException e) { - return false; - } - } - /** - * @see IndexBlock#reset - */ - public void reset() { - super.reset(); - offset= 0; - prevWord= null; - } - -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java deleted file mode 100644 index 9ac1afee68f..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.cdt.internal.core.CharOperation; - - -/** - * An IFileDocument represents an IFile. - */ - -public class IFileDocument extends PropertyDocument { - protected IFile file; - - // cached contents if needed - only one of them is used at a time - protected char[] charContents; - protected byte[] byteContents; - /** - * IFileDocument constructor comment. - */ - public IFileDocument(IFile file) { - this(file, (char[])null); - } - /** - * IFileDocument constructor comment. - */ - public IFileDocument(IFile file, byte[] byteContents) { - this.file= file; - this.byteContents= byteContents; - } - /** - * IFileDocument constructor comment. - */ - public IFileDocument(IFile file, char[] charContents) { - this.file= file; - this.charContents= charContents; - } - /** - * @see org.eclipse.jdt.internal.core.index.IDocument#getByteContent() - */ - public byte[] getByteContent() throws IOException { - if (byteContents != null) return byteContents; - IPath location = file.getLocation(); - if (location == null) return new byte[0]; - return byteContents = org.eclipse.cdt.internal.core.Util.getFileByteContent(location.toFile()); - } - /** - * @see org.eclipse.jdt.internal.core.index.IDocument#getCharContent() - */ - public char[] getCharContent() throws IOException { - if (charContents != null) return charContents; - IPath location = file.getLocation(); - if (location == null) return CharOperation.NO_CHAR; - return charContents = org.eclipse.cdt.internal.core.Util.getFileCharContent( - location.toFile(), - getEncoding()); - } - /** - * @see org.eclipse.jdt.internal.core.index.IDocument#getEncoding() - */ - public String getEncoding() { - //TODO: Indexer - get encoding - return null; - } - /** - * @see org.eclipse.jdt.internal.core.index.IDocument#getName() - */ - public String getName() { - return file.getFullPath().toString(); - } - /** - * @see org.eclipse.jdt.internal.core.index.IDocument#getStringContent() - */ - public String getStringContent() throws java.io.IOException { - return new String(getCharContent()); - } - /** - * @see org.eclipse.jdt.internal.core.index.IDocument#getType() - */ - public String getType() { - String extension= file.getFileExtension(); - if (extension == null) - return ""; //$NON-NLS-1$ - return extension; - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java deleted file mode 100644 index f464514d5d6..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -/** - * This interface provides constants used by the search engine. - */ -public interface IIndexConstants { - /** - * The signature of the index file. - */ - public static final String SIGNATURE= "INDEX FILE 0.014"; //$NON-NLS-1$ - /** - * The separator for files in the index file. - */ - public static final char FILE_SEPARATOR= '/'; - /** - * The size of a block for a Block. - */ - public static final int BLOCK_SIZE= 8192; -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java deleted file mode 100644 index 70c31e4e008..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java +++ /dev/null @@ -1,304 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.File; -import java.io.IOException; - -import org.eclipse.cdt.internal.core.index.IDocument; - -/** - * This index stores the document names in an ObjectVector, and the words in - * an HashtableOfObjects. - */ - -public class InMemoryIndex { - - /** - * hashtable of IncludeEntrys = includeFiles+numbers of the files they appear in. - */ - protected IncludeEntryHashedArray includes; - /** - * hashtable of WordEntrys = words+numbers of the files they appear in. - */ - protected WordEntryHashedArray words; - /** - * List of IndexedFiles = file name + a unique number. - */ - protected IndexedFileHashedArray files; - /** - * Size of the index. - */ - protected long footprint; - - private IncludeEntry[] sortedIncludeEntries; - private WordEntry[] sortedWordEntries; - private IndexedFile[] sortedFiles; - - private int lastId; - - public InMemoryIndex() { - includes= new IncludeEntryHashedArray(501); - init(); - } - - public IndexedFile addDocument(IDocument document) { - IndexedFile indexedFile= this.files.add(document); - this.footprint += indexedFile.footprint() + 4; - this.sortedFiles = null; - return indexedFile; - } - - public void addIncludeRef(IndexedFile indexedFile, char[] include) { - addIncludeRef(include, indexedFile.getFileNumber()); - } - - public void addIncludeRef(IndexedFile indexedFile, String include) { - addIncludeRef(include.toCharArray(), indexedFile.getFileNumber()); - } - - /** - * Adds the references of the include to the tree (reference = number of the file the include belongs to). - */ - protected void addIncludeRef(char[] include, int[] references) { - int size= references.length; - int i= 0; - while (i < size) { - if (references[i] != 0) - addIncludeRef(include, references[i]); - i++; - } - } - /** - * Looks if the include already exists to the tree and adds the fileNum to this include. - * If the include does not exist, it adds it to the tree. - */ - protected void addIncludeRef(char[] include, int fileNum) { - IncludeEntry entry= (IncludeEntry) this.includes.get(include); - if (entry == null) { - entry= new IncludeEntry(include, ++lastId); - entry.addRef(fileNum); - this.includes.add(entry); - this.sortedIncludeEntries= null; - //TODO: BOG FIGURE OUT FOOTPRINT - //this.footprint += entry.getClass(); //footprint(); - // - } else { - this.footprint += entry.addRef(fileNum); - } - } - - /** - * Adds the references of the word to the index (reference = number of the file the word belongs to). - */ - protected void addRef(char[] word, int[] references) { - int size= references.length; - int i= 0; - while (i < size) { - if (references[i] != 0) - addRef(word, references[i]); - i++; - } - } - /** - * Looks if the word already exists in the index and add the fileNum to this word. - * If the word does not exist, it adds it in the index. - */ - protected void addRef(char[] word, int fileNum) { - WordEntry entry= (WordEntry) this.words.get(word); - if (entry == null) { - entry= new WordEntry(word); - entry.addRef(fileNum); - this.words.add(entry); - this.sortedWordEntries= null; - this.footprint += entry.footprint(); - } else { - this.footprint += entry.addRef(fileNum); - } - } - - public void addRef(IndexedFile indexedFile, char[] word) { - addRef(word, indexedFile.getFileNumber()); - } - - public void addRef(IndexedFile indexedFile, String word) { - addRef(word.toCharArray(), indexedFile.getFileNumber()); - } - - public void addRelatives(IndexedFile indexedFile, String inclusion, String parent) { - addRelatives(indexedFile.getFileNumber(),inclusion.toCharArray(),(parent != null ) ? parent.toCharArray() : null); - } - - protected void addRelatives(int fileNumber, char[] inclusion, char[] parent) { - IncludeEntry childEntry=null; - IncludeEntry parentEntry=null; - - if (inclusion != null) - childEntry= (IncludeEntry) this.includes.get(inclusion); - - if (parent != null) - parentEntry= (IncludeEntry) this.includes.get(parent); - - - childEntry.addParent(fileNumber,(parentEntry!=null) ? parentEntry.getID() : -1); - - if (parent!=null) - parentEntry.addChild(fileNumber,(childEntry!=null) ? childEntry.getID() : -1); - } - /** - * Returns the footprint of the index. - */ - public long getFootprint() { - return this.footprint; - } - /** - * Returns the indexed files contained in the hashtable of includes. - */ - public IndexedFile[] getIndexedFiles(){ - return this.files.asArray(); - } - /** - * Returns the indexed file with the given path, or null if such file does not exist. - */ - public IndexedFile getIndexedFile(String path) { - return files.get(path); - } - /** - * Returns the include entries contained in the hashtable of includes. - */ - public IncludeEntry[] getIncludeEntries() { - return this.includes.asArray(); - } - /** - * Returns the include entry corresponding to the given include. - */ - protected IncludeEntry getIncludeEntry(char[] include) { - return (IncludeEntry) includes.get(include); - } - /** - * @see IIndex#getNumDocuments() - */ - public int getNumFiles() { - return files.size(); - } - /** - * @see IIndex#getNumWords() - */ - public int getNumWords() { - return words.elementSize; - } - - public int getNumIncludes() { - return includes.elementSize; - } - - /** - * Returns the words contained in the hashtable of words, sorted by alphabetical order. - */ - protected IndexedFile[] getSortedFiles() { - if (this.sortedFiles == null) { - IndexedFile[] indexedFiles= files.asArray(); - Util.sort(indexedFiles); - this.sortedFiles= indexedFiles; - } - return this.sortedFiles; - } - /** - * Returns the word entries contained in the hashtable of words, sorted by alphabetical order. - */ - protected WordEntry[] getSortedWordEntries() { - if (this.sortedWordEntries == null) { - WordEntry[] words= this.words.asArray(); - Util.sort(words); - this.sortedWordEntries= words; - } - return this.sortedWordEntries; - } - /** - * Returns the include entries contained in the hashtable of includeas, sorted by alphabetical order. - */ - protected IncludeEntry[] getSortedIncludeEntries() { - if (this.sortedIncludeEntries == null) { - IncludeEntry[] includes= this.includes.asArray(); - Util.sort(includes); - this.sortedIncludeEntries= includes; - } - return this.sortedIncludeEntries; - } - /** - * Returns the word entry corresponding to the given word. - */ - protected WordEntry getWordEntry(char[] word) { - return (WordEntry) words.get(word); - } - /** - * Initialises the fields of the index - */ - public void init() { - includes= new IncludeEntryHashedArray(501); - words= new WordEntryHashedArray(501); - files= new IndexedFileHashedArray(101); - footprint= 0; - lastId=0; - sortedWordEntries= null; - sortedFiles= null; - sortedIncludeEntries=null; - } - /** - * Saves the index in the given file. - * Structure of the saved Index : - * - IndexedFiles in sorted order. - * + example: - * "c:/com/a.cpp 1" - * "c:/com/b.cpp 2" - * - References with the words in sorted order - * + example: - * "classDecl/a 1" - * "classDecl/b 2" - * "ref/String 1 2" - */ - public void save(File file) throws IOException { - BlocksIndexOutput output= new BlocksIndexOutput(file); - save(output); - } - /** - * Saves the index in the given IndexOutput. - * Structure of the saved Index : - * - IndexedFiles in sorted order. - * + example: - * "c:/com/a.cpp 1" - * "c:/com/b.cpp 2" - * - References with the words in sorted order - * + example: - * "classDecl/a 1" - * "classDecl/b 2" - * "ref/String 1 2" - */ - protected void save(IndexOutput output) throws IOException { - boolean ok= false; - try { - output.open(); - IndexedFile[] indexedFiles= files.asArray(); - for (int i= 0, length = indexedFiles.length; i < length; ++i) - output.addFile(indexedFiles[i]); // written out in order BUT not alphabetical - getSortedWordEntries(); // init the slot - for (int i= 0, numWords= sortedWordEntries.length; i < numWords; ++i) - output.addWord(sortedWordEntries[i]); - output.flush(); - output.close(); - ok= true; - } finally { - if (!ok && output != null) - output.close(); - } - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntry.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntry.java deleted file mode 100644 index 7495ac6e54a..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntry.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.index.impl; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.sourcedependency.Node; - -/** - * @author bgheorgh - */ -public class IncludeEntry { - - protected char[] fFile; - protected int fId; - protected int fNumRefs; - protected int[] fRefs; - //TODO: BOG Consider making these arrays... - protected ArrayList fParent; - protected ArrayList fChild; - protected int fNumParent; - protected int fNumChild; - - public IncludeEntry(int id) { - this(CharOperation.NO_CHAR,id); - } - - public IncludeEntry(char[] file, int id) { - fFile = file; - fNumRefs= 0; - fRefs= new int[1]; - fId=id; - - fParent = new ArrayList(5); - fChild = new ArrayList(5); - fNumParent = 0; - fNumChild = 0; - } - /** - * Adds a reference and records the change in footprint. - */ - public int addRef(int fileNum) { - if (fNumRefs > 0 && fRefs[fNumRefs - 1] == fileNum) { - return 0; - } - if (fNumRefs < fRefs.length) { - fRefs[fNumRefs++]= fileNum; - return 0; - } - - int newSize= fNumRefs < 4 ? 4 : fNumRefs * 2; // so will start @ 1, grow to 4, 8, 16, 32, 64 etc. - System.arraycopy(fRefs, 0, fRefs= new int[newSize], 0, fNumRefs); - fRefs[fNumRefs++]= fileNum; - return (newSize - fNumRefs + 1) * 4; - } - - public void addParent(int fileRef, int parentId){ - Node newParent = new Node(fileRef,parentId); - fParent.add(newParent); - fNumParent++; - } - /** - * @param is - */ - public void addRefs(int[] refs) { - int[] newRefs= new int[fNumRefs + refs.length]; - int pos1= 0; - int pos2= 0; - int posNew= 0; - int compare; - int r1= 0; - int r2= 0; - while (pos1 < fNumRefs || pos2 < refs.length) { - if (pos1 >= fNumRefs) { - r2= refs[pos2]; - compare= -1; - } else if (pos2 >= refs.length) { - compare= 1; - r1= fRefs[pos1]; - } else { - r1= fRefs[pos1]; - r2= refs[pos2]; - compare= r2 - r1; - } - if (compare > 0) { - newRefs[posNew]= r1; - posNew++; - pos1++; - } else { - if (r2 != 0) { - newRefs[posNew]= r2; - posNew++; - } - pos2++; - } - } - fRefs= newRefs; - fNumRefs= posNew; - /*for (int i = 0; i < refs.length; i++) - addRef(refs[i]); - int[] newRefs = new int[fNumRefs]; - System.arraycopy(fRefs, 0, newRefs, 0, fNumRefs); - fRefs = newRefs; - Util.sort(fRefs);*/ - - } - - public void addChild(int fileRef, int parentId){ - Node newChild = new Node(fileRef,parentId); - fChild.add(newChild); - fNumChild++; - } - /** - * Returns the number of references, e.g. the number of files this word appears in. - */ - public int getNumRefs() { - return fNumRefs; - } - /** - * returns the file number in the i position in the list of references. - */ - public int getRef(int i) { - if (i < fNumRefs) return fRefs[i]; - throw new IndexOutOfBoundsException(); - } - /** - * Returns the references of the includeEntry (the number of the files it appears in). - */ - public int[] getRefs() { - int[] result= new int[fNumRefs]; - System.arraycopy(fRefs, 0, result, 0, fNumRefs); - return result; - } - /** - * returns the word of the includeEntry. - */ - public char[] getFile() { - return fFile; - } - /** - * Changes the references of the wordEntry to match the mapping. For example,
    - * if the current references are [1 3 4]
    - * and mapping is [1 2 3 4 5]
    - * in references 1 becomes mapping[1] = 2, 3->4, and 4->5
    - * => references = [2 4 5].
    - */ - public void mapRefs(int[] mappings) { - int position= 0; - for (int i= 0; i < fNumRefs; i++) { - int map= mappings[fRefs[i]]; - if (map != -1 && map != 0) - fRefs[position++]= map; - } - fNumRefs= position; - - //to be changed! - System.arraycopy(fRefs, 0, (fRefs= new int[fNumRefs]), 0, fNumRefs); - Util.sort(fRefs); - } - /** - * Clears the includeEntry. - */ - public void reset(char[] word) { - for (int i= fNumRefs; i-- > 0;) { - fRefs[i]= 0; - } - fNumRefs= 0; - fFile= word; - } - - public int getID(){ - return fId; - } - - public String toString() { - StringBuffer tempBuffer = new StringBuffer(); - tempBuffer.append(" 0) tempBuffer.append(','); - tempBuffer.append(' '); - tempBuffer.append(fRefs[i]); - } - tempBuffer.append("}, Parents:{"); - Iterator x = fParent.iterator(); - while (x.hasNext()) - { - Node tempNode = (Node) x.next(); - tempBuffer.append(tempNode.toString()); - if (x.hasNext()) { - tempBuffer.append(','); - tempBuffer.append(' '); - } - } - tempBuffer.append("}, Children:{"); - Iterator y = fChild.iterator(); - while (y.hasNext()) - { - Node tempNode = (Node) y.next(); - tempBuffer.append(tempNode.toString()); - if (y.hasNext()) { - tempBuffer.append(','); - tempBuffer.append(' '); - } - } - tempBuffer.append("} >"); - return tempBuffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntryHashedArray.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntryHashedArray.java deleted file mode 100644 index 3c7bc80c5b6..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IncludeEntryHashedArray.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.CharOperation; - -public final class IncludeEntryHashedArray { - - public IncludeEntry elements[]; - public int elementSize; // number of elements in the table - public int threshold; - - public IncludeEntryHashedArray(int size) { - if (size < 7) size = 7; - this.elements = new IncludeEntry[2 * size + 1]; - this.elementSize = 0; - this.threshold = size + 1; // size is the expected number of elements - } - - public IncludeEntry add(IncludeEntry entry) { - int length = elements.length; - char[] word = entry.getFile(); - int index = CharOperation.hashCode(word) % length; - IncludeEntry current; - while ((current = elements[index]) != null) { - if (CharOperation.equals(current.getFile(), word)) return elements[index] = entry; - if (++index == length) index = 0; - } - elements[index] = entry; - - // assumes the threshold is never equal to the size of the table - if (++elementSize > threshold) grow(); - return entry; - } - - public IncludeEntry[] asArray() { - IncludeEntry[] array = new IncludeEntry[elementSize]; - for (int i = 0, j = 0, length = elements.length; i < length; i++) { - IncludeEntry current = elements[i]; - if (current != null) array[j++] = current; - } - return array; - } - - public IncludeEntry get(char[] word) { - int length = elements.length; - int index = CharOperation.hashCode(word) % length; - IncludeEntry current; - while ((current = elements[index]) != null) { - if (CharOperation.equals(current.getFile(), word)) return current; - if (++index == length) index = 0; - } - return null; - } - - private void grow() { - IncludeEntryHashedArray newArray = new IncludeEntryHashedArray(elementSize * 2); // double the number of expected elements - for (int i = 0, length = elements.length; i < length; i++) - if (elements[i] != null) - newArray.add(elements[i]); - - this.elements = newArray.elements; - this.elementSize = newArray.elementSize; - this.threshold = newArray.threshold; - } - - public String toString() { - String s = ""; //$NON-NLS-1$ - IncludeEntry[] entries = asArray(); - for (int i = 0, length = entries.length; i < length; i++) - s += entries[i].toString() + "\n"; //$NON-NLS-1$ - return s; - } - -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Index.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Index.java deleted file mode 100644 index 5724f318b5d..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Index.java +++ /dev/null @@ -1,443 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.IIndexer; -import org.eclipse.cdt.internal.core.index.IQueryResult; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; - -/** - * An Index is used to create an index on the disk, and to make queries. It uses a set of - * indexers and a mergeFactory. The index fills an inMemoryIndex up - * to it reaches a certain size, and then merges it with a main index on the disk. - *

    - * The changes are only taken into account by the queries after a merge. - */ - -public class Index implements IIndex { - /** - * Maximum size of the index in memory. - */ - public static final int MAX_FOOTPRINT= 10000000; - - /** - * Index in memory, who is merged with mainIndex each times it - * reaches a certain size. - */ - protected InMemoryIndex addsIndex; - protected IndexInput addsIndexInput; - - /** - * State of the indexGenerator: addsIndex empty <=> MERGED, or - * addsIndex not empty <=> CAN_MERGE - */ - protected int state; - - /** - * Files removed form the addsIndex. - */ - protected Map removedInAdds; - - /** - * Files removed form the oldIndex. - */ - protected Map removedInOld; - protected static final int CAN_MERGE= 0; - protected static final int MERGED= 1; - private File indexFile; - - /** - * String representation of this index. - */ - public String toString; - - public Index(File indexDirectory, boolean reuseExistingFile) throws IOException { - this(indexDirectory,".index", reuseExistingFile); //$NON-NLS-1$ - } - - public Index(File indexDirectory, String indexName, boolean reuseExistingFile) throws IOException { - super(); - state= MERGED; - indexFile= new File(indexDirectory, indexName); - initialize(reuseExistingFile); - } - - public Index(String indexName, boolean reuseExistingFile) throws IOException { - this(indexName, null, reuseExistingFile); - } - - public Index(String indexName, String toString, boolean reuseExistingFile) throws IOException { - super(); - state= MERGED; - indexFile= new File(indexName); - this.toString = toString; - initialize(reuseExistingFile); - } - /** - * Indexes the given document, using the appropriate indexer registered in the indexerRegistry. - * If the document already exists in the index, it overrides the previous one. The changes will be - * taken into account after a merge. - */ - public void add(IDocument document, IIndexer indexer) throws IOException { - if (timeToMerge()) { - merge(); - } - IndexedFile indexedFile= addsIndex.getIndexedFile(document.getName()); - if (indexedFile != null /*&& removedInAdds.get(document.getName()) == null*/ - ) - remove(indexedFile, MergeFactory.ADDS_INDEX); - IndexerOutput output= new IndexerOutput(addsIndex); - indexer.index(document, output); - state= CAN_MERGE; - } - /** - * Returns true if the index in memory is not empty, so - * merge() can be called to fill the mainIndex with the files and words - * contained in the addsIndex. - */ - protected boolean canMerge() { - return state == CAN_MERGE; - } - /** - * Initialises the indexGenerator. - */ - public void empty() throws IOException { - - if (indexFile.exists()){ - indexFile.delete(); - //initialisation of mainIndex - InMemoryIndex mainIndex= new InMemoryIndex(); - IndexOutput mainIndexOutput= new BlocksIndexOutput(indexFile); - if (!indexFile.exists()) - mainIndex.save(mainIndexOutput); - } - - //initialisation of addsIndex - addsIndex= new InMemoryIndex(); - addsIndexInput= new SimpleIndexInput(addsIndex); - - //vectors who keep track of the removed Files - removedInAdds= new HashMap(11); - removedInOld= new HashMap(11); - } - /** - * @see IIndex#getIndexFile - */ - public File getIndexFile() { - return indexFile; - } - /** - * @see IIndex#getNumDocuments - */ - public int getNumDocuments() throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - input.open(); - return input.getNumFiles(); - } finally { - input.close(); - } - } - /** - * @see IIndex#getNumWords - */ - public int getNumWords() throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - input.open(); - return input.getNumWords(); - } finally { - input.close(); - } - } - /** - * @see IIndex#getNumWords - */ - public int getNumIncludes() throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - input.open(); - return input.getNumIncludes(); - } finally { - input.close(); - } - } - /** - * Returns the path corresponding to a given document number - */ - public String getPath(int documentNumber) throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - input.open(); - IndexedFile file = input.getIndexedFile(documentNumber); - if (file == null) return null; - return file.getPath(); - } finally { - input.close(); - } - } - /** - * see IIndex.hasChanged - */ - public boolean hasChanged() { - return canMerge(); - } - /** - * Initialises the indexGenerator. - */ - public void initialize(boolean reuseExistingFile) throws IOException { - //initialisation of addsIndex - addsIndex= new InMemoryIndex(); - addsIndexInput= new SimpleIndexInput(addsIndex); - - //vectors who keep track of the removed Files - removedInAdds= new HashMap(11); - removedInOld= new HashMap(11); - - // check whether existing index file can be read - if (reuseExistingFile && indexFile.exists()) { - IndexInput mainIndexInput= new BlocksIndexInput(indexFile); - try { - mainIndexInput.open(); - } catch(IOException e) { - BlocksIndexInput input = (BlocksIndexInput)mainIndexInput; - try { - input.opened = true; - input.close(); - } finally { - input.opened = false; - } - indexFile.delete(); - mainIndexInput = null; - throw e; - } - mainIndexInput.close(); - } else { - InMemoryIndex mainIndex= new InMemoryIndex(); - IndexOutput mainIndexOutput= new BlocksIndexOutput(indexFile); - mainIndex.save(mainIndexOutput); - } - } - /** - * Merges the in memory index and the index on the disk, and saves the results on the disk. - */ - protected void merge() throws IOException { - //initialisation of tempIndex - File tempFile= new File(indexFile.getAbsolutePath() + "TempVA"); //$NON-NLS-1$ - - IndexInput mainIndexInput= new BlocksIndexInput(indexFile); - BlocksIndexOutput tempIndexOutput= new BlocksIndexOutput(tempFile); - - try { - //invoke a mergeFactory - new MergeFactory( - mainIndexInput, - addsIndexInput, - tempIndexOutput, - removedInOld, - removedInAdds).merge(); - - //rename the file created to become the main index - File mainIndexFile= (File) mainIndexInput.getSource(); - File tempIndexFile= (File) tempIndexOutput.getDestination(); - mainIndexFile.delete(); - tempIndexFile.renameTo(mainIndexFile); - } finally { - //initialise remove vectors and addsindex, and change the state - removedInAdds.clear(); - removedInOld.clear(); - addsIndex.init(); - addsIndexInput= new SimpleIndexInput(addsIndex); - state= MERGED; - //flush the CDT log - CCorePlugin.getDefault().cdtLog.flushLog(); - } - } - /** - * @see IIndex#query - */ - public IQueryResult[] query(String word) throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - return input.query(word); - } finally { - input.close(); - } - } - public IEntryResult[] queryEntries(char[] prefix) throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - return input.queryEntriesPrefixedBy(prefix); - } finally { - input.close(); - } - } - /** - * @see IIndex#queryInDocumentNames - */ - public IQueryResult[] queryInDocumentNames(String word) throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - return input.queryInDocumentNames(word); - } finally { - input.close(); - } - } - /** - * @see IIndex#queryPrefix - */ - public IQueryResult[] queryPrefix(char[] prefix) throws IOException { - //save(); - IndexInput input= new BlocksIndexInput(indexFile); - try { - return input.queryFilesReferringToPrefix(prefix); - } finally { - input.close(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.sourcedependency.IDependencyTree#getFileDepencies(int) - */ - public String[] getFileDependencies(IPath filePath) throws IOException { -// List tempFileReturn = new ArrayList(); -// -// IndexedFile indexFile = addsIndex.getIndexedFile(filePath.toString()); -// -// if (indexFile == null) -// return new String[0]; -// -// int fileNum = indexFile.getFileNumber(); -// IncludeEntry[] tempEntries = addsIndex.getIncludeEntries(); -// for (int i=0; i= MAX_FOOTPRINT); - } - public String toString() { - String str = this.toString; - if (str == null) str = super.toString(); - str += "(length: "+ getIndexFile().length() +")"; //$NON-NLS-1$ //$NON-NLS-2$ - return str; -} - - -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java deleted file mode 100644 index bd3c32427b0..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.CharOperation; - -/** - * An indexBlock stores wordEntries. - */ -public abstract class IndexBlock extends Block { - - public IndexBlock(int blockSize) { - super(blockSize); - } - /** - * Adds the given wordEntry to the indexBlock. - */ - public abstract boolean addEntry(WordEntry entry); - /** - * Adds the given wordEntry to the indexBlock. - */ - public abstract boolean addIncludeEntry(IncludeEntry entry); - /** - * @see Block#clear() - */ - public void clear() { - reset(); - super.clear(); - } - public WordEntry findEntryMatching(char[] pattern, boolean isCaseSensitive) { - reset(); - WordEntry entry= new WordEntry(); - while (nextEntry(entry)) { - if (CharOperation.match(pattern, entry.getWord(), isCaseSensitive)) { - return entry; - } - } - return null; - } - public WordEntry findEntryPrefixedBy(char[] word, boolean isCaseSensitive) { - reset(); - WordEntry entry= new WordEntry(); - while (nextEntry(entry)) { - if (CharOperation.prefixEquals(entry.getWord(), word, isCaseSensitive)) { - return entry; - } - } - return null; - } - public WordEntry findExactEntry(char[] word) { - reset(); - WordEntry entry= new WordEntry(); - while (nextEntry(entry)) { - if (CharOperation.equals(entry.getWord(), word)) { - return entry; - } - } - return null; - } - /** - * Returns whether the block is empty or not (if it doesn't contain any wordEntry). - */ - public abstract boolean isEmpty(); - /** - * Finds the next wordEntry and stores it in the given entry. - */ - public abstract boolean nextEntry(WordEntry entry); - public abstract boolean nextEntry(IncludeEntry entry); - - public void reset() { - } - -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java deleted file mode 100644 index 61e368c58a1..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; - -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.IQueryResult; - - -/** - * This class provides an input on an index, after it has been generated. - * You can access all the files of an index via getNextFile(), getCurrentFile() - * and moveToNextFile() (idem for the word entries). - * The usage is the same for every subclass: creation (constructor), opening - * (the open() method), usage, and closing (the close() method), to release the - * data source used by this input. - */ -public abstract class IndexInput { - protected int filePosition; - protected WordEntry currentWordEntry; - protected int wordPosition; - protected IncludeEntry currentIncludeEntry; - protected int includePosition; - - public IndexInput() { - super(); - wordPosition= 1; - filePosition= 1; - includePosition= 1; - } - /** - * clears the cache of this indexInput, if it keeps track of the information already read. - */ - public abstract void clearCache(); - /** - * Closes the IndexInput. For example, if the input is on a RandomAccessFile, - * it calls the close() method of RandomAccessFile. - */ - public abstract void close() throws IOException; - /** - * Returns the current file the indexInput is pointing to in the index. - */ - public abstract IndexedFile getCurrentFile() throws IOException; - /** - * Returns the current file the indexInput is pointing to in the index. - */ - public WordEntry getCurrentWordEntry() throws IOException { - if (!hasMoreWords()) - return null; - return currentWordEntry; - } - /** - * Returns the current file the indexInput is pointing to in the index. - */ - public IncludeEntry getCurrentIncludeEntry() throws IOException { - if (!hasMoreIncludes()) - return null; - return currentIncludeEntry; - } - /** - * Returns the position of the current file the input is pointing to in the index. - */ - public int getFilePosition() { - return filePosition; - } - /** - * Returns the indexedFile corresponding to the given document number in the index the input - * reads in, or null if such indexedFile does not exist. - */ - public abstract IndexedFile getIndexedFile(int fileNum) throws IOException; - /** - * Returns the indexedFile corresponding to the given document in the index the input - * reads in (e.g. the indexedFile with the same path in this index), or null if such - * indexedFile does not exist. - */ - public abstract IndexedFile getIndexedFile(IDocument document) throws IOException; - /** - * Returns the number of files in the index. - */ - public abstract int getNumFiles(); - /** - * Returns the number of unique words in the index. - */ - public abstract int getNumWords(); - /** - * Returns the number of unique words in the index. - */ - public abstract int getNumIncludes(); - /** - * Returns the Object the input is reading from. It can be an IIndex, - * a File, ... - */ - public abstract Object getSource(); - /** - * Returns true if the input has not reached the end of the index for the files. - */ - public boolean hasMoreFiles() { - return getFilePosition() <= getNumFiles(); - } - /** - * Returns true if the input has not reached the end of the index for the files. - */ - public boolean hasMoreWords() { - return wordPosition <= getNumWords(); - } - /** - * Returns true if the input has not reached the end of the index for the files. - */ - public boolean hasMoreIncludes() { - return includePosition <= getNumIncludes(); - } - /** - * Moves the pointer on the current file to the next file in the index. - */ - public abstract void moveToNextFile() throws IOException; - /** - * Moves the pointer on the current word to the next file in the index. - */ - public abstract void moveToNextWordEntry() throws IOException; - /** - * Moves the pointer on the current include entry to the next file in the index. - */ - public abstract void moveToNextIncludeEntry() throws IOException; - /** - * Open the Source where the input gets the information from. - */ - public abstract void open() throws IOException; - /** - * Returns the list of the files containing the given word in the index. - */ - public abstract IQueryResult[] query(String word) throws IOException; - public abstract IEntryResult[] queryEntriesPrefixedBy(char[] prefix) throws IOException; - public abstract IQueryResult[] queryFilesReferringToPrefix(char[] prefix) throws IOException; - /** - * Returns the list of the files whose name contain the given word in the index. - */ - public abstract IQueryResult[] queryInDocumentNames(String word) throws IOException; - /** - * Returns the list of the files whose name contain the given word in the index. - */ - public abstract IncludeEntry[] queryIncludeEntries(); - /** - * @param fileNum - * @return - */ - public abstract IncludeEntry[] queryIncludeEntries(int fileNum) throws IOException; - /** - * Set the pointer on the current file to the first file of the index. - */ - protected abstract void setFirstFile() throws IOException; - /** - * Set the pointer on the current word to the first word of the index. - */ - protected abstract void setFirstWord() throws IOException; - /** - * Set the pointer on the current include to the first include of the index. - */ - protected abstract void setFirstInclude() throws IOException; - - -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java deleted file mode 100644 index 6bea88471e0..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; - -/** - * An indexOutput is used to write an index into a different object (a File, ...). - */ -public abstract class IndexOutput { - /** - * Adds a File to the destination. - */ - public abstract void addFile(IndexedFile file) throws IOException; - /** - * Adds a word to the destination. - */ - public abstract void addWord(WordEntry word) throws IOException; - /** - * Closes the output, releasing the resources it was using. - */ - public abstract void close() throws IOException; - /** - * Flushes the output. - */ - public abstract void flush() throws IOException; - /** - * Returns the Object the output is writing to. It can be a file, another type of index, ... - */ - public abstract Object getDestination(); - /** - * Opens the output, before writing any information. - */ - public abstract void open() throws IOException; -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java deleted file mode 100644 index 1d4753492e0..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java +++ /dev/null @@ -1,390 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.ArrayList; - -import org.eclipse.cdt.internal.core.CharOperation; - -/** - * An indexSummary is used when saving an index into a BlocksIndexOuput or - * reading it from a BlocksIndexInput. It contains basic informations about - * an index: first files/words in each block, number of files/words. - */ - -public class IndexSummary { - /** - * First file for each block. - */ - protected ArrayList firstFilesInBlocks= new ArrayList(); - /** - * First word for each block. - */ - protected ArrayList firstWordsInBlocks= new ArrayList(); - /** - * First include for each block. - */ - protected ArrayList firstIncludesInBlocks= new ArrayList(); - /** - * Number of files in the index. - */ - protected int numFiles; - /** - * Number of words in the index. - */ - protected int numWords; - /** - * Number of includes in the index. - */ - protected int numIncludes; - - static class FirstFileInBlock { - IndexedFile indexedFile; - int blockNum; - } - - static class FirstWordInBlock { - char[] word; - int blockNum; - public String toString(){ - return "FirstWordInBlock: " + new String(word) + ", blockNum: " + blockNum; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - static class FirstIncludeInBlock { - char[] file; - int blockNum; - public String toString(){ - return "FirstIncludeInBlock: " + new String(file) + ", blockNum: " + blockNum; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - protected int firstWordBlockNum; - protected boolean firstWordAdded= true; - - protected int firstIncludeBlockNum; - protected boolean firstIncludeBlockAdded= true; - /** - * Adds the given file as the first file for the given Block number. - */ - public void addFirstFileInBlock(IndexedFile indexedFile, int blockNum) { - FirstFileInBlock entry= new FirstFileInBlock(); - entry.indexedFile= indexedFile; - entry.blockNum= blockNum; - firstFilesInBlocks.add(entry); - } - /** - * Adds the given word as the first word for the given Block number. - */ - public void addFirstWordInBlock(char[] word, int blockNum) { - if (firstWordAdded) { - firstWordBlockNum= blockNum; - firstWordAdded= false; - } - FirstWordInBlock entry= new FirstWordInBlock(); - entry.word= word; - entry.blockNum= blockNum; - firstWordsInBlocks.add(entry); - } - /** - * Adds the given include as the first include for the given Block number. - */ - public void addFirstIncludeInBlock(char[] file, int blockNum) { - if (firstIncludeBlockAdded) { - firstIncludeBlockNum= blockNum; - firstIncludeBlockAdded= false; - } - FirstIncludeInBlock entry= new FirstIncludeInBlock(); - entry.file = file; - entry.blockNum= blockNum; - firstIncludesInBlocks.add(entry); - } - /** - * Returns the numbers of all the blocks - */ - public int[] getAllBlockNums() { - - int max = firstWordsInBlocks.size(); - int[] blockNums = new int[max]; - for (int i = 0; i < max; i++){ - blockNums[i] = ((FirstWordInBlock)firstWordsInBlocks.get(i)).blockNum; - } - return blockNums; - } - public int getBlockNum(int blockLocation) { - return ((FirstWordInBlock) firstWordsInBlocks.get(blockLocation)).blockNum; - } - /** - * Returns the number of the Block containing the file with the given number. - */ - public int getBlockNumForFileNum(int fileNum) { - int min= 0; - int max= firstFilesInBlocks.size() - 1; - while (min <= max) { - int mid= (min + max) / 2; - FirstFileInBlock entry= (FirstFileInBlock) firstFilesInBlocks.get(mid); - int compare= fileNum - entry.indexedFile.getFileNumber(); - if (compare == 0) - return entry.blockNum; - if (compare < 0) - max= mid - 1; - else - min= mid + 1; - } - if (max < 0) - return -1; - FirstFileInBlock entry= (FirstFileInBlock) firstFilesInBlocks.get(max); - return entry.blockNum; - } - /** - * Returns the number of the Block containing the given word. - */ - public int getBlockNumForWord(char[] word) { - int min= 0; - int max= firstWordsInBlocks.size() - 1; - while (min <= max) { - int mid= (min + max) / 2; - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(mid); - int compare= Util.compare(word, entry.word); - if (compare == 0) - return entry.blockNum; - if (compare < 0) - max= mid - 1; - else - min= mid + 1; - } - if (max < 0) - return -1; - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(max); - return entry.blockNum; - } - public int[] getBlockNumsForPrefix(char[] prefix) { - int min= 0; - int size= firstWordsInBlocks.size(); - int max= size - 1; - int match= -1; - while (min <= max && match < 0) { - int mid= (min + max) / 2; - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(mid); - int compare= CharOperation.compareWith(entry.word, prefix); - if (compare == 0) { - match= mid; - break; - } - if (compare >= 0) - max= mid - 1; - else - min= mid + 1; - } - if (max < 0) - return new int[0]; - - if (match < 0) - match= max; - - int firstBlock= match - 1; - // Look if previous blocks are affected - for (; firstBlock >= 0; firstBlock--) { - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(firstBlock); - if (!CharOperation.prefixEquals(prefix, entry.word)) - break; - } - if (firstBlock < 0) - firstBlock= 0; - - // Look if next blocks are affected - int firstNotIncludedBlock= match + 1; - for (; firstNotIncludedBlock < size; firstNotIncludedBlock++) { - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(firstNotIncludedBlock); - if (!CharOperation.prefixEquals(prefix, entry.word)) - break; - } - - int numberOfBlocks= firstNotIncludedBlock - firstBlock; - int[] result= new int[numberOfBlocks]; - int pos= firstBlock; - for (int i= 0; i < numberOfBlocks; i++, pos++) { - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(pos); - result[i]= entry.blockNum; - } - return result; - } - public int[] getBlockNumsForIncludes() { - int max = firstIncludesInBlocks.size(); - int[] blockNums = new int[max]; - for (int i = 0; i < max; i++){ - blockNums[i] = ((FirstIncludeInBlock)firstIncludesInBlocks.get(i)).blockNum; - } - return blockNums; - } - public int getFirstBlockLocationForPrefix(char[] prefix) { - int min = 0; - int size = firstWordsInBlocks.size(); - int max = size - 1; - int match = -1; - while (min <= max) { - int mid = (min + max) / 2; - FirstWordInBlock entry = (FirstWordInBlock) firstWordsInBlocks.get(mid); - int compare = CharOperation.compareWith(entry.word, prefix); - if (compare == 0) { - match = mid; - break; - } - if (compare >= 0) { - max = mid - 1; - } else { - match = mid; // not perfect match, but could be inside - min = mid + 1; - } - } - if (max < 0) return -1; - - // no match at all, might be some matching entries inside max block - if (match < 0){ - match = max; - } else { - // look for possible matches inside previous blocks - while (match > 0){ - FirstWordInBlock entry = (FirstWordInBlock) firstWordsInBlocks.get(match); - if (!CharOperation.prefixEquals(prefix, entry.word)) - break; - match--; - } - } - return match; - } - /** - * Returns the number of the first IndexBlock (containing words). - */ - public int getFirstWordBlockNum() { - return firstWordBlockNum; - } - /** - * Returns the number of the first IndexBlock (containing words). - */ - public int getFirstIncludeBlockNum() { - return firstIncludeBlockNum; - } - /** - * Blocks are contiguous, so the next one is a potential candidate if its first word starts with - * the given prefix - */ - public int getNextBlockLocationForPrefix(char[] prefix, int blockLoc) { - if (++blockLoc < firstWordsInBlocks.size()){ - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(blockLoc); - if (CharOperation.prefixEquals(prefix, entry.word)) return blockLoc; - } - return -1; - } - /** - * Returns the number of files contained in the index. - */ - public int getNumFiles() { - return numFiles; - } - /** - * Returns the number of words contained in the index. - */ - public int getNumWords() { - return numWords; - } - /** - * Returns the number of words contained in the index. - */ - public int getNumIncludes() { - return numIncludes; - } - /** - * Loads the summary in memory. - */ - public void read(RandomAccessFile raf) throws IOException { - numFiles= raf.readInt(); - numWords= raf.readInt(); - numIncludes= raf.readInt(); - firstWordBlockNum= raf.readInt(); - firstIncludeBlockNum= raf.readInt(); - int numFirstFiles= raf.readInt(); - for (int i= 0; i < numFirstFiles; ++i) { - FirstFileInBlock entry= new FirstFileInBlock(); - String path= raf.readUTF(); - int fileNum= raf.readInt(); - entry.indexedFile= new IndexedFile(path, fileNum); - entry.blockNum= raf.readInt(); - firstFilesInBlocks.add(entry); - } - int numFirstWords= raf.readInt(); - for (int i= 0; i < numFirstWords; ++i) { - FirstWordInBlock entry= new FirstWordInBlock(); - entry.word= raf.readUTF().toCharArray(); - entry.blockNum= raf.readInt(); - firstWordsInBlocks.add(entry); - } - int numIncludes = raf.readInt(); - for (int i= 0; i < numIncludes; ++i) { - FirstIncludeInBlock entry= new FirstIncludeInBlock(); - entry.file= raf.readUTF().toCharArray(); - entry.blockNum= raf.readInt(); - firstIncludesInBlocks.add(entry); - } - } - /** - * Sets the number of files of the index. - */ - - public void setNumFiles(int numFiles) { - this.numFiles= numFiles; - } - /** - * Sets the number of words of the index. - */ - - public void setNumWords(int numWords) { - this.numWords= numWords; - } - /** - * Sets the number of includes of the index. - */ - public void setNumIncludes(int numIncs) { - this.numIncludes= numIncs; - } - /** - * Saves the summary on the disk. - */ - public void write(RandomAccessFile raf) throws IOException { - raf.writeInt(numFiles); - raf.writeInt(numWords); - raf.writeInt(numIncludes); - raf.writeInt(firstWordBlockNum); - raf.writeInt(firstIncludeBlockNum); - raf.writeInt(firstFilesInBlocks.size()); - for (int i= 0, size= firstFilesInBlocks.size(); i < size; ++i) { - FirstFileInBlock entry= (FirstFileInBlock) firstFilesInBlocks.get(i); - raf.writeUTF(entry.indexedFile.getPath()); - raf.writeInt(entry.indexedFile.getFileNumber()); - raf.writeInt(entry.blockNum); - } - raf.writeInt(firstWordsInBlocks.size()); - for (int i= 0, size= firstWordsInBlocks.size(); i < size; ++i) { - FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(i); - raf.writeUTF(new String(entry.word)); - raf.writeInt(entry.blockNum); - } - raf.writeInt(firstIncludesInBlocks.size()); - for (int i= 0, size= firstIncludesInBlocks.size(); i < size; ++i) { - FirstIncludeInBlock entry= (FirstIncludeInBlock) firstIncludesInBlocks.get(i); - raf.writeUTF(new String(entry.file)); - raf.writeInt(entry.blockNum); - } - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java deleted file mode 100644 index 8f0e1b2a100..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.index.IQueryResult; -import org.eclipse.cdt.internal.core.index.IDocument; - -/** - * An indexedFile associates a number to a document path, and document properties. - * It is what we add into an index, and the result of a query. - */ - -public class IndexedFile implements IQueryResult { - protected String path; - protected int fileNumber; - - public IndexedFile(String path, int fileNum) { - if (fileNum < 1) - throw new IllegalArgumentException(); - this.fileNumber= fileNum; - this.path= path; - } - public IndexedFile(IDocument document, int fileNum) { - if (fileNum < 1) - throw new IllegalArgumentException(); - this.path= document.getName(); - this.fileNumber= fileNum; - } - /** - * Returns the size of the indexedFile. - */ - public int footprint() { - //object+ 2 slots + size of the string (header + 4 slots + char[]) - return 8 + (2 * 4) + (8 + (4 * 4) + 8 + path.length() * 2); - } - /** - * Returns the file number. - */ - public int getFileNumber() { - return fileNumber; - } - /** - * Returns the path. - */ - public String getPath() { - return path; - } - /** - * Sets the file number. - */ - public void setFileNumber(int fileNumber) { - this.fileNumber= fileNumber; - } - public String toString() { - return "IndexedFile(" + fileNumber + ": " + path + ")"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$ - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java deleted file mode 100644 index 713b9761b3a..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.util.ArrayList; - -import org.eclipse.cdt.internal.core.index.IDocument; - -public final class IndexedFileHashedArray { - -private IndexedFile elements[]; -private int elementSize; // number of elements in the table -private int threshold; -private int lastId; -private ArrayList replacedElements; - -public IndexedFileHashedArray(int size) { - if (size < 7) size = 7; - this.elements = new IndexedFile[2 * size + 1]; - this.elementSize = 0; - this.threshold = size + 1; // size is the expected number of elements - this.lastId = 0; - this.replacedElements = null; -} - -public IndexedFile add(IDocument document) { - return add(new IndexedFile(document, ++lastId)); -} - -private IndexedFile add(IndexedFile file) { - int length = elements.length; - String path = file.getPath(); - int index = (path.hashCode() & 0x7FFFFFFF) % length; - IndexedFile current; - while ((current = elements[index]) != null) { - if (current.getPath().equals(path)) { - if (replacedElements == null) replacedElements = new ArrayList(5); - replacedElements.add(current); - return elements[index] = file; - } - if (++index == length) index = 0; - } - elements[index] = file; - - // assumes the threshold is never equal to the size of the table - if (++elementSize > threshold) grow(); - return file; -} - -public IndexedFile[] asArray() { - IndexedFile[] array = new IndexedFile[lastId]; - for (int i = 0, length = elements.length; i < length; i++) { - IndexedFile current = elements[i]; - if (current != null) - array[current.fileNumber - 1] = current; - } - if (replacedElements != null) { - for (int i = 0, length = replacedElements.size(); i < length; i++) { - IndexedFile current = (IndexedFile) replacedElements.get(i); - array[current.fileNumber - 1] = current; - } - } - return array; -} - -public IndexedFile get(String path) { - int length = elements.length; - int index = (path.hashCode() & 0x7FFFFFFF) % length; - IndexedFile current; - while ((current = elements[index]) != null) { - if (current.getPath().equals(path)) return current; - if (++index == length) index = 0; - } - return null; -} - -private void grow() { - IndexedFileHashedArray newArray = new IndexedFileHashedArray(elementSize * 2); // double the number of expected elements - for (int i = 0, length = elements.length; i < length; i++) - if (elements[i] != null) - newArray.add(elements[i]); - - // leave replacedElements as is - this.elements = newArray.elements; - this.elementSize = newArray.elementSize; - this.threshold = newArray.threshold; -} - -public int size() { - return elementSize + (replacedElements == null ? 0 : replacedElements.size()); -} - -public String toString() { - String s = ""; //$NON-NLS-1$ - IndexedFile[] files = asArray(); - for (int i = 0, length = files.length; i < length; i++) - s += files[i].toString() + "\n"; //$NON-NLS-1$ - return s; -} -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java deleted file mode 100644 index 396761894ce..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IIndexerOutput; - -/** - * An indexerOutput is used by an indexer to add documents and word references to - * an inMemoryIndex. It keeps track of the document being indexed and add the - * word references to this document (so you do not need to precise the document - * each time you add a word). - */ - -public class IndexerOutput implements IIndexerOutput { - protected InMemoryIndex index; - protected IndexedFile indexedFile; - protected IDocument document; - /** - * IndexerOutput constructor comment. - */ - public IndexerOutput(InMemoryIndex index) { - this.index= index; - } - /** - * Adds the given document to the inMemoryIndex. - */ - public void addDocument(IDocument document) { - if (indexedFile == null) { - indexedFile= index.addDocument(document); - } else { - throw new IllegalStateException(); - } - } - /** - * Adds a reference to the given word to the inMemoryIndex. - */ - public void addRef(char[] word) { - if (indexedFile == null) { - throw new IllegalStateException(); - } - index.addRef(indexedFile, word); - } - /** - * Adds a reference to the given word to the inMemoryIndex. - */ - public void addRef(String word) { - addRef(word.toCharArray()); - } - - public void addRelatives(String inclusion, String parent) { - if (indexedFile == null) { - throw new IllegalStateException(); - } - index.addRelatives(indexedFile, inclusion, parent); - } - - public void addIncludeRef(char[] word) { - if (indexedFile == null) { - throw new IllegalStateException(); - } - index.addIncludeRef(indexedFile, word); - } - - public void addIncludeRef(String word) { - addIncludeRef(word.toCharArray()); - } - -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Int.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Int.java deleted file mode 100644 index f1027f3e5ef..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Int.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -public class Int { - public int value; - /** - * Int constructor comment. - */ - public Int(int i) { - value= i; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java deleted file mode 100644 index 10d2a65497a..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; -import java.util.Map; - -/** - * A mergeFactory is used to merge 2 indexes into one. One of the indexes - * (oldIndex) is on the disk and the other(addsIndex) is in memory. - * The merge respects the following rules:
    - * - The files are sorted in alphabetical order;
    - * - if a file is in oldIndex and addsIndex, the one which is added - * is the one in the addsIndex.
    - */ -public class MergeFactory { - /** - * Input on the addsIndex. - */ - protected IndexInput addsInput; - /** - * Input on the oldIndex. - */ - protected IndexInput oldInput; - /** - * Output to write the result of the merge in. - */ - protected BlocksIndexOutput mergeOutput; - /** - * Files removed from oldIndex. - */ - protected Map removedInOld; - /** - * Files removed from addsIndex. - */ - protected Map removedInAdds; - protected int[] mappingOld; - protected int[] mappingAdds; - public static final int ADDS_INDEX= 0; - public static final int OLD_INDEX= 1; - /** - * MergeFactory constructor comment. - * @param directory java.io.File - */ - public MergeFactory(IndexInput oldIndexInput, IndexInput addsIndexInput, BlocksIndexOutput mergeIndexOutput, Map removedInOld, Map removedInAdds) { - oldInput= oldIndexInput; - addsInput= addsIndexInput; - mergeOutput= mergeIndexOutput; - this.removedInOld= removedInOld; - this.removedInAdds= removedInAdds; - } - /** - * Initialise the merge. - */ - protected void init() { - mappingOld= new int[oldInput.getNumFiles() + 1]; - mappingAdds= new int[addsInput.getNumFiles() + 1]; - - } - /** - * Merges the 2 indexes into a new one on the disk. - */ - public void merge() throws IOException { - try { - //init - addsInput.open(); - oldInput.open(); - mergeOutput.open(); - init(); - //merge - //findChanges(); - mergeFiles(); - mergeReferences(); - mergeIncludes(); - mergeOutput.flush(); - } finally { - //closes everything - oldInput.close(); - addsInput.close(); - mergeOutput.close(); - } - } - /** - * Merges the files of the 2 indexes in the new index, removes the files - * to be removed, and records the changes made to propagate them to the - * word references. - */ - - protected void mergeFiles() throws IOException { - int positionInMerge= 1; - int compare; - - while (oldInput.hasMoreFiles() || addsInput.hasMoreFiles()) { - IndexedFile file1= oldInput.getCurrentFile(); - IndexedFile file2= addsInput.getCurrentFile(); - - //if the file has been removed we don't take it into account - while (file1 != null && wasRemoved(file1, OLD_INDEX)) { - oldInput.moveToNextFile(); - file1= oldInput.getCurrentFile(); - } - while (file2 != null && wasRemoved(file2, ADDS_INDEX)) { - addsInput.moveToNextFile(); - file2= addsInput.getCurrentFile(); - } - - //the addsIndex was empty, we just removed files from the oldIndex - if (file1 == null && file2 == null) - break; - - //test if we reached the end of one the 2 index - if (file1 == null) - compare= 1; - else if (file2 == null) - compare= -1; - else - compare= file1.getPath().compareTo(file2.getPath()); - - //records the changes to Make - if (compare == 0) { - //the file has been modified: - //we remove it from the oldIndex and add it to the addsIndex - removeFile(file1, OLD_INDEX); - mappingAdds[file2.getFileNumber()]= positionInMerge; - file1.setFileNumber(positionInMerge); - mergeOutput.addFile(file1); - oldInput.moveToNextFile(); - addsInput.moveToNextFile(); - } else if (compare < 0) { - mappingOld[file1.getFileNumber()]= positionInMerge; - file1.setFileNumber(positionInMerge); - mergeOutput.addFile(file1); - oldInput.moveToNextFile(); - } else { - mappingAdds[file2.getFileNumber()]= positionInMerge; - file2.setFileNumber(positionInMerge); - mergeOutput.addFile(file2); - addsInput.moveToNextFile(); - } - positionInMerge++; - } - mergeOutput.flushFiles(); - } - /** - * Merges the files of the 2 indexes in the new index, according to the changes - * recorded during mergeFiles(). - */ - protected void mergeReferences() throws IOException { - int compare; - while (oldInput.hasMoreWords() || addsInput.hasMoreWords()) { - WordEntry word1= oldInput.getCurrentWordEntry(); - WordEntry word2= addsInput.getCurrentWordEntry(); - - if (word1 == null && word2 == null) - break; - - if (word1 == null) - compare= 1; - else if (word2 == null) - compare= -1; - else - compare= Util.compare(word1.getWord(), word2.getWord()); - if (compare < 0) { - word1.mapRefs(mappingOld); - mergeOutput.addWord(word1); - oldInput.moveToNextWordEntry(); - } else if (compare > 0) { - word2.mapRefs(mappingAdds); - mergeOutput.addWord(word2); - addsInput.moveToNextWordEntry(); - } else { - word1.mapRefs(mappingOld); - word2.mapRefs(mappingAdds); - word1.addRefs(word2.getRefs()); - mergeOutput.addWord(word1); - addsInput.moveToNextWordEntry(); - oldInput.moveToNextWordEntry(); - } - } - mergeOutput.flushWords(); - } - /** - * Merges the files of the 2 indexes in the new index, according to the changes - * recorded during mergeFiles(). - */ - protected void mergeIncludes() throws IOException { - int compare; - - while (oldInput.hasMoreIncludes() || addsInput.hasMoreIncludes()) { - IncludeEntry inc1= oldInput.getCurrentIncludeEntry(); - IncludeEntry inc2= addsInput.getCurrentIncludeEntry(); - - if (inc1 == null && inc2 == null) - break; - - if (inc1 == null) - compare= 1; - else if (inc2 == null) - compare= -1; - else - compare= Util.compare(inc1.getFile(), inc2.getFile()); - if (compare < 0) { - inc1.mapRefs(mappingOld); - mergeOutput.addInclude(inc1); - oldInput.moveToNextIncludeEntry(); - } else if (compare > 0) { - inc2.mapRefs(mappingAdds); - mergeOutput.addInclude(inc2); - addsInput.moveToNextIncludeEntry(); - } else { - inc1.mapRefs(mappingOld); - inc2.mapRefs(mappingAdds); - inc1.addRefs(inc2.getRefs()); - mergeOutput.addInclude(inc1); - addsInput.moveToNextIncludeEntry(); - oldInput.moveToNextIncludeEntry(); - } - } - mergeOutput.flushIncludes(); - } - /** - * Records the deletion of one file. - */ - protected void removeFile(IndexedFile file, int index) { - if (index == OLD_INDEX) - mappingOld[file.getFileNumber()]= -1; - else - mappingAdds[file.getFileNumber()]= -1; - } - /** - * Returns whether the given file has to be removed from the given index - * (ADDS_INDEX or OLD_INDEX). If it has to be removed, the mergeFactory - * deletes it and records the changes. - */ - - protected boolean wasRemoved(IndexedFile indexedFile, int index) { - String path= indexedFile.getPath(); - if (index == OLD_INDEX) { - if (removedInOld.remove(path) != null) { - mappingOld[indexedFile.getFileNumber()]= -1; - return true; - } - } else if (index == ADDS_INDEX) { - Int lastRemoved= (Int) removedInAdds.get(path); - if (lastRemoved != null) { - int fileNum= indexedFile.getFileNumber(); - if (lastRemoved.value >= fileNum) { - mappingAdds[fileNum]= -1; - //if (lastRemoved.value == fileNum) // ONLY if files in sorted order for names AND fileNums - //removedInAdds.remove(path); - return true; - } - } - } - return false; - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java deleted file mode 100644 index c959426ad72..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.util.Enumeration; -import java.util.Hashtable; - -import org.eclipse.cdt.internal.core.index.IDocument; - -/** - * The properties of a document are stored into a hashtable. - * @see IDocument - */ - -public abstract class PropertyDocument implements IDocument { - protected Hashtable properties; - public PropertyDocument() { - properties= new Hashtable(5); - } - /** - * @see IDocument#getProperty - */ - public String getProperty(String property) { - return (String) properties.get(property); - } - /** - * @see IDocument#getPropertyNames - */ - - public Enumeration getPropertyNames() { - return properties.keys(); - } - /** - * @see IDocument#setProperty - */ - - public void setProperty(String property, String value) { - properties.put(property, value); - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java deleted file mode 100644 index 3dddaa21e45..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; -import java.io.RandomAccessFile; - -/** - * A safe subclass of RandomAccessFile, which ensure that it's closed - * on finalize. - */ -public class SafeRandomAccessFile extends RandomAccessFile { - public SafeRandomAccessFile(java.io.File file, String mode) throws java.io.IOException { - super(file, mode); - } - public SafeRandomAccessFile(String name, String mode) throws java.io.IOException { - super(name, mode); - } - protected void finalize() throws IOException { - close(); - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java deleted file mode 100644 index 1129839ea45..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java +++ /dev/null @@ -1,209 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.IOException; -import java.util.ArrayList; - -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.IQueryResult; - -/** - * A simpleIndexInput is an input on an in memory Index. - */ - -public class SimpleIndexInput extends IndexInput { - protected WordEntry[] sortedWordEntries; - protected IncludeEntry[] sortedIncludes; - protected IndexedFile currentFile; - protected IndexedFile[] sortedFiles; - protected InMemoryIndex index; - - public SimpleIndexInput(InMemoryIndex index) { - super(); - this.index= index; - } - /** - * @see IndexInput#clearCache() - */ - public void clearCache() { - } - /** - * @see IndexInput#close() - */ - public void close() throws IOException { - sortedFiles= null; - } - /** - * @see IndexInput#getCurrentFile() - */ - public IndexedFile getCurrentFile() throws IOException { - if (!hasMoreFiles()) - return null; - return currentFile; - } - /** - * @see IndexInput#getIndexedFile(int) - */ - public IndexedFile getIndexedFile(int fileNum) throws IOException { - for (int i= 0; i < sortedFiles.length; i++) - if (sortedFiles[i].getFileNumber() == fileNum) - return sortedFiles[i]; - return null; - } - /** - * @see IndexInput#getIndexedFile(IDocument) - */ - public IndexedFile getIndexedFile(IDocument document) throws IOException { - String name= document.getName(); - for (int i= index.getNumFiles(); i >= 1; i--) { - IndexedFile file= getIndexedFile(i); - if (name.equals(file.getPath())) - return file; - } - return null; - } - /** - * @see IndexInput#getNumFiles() - */ - public int getNumFiles() { - return index.getNumFiles(); - } - /** - * @see IndexInput#getNumIncludes() - */ - public int getNumIncludes() { - return sortedIncludes.length; - } - /** - * @see IndexInput#getNumWords() - */ - public int getNumWords() { - return sortedWordEntries.length; - } - /** - * @see IndexInput#getSource() - */ - public Object getSource() { - return index; - } - public void init() { - index.init(); - - } - /** - * @see IndexInput#moveToNextFile() - */ - public void moveToNextFile() throws IOException { - filePosition++; - if (!hasMoreFiles()) { - return; - } - currentFile= sortedFiles[filePosition - 1]; - } - /** - * @see IndexInput#moveToNextWordEntry() - */ - public void moveToNextWordEntry() throws IOException { - wordPosition++; - if (hasMoreWords()) - currentWordEntry= sortedWordEntries[wordPosition - 1]; - } - /** - * @see IndexInput#moveToNextIncludeEntry() - */ - public void moveToNextIncludeEntry() throws IOException { - includePosition++; - if (hasMoreIncludes()) - currentIncludeEntry= sortedIncludes[includePosition - 1]; - } - /** - * @see IndexInput#open() - */ - public void open() throws IOException { - sortedWordEntries= index.getSortedWordEntries(); - sortedFiles= index.getSortedFiles(); - sortedIncludes = index.getSortedIncludeEntries(); - filePosition= 1; - wordPosition= 1; - includePosition=1; - setFirstFile(); - setFirstWord(); - setFirstInclude(); - } - /** - * @see IndexInput#query(String) - */ - public IQueryResult[] query(String word) throws IOException { - char[] wordChar= word.toCharArray(); - WordEntry wordEntry= index.getWordEntry(wordChar); - int[] fileNums= wordEntry.getRefs(); - IQueryResult[] files= new IQueryResult[fileNums.length]; - for (int i= 0; i < files.length; i++) - files[i]= getIndexedFile(fileNums[i]); - return files; - } - public IEntryResult[] queryEntriesPrefixedBy(char[] prefix) throws IOException { - return null; - } - public IQueryResult[] queryFilesReferringToPrefix(char[] prefix) throws IOException { - return null; - } - /** - * @see IndexInput#queryInDocumentNames(String) - */ - public IQueryResult[] queryInDocumentNames(String word) throws IOException { - setFirstFile(); - ArrayList matches= new ArrayList(); - while (hasMoreFiles()) { - IndexedFile file= getCurrentFile(); - if (file.getPath().indexOf(word) != -1) - matches.add(file.getPath()); - moveToNextFile(); - } - IQueryResult[] match= new IQueryResult[matches.size()]; - matches.toArray(match); - return match; - } - /** - * @see IndexInput#setFirstFile() - */ - protected void setFirstFile() throws IOException { - filePosition= 1; - if (sortedFiles.length > 0) { - currentFile= sortedFiles[0]; - } - } - /** - * @see IndexInput#setFirstWord() - */ - protected void setFirstWord() throws IOException { - wordPosition= 1; - if (sortedWordEntries.length > 0) - currentWordEntry= sortedWordEntries[0]; - } - /** - * @see IndexInput#setFirstInclude() - */ - protected void setFirstInclude() throws IOException { - includePosition=1; - if (sortedIncludes.length >0) - currentIncludeEntry=sortedIncludes[0]; - } - public IncludeEntry[] queryIncludeEntries() { - return null; - } - public IncludeEntry[] queryIncludeEntries(int fileNum) throws IOException { - return null; - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Util.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Util.java deleted file mode 100644 index 3ff79dcf8bc..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/Util.java +++ /dev/null @@ -1,371 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import java.io.DataInput; -import java.io.IOException; -import java.io.OutputStream; -import java.io.UTFDataFormatException; - -public class Util { - - private Util() { - } - /** - * Compares two strings lexicographically. - * The comparison is based on the Unicode value of each character in - * the strings. - * - * @return the value 0 if the str1 is equal to str2; - * a value less than 0 if str1 - * is lexicographically less than str2; - * and a value greater than 0 if str1 is - * lexicographically greater than str2. - */ - public static int compare(char[] str1, char[] str2) { - int len1= str1.length; - int len2= str2.length; - int n= Math.min(len1, len2); - int i= 0; - while (n-- != 0) { - char c1= str1[i]; - char c2= str2[i++]; - if (c1 != c2) { - return c1 - c2; - } - } - return len1 - len2; - } - - /** - * Returns the length of the common prefix between s1 and s2. - */ - public static int prefixLength(char[] s1, char[] s2) { - int len= 0; - int max= Math.min(s1.length, s2.length); - for (int i= 0; i < max && s1[i] == s2[i]; ++i) - ++len; - return len; - } - /** - * Returns the length of the common prefix between s1 and s2. - */ - public static int prefixLength(String s1, String s2) { - int len= 0; - int max= Math.min(s1.length(), s2.length()); - for (int i= 0; i < max && s1.charAt(i) == s2.charAt(i); ++i) - ++len; - return len; - } - private static void quickSort(char[][] list, int left, int right) { - int original_left= left; - int original_right= right; - char[] mid= list[(left + right) / 2]; - do { - while (compare(list[left], mid) < 0) { - left++; - } - while (compare(mid, list[right]) < 0) { - right--; - } - if (left <= right) { - char[] tmp= list[left]; - list[left]= list[right]; - list[right]= tmp; - left++; - right--; - } - } while (left <= right); - if (original_left < right) { - quickSort(list, original_left, right); - } - if (left < original_right) { - quickSort(list, left, original_right); - } - } - private static void quickSort(int[] list, int left, int right) { - int original_left= left; - int original_right= right; - int mid= list[(left + right) / 2]; - do { - while (list[left] < mid) { - left++; - } - while (mid < list[right]) { - right--; - } - if (left <= right) { - int tmp= list[left]; - list[left]= list[right]; - list[right]= tmp; - left++; - right--; - } - } while (left <= right); - if (original_left < right) { - quickSort(list, original_left, right); - } - if (left < original_right) { - quickSort(list, left, original_right); - } - } - private static void quickSort(String[] list, int left, int right) { - int original_left= left; - int original_right= right; - String mid= list[(left + right) / 2]; - do { - while (list[left].compareTo(mid) < 0) { - left++; - } - while (mid.compareTo(list[right]) < 0) { - right--; - } - if (left <= right) { - String tmp= list[left]; - list[left]= list[right]; - list[right]= tmp; - left++; - right--; - } - } while (left <= right); - if (original_left < right) { - quickSort(list, original_left, right); - } - if (left < original_right) { - quickSort(list, left, original_right); - } - } - private static void quickSort(IndexedFile[] list, int left, int right) { - int original_left= left; - int original_right= right; - String mid= list[(left + right) / 2].path; - do { - while (list[left].path.compareTo(mid) < 0) { - left++; - } - while (mid.compareTo(list[right].path) < 0) { - right--; - } - if (left <= right) { - IndexedFile tmp= list[left]; - list[left]= list[right]; - list[right]= tmp; - left++; - right--; - } - } while (left <= right); - if (original_left < right) { - quickSort(list, original_left, right); - } - if (left < original_right) { - quickSort(list, left, original_right); - } - } - private static void quickSort(WordEntry[] list, int left, int right) { - int original_left= left; - int original_right= right; - char[] mid= list[(left + right) / 2].fWord; - do { - while (compare(list[left].fWord, mid) < 0) { - left++; - } - while (compare(mid, list[right].fWord) < 0) { - right--; - } - if (left <= right) { - WordEntry tmp= list[left]; - list[left]= list[right]; - list[right]= tmp; - left++; - right--; - } - } while (left <= right); - if (original_left < right) { - quickSort(list, original_left, right); - } - if (left < original_right) { - quickSort(list, left, original_right); - } - } - private static void quickSort(IncludeEntry[] list, int left, int right) { - int original_left= left; - int original_right= right; - char[] mid= list[(left + right) / 2].fFile; - do { - while (compare(list[left].fFile, mid) < 0) { - left++; - } - while (compare(mid, list[right].fFile) < 0) { - right--; - } - if (left <= right) { - IncludeEntry tmp= list[left]; - list[left]= list[right]; - list[right]= tmp; - left++; - right--; - } - } while (left <= right); - if (original_left < right) { - quickSort(list, original_left, right); - } - if (left < original_right) { - quickSort(list, left, original_right); - } - } - /** - * Reads in a string from the specified data input stream. The - * string has been encoded using a modified UTF-8 format. - *

    - * The first two bytes are read as if by - * readUnsignedShort. This value gives the number of - * following bytes that are in the encoded string, not - * the length of the resulting string. The following bytes are then - * interpreted as bytes encoding characters in the UTF-8 format - * and are converted into characters. - *

    - * This method blocks until all the bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @param in a data input stream. - * @return a Unicode string. - * @exception EOFException if the input stream reaches the end - * before all the bytes. - * @exception IOException if an I/O error occurs. - * @exception UTFDataFormatException if the bytes do not represent a - * valid UTF-8 encoding of a Unicode string. - * @see java.io.DataInputStream#readUnsignedShort() - */ - public final static char[] readUTF(DataInput in) throws IOException { - int utflen= in.readUnsignedShort(); - char str[]= new char[utflen]; - int count= 0; - int strlen= 0; - while (count < utflen) { - int c= in.readUnsignedByte(); - int char2, char3; - switch (c >> 4) { - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - // 0xxxxxxx - count++; - str[strlen++]= (char) c; - break; - case 12 : - case 13 : - // 110x xxxx 10xx xxxx - count += 2; - if (count > utflen) - throw new UTFDataFormatException(); - char2= in.readUnsignedByte(); - if ((char2 & 0xC0) != 0x80) - throw new UTFDataFormatException(); - str[strlen++]= (char) (((c & 0x1F) << 6) | (char2 & 0x3F)); - break; - case 14 : - // 1110 xxxx 10xx xxxx 10xx xxxx - count += 3; - if (count > utflen) - throw new UTFDataFormatException(); - char2= in.readUnsignedByte(); - char3= in.readUnsignedByte(); - if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) - throw new UTFDataFormatException(); - str[strlen++]= (char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0)); - break; - default : - // 10xx xxxx, 1111 xxxx - throw new UTFDataFormatException(); - } - } - if (strlen < utflen) { - System.arraycopy(str, 0, str= new char[strlen], 0, strlen); - } - return str; - } - public static void sort(char[][] list) { - if (list.length > 1) - quickSort(list, 0, list.length - 1); - } - public static void sort(int[] list) { - if (list.length > 1) - quickSort(list, 0, list.length - 1); - } - public static void sort(String[] list) { - if (list.length > 1) - quickSort(list, 0, list.length - 1); - } - public static void sort(IndexedFile[] list) { - if (list.length > 1) - quickSort(list, 0, list.length - 1); - } - public static void sort(WordEntry[] list) { - if (list.length > 1) - quickSort(list, 0, list.length - 1); - } - public static void sort(IncludeEntry[] list) { - if (list.length > 1) - quickSort(list, 0, list.length - 1); - } - /** - * Writes a string to the given output stream using UTF-8 - * encoding in a machine-independent manner. - *

    - * First, two bytes are written to the output stream as if by the - * writeShort method giving the number of bytes to - * follow. This value is the number of bytes actually written out, - * not the length of the string. Following the length, each character - * of the string is output, in sequence, using the UTF-8 encoding - * for the character. - * - * @param str a string to be written. - * @exception IOException if an I/O error occurs. - * @since JDK1.0 - */ - public static void writeUTF(OutputStream out, char[] str) throws IOException { - int strlen= str.length; - int utflen= 0; - for (int i= 0; i < strlen; i++) { - int c= str[i]; - if ((c >= 0x0001) && (c <= 0x007F)) { - utflen++; - } else if (c > 0x07FF) { - utflen += 3; - } else { - utflen += 2; - } - } - if (utflen > 65535) - throw new UTFDataFormatException(); - out.write((utflen >>> 8) & 0xFF); - out.write((utflen >>> 0) & 0xFF); - for (int i= 0; i < strlen; i++) { - int c= str[i]; - if ((c >= 0x0001) && (c <= 0x007F)) { - out.write(c); - } else if (c > 0x07FF) { - out.write(0xE0 | ((c >> 12) & 0x0F)); - out.write(0x80 | ((c >> 6) & 0x3F)); - out.write(0x80 | ((c >> 0) & 0x3F)); - } else { - out.write(0xC0 | ((c >> 6) & 0x1F)); - out.write(0x80 | ((c >> 0) & 0x3F)); - } - } - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java deleted file mode 100644 index 20727388e74..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java +++ /dev/null @@ -1,156 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.CharOperation; - -public class WordEntry { - protected char[] fWord; - protected int fNumRefs; - protected int[] fRefs; - public WordEntry() { - this(CharOperation.NO_CHAR); - } - public WordEntry(char[] word) { - fWord= word; - fNumRefs= 0; - fRefs= new int[1]; - } - /** - * Adds a reference and records the change in footprint. - */ - public int addRef(int fileNum) { - if (fNumRefs > 0 && fRefs[fNumRefs - 1] == fileNum) { - return 0; - } - if (fNumRefs < fRefs.length) { - fRefs[fNumRefs++]= fileNum; - return 0; - } - - // For rt.jar, 73265 word entries are created. 51997 have 1 ref, then 9438, 3738, 1980, 1214, 779, 547, 429, 371 etc. - int newSize= fNumRefs < 4 ? 4 : fNumRefs * 2; // so will start @ 1, grow to 4, 8, 16, 32, 64 etc. - System.arraycopy(fRefs, 0, fRefs= new int[newSize], 0, fNumRefs); - fRefs[fNumRefs++]= fileNum; - return (newSize - fNumRefs + 1) * 4; - } - /** - * Adds a set of references and records the change in footprint. - */ - public void addRefs(int[] refs) { - int[] newRefs= new int[fNumRefs + refs.length]; - int pos1= 0; - int pos2= 0; - int posNew= 0; - int compare; - int r1= 0; - int r2= 0; - while (pos1 < fNumRefs || pos2 < refs.length) { - if (pos1 >= fNumRefs) { - r2= refs[pos2]; - compare= -1; - } else if (pos2 >= refs.length) { - compare= 1; - r1= fRefs[pos1]; - } else { - r1= fRefs[pos1]; - r2= refs[pos2]; - compare= r2 - r1; - } - if (compare > 0) { - newRefs[posNew]= r1; - posNew++; - pos1++; - } else { - if (r2 != 0) { - newRefs[posNew]= r2; - posNew++; - } - pos2++; - } - } - fRefs= newRefs; - fNumRefs= posNew; - /*for (int i = 0; i < refs.length; i++) - addRef(refs[i]); - int[] newRefs = new int[fNumRefs]; - System.arraycopy(fRefs, 0, newRefs, 0, fNumRefs); - fRefs = newRefs; - Util.sort(fRefs);*/ - } - /** - * Returns the size of the wordEntry - */ - public int footprint() { - return 8 + (3 * 4) + (8 + fWord.length * 2) + (8 + fRefs.length * 4); - } - /** - * Returns the number of references, e.g. the number of files this word appears in. - */ - public int getNumRefs() { - return fNumRefs; - } - /** - * returns the file number in the i position in the list of references. - */ - public int getRef(int i) { - if (i < fNumRefs) return fRefs[i]; - throw new IndexOutOfBoundsException(); - } - /** - * Returns the references of the wordEntry (the number of the files it appears in). - */ - public int[] getRefs() { - int[] result= new int[fNumRefs]; - System.arraycopy(fRefs, 0, result, 0, fNumRefs); - return result; - } - /** - * returns the word of the wordEntry. - */ - public char[] getWord() { - return fWord; - } - /** - * Changes the references of the wordEntry to match the mapping. For example,
    - * if the current references are [1 3 4]
    - * and mapping is [1 2 3 4 5]
    - * in references 1 becomes mapping[1] = 2, 3->4, and 4->5
    - * => references = [2 4 5].
    - */ - public void mapRefs(int[] mappings) { - int position= 0; - for (int i= 0; i < fNumRefs; i++) { - int map= mappings[fRefs[i]]; - if (map != -1 && map != 0) - fRefs[position++]= map; - } - fNumRefs= position; - - //to be changed! - System.arraycopy(fRefs, 0, (fRefs= new int[fNumRefs]), 0, fNumRefs); - Util.sort(fRefs); - } - /** - * Clears the wordEntry. - */ - public void reset(char[] word) { - for (int i= fNumRefs; i-- > 0;) { - fRefs[i]= 0; - } - fNumRefs= 0; - fWord= word; - } - public String toString() { - return new String(fWord); - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java deleted file mode 100644 index 3e57fa9dda4..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.index.impl; - -import org.eclipse.cdt.internal.core.CharOperation; - -public final class WordEntryHashedArray { - - // to avoid using Enumerations, walk the objects skipping nulls - public WordEntry elements[]; - public int elementSize; // number of elements in the table - public int threshold; - - public WordEntryHashedArray(int size) { - if (size < 7) size = 7; - this.elements = new WordEntry[2 * size + 1]; - this.elementSize = 0; - this.threshold = size + 1; // size is the expected number of elements - } - - public WordEntry add(WordEntry entry) { - int length = elements.length; - char[] word = entry.getWord(); - int index = CharOperation.hashCode(word) % length; - WordEntry current; - while ((current = elements[index]) != null) { - if (CharOperation.equals(current.getWord(), word)) return elements[index] = entry; - if (++index == length) index = 0; - } - elements[index] = entry; - - // assumes the threshold is never equal to the size of the table - if (++elementSize > threshold) grow(); - return entry; - } - - public WordEntry[] asArray() { - WordEntry[] array = new WordEntry[elementSize]; - for (int i = 0, j = 0, length = elements.length; i < length; i++) { - WordEntry current = elements[i]; - if (current != null) array[j++] = current; - } - return array; - } - - public WordEntry get(char[] word) { - int length = elements.length; - int index = CharOperation.hashCode(word) % length; - WordEntry current; - while ((current = elements[index]) != null) { - if (CharOperation.equals(current.getWord(), word)) return current; - if (++index == length) index = 0; - } - return null; - } - - private void grow() { - WordEntryHashedArray newArray = new WordEntryHashedArray(elementSize * 2); // double the number of expected elements - for (int i = 0, length = elements.length; i < length; i++) - if (elements[i] != null) - newArray.add(elements[i]); - - this.elements = newArray.elements; - this.elementSize = newArray.elementSize; - this.threshold = newArray.threshold; - } - - public String toString() { - String s = ""; //$NON-NLS-1$ - WordEntry[] entries = asArray(); - for (int i = 0, length = entries.length; i < length; i++) - s += entries[i].toString() + "\n"; //$NON-NLS-1$ - return s; - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/messages.properties b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/messages.properties deleted file mode 100644 index 7d7bc92324f..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/messages.properties +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -### Eclipse CDT Core Search messages. - -engine.searching = Searching... -exception.wrongFormat = Wrong format -process.name = CDT Indexer -manager.filesToIndex = {0} files to index - -convention.illegalIdentifier= Illegal Identifier -convention.scope.lowercaseName= Scope starts with lower case -convention.scope.nullName= Scope name is null -convention.scope.emptyName= Scope name is empty -convention.scope.dotName= Scope name starts or ends with a . -convention.scope.nameWithBlanks= Scop name has blanks - -convention.class.nullName= Class name is null -convention.class.nameWithBlanks= Class name has blanks -convention.class.dollarName= Class name has $ -convention.class.lowercaseName= Class name starts with lower case -convention.class.invalidName= Class name is invalid diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java deleted file mode 100644 index 7a37433e6cb..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.search; - - /** - * Hashtable for non-zero int keys. - */ - -public final class HashtableOfInt { - // to avoid using Enumerations, walk the individual tables skipping nulls - public int[] keyTable; - public Object[] valueTable; - - int elementSize; // number of elements in the table - int threshold; - public HashtableOfInt() { - this(13); - } - public HashtableOfInt(int size) { - this.elementSize = 0; - this.threshold = size; // size represents the expected number of elements - int extraRoom = (int) (size * 1.75f); - if (this.threshold == extraRoom) - extraRoom++; - this.keyTable = new int[extraRoom]; - this.valueTable = new Object[extraRoom]; - } - public boolean containsKey(int key) { - int index = key % valueTable.length; - int currentKey; - while ((currentKey = keyTable[index]) != 0) { - if (currentKey == key) - return true; - index = (index + 1) % keyTable.length; - } - return false; - } - public Object get(int key) { - int index = key % valueTable.length; - int currentKey; - while ((currentKey = keyTable[index]) != 0) { - if (currentKey == key) return valueTable[index]; - index = (index + 1) % keyTable.length; - } - return null; - } - public Object put(int key, Object value) { - int index = key % valueTable.length; - int currentKey; - while ((currentKey = keyTable[index]) != 0) { - if (currentKey == key) return valueTable[index] = value; - index = (index + 1) % keyTable.length; - } - keyTable[index] = key; - valueTable[index] = value; - - // assumes the threshold is never equal to the size of the table - if (++elementSize > threshold) - rehash(); - return value; - } - private void rehash() { - HashtableOfInt newHashtable = new HashtableOfInt(elementSize * 2); // double the number of expected elements - int currentKey; - for (int i = keyTable.length; --i >= 0;) - if ((currentKey = keyTable[i]) != 0) - newHashtable.put(currentKey, valueTable[i]); - - this.keyTable = newHashtable.keyTable; - this.valueTable = newHashtable.valueTable; - this.threshold = newHashtable.threshold; - } - public int size() { - return elementSize; - } - public String toString() { - String s = ""; //$NON-NLS-1$ - Object object; - for (int i = 0, length = valueTable.length; i < length; i++) - if ((object = valueTable[i]) != null) - s += keyTable[i] + " -> " + object.toString() + "\n"; //$NON-NLS-2$ //$NON-NLS-1$ - return s; - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java deleted file mode 100644 index c7ef26cd704..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.search; - -/** - * A simple lookup table is a non-synchronized Hashtable, whose keys - * and values are Objects. It also uses linear probing to resolve collisions - * rather than a linked list of hash table entries. - */ -public final class SimpleLookupTable implements Cloneable { - - // to avoid using Enumerations, walk the individual tables skipping nulls - public Object[] keyTable; - public Object[] valueTable; - public int elementSize; // number of elements in the table - public int threshold; - - public SimpleLookupTable() { - this(13); - } - - public SimpleLookupTable(int size) { - if (size < 3) size = 3; - this.elementSize = 0; - this.threshold = size + 1; // size is the expected number of elements - int tableLength = 2 * size + 1; - this.keyTable = new Object[tableLength]; - this.valueTable = new Object[tableLength]; - } - - public Object clone() throws CloneNotSupportedException { - SimpleLookupTable result = (SimpleLookupTable) super.clone(); - result.elementSize = this.elementSize; - result.threshold = this.threshold; - - int length = this.keyTable.length; - result.keyTable = new Object[length]; - System.arraycopy(this.keyTable, 0, result.keyTable, 0, length); - - length = this.valueTable.length; - result.valueTable = new Object[length]; - System.arraycopy(this.valueTable, 0, result.valueTable, 0, length); - return result; - } - - public boolean containsKey(Object key) { - int length = keyTable.length; - int index = (key.hashCode() & 0x7FFFFFFF) % length; - Object currentKey; - while ((currentKey = keyTable[index]) != null) { - if (currentKey.equals(key)) return true; - if (++index == length) index = 0; - } - return false; - } - - public Object get(Object key) { - int length = keyTable.length; - int index = (key.hashCode() & 0x7FFFFFFF) % length; - Object currentKey; - while ((currentKey = keyTable[index]) != null) { - if (currentKey.equals(key)) return valueTable[index]; - if (++index == length) index = 0; - } - return null; - } - - public Object keyForValue(Object valueToMatch) { - if (valueToMatch != null) - for (int i = 0, l = valueTable.length; i < l; i++) - if (valueToMatch.equals(valueTable[i])) - return keyTable[i]; - return null; - } - - public Object put(Object key, Object value) { - int length = keyTable.length; - int index = (key.hashCode() & 0x7FFFFFFF) % length; - Object currentKey; - while ((currentKey = keyTable[index]) != null) { - if (currentKey.equals(key)) return valueTable[index] = value; - if (++index == length) index = 0; - } - keyTable[index] = key; - valueTable[index] = value; - - // assumes the threshold is never equal to the size of the table - if (++elementSize > threshold) rehash(); - return value; - } - - public void removeKey(Object key) { - int length = keyTable.length; - int index = (key.hashCode() & 0x7FFFFFFF) % length; - Object currentKey; - while ((currentKey = keyTable[index]) != null) { - if (currentKey.equals(key)) { - elementSize--; - keyTable[index] = null; - valueTable[index] = null; - if (keyTable[index + 1 == length ? 0 : index + 1] != null) - rehash(); // only needed if a possible collision existed - return; - } - if (++index == length) index = 0; - } - } - - public void removeValue(Object valueToRemove) { - boolean rehash = false; - for (int i = 0, l = valueTable.length; i < l; i++) { - Object value = valueTable[i]; - if (value != null && value.equals(valueToRemove)) { - elementSize--; - keyTable[i] = null; - valueTable[i] = null; - if (!rehash && keyTable[i + 1 == l ? 0 : i + 1] != null) - rehash = true; // only needed if a possible collision existed - } - } - if (rehash) rehash(); - } - - private void rehash() { - SimpleLookupTable newLookupTable = new SimpleLookupTable(elementSize * 2); // double the number of expected elements - Object currentKey; - for (int i = keyTable.length; --i >= 0;) - if ((currentKey = keyTable[i]) != null) - newLookupTable.put(currentKey, valueTable[i]); - - this.keyTable = newLookupTable.keyTable; - this.valueTable = newLookupTable.valueTable; - this.elementSize = newLookupTable.elementSize; - this.threshold = newLookupTable.threshold; - } - - public String toString() { - String s = ""; //$NON-NLS-1$ - Object object; - for (int i = 0, l = valueTable.length; i < l; i++) - if ((object = valueTable[i]) != null) - s += keyTable[i].toString() + " -> " + object.toString() + "\n"; //$NON-NLS-2$ //$NON-NLS-1$ - return s; - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java deleted file mode 100644 index 2fbb96494af..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java +++ /dev/null @@ -1,659 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.index.IIndexer; -import org.eclipse.cdt.internal.core.index.IIndexerOutput; -import org.eclipse.core.resources.IFile; - -public abstract class AbstractIndexer implements IIndexer, IIndexConstants, ICSearchConstants { - - IIndexerOutput output; - final static int CLASS = 1; - final static int STRUCT = 2; - final static int UNION = 3; - final static int ENUM = 4; - final static int VAR = 5; - final static int TYPEDEF = 6; - - public static boolean VERBOSE = false; - - public AbstractIndexer() { - super(); - } - - public static void verbose(String log) { - System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$//$NON-NLS-2$ - } - - public void addClassSpecifier(IASTClassSpecifier classSpecification){ - - if (classSpecification.getClassKind().equals(ASTClassKind.CLASS)) - { - this.output.addRef(encodeTypeEntry(classSpecification.getFullyQualifiedName(),CLASS, ICSearchConstants.DECLARATIONS)); - } - else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT)) - { - this.output.addRef(encodeTypeEntry(classSpecification.getFullyQualifiedName(),STRUCT, ICSearchConstants.DECLARATIONS)); - } - else if (classSpecification.getClassKind().equals(ASTClassKind.UNION)) - { - this.output.addRef(encodeTypeEntry(classSpecification.getFullyQualifiedName(),UNION, ICSearchConstants.DECLARATIONS)); - } - } - - public void addEnumerationSpecifier(IASTEnumerationSpecifier enumeration) { - this.output.addRef(encodeTypeEntry(enumeration.getFullyQualifiedName(), ENUM, ICSearchConstants.DECLARATIONS)); - - Iterator i = enumeration.getEnumerators(); - while (i.hasNext()) - { - IASTEnumerator en = (IASTEnumerator) i.next(); - String[] enumeratorFullName = - createEnumeratorFullyQualifiedName(en); - - this.output.addRef(encodeEntry( enumeratorFullName, FIELD_DECL, FIELD_DECL_LENGTH )); - - } - } - - protected String[] createEnumeratorFullyQualifiedName(IASTEnumerator en) { - String name = en.getName(); - IASTEnumerationSpecifier parent = en.getOwnerEnumerationSpecifier(); - String[] parentName = parent.getFullyQualifiedName(); - - //See spec 7.2-10, the the scope of the enumerator is the same level as the enumeration - String[] enumeratorFullName = new String[ parentName.length ]; - - System.arraycopy( parentName, 0, enumeratorFullName, 0, parentName.length); - enumeratorFullName[ parentName.length - 1 ] = name; - return enumeratorFullName; - } - - public void addEnumeratorReference(IASTEnumerator enumerator) { - this.output.addRef(encodeEntry(createEnumeratorFullyQualifiedName(enumerator),FIELD_REF,FIELD_REF_LENGTH)); - } - - public void addMacro(IASTMacro macro) { - String[] macroName = new String[1]; - macroName[0] = macro.getName(); - this.output.addRef(encodeEntry(macroName,MACRO_DECL,MACRO_DECL_LENGTH)); - } - - public void addEnumerationReference(IASTEnumerationSpecifier enumeration) { - this.output.addRef(encodeTypeEntry(enumeration.getFullyQualifiedName(), ENUM, ICSearchConstants.REFERENCES)); - } - public void addVariable(IASTVariable variable) { - this.output.addRef(encodeTypeEntry(variable.getFullyQualifiedName(), VAR, ICSearchConstants.DECLARATIONS)); - } - - public void addVariableReference(IASTVariable variable) { - this.output.addRef(encodeTypeEntry(variable.getFullyQualifiedName(), VAR, ICSearchConstants.REFERENCES)); - } - - public void addParameterReference( IASTParameterDeclaration parameter ){ - this.output.addRef( encodeTypeEntry( new String [] { parameter.getName() }, VAR, ICSearchConstants.REFERENCES)); - } - - public void addTypedefDeclaration(IASTTypedefDeclaration typedef) { - this.output.addRef(encodeEntry(typedef.getFullyQualifiedName(), TYPEDEF_DECL, TYPEDEF_DECL_LENGTH)); - } - - public void addFieldDeclaration(IASTField field) { - this.output.addRef(encodeEntry(field.getFullyQualifiedName(),FIELD_DECL,FIELD_DECL_LENGTH)); - } - - public void addFieldReference(IASTField field) { - this.output.addRef(encodeEntry(field.getFullyQualifiedName(),FIELD_REF,FIELD_REF_LENGTH)); - } - - public void addMethodDeclaration(IASTMethod method) { - this.output.addRef(encodeEntry(method.getFullyQualifiedName(),METHOD_DECL,METHOD_DECL_LENGTH)); - } - - public void addMethodReference(IASTMethod method) { - this.output.addRef(encodeEntry(method.getFullyQualifiedName(),METHOD_REF,METHOD_REF_LENGTH)); - } - - public void addElaboratedForwardDeclaration(IASTElaboratedTypeSpecifier elaboratedType) { - if (elaboratedType.getClassKind().equals(ASTClassKind.CLASS)) - { - this.output.addRef(encodeTypeEntry(elaboratedType.getFullyQualifiedName(),CLASS, ICSearchConstants.DECLARATIONS)); - } - else if (elaboratedType.getClassKind().equals(ASTClassKind.STRUCT)) - { - this.output.addRef(encodeTypeEntry(elaboratedType.getFullyQualifiedName(),STRUCT, ICSearchConstants.DECLARATIONS)); - } - else if (elaboratedType.getClassKind().equals(ASTClassKind.UNION)) - { - this.output.addRef(encodeTypeEntry(elaboratedType.getFullyQualifiedName(),UNION, ICSearchConstants.DECLARATIONS)); - } - } - - public void addConstructorDeclaration(){ - - } - public void addConstructorReference(){ - - } - - public void addMemberDeclaration(){ - - } - public void addMemberReference(){ - - } - - public void addFunctionDeclaration(IASTFunction function){ - this.output.addRef(encodeEntry(function.getFullyQualifiedName(),FUNCTION_DECL,FUNCTION_DECL_LENGTH)); - } - - public void addFunctionReference(IASTFunction function){ - this.output.addRef(encodeEntry(function.getFullyQualifiedName(),FUNCTION_REF,FUNCTION_REF_LENGTH)); - } - - public void addNameReference(){ - - } - - public void addNamespaceDefinition(IASTNamespaceDefinition namespace){ - this.output.addRef(encodeEntry(namespace.getFullyQualifiedName(),NAMESPACE_DECL,NAMESPACE_DECL_LENGTH)); - } - - public void addNamespaceReference(IASTNamespaceDefinition namespace) { - this.output.addRef(encodeEntry(namespace.getFullyQualifiedName(),NAMESPACE_REF,NAMESPACE_REF_LENGTH)); - } - - public void addTypedefReference( IASTTypedefDeclaration typedef ){ - this.output.addRef( encodeTypeEntry( typedef.getFullyQualifiedName(), TYPEDEF, ICSearchConstants.REFERENCES) ); - } - - private void addSuperTypeReference(int modifiers, char[] packageName, char[] typeName, char[][] enclosingTypeNames, char classOrInterface, char[] superTypeName, char superClassOrInterface){ - - } - - public void addTypeReference(char[] typeName){ - //this.output.addRef(CharOperation.concat(TYPE_REF, CharOperation.lastSegment(typeName, '.'))); - } - - public void addClassReference(IASTTypeSpecifier reference){ - String[] fullyQualifiedName = null; - ASTClassKind classKind = null; - - if (reference instanceof IASTClassSpecifier){ - IASTClassSpecifier classRef = (IASTClassSpecifier) reference; - fullyQualifiedName = classRef.getFullyQualifiedName(); - classKind = classRef.getClassKind(); - } - else if (reference instanceof IASTElaboratedTypeSpecifier){ - IASTElaboratedTypeSpecifier typeRef = (IASTElaboratedTypeSpecifier) reference; - fullyQualifiedName = typeRef.getFullyQualifiedName(); - classKind = typeRef.getClassKind(); - } - - if (classKind.equals(ASTClassKind.CLASS)) - { - this.output.addRef(encodeTypeEntry(fullyQualifiedName,CLASS, ICSearchConstants.REFERENCES)); - } - else if (classKind.equals(ASTClassKind.STRUCT)) - { - this.output.addRef(encodeTypeEntry(fullyQualifiedName,STRUCT,ICSearchConstants.REFERENCES)); - } - else if (classKind.equals(ASTClassKind.UNION)) - { - this.output.addRef(encodeTypeEntry(fullyQualifiedName,UNION,ICSearchConstants.REFERENCES)); - } - } - /** - * Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' | 'E' ) '/' TypeName ['/' Qualifier]* - */ - protected static final char[] encodeTypeEntry( String [] fullTypeName, int typeType, LimitTo encodeType){ - - int pos = 0, nameLength = 0; - for (int i=0; i 0){ - //Extract the name first - char [] tempName = fullTypeName[fullTypeName.length-1].toCharArray(); - System.arraycopy(tempName, 0, result, pos, tempName.length); - pos += tempName.length; - } - //Extract the qualifiers - for (int i=fullTypeName.length - 2; i >= 0; i--){ - result[pos++] = SEPARATOR; - char [] tempName = fullTypeName[i].toCharArray(); - System.arraycopy(tempName, 0, result, pos, tempName.length); - pos+=tempName.length; - } - - if (AbstractIndexer.VERBOSE) - AbstractIndexer.verbose(new String(result)); - - return result; - } - /** - * Namespace entries are encoded as follow: '[prefix]/' TypeName ['/' Qualifier]* - */ - protected static final char[] encodeEntry(String[] elementName, char[] prefix, int prefixSize){ - int pos, nameLength = 0; - for (int i=0; i 0){ - //Extract the name first - char [] tempName = elementName[elementName.length-1].toCharArray(); - System.arraycopy(tempName, 0, result, pos, tempName.length); - pos += tempName.length; - } - //Extract the qualifiers - for (int i=elementName.length - 2; i>=0; i--){ - result[pos++] = SEPARATOR; - char [] tempName = elementName[i].toCharArray(); - System.arraycopy(tempName, 0, result, pos, tempName.length); - pos+=tempName.length; - } - - if (AbstractIndexer.VERBOSE) - AbstractIndexer.verbose(new String(result)); - - return result; - } - - /** - * Returns the file types the IIndexer handles. - */ - public abstract String[] getFileTypes(); - /** - * Returns the file types being indexed. - */ - public abstract IFile getResourceFile(); - /** - * @see IIndexer#index(IDocument document, IIndexerOutput output) - */ - public void index(IDocument document, IIndexerOutput output) throws IOException { - this.output = output; - if (shouldIndex(document)) indexFile(document); - } - - protected abstract void indexFile(IDocument document) throws IOException; - /** - * @see IIndexer#shouldIndex(IDocument document) - */ - public boolean shouldIndex(IDocument document) { - String type = document.getType(); - String[] supportedTypes = this.getFileTypes(); - for (int i = 0; i < supportedTypes.length; ++i) { - if (supportedTypes[i].equals(type)) - return true; - } - return false; - } - /** - * Type entries are encoded as follow: 'typeDecl/' ('C' | 'S' | 'U' ) '/' TypeName '/' - * Current encoding is optimized for queries: all classes - */ - public static final char[] bestTypePrefix( SearchFor searchFor, LimitTo limitTo, char[] typeName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) { - char [] prefix = null; - if( limitTo == DECLARATIONS ){ - prefix = TYPE_DECL; - } else if( limitTo == REFERENCES ){ - prefix = TYPE_REF; - } else { - return TYPE_ALL; - } - - char classType = 0; - - if( searchFor == ICSearchConstants.CLASS ){ - classType = CLASS_SUFFIX; - } else if ( searchFor == ICSearchConstants.STRUCT ){ - classType = STRUCT_SUFFIX; - } else if ( searchFor == ICSearchConstants.UNION ){ - classType = UNION_SUFFIX; - } else if ( searchFor == ICSearchConstants.ENUM ){ - classType = ENUM_SUFFIX; - } else if ( searchFor == ICSearchConstants.TYPEDEF ){ - classType = TYPEDEF_SUFFIX; - } else { - //could be TYPE or CLASS_STRUCT, best we can do for these is the prefix - return prefix; - } - - return bestPrefix( prefix, classType, typeName, containingTypes, matchMode, isCaseSensitive ); - } - - public static final char[] bestNamespacePrefix(LimitTo limitTo, char[] namespaceName, char[][] containingTypes, int matchMode, boolean isCaseSensitive) { - char [] prefix = null; - if( limitTo == REFERENCES ){ - prefix = NAMESPACE_REF; - } else if ( limitTo == DECLARATIONS ) { - prefix = NAMESPACE_DECL; - } else { - return NAMESPACE_ALL; - } - - return bestPrefix( prefix, (char) 0, namespaceName, containingTypes, matchMode, isCaseSensitive ); - } - - public static final char[] bestVariablePrefix( LimitTo limitTo, char[] varName, char[][] containingTypes, int matchMode, boolean isCaseSenstive ){ - char [] prefix = null; - if( limitTo == REFERENCES ){ - prefix = TYPE_REF; - } else if( limitTo == DECLARATIONS ){ - prefix = TYPE_DECL; - } else { - return TYPE_ALL; - } - - return bestPrefix( prefix, VAR_SUFFIX, varName, containingTypes, matchMode, isCaseSenstive ); - } - - public static final char[] bestFieldPrefix( LimitTo limitTo, char[] fieldName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) { - char [] prefix = null; - if( limitTo == REFERENCES ){ - prefix = FIELD_REF; - } else if( limitTo == DECLARATIONS ){ - prefix = FIELD_DECL; - } else { - return FIELD_ALL; - } - - return bestPrefix( prefix, (char)0, fieldName, containingTypes, matchMode, isCaseSensitive ); - } - - public static final char[] bestMethodPrefix( LimitTo limitTo, char[] methodName,char[][] containingTypes, int matchMode, boolean isCaseSensitive) { - char [] prefix = null; - if( limitTo == REFERENCES ){ - prefix = METHOD_REF; - } else if( limitTo == DECLARATIONS ){ - prefix = METHOD_DECL; - } else if( limitTo == DEFINITIONS ){ - //TODO prefix = METHOD_DEF; - return METHOD_ALL; - } else { - return METHOD_ALL; - } - - return bestPrefix( prefix, (char)0, methodName, containingTypes, matchMode, isCaseSensitive ); - } - - public static final char[] bestFunctionPrefix( LimitTo limitTo, char[] functionName, int matchMode, boolean isCaseSensitive) { - char [] prefix = null; - if( limitTo == REFERENCES ){ - prefix = FUNCTION_REF; - } else if( limitTo == DECLARATIONS ){ - prefix = FUNCTION_DECL; - } else if ( limitTo == DEFINITIONS ){ - //TODO prefix = FUNCTION_DEF; - return FUNCTION_ALL; - } else { - return FUNCTION_ALL; - } - return bestPrefix( prefix, (char)0, functionName, null, matchMode, isCaseSensitive ); - } - - public static final char[] bestPrefix( char [] prefix, char optionalType, char[] name, char[][] containingTypes, int matchMode, boolean isCaseSensitive) { - char[] result = null; - int pos = 0; - - int wildPos, starPos = -1, questionPos; - - //length of prefix + separator - int length = prefix.length; - - //add length for optional type + another separator - if( optionalType != 0 ) - length += 2; - - if (!isCaseSensitive){ - //index is case sensitive, thus in case attempting case insensitive search, cannot consider - //type name. - name = null; - } else if( matchMode == PATTERN_MATCH && name != null ){ - int start = 0; - - char [] temp = new char [ name.length ]; - boolean isEscaped = false; - int tmpIdx = 0; - for( int i = 0; i < name.length; i++ ){ - if( name[i] == '\\' ){ - if( !isEscaped ){ - isEscaped = true; - continue; - } - isEscaped = false; - } else if( name[i] == '*' && !isEscaped ){ - starPos = i; - break; - } - temp[ tmpIdx++ ] = name[i]; - } - - name = new char [ tmpIdx ]; - System.arraycopy( temp, 0, name, 0, tmpIdx ); - - //starPos = CharOperation.indexOf( '*', name ); - questionPos = CharOperation.indexOf( '?', name ); - - if( starPos >= 0 ){ - if( questionPos >= 0 ) - wildPos = ( starPos < questionPos ) ? starPos : questionPos; - else - wildPos = starPos; - } else { - wildPos = questionPos; - } - - switch( wildPos ){ - case -1 : break; - case 0 : name = null; break; - default : name = CharOperation.subarray( name, 0, wildPos ); break; - } - } - //add length for name - if( name != null ){ - length += name.length; - } else { - //name is null, don't even consider qualifications. - result = new char [ length ]; - System.arraycopy( prefix, 0, result, 0, pos = prefix.length ); - if( optionalType != 0){ - result[ pos++ ] = optionalType; - result[ pos++ ] = SEPARATOR; - } - return result; - } - - //add the total length of the qualifiers - //we don't want to mess with the contents of this array (treat it as constant) - //so check for wild cards later. - if( containingTypes != null ){ - for( int i = 0; i < containingTypes.length; i++ ){ - if( containingTypes[i].length > 0 ){ - length += containingTypes[ i ].length; - length++; //separator - } - } - } - - //because we haven't checked qualifier wild cards yet, this array might turn out - //to be too long. So fill a temp array, then check the length after - char [] temp = new char [ length ]; - - System.arraycopy( prefix, 0, temp, 0, pos = prefix.length ); - - if( optionalType != 0 ){ - temp[ pos++ ] = optionalType; - temp[ pos++ ] = SEPARATOR; - } - - System.arraycopy( name, 0, temp, pos, name.length ); - pos += name.length; - - if( containingTypes != null ){ - for( int i = containingTypes.length - 1; i >= 0; i-- ){ - if( matchMode == PATTERN_MATCH ){ - starPos = CharOperation.indexOf( '*', containingTypes[i] ); - questionPos = CharOperation.indexOf( '?', containingTypes[i] ); - - if( starPos >= 0 ){ - if( questionPos >= 0 ) - wildPos = ( starPos < questionPos ) ? starPos : questionPos; - else - wildPos = starPos; - } else { - wildPos = questionPos; - } - - if( wildPos >= 0 ){ - temp[ pos++ ] = SEPARATOR; - System.arraycopy( containingTypes[i], 0, temp, pos, wildPos ); - pos += starPos; - break; - } - } - - if( containingTypes[i].length > 0 ){ - temp[ pos++ ] = SEPARATOR; - System.arraycopy( containingTypes[i], 0, temp, pos, containingTypes[i].length ); - pos += containingTypes[i].length; - } - } - } - - if( pos < length ){ - result = new char[ pos ]; - System.arraycopy( temp, 0, result, 0, pos ); - } else { - result = temp; - } - - return result; - } - - /** - * @param _limitTo - * @param simpleName - * @param _matchMode - * @param _caseSensitive - * @return - */ - public static final char[] bestMacroPrefix( LimitTo limitTo, char[] macroName, int matchMode, boolean isCaseSenstive ){ - //since we only index macro declarations we already know the prefix - char [] prefix = null; - if( limitTo == DECLARATIONS ){ - prefix = MACRO_DECL; - } else { - return null; - } - - return bestPrefix( prefix, (char)0, macroName, null, matchMode, isCaseSenstive ); - } - - /** - * @param _limitTo - * @param simpleName - * @param _matchMode - * @param _caseSensitive - * @return - */ - public static final char[] bestIncludePrefix( LimitTo limitTo, char[] incName, int matchMode, boolean isCaseSenstive ){ - //since we only index macro declarations we already know the prefix - char [] prefix = null; - if( limitTo == REFERENCES ){ - prefix = INCLUDE_REF; - } else { - return null; - } - - return bestPrefix( prefix, (char)0, incName, null, matchMode, isCaseSenstive ); - } - - public void addInclude(IASTInclusion inclusion, IASTInclusion parent){ - this.output.addIncludeRef(inclusion.getFullFileName()); - this.output.addRelatives(inclusion.getFullFileName(),(parent != null ) ? parent.getFullFileName() : null); - //Add Dep Table entry - String[] incName = new String[1]; - incName[0] = inclusion.getFullFileName(); - this.output.addRef(encodeEntry(incName, INCLUDE_REF, INCLUDE_REF_LENGTH)); - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java deleted file mode 100644 index ecff290b200..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; - -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.impl.IFileDocument; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; - -public class AddCompilationUnitToIndex extends AddFileToIndex { - char[] contents; - - public AddCompilationUnitToIndex(IFile resource, IPath indexedContainer, IndexManager manager) { - super(resource, indexedContainer, manager); - } - protected boolean indexDocument(IIndex index) throws IOException { - if (!initializeContents()) return false; - index.add(new IFileDocument(resource, this.contents), new SourceIndexer(resource)); - return true; - } - public boolean initializeContents() { - if (this.contents == null) { - try { - IPath location = resource.getLocation(); - if (location != null) - this.contents = org.eclipse.cdt.internal.core.Util.getFileCharContent(location.toFile(), null); - } catch (IOException e) { - } - } - return this.contents != null; - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java deleted file mode 100644 index 82245a2fa56..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; - -import org.eclipse.cdt.core.ICLogConstants; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public abstract class AddFileToIndex extends IndexRequest { - IFile resource; - - public AddFileToIndex(IFile resource, IPath indexPath, IndexManager manager) { - super(indexPath, manager); - this.resource = resource; - } - - public boolean execute(IProgressMonitor progressMonitor) { - if (progressMonitor != null && progressMonitor.isCanceled()) return true; - /* ensure no concurrent write access to index */ - IIndex index = manager.getIndex(this.indexPath, true, /*reuse index file*/ true /*create if none*/); - if (index == null) return true; - ReadWriteMonitor monitor = manager.getMonitorFor(index); - if (monitor == null) return true; // index got deleted since acquired - try { - monitor.enterWrite(); // ask permission to write - if (!indexDocument(index)) return false; - } catch (IOException e) { - org.eclipse.cdt.internal.core.model.Util.log(null, "Index I/O Exception: " + e.getMessage() + " on File: " + resource.getName(), ICLogConstants.CDT); - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to index " + this.resource + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - return false; - } finally { - monitor.exitWrite(); // free write lock - } - return true; - } - - protected abstract boolean indexDocument(IIndex index) throws IOException; - - public String toString() { - return "indexing " + this.resource.getFullPath(); //$NON-NLS-1$ - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java deleted file mode 100644 index 029aa05f285..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -class AddFolderToIndex extends IndexRequest { - IPath folderPath; - IProject project; - char[][] exclusionPattern; - - public AddFolderToIndex(IPath folderPath, IProject project, char[][] exclusionPattern, IndexManager manager) { - super(project.getFullPath(), manager); - this.folderPath = folderPath; - this.project = project; - this.exclusionPattern = exclusionPattern; - } - - public boolean execute(IProgressMonitor progressMonitor) { - if (progressMonitor != null && progressMonitor.isCanceled()) return true; - if (!project.isAccessible()) return true; // nothing to do - IResource folder = this.project.getParent().findMember(this.folderPath); - if (folder == null || folder.getType() == IResource.FILE) return true; // nothing to do, source folder was removed - - /* ensure no concurrent write access to index */ - IIndex index = manager.getIndex(this.indexPath, true, /*reuse index file*/ true /*create if none*/); - if (index == null) return true; - ReadWriteMonitor monitor = manager.getMonitorFor(index); - if (monitor == null) return true; // index got deleted since acquired - - try { - monitor.enterRead(); // ask permission to read - - final IPath container = this.indexPath; - final IndexManager indexManager = this.manager; - final char[][] pattern = exclusionPattern; - folder.accept( - new IResourceProxyVisitor() { - public boolean visit(IResourceProxy proxy) throws CoreException { - switch(proxy.getType()) { - case IResource.FILE : -// TODO: BOG Put the file name checking back - //if (Util.isJavaFileName(proxy.getName())) { - IResource resource = proxy.requestResource(); - if (pattern == null || !Util.isExcluded(resource, pattern)) - indexManager.addSource((IFile)resource, container); - //} - //return false; - case IResource.FOLDER : - if (pattern != null && Util.isExcluded(proxy.requestResource(), pattern)) - return false; - } - return true; - } - }, - IResource.NONE - ); - } catch (CoreException e) { - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to add " + this.folderPath + " to index because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - return false; - } finally { - monitor.exitRead(); // free read lock - } - return true; - } - - public String toString() { - return "adding " + this.folderPath + " to index " + this.indexPath; //$NON-NLS-1$ //$NON-NLS-2$ - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java deleted file mode 100644 index ee57290fd4c..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; -/** - * @author bgheorgh - */ -public interface IIndexConstants { - - /* index encoding */ - char[] REF= "ref/".toCharArray(); //$NON-NLS-1$ - - char[] TYPE_REF= "typeRef/".toCharArray(); //$NON-NLS-1$ - int TYPE_REF_LENGTH = 8; - - char[] TYPE_DECL = "typeDecl/".toCharArray(); //$NON-NLS-1$ - char[] TYPE_ALL = "type".toCharArray(); //$NON-NLS-1$ - int TYPE_DECL_LENGTH = 9; - - char[] FUNCTION_REF= "functionRef/".toCharArray(); //$NON-NLS-1$ - int FUNCTION_REF_LENGTH=12; - - char[] FUNCTION_DECL= "functionDecl/".toCharArray(); //$NON-NLS-1$ - char[] FUNCTION_ALL= "function".toCharArray(); //$NON-NLS-1$ - int FUNCTION_DECL_LENGTH = 13; - - char[] CONSTRUCTOR_REF= "constructorRef/".toCharArray(); //$NON-NLS-1$ - char[] CONSTRUCTOR_DECL= "constructorDecl/".toCharArray(); //$NON-NLS-1$ - - char[] NAMESPACE_REF= "namespaceRef/".toCharArray(); //$NON-NLS-1$ - int NAMESPACE_REF_LENGTH=13; - - char[] NAMESPACE_DECL= "namespaceDecl/".toCharArray(); //$NON-NLS-1$ - char[] NAMESPACE_ALL = "namespace".toCharArray(); //$NON-NLS-1$ - int NAMESPACE_DECL_LENGTH = 14; - - - char[] FIELD_REF= "fieldRef/".toCharArray(); //$NON-NLS-1$ - int FIELD_REF_LENGTH=9; - - char[] FIELD_DECL= "fieldDecl/".toCharArray(); //$NON-NLS-1$ - char[] FIELD_ALL= "field".toCharArray(); //$NON-NLS-1$ - int FIELD_DECL_LENGTH = 10; - - char[] METHOD_REF= "methodRef/".toCharArray(); //$NON-NLS-1$ - int METHOD_REF_LENGTH = 10; - - char[] METHOD_DECL= "methodDecl/".toCharArray(); //$NON-NLS-1$ - char[] METHOD_ALL= "method".toCharArray(); //$NON-NLS-1$ - int METHOD_DECL_LENGTH = 11; - - char[] TYPEDEF_DECL = "typeDecl/T/".toCharArray(); //$NON-NLS-1$ - int TYPEDEF_DECL_LENGTH = 11; - - char[] MACRO_DECL = "macroDecl/".toCharArray(); - int MACRO_DECL_LENGTH = 10; - - char[] INCLUDE_REF = "includeRef/".toCharArray(); - int INCLUDE_REF_LENGTH = 11; - //a Var REF will be treated as a typeREF - //char[] VAR_REF= "varRef/".toCharArray(); //$NON-NLS-1$ - - //a Struct REF will be treated as a typeREF - //char[] STRUCT_REF= "structRef/".toCharArray(); //$NON-NLS-1$ - - //a Enum REF will be treated as a typeREF - //char[] ENUM_REF= "enumRef/".toCharArray(); //$NON-NLS-1$ - - //a UNION REF will be treated as a typeREF - //char[] UNION_REF= "unionRef/".toCharArray(); //$NON-NLS-1$ - - - char[] SUPER_REF = "superRef/".toCharArray(); //$NON-NLS-1$ - - char[] CLASS_DECL= "typeDecl/C/".toCharArray(); //$NON-NLS-1$ - char[] VAR_DECL= "typeDecl/V/".toCharArray(); //$NON-NLS-1$ - char[] STRUCT_DECL= "typeDecl/S/".toCharArray(); //$NON-NLS-1$ - char[] ENUM_DECL= "typeDecl/E/".toCharArray(); //$NON-NLS-1$ - char[] UNION_DECL= "typeDecl/U/".toCharArray(); //$NON-NLS-1$ - - char[] OBJECT = "Object".toCharArray(); //$NON-NLS-1$ - char[][] COUNTS= - new char[][] { new char[] {'0'}, new char[] {'1'}, new char[] {'2'}, new char[] {'3'}, new char[] {'4'}, new char[] {'5'}, new char[] {'6'}, new char[] {'7'}, new char[] {'8'}, new char[] {'9'} - }; - char CLASS_SUFFIX = 'C'; - char VAR_SUFFIX = 'V'; - char STRUCT_SUFFIX = 'S'; - char ENUM_SUFFIX = 'E'; - char UNION_SUFFIX = 'U'; - char TYPEDEF_SUFFIX = 'T'; - - char TYPE_SUFFIX = 0; - char SEPARATOR= '/'; - - char[] ONE_STAR = new char[] {'*'}; - char[][] ONE_STAR_CHAR = new char[][] {ONE_STAR}; - - // used as special marker for enclosing type name of local and anonymous classes - char[] ONE_ZERO = new char[] {'0'}; - char[][] ONE_ZERO_CHAR = new char[][] {ONE_ZERO}; -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java deleted file mode 100644 index bf4b4cf9b1d..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; -import java.util.HashSet; - -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.IQueryResult; -import org.eclipse.cdt.internal.core.index.impl.IFileDocument; -import org.eclipse.cdt.internal.core.search.SimpleLookupTable; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - - -public class IndexAllProject extends IndexRequest { - IProject project; - - public IndexAllProject(IProject project, IndexManager manager) { - super(project.getFullPath(), manager); - this.project = project; - } - - public boolean equals(Object o) { - if (o instanceof IndexAllProject) - return this.project.equals(((IndexAllProject) o).project); - return false; - } - /** - * Ensure consistency of a project index. Need to walk all nested resources, - * and discover resources which have either been changed, added or deleted - * since the index was produced. - */ - public boolean execute(IProgressMonitor progressMonitor) { - - if (progressMonitor != null && progressMonitor.isCanceled()) return true; - if (!project.isAccessible()) return true; // nothing to do - - IIndex index = this.manager.getIndex(this.indexPath, true, /*reuse index file*/ true /*create if none*/); - if (index == null) return true; - ReadWriteMonitor monitor = this.manager.getMonitorFor(index); - if (monitor == null) return true; // index got deleted since acquired - - try { - monitor.enterRead(); // ask permission to read - saveIfNecessary(index, monitor); - - IQueryResult[] results = index.queryInDocumentNames(""); // all file names //$NON-NLS-1$ - int max = results == null ? 0 : results.length; - final SimpleLookupTable indexedFileNames = new SimpleLookupTable(max == 0 ? 33 : max + 11); - final String OK = "OK"; //$NON-NLS-1$ - final String DELETED = "DELETED"; //$NON-NLS-1$ - for (int i = 0; i < max; i++) - indexedFileNames.put(results[i].getPath(), DELETED); - final long indexLastModified = max == 0 ? 0L : index.getIndexFile().lastModified(); - -// CModel model = (CModel) CModelManager.getDefault().getCModel(); -// ICProject cProject = model.getCProject(project.getName()); -// ICElement[] kids = cProject.getChildren(); - IPath cProjectPath = project.getFullPath(); - - IWorkspaceRoot root = this.project.getWorkspace().getRoot(); - IResource sourceFolder = root.findMember(cProjectPath); - - if (this.isCancelled) return false; - - if (sourceFolder != null) { - - // collect output locations if source is project (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32041) - final HashSet outputs = new HashSet(); - - final boolean hasOutputs = !outputs.isEmpty(); - - final char[][] patterns = null; - if (max == 0) { - sourceFolder.accept( - new IResourceProxyVisitor() { - public boolean visit(IResourceProxy proxy) { - if (isCancelled) return false; - switch(proxy.getType()) { - case IResource.FILE : - if (Util.isCCFileName(proxy.getName())) { - IResource resource = proxy.requestResource(); - if (resource.getLocation() != null && (patterns == null || !Util.isExcluded(resource, patterns))) { - String name = new IFileDocument((IFile) resource).getName(); - indexedFileNames.put(name, resource); - } - } - return false; - - case IResource.FOLDER : - if (patterns != null && Util.isExcluded(proxy.requestResource(), patterns)) - return false; - if (hasOutputs && outputs.contains(proxy.requestFullPath())) { - return false; - } - } - return true; - } - }, - IResource.NONE - ); - } else { - sourceFolder.accept( - new IResourceProxyVisitor() { - public boolean visit(IResourceProxy proxy) { - if (isCancelled) return false; - switch(proxy.getType()) { - case IResource.FILE : -// TODO: BOG Put the file name checking back - //if (Util.isCCFileName(proxy.getName())) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - if (path != null && (patterns == null || !Util.isExcluded(resource, patterns))) { - String name = new IFileDocument((IFile) resource).getName(); - indexedFileNames.put(name, - indexedFileNames.get(name) == null || indexLastModified < path.toFile().lastModified() - ? (Object) resource - : (Object) OK); - } - //} - //return false; - case IResource.FOLDER : - if (patterns != null && Util.isExcluded(proxy.requestResource(), patterns)) - return false; - if (hasOutputs && outputs.contains(proxy.requestFullPath())) { - return false; - } - } - return true; - } - }, - IResource.NONE - ); - } - } - - Object[] names = indexedFileNames.keyTable; - Object[] values = indexedFileNames.valueTable; - boolean shouldSave = false; - for (int i = 0, length = names.length; i < length; i++) { - String name = (String) names[i]; - if (name != null) { - if (this.isCancelled) return false; - - Object value = values[i]; - if (value != OK) { - shouldSave = true; - if (value == DELETED) - this.manager.remove(name, this.indexPath); - else - this.manager.addSource((IFile) value, this.indexPath); - } - } - } - - // request to save index when all cus have been indexed - if (shouldSave) - this.manager.request(new SaveIndex(this.indexPath, this.manager)); - - } catch (CoreException e) { - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to index " + this.project + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - this.manager.removeIndex(this.indexPath); - return false; - } catch (IOException e) { - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to index " + this.project + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - this.manager.removeIndex(this.indexPath); - return false; - } finally { - monitor.exitRead(); // free read lock - } - return true; - } - - public int hashCode() { - return this.project.hashCode(); - } - - protected Integer updatedIndexState() { - return IndexManager.REBUILDING_STATE; - } - - public String toString() { - return "indexing project " + this.project.getFullPath(); //$NON-NLS-1$ - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java deleted file mode 100644 index 54d1cd19f86..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java +++ /dev/null @@ -1,576 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.zip.CRC32; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.impl.Index; -import org.eclipse.cdt.internal.core.model.CProject; -import org.eclipse.cdt.internal.core.search.CWorkspaceScope; -import org.eclipse.cdt.internal.core.search.IndexSelector; -import org.eclipse.cdt.internal.core.search.SimpleLookupTable; -import org.eclipse.cdt.internal.core.search.processing.IJob; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.cdt.internal.core.sourcedependency.UpdateDependency; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; - - -public class IndexManager extends JobManager implements IIndexConstants { - /* number of file contents in memory */ - public static int MAX_FILES_IN_MEMORY = 0; - - public IWorkspace workspace; - public SimpleLookupTable indexNames = new SimpleLookupTable(); - private Map indexes = new HashMap(5); - - /* read write monitors */ - private Map monitors = new HashMap(5); - - /* need to save ? */ - private boolean needToSave = false; - private static final CRC32 checksumCalculator = new CRC32(); - private IPath cCorePluginLocation = null; - - /* can only replace a current state if its less than the new one */ - private SimpleLookupTable indexStates = null; - private File savedIndexNamesFile = - new File(getCCorePluginWorkingLocation().append("savedIndexNames.txt").toOSString()); //$NON-NLS-1$ - public static Integer SAVED_STATE = new Integer(0); - public static Integer UPDATING_STATE = new Integer(1); - public static Integer UNKNOWN_STATE = new Integer(2); - public static Integer REBUILDING_STATE = new Integer(3); - - public static boolean VERBOSE = false; - - public synchronized void aboutToUpdateIndex(IPath path, Integer newIndexState) { - // newIndexState is either UPDATING_STATE or REBUILDING_STATE - // must tag the index as inconsistent, in case we exit before the update job is started - String indexName = computeIndexName(path); - Object state = getIndexStates().get(indexName); - Integer currentIndexState = state == null ? UNKNOWN_STATE : (Integer) state; - if (currentIndexState.equals(REBUILDING_STATE)) return; // already rebuilding the index - - int compare = newIndexState.compareTo(currentIndexState); - if (compare > 0) { - // so UPDATING_STATE replaces SAVED_STATE and REBUILDING_STATE replaces everything - updateIndexState(indexName, newIndexState); - } else if (compare < 0 && this.indexes.get(path) == null) { - // if already cached index then there is nothing more to do - rebuildIndex(indexName, path); - } - } - /** - * Not at the moment... - * @param resource - * @param indexedContainer - */ - /* - public void addBinary(IFile resource, IPath indexedContainer){ - if (JavaCore.getPlugin() == null) return; - AddClassFileToIndex job = new AddClassFileToIndex(resource, indexedContainer, this); - if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) { - // reduces the chance that the file is open later on, preventing it from being deleted - if (!job.initializeContents()) return; - } - request(job); - } - */ - /** - * Trigger addition of a resource to an index - * Note: the actual operation is performed in background - */ - public void addSource(IFile resource, IPath indexedContainer){ - if (CCorePlugin.getDefault() == null) return; - AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this); - if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) { - // reduces the chance that the file is open later on, preventing it from being deleted - if (!job.initializeContents()) return; - } - request(job); - } - - public void updateDependencies(IResource resource){ - if (CCorePlugin.getDefault() == null) return; - UpdateDependency job = new UpdateDependency(resource); - - request(job); - } - - String computeIndexName(IPath path) { - String name = (String) indexNames.get(path); - if (name == null) { - String pathString = path.toOSString(); - checksumCalculator.reset(); - checksumCalculator.update(pathString.getBytes()); - String fileName = Long.toString(checksumCalculator.getValue()) + ".index"; //$NON-NLS-1$ - if (IndexManager.VERBOSE) - JobManager.verbose("-> index name for " + pathString + " is " + fileName); //$NON-NLS-1$ //$NON-NLS-2$ - name = getCCorePluginWorkingLocation().append(fileName).toOSString(); - indexNames.put(path, name); - } - return name; - } - /** - * Returns the index for a given project, according to the following algorithm: - * - if index is already in memory: answers this one back - * - if (reuseExistingFile) then read it and return this index and record it in memory - * - if (createIfMissing) then create a new empty index and record it in memory - * - * Warning: Does not check whether index is consistent (not being used) - */ - public synchronized IIndex getIndex(IPath path, boolean reuseExistingFile, boolean createIfMissing) { - // Path is already canonical per construction - IIndex index = (IIndex) indexes.get(path); - if (index == null) { - String indexName = computeIndexName(path); - Object state = getIndexStates().get(indexName); - Integer currentIndexState = state == null ? UNKNOWN_STATE : (Integer) state; - if (currentIndexState == UNKNOWN_STATE) { - // should only be reachable for query jobs - // IF you put an index in the cache, then AddJarFileToIndex fails because it thinks there is nothing to do - rebuildIndex(indexName, path); - return null; - } - - // index isn't cached, consider reusing an existing index file - if (reuseExistingFile) { - File indexFile = new File(indexName); - if (indexFile.exists()) { // check before creating index so as to avoid creating a new empty index if file is missing - try { - index = new Index(indexName, "Index for " + path.toOSString(), true /*reuse index file*/); //$NON-NLS-1$ - indexes.put(path, index); - monitors.put(index, new ReadWriteMonitor()); - return index; - } catch (IOException e) { - // failed to read the existing file or its no longer compatible - if (currentIndexState != REBUILDING_STATE) { // rebuild index if existing file is corrupt, unless the index is already being rebuilt - if (IndexManager.VERBOSE) - JobManager.verbose("-> cannot reuse existing index: "+indexName+" path: "+path.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ - rebuildIndex(indexName, path); - return null; - } else { - index = null; // will fall thru to createIfMissing & create a empty index for the rebuild all job to populate - } - } - } - if (currentIndexState == SAVED_STATE) { // rebuild index if existing file is missing - rebuildIndex(indexName, path); - return null; - } - } - // index wasn't found on disk, consider creating an empty new one - if (createIfMissing) { - try { - if (VERBOSE) - JobManager.verbose("-> create empty index: "+indexName+" path: "+path.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ - index = new Index(indexName, "Index for " + path.toOSString(), false /*do not reuse index file*/); //$NON-NLS-1$ - indexes.put(path, index); - monitors.put(index, new ReadWriteMonitor()); - return index; - } catch (IOException e) { - if (VERBOSE) - JobManager.verbose("-> unable to create empty index: "+indexName+" path: "+path.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ - // The file could not be created. Possible reason: the project has been deleted. - return null; - } - } - } - //System.out.println(" index name: " + path.toOSString() + " <----> " + index.getIndexFile().getName()); - return index; - } - - private SimpleLookupTable getIndexStates() { - if (indexStates != null) return indexStates; - - this.indexStates = new SimpleLookupTable(); - char[] savedIndexNames = readIndexState(); - if (savedIndexNames.length > 0) { - char[][] names = CharOperation.splitOn('\n', savedIndexNames); - for (int i = 0, l = names.length; i < l; i++) { - char[] name = names[i]; - if (name.length > 0) - this.indexStates.put(new String(name), SAVED_STATE); - } - } - return this.indexStates; - } - - private IPath getCCorePluginWorkingLocation() { - if (this.cCorePluginLocation != null) return this.cCorePluginLocation; - - return this.cCorePluginLocation = CCorePlugin.getDefault().getStateLocation(); - } - /** - * Index access is controlled through a read-write monitor so as - * to ensure there is no concurrent read and write operations - * (only concurrent reading is allowed). - */ - public ReadWriteMonitor getMonitorFor(IIndex index){ - return (ReadWriteMonitor) monitors.get(index); - } - /** - * Trigger addition of the entire content of a project - * Note: the actual operation is performed in background - */ - public void indexAll(IProject project) { - if (CCorePlugin.getDefault() == null) return; - - // check if the same request is not already in the queue - IndexRequest request = new IndexAllProject(project, this); - for (int i = this.jobEnd; i > this.jobStart; i--) // NB: don't check job at jobStart, as it may have already started (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32488) - if (request.equals(this.awaitingJobs[i])) return; - this.request(request); - } - /** - * Index the content of the given source folder. - */ - public void indexSourceFolder(CProject javaProject, IPath sourceFolder, final char[][] exclusionPattern) { - IProject project = javaProject.getProject(); - - if (this.jobEnd > this.jobStart) { - // check if a job to index the project is not already in the queue - IndexRequest request = new IndexAllProject(project, this); - for (int i = this.jobEnd; i > this.jobStart; i--) // NB: don't check job at jobStart, as it may have already started (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32488) - if (request.equals(this.awaitingJobs[i])) return; - } - this.request(new AddFolderToIndex(sourceFolder, project, exclusionPattern, this)); - } - - public void jobWasCancelled(IPath path) { - Object o = this.indexes.get(path); - if (o instanceof IIndex) { - this.monitors.remove(o); - this.indexes.remove(path); - } - updateIndexState(computeIndexName(path), UNKNOWN_STATE); - } - /** - * Advance to the next available job, once the current one has been completed. - * Note: clients awaiting until the job count is zero are still waiting at this point. - */ - protected synchronized void moveToNextJob() { - // remember that one job was executed, and we will need to save indexes at some point - needToSave = true; - super.moveToNextJob(); - } - /** - * No more job awaiting. - */ - protected void notifyIdle(long idlingTime){ - if (idlingTime > 1000 && needToSave) saveIndexes(); - } - /* - * For debug purpose - */ - public IIndex peekAtIndex(IPath path) { - return (IIndex) indexes.get(path); - } - /** - * Name of the background process - */ - public String processName(){ - return org.eclipse.cdt.internal.core.Util.bind("process.name"); //$NON-NLS-1$ - } - - private void rebuildIndex(String indexName, IPath path) { - Object target = org.eclipse.cdt.internal.core.Util.getTarget(ResourcesPlugin.getWorkspace().getRoot(), path, true); - if (target == null) return; - - if (IndexManager.VERBOSE) - JobManager.verbose("-> request to rebuild index: "+indexName+" path: "+path.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ - - updateIndexState(indexName, REBUILDING_STATE); - IndexRequest request = null; - if (target instanceof IProject) { - IProject p = (IProject) target; - request = new IndexAllProject(p, this); - } - - if (request != null) - request(request); - } - /** - * Recreates the index for a given path, keeping the same read-write monitor. - * Returns the new empty index or null if it didn't exist before. - * Warning: Does not check whether index is consistent (not being used) - */ - public synchronized IIndex recreateIndex(IPath path) { - // only called to over write an existing cached index... - try { - IIndex index = (IIndex) this.indexes.get(path); - ReadWriteMonitor monitor = (ReadWriteMonitor) this.monitors.remove(index); - - // Path is already canonical - String indexPath = computeIndexName(path); - if (IndexManager.VERBOSE) - JobManager.verbose("-> recreating index: "+indexPath+" for path: "+path.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ - index = new Index(indexPath, "Index for " + path.toOSString(), false /*reuse index file*/); //$NON-NLS-1$ - indexes.put(path, index); - monitors.put(index, monitor); - return index; - } catch (IOException e) { - // The file could not be created. Possible reason: the project has been deleted. - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to recreate index for path: "+path.toOSString()); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - return null; - } - } - /** - * Trigger removal of a resource to an index - * Note: the actual operation is performed in background - */ - public void remove(String resourceName, IPath indexedContainer){ - request(new RemoveFromIndex(resourceName, indexedContainer, this)); - } - /** - * Removes the index for a given path. - * This is a no-op if the index did not exist. - */ - public synchronized void removeIndex(IPath path) { - if (IndexManager.VERBOSE) - JobManager.verbose("removing index " + path); //$NON-NLS-1$ - String indexName = computeIndexName(path); - File indexFile = new File(indexName); - if (indexFile.exists()) - indexFile.delete(); - Object o = this.indexes.get(path); - if (o instanceof IIndex) - this.monitors.remove(o); - this.indexes.remove(path); - updateIndexState(indexName, null); - } - /** - * Removes all indexes whose paths start with (or are equal to) the given path. - */ - public synchronized void removeIndexFamily(IPath path) { - // only finds cached index files... shutdown removes all non-cached index files - ArrayList toRemove = null; - Iterator iterator = this.indexes.keySet().iterator(); - while (iterator.hasNext()) { - IPath indexPath = (IPath) iterator.next(); - if (path.isPrefixOf(indexPath)) { - if (toRemove == null) - toRemove = new ArrayList(); - toRemove.add(indexPath); - } - } - if (toRemove != null) - for (int i = 0, length = toRemove.size(); i < length; i++) - this.removeIndex((IPath) toRemove.get(i)); - } - /** - * Remove the content of the given source folder from the index. - */ - public void removeSourceFolderFromIndex(CProject javaProject, IPath sourceFolder, char[][] exclusionPatterns) { - IProject project = javaProject.getProject(); - - if (this.jobEnd > this.jobStart) { - // check if a job to index the project is not already in the queue - IndexRequest request = new IndexAllProject(project, this); - for (int i = this.jobEnd; i > this.jobStart; i--) // NB: don't check job at jobStart, as it may have already started (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32488) - if (request.equals(this.awaitingJobs[i])) return; - } - - this.request(new RemoveFolderFromIndex(sourceFolder, exclusionPatterns, project, this)); - } - /** - * Flush current state - */ - public void reset() { - super.reset(); - if (this.indexes != null) { - this.indexes = new HashMap(5); - this.monitors = new HashMap(5); - this.indexStates = null; - } - this.indexNames = new SimpleLookupTable(); - this.cCorePluginLocation = null; - } - - public void saveIndex(IIndex index) throws IOException { - // must have permission to write from the write monitor - if (index.hasChanged()) { - if (IndexManager.VERBOSE) - JobManager.verbose("-> saving index " + index.getIndexFile()); //$NON-NLS-1$ - index.save(); - } - String indexName = index.getIndexFile().getPath(); - if (this.jobEnd > this.jobStart) { - Object indexPath = indexNames.keyForValue(indexName); - if (indexPath != null) { - for (int i = this.jobEnd; i > this.jobStart; i--) { // skip the current job - IJob job = this.awaitingJobs[i]; - if (job instanceof IndexRequest) - if (((IndexRequest) job).indexPath.equals(indexPath)) return; - } - } - } - updateIndexState(indexName, SAVED_STATE); - } - /** - * Commit all index memory changes to disk - */ - public void saveIndexes() { - // only save cached indexes... the rest were not modified - ArrayList toSave = new ArrayList(); - synchronized(this) { - for (Iterator iter = this.indexes.values().iterator(); iter.hasNext();) { - Object o = iter.next(); - if (o instanceof IIndex) - toSave.add(o); - } - } - - for (int i = 0, length = toSave.size(); i < length; i++) { - IIndex index = (IIndex) toSave.get(i); - ReadWriteMonitor monitor = getMonitorFor(index); - if (monitor == null) continue; // index got deleted since acquired - try { - monitor.enterWrite(); - try { - saveIndex(index); - } catch(IOException e){ - if (IndexManager.VERBOSE) { - JobManager.verbose("-> got the following exception while saving:"); //$NON-NLS-1$ - e.printStackTrace(); - } - //Util.log(e); - } - } finally { - monitor.exitWrite(); - } - } - needToSave = false; - } - - public void shutdown() { - if (IndexManager.VERBOSE) - JobManager.verbose("Shutdown"); //$NON-NLS-1$ - //Get index entries for all projects in the workspace, store their absolute paths - IndexSelector indexSelector = new IndexSelector(new CWorkspaceScope(), null, false, this); - IIndex[] selectedIndexes = indexSelector.getIndexes(); - SimpleLookupTable knownPaths = new SimpleLookupTable(); - for (int i = 0, max = selectedIndexes.length; i < max; i++) { - String path = selectedIndexes[i].getIndexFile().getAbsolutePath(); - knownPaths.put(path, path); - } - //Any index entries that are in the index state must have a corresponding - //path entry - if not they are removed from the saved indexes file - if (indexStates != null) { - Object[] indexNames = indexStates.keyTable; - for (int i = 0, l = indexNames.length; i < l; i++) { - String key = (String) indexNames[i]; - if (key != null && !knownPaths.containsKey(key)) //here is an index that is in t - updateIndexState(key, null); - } - } - - //Clean up the .metadata folder - if there are any files in the directory that - //are not associated to an index we delete them - File indexesDirectory = new File(getCCorePluginWorkingLocation().toOSString()); - if (indexesDirectory.isDirectory()) { - File[] indexesFiles = indexesDirectory.listFiles(); - if (indexesFiles != null) { - for (int i = 0, indexesFilesLength = indexesFiles.length; i < indexesFilesLength; i++) { - String fileName = indexesFiles[i].getAbsolutePath(); - if (!knownPaths.containsKey(fileName) && fileName.toLowerCase().endsWith(".index")) { //$NON-NLS-1$ - if (IndexManager.VERBOSE) - JobManager.verbose("Deleting index file " + indexesFiles[i]); //$NON-NLS-1$ - indexesFiles[i].delete(); - } - } - } - } - - super.shutdown(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(10); - buffer.append(super.toString()); - buffer.append("In-memory indexes:\n"); //$NON-NLS-1$ - int count = 0; - for (Iterator iter = this.indexes.values().iterator(); iter.hasNext();) { - buffer.append(++count).append(" - ").append(iter.next().toString()).append('\n'); //$NON-NLS-1$ - } - return buffer.toString(); - } - - private char[] readIndexState() { - try { - return org.eclipse.cdt.internal.core.Util.getFileCharContent(savedIndexNamesFile, null); - } catch (IOException ignored) { - if (IndexManager.VERBOSE) - JobManager.verbose("Failed to read saved index file names"); //$NON-NLS-1$ - return new char[0]; - } - } - - private void updateIndexState(String indexName, Integer indexState) { - getIndexStates(); // ensure the states are initialized - if (indexState != null) { - if (indexState.equals(indexStates.get(indexName))) return; // not changed - indexStates.put(indexName, indexState); - } else { - if (!indexStates.containsKey(indexName)) return; // did not exist anyway - indexStates.removeKey(indexName); - } - - BufferedWriter writer = null; - try { - writer = new BufferedWriter(new FileWriter(savedIndexNamesFile)); - Object[] indexNames = indexStates.keyTable; - Object[] states = indexStates.valueTable; - for (int i = 0, l = states.length; i < l; i++) { - if (states[i] == SAVED_STATE) { - writer.write((String) indexNames[i]); - writer.write('\n'); - } - } - } catch (IOException ignored) { - if (IndexManager.VERBOSE) - JobManager.verbose("Failed to write saved index file names"); //$NON-NLS-1$ - } finally { - if (writer != null) { - try { - writer.close(); - } catch (IOException e) {} - } - } - if (IndexManager.VERBOSE) { - String state = "?"; //$NON-NLS-1$ - if (indexState == SAVED_STATE) state = "SAVED"; //$NON-NLS-1$ - else if (indexState == UPDATING_STATE) state = "UPDATING"; //$NON-NLS-1$ - else if (indexState == UNKNOWN_STATE) state = "UNKNOWN"; //$NON-NLS-1$ - else if (indexState == REBUILDING_STATE) state = "REBUILDING"; //$NON-NLS-1$ - JobManager.verbose("-> index state updated to: " + state + " for: "+indexName); //$NON-NLS-1$ //$NON-NLS-2$ - } - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java deleted file mode 100644 index 96aab0b526c..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; - -import org.eclipse.cdt.internal.core.search.processing.IJob; -import org.eclipse.core.runtime.IPath; -import org.eclipse.cdt.internal.core.index.IIndex; - -public abstract class IndexRequest implements IJob { - protected boolean isCancelled = false; - protected IPath indexPath; - protected IndexManager manager; - - public IndexRequest(IPath indexPath, IndexManager manager) { - this.indexPath = indexPath; - this.manager = manager; - } - - public boolean belongsTo(String projectName) { - return projectName.equals(this.indexPath.segment(0)); - } - - public void cancel() { - this.manager.jobWasCancelled(this.indexPath); - this.isCancelled = true; - } - - public boolean isReadyToRun() { - // tag the index as inconsistent - this.manager.aboutToUpdateIndex(indexPath, updatedIndexState()); - return true; - } - /* - * This code is assumed to be invoked while monitor has read lock - */ - protected void saveIfNecessary(IIndex index, ReadWriteMonitor monitor) throws IOException { - /* if index has changed, commit these before querying */ - if (index.hasChanged()) { - try { - monitor.exitRead(); // free read lock - monitor.enterWrite(); // ask permission to write - this.manager.saveIndex(index); - } finally { - monitor.exitWriteEnterRead(); // finished writing and reacquire read permission - } - } - } - - protected Integer updatedIndexState() { - return IndexManager.UPDATING_STATE; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java deleted file mode 100644 index 928cdd0ef64..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -/** - * Monitor ensuring no more than one writer working concurrently. - * Multiple readers are allowed to perform simultaneously. - */ -public class ReadWriteMonitor { - - /** - * <0 : writing (cannot go beyond -1, i.e one concurrent writer) - * =0 : idle - * >0 : reading (number of concurrent readers) - */ - private int status = 0; - /** - * Concurrent reading is allowed - * Blocking only when already writing. - */ - public synchronized void enterRead() { - - while (status < 0){ - try { - wait(); - } catch(InterruptedException e){ - } - } - status++; - } - /** - * Only one writer at a time is allowed to perform - * Blocking only when already writing or reading. - */ - public synchronized void enterWrite() { - - while (status != 0){ - try { - wait(); - } catch(InterruptedException e){ - } - } - status--; - } - /** - * Only notify waiting writer(s) if last reader - */ - public synchronized void exitRead() { - if (--status == 0) notifyAll(); - } - /** - * When writing is over, all readers and possible - * writers are granted permission to restart concurrently - */ - public synchronized void exitWrite() { - if (++status == 0) notifyAll(); - } - /** - * Atomic exitWrite/enterRead: Allows to keep monitor in between - * exit write and next enter read. - * When writing is over, all readers are granted permissing to restart - * concurrently. - * This is the same as: - *

    -	 * synchronized(monitor) {
    -	 *   monitor.exitWrite();
    -	 *   monitor.enterRead();
    -	 * }
    -	 * 
    - */ - public synchronized void exitWriteEnterRead() { - this.exitWrite(); - this.enterRead(); - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java deleted file mode 100644 index 0c08b31e7b7..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; - -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.IQueryResult; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -class RemoveFolderFromIndex extends IndexRequest { - IPath folderPath; - char[][] exclusionPatterns; - IProject project; - - public RemoveFolderFromIndex(IPath folderPath, char[][] exclusionPatterns, IProject project, IndexManager manager) { - super(project.getFullPath(), manager); - this.folderPath = folderPath; - this.exclusionPatterns = exclusionPatterns; - this.project = project; - } - - public boolean execute(IProgressMonitor progressMonitor) { - if (progressMonitor != null && progressMonitor.isCanceled()) return true; - - /* ensure no concurrent write access to index */ - IIndex index = manager.getIndex(this.indexPath, true, /*reuse index file*/ false /*create if none*/); - if (index == null) return true; - ReadWriteMonitor monitor = manager.getMonitorFor(index); - if (monitor == null) return true; // index got deleted since acquired - - try { - monitor.enterRead(); // ask permission to read - IQueryResult[] results = index.queryInDocumentNames(this.folderPath.toString()); - // all file names belonging to the folder or its subfolders and that are not excluded (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32607) - for (int i = 0, max = results == null ? 0 : results.length; i < max; i++) { - String documentPath = results[i].getPath(); - if (this.exclusionPatterns == null || !Util.isExcluded(new Path(documentPath), this.exclusionPatterns)) { - manager.remove(documentPath, this.indexPath); // write lock will be acquired by the remove operation - } - } - } catch (IOException e) { - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to remove " + this.folderPath + " from index because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - return false; - } finally { - monitor.exitRead(); // free read lock - } - return true; - } - - public String toString() { - return "removing " + this.folderPath + " from index " + this.indexPath; //$NON-NLS-1$ //$NON-NLS-2$ - } -} - diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java deleted file mode 100644 index e69d580e908..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.search.processing.JobManager; - -class RemoveFromIndex extends IndexRequest { - String resourceName; - - public RemoveFromIndex(String resourceName, IPath indexPath, IndexManager manager) { - super(indexPath, manager); - this.resourceName = resourceName; - } - - public boolean execute(IProgressMonitor progressMonitor) { - - if (progressMonitor != null && progressMonitor.isCanceled()) return true; - - /* ensure no concurrent write access to index */ - IIndex index = manager.getIndex(this.indexPath, true, /*reuse index file*/ false /*create if none*/); - if (index == null) return true; - ReadWriteMonitor monitor = manager.getMonitorFor(index); - if (monitor == null) return true; // index got deleted since acquired - - try { - monitor.enterWrite(); // ask permission to write - index.remove(resourceName); - } catch (IOException e) { - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to remove " + this.resourceName + " from index because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - return false; - } finally { - monitor.exitWrite(); // free write lock - } - return true; - } - - public String toString() { - return "removing " + this.resourceName + " from index " + this.indexPath; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java deleted file mode 100644 index 99e3bfa0d69..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -import java.io.IOException; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.search.processing.JobManager; - -/* - * Save the index of a project. - */ -public class SaveIndex extends IndexRequest { - public SaveIndex(IPath indexPath, IndexManager manager) { - super(indexPath, manager); - } - - public boolean execute(IProgressMonitor progressMonitor) { - if (progressMonitor != null && progressMonitor.isCanceled()) return true; - - /* ensure no concurrent write access to index */ - IIndex index = this.manager.getIndex(this.indexPath, true /*reuse index file*/, false /*don't create if none*/); - if (index == null) return true; - ReadWriteMonitor monitor = this.manager.getMonitorFor(index); - if (monitor == null) return true; // index got deleted since acquired - - try { - monitor.enterWrite(); // ask permission to write - this.manager.saveIndex(index); - } catch (IOException e) { - if (IndexManager.VERBOSE) { - JobManager.verbose("-> failed to save index " + this.indexPath + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ - e.printStackTrace(); - } - return false; - } finally { - monitor.exitWrite(); // free write lock - } - return true; - } - - public String toString() { - return "saving index for " + this.indexPath; //$NON-NLS-1$ - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java deleted file mode 100644 index 7acdf1a0378..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -/** - * @author bgheorgh -*/ - -import java.io.IOException; -import java.io.StringReader; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICLogConstants; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.parser.ParserUtil; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.internal.core.index.IDocument; -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; - -/** - * A SourceIndexer indexes source files using the parser. The following items are indexed: - * Declarations: - * - Classes - * - Structs - * - Unions - * References: - * - Classes - * - Structs - * - Unions - */ -public class SourceIndexer extends AbstractIndexer { - - //TODO: Indexer, add additional file types - //Header files: "h" , "hh", "hpp" - //Use the CModelManager defined file types - //public static final String[] FILE_TYPES= new String[] {"cpp","c", "cc", "cxx"}; //$NON-NLS-1$ - - //protected DefaultProblemFactory problemFactory= new DefaultProblemFactory(Locale.getDefault()); - IFile resourceFile; - - SourceIndexer(IFile resourceFile) { - this.resourceFile = resourceFile; - } - /** - * Returns the file types the IIndexer handles. - */ - public String[] getFileTypes(){ - return CModelManager.sourceExtensions; - } - - protected void indexFile(IDocument document) throws IOException { - // Add the name of the file to the index - output.addDocument(document); - // Create a new Parser - SourceIndexerRequestor requestor = new SourceIndexerRequestor(this, document); - - //Get the scanner info - IProject currentProject = resourceFile.getProject(); - IScannerInfo scanInfo = new ScannerInfo(); - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(currentProject); - if (provider != null){ - IScannerInfo buildScanInfo = provider.getScannerInformation(currentProject); - if (buildScanInfo != null){ - scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths()); - } - } - - //C or CPP? - ParserLanguage language = CoreModel.getDefault().hasCCNature(currentProject) ? ParserLanguage.CPP : ParserLanguage.C; - - IParser parser = null; - - try - { - parser = ParserFactory.createParser( - ParserFactory.createScanner( new StringReader( document.getStringContent() ), resourceFile.getLocation().toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, requestor, ParserUtil.getParserLogService() ), - requestor, ParserMode.COMPLETE_PARSE, language, ParserUtil.getParserLogService() ); - } catch( ParserFactoryException pfe ) - { - } - - boolean retVal = parser.parse(); - - if (!retVal) - org.eclipse.cdt.internal.core.model.Util.log(null, "Failed to index " + resourceFile.getFullPath(), ICLogConstants.CDT); - - if (AbstractIndexer.VERBOSE){ - if (!retVal) - AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString()); - else - AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString()); - } - } - /** - * Sets the document types the IIndexer handles. - */ - - public void setFileTypes(String[] fileTypes){} - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer#getResourceFile() - */ - public IFile getResourceFile() { - return resourceFile; - } -} diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java deleted file mode 100644 index 346dc341bf6..00000000000 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java +++ /dev/null @@ -1,479 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search.indexing; - -/** -* @author bgheorgh -*/ - -import java.util.LinkedList; - -import org.eclipse.cdt.core.parser.DefaultProblemHandler; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; -import org.eclipse.cdt.internal.core.index.IDocument; - -/** - * @author bgheorgh - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants { - - SourceIndexer indexer; - IDocument document; - - char[] packageName; - char[][] enclosingTypeNames = new char[5][]; - int depth = 0; - int methodDepth = 0; - - private IASTInclusion currentInclude = null; - private LinkedList includeStack = new LinkedList(); - - public SourceIndexerRequestor(SourceIndexer indexer, IDocument document) { - super(); - this.indexer = indexer; - this.document= document; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem) - */ - public boolean acceptProblem(IProblem problem) { - return DefaultProblemHandler.ruleOnProblem( problem, ParserMode.COMPLETE_PARSE ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro) - */ - public void acceptMacro(IASTMacro macro) { - // TODO Auto-generated method stub - indexer.addMacro(macro); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable) - */ - public void acceptVariable(IASTVariable variable) { - // TODO Auto-generated method stub - //System.out.println("acceptVariable"); - indexer.addVariable(variable); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void acceptFunctionDeclaration(IASTFunction function) { - // TODO Auto-generated method stub - //System.out.println("acceptFunctionDeclaration"); - indexer.addFunctionDeclaration(function); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective) - */ - public void acceptUsingDirective(IASTUsingDirective usageDirective) { - // TODO Auto-generated method stub - //System.out.println("acceptUsingDirective"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration) - */ - public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration) { - // TODO Auto-generated method stub - //System.out.println("acceptUsingDeclaration"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptASMDefinition(org.eclipse.cdt.core.parser.ast.IASTASMDefinition) - */ - public void acceptASMDefinition(IASTASMDefinition asmDefinition) { - // TODO Auto-generated method stub - //System.out.println("acceptASMDefinition"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedef(org.eclipse.cdt.core.parser.ast.IASTTypedef) - */ - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) { - // TODO Auto-generated method stub - indexer.addTypedefDeclaration(typedef); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier) - */ - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) { - // TODO Auto-generated method stub - //System.out.println("acceptEnumSpecifier"); - indexer.addEnumerationSpecifier(enumeration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void enterFunctionBody(IASTFunction function) { - // TODO Auto-generated method stub - indexer.addFunctionDeclaration(function); - //indexer.addFunctionDefinition(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void exitFunctionBody(IASTFunction function) { - // TODO Auto-generated method stub - //System.out.println("exitFunctionBody"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) { - // TODO Auto-generated method stub - //System.out.println("enterCompilationUnit"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) { - // TODO Auto-generated method stub - - IASTInclusion parent = peekInclude(); - indexer.addInclude(inclusion, parent); - //Push on stack - pushInclude(inclusion); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - // TODO Auto-generated method stub - //System.out.println("enterNamespaceDefinition"); - indexer.addNamespaceDefinition(namespaceDefinition); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void enterClassSpecifier(IASTClassSpecifier classSpecification) { - // TODO Auto-generated method stub - - //System.out.println("New class spec: " + classSpecification.getName()); - indexer.addClassSpecifier(classSpecification); - //System.out.println("enterClassSpecifier"); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) { - // TODO Auto-generated method stub - //System.out.println("enterLinkageSpecification"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) { - // TODO Auto-generated method stub - //System.out.println("enterTemplateDeclaration"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void enterTemplateSpecialization(IASTTemplateSpecialization specialization) { - // TODO Auto-generated method stub - //System.out.println("enterTemplateSpecialization"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation) { - // TODO Auto-generated method stub - //System.out.println("enterTemplateExplicitInstantiation"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void acceptMethodDeclaration(IASTMethod method) { - // TODO Auto-generated method stub - //System.out.println("acceptMethodDeclaration"); - indexer.addMethodDeclaration(method); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void enterMethodBody(IASTMethod method) { - // TODO Auto-generated method stub - //System.out.println("enterMethodBody " + method.getName()); - indexer.addMethodDeclaration(method); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void exitMethodBody(IASTMethod method) { - // TODO Auto-generated method stub - //System.out.println("exitMethodBody"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField) - */ - public void acceptField(IASTField field) { - // TODO Auto-generated method stub - // System.out.println("acceptField"); - indexer.addFieldDeclaration(field); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, int) - */ - public void acceptClassReference(IASTClassReference reference) { - // TODO Auto-generated method stub - //System.out.println("acceptClassReference"); - if (reference.getReferencedElement() instanceof IASTClassSpecifier) - indexer.addClassReference((IASTClassSpecifier)reference.getReferencedElement()); - else if (reference.getReferencedElement() instanceof IASTElaboratedTypeSpecifier) - { - indexer.addClassReference((IASTTypeSpecifier) reference.getReferencedElement()); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void exitTemplateDeclaration(IASTTemplateDeclaration declaration) { - // TODO Auto-generated method stub - //System.out.println("exitTemplateDeclaration"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) { - // TODO Auto-generated method stub - //System.out.println("exitTemplateSpecialization"); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation) { - // TODO Auto-generated method stub - //System.out.println("exitTemplateExplicitInstantiation"); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec) { - // TODO Auto-generated method stub - //System.out.println("exitLinkageSpecification"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void exitClassSpecifier(IASTClassSpecifier classSpecification) { - // TODO Auto-generated method stub - //System.out.println("exitClassSpecifier"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - // TODO Auto-generated method stub - //System.out.println("exitNamespaceDefinition"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion(IASTInclusion inclusion) { - // TODO Auto-generated method stub - popInclude(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void exitCompilationUnit(IASTCompilationUnit compilationUnit) { - // TODO Auto-generated method stub - //System.out.println("exitCompilationUnit"); - -} - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration) - */ - public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference) - */ - public void acceptTypedefReference(IASTTypedefReference reference) { - // TODO Auto-generated method stub - if( reference.getReferencedElement() instanceof IASTTypedefDeclaration ) - indexer.addTypedefReference( (IASTTypedefDeclaration) reference.getReferencedElement() ); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference) - */ - public void acceptNamespaceReference(IASTNamespaceReference reference) { - // TODO Auto-generated method stub - if (reference.getReferencedElement() instanceof IASTNamespaceDefinition) - indexer.addNamespaceReference((IASTNamespaceDefinition)reference.getReferencedElement()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumerationReference(IASTEnumerationReference reference) { - // TODO Auto-generated method stub - if (reference.getReferencedElement() instanceof IASTEnumerationSpecifier) - indexer.addEnumerationReference((IASTEnumerationSpecifier) reference.getReferencedElement()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference) - */ - public void acceptVariableReference(IASTVariableReference reference) { - // TODO Auto-generated method stub - if (reference.getReferencedElement() instanceof IASTVariable) - indexer.addVariableReference((IASTVariable)reference.getReferencedElement()); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference) - */ - public void acceptFunctionReference(IASTFunctionReference reference) { - if (reference.getReferencedElement() instanceof IASTFunction) - indexer.addFunctionReference((IASTFunction) reference.getReferencedElement()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference) - */ - public void acceptFieldReference(IASTFieldReference reference) { - if (reference.getReferencedElement() instanceof IASTField) - indexer.addFieldReference((IASTField) reference.getReferencedElement()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference) - */ - public void acceptMethodReference(IASTMethodReference reference) { - if (reference.getReferencedElement() instanceof IASTMethod) - indexer.addMethodReference((IASTMethod) reference.getReferencedElement()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier) - */ - public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType){ - indexer.addElaboratedForwardDeclaration(elaboratedType); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void enterCodeBlock(IASTCodeScope scope) { - // TODO Auto-generated method stub - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void exitCodeBlock(IASTCodeScope scope) { - // TODO Auto-generated method stub - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumeratorReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumeratorReference(IASTEnumeratorReference reference) - { - if( reference.getReferencedElement() instanceof IASTEnumerator ) - indexer.addEnumeratorReference( (IASTEnumerator)reference.getReferencedElement() ); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference) - */ - public void acceptParameterReference(IASTParameterReference reference) - { - if( reference.getReferencedElement() instanceof IASTParameterDeclaration ) - indexer.addParameterReference( (IASTParameterDeclaration) reference.getReferencedElement() ); - - } - - private void pushInclude( IASTInclusion inclusion ){ - includeStack.addFirst( currentInclude ); - currentInclude = inclusion; - } - - private IASTInclusion popInclude(){ - IASTInclusion oldInclude = currentInclude; - currentInclude = (includeStack.size() > 0 ) ? (IASTInclusion) includeStack.removeFirst() : null; - return oldInclude; - } - - private IASTInclusion peekInclude(){ - return currentInclude; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/BufferChangedEvent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/BufferChangedEvent.java deleted file mode 100644 index e0753637a20..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/BufferChangedEvent.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.eclipse.cdt.core.model; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.EventObject; - - -/** - * A buffer changed event describes how a buffer has changed. These events are - * used in IBufferChangedListener notifications. - *

    - * For text insertions, getOffset is the offset - * of the first inserted character, getText is the - * inserted text, and getLength is 0. - *

    - *

    - * For text removals, getOffset is the offset - * of the first removed character, getText is null, - * and getLength is the length of the text that was removed. - *

    - *

    - * For replacements (including IBuffer.setContents), - * getOffset is the offset - * of the first replaced character, getText is the replacement - * text, and getLength is the length of the original text - * that was replaced. - *

    - *

    - * When a buffer is closed, getOffset is 0, getLength - * is 0, and getText is null. - *

    - *

    - * This class is not intended to be instantiated or subclassed by clients. - * Instances of this class are automatically created by the C model. - *

    - * - * @see IBuffer - * This class is similar to the JDT BufferChangedEvent class. - */ - -public class BufferChangedEvent extends EventObject { - /** - * The length of text that has been modified in the buffer. - */ - private int length; - - /** - * The offset into the buffer where the modification took place. - */ - private int offset; - - /** - * The text that was modified. - */ - private String text; - - /** - * Creates a new buffer changed event indicating that the given buffer has changed. - */ - public BufferChangedEvent(IBuffer buffer, int offset, int length, String text) { - super(buffer); - this.offset = offset; - this.length = length; - this.text = text; - } - /** - * Returns the buffer which has changed. - * - * @return the buffer affected by the change - */ - public IBuffer getBuffer() { - return (IBuffer) source; - } - /** - * Returns the length of text removed or replaced in the buffer, or - * 0 if text has been inserted into the buffer. - * - * @return the length of the original text fragment modified by the - * buffer change ( 0 in case of insertion). - */ - public int getLength() { - return this.length; - } - /** - * Returns the index of the first character inserted, removed, or replaced - * in the buffer. - * - * @return the source offset of the textual manipulation in the buffer - */ - public int getOffset() { - return this.offset; - } - /** - * Returns the text that was inserted, the replacement text, - * or null if text has been removed. - * - * @return the text corresponding to the buffer change ( null - * in case of deletion). - */ - public String getText() { - return this.text; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CModelException.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CModelException.java deleted file mode 100644 index dbe943a1445..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CModelException.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.cdt.internal.core.model.CModelStatus; - -/** - * A checked exception representing a failure in the C model. - * C model exceptions contain a C-specific status object describing the - * cause of the exception. - * - * @see ICModelStatus - * @see ICModelStatusConstants - */ -public class CModelException extends CoreException { - /** - * Creates a C model exception that wrappers the given Throwable. - * The exception contains a C-specific status object with severity - * IStatus.ERROR and the given status code. - * - * @param exception the Throwable - * @param code one of the C-specific status codes declared in - * ICModelStatusConstants - * @return the new C model exception - * @see ICModelStatusConstants - * @see org.eclipse.core.runtime.IStatus#ERROR - */ - public CModelException(Throwable e, int code) { - this(new CModelStatus(code, e)); - } - - /** - * Creates a C model exception for the given CoreException. - * Equivalent to - * CModelException(exception,ICModelStatusConstants.CORE_EXCEPTION. - * - * @param exception the CoreException - * @return the new C model exception - */ - public CModelException(CoreException exception) { - this(new CModelStatus(exception)); - } - - /** - * Creates a C model exception for the given C-specific status object. - * - * @param status the C-specific status object - * @return the new C model exception - */ - public CModelException(ICModelStatus status) { - super(status); - } - - /** - * Returns the underlying Throwable that caused the failure. - * - * @return the wrappered Throwable, or null if the - * direct case of the failure was at the C model layer - */ - public Throwable getException() { - return getStatus().getException(); - } - - /** - * Returns the C model status object for this exception. - * Equivalent to (ICModelStatus) getStatus(). - * - * @return a status object - */ - public ICModelStatus getCModelStatus() { - return (ICModelStatus) getStatus(); - } - - /** - * Returns whether this exception indicates that a C model element does not - * exist. Such exceptions have a status with a code of - * ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST. - * This is a convenience method. - * - * @return true if this exception indicates that a C model - * element does not exist - * @see ICModelStatus#doesNotExist - * @see ICModelStatusConstants#ELEMENT_DOES_NOT_EXIST - */ - public boolean doesNotExist() { - ICModelStatus cModelStatus = getCModelStatus(); - return cModelStatus != null && cModelStatus.doesNotExist(); - } - - /** - * Returns a printable representation of this exception suitable for debugging - * purposes only. - */ - public String toString() { - StringBuffer buffer= new StringBuffer(); - buffer.append("C Model Exception: "); //$NON-NLS-1$ - if (getException() != null) { - if (getException() instanceof CoreException) { - CoreException c= (CoreException)getException(); - buffer.append("Core Exception [code "); //$NON-NLS-1$ - buffer.append(c.getStatus().getCode()); - buffer.append("] "); //$NON-NLS-1$ - buffer.append(c.getStatus().getMessage()); - } else { - buffer.append(getException().toString()); - } - } else { - buffer.append(getStatus().toString()); - } - return buffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java deleted file mode 100644 index adfc62396e9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java +++ /dev/null @@ -1,528 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.internal.core.model.BatchOperation; -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.cdt.internal.core.model.ContainerEntry; -import org.eclipse.cdt.internal.core.model.IncludeEntry; -import org.eclipse.cdt.internal.core.model.LibraryEntry; -import org.eclipse.cdt.internal.core.model.MacroEntry; -import org.eclipse.cdt.internal.core.model.ProjectEntry; -import org.eclipse.cdt.internal.core.model.SourceEntry; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CoreModel { - - private static CoreModel cmodel = null; - private static CModelManager manager = null; - - public final static String CORE_MODEL_ID = CCorePlugin.PLUGIN_ID + ".coremodel"; - - /** - * Creates an ICElement form and IPath. - * Returns null if not found. - */ - public ICElement create(IPath path) { - return manager.create(path); - } - - /** - * Creates an ICElement form and IFile. - * Returns null if not found. - */ - public ICElement create(IFile file) { - return manager.create(file); - } - - /** - * Creates an ICElement form and IFolder. - * Returns null if not found. - */ - public ICContainer create(IFolder folder) { - return manager.create(folder); - } - - /** - * Creates an ICElement form and IProject. - * Returns null if not found. - */ - public ICProject create(IProject project) { - return manager.create(project); - } - - /** - * Creates an ICElement form and IResource. - * Returns null if not found. - */ - public ICElement create(IResource resource) { - return manager.create(resource); - } - - /** - * Returns the default ICModel. - */ - public ICModel getCModel() { - return manager.getCModel(); - } - - /** - * Return true if IFile is a shared library, i.e. libxx.so - */ - public boolean isSharedLib(IFile file) { - return manager.isSharedLib(file); - } - - /** - * Return true if IFile is a an object(ELF), i.e. *.o - */ - public boolean isObject(IFile file) { - return manager.isObject(file); - } - - /** - * Return true if IFile is an ELF executable - */ - public boolean isExecutable(IFile file) { - return manager.isExecutable(file); - } - - /** - * Return true if IFile is an ELF. - */ - public boolean isBinary(IFile file) { - return manager.isBinary(file); - } - - /** - * Return true if IFile is an Achive, *.a - */ - public boolean isArchive(IFile file) { - return manager.isArchive(file); - } - - /** - * Return true if IFile is a TranslationUnit. - */ - public boolean isTranslationUnit(IFile file) { - return manager.isTranslationUnit(file); - } - - /** - * Return true if name is a valid name for a translation unit. - */ - public boolean isValidTranslationUnitName(String name) { - return manager.isValidTranslationUnitName(name); - } - - /** - * Return the list of headers extensions. - */ - public String[] getHeaderExtensions() { - return manager.getHeaderExtensions(); - } - - /** - * Returns the list of source extensions. - */ - public String[] getSourceExtensions() { - return manager.getSourceExtensions(); - } - - /** - * Returns the list of headers and sources extensions - */ - public String[] getTranslationUnitExtensions() { - return manager.getTranslationUnitExtensions(); - } - - /** - * Return true if project has C nature. - */ - public boolean hasCNature(IProject project) { - return manager.hasCNature(project); - } - - /** - * Return true if project has C++ nature. - */ - public boolean hasCCNature(IProject project) { - return manager.hasCCNature(project); - } - - /** - * Creates and returns a new non-exported entry of kind CDT_PROJECT - * for the project identified by the given absolute path. - *

    - * A project entry is used to denote a prerequisite project. - * The ICPathEntry[] entries of the project will be contributed. - *

    - * The prerequisite project is referred to using an absolute path relative to the workspace root. - *

    - * The resulting entry is not exported to dependent projects. This method is equivalent to - * newProjectEntry(path,false). - *

    - * - * @param path the absolute path of the binary archive - * @return a new project entry - * - * @see CoreModel#newProjectEntry(IPath, boolean) - */ - public static IProjectEntry newProjectEntry(IPath path) { - return newProjectEntry(path, false); - } - - /** - * Creates and returns a new entry of kind CDT_PROJECT - * for the project identified by the given absolute path. - *

    - * A project entry is used to denote a prerequisite project. - * All the ICPathEntries of the project will be contributed as a whole. - * The prerequisite project is referred to using an absolute path relative to the workspace root. - *

    - * - * @param path the absolute path of the prerequisite project - * @param isExported indicates whether this entry is contributed to dependent - * projects in addition to the output location - * @return a new project entry - */ - public static IProjectEntry newProjectEntry(IPath path, boolean isExported) { - return new ProjectEntry(path, isExported); - } - - /** - * Creates and returns a new entry of kind CDT_CONTAINER - * for the given path. The path of the container will be used during resolution so as to map this - * container entry to a set of other entries the container is acting for. - *

    - * The resulting entry is not exported to dependent projects. This method is equivalent to - * newContainerEntry(path,false). - *

    - * @param containerPath the id of the container - * @return a new container entry - * - */ - public static IContainerEntry newContainerEntry(String id) { - return newContainerEntry(id, false); - } - - /** - * Creates and returns a new entry of kind CDT_CONTAINER - * for the given path. The path of the container will be used during resolution so as to map this - * container entry to a set of other entries the container is acting for. - *

    - * The resulting entry is not exported to dependent projects. This method is equivalent to - * newContainerEntry(path,false). - *

    - */ - public static IContainerEntry newContainerEntry(String id, boolean isExported) { - return new ContainerEntry(id, isExported); - } - - /** - * Creates and returns a new non-exported entry of kind CDT_LIBRARY for the - * archive or folder identified by the given absolute path. - * - * Note that this operation does not attempt to validate or access the - * resources at the given paths. - *

    - * The resulting entry is not exported to dependent projects. This method is equivalent to - * newLibraryEntry(-,-,-,false). - *

    - * @param path the absolute path of the binary archive - * @param sourceAttachmentPath the absolute path of the corresponding source archive or folder, - * or null if none. - * @param sourceAttachmentRootPath the location of the root within the source archive or folder - * or null. - * @param sourceAttachmentPrefixMapping prefix mapping - * or null. - * @return a new library entry - * - */ - public static ILibraryEntry newLibraryEntry( - IPath path, - IPath sourceAttachmentPath, - IPath sourceAttachmentRootPath, - IPath sourceAttachmentPrefixMapping) { - return newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, sourceAttachmentPrefixMapping, false); - } - - /** - * Creates and returns a new non-exported entry of kind CDT_LIBRARY for the - * archive or folder identified by the given absolute path. - * - * Note that this operation does not attempt to validate or access the - * resources at the given paths. - *

    - * @param path the absolute path of the binary archive - * @param sourceAttachmentPath the absolute path of the corresponding source archive or folder, - * or null if none. - * @param sourceAttachmentRootPath the location of the root within the source archive or folder - * or null. - * @param sourceAttachmentPrefixMapping prefix mapping - * or null. - * @return a new library entry - * - */ - public static ILibraryEntry newLibraryEntry( - IPath path, - IPath sourceAttachmentPath, - IPath sourceAttachmentRootPath, - IPath sourceAttachmentPrefixMapping, - boolean isExported) { - return new LibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, sourceAttachmentPrefixMapping, isExported); - } - - /** - * Creates and returns a new entry of kind CDT_SOURCE - * for the project's source folder identified by the given absolute - * workspace-relative path. - *

    - * The source folder is referred to using an absolute path relative to the - * workspace root, e.g. /Project/src. A project's source - * folders are located with that project. That is, a source - * entry specifying the path /P1/src is only usable for - * project P1. - *

    - *

    - *

    - * Note that all sources/binaries inside a project are contributed as a whole through - * a project entry (see newProjectEntry). Particular - * source entries cannot be selectively exported. - *

    - * - * @param path the absolute workspace-relative path of a source folder - * @return a new source entry with not exclusion patterns - * - */ - public static ISourceEntry newSourceEntry(IPath path) { - return newSourceEntry(path, SourceEntry.NO_EXCLUSION_PATTERNS); - } - - /** - * Creates and returns a new entry of kind CDT_SOURCE - * for the project's source folder identified by the given absolute - * workspace-relative path but excluding all source files with paths - * matching any of the given patterns. This specifies that all package - * fragments within the root will have children of type - * ICompilationUnit. - *

    - * The source folder is referred to using an absolute path relative to the - * workspace root, e.g. /Project/src. A project's source - * folders are located with that project. That is, a source - * entry specifying the path /P1/src is only usable for - * project P1. - *

    - * - * @param path the absolute workspace-relative path of a source folder - * @param exclusionPatterns the possibly empty list of exclusion patterns - * represented as relative paths - * @return a new source entry with the given exclusion patterns - * - */ - public static ISourceEntry newSourceEntry(IPath path, IPath[] exclusionPatterns) { - return newSourceEntry(path, null, exclusionPatterns); - } - - /** - * Creates and returns a new entry of kind CDT_SOURCE - * for the project's source folder identified by the given absolute - * workspace-relative path but excluding all source files with paths - * matching any of the given patterns. This specifies that all package - * fragments within the root will have children of type - * ICompilationUnit. - *

    - * The source folder is referred to using an absolute path relative to the - * workspace root, e.g. /Project/src. A project's source - * folders are located with that project. That is, a source - * entry specifying the path /P1/src is only usable for - * project P1. - *

    - * @param path the absolute workspace-relative path of a source folder - * @param exclusionPatterns the possibly empty list of exclusion patterns - * represented as relative paths - * @param specificOutputLocation the specific output location for this source entry (null if using project default ouput location) - * @return a new source entry with the given exclusion patterns - */ - public static ISourceEntry newSourceEntry(IPath path, IPath outputLocation, IPath[] exclusionPatterns) { - return newSourceEntry(path, outputLocation, true, exclusionPatterns); - } - - /** - * Creates and returns a new entry of kind CDT_SOURCE - * for the project's source folder identified by the given absolute - * workspace-relative path but excluding all source files with paths - * matching any of the given patterns. This specifies that all package - * fragments within the root will have children of type - * ICompilationUnit. - *

    - * The source folder is referred to using an absolute path relative to the - * workspace root, e.g. /Project/src. A project's source - * folders are located with that project. That is, a source - * entry specifying the path /P1/src is only usable for - * project P1. - *

    - * @param path the absolute workspace-relative path of a source folder - * @param exclusionPatterns the possibly empty list of exclusion patterns - * represented as relative paths - * @param specificOutputLocation the specific output location for this source entry (null if using project default ouput location) - * @return a new source entry with the given exclusion patterns - */ - public static ISourceEntry newSourceEntry(IPath path, IPath outputLocation, boolean isRecursive, IPath[] exclusionPatterns) { - return new SourceEntry(path, outputLocation, isRecursive, exclusionPatterns); - } - - /** - * Creates and returns a new entry of kind CDT_INCLUDE - * @param path the affected worksapce-relative resource path - * @param includePath the absolute path of the include - * @return - */ - public static IIncludeEntry newIncludeEntry(IPath path, IPath includePath) { - return newIncludeEntry(path, includePath, false); - } - - /** - * Creates and returns a new entry of kind CDT_INCLUDE - * @param path the affected workspace-relative resource path - * @param includePath the absolute path of the include - * @param isSystemInclude wheter this include path should be consider the system include path - * @return - */ - public static IIncludeEntry newIncludeEntry(IPath path, IPath includePath, boolean isSystemInclude) { - return newIncludeEntry(path, includePath, isSystemInclude, true, IncludeEntry.NO_EXCLUSION_PATTERNS, true); - } - - /** - * Creates and returns a new entry of kind CDT_INCLUDE - * - * @param path the affected workspace-relative resource path - * @param includePath the absolute path of the include - * @param isSystemInclude wheter this include path should be consider the system include path - * @param isRecursive if the resource is a folder the include applied to all recursively - * @param exclusionPatterns exclusion patterns in the resource if a container - * @param isExported whether this cpath is exported. - * @return - */ - public static IIncludeEntry newIncludeEntry( - IPath path, - IPath includePath, - boolean isSystemInclude, - boolean isRecursive, - IPath[] exclusionPatterns, - boolean isExported) { - return new IncludeEntry(path, includePath, isSystemInclude, isRecursive, exclusionPatterns, isExported); - } - - /** - * Creates and returns an entry kind CDT_MACRO - * @param path the affected workspace-relative resource path - * @param macroName the name of the macro - * @param macroValue the value of the macro - * @return - */ - public static IMacroEntry newMacroEntry(IPath path, String macroName, String macroValue) { - return newMacroEntry(path, macroName, macroValue, true, MacroEntry.NO_EXCLUSION_PATTERNS, true); - } - - /** - * Creates and returns an entry kind CDT_MACRO - * @param path the affected workspace-relative resource path - * @param macroName the name of the macro - * @param macroValue the value of the macro - * @param isRecursive if the resource is a folder the include applied to all recursively - * @param exclusionPatterns exclusion patterns in the resource if a container - * @param isExported whether this cpath is exported. - * @return - */ - public static IMacroEntry newMacroEntry( - IPath path, - String macroName, - String macroValue, - boolean isRecursive, - IPath[] exclusionPatterns, - boolean isExported) { - return new MacroEntry(path, macroName, macroValue, isRecursive, exclusionPatterns, isExported); - } - - /** - * TODO: this is a temporary hack until, the CDescriptor manager is - * in place and could fire deltas of Parser change. - * @deprecated this function will be removed shortly. - */ - public void resetBinaryParser(IProject project) { - manager.resetBinaryParser(project); - } - - /** - * Return the singleton. - */ - public static CoreModel getDefault() { - if (cmodel == null) { - cmodel = new CoreModel(); - manager = CModelManager.getDefault(); - } - return cmodel; - } - - public void addElementChangedListener(IElementChangedListener listener) { - manager.addElementChangedListener(listener); - } - - /** - * Removes the given element changed listener. - * Has no affect if an identical listener is not registered. - * - * @param listener the listener - */ - public void removeElementChangedListener(IElementChangedListener listener) { - manager.removeElementChangedListener(listener); - } - - /** - * @see Plugin#startup - */ - public void startup() { - manager.startup(); - } - - public void shutdown() { - manager.shutdown(); - } - - private CoreModel() { - } - - public static void run(IWorkspaceRunnable action, IProgressMonitor monitor) throws CoreException { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - if (workspace.isTreeLocked()) { - new BatchOperation(action).run(monitor); - } else { - // use IWorkspace.run(...) to ensure that a build will be done in autobuild mode - workspace.run(new BatchOperation(action), monitor); - } - } - - public void startIndexing() { - manager.getIndexManager().reset(); - } - - public IndexManager getIndexManager() { - return manager.getIndexManager(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ElementChangedEvent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ElementChangedEvent.java deleted file mode 100644 index 767d909cdd8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ElementChangedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.util.EventObject; - -/** - * An element changed event describes a change to the structure or contents - * of a tree of C elements. The changes to the elements are described by - * the associated delta object carried by this event. - * - * @see IElementChangedListener - * @see ICElementDelta - */ -public class ElementChangedEvent extends EventObject { - public static final int POST_CHANGE = 1; - public static final int PRE_AUTO_BUILD = 2; - public static final int POST_RECONCILE = 4; - /** - * Creates an new element changed event (based on a ICElementDelta). - * - * @param delta the C element delta. - */ - public ElementChangedEvent(ICElementDelta delta) { - super(delta); - } - /** - * Returns the delta describing the change. - * - */ - public ICElementDelta getDelta() { - return (ICElementDelta) source; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/Flags.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/Flags.java deleted file mode 100644 index 30925076c86..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/Flags.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.core.model.IConstants; - -/** - * Utility class for decoding modifier flags in C elements. - *

    - * This class provides static methods only; it is not intended to be - * instantiated or subclassed by clients. - *

    - * - */ -public final class Flags { - /** - * Not instantiable. - */ - private Flags() {} - - /** - * Returns whether the given integer includes the abstract modifier. - * - * @param flags the flags - * @return true if the abstract modifier is included - */ - public static boolean isAbstract(int flags) { - return (flags & IConstants.AccAbstract) != 0; - } - - /** - * - * Return whether the give integer include the keyword export modifier. - * @param flags the flags - * @return true if the element is export - */ - public static boolean isExport(int flags) { - return (flags & IConstants.AccExport) != 0; - } - - /** - * Returns whether the given integer includes the inline modifier. - * - * @param flags the flags - * @return true if the inline modifier is included - */ - public static boolean isInline(int flags) { - return (flags & IConstants.AccInline) != 0; - } - - /** - * Returns whether the given integer includes the explicit modifier. - * - * @param flags the flags - * @return true if explicit modifier is included - */ - public static boolean isExplicit(int flags) { - return (flags & IConstants.AccExplicit) != 0; - } - - /** - * Returns whether the given integer includes the private modifier. - * - * @param flags the flags - * @return true if the private modifier is included - */ - public static boolean isPrivate(int flags) { - return (flags & IConstants.AccPrivate) != 0; - } - - /** - * Returns whether the given integer includes the protected modifier. - * - * @param flags the flags - * @return true if the protected modifier is included - */ - public static boolean isProtected(int flags) { - return (flags & IConstants.AccProtected) != 0; - } - - /** - * Returns whether the given integer includes the public modifier. - * - * @param flags the flags - * @return true if the public modifier is included - */ - public static boolean isPublic(int flags) { - return (flags & IConstants.AccPublic) != 0; - } - - /** - * Returns whether the given integer includes the static modifier. - * - * @param flags the flags - * @return true if the static modifier is included - */ - public static boolean isStatic(int flags) { - return (flags & IConstants.AccStatic) != 0; - } - - /** - * Returns whether the given integer includes the extern modifier. - * - * @param flags the flags - * @return true if the extern modifier is included - */ - public static boolean isExtern(int flags) { - return (flags & IConstants.AccExtern) != 0; - } - /** - * Returns whether the given integer includes the mutable modifier. - * - * @param flags the flags - * @return true if the mutable modifier is included - */ - public static boolean isMutable(int flags) { - return (flags & IConstants.AccMutable) != 0; - } - - /** - * Returns whether the given integer includes the indication that the - * element is a register storage specifier. - * - * @param flags the flags - * @return true if the element is marked register storage specifier - */ - public static boolean isRegister(int flags) { - return (flags & IConstants.AccRegister) != 0; - } - /** - * Returns whether the given integer includes the virtual modifier. - * - * @param flags the flags - * @return true if the virtual modifier is included - */ - public static boolean isVirtual(int flags) { - return (flags & IConstants.AccVirtual) != 0; - } - - /** - * Returns whether the given integer includes the volatile modifier. - * - * @param flags the flags - * @return true if the volatile modifier is included - */ - public static boolean isVolatile(int flags) { - return (flags & IConstants.AccVolatile) != 0; - } - - /** - * Returns a standard string describing the given modifier flags. - * Only modifier flags are included in the output; the deprecated and - * synthetic flags are ignored if set. - *

    - * Examples results: - *

    -	 *	  "public static"
    -	 *	  "private"
    -	 * 
    - *

    - * - * @param flags the flags - * @return the standard string representation of the given flags - */ - public static String toString(int flags) { - StringBuffer sb = new StringBuffer(); - - if (isPublic(flags)) sb.append("public "); //$NON-NLS-1$ - if (isProtected(flags)) sb.append("protected "); //$NON-NLS-1$ - if (isPrivate(flags)) sb.append("private "); //$NON-NLS-1$ - if (isStatic(flags)) sb.append("static "); //$NON-NLS-1$ - if (isAbstract(flags)) sb.append("abstract "); //$NON-NLS-1$ - if (isVirtual(flags)) sb.append("virtual "); //$NON-NLS-1$ - if (isInline(flags)) sb.append("inline "); //$NON-NLS-1$ - if (isExtern(flags)) sb.append("extern "); //$NON-NLS-1$ - if (isExport(flags)) sb.append("export "); //$NON-NLS-1$ - if (isVolatile(flags)) sb.append("volatile "); //$NON-NLS-1$ - if (isExplicit(flags)) sb.append("explicit "); //$NON-NLS-1$ - - int len = sb.length(); - if (len == 0) return ""; //$NON-NLS-1$ - sb.setLength(len-1); - return sb.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchive.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchive.java deleted file mode 100644 index 1f1f471099b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchive.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * An IArchive represents a group of files combined into a - * single file(the Archive), for example libxx.a. - */ -public interface IArchive extends ICElement, IParent, IOpenable { - /** - * Return the binaries contain in the archive. - * It does not actually extract the files. - */ - public IBinary[] getBinaries(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchiveContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchiveContainer.java deleted file mode 100644 index 6554e42fd04..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IArchiveContainer.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents a container of all the IArchive's found in the project - * while inspecting the project. - */ -public interface IArchiveContainer extends ICElement, IParent, IOpenable { - public IArchive[] getArchives(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinary.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinary.java deleted file mode 100644 index 4c9d361be08..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinary.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents a Binary file, for example an ELF excutable. - * An ELF parser will inspect the binary. - */ -public interface IBinary extends ICElement, IParent, IOpenable { - /** - * Return whether the file was compiling with debug symbols. - */ - public boolean hasDebug(); - - public boolean isExecutable(); - - public boolean isObject(); - - public boolean isSharedLib(); - - public boolean isCore(); - - public String [] getNeededSharedLibs(); - - public String getSoname(); - - public String getCPU(); - - public long getText(); - - public long getData(); - - public long getBSS(); - - public boolean isLittleEndian(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryContainer.java deleted file mode 100644 index 2a937c485a9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryContainer.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents a container of all the IBinary's found in the project - * while inspecting the project. - */ -public interface IBinaryContainer extends ICElement, IParent, IOpenable { - - public IBinary[] getBinaries(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryElement.java deleted file mode 100644 index b6cec1e2d5c..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryElement.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - */ -public interface IBinaryElement extends ICElement { - - /** - * Returns the address of the function. This method will return, - * the address of a symbol for children of IBinaryObject. - * - * @exception CModelException if this element does not have address - * information. - */ - long getAddress() throws CModelException; - - /** - * Returns the binary object the element belongs to. - * - */ - IBinary getBinary(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryFunction.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryFunction.java deleted file mode 100644 index febdee14917..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryFunction.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents a function. - */ -public interface IBinaryFunction extends IFunction, IBinaryElement { -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryModule.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryModule.java deleted file mode 100644 index d72fd072eb1..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryModule.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - */ -public interface IBinaryModule extends IParent, IBinaryElement { - - IBinaryElement[] getBinaryElements(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryVariable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryVariable.java deleted file mode 100644 index 71c488ea7ee..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBinaryVariable.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a global variable. - */ -public interface IBinaryVariable extends IVariable , IBinaryElement { -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBuffer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBuffer.java deleted file mode 100644 index 34e1a95f2c8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBuffer.java +++ /dev/null @@ -1,257 +0,0 @@ -package org.eclipse.cdt.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * A buffer contains the text contents of a resource. It is not language-specific. - * The contents may be in the process of being edited, differing from the actual contents of the - * underlying resource. A buffer has an owner, which is an - * IOpenable. If a buffer does not have an underlying resource, - * saving the buffer has no effect. Buffers can be read-only. - *

    - * This interface is similar to the JDT IBuffer interface. - */ - -public interface IBuffer { - - /** - * Adds the given listener for changes to this buffer. - * Has no effect if an identical listener is already registered or if the buffer - * is closed. - * - * @param listener the listener of buffer changes - */ - public void addBufferChangedListener(IBufferChangedListener listener); - /** - * Appends the given character array to the contents of the buffer. - * This buffer will now have unsaved changes. - * Any client can append to the contents of the buffer, not just the owner of the buffer. - * Reports a buffer changed event. - *

    - * Has no effect if this buffer is read-only. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param text the given character array to append to contents of the buffer - */ - public void append(char[] text); - /** - * Appends the given string to the contents of the buffer. - * This buffer will now have unsaved changes. - * Any client can append to the contents of the buffer, not just the owner of the buffer. - * Reports a buffer changed event. - *

    - * Has no effect if this buffer is read-only. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param text the String to append to the contents of the buffer - */ - public void append(String text); - /** - * Closes the buffer. Any unsaved changes are lost. Reports a buffer changed event - * with a 0 offset and a 0 length. When this event is fired, the buffer should already - * be closed. - *

    - * Further operations on the buffer are not allowed, except for close. If an - * attempt is made to close an already closed buffer, the second attempt has no effect. - */ - public void close(); - /** - * Returns the character at the given position in this buffer. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param position a zero-based source offset in this buffer - * @return the character at the given position in this buffer - */ - public char getChar(int position); - /** - * Returns the contents of this buffer as a character array, or null if - * the buffer has not been initialized. - *

    - * Callers should make no assumption about whether the returned character array - * is or is not the genuine article or a copy. In other words, if the client - * wishes to change this array, they should make a copy. Likewise, if the - * client wishes to hang on to the array in its current state, they should - * make a copy. - *

    - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @return the characters contained in this buffer - */ - public char[] getCharacters(); - /** - * Returns the contents of this buffer as a String. Like all strings, - * the result is an immutable value object., It can also answer null if - * the buffer has not been initialized. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @return the contents of this buffer as a String - */ - public String getContents(); - /** - * Returns number of characters stored in this buffer. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @return the number of characters in this buffer - */ - public int getLength(); - /** - * Returns the resource element owning of this buffer. - * - * @return the resource element owning this buffer - */ - public IOpenable getOwner(); - /** - * Returns the given range of text in this buffer. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param offset the zero-based starting offset - * @param length the number of characters to retrieve - * @return the given range of text in this buffer - */ - public String getText(int offset, int length); - /** - * Returns the underlying resource for which this buffer was opened, - * or null if this buffer was not opened on a resource. - * - * @return the underlying resource for this buffer, or null - * if none. - */ - public IResource getUnderlyingResource(); - /** - * Returns whether this buffer has been modified since it - * was opened or since it was last saved. - * If a buffer does not have an underlying resource, this method always - * returns true. - * - * @return a boolean indicating presence of unsaved changes (in - * the absence of any underlying resource, it will always return true). - */ - public boolean hasUnsavedChanges(); - /** - * Returns whether this buffer has been closed. - * - * @return a boolean indicating whether this buffer is closed. - */ - public boolean isClosed(); - /** - * Returns whether this buffer is read-only. - * - * @return a boolean indicating whether this buffer is read-only - */ - public boolean isReadOnly(); - /** - * Removes the given listener from this buffer. - * Has no affect if an identical listener is not registered or if the buffer is closed. - * - * @param listener the listener - */ - public void removeBufferChangedListener(IBufferChangedListener listener); - /** - * Replaces the given range of characters in this buffer with the given text. - * position and position + length must be in the range [0, getLength()]. - * length must not be negative. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param position the zero-based starting position of the affected text range in this buffer - * @param length the length of the affected text range in this buffer - * @param text the replacing text as a character array - */ - public void replace(int position, int length, char[] text); - /** - * Replaces the given range of characters in this buffer with the given text. - * position and position + length must be in the range [0, getLength()]. - * length must not be negative. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param position the zero-based starting position of the affected text range in this buffer - * @param length the length of the affected text range in this buffer - * @param text the replacing text as a String - */ - public void replace(int position, int length, String text); - /** - * Saves the contents of this buffer to its underlying resource. If - * successful, this buffer will have no unsaved changes. - * The buffer is left open. Saving a buffer with no unsaved - * changes has no effect - the underlying resource is not changed. - * If the buffer does not have an underlying resource or is read-only, this - * has no effect. - *

    - * The force parameter controls how this method deals with - * cases where the workbench is not completely in sync with the local file system. - * If false is specified, this method will only attempt - * to overwrite a corresponding file in the local file system provided - * it is in sync with the workbench. This option ensures there is no - * unintended data loss; it is the recommended setting. - * However, if true is specified, an attempt will be made - * to write a corresponding file in the local file system, - * overwriting any existing one if need be. - * In either case, if this method succeeds, the resource will be marked - * as being local (even if it wasn't before). - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param progress the progress monitor to notify - * @param force a boolean flag indicating how to deal with resource - * inconsistencies. - * - * @exception CModelException if an error occurs writing the buffer to - * the underlying resource - * - * @see org.eclipse.core.resources.IFile#setContents(java.io.InputStream, boolean, boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public void save(IProgressMonitor progress, boolean force) throws CModelException; - /** - * Sets the contents of this buffer to the given character array. - * This buffer will now have unsaved changes. - * Any client can set the contents of the buffer, not just the owner of the buffer. - * Reports a buffer changed event. - *

    - * Equivalent to replace(0,getLength(),contents). - *

    - *

    - * Has no effect if this buffer is read-only. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param contents the new contents of this buffer as a character array - */ - public void setContents(char[] contents); - /** - * Sets the contents of this buffer to the given String. - * This buffer will now have unsaved changes. - * Any client can set the contents of the buffer, not just the owner of the buffer. - * Reports a buffer changed event. - *

    - * Equivalent to replace(0,getLength(),contents). - *

    - *

    - * Has no effect if this buffer is read-only. - *

    - * A RuntimeException might be thrown if the buffer is closed. - * - * @param contents the new contents of this buffer as a String - */ - public void setContents(String contents); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBufferChangedListener.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBufferChangedListener.java deleted file mode 100644 index a7caa0d8769..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IBufferChangedListener.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.cdt.core.model; - - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -/** - * A listener, which gets notified when the contents of a specific buffer - * have changed, or when the buffer is closed. - * When a buffer is closed, the listener is notified after the buffer has been closed. - * A listener is not notified when a buffer is saved. - *

    - * This interface may be implemented by clients. - *

    - * - * This interface is similar to the JDT IBufferChangedListener interface - */ -public interface IBufferChangedListener { - /** - * Notifies that the given event has occurred. - * - * @param event the change event - */ - public void bufferChanged(BufferChangedEvent event); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java deleted file mode 100644 index 7b1a1c2b3ab..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICContainer.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -/** - * A C Folder Resource. - */ -public interface ICContainer extends ICElement, IParent, IOpenable { - /** - * Returns an array of non-C resources directly contained in this project. - * It does not transitively answer non-C resources contained in folders; - * these would have to be explicitly iterated over. - *

    - * Non-C resources includes files, folders, projects not accounted for. - *

    - * - * @return an array of non-C resources directly contained in this project - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - Object[] getNonCResources() throws CModelException; - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java deleted file mode 100644 index e4282aa43e7..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElement.java +++ /dev/null @@ -1,316 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; - -/** - * Common protocol for all elements provided by the C model. - */ -public interface ICElement extends IAdaptable { - - /** - * IResource from 10-20 - */ - - /** - * Constant representing a C Root workspace (IWorkspaceRoot object). - * A C element with this type can be safely cast to ICModel. - */ - static final int C_MODEL = 10; - - /** - * Constant representing a C project(IProject object). - * A C element with this type can be safely cast to ICProject. - */ - static final int C_PROJECT = 11; - - /** - * Constant representing a folder(ICContainer object). - * A C element with this type can be safely cast to ICContainer. - */ - static final int C_CCONTAINER = 12; - - static final int C_BINARY = 14; - - static final int C_ARCHIVE = 18; - /** - * Virtual container serving as a place holder. - */ - static final int C_VCONTAINER = 30; - - /** - * Constant representing a C/C++ children of a Translation Unit - */ - static final int C_UNIT = 60; - - /** - * Namespace. - */ - static final int C_NAMESPACE = 61; - - /** - * Using. - */ - static final int C_USING = 62; - - /** - * Enumeration. - */ - static final int C_ENUMERATION = 63; - - /** - * Constant representing a class structure. - */ - static final int C_CLASS = 64; - - /** - * Constant representing a struct structure. - */ - static final int C_STRUCT = 65; - - /** - * Constant representing a union structure. - */ - static final int C_UNION = 66; - - /** - * A method definition part of a structure(class, struct, union). - */ - static final int C_METHOD = 67; - - /** - * A method declaration part of a structure(class, struct, union). - */ - static final int C_METHOD_DECLARATION = 68; - - /** - * A Field definition part of a structure(class, struct, union). - */ - static final int C_FIELD = 69; - - /** - * a C/C++ function prototype. - */ - static final int C_FUNCTION_DECLARATION = 70; - - /** - * a C/C++ function. - */ - static final int C_FUNCTION = 71; - - /** - * Preprocessor #include directive. - */ - static final int C_INCLUDE = 72; - - /** - * C++ template class. - */ - static final int C_TEMPLATE_CLASS = 73; - - /** - * Global variable. - */ - static final int C_VARIABLE = 74; - - /** - * variable Declaration. - */ - static final int C_VARIABLE_DECLARATION = 75; - - /** - * Local Variable. - */ - static final int C_VARIABLE_LOCAL = 76; - - /** - * A preprocessor macro. - */ - static final int C_MACRO = 77; - - /** - * a Typedef. - */ - static final int C_TYPEDEF = 78; - - /** - * Enumerator. - */ - static final int C_ENUMERATOR = 79; - - /** - * C++ template function. - */ - static final int C_TEMPLATE_FUNCTION = 80; - - /** - * C++ template method. - */ - static final int C_TEMPLATE_METHOD = 81; - - /** - * C++ template struct. - */ - static final int C_TEMPLATE_STRUCT = 82; - - /** - * C++ template union. - */ - static final int C_TEMPLATE_UNION = 83; - - /** - * C++ template variable. - */ - static final int C_TEMPLATE_VARIABLE = 84; - - /** - * Modifier indicating a class constructor - */ - static final int C_CLASS_CTOR = 0x100; - - /** - * Modifier indicating a class destructor - */ - static final int C_CLASS_DTOR = 0x200; - - /** - * Modifier indicating a static storage attribute - */ - static final int C_STORAGE_STATIC = 0x400; - - /** - * Modifier indicating an extern storage attribute - */ - static final int C_STORAGE_EXTERN = 0x800; - - /** - * Modifier indicating a private class - */ - static final int CPP_PRIVATE = 0x1000; - - /** - * Modifier indicating a public class - */ - - static final int CPP_PUBLIC = 0x2000; - - /** - * Modifier indicating a protected class - */ - static final int CPP_PROTECTED = 0x4000; - /** - * Modifier indicating a friend class - */ - static final int CPP_FRIEND = 0x8000; - - /** - * Returns whether this C element exists in the model. - * - * @return true if this element exists in the C model - */ - boolean exists(); - - /** - * Returns the name of this element. - * - * @return the element name - */ - String getElementName(); - - /** - * Returns this element's kind encoded as an integer. - * This is a handle-only method. - * - * @return the kind of element; one of the constants declared in - * ICElement - * @see ICElement - */ - int getElementType(); - - /** - * Returns the C model. - * - * @return the C model - */ - ICModel getCModel(); - - /** - * Returns the C project this element is contained in, - * or null if this element is not contained in any C project - * - * @return the containing C project, or null if this element is - * not contained in a C project - */ - ICProject getCProject(); - - /** - * Returns the element directly containing this element, - * or null if this element has no parent. - * - * @return the parent element, or null if this element has no parent - */ - ICElement getParent(); - - /** - * Returns the path to the innermost resource enclosing this element. - * If this element is not included in an external archive, - * the path returned is the full, absolute path to the underlying resource, - * relative to the workbench. - * If this element is included in an external archive, - * the path returned is the absolute path to the archive in the file system. - * This is a handle-only method. - * - */ - IPath getPath(); - - /** - * Returns the underlying resource that contains - * this element, or null if this element is not contained - * in a resource. - * - * @return the underlying resource, or null if none - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its underlying resource - */ - IResource getUnderlyingResource(); - - /** - * Returns the Corresponding resource for - * this element, or null if this element does not have - * a corresponding resource. - * - * @return the corresponding resource, or null if none - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its resource - */ - IResource getResource() ; - /** - * Returns whether this C element is read-only. An element is read-only - * if its structure cannot be modified by the C model. - * - * @return true if this element is read-only - */ - boolean isReadOnly(); - - /** - * Returns whether the structure of this element is known. For example, for a - * translation unit that could not be parsed, false is returned. - * If the structure of an element is unknown, navigations will return reasonable - * defaults. For example, getChildren will return an empty collection. - *

    - * Note: This does not imply anything about consistency with the - * underlying resource/buffer contents. - *

    - * - * @return true if the structure of this element is known - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - boolean isStructureKnown() throws CModelException; -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElementDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElementDelta.java deleted file mode 100644 index b8edc907642..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICElementDelta.java +++ /dev/null @@ -1,200 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import org.eclipse.core.resources.IResourceDelta; - -/** - * A C element delta describes changes in C element between two discrete - * points in time. Given a delta, clients can access the element that has - * changed, and any children that have changed. - *

    - * Deltas have a different status depending on the kind of change they represent. - * The list below summarizes each status (as returned by getKind) - * and its meaning: - *

      - *
    • ADDED - The element described by the delta - * has been added. - *
    • REMOVED - The element described by the delta - * has been removed. - *
    • CHANGED - The element described by the delta - * has been changed in some way. - *
    • - *
    - *

    - * Move operations are indicated by other change flags, layered on top - * of the change flags described above. If element A is moved to become B, - * the delta for the change in A will have status REMOVED, - * with change flag F_MOVED_TO. In this case, - * getMovedToElement on delta A will return the handle for B. - * The delta for B will have status ADDED, with change flag - * F_MOVED_FROM, and getMovedFromElement on delta - * B will return the handle for A. (Note, the handle to A in this case represents - * an element that no longer exists). - *

    - *

    - * Note that the move change flags only describe the changes to a single element, they - * do not imply anything about the parent or children of the element. - */ -public interface ICElementDelta { - - /** - * Status constant indicating that the element has been added. - */ - public int ADDED = 1; - - /** - * Status constant indicating that the element has been removed. - */ - public int REMOVED = 2; - - /** - * Status constant indicating that the element has been changed, - * as described by the change flags. - */ - public int CHANGED = 4; - - /** - * Change flag indicating that the content of the element has changed. - */ - public int F_CONTENT = 0x0001; - - /** - * Change flag indicating that the modifiers of the element have changed. - */ - public int F_MODIFIERS = 0x0002; - - /** - * Change flag indicating that there are changes to the children of the element. - */ - public int F_CHILDREN = 0x0008; - - /** - * Change flag indicating that the element was moved from another location. - * The location of the old element can be retrieved using getMovedFromElement. - */ - public int F_MOVED_FROM = 0x0010; - - /** - * Change flag indicating that the element was moved to another location. - * The location of the new element can be retrieved using getMovedToElement. - */ - public int F_MOVED_TO = 0x0020; - - /** - * Change flag indicating that the underlying IProject has been - * opened. - */ - public int F_OPENED = 0x0200; - - /** - * Change flag indicating that the underlying IProject has been - * closed. - */ - public int F_CLOSED = 0x0400; - - /** - * Change in the binary Parser. - */ - public int F_BINARY_PARSER_CHANGED = 0x0800; - - /** - * A cpathEntry was added for this resource. - */ - public int F_ADDED_TO_CPATHENTRY = 0x0040; - - /** - * A cpathEtnry was remove for this resource. - */ - public int F_REMOVED_FROM_CPATHENTRY = 0x0080; - - //public int F_CLASSPATH_REORDER = 0x0100; - //public int F_SUPER_TYPES = 0x0800; - - /** - * Change flag indicating that a source jar has been attached to a binary jar. - */ - public int F_SOURCEATTACHED = 0x1000; - - /** - * Change flag indicating that a source jar has been detached to a binary jar. - */ - public int F_SOURCEDETACHED = 0x2000; - - /** - * Change flag indicating that this is a fine-grained delta, i.e. an analysis down - * to the members level was done to determine if there were structural changes to - * members. - */ - public int F_FINE_GRAINED = 0x4000; - - /** - * Returns deltas for the children that have been added. - */ - public ICElementDelta[] getAddedChildren(); - - /** - * Returns deltas for the affected (added, removed, or changed) children. - */ - public ICElementDelta[] getAffectedChildren(); - - /** - * Returns deltas for the children which have changed. - */ - public ICElementDelta[] getChangedChildren(); - - /** - * Returns the element that this delta describes a change to. - */ - public ICElement getElement(); - - /** - * Returns flags that describe how an element has changed. - * - * @see ICElementDelta#F_CHILDREN - * @see ICElementDelta#F_CONTENT - * @see ICElementDelta#F_MODIFIERS - * @see ICElementDelta#F_MOVED_FROM - * @see ICElementDelta#F_MOVED_TO - */ - public int getFlags(); - - /** - * Returns the kind of this delta - one of ADDED, REMOVED, - * or CHANGED. - */ - public int getKind(); - - /** - * Returns an element describing this element before it was moved - * to its current location, or null if the - * F_MOVED_FROM change flag is not set. - */ - public ICElement getMovedFromElement(); - - /** - * Returns an element describing this element in its new location, - * or null if the F_MOVED_TO change - * flag is not set. - */ - public ICElement getMovedToElement(); - - /** - * Returns deltas for the children which have been removed. - */ - public ICElementDelta[] getRemovedChildren(); - - /** - * Returns the collection of resource deltas. - *

    - * Note that resource deltas, like C element deltas, are generally only valid - * for the dynamic scope of an event notification. Clients must not hang on to - * these objects. - *

    - * - * @return the underlying resource deltas, or null if none - */ - public IResourceDelta[] getResourceDeltas(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModel.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModel.java deleted file mode 100644 index 599b1477176..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModel.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Represent the root C element corresponding to the workspace. - * Since there is only one such root element, it is commonly referred to as - * the C model element. - * The C model element needs to be opened before it can be navigated or manipulated. - * The C model element has no parent (it is the root of the C element - * hierarchy). Its children are ICProjects. - *

    - * This interface provides methods for performing copy, move, rename, and - * delete operations on multiple C elements. - *

    - * - * @see CCore#create(org.eclipse.core.resources.IWorkspaceRoot) - */ -public interface ICModel extends ICElement, IParent, IOpenable { - /** - * Copies the given elements to the specified container(s). - * If one container is specified, all elements are copied to that - * container. If more than one container is specified, the number of - * elements and containers must match, and each element is copied to - * its associated container. - *

    - * Optionally, each copy can positioned before a sibling - * element. If null is specified for a given sibling, the copy - * is inserted as the last child of its associated container. - *

    - *

    - * Optionally, each copy can be renamed. If - * null is specified for the new name, the copy - * is not renamed. - *

    - *

    - * Optionally, any existing child in the destination container with - * the same name can be replaced by specifying true for - * force. Otherwise an exception is thrown in the event that a name - * collision occurs. - *

    - * - * @param elements the elements to copy - * @param containers the container, or list of containers - * @param siblings the list of siblings element any of which may be - * null; or null - * @param renamings the list of new names any of which may be - * null; or null - * @param replace true if any existing child in a target container - * with the target name should be replaced, and false to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception CModelException if an element could not be copied. Reasons include: - *
      - *
    • A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
    • - *
    • A CoreException occurred while updating an underlying resource - *
    • A container is of an incompatible type (INVALID_DESTINATION) - *
    • A sibling is not a child of it associated container (INVALID_SIBLING) - *
    • A new name is invalid (INVALID_NAME) - *
    • A child in its associated container already exists with the same - * name and replace has been specified as false (NAME_COLLISION) - *
    • A container or element is read-only (READ_ONLY) - *
    - */ - void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException; - /** - * Deletes the given elements, forcing the operation if necessary and specified. - * - * @param elements the elements to delete - * @param force a flag controlling whether underlying resources that are not - * in sync with the local file system will be tolerated - * @param monitor a progress monitor - * @exception CModelException if an element could not be deleted. Reasons include: - *
      - *
    • A specified element does not exist (ELEMENT_DOES_NOT_EXIST)
    • - *
    • A CoreException occurred while updating an underlying resource - *
    • An element is read-only (READ_ONLY) - *
    - */ - void delete(ICElement[] elements, boolean force, IProgressMonitor monitor) throws CModelException; - - /** - * Moves the given elements to the specified container(s). - * If one container is specified, all elements are moved to that - * container. If more than one container is specified, the number of - * elements and containers must match, and each element is moved to - * its associated container. - *

    - * Optionally, each element can positioned before a sibling - * element. If null is specified for sibling, the element - * is inserted as the last child of its associated container. - *

    - *

    - * Optionally, each element can be renamed. If - * null is specified for the new name, the element - * is not renamed. - *

    - *

    - * Optionally, any existing child in the destination container with - * the same name can be replaced by specifying true for - * force. Otherwise an exception is thrown in the event that a name - * collision occurs. - *

    - * - * @param elements the elements to move - * @param containers the container, or list of containers - * @param siblings the list of siblings element any of which may be - * null; or null - * @param renamings the list of new names any of which may be - * null; or null - * @param replace true if any existing child in a target container - * with the target name should be replaced, and false to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception CModelException if an element could not be moved. Reasons include: - *
      - *
    • A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
    • - *
    • A CoreException occurred while updating an underlying resource - *
    • A container is of an incompatible type (INVALID_DESTINATION) - *
    • A sibling is not a child of it associated container (INVALID_SIBLING) - *
    • A new name is invalid (INVALID_NAME) - *
    • A child in its associated container already exists with the same - * name and replace has been specified as false (NAME_COLLISION) - *
    • A container or element is read-only (READ_ONLY) - *
    - * - * @exception IllegalArgumentException any element or container is null - */ - void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings, String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException; - - /** - * Renames the given elements as specified. - * If one container is specified, all elements are renamed within that - * container. If more than one container is specified, the number of - * elements and containers must match, and each element is renamed within - * its associated container. - * - * @param elements the elements to rename - * @param destinations the container, or list of containers - * @param names the list of new names - * @param replace true if an existing child in a target container - * with the target name should be replaced, and false to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception CModelException if an element could not be renamed. Reasons include: - *
      - *
    • A specified element does not exist (ELEMENT_DOES_NOT_EXIST)
    • - *
    • A CoreException occurred while updating an underlying resource - *
    • A new name is invalid (INVALID_NAME) - *
    • A child already exists with the same name and replace has been specified as false (NAME_COLLISION) - *
    • An element is read-only (READ_ONLY) - *
    - */ - void rename(ICElement[] elements, ICElement[] destinations, String[] names, boolean replace, IProgressMonitor monitor) throws CModelException; - - /** - * Returns the C project with the given name. This is a handle-only method. - * The project may or may not exist. - */ - ICProject getCProject(String name); - - /** - * Returns the C projects. - */ - ICProject[] getCProjects(); - - /** - * Returns an array of non-C resources (i.e. non-C projects) in - * the workspace. - *

    - * Non-C projects include all projects that are closed (even if they have the - * C nature). - *

    - * - * @return an array of non-C projects contained in the workspace. - * @throws CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @since 2.1 - */ - Object[] getNonCResources() throws CModelException; - - /** - * Returns the workspace associated with this C model. - */ - IWorkspace getWorkspace(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelMarker.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelMarker.java deleted file mode 100644 index 11d8fe88c22..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelMarker.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; - - -/** - * Markers used by the C model. - *

    - * This interface declares constants only; it is not intended to be implemented - * or extended. - *

    - */ -public interface ICModelMarker { - - /** - * C model problem marker type (value "org.eclipse.cdt.core.problem"). - * This can be used to recognize those markers in the workspace that flag problems - * detected by the C compilers. - */ - public static final String C_MODEL_PROBLEM_MARKER = CCorePlugin.PLUGIN_ID + ".problem"; //$NON-NLS-1$ - - /** - * C model extension to the marker problem markers which may hold a hint on - * the variable name that caused the error. Used by the ui to highlight the variable - * itself if it can be found. - */ - public static final String C_MODEL_MARKER_VARIABLE = "problem.variable"; //$NON-NLS-1$ - - /** - * C model task marker type (value "org.eclipse.cdt.core.task"). - * This can be used to recognize task markers in the workspace that correspond to tasks - * specified in C/C++ source comments and detected during translation (for example, 'TO-DO: ...'). - * Tasks are identified by a task tag, which can be customized through CCorePlugin - * option "org.eclipse.cdt.core.translation.taskTag". - */ - public static final String TASK_MARKER = CCorePlugin.PLUGIN_ID + ".task"; //$NON-NLS-1$ -} - - diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatus.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatus.java deleted file mode 100644 index f62c6d50faa..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatus.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; - -/** - * Represents the outcome of an C model operation. Status objects are - * used inside CModelException objects to indicate what went - * wrong. - *

    - * C model status object are distinguished by their plug-in id: - * getPlugin returns "org.eclipse.cdt.core". - * getCode returns one of the status codes declared in - * ICModelStatusConstants. - *

    - *

    - * A C model status may also carry additional information (that is, in - * addition to the information defined in IStatus): - *

      - *
    • elements - optional handles to C elements associated with the failure
    • - *
    • string - optional string associated with the failure
    • - *
    - *

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

    - * - * @see org.eclipse.core.runtime.IStatus - * @see ICModelStatusConstants - */ -public interface ICModelStatus extends IStatus { - /** - * Returns any C elements associated with the failure (see specification - * of the status code), or an empty array if no elements are related to this - * particular status code. - * - * @return the list of C element culprits - * @see ICModelStatusConstants - */ - ICElement[] getElements(); - - /** - * Returns the path associated with the failure (see specification - * of the status code), or null if the failure is not - * one of DEVICE_PATH, INVALID_PATH, - * PATH_OUTSIDE_PROJECT, or RELATIVE_PATH. - * - * @return the path that caused the failure, or null if none - * @see ICModelStatusConstants#DEVICE_PATH - * @see ICModelStatusConstants#INVALID_PATH - * @see ICModelStatusConstants#PATH_OUTSIDE_PROJECT - * @see ICModelStatusConstants#RELATIVE_PATH - */ - IPath getPath(); - - /** - * Returns the string associated with the failure (see specification - * of the status code), or null if no string is related to this - * particular status code. - * - * @return the string culprit, or null if none - * @see ICModelStatusConstants - */ - String getString(); - - /** - * Returns whether this status indicates that a C model element does not exist. - * This convenience method is equivalent to - * getCode() == ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST. - * - * @return true if the status code indicates that a C model - * element does not exist - * @see ICModelStatusConstants#ELEMENT_DOES_NOT_EXIST - */ - boolean doesNotExist(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatusConstants.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatusConstants.java deleted file mode 100644 index 21fe3c6a202..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICModelStatusConstants.java +++ /dev/null @@ -1,224 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Status codes used with C model status objects. - *

    - * This interface declares constants only; it is not intended to be implemented - * or extended. - *

    - * - * @see ICModelStatus - * @see org.eclipse.core.runtime.IStatus#getCode - */ -public interface ICModelStatusConstants { - - /** - * Status constant indicating that a variable path was not resolvable - * indicating either the referred variable is undefined, unbound or the resolved - * variable path does not correspond to an existing file or folder. - */ - public static final int CP_VARIABLE_PATH_UNBOUND = 965; - - /** - * Status constant indicating a core exception occurred. - * Use getException to retrieve a CoreException. - */ - public static final int CORE_EXCEPTION = 966; - - /** - * Status constant indicating one or more of the elements - * supplied are not of a valid type for the operation to - * process. - * The element(s) can be retrieved using getElements on the status object. - */ - public static final int INVALID_ELEMENT_TYPES = 967; - - /** - * Status constant indicating that no elements were - * provided to the operation for processing. - */ - public static final int NO_ELEMENTS_TO_PROCESS = 968; - - /** - * Status constant indicating that one or more elements - * supplied do not exist. - * The element(s) can be retrieved using getElements on the status object. - * - * @see ICModelStatus#isDoesNotExist - */ - public static final int ELEMENT_DOES_NOT_EXIST = 969; - - /** - * Status constant indicating that a null path was - * supplied to the operation. - */ - public static final int NULL_PATH = 970; - - /** - * Status constant indicating that a path outside of the - * project was supplied to the operation. The path can be retrieved using - * getPath on the status object. - */ - public static final int PATH_OUTSIDE_PROJECT = 971; - - /** - * Status constant indicating that a relative path - * was supplied to the operation when an absolute path is - * required. The path can be retrieved using getPath on the - * status object. - */ - public static final int RELATIVE_PATH = 972; - - /** - * Status constant indicating that a path specifying a device - * was supplied to the operation when a path with no device is - * required. The path can be retrieved using getPath on the - * status object. - */ - public static final int DEVICE_PATH = 973; - - /** - * Status constant indicating that a string - * was supplied to the operation that was null. - */ - public static final int NULL_STRING = 974; - - /** - * Status constant indicating that the operation encountered - * a read-only element. - * The element(s) can be retrieved using getElements on the status object. - */ - public static final int READ_ONLY = 976; - - /** - * Status constant indicating that a naming collision would occur - * if the operation proceeded. - */ - public static final int NAME_COLLISION = 977; - - /** - * Status constant indicating that a destination provided for a copy/move/rename operation - * is invalid. - * The destination element can be retrieved using getElements on the status object. - */ - public static final int INVALID_DESTINATION = 978; - - /** - * Status constant indicating that a path provided to an operation - * is invalid. The path can be retrieved using getPath on the - * status object. - */ - public static final int INVALID_PATH = 979; - - /** - * Status constant indicating the given source position is out of bounds. - */ - public static final int INDEX_OUT_OF_BOUNDS = 980; - - /** - * Status constant indicating there is an update conflict - * for a working copy. The translation unit on which the - * working copy is based has changed since the working copy - * was created. - */ - public static final int UPDATE_CONFLICT = 981; - - /** - * Status constant indicating that null was specified - * as a name argument. - */ - public static final int NULL_NAME = 982; - - /** - * Status constant indicating that a name provided is not syntactically correct. - * The name can be retrieved from getString. - */ - public static final int INVALID_NAME = 983; - - /** - * Status constant indicating that the specified contents - * are not valid. - */ - public static final int INVALID_CONTENTS = 984; - - /** - * Status constant indicating that an java.io.IOException - * occurred. - */ - public static final int IO_EXCEPTION = 985; - - /** - * Status constant indicating that a DOMException - * occurred. - */ - public static final int DOM_EXCEPTION = 986; - - /** - * Status constant indicating that a TargetException - * occurred. - */ - public static final int TARGET_EXCEPTION = 987; - - /** - * Status constant indicating that the C builder - * could not be initialized. - */ - public static final int BUILDER_INITIALIZATION_ERROR = 990; - - /** - * Status constant indicating that the C builder's last built state - * could not be serialized or deserialized. - */ - public static final int BUILDER_SERIALIZATION_ERROR = 991; - - /** - * Status constant indicating that an error was encountered while - * trying to evaluate a code snippet, or other item. - */ - public static final int EVALUATION_ERROR = 992; - - /** - * Status constant indicating that a sibling specified is not valid. - */ - public static final int INVALID_SIBLING = 993; - - /** - * Status indicating that a C element could not be created because - * the underlying resource is invalid. - * @see CCore - */ - public static final int INVALID_RESOURCE = 995; - - /** - * Status indicating that a C element could not be created because - * the underlying resource is not of an appropriate type. - * @see CCore - */ - public static final int INVALID_RESOURCE_TYPE = 996; - - /** - * Status indicating that a C element could not be created because - * the project owning underlying resource does not have the C nature. - * @see CCore - */ - public static final int INVALID_PROJECT = 997; - - //public static final int INVALID_NAMESPACE = 998; - - /** - * Status indicating that the corresponding resource has no local contents yet. - * This might happen when attempting to use a resource before its contents - * has been made locally available. - */ - public static final int NO_LOCAL_CONTENTS = 999; - - ///** - //* Status constant indicating that a classpath entry was invalid - //*/ - //public static final int INVALID_CLASSPATH = 964; -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICPathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICPathEntry.java deleted file mode 100644 index 2a0562a8c8a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICPathEntry.java +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - - -public interface ICPathEntry { - - /** - * Entry kind constant describing a path entry identifying a - * library. A library is an archive containing - * consisting of pre-compiled binaries. - */ - int CDT_LIBRARY = 1; - - /** - * Entry kind constant describing a path entry identifying a - * required project. - */ - int CDT_PROJECT = 2; - - /** - * Entry kind constant describing a path entry identifying a - * folder containing source code to be compiled. - */ - int CDT_SOURCE = 3; - - /* - * Entry kind constant describing a path entry defined using - * a path that begins with a variable reference. - */ - int CDT_VARIABLE = 4; - - /** - * Entry kind constant describing a path entry identifying a - * include path. - */ - int CDT_INCLUDE = 5; - - /** - * Entry kind constant describing a path entry representing - * a container id. - * - */ - int CDT_CONTAINER = 6; - - /** - * Entry kind constant describing a path entry representing - * a macro definition. - * - */ - int CDT_MACRO = 7; - - /** - * Entry kind constant describing output location - * - */ - int CDT_OUTPUT = 8; - - /** - * Returns the kind of this path entry. - * - * @return one of: - *
      - *
    • CDT_SOURCE - this entry describes a source root in - its project - *
    • CDT_LIBRARY - this entry describes a library - *
    • CDT_PROJECT - this entry describes another project - *
    • CDT_VARIABLE - this entry describes a project or library - * indirectly via a variable in the first segment of the path - *
    • CDT_INCLUDE - this entry describes a include path - *
    • CDT_MACRO - this entry describes a macro definition - *
    • CDT_CONTAINER - this entry describes a container id - *
    • CDT_OUTPUT - this entry describes output location - */ - int getEntryKind(); - - /** - * Returns whether this entry is exported to dependent projects. - * Always returns false for source entries (kind - * CPE_SOURCE), which cannot be exported. - * - * @return true if exported, and false otherwise - */ - boolean isExported(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java deleted file mode 100644 index 32fb5e79942..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ICProject.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * A C project represents a view of a project resource in terms of C - * elements such as , ICContainer, ITranslationUnit .... - * CCore.create(project). - *

      - * - * @see CCore#create(org.eclipse.core.resources.IProject) - * @see IBuildEntry - */ -public interface ICProject extends ICContainer { - - /** - * Returns the ICElement corresponding to the given - * path, or null if no such - * ICElement is found. - * - * @exception CModelException if the given path is null - * or absolute - */ - ICElement findElement(IPath path) throws CModelException; - - /** - * Return the ArchiveContainer of this Project. - */ - IArchiveContainer getArchiveContainer(); - - /** - * Return the BinaryContainer of this Project. - */ - IBinaryContainer getBinaryContainer(); - - /** - * Return the library references for this project. - * - * @return [] ILibraryReference - */ - ILibraryReference[] getLibraryReferences() throws CModelException; - - /** - * Returns the names of the projects that are directly required by this - * project. A project is required if it is in its cpath entries. - *

      - * The project names are returned in the order they appear on the cpathentries. - * - * @return the names of the projects that are directly required by this project - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - String[] getRequiredProjectNames() throws CModelException; - - /** - * - * @return IProject - */ - IProject getProject(); - - /** - * Helper method for returning one option value only. Equivalent to (String)this.getOptions(inheritCCoreOptions).get(optionName) - * Note that it may answer null if this option does not exist, or if there is no custom value for it. - *

      - * For a complete description of the configurable options, see CCorePlugin#getDefaultOptions. - *

      - * - * @param optionName the name of an option - * @param inheritCCoreOptions - boolean indicating whether CCorePlugin options should be inherited as well - * @return the String value of a given option - * @see CCorePlugin#getDefaultOptions - */ - String getOption(String optionName, boolean inheritCCoreOptions); - - /** - * Returns the table of the current custom options for this project. Projects remember their custom options, - * in other words, only the options different from the the CCorePlugin global options for the workspace. - * A boolean argument allows to directly merge the project options with global ones from CCorePlugin. - *

      - * For a complete description of the configurable options, see CCorePlugin#getDefaultOptions. - *

      - * - * @param inheritCCoreOptions - boolean indicating whether CCorePlugin options should be inherited as well - * @return table of current settings of all options - * (key type: String; value type: String) - * @see CCorePlugin#getDefaultOptions - */ - Map getOptions(boolean inheritCCoreOptions); - - /** - * Helper method for setting one option value only. Equivalent to Map options = this.getOptions(false); map.put(optionName, optionValue); this.setOptions(map) - *

      - * For a complete description of the configurable options, see CCorePlugin#getDefaultOptions. - *

      - * - * @param optionName the name of an option - * @param optionValue the value of the option to set - * @see CCorePlugin#getDefaultOptions - */ - void setOption(String optionName, String optionValue); - - /** - * Sets the project custom options. All and only the options explicitly included in the given table - * are remembered; all previous option settings are forgotten, including ones not explicitly - * mentioned. - *

      - * For a complete description of the configurable options, see CCorePlugin#getDefaultOptions. - *

      - * - * @param newOptions the new options (key type: String; value type: String), - * or null to flush all custom options (clients will automatically get the global CCorePlugin options). - * @see CCorePlugin#getDefaultOptions - */ - void setOptions(Map newOptions); - - /** - * Returns the list of entries for the project. This corresponds to the exact set - * of entries which were assigned using setCPathEntries. - *

      - * - * @return the list of entries for the project. - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - ICPathEntry[] getResolvedCPathEntries() throws CModelException; - - /** - * Returns the list of entries for the project. This corresponds to the exact set - * of entries which were assigned using setCPathEntries. - *

      - * - * @return the list of entries for the project. - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - ICPathEntry[] getRawCPathEntries() throws CModelException; - - /** - * Sets the entries for this project. - * - * @param entries a list of ICPathEntry[] entries - * @param monitor the given progress monitor - * @exception CModelException if the entries could not be set. Reasons include: - *

        - *
      • This C/C++ element does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • The entries are being modified during resource change event notification (CORE_EXCEPTION) - *
      - */ - void setRawCPathEntries(ICPathEntry[] entries, IProgressMonitor monitor) throws CModelException; - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IContainerEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IContainerEntry.java deleted file mode 100644 index 08d88fd0da8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IContainerEntry.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - -public interface IContainerEntry extends ICPathEntry { - - /** - * Returns the id identifying this container. - * @return String - */ - String getId(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IDeclaration.java deleted file mode 100644 index 2acb4ace4f2..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IDeclaration.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.cdt.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -public interface IDeclaration extends ICElement, ISourceManipulation, ISourceReference { - boolean isStatic(); - boolean isConst(); - boolean isVolatile(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IElementChangedListener.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IElementChangedListener.java deleted file mode 100644 index ae43d79e3d9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IElementChangedListener.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.cdt.core.model; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * An element changed listener receives notification of changes to C elements - * maintained by the C model. - */ -public interface IElementChangedListener { - - /** - * Notifies that one or more attributes of one or more C elements have changed. - * The specific details of the change are described by the given event. - * - * @param event the change event - */ - public void elementChanged(ElementChangedEvent event); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumeration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumeration.java deleted file mode 100644 index 595a0604ffb..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumeration.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * An Enumeration type. - */ -public interface IEnumeration extends IVariable, IParent { -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumerator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumerator.java deleted file mode 100644 index a9a08a5ac54..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IEnumerator.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.cdt.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ -public interface IEnumerator extends ICElement, ISourceManipulation{ - - /** - * Returns the enumerator constant expression if any. - * Returns null otherwise. - * @return String - */ - String getConstantExpression(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IField.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IField.java deleted file mode 100644 index b44451e71db..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IField.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a field(variable) declared in an IStructure(struct, class, union). - */ -public interface IField extends IMember, IVariableDeclaration { - - /** - * Returns whether this storage specifier is mutable for the member. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - public boolean isMutable(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunction.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunction.java deleted file mode 100644 index bd1717f0c0a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunction.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents a function. - */ -public interface IFunction extends IFunctionDeclaration { - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunctionDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunctionDeclaration.java deleted file mode 100644 index 3c92553b850..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IFunctionDeclaration.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents a function - */ -public interface IFunctionDeclaration extends IDeclaration { - - /** - * Returns the type signatures of the exceptions this method throws, - * in the order declared in the source. Returns an empty array - * if this method throws no exceptions. - * - *

      For example, a source method declaring "void f(int a) throw (x1, x2);", - * would return the array {"x1", "x2"}. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * - * @see Signature - */ - String[] getExceptions(); - - /** - * Returns the number of parameters of this method. - */ - int getNumberOfParameters(); - - /** - * Returns the initializer of parameters position for this method. - * Returns an empty string if this argument has no initializer. - * - *

      For example, a method declared as public void foo(String text, int length=9) - * would return the array {"9"}. - * - * @exception CModelException if this argument does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - String getParameterInitializer(int pos); - - /** - * Returns the type signatures for the parameters of this method. - * Returns an empty array if this method has no parameters. - * This is a handle-only method. - * - *

      For example, a source method declared as void foo(string text, int length) - * would return the array {"string","int"}. - * - * @see Signature - */ - String[] getParameterTypes(); - - /** - * Returns the return value of this method. - */ - String getReturnType(); - - /** - * Returns the signature of the method. - */ - String getSignature(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInclude.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInclude.java deleted file mode 100644 index 5a89f70217f..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInclude.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.cdt.core.model; -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents an include declaration in a C translation unit. - */ -public interface IInclude extends ICElement, ISourceReference, ISourceManipulation { - /** - * Returns the name that of the included file. - * For example, for the statement "#include , - * this returns "stdio.h". - */ - String getIncludeName(); - - /** - * Returns whether the included was search on "standard places" like /usr/include first . - * An include is standard if it starts with "\<". - * For example, "#include \" returns true and - * "#include "foobar.h" returns false. - */ - boolean isStandard(); - - public String getFullFileName(); - - public boolean isLocal(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IIncludeEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IIncludeEntry.java deleted file mode 100644 index 029bc6a0b51..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IIncludeEntry.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - -import org.eclipse.core.runtime.IPath; - -public interface IIncludeEntry extends ICPathEntry { - - /** - * Returns the affected resource by the include. - * @return IPath - */ - IPath getResourcePath(); - - /** - * Returns the include path - * @return IPath - */ - IPath getIncludePath(); - - /** - * Whether or not it a system include path - * @return boolean - */ - boolean isSystemInclude(); - - /** - * Whether or not the include affects the resource(if it is a folder) - * recursively - * @return boolean - */ - boolean isRecursive(); - - /** - * If isRecursive() is true, specify an exclude file patterns. - * @return IPath - */ - IPath[] getExclusionPatterns(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInheritance.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInheritance.java deleted file mode 100644 index a6caa028d82..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IInheritance.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.core.model; - -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Place holder of the inherited class from struct or class(IStructure). - */ -public interface IInheritance { - /** - * Return the inherited structures names. - */ - public String[] getSuperClassesNames(); - /** - * Returns the super class access : ASTAccessVisibility - */ - public ASTAccessVisibility getSuperClassAccess(String name); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryEntry.java deleted file mode 100644 index 70fd16522e9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryEntry.java +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - -import org.eclipse.core.runtime.IPath; - -public interface ILibraryEntry extends ICPathEntry { - - /** - * Returns the absolute path of the library - * @return String - */ - IPath getLibraryPath(); - - /** - * Returns the path to the source archive or folder associated with this - * C path entry, or null if this C path entry has no - * source attachment. - *

      - * Only library and variable C path entries may have source attachments. - * For library C path entries, the result path (if present) locates a source - * archive or folder. This archive or folder can be located in a project of the - * workspace or outside thr workspace. For variable c path entries, the - * result path (if present) has an analogous form and meaning as the - * variable path, namely the first segment is the name of a c path variable. - *

      - * - * @return the path to the source archive or folder, or null if none - */ - IPath getSourceAttachmentPath(); - - /** - * Returns the path within the source archive or folder where source - * are located. An empty path indicates that packages are located at - * the root of the source archive or folder. Returns a non-null value - * if and only if getSourceAttachmentPath returns - * a non-null value. - * - * @return the path within the source archive or folder, or null if - * not applicable - */ - IPath getSourceAttachmentRootPath(); - - /** - * Returns the path to map the source paths with to the source achive or folder - * An empty path indicates that the is a one-to-one mapping of source paths to the - * source achive or folder path. Returns a non-null value - * if and only if getSourceAttachmentPath returns - * a non-null value. - * - * @return the path mapping within the source archive or folder, or null if - * not applicable - */ - IPath getSourceAttachmentPrefixMapping(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryReference.java deleted file mode 100644 index 43c12887f82..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ILibraryReference.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - */ -public interface ILibraryReference extends IParent, ICElement { -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacro.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacro.java deleted file mode 100644 index 6c6445347ee..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacro.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a field declared in a type. - */ -public interface IMacro extends ICElement, ISourceManipulation, ISourceReference { - String getIdentifierList(); - String getTokenSequence(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacroEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacroEntry.java deleted file mode 100644 index 09fe86024da..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMacroEntry.java +++ /dev/null @@ -1,51 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - -import org.eclipse.core.runtime.IPath; - -public interface IMacroEntry extends ICPathEntry { - - /** - * Returns the absolute path from the worskspace root or - * relative path of the affected resource. - * @return String - */ - IPath getResourcePath(); - - /** - * Returns the macro name. - * @return String - */ - String getMacroName(); - - /** - * Returns the macro value. - * @return String - */ - String getMacroValue(); - - /** - * Whether or not the macro is applied recursively. - * @return boolean - */ - boolean isRecursive(); - - /** - * Returns an array of inclusion paths affecting the - * resource when looking for files recursively. - * @return IPath - */ - IPath[] getExclusionPatterns(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMember.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMember.java deleted file mode 100644 index d5aa4477ec0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMember.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.cdt.core.model; - -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Common protocol for C elements that can be members of types. - * This set consists of IType, IMethod, - * IField. - */ -public interface IMember extends IDeclaration { - - /** - * Returns the member's visibility - * V_PRIVATE = 0 V_PROTECTED = 1 V_PUBLIC = 2 - * @return int - */ - public ASTAccessVisibility getVisibility(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethod.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethod.java deleted file mode 100644 index 61d18a9a2d1..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethod.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents the definition method of a class. - */ -public interface IMethod extends IMethodDeclaration { - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java deleted file mode 100644 index 35eb830805d..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represents the declaration method of a class - */ -public interface IMethodDeclaration extends IMember, IFunctionDeclaration { - - /** - * Returns whether this method is a constructor. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - boolean isConstructor(); - - /** - * Returns whether this method is a destructor. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - boolean isDestructor(); - - /** - * Returns whether this method is an operator method. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - boolean isOperator(); - - /** - * Returns whether this method is declared pure virtual. - * - *

      For example, a source method declared as virtual void m() = 0;. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - boolean isPureVirtual(); - - /** - * Returns if this method is static or not - * @return boolean - */ - public boolean isStatic(); - - /** - * Returns if this method is inline or not - * @return boolean - */ - public boolean isInline(); - - /** - * Returns whether this method is declared virtual. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - */ - boolean isVirtual(); - - /** - * return true if the member is a friend. - */ - public boolean isFriend(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java deleted file mode 100644 index 2bb81c39ee7..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.cdt.core.model; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a package declaration in a C translation unit. - */ -public interface INamespace extends ICElement, IParent, ISourceManipulation, ISourceReference { - - String getTypeName(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IOpenable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IOpenable.java deleted file mode 100644 index f640b79a653..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IOpenable.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.cdt.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * An openable is an element that can be opened, saved, and closed. - * An openable might or might not have an associated buffer. - */ -public interface IOpenable extends IBufferChangedListener{ - /** - * Closes this element and its buffer (if any). - */ - public void close() throws CModelException; - /** - * Returns the buffer opened for this element, or null - * if this element does not have a buffer. - */ - public IBuffer getBuffer() throws CModelException; - /** - * returns true if the associated buffer has some unsaved changes - */ - boolean hasUnsavedChanges() throws CModelException; - /** - * Returns whether the element is consistent with its underlying resource or buffer. - * The element is consistent when opened, and is consistent if the underlying resource - * or buffer has not been modified since it was last consistent. - */ - boolean isConsistent() throws CModelException; - - /** - * Returns whether this CFile is open. - */ - boolean isOpen(); - - /** - * Makes this element consistent with its underlying resource or buffer - * by updating the element's structure and properties as necessary. - */ - void makeConsistent(IProgressMonitor progress) throws CModelException; - void makeConsistent(IProgressMonitor progress, boolean forced) throws CModelException; - - /** - * Opens this element and all parent elements that are not already open. - * For translation units, a buffer is opened on the contents of the - * underlying resource. - */ - public void open(IProgressMonitor progress) throws CModelException; - - /** - * Saves any changes in this element's buffer to its underlying resource - * via a workspace resource operation. - *

      - * The force parameter controls how this method deals with - * cases where the workbench is not completely in sync with the local file system. - */ - public void save(IProgressMonitor progress, boolean force) throws CModelException; - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java deleted file mode 100644 index c375b4e7f2e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IParent.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.cdt.core.model; - -import java.util.ArrayList; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Common protocol for C elements that contain other C elements. - */ -public interface IParent { - - /** - * Returns the immediate children of this element. - * The children are in no particular order. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - ICElement[] getChildren(); - - /** - * returns the children of a certain type - */ - public ArrayList getChildrenOfType(int type); - /** - * Returns whether this element has one or more immediate children. - * This is a convenience method, and may be more efficient than - * testing whether getChildren is an empty array. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - boolean hasChildren(); - - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IProjectEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IProjectEntry.java deleted file mode 100644 index 8f71cc8460b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IProjectEntry.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - -import org.eclipse.core.runtime.IPath; - - -public interface IProjectEntry extends ICPathEntry { - - /** - * Returns the absolute path relative to the workspace root. - * @return IPath - */ - IPath getProjectPath(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceEntry.java deleted file mode 100644 index 8c8ba72a824..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceEntry.java +++ /dev/null @@ -1,46 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.model; - -import org.eclipse.core.runtime.IPath; - -public interface ISourceEntry extends ICPathEntry { - - /** - * Returns the absolute path from the worskspace root or - * relative path of the source folder. - * @return String - */ - IPath getSourcePath(); - - /** - * Whether or not to look recursively in the folder. - * @return boolean - */ - boolean isRecursive(); - - /** - * Returns an array of inclusion paths affecting the - * source folder when looking for files recursively. - * @return IPath - */ - IPath[] getExclusionPatterns(); - - /** - * Binary output location for this source folder. - * @return IPath, null means to use the - * default output location of the project. - */ - IPath getOutputLocation(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceManipulation.java deleted file mode 100644 index 2cf3f0b2870..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceManipulation.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Common protocol for C elements that support source code manipulations such - * as copy, move, rename, and delete. - */ -public interface ISourceManipulation { - /** - * Copies this element to the given container. - * - * @param container the container - * @param sibling the sibling element before which the copy should be inserted, - * or null if the copy should be inserted as the last child of - * the container - * @param rename the new name for the element, or null if the copy - * retains the name of this element - * @param replace true if any existing child in the container with - * the target name should be replaced, and false to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception CModelException if this element could not be copied. Reasons include: - *

        - *
      • This C element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • A CoreException occurred while updating an underlying resource - *
      • The container is of an incompatible type (INVALID_DESTINATION) - *
      • The sibling is not a child of the given container (INVALID_SIBLING) - *
      • The new name is invalid (INVALID_NAME) - *
      • A child in the container already exists with the same name (NAME_COLLISION) - * and replace has been specified as false - *
      • The container or this element is read-only (READ_ONLY) - *
      - * - * @exception IllegalArgumentException if container is null - */ - void copy(ICElement container, ICElement sibling, String rename, boolean replace, IProgressMonitor monitor) throws CModelException; - - /** - * Deletes this element, forcing if specified and necessary. - * - * @param force a flag controlling whether underlying resources that are not - * in sync with the local file system will be tolerated (same as the force flag - * in IResource operations). - * @param monitor a progress monitor - * @exception CModelException if this element could not be deleted. Reasons include: - *
        - *
      • This C element does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • A CoreException occurred while updating an underlying resource (CORE_EXCEPTION)
      • - *
      • This element is read-only (READ_ONLY)
      • - *
      - */ - void delete(boolean force, IProgressMonitor monitor) throws CModelException; - - /** - * Moves this element to the given container. - * - * @param container the container - * @param sibling the sibling element before which the element should be inserted, - * or null if the element should be inserted as the last child of - * the container - * @param rename the new name for the element, or null if the - * element retains its name - * @param replace true if any existing child in the container with - * the target name should be replaced, and false to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception CModelException if this element could not be moved. Reasons include: - *
        - *
      • This C element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • A CoreException occurred while updating an underlying resource - *
      • The container is of an incompatible type (INVALID_DESTINATION) - *
      • The sibling is not a child of the given container (INVALID_SIBLING) - *
      • The new name is invalid (INVALID_NAME) - *
      • A child in the container already exists with the same name (NAME_COLLISION) - * and replace has been specified as false - *
      • The container or this element is read-only (READ_ONLY) - *
      - * - * @exception IllegalArgumentException if container is null - */ - - void move(ICElement container, ICElement sibling, String rename, boolean replace, IProgressMonitor monitor) throws CModelException; - - /** - * Renames this element to the given name. - * - * @param name the new name for the element - * @param replace true if any existing element with the target name - * should be replaced, and false to throw an exception in the - * event of a name collision - * @param monitor a progress monitor - * @exception CModelException if this element could not be renamed. Reasons include: - *
        - *
      • This C element does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • A CoreException occurred while updating an underlying resource - *
      • The new name is invalid (INVALID_NAME) - *
      • A child in the container already exists with the same name (NAME_COLLISION) - * and replace has been specified as false - *
      • This element is read-only (READ_ONLY) - *
      - */ - void rename(String name, boolean replace, IProgressMonitor monitor) throws CModelException; -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceRange.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceRange.java deleted file mode 100644 index d5d2d752f0a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceRange.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * A source range defines an element's source coordinates - */ -public interface ISourceRange { - - /** - * Returns the 0-based starting position of this element. - */ - public int getStartPos(); - - /** - * Returns the number of characters of the source code for this element. - */ - public int getLength(); - - /** - * Returns the Id starting position of this element. - */ - public int getIdStartPos(); - - /** - * Returns the number of characters of the Id for this element. - */ - public int getIdLength(); - - /** - * Returns the 1-based starting line of this element. - */ - public int getStartLine(); - - /** - * Returns the 1-based ending line of this element. - */ - public int getEndLine(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java deleted file mode 100644 index daa5f1f21ee..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ISourceReference.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.eclipse.cdt.core.model; -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Common protocol for C elements that have associated source code. - *

      - * Note: For IBinary, IArchive and other members - * derived from a binary type, the implementation returns source iff the - * element has attached source code and debuging information. - * - */ - -public interface ISourceReference { - - /** - * Returns the source code associated with this element. - *

      - * For binary files, this returns the source of the entire translation unit - * associated with the binary file (if there is one). - *

      - * - * @return the source code, or null if this element has no - * associated source code - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - String getSource() throws CModelException; - - /** - * Returns the source range associated with this element. - *

      - * For binary files, this returns the range of the entire translation unit - * associated with the binary file (if there is one). - *

      - * - * @return the source range, or null if if this element has no - * associated source code - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - ISourceRange getSourceRange() throws CModelException; - - /** - * Returns the translation unit in which this member is declared, or null - * if this member is not declared in a translation unit (for example, a binary type). - */ - ITranslationUnit getTranslationUnit(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IStructure.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IStructure.java deleted file mode 100644 index e66fd371bbc..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IStructure.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.core.model; - - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -/** - * Represent struct(ure), class or union. - */ -public interface IStructure extends IInheritance, IParent, IVariableDeclaration { - public IField getField(String name); - public IField[] getFields(); - - public IMethodDeclaration getMethod(String name); - public IMethodDeclaration [] getMethods(); - - public boolean isUnion(); - - public boolean isClass(); - - public boolean isStruct(); - - public boolean isAbstract(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITemplate.java deleted file mode 100644 index a288c9b13ec..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITemplate.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.cdt.core.model; -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -public interface ITemplate extends IDeclaration { - /** - * Returns the template parameter types. - * @return String - */ - String[] getTemplateParameterTypes(); - /** - * Sets the template parameter types. - * @param paramTypes - */ - void setTemplateParameterTypes(String[] templateParameterTypes); - /** - * Returns the template signature - * @return String - */ - String getTemplateSignature(); - /** - * Returns the number of template parameters - * @return int - */ - int getNumberOfTemplateParameters(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITranslationUnit.java deleted file mode 100644 index 16fbe0247c0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITranslationUnit.java +++ /dev/null @@ -1,214 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.util.Map; - -import org.eclipse.cdt.internal.core.model.IBufferFactory; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.core.runtime.IProgressMonitor; -/** - * Represents an entire C translation unit (.c source file). - * The children are of type IStructureElement, - * IInclude, etc.. - * and appear in the order in which they are declared in the source. - * If a .c file cannot be parsed, its structure remains unknown. - * Use ICElement.isStructureKnown to determine whether this is - * the case. - */ -public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISourceReference, ISourceManipulation { - /** - * Creates and returns an include declaration in this translation unit - * with the given name. - *

      - * Optionally, the new element can be positioned before the specified - * sibling. If no sibling is specified, the element will be inserted - * as the last import declaration in this translation unit. - *

      - * If the translation unit already includes the specified include declaration, - * the import is not generated (it does not generate duplicates). - * - * @param name the name of the include declaration to add (For example: "stdio.h" or - * "sys/types.h") - * @param sibling the existing element which the include declaration will be inserted immediately before (if - * null , then this include will be inserted as the last include declaration. - * @param monitor the progress monitor to notify - * @return the newly inserted include declaration (or the previously existing one in case attempting to create a duplicate) - * - * @exception CModelException if the element could not be created. Reasons include: - *

        - *
      • This C element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • A CoreException occurred while updating an underlying resource - *
      • The specified sibling is not a child of this translation unit (INVALID_SIBLING) - *
      • The name is not a valid import name (INVALID_NAME) - *
      - */ - IInclude createInclude(String name, ICElement sibling, IProgressMonitor monitor) throws CModelException; - - /** - * Creates and returns a namesapce declaration in this translation unit - * with the given package name. - * - *

      If the translation unit already includes the specified package declaration, - * it is not generated (it does not generate duplicates). - * - * @param name the name of the namespace declaration to add (For example, "std") - * @param monitor the progress monitor to notify - * @return the newly inserted namespace declaration (or the previously existing one in case attempting to create a duplicate) - * - * @exception CModelException if the element could not be created. Reasons include: - *

        - *
      • This C element does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      • A CoreException occurred while updating an underlying resource - *
      • The name is not a valid package name (INVALID_NAME) - *
      - */ - IUsing createUsing (String name, IProgressMonitor monitor) throws CModelException; - - /** - * Finds the shared working copy for this element, given a IBuffer factory. - * If no working copy has been created for this element associated with this - * buffer factory, returns null. - *

      - * Users of this method must not destroy the resulting working copy. - * - * @param bufferFactory the given IBuffer factory - * @return the found shared working copy for this element, null if none - * @see IBufferFactory - * @since 2.0 - */ - IWorkingCopy findSharedWorkingCopy(IBufferFactory bufferFactory); - - /** - * Returns the contents of a translation unit as a char[] - * @return char[] - */ - char[] getContents(); - - /** - * Returns the smallest element within this translation unit that - * includes the given source position (that is, a method, field, etc.), or - * null if there is no element other than the translation - * unit itself at the given position, or if the given position is not - * within the source range of this translation unit. - * - * @param position a source position inside the translation unit - * @return the innermost C element enclosing a given source position or null - * if none (excluding the translation unit). - * @exception CModelException if the translation unit does not exist or if an - * exception occurs while accessing its corresponding resource - */ - ICElement getElementAtLine(int line) throws CModelException; - - ICElement getElement(String name) throws CModelException; - - /** - * Returns the include declaration in this translation unit with the given name. - * - * @param the name of the include to find (For example: "stdio.h" - * or "sys/types.h") - * @return a handle onto the corresponding include declaration. The include declaration may or may not exist. - */ - IInclude getInclude(String name) ; - - /** - * Returns the include declarations in this translation unit - * in the order in which they appear in the source. - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - IInclude[] getIncludes() throws CModelException; - - /** - * Returns a shared working copy on this element using the given factory to create - * the buffer, or this element if this element is already a working copy. - * This API can only answer an already existing working copy if it is based on the same - * original translation unit AND was using the same buffer factory (i.e. as - * defined by Object#equals). - *

      - * The life time of a shared working copy is as follows: - *

        - *
      • The first call to getSharedWorkingCopy(...) creates a new working copy for this - * element
      • - *
      • Subsequent calls increment an internal counter.
      • - *
      • A call to destroy() decrements the internal counter.
      • - *
      • When this counter is 0, the working copy is destroyed. - *
      - * So users of this method must destroy exactly once the working copy. - *

      - * Note that the buffer factory will be used for the life time of this working copy, i.e. if the - * working copy is closed then reopened, this factory will be used. - * The buffer will be automatically initialized with the original's compilation unit content - * upon creation. - *

      - * When the shared working copy instance is created, an ADDED ICElementDelta is reported on this - * working copy. - * - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or null if no progress should be reported - * @param factory the factory that creates a buffer that is used to get the content of the working copy - * or null if the internal factory should be used - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to null indicating - * that the client is not interested in problems. - * @exception CModelException if the contents of this element can not be - * determined. Reasons include: - *

        - *
      • This C element does not exist (ELEMENT_DOES_NOT_EXIST)
      • - *
      - * @return a shared working copy on this element using the given factory to create - * the buffer, or this element if this element is already a working copy - * @see IBufferFactory - * @see IProblemRequestor - * @since 2.0 - */ - - IWorkingCopy getSharedWorkingCopy( - IProgressMonitor monitor, - IBufferFactory factory) - throws CModelException; - - /** - * Returns the first namespace declaration in this translation unit with the given package name - * This is a handle-only method. The namespace declaration may or may not exist. - * - * @param name the name of the namespace declaration (For example, "std") - */ - IUsing getUsing(String name); - - /** - * Returns the namespace declarations in this translation unit - * in the order in which they appear in the source. - * - * @return an array of namespace declaration (normally of size one) - * - * @exception CModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - */ - IUsing[] getUsings() throws CModelException; - /** - * Returns a new working copy for the Translation Unit. - * @return IWorkingCopy - */ - IWorkingCopy getWorkingCopy() throws CModelException; - - /** - * Returns a new working copy for the Translation Unit. - * @return IWorkingCopy - */ - IWorkingCopy getWorkingCopy(IProgressMonitor monitor, IBufferFactory factory) throws CModelException; - - /** - * Checks if this is a working copy. - * @return boolean - */ - boolean isWorkingCopy(); - /** - * parse() - * returns a map of all new elements and their element info - */ - Map parse(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java deleted file mode 100644 index 649f0b7ace2..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a field declared in a type. - */ -public interface ITypeDef extends ICElement, ISourceManipulation, ISourceReference { - /** - * Returns the type of the typedef item - * @return String - */ - String getTypeName(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java deleted file mode 100644 index 2002f55a0e0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.cdt.core.model; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a "using" declaration in C translation unit. - */ -public interface IUsing extends ICElement, ISourceManipulation, ISourceReference { - /** - * Returns the name of the package the statement refers to. - * This is a handle-only method. - */ - String getElementName(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariable.java deleted file mode 100644 index 3c8452dd010..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariable.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents a global variable. - */ -public interface IVariable extends IVariableDeclaration { - public String getInitializer(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariableDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariableDeclaration.java deleted file mode 100644 index 664327a2fcf..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IVariableDeclaration.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.cdt.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Represents the declaration of a variable. - */ -public interface IVariableDeclaration extends IDeclaration { - public String getTypeName(); - public void setTypeName(String type); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ACPathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ACPathEntry.java deleted file mode 100644 index dffe125b56b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ACPathEntry.java +++ /dev/null @@ -1,74 +0,0 @@ -/********************************************************************** - * Created on 25-Mar-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.core.runtime.IPath; - -public abstract class ACPathEntry extends CPathEntry { - - public static IPath[] NO_EXCLUSION_PATTERNS = {}; - IPath[] exclusionPatterns; - boolean isRecursive; - - public ACPathEntry (int kind, boolean isRecursive, IPath[] exclusionPatterns, boolean isExported) { - super(kind, isExported); - this.exclusionPatterns = exclusionPatterns; - this.isRecursive = isRecursive; - } - - /** - * Returns the exclusion patterns - * @return IPath[] - */ - public IPath[] getExclusionPatterns() { - return exclusionPatterns; - } - - /** - * Whether or not it is recursive - * @return boolean - */ - public boolean isRecursive() { - return isRecursive; - } - - public boolean equals(Object obj) { - if (obj instanceof ACPathEntry) { - ACPathEntry otherEntry = (ACPathEntry)obj; - if (!super.equals(otherEntry)) { - return false; - } - if (isRecursive != otherEntry.isRecursive()) { - return false; - } - IPath[] otherExcludes = otherEntry.getExclusionPatterns(); - if (exclusionPatterns != otherExcludes) { - int excludeLength = (exclusionPatterns == null) ? 0 : exclusionPatterns.length; - if (otherExcludes.length != excludeLength) { - return false; - } - for (int i = 0; i < excludeLength; i++) { - // compare toStrings instead of IPaths - // since IPath.equals is specified to ignore trailing separators - String myPattern = exclusionPatterns[i].toString(); - if (!myPattern.equals(otherExcludes[i].toString())) { - return false; - } - } - } - return true; - } - return super.equals(obj); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java deleted file mode 100644 index 9a745ae998b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.util.Map; - -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public class Archive extends Openable implements IArchive { - - public Archive(ICElement parent, IFile file) { - this(parent, file.getLocation()); - } - - public Archive(ICElement parent, IPath path) { - super (parent, path, ICElement.C_ARCHIVE); - } - - public IBinary[] getBinaries() { - ICElement[] e = getChildren(); - IBinary[] b = new IBinary[e.length]; - System.arraycopy(e, 0, b, 0, e.length); - return b; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - public CElementInfo createElementInfo() { - return new ArchiveInfo(this); - } - - protected ArchiveInfo getArchiveInfo() { - return (ArchiveInfo)getElementInfo(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource) - */ - protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) - throws CModelException { - CModelManager.getDefault().putInfo(this, info); - return computeChildren(info, underlyingResource); - } - - - public boolean computeChildren(OpenableInfo info, IResource res) { - IBinaryArchive ar = getBinaryArchive(res); - if (ar != null) { - IBinaryObject[] objects = ar.getObjects(); - for (int i = 0; i < objects.length; i++) { - final IBinaryObject obj = objects[i]; - Binary binary = new Binary(this, ar.getPath().append(obj.getName()), obj); - info.addChild(binary); - } - } else { - return false; - } - return true; - } - - IBinaryArchive getBinaryArchive(IResource res) { - IBinaryArchive archive = null; - IProject project = null; - IBinaryParser parser = null; - if (res != null) { - project = res.getProject(); - } - if (project != null) { - parser = CModelManager.getDefault().getBinaryParser(project); - } - if (parser != null) { - try { - IPath path = res.getLocation(); - IBinaryFile bfile = parser.getBinary(path); - if (bfile instanceof IBinaryArchive) { - archive = (IBinaryArchive) bfile; - } - } catch (IOException e) { - } - } - return archive; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java deleted file mode 100644 index 6b5fcfdcb39..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Map; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; - -public class ArchiveContainer extends Openable implements IArchiveContainer { - - public ArchiveContainer (CProject cProject) { - super (cProject, null, "Archives", CElement.C_VCONTAINER); - } - - public IArchive[] getArchives() { - ((ArchiveContainerInfo)getElementInfo()).sync(); - ICElement[] e = getChildren(); - IArchive[] a = new IArchive[e.length]; - System.arraycopy(e, 0, a, 0, e.length); - return a; - } - - public CElementInfo createElementInfo() { - return new ArchiveContainerInfo(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource) - */ - protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) - throws CModelException { - // this will bootstrap/start the runner for the project. - CModelManager.getDefault().getBinaryRunner(getCProject()); - return true; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java deleted file mode 100644 index 22900b75445..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainerInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - */ -public class ArchiveContainerInfo extends OpenableInfo { - - /** - * Constructs a new C Model Info - */ - protected ArchiveContainerInfo(CElement element) { - super(element); - } - - synchronized void sync() { - BinaryRunner runner = CModelManager.getDefault().getBinaryRunner(getElement().getCProject()); - if (runner != null) { - runner.waitIfRunning(); - } - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java deleted file mode 100644 index 415dff5e3d5..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveInfo.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -/** - * Info for ICProject. - */ - -class ArchiveInfo extends OpenableInfo { - - /** - */ - public ArchiveInfo(CElement element) { - super(element); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BatchOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BatchOperation.java deleted file mode 100644 index dcc13bb615e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BatchOperation.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.CModelException; - -/** - * An operation created as a result of a call to JavaCore.run(IWorkspaceRunnable, IProgressMonitor) - * that encapsulates a user defined IWorkspaceRunnable. - */ -public class BatchOperation extends CModelOperation { - protected IWorkspaceRunnable runnable; - public BatchOperation(IWorkspaceRunnable runnable) { - this.runnable = runnable; - } - - /* (non-Javadoc) - * @see org.eclipse.jdt.internal.core.JavaModelOperation#executeOperation() - */ - protected void executeOperation() throws CModelException { - try { - this.runnable.run(fMonitor); - } catch (CoreException ce) { - if (ce instanceof CModelException) { - throw (CModelException)ce; - } else { - if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) { - Throwable e= ce.getStatus().getException(); - if (e instanceof CModelException) { - throw (CModelException) e; - } - } - throw new CModelException(ce); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.jdt.internal.core.JavaModelOperation#verify() - */ - protected ICModelStatus verify() { - // cannot verify user defined operation - return CModelStatus.VERIFIED_OK; - } - - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java deleted file mode 100644 index 99fb459c34e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java +++ /dev/null @@ -1,274 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.core.IBinaryParser.IBinaryShared; -import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public class Binary extends Openable implements IBinary { - - private int fBinType; - private String hasDebug; - private String cpu; - private String[] needed; - private long longData; - private long longText; - private long longBSS; - private String endian; - private String soname; - - private long fLastModification; - - IBinaryFile binaryFile; - - public Binary(ICElement parent, IFile file, IBinaryFile bin) { - super(parent, file, ICElement.C_BINARY); - binaryFile = bin; - } - - public Binary(ICElement parent, IPath path, IBinaryFile bin) { - super (parent, path, ICElement.C_BINARY); - binaryFile = bin; - } - - public boolean isSharedLib() { - return getType() == IBinaryObject.SHARED; - } - - public boolean isExecutable() { - return getType() == IBinaryObject.EXECUTABLE; - } - - public boolean isObject() { - return getType() == IBinaryObject.OBJECT; - } - - public boolean isCore() { - return getType() == IBinaryObject.CORE; - } - - public boolean hasDebug() { - if (isObject() || isExecutable() || isSharedLib()) { - if (hasDebug == null || hasChanged()) { - hasDebug = new Boolean(((IBinaryObject)getBinaryFile()).hasDebug()).toString(); - } - } - return Boolean.valueOf(hasDebug).booleanValue(); - } - - public String getCPU() { - if (isObject() || isExecutable() || isSharedLib() || isCore()) { - if (cpu == null || hasChanged()) { - cpu = ((IBinaryObject)getBinaryFile()).getCPU(); - } - } - return (cpu == null ? "" : cpu); - } - - public String[] getNeededSharedLibs() { - if (isExecutable() || isSharedLib()) { - if (needed == null || hasChanged()) { - needed = ((IBinaryExecutable)getBinaryFile()).getNeededSharedLibs(); - } - } - return (needed == null ? new String[0] : needed); - } - - public long getText() { - if (isObject() || isExecutable() || isSharedLib()) { - if (longText == -1 || hasChanged()) { - longText = ((IBinaryObject)getBinaryFile()).getText(); - } - } - return longText; - } - - public long getData() { - if (isObject() || isExecutable() || isSharedLib()) { - if (longData == -1 || hasChanged()) { - longData = ((IBinaryObject)getBinaryFile()).getData(); - } - } - return longData; - } - - public long getBSS() { - if (isObject() || isExecutable() || isSharedLib()) { - if (longBSS == -1 || hasChanged()) { - longBSS = ((IBinaryObject)getBinaryFile()).getBSS(); - } - } - return longBSS; - } - - public String getSoname() { - if (isSharedLib()) { - if (soname == null || hasChanged()) { - soname = ((IBinaryShared)getBinaryFile()).getSoName(); - } - } - return (soname == null ? "" : soname); - } - - public boolean isLittleEndian() { - if (isObject() || isExecutable() || isSharedLib() || isCore()) { - if (endian == null || hasChanged()) { - endian = new Boolean(((IBinaryObject)getBinaryFile()).isLittleEndian()).toString(); - } - } - return Boolean.valueOf(endian).booleanValue(); - } - - protected IBinaryFile getBinaryFile() { - return binaryFile; - } - - protected int getType() { - if (getBinaryFile() != null && (fBinType == 0 || hasChanged())) { - fBinType = getBinaryFile().getType(); - } - return fBinType; - } - - protected boolean hasChanged() { - long modification = getModificationStamp(); - boolean changed = modification != fLastModification; - fLastModification = modification; - if (changed) { - hasDebug = null; - needed = null; - cpu = null; - endian = null; - longBSS = -1; - longData = -1; - longText = -1; - soname = null; - } - return changed; - } - - protected long getModificationStamp() { - IResource res = getResource(); - if (res != null) { - return res.getModificationStamp(); - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - public CElementInfo createElementInfo() { - return new BinaryInfo(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource) - */ - protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) - throws CModelException { - CModelManager.getDefault().putInfo(this, info); - return computeChildren(info, underlyingResource); - } - - - boolean computeChildren(OpenableInfo info, IResource res) { - if (isObject() || isExecutable() || isSharedLib()) { - Map hash = new HashMap(); - ISymbol[] symbols = ((IBinaryObject)getBinaryFile()).getSymbols(); - for (int i = 0; i < symbols.length; i++) { - switch (symbols[i].getType()) { - case ISymbol.FUNCTION : - addFunction(info, symbols[i], hash); - break; - - case ISymbol.VARIABLE : - addVariable(info, symbols[i], hash); - break; - } - } - } else { - return false; - } - return true; - } - - private void addFunction(OpenableInfo info, ISymbol symbol, Map hash) { - IPath filename = filename = symbol.getFilename(); - BinaryFunction function = null; - - if (filename != null) { - BinaryModule module = null; - if (hash.containsKey(filename)) { - module = (BinaryModule)hash.get(filename); - } else { - // A special container we do not want the file to be parse. - module = new BinaryModule(this, filename); - hash.put(filename, module); - info.addChild(module); - } - function = new BinaryFunction(module, symbol.getName(), symbol.getAddress()); - function.setLines(symbol.getStartLine(), symbol.getEndLine()); - module.addChild(function); - } else { - //function = new Function(parent, symbol.getName()); - function = new BinaryFunction(this, symbol.getName(), symbol.getAddress()); - function.setLines(symbol.getStartLine(), symbol.getEndLine()); - info.addChild(function); - } - // if (function != null) { - // if (!external) { - // function.getFunctionInfo().setAccessControl(IConstants.AccStatic); - // } - // } - } - - private void addVariable(OpenableInfo info, ISymbol symbol, Map hash) { - IPath filename = filename = symbol.getFilename(); - BinaryVariable variable = null; - if (filename != null) { - BinaryModule module = null; - if (hash.containsKey(filename)) { - module = (BinaryModule)hash.get(filename); - } else { - module = new BinaryModule(this, filename); - hash.put(filename, module); - info.addChild(module); - } - variable = new BinaryVariable(module, symbol.getName(), symbol.getAddress()); - variable.setLines(symbol.getStartLine(), symbol.getEndLine()); - module.addChild(variable); - } else { - variable = new BinaryVariable(this, symbol.getName(), symbol.getAddress()); - variable.setLines(symbol.getStartLine(), symbol.getEndLine()); - info.addChild(variable); - } - - //if (variable != null) { - // if (!external) { - // variable.getVariableInfo().setAccessControl(IConstants.AccStatic); - // } - //} - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java deleted file mode 100644 index 6e446365fb8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Map; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; - -public class BinaryContainer extends Openable implements IBinaryContainer { - - public BinaryContainer (CProject cProject) { - super (cProject, null, "Binaries", CElement.C_VCONTAINER); - } - - public IBinary[] getBinaries() { - ((BinaryContainerInfo)getElementInfo()).sync(); - ICElement[] e = getChildren(); - IBinary[] b = new IBinary[e.length]; - System.arraycopy(e, 0, b, 0, e.length); - return b; - } - - public CElementInfo createElementInfo() { - return new BinaryContainerInfo(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource) - */ - protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) - throws CModelException { - // this will bootstrap/start the runner for the project. - CModelManager.getDefault().getBinaryRunner(getCProject()); - return true; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java deleted file mode 100644 index 0edc1ae852e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainerInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - */ -public class BinaryContainerInfo extends OpenableInfo { - - /** - * Constructs a new C Model Info - */ - protected BinaryContainerInfo(CElement element) { - super(element); - } - - synchronized void sync() { - BinaryRunner runner = CModelManager.getDefault().getBinaryRunner(getElement().getCProject()); - if (runner != null) { - runner.waitIfRunning(); - } - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java deleted file mode 100644 index 812052876e0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.core.model; - -import java.io.IOException; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryElement; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ISourceManipulation; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -/** - */ -public class BinaryElement extends CElement implements IBinaryElement, ISourceManipulation, ISourceReference { - - long addr; - - public BinaryElement(ICElement parent, String name, int type, long a) { - super(parent, name, type); - addr = a; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceManipulation#copy(org.eclipse.cdt.core.model.ICElement, org.eclipse.cdt.core.model.ICElement, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public void copy(ICElement container, ICElement sibling, String rename, boolean replace, IProgressMonitor monitor) - throws CModelException { - throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this)); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceManipulation#delete(boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public void delete(boolean force, IProgressMonitor monitor) throws CModelException { - throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this)); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceManipulation#move(org.eclipse.cdt.core.model.ICElement, org.eclipse.cdt.core.model.ICElement, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public void move(ICElement container, ICElement sibling, String rename, boolean replace, IProgressMonitor monitor) - throws CModelException { - throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this)); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceManipulation#rename(java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public void rename(String name, boolean replace, IProgressMonitor monitor) throws CModelException { - throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this)); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceReference#getSource() - */ - public String getSource() throws CModelException { - ITranslationUnit tu = getTranslationUnit(); - if (tu != null) { - try { - IResource res = tu.getResource(); - if (res != null && res instanceof IFile) { - StringBuffer buffer = Util.getContent((IFile)res); - return buffer.substring(getStartPos(), - getStartPos() + getLength()); - } - } catch (IOException e) { - throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION); - } - } - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceReference#getSourceRange() - */ - public ISourceRange getSourceRange() throws CModelException { - return new SourceRange(getStartPos(), - getLength(), - getIdStartPos(), - getIdLength(), - getStartLine(), - getEndLine()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ISourceReference#getTranslationUnit() - */ - public ITranslationUnit getTranslationUnit() { - ITranslationUnit tu = null; - CModelManager mgr = CModelManager.getDefault(); - ICElement parent = getParent(); - if (parent != null) { - IPath path = parent.getPath(); - if (path != null && path.isAbsolute()) { - IResource res = mgr.getCModel().getWorkspace().getRoot().getFileForLocation(path); - if (res != null && res.exists() && res.getType() == IResource.FILE) { - ICElement e = CModelManager.getDefault().create(res); - if (e instanceof ITranslationUnit) { - tu = (ITranslationUnit)e; - } - } - } else { - // TODO-model: handle non-absolute paths when finding source files - // ??? assert() - path = new Path(""); - } - // Fall back to the project sourcemapper. - if (tu == null) { - ICProject cproject = getCProject(); - SourceMapper mapper = mgr.getSourceMapper(cproject); - if (mapper != null) { - String lastSegment = path.lastSegment(); - if (lastSegment != null) { - tu = mapper.findTranslationUnit(lastSegment); - } - } - } - } - return tu; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo() - */ - protected CElementInfo createElementInfo() { - return new CElementInfo(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getResource() - */ - public IResource getResource() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBinaryElement#getAddress() - */ - public long getAddress() throws CModelException { - return addr; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBinaryElement#getBinary() - */ - public IBinary getBinary() { - ICElement current = this; - do { - if (current instanceof IBinary) { - return (IBinary) current; - } - } while ((current = current.getParent()) != null); - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java deleted file mode 100644 index 39253ea5dc1..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunction; - -/** - */ -public class BinaryFunction extends BinaryElement implements IFunction { - - public BinaryFunction(ICElement parent, String name, long a) { - super(parent, name, ICElement.C_FUNCTION, a); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IFunctionDeclaration#getExceptions() - */ - public String[] getExceptions() { - return new String[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IFunctionDeclaration#getNumberOfParameters() - */ - public int getNumberOfParameters() { - // TODO Auto-generated method stub - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IFunctionDeclaration#getParameterInitializer(int) - */ - public String getParameterInitializer(int pos) { - // TODO Auto-generated method stub - return new String(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IFunctionDeclaration#getParameterTypes() - */ - public String[] getParameterTypes() { - // TODO Auto-generated method stub - return new String[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IFunctionDeclaration#getReturnType() - */ - public String getReturnType() { - // TODO Auto-generated method stub - return new String(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IFunctionDeclaration#getSignature() - */ - public String getSignature() { - return getElementName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IDeclaration#isStatic() - */ - public boolean isStatic() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IDeclaration#isConst() - */ - public boolean isConst() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IDeclaration#isVolatile() - */ - public boolean isVolatile() { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryInfo.java deleted file mode 100644 index e323eee3838..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryInfo.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -class BinaryInfo extends OpenableInfo { - - public BinaryInfo(CElement element) { - super(element); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java deleted file mode 100644 index 8b0a60c36cb..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryElement; -import org.eclipse.cdt.core.model.IBinaryModule; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryModule extends Parent implements IBinaryModule { - - IPath path; - - public BinaryModule(Binary parent, IPath p) { - super(parent, p.lastSegment(), ICElement.C_VCONTAINER); - path = p; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBinaryModule#getBinaryElements() - */ - public IBinaryElement[] getBinaryElements() { - ICElement[] e = getChildren(); - IBinaryElement[] b = new IBinaryElement[e.length]; - System.arraycopy(e, 0, b, 0, e.length); - return b; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBinaryElement#getAddress() - */ - public long getAddress() throws CModelException { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBinaryElement#getBinary() - */ - public IBinary getBinary() { - return (IBinary)getParent(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getResource() - */ - public IResource getResource() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo() - */ - protected CElementInfo createElementInfo() { - return new CElementInfo(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getPath() - */ - public IPath getPath() { - return path; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java deleted file mode 100644 index beb98c8aeb4..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.runtime.CoreException; - -public class BinaryRunner { - IProject project; - Thread runner; - - public BinaryRunner(IProject prj) { - project = prj; - } - - public void start() { - runner = new Thread(new Runnable() { - public void run() { - ICProject cproject = CModelManager.getDefault().create(project); - ArchiveContainer clib; - BinaryContainer cbin; - cbin = (BinaryContainer)cproject.getBinaryContainer(); - clib = (ArchiveContainer)cproject.getArchiveContainer(); - clib.removeChildren(); - cbin.removeChildren(); - try { - cproject.getProject().accept(new Visitor(BinaryRunner.this)); - } catch (CoreException e) { - //e.printStackTrace(); - } catch (Exception e) { - // What is wrong ? - e.printStackTrace(); - } - if (!Thread.currentThread().isInterrupted()) { - fireEvents(cproject, cbin); - fireEvents(cproject, clib); - } - // Tell the listeners we are done. - synchronized(BinaryRunner.this) { - BinaryRunner.this.notifyAll(); - runner = null; - } - } - - }, "Binary Search Thread"); - runner.start(); - } - - - /** - * wrap the wait call and the interrupteException. - */ - public synchronized void waitIfRunning() { - while (runner != null && runner.isAlive()) { - try { - wait(); - } catch (InterruptedException e) { - } - } - } - - public void stop() { - if ( runner != null && runner.isAlive()) { - runner.interrupt(); - } - } - - void fireEvents(ICProject cproject, Parent container) { - // Fired the event. - ICElement[] children = container.getChildren(); - if (children.length > 0) { - CModelManager factory = CModelManager.getDefault(); - ICElement root = (ICModel)factory.getCModel(); - CElementDelta cdelta = new CElementDelta(root); - cdelta.added(cproject); - cdelta.added(container); - for (int i = 0; i < children.length; i++) { - cdelta.added(children[i]); - } - factory.registerCModelDelta(cdelta); - factory.fire(); - } - } - - void addChildIfBinary(IFile file) { - CModelManager factory = CModelManager.getDefault(); - // Attempt to speed things up by rejecting up front - // Things we know should not be Binary files. - if (!factory.isTranslationUnit(file)) { - IBinaryFile bin = factory.createBinaryFile(file); - if (bin != null) { - IResource res = file.getParent(); - ICElement parent = factory.create(res); - // By creating the element, it will be added to the correct (bin/archive)container. - factory.create(parent, file, bin); - } - } - } - - class Visitor implements IResourceVisitor { - BinaryRunner runner; - - public Visitor (BinaryRunner r) { - runner = r; - } - - public boolean visit(IResource res) throws CoreException { - if (Thread.currentThread().isInterrupted()) { - return false; - } - if (res instanceof IFile) { - runner.addChildIfBinary((IFile)res); - return false; - } - return true; - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java deleted file mode 100644 index 668be02a81b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IVariable; - -/** - * - */ -public class BinaryVariable extends BinaryElement implements IVariable { - - public BinaryVariable(ICElement parent, String name, long a) { - super(parent, name, ICElement.C_VARIABLE, a); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IVariable#getInitializer() - */ - public String getInitializer() { - // TODO Auto-generated method stub - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IVariableDeclaration#getTypeName() - */ - public String getTypeName() { - // TODO Auto-generated method stub - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IVariableDeclaration#setTypeName(java.lang.String) - */ - public void setTypeName(String type) { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IDeclaration#isStatic() - */ - public boolean isStatic() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IDeclaration#isConst() - */ - public boolean isConst() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IDeclaration#isVolatile() - */ - public boolean isVolatile() { - // TODO Auto-generated method stub - return false; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java deleted file mode 100644 index 2b3211ab963..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java +++ /dev/null @@ -1,445 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.io.ByteArrayInputStream; -import java.util.ArrayList; - -import org.eclipse.cdt.core.ICLogConstants; -import org.eclipse.cdt.core.model.*; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.Platform; - -/** - * @see IBuffer - * This class is similar to the JDT Buffer class. - */ -public class Buffer implements IBuffer { - protected IFile file; - protected int flags; - protected char[] contents; - protected ArrayList changeListeners; - protected IOpenable owner; - protected int gapStart= -1; - protected int gapEnd= -1; - - protected Object lock= new Object(); - - protected static final int F_HAS_UNSAVED_CHANGES= 1; - protected static final int F_IS_READ_ONLY= 2; - protected static final int F_IS_CLOSED= 4; - /** - * Creates a new buffer on an underlying resource. - */ - protected Buffer(IFile file, IOpenable owner, boolean readOnly) { - this.file = file; - this.owner = owner; - if (file == null) { - setReadOnly(readOnly); - } - } - - /** - * @see IBuffer - */ - public void addBufferChangedListener(IBufferChangedListener listener) { - if (this.changeListeners == null) { - this.changeListeners = new ArrayList(5); - } - if (!this.changeListeners.contains(listener)) { - this.changeListeners.add(listener); - } - } - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#append(char) - */ - public void append(char[] text) { - if (!isReadOnly()) { - if (text == null || text.length == 0) { - return; - } - int length = getLength(); - moveAndResizeGap(length, text.length); - System.arraycopy(text, 0, this.contents, length, text.length); - this.gapStart += text.length; - this.flags |= F_HAS_UNSAVED_CHANGES; - notifyChanged(new BufferChangedEvent(this, length, 0, new String(text))); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#append(java.lang.String) - */ - public void append(String text) { - if (text == null) { - return; - } - this.append(text.toCharArray()); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#close() - */ - public void close() { - BufferChangedEvent event = null; - synchronized (this.lock) { - if (isClosed()) - return; - event = new BufferChangedEvent(this, 0, 0, null); - this.contents = null; - this.flags |= F_IS_CLOSED; - } - notifyChanged(event); // notify outside of synchronized block - this.changeListeners = null; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getChar(int) - */ - public char getChar(int position) { - synchronized (this.lock) { - if (position < this.gapStart) { - return this.contents[position]; - } - int gapLength = this.gapEnd - this.gapStart; - return this.contents[position + gapLength]; - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getCharacters() - */ - public char[] getCharacters() { - if (this.contents == null) return null; - synchronized (this.lock) { - if (this.gapStart < 0) { - return this.contents; - } - int length = this.contents.length; - char[] newContents = new char[length - this.gapEnd + this.gapStart]; - System.arraycopy(this.contents, 0, newContents, 0, this.gapStart); - System.arraycopy(this.contents, this.gapEnd, newContents, this.gapStart, length - this.gapEnd); - return newContents; - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getContents() - */ - public String getContents() { - if (this.contents == null) return null; - return new String(this.getCharacters()); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getLength() - */ - public int getLength() { - synchronized (this.lock) { - int length = this.gapEnd - this.gapStart; - return (this.contents.length - length); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getOwner() - */ - public IOpenable getOwner() { - return this.owner; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getText(int, int) - */ - public String getText(int offset, int length) { - if (this.contents == null) - return ""; //$NON-NLS-1$ - synchronized (this.lock) { - if (offset + length < this.gapStart) - return new String(this.contents, offset, length); - if (this.gapStart < offset) { - int gapLength = this.gapEnd - this.gapStart; - return new String(this.contents, offset + gapLength, length); - } - StringBuffer buf = new StringBuffer(); - buf.append(this.contents, offset, this.gapStart - offset); - buf.append(this.contents, this.gapEnd, offset + length - this.gapStart); - return buf.toString(); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getUnderlyingResource() - */ - public IResource getUnderlyingResource() { - return this.file; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#hasUnsavedChanges() - */ - public boolean hasUnsavedChanges() { - return (this.flags & F_HAS_UNSAVED_CHANGES) != 0; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#isClosed() - */ - public boolean isClosed() { - return (this.flags & F_IS_CLOSED) != 0; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#isReadOnly() - */ - public boolean isReadOnly() { - if (this.file == null) { - return (this.flags & F_IS_READ_ONLY) != 0; - } else { - return this.file.isReadOnly(); - } - } - - /** - * Notify the listeners that this buffer has changed. - * To avoid deadlock, this should not be called in a synchronized block. - */ - protected void notifyChanged(final BufferChangedEvent event) { - if (this.changeListeners != null) { - for (int i = 0, size = this.changeListeners.size(); i < size; ++i) { - final IBufferChangedListener listener = (IBufferChangedListener) this.changeListeners.get(i); - Platform.run(new ISafeRunnable() { - public void handleException(Throwable exception) { - Util.log(exception, "Exception occurred in listener of buffer change notification", ICLogConstants.CDT); //$NON-NLS-1$ - } - public void run() throws Exception { - listener.bufferChanged(event); - } - }); - } - } - } - /** - * @see IBuffer - */ - public void removeBufferChangedListener(IBufferChangedListener listener) { - if (this.changeListeners != null) { - this.changeListeners.remove(listener); - if (this.changeListeners.size() == 0) { - this.changeListeners = null; - } - } - } - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#replace(int, int, char) - */ - public void replace(int position, int length, char[] text) { - if (!isReadOnly()) { - int textLength = text == null ? 0 : text.length; - synchronized (this.lock) { - // move gap - moveAndResizeGap(position + length, textLength - length); - - // overwrite - int min = Math.min(textLength, length); - if (min > 0) { - System.arraycopy(text, 0, this.contents, position, min); - } - if (length > textLength) { - // enlarge the gap - this.gapStart -= length - textLength; - } else if (textLength > length) { - // shrink gap - this.gapStart += textLength - length; - System.arraycopy(text, 0, this.contents, position, textLength); - } - } - this.flags |= F_HAS_UNSAVED_CHANGES; - String string = null; - if (textLength > 0) { - string = new String(text); - } - notifyChanged(new BufferChangedEvent(this, position, length, string)); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#replace(int, int, java.lang.String) - */ - public void replace(int position, int length, String text) { - this.replace(position, length, text == null ? null : text.toCharArray()); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#save(org.eclipse.core.runtime.IProgressMonitor, boolean) - */ - public void save(IProgressMonitor progress, boolean force) - throws CModelException { - // determine if saving is required - if (isReadOnly() || this.file == null) { - return; - } - synchronized (this.lock) { - if (!hasUnsavedChanges()) - return; - - // use a platform operation to update the resource contents - try { - String contents = this.getContents(); - if (contents == null) return; - byte[] bytes = contents.getBytes(); - ByteArrayInputStream stream = new ByteArrayInputStream(bytes); - - this.file.setContents( - stream, - force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY, - null); - } - catch (CoreException e) { - throw new CModelException(e); - } - - // the resource no longer has unsaved changes - this.flags &= ~ (F_HAS_UNSAVED_CHANGES); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#setContents(char) - */ - public void setContents(char[] newContents) { - // allow special case for first initialization - // after creation by buffer factory - if (this.contents == null) { - this.contents = newContents; - this.flags &= ~ (F_HAS_UNSAVED_CHANGES); - return; - } - - if (!isReadOnly()) { - String string = null; - if (newContents != null) { - string = new String(newContents); - } - BufferChangedEvent event = new BufferChangedEvent(this, 0, this.getLength(), string); - synchronized (this.lock) { - this.contents = newContents; - this.flags |= F_HAS_UNSAVED_CHANGES; - this.gapStart = -1; - this.gapEnd = -1; - } - notifyChanged(event); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#setContents(java.lang.String) - */ - public void setContents(String newContents) { - this.setContents(newContents.toCharArray()); - } - - /** - * Moves the gap to location and adjust its size to the - * anticipated change size. The size represents the expected - * range of the gap that will be filled after the gap has been moved. - * Thus the gap is resized to actual size + the specified size and - * moved to the given position. - */ - protected void moveAndResizeGap(int position, int size) { - char[] content = null; - int oldSize = this.gapEnd - this.gapStart; - if (size < 0) { - if (oldSize > 0) { - content = new char[this.contents.length - oldSize]; - System.arraycopy(this.contents, 0, content, 0, this.gapStart); - System.arraycopy(this.contents, this.gapEnd, content, this.gapStart, content.length - this.gapStart); - this.contents = content; - } - this.gapStart = this.gapEnd = position; - return; - } - content = new char[this.contents.length + (size - oldSize)]; - int newGapStart = position; - int newGapEnd = newGapStart + size; - if (oldSize == 0) { - System.arraycopy(this.contents, 0, content, 0, newGapStart); - System.arraycopy(this.contents, newGapStart, content, newGapEnd, content.length - newGapEnd); - } else - if (newGapStart < this.gapStart) { - int delta = this.gapStart - newGapStart; - System.arraycopy(this.contents, 0, content, 0, newGapStart); - System.arraycopy(this.contents, newGapStart, content, newGapEnd, delta); - System.arraycopy(this.contents, this.gapEnd, content, newGapEnd + delta, this.contents.length - this.gapEnd); - } else { - int delta = newGapStart - this.gapStart; - System.arraycopy(this.contents, 0, content, 0, this.gapStart); - System.arraycopy(this.contents, this.gapEnd, content, this.gapStart, delta); - System.arraycopy(this.contents, this.gapEnd + delta, content, newGapEnd, content.length - newGapEnd); - } - this.contents = content; - this.gapStart = newGapStart; - this.gapEnd = newGapEnd; - } - - /** - * Sets this Buffer to be read only. - */ - protected void setReadOnly(boolean readOnly) { - if (readOnly) { - this.flags |= F_IS_READ_ONLY; - } else { - this.flags &= ~(F_IS_READ_ONLY); - } - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("Owner: " + ((CElement)this.owner).toString()); //$NON-NLS-1$ - buffer.append("\nHas unsaved changes: " + this.hasUnsavedChanges()); //$NON-NLS-1$ - buffer.append("\nIs readonly: " + this.isReadOnly()); //$NON-NLS-1$ - buffer.append("\nIs closed: " + this.isClosed()); //$NON-NLS-1$ - buffer.append("\nContents:\n"); //$NON-NLS-1$ - char[] contents = this.getCharacters(); - if (contents == null) { - buffer.append(""); //$NON-NLS-1$ - } else { - int length = contents.length; - for (int i = 0; i < length; i++) { - char car = contents[i]; - switch (car) { - case '\n': - buffer.append("\\n\n"); //$NON-NLS-1$ - break; - case '\r': - if (i < length-1 && this.contents[i+1] == '\n') { - buffer.append("\\r\\n\n"); //$NON-NLS-1$ - i++; - } else { - buffer.append("\\r\n"); //$NON-NLS-1$ - } - break; - default: - buffer.append(car); - break; - } - } - } - return buffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java deleted file mode 100644 index 786835b347e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java +++ /dev/null @@ -1,152 +0,0 @@ -package org.eclipse.cdt.internal.core.model; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - - -import java.util.Enumeration; - -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.internal.core.util.LRUCache; -import org.eclipse.cdt.internal.core.util.OverflowingLRUCache; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -/** - * The buffer manager manages the set of open buffers. - * It implements an LRU cache of buffers. - * - * This class is similar to the JDT BufferManager class - */ - -public class BufferManager implements IBufferFactory { - - /** - * An LRU cache of IBuffers. - */ - public class BufferCache extends OverflowingLRUCache { - /** - * Constructs a new buffer cache of the given size. - */ - public BufferCache(int size) { - super(size); - } - /** - * Constructs a new buffer cache of the given size. - */ - public BufferCache(int size, int overflow) { - super(size, overflow); - } - /** - * Returns true if the buffer is successfully closed and - * removed from the cache, otherwise false. - * - *

      NOTE: this triggers an external removal of this buffer - * by closing the buffer. - */ - protected boolean close(LRUCacheEntry entry) { - IBuffer buffer= (IBuffer) entry._fValue; - if (buffer.hasUnsavedChanges()) { - return false; - } else { - buffer.close(); - return true; - } - } - /** - * Returns a new instance of the reciever. - */ - protected LRUCache newInstance(int size, int overflow) { - return new BufferCache(size, overflow); - } - } - - protected static BufferManager DEFAULT_BUFFER_MANAGER; - - /** - * LRU cache of buffers. The key and value for an entry - * in the table is the identical buffer. - */ - protected OverflowingLRUCache openBuffers = new BufferCache(60); - - /** - * Creates a new buffer manager. - */ - public BufferManager() { - } - /** - * Adds a buffer to the table of open buffers. - */ - protected void addBuffer(IBuffer buffer) { - openBuffers.put(buffer.getOwner(), buffer); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBufferFactory#createBuffer(org.eclipse.cdt.core.model.IOpenable) - */ - public IBuffer createBuffer(IOpenable owner) { - ICElement element = (ICElement)owner; - - IResource resource = element.getResource(); - return - new Buffer( - resource instanceof IFile ? (IFile)resource : null, - owner, - element.isReadOnly()); - } - - /** - * Returns the open buffer associated with the given owner, - * or null if the owner does not have an open - * buffer associated with it. - */ - public IBuffer getBuffer(IOpenable owner) { - return (IBuffer)openBuffers.get(owner); - } - /** - * Returns the default buffer factory. - */ - public IBufferFactory getDefaultBufferFactory() { - return this; - } - /** - * Returns the default buffer manager. - */ - public synchronized static BufferManager getDefaultBufferManager() { - if (DEFAULT_BUFFER_MANAGER == null) { - DEFAULT_BUFFER_MANAGER = new BufferManager(); - } - return DEFAULT_BUFFER_MANAGER; - } - /** - * Returns an enumeration of all open buffers. - *

      - * The Enumeration answered is thread safe. - * - * @see OverflowingLRUCache - * @return Enumeration of IBuffer - */ - public Enumeration getOpenBuffers() { - synchronized (openBuffers) { - openBuffers.shrink(); - return openBuffers.elements(); - } - } - - - /** - * Removes a buffer from the table of open buffers. - */ - protected void removeBuffer(IBuffer buffer) { - openBuffers.remove(buffer.getOwner()); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java deleted file mode 100644 index 19e9cef666a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Map; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CContainer extends Openable implements ICContainer { - - public CContainer (ICElement parent, IResource res) { - this (parent, res, ICElement.C_CCONTAINER); - } - - public CContainer (ICElement parent, IResource res, int type) { - super (parent, res, type); - } - - /** - * Returns a the collection of binary files in this ccontainer - * - * @see ICContainer#getBinaries() - */ - public IBinary[] getBinaries() throws CModelException { - ArrayList list = getChildrenOfType(C_BINARY); - IBinary[] array = new IBinary[list.size()]; - list.toArray(array); - return array; - } - - /** - * Returns a the collection of archive files in this ccontainer - * - * @see ICContainer#getArchives() - */ - public IArchive[] getArchives() throws CModelException { - ArrayList list = getChildrenOfType(C_ARCHIVE); - IArchive[] array = new IArchive[list.size()]; - list.toArray(array); - return array; - } - - /** - * @see ICContainer#getTranslationUnits() - */ - public ITranslationUnit[] getTranslationUnit() throws CModelException { - ArrayList list = getChildrenOfType(C_UNIT); - ITranslationUnit[] array = new ITranslationUnit[list.size()]; - list.toArray(array); - return array; - } - - protected CElementInfo createElementInfo () { - return new CContainerInfo(this); - } - - // CHECKPOINT: folders will return the hash code of their path - public int hashCode() { - return getPath().hashCode(); - } - - /** - * @see Openable - */ - protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, - Map newElements, IResource underlyingResource) throws CModelException { - - boolean validInfo = false; - try { - IResource res = getResource(); - if (res != null && (res instanceof IWorkspaceRoot || res.getProject().isOpen())) { - // put the info now, because computing the roots requires it - CModelManager.getDefault().putInfo(this, info); - validInfo = computeChildren(info, res); - } - } finally { - if (!validInfo) { - CModelManager.getDefault().removeInfo(this); - } - } - return validInfo; - } - - /* (non-Javadoc) - * Returns an array of non-c resources contained in the receiver. - * @see org.eclipse.cdt.core.model.ICContainer#getNonCResources() - */ - public Object[] getNonCResources() throws CModelException { - return ((CContainerInfo)getElementInfo()).getNonCResources(getResource()); - } - - protected boolean computeChildren(OpenableInfo info, IResource res) { - ArrayList vChildren = new ArrayList(); - ArrayList notChildren = new ArrayList(); - try { - IResource[] resources = null; - if (res != null) { - //System.out.println (" Resource: " + res.getFullPath().toOSString()); - switch(res.getType()) { - case IResource.ROOT: - case IResource.PROJECT: - case IResource.FOLDER: - IContainer container = (IContainer)res; - resources = container.members(false); - break; - - case IResource.FILE: - break; - } - } - - if (resources != null) { - CModelManager factory = CModelManager.getDefault(); - for (int i = 0; i < resources.length; i++) { - // Check for Valid C Element only. - ICElement celement = factory.create(this, resources[i]); - if (celement != null) { - vChildren.add(celement); - } else { - notChildren.add(resources[i]); - } - } - } - } catch (CoreException e) { - //System.out.println (e); - //CPlugin.log (e); - //e.printStackTrace(); - } - ICElement[] children = new ICElement[vChildren.size()]; - vChildren.toArray(children); - info.setChildren(children); - ((CContainerInfo)getElementInfo()).setNonCResources(notChildren.toArray()); - return true; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java deleted file mode 100644 index 7973ea3805a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainerInfo.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - */ -public class CContainerInfo extends OpenableInfo { - - /** - * Shared empty collection used for efficiency. - */ - static Object[] NO_NON_C_RESOURCES = new Object[] {}; - - Object[] nonCResources = null; - - /** - * Constructs a new C Model Info - */ - protected CContainerInfo(CElement element) { - super(element); - } - - /** - * @param container - * @return - */ - public Object[] getNonCResources(IResource res) { - if (nonCResources != null) - return nonCResources; - - ArrayList notChildren = new ArrayList(); - ICElement parent = getElement(); - try { - IResource[] resources = null; - if (res != null) { - switch(res.getType()) { - case IResource.ROOT: - case IResource.PROJECT: - case IResource.FOLDER: - IContainer container = (IContainer)res; - resources = container.members(false); - break; - - case IResource.FILE: - break; - } - } - - if (resources != null) { - CModelManager factory = CModelManager.getDefault(); - for (int i = 0; i < resources.length; i++) { - // Check for Valid C projects only. - ICElement celement = factory.create(parent, resources[i]); - if (celement == null) { - notChildren.add(resources[i]); - } - } - } - } catch (CoreException e) { - //System.out.println (e); - //CPlugin.log (e); - //e.printStackTrace(); - } - setNonCResources(notChildren.toArray()); - return nonCResources; - } - - /** - * @param container - * @return - */ - public void setNonCResources(Object[] resources) { - nonCResources = resources; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java deleted file mode 100644 index 745e63a3b5f..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java +++ /dev/null @@ -1,386 +0,0 @@ -package org.eclipse.cdt.internal.core.model; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.PlatformObject; - -public abstract class CElement extends PlatformObject implements ICElement { - - protected int fType; - - protected ICElement fParent; - - protected String fName; - - protected int fStartPos; - protected int fLength; - protected int fIdStartPos; - protected int fIdLength; - protected int fStartLine; - protected int fEndLine; - - protected CElement[] empty = new CElement[0]; - - protected CElement(ICElement parent, String name, int type) { - fParent= parent; - fName= name; - fType= type; - } - - // setters - - public void setElementType (int type) { - fType= type; - } - - public void setElementName(String name) { - fName = name; - } - - public void setParent (ICElement parent) { - fParent = parent; - } - - // getters - - public int getElementType() { - return fType; - } - - public String getElementName() { - return fName; - } - - public ICElement getParent() { - return fParent; - } - - public IPath getPath() { - IResource res = getUnderlyingResource(); - if (res != null) - return res.getFullPath(); - return new Path(getElementName()); - } - - public boolean exists() { - return getResource() != null; - } - - public boolean isReadOnly () { - IResource r = getUnderlyingResource(); - if (r != null) { - return r.isReadOnly(); - } - return false; - } - - public boolean isStructureKnown() throws CModelException { - return getElementInfo().isStructureKnown(); - } - - public ICModel getCModel () { - ICElement current = this; - do { - if (current instanceof ICModel) return (ICModel) current; - } while ((current = current.getParent()) != null); - return null; - } - - public ICProject getCProject() { - ICElement current = this; - do { - if (current instanceof ICProject) return (ICProject) current; - } while ((current = current.getParent()) != null); - return null; - } - - protected void addChild(ICElement e) { - } - - public void setPos(int startPos, int length) { - fStartPos = startPos; - fLength = length; - } - - public int getStartPos() { - return fStartPos; - } - - public int getLength() { - return fLength; - } - - public void setIdPos(int startPos, int length) { - fIdStartPos= startPos; - fIdLength= length; - } - - public int getIdStartPos() { - return fIdStartPos; - } - - public int getIdLength() { - return fIdLength; - } - - public int getStartLine() { - return fStartLine; - } - - public int getEndLine() { - return fEndLine; - } - - public void setLines(int startLine, int endLine) { - fStartLine = startLine; - fEndLine = endLine; - } - - public IResource getUnderlyingResource() { - IResource res = getResource(); - if (res == null) { - ICElement p = getParent(); - if (p != null) { - res = p.getUnderlyingResource(); - } - } - return res; - } - - public abstract IResource getResource() ; - - protected abstract CElementInfo createElementInfo(); - - /** - * Tests if an element has the same name, type and an equal parent. - */ - public boolean equals (Object o) { - if (this == o) - return true; - if (o instanceof CElement) { - CElement other = (CElement) o; - if( fName == null || other.fName == null ) - return false; - if( fName.length() == 0 || other.fName.length() == 0 ) - return false; - if (fType != other.fType) - return false; - if (fName.equals(other.fName)) { - if (fParent != null && fParent.equals(other.fParent)) { - return true; - } - if (fParent == null && other.fParent == null) - return true; - } - } - return false; - } - - public CElementInfo getElementInfo () { - try { - CModelManager manager; - synchronized(manager = CModelManager.getDefault()){ - Object info = manager.getInfo(this); - if (info == null) { - openHierarchy(); - info= manager.getInfo(this); - if (info == null) { - throw newNotPresentException(); - } - } - return (CElementInfo)info; - } - } catch(CModelException e) { - return null; - } - } - - public String toString() { - return getElementName(); - } - - public String toDebugString() { - return getElementName() + " " + getTypeString(getElementType()); - } - - // util - public static String getTypeString(int type) { - switch (type) { - case C_MODEL: - return "CMODEL"; - case C_PROJECT: - return "CPROJECT"; - case C_CCONTAINER: - return "CCONTAINER"; - case C_UNIT: - return "TRANSLATION_UNIT"; - case C_FUNCTION: - return "C_FUNCTION"; - case C_FUNCTION_DECLARATION: - return "C_FUNCTION_DECLARATION"; - case C_VARIABLE: - return "C_VARIABLE"; - case C_VARIABLE_DECLARATION: - return "C_VARIABLE_DECLARATION"; - case C_INCLUDE: - return "C_INCLUDE"; - case C_MACRO: - return "C_MACRO"; - case C_STRUCT: - return "C_STRUCT"; - case C_CLASS: - return "C_CLASS"; - case C_UNION: - return "C_UNION"; - case C_FIELD: - return "C_FIELD"; - case C_METHOD: - return "C_METHOD"; - default: - return "UNKNOWN"; - } - } - - /** - * Runs a C Model Operation - */ - protected void runOperation(CModelOperation operation, IProgressMonitor monitor) throws CModelException { - CModelManager.getDefault().runOperation(operation, monitor); - } - - /** - * Close the C Element - * @throws CModelException - */ - public void close() throws CModelException { - Object info = CModelManager.getDefault().peekAtInfo(this); - if (info != null) { - if (this instanceof IParent) { - ICElement[] children = ((CElementInfo) info).getChildren(); - for (int i = 0, size = children.length; i < size; ++i) { - CElement child = (CElement) children[i]; - child.close(); - } - } - closing(info); - CModelManager.getDefault().removeInfo(this); - } - } - /** - * This element is being closed. Do any necessary cleanup. - */ - protected void closing(Object info) throws CModelException { - } - - /** - * This element has just been opened. Do any necessary setup. - */ - protected void opening(Object info) { - } - - /** - * Return the first instance of IOpenable in the parent - * hierarchy of this element. - * - *

      Subclasses that are not IOpenable's must override this method. - */ - public IOpenable getOpenableParent() { - if (fParent instanceof IOpenable) { - return (IOpenable)fParent; - } - return null; - } - - - /** - * Opens this element and all parents that are not already open. - * - * @exception CModelException this element is not present or accessible - */ - protected void openHierarchy() throws CModelException { - if (this instanceof IOpenable) { - ((Openable) this).openWhenClosed(null); - } else { - Openable openableParent = (Openable)getOpenableParent(); - if (openableParent != null) { - CElementInfo openableParentInfo = (CElementInfo) CModelManager.getDefault().getInfo((ICElement) openableParent); - if (openableParentInfo == null) { - openableParent.openWhenClosed(null); - } - //else { - CModelManager.getDefault().putInfo( this, createElementInfo()); - //} - } - } - } - /** - * Returns true if this element is an ancestor of the given element, - * otherwise false. - */ - protected boolean isAncestorOf(ICElement e) { - ICElement parent= e.getParent(); - while (parent != null && !parent.equals(this)) { - parent= parent.getParent(); - } - return parent != null; - } - - /** - * Creates and returns and not present exception for this element. - */ - protected CModelException newNotPresentException() { - return new CModelException(new CModelStatus(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, this)); - } - /** - * Removes all cached info from the C Model, including all children, - * but does not close this element. - */ - protected void removeInfo() { - Object info = CModelManager.getDefault().peekAtInfo(this); - if (info != null) { - if (this instanceof IParent) { - ICElement[] children = ((CElementInfo)info).getChildren(); - for (int i = 0, size = children.length; i < size; ++i) { - CElement child = (CElement) children[i]; - child.removeInfo(); - } - } - CModelManager.getDefault().removeInfo(this); - } - } - - /** - * Returns the hash code for this Java element. By default, - * the hash code for an element is a combination of its name - * and parent's hash code. Elements with other requirements must - * override this method. - */ - // CHECKPOINT: making not equal objects seem equal - // What elements should override this? - public int hashCode() { - if (fParent == null) return super.hashCode(); - return Util.combineHashCodes(fName.hashCode(), fParent.hashCode()); - } - - /* - * Test to see if two objects are identical - * Subclasses should override accordingly - */ - public boolean isIdentical( CElement otherElement){ - return this.equals(otherElement); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java deleted file mode 100644 index e280042d280..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java +++ /dev/null @@ -1,729 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.core.resources.IResourceDelta; - - -/** - * @see ICElementDelta - */ -public class CElementDelta implements ICElementDelta { - /** - * The element that this delta describes the change to. - * @see #getElement() - */ - protected ICElement fChangedElement; - - /** - * @see #getKind() - */ - private int fKind = 0; - - /** - * @see #getFlags() - */ - private int fChangeFlags = 0; - - /** - * @see #getMovedFromHandle() - */ - protected ICElement fMovedFromHandle = null; - - /** - * @see #getMovedToHandle() - */ - protected ICElement fMovedToHandle = null; - - /** - * Collection of resource deltas that correspond to non c resources deltas. - */ - protected IResourceDelta[] resourceDeltas = null; - - /** - * Counter of resource deltas - */ - protected int resourceDeltasCounter; - - /** - * Empty array of ICElementDelta - */ - protected static ICElementDelta[] fgEmptyDelta= new ICElementDelta[] {}; - - /** - * @see #getAffectedChildren() - */ - protected ICElementDelta[] fAffectedChildren = fgEmptyDelta; - - /** - * Creates the root delta. To create the nested delta - * hierarchies use the following convenience methods. The root - * delta can be created at any level (i.e. project, folder). - *

        - *
      • added(ICElement) - *
      • changed(ICElement) - *
      • moved(ICElement, ICElement) - *
      • removed(ICElement) - *
      • renamed(ICElement, ICElement) - *
      - */ - public CElementDelta(ICElement element) { - super(); - fChangedElement = element; - } - - /** - * Adds the child delta to the collection of affected children. If the - * child is already in the collection, walk down the hierarchy. - */ - protected void addAffectedChild(CElementDelta child) { - switch (fKind) { - case ADDED: - case REMOVED: - // no need to add a child if this parent is added or removed - return; - case CHANGED: - fChangeFlags |= F_CHILDREN; - break; - default: - fKind = CHANGED; - fChangeFlags |= F_CHILDREN; - } - - // if a child delta is added to a translation unit delta or below, - // it's a fine grained delta - if (!(fChangedElement.getElementType() >= ICElement.C_UNIT)) { - fineGrained(); - } - - if (fAffectedChildren.length == 0) { - fAffectedChildren = new ICElementDelta[] {child}; - return; - } - - // Check if we already have the delta. - ICElementDelta existingChild = null; - int existingChildIndex = -1; - for (int i = 0; i < fAffectedChildren.length; i++) { - // handle case of two jars that can be equals but not in the same project - if (equalsAndSameParent(fAffectedChildren[i].getElement(), child.getElement())) { - existingChild = fAffectedChildren[i]; - existingChildIndex = i; - break; - } - } - - if (existingChild == null) { //new affected child - fAffectedChildren= growAndAddToArray(fAffectedChildren, child); - } else { - switch (existingChild.getKind()) { - case ADDED: - switch (child.getKind()) { - // child was added then added -> it is added - case ADDED: - // child was added then changed -> it is added - case CHANGED: - return; - - // child was added then removed -> noop - case REMOVED: - fAffectedChildren = removeAndShrinkArray(fAffectedChildren, existingChildIndex); - return; - } - break; - case REMOVED: - switch (child.getKind()) { - // child was removed then added -> it is changed - case ADDED: - child.fKind = CHANGED; - fAffectedChildren[existingChildIndex] = child; - return; - - // child was removed then changed -> it is removed - case CHANGED: - // child was removed then removed -> it is removed - case REMOVED: - return; - } - break; - case CHANGED: - switch (child.getKind()) { - // child was changed then added -> it is added - case ADDED: - // child was changed then removed -> it is removed - case REMOVED: - fAffectedChildren[existingChildIndex] = child; - return; - - // child was changed then changed -> it is changed - case CHANGED: - ICElementDelta[] children = child.getAffectedChildren(); - for (int i = 0; i < children.length; i++) { - CElementDelta childsChild = (CElementDelta) children[i]; - ((CElementDelta) existingChild).addAffectedChild(childsChild); - } - // add the non-c resource deltas if needed - // note that the child delta always takes - // precedence over this existing child delta - // as non-c resource deltas are always - // created last (by the DeltaProcessor) - IResourceDelta[] resDeltas = child.getResourceDeltas(); - if (resDeltas != null) { - ((CElementDelta)existingChild).resourceDeltas = resDeltas; - ((CElementDelta)existingChild).resourceDeltasCounter = child.resourceDeltasCounter; - } - return; - } - break; - default: - // unknown -> existing child becomes the child with the existing child's flags - int flags = existingChild.getFlags(); - fAffectedChildren[existingChildIndex] = child; - child.fChangeFlags |= flags; - } - } - } - - /** - * Creates the nested deltas resulting from an add operation. - * Convenience method for creating add deltas. - * The constructor should be used to create the root delta - * and then an add operation should call this method. - */ - public void added(ICElement element) { - CElementDelta addedDelta = new CElementDelta(element); - addedDelta.fKind = ADDED; - insertDeltaTree(element, addedDelta); - } - - /** - * Adds the child delta to the collection of affected children. If the - * child is already in the collection, walk down the hierarchy. - */ - protected void addResourceDelta(IResourceDelta child) { - switch (fKind) { - case ADDED: - case REMOVED: - // no need to add a child if this parent is added or removed - return; - case CHANGED: - fChangeFlags |= F_CONTENT; - break; - default: - fKind = CHANGED; - fChangeFlags |= F_CONTENT; - } - if (resourceDeltas == null) { - resourceDeltas = new IResourceDelta[5]; - resourceDeltas[resourceDeltasCounter++] = child; - return; - } - if (resourceDeltas.length == resourceDeltasCounter) { - // need a resize - System.arraycopy(resourceDeltas, 0, (resourceDeltas = new IResourceDelta[resourceDeltasCounter * 2]), 0, resourceDeltasCounter); - } - resourceDeltas[resourceDeltasCounter++] = child; - } - - /** - * Creates the nested deltas resulting from a change operation. - * Convenience method for creating change deltas. - * The constructor should be used to create the root delta - * and then a change operation should call this method. - */ - public void changed(ICElement element, int changeFlag) { - CElementDelta changedDelta = new CElementDelta(element); - changedDelta.fKind = CHANGED; - changedDelta.fChangeFlags |= changeFlag; - insertDeltaTree(element, changedDelta); - } - - /** - * Creates the nested deltas for a closed element. - */ - public void closed(ICElement element) { - CElementDelta delta = new CElementDelta(element); - delta.fKind = CHANGED; - delta.fChangeFlags |= F_CLOSED; - insertDeltaTree(element, delta); - } - - /** - * Returns whether the two c elements are equals and have the same parent. - */ - protected boolean equalsAndSameParent(ICElement e1, ICElement e2) { - ICElement parent1; - return e1.equals(e2) && ((parent1 = e1.getParent()) != null) && parent1.equals(e2.getParent()); - } - - /** - * Creates the nested delta deltas based on the affected element - * its delta, and the root of this delta tree. Returns the root - * of the created delta tree. - */ - protected CElementDelta createDeltaTree(ICElement element, CElementDelta delta) { - CElementDelta childDelta = delta; - ArrayList ancestors= getAncestors(element); - if (ancestors == null) { - if (equalsAndSameParent(delta.getElement(), getElement())) { - // handle case of two jars that can be equals but not in the - // same project - // the element being changed is the root element - fKind= delta.fKind; - fChangeFlags = delta.fChangeFlags; - fMovedToHandle = delta.fMovedToHandle; - fMovedFromHandle = delta.fMovedFromHandle; - } else { - // the given delta is not the root or a child - illegal - //Assert.isTrue(false); - } - } else { - for (int i = 0, size = ancestors.size(); i < size; i++) { - ICElement ancestor = (ICElement) ancestors.get(i); - CElementDelta ancestorDelta = new CElementDelta(ancestor); - ancestorDelta.addAffectedChild(childDelta); - childDelta = ancestorDelta; - } - } - return childDelta; - } - - /** - * Returns the CElementDelta for the given element - * in the delta tree, or null, if no delta for the given element is found. - */ - protected CElementDelta find(ICElement e) { - if (equalsAndSameParent(fChangedElement, e)) { // handle case of two jars that can be equals but not in the same project - return this; - } else { - for (int i = 0; i < fAffectedChildren.length; i++) { - CElementDelta delta = ((CElementDelta)fAffectedChildren[i]).find(e); - if (delta != null) { - return delta; - } - } - } - return null; - } - - /** - * Mark this delta as a fine-grained delta. - */ - public void fineGrained() { - fChangeFlags |= F_FINE_GRAINED; - } - - /** - * @see ICElementDelta - */ - public ICElementDelta[] getAddedChildren() { - return getChildrenOfType(ADDED); - } - - /** - * @see ICElementDelta - */ - public ICElementDelta[] getAffectedChildren() { - return fAffectedChildren; - } - - /** - * Returns a collection of all the parents of this element up to (but - * not including) the root of this tree in bottom-up order. If the given - * element is not a descendant of the root of this tree, null - * is returned. - */ - private ArrayList getAncestors(ICElement element) { - ICElement parent = element.getParent(); - if (parent == null) { - return null; - } - ArrayList parents = new ArrayList(); - while (!parent.equals(fChangedElement)) { - parents.add(parent); - parent = parent.getParent(); - if (parent == null) { - return null; - } - } - parents.trimToSize(); - return parents; - } - - /** - * @see ICElementDelta - */ - public ICElementDelta[] getChangedChildren() { - return getChildrenOfType(CHANGED); - } - - /** - * @see ICElementDelta - */ - protected ICElementDelta[] getChildrenOfType(int type) { - int length = fAffectedChildren.length; - if (length == 0) { - return new ICElementDelta[] {}; - } - ArrayList children= new ArrayList(length); - for (int i = 0; i < length; i++) { - if (fAffectedChildren[i].getKind() == type) { - children.add(fAffectedChildren[i]); - } - } - - ICElementDelta[] childrenOfType = new ICElementDelta[children.size()]; - children.toArray(childrenOfType); - return childrenOfType; - } - - /** - * Returns the delta for a given element. Only looks below this - * delta. - */ - protected CElementDelta getDeltaFor(ICElement element) { - if (equalsAndSameParent(getElement(), element)) // handle case of two jars that can be equals but not in the same project - return this; - if (fAffectedChildren.length == 0) - return null; - int childrenCount = fAffectedChildren.length; - for (int i = 0; i < childrenCount; i++) { - CElementDelta delta = (CElementDelta)fAffectedChildren[i]; - if (equalsAndSameParent(delta.getElement(), element)) { // handle case of two jars that can be equals but not in the same project - return delta; - } else { - delta = ((CElementDelta)delta).getDeltaFor(element); - if (delta != null) - return delta; - } - } - return null; - } - - /** - * @see ICElementDelta - */ - public ICElement getElement() { - return fChangedElement; - } - - /** - * @see ICElementDelta - */ - public int getFlags() { - return fChangeFlags; - } - - /** - * @see ICElementDelta - */ - public int getKind() { - return fKind; - } - - /** - * @see ICElementDelta - */ - public ICElement getMovedFromElement() { - return fMovedFromHandle; - } - - /** - * @see ICElementDelta - */ - public ICElement getMovedToElement() { - return fMovedToHandle; - } - - /** - * @see ICElementDelta - */ - public ICElementDelta[] getRemovedChildren() { - return getChildrenOfType(REMOVED); - } - - /** - * Return the collection of resource deltas. Return null if none. - */ - public IResourceDelta[] getResourceDeltas() { - if (resourceDeltas == null) - return null; - if (resourceDeltas.length != resourceDeltasCounter) { - System.arraycopy(resourceDeltas, 0, resourceDeltas = new IResourceDelta[resourceDeltasCounter], 0, resourceDeltasCounter); - } - return resourceDeltas; - } - - /** - * Adds the new element to a new array that contains all of the elements of the old array. - * Returns the new array. - */ - protected ICElementDelta[] growAndAddToArray(ICElementDelta[] array, ICElementDelta addition) { - ICElementDelta[] old = array; - array = new ICElementDelta[old.length + 1]; - System.arraycopy(old, 0, array, 0, old.length); - array[old.length] = addition; - return array; - } - - /** - * Creates the delta tree for the given element and delta, and then - * inserts the tree as an affected child of this node. - */ - protected void insertDeltaTree(ICElement element, CElementDelta delta) { - CElementDelta childDelta= createDeltaTree(element, delta); - if (!equalsAndSameParent(element, getElement())) { - addAffectedChild(childDelta); - } - } - - - /** - * Creates the nested deltas resulting from an move operation. - * Convenience method for creating the "move from" delta. - * The constructor should be used to create the root delta - * and then the move operation should call this method. - */ - public void movedFrom(ICElement movedFromElement, ICElement movedToElement) { - CElementDelta removedDelta = new CElementDelta(movedFromElement); - removedDelta.fKind = REMOVED; - removedDelta.fChangeFlags |= F_MOVED_TO; - removedDelta.fMovedToHandle = movedToElement; - insertDeltaTree(movedFromElement, removedDelta); - } - - /** - * Creates the nested deltas resulting from an move operation. - * Convenience method for creating the "move to" delta. - * The constructor should be used to create the root delta - * and then the move operation should call this method. - */ - public void movedTo(ICElement movedToElement, ICElement movedFromElement) { - CElementDelta addedDelta = new CElementDelta(movedToElement); - addedDelta.fKind = ADDED; - addedDelta.fChangeFlags |= F_MOVED_FROM; - addedDelta.fMovedFromHandle = movedFromElement; - insertDeltaTree(movedToElement, addedDelta); - } - - /** - * Creates the nested deltas for an opened element. - */ - public void opened(ICElement element) { - CElementDelta delta = new CElementDelta(element); - delta.fKind = CHANGED; - delta.fChangeFlags |= F_OPENED; - insertDeltaTree(element, delta); - } - - /** - * Removes the child delta from the collection of affected children. - */ - protected void removeAffectedChild(CElementDelta child) { - int index = -1; - if (fAffectedChildren != null) { - for (int i = 0; i < fAffectedChildren.length; i++) { - if (equalsAndSameParent(fAffectedChildren[i].getElement(), child.getElement())) { // handle case of two jars that can be equals but not in the same project - index = i; - break; - } - } - } - if (index >= 0) { - fAffectedChildren= removeAndShrinkArray(fAffectedChildren, index); - } - } - - /** - * Removes the element from the array. - * Returns the a new array which has shrunk. - */ - protected ICElementDelta[] removeAndShrinkArray(ICElementDelta[] old, int index) { - ICElementDelta[] array = new ICElementDelta[old.length - 1]; - if (index > 0) - System.arraycopy(old, 0, array, 0, index); - int rest = old.length - index - 1; - if (rest > 0) - System.arraycopy(old, index + 1, array, index, rest); - return array; - } - - /** - * Creates the nested deltas resulting from an delete operation. - * Convenience method for creating removed deltas. - * The constructor should be used to create the root delta - * and then the delete operation should call this method. - */ - public void removed(ICElement element) { - CElementDelta removedDelta= new CElementDelta(element); - insertDeltaTree(element, removedDelta); - CElementDelta actualDelta = getDeltaFor(element); - if (actualDelta != null) { - actualDelta.fKind = REMOVED; - actualDelta.fChangeFlags = 0; - actualDelta.fAffectedChildren = fgEmptyDelta; - } - } - - /** - * Creates the nested deltas resulting from a change operation. - * Convenience method for creating change deltas. - * The constructor should be used to create the root delta - * and then a change operation should call this method. - */ - public void binaryParserChanged(ICElement element) { - CElementDelta attachedDelta = new CElementDelta(element); - attachedDelta.fKind = CHANGED; - attachedDelta.fChangeFlags |= F_BINARY_PARSER_CHANGED; - insertDeltaTree(element, attachedDelta); - } - - /** - * Creates the nested deltas resulting from a change operation. - * Convenience method for creating change deltas. - * The constructor should be used to create the root delta - * and then a change operation should call this method. - */ - public void sourceAttached(ICElement element) { - CElementDelta attachedDelta = new CElementDelta(element); - attachedDelta.fKind = CHANGED; - attachedDelta.fChangeFlags |= F_SOURCEATTACHED; - insertDeltaTree(element, attachedDelta); - } - - /** - * Creates the nested deltas resulting from a change operation. - * Convenience method for creating change deltas. - * The constructor should be used to create the root delta - * and then a change operation should call this method. - */ - public void sourceDetached(ICElement element) { - CElementDelta detachedDelta = new CElementDelta(element); - detachedDelta.fKind = CHANGED; - detachedDelta.fChangeFlags |= F_SOURCEDETACHED; - insertDeltaTree(element, detachedDelta); - } - - /** - * Returns a string representation of this delta's - * structure suitable for debug purposes. - * - * @see toString - */ - public String toDebugString(int depth) { - StringBuffer buffer = new StringBuffer(); - for (int i= 0; i < depth; i++) { - buffer.append('\t'); - } - buffer.append(((CElement)getElement()).toDebugString()); - buffer.append(" ["); //$NON-NLS-1$ - switch (getKind()) { - case ICElementDelta.ADDED : - buffer.append('+'); - break; - case ICElementDelta.REMOVED : - buffer.append('-'); - break; - case ICElementDelta.CHANGED : - buffer.append('*'); - break; - default : - buffer.append('?'); - break; - } - buffer.append("]: {"); //$NON-NLS-1$ - int changeFlags = getFlags(); - boolean prev = false; - if ((changeFlags & ICElementDelta.F_CHILDREN) != 0) { - if (prev) - buffer.append(" | "); //$NON-NLS-1$ - buffer.append("CHILDREN"); //$NON-NLS-1$ - prev = true; - } - if ((changeFlags & ICElementDelta.F_CONTENT) != 0) { - if (prev) - buffer.append(" | "); //$NON-NLS-1$ - buffer.append("CONTENT"); //$NON-NLS-1$ - prev = true; - } - if ((changeFlags & ICElementDelta.F_MOVED_FROM) != 0) { - if (prev) - buffer.append(" | "); //$NON-NLS-1$ - //buffer.append("MOVED_FROM(" + ((CElement)getMovedFromElement()).toStringWithAncestors() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - prev = true; - } - if ((changeFlags & ICElementDelta.F_MOVED_TO) != 0) { - if (prev) - buffer.append(" | "); //$NON-NLS-1$ - //buffer.append("MOVED_TO(" + ((CElement)getMovedToElement()).toStringWithAncestors() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ - prev = true; - } - if ((changeFlags & ICElementDelta.F_MODIFIERS) != 0) { - if (prev) - buffer.append(" | "); //$NON-NLS-1$ - buffer.append("MODIFIERS CHANGED"); //$NON-NLS-1$ - prev = true; - } - //if ((changeFlags & ICElementDelta.F_SUPER_TYPES) != 0) { - // if (prev) - // buffer.append(" | "); //$NON-NLS-1$ - // buffer.append("SUPER TYPES CHANGED"); //$NON-NLS-1$ - // prev = true; - //} - if ((changeFlags & ICElementDelta.F_FINE_GRAINED) != 0) { - if (prev) - buffer.append(" | "); //$NON-NLS-1$ - buffer.append("FINE GRAINED"); //$NON-NLS-1$ - prev = true; - } - buffer.append("}"); //$NON-NLS-1$ - ICElementDelta[] children = getAffectedChildren(); - if (children != null) { - for (int i = 0; i < children.length; ++i) { - buffer.append("\n"); //$NON-NLS-1$ - buffer.append(((CElementDelta) children[i]).toDebugString(depth + 1)); - } - } - - for (int i = 0; i < resourceDeltasCounter; i++) { - buffer.append("\n");//$NON-NLS-1$ - for (int j = 0; j < depth+1; j++) { - buffer.append('\t'); - } - IResourceDelta resourceDelta = resourceDeltas[i]; - buffer.append(resourceDelta.toString()); - buffer.append("["); //$NON-NLS-1$ - switch (resourceDelta.getKind()) { - case IResourceDelta.ADDED : - buffer.append('+'); - break; - case IResourceDelta.REMOVED : - buffer.append('-'); - break; - case IResourceDelta.CHANGED : - buffer.append('*'); - break; - default : - buffer.append('?'); - break; - } - buffer.append("]"); //$NON-NLS-1$ - } - return buffer.toString(); - } - - /** - * Returns a string representation of this delta's - * structure suitable for debug purposes. - */ - public String toString() { - return toDebugString(0); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java deleted file mode 100644 index 579ef48f8e5..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDeltaBuilder.java +++ /dev/null @@ -1,401 +0,0 @@ -package org.eclipse.cdt.internal.core.model; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.IParent; - -/** - * A C element delta biulder creates a C element delta on a C element between - * the version of the C element at the time the comparator was created and the - * current version of the C element. - * - * It performs this operation by locally caching the contents of - * the C element when it is created. When the method buildDeltas() is called, it - * creates a delta over the cached contents and the new contents. - * - * This class is similar to the JDT CElementDeltaBuilder class. - */ - -public class CElementDeltaBuilder { - - /** - * The c element handle - */ - ICElement cElement; - - /** - * The maximum depth in the C element children we should look into - */ - int maxDepth = Integer.MAX_VALUE; - - /** - * The old handle to info relationships - */ - Map infos; - - /** - * The old position info - */ - Map oldPositions; - - /** - * The new position info - */ - Map newPositions; - - /** - * Change delta - */ - CElementDelta delta; - - /** - * List of added elements - */ - ArrayList added; - - /** - * List of removed elements - */ - ArrayList removed; - - /** - * Doubly linked list item - */ - class ListItem { - public ICElement previous; - public ICElement next; - - public ListItem(ICElement previous, ICElement next) { - this.previous = previous; - this.next = next; - } - } -/** - * Creates a C element comparator on a C element - * looking as deep as necessary. - */ -public CElementDeltaBuilder(ICElement CElement) { - this.cElement = CElement; - this.initialize(); - this.recordElementInfo(CElement,0); -} -/** - * Creates a C element comparator on a C element - * looking only 'maxDepth' levels deep. - */ -public CElementDeltaBuilder(ICElement cElement, int maxDepth) { - this.cElement = cElement; - this.maxDepth = maxDepth; - this.initialize(); - this.recordElementInfo(cElement,0); -} -/** - * Repairs the positioning information - * after an element has been added - */ -private void added(ICElement element) { - this.added.add(element); - ListItem current = this.getNewPosition(element); - ListItem previous = null, next = null; - if (current.previous != null) - previous = this.getNewPosition(current.previous); - if (current.next != null) - next = this.getNewPosition(current.next); - if (previous != null) - previous.next = current.next; - if (next != null) - next.previous = current.previous; -} -/** - * Builds the C element deltas between the old content of the translation unit - * and its new content. - */ -public void buildDeltas() { - this.recordNewPositions(this.cElement, 0); - this.findAdditions(this.cElement, 0); - this.findDeletions(); - this.findChangesInPositioning(this.cElement, 0); - this.trimDelta(this.delta); -} -/** - * Finds elements which have been added or changed. - */ -private void findAdditions(ICElement newElement, int depth) { - CElementInfo oldInfo = this.getElementInfo(newElement); - if (oldInfo == null && depth < this.maxDepth) { - this.delta.added(newElement); - added(newElement); - } else { - this.removeElementInfo(newElement); - } - - if (depth >= this.maxDepth) { - // mark element as changed - this.delta.changed(newElement, ICElementDelta.F_CONTENT); - return; - } - - CElementInfo newInfo = null; - newInfo = ((CElement)newElement).getElementInfo(); - - this.findContentChange(oldInfo, newInfo, newElement); - - if (oldInfo != null && newElement instanceof IParent) { - - ICElement[] children = newInfo.getChildren(); - if (children != null) { - int length = children.length; - for(int i = 0; i < length; i++) { - this.findAdditions(children[i], depth + 1); - } - } - } -} -/** - * Looks for changed positioning of elements. - */ -private void findChangesInPositioning(ICElement element, int depth) { - if (depth >= this.maxDepth || this.added.contains(element) || this.removed.contains(element)) - return; - - if (!isPositionedCorrectly(element)) { - this.delta.removed(element); - this.delta.added(element); - } - - if (element instanceof IParent) { - CElementInfo info = null; - info = ((CElement)element).getElementInfo(); - - ICElement[] children = info.getChildren(); - if (children != null) { - int length = children.length; - for(int i = 0; i < length; i++) { - this.findChangesInPositioning(children[i], depth + 1); - } - } - } -} -/** - * The elements are equivalent, but might have content changes. - */ -private void findContentChange(CElementInfo oldInfo, CElementInfo newInfo, ICElement newElement) { - if (oldInfo instanceof SourceManipulationInfo && newInfo instanceof SourceManipulationInfo) { - SourceManipulationInfo oldSourceInfo = (SourceManipulationInfo) oldInfo; - SourceManipulationInfo newSourceInfo = (SourceManipulationInfo) newInfo; - - if ((oldSourceInfo).getModifiers() != (newSourceInfo).getModifiers()) { - this.delta.changed(newElement, ICElementDelta.F_MODIFIERS); - } - - // The element info should be able to tell if the contents are the same. - if(!oldSourceInfo.hasSameContentsAs(newSourceInfo)){ - this.delta.changed(newElement, ICElementDelta.F_CONTENT); - } - } -} -/** - * Adds removed deltas for any handles left in the table - */ -private void findDeletions() { - Iterator iter = this.infos.keySet().iterator(); - while(iter.hasNext()) { - ICElement element = (ICElement)iter.next(); - this.delta.removed(element); - this.removed(element); - } -} -private CElementInfo getElementInfo(ICElement element) { - return (CElementInfo)this.infos.get(element); -} -private ListItem getNewPosition(ICElement element) { - return (ListItem)this.newPositions.get(element); -} -private ListItem getOldPosition(ICElement element) { - return (ListItem)this.oldPositions.get(element); -} -private void initialize() { - this.infos = new HashMap(20); - this.oldPositions = new HashMap(20); - this.newPositions = new HashMap(20); - this.putOldPosition(this.cElement, new ListItem(null, null)); - this.putNewPosition(this.cElement, new ListItem(null, null)); - this.delta = new CElementDelta(cElement); - - // if building a delta on a translation unit or below, - // it's a fine grained delta - if (cElement.getElementType() >= ICElement.C_UNIT) { - this.delta.fineGrained(); - } - - this.added = new ArrayList(5); - this.removed = new ArrayList(5); -} -/** - * Inserts position information for the elements into the new or old positions table - */ -private void insertPositions(ICElement[] elements, boolean isNew) { - int length = elements.length; - ICElement previous = null, current = null, next = (length > 0) ? elements[0] : null; - for(int i = 0; i < length; i++) { - previous = current; - current = next; - next = (i + 1 < length) ? elements[i + 1] : null; - if (isNew) { - this.putNewPosition(current, new ListItem(previous, next)); - } else { - this.putOldPosition(current, new ListItem(previous, next)); - } - } -} -/** - * Returns true if the given elements represent the an equivalent declaration. - * - *

      NOTE: Since this comparison can be done with handle info only, - * none of the internal calls need to use the locally cached contents - * of the old translation unit. - */ -private boolean isIdentical(CElement e1, CElement e2) { - if (e1 == null ^ e2 == null) - return false; - - if (e1 == null) - return true; - - return e1.isIdentical(e2); -} -/** - * Answers true if the elements position has not changed. - * Takes into account additions so that elements following - * new elements will not appear out of place. - */ -private boolean isPositionedCorrectly(ICElement element) { - ListItem oldListItem = this.getOldPosition(element); - if (oldListItem == null) - return false; - ICElement oldPrevious = oldListItem.previous; - ListItem newListItem = this.getNewPosition(element); - if (newListItem == null) - return false; - ICElement newPrevious = newListItem.previous; - if (oldPrevious == newPrevious) - return true; - ICElement lastNewPrevious = null; - while(lastNewPrevious != newPrevious) { - if (isIdentical((CElement)oldPrevious, (CElement)newPrevious)) - return true; - lastNewPrevious = newPrevious; - // if newPrevious is null at this time we should exit the loop. - if (newPrevious == null) break; - newPrevious = (this.getNewPosition(newPrevious)).previous; - } - return false; -} -private void putElementInfo(ICElement element, CElementInfo info) { - this.infos.put(element, info); -} -private void putNewPosition(ICElement element, ListItem position) { - this.newPositions.put(element, position); -} -private void putOldPosition(ICElement element, ListItem position) { - this.oldPositions.put(element, position); -} -/** - * Records this elements info, and attempts - * to record the info for the children. - */ -private void recordElementInfo(ICElement element, int depth) { - if (depth >= this.maxDepth) { - return; - } - CElementInfo info = (CElementInfo)CModelManager.getDefault().getInfo(element); - if (info == null) // no longer in the C model. - return; - this.putElementInfo(element, info); - - if (element instanceof IParent) { - ICElement[] children = info.getChildren(); - if (children != null) { - insertPositions(children, false); - for(int i = 0, length = children.length; i < length; i++) - recordElementInfo(children[i], depth + 1); - } - } -} -/** - * Fills the newPositions hashtable with the new position information - */ -private void recordNewPositions(ICElement newElement, int depth) { - if (depth < this.maxDepth && newElement instanceof IParent) { - CElementInfo info = null; - info = ((CElement)newElement).getElementInfo(); - - ICElement[] children = info.getChildren(); - if (children != null) { - insertPositions(children, true); - for(int i = 0, length = children.length; i < length; i++) { - recordNewPositions(children[i], depth + 1); - } - } - } -} -/** - * Repairs the positioning information - * after an element has been removed - */ -private void removed(ICElement element) { - this.removed.add(element); - ListItem current = this.getOldPosition(element); - ListItem previous = null, next = null; - if (current.previous != null) - previous = this.getOldPosition(current.previous); - if (current.next != null) - next = this.getOldPosition(current.next); - if (previous != null) - previous.next = current.next; - if (next != null) - next.previous = current.previous; - -} -private void removeElementInfo(ICElement element) { - this.infos.remove(element); -} -public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("Built delta:\n"); //$NON-NLS-1$ - buffer.append(this.delta.toString()); - return buffer.toString(); -} -/** - * Trims deletion deltas to only report the highest level of deletion - */ -private void trimDelta(CElementDelta delta) { - if (delta.getKind() == ICElementDelta.REMOVED) { - ICElementDelta[] children = delta.getAffectedChildren(); - for(int i = 0, length = children.length; i < length; i++) { - delta.removeAffectedChild((CElementDelta)children[i]); - } - } else { - ICElementDelta[] children = delta.getAffectedChildren(); - for(int i = 0, length = children.length; i < length; i++) { - trimDelta((CElementDelta)children[i]); - } - } -} - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java deleted file mode 100644 index 3c97f097417..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementInfo.java +++ /dev/null @@ -1,179 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.File; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IResource; - -/** - * Holds cached structure and properties for a C element. - * Subclassed to carry properties for specific kinds of elements. - */ -class CElementInfo { - - protected CElement element; - - /** - * Collection of handles of immediate children of this - * object. This is an empty array if this element has - * no children. - */ - protected ICElement[] fChildren; - - /** - * Shared empty collection used for efficiency. - */ - protected static ICElement[] fgEmptyChildren = new ICElement[]{}; - - /** - * Is the structure of this element known - * @see ICElement.isStructureKnown() - */ - protected boolean fIsStructureKnown = false; - - protected long modificationStamp = 0; - - protected CElementInfo(CElement element) { - this.element = element; - fChildren = fgEmptyChildren; - } - - protected CElement getElement() { - return element; - } - - protected void addChild(ICElement child) { - if (fChildren == fgEmptyChildren) { - setChildren(new ICElement[] {child}); - } else { - if (!includesChild(child)) { - setChildren(growAndAddToArray(fChildren, child)); - } - } - } - - protected ICElement[] getChildren() { - return fChildren; - } - - /** - * Adds the new element to a new array that contains all of the elements of the old array. - * Returns the new array. - */ - protected ICElement[] growAndAddToArray(ICElement[] array, ICElement addition) { - ICElement[] old = array; - array = new ICElement[old.length + 1]; - System.arraycopy(old, 0, array, 0, old.length); - array[old.length] = addition; - return array; - } - - /** - * Returns true if this child is in my children collection - */ - protected boolean includesChild(ICElement child) { - - for (int i= 0; i < fChildren.length; i++) { - if (fChildren[i].equals(child)) { - return true; - } - } - return false; - } - - /** - * @see ICElement.isStructureKnown() - */ - protected boolean isStructureKnown() { - return fIsStructureKnown; - } - - /** - * Returns an array with all the same elements as the specified array except for - * the element to remove. Assumes that the deletion is contained in the array. - */ - protected ICElement[] removeAndShrinkArray(ICElement[] array, ICElement deletion) { - ICElement[] old = array; - array = new ICElement[old.length - 1]; - int j = 0; - for (int i = 0; i < old.length; i++) { - if (!old[i].equals(deletion)) { - array[j] = old[i]; - } else { - System.arraycopy(old, i + 1, array, j, old.length - (i + 1)); - return array; - } - j++; - } - return array; - } - - protected void removeChild(ICElement child) { - if (includesChild(child)) { - setChildren(removeAndShrinkArray(fChildren, child)); - } - } - - protected void removeChildren () { - fChildren = fgEmptyChildren; - } - - protected void setChildren(ICElement[] children) { - fChildren = children; - } - - protected boolean hasChildren() { - return fChildren.length > 0; - } - - protected void setChanged() { - modificationStamp = 0; - } - - protected boolean hasChanged () { - IResource r = null; - boolean b = false; - r = getElement().getUnderlyingResource(); - if (r != null && r.exists()) { - long modif = 0; - switch(r.getType()) { - // Adding/Removing does not count as changing, in Eclipse - // Ask the underlying file system - case IResource.FOLDER: - case IResource.PROJECT: - case IResource.ROOT: - File file = r.getLocation().toFile(); - modif = file.lastModified(); - break; - - case IResource.FILE: - modif = r.getModificationStamp(); - break; - } - b = (modif != modificationStamp); - modificationStamp = modif; - } - return b; - } - - /** - * Sets whether the structure of this element known - * @see ICElement.isStructureKnown() - */ - protected void setIsStructureKnown(boolean newIsStructureKnown) { - fIsStructureKnown = newIsStructureKnown; - } - - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - throw new Error(); - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFileInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFileInfo.java deleted file mode 100644 index b440f88689a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CFileInfo.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -public class CFileInfo extends CElementInfo { - - /** - * Constructs a new C Model Info - */ - protected CFileInfo(CElement element) { - super(element); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java deleted file mode 100644 index b067ced75e0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CModel extends CContainer implements ICModel { - - public CModel () { - this(ResourcesPlugin.getWorkspace().getRoot()); - } - - public CModel(IWorkspaceRoot root) { - super (null, root, ICElement.C_MODEL); - } - - public ICProject getCProject(String name) { - IProject project = getWorkspace().getRoot().getProject(name); - return CModelManager.getDefault().create(project); - } - - public ICProject[] getCProjects() { - ArrayList list = getChildrenOfType(C_PROJECT); - ICProject[] array= new ICProject[list.size()]; - list.toArray(array); - return array; - } - - public IWorkspace getWorkspace() { - return getUnderlyingResource().getWorkspace(); - } - - public void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings, - String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException { - if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT ) { - runOperation(new CopyResourceElementsOperation(elements, containers, replace), elements, siblings, renamings, monitor); - } else { - throw new CModelException (new CModelStatus()); - //runOperation(new CopyElementsOperation(elements, containers, force), elements, siblings, renamings, monitor); - } - } - - public void delete(ICElement[] elements, boolean force, IProgressMonitor monitor) - throws CModelException { - if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) { - runOperation(new DeleteResourceElementsOperation(elements, force), monitor); - } else { - throw new CModelException (new CModelStatus()); - //runOperation(new DeleteElementsOperation(elements, force), monitor); - } - } - - public void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings, - String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException { - if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) { - runOperation(new MoveResourceElementsOperation(elements, containers, replace), elements, siblings, renamings, monitor); - } else { - throw new CModelException (new CModelStatus()); - //runOperation(new MoveElementsOperation(elements, containers, force), elements, siblings, renamings, monitor); - } - } - - public void rename(ICElement[] elements, ICElement[] destinations, String[] renamings, - boolean force, IProgressMonitor monitor) throws CModelException { - if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) { - runOperation(new RenameResourceElementsOperation(elements, destinations, - renamings, force), monitor); - } else { - throw new CModelException (new CModelStatus()); - //runOperation(new RenameElementsOperation(elements, containers, renamings, force), monitor); - } - } - - /** - * Configures and runs the MultiOperation. - */ - protected void runOperation(MultiOperation op, ICElement[] elements, ICElement[] siblings, String[] renamings, IProgressMonitor monitor) throws CModelException { - op.setRenamings(renamings); - if (siblings != null) { - for (int i = 0; i < elements.length; i++) { - op.setInsertBefore(elements[i], siblings[i]); - } - } - runOperation(op, monitor); - } - - protected CElementInfo createElementInfo () { - return new CModelInfo(this); - } - - // CHECKPOINT: Roots will return the hashcode of their resource - public int hashCode() { - return resource.hashCode(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java deleted file mode 100644 index 76ec66635fa..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java +++ /dev/null @@ -1,637 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import java.io.StringReader; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ITemplate; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IQuickParseCallback; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserUtil; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifierOwner; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ParserException; -import org.eclipse.cdt.internal.core.parser.util.ASTUtil; -import org.eclipse.core.resources.IProject; - - -public class CModelBuilder { - - private org.eclipse.cdt.internal.core.model.TranslationUnit translationUnit; - private Map newElements; - private IQuickParseCallback quickParseCallback; - private IASTCompilationUnit compilationUnit; - - public CModelBuilder(org.eclipse.cdt.internal.core.model.TranslationUnit tu) { - this.translationUnit = tu ; - this.newElements = new HashMap(); - } - - private IASTCompilationUnit parse( ITranslationUnit translationUnit, boolean quickParseMode, boolean throwExceptionOnError ) throws ParserException - { - IProject currentProject = null; - boolean hasCppNature = true; - String code = ""; - - // get the current project - if (translationUnit != null && translationUnit.getCProject() != null) { - currentProject = translationUnit.getCProject().getProject(); - } - // check the project's nature - if( currentProject != null ) - { - hasCppNature = CoreModel.getDefault().hasCCNature(currentProject); - } - // get the code to parse - try{ - code = translationUnit.getBuffer().getContents(); - } catch (CModelException e) { - - } - // use quick or structural parse mode - ParserMode mode = quickParseMode ? ParserMode.QUICK_PARSE : ParserMode.STRUCTURAL_PARSE; - if(quickParseMode) - quickParseCallback = ParserFactory.createQuickParseCallback(); - else - quickParseCallback = ParserFactory.createStructuralParseCallback(); - - // pick the language - ParserLanguage language = hasCppNature ? ParserLanguage.CPP : ParserLanguage.C; - - // create the parser - IParser parser = null; - try - { - - IScannerInfo scanInfo = new ScannerInfo(); - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(currentProject); - if (provider != null){ - IScannerInfo buildScanInfo = provider.getScannerInformation(currentProject); - if (buildScanInfo != null){ - scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths()); - } - } - - parser = ParserFactory.createParser( - ParserFactory.createScanner( - new StringReader( code ), - translationUnit.getUnderlyingResource().getLocation().toOSString(), - scanInfo, - mode, - language, - quickParseCallback, - ParserUtil.getParserLogService()) - ,quickParseCallback, - mode, - language, - ParserUtil.getParserLogService() ); - } - catch( ParserFactoryException pfe ) - { - throw new ParserException( "Parser/Scanner construction failure."); - } - // call parse - if( ! parser.parse() && throwExceptionOnError ) - throw new ParserException("Parse failure"); - return quickParseCallback.getCompilationUnit(); - } - - - public Map parse(boolean quickParseMode) throws Exception { - try - { - compilationUnit = parse( translationUnit, quickParseMode, true); - } - - catch( ParserException e ) - { - Util.debugLog( "Parse Exception in CModelBuilder", IDebugLogConstants.MODEL ); - //e.printStackTrace(); - } - long startTime = System.currentTimeMillis(); - try - { - generateModelElements(); - } - catch( NullPointerException npe ) - { - Util.debugLog( "NullPointer exception in CModelBuilder", IDebugLogConstants.MODEL); - //npe.printStackTrace(); - } - - // For the debuglog to take place, you have to call - // Util.setDebugging(true); - // Or set debug to true in the core plugin preference - Util.debugLog("CModel build: "+ ( System.currentTimeMillis() - startTime ) + "ms", IDebugLogConstants.MODEL); - return this.newElements; - - } - - private void generateModelElements(){ - Iterator i = quickParseCallback.iterateOffsetableElements(); - while (i.hasNext()){ - IASTOffsetableElement offsetable = (IASTOffsetableElement)i.next(); - if(offsetable instanceof IASTInclusion){ - createInclusion(translationUnit, (IASTInclusion) offsetable); - } - else if(offsetable instanceof IASTMacro){ - createMacro(translationUnit, (IASTMacro) offsetable); - }else if(offsetable instanceof IASTDeclaration){ - try{ - generateModelElements (translationUnit, (IASTDeclaration) offsetable); - } catch(ASTNotImplementedException e){ - } - } - } - } - - private void generateModelElements (Parent parent, IASTDeclaration declaration) throws ASTNotImplementedException - { - if(declaration instanceof IASTNamespaceDefinition ) { - generateModelElements(parent, (IASTNamespaceDefinition) declaration); - } - - if(declaration instanceof IASTAbstractTypeSpecifierDeclaration ) { - generateModelElements(parent, (IASTAbstractTypeSpecifierDeclaration) declaration); - } - - if(declaration instanceof IASTTemplateDeclaration ) { - generateModelElements(parent, (IASTTemplateDeclaration) declaration); - } - - if(declaration instanceof IASTTypedefDeclaration ) { - generateModelElements(parent, (IASTTypedefDeclaration) declaration); - } - - createSimpleElement(parent, declaration, false); - } - - private void generateModelElements (Parent parent, IASTNamespaceDefinition declaration) throws ASTNotImplementedException{ - // IASTNamespaceDefinition - IParent namespace = createNamespace(parent, declaration); - Iterator nsDecls = declaration.getDeclarations(); - while (nsDecls.hasNext()){ - IASTDeclaration subNsDeclaration = (IASTDeclaration) nsDecls.next(); - generateModelElements((Parent)namespace, subNsDeclaration); - } - } - - private void generateModelElements (Parent parent, IASTAbstractTypeSpecifierDeclaration abstractDeclaration) throws ASTNotImplementedException - { - // IASTAbstractTypeSpecifierDeclaration - CElement element = createAbstractElement(parent, abstractDeclaration, false); - } - - private void generateModelElements (Parent parent, IASTTemplateDeclaration templateDeclaration) throws ASTNotImplementedException - { - // Template Declaration - IASTDeclaration declaration = (IASTDeclaration)templateDeclaration.getOwnedDeclaration(); - if(declaration instanceof IASTAbstractTypeSpecifierDeclaration){ - IASTAbstractTypeSpecifierDeclaration abstractDeclaration = (IASTAbstractTypeSpecifierDeclaration)declaration ; - CElement element = createAbstractElement(parent, abstractDeclaration , true); - if(element != null){ - // set the element position - element.setPos(templateDeclaration.getStartingOffset(), templateDeclaration.getEndingOffset() - templateDeclaration.getStartingOffset()); - // set the template parameters - String[] parameterTypes = ASTUtil.getTemplateParameters(templateDeclaration); - ITemplate classTemplate = (ITemplate) element; - classTemplate.setTemplateParameterTypes(parameterTypes); - } - } - ITemplate template = null; - template = (ITemplate) createSimpleElement(parent, declaration, true); - - if(template != null){ - CElement element = (CElement)template; - // set the element position - element.setPos(templateDeclaration.getStartingOffset(), templateDeclaration.getEndingOffset() - templateDeclaration.getStartingOffset()); - // set the template parameters - String[] parameterTypes = ASTUtil.getTemplateParameters(templateDeclaration); - template.setTemplateParameterTypes(parameterTypes); - } - } - - private void generateModelElements (Parent parent, IASTTypedefDeclaration declaration) throws ASTNotImplementedException - { - TypeDef typeDef = createTypeDef(parent, declaration); - IASTAbstractDeclaration abstractDeclaration = declaration.getAbstractDeclarator(); - CElement element = createAbstractElement(parent, abstractDeclaration, false); - } - - private CElement createAbstractElement(Parent parent, IASTTypeSpecifierOwner abstractDeclaration, boolean isTemplate)throws ASTNotImplementedException{ - CElement element = null; - if(abstractDeclaration != null){ - IASTTypeSpecifier typeSpec = abstractDeclaration.getTypeSpecifier(); - // IASTEnumerationSpecifier - if ( typeSpec instanceof IASTEnumerationSpecifier){ - IASTEnumerationSpecifier enumSpecifier = (IASTEnumerationSpecifier) typeSpec; - IParent enumElement = createEnumeration (parent, enumSpecifier); - element = (CElement) enumElement; - } - // IASTClassSpecifier - else if (typeSpec instanceof IASTClassSpecifier){ - IASTClassSpecifier classSpecifier = (IASTClassSpecifier) typeSpec; - IParent classElement = createClass(parent, classSpecifier, isTemplate); - element = (CElement) classElement; - - // create the sub declarations - Iterator j = classSpecifier.getDeclarations(); - while (j.hasNext()){ - IASTDeclaration subDeclaration = (IASTDeclaration)j.next(); - generateModelElements((Parent)classElement, subDeclaration); - } // end while j - } else if (typeSpec instanceof IASTElaboratedTypeSpecifier){ - // This is not a model element, so we don't create anything here. - // However, do we need to do anything else? - } - } - return element; - } - - private CElement createSimpleElement(Parent parent, IASTDeclaration declaration, boolean isTemplate)throws ASTNotImplementedException{ - - CElement element = null; - if (declaration instanceof IASTVariable) - { - element = createVariableSpecification(parent, (IASTVariable)declaration, isTemplate); - } - // function or method - else if(declaration instanceof IASTFunction ) - { - element = createFunctionSpecification(parent, (IASTFunction)declaration, isTemplate); - } - return element; - } - - private Include createInclusion(Parent parent, IASTInclusion inclusion){ - // create element - Include element = new Include((CElement)parent, inclusion.getName(), !inclusion.isLocal()); - element.setFullPathName(inclusion.getFullFileName()); - // add to parent - parent.addChild((CElement) element); - // set position - element.setIdPos(inclusion.getNameOffset(), inclusion.getNameEndOffset() - inclusion.getNameOffset()); - element.setPos(inclusion.getStartingOffset(), inclusion.getEndingOffset() - inclusion.getStartingOffset()); - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private Macro createMacro(Parent parent, IASTMacro macro){ - // create element - org.eclipse.cdt.internal.core.model.Macro element = new Macro(parent, macro.getName()); - // add to parent - parent.addChild((CElement) element); - // set position - element.setIdPos(macro.getNameOffset(), macro.getNameEndOffset() - macro.getNameOffset()); - element.setPos(macro.getStartingOffset(), macro.getEndingOffset() - macro.getStartingOffset()); - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private Namespace createNamespace(Parent parent, IASTNamespaceDefinition nsDef){ - // create element - String type = "namespace"; - String nsName = (nsDef.getName() == null ) - ? "" - : nsDef.getName().toString(); - Namespace element = new Namespace ((ICElement)parent, nsName ); - // add to parent - parent.addChild((ICElement)element); - element.setIdPos(nsDef.getNameOffset(), - (nsName.length() == 0) ? type.length() : (nsDef.getNameEndOffset() - nsDef.getNameOffset())); - element.setPos(nsDef.getStartingOffset(), nsDef.getEndingOffset() - nsDef.getStartingOffset()); - element.setTypeName(type); - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private Enumeration createEnumeration(Parent parent, IASTEnumerationSpecifier enumSpecifier){ - // create element - String type = "enum"; - String enumName = (enumSpecifier.getName() == null ) - ? "" - : enumSpecifier.getName().toString(); - Enumeration element = new Enumeration ((ICElement)parent, enumName ); - // add to parent - parent.addChild((ICElement)element); - Iterator i = enumSpecifier.getEnumerators(); - while (i.hasNext()){ - // create sub element - IASTEnumerator enumDef = (IASTEnumerator) i.next(); - createEnumerator(element, enumDef); - } - // set enumeration position - element.setIdPos(enumSpecifier.getNameOffset(), - (enumName.length() == 0) ? type.length() : (enumSpecifier.getNameEndOffset() - enumSpecifier.getNameOffset() )); - element.setPos(enumSpecifier.getStartingOffset(), enumSpecifier.getEndingOffset() - enumSpecifier.getStartingOffset()); - element.setTypeName(type); - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private Enumerator createEnumerator(Parent enum, IASTEnumerator enumDef){ - Enumerator element = new Enumerator (enum, enumDef.getName().toString()); - // add to parent - enum.addChild(element); - // set enumerator position - element.setIdPos(enumDef.getStartingOffset(), (enumDef.getNameEndOffset() - enumDef.getNameOffset())); - element.setPos(enumDef.getStartingOffset(), enumDef.getEndingOffset() - enumDef.getStartingOffset()); - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private Structure createClass(Parent parent, IASTClassSpecifier classSpecifier, boolean isTemplate){ - // create element - String className = ""; - String type = ""; - int kind = ICElement.C_CLASS; - ASTClassKind classkind = classSpecifier.getClassKind(); - if(classkind == ASTClassKind.CLASS){ - if(!isTemplate) - kind = ICElement.C_CLASS; - else - kind = ICElement.C_TEMPLATE_CLASS; - type = "class"; - className = (classSpecifier.getName() == null ) - ? "" - : classSpecifier.getName().toString(); - } - if(classkind == ASTClassKind.STRUCT){ - if(!isTemplate) - kind = ICElement.C_STRUCT; - else - kind = ICElement.C_TEMPLATE_STRUCT; - type = "struct"; - className = (classSpecifier.getName() == null ) - ? "" - : classSpecifier.getName().toString(); - } - if(classkind == ASTClassKind.UNION){ - if(!isTemplate) - kind = ICElement.C_UNION; - else - kind = ICElement.C_TEMPLATE_UNION; - type = "union"; - className = (classSpecifier.getName() == null ) - ? "" - : classSpecifier.getName().toString(); - } - - Structure element; - if(!isTemplate){ - Structure classElement = new Structure( (CElement)parent, kind, className ); - element = classElement; - } else { - StructureTemplate classTemplate = new StructureTemplate( (CElement)parent, kind, className ); - element = classTemplate; - } - - // store super classes names - Iterator baseClauses = classSpecifier.getBaseClauses(); - while (baseClauses.hasNext()){ - IASTBaseSpecifier baseSpec = (IASTBaseSpecifier)baseClauses.next(); - element.addSuperClass(baseSpec.getParentClassName(), baseSpec.getAccess()); - } - - // add to parent - parent.addChild((ICElement) element); - // set element position - element.setIdPos( classSpecifier.getNameOffset(), - (className.length() == 0) ? type.length() : (classSpecifier.getNameEndOffset() - classSpecifier.getNameOffset() )); - element.setTypeName( type ); - if(!isTemplate){ - // set the element position - element.setPos(classSpecifier.getStartingOffset(), classSpecifier.getEndingOffset() - classSpecifier.getStartingOffset()); - } - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private TypeDef createTypeDef(Parent parent, IASTTypedefDeclaration typeDefDeclaration){ - // create the element - String name = typeDefDeclaration.getName(); - - TypeDef element = new TypeDef( parent, name ); - - StringBuffer typeName = new StringBuffer(ASTUtil.getType(typeDefDeclaration.getAbstractDeclarator())); - element.setTypeName(typeName.toString()); - - // add to parent - parent.addChild((CElement)element); - - // set positions - element.setIdPos(typeDefDeclaration.getNameOffset(), (typeDefDeclaration.getNameEndOffset() - typeDefDeclaration.getNameOffset())); - element.setPos(typeDefDeclaration.getStartingOffset(), typeDefDeclaration.getEndingOffset() - typeDefDeclaration.getStartingOffset()); - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private VariableDeclaration createVariableSpecification(Parent parent, IASTVariable varDeclaration, boolean isTemplate)throws ASTNotImplementedException - { - String variableName = varDeclaration.getName(); - if((variableName == null) || (variableName.length() <= 0)){ - // something is wrong, skip this element - return null; - } - - IASTAbstractDeclaration abstractDeclaration = varDeclaration.getAbstractDeclaration(); - CElement abstractElement = createAbstractElement (parent, abstractDeclaration , isTemplate); - - VariableDeclaration element = null; - if(varDeclaration instanceof IASTField){ - IASTField fieldDeclaration = (IASTField) varDeclaration; - // field - Field newElement = new Field( parent, variableName); - newElement.setMutable(fieldDeclaration.isMutable()); - newElement.setVisibility(fieldDeclaration.getVisiblity()); - element = newElement; - } - else { - if(isTemplate){ - // variable - VariableTemplate newElement = new VariableTemplate( parent, variableName ); - element = newElement; - }else { - if(varDeclaration.isExtern()){ - // variableDeclaration - VariableDeclaration newElement = new VariableDeclaration( parent, variableName ); - element = newElement; - } - else { - // variable - Variable newElement = new Variable( parent, variableName ); - element = newElement; - } - } - } - element.setTypeName ( ASTUtil.getType(varDeclaration.getAbstractDeclaration()) ); - element.setConst(varDeclaration.getAbstractDeclaration().isConst()); - element.setVolatile(varDeclaration.getAbstractDeclaration().isVolatile()); - element.setStatic(varDeclaration.isStatic()); - // add to parent - parent.addChild( element ); - - // set position - element.setIdPos( varDeclaration.getNameOffset(), (varDeclaration.getNameEndOffset() - varDeclaration.getNameOffset()) ); - if(!isTemplate){ - // set element position - element.setPos(varDeclaration.getStartingOffset(), varDeclaration.getEndingOffset() - varDeclaration.getStartingOffset()); - } - - this.newElements.put(element, element.getElementInfo()); - return element; - } - - private FunctionDeclaration createFunctionSpecification(Parent parent, IASTFunction functionDeclaration, boolean isTemplate) - { - String name = functionDeclaration.getName(); - if ((name == null) || (name.length() <= 0)) { - // Something is wrong, skip this element - return null; - } - - // get parameters types - String[] parameterTypes = ASTUtil.getFunctionParameterTypes(functionDeclaration); - - FunctionDeclaration element = null; - - if( functionDeclaration instanceof IASTMethod ) - { - IASTMethod methodDeclaration = (IASTMethod) functionDeclaration; - MethodDeclaration methodElement = null; - if (methodDeclaration.hasFunctionBody()) - { - // method - if(!isTemplate){ - Method newElement = new Method( parent, name ); - methodElement = newElement; - }else { - MethodTemplate newElement = new MethodTemplate(parent, name); - methodElement = newElement; - } - } - else - { - // method declaration - if(!isTemplate){ - MethodDeclaration newElement = new MethodDeclaration( parent, name ); - methodElement = newElement; - }else { - MethodTemplate newElement = new MethodTemplate(parent, name); - methodElement = newElement; - } - - } - methodElement.setParameterTypes(parameterTypes); - methodElement.setReturnType( ASTUtil.getType(functionDeclaration.getReturnType()) ); - methodElement.setStatic(functionDeclaration.isStatic()); - - // Common settings for method declaration - methodElement.setVisibility(methodDeclaration.getVisiblity()); - methodElement.setVolatile(methodDeclaration.isVolatile()); - methodElement.setConst(methodDeclaration.isConst()); - methodElement.setVirtual(methodDeclaration.isVirtual()); - methodElement.setPureVirtual(methodDeclaration.isPureVirtual()); - methodElement.setInline(methodDeclaration.isInline()); - methodElement.setFriend(methodDeclaration.isFriend()); - methodElement.setConstructor(methodDeclaration.isConstructor()); - methodElement.setDestructor(methodDeclaration.isDestructor()); - element = methodElement; - } - else // instance of IASTFunction - { - FunctionDeclaration functionElement = null; - if (functionDeclaration.hasFunctionBody()) - { - // function - if(!isTemplate){ - Function newElement = new Function( parent, name ); - functionElement = newElement; - } else { - FunctionTemplate newElement = new FunctionTemplate( parent, name ); - functionElement = newElement; - } - } - else - { - // functionDeclaration - if(!isTemplate){ - FunctionDeclaration newElement = new FunctionDeclaration( parent, name ); - functionElement = newElement; - } else { - FunctionTemplate newElement = new FunctionTemplate( parent, name ); - functionElement = newElement; - } - } - functionElement.setParameterTypes(parameterTypes); - functionElement.setReturnType( ASTUtil.getType(functionDeclaration.getReturnType()) ); - functionElement.setStatic(functionDeclaration.isStatic()); - element = functionElement; - } - // add to parent - parent.addChild( element ); - - // hook up the offsets - element.setIdPos( functionDeclaration.getNameOffset(), (functionDeclaration.getNameEndOffset() - functionDeclaration.getNameOffset()) ); - if(!isTemplate){ - // set the element position - element.setPos(functionDeclaration.getStartingOffset(), functionDeclaration.getEndingOffset() - functionDeclaration.getStartingOffset()); - } - - this.newElements.put(element, element.getElementInfo()); - return element; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java deleted file mode 100644 index a03ad056cd9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelCache.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.core.util.OverflowingLRUCache; - - -/** - * The cache of C elements to their respective info. - * - * This class is similar to the JDT CModelCache class. - */ -public class CModelCache { - public static final int PROJ_CACHE_SIZE = 50; - public static final int FOLDER_CACHE_SIZE = 500; - public static final int FILE_CACHE_SIZE = 2000; - public static final int CHILDREN_CACHE_SIZE = FILE_CACHE_SIZE * 20; - - /** - * Cache of open projects and roots. - */ - protected Map projectAndRootCache; - - /** - * Cache of open containers - */ - protected Map folderCache; - - /** - * Cache of open translation unit files - */ - protected OverflowingLRUCache fileCache; - - /** - * Cache of children of C elements - */ - protected Map childrenCache; - -public CModelCache() { - this.projectAndRootCache = new HashMap(PROJ_CACHE_SIZE); - this.folderCache = new HashMap(FOLDER_CACHE_SIZE); - this.fileCache = new ElementCache(FILE_CACHE_SIZE); - this.childrenCache = new HashMap(CHILDREN_CACHE_SIZE); // average 20 children per openable -} - -public double openableFillingRatio() { - return this.fileCache.fillingRatio(); -} - -/** - * Returns the info for the element. - */ -public Object getInfo(ICElement element) { - switch (element.getElementType()) { - case ICElement.C_MODEL: - case ICElement.C_PROJECT: - return this.projectAndRootCache.get(element); - case ICElement.C_CCONTAINER: - return this.folderCache.get(element); - case ICElement.C_ARCHIVE: - case ICElement.C_BINARY: - case ICElement.C_UNIT: - return this.fileCache.get(element); - default: - return this.childrenCache.get(element); - } -} - -/** - * Returns the info for this element without - * disturbing the cache ordering. - */ -protected Object peekAtInfo(ICElement element) { - switch (element.getElementType()) { - case ICElement.C_MODEL: - case ICElement.C_PROJECT: - return this.projectAndRootCache.get(element); - case ICElement.C_CCONTAINER: - return this.folderCache.get(element); - case ICElement.C_ARCHIVE: - case ICElement.C_BINARY: - case ICElement.C_UNIT: - return this.fileCache.peek(element); - default: - return this.childrenCache.get(element); - } -} - -/** - * Remember the info for the element. - */ -protected void putInfo(ICElement element, Object info) { - switch (element.getElementType()) { - case ICElement.C_MODEL: - case ICElement.C_PROJECT: - this.projectAndRootCache.put(element, info); - break; - case ICElement.C_CCONTAINER: - this.folderCache.put(element, info); - break; - case ICElement.C_ARCHIVE: - case ICElement.C_BINARY: - case ICElement.C_UNIT: - this.fileCache.put(element, info); - break; - default: - this.childrenCache.put(element, info); - } -} -/** - * Removes the info of the element from the cache. - */ -protected void removeInfo(ICElement element) { - switch (element.getElementType()) { - case ICElement.C_MODEL: - case ICElement.C_PROJECT: - this.projectAndRootCache.remove(element); - break; - case ICElement.C_CCONTAINER: - this.folderCache.remove(element); - break; - case ICElement.C_ARCHIVE: - case ICElement.C_BINARY: - case ICElement.C_UNIT: - this.fileCache.remove(element); - break; - default: - this.childrenCache.remove(element); - } -} - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelInfo.java deleted file mode 100644 index f2cac585ec8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelInfo.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * @see ICModel - */ -public class CModelInfo extends CContainerInfo { - - /** - * Constructs a new C Model Info - */ - protected CModelInfo(CElement element) { - super(element); - } - - /** - * Compute the non-C resources contained in this C project. - */ - private Object[] computeNonCResources() { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - int length = projects.length; - Object[] nonCProjects = null; - int index = 0; - for (int i = 0; i < length; i++) { - IProject project = projects[i]; - if (!CProject.hasCNature(project)) { - if (nonCProjects == null) { - nonCProjects = new Object[length]; - } - nonCProjects[index++] = project; - } - } - if (index == 0) return NO_NON_C_RESOURCES; - if (index < length) { - System.arraycopy(nonCProjects, 0, nonCProjects = new Object[index], 0, index); - } - return nonCProjects; - } - - /** - * Returns an array of non-C resources contained in the receiver. - */ - Object[] getNonCResources() { - if (nonCResources == null) { - nonCResources = computeNonCResources(); - } - return nonCResources; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java deleted file mode 100644 index 080f830872b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java +++ /dev/null @@ -1,885 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ElementChangedEvent; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IElementChangedListener; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CModelManager implements IResourceChangeListener { - - /** - * Unique handle onto the CModel - */ - final CModel cModel = new CModel(); - - public static HashSet OptionNames = new HashSet(20); - - /** - * Used to convert IResourceDeltas into ICElementDeltas. - */ - protected DeltaProcessor fDeltaProcessor = new DeltaProcessor(); - - /** - * Queue of deltas created explicily by the C Model that - * have yet to be fired. - */ - private ArrayList fCModelDeltas = new ArrayList(); - - /** - * Turns delta firing on/off. By default it is on. - */ - protected boolean fFire = true; - - /** - * Collection of listeners for C element deltas - */ - protected ArrayList fElementChangedListeners = new ArrayList(); - - /** - * A map from ITranslationUnit to IWorkingCopy of the shared working copies. - */ - public Map sharedWorkingCopies = new HashMap(); - /** - * Set of elements which are out of sync with their buffers. - */ - protected Map elementsOutOfSynchWithBuffers = new HashMap(11); - - /** - * Infos cache. - */ - protected CModelCache cache = new CModelCache(); - - /** - * This is a cache of the projects before any project addition/deletion has started. - */ - public ICProject[] cProjectsCache; - - /** - * The list of started BinaryRunners on projects. - */ - private HashMap binaryRunners = new HashMap(); - - /** - * Map of the binary parser for each project. - */ - private HashMap binaryParsersMap = new HashMap(); - - /** - * The lis of the SourceMappers on projects. - */ - private HashMap sourceMappers = new HashMap(); - - public static final String [] sourceExtensions = {"c", "cxx", "cc", "C", "cpp"}; - - public static final String [] headerExtensions = {"h", "hh", "hpp", "H"}; - - public static final IWorkingCopy[] NoWorkingCopy = new IWorkingCopy[0]; - - static CModelManager factory = null; - - private CModelManager() { - } - - public static CModelManager getDefault() { - if (factory == null) { - factory = new CModelManager(); - - // Register to the workspace; - ResourcesPlugin.getWorkspace().addResourceChangeListener(factory, - IResourceChangeEvent.PRE_AUTO_BUILD - | IResourceChangeEvent.POST_CHANGE - | IResourceChangeEvent.PRE_DELETE - | IResourceChangeEvent.PRE_CLOSE); - } - return factory; - } - - /** - * Returns the CModel for the given workspace, creating - * it if it does not yet exist. - */ - public ICModel getCModel(IWorkspaceRoot root) { - return getCModel(); - //return create(root); - } - - public ICModel getCModel() { - return cModel; - } - - public ICElement create (IPath path) { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - // Assume it is fullpath relative to workspace - IResource res = root.findMember(path); - if (res == null) { - IPath rootPath = root.getLocation(); - if (path.equals(rootPath)) - return getCModel(root); - res = root.getContainerForLocation(path); - if (res == null || !res.exists()) - res = root.getFileForLocation(path); - if (res != null && !res.exists()) - res = null; - } - // TODO: for extenal resources ?? - return create(res); - } - - public ICElement create (IResource resource) { - if (resource == null) { - return null; - } - int type = resource.getType(); - switch (type) { - case IResource.PROJECT : - return create((IProject)resource); - case IResource.FILE : - return create((IFile)resource); - case IResource.FOLDER : - return create((IFolder)resource); - case IResource.ROOT : - return create((IWorkspaceRoot)resource); - default : - return null; - } - } - - public ICElement create(ICElement parent, IResource resource) { - int type = resource.getType(); - switch (type) { - case IResource.PROJECT : - return create(parent, (IProject)resource); - case IResource.FILE : - return create(parent, (IFile)resource); - case IResource.FOLDER : - return create(parent, (IFolder)resource); - case IResource.ROOT : - return create((IWorkspaceRoot)resource); - default : - return null; - } - } - - public ICElement create(IFile file) { - IResource parent = file.getParent(); - ICElement cparent = null; - if (parent instanceof IFolder) { - cparent = create((IFolder)parent); - } else if (parent instanceof IProject) { - cparent = create((IProject)parent); - } - if (cparent != null) - return create(cparent, file); - return null; - } - - public ICElement create(ICElement parent, IFile file) { - return create(parent, file, null); - } - - public synchronized ICElement create(ICElement parent, IFile file, IBinaryFile bin) { - ICElement cfile = null; - - if (isTranslationUnit(file)) { - cfile = new TranslationUnit(parent, file); - } else if (file.exists()) { - // Try to create the binaryFile first. - if (bin == null) { - bin = createBinaryFile(file); - } - if (bin != null) { - if (bin.getType() == IBinaryFile.ARCHIVE) { - cfile = new Archive(parent, file); - } else { - cfile = new Binary(parent, file, bin); - } - } - } - // Added also to the Containers - if (cfile != null && (cfile instanceof IBinary || cfile instanceof IArchive)) { - if (bin == null) { - bin = createBinaryFile(file); - } - if (bin != null) { - if (bin.getType() == IBinaryFile.ARCHIVE) { - CProject cproj = (CProject)cfile.getCProject(); - ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer(); - container.addChild(cfile); - } else if (bin.getType() == IBinaryFile.EXECUTABLE || bin.getType() == IBinaryFile.SHARED) { - CProject cproj = (CProject)cfile.getCProject(); - BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer(); - container.addChild(cfile); - } - } - } - return cfile; - } - - public ICContainer create(IFolder folder) { - IResource parent = folder.getParent(); - ICElement cparent = null; - if (parent instanceof IFolder) { - cparent = create ((IFolder)parent); - } else if (parent instanceof IProject) { - cparent = create ((IProject)parent); - } - if (cparent != null) - return (ICContainer) create (cparent, folder); - return null; - } - - public ICContainer create(ICElement parent, IFolder folder) { - return new CContainer(parent, folder); - } - - public ICProject create(IProject project) { - IResource parent = project.getParent(); - ICElement celement = null; - if (parent instanceof IWorkspaceRoot) { - celement = create ((IWorkspaceRoot)parent); - } - return create(celement, project); - } - - public ICProject create(ICElement parent, IProject project) { - if (hasCNature(project)){ - return new CProject(parent, project); - } - return null; - } - - public ICModel create(IWorkspaceRoot root) { - return getCModel(); - //return new CModel(root); - } - - public void releaseCElement(ICElement celement) { - - // Guard. - if (celement == null) - return; - -//System.out.println("RELEASE " + celement.getElementName()); - - // Remove from the containers. - int type = celement.getElementType(); - if (type == ICElement.C_ARCHIVE) { -//System.out.println("RELEASE Archive " + cfile.getElementName()); - CProject cproj = (CProject)celement.getCProject(); - ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer(); - container.removeChild(celement); - } else if (type == ICElement.C_BINARY) { - if (! ((IBinary)celement).isObject()) { -//System.out.println("RELEASE Binary " + cfile.getElementName()); - CProject cproj = (CProject)celement.getCProject(); - BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer(); - container.removeChild(celement); - } - } - - if (celement instanceof IParent) { - if ( peekAtInfo(celement) != null ) { - CElementInfo info = ((CElement)celement).getElementInfo(); - if (info != null) { - ICElement[] children = info.getChildren(); - for (int i = 0; i < children.length; i++) { - releaseCElement(children[i]); - } - // Make sure we destroy the BinaryContainer and ArchiveContainer - // Since they are not part of the children. - if (info instanceof CProjectInfo) { - CProjectInfo pinfo = (CProjectInfo) info; - if (pinfo.vBin != null) { - releaseCElement(pinfo.vBin); - } - if (pinfo.vLib != null) { - releaseCElement(pinfo.vLib); - } - } - } - } else { - ICProject cproject = celement.getCProject(); - CProjectInfo info = (CProjectInfo)peekAtInfo(cproject); - if (info != null && info.vBin != null) { - if (peekAtInfo(info.vBin) != null) { - ICElement[] bins = info.getChildren(); - for (int i = 0; i < bins.length; i++) { - if (celement.getPath().isPrefixOf(bins[i].getPath())) { - CElementDelta delta = new CElementDelta(getCModel()); - delta.changed(info.vBin, ICElementDelta.CHANGED); - registerCModelDelta(delta); - info.vBin.removeChild(bins[i]); - } - } - } - } - if (info != null && info.vLib != null) { - if (peekAtInfo(info.vLib) != null) { - ICElement[] ars = info.vLib.getChildren(); - for (int i = 0; i < ars.length; i++) { - if (celement.getPath().isPrefixOf(ars[i].getPath())) { - CElementDelta delta = new CElementDelta(getCModel()); - delta.changed(info.vLib, ICElementDelta.CHANGED); - registerCModelDelta(delta); - info.vLib.removeChild(ars[i]); - } - } - } - } - } - } - - // Remove the child from the parent list. - Parent parent = (Parent)celement.getParent(); - if (parent != null) { - parent.removeChild(celement); - } - - removeInfo(celement); - } - - public IBinaryParser getBinaryParser(IProject project) { - try { - IBinaryParser parser = (IBinaryParser)binaryParsersMap.get(project); - if (parser == null) { - parser = CCorePlugin.getDefault().getBinaryParser(project); - } - if (parser != null) { - binaryParsersMap.put(project, parser); - return parser; - } - } catch (CoreException e) { - } - return new NullBinaryParser(); - } - - public IBinaryFile createBinaryFile(IFile file) { - try { - IBinaryParser parser = getBinaryParser(file.getProject()); - InputStream is = file.getContents(); - byte[] bytes = new byte[128]; - int count = is.read(bytes); - is.close(); - if (count > 0 && count < bytes.length) { - byte[] array = new byte[count]; - System.arraycopy(bytes, 0, array, 0, count); - bytes = array; - } - IPath location = file.getLocation(); - if (parser.isBinary(bytes, location)) { - return parser.getBinary(location); - } - } catch (IOException e) { - } catch (CoreException e) { - //e.printStackTrace(); - } - return null; - } - - /** - * TODO: this is a temporary hack until, the CDescriptor manager is - * in place and could fire deltas of Parser change. - */ - public void resetBinaryParser(IProject project) { - if (project != null) { - ICElement celement = create(project); - if (celement != null) { - // Let the function remove the children - // but it has the side of effect of removing the CProject also - // so we have to recall create again. - releaseCElement(celement); - binaryParsersMap.remove(project); - celement = create(project); - Parent parent = (Parent)celement.getParent(); - CElementInfo info = (CElementInfo)parent.getElementInfo(); - info.addChild(celement); - - // Fired and ICElementDelta.PARSER_CHANGED - CElementDelta delta = new CElementDelta(getCModel()); - delta.binaryParserChanged(celement); - registerCModelDelta(delta); - fire(); - } - } - } - - public boolean isSharedLib(IFile file) { - try { - IBinaryParser parser = getBinaryParser(file.getProject()); - IBinaryFile bin = parser.getBinary(file.getLocation()); - return (bin.getType() == IBinaryFile.SHARED); - } catch (IOException e) { - } - return false; - } - - public boolean isObject(IFile file) { - try { - IBinaryParser parser = getBinaryParser(file.getProject()); - IBinaryFile bin = parser.getBinary(file.getLocation()); - return (bin.getType() == IBinaryFile.OBJECT); - } catch (IOException e) { - } - return false; - } - - public boolean isExecutable(IFile file) { - try { - IBinaryParser parser = getBinaryParser(file.getProject()); - IBinaryFile bin = parser.getBinary(file.getLocation()); - return (bin.getType() == IBinaryFile.EXECUTABLE); - } catch (IOException e) { - //e.printStackTrace(); - } - return false; - } - - public boolean isBinary(IFile file) { - try { - IBinaryParser parser = getBinaryParser(file.getProject()); - IBinaryFile bin = parser.getBinary(file.getLocation()); - return (bin.getType() == IBinaryFile.EXECUTABLE - || bin.getType() == IBinaryFile.OBJECT - || bin.getType() == IBinaryFile.SHARED - || bin.getType() == IBinaryFile.CORE); - } catch (IOException e) { - } - return false; - } - - public boolean isArchive(IFile file) { - try { - IBinaryParser parser = getBinaryParser(file.getProject()); - IBinaryFile bin = parser.getBinary(file.getLocation()); - return (bin.getType() == IBinaryFile.ARCHIVE); - } catch (IOException e) { - } - return false; - } - - public boolean isTranslationUnit(IFile file) { - return isValidTranslationUnitName(file.getName()); - } - - public boolean isValidTranslationUnitName(String name){ - if (name == null) { - return false; - } - int index = name.lastIndexOf('.'); - if (index == -1) { - return false; - } - String ext = name.substring(index + 1); - String[] cexts = getTranslationUnitExtensions(); - for (int i = 0; i < cexts.length; i++) { - if (ext.equals(cexts[i])) - return true; - } - return false; - } - - public String[] getHeaderExtensions() { - return headerExtensions; - } - - public String[] getSourceExtensions() { - return sourceExtensions; - } - - public String[] getTranslationUnitExtensions() { - String[] headers = getHeaderExtensions(); - String[] sources = getSourceExtensions(); - String[] cexts = new String[headers.length + sources.length]; - System.arraycopy(sources, 0, cexts, 0, sources.length); - System.arraycopy(headers, 0, cexts, sources.length, headers.length); - return cexts; - } - - /* Only project with C nature and Open. */ - public boolean hasCNature (IProject p) { - boolean ok = false; - try { - ok = (p.isOpen() && p.hasNature(CProjectNature.C_NATURE_ID)); - } catch (CoreException e) { - //throws exception if the project is not open. - //System.out.println (e); - //e.printStackTrace(); - } - return ok; - } - - /* Only project with C++ nature and Open. */ - public boolean hasCCNature (IProject p) { - boolean ok = false; - try { - ok = (p.isOpen() && p.hasNature(CCProjectNature.CC_NATURE_ID)); - } catch (CoreException e) { - //throws exception if the project is not open. - //System.out.println (e); - //e.printStackTrace(); - } - return ok; - } - - public BinaryRunner getBinaryRunner(ICProject project) { - BinaryRunner runner = null; - synchronized(binaryRunners) { - runner = (BinaryRunner)binaryRunners.get(project.getProject()); - if (runner == null) { - runner = new BinaryRunner(project.getProject()); - binaryRunners.put(project.getProject(), runner); - runner.start(); - } - } - return runner; - } - - public SourceMapper getSourceMapper(ICProject cProject) { - SourceMapper mapper = null; - synchronized(sourceMappers) { - mapper = (SourceMapper) sourceMappers.get(cProject); - if (mapper == null) { - mapper = new SourceMapper(cProject); - sourceMappers.put(cProject, mapper); - } - } - return mapper; - } - /** - * addElementChangedListener method comment. - */ - public synchronized void addElementChangedListener(IElementChangedListener listener) { - if (fElementChangedListeners.indexOf(listener) < 0) { - fElementChangedListeners.add(listener); - } - } - - /** - * removeElementChangedListener method comment. - */ - public synchronized void removeElementChangedListener(IElementChangedListener listener) { - int i = fElementChangedListeners.indexOf(listener); - if (i != -1) { - fElementChangedListeners.remove(i); - } - } - - /** - * Registers the given delta with this manager. This API is to be - * used to registerd deltas that are created explicitly by the C - * Model. Deltas created as translations of IResourceDeltas - * are to be registered with #registerResourceDelta. - */ - public synchronized void registerCModelDelta(ICElementDelta delta) { - fCModelDeltas.add(delta); - } - - /** - * Notifies this C Model Manager that some resource changes have happened - * on the platform, and that the C Model should update any required - * internal structures such that its elements remain consistent. - * Translates IResourceDeltas into ICElementDeltas. - * - * @see IResourceDelta - * @see IResource - */ - public void resourceChanged(IResourceChangeEvent event) { - - if (event.getSource() instanceof IWorkspace) { - IResourceDelta delta = event.getDelta(); - IResource resource = event.getResource(); - switch(event.getType()){ - case IResourceChangeEvent.PRE_DELETE : - try{ - if (resource.getType() == IResource.PROJECT && - ( ((IProject)resource).hasNature(CProjectNature.C_NATURE_ID) || - ((IProject)resource).hasNature(CCProjectNature.CC_NATURE_ID) )){ - this.deleting((IProject) resource);} - }catch (CoreException e){ - } - break; - - case IResourceChangeEvent.PRE_AUTO_BUILD : - // No need now. - if(delta != null) { - this.checkProjectsBeingAddedOrRemoved(delta); - } - break; - - case IResourceChangeEvent.POST_CHANGE : - try { - if (delta != null) { - ICElementDelta[] translatedDeltas = fDeltaProcessor.processResourceDelta(delta); - if (translatedDeltas.length > 0) { - for (int i= 0; i < translatedDeltas.length; i++) { - registerCModelDelta(translatedDeltas[i]); - } - } - fire(); - } - } catch (Exception e) { - e.printStackTrace(); - } - break; - } - } - } - - /** - * Fire C Model deltas, flushing them after the fact. - * If the firing mode has been turned off, this has no effect. - */ - public synchronized void fire() { - if (fFire) { - mergeDeltas(); - try { - Iterator iterator = fCModelDeltas.iterator(); - while (iterator.hasNext()) { - ICElementDelta delta= (ICElementDelta) iterator.next(); - - // Refresh internal scopes - - ElementChangedEvent event= new ElementChangedEvent(delta); - // Clone the listeners since they could remove themselves when told about the event - // (eg. a type hierarchy becomes invalid (and thus it removes itself) when the type is removed - ArrayList listeners= (ArrayList) fElementChangedListeners.clone(); - for (int i= 0; i < listeners.size(); i++) { - IElementChangedListener listener= (IElementChangedListener) listeners.get(i); - listener.elementChanged(event); - } - } - } finally { - // empty the queue - this.flush(); - } - } - } - - /** - * Flushes all deltas without firing them. - */ - protected synchronized void flush() { - fCModelDeltas= new ArrayList(); - } - - /** - * Merged all awaiting deltas. - */ - private void mergeDeltas() { - if (fCModelDeltas.size() <= 1) - return; - - Iterator deltas = fCModelDeltas.iterator(); - ICElement cRoot = getCModel(); - CElementDelta rootDelta = new CElementDelta(cRoot); - boolean insertedTree = false; - while (deltas.hasNext()) { - CElementDelta delta = (CElementDelta)deltas.next(); - ICElement element = delta.getElement(); - if (cRoot.equals(element)) { - ICElementDelta[] children = delta.getAffectedChildren(); - for (int j = 0; j < children.length; j++) { - CElementDelta projectDelta = (CElementDelta) children[j]; - rootDelta.insertDeltaTree(projectDelta.getElement(), projectDelta); - insertedTree = true; - } - } else { - rootDelta.insertDeltaTree(element, delta); - insertedTree = true; - } - } - if (insertedTree) { - fCModelDeltas = new ArrayList(1); - fCModelDeltas.add(rootDelta); - } else { - fCModelDeltas = new ArrayList(0); - } - } - - /** - * Runs a C Model Operation - */ - public void runOperation(CModelOperation operation, IProgressMonitor monitor) throws CModelException { - boolean hadAwaitingDeltas = !fCModelDeltas.isEmpty(); - try { - if (operation.isReadOnly()) { - operation.run(monitor); - } else { - // use IWorkspace.run(...) to ensure that a build will be done in autobuild mode - getCModel().getUnderlyingResource().getWorkspace().run(operation, monitor); - } - } catch (CoreException ce) { - if (ce instanceof CModelException) { - throw (CModelException)ce; - } else { - if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) { - Throwable e= ce.getStatus().getException(); - if (e instanceof CModelException) { - throw (CModelException) e; - } - } - throw new CModelException(ce); - } - } finally { -// fire only if there were no awaiting deltas (if there were, they would come from a resource modifying operation) -// and the operation has not modified any resource - if (!hadAwaitingDeltas && !operation.hasModifiedResource()) { - fire(); - } // else deltas are fired while processing the resource delta - } - } - - /** - * Process the given delta and look for projects being added, opened, - * or closed - */ - public void checkProjectsBeingAddedOrRemoved(IResourceDelta delta) { - IResource resource = delta.getResource(); - switch (resource.getType()) { - case IResource.ROOT : - if (this.cProjectsCache == null) { - this.cProjectsCache = this.getCModel().getCProjects(); - } - - IResourceDelta[] children = delta.getAffectedChildren(); - for (int i = 0, length = children.length; i < length; i++) { - this.checkProjectsBeingAddedOrRemoved(children[i]); - } - break; - case IResource.PROJECT : - if (0 != (delta.getFlags() & IResourceDelta.OPEN)) { - IProject project = (IProject) resource; - if (!project.isOpen()) { - // project closing... stop the runner. - BinaryRunner runner = (BinaryRunner)binaryRunners.get(project); - if (runner != null ) { - runner.stop(); - } - } else { - if ( binaryRunners.get(project) == null ) { - // project opening... lets add the runner to the - // map but no need to start it since the deltas - // will populate containers - binaryRunners.put(project, new BinaryRunner(project)); - } - } - } else if (0 != (delta.getFlags() & IResourceDelta.REMOVED)) { - IProject project = (IProject) resource; - BinaryRunner runner = (BinaryRunner) binaryRunners.remove(project); - if (runner != null) { - runner.stop(); - } - binaryParsersMap.remove(project); - } - break; - } - } - - /** - * Returns the set of elements which are out of synch with their buffers. - */ - protected Map getElementsOutOfSynchWithBuffers() { - return this.elementsOutOfSynchWithBuffers; - } - - /** - * Returns the info for the element. - */ - public Object getInfo(ICElement element) { - return this.cache.getInfo(element); - } - /** - * Returns the info for this element without - * disturbing the cache ordering. - */ - protected Object peekAtInfo(ICElement element) { - return this.cache.peekAtInfo(element); - } - - /** - * Puts the info for a C Model Element - */ - protected void putInfo(ICElement element, Object info) { - this.cache.putInfo(element, info); - } - - /** - * Removes the info of this model element. - */ - protected void removeInfo(ICElement element) { - this.cache.removeInfo(element); - } - - /** - * - */ - public void startup() { - // Do any initialization. - } - - /** - * - */ - public void shutdown() { - if (this.fDeltaProcessor.indexManager != null){ // no more indexing - this.fDeltaProcessor.indexManager.shutdown(); - } - - // Do any shutdown of services. - ResourcesPlugin.getWorkspace().removeResourceChangeListener(factory); - - BinaryRunner[] runners = (BinaryRunner[])binaryRunners.values().toArray(new BinaryRunner[0]); - for (int i = 0; i < runners.length; i++) { - runners[i].stop(); - } - } - - public IndexManager getIndexManager() { - return this.fDeltaProcessor.indexManager; - } - - public void deleting(IProject project){ - // discard all indexing jobs for this project - this.getIndexManager().discardJobs(project.getName()); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java deleted file mode 100644 index f764c64c627..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java +++ /dev/null @@ -1,555 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import java.io.InputStream; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.SubProgressMonitor; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.CModelException; - -/** - * Defines behavior common to all C Model operations - */ -public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMonitor { - /** - * The elements this operation operates on, - * or null if this operation - * does not operate on specific elements. - */ - protected ICElement[] fElementsToProcess; - - /** - * The parent elements this operation operates with - * or null if this operation - * does not operate with specific parent elements. - */ - protected ICElement[] fParentElements; - - /** - * An empty collection of ICElements - the common - * empty result if no elements are created, or if this - * operation is not actually executed. - */ - protected static ICElement[] fgEmptyResult= new ICElement[] {}; - - /** - * Collection of ICElementDeltas created by this operation. - * This collection starts out null and becomes an - * array of ICElementDeltas if the operation creates any - * deltas. This collection is registered with the C Model notification - * manager if the operation completes successfully. - */ - protected ICElementDelta[] fDeltas= null; - - /** - * The elements created by this operation - empty - * until the operation actually creates elements. - */ - protected ICElement[] fResultElements= fgEmptyResult; - - /** - * The progress monitor passed into this operation - */ - protected IProgressMonitor fMonitor= null; - - /** - * A flag indicating whether this operation is nested. - */ - protected boolean fNested = false; - - /** - * Conflict resolution policy - by default do not force (fail on a conflict). - */ - protected boolean fForce= false; - - /* - * Whether the operation has modified resources, and thus whether resource - * delta notifcation will happen. - */ - protected boolean hasModifiedResource = false; - - protected CModelOperation() { - } - /** - * A common constructor for all C Model operations. - */ - protected CModelOperation(ICElement[] elements) { - fElementsToProcess = elements; - } - - /** - * Common constructor for all C Model operations. - */ - protected CModelOperation(ICElement[] elementsToProcess, ICElement[] parentElements) { - fElementsToProcess = elementsToProcess; - fParentElements= parentElements; - } - - /** - * A common constructor for all C Model operations. - */ - protected CModelOperation(ICElement[] elementsToProcess, ICElement[] parentElements, boolean force) { - fElementsToProcess = elementsToProcess; - fParentElements= parentElements; - fForce= force; - } - - /** - * A common constructor for all C Model operations. - */ - protected CModelOperation(ICElement[] elements, boolean force) { - fElementsToProcess = elements; - fForce= force; - } - - /** - * Common constructor for all C Model operations. - */ - protected CModelOperation(ICElement element) { - fElementsToProcess = new ICElement[]{element}; - } - - /** - * A common constructor for all C Model operations. - */ - protected CModelOperation(ICElement element, boolean force) { - fElementsToProcess = new ICElement[]{element}; - fForce= force; - } - - /** - * Adds the given delta to the collection of deltas - * that this operation has created. These deltas are - * automatically registered with the C Model Manager - * when the operation completes. - */ - protected void addDelta(ICElementDelta delta) { - if (fDeltas == null) { - fDeltas= new ICElementDelta[] {delta}; - } else { - ICElementDelta[] copy= new ICElementDelta[fDeltas.length + 1]; - System.arraycopy(fDeltas, 0, copy, 0, fDeltas.length); - copy[fDeltas.length]= delta; - fDeltas= copy; - } - } - - /** - * @see IProgressMonitor - */ - public void beginTask(String name, int totalWork) { - if (fMonitor != null) { - fMonitor.beginTask(name, totalWork); - } - } - - /** - * Checks with the progress monitor to see whether this operation - * should be canceled. An operation should regularly call this method - * during its operation so that the user can cancel it. - * - * @exception OperationCanceledException if cancelling the operation has been requested - * @see IProgressMonitor#isCanceled - */ - protected void checkCanceled() { - if (isCanceled()) { - throw new OperationCanceledException("operation.cancelled"); //$NON-NLS-1$ - } - } - - /** - * Common code used to verify the elements this operation is processing. - * @see CModelOperation#verify() - */ - protected ICModelStatus commonVerify() { - if (fElementsToProcess == null || fElementsToProcess.length == 0) { - return new CModelStatus(ICModelStatusConstants.NO_ELEMENTS_TO_PROCESS); - } - for (int i = 0; i < fElementsToProcess.length; i++) { - if (fElementsToProcess[i] == null) { - return new CModelStatus(ICModelStatusConstants.NO_ELEMENTS_TO_PROCESS); - } - } - return CModelStatus.VERIFIED_OK; - } - - /** - * Convenience method to copy resources - */ - protected void copyResources(IResource[] resources, IPath destinationPath) throws CModelException { - IProgressMonitor subProgressMonitor = getSubProgressMonitor(resources.length); - IWorkspace workspace = resources[0].getWorkspace(); - try { - workspace.copy(resources, destinationPath, false, subProgressMonitor); - this.hasModifiedResource = true; - } catch (CoreException e) { - throw new CModelException(e); - } - } - - /** - * Convenience method to create a file - */ - protected void createFile(IContainer folder, String name, InputStream contents, boolean force) throws CModelException { - IFile file= folder.getFile(new Path(name)); - try { - file.create(contents, force, getSubProgressMonitor(1)); - this.hasModifiedResource = true; - } catch (CoreException e) { - throw new CModelException(e); - } - } - - /** - * Convenience method to create a folder - */ - protected void createFolder(IContainer parentFolder, String name, boolean force) throws CModelException { - IFolder folder= parentFolder.getFolder(new Path(name)); - try { - // we should use true to create the file locally. Only VCM should use tru/false - folder.create(force, true, getSubProgressMonitor(1)); - this.hasModifiedResource = true; - } catch (CoreException e) { - throw new CModelException(e); - } - } - - /** - * Convenience method to delete a resource - */ - protected void deleteResource(IResource resource, boolean force) throws CModelException { - try { - resource.delete(force, getSubProgressMonitor(1)); - this.hasModifiedResource = true; - } catch (CoreException e) { - throw new CModelException(e); - } - } - - /** - * Convenience method to delete resources - */ - protected void deleteResources(IResource[] resources, boolean force) throws CModelException { - if (resources == null || resources.length == 0) return; - IProgressMonitor subProgressMonitor = getSubProgressMonitor(resources.length); - IWorkspace workspace = resources[0].getWorkspace(); - try { - workspace.delete(resources, force, subProgressMonitor); - this.hasModifiedResource = true; - } catch (CoreException e) { - throw new CModelException(e); - } - } - - /** - * @see IProgressMonitor - */ - public void done() { - if (fMonitor != null) { - fMonitor.done(); - } - } - - /** - * Verifies the operation can proceed and executes the operation. - * Subclasses should override #verify and - * executeOperation to implement the specific operation behavior. - * - * @exception CModelException The operation has failed. - */ - protected void execute() throws CModelException { - ICModelStatus status= verify(); - if (status.isOK()) { - executeOperation(); - } else { - throw new CModelException(status); - } - } - - /** - * Convenience method to run an operation within this operation - */ - public void executeNestedOperation(CModelOperation operation, int subWorkAmount) throws CModelException { - IProgressMonitor subProgressMonitor = getSubProgressMonitor(subWorkAmount); - // fix for 1FW7IKC, part (1) - try { - operation.setNested(true); - operation.run(subProgressMonitor); - if (operation.hasModifiedResource()) { - this.hasModifiedResource = true; - } - //accumulate the nested operation deltas - if (operation.fDeltas != null) { - for (int i = 0; i < operation.fDeltas.length; i++) { - addDelta(operation.fDeltas[i]); - } - } - } catch (CoreException ce) { - if (ce instanceof CModelException) { - throw (CModelException)ce; - } else { - // translate the core exception to a c model exception - if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) { - Throwable e = ce.getStatus().getException(); - if (e instanceof CModelException) { - throw (CModelException) e; - } - } - throw new CModelException(ce); - } - } - } - - /** - * Performs the operation specific behavior. Subclasses must override. - */ - protected abstract void executeOperation() throws CModelException; - - /** - * Returns the elements to which this operation applies, - * or null if not applicable. - */ - protected ICElement[] getElementsToProcess() { - return fElementsToProcess; - } - - /** - * Returns the element to which this operation applies, - * or null if not applicable. - */ - protected ICElement getElementToProcess() { - if (fElementsToProcess == null || fElementsToProcess.length == 0) { - return null; - } - return fElementsToProcess[0]; - } - - /** - * Returns the C Model this operation is operating in. - */ - public ICModel getCModel() { - if (fElementsToProcess == null || fElementsToProcess.length == 0) { - return getParentElement().getCModel(); - } else { - return fElementsToProcess[0].getCModel(); - } - } - - /** - * Returns the parent element to which this operation applies, - * or null if not applicable. - */ - protected ICElement getParentElement() { - if (fParentElements == null || fParentElements.length == 0) { - return null; - } - return fParentElements[0]; - } - - /** - * Returns the parent elements to which this operation applies, - * or null if not applicable. - */ - protected ICElement[] getParentElements() { - return fParentElements; - } - - /** - * Returns the elements created by this operation. - */ - public ICElement[] getResultElements() { - return fResultElements; - } - - /** - * Creates and returns a subprogress monitor if appropriate. - */ - protected IProgressMonitor getSubProgressMonitor(int workAmount) { - IProgressMonitor sub = null; - if (fMonitor != null) { - sub = new SubProgressMonitor(fMonitor, workAmount, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - } - return sub; - } - - /** - * Returns the IWorkspace this operation is working in, or - * null if this operation has no elements to process. - */ - protected IWorkspace getWorkspace() { - if (fElementsToProcess != null && fElementsToProcess.length > 0) { - ICProject project = fElementsToProcess[0].getCProject(); - if (project != null) { - return project.getCModel().getWorkspace(); - } - } - return null; - } - - /** - * Returns whether this operation has performed any resource modifications. - * Returns false if this operation has not been executed yet. - */ - public boolean hasModifiedResource() { - return !this.isReadOnly() && this.hasModifiedResource; - } - - public void internalWorked(double work) { - if (fMonitor != null) { - fMonitor.internalWorked(work); - } - } - - /** - * @see IProgressMonitor - */ - public boolean isCanceled() { - if (fMonitor != null) { - return fMonitor.isCanceled(); - } - return false; - } - - /** - * Returns true if this operation performs no resource modifications, - * otherwise false. Subclasses must override. - */ - public boolean isReadOnly() { - return false; - } - - /** - * Convenience method to move resources - */ - protected void moveResources(IResource[] resources, IPath destinationPath) throws CModelException { - IProgressMonitor subProgressMonitor = null; - if (fMonitor != null) { - subProgressMonitor = new SubProgressMonitor(fMonitor, resources.length, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - } - IWorkspace workspace = resources[0].getWorkspace(); - try { - workspace.move(resources, destinationPath, false, subProgressMonitor); - this.hasModifiedResource = true; - } catch (CoreException e) { - throw new CModelException(e); - } - } - - /** - * Creates and returns a new ICElementDelta - * on the C Model. - */ - public CElementDelta newCElementDelta() { - return new CElementDelta(getCModel()); - } - - /** - * Registers any deltas this operation created, with the - * C Model manager. - */ - protected void registerDeltas() { - if (fDeltas != null && !fNested) { - // hook to ensure working copies remain consistent - //makeWorkingCopiesConsistent(fDeltas); - CModelManager manager= CModelManager.getDefault(); - for (int i= 0; i < fDeltas.length; i++) { - manager.registerCModelDelta(fDeltas[i]); - } - } - } - - /** - * Main entry point for C Model operations. Executes this operation - * and registers any deltas created. - * - * @see IWorkspaceRunnable - * @exception CoreException if the operation fails - */ - public void run(IProgressMonitor monitor) throws CoreException { - try { - fMonitor = monitor; - execute(); - } finally { - registerDeltas(); - } - } - - /** - * @see IProgressMonitor - */ - public void setCanceled(boolean b) { - if (fMonitor != null) { - fMonitor.setCanceled(b); - } - } - - /** - * Sets whether this operation is nested or not. - * @see CreateElementInCUOperation#checkCanceled - */ - protected void setNested(boolean nested) { - fNested = nested; - } - - /** - * @see IProgressMonitor - */ - public void setTaskName(String name) { - if (fMonitor != null) { - fMonitor.setTaskName(name); - } - } - - /** - * @see IProgressMonitor - */ - public void subTask(String name) { - if (fMonitor != null) { - fMonitor.subTask(name); - } - } - /** - * Returns a status indicating if there is any known reason - * this operation will fail. Operations are verified before they - * are run. - * - * Subclasses must override if they have any conditions to verify - * before this operation executes. - * - * @see ICModelStatus - */ - protected ICModelStatus verify() { - return commonVerify(); - } - - /** - * @see IProgressMonitor - */ - public void worked(int work) { - if (fMonitor != null) { - fMonitor.worked(work); - checkCanceled(); - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java deleted file mode 100644 index 274501145d3..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java +++ /dev/null @@ -1,263 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * @see ICModelStatus - */ - -public class CModelStatus extends Status implements ICModelStatus, ICModelStatusConstants, IResourceStatus { - - /** - * The elements related to the failure, or null - * if no elements are involved. - */ - protected ICElement[] fElements = new ICElement[0]; - /** - * The path related to the failure, or null - * if no path is involved. - */ - protected IPath fPath; - /** - * The String related to the failure, or null - * if no String is involved. - */ - protected String fString; - /** - * Empty children - */ - protected final static IStatus[] fgEmptyChildren = new IStatus[] {}; - protected IStatus[] fChildren= fgEmptyChildren; - - /** - * Singleton OK object - */ - public static final ICModelStatus VERIFIED_OK = new CModelStatus(OK, OK, org.eclipse.cdt.internal.core.Util.bind("status.OK"));; - - /** - * Constructs an C model status with no corresponding elements. - */ - public CModelStatus() { - // no code for an multi-status - super(ERROR, CCorePlugin.PLUGIN_ID, 0, "CModelStatus", null); //$NON-NLS-1$ - } - - /** - * Constructs an C model status with no corresponding elements. - */ - public CModelStatus(int code) { - super(ERROR, CCorePlugin.PLUGIN_ID, code, "CModelStatus", null); //$NON-NLS-1$ - fElements= CElementInfo.fgEmptyChildren; - } - - /** - * Constructs an C model status with the given corresponding - * elements. - */ - public CModelStatus(int code, ICElement[] elements) { - super(ERROR, CCorePlugin.PLUGIN_ID, code, "CModelStatus", null); //$NON-NLS-1$ - fElements= elements; - fPath= null; - } - - /** - * Constructs an C model status with no corresponding elements. - */ - public CModelStatus(int code, String string) { - this(ERROR, code, string); - } - - public CModelStatus(int severity, int code, String string) { - super(severity, CCorePlugin.PLUGIN_ID, code, "CModelStatus", null); //$NON-NLS-1$ - fElements= CElementInfo.fgEmptyChildren; - fPath= null; - fString = string; - } - - /** - * Constructs an C model status with no corresponding elements. - */ - public CModelStatus(int code, Throwable throwable) { - super(ERROR, CCorePlugin.PLUGIN_ID, code, "CModelStatus", throwable); //$NON-NLS-1$ - fElements= CElementInfo.fgEmptyChildren; - } - - /** - * Constructs an C model status with no corresponding elements. - */ - public CModelStatus(int code, IPath path) { - super(ERROR, CCorePlugin.PLUGIN_ID, code, "CModelStatus", null); //$NON-NLS-1$ - fElements= CElementInfo.fgEmptyChildren; - fPath= path; - } - - /** - * Constructs an C model status with the given corresponding - * element. - */ - public CModelStatus(int code, ICElement element) { - this(code, new ICElement[]{element}); - } - - /** - * Constructs an C model status with the given corresponding - * element and string - */ - public CModelStatus(int code, ICElement element, String string) { - this(code, new ICElement[]{element}); - fString= string; - } - - public CModelStatus(int code, ICElement element, IPath path) { - this(code, new ICElement[]{element}); - fPath = path; - } - - /** - * Constructs an C model status with no corresponding elements. - */ - public CModelStatus(CoreException coreException) { - super(ERROR, CCorePlugin.PLUGIN_ID, CORE_EXCEPTION, "CModelStatus", coreException); //$NON-NLS-1$ - //fElements= CElementInfo.fgEmptyChildren; - } - - protected int getBits() { - int severity = 1 << (getCode() % 100 / 33); - int category = 1 << ((getCode() / 100) + 3); - return severity | category; - } - - /** - * @see IStatus - */ - public IStatus[] getChildren() { - return fChildren; - } - - /** - * @see ICModelStatus - */ - public ICElement[] getElements() { - return fElements; - } - - /** - * Returns the message that is relevant to the code of this status. - */ - public String getMessage() { - return "Error in C Plugin"; - } - /** - * @see IOperationStatus - */ - public IPath getPath() { - return fPath; - } - - /** - * @see IStatus - */ - public int getSeverity() { - if (fChildren == fgEmptyChildren) return super.getSeverity(); - int severity = -1; - for (int i = 0, max = fChildren.length; i < max; i++) { - int childrenSeverity = fChildren[i].getSeverity(); - if (childrenSeverity > severity) { - severity = childrenSeverity; - } - } - return severity; - } - - /** - * @see ICModelStatus - */ - public String getString() { - return fString; - } - - /** - * @see ICModelStatus - */ - public boolean doesNotExist() { - return getCode() == ELEMENT_DOES_NOT_EXIST; - } - - /** - * @see IStatus - */ - public boolean isMultiStatus() { - return fChildren != fgEmptyChildren; - } - - /** - * @see ICModelStatus - */ - public boolean isOK() { - return getCode() == OK; - } - - /** - * @see IStatus#matches - */ - public boolean matches(int mask) { - if (! isMultiStatus()) { - return matches(this, mask); - } else { - for (int i = 0, max = fChildren.length; i < max; i++) { - if (matches((CModelStatus) fChildren[i], mask)) - return true; - } - return false; - } - } - - /** - * Helper for matches(int). - */ - protected boolean matches(CModelStatus status, int mask) { - int severityMask = mask & 0x7; - int categoryMask = mask & ~0x7; - int bits = status.getBits(); - return ((severityMask == 0) || (bits & severityMask) != 0) && ((categoryMask == 0) || (bits & categoryMask) != 0); - } - - /** - * Creates and returns a new ICModelStatus that is a - * a multi-status status. - * - * @see IStatus#.isMultiStatus() - */ - public static ICModelStatus newMultiStatus(ICModelStatus[] children) { - CModelStatus jms = new CModelStatus(); - jms.fChildren = children; - return jms; - } - - /** - * Returns a printable representation of this exception for debugging - * purposes. - */ - public String toString() { - if (this == VERIFIED_OK){ - return "CModelStatus[OK]"; //$NON-NLS-1$ - } - StringBuffer buffer = new StringBuffer(); - buffer.append("C Model Status ["); //$NON-NLS-1$ - buffer.append(getMessage()); - buffer.append("]"); //$NON-NLS-1$ - return buffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CPathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CPathEntry.java deleted file mode 100644 index 2003955ece0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CPathEntry.java +++ /dev/null @@ -1,136 +0,0 @@ -/********************************************************************** - * Created on 25-Mar-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ICPathEntry; - -public class CPathEntry implements ICPathEntry { - - public int entryKind; - public boolean isExported; - - public CPathEntry(int entryKind, boolean isExported) { - - this.entryKind = entryKind; - this.isExported = isExported; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICPathEntry#getEntryKind() - */ - public int getEntryKind() { - return entryKind; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICPathEntry#isExported() - */ - public boolean isExported() { - return isExported; - } - - public boolean equals(Object obj) { - if (obj instanceof ICPathEntry) { - ICPathEntry otherEntry = (ICPathEntry)obj; - if (entryKind != otherEntry.getEntryKind()) { - return false; - } - if (isExported != otherEntry.isExported()) { - return false; - } - return true; - } - return super.equals(obj); - } - - /** - * Returns the kind from its String form. - */ - static int kindFromString(String kindStr) { - - if (kindStr.equalsIgnoreCase("prj")) //$NON-NLS-1$ - return ICPathEntry.CDT_PROJECT; - if (kindStr.equalsIgnoreCase("var")) //$NON-NLS-1$ - return ICPathEntry.CDT_VARIABLE; - if (kindStr.equalsIgnoreCase("src")) //$NON-NLS-1$ - return ICPathEntry.CDT_SOURCE; - if (kindStr.equalsIgnoreCase("lib")) //$NON-NLS-1$ - return ICPathEntry.CDT_LIBRARY; - if (kindStr.equalsIgnoreCase("inc")) //$NON-NLS-1$ - return ICPathEntry.CDT_INCLUDE; - if (kindStr.equalsIgnoreCase("mac")) //$NON-NLS-1$ - return ICPathEntry.CDT_MACRO; - if (kindStr.equalsIgnoreCase("con")) //$NON-NLS-1$ - return ICPathEntry.CDT_CONTAINER; - return -1; - } - - /** - * Returns a String for the kind of a path entry. - */ - static String kindToString(int kind) { - - switch (kind) { - case ICPathEntry.CDT_PROJECT : - return "prj"; - case ICPathEntry.CDT_SOURCE : - return "src"; //$NON-NLS-1$ - case ICPathEntry.CDT_LIBRARY : - return "lib"; //$NON-NLS-1$ - case ICPathEntry.CDT_VARIABLE : - return "var"; //$NON-NLS-1$ - case ICPathEntry.CDT_INCLUDE : - return "inc"; //$NON-NLS-1$ - case ICPathEntry.CDT_MACRO : - return "mac"; //$NON-NLS-1$ - case ICPathEntry.CDT_CONTAINER : - return "con"; //$NON-NLS-1$ - default : - return "unknown"; //$NON-NLS-1$ - } - } - - /** - * Returns a printable representation of this classpath entry. - */ - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('['); - switch (getEntryKind()) { - case ICPathEntry.CDT_LIBRARY : - buffer.append("CDT_LIBRARY"); //$NON-NLS-1$ - break; - case ICPathEntry.CDT_PROJECT : - buffer.append("CDT_PROJECT"); //$NON-NLS-1$ - break; - case ICPathEntry.CDT_SOURCE : - buffer.append("CDT_SOURCE"); //$NON-NLS-1$ - break; - case ICPathEntry.CDT_VARIABLE : - buffer.append("CDT_VARIABLE"); //$NON-NLS-1$ - break; - case ICPathEntry.CDT_INCLUDE : - buffer.append("CDT_INCLUDE"); //$NON-NLS-1$ - break; - case ICPathEntry.CDT_MACRO : - buffer.append("CDT_MACRO"); //$NON-NLS-1$ - break; - case ICPathEntry.CDT_CONTAINER : - buffer.append("CDT_CONTAINER"); //$NON-NLS-1$ - break; - } - buffer.append(']'); - return buffer.toString(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java deleted file mode 100644 index d9882bf2974..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java +++ /dev/null @@ -1,579 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ICPathEntry; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IContainerEntry; -import org.eclipse.cdt.core.model.IIncludeEntry; -import org.eclipse.cdt.core.model.ILibraryEntry; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.cdt.core.model.IMacroEntry; -import org.eclipse.cdt.core.model.IProjectEntry; -import org.eclipse.cdt.core.model.ISourceEntry; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.QualifiedName; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class CProject extends CContainer implements ICProject { - - /** - * An empty array of strings indicating that a project doesn't have any prerequesite projects. - */ - protected static final String[] NO_PREREQUISITES = new String[0]; - - public CProject(ICElement parent, IProject project) { - super(parent, project, CElement.C_PROJECT); - } - - public IBinaryContainer getBinaryContainer() { - return ((CProjectInfo) getElementInfo()).getBinaryContainer(); - } - - public IArchiveContainer getArchiveContainer() { - return ((CProjectInfo) getElementInfo()).getArchiveContainer(); - } - - public IProject getProject() { - return getUnderlyingResource().getProject(); - } - - private static final String CUSTOM_DEFAULT_OPTION_VALUE = "#\r\n\r#custom-non-empty-default-value#\r\n\r#"; //$NON-NLS-1$ - - public ICElement findElement(IPath path) throws CModelException { - ICElement celem = null; - if (path.isAbsolute()) { - celem = CModelManager.getDefault().create(path); - } else { - IProject project = getProject(); - if (project != null) { - IPath p = project.getFullPath().append(path); - celem = CModelManager.getDefault().create(p); - } - } - if (celem == null) { - CModelStatus status = new CModelStatus(ICModelStatusConstants.INVALID_PATH, path); - throw new CModelException(status); - } - return celem; - } - - public static boolean hasCNature(IProject p) { - try { - return p.hasNature(CProjectNature.C_NATURE_ID); - } catch (CoreException e) { - //throws exception if the project is not open. - } - return false; - } - - protected CElementInfo createElementInfo() { - return new CProjectInfo(this); - } - - // CHECKPOINT: CProjects will return the hash code of their underlying IProject - public int hashCode() { - return getProject().hashCode(); - } - - public ILibraryReference[] getLibraryReferences() throws CModelException { - ArrayList list = new ArrayList(5); - IBinaryParser binParser = null; - try { - binParser = CCorePlugin.getDefault().getBinaryParser(getProject()); - } catch (CoreException e) { - } - ICPathEntry[] entries = getResolvedCPathEntries(); - for (int i = 0; i < entries.length; i++) { - if (entries[i].getEntryKind() == ICPathEntry.CDT_LIBRARY) { - ILibraryEntry entry = (ILibraryEntry) entries[i]; - ILibraryReference lib = null; - if (binParser != null) { - IBinaryFile bin; - try { - bin = binParser.getBinary(entry.getLibraryPath()); - if (bin.getType() == IBinaryFile.ARCHIVE) { - lib = new LibraryReferenceArchive(this, entry, (IBinaryArchive)bin); - } else { - lib = new LibraryReferenceShared(this, entry, bin); - } - } catch (IOException e1) { - lib = new LibraryReference(this, entry); - } - } - if (lib != null) { - list.add(lib); - } - } - } - return (ILibraryReference[]) list.toArray(new ILibraryReference[0]); - } - - /** - * @see ICProject#getRequiredProjectNames() - */ - public String[] getRequiredProjectNames() throws CModelException { - return projectPrerequisites(getResolvedCPathEntries()); - } - - public String[] projectPrerequisites(ICPathEntry[] entries) throws CModelException { - ArrayList prerequisites = new ArrayList(); - for (int i = 0, length = entries.length; i < length; i++) { - if (entries[i].getEntryKind() == ICPathEntry.CDT_PROJECT) { - IProjectEntry entry = (IProjectEntry)entries[i]; - prerequisites.add(entry.getProjectPath().lastSegment()); - } - } - int size = prerequisites.size(); - if (size != 0) { - String[] result = new String[size]; - prerequisites.toArray(result); - return result; - } - return NO_PREREQUISITES; - } - - - - /** - * @see org.eclipse.cdt.core.model.ICProject#getOption(String, boolean) - */ - public String getOption(String optionName, boolean inheritCCoreOptions) { - - if (CModelManager.OptionNames.contains(optionName)) { - Preferences preferences = getPreferences(); - - if (preferences == null || preferences.isDefault(optionName)) { - return inheritCCoreOptions ? CCorePlugin.getOption(optionName) : null; - } - - return preferences.getString(optionName).trim(); - } - - return null; - } - - /** - * @see org.eclipse.cdt.core.model.ICProject#getOptions(boolean) - */ - public Map getOptions(boolean inheritCCoreOptions) { - // initialize to the defaults from CCorePlugin options pool - Map options = inheritCCoreOptions ? CCorePlugin.getOptions() : new HashMap(5); - - Preferences preferences = getPreferences(); - if (preferences == null) - return options; - HashSet optionNames = CModelManager.OptionNames; - - // get preferences set to their default - if (inheritCCoreOptions) { - String[] defaultPropertyNames = preferences.defaultPropertyNames(); - for (int i = 0; i < defaultPropertyNames.length; i++) { - String propertyName = defaultPropertyNames[i]; - if (optionNames.contains(propertyName)) { - options.put(propertyName, preferences.getDefaultString(propertyName).trim()); - } - } - } - // get custom preferences not set to their default - String[] propertyNames = preferences.propertyNames(); - for (int i = 0; i < propertyNames.length; i++) { - String propertyName = propertyNames[i]; - if (optionNames.contains(propertyName)) { - options.put(propertyName, preferences.getString(propertyName).trim()); - } - } - return options; - } - - /** - * @see org.eclipse.cdt.core.model.ICProject#setOption(java.lang.String, java.lang.String) - */ - public void setOption(String optionName, String optionValue) { - if (!CModelManager.OptionNames.contains(optionName)) - return; // unrecognized option - - Preferences preferences = getPreferences(); - preferences.setDefault(optionName, CUSTOM_DEFAULT_OPTION_VALUE); // empty string isn't the default (26251) - preferences.setValue(optionName, optionValue); - - savePreferences(preferences); - } - - /** - * @see org.eclipse.cdt.core.model.ICProject#setOptions(Map) - */ - public void setOptions(Map newOptions) { - Preferences preferences = new Preferences(); - setPreferences(preferences); // always reset (26255) - - if (newOptions != null) { - Iterator keys = newOptions.keySet().iterator(); - - while (keys.hasNext()) { - String key = (String) keys.next(); - if (!CModelManager.OptionNames.contains(key)) - continue; // unrecognized option - - // no filtering for encoding (custom encoding for project is allowed) - String value = (String) newOptions.get(key); - preferences.setDefault(key, CUSTOM_DEFAULT_OPTION_VALUE); // empty string isn't the default (26251) - preferences.setValue(key, value); - } - } - - // persist options - savePreferences(preferences); - } - - /** - * Returns the project custom preference pool. - * Project preferences may include custom encoding. - */ - private Preferences getPreferences() { - Preferences preferences = new Preferences(); - Iterator iter = CModelManager.OptionNames.iterator(); - - while (iter.hasNext()) { - String qualifiedName = (String) iter.next(); - String dequalifiedName = qualifiedName.substring(CCorePlugin.PLUGIN_ID.length() + 1); - String value = null; - - try { - value = resource.getPersistentProperty(new QualifiedName(CCorePlugin.PLUGIN_ID, dequalifiedName)); - } catch (CoreException e) { - } - - if (value != null) - preferences.setValue(qualifiedName, value); - } - - return preferences; - } - - /** - * Save project custom preferences to persistent properties - */ - private void savePreferences(Preferences preferences) { - if (preferences == null) - return; - Iterator iter = CModelManager.OptionNames.iterator(); - - while (iter.hasNext()) { - String qualifiedName = (String) iter.next(); - String dequalifiedName = qualifiedName.substring(CCorePlugin.PLUGIN_ID.length() + 1); - String value = null; - - try { - value = preferences.getString(qualifiedName); - - if (value != null && !value.equals(preferences.getDefaultString(qualifiedName))) { - resource.setPersistentProperty(new QualifiedName(CCorePlugin.PLUGIN_ID, dequalifiedName), value); - } else { - resource.setPersistentProperty(new QualifiedName(CCorePlugin.PLUGIN_ID, dequalifiedName), null); - } - } catch (CoreException e) { - } - } - } - - /* - * Set cached preferences, no preferences are saved, only info is updated - */ - private void setPreferences(Preferences preferences) { - // Do nothing - } - - - static String PATH_ENTRY = "cpathentry"; //$NON-NLS-1$ - static String PATH_ENTRY_ID = "org.eclipse.cdt.core.cpathentry"; //$NON-NLS-1$ - static String ATTRIBUTE_KIND = "kind"; //$NON-NLS-1$ - static String ATTRIBUTE_PATH = "path"; //$NON-NLS-1$ - static String ATTRIBUTE_EXPORTED = "exported"; //$NON-NLS-1$ - static String ATTRIBUTE_SOURCEPATH = "sourcepath"; //$NON-NLS-1$ - static String ATTRIBUTE_ROOTPATH = "roopath"; //$NON-NLS-1$ - static String ATTRIBUTE_PREFIXMAPPING = "prefixmapping"; //$NON-NLS-1$ - static String ATTRIBUTE_EXCLUDING = "excluding"; //$NON-NLS-1$ - static String ATTRIBUTE_RECUSIVE = "recusive"; //$NON-NLS-1$ - static String ATTRIBUTE_OUTPUT = "output"; //$NON-NLS-1$ - static String ATTRIBUTE_INCLUDE = "include"; //$NON-NLS-1$ - static String ATTRIBUTE_SYSTEM = "system"; //$NON-NLS-1$ - static String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$ - static String ATTRIBUTE_VALUE = "value"; //$NON-NLS-1$ - static String ATTRIBUTE_ID = "id"; //$NON-NLS-1$ - static String VALUE_TRUE = "true"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICProject#getResolvedCPathEntries() - */ - public ICPathEntry[] getResolvedCPathEntries() throws CModelException { - // Not implemented - return getRawCPathEntries(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICProject#getRawCPathEntries() - */ - public ICPathEntry[] getRawCPathEntries() throws CModelException { - ArrayList pathEntries = new ArrayList(); - try { - ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(getProject()); - Element element = cdesc.getProjectData(PATH_ENTRY_ID); - NodeList list = element.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - Node childNode = list.item(i); - if (childNode.getNodeType() == Node.ELEMENT_NODE) { - if (childNode.getNodeName().equals(PATH_ENTRY)) { - pathEntries.add(decodeCPathEntry((Element) childNode)); - } - } - } - } catch (CoreException e) { - throw new CModelException(e); - } - return (ICPathEntry[]) pathEntries.toArray(new ICPathEntry[0]); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICProject#setRawCPathEntries(org.eclipse.cdt.core.model.ICPathEntry[], org.eclipse.core.runtime.IProgressMonitor) - */ - public void setRawCPathEntries(ICPathEntry[] newEntries, IProgressMonitor monitor) throws CModelException { - try { - SetCPathEntriesOperation op = new SetCPathEntriesOperation(this, getRawCPathEntries(), newEntries); - runOperation(op, monitor); - } catch (CoreException e) { - throw new CModelException(e); - } - - } - - ICPathEntry decodeCPathEntry(Element element) throws CModelException { - IPath projectPath = getProject().getFullPath(); - - // kind - String kindAttr = element.getAttribute(ATTRIBUTE_KIND); - int kind = CPathEntry.kindFromString(kindAttr); - - // exported flag - boolean isExported = false; - if (element.hasAttribute(ATTRIBUTE_EXPORTED)) { - isExported = element.getAttribute(ATTRIBUTE_EXPORTED).equals(VALUE_TRUE); - } - - // ensure path is absolute - String pathAttr = element.getAttribute(ATTRIBUTE_PATH); - IPath path = new Path(pathAttr); - if (kind != ICPathEntry.CDT_VARIABLE && !path.isAbsolute()) { - path = projectPath.append(path); - } - - // source attachment info (optional) - IPath sourceAttachmentPath = - element.hasAttribute(ATTRIBUTE_SOURCEPATH) ? new Path(element.getAttribute(ATTRIBUTE_SOURCEPATH)) : null; - IPath sourceAttachmentRootPath = - element.hasAttribute(ATTRIBUTE_ROOTPATH) ? new Path(element.getAttribute(ATTRIBUTE_ROOTPATH)) : null; - IPath sourceAttachmentPrefixMapping = - element.hasAttribute(ATTRIBUTE_PREFIXMAPPING) ? new Path(element.getAttribute(ATTRIBUTE_PREFIXMAPPING)) : null; - - // exclusion patterns (optional) - String exclusion = element.getAttribute(ATTRIBUTE_EXCLUDING); - IPath[] exclusionPatterns = ACPathEntry.NO_EXCLUSION_PATTERNS; - if (!exclusion.equals("")) { //$NON-NLS-1$ - char[][] patterns = CharOperation.splitOn('|', exclusion.toCharArray()); - int patternCount; - if ((patternCount = patterns.length) > 0) { - exclusionPatterns = new IPath[patternCount]; - for (int j = 0; j < patterns.length; j++) { - exclusionPatterns[j] = new Path(new String(patterns[j])); - } - } - } - - boolean isRecursive = false; - if (element.hasAttribute(ATTRIBUTE_RECUSIVE)) { - isRecursive = element.getAttribute(ATTRIBUTE_RECUSIVE).equals(VALUE_TRUE); - } - - // recreate the CP entry - - switch (kind) { - - case ICPathEntry.CDT_PROJECT : - return CoreModel.newProjectEntry(path, isExported); - - case ICPathEntry.CDT_LIBRARY : - return CoreModel.newLibraryEntry( - path, - sourceAttachmentPath, - sourceAttachmentRootPath, - sourceAttachmentPrefixMapping, - isExported); - - case ICPathEntry.CDT_SOURCE : - { - // custom output location - IPath outputLocation = element.hasAttribute(ATTRIBUTE_OUTPUT) ? projectPath.append(element.getAttribute(ATTRIBUTE_OUTPUT)) : null; //$NON-NLS-1$ //$NON-NLS-2$ - // must be an entry in this project or specify another project - String projSegment = path.segment(0); - if (projSegment != null && projSegment.equals(getElementName())) { // this project - return CoreModel.newSourceEntry(path, outputLocation, isRecursive, exclusionPatterns); - } else { // another project - return CoreModel.newProjectEntry(path, isExported); - } - } - - // case ICPathEntry.CDT_VARIABLE : - // return CoreModel.newVariableEntry(path, sourceAttachmentPath, sourceAttachmentRootPath); - - case ICPathEntry.CDT_INCLUDE : - { - // include path info (optional - IPath includePath = - element.hasAttribute(ATTRIBUTE_INCLUDE) ? new Path(element.getAttribute(ATTRIBUTE_INCLUDE)) : null; - // isSysteminclude - boolean isSystemInclude = false; - if (element.hasAttribute(ATTRIBUTE_SYSTEM)) { - isSystemInclude = element.getAttribute(ATTRIBUTE_SYSTEM).equals(VALUE_TRUE); - } - return CoreModel.newIncludeEntry( - path, - includePath, - isSystemInclude, - isRecursive, - exclusionPatterns, - isExported); - } - - case ICPathEntry.CDT_MACRO : - { - String macroName = element.getAttribute(ATTRIBUTE_NAME); //$NON-NLS-1$ - String macroValue = element.getAttribute(ATTRIBUTE_VALUE); //$NON-NLS-1$ - return CoreModel.newMacroEntry(path, macroName, macroValue, isRecursive, exclusionPatterns, isExported); - } - - case ICPathEntry.CDT_CONTAINER : - { - String id = element.getAttribute(ATTRIBUTE_ID); //$NON-NLS-1$ - return CoreModel.newContainerEntry(id, isExported); - } - - default : - { - ICModelStatus status = new CModelStatus(ICModelStatus.ERROR, "CPathEntry: unknown kind (" + kindAttr + ")"); //$NON-NLS-1$ - throw new CModelException(status); - } - } - } - - void encodeCPathEntries(Document doc, Element configRootElement, ICPathEntry[] entries) { - Element element; - IPath projectPath = getProject().getFullPath(); - for (int i = 0; i < entries.length; i++) { - element = doc.createElement(PATH_ENTRY); - configRootElement.appendChild(element); - int kind = entries[i].getEntryKind(); - - // Set the kind - element.setAttribute(ATTRIBUTE_KIND, CPathEntry.kindToString(kind)); - - // Save the exclusions attributes - if (entries[i] instanceof ACPathEntry) { - ACPathEntry entry = (ACPathEntry) entries[i]; - IPath[] exclusionPatterns = entry.getExclusionPatterns(); - if (exclusionPatterns.length > 0) { - StringBuffer excludeRule = new StringBuffer(10); - for (int j = 0, max = exclusionPatterns.length; j < max; j++) { - if (j > 0) { - excludeRule.append('|'); - } - excludeRule.append(exclusionPatterns[j]); - } - element.setAttribute(ATTRIBUTE_EXCLUDING, excludeRule.toString()); - } - if (entry.isRecursive()) { - element.setAttribute(ATTRIBUTE_RECUSIVE, VALUE_TRUE); - } - } - - if (kind == ICPathEntry.CDT_SOURCE) { - ISourceEntry source = (ISourceEntry) entries[i]; - IPath path = source.getSourcePath(); - element.setAttribute(ATTRIBUTE_PATH, path.toString()); - IPath output = source.getOutputLocation(); - if (output != null && output.isEmpty()) { - element.setAttribute(ATTRIBUTE_OUTPUT, output.toString()); - } - } else if (kind == ICPathEntry.CDT_LIBRARY) { - ILibraryEntry lib = (ILibraryEntry) entries[i]; - IPath path = lib.getLibraryPath(); - element.setAttribute(ATTRIBUTE_PATH, path.toString()); - if (lib.getSourceAttachmentPath() != null) { - element.setAttribute(ATTRIBUTE_SOURCEPATH, lib.getSourceAttachmentPath().toString()); - } - if (lib.getSourceAttachmentRootPath() != null) { - element.setAttribute(ATTRIBUTE_ROOTPATH, lib.getSourceAttachmentRootPath().toString()); - } - if (lib.getSourceAttachmentPrefixMapping() != null) { - element.setAttribute(ATTRIBUTE_PREFIXMAPPING, lib.getSourceAttachmentPrefixMapping().toString()); - } - } else if (kind == ICPathEntry.CDT_PROJECT) { - IProjectEntry pentry = (IProjectEntry) entries[i]; - IPath path = pentry.getProjectPath(); - element.setAttribute(ATTRIBUTE_PATH, path.toString()); - } else if (kind == ICPathEntry.CDT_INCLUDE) { - IIncludeEntry include = (IIncludeEntry) entries[i]; - IPath path = include.getResourcePath(); - element.setAttribute(ATTRIBUTE_PATH, path.toString()); - IPath includePath = include.getIncludePath(); - element.setAttribute(ATTRIBUTE_INCLUDE, includePath.toString()); - if (include.isSystemInclude()) { - element.setAttribute(ATTRIBUTE_SYSTEM, VALUE_TRUE); - } - } else if (kind == ICPathEntry.CDT_MACRO) { - IMacroEntry macro = (IMacroEntry) entries[i]; - IPath path = macro.getResourcePath(); - element.setAttribute(ATTRIBUTE_PATH, path.toString()); - element.setAttribute(ATTRIBUTE_NAME, macro.getMacroName()); - element.setAttribute(ATTRIBUTE_VALUE, macro.getMacroValue()); - } else if (kind == ICPathEntry.CDT_CONTAINER) { - IContainerEntry container = (IContainerEntry) entries[i]; - element.setAttribute(ATTRIBUTE_ID, container.getId()); - } - if (entries[i].isExported()) { - element.setAttribute(ATTRIBUTE_EXPORTED, VALUE_TRUE); - } - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java deleted file mode 100644 index 03c05ecd5cd..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProjectInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinaryContainer; - -/** - * Info for ICProject. - */ - -class CProjectInfo extends CContainerInfo { - - BinaryContainer vBin; - ArchiveContainer vLib; - - /** - */ - public CProjectInfo(CElement element) { - super(element); - vBin = null; - vLib = null; - } - - synchronized public IBinaryContainer getBinaryContainer() { - if (vBin == null) { - vBin = new BinaryContainer((CProject)getElement()); - } - return vBin; - } - - synchronized public IArchiveContainer getArchiveContainer() { - if (vLib == null) { - vLib = new ArchiveContainer((CProject)getElement()); - } - return vLib; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java deleted file mode 100644 index 062ae92d507..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CommitWorkingCopyOperation.java +++ /dev/null @@ -1,142 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.*; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IResource; - -/** - * Commits the contents of a working copy translation unit to its original - * element and resource, bringing the C Model up-to-date with the current - * contents of the working copy. - * - *

      It is possible that the contents of the - * original resource have changed since the working copy was created, - * in which case there is an update conflict. This operation allows - * for two settings to resolve conflict set by the fForce flag:

        - *
      • force flag is false - in this case a CModelException - * is thrown
      • - *
      • force flag is true - in this case the contents of - * the working copy are applied to the underlying resource even though - * the working copy was created before a subsequent change in the - * resource
      • - *
      - * - *

      The default conflict resolution setting is the force flag is false - * - * A CModelOperation exception is thrown either if the commit could not be - * performed. - * - * This class is similar to the JDT CommitWorkingCopyOperation class. - */ - -public class CommitWorkingCopyOperation extends CModelOperation { - /** - * Constructs an operation to commit the contents of a working copy - * to its original translation unit. - */ - - public CommitWorkingCopyOperation(ITranslationUnit element, boolean force) { - super(new ICElement[] {element}, force); - } - - - /** - * @see org.eclipse.cdt.internal.core.model.CModelOperation#executeOperation() - */ - protected void executeOperation() throws CModelException { - try { - beginTask("workingCopy.commit", 2); //$NON-NLS-1$ - WorkingCopy copy = (WorkingCopy)getElementToProcess(); - ITranslationUnit original = (ITranslationUnit) copy.getOriginalElement(); - - - // creates the delta builder (this remembers the content of the cu) - if (!original.isOpen()) { - // force opening so that the delta builder can get the old info - original.open(null); - } - CElementDeltaBuilder deltaBuilder = new CElementDeltaBuilder(original); - - // save the cu - IBuffer originalBuffer = original.getBuffer(); - if (originalBuffer == null) return; - char[] originalContents = originalBuffer.getCharacters(); - boolean hasSaved = false; - try { - IBuffer copyBuffer = copy.getBuffer(); - if (copyBuffer == null) return; - originalBuffer.setContents(copyBuffer.getCharacters()); - original.save(fMonitor, fForce); - this.hasModifiedResource = true; - hasSaved = true; - } finally { - if (!hasSaved){ - // restore original buffer contents since something went wrong - originalBuffer.setContents(originalContents); - } - } - // make sure working copy is in sync - copy.updateTimeStamp((TranslationUnit)original); - copy.makeConsistent(this); - worked(1); - - if (deltaBuilder != null) { - // build the deltas - deltaBuilder.buildDeltas(); - - // add the deltas to the list of deltas created during this operation - if (deltaBuilder.delta != null) { - addDelta(deltaBuilder.delta); - } - } - worked(1); - } finally { - done(); - } - } - /** - * Possible failures:

        - *
      • INVALID_ELEMENT_TYPES - the Translation unit supplied to this - * operation is not a working copy - *
      • ELEMENT_NOT_PRESENT - the Translation unit the working copy is - * based on no longer exists. - *
      • UPDATE_CONFLICT - the original Translation unit has changed since - * the working copy was created and the operation specifies no force - *
      - */ - - public ICModelStatus verify() { - - IWorkingCopy wc = (IWorkingCopy) getElementToProcess(); - if (!wc.isWorkingCopy()) { - return new CModelStatus(ICModelStatusConstants.INVALID_ELEMENT_TYPES, wc); - } - - ITranslationUnit original= (ITranslationUnit)wc.getOriginalElement(); - IResource resource = original.getResource(); - if (!wc.isBasedOn(resource) && !fForce) { - return new CModelStatus(ICModelStatusConstants.UPDATE_CONFLICT); - } - - // no read-only check, since some repository adapters can change the flag on save - // operation. - return CModelStatus.VERIFIED_OK; - - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContainerEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContainerEntry.java deleted file mode 100644 index eae95703cf0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ContainerEntry.java +++ /dev/null @@ -1,54 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.IContainerEntry; - -public class ContainerEntry extends CPathEntry implements IContainerEntry { - - String id; - - public ContainerEntry(String id, boolean isExported) { - super(IContainerEntry.CDT_CONTAINER, isExported); - this.id = id; - } - - /** - * Returns the id identifying this container. - * @return String - */ - public String getId() { - return id; - } - - public boolean equals(Object obj) { - if (obj instanceof IContainerEntry) { - IContainerEntry container = (IContainerEntry)obj; - if (!super.equals(container)) { - return false; - } - if (id == null) { - if (container.getId() != null) { - return false; - } - } else { - if (!id.equals(container.getId())) { - return false; - } - } - return true; - } - return super.equals(obj); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java deleted file mode 100644 index b5d214fcc4d..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyElementsOperation.java +++ /dev/null @@ -1,214 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.IParent; - -/** - * This operation copies/moves a collection of elements from their current - * container to a new container, optionally renaming the - * elements. - *

      Notes:

        - *
      • If there is already an element with the same name in - * the new container, the operation either overwrites or aborts, - * depending on the collision policy setting. The default setting is - * abort. - * - *
      • When constructors are copied to a type, the constructors - * are automatically renamed to the name of the destination - * type. - * - *
      • When main types are renamed (move within the same parent), - * the compilation unit and constructors are automatically renamed - * - *
      • The collection of elements being copied must all share the - * same type of container (for example, must all be type members). - * - *
      • The elements are inserted in the new container in the order given. - * - *
      • The elements can be positioned in the new container - see #setInsertBefore. - * By default, the elements are inserted based on the default positions as specified in - * the creation operation for that element type. - * - *
      • This operation can be used to copy and rename elements within - * the same container. - * - *
      • This operation only copies elements contained within compilation units. - *
      - * - */ -public class CopyElementsOperation extends MultiOperation { - - //private Map fSources = new HashMap(); - - /** - * When executed, this operation will copy the given elements to the - * given containers. The elements and destination containers must be in - * the correct order. If there is > 1 destination, the number of destinations - * must be the same as the number of elements being copied/moved/renamed. - */ - public CopyElementsOperation(ICElement[] elementsToCopy, ICElement[] destContainers, boolean force) { - super(elementsToCopy, destContainers, force); - } - - /** - * When executed, this operation will copy the given elements to the - * given container. - */ - public CopyElementsOperation(ICElement[] elementsToCopy, ICElement destContainer, boolean force) { - this(elementsToCopy, new ICElement[]{destContainer}, force); - } - - /** - * Returns the String to use as the main task name - * for progress monitoring. - */ - protected String getMainTaskName() { - return "operation.copyElementProgress"; //$NON-NLS-1$ - } - - /** - * Returns the nested operation to use for processing this element - */ - protected CModelOperation getNestedOperation(ICElement element) { - //ICElement dest = getDestinationParent(element); - switch (element.getElementType()) { - //case ICElement.C_INCLUDE: - // return new CreateIncludeOperation(element, dest); - //case ICElement.C_FUNCTION_DECLARATION : - // return new CreateFunctionDeclarationOperation(element, dest); - //case ICElement.C_FUNCTION : - // return new CreateFunctionOperation(element, dest); - //case ICElement.C_STRUCTURE : - // return new CreateStructureOperation(element, dest, fForce); - //case ICElement.C_METHOD : - // return new CreateMethodOperation(element, dest, fForce); - //case ICElement.C_FIELD : - // return new CreateFieldOperation(element, dest, fForce); - //case ICElement.C_VARIABLE: - // return new CreateVariableOperation(element, dest); - default : - return null; - } - } - - /** - * Copy/move the element from the source to destination, renaming - * the elements as specified, honoring the collision policy. - * - * @exception CModelException if the operation is unable to - * be completed - */ - protected void processElement(ICElement element) throws CModelException { - CModelOperation op = getNestedOperation(element); - if (op == null) { - return; - } - boolean isInTUOperation = op instanceof CreateElementInTUOperation; - if (isInTUOperation) { - CreateElementInTUOperation inTUop = (CreateElementInTUOperation)op; - ICElement sibling = (ICElement) fInsertBeforeElements.get(element); - if (sibling != null) { - (inTUop).setRelativePosition(sibling, CreateElementInTUOperation.INSERT_BEFORE); - } else if (isRename()) { - ICElement anchor = resolveRenameAnchor(element); - if (anchor != null) { - inTUop.setRelativePosition(anchor, CreateElementInTUOperation.INSERT_AFTER); // insert after so that the anchor is found before when deleted below - } - } - String newName = getNewNameFor(element); - if (newName != null) { - inTUop.setAlteredName(newName); - } - } - executeNestedOperation(op, 1); - - //if (isInTUOperation && isMove()) { - // DeleteElementsOperation deleteOp = new DeleteElementsOperation(new ICElement[] { element }, fForce); - // executeNestedOperation(deleteOp, 1); - //} - } - - /** - * Returns the anchor used for positioning in the destination for - * the element being renamed. For renaming, if no anchor has - * explicitly been provided, the element is anchored in the same position. - */ - private ICElement resolveRenameAnchor(ICElement element) throws CModelException { - IParent parent = (IParent) element.getParent(); - ICElement[] children = parent.getChildren(); - for (int i = 0; i < children.length; i++) { - ICElement child = children[i]; - if (child.equals(element)) { - return child; - } - } - return null; - } - - /** - * Possible failures: - *
        - *
      • NO_ELEMENTS_TO_PROCESS - no elements supplied to the operation - *
      • INDEX_OUT_OF_BOUNDS - the number of renamings supplied to the operation - * does not match the number of elements that were supplied. - *
      - */ - protected ICModelStatus verify() { - ICModelStatus status = super.verify(); - if (!status.isOK()) { - return status; - } - if (fRenamingsList != null && fRenamingsList.length != fElementsToProcess.length) { - return new CModelStatus(ICModelStatusConstants.INDEX_OUT_OF_BOUNDS); - } - return CModelStatus.VERIFIED_OK; - } - - /** - * @see MultiOperation - * - * Possible failure codes: - *
        - * - *
      • ELEMENT_DOES_NOT_EXIST - element or its specified destination is - * is null or does not exist. If a null element is - * supplied, no element is provided in the status, otherwise, the non-existant element - * is supplied in the status. - *
      • INVALID_ELEMENT_TYPES - element is not contained within a compilation unit. - * This operation only operates on elements contained within compilation units. - *
      • READ_ONLY - element is read only. - *
      • INVALID_DESTINATION - The destination parent specified for element - * is of an incompatible type. The destination for a package declaration or import declaration must - * be a compilation unit; the destination for a type must be a type or compilation - * unit; the destinaion for any type member (other than a type) must be a type. When - * this error occurs, the element provided in the operation status is the element. - *
      • INVALID_NAME - the new name for element does not have valid syntax. - * In this case the element and name are provided in the status. - - *
      - */ - protected void verify(ICElement element) throws CModelException { - if (element == null || !element.exists()) - error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, element); - - if (element.getElementType() < ICElement.C_UNIT) - error(ICModelStatusConstants.INVALID_ELEMENT_TYPES, element); - - if (element.isReadOnly()) - error(ICModelStatusConstants.READ_ONLY, element); - - ICElement dest = getDestinationParent(element); - verifyDestination(element, dest); - verifySibling(element, dest); - if (fRenamingsList != null) { - verifyRenaming(element); - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java deleted file mode 100644 index e4b4a6cf1a2..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CopyResourceElementsOperation.java +++ /dev/null @@ -1,249 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; - -/** - * This operation copies/moves/renames a collection of resources from their current - * container to a new container, optionally renaming the - * elements. - *

      Notes:

        - *
      • If there is already an resource with the same name in - * the new container, the operation either overwrites or aborts, - * depending on the collision policy setting. The default setting is - * abort. - * - *
      • The collection of elements being copied must all share the - * same type of container. - * - *
      • This operation can be used to copy and rename elements within - * the same container. - * - *
      • This operation only copies translation units. - *
      - * - */ -public class CopyResourceElementsOperation extends MultiOperation { - - /** - * The list of new resources created during this operation. - */ - protected ArrayList fCreatedElements; - - /** - * Table specifying deltas for elements being - * copied/moved/renamed. Keyed by elements' project(s), and - * values are the corresponding deltas. - */ - protected Map fDeltasPerProject= new HashMap(1); - - public CopyResourceElementsOperation(ICElement[] src, ICElement[] dst, boolean force) { - super(src, dst, force); - } - - /** - * Returns the CElementDelta for cProject, - * creating it and putting it in fDeltasPerProject if - * it does not exist yet. - */ - private CElementDelta getDeltaFor(ICProject cProject) { - CElementDelta delta = (CElementDelta) fDeltasPerProject.get(cProject); - if (delta == null) { - delta = new CElementDelta(cProject); - fDeltasPerProject.put(cProject, delta); - } - return delta; - } - - /** - * @see MultiOperation - */ - protected String getMainTaskName() { - return "operation.copyResourceProgress"; //$NON-NLS-1$ - } - - /** - * Sets the deltas to register the changes resulting from this operation - * for this source element and its destination. - * If the operation is a cross project operation
        - *
      • On a copy, the delta should be rooted in the dest project - *
      • On a move, two deltas are generated
          - *
        • one rooted in the source project - *
        • one rooted in the destination project
      - * If the operation is rooted in a single project, the delta is rooted in that project - * - */ - protected void prepareDeltas(ICElement sourceElement, ICElement destinationElement) { - ICProject destProject = destinationElement.getCProject(); - if (isMove()) { - ICProject sourceProject = sourceElement.getCProject(); - getDeltaFor(sourceProject).movedFrom(sourceElement, destinationElement); - getDeltaFor(destProject).movedTo(destinationElement, sourceElement); - } else { - getDeltaFor(destProject).added(destinationElement); - } - } - - /** - * Process all of the changed deltas generated by this operation. - */ - protected void processDeltas() { - for (Iterator deltas = this.fDeltasPerProject.values().iterator(); deltas.hasNext();){ - addDelta((ICElementDelta) deltas.next()); - } - } - - /** - * Copies/moves a compilation unit with the name newName - * to the destination package.
      - * The package statement in the compilation unit is updated if necessary. - * The main type of the compilation unit is renamed if necessary. - * - * @exception JavaModelException if the operation is unable to - * complete - */ - private void processResource(ICElement source, ICElement dest) throws CModelException { - String newName = getNewNameFor(source); - String destName = (newName != null) ? newName : source.getElementName(); - - // copy resource - IFile sourceResource = (IFile)source.getResource(); - // can be an IFolder or an IProject - IContainer destFolder = (IContainer)dest.getResource(); - IFile destFile = destFolder.getFile(new Path(destName)); - if (!destFile.equals(sourceResource)) { - try { - if (destFile.exists()) { - if (fForce) { - // we can remove it - deleteResource(destFile, false); - } else { - // abort - throw new CModelException(new CModelStatus(ICModelStatusConstants.NAME_COLLISION)); - } - } - if (this.isMove()) { - sourceResource.move(destFile.getFullPath(), fForce, true, getSubProgressMonitor(1)); - } else { - sourceResource.copy(destFile.getFullPath(), fForce, getSubProgressMonitor(1)); - } - this.hasModifiedResource = true; - } catch (CModelException e) { - throw e; - } catch (CoreException e) { - throw new CModelException(e); - } - - // update new resource content - - // register the correct change deltas - ICElement cdest = CModelManager.getDefault().create(destFile); - prepareDeltas(source, cdest); - fCreatedElements.add(cdest); - //if (newName != null) { - //the main type has been renamed - //String oldName = source.getElementName(); - //oldName = oldName.substring(0, oldName.length() - 5); - //String nName = newName; - //nName = nName.substring(0, nName.length() - 5); - //prepareDeltas(source.getType(oldName), cdest.getType(nName)); - //} - } else { - if (!fForce) { - throw new CModelException(new CModelStatus(ICModelStatusConstants.NAME_COLLISION)); - } - // update new resource content - // in case we do a saveas on the same resource we have to simply update the contents - // see http://dev.eclipse.org/bugs/show_bug.cgi?id=9351 - } - } - - /** - * @see MultiOperation - * This method delegates to processResource or - * processPackageFragmentResource, depending on the type of - * element. - */ - protected void processElement(ICElement element) throws CModelException { - ICElement dest = getDestinationParent(element); - if (element.getElementType() <= ICElement.C_UNIT) { - processResource(element, dest); - //fCreatedElements.add(dest.getCompilationUnit(element.getElementName())); - } else { - throw new CModelException(new CModelStatus(ICModelStatusConstants.INVALID_ELEMENT_TYPES, element)); - } - } - - /** - * @see MultiOperation - * Overridden to allow special processing of CElementDeltas - * and fResultElements. - */ - protected void processElements() throws CModelException { - fCreatedElements = new ArrayList(fElementsToProcess.length); - try { - super.processElements(); - } catch (CModelException cme) { - throw cme; - } finally { - fResultElements = new ICElement[fCreatedElements.size()]; - fCreatedElements.toArray(fResultElements); - processDeltas(); - } - } - - /** - * Possible failures: - *
        - *
      • NO_ELEMENTS_TO_PROCESS - no elements supplied to the operation - *
      • INDEX_OUT_OF_BOUNDS - the number of renamings supplied to the operation - * does not match the number of elements that were supplied. - *
      - */ - protected ICModelStatus verify() { - ICModelStatus status = super.verify(); - if (!status.isOK()) { - return status; - } - - if (fRenamingsList != null && fRenamingsList.length != fElementsToProcess.length) { - return new CModelStatus(ICModelStatusConstants.INDEX_OUT_OF_BOUNDS); - } - return CModelStatus.VERIFIED_OK; - } - - /** - * @see MultiOperation - */ - protected void verify(ICElement element) throws CModelException { - if (element == null || !element.exists()) - error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, element); - - if (element.isReadOnly() && (isRename() || isMove())) - error(ICModelStatusConstants.READ_ONLY, element); - - CElement dest = (CElement) getDestinationParent(element); - verifyDestination(element, dest); - if (fRenamings != null) { - verifyRenaming(element); - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java deleted file mode 100644 index e70af712749..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateElementInTUOperation.java +++ /dev/null @@ -1,429 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import org.eclipse.cdt.core.model.*; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; - -/** - *

      This abstract class implements behavior common to CreateElementInCUOperations. - * To create a compilation unit, or an element contained in a compilation unit, the - * source code for the entire compilation unit is updated and saved. - * - *

      The element being created can be positioned relative to an existing - * element in the compilation unit via the methods #createAfter - * and #createBefore. By default, the new element is positioned - * as the last child of its parent element. - * - */ -public abstract class CreateElementInTUOperation extends CModelOperation { - - /** - * A constant meaning to position the new element - * as the last child of its parent element. - */ - protected static final int INSERT_LAST = 1; - - /** - * A constant meaning to position the new element - * after the element defined by fAnchorElement. - */ - protected static final int INSERT_AFTER = 2; - - /** - * A constant meaning to position the new element - * before the element defined by fAnchorElement. - */ - protected static final int INSERT_BEFORE = 3; - - /** - * One of the position constants, describing where - * to position the newly created element. - */ - protected int fInsertionPolicy = INSERT_LAST; - - /** - * The element that is being created. - */ - protected ISourceReference fCreatedElement = null;; - - /** - * The element that the newly created element is - * positioned relative to, as described by - * fInsertPosition, or null - * if the newly created element will be positioned - * last. - */ - protected ICElement fAnchorElement = null; - - /** - * A flag indicating whether creation of a new element occurred. - * A request for creating a duplicate element would request in this - * flag being set to false. Ensures that no deltas are generated - * when creation does not occur. - */ - protected boolean fCreationOccurred = true; - - /** - * The position of the element that is being created. - */ - protected int fInsertionPosition = -1; - - /** - * The number of characters the new element replaces, - * or 0 if the new element is inserted, - * or -1 if the new element is append to the end of the CU. - */ - protected int fReplacementLength = -1; - - /** - * Constructs an operation that creates a C Language Element with - * the specified parent, contained within a translation unit. - */ - public CreateElementInTUOperation(ICElement parentElement) { - super(null, new ICElement[]{parentElement}); - initializeDefaultPosition(); - } - - /** - * Only allow cancelling if this operation is not nested. - */ - protected void checkCanceled() { - if (!fNested) { - super.checkCanceled(); - } - } - - /** - * Instructs this operation to position the new element after - * the given sibling, or to add the new element as the last child - * of its parent if null. - */ - public void createAfter(ICElement sibling) { - setRelativePosition(sibling, INSERT_AFTER); - } - - /** - * Instructs this operation to position the new element before - * the given sibling, or to add the new element as the last child - * of its parent if null. - */ - public void createBefore(ICElement sibling) { - setRelativePosition(sibling, INSERT_BEFORE); - } - - /** - * Execute the operation - generate new source for the compilation unit - * and save the results. - * - * @exception CModelException if the operation is unable to complete - */ - protected void executeOperation() throws CModelException { - beginTask(getMainTaskName(), getMainAmountOfWork()); - CElementDelta delta = newCElementDelta(); - ITranslationUnit unit = getTranslationUnit(); - // generateNewTranslationUnitDOM(unit); - insertElement(); - if (fCreationOccurred) { - //a change has really occurred - IBuffer buffer = unit.getBuffer(); - if (buffer == null) return; - char[] bufferContents = buffer.getCharacters(); - if (bufferContents == null) return; - //char[] elementContents = normalizeCRS(..); - char[] elementContents = fCreatedElement.getSource().toCharArray(); - //IFile file = (IFile)((ICResource)unit).getResource(); - //StringBuffer buffer = getContent(file); - switch (fReplacementLength) { - case -1 : - // element is append at the end - //buffer.append(fCreatedElement.getSource()); - buffer.append(elementContents); - break; - - case 0 : - // element is inserted - //buffer.insert(fInsertionPosition, fCreatedElement.getSource()); - buffer.replace(fInsertionPosition, 0, elementContents); - break; - - default : - // element is replacing the previous one - buffer.replace(fInsertionPosition, fReplacementLength, fCreatedElement.getSource()); - } - unit.save(null, false); - //save(buffer, file); - boolean isWorkingCopy = unit.isWorkingCopy(); - //if (isWorkingCopy) { - // this.setAttributes(...); - //} - worked(1); - fResultElements = generateResultHandles(); - if (!isWorkingCopy) { // if unit is working copy, then save will have already fired the delta - if (unit.getParent().exists()) { - for (int i = 0; i < fResultElements.length; i++) { - delta.added(fResultElements[i]); - } - addDelta(delta); - } // else unit is created outside classpath - // non-java resource delta will be notified by delta processor - } - } - done(); - } - - /** - * Creates and returns the handle for the element this operation created. - */ - protected abstract ICElement generateResultHandle(); - - /** - * Creates and returns the handles for the elements this operation created. - */ - protected ICElement[] generateResultHandles() throws CModelException { - return new ICElement[]{generateResultHandle()}; - } - - /** - * Returns the compilation unit in which the new element is being created. - */ - protected ITranslationUnit getTranslationUnit() { - return ((ISourceReference)getParentElement()).getTranslationUnit(); - } - - /** - * Returns the amount of work for the main task of this operation for - * progress reporting. - * @see executeOperation() - */ - protected int getMainAmountOfWork(){ - return 2; - } - - /** - * Returns the name of the main task of this operation for - * progress reporting. - * @see executeOperation() - */ - protected abstract String getMainTaskName(); - - /** - * Returns the elements created by this operation. - */ - public ICElement[] getResultElements() { - return fResultElements; - } - - /** - * Sets the default position in which to create the new type - * member. By default, the new element is positioned as the - * last child of the parent element in which it is created. - * Operations that require a different default position must - * override this method. - */ - protected void initializeDefaultPosition() { - } - - /** - * Inserts the given child into the given JDOM, - * based on the position settings of this operation. - * - * @see createAfter(IJavaElement) - * @see createBefore(IJavaElement); - */ - protected void insertElement() throws CModelException { - if (fInsertionPolicy != INSERT_LAST) { - ISourceRange range = ((ISourceReference)fAnchorElement).getSourceRange(); - switch (fInsertionPolicy) { - case INSERT_AFTER: - fReplacementLength = 0; - fInsertionPosition = range.getStartPos() + range.getLength(); - break; - - case INSERT_BEFORE: - fReplacementLength = 0; - fInsertionPosition = range.getStartPos(); - - default: - fReplacementLength = range.getStartPos() + range.getLength(); - fInsertionPosition = range.getStartPos(); - break; - } - return; - } - //add as the last element of the parent - fReplacementLength = -1; - } - - /** - * Sets the name of the DOMNode that will be used to - * create this new element. - * Used by the CopyElementsOperation for renaming. - * Only used for CreateTypeMemberOperation - */ - protected void setAlteredName(String newName) { - } - - /** - * Instructs this operation to position the new element relative - * to the given sibling, or to add the new element as the last child - * of its parent if null. The position - * must be one of the position constants. - */ - protected void setRelativePosition(ICElement sibling, int policy) throws IllegalArgumentException { - if (sibling == null) { - fAnchorElement = null; - fInsertionPolicy = INSERT_LAST; - } else { - fAnchorElement = sibling; - fInsertionPolicy = policy; - } - } - - /** - * Possible failures:

        - *
      • NO_ELEMENTS_TO_PROCESS - the compilation unit supplied to the operation is - * null. - *
      • INVALID_NAME - no name, a name was null or not a valid - * import declaration name. - *
      • INVALID_SIBLING - the sibling provided for positioning is not valid. - *
      - * @see ICModelStatus - * @see CNamingConventions - */ - public ICModelStatus verify() { - if (getParentElement() == null) { - return new CModelStatus(ICModelStatusConstants.NO_ELEMENTS_TO_PROCESS); - } - if (fAnchorElement != null) { - ICElement domPresentParent = fAnchorElement.getParent(); - //if (domPresentParent.getElementType() == ICElement.IMPORT_CONTAINER) { - // domPresentParent = domPresentParent.getParent(); - //} - if (!domPresentParent.equals(getParentElement())) { - return new CModelStatus(ICModelStatusConstants.INVALID_SIBLING, fAnchorElement); - } - } - return CModelStatus.VERIFIED_OK; - } - - - StringBuffer getContent(IFile file) throws CModelException { - InputStream stream = null; - try { - stream = new BufferedInputStream(file.getContents(true)); - } catch (CoreException e) { - throw new CModelException(e); - } - try { - char [] b = getInputStreamAsCharArray(stream, -1, null); - return new StringBuffer(b.length).append(b); - } catch (IOException e) { - throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION); - } finally { - try { - if (stream != null) - stream.close(); - } catch (IOException e) { - } - } - } - - /** - * Returns the given input stream's contents as a character array. - * If a length is specified (ie. if length != -1), only length chars - * are returned. Otherwise all chars in the stream are returned. - * Note this doesn't close the stream. - * @throws IOException if a problem occured reading the stream. - */ - public static char[] getInputStreamAsCharArray(InputStream stream, int length, String encoding) - throws IOException { - InputStreamReader reader = null; - reader = encoding == null - ? new InputStreamReader(stream) - : new InputStreamReader(stream, encoding); - char[] contents; - if (length == -1) { - contents = new char[0]; - int contentsLength = 0; - int charsRead = -1; - do { - int available = stream.available(); - - // resize contents if needed - if (contentsLength + available > contents.length) { - System.arraycopy( - contents, - 0, - contents = new char[contentsLength + available], - 0, - contentsLength); - } - - // read as many chars as possible - charsRead = reader.read(contents, contentsLength, available); - - if (charsRead > 0) { - // remember length of contents - contentsLength += charsRead; - } - } while (charsRead > 0); - - // resize contents if necessary - if (contentsLength < contents.length) { - System.arraycopy( - contents, - 0, - contents = new char[contentsLength], - 0, - contentsLength); - } - } else { - contents = new char[length]; - int len = 0; - int readSize = 0; - while ((readSize != -1) && (len != length)) { - // See PR 1FMS89U - // We record first the read size. In this case len is the actual read size. - len += readSize; - readSize = reader.read(contents, len, length - len); - } - // See PR 1FMS89U - // Now we need to resize in case the default encoding used more than one byte for each - // character - if (len != length) - System.arraycopy(contents, 0, (contents = new char[len]), 0, len); - } - - return contents; - } - - void save (StringBuffer buffer, IFile file) throws CModelException { - byte[] bytes = buffer.toString().getBytes(); - ByteArrayInputStream stream = new ByteArrayInputStream(bytes); - // use a platform operation to update the resource contents - try { - boolean force = true; - file.setContents(stream, force, true, null); // record history - } catch (CoreException e) { - throw new CModelException(e); - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java deleted file mode 100644 index cae08069224..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFieldOperation.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.cdt.core.model.ICModelStatus; -/** - *

      This operation creates a field declaration in a type. - * - *

      Required Attributes:

        - *
      • Containing Type - *
      • The source code for the declaration. No verification of the source is - * performed. - *
      - */ -public class CreateFieldOperation extends CreateMemberOperation { - /** - * When executed, this operation will create a field with the given name - * in the given type with the specified source. - * - *

      By default the new field is positioned after the last existing field - * declaration, or as the first member in the type if there are no - * field declarations. - */ - public CreateFieldOperation(IStructure parentElement, String source, boolean force) { - super(parentElement, source, force); - } - - /** - * @see CreateElementInCUOperation#getMainTaskName - */ - public String getMainTaskName(){ - return "operation.createFieldProgress"; //$NON-NLS-1$ - } - - /** - * By default the new field is positioned after the last existing field - * declaration, or as the first member in the type if there are no - * field declarations. - */ - protected void initializeDefaultPosition() { - IStructure parentElement = getStructure(); - //try { - ICElement[] elements = parentElement.getFields(); - if (elements != null && elements.length > 0) { - createAfter(elements[elements.length - 1]); - } else { - elements = parentElement.getChildren(); - if (elements != null && elements.length > 0) { - createBefore(elements[0]); - } - } - //} catch (CModelException e) { - //} - } - - /** - * @see CreateElementInCUOperation#generateResultHandle - */ - protected ICElement generateResultHandle() { - return getStructure().getField(fSource); - } - - /** - * @see CreateTypeMemberOperation#verifyNameCollision - */ - protected ICModelStatus verifyNameCollision() { - return CModelStatus.VERIFIED_OK; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFunctionDeclarationOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFunctionDeclarationOperation.java deleted file mode 100644 index d00f25c0167..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateFunctionDeclarationOperation.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IInclude; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.CModelException; - -/** - *

      This operation adds an include declaration to an existing translation unit. - * If the translation unit already includes the specified include declaration, - * the include is not generated (it does not generate duplicates). - * - *

      Required Attributes:

        - *
      • Translation unit - *
      • Include name - the name of the include to add to the - * translation unit. For example: "stdio.h" - *
      - */ -public class CreateFunctionDeclarationOperation extends CreateElementInTUOperation { - - /** - * The name of the include to be created. - */ - protected String fFunction; - - /** - * When executed, this operation will add an include to the given translation unit. - */ - public CreateFunctionDeclarationOperation(String function, ITranslationUnit parentElement) { - super(parentElement); - fFunction = function; - } - - /** - * @see CreateElementInCUOperation#generateResultHandle - */ - protected ICElement generateResultHandle() { - try { - return getTranslationUnit().getElement(fFunction); - } catch (CModelException e) { - } - return null; - } - - /** - * @see CreateElementInCUOperation#getMainTaskName - */ - public String getMainTaskName(){ - return "operation.createIncludeProgress"; //$NON-NLS-1$ - } - - /** - * Sets the correct position for the new include:
        - *
      • after the last include - *
      • if no include, before the first type - *
      • if no type, after the package statement - *
      • and if no package statement - first thing in the CU - */ - protected void initializeDefaultPosition() { - try { - ITranslationUnit tu = getTranslationUnit(); - IInclude[] includes = tu.getIncludes(); - if (includes.length > 0) { - createAfter(includes[includes.length - 1]); - return; - } - } catch (CModelException npe) { - } - } - - /** - * Possible failures:
          - *
        • NO_ELEMENTS_TO_PROCESS - the compilation unit supplied to the operation is - * null. - *
        • INVALID_NAME - not a valid include declaration name. - *
        - * @see ICModelStatus - * @see CNamingConventions - */ - public ICModelStatus verify() { - ICModelStatus status = super.verify(); - if (!status.isOK()) { - return status; - } - //if (CConventions.validateInclude(fIncludeName).getSeverity() == IStatus.ERROR) { - // return new CModelStatus(ICModelStatusConstants.INVALID_NAME, fIncludeName); - //} - return CModelStatus.VERIFIED_OK; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateIncludeOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateIncludeOperation.java deleted file mode 100644 index e845adc9b92..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateIncludeOperation.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IInclude; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.CModelException; - -/** - *

        This operation adds an include declaration to an existing translation unit. - * If the translation unit already includes the specified include declaration, - * the include is not generated (it does not generate duplicates). - * - *

        Required Attributes:

          - *
        • Translation unit - *
        • Include name - the name of the include to add to the - * translation unit. For example: "stdio.h" - *
        - */ -public class CreateIncludeOperation extends CreateElementInTUOperation { - - /** - * The name of the include to be created. - */ - protected String fIncludeName; - - /** - * When executed, this operation will add an include to the given translation unit. - */ - public CreateIncludeOperation(String includeName, ITranslationUnit parentElement) { - super(parentElement); - fIncludeName = includeName; - } - - /** - * @see CreateElementInCUOperation#generateResultHandle - */ - protected ICElement generateResultHandle() { - return getTranslationUnit().getInclude(fIncludeName); - } - - /** - * @see CreateElementInCUOperation#getMainTaskName - */ - public String getMainTaskName(){ - return "operation.createIncludeProgress"; //$NON-NLS-1$ - } - - /** - * Sets the correct position for the new include:
          - *
        • after the last include - *
        • if no include, before the first type - *
        • if no type, after the package statement - *
        • and if no package statement - first thing in the CU - */ - protected void initializeDefaultPosition() { - try { - ITranslationUnit cu = getTranslationUnit(); - IInclude[] includes = cu.getIncludes(); - if (includes.length > 0) { - createAfter(includes[includes.length - 1]); - return; - } - } catch (CModelException npe) { - } - } - - /** - * Possible failures:
            - *
          • NO_ELEMENTS_TO_PROCESS - the compilation unit supplied to the operation is - * null. - *
          • INVALID_NAME - not a valid include declaration name. - *
          - * @see ICModelStatus - * @see CNamingConventions - */ - public ICModelStatus verify() { - ICModelStatus status = super.verify(); - if (!status.isOK()) { - return status; - } - //if (CConventions.validateInclude(fIncludeName).getSeverity() == IStatus.ERROR) { - // return new CModelStatus(ICModelStatusConstants.INVALID_NAME, fIncludeName); - //} - return CModelStatus.VERIFIED_OK; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMemberOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMemberOperation.java deleted file mode 100644 index ffe3e1538b0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMemberOperation.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; - -/** - * Implements functionality common to - * operations that create type members. - */ -public abstract class CreateMemberOperation extends CreateElementInTUOperation { - /** - * The source code for the new member. - */ - protected String fSource = null; - - /** - * The name of the DOMNode that may be used to - * create this new element. - * Used by the CopyElementsOperation for renaming - */ - protected String fAlteredName; - - /** - * When executed, this operation will create a type member - * in the given parent element with the specified source. - */ - public CreateMemberOperation(ICElement parentElement, String source, boolean force) { - super(parentElement); - fSource= source; - fForce= force; - } - - /** - * Returns the IType the member is to be created in. - */ - protected IStructure getStructure() { - return (IStructure)getParentElement(); - } - - /** - * Sets the name of the DOMNode that will be used to - * create this new element. - * Used by the CopyElementsOperation for renaming - */ - protected void setAlteredName(String newName) { - fAlteredName = newName; - } - - /** - * Possible failures:
            - *
          • NO_ELEMENTS_TO_PROCESS - the parent element supplied to the operation is - * null. - *
          • INVALID_CONTENTS - The source is null or has serious syntax errors. - *
          • NAME_COLLISION - A name collision occurred in the destination - *
          - */ - public ICModelStatus verify() { - ICModelStatus status = super.verify(); - if (!status.isOK()) { - return status; - } - if (fSource == null) { - return new CModelStatus(ICModelStatusConstants.INVALID_CONTENTS); - } - if (!fForce) { - //check for name collisions - //if (node == null) { - // return new CModelStatus(ICModelStatusConstants.INVALID_CONTENTS); - // } - //} catch (CModelException jme) { - //} - return verifyNameCollision(); - } - - return CModelStatus.VERIFIED_OK; - } - - /** - * Verify for a name collision in the destination container. - */ - protected ICModelStatus verifyNameCollision() { - return CModelStatus.VERIFIED_OK; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java deleted file mode 100644 index 0704e206400..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CreateMethodOperation.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.cdt.core.model.ICModelStatus; - -/** - *

          This operation creates an instance method. - * - *

          Required Attributes:

            - *
          • Containing type - *
          • The source code for the method. No verification of the source is - * performed. - *
          - */ -public class CreateMethodOperation extends CreateMemberOperation { - protected String[] fParameterTypes; - - /** - * When executed, this operation will create a method - * in the given type with the specified source. - */ - public CreateMethodOperation(IStructure parentElement, String source, boolean force) { - super(parentElement, source, force); - } - - /** - * @see CreateElementInCUOperation#generateResultHandle - */ - protected ICElement generateResultHandle() { - return getStructure().getMethod(fSource); - } - - /** - * @see CreateElementInCUOperation#getMainTaskName - */ - public String getMainTaskName(){ - return "operation.createMethodProgress"; //$NON-NLS-1$ - } - - /** - * @see CreateTypeMemberOperation#verifyNameCollision - */ - protected ICModelStatus verifyNameCollision() { - return CModelStatus.VERIFIED_OK; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java deleted file mode 100644 index 858b6d790b3..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeleteResourceElementsOperation.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; - -/** - * This operation deletes a collection of resources and all of their children. - * It does not delete resources which do not belong to the C Model - * (eg GIF files). - */ -public class DeleteResourceElementsOperation extends MultiOperation { - /** - * When executed, this operation will delete the given elements. The elements - * to delete cannot be null or empty, and must have a corresponding - * resource. - */ - protected DeleteResourceElementsOperation(ICElement[] elementsToProcess, boolean force) { - super(elementsToProcess, force); - } - - /** - * @see MultiOperation - */ - protected String getMainTaskName() { - return "operation.deleteResourceProgress"; //$NON-NLS-1$ - } - - /** - * @see MultiOperation. This method delegate to deleteResource or - * deletePackageFragment depending on the type of element. - */ - protected void processElement(ICElement element) throws CModelException { - deleteResource(element.getResource(), fForce); - } - - /** - * @see MultiOperation - */ - protected void verify(ICElement element) throws CModelException { - if (element == null || !element.exists()) - error(CModelStatus.ELEMENT_DOES_NOT_EXIST, element); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java deleted file mode 100644 index 6645bf2a08e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java +++ /dev/null @@ -1,524 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.IPath; - -/** - * This class is used by CModelManager to convert - * IResourceDeltas into ICElementDeltas. - * It also does some processing on the CElements involved - * (e.g. closing them or updating classpaths). - */ -public class DeltaProcessor { - - /** - * The CElementDelta corresponding to the IResourceDelta being translated. - */ - protected CElementDelta fCurrentDelta; - - protected IndexManager indexManager = new IndexManager(); - - /* The C element that was last created (see createElement(IResource). - * This is used as a stack of C elements (using getParent() to pop it, and - * using the various get*(...) to push it. */ - ICElement currentElement; - - static final ICElementDelta[] NO_DELTA = new ICElementDelta[0]; - - public static boolean VERBOSE = false; - - // Hold on the element bein renamed. - ICElement movedFromElement = null; - - /** - * Creates the create corresponding to this resource. - * Returns null if none was found. - */ - protected ICElement createElement(IResource resource) { - CModelManager manager = CModelManager.getDefault(); - if (resource == null) - return null; - ICElement celement = manager.create(resource); - if (celement == null) { - ICElement parent = manager.create(resource.getParent()); - // Probably it was deleted, find it - if (parent instanceof IParent) { - ICElement[] children; - if ( CModelManager.getDefault().peekAtInfo(parent) != null ) { - children = ((CElement)parent).getElementInfo().getChildren(); - for (int i = 0; i < children.length; i++) { - IResource res = children[i].getResource(); - if (res != null && res.equals(resource)) { - celement = children[i]; - break; - } - } - } - // BUG 36424: - // The Binary may only be visible in the BinaryContainers - if (celement == null) { - ICProject cproj = parent.getCProject(); - if (cproj != null) { - IBinaryContainer bin = cproj.getBinaryContainer(); - children = ((CElement)bin).getElementInfo().getChildren(); - for (int i = 0; i < children.length; i++) { - IResource res = children[i].getResource(); - if (res != null && res.equals(resource)) { - celement = children[i]; - break; - } - } - } - } - // BUG 36424: - // The Archive may only be visible in the ArchiveContainers - if (celement == null) { - ICProject cproj = parent.getCProject(); - if (cproj != null) { - IArchiveContainer bin = cproj.getArchiveContainer(); - children = ((CElement)bin).getElementInfo().getChildren(); - for (int i = 0; i < children.length; i++) { - IResource res = children[i].getResource(); - if (res != null && res.equals(resource)) { - celement = children[i]; - break; - } - } - } - } - } - } - return celement; - } - - /** - * Creates the create corresponding to this resource. - * Returns null if none was found. - */ - protected ICElement createElement(IPath path) { - return CModelManager.getDefault().create(path); - } - - /** - * Release the Element from the CModel hastable. - * Returns null if none was found. - */ - protected void releaseCElement(ICElement celement) { - CModelManager.getDefault().releaseCElement(celement); - } - - /** - * Adds the given child handle to its parent's cache of children. - */ - protected void addToParentInfo(Openable child) { - Openable parent = (Openable) child.getParent(); - if (parent != null && parent.isOpen()) { - CElementInfo info = (CElementInfo)parent.getElementInfo(); - info.addChild(child); - } - } - - /** - * Processing for an element that has been added:
            - *
          • If the element is a project, do nothing, and do not process - * children, as when a project is created it does not yet have any - * natures - specifically a java nature. - *
          • If the elemet is not a project, process it as added (see - * basicElementAdded. - *
          - */ - protected void elementAdded(ICElement element, IResourceDelta delta) { - - if (element instanceof Openable) { - addToParentInfo((Openable)element); - } - if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) { - //ICElement movedFromElement = createElement(delta.getMovedFromPath()); - if (movedFromElement == null) - movedFromElement = createElement(delta.getMovedFromPath()); - fCurrentDelta.movedTo(element, movedFromElement); - movedFromElement = null; - } else { - fCurrentDelta.added(element); - } - } - - /** - * Processing for the closing of an element - there are two cases:
            - *
          • when a project is closed (in the platform sense), the - * CModel reports this as if the CProject has been removed. - *
          • otherwise, the CModel reports this - * as a the element being closed (CHANGED + F_CLOSED). - *
          - *

          In both cases, the children of the element are not processed. When - * a resource is closed, the platform reports all children as removed. This - * would effectively delete the classpath if we processed children. - */ - protected void elementClosed(ICElement element, IResourceDelta delta) { - - if (element.getElementType() == ICElement.C_PROJECT) { - // treat project closing as removal - elementRemoved(element, delta); - } else { - fCurrentDelta.closed(element); - } - } - - /** - * Processing for the opening of an element - there are two cases:

            - *
          • when a project is opened (in the platform sense), the - * CModel reports this as if the CProject has been added. - *
          • otherwise, the CModel reports this - * as a the element being opened (CHANGED + F_CLOSED). - *
          - */ - protected void elementOpened(ICElement element, IResourceDelta delta) { - - if (element.getElementType() == ICElement.C_PROJECT) { - // treat project opening as addition - if (hasCNature(delta.getResource())) { - elementAdded(element, delta); - } - } else { - fCurrentDelta.opened(element); - } - } - - /* - * Closes the given element, which removes it from the cache of open elements. - */ - private void close(Openable element) { - try { - element.close(); - } catch (CModelException e) { - // do nothing - } - } - - /** - * Generic processing for elements with changed contents:
            - *
          • The element is closed such that any subsequent accesses will re-open - * the element reflecting its new structure. - *
          • An entry is made in the delta reporting a content change (K_CHANGE with F_CONTENT flag set). - *
          - */ - protected void elementChanged(ICElement element, IResourceDelta delta) { - if (element instanceof Openable) { - close((Openable)element); - } - fCurrentDelta.changed(element, ICElementDelta.F_CONTENT); - } - - /** - * Generic processing for a removed element:
            - *
          • Close the element, removing its structure from the cache - *
          • Remove the element from its parent's cache of children - *
          • Add a REMOVED entry in the delta - *
          - */ - protected void elementRemoved(ICElement element, IResourceDelta delta) { - if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) { - IPath movedToPath = delta.getMovedToPath(); - // create the moved to element - ICElement movedToElement = createElement(movedToPath); - if (movedToElement == null) { - // moved outside - fCurrentDelta.removed(element); - } else { - movedFromElement = element; - fCurrentDelta.movedFrom(element, movedToElement); - } - } else { - fCurrentDelta.removed(element); - } - releaseCElement(element); - } - - /** - * Filters the generated CElementDeltas to remove those - * which should not be fired (because they don't represent a real change - * in the C Model). - */ - protected ICElementDelta[] filterRealDeltas(ICElementDelta[] deltas) { - - int length = deltas.length; - ICElementDelta[] realDeltas = null; - int index = 0; - for (int i = 0; i < length; i++) { - CElementDelta delta = (CElementDelta)deltas[i]; - if (delta == null) { - continue; - } - if (delta.getAffectedChildren().length > 0 - || delta.getKind() == ICElementDelta.ADDED - || delta.getKind() == ICElementDelta.REMOVED - || (delta.getFlags() & ICElementDelta.F_CLOSED) != 0 - || (delta.getFlags() & ICElementDelta.F_OPENED) != 0 - || delta.resourceDeltasCounter > 0) { - - if (realDeltas == null) { - realDeltas = new ICElementDelta[length]; - } - realDeltas[index++] = delta; - } - } - if (index > 0) { - ICElementDelta[] result = new ICElementDelta[index]; - System.arraycopy(realDeltas, 0, result, 0, index); - return result; - } else { - return NO_DELTA; - } - } - - /** - * Returns true if the given resource is contained in an open project - * with a java nature, otherwise false. - */ - protected boolean hasCNature(IResource resource) { - // ensure the project has a C nature (if open) - IProject project = resource.getProject(); - if (project.isOpen()) { - return CoreModel.getDefault().hasCNature(project); - } - return false; - } - - /** - * Converts a IResourceDelta rooted in a Workspace into - * the corresponding set of ICElementDelta, rooted in the - * relevant CModels. - */ - public ICElementDelta[] processResourceDelta(IResourceDelta changes) { - - try { - ICElement root = (ICModel)CModelManager.getDefault().getCModel(); - -/* - try { - changes.accept(new IResourceDeltaVisitor() { - public boolean visit(IResourceDelta delta) { - switch (delta.getKind()) { - case IResourceDelta.ADDED : - // handle added resource - System.out.print("ADDED "); - break; - case IResourceDelta.REMOVED : - // handle removed resource - System.out.print("REMOVED "); - break; - case IResourceDelta.CHANGED : - // handle changed resource - System.out.print("CHANGED "); - break; - } - System.out.println(delta.getResource()); - return true; - } - }); - } catch (CoreException e) { - } -*/ - // get the workspace delta, and start processing there. - IResourceDelta[] deltas = changes.getAffectedChildren(); - ICElementDelta[] translatedDeltas = new CElementDelta[deltas.length]; - //System.out.println("delta.length: " + deltas.length); - for (int i = 0; i < deltas.length; i++) { - IResourceDelta delta = deltas[i]; - fCurrentDelta = new CElementDelta(root); - traverseDelta(root, delta); // traverse delta - translatedDeltas[i] = fCurrentDelta; - } - return filterRealDeltas(translatedDeltas); - } finally { - } - } - - /** - * Converts an IResourceDelta and its children into - * the corresponding ICElementDeltas. - * Return whether the delta corresponds to a resource on the classpath. - * If it is not a resource on the classpath, it will be added as a non-java - * resource by the sender of this method. - */ - protected void traverseDelta(ICElement parent, IResourceDelta delta) { - try { - ICElement current = updateCurrentDeltaAndIndex(delta); - if (current == null) { - nonCResourcesChanged(parent, delta); - } else { - parent = current; - } - } catch (CModelException e) { - } - IResourceDelta [] children = delta.getAffectedChildren(); - for (int i = 0; i < children.length; i++) { - traverseDelta(parent, children[i]); - } - } - - protected void nonCResourcesChanged(ICElement parent, IResourceDelta delta) { - CElementDelta elementDelta = fCurrentDelta.find(parent); - if (elementDelta == null) { - fCurrentDelta.changed(parent, ICElementDelta.F_CONTENT); - } else { - elementDelta.addResourceDelta(delta); - } - if (parent instanceof CContainer) { - // if info not created yet no need to null NonCResources... - if (CModelManager.getDefault().peekAtInfo(parent) != null) { - CElementInfo info = ((CContainer)parent).getElementInfo(); - if (info instanceof CContainerInfo) { - ((CContainerInfo)info).setNonCResources(null); - } - } - } - } - - /* - * Update the current delta (ie. add/remove/change the given element) and update the - * correponding index. - * Returns whether the children of the given delta must be processed. - * @throws a CModelException if the delta doesn't correspond to a c element of the given type. - */ - private ICElement updateCurrentDeltaAndIndex(IResourceDelta delta) throws CModelException { - - IResource resource = delta.getResource(); - ICElement element = createElement(resource); - - switch (delta.getKind()) { - case IResourceDelta.ADDED : - if (element != null) { - updateIndexAddResource(element, delta); - elementAdded(element, delta); - } - break; - - case IResourceDelta.REMOVED : - if (element != null) { - updateIndexRemoveResource(element, delta); - elementRemoved(element, delta); - } - break; - - case IResourceDelta.CHANGED : - int flags = delta.getFlags(); - if ((flags & IResourceDelta.CONTENT) != 0) { - // content has changed - if (element != null) { - elementChanged(element, delta); - updateIndexAddResource(element, delta); - //check to see if any projects need to be reindexed - updateDependencies(element); - - } - } else if (resource.getType() == IResource.PROJECT) { - if ((flags & IResourceDelta.OPEN) != 0) { - // project has been opened or closed - IProject res = (IProject)resource; - if (element != null) { - if (res.isOpen()) { - elementOpened(element, delta); - updateIndexAddResource(element, delta); - } else { - elementClosed(element, delta); - updateIndexRemoveResource(element, delta); - } - } - } else if ((flags & IResourceDelta.DESCRIPTION) != 0) { - if (element != null) { - elementAdded(element, delta); - } - } else if (element != null) { - elementChanged(element, delta); - } - } else if (element != null) { - elementChanged(element, delta); - } - break; - } - return element; - } - - protected void updateIndexAddResource(ICElement element, IResourceDelta delta) { - - if (indexManager == null) - return; - - switch (element.getElementType()) { - case ICElement.C_PROJECT : - this.indexManager.indexAll(element.getCProject().getProject()); - break; - - case ICElement.C_UNIT: - IFile file = (IFile) delta.getResource(); - IProject filesProject = file.getProject(); - indexManager.addSource(file, filesProject.getFullPath()); - break; - } - - } - - protected void updateIndexRemoveResource(ICElement element, IResourceDelta delta) { - - if (indexManager == null) - return; - - switch (element.getElementType()) { - case ICElement.C_PROJECT : - this.indexManager.removeIndexFamily(element.getCProject().getProject().getFullPath()); - // NB: Discarding index jobs belonging to this project was done during PRE_DELETE - break; - // NB: Update of index if project is opened, closed, or its c nature is added or removed - // is done in updateCurrentDeltaAndIndex - - case ICElement.C_UNIT: - IFile file = (IFile) delta.getResource(); - indexManager.remove(file.getFullPath().toString(), file.getProject().getProject().getFullPath()); - break; - } - - - } - - private void updateDependencies(ICElement element){ - - IResource resource = element.getResource(); - if (resource == null) - return; - - String fileExtension = resource.getFileExtension(); - - if ((fileExtension != null) && - (isValidHeader(fileExtension))){ - indexManager.updateDependencies(resource); - } - } - - private boolean isValidHeader(String fileExtension) { - String[] supportedTypes = CModelManager.headerExtensions; - for (int i = 0; i < supportedTypes.length; ++i) { - if (supportedTypes[i].equals(fileExtension)) - return true; - } - return false; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java deleted file mode 100644 index 63656a5d469..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ElementCache.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.internal.core.util.LRUCache; -import org.eclipse.cdt.internal.core.util.OverflowingLRUCache; - -/** - * An LRU cache of CElements. - * - * This class is similar to the JDT ElementCache class. - */ -public class ElementCache extends OverflowingLRUCache { - - /** - * Constructs a new element cache of the given size. - */ - public ElementCache(int size) { - super(size); - } - /** - * Constructs a new element cache of the given size. - */ - public ElementCache(int size, int overflow) { - super(size, overflow); - } - /** - * Returns true if the element is successfully closed and - * removed from the cache, otherwise false. - * - *

          NOTE: this triggers an external removal of this element - * by closing the element. - */ - protected boolean close(LRUCacheEntry entry) { - IOpenable element = (IOpenable) entry._fKey; - try { - if (element.hasUnsavedChanges()) { - return false; - } /*else { - // We must close an entire JarPackageFragmentRoot at once. - if (element instanceof JarPackageFragment) { - JarPackageFragment packageFragment= (JarPackageFragment) element; - JarPackageFragmentRoot root = (JarPackageFragmentRoot) packageFragment.getParent(); - root.close(); - }*/ else { - element.close(); - } - return true; - // } - } catch (CModelException npe) { - return false; - } - } - /** - * Returns a new instance of the reciever. - */ - protected LRUCache newInstance(int size, int overflow) { - return new ElementCache(size, overflow); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java deleted file mode 100644 index cca67d8fa7a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IEnumeration; - -public class Enumeration extends SourceManipulation implements IEnumeration{ - - public Enumeration(ICElement parent, String name) { - super(parent, name, CElement.C_ENUMERATION); - } - - protected CElementInfo createElementInfo () { - return new EnumerationInfo(this); - } - - private EnumerationInfo getEnumerationInfo(){ - return (EnumerationInfo) getElementInfo(); - } - /** - * @see org.eclipse.cdt.core.model.IVariable#getInitializer() - */ - public String getInitializer() { - return null; - } - - /** - * @see org.eclipse.cdt.core.model.IVariableDeclaration#getTypeName() - */ - public String getTypeName() { - return getEnumerationInfo().getTypeName(); - } - - /** - * @see org.eclipse.cdt.core.model.IVariableDeclaration#setTypeName(java.lang.String) - */ - public void setTypeName(String type) { - getEnumerationInfo().setTypeName(type); - } - - /** - * @see org.eclipse.cdt.core.model.IDeclaration#isConst() - */ - public boolean isConst() { - return getEnumerationInfo().isConst(); - } - - /** - * @see org.eclipse.cdt.core.model.IDeclaration#isStatic() - */ - public boolean isStatic() { - return getEnumerationInfo().isStatic(); - } - - /** - * @see org.eclipse.cdt.core.model.IDeclaration#isVolatile() - */ - public boolean isVolatile() { - return getEnumerationInfo().isVolatile(); - } - - /** - * Sets the isConst. - * @param isConst The isConst to set - */ - public void setConst(boolean isConst) { - getEnumerationInfo().setConst(isConst); - } - - /** - * Sets the isStatic. - * @param isStatic The isStatic to set - */ - public void setStatic(boolean isStatic) { - getEnumerationInfo().setStatic( isStatic); - } - - /** - * Sets the isVolatile. - * @param isVolatile The isVolatile to set - */ - public void setVolatile(boolean isVolatile) { - getEnumerationInfo().setVolatile(isVolatile); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java deleted file mode 100644 index 511a8a79a00..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ -public class EnumerationInfo extends VariableInfo{ - - - protected EnumerationInfo(CElement element) { - super(element); - } - - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java deleted file mode 100644 index bd3a8c5b3df..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IEnumerator; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ -public class Enumerator extends SourceManipulation implements IEnumerator{ - - String constantExpression = ""; - - public Enumerator(ICElement parent, String name) { - super(parent, name, CElement.C_ENUMERATOR); - } - - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } - - /** - * @see org.eclipse.cdt.core.model.IEnumerator#getConstantExptrssion() - */ - public String getConstantExpression() { - return constantExpression; - } - - /** - * Sets the constantExpression. - * @param constantExpression The constantExpression to set - */ - public void setConstantExpression(String constantExpression) { - this.constantExpression = constantExpression; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java deleted file mode 100644 index 59c62ca3b8f..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IField; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -public class Field extends VariableDeclaration implements IField { - - public Field(ICElement parent, String name) { - super(parent, name, CElement.C_FIELD); - } - - public boolean isMutable(){ - return getFieldInfo().isMutable(); - } - - public void setMutable(boolean mutable){ - getFieldInfo().setMutable(mutable); - } - - public String getTypeName() { - return getFieldInfo().getTypeName(); - } - - public void setTypeName(String type) { - getFieldInfo().setTypeName(type); - } - - public boolean isConst() { - return getFieldInfo().isConst(); - } - - public void setConst(boolean isConst) { - getFieldInfo().setConst(isConst); - } - - public boolean isVolatile() { - return getFieldInfo().isVolatile(); - } - - public void setVolatile(boolean isVolatile) { - getFieldInfo().setVolatile(isVolatile); - } - - public boolean isStatic() { - return getFieldInfo().isStatic(); - } - - public void setStatic(boolean isStatic) { - getFieldInfo().setStatic(isStatic); - } - - public ASTAccessVisibility getVisibility() { - return getFieldInfo().getVisibility(); - } - - public void setVisibility(ASTAccessVisibility visibility) { - getFieldInfo().setVisibility(visibility); - } - - public FieldInfo getFieldInfo(){ - return (FieldInfo) getElementInfo(); - } - - protected CElementInfo createElementInfo () { - return new FieldInfo(this); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java deleted file mode 100644 index 52e4b4c63d1..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -public class FieldInfo extends SourceManipulationInfo { - - String typeStr = ""; - boolean isConst = false; - boolean isVolatile = false; - boolean isMutable = false; - boolean isStatic = false; - ASTAccessVisibility visibility; - - protected FieldInfo (CElement element) { - super(element); - visibility = ASTAccessVisibility.PRIVATE; - } - - protected String getTypeName(){ - return typeStr; - } - - protected void setTypeName(String type){ - typeStr = type; - } - - protected boolean isConst(){ - return isConst; - } - - protected void setConst(boolean isConst){ - this.isConst = isConst; - } - - protected boolean isVolatile(){ - return isVolatile; - } - - protected void setVolatile(boolean isVolatile){ - this.isVolatile = isVolatile; - } - - public boolean isStatic() { - return isStatic; - } - - public void setStatic(boolean isStatic) { - this.isStatic = isStatic; - } - - protected boolean isMutable(){ - return isMutable; - } - - protected void setMutable(boolean mutable){ - this.isMutable = mutable; - } - /** - * Returns the visibility. - * @return int - */ - public ASTAccessVisibility getVisibility() { - return visibility; - } - - /** - * Sets the visibility. - * @param visibility The visibility to set - */ - public void setVisibility(ASTAccessVisibility visibility) { - this.visibility = visibility; - } - - /** - * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(SourceManipulationInfo) - */ - public boolean hasSameContentsAs( SourceManipulationInfo info){ - - return( super.hasSameContentsAs(info) - && (typeStr.equals(((FieldInfo)info).getTypeName())) - && (isConst == ((FieldInfo)info).isConst()) - && (isVolatile == ((FieldInfo)info).isVolatile()) - && (isMutable == ((FieldInfo)info).isMutable()) - && (visibility == ((FieldInfo)info).getVisibility()) - && (isStatic == ((FieldInfo)info).isStatic()) - ); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Function.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Function.java deleted file mode 100644 index 7246a96c54e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Function.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunction; - -public class Function extends FunctionDeclaration implements IFunction { - - public Function(ICElement parent, String name) { - super(parent, name, CElement.C_FUNCTION); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java deleted file mode 100644 index 6e0db36083f..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunctionDeclaration; - -public class FunctionDeclaration extends SourceManipulation implements IFunctionDeclaration { - /** - * An empty list of Strings - */ - protected static final String[] fgEmptyList= new String[] {}; - protected String[] fParameterTypes; - protected String returnType; - - public FunctionDeclaration(ICElement parent, String name) { - super(parent, name, CElement.C_FUNCTION_DECLARATION); - fParameterTypes= fgEmptyList; - } - - public FunctionDeclaration(ICElement parent, String name, int type) { - super(parent, name, type); - fParameterTypes= fgEmptyList; - } - - public String getReturnType(){ - if (returnType != null) - return returnType; - else - return ""; - } - - public void setReturnType(String type){ - returnType = type; - } - - public int getNumberOfParameters() { - return fParameterTypes == null ? 0 : fParameterTypes.length; - } - - public String[] getParameterTypes() { - return fParameterTypes; - } - - public void setParameterTypes(String[] parameterTypes) { - fParameterTypes = parameterTypes; - } - - public String getSignature(){ - StringBuffer sig = new StringBuffer(getElementName()); - sig.append(getParameterClause()); - if(isConst()) - sig.append(" const"); - if(isVolatile()) - sig.append(" volatile"); - return sig.toString(); - } - - public String getParameterClause(){ - StringBuffer sig = new StringBuffer(); - - if(getNumberOfParameters() > 0){ - sig.append("("); - String[] paramTypes = getParameterTypes(); - int i = 0; - sig.append(paramTypes[i++]); - while (i < paramTypes.length){ - sig.append(", "); - sig.append(paramTypes[i++]); - } - sig.append(")"); - } - else{ - sig.append("()"); - } - return sig.toString(); - } - - public String getParameterInitializer(int pos) { - return ""; - } - - public String[] getExceptions(){ - return new String[] {}; - } - - protected CElementInfo createElementInfo () { - return new FunctionInfo(this); - } - - protected FunctionInfo getFunctionInfo(){ - return (FunctionInfo) getElementInfo(); - } - - public boolean equals(Object other) { - // Two function declarations are equal if - // Their parents and names are equal and - return ( super.equals(other) - // their parameter types are equal and - && Util.equalArraysOrNull(fParameterTypes, ((FunctionDeclaration)other).fParameterTypes) - // their return types are equal - && getReturnType().equals(((FunctionDeclaration)other).getReturnType()) - ); - } - - /** - * FunctionDeclarations and Functions can not be constant - * @see org.eclipse.cdt.core.model.IDeclaration#isConst() - */ - public boolean isConst(){ - return getFunctionInfo().isConst(); - } - - public void setConst(boolean isConst){ - getFunctionInfo().setConst(isConst); - } - - /** - * Returns the isStatic. - * @return boolean - */ - public boolean isStatic() { - return getFunctionInfo().isStatic(); - } - - /** - * Returns the isVolatile. - * @return boolean - */ - public boolean isVolatile() { - return getFunctionInfo().isVolatile(); - } - - /** - * Sets the isStatic. - * @param isStatic The isStatic to set - */ - public void setStatic(boolean isStatic) { - getFunctionInfo().setStatic(isStatic); - } - - /** - * Sets the isVolatile. - * @param isVolatile The isVolatile to set - */ - public void setVolatile(boolean isVolatile) { - getFunctionInfo().setVolatile(isVolatile); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java deleted file mode 100644 index 0d74c45793b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -class FunctionInfo extends SourceManipulationInfo { - - protected boolean isStatic; - protected boolean isVolatile; - protected boolean isConst; - - - protected FunctionInfo (CElement element) { - super(element); - } - - /** - * Returns the isStatic. - * @return boolean - */ - public boolean isStatic() { - return isStatic; - } - - /** - * Returns the isVolatile. - * @return boolean - */ - public boolean isVolatile() { - return isVolatile; - } - - /** - * Sets the isStatic. - * @param isStatic The isStatic to set - */ - public void setStatic(boolean isStatic) { - this.isStatic = isStatic; - } - - /** - * Sets the isVolatile. - * @param isVolatile The isVolatile to set - */ - public void setVolatile(boolean isVolatile) { - this.isVolatile = isVolatile; - } - - /** - * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(org.eclipse.cdt.internal.core.model.SourceManipulationInfo) - */ - public boolean hasSameContentsAs(SourceManipulationInfo otherInfo) { - return (super.hasSameContentsAs(otherInfo) - && (this.isStatic() == ((FunctionInfo)otherInfo).isStatic()) - && (this.isVolatile() == ((FunctionInfo)otherInfo).isVolatile()) - ); - } - - /** - * Returns the isConst. - * @return boolean - */ - public boolean isConst() { - return isConst; - } - - /** - * Sets the isConst. - * @param isConst The isConst to set - */ - public void setConst(boolean isConst) { - this.isConst = isConst; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java deleted file mode 100644 index ad2f99bae97..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITemplate; - -public class FunctionTemplate extends FunctionDeclaration implements ITemplate{ - - protected static final String[] fgEmptyList= new String[] {}; - protected String[] templateParameterTypes; - - public FunctionTemplate(ICElement parent, String name) { - super(parent, name, CElement.C_TEMPLATE_FUNCTION); - templateParameterTypes= fgEmptyList; - } - - /** - * Returns the parameterTypes. - * @see org.eclipse.cdt.core.model.ITemplate#getParameters() - * @return String[] - */ - public String[] getTemplateParameterTypes() { - return templateParameterTypes; - } - - /** - * Sets the fParameterTypes. - * @param fParameterTypes The fParameterTypes to set - */ - public void setTemplateParameterTypes(String[] templateParameterTypes) { - this.templateParameterTypes = templateParameterTypes; - } - /** - * @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters() - */ - public int getNumberOfTemplateParameters() { - return templateParameterTypes == null ? 0 : templateParameterTypes.length; - } - - /** - * @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature() - */ - /* - * The signature in the outline view will be: - * The class X followed by its template parameters, - * then the scope resolution, then the function name, - * followed by its template parameters, folowed by its - * normal parameter list, then a colon then the function's - * return type. - */ - public String getTemplateSignature() { - StringBuffer sig = new StringBuffer(getElementName()); - if(getNumberOfTemplateParameters() > 0){ - sig.append("<"); - String[] paramTypes = getTemplateParameterTypes(); - int i = 0; - sig.append(paramTypes[i++]); - while (i < paramTypes.length){ - sig.append(", "); - sig.append(paramTypes[i++]); - } - sig.append(">"); - } - else{ - sig.append("<>"); - } - sig.append(this.getParameterClause()); - if(isConst()) - sig.append(" const"); - if(isVolatile()) - sig.append(" volatile"); - - if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){ - sig.append(" : "); - sig.append(this.getReturnType()); - } - - return sig.toString(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IBufferFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IBufferFactory.java deleted file mode 100644 index 0265d5428fb..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IBufferFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.*; -import org.eclipse.cdt.core.model.IOpenable; -/** - * A factory that creates IBuffers for CFiles. - *

          - * This interface may be implemented by clients. - *

          - * - * This interface is similar to the JDT IBufferFactory interface. - */ -public interface IBufferFactory { - - /** - * Creates a buffer for the given owner. - * The new buffer will be initialized with the contents of the owner - * if and only if it was not already initialized by the factory (a buffer is uninitialized if - * its content is null). - * - * @param owner the owner of the buffer - * @see IBuffer - */ - IBuffer createBuffer(IOpenable owner); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IConstants.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IConstants.java deleted file mode 100644 index b9d20660da9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IConstants.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * This interface defines constants for use by the builder / compiler interface. - */ -public interface IConstants { - - /* - * Modifiers - */ - int AccPublic = 0x0001; - int AccPrivate = 0x0002; - int AccProtected = 0x0004; - int AccStatic = 0x0008; - int AccExtern = 0x0010; - int AccInline = 0x0020; - int AccVolatile = 0x0040; - int AccRegister = 0x0080; - int AccExplicit = 0x0100; - int AccExport = 0x0200; - int AccAbstract = 0x0400; - int AccMutable = 0x0800; - - /* - * Other VM flags. - */ - int AccAuto = 0x0020; - - /** - * Extra flags for types and members. - */ - int AccVirtual = 0x20000; - int AccTypename = 0x100000; -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java deleted file mode 100644 index ff791844b2c..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IDebugLogConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Created on Aug 25, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.model; - -/** - * @author bgheorgh - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IDebugLogConstants { - public class DebugLogConstant { - private DebugLogConstant( int value ) - { - this.value = value; - } - private final int value; - } - - public static final DebugLogConstant PARSER = new DebugLogConstant( 1 ); - public static final DebugLogConstant MODEL = new DebugLogConstant ( 2 ); - public static final DebugLogConstant CONTENTASSIST = new DebugLogConstant ( 3 ); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java deleted file mode 100644 index b54ea2c3e60..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - *

          A working copy of a C element acts just like a regular element (handle), - * except it is not attached to an underlying resource. A working copy is not - * visible to the rest of the C model. Changes in a working copy's buffer are - * not realized in a resource. To bring the C model up-to-date with a working - * copy's contents, an explicit commit must be performed on the working copy. - * Other operations performed on a working copy update the contents of the - * working copy's buffer but do not commit the contents of the working copy. - *

          - *

          - * Note: The contents of a working copy is determined when a working - * copy is created, based on the current content of the element the working - * copy is created from. If a working copy is an ICFile and is - * explicitly closed, the working copy's buffer will be thrown away. However, - * clients should not explicitly open and close working copies. - *

          - *

          - * The client that creates a working copy is responsible for - * destroying the working copy. The C model will never automatically destroy or - * close a working copy. (Note that destroying a working copy does not commit it - * to the model, it only frees up the memory occupied by the element). After a - * working copy is destroyed, the working copy cannot be accessed again. Non- - * handle methods will throw a CModelException indicating the - * C element does not exist. - *

          - *

          - * A working copy cannot be created from another working copy. - * Calling getWorkingCopy on a working copy returns the receiver. - *

          - */ -public interface IWorkingCopy extends ITranslationUnit{ - /** - * Commits the contents of this working copy to its original element - * and underlying resource, bringing the C model up-to-date with the current - * contents of the working copy. - * - *

          It is possible that the contents of the original resource have changed - * since this working copy was created, in which case there is an update conflict. - * The value of the force parameter effects the resolution of - * such a conflict:

            - *
          • true - in this case the contents of this working copy are applied to - * the underlying resource even though this working copy was created before - * a subsequent change in the resource
          • - *
          • false - in this case a CModelException is - * thrown
          • - *
          - */ - void commit(boolean force, IProgressMonitor monitor) throws CModelException; - /** - * Destroys this working copy, closing its buffer and discarding - * its structure. Subsequent attempts to access non-handle information - * for this working copy will result in CModelExceptions. Has - * no effect if this element is not a working copy. - *

          - * If this working copy is shared, it is destroyed only when the number of calls to - * destroy() is the same as the number of calls to - * getSharedWorkingCopy(IProgressMonitor, IBufferFactory). - * A REMOVED CElementDelta is then reported on this working copy. - */ - - void destroy(); - - /** - * Returns the original element this working copy was created from, - * or null if this is not a working copy. - */ - ITranslationUnit getOriginalElement(); - - /** - * Returns whether this working copy's original element's content - * has not changed since the inception of this working copy. - * - * @return true if this working copy's original element's content - * has not changed since the inception of this working copy, false otherwise - */ - boolean isBasedOn(IResource resource); - - /** - * Reconciles the contents of this working copy. - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta. - *

          - * If the working copy hasn't changed, then no problem will be detected, - * this is equivalent to IWorkingCopy#reconcile(false, null). - *

          - */ - IMarker[] reconcile() throws CModelException; - - /** - * Reconciles the contents of this working copy. - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta. - *

          - * The boolean argument allows to force problem detection even if the - * working copy is already consistent. - */ - boolean reconcile(boolean forceProblemDetection, IProgressMonitor monitor) throws CModelException; - /** - * Restores the contents of this working copy to the current contents of - * this working copy's original element. Has no effect if this element - * is not a working copy. - */ - void restore() throws CModelException; -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java deleted file mode 100644 index 91ef79fe688..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IInclude; - -public class Include extends SourceManipulation implements IInclude { - - private final boolean standard; - private String fullPath; - - public Include(ICElement parent, String name, boolean isStandard) { - super(parent, name, CElement.C_INCLUDE); - standard = isStandard; - } - - public String getIncludeName() { - return getElementName(); - } - - public boolean isStandard() { - return standard; - } - - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IInclude#getFullFileName() - */ - public String getFullFileName() { - return fullPath; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IInclude#isLocal() - */ - public boolean isLocal() { - return !isStandard(); - } - - /* - * This is not yet populated properly by the parse; - * however, it might be in the near future. - */ - public void setFullPathName(String fullPath) { - this.fullPath = fullPath; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java deleted file mode 100644 index 0072ee5ede2..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java +++ /dev/null @@ -1,88 +0,0 @@ -/********************************************************************** - * Created on 25-Mar-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.IIncludeEntry; -import org.eclipse.core.runtime.IPath; - -public class IncludeEntry extends ACPathEntry implements IIncludeEntry { - - IPath resourcePath; - IPath includePath; - boolean isSystemInclude; - - public IncludeEntry(IPath resourcePath, IPath includePath, boolean isSystemInclude, - boolean isRecursive, IPath[] exclusionPatterns, boolean isExported) { - super(IIncludeEntry.CDT_INCLUDE, isRecursive, exclusionPatterns, isExported); - this.resourcePath = resourcePath; - this.includePath = includePath; - this.isSystemInclude = isSystemInclude; - } - - /** - * Returns the affected resource by the include. - * @return IPath - */ - public IPath getResourcePath() { - return resourcePath; - } - - /** - * Returns the include path - * @return IPath - */ - public IPath getIncludePath() { - return includePath; - } - - /** - * Whether or not it a system include path - * @return boolean - */ - public boolean isSystemInclude() { - return isSystemInclude; - } - - public boolean equals(Object obj) { - if (obj instanceof IIncludeEntry) { - IIncludeEntry otherEntry = (IIncludeEntry)obj; - if (!super.equals(otherEntry)) { - return false; - } - if (resourcePath == null) { - if (otherEntry.getResourcePath() != null) { - return false; - } - } else { - if (!resourcePath.toString().equals(otherEntry.getResourcePath().toString())) { - return false; - } - } - if (includePath == null) { - if (otherEntry.getIncludePath() != null) { - return false; - } - } else { - if (!includePath.toString().equals(otherEntry.getIncludePath().toString())) { - return false; - } - } - if (isSystemInclude != otherEntry.isSystemInclude()) { - return false; - } - return true; - } - return super.equals(obj); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java deleted file mode 100644 index 6e418ef0d0f..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java +++ /dev/null @@ -1,120 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ILibraryEntry; -import org.eclipse.core.runtime.IPath; - -public class LibraryEntry extends CPathEntry implements ILibraryEntry { - - IPath libraryPath; - IPath sourceAttachmentPath; - IPath sourceAttachmentRootPath; - IPath sourceAttachmentPrefixMapping; - - public LibraryEntry(IPath libraryPath, IPath sourceAttachmentPath, - IPath sourceAttachmentRootPath, IPath sourceAttachmentPrefixMapping, boolean isExported) { - super(ILibraryEntry.CDT_LIBRARY, isExported); - this.libraryPath = libraryPath; - this.sourceAttachmentPath = sourceAttachmentPath; - this.sourceAttachmentRootPath = sourceAttachmentRootPath; - this.sourceAttachmentPrefixMapping = sourceAttachmentPrefixMapping; - } - - /** - * Returns the absolute path of the library - * @return String - */ - public IPath getLibraryPath() { - return libraryPath; - } - - /** - * Returns the path to the source archive or folder associated with this - * C path entry, or null if this C path entry has no - * source attachment. - *

          - * Only library and variable C path entries may have source attachments. - * For library C path entries, the result path (if present) locates a source - * archive or folder. This archive or folder can be located in a project of the - * workspace or outside thr workspace. For variable c path entries, the - * result path (if present) has an analogous form and meaning as the - * variable path, namely the first segment is the name of a c path variable. - *

          - * - * @return the path to the source archive or folder, or null if none - */ - public IPath getSourceAttachmentPath() { - return sourceAttachmentPath; - } - - /** - * Returns the path within the source archive or folder where source - * are located. An empty path indicates that packages are located at - * the root of the source archive or folder. Returns a non-null value - * if and only if getSourceAttachmentPath returns - * a non-null value. - * - * @return the path within the source archive or folder, or null if - * not applicable - */ - public IPath getSourceAttachmentRootPath() { - return sourceAttachmentRootPath; - } - - /** - * Returns the path to map the source paths with to the source achive or folder - * An empty path indicates that the is a one-to-one mapping of source paths to the - * source achive or folder path. Returns a non-null value - * if and only if getSourceAttachmentPath returns - * a non-null value. - * - * @return the path mapping within the source archive or folder, or null if - * not applicable - */ - public IPath getSourceAttachmentPrefixMapping() { - return sourceAttachmentPrefixMapping; - } - - - public boolean equals(Object obj) { - if (obj instanceof ILibraryEntry) { - ILibraryEntry otherEntry = (ILibraryEntry)obj; - if (!super.equals(obj)) { - return false; - } - IPath otherPath = otherEntry.getSourceAttachmentPath(); - if (sourceAttachmentPath == null) { - if (otherPath != null) { - return false; - } - } else { - if (!sourceAttachmentPath.equals(otherPath)) { - return false; - } - } - otherPath = otherEntry.getSourceAttachmentRootPath(); - if (sourceAttachmentRootPath == null) { - if (otherPath != null) { - return false; - } - } else { - if (!sourceAttachmentRootPath.equals(otherPath)) { - return false; - } - } - return true; - } - return super.equals(obj); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java deleted file mode 100644 index ee985a84d6a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Created on Apr 2, 2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template - */ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ILibraryEntry; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -/** - * @author alain - */ -public class LibraryReference extends Parent implements ILibraryReference { - - ILibraryEntry entry; - - public LibraryReference(ICElement parent, ILibraryEntry e) { - super(parent, e.getLibraryPath().lastSegment(), ICElement.C_VCONTAINER); - entry = e; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getResource() - */ - public IResource getResource() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo() - */ - protected CElementInfo createElementInfo() { - return new CElementInfo(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getPath() - */ - public IPath getPath() { - return entry.getLibraryPath(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java deleted file mode 100644 index d15a68c8115..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Created on Apr 2, 2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template - */ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ILibraryEntry; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -/** - * @author alain - */ -public class LibraryReferenceArchive extends Archive implements ILibraryReference { - - ILibraryEntry entry; - IBinaryArchive archive; - - public LibraryReferenceArchive(ICElement parent, ILibraryEntry e, IBinaryArchive ar) { - super(parent, e.getLibraryPath()); - setElementType(ICElement.C_VCONTAINER); - entry = e; - archive = ar; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getResource() - */ - public IResource getResource() { - return null; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getPath() - */ - public IPath getPath() { - return entry.getLibraryPath(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.Archive#getBinaryArchive(org.eclipse.core.resources.IResource) - */ - IBinaryArchive getBinaryArchive(IResource res) { - return archive; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java deleted file mode 100644 index ffa37133e05..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Created on Apr 2, 2003 - * - * To change this generated comment go to - * Window>Preferences>Java>Code Generation>Code Template - */ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ILibraryEntry; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -/** - * @author alain - */ -public class LibraryReferenceShared extends Binary implements ILibraryReference { - - ILibraryEntry entry; - - public LibraryReferenceShared(ICElement parent, ILibraryEntry e, IBinaryFile bin) { - super(parent, e.getLibraryPath(), bin); - setElementType(ICElement.C_VCONTAINER); - entry = e; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.Binary#getModificationStamp() - */ - protected long getModificationStamp() { - return getPath().toFile().lastModified(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getResource() - */ - public IResource getResource() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ICElement#getPath() - */ - public IPath getPath() { - return entry.getLibraryPath(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java deleted file mode 100644 index 7c5ca6fae54..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IMacro; - -public class Macro extends SourceManipulation implements IMacro { - - public Macro(ICElement parent, String name) { - super(parent, name, CElement.C_MACRO); - } - - public String getIdentifierList() { - return ""; - } - - public String getTokenSequence() { - return ""; - } - - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java deleted file mode 100644 index 95d4d48bc25..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java +++ /dev/null @@ -1,86 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.IMacroEntry; -import org.eclipse.core.runtime.IPath; - -public class MacroEntry extends ACPathEntry implements IMacroEntry { - - IPath resourcePath; - String macroName; - String macroValue; - - public MacroEntry (IPath resourcePath, String macroName, String macroValue, - boolean isRecursive, IPath[] exclusionPatterns, boolean isExported) { - super(IMacroEntry.CDT_MACRO, isRecursive, exclusionPatterns, isExported); - this.resourcePath = resourcePath; - this.macroName = macroName; - this.macroValue = macroValue; - } - - /** - * Returns the absolute path from the worskspace root or - * relative path of the affected resource. - * @return String - */ - public IPath getResourcePath() { - return resourcePath; - } - - /** - * Returns the macro name. - * @return String - */ - public String getMacroName() { - return macroName; - } - - /** - * Returns the macro value. - * @return String - */ - public String getMacroValue() { - return macroName; - } - - public boolean equals(Object obj) { - if (obj instanceof IMacroEntry) { - IMacroEntry otherEntry = (IMacroEntry)obj; - if (!super.equals(otherEntry)) { - return false; - } - if (macroName == null) { - if (otherEntry.getMacroName() != null) { - return false; - } - } else { - if (!macroName.equals(otherEntry.getMacroName())) { - return false; - } - } - if (macroValue == null) { - if (otherEntry.getMacroValue() != null) { - return false; - } - } else { - if (!macroValue.equals(otherEntry.getMacroValue())) { - return false; - } - } - return true; - } - return super.equals(obj); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java deleted file mode 100644 index adaf4a5bfa8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Method.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IMethod; - -public class Method extends MethodDeclaration implements IMethod{ - - public Method(ICElement parent, String name){ - super(parent, name, CElement.C_METHOD); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java deleted file mode 100644 index f54ac6c7c6e..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IMethodDeclaration; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -public class MethodDeclaration extends FunctionDeclaration implements IMethodDeclaration{ - - boolean isConst = false; - boolean isConstructor = false; - boolean isDestructor = false; - - public MethodDeclaration(ICElement parent, String name){ - super(parent, name, CElement.C_METHOD_DECLARATION); - } - - public MethodDeclaration(ICElement parent, String name, int type){ - super(parent, name, type); - } - - public boolean isConstructor(){ - // is not implemented in the parser's quick mode - //return isConstructor; - return getElementName().equals(getParent().getElementName()); - } - - public boolean isDestructor() { - // is not implemented in the parser's quick mode - //return isDestructor; - return getElementName().startsWith("~"); - } - - public void setConstructor(boolean isConstructor) { - this.isConstructor = isConstructor; - } - - public void setDestructor(boolean isDestructor) { - this.isDestructor = isDestructor; - } - - public boolean isOperator(){ - return getElementName().startsWith("operator"); - } - - public boolean isPureVirtual(){ - return getMethodInfo().isPureVirtual(); - } - - public void setPureVirtual(boolean isPureVirtual){ - getMethodInfo().setPureVirtual(isPureVirtual); - } - - public boolean isInline(){ - return getMethodInfo().isInline(); - } - - public void setInline(boolean isInline){ - getMethodInfo().setInline(isInline); - } - - public boolean isVirtual(){ - return getMethodInfo().isVirtual(); - } - - public void setVirtual(boolean isVirtual){ - getMethodInfo().setVirtual(isVirtual); - } - - public boolean isFriend(){ - return getMethodInfo().isFriend(); - } - - public void setFriend(boolean isFriend){ - getMethodInfo().setFriend(isFriend); - } - - public boolean isConst(){ - return isConst; - } - - public void setConst(boolean isConst){ - this.isConst = isConst; - getMethodInfo().setConst(isConst); - } - - public ASTAccessVisibility getVisibility(){ - return getMethodInfo().getVisibility(); - } - - public void setVisibility(ASTAccessVisibility visibility){ - getMethodInfo().setVisibility(visibility); - } - - protected CElementInfo createElementInfo () { - return new MethodInfo(this); - } - - private MethodInfo getMethodInfo(){ - return (MethodInfo) getElementInfo(); - } - - /* - * See if we need anything else to put in equals here - */ - public boolean equals(Object other) { - // Two methods are equal if - // their parents, names, parameter types and return types are equal and - return ( super.equals(other) - // their constant directive is the same - && isConst() == ((MethodDeclaration)other).isConst() - ); - } - - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java deleted file mode 100644 index bf3f5efadd4..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -public class MethodInfo extends FunctionInfo { - - boolean isPureVirtual = false; - boolean isInline = false; - boolean isVirtual = false; - boolean isFriend = false; - boolean isConst = false; - ASTAccessVisibility visibility = null; - - MethodInfo(CElement element) { - super(element); - visibility = ASTAccessVisibility.PRIVATE; - } - - public boolean isPureVirtual(){ - return isPureVirtual; - } - - public void setPureVirtual(boolean isPureVirtual){ - this.isPureVirtual = isPureVirtual; - } - - public boolean isInline(){ - return isInline; - } - - public void setInline(boolean isInline){ - this.isInline = isInline; - } - - public boolean isVirtual(){ - return isVirtual; - } - - public void setVirtual(boolean isVirtual){ - this.isVirtual = isVirtual; - } - - public boolean isFriend(){ - return isFriend; - } - - public void setFriend(boolean isFriend){ - this.isFriend = isFriend; - } - - public boolean isConst(){ - return isConst; - } - - public void setConst(boolean isConst){ - this.isConst = isConst; - } - - /** - * Returns the visibility. - * @return int - */ - public ASTAccessVisibility getVisibility() { - return visibility; - } - - /** - * Sets the visibility. - * @param visibility The visibility to set - */ - public void setVisibility(ASTAccessVisibility visibility) { - this.visibility = visibility; - } - - /** - * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(org.eclipse.cdt.internal.core.model.SourceManipulationInfo) - */ - public boolean hasSameContentsAs(SourceManipulationInfo otherInfo) { - return (super.hasSameContentsAs(otherInfo) - && (isConst == ((MethodInfo)otherInfo).isConst()) - && (isPureVirtual == ((MethodInfo)otherInfo).isPureVirtual()) - && (isInline == ((MethodInfo)otherInfo).isInline()) - && (isVirtual == ((MethodInfo)otherInfo).isVirtual()) - && (isFriend == ((MethodInfo)otherInfo).isFriend()) - && (visibility == ((MethodInfo)otherInfo).getVisibility()) - ); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java deleted file mode 100644 index a4b3a9020c8..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITemplate; - -public class MethodTemplate extends MethodDeclaration implements ITemplate{ - - protected static final String[] fgEmptyList= new String[] {}; - protected String[] templateParameterTypes; - - public MethodTemplate(ICElement parent, String name) { - super(parent, name, CElement.C_TEMPLATE_METHOD); - templateParameterTypes= fgEmptyList; - } - - /** - * Returns the parameterTypes. - * @see org.eclipse.cdt.core.model.ITemplate#getParameters() - * @return String[] - */ - public String[] getTemplateParameterTypes() { - return templateParameterTypes; - } - - /** - * Sets the fParameterTypes. - * @param fParameterTypes The fParameterTypes to set - */ - public void setTemplateParameterTypes(String[] templateParameterTypes) { - this.templateParameterTypes = templateParameterTypes; - } - /** - * @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters() - */ - public int getNumberOfTemplateParameters() { - return templateParameterTypes == null ? 0 : templateParameterTypes.length; - } - - /** - * @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature() - */ - /* - * The signature in the outline view will be: - * The class X followed by its template parameters, - * then the scope resolution, then the function name, - * followed by its template parameters, folowed by its - * normal parameter list, then a colon then the function's - * return type. - */ - - public String getTemplateSignature() { - StringBuffer sig = new StringBuffer(getElementName()); - if(getNumberOfTemplateParameters() > 0){ - sig.append("<"); - String[] paramTypes = getTemplateParameterTypes(); - int i = 0; - sig.append(paramTypes[i++]); - while (i < paramTypes.length){ - sig.append(", "); - sig.append(paramTypes[i++]); - } - sig.append(">"); - } - else{ - sig.append("<>"); - } - sig.append(this.getParameterClause()); - if(isConst()) - sig.append(" const"); - if(isVolatile()) - sig.append(" volatile"); - - if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){ - sig.append(" : "); - sig.append(this.getReturnType()); - } - - return sig.toString(); - } - -} - diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MoveResourceElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MoveResourceElementsOperation.java deleted file mode 100644 index 8152f58e0e0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MoveResourceElementsOperation.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import org.eclipse.cdt.core.model.ICElement; - -/** - * This operation moves resources (package fragments and compilation units) from their current - * container to a specified destination container, optionally renaming the - * elements. - * A move resource operation is equivalent to a copy resource operation, where - * the source resources are deleted after the copy. - *

          This operation can be used for reorganizing resources within the same container. - * - * @see CopyResourceElementsOperation - */ -public class MoveResourceElementsOperation extends CopyResourceElementsOperation { - /** - * When executed, this operation will move the given elements to the given containers. - */ - public MoveResourceElementsOperation(ICElement[] elementsToMove, ICElement[] destContainers, boolean force) { - super(elementsToMove, destContainers, force); - } - - /** - * @see MultiOperation - */ - protected String getMainTaskName() { - return "operation.moveResourceProgress"; //$NON-NLS-1$ - } - - /** - * @see CopyResourceElementsOperation#isMove() - */ - protected boolean isMove() { - return true; - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java deleted file mode 100644 index 4ae5aaec649..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MultiOperation.java +++ /dev/null @@ -1,297 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICModelStatus; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.CModelException; - -/** - * This class is used to perform operations on multiple ICElement. - * It is responible for running each operation in turn, collecting - * the errors and merging the corresponding CElementDeltas. - *

          - * If several errors occured, they are collected in a multi-status - * CModelStatus. Otherwise, a simple CModelStatus - * is thrown. - */ -public abstract class MultiOperation extends CModelOperation { - /** - * The list of renamings supplied to the operation - */ - protected String[] fRenamingsList= null; - - /** - * Table specifying the new parent for elements being - * copied/moved/renamed. - * Keyed by elements being processed, and - * values are the corresponding destination parent. - */ - protected Map fParentElements; - - /** - * Table specifying insertion positions for elements being - * copied/moved/renamed. Keyed by elements being processed, and - * values are the corresponding insertion point. - * @see processElements(IProgressMonitor) - */ - protected Map fInsertBeforeElements= new HashMap(1); - - /** - * This table presents the data in fRenamingList in a more - * convenient way. - */ - protected Map fRenamings; - - /** - * Creates a new MultiOperation. - */ - protected MultiOperation(ICElement[] elementsToProcess, ICElement[] parentElements, boolean force) { - super(elementsToProcess, parentElements, force); - fParentElements = new HashMap(elementsToProcess.length); - if (elementsToProcess.length == parentElements.length) { - for (int i = 0; i < elementsToProcess.length; i++) { - fParentElements.put(elementsToProcess[i], parentElements[i]); - } - } else { //same destination for all elements to be moved/copied/renamed - for (int i = 0; i < elementsToProcess.length; i++) { - fParentElements.put(elementsToProcess[i], parentElements[0]); - } - } - } - - /** - * Creates a new MultiOperation on elementsToProcess. - */ - protected MultiOperation(ICElement[] elementsToProcess, boolean force) { - super(elementsToProcess, force); - } - - /** - * Convenience method to create a CModelException - * embending a CModelStatus. - */ - protected void error(int code, ICElement element) throws CModelException { - throw new CModelException(new CModelStatus(code, element)); - } - - /** - * Executes the operation. - * - * @exception CModelException if one or several errors occured during the operation. - * If multiple errors occured, the corresponding CModelStatus is a - * multi-status. Otherwise, it is a simple one. - */ - protected void executeOperation() throws CModelException { - try { - processElements(); - } catch (CModelException cme) { - throw cme; - } finally { - mergeDeltas(); - } - } - - /** - * Returns the parent of the element being copied/moved/renamed. - */ - protected ICElement getDestinationParent(ICElement child) { - return (ICElement)fParentElements.get(child); - } - - /** - * Returns the name to be used by the progress monitor. - */ - protected abstract String getMainTaskName(); - - /** - * Returns the new name for element, or null - * if there are no renamings specified. - */ - protected String getNewNameFor(ICElement element) { - if (fRenamings != null) - return (String) fRenamings.get(element); - else - return null; - } - - /** - * Sets up the renamings hashtable - keys are the elements and - * values are the new name. - */ - private void initializeRenamings() { - if (fRenamingsList != null && fRenamingsList.length == fElementsToProcess.length) { - fRenamings = new HashMap(fRenamingsList.length); - for (int i = 0; i < fRenamingsList.length; i++) { - if (fRenamingsList[i] != null) { - fRenamings.put(fElementsToProcess[i], fRenamingsList[i]); - } - } - } - } - - /** - * Returns true if this operation represents a move or rename, false - * if this operation represents a copy.
          - * Note: a rename is just a move within the same parent with a name change. - */ - protected boolean isMove() { - return false; - } - - /** - * Returns true if this operation represents a rename, false - * if this operation represents a copy or move. - */ - protected boolean isRename() { - return false; - } - - /** - * Process all of the changed deltas generated by these operations. - */ - protected void mergeDeltas() { - if (fDeltas != null) { - CElementDelta rootDelta = newCElementDelta(); - boolean insertedTree = false; - for (int i = 0; i < fDeltas.length; i++) { - ICElementDelta delta = fDeltas[i]; - ICElementDelta[] children = delta.getAffectedChildren(); - for (int j = 0; j < children.length; j++) { - CElementDelta projectDelta = (CElementDelta) children[j]; - rootDelta.insertDeltaTree(projectDelta.getElement(), projectDelta); - insertedTree = true; - } - } - if (insertedTree) - fDeltas = new ICElementDelta[] {rootDelta}; - else - fDeltas = null; - } - } - - /** - * Subclasses must implement this method to process a given ICElement. - */ - protected abstract void processElement(ICElement element) throws CModelException; - - /** - * Processes all the ICElements in turn, collecting errors - * and updating the progress monitor. - * - * @exception CModelException if one or several operation(s) was unable to - * be completed. - */ - protected void processElements() throws CModelException { - beginTask(getMainTaskName(), fElementsToProcess.length); - ICModelStatus[] errors = new ICModelStatus[3]; - int errorsCounter = 0; - for (int i = 0; i < fElementsToProcess.length; i++) { - try { - verify(fElementsToProcess[i]); - processElement(fElementsToProcess[i]); - } catch (CModelException jme) { - if (errorsCounter == errors.length) { - // resize - System.arraycopy(errors, 0, (errors = new ICModelStatus[errorsCounter*2]), 0, errorsCounter); - } - errors[errorsCounter++] = jme.getCModelStatus(); - } finally { - worked(1); - } - } - done(); - if (errorsCounter == 1) { - throw new CModelException(errors[0]); - } else if (errorsCounter > 1) { - if (errorsCounter != errors.length) { - // resize - System.arraycopy(errors, 0, (errors = new ICModelStatus[errorsCounter]), 0, errorsCounter); - } - throw new CModelException(CModelStatus.newMultiStatus(errors)); - } - } - - /** - * Sets the insertion position in the new container for the modified element. The element - * being modified will be inserted before the specified new sibling. The given sibling - * must be a child of the destination container specified for the modified element. - * The default is null, which indicates that the element is to be - * inserted at the end of the container. - */ - public void setInsertBefore(ICElement modifiedElement, ICElement newSibling) { - fInsertBeforeElements.put(modifiedElement, newSibling); - } - - /** - * Sets the new names to use for each element being copied. The renamings - * correspond to the elements being processed, and the number of - * renamings must match the number of elements being processed. - * A null entry in the list indicates that an element - * is not to be renamed. - * - *

          Note that some renamings may not be used. If both a parent - * and a child have been selected for copy/move, only the parent - * is changed. Therefore, if a new name is specified for the child, - * the child's name will not be changed. - */ - public void setRenamings(String[] renamings) { - fRenamingsList = renamings; - initializeRenamings(); - } - - /** - * This method is called for each ICElement before - * processElement. It should check that this element - * can be processed. - */ - protected abstract void verify(ICElement element) throws CModelException; - - /** - * Verifies that the destination specified for the element is valid for the types of the - * element and destination. - */ - protected void verifyDestination(ICElement element, ICElement destination) throws CModelException { - if (destination == null || !destination.exists()) - error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, destination); - - } - - /** - * Verify that the new name specified for element is - * valid for that type of C element. - */ - protected void verifyRenaming(ICElement element) throws CModelException { - String newName = getNewNameFor(element); - boolean isValid = true; - // Validate the name here. - if (newName.indexOf(' ') != -1) { - isValid = false; - } - - if (!isValid) { - throw new CModelException(new CModelStatus(ICModelStatusConstants.INVALID_NAME, element, newName)); - } - } - - /** - * Verifies that the positioning sibling specified for the element is exists and - * its parent is the destination container of this element. - */ - protected void verifySibling(ICElement element, ICElement destination) throws CModelException { - ICElement insertBeforeElement = (ICElement) fInsertBeforeElements.get(element); - if (insertBeforeElement != null) { - if (!insertBeforeElement.exists() || !insertBeforeElement.getParent().equals(destination)) { - error(ICModelStatusConstants.INVALID_SIBLING, insertBeforeElement); - } - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java deleted file mode 100644 index 5a32725aa16..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.INamespace; - -public class Namespace extends SourceManipulation implements INamespace{ - - String typeName = ""; - public Namespace(ICElement parent, String name) { - super(parent, name, CElement.C_NAMESPACE); - } - - /** - * Returns the typeName. - * @return String - */ - public String getTypeName() { - return typeName; - } - - /** - * Sets the typeName. - * @param typeName The typeName to set - */ - public void setTypeName(String typeName) { - this.typeName = typeName; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java deleted file mode 100644 index cf4c4586f09..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class NullBinaryParser implements IBinaryParser { - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath) - */ - public IBinaryFile getBinary(IPath path) throws IOException { - throw new IOException("not a binary file"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser#getFormat() - */ - public String getFormat() { - return "Null Format"; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser#isBinary(byte[], org.eclipse.core.runtime.IPath) - */ - public boolean isBinary(byte[] array, IPath path) { - return false; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java deleted file mode 100644 index 90d0c019e07..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java +++ /dev/null @@ -1,304 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.model.BufferChangedEvent; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.IBufferChangedListener; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -public abstract class Openable extends Parent implements IOpenable, IBufferChangedListener { - - protected IResource resource; - - public Openable (ICElement parent, IPath path, int type) { - // Check if the file is under the workspace. - this (parent, ResourcesPlugin.getWorkspace().getRoot().getFileForLocation (path), - path.lastSegment(), type); - } - - public Openable (ICElement parent, IResource resource, int type) { - this (parent, resource, resource.getName(), type); - } - - public Openable (ICElement parent, IResource res, String name, int type) { - super (parent, name, type); - resource = res; - } - - public IResource getResource() { - return resource; - } - - /** - * The buffer associated with this element has changed. Registers - * this element as being out of synch with its buffer's contents. - * If the buffer has been closed, this element is set as NOT out of - * synch with the contents. - * - * @see IBufferChangedListener - */ - public void bufferChanged(BufferChangedEvent event) { - if (event.getBuffer().isClosed()) { - CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this); - getBufferManager().removeBuffer(event.getBuffer()); - } else { - CModelManager.getDefault().getElementsOutOfSynchWithBuffers().put(this, this); - } - } - /** - * Updates the info objects for this element and all of its children by - * removing the current infos, generating new infos, and then placing - * the new infos into the C Model cache tables. - */ - protected void buildStructure(OpenableInfo info, IProgressMonitor monitor) throws CModelException { - - if (monitor != null && monitor.isCanceled()) return; - - // remove existing (old) infos - removeInfo(); - HashMap newElements = new HashMap(11); - info.setIsStructureKnown(generateInfos(info, monitor, newElements, getResource())); - CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this); - for (Iterator iter = newElements.keySet().iterator(); iter.hasNext();) { - ICElement key = (ICElement) iter.next(); - Object value = newElements.get(key); - CModelManager.getDefault().putInfo(key, value); - } - - // add the info for this at the end, to ensure that a getInfo cannot reply null in case the LRU cache needs - // to be flushed. Might lead to performance issues. - CModelManager.getDefault().putInfo(this, info); - } - - /** - * Close the buffer associated with this element, if any. - */ - protected void closeBuffer(OpenableInfo info) { - if (!hasBuffer()) return; // nothing to do - IBuffer buffer = null; - buffer = getBufferManager().getBuffer(this); - if (buffer != null) { - buffer.close(); - buffer.removeBufferChangedListener(this); - } - } - - /** - * Builds this element's structure and properties in the given - * info object, based on this element's current contents (i.e. buffer - * contents if this element has an open buffer, or resource contents - * if this element does not have an open buffer). Children - * are placed in the given newElements table (note, this element - * has already been placed in the newElements table). Returns true - * if successful, or false if an error is encountered while determining - * the structure of this element. - */ - protected abstract boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException; - //protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException { - // return false; - //} - - /** - * @see org.eclipse.cdt.core.model.IOpenable#getBuffer() - */ - public IBuffer getBuffer() throws CModelException { - if (hasBuffer()) { - // ensure element is open - if (!isOpen()) { - getElementInfo(); - } - IBuffer buffer = getBufferManager().getBuffer(this); - if (buffer == null) { - // try to (re)open a buffer - buffer = openBuffer(null); - } - return buffer; - } else { - return null; - } - } - - /** - * Answers the buffer factory to use for creating new buffers - */ - public IBufferFactory getBufferFactory(){ - return getBufferManager().getDefaultBufferFactory(); - } - - /** - * Returns the buffer manager for this element. - */ - protected BufferManager getBufferManager() { - return BufferManager.getDefaultBufferManager(); - } - - /** - * Returns true if this element may have an associated source buffer, - * otherwise false. Subclasses must override as required. - */ - protected boolean hasBuffer() { - return false; - } - /** - * @see org.eclipse.cdt.core.model.IOpenable#hasUnsavedChanges() - */ - public boolean hasUnsavedChanges() throws CModelException{ - - if (isReadOnly() || !isOpen()) { - return false; - } - IBuffer buf = this.getBuffer(); - if (buf != null && buf.hasUnsavedChanges()) { - return true; - } - // for roots and projects must check open buffers - // to see if they have an child with unsaved changes - if (fType == C_MODEL || - fType == C_PROJECT) { - Enumeration openBuffers= getBufferManager().getOpenBuffers(); - while (openBuffers.hasMoreElements()) { - IBuffer buffer= (IBuffer)openBuffers.nextElement(); - if (buffer.hasUnsavedChanges()) { - ICElement owner= (ICElement)buffer.getOwner(); - if (isAncestorOf(owner)) { - return true; - } - } - } - } - - return false; - } - /** - * Subclasses must override as required. - * - * @see org.eclipse.cdt.core.model.IOpenable#isConsistent() - */ - public boolean isConsistent() throws CModelException { - return true; - } - - /** - * @see org.eclipse.cdt.core.model.IOpenable#isOpen() - */ - public boolean isOpen() { - synchronized(CModelManager.getDefault()){ - return CModelManager.getDefault().getInfo(this) != null; - } - } - - /** - * Returns true if this represents a source element. - * Openable source elements have an associated buffer created - * when they are opened. - */ - protected boolean isSourceElement() { - return false; - } - - /** - * @see org.eclipse.cdt.core.model.IOpenable#makeConsistent(IProgressMonitor) - */ - public void makeConsistent(IProgressMonitor pm) throws CModelException { - makeConsistent(pm, false); - } - - public void makeConsistent(IProgressMonitor pm, boolean forced) throws CModelException { - if (!isConsistent() || forced) { - buildStructure((OpenableInfo)getElementInfo(), pm); - } - } - - /** - * @see org.eclipse.cdt.core.model.IOpenable#open(IProgressMonitor) - */ - public void open(IProgressMonitor pm) throws CModelException { - if (!isOpen()) { - this.openWhenClosed(pm); - } - } - - /** - * Opens a buffer on the contents of this element, and returns - * the buffer, or returns null if opening fails. - * By default, do nothing - subclasses that have buffers - * must override as required. - */ - protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException { - return null; - } - - /** - * Open the parent element if necessary - * - */ - protected void openParent(IProgressMonitor pm) throws CModelException { - - Openable openableParent = (Openable)getOpenableParent(); - if (openableParent != null) { - if (!openableParent.isOpen()){ - openableParent.openWhenClosed(pm); - } - } - } - - /** - * Open a IOpenable that is known to be closed (no check for - * isOpen()). - */ - protected void openWhenClosed(IProgressMonitor pm) throws CModelException { - try { - - // 1) Parent must be open - open the parent if necessary - openParent(pm); - - // 2) create the new element info and open a buffer if needed - OpenableInfo info = (OpenableInfo) createElementInfo(); - IResource resource = getResource(); - if (resource != null && isSourceElement()) { - this.openBuffer(pm); - } - - // 3) build the structure of the openable - buildStructure(info, pm); - - // if any problems occuring openning the element, ensure that it's info - // does not remain in the cache (some elements, pre-cache their info - // as they are being opened). - } catch (CModelException e) { - CModelManager.getDefault().removeInfo(this); - throw e; - } - } - - /** - * @see org.eclipse.cdt.core.model.IOpenable#save(IProgressMonitor, boolean) - */ - public void save(IProgressMonitor pm, boolean force) throws CModelException { - if (isReadOnly() || this.getResource().isReadOnly()) { - throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this)); - } - IBuffer buf = getBuffer(); - if (buf != null) { - buf.save(pm, force); - this.makeConsistent(pm); // update the element info of this element - } - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/OpenableInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/OpenableInfo.java deleted file mode 100644 index b7a0160409b..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/OpenableInfo.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -/** - */ -public class OpenableInfo extends CElementInfo { - - /** - * Constructs a new C Model Info - */ - protected OpenableInfo(CElement element) { - super(element); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java deleted file mode 100644 index 40581c621f9..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Parent.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IParent; - -public abstract class Parent extends CElement implements IParent { - - public Parent (ICElement parent, String name, int type) { - super (parent, name, type); - } - - // members - - /** - * Adds a child to the current element. - * Implementations override this method to support children - */ - protected void addChild(ICElement member) { - getElementInfo().addChild(member); - } - - /** - * Removes a child to the current element. - * Implementations override this method to support children - */ - protected void removeChild(ICElement member) { - getElementInfo().removeChild(member); - } - - protected void removeChildren () { - getElementInfo().removeChildren(); - } - - /** - * Gets the children of this element. - * Returns null if the element does not support children - * Implementations override this method to support children - */ - public ICElement[] getChildren() { - return getElementInfo().getChildren(); - } - - /** - * Gets the children of a certain type - * @param type - * @return ArrayList - */ - public ArrayList getChildrenOfType(int type){ - ICElement[] children = getChildren(); - int size = children.length; - ArrayList list = new ArrayList(size); - for (int i = 0; i < size; ++i) { - CElement elt = (CElement)children[i]; - if (elt.getElementType() == type) { - list.add(elt); - } - } - return list; - } - - public boolean hasChildren () { - return getElementInfo().hasChildren(); - } - - protected void setChanged () { - getElementInfo().setChanged(); - } - - protected boolean hasChanged () { - return getElementInfo().hasChanged(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProjectEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProjectEntry.java deleted file mode 100644 index 48a1f3ff17d..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProjectEntry.java +++ /dev/null @@ -1,56 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.IProjectEntry; -import org.eclipse.core.runtime.IPath; - - -public class ProjectEntry extends CPathEntry implements IProjectEntry { - - IPath projectPath; - - public ProjectEntry(IPath projectPath, boolean isExported) { - super(IProjectEntry.CDT_PROJECT, isExported); - this.projectPath = projectPath; - } - - /** - * Returns the absolute path relative to the workspace root. - * @return IPath - */ - public IPath getProjectPath() { - return projectPath; - } - - public boolean equals(Object obj) { - if (obj instanceof IProjectEntry) { - IProjectEntry otherEntry = (IProjectEntry)obj; - if (!super.equals(otherEntry)) { - return false; - } - if (projectPath == null) { - if (otherEntry.getProjectPath() != null) { - return false; - } - } else { - if (!projectPath.toString().equals(otherEntry.getProjectPath().toString())) { - return false; - } - } - return true; - } - return super.equals(obj); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/RenameResourceElementsOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/RenameResourceElementsOperation.java deleted file mode 100644 index 6c4da177eff..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/RenameResourceElementsOperation.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.CModelException; - -/** - * This operation renames resources (Package fragments and compilation units). - * - *

          Notes:

            - *
          • When a compilation unit is renamed, its main type and the constructors of the - * main type are renamed. - *
          - */ -public class RenameResourceElementsOperation extends MoveResourceElementsOperation { - /** - * When executed, this operation will rename the specified elements with the given names in the - * corresponding destinations. - */ - public RenameResourceElementsOperation(ICElement[] elements, ICElement[] destinations, String[] newNames, boolean force) { - //a rename is a move to the same parent with a new name specified - //these elements are from different parents - super(elements, destinations, force); - setRenamings(newNames); - } - - /** - * @see MultiOperation - */ - protected String getMainTaskName() { - return "operation.renameResourceProgress"; //$NON-NLS-1$ - } - - /** - * @see CopyResourceElementsOperation#isRename() - */ - protected boolean isRename() { - return true; - } - - /** - * @see MultiOperation - */ - protected void verify(ICElement element) throws CModelException { - super.verify(element); - verifyRenaming(element); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetCPathEntriesOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetCPathEntriesOperation.java deleted file mode 100644 index 6a3e206ef48..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SetCPathEntriesOperation.java +++ /dev/null @@ -1,221 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.internal.core.model; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICPathEntry; -import org.eclipse.cdt.core.model.IContainerEntry; -import org.eclipse.cdt.core.model.IIncludeEntry; -import org.eclipse.cdt.core.model.IMacroEntry; -import org.eclipse.cdt.core.model.ISourceEntry; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - */ -public class SetCPathEntriesOperation extends CModelOperation { - - ICPathEntry[] oldEntries; - ICPathEntry[] newEntries; - CProject project; - - public SetCPathEntriesOperation(CProject project, ICPathEntry[] oldEntries, ICPathEntry[] newEntries) { - super(project); - this.oldEntries = oldEntries; - this.newEntries = newEntries; - this.project = project; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.CModelOperation#executeOperation() - */ - protected void executeOperation() throws CModelException { - // project reference updated - may throw an exception if unable to write .cdtproject file - updateProjectReferencesIfNecessary(); - try { - - ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project.getProject()); - Element rootElement = descriptor.getProjectData(CProject.PATH_ENTRY_ID); - // Clear out all current children - Node child = rootElement.getFirstChild(); - while (child != null) { - rootElement.removeChild(child); - child = rootElement.getFirstChild(); - } - - // Save the entries - if (newEntries != null && newEntries.length > 0) { - // Serialize the include paths - Document doc = rootElement.getOwnerDocument(); - project.encodeCPathEntries(doc, rootElement, newEntries); - descriptor.saveProjectData(); - } - - generateCPathEntryDeltas(); - done(); - } catch (CoreException e) { - throw new CModelException(e); - } - } - - protected void updateProjectReferencesIfNecessary() throws CModelException { - String[] oldRequired = this.project.projectPrerequisites(oldEntries); - String[] newRequired = this.project.projectPrerequisites(newEntries); - - try { - IProject projectResource = project.getProject(); - IProjectDescription description = projectResource.getDescription(); - - IProject[] projectReferences = description.getReferencedProjects(); - - HashSet oldReferences = new HashSet(projectReferences.length); - for (int i = 0; i < projectReferences.length; i++) { - String projectName = projectReferences[i].getName(); - oldReferences.add(projectName); - } - HashSet newReferences = (HashSet) oldReferences.clone(); - - for (int i = 0; i < oldRequired.length; i++) { - String projectName = oldRequired[i]; - newReferences.remove(projectName); - } - for (int i = 0; i < newRequired.length; i++) { - String projectName = newRequired[i]; - newReferences.add(projectName); - } - - Iterator iter; - int newSize = newReferences.size(); - - checkIdentity : { - if (oldReferences.size() == newSize) { - iter = newReferences.iterator(); - while (iter.hasNext()) { - if (!oldReferences.contains(iter.next())) { - break checkIdentity; - } - } - return; - } - } - String[] requiredProjectNames = new String[newSize]; - int index = 0; - iter = newReferences.iterator(); - while (iter.hasNext()) { - requiredProjectNames[index++] = (String) iter.next(); - } - Arrays.sort(requiredProjectNames); // ensure that if changed, the order is consistent - - IProject[] requiredProjectArray = new IProject[newSize]; - IWorkspaceRoot wksRoot = projectResource.getWorkspace().getRoot(); - for (int i = 0; i < newSize; i++) { - requiredProjectArray[i] = wksRoot.getProject(requiredProjectNames[i]); - } - - description.setReferencedProjects(requiredProjectArray); - projectResource.setDescription(description, this.fMonitor); - - } catch (CoreException e) { - throw new CModelException(e); - } - } - - private void generateCPathEntryDeltas() { - CModelManager manager = CModelManager.getDefault(); - boolean needToUpdateDependents = false; - CElementDelta delta = new CElementDelta(getCModel()); - boolean hasDelta = false; - - // Check the removed entries. - for (int i = 0; i < oldEntries.length; i++) { - boolean found = false; - for (int j = 0; j < newEntries.length; j++) { - if (oldEntries[i].equals(newEntries[j])) { - found = true; - break; - } - } - // Was it deleted. - if (!found) { - addCPathEntryDeltas(oldEntries[i], ICElementDelta.F_REMOVED_FROM_CPATHENTRY, delta); - } - } - // Check the new entries. - for (int i = 0; i < newEntries.length; i++) { - boolean found = false; - for (int j = 0; j < oldEntries.length; j++) { - if (newEntries[i].equals(oldEntries[j])) { - found = true; - break; - } - } - // is it new? - if (!found) { - addCPathEntryDeltas(newEntries[i], ICElementDelta.F_ADDED_TO_CPATHENTRY, delta); - } - } - } - - /** - * Adds deltas, with the specified change flag. - */ - protected void addCPathEntryDeltas(ICPathEntry entry, int flag, CElementDelta delta) { - - int kind = entry.getEntryKind(); - ICElement celement = null; - if (kind == ICPathEntry.CDT_SOURCE) { - ISourceEntry source = (ISourceEntry) entry; - IPath path = source.getSourcePath(); - celement = CoreModel.getDefault().create(path); - } else if (kind == ICPathEntry.CDT_LIBRARY) { - //ILibraryEntry lib = (ILibraryEntry) entry; - //IPath path = lib.getLibraryPath(); - celement = project; - } else if (kind == ICPathEntry.CDT_PROJECT) { - //IProjectEntry pentry = (IProjectEntry) entry; - //IPath path = pentry.getProjectPath(); - celement = project; - } else if (kind == ICPathEntry.CDT_INCLUDE) { - IIncludeEntry include = (IIncludeEntry) entry; - IPath path = include.getResourcePath(); - celement = CoreModel.getDefault().create(path); - } else if (kind == ICPathEntry.CDT_MACRO) { - IMacroEntry macro = (IMacroEntry) entry; - IPath path = macro.getResourcePath(); - celement = CoreModel.getDefault().create(path); - } else if (kind == ICPathEntry.CDT_CONTAINER) { - IContainerEntry container = (IContainerEntry) entry; - celement = project; - } - if (celement != null) { - delta.changed(celement, flag); - addDelta(delta); - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java deleted file mode 100644 index 2e317eb1dad..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceEntry.java +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************** - * Created on Mar 25, 2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.model; - -import org.eclipse.cdt.core.model.ISourceEntry; -import org.eclipse.core.runtime.IPath; - -public class SourceEntry extends ACPathEntry implements ISourceEntry { - - IPath sourcePath; - IPath outputLocation; - - public SourceEntry(IPath sourcePath, IPath outputLocation, boolean isRecursive, IPath[] exclusionPatterns) { - super(ISourceEntry.CDT_SOURCE, isRecursive, exclusionPatterns, false); - this.sourcePath = sourcePath; - this.outputLocation = outputLocation; - } - - /** - * Returns the absolute path from the worskspace root or - * relative path of the source folder. - * @return String - */ - public IPath getSourcePath() { - return sourcePath; - } - - /** - * Binary output location for this source folder. - * @return IPath, null means to use the - * default output location of the project. - */ - public IPath getOutputLocation() { - return outputLocation; - } - - public boolean equals (Object obj) { - if (obj instanceof ISourceEntry) { - ISourceEntry otherEntry = (ISourceEntry)obj; - if (!super.equals(otherEntry)) { - return false; - } - if (sourcePath == null) { - if (otherEntry.getSourcePath() != null) { - return false; - } - } else { - if (!sourcePath.toString().equals(otherEntry.getSourcePath().toString())) { - return false; - } - } - if (outputLocation == null) { - if (otherEntry.getOutputLocation() != null) { - return false; - } - } else { - if (!outputLocation.toString().equals(otherEntry.getOutputLocation().toString())) { - return false; - } - } - return true; - } - return super.equals(obj); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java deleted file mode 100644 index 45890e46573..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.core.model.ISourceManipulation; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Abstract class for C elements which implement ISourceReference. - */ - -public class SourceManipulation extends Parent implements ISourceManipulation, ISourceReference { - - public SourceManipulation(ICElement parent, String name, int type) { - super(parent, name, type); - } - - /** - * @see ISourceManipulation - */ - public void copy(ICElement container, ICElement sibling, String rename, boolean force, - IProgressMonitor monitor) throws CModelException { - if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ - } - ICElement[] elements= new ICElement[] {this}; - ICElement[] containers= new ICElement[] {container}; - ICElement[] siblings= null; - if (sibling != null) { - siblings= new ICElement[] {sibling}; - } - String[] renamings= null; - if (rename != null) { - renamings= new String[] {rename}; - } - getCModel().copy(elements, containers, siblings, renamings, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void delete(boolean force, IProgressMonitor monitor) throws CModelException { - ICElement[] elements = new ICElement[] {this}; - getCModel().delete(elements, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void move(ICElement container, ICElement sibling, String rename, boolean force, - IProgressMonitor monitor) throws CModelException { - if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ - } - ICElement[] elements= new ICElement[] {this}; - ICElement[] containers= new ICElement[] {container}; - ICElement[] siblings= null; - if (sibling != null) { - siblings= new ICElement[] {sibling}; - } - String[] renamings= null; - if (rename != null) { - renamings= new String[] {rename}; - } - getCModel().move(elements, containers, siblings, renamings, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void rename(String name, boolean force, IProgressMonitor monitor) throws CModelException { - if (name == null) { - throw new IllegalArgumentException("element.nullName"); //$NON-NLS-1$ - } - ICElement[] elements= new ICElement[] {this}; - ICElement[] dests= new ICElement[] {this.getParent()}; - String[] renamings= new String[] {name}; - getCModel().rename(elements, dests, renamings, force, monitor); - } - - /** - * @see IMember - */ - public ITranslationUnit getTranslationUnit() { - return getSourceManipulationInfo().getTranslationUnit(); - } - - /** - * Elements within compilation units and class files have no - * corresponding resource. - * - * @see ICElement - */ - public IResource getCorrespondingResource() throws CModelException { - return null; - } - - /** - * Returns the first parent of the element that is an instance of - * IOpenable. - */ - public IOpenable getOpenableParent() { - ICElement current = getParent(); - while (current != null){ - if (current instanceof IOpenable){ - return (IOpenable) current; - } - current = current.getParent(); - } - return null; - } - - /** - * @see ISourceReference - */ - public String getSource() throws CModelException { - return getSourceManipulationInfo().getSource(); - } - - /** - * @see ISourceReference - */ - public ISourceRange getSourceRange() throws CModelException { - return getSourceManipulationInfo().getSourceRange(); - } - - /** - * @see ICElement - */ - public IResource getUnderlyingResource() { - return getParent().getUnderlyingResource(); - } - - public IResource getResource() { - return null; - } - - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } - - protected SourceManipulationInfo getSourceManipulationInfo() { - return (SourceManipulationInfo)getElementInfo(); - } - - public boolean isIdentical(SourceManipulation other){ - return (this.equals(other) - && (this.getSourceManipulationInfo().hasSameContentsAs(other.getSourceManipulationInfo()))); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java deleted file mode 100644 index 02ac28e2727..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java +++ /dev/null @@ -1,152 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Element info for ISourceReference elements. - */ -/* package */ -class SourceManipulationInfo extends CElementInfo { - - int modifiers; - - protected SourceManipulationInfo(CElement element) { - super(element); - setIsStructureKnown(true); - modifiers = 0; - } - - protected ISourceRange getSourceRange() { - return new SourceRange(getElement().getStartPos(), - getElement().getLength(), - getElement().getIdStartPos(), - getElement().getIdLength(), - getElement().getStartLine(), - getElement().getEndLine()); - } - - /** - * @see ISourceReference - */ - public String getSource() throws CModelException { - ITranslationUnit tu = getTranslationUnit(); - if (tu != null) { - try { - IResource res = tu.getResource(); - if (res != null && res instanceof IFile) { - StringBuffer buffer = Util.getContent((IFile)res); - return buffer.substring(getElement().getStartPos(), - getElement().getStartPos() + getElement().getLength()); - } - } catch (IOException e) { - throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION); - } - } - return ""; - } - - /** - * @see IMember - */ - public ITranslationUnit getTranslationUnit() { - ICElement celem = getElement(); - for (; celem != null; celem = celem.getParent()) { - if (celem instanceof ITranslationUnit) - return (ITranslationUnit)celem; - } - return null; - } - - /** - * @see ISourceManipulation - */ - public void copy(ICElement container, ICElement sibling, String rename, boolean force, - IProgressMonitor monitor) throws CModelException { - if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ - } - ICElement[] elements= new ICElement[] {getElement()}; - ICElement[] containers= new ICElement[] {container}; - ICElement[] siblings= null; - if (sibling != null) { - siblings= new ICElement[] {sibling}; - } - String[] renamings= null; - if (rename != null) { - renamings= new String[] {rename}; - } - getElement().getCModel().copy(elements, containers, siblings, renamings, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void delete(boolean force, IProgressMonitor monitor) throws CModelException { - ICElement[] elements = new ICElement[] {getElement()}; - getElement().getCModel().delete(elements, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void move(ICElement container, ICElement sibling, String rename, boolean force, - IProgressMonitor monitor) throws CModelException { - if (container == null) { - throw new IllegalArgumentException("operation.nullContainer"); //$NON-NLS-1$ - } - ICElement[] elements= new ICElement[] {getElement()}; - ICElement[] containers= new ICElement[] {container}; - ICElement[] siblings= null; - if (sibling != null) { - siblings= new ICElement[] {sibling}; - } - String[] renamings= null; - if (rename != null) { - renamings= new String[] {rename}; - } - getElement().getCModel().move(elements, containers, siblings, renamings, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void rename(String name, boolean force, IProgressMonitor monitor) throws CModelException { - if (name == null) { - throw new IllegalArgumentException("element.nullName"); //$NON-NLS-1$ - } - ICElement[] elements= new ICElement[] {getElement()}; - ICElement[] dests= new ICElement[] {getElement().getParent()}; - String[] renamings= new String[] {name}; - getElement().getCModel().rename(elements, dests, renamings, force, monitor); - } - - /** - * return the element modifiers - * @return int - */ - public int getModifiers(){ - return modifiers; - } - - /** - * subclasses should override - */ - public boolean hasSameContentsAs( SourceManipulationInfo otherInfo){ - return (this.element.fType == otherInfo.element.fType); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceMapper.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceMapper.java deleted file mode 100644 index 7714236d3be..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.core.model; - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ITranslationUnit; - -/** - */ -public class SourceMapper { - ICProject cproject; - - public SourceMapper(ICProject p) { - cproject = p; - } - - public ITranslationUnit findTranslationUnit(String filename) { - return findTranslationUnit(cproject, filename); - } - - public ITranslationUnit findTranslationUnit(ICContainer container, String filename) { - ArrayList list = container.getChildrenOfType(ICElement.C_UNIT); - for (int i = 0; i < list.size(); i++) { - Object o = list.get(i); - if (o instanceof ITranslationUnit) { - ITranslationUnit tu = (ITranslationUnit)o; - // TODO: What about non case sensitive filesystems. - if (filename.equals(tu.getElementName())) { - return tu; - } - } - } - - // TODO: This to simple, we are not protected against - // loop in the file system symbolic links etc .. - list = container.getChildrenOfType(ICElement.C_CCONTAINER); - for (int i = 0; i < list.size(); i++) { - Object o = list.get(i); - if (o instanceof ICContainer) { - ITranslationUnit tu = findTranslationUnit((ICContainer)o, filename); - if (tu != null) { - return tu; - } - } - } - return null; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java deleted file mode 100644 index 775f6f3d882..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ISourceRange; - -/** - * @see ISourceRange - */ -class SourceRange implements ISourceRange { - - protected int startPos, length; - protected int idStartPos, idLength; - protected int startLine, endLine; - - protected SourceRange(int startPos, int length) { - this.startPos = startPos; - this.length = length; - idStartPos = 0; - idLength = 0; - startLine = 0; - endLine = 0; - } - - protected SourceRange(int startPos, int length, int idStartPos, int idLength) { - this.startPos = startPos; - this.length = length; - this.idStartPos = idStartPos; - this.idLength = idLength; - } - - protected SourceRange(int startPos, int length, int idStartPos, int idLength, - int startLine, int endLine) { - this.startPos = startPos; - this.length = length; - this.idStartPos = idStartPos; - this.idLength = idLength; - this.startLine = startLine; - this.endLine = endLine; - } - /** - * @see ISourceRange - */ - public int getLength() { - return length; - } - - /** - * @see ISourceRange - */ - public int getStartPos() { - return startPos; - } - - /** - */ - public int getIdStartPos() { - return idStartPos; - } - - public int getIdLength() { - return idLength; - } - - public int getStartLine() { - return startLine; - } - - public int getEndLine() { - return endLine; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("[offset="); //$NON-NLS-1$ - buffer.append(this.startPos); - buffer.append(", length="); //$NON-NLS-1$ - buffer.append(this.length); - buffer.append("]"); //$NON-NLS-1$ - - buffer.append("[IdOffset="); //$NON-NLS-1$ - buffer.append(this.idStartPos); - buffer.append(", idLength="); //$NON-NLS-1$ - buffer.append(this.idLength); - buffer.append("]"); //$NON-NLS-1$ - return buffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java deleted file mode 100644 index 54603117757..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IField; -import org.eclipse.cdt.core.model.IMethodDeclaration; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -public class Structure extends SourceManipulation implements IStructure { - - Map superClassesNames = new TreeMap(); - - public Structure(ICElement parent, int kind, String name) { - super(parent, name, kind); - } - - public IField[] getFields() { - List fields = new ArrayList(); - fields.addAll(getChildrenOfType(ICElement.C_FIELD)); - return (IField[]) fields.toArray(new IField[fields.size()]); - } - - public IField getField(String name) { - IField[] fields = getFields(); - for (int i = 0; i 0){ - sig.append("<"); - String[] paramTypes = getTemplateParameterTypes(); - int i = 0; - sig.append(paramTypes[i++]); - while (i < paramTypes.length){ - sig.append(", "); - sig.append(paramTypes[i++]); - } - sig.append(">"); - } - else{ - sig.append("<>"); - } - return sig.toString(); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java deleted file mode 100644 index 4282ee1bf41..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java +++ /dev/null @@ -1,481 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IInclude; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.IUsing; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * @see ITranslationUnit - */ -public class TranslationUnit extends Openable implements ITranslationUnit { - - IPath location = null; - - SourceManipulationInfo sourceManipulationInfo = null; - - public TranslationUnit(ICElement parent, IFile file) { - super(parent, file, ICElement.C_UNIT); - } - - public TranslationUnit(ICElement parent, IPath path) { - super(parent, path, ICElement.C_UNIT); - } - - public ITranslationUnit getTranslationUnit () { - return this; - } - - public IInclude createInclude(String name, ICElement sibling, IProgressMonitor monitor) - throws CModelException { - return null; - } - - public IUsing createUsing(String name, IProgressMonitor monitor) throws CModelException { - return null; - } - - public ICElement getElementAtLine(int line) throws CModelException { - ICElement[] celements = getChildren(); - for (int i = 0; i < celements.length; i++) { - ISourceRange range = ((ISourceReference)celements[i]).getSourceRange(); - int startLine = range.getStartLine(); - int endLine = range.getEndLine(); - if (line >= startLine && line <= endLine) { - return celements[i]; - } - } - return null; - } - - public ICElement getElement(String name ) { - ICElement[] celements = getChildren(); - for (int i = 0; i < celements.length; i++) { - if (name.equals(celements[i].getElementName())) { - return celements[i]; - } - } - return null; - } - - public IInclude getInclude(String name) { - ICElement[] celements = getChildren(); - for (int i = 0; i < celements.length; i++) { - if (celements[i].getElementType() == ICElement.C_INCLUDE) { - if (name.equals(celements[i].getElementName())) { - return (IInclude)celements[i]; - } - } - } - return null; - } - - public IInclude[] getIncludes() throws CModelException { - ICElement[] celements = getChildren(); - ArrayList aList = new ArrayList(); - for (int i = 0; i < celements.length; i++) { - if (celements[i].getElementType() == ICElement.C_INCLUDE) { - aList.add(celements[i]); - } - } - return (IInclude[])aList.toArray(new IInclude[0]); - } - - public IUsing getUsing(String name) { - ICElement[] celements = getChildren(); - for (int i = 0; i < celements.length; i++) { - if (celements[i].getElementType() == ICElement.C_USING) { - if (name.equals(celements[i].getElementName())) { - return (IUsing)celements[i]; - } - } - } - return null; - } - - public IUsing[] getUsings() throws CModelException { - ICElement[] celements = getChildren(); - ArrayList aList = new ArrayList(); - for (int i = 0; i < celements.length; i++) { - if (celements[i].getElementType() == ICElement.C_USING) { - aList.add(celements[i]); - } - } - return (IUsing[])aList.toArray(new IUsing[0]); - } - - public void setLocation(IPath loc) { - location = loc; - } - - public IPath getLocation() { - if (location == null) { - IFile file = getFile(); - if (file != null) { - location = file.getLocation(); - } else { - return getPath(); - } - } - return location; - } - - protected IFile getFile() { - IResource res = getResource(); - if (res instanceof IFile) { - return (IFile)res; - } - return null; - } - - /** - * @see ISourceManipulation - */ - public void copy(ICElement container, ICElement sibling, String rename, boolean force, - IProgressMonitor monitor) throws CModelException { - getSourceManipulationInfo().copy(container, sibling, rename, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void delete(boolean force, IProgressMonitor monitor) throws CModelException { - getSourceManipulationInfo().delete(force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void move(ICElement container, ICElement sibling, String rename, boolean force, - IProgressMonitor monitor) throws CModelException { - getSourceManipulationInfo().move(container, sibling, rename, force, monitor); - } - - /** - * @see ISourceManipulation - */ - public void rename(String name, boolean force, IProgressMonitor monitor) - throws CModelException { - getSourceManipulationInfo().rename(name, force, monitor); - } - - /** - * @see ISourceReference - */ - public String getSource() throws CModelException { - return getSourceManipulationInfo().getSource(); - } - - /** - * @see ISourceReference - */ - public ISourceRange getSourceRange() throws CModelException { - return getSourceManipulationInfo().getSourceRange(); - } - - protected TranslationUnitInfo getTranslationUnitInfo() { - return (TranslationUnitInfo)getElementInfo(); - } - - protected SourceManipulationInfo getSourceManipulationInfo() { - if (sourceManipulationInfo == null) { - sourceManipulationInfo = new SourceManipulationInfo(this); - } - return sourceManipulationInfo; - } - - protected CElementInfo createElementInfo () { - return new TranslationUnitInfo(this); - } - - /** - * @see org.eclipse.cdt.internal.core.model.CFile#buildStructure(CFileInfo, IProgressMonitor) - */ - protected void buildStructure(OpenableInfo info, IProgressMonitor monitor) throws CModelException { - if (monitor != null && monitor.isCanceled()) return; - - // remove existing (old) infos - removeInfo(); - - HashMap newElements = new HashMap(11); - info.setIsStructureKnown(generateInfos(info, monitor, newElements, getResource())); - CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this); - for (Iterator iter = newElements.keySet().iterator(); iter.hasNext();) { - ICElement key = (ICElement) iter.next(); - Object value = newElements.get(key); - CModelManager.getDefault().putInfo(key, value); - } - // problem detection - if (monitor != null && monitor.isCanceled()) return; - - //IProblemRequestor problemRequestor = this.getProblemRequestor(); - //if (problemRequestor != null && problemRequestor.isActive()){ - // problemRequestor.beginReporting(); - // CompilationUnitProblemFinder.process(this, problemRequestor, monitor); - // problemRequestor.endReporting(); - //} - - // add the info for this at the end, to ensure that a getInfo cannot reply null in case the LRU cache needs - // to be flushed. Might lead to performance issues. - CModelManager.getDefault().putInfo(this, info); - - } - /** - * Returns true if this handle represents the same Java element - * as the given handle. - * - *

          Compilation units must also check working copy state; - * - * @see Object#equals(java.lang.Object) - */ - public boolean equals(Object o) { - return super.equals(o) && !((ITranslationUnit)o).isWorkingCopy(); - } - - /** - * @see IWorkingCopy#findSharedWorkingCopy(IBufferFactory) - */ - public IWorkingCopy findSharedWorkingCopy(IBufferFactory factory) { - - // if factory is null, default factory must be used - if (factory == null) factory = BufferManager.getDefaultBufferManager(); - - // In order to be shared, working copies have to denote the same translation unit - // AND use the same buffer factory. - // Assuming there is a little set of buffer factories, then use a 2 level Map cache. - Map sharedWorkingCopies = CModelManager.getDefault().sharedWorkingCopies; - - Map perFactoryWorkingCopies = (Map) sharedWorkingCopies.get(factory); - if (perFactoryWorkingCopies == null) return null; - return (WorkingCopy)perFactoryWorkingCopies.get(this); - } - - /** - * To be removed with the new model builder in place - * @param newElements - * @param element - */ - private void getNewElements(Map newElements, CElement element){ - Object info = element.getElementInfo(); - if(info != null){ - if(element instanceof IParent){ - ICElement[] children = ((CElementInfo)info).getChildren(); - int size = children.length; - for (int i = 0; i < size; ++i) { - CElement child = (CElement) children[i]; - getNewElements(newElements, child); - } - } - } - newElements.put(element, info); - } - - /** - * @see org.eclipse.cdt.internal.core.model.Openable#generateInfos(OpenableInfo, IProgressMonitor, Map, IResource) - */ - protected boolean generateInfos(OpenableInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws CModelException { - // put the info now, because getting the contents requires it - CModelManager.getDefault().putInfo(this, info); - TranslationUnitInfo unitInfo = (TranslationUnitInfo) info; - - // generate structure - Map mapping = this.parse(); - - // this is temporary until the New Model Builder is implemented - if(mapping == null) { - getNewElements(newElements, this); - } else { - newElements.putAll(mapping); - } - /////////////////////////////////////////////////////////////// - - if (isWorkingCopy()) { - ITranslationUnit original = (ITranslationUnit) ((IWorkingCopy)this).getOriginalElement(); - // might be IResource.NULL_STAMP if original does not exist - IResource r = original.getResource(); - if (r != null && r instanceof IFile) { - unitInfo.fTimestamp = ((IFile) r).getModificationStamp(); - } - } - - return unitInfo.isStructureKnown(); - } - - /** - * @see org.eclipse.cdt.core.model.ITranslationUnit#getContents() - */ - public char[] getContents() { - try { - IBuffer buffer = this.getBuffer(); - return buffer == null ? null : buffer.getCharacters(); - } catch (CModelException e) { - return new char[0]; - } - } - - /** - * @see org.eclipse.cdt.core.model.ITranslationUnit#getSharedWorkingCopy(IProgressMonitor, IBufferFactory) - */ - public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor,IBufferFactory factory) - throws CModelException { - - // if factory is null, default factory must be used - if (factory == null) factory = BufferManager.getDefaultBufferManager(); - - CModelManager manager = CModelManager.getDefault(); - - // In order to be shared, working copies have to denote the same translation unit - // AND use the same buffer factory. - // Assuming there is a little set of buffer factories, then use a 2 level Map cache. - Map sharedWorkingCopies = manager.sharedWorkingCopies; - - Map perFactoryWorkingCopies = (Map) sharedWorkingCopies.get(factory); - if (perFactoryWorkingCopies == null){ - perFactoryWorkingCopies = new HashMap(); - sharedWorkingCopies.put(factory, perFactoryWorkingCopies); - } - WorkingCopy workingCopy = (WorkingCopy)perFactoryWorkingCopies.get(this); - if (workingCopy != null) { - workingCopy.useCount++; - return workingCopy; - - } else { - workingCopy = (WorkingCopy)this.getWorkingCopy(monitor, factory); - perFactoryWorkingCopies.put(this, workingCopy); - - // report added java delta -// CElementDelta delta = new CElementDelta(this.getCModel()); -// delta.added(workingCopy); -// manager.fire(delta, CModelManager.DEFAULT_CHANGE_EVENT); - - return workingCopy; - } - } - /** - * - * @see org.eclipse.cdt.core.model.ITranslationUnit#getWorkingCopy() - */ - public IWorkingCopy getWorkingCopy()throws CModelException{ - return this.getWorkingCopy(null, null); - } - - /** - * - * @see org.eclipse.cdt.core.model.ITranslationUnit#getWorkingCopy() - */ - public IWorkingCopy getWorkingCopy(IProgressMonitor monitor, IBufferFactory factory)throws CModelException{ - WorkingCopy workingCopy = new WorkingCopy(getParent(), getFile(), factory); - // open the working copy now to ensure contents are that of the current state of this element - workingCopy.open(monitor); - return workingCopy; - } - - /** - * Returns true if this element may have an associated source buffer. - */ - protected boolean hasBuffer() { - return true; - } - - /** - * @see org.eclipse.cdt.core.model.IOpenable#isConsistent() - */ - public boolean isConsistent() throws CModelException { - return CModelManager.getDefault().getElementsOutOfSynchWithBuffers().get(this) == null; - } - - /** - * @see org.eclipse.cdt.internal.core.model.Openable#isSourceElement() - */ - protected boolean isSourceElement() { - return true; - } - /** - * @see org.eclipse.cdt.core.model.ITranslationUnit#isWorkingCopy() - */ - public boolean isWorkingCopy() { - return false; - } - - /** - * @see org.eclipse.cdt.core.model.IOpenable#makeConsistent(IProgressMonitor) - */ - public void makeConsistent(IProgressMonitor pm) throws CModelException { - makeConsistent(pm, false); - } - public void makeConsistent(IProgressMonitor pm, boolean forced) throws CModelException { - if (!isConsistent() || forced) { - // create a new info and make it the current info - OpenableInfo info = (OpenableInfo) createElementInfo(); - buildStructure(info, pm); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.Openable#openBuffer(IProgressMonitor) - */ - protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException { - - // create buffer - translation units only use default buffer factory - BufferManager bufManager = getBufferManager(); - IBuffer buffer = getBufferFactory().createBuffer(this); - if (buffer == null) - return null; - - // set the buffer source - if (buffer.getCharacters() == null){ - IResource file = this.getResource(); - if (file != null && file.getType() == IResource.FILE) { - buffer.setContents(Util.getResourceContentsAsCharArray((IFile)file)); - } - } - - // add buffer to buffer cache - bufManager.addBuffer(buffer); - - // listen to buffer changes - buffer.addBufferChangedListener(this); - - return buffer; - } - - /** - * Parse the buffer contents of this element. - */ - public Map parse(){ - try { - removeChildren(); - CModelBuilder modelBuilder = new CModelBuilder(this); - - boolean quickParseMode = ! (CCorePlugin.getDefault().useStructuralParseMode()); - return modelBuilder.parse(quickParseMode); - } catch (Exception e) { - // FIXME: use the debug log for this exception. - //System.out.println(e); - return null; - } - } - - - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java deleted file mode 100644 index e566162bb1f..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnitInfo.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.core.runtime.IPath; - -/** - * The Element Info of a Translation Unit. - */ -class TranslationUnitInfo extends OpenableInfo { - - /** - * Timestamp of original resource at the time this element - * was opened or last updated. - */ - protected long fTimestamp; - - protected TranslationUnitInfo (CElement element) { - super(element); - } - - protected boolean hasChildren() { - return true; - } - - protected ICElement [] getChildren() { - // CHECKPOINT: replacing the parsing done here before - return fChildren; - } -/* - protected Map parse(InputStream in, boolean requiresLineNumbers) { - try { - removeChildren(); - if (CCorePlugin.getDefault().useNewParser()) { - // new parser - CModelBuilder modelBuilder = new CModelBuilder((TranslationUnit)getElement()); - return (modelBuilder.parse(requiresLineNumbers)); - - } else { - // cdt 1.0 parser - ModelBuilder modelBuilder= new ModelBuilder((TranslationUnit)getElement()); - CStructurizer.getCStructurizer().parse(modelBuilder, in); - return null; - } - } catch (Exception e) { - System.out.println(e); - return null; - } - } - - protected Map parse(String buf, boolean requiresLineNumbers) { - // CHECKPOINT: Parsing a string using the StringBufferInputStream - // FIXME: quick fix for the IBinary which uses fake translationUnit - if (buf != null) { - StringBufferInputStream in = new StringBufferInputStream (buf); - return (parse (in, requiresLineNumbers)); - } - return null; - } -*/ - /* Overide the SourceManipulation for the range. */ - protected ISourceRange getSourceRange() { - IPath location = ((TranslationUnit)getElement()).getLocation(); - return new SourceRange(0, (int)location.toFile().length()); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java deleted file mode 100644 index 2e3b1a59184..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITypeDef; - -public class TypeDef extends SourceManipulation implements ITypeDef{ - - String typeName= ""; - public TypeDef(ICElement parent, String name) { - super(parent, name, CElement.C_TYPEDEF); - } - /** - * Returns the typeName. - * @return String - */ - public String getTypeName() { - return typeName; - } - - /** - * Sets the typeName. - * @param typeName The typeName to set - */ - public void setTypeName(String typeName) { - this.typeName = typeName; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java deleted file mode 100644 index a7add0cad3c..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IUsing; - -public class Using extends SourceManipulation implements IUsing{ - - public Using(ICElement parent, String name) { - super(parent, name, CElement.C_USING); - } - - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java deleted file mode 100644 index 7a84ab46711..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Util.java +++ /dev/null @@ -1,300 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.text.MessageFormat; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICLogConstants; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.internal.core.model.IDebugLogConstants.DebugLogConstant; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -public class Util implements ICLogConstants { - - public static boolean VERBOSE_PARSER = false; - public static boolean VERBOSE_MODEL = false; - public static boolean VERBOSE_CONTENTASSIST = false; - - private Util() { - } - - - public static StringBuffer getContent(IFile file) throws IOException { - InputStream stream = null; - try { - stream = new BufferedInputStream(file.getContents(true)); - } catch (CoreException e) { - throw new IOException(e.getMessage()); - } - try { - char [] b = getInputStreamAsCharArray(stream, -1, null); - return new StringBuffer(b.length).append(b); - } finally { - try { - if (stream != null) - stream.close(); - } catch (IOException e) { - } - } - } - - /** - * Returns the given input stream's contents as a character array. - * If a length is specified (ie. if length != -1), only length chars - * are returned. Otherwise all chars in the stream are returned. - * Note this doesn't close the stream. - * @throws IOException if a problem occured reading the stream. - */ - public static char[] getInputStreamAsCharArray(InputStream stream, int length, String encoding) - throws IOException { - InputStreamReader reader = null; - reader = encoding == null - ? new InputStreamReader(stream) - : new InputStreamReader(stream, encoding); - char[] contents; - if (length == -1) { - contents = new char[0]; - int contentsLength = 0; - int charsRead = -1; - do { - int available = stream.available(); - - // resize contents if needed - if (contentsLength + available > contents.length) { - System.arraycopy( - contents, - 0, - contents = new char[contentsLength + available], - 0, - contentsLength); - } - - // read as many chars as possible - charsRead = reader.read(contents, contentsLength, available); - - if (charsRead > 0) { - // remember length of contents - contentsLength += charsRead; - } - } while (charsRead > 0); - - // resize contents if necessary - if (contentsLength < contents.length) { - System.arraycopy( - contents, - 0, - contents = new char[contentsLength], - 0, - contentsLength); - } - } else { - contents = new char[length]; - int len = 0; - int readSize = 0; - while ((readSize != -1) && (len != length)) { - // See PR 1FMS89U - // We record first the read size. In this case len is the actual read size. - len += readSize; - readSize = reader.read(contents, len, length - len); - } - // See PR 1FMS89U - // Now we need to resize in case the default encoding used more than one byte for each - // character - if (len != length) - System.arraycopy(contents, 0, (contents = new char[len]), 0, len); - } - - return contents; - } - - public static void save (StringBuffer buffer, IFile file) throws CoreException { - byte[] bytes = buffer.toString().getBytes(); - ByteArrayInputStream stream = new ByteArrayInputStream(bytes); - // use a platform operation to update the resource contents - boolean force = true; - file.setContents(stream, force, true, null); // record history - } - - /** - * Returns the given file's contents as a character array. - */ - public static char[] getResourceContentsAsCharArray(IFile file) throws CModelException { - return getResourceContentsAsCharArray(file, null); - } - - public static char[] getResourceContentsAsCharArray(IFile file, String encoding) throws CModelException { - InputStream stream= null; - try { - stream = new BufferedInputStream(file.getContents(true)); - } catch (CoreException e) { - throw new CModelException(e, ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST); - } - try { - return Util.getInputStreamAsCharArray(stream, -1, encoding); - } catch (IOException e) { - throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION); - } finally { - try { - stream.close(); - } catch (IOException e) { - } - } - } - /* - * Add a log entry - */ - public static void log(Throwable e, String message, LogConst logType) { - IStatus status= new Status( - IStatus.ERROR, - CCorePlugin.getDefault().getDescriptor().getUniqueIdentifier(), - IStatus.ERROR, - message, - e); - Util.log(status, logType); - } - - public static void log(IStatus status, LogConst logType){ - if (logType.equals(ICLogConstants.PDE)){ - CCorePlugin.getDefault().getLog().log(status); - } - else if (logType.equals(ICLogConstants.CDT)){ - CCorePlugin.getDefault().cdtLog.log(status); - } - } - - public static void log(String message, LogConst logType){ - IStatus status = new Status(IStatus.INFO, - CCorePlugin.getDefault().getDescriptor().getUniqueIdentifier(), - IStatus.INFO, - message, - null); - Util.log(status, logType); - } - - public static void debugLog(String message, DebugLogConstant client) { - Util.debugLog(message, client, true); - } - - public static void debugLog(String message, DebugLogConstant client, boolean addTimeStamp) { - if( CCorePlugin.getDefault() == null ) return; - if ( CCorePlugin.getDefault().isDebugging() && isActive(client)) { - // Time stamp - if(addTimeStamp) - message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } ); - while (message.length() > 100) { - String partial = message.substring(0, 100); - message = message.substring(100); - System.out.println(partial + "\\"); - } - if (message.endsWith("\n")) { - System.err.print(message); - } else { - System.out.println(message); - } - } - } - - /** - * @param client - * @return - */ - public static boolean isActive(DebugLogConstant client) { - if (client.equals(IDebugLogConstants.PARSER)){ - return VERBOSE_PARSER; - } - else if (client.equals(IDebugLogConstants.MODEL)){ - return VERBOSE_MODEL; - } - else if (client.equals(IDebugLogConstants.CONTENTASSIST)){ - return VERBOSE_CONTENTASSIST; - } - return false; - } - - public static void setDebugging(boolean value){ - CCorePlugin.getDefault().setDebugging(value); - } - - /** - * Combines two hash codes to make a new one. - */ - public static int combineHashCodes(int hashCode1, int hashCode2) { - return hashCode1 * 17 + hashCode2; - } - /** - * Compares two arrays using equals() on the elements. - * Either or both arrays may be null. - * Returns true if both are null. - * Returns false if only one is null. - * If both are arrays, returns true iff they have the same length and - * all elements compare true with equals. - */ - public static boolean equalArraysOrNull(Object[] a, Object[] b) { - if (a == b) return true; - if (a == null || b == null) return false; - - int len = a.length; - if (len != b.length) return false; - for (int i = 0; i < len; ++i) { - if (a[i] == null) { - if (b[i] != null) return false; - } else { - if (!a[i].equals(b[i])) return false; - } - } - return true; - } - /** - * Compares two arrays using equals() on the elements. - * Either or both arrays may be null. - * Returns true if both are null. - * Returns false if only one is null. - * If both are arrays, returns true iff they have the same length and - * all elements are equal. - */ - public static boolean equalArraysOrNull(int[] a, int[] b) { - if (a == b) - return true; - if (a == null || b == null) - return false; - int len = a.length; - if (len != b.length) - return false; - for (int i = 0; i < len; ++i) { - if (a[i] != b[i]) - return false; - } - return true; - } - - /** - * Compares two objects using equals(). - * Either or both array may be null. - * Returns true if both are null. - * Returns false if only one is null. - * Otherwise, return the result of comparing with equals(). - */ - public static boolean equalOrNull(Object a, Object b) { - if (a == b) { - return true; - } - if (a == null || b == null) { - return false; - } - return a.equals(b); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java deleted file mode 100644 index f3cdc985349..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IVariable; - -public class Variable extends VariableDeclaration implements IVariable { - - public Variable(ICElement parent, String name) { - super(parent, name, CElement.C_VARIABLE); - } - - public Variable(ICElement parent, String name, int kind) { - super(parent, name, kind); - } - - public String getInitializer() { - return ""; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java deleted file mode 100644 index 10caa7f4836..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IVariableDeclaration; - -public class VariableDeclaration extends SourceManipulation implements IVariableDeclaration { - - public VariableDeclaration(ICElement parent, String name) { - super(parent, name, CElement.C_VARIABLE_DECLARATION); - } - - public VariableDeclaration(ICElement parent, String name, int type) { - super(parent, name, type); - } - - public String getTypeName() { - return getVariableInfo().getTypeName(); - } - - public void setTypeName(String type) { - getVariableInfo().setTypeString(type); - } - - public boolean isConst() { - return getVariableInfo().isConst(); - } - - public void setConst(boolean isConst) { - getVariableInfo().setConst(isConst); - } - - public boolean isVolatile() { - return getVariableInfo().isVolatile(); - } - - public void setVolatile(boolean isVolatile) { - getVariableInfo().setVolatile(isVolatile); - } - - public boolean isStatic() { - return getVariableInfo().isStatic(); - } - - public void setStatic(boolean isStatic) { - getVariableInfo().setStatic(isStatic); - } - - public VariableInfo getVariableInfo(){ - return (VariableInfo) getElementInfo(); - } - - protected CElementInfo createElementInfo () { - return new VariableInfo(this); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java deleted file mode 100644 index a528f414c2a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -class VariableInfo extends SourceManipulationInfo { - - String typeStr = ""; - boolean isConst = false; - boolean isVolatile = false; - boolean isStatic = false; - - protected VariableInfo (CElement element) { - super(element); - } - - protected String getTypeName(){ - return typeStr; - } - - protected void setTypeName(String type){ - typeStr = type; - } - - protected void setTypeString(String type){ - typeStr = type; - } - protected boolean isConst(){ - return isConst; - } - - protected void setConst(boolean isConst){ - this.isConst = isConst; - } - - protected boolean isVolatile(){ - return isVolatile; - } - - protected void setVolatile(boolean isVolatile){ - this.isVolatile = isVolatile; - } - - protected boolean isStatic() { - return isStatic; - } - - protected void setStatic(boolean isStatic) { - this.isStatic = isStatic; - } - - /** - * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(org.eclipse.cdt.internal.core.model.SourceManipulationInfo) - */ - public boolean hasSameContentsAs(SourceManipulationInfo otherInfo) { - return - ( super.hasSameContentsAs(otherInfo) - && ( typeStr.equals(((VariableInfo)otherInfo).getTypeName()) ) - && ( isConst() == ((VariableInfo)otherInfo).isConst() ) - && (isVolatile() == ((VariableInfo)otherInfo).isVolatile() ) - && (isStatic() == ((VariableInfo)otherInfo).isStatic() ) - ); - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java deleted file mode 100644 index 1649073ba91..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.cdt.internal.core.model; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITemplate; - -public class VariableTemplate extends Variable implements ITemplate { - - protected static final String[] fgEmptyList= new String[] {}; - protected String[] templateParameterTypes; - - public VariableTemplate(ICElement parent, String name) { - super(parent, name, CElement.C_TEMPLATE_VARIABLE); - templateParameterTypes= fgEmptyList; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters() - */ - public int getNumberOfTemplateParameters() { - return templateParameterTypes == null ? 0 : templateParameterTypes.length; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ITemplate#getTemplateParameterTypes() - */ - public String[] getTemplateParameterTypes() { - return templateParameterTypes; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ITemplate#setTemplateParameterTypes(java.lang.String[]) - */ - public void setTemplateParameterTypes(String[] templateParameterTypes) { - this.templateParameterTypes = templateParameterTypes; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature() - */ - public String getTemplateSignature() { - StringBuffer sig = new StringBuffer(getElementName()); - if(getNumberOfTemplateParameters() > 0){ - sig.append("<"); - String[] paramTypes = getTemplateParameterTypes(); - int i = 0; - sig.append(paramTypes[i++]); - while (i < paramTypes.length){ - sig.append(", "); - sig.append(paramTypes[i++]); - } - sig.append(">"); - } - else{ - sig.append("<>"); - } - - sig.append(" : "); - sig.append(this.getTypeName()); - - return sig.toString(); - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java deleted file mode 100644 index 8a87ebfe378..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java +++ /dev/null @@ -1,382 +0,0 @@ -package org.eclipse.cdt.internal.core.model; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.io.ByteArrayInputStream; -import java.util.Map; - -import org.eclipse.cdt.core.model.*; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelStatusConstants; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * Implementation of a working copy translation unit. A working copy maintains - * the timestamp of the resource it was created from. - */ -public class WorkingCopy extends TranslationUnit implements IWorkingCopy { - - /** - * If set, this is the factory that will be used to create the buffer. - */ - protected IBufferFactory bufferFactory; - /** - * A counter of the number of time clients have asked for this - * working copy. It is set to 1, if the working - * copy is not managed. When destroyed, this counter is - * set to 0. Once destroyed, this working copy cannot be opened - * and non-handle info can not be accessed. This is - * never true if this translation unit is not a working copy. - */ - protected int useCount = 1; - - /** - * Creates a working copy of this element - */ - public WorkingCopy(ICElement parent, IFile file, IBufferFactory bufferFactory) { - super(parent, file); - this.bufferFactory = - bufferFactory == null ? - getBufferManager() : - bufferFactory; - } - - public WorkingCopy(ICElement parent, IPath path, IBufferFactory bufferFactory) { - super(parent, path); - this.bufferFactory = - bufferFactory == null ? - getBufferManager() : - bufferFactory; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#commit(boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public void commit(boolean force, IProgressMonitor monitor) - throws CModelException { - ITranslationUnit original = (ITranslationUnit)this.getOriginalElement(); - if (original.exists()) { - CommitWorkingCopyOperation op= new CommitWorkingCopyOperation(this, force); - runOperation(op, monitor); - } else { - String contents = this.getSource(); - if (contents == null) return; - try { - byte[] bytes = contents.getBytes(); - ByteArrayInputStream stream = new ByteArrayInputStream(bytes); - IFile originalRes = (IFile)original.getResource(); - if (originalRes.exists()) { - originalRes.setContents( - stream, - force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY, - null); - } else { - originalRes.create( - stream, - force, - monitor); - } - } catch (CoreException e) { - throw new CModelException(e); - } - } - } - - /** - * Returns a new element info for this element. - */ - protected CElementInfo createElementInfo() { - return new WorkingCopyInfo(this); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#destroy() - */ - public void destroy() { - if (--this.useCount > 0) { - return; - } - try { - close(); - - // if original element is not on classpath flush it from the cache - ICElement originalElement = this.getOriginalElement(); - if (!this.getParent().exists()) { - ((TranslationUnit)originalElement).close(); - } - - // remove working copy from the cache - CModelManager manager = CModelManager.getDefault(); - - // In order to be shared, working copies have to denote the same compilation unit - // AND use the same buffer factory. - // Assuming there is a little set of buffer factories, then use a 2 level Map cache. - Map sharedWorkingCopies = manager.sharedWorkingCopies; - - Map perFactoryWorkingCopies = (Map) sharedWorkingCopies.get(this.bufferFactory); - if (perFactoryWorkingCopies != null){ - if (perFactoryWorkingCopies.remove(originalElement) != null) { - - // report removed java delta - //CElementDelta delta = new CElementDelta(this.getCoreModel()); - //delta.removed(this); - //manager.fire(delta, CModelManager.DEFAULT_CHANGE_EVENT); - } - } - } catch (CModelException e) { - // do nothing - } - } - - /** - * @see org.eclipse.cdt.core.model.ICElement#exists() - */ - public boolean exists() { - // working copy always exists in the model until it is detroyed - return this.useCount != 0; - } - - - /** - * Answers custom buffer factory - */ - public IBufferFactory getBufferFactory(){ - - return this.bufferFactory; - } - - /** - * Working copies must be identical to be equal. - * - * @see Object#equals - */ - public boolean equals(Object o) { - return this == o; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#getOriginalElement() - */ - public ITranslationUnit getOriginalElement() { - return new TranslationUnit(getParent(), getFile()); - } - - /** - * @see org.eclipse.cdt.core.model.ITranslationUnit#getSharedWorkingCopy(IProgressMonitor, IBufferFactory) - */ - public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor,IBufferFactory factory) - throws CModelException{ - return this; - } - /** - * @see org.eclipse.cdt.core.model.ITranslationUnit#getWorkingCopy() - */ - public IWorkingCopy getWorkingCopy() { - return this; - } - - /** - * @see IWorkingCopy - */ - public IWorkingCopy getWorkingCopy(IProgressMonitor monitor, IBufferFactory factory){ - return this; - } - - - /** - * @see IWorkingCopy - */ - public boolean isBasedOn(IResource resource) { - if (resource.getType() != IResource.FILE) { - return false; - } - if (this.useCount == 0) { - return false; - } - // if resource got deleted, then #getModificationStamp() will answer IResource.NULL_STAMP, which is always different from the cached - // timestamp - return ((TranslationUnitInfo) getElementInfo()).fTimestamp == ((IFile) resource).getModificationStamp(); - } - /** - * @see org.eclipse.cdt.core.model.ITranslationUnit#isWorkingCopy() - */ - public boolean isWorkingCopy() { - return true; - } - - /** - * @see ICFile - * @see IWorkingCopy - * - * @exception CModelException attempting to open a read only element for - * something other than navigation or if this is a working copy being - * opened after it has been destroyed. - */ - public void open(IProgressMonitor pm) throws CModelException { - if (this.useCount == 0) { // was destroyed - throw newNotPresentException(); - } else { - super.open(pm); - } - } - /** - * @see org.eclipse.cdt.internal.core.model.CFile#openBuffer(IProgressMonitor) - */ - protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException { - - if (this.useCount == 0) throw newNotPresentException(); - - // create buffer - working copies may use custom buffer factory - IBuffer buffer = getBufferFactory().createBuffer(this); - if (buffer == null) - return null; - - // set the buffer source if needed - if (buffer.getCharacters() == null){ - ITranslationUnit original= (ITranslationUnit)this.getOriginalElement(); - IBuffer originalBuffer = null; - try { - originalBuffer = original.getBuffer(); - } catch (CModelException e) { - // original element does not exist: create an empty working copy - if (!e.getCModelStatus().doesNotExist()) { - throw e; - } - } - if (originalBuffer != null) { - char[] originalContents = originalBuffer.getCharacters(); - if (originalContents != null) { - buffer.setContents((char[])originalContents.clone()); - } - } else { - // initialize buffer - buffer.setContents(new char[0]); - } - } - - // add buffer to buffer cache - this.getBufferManager().addBuffer(buffer); - - // listen to buffer changes - buffer.addBufferChangedListener(this); - - return buffer; - } - - - /** - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#reconcile() - */ - public IMarker[] reconcile() throws CModelException { - reconcile(false, null); - return null; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#reconcile(boolean, org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean reconcile(boolean forceProblemDetection, IProgressMonitor monitor) - throws CModelException { - - boolean somethingChanged = false; - - if (this.useCount == 0) throw newNotPresentException(); //was destroyed - - if (monitor != null){ - if (monitor.isCanceled()) return somethingChanged; - monitor.beginTask("element.reconciling", 10); //$NON-NLS-1$ - } - - boolean wasConsistent = isConsistent(); - CElementDeltaBuilder deltaBuilder = null; - - try { - // create the delta builder (this remembers the current content of the cu) - if (!wasConsistent){ - deltaBuilder = new CElementDeltaBuilder(this); - - // update the element infos with the content of the working copy - this.makeConsistent(monitor); - deltaBuilder.buildDeltas(); - somethingChanged = true; - } - - if (monitor != null) monitor.worked(2); - - // force problem detection? - if structure was consistent - if (forceProblemDetection && wasConsistent){ - if (monitor != null && monitor.isCanceled()) return somethingChanged; - - //IProblemRequestor problemRequestor = this.getProblemRequestor(); - //if (problemRequestor != null && problemRequestor.isActive()){ - // problemRequestor.beginReporting(); - // CompilationUnitProblemFinder.process(this, problemRequestor, monitor); - // problemRequestor.endReporting(); - //} - } - - // fire the deltas - //if (deltaBuilder != null){ - // if ((deltaBuilder.delta != null) && (deltaBuilder.delta.getAffectedChildren().length > 0)) { - // CModelManager.getDefault().fire(deltaBuilder.delta, ElementChangedEvent.POST_RECONCILE); - // } - //} - } finally { - if (monitor != null) monitor.done(); - } - return somethingChanged; - } - /** - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#restore() - */ - public void restore() throws CModelException{ - if (this.useCount == 0) throw newNotPresentException(); //was destroyed - - TranslationUnit original = (TranslationUnit) getOriginalElement(); - IBuffer buffer = this.getBuffer(); - if (buffer == null) return; - buffer.setContents(original.getContents()); - updateTimeStamp(original); - makeConsistent(null); - } - /** - * @see org.eclipse.cdt.core.model.ICFile#save(IProgressMonitor, boolean) - */ - public void save(IProgressMonitor pm, boolean force) throws CModelException { - if (isReadOnly()) { - throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this)); - } - // computes fine-grain deltas in case the working copy is being reconciled already (if not it would miss one iteration of deltas). - this.reconcile(); - } - /** - * @param original - * @throws CModelException - */ - protected void updateTimeStamp(TranslationUnit original) throws CModelException { - long timeStamp = - ((IFile) original.getResource()).getModificationStamp(); - if (timeStamp == IResource.NULL_STAMP) { - throw new CModelException( - new CModelStatus(ICModelStatusConstants.INVALID_RESOURCE)); - } - ((TranslationUnitInfo) getElementInfo()).fTimestamp = timeStamp; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopyInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopyInfo.java deleted file mode 100644 index a63dff35e2a..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopyInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.internal.core.model; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -/** - * The Element Info of a Working Copy. - */ -public class WorkingCopyInfo extends TranslationUnitInfo { - - public WorkingCopyInfo (CElement element) { - super(element); - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java deleted file mode 100644 index 883102ff323..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/ElfParser.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.internal.core.model.parser; - -/** - * Implementation moved to org.eclipse.cdt.utils.elf.parser.ElfParser - * But this class is still provided for backward compatibility. - */ -public class ElfParser extends org.eclipse.cdt.utils.elf.parser.ElfParser { -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/PEParser.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/PEParser.java deleted file mode 100644 index 0b092507350..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/PEParser.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.cdt.internal.core.model.parser; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -/** - * Implementation moved to org.eclipse.cdt.utils.coff.parser.PEParser - * But this class is still provided for backward compatibility. - */ -public class PEParser extends org.eclipse.cdt.utils.coff.parser.PEParser { -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java deleted file mode 100644 index 8135a13acf7..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.internal.core.util; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.Enumeration; - -/** - * The ICacheEnumeration is used to iterate over both the keys - * and values in an LRUCache. The getValue() method returns the - * value of the last key to be retrieved using nextElement(). - * The nextElement() method must be called before the - * getValue() method. - * - *

          The iteration can be made efficient by making use of the fact that values in - * the cache (instances of LRUCacheEntry), know their key. For this reason, - * Hashtable lookups don't have to be made at each step of the iteration. - * - *

          Modifications to the cache must not be performed while using the - * enumeration. Doing so will lead to an illegal state. - * - * @see LRUCache - * - * This interface is similar to the JDT ICacheEnumeration interface. - */ -public interface ICacheEnumeration extends Enumeration { - /** - * Returns the value of the previously accessed key in the enumeration. - * Must be called after a call to nextElement(). - * - * @return Value of current cache entry - */ - public Object getValue(); -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ILRUCacheable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ILRUCacheable.java deleted file mode 100644 index 1293c6476c1..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ILRUCacheable.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.cdt.internal.core.util; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -/** - * Types implementing this interface can occupy a variable amount of space - * in an LRUCache. Cached items that do not implement this interface are - * considered to occupy one unit of space. - * - * @see LRUCache - * - * This interface is similar to the JDT ILRUCacheable interface. - */ -public interface ILRUCacheable { - /** - * Returns the space the receiver consumes in an LRU Cache. The default space - * value is 1. - * - * @return int Amount of cache space taken by the receiver - */ - public int getCacheFootprint(); - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java deleted file mode 100644 index 9ab85bb9d90..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java +++ /dev/null @@ -1,503 +0,0 @@ -package org.eclipse.cdt.internal.core.util; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - - -import java.util.Enumeration; -import java.util.Hashtable; - -/** - * The LRUCache is a hashtable that stores a finite number of elements. - * When an attempt is made to add values to a full cache, the least recently used values - * in the cache are discarded to make room for the new values as necessary. - * - *

          The data structure is based on the LRU virtual memory paging scheme. - * - *

          Objects can take up a variable amount of cache space by implementing - * the ILRUCacheable interface. - * - *

          This implementation is NOT thread-safe. Synchronization wrappers would - * have to be added to ensure atomic insertions and deletions from the cache. - * - * @see ILRUCacheable - * - * This class is similar to the JDT LRUCache class. - */ -public class LRUCache implements Cloneable { - - /** - * This type is used internally by the LRUCache to represent entries - * stored in the cache. - * It is static because it does not require a pointer to the cache - * which contains it. - * - * @see LRUCache - */ - protected static class LRUCacheEntry { - - /** - * Hash table key - */ - public Object _fKey; - - /** - * Hash table value (an LRUCacheEntry object) - */ - public Object _fValue; - - /** - * Time value for queue sorting - */ - public int _fTimestamp; - - /** - * Cache footprint of this entry - */ - public int _fSpace; - - /** - * Previous entry in queue - */ - public LRUCacheEntry _fPrevious; - - /** - * Next entry in queue - */ - public LRUCacheEntry _fNext; - - /** - * Creates a new instance of the receiver with the provided values - * for key, value, and space. - */ - public LRUCacheEntry (Object key, Object value, int space) { - _fKey = key; - _fValue = value; - _fSpace = space; - } - - /** - * Returns a String that represents the value of this object. - */ - public String toString() { - - return "LRUCacheEntry [" + _fKey + "-->" + _fValue + "]"; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * Amount of cache space used so far - */ - protected int fCurrentSpace; - - /** - * Maximum space allowed in cache - */ - protected int fSpaceLimit; - - /** - * Counter for handing out sequential timestamps - */ - protected int fTimestampCounter; - - /** - * Hash table for fast random access to cache entries - */ - protected Hashtable fEntryTable; - - /** - * Start of queue (most recently used entry) - */ - protected LRUCacheEntry fEntryQueue; - - /** - * End of queue (least recently used entry) - */ - protected LRUCacheEntry fEntryQueueTail; - - /** - * Default amount of space in the cache - */ - protected static final int DEFAULT_SPACELIMIT = 100; - /** - * Creates a new cache. Size of cache is defined by - * DEFAULT_SPACELIMIT. - */ - public LRUCache() { - - this(DEFAULT_SPACELIMIT); - } - /** - * Creates a new cache. - * @param size Size of Cache - */ - public LRUCache(int size) { - - fTimestampCounter = fCurrentSpace = 0; - fEntryQueue = fEntryQueueTail = null; - fEntryTable = new Hashtable(size); - fSpaceLimit = size; - } - /** - * Returns a new cache containing the same contents. - * - * @return New copy of object. - */ - public Object clone() { - - LRUCache newCache = newInstance(fSpaceLimit); - LRUCacheEntry qEntry; - - /* Preserve order of entries by copying from oldest to newest */ - qEntry = this.fEntryQueueTail; - while (qEntry != null) { - newCache.privateAdd (qEntry._fKey, qEntry._fValue, qEntry._fSpace); - qEntry = qEntry._fPrevious; - } - return newCache; - } - /** - * Flushes all entries from the cache. - */ - public void flush() { - - fCurrentSpace = 0; - LRUCacheEntry entry = fEntryQueueTail; // Remember last entry - fEntryTable = new Hashtable(); // Clear it out - fEntryQueue = fEntryQueueTail = null; - while (entry != null) { // send deletion notifications in LRU order - privateNotifyDeletionFromCache(entry); - entry = entry._fPrevious; - } - } - /** - * Flushes the given entry from the cache. Does nothing if entry does not - * exist in cache. - * - * @param key Key of object to flush - */ - public void flush (Object key) { - - LRUCacheEntry entry; - - entry = (LRUCacheEntry) fEntryTable.get(key); - - /* If entry does not exist, return */ - if (entry == null) return; - - this.privateRemoveEntry (entry, false); - } - /** - * Answers the value in the cache at the given key. - * If the value is not in the cache, returns null - * - * @param key Hash table key of object to retrieve - * @return Retreived object, or null if object does not exist - */ - public Object get(Object key) { - - LRUCacheEntry entry = (LRUCacheEntry) fEntryTable.get(key); - if (entry == null) { - return null; - } - - this.updateTimestamp (entry); - return entry._fValue; - } - /** - * Returns the amount of space that is current used in the cache. - */ - public int getCurrentSpace() { - return fCurrentSpace; - } - /** - * Returns the maximum amount of space available in the cache. - */ - public int getSpaceLimit() { - return fSpaceLimit; - } - /** - * Returns an Enumeration of the keys currently in the cache. - */ - public Enumeration keys() { - - return fEntryTable.keys(); - } - /** - * Returns an enumeration that iterates over all the keys and values - * currently in the cache. - */ - public ICacheEnumeration keysAndValues() { - return new ICacheEnumeration() { - - Enumeration fValues = fEntryTable.elements(); - LRUCacheEntry fEntry; - - public boolean hasMoreElements() { - return fValues.hasMoreElements(); - } - - public Object nextElement() { - fEntry = (LRUCacheEntry) fValues.nextElement(); - return fEntry._fKey; - } - - public Object getValue() { - if (fEntry == null) { - throw new java.util.NoSuchElementException(); - } - return fEntry._fValue; - } - }; - } - /** - * Ensures there is the specified amount of free space in the receiver, - * by removing old entries if necessary. Returns true if the requested space was - * made available, false otherwise. - * - * @param space Amount of space to free up - */ - protected boolean makeSpace (int space) { - - int limit; - - limit = this.getSpaceLimit(); - - /* if space is already available */ - if (fCurrentSpace + space <= limit) { - return true; - } - - /* if entry is too big for cache */ - if (space > limit) { - return false; - } - - /* Free up space by removing oldest entries */ - while (fCurrentSpace + space > limit && fEntryQueueTail != null) { - this.privateRemoveEntry (fEntryQueueTail, false); - } - return true; - } - /** - * Returns a new LRUCache instance - */ - protected LRUCache newInstance(int size) { - return new LRUCache(size); - } - /** - * Adds an entry for the given key/value/space. - */ - protected void privateAdd (Object key, Object value, int space) { - - LRUCacheEntry entry; - - entry = new LRUCacheEntry(key, value, space); - this.privateAddEntry (entry, false); - } - /** - * Adds the given entry from the receiver. - * @param shuffle Indicates whether we are just shuffling the queue - * (i.e., the entry table is left alone). - */ - protected void privateAddEntry (LRUCacheEntry entry, boolean shuffle) { - - if (!shuffle) { - fEntryTable.put (entry._fKey, entry); - fCurrentSpace += entry._fSpace; - } - - entry._fTimestamp = fTimestampCounter++; - entry._fNext = this.fEntryQueue; - entry._fPrevious = null; - - if (fEntryQueue == null) { - /* this is the first and last entry */ - fEntryQueueTail = entry; - } else { - fEntryQueue._fPrevious = entry; - } - - fEntryQueue = entry; - } - /** - * An entry has been removed from the cache, for example because it has - * fallen off the bottom of the LRU queue. - * Subclasses could over-ride this to implement a persistent cache below the LRU cache. - */ - protected void privateNotifyDeletionFromCache(LRUCacheEntry entry) { - // Default is NOP. - } - /** - * Removes the entry from the entry queue. - * @param shuffle indicates whether we are just shuffling the queue - * (i.e., the entry table is left alone). - */ - protected void privateRemoveEntry (LRUCacheEntry entry, boolean shuffle) { - - LRUCacheEntry previous, next; - - previous = entry._fPrevious; - next = entry._fNext; - - if (!shuffle) { - fEntryTable.remove(entry._fKey); - fCurrentSpace -= entry._fSpace; - privateNotifyDeletionFromCache(entry); - } - - /* if this was the first entry */ - if (previous == null) { - fEntryQueue = next; - } else { - previous._fNext = next; - } - - /* if this was the last entry */ - if (next == null) { - fEntryQueueTail = previous; - } else { - next._fPrevious = previous; - } - } - /** - * Sets the value in the cache at the given key. Returns the value. - * - * @param key Key of object to add. - * @param value Value of object to add. - * @return added value. - */ - public Object put(Object key, Object value) { - - int newSpace, oldSpace, newTotal; - LRUCacheEntry entry; - - /* Check whether there's an entry in the cache */ - newSpace = spaceFor (key, value); - entry = (LRUCacheEntry) fEntryTable.get (key); - - if (entry != null) { - - /** - * Replace the entry in the cache if it would not overflow - * the cache. Otherwise flush the entry and re-add it so as - * to keep cache within budget - */ - oldSpace = entry._fSpace; - newTotal = getCurrentSpace() - oldSpace + newSpace; - if (newTotal <= getSpaceLimit()) { - updateTimestamp (entry); - entry._fValue = value; - entry._fSpace = newSpace; - this.fCurrentSpace = newTotal; - return value; - } else { - privateRemoveEntry (entry, false); - } - } - if (makeSpace(newSpace)) { - privateAdd (key, value, newSpace); - } - return value; - } - /** - * Removes and returns the value in the cache for the given key. - * If the key is not in the cache, returns null. - * - * @param key Key of object to remove from cache. - * @return Value removed from cache. - */ - public Object removeKey (Object key) { - - LRUCacheEntry entry = (LRUCacheEntry) fEntryTable.get(key); - if (entry == null) { - return null; - } - Object value = entry._fValue; - this.privateRemoveEntry (entry, false); - return value; - } - /** - * Sets the maximum amount of space that the cache can store - * - * @param limit Number of units of cache space - */ - public void setSpaceLimit(int limit) { - if (limit < fSpaceLimit) { - makeSpace(fSpaceLimit - limit); - } - fSpaceLimit = limit; - } - /** - * Returns the space taken by the given key and value. - */ - protected int spaceFor (Object key, Object value) { - - if (value instanceof ILRUCacheable) { - return ((ILRUCacheable) value).getCacheFootprint(); - } else { - return 1; - } - } -/** - * Returns a String that represents the value of this object. This method - * is for debugging purposes only. - */ -public String toString() { - return - "LRUCache " + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n" + //$NON-NLS-1$ //$NON-NLS-2$ - this.toStringContents(); -} -/** - * Returns a String that represents the contents of this object. This method - * is for debugging purposes only. - */ -protected String toStringContents() { - StringBuffer result = new StringBuffer(); - int length = fEntryTable.size(); - Object[] unsortedKeys = new Object[length]; - String[] unsortedToStrings = new String[length]; - Enumeration e = this.keys(); - for (int i = 0; i < length; i++) { - Object key = e.nextElement(); - unsortedKeys[i] = key; - unsortedToStrings[i] = - (key instanceof org.eclipse.cdt.internal.core.model.CElement) ? - ((org.eclipse.cdt.internal.core.model.CElement)key).getElementName() : - key.toString(); - } - ToStringSorter sorter = new ToStringSorter(); - sorter.sort(unsortedKeys, unsortedToStrings); - for (int i = 0; i < length; i++) { - String toString = sorter.sortedStrings[i]; - Object value = this.get(sorter.sortedObjects[i]); - result.append(toString); - result.append(" -> "); //$NON-NLS-1$ - result.append(value); - result.append("\n"); //$NON-NLS-1$ - } - return result.toString(); -} - /** - * Updates the timestamp for the given entry, ensuring that the queue is - * kept in correct order. The entry must exist - */ - protected void updateTimestamp (LRUCacheEntry entry) { - - entry._fTimestamp = fTimestampCounter++; - if (fEntryQueue != entry) { - this.privateRemoveEntry (entry, true); - this.privateAddEntry (entry, true); - } - return; - } - -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java deleted file mode 100644 index 7be087d3fb0..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.eclipse.cdt.internal.core.util; -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.Enumeration; - -/** - * The LRUCacheEnumerator returns its elements in - * the order they are found in the LRUCache, with the - * most recent elements first. - * - * Once the enumerator is created, elements which are later added - * to the cache are not returned by the enumerator. However, - * elements returned from the enumerator could have been closed - * by the cache. - * - * This class is similar to the JDT LRUCacheEnumerator class. - */ -public class LRUCacheEnumerator implements Enumeration { - /** - * Current element; - */ - protected LRUEnumeratorElement fElementQueue; - - public static class LRUEnumeratorElement { - /** - * Value returned by nextElement(); - */ - public Object fValue; - - /** - * Next element - */ - public LRUEnumeratorElement fNext; - - /** - * Constructor - */ - public LRUEnumeratorElement(Object value) { - fValue = value; - } - } - /** - * Creates a CacheEnumerator on the list of LRUEnumeratorElements. - */ - public LRUCacheEnumerator(LRUEnumeratorElement firstElement) { - fElementQueue = firstElement; - } - /** - * Returns true if more elements exist. - */ - public boolean hasMoreElements() { - return fElementQueue != null; - } - /** - * Returns the next element. - */ - public Object nextElement() { - Object temp = fElementQueue.fValue; - fElementQueue = fElementQueue.fNext; - return temp; - } -} - diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java deleted file mode 100644 index c479f797d83..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/OverflowingLRUCache.java +++ /dev/null @@ -1,429 +0,0 @@ -package org.eclipse.cdt.internal.core.util; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -import java.util.Enumeration; -import java.util.Iterator; - -import org.eclipse.cdt.internal.core.util.LRUCache; - -/** - * The OverflowingLRUCache is an LRUCache which attempts - * to maintain a size equal or less than its fSpaceLimit - * by removing the least recently used elements. - * - *

          The cache will remove elements which successfully close and all - * elements which are explicitly removed. - * - *

          If the cache cannot remove enough old elements to add new elements - * it will grow beyond fSpaceLimit. Later, it will attempt to - * shink back to the maximum space limit. - * - * The method close should attempt to close the element. If - * the element is successfully closed it will return true and the element will - * be removed from the cache. Otherwise the element will remain in the cache. - * - *

          The cache implicitly attempts shrinks on calls to putand - * setSpaceLimit. Explicitly calling the shrink method - * will also cause the cache to attempt to shrink. - * - *

          The cache calculates the used space of all elements which implement - * ILRUCacheable. All other elements are assumed to be of size one. - * - *

          Use the #peek(Object) and #disableTimestamps() method to - * circumvent the timestamp feature of the cache. This feature is intended to be used - * only when the #close(LRUCacheEntry) method causes changes to the cache. - * For example, if a parent closes its children when #close(LRUCacheEntry) is called, - * it should be careful not to change the LRU linked list. It can be sure it is not causing - * problems by calling #peek(Object) instead of #get(Object) method. - * - * @see LRUCache - * - * This class is similar to the JDT OverflowingLRUCache class. - */ -public abstract class OverflowingLRUCache extends LRUCache { - /** - * Indicates if the cache has been over filled and by how much. - */ - protected int fOverflow = 0; - /** - * Indicates whether or not timestamps should be updated - */ - protected boolean fTimestampsOn = true; - /** - * Indicates how much space should be reclaimed when the cache overflows. - * Inital load factor of one third. - */ - protected double fLoadFactor = 0.333; - /** - * Creates a OverflowingLRUCache. - * @param size Size limit of cache. - */ - public OverflowingLRUCache(int size) { - this(size, 0); - } - /** - * Creates a OverflowingLRUCache. - * @param size Size limit of cache. - * @param overflow Size of the overflow. - */ - public OverflowingLRUCache(int size, int overflow) { - super(size); - fOverflow = overflow; - } - /** - * Returns a new cache containing the same contents. - * - * @return New copy of this object. - */ - public Object clone() { - - OverflowingLRUCache newCache = (OverflowingLRUCache)newInstance(fSpaceLimit, fOverflow); - LRUCacheEntry qEntry; - - /* Preserve order of entries by copying from oldest to newest */ - qEntry = this.fEntryQueueTail; - while (qEntry != null) { - newCache.privateAdd (qEntry._fKey, qEntry._fValue, qEntry._fSpace); - qEntry = qEntry._fPrevious; - } - return newCache; - } - /** - * Returns true if the element is successfully closed and - * removed from the cache, otherwise false. - * - *

          NOTE: this triggers an external remove from the cache - * by closing the obejct. - * - */ - protected abstract boolean close(LRUCacheEntry entry); - /** - * Returns an enumerator of the values in the cache with the most - * recently used first. - */ - public Enumeration elements() { - if (fEntryQueue == null) - return new LRUCacheEnumerator(null); - LRUCacheEnumerator.LRUEnumeratorElement head = - new LRUCacheEnumerator.LRUEnumeratorElement(fEntryQueue._fValue); - LRUCacheEntry currentEntry = fEntryQueue._fNext; - LRUCacheEnumerator.LRUEnumeratorElement currentElement = head; - while(currentEntry != null) { - currentElement.fNext = new LRUCacheEnumerator.LRUEnumeratorElement(currentEntry._fValue); - currentElement = currentElement.fNext; - - currentEntry = currentEntry._fNext; - } - return new LRUCacheEnumerator(head); - } - public double fillingRatio() { - return (fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit; - } - /** - * For internal testing only. - * This method exposed only for testing purposes! - * - * @return Hashtable of entries - */ - public java.util.Hashtable getEntryTable() { - return fEntryTable; - } - /** - * Returns the load factor for the cache. The load factor determines how - * much space is reclaimed when the cache exceeds its space limit. - * @return double - */ - public double getLoadFactor() { - return fLoadFactor; - } - /** - * @return The space by which the cache has overflown. - */ - public int getOverflow() { - return fOverflow; - } - /** - * Ensures there is the specified amount of free space in the receiver, - * by removing old entries if necessary. Returns true if the requested space was - * made available, false otherwise. May not be able to free enough space - * since some elements cannot be removed until they are saved. - * - * @param space Amount of space to free up - */ - protected boolean makeSpace(int space) { - - int limit = fSpaceLimit; - if (fOverflow == 0) { - /* if space is already available */ - if (fCurrentSpace + space <= limit) { - return true; - } - } - - /* Free up space by removing oldest entries */ - int spaceNeeded = (int)((1 - fLoadFactor) * fSpaceLimit); - spaceNeeded = (spaceNeeded > space) ? spaceNeeded : space; - LRUCacheEntry entry = fEntryQueueTail; - - while (fCurrentSpace + spaceNeeded > limit && entry != null) { - this.privateRemoveEntry(entry, false, false); - entry = entry._fPrevious; - } - - /* check again, since we may have aquired enough space */ - if (fCurrentSpace + space <= limit) { - fOverflow = 0; - return true; - } - - /* update fOverflow */ - fOverflow = fCurrentSpace + space - limit; - return false; - } - /** - * Returns a new instance of the reciever. - */ - protected abstract LRUCache newInstance(int size, int overflow); - /** - * Answers the value in the cache at the given key. - * If the value is not in the cache, returns null - * - * This function does not modify timestamps. - */ - public Object peek(Object key) { - - LRUCacheEntry entry = (LRUCacheEntry) fEntryTable.get(key); - if (entry == null) { - return null; - } - return entry._fValue; - } - /** - * For testing purposes only - */ - public void printStats() { - int forwardListLength = 0; - LRUCacheEntry entry = fEntryQueue; - while(entry != null) { - forwardListLength++; - entry = entry._fNext; - } - System.out.println("Forward length: " + forwardListLength); //$NON-NLS-1$ - - int backwardListLength = 0; - entry = fEntryQueueTail; - while(entry != null) { - backwardListLength++; - entry = entry._fPrevious; - } - System.out.println("Backward length: " + backwardListLength); //$NON-NLS-1$ - - Enumeration keys = fEntryTable.keys(); - class Temp { - public Class fClass; - public int fCount; - public Temp(Class aClass) { - fClass = aClass; - fCount = 1; - } - public String toString() { - return "Class: " + fClass + " has " + fCount + " entries."; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$ - } - } - java.util.HashMap h = new java.util.HashMap(); - while(keys.hasMoreElements()) { - entry = (LRUCacheEntry)fEntryTable.get(keys.nextElement()); - Class key = entry._fValue.getClass(); - Temp t = (Temp)h.get(key); - if (t == null) { - h.put(key, new Temp(key)); - } else { - t.fCount++; - } - } - - for (Iterator iter = h.keySet().iterator(); iter.hasNext();){ - System.out.println(h.get(iter.next())); - } - } - /** - * Removes the entry from the entry queue. - * Calls privateRemoveEntry with the external functionality enabled. - * - * @param shuffle indicates whether we are just shuffling the queue - * (i.e., the entry table is left alone). - */ - protected void privateRemoveEntry (LRUCacheEntry entry, boolean shuffle) { - privateRemoveEntry(entry, shuffle, true); - } - /** - * Removes the entry from the entry queue. If external is true, the entry is removed - * without checking if it can be removed. It is assumed that the client has already closed - * the element it is trying to remove (or will close it promptly). - * - * If external is false, and the entry could not be closed, it is not removed and the - * pointers are not changed. - * - * @param shuffle indicates whether we are just shuffling the queue - * (i.e., the entry table is left alone). - */ - protected void privateRemoveEntry(LRUCacheEntry entry, boolean shuffle, boolean external) { - - if (!shuffle) { - if (external) { - fEntryTable.remove(entry._fKey); - fCurrentSpace -= entry._fSpace; - privateNotifyDeletionFromCache(entry); - } else { - if (!close(entry)) return; - // buffer close will recursively call #privateRemoveEntry with external==true - // thus entry will already be removed if reaching this point. - if (fEntryTable.get(entry._fKey) == null){ - return; - } else { - // basic removal - fEntryTable.remove(entry._fKey); - fCurrentSpace -= entry._fSpace; - privateNotifyDeletionFromCache(entry); - } - } - } - LRUCacheEntry previous = entry._fPrevious; - LRUCacheEntry next = entry._fNext; - - /* if this was the first entry */ - if (previous == null) { - fEntryQueue = next; - } else { - previous._fNext = next; - } - /* if this was the last entry */ - if (next == null) { - fEntryQueueTail = previous; - } else { - next._fPrevious = previous; - } - } - /** - * Sets the value in the cache at the given key. Returns the value. - * - * @param key Key of object to add. - * @param value Value of object to add. - * @return added value. - */ - public Object put(Object key, Object value) { - /* attempt to rid ourselves of the overflow, if there is any */ - if (fOverflow > 0) - shrink(); - - /* Check whether there's an entry in the cache */ - int newSpace = spaceFor (key, value); - LRUCacheEntry entry = (LRUCacheEntry) fEntryTable.get (key); - - if (entry != null) { - - /** - * Replace the entry in the cache if it would not overflow - * the cache. Otherwise flush the entry and re-add it so as - * to keep cache within budget - */ - int oldSpace = entry._fSpace; - int newTotal = fCurrentSpace - oldSpace + newSpace; - if (newTotal <= fSpaceLimit) { - updateTimestamp (entry); - entry._fValue = value; - entry._fSpace = newSpace; - fCurrentSpace = newTotal; - fOverflow = 0; - return value; - } else { - privateRemoveEntry (entry, false, false); - } - } - - // attempt to make new space - makeSpace(newSpace); - - // add without worring about space, it will - // be handled later in a makeSpace call - privateAdd (key, value, newSpace); - - return value; - } - /** - * Removes and returns the value in the cache for the given key. - * If the key is not in the cache, returns null. - * - * @param key Key of object to remove from cache. - * @return Value removed from cache. - */ - public Object remove(Object key) { - return removeKey(key); - } - /** - * Sets the load factor for the cache. The load factor determines how - * much space is reclaimed when the cache exceeds its space limit. - * @param newLoadFactor double - * @throws IllegalArgumentException when the new load factor is not in (0.0, 1.0] - */ - public void setLoadFactor(double newLoadFactor) throws IllegalArgumentException { - if(newLoadFactor <= 1.0 && newLoadFactor > 0.0) - fLoadFactor = newLoadFactor; - else - throw new IllegalArgumentException("cache.invalidLoadFactor"); //$NON-NLS-1$ - } - /** - * Sets the maximum amount of space that the cache can store - * - * @param limit Number of units of cache space - */ - public void setSpaceLimit(int limit) { - if (limit < fSpaceLimit) { - makeSpace(fSpaceLimit - limit); - } - fSpaceLimit = limit; - } - /** - * Attempts to shrink the cache if it has overflown. - * Returns true if the cache shrinks to less than or equal to fSpaceLimit. - */ - public boolean shrink() { - if (fOverflow > 0) - return makeSpace(0); - return true; - } - /** - * Returns a String that represents the value of this object. This method - * is for debugging purposes only. - */ - public String toString() { - return - "OverflowingLRUCache " + this.fillingRatio() + "% full\n" + //$NON-NLS-1$ //$NON-NLS-2$ - this.toStringContents(); - } - /** - * Updates the timestamp for the given entry, ensuring that the queue is - * kept in correct order. The entry must exist. - * - *

          This method will do nothing if timestamps have been disabled. - */ - protected void updateTimestamp(LRUCacheEntry entry) { - if (fTimestampsOn) { - entry._fTimestamp = fTimestampCounter++; - if (fEntryQueue != entry) { - this.privateRemoveEntry(entry, true); - this.privateAddEntry(entry, true); - } - } - } -} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ToStringSorter.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ToStringSorter.java deleted file mode 100644 index 8ec2504ba53..00000000000 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ToStringSorter.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.eclipse.cdt.internal.core.util; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -/** - * The SortOperation takes a collection of objects and returns - * a sorted collection of these objects. The sorting of these - * objects is based on their toString(). They are sorted in - * alphabetical order. - * - * This class is similar to the JDT toStringSorter class. - */ -public class ToStringSorter { - Object[] sortedObjects; - String[] sortedStrings; - /** - * Returns true if stringTwo is 'greater than' stringOne - * This is the 'ordering' method of the sort operation. - */ - public boolean compare(String stringOne, String stringTwo) { - return stringOne.compareTo(stringTwo) < 0; - } - /** - * Sort the objects in sorted collection and return that collection. - */ - private void quickSort(int left, int right) { - int originalLeft = left; - int originalRight = right; - int midIndex = (left + right) / 2; - String midToString = this.sortedStrings[midIndex]; - - do { - while (compare(this.sortedStrings[left], midToString)) - left++; - while (compare(midToString, this.sortedStrings[right])) - right--; - if (left <= right) { - Object tmp = this.sortedObjects[left]; - this.sortedObjects[left] = this.sortedObjects[right]; - this.sortedObjects[right] = tmp; - String tmpToString = this.sortedStrings[left]; - this.sortedStrings[left] = this.sortedStrings[right]; - this.sortedStrings[right] = tmpToString; - left++; - right--; - } - } while (left <= right); - - if (originalLeft < right) - quickSort(originalLeft, right); - if (left < originalRight) - quickSort(left, originalRight); - } - /** - * Return a new sorted collection from this unsorted collection. - * Sort using quick sort. - */ - public void sort(Object[] unSortedObjects, String[] unsortedStrings) { - int size = unSortedObjects.length; - this.sortedObjects = new Object[size]; - this.sortedStrings = new String[size]; - - //copy the array so can return a new sorted collection - System.arraycopy(unSortedObjects, 0, this.sortedObjects, 0, size); - System.arraycopy(unsortedStrings, 0, this.sortedStrings, 0, size); - if (size > 1) - quickSort(0, size - 1); - } -} diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog-parser b/core/org.eclipse.cdt.core/parser/ChangeLog-parser deleted file mode 100644 index 0d30a52db75..00000000000 --- a/core/org.eclipse.cdt.core/parser/ChangeLog-parser +++ /dev/null @@ -1,938 +0,0 @@ -2004-01-12 John Camelon - Fixed bug 48909 - Wrong completion node after a . or an -> - Fixed bug 49702 - Wrong completion kind sent in const/dest and code blocks - Added new CompletionKind - STATEMENT_START to indicate the beginning of a statement line. - - -2004-01-08 Andrew Niefer - fixing bug 43110 - Parser support needed for functions with ellipses - Added IParameterizedSymbol.setHasVariableArgs() & hasVariableArgs() - Modified ParserSymbolTable.resolveFunction & reduceToViable - Modified CompleteParseASTFactory.createMethod & createFunction - -2004-01-08 Andrew Niefer - Fixing 48307 - PST: Friendship needs to be handled better - Added IDerivableContainerSymbol.lookupFunctionForFriendship. - Modified IASTFactory.createMethod to take an ITokenDuple for the method name. - Added LookupType.FORFRIENDSHIP and use it in LookupElement. - Modified CompleteParseASTFactory.createMethod to handle friend functions. - -2004-01-06 Andrew Niefer - For Content Assist, support lookup using LookupKind.THIS (lookup in the class of the this pointer ) - Fix bug where forward declared method/functions appeared twice in the content assist lookup results. - -2004-01-06 John Camelon - Renamed IToken::tELIPSE to IToken::tELLIPSIS - Partially fixed Bug 43110 : Parser support needed for functions with ellipses - -2004-01-05 John Camelon - Removed warnings. - Moved StructuralParseCallback from model to parser directory to facilitate building the parser standalone. - -2003-12-31 Hoda Amer - - Changed ASTUtil.getType to include parameter initializer clause in returned string. - -2003-12-22 Hoda Amer - Content Assist Work : Returned the results size of the IASTNode lookup - to help in determining the scope relevance - - Added the variable type to a search match result to be compatible with the - results found by the completion engine - -2003-12-17 Andrew Niefer - Content Assist work: - - change parser & symbol table to handle handle friend classes - - change visibility filtering to check for friendship - - fix finding function parameters in prefix lookup - -2003-12-17 Hoda Amer - Content Assist work : Integrated with Parser and Symbol table modifications - -2003-12-15 Andrew Niefer - Changed IASTNode.lookup to take the context as a parameter - created ASTNode to implement IASTNode, ASTSymbolOwner extends it. - Set Completion Scope for statements - Set Completion context for . and -> expressions - -2003-12-15 Hoda Amer - Fixed [Bug 47234] new ParserMode required for a better CModel : - - Added a core plugin preference to build the CModel in Structural mode - - Added StructuralParseCallBack class - - Added lists of declarations to AST Scopes in the complete AST - -2003-12-12 John Camelon - Added preliminary keyword support into IASTCompletionNode::getKeywords(). - Refactored parser to put keyword string literals in one utility class. - -2003-12-11 John Camelon - Added OffsetLimitReachedException and restructured Parser exceptions. - Continued support for code assist/selection search parser. - Ensured all source in parser/ have copyright notices. - -2003-12-09 Andrew Niefer - -created TypeFilter to support support filtering of what kind of symbols to find (for prefix lookup 48306) - -added IContainerSymbol.isVisible for bug 48294 - -2003-12-09 Hoda Amer - Modified IASTCompletionNode.CompletionKind - modified IASTNode.LookupKind - Changed IASTScope to extend IASTNode - -2003-15-09 John Camelon - Fixed Bug 47234 : new ParserMode required for a better CModel - Updated IASTCompletionNode to include a scope as well as a context. - Begun parser updates to support code assist & selection search. - -2003-12-05 John Camelon - Broke the Parser up into separate classes per ParserMode. - -2003-12-04 John Camelon - Removed some warnings. - Fixed Bug 39678 : Scanner doesn't support concatenation of different-type string literals (GCC) - Refactored ScannerContext to use constructors rather than initializers. - Refactored IScannerContext to use enumeration-esque kinds. - Added code assist/selection search support to Scanner. - -2003-12-03 Andrew Niefer - - Symbol table - modify prefix lookup handling of ambiguities - - fix up qualified lookup - - add IContainerSymbol.lookupMethodForDefinition - - Parser - modify Complete parse AST factory to use the correct lookups in different situations - - Created a LookupType enum to specify what kind of lookup is needed (Qualified, unqualified, for definition) - - -2003-11-27 Andrew Niefer - fix bug 47264: Parse fails when using struct s foo; and int s; in function bodies - -2003-11-18 Andrew Niefer - Refactor PST: Split Declaration into 4 classes : ContainerSymbol, DerivableContainerSymbol, ParameterizedContainerSymbol, - SpecializedSymbol. Move these along with BasicSymbol & TemplateInstance to no longer be nested in ParserSymbolTable. - -2003-11-13 Hoda Amer - Changed the getExpressionResultType() in the complete factory to return - an object of type ExpressionResult. - Solved bug#44342: Failure to dereference function calls after a . or an -> - -2003-11-07 John Camelon - Fixed Bug 39554 : _Pragma directive is not supported (ANSI C99) - -2003-11-06 John Camelon - Removed one last remainder of core.model.Util in parser to unbreak 2.0 build. - -2003-11-05 John Camelon - Fixed Bug 44838 : exception when resolving parameter references in a constructor - Fixed Bug 46165 : fields referenced in constructor chains are not called back upon - Fixed Bug 45551 : Macro replacement in #include directives - -2003-11-05 John Camelon - Cleaned up the ParserFactory interface to check for validity of input arguments. - Moved NullSourceElementRequestor and ScannerInfo to public interface as requested. - Restructured code so that no Eclipse/CDT source outside the parser source directory is used. - Updated parser clients to use new ParserFactory (stand-alone parser work item). - -2003-11-05 John Camelon - Removed warnings from parser source tree. - Removed preliminary task tags support to clean up parser interfaces and implementation. - Added preliminary IProblem support to - -2003-11-03 John Camelon - Added in preliminary interface for code completion mode. - -2003-10-28 Andrew Niefer - Fixed Bug 44925 : Search: Elaborated type specifier - Patially fixed Bug 44510 : C/C++ Search gives wrong results - -2003-10-24 John Camelon - Fixed Bug 45476 : preprocessor macro "defined" not handled correctly - Fixed Bug 45477 : macro redefines prevent further parsing - -2003-10-24 John Camelon - Fixed Bug 39542 : Parser fails on 'struct' parameter types - Fixed Bug 39549 : Designated initializers are not supported (ANSI C99) - Fixed Bug 39551 : Complex and imaginary numbers are not supported (ANSI C99) - -2003-10-21 John Camelon - Fixed Bug 40007 : Parser reports success when it fails - Fixed Bug 44305 : Scanner/preprocessor fails on conditionals using hexidecimal - Fixed Bug 41935 : parser provides wrong name on namespace aliases - Fixed Bug 39525 : Parser fails on expressions that take address of overloaded operators - Fixed Bug 45287 : Scanner does not accept character sequence literals - Fixed Bug 36550 : Error recovery with unterminated string is weak - Fixed Bug 41063 : Remove unused K&R C support from ANSI Parser - Fixed Bug 39528 : Function try-blocks are not supported by the parser (ANSI C++) - Fixed Bug 39538 : Parser fails on explicit instantiation of templated operators - Fixed Bug 39536 : Parser fails on templated constructors/conversion operators - Refactored Scanner to make it easier to debug. - -2003-10-01 John Camelon - Fixed Bug 43987 : Search results: Declaration of class not highlighted when selected - Fixed Bug 43997 : Search results: selection includes preceding whitespace - Fixed Bug 44034 : Scanner failure on #undef - -2003-10-01 Andrew Niefer - bug43951 - search on ctor declarations returns definition too. - PST changes: - - modify lookupConstructor to copy the constructor list before resolving on it - - modify checkUserDefinedConversionSequence the same way - - modify isValidFunctionOverload to check for forward declarations - -2003-10-01 Bogdan Gheorghe - Modified CDT log dump in Parser.fetchToken to include error message - -2003-10-01 Andrew Niefer - bug43450 - Scanner needs to handle include paths that contain quotes - -2003-09-30 Bogdan Gheorghe - Added CDT log dump in Parser.fetchToken to catch HandleInclusion failures - -2003-09-30 John Camelon - Fixed Bug 43503 : Search:f_SD_01 cannot be found in ManyClasses20 Project - Fixed Bug 43680 : Fix Parser Error Handling - -2003-09-30 Hoda Amer - -Solution to [Bug 43053] require reference cleanup for expressions - Added purgeReferences() at the end of ASTExpression::acceptElement() - -2003-09-30 Andrew Niefer - PST changes for bug 43503 - parser needs to know the different between ambiguous functions - and no functions when no parameter information is provided - - throw r_UnableToResolveFunction if we have more than 1 function and no parameter info was given - - handle this case in addUsingDeclaration. - * note that r_UnableToResolveFunction doesn't necessarily mean ambiguous if we had enough information - -2003-09-29 Hoda Amer - Solution to bug#43679 : Exceptions in indexer - -2003-09-29 Andrew Niefer - fixed bug 43834 : Empty Parameter list and parameter list taking one void do not match - -2003-09-29 John Camelon - Continued work on Bug 43062 : Outline is confused on operator methods containing spaces - Partial fix for Bug 43680 : Fix Parser Error Handling - -2003-09-26 John Camelon - Fixed Bug 43644 : 6 triangle icons appearing in outline viewer when typing an error - Fixed Bug 43062 : Outline is confused on operator methods containing spaces - Fixed Bug 39531 : Problems with type conversion operators - -2003-09-25 Hoda Amer - - Last part of solution to bug#42453: Expression result types not computed - Added the handling of POSTFIX_TYPENAME_IDENTIFIER - Completed bug#43221: POSTFIX_TYPENAME_IDENTIFIER not implemented - - Solution to bug#43644 : 6 triangle icons appearing in outline viewer when typing ... - -2003-09-24 Hoda Amer - Partial solution to bug#42453: Expression result types not computed - Added the handling of the NEW_TYPEID, CASTEXPRESSION, POSTFIX_DYNAMIC_CAST, - POSTFIX_REINTERPRET_CAST, POSTFIX_STATIC_CAST, and POSTFIX_CONST_CAST - -2003-09-25 John Camelon - Partial fix for Bug 43221 : POSTFIX_TYPENAME_IDENTIFIER not implemented - -2003-09-24 John Camelon - Fixed Bug 43106 : Symbol Table support needed to resolve types - Fixed Bug 43375 : isExtern not returning true for extern declarations - -2003-09-23 John Camelon - Fixed Bug 43084 : need to restructure TypeId to allow dynamic_cast<> type expression references. - Fixed Bug 39504 : sizeof-expressions are not handled properly - -2003-09-23 Hoda Amer - Solution to bug#43373: No reference to static member in definition - Solution to bug#43371: constructor incorrectly marked private - -2003-09-18 Andrew Niefer - - modified Symbol table interfaces to use Lists & Maps instead of LinkedList and HashMap - - fixed warnings in ParserSymbolTable - - fixed bug43106 - Symbol Table support needed to resolve types - - fixed bug43156 - require ability to add implicit inheritance copy constructor - - fixed bug43159 - TypeInfo.equals() not working properly - - fixed bug43238 - Postfix_Subscript expressions confuse function resolution - -2003-09-16 Andrew Niefer - - added setThrowExceptionOnBadCharacterRead to IScanner to help with wildcard bug43063 - -2003-09-17 Hoda Amer - In completeParseASTFactory.getExpressionResultType(): Added the support - for expression types: PM_DOTSTAR, PM_ARROWSTAR, CONDITIONALEXPRESSION - -2003-09-16 John Camelon - Implement CompleteParse IASTFunction::previouslyDeclared(). - -2003-09-16 Hoda Amer - In completeParseASTFactory.getExpressionResultType(): Added the support - for expression type PRIMARY_THIS. - In createMethod(): changed the scope of a method definition to point to - the parent class. - -2003-09-15 John Camelon - Fixed Bug 39556 : 'restrict' qualifier is not supported (ANSI C99) - Fixed Bug 43126 : ISourceElementRequestor.acceptParameterReference accesses internal class - Fixed Bug 43062 : Outline is confused on operator methods containing spaces - Cleaned up some warnings in the parser. - -2003-09-15 Andrew Niefer - bug43106 - added getConditionalOperand to ParserSymbolTable - -2003-09-15 John Camelon - Partially fixed Bug 42979 : Cannot search for operator overloaders - -2003-09-12 Hoda Amer - In completeParseASTFactory.getExpressionResultType() - - Added the handling of some more expression types. - See CompleteParseASTExpressionTest for details. - -2003-09-12 John Camelon - Fixed Bug 42985 : Search: Qualified function call is treated as a declaration - Fixed Bug 40419 : parser fails on heavily templated expressions - -2003-09-12 John Camelon - Fixed Bug 43013 : IASTParameterDeclaration does not derive from IASTOffsetableNamedElement - -2003-09-12 Andrew Niefer - Fixed some NPEs in ParserSymbolTable.getFlatTypeInfo - Added some comments and created some constants to help clarify ranking of conversion sequences - -2003-09-11 John Camelon - Fixed Bug 42840 : Search: Cannot find things after double declarations - Fixed Bug 42798 : Selected #include off by 1 char - Fixed Bug 42872 : dynamic cast not parsed properly - Partially fixed Bug 39504 : sizeof-expressions are not handled properly - Updated SourceElementRequestor callbacks to include IASTParameterReference callbacks. - -2003-09-09 Hoda Amer - - Solved the double reference problem - - solution to bugs #42822, #42823, & #42822B - -2003-09-09 John Camelon - Updated ScannerException to be more precise and include more information. - Updated Parser to be more careful of how it handles particular Scanner errors in COMPLETE_PARSE mode. - -2003-09-08 Bogdan Gheorghe - Added ScannerExceptions in Preprocessor.java to PDE Error - Log - -2003-09-09 Hoda Amer - Added more IASTExpression.Kind handling to CompleteParseASTFactory.getExpressionResultType() - -2003-09-08 John Camelon - Made scoping support more robust in CompleteParse mode. - Refactored ISourceElementRequestor (enter|exit)CodeBlock() to take IASTCodeScope rather than IASTScope. - Removed the now obsolete DOM. -` Added enumerator references to ISourceElementRequestor. - -2003-09-08 Andrew Niefer - - Created ParserLanguage.java - - Updated Factories to take language as parameter when create scanner & parser - - Updated Parser, Scanner & ParserSymbolTable to take language in their constructor - -2003-09-05 Hoda Amer - - Added references to variables with pointers in solution - of bug#42453:Expression result types not computed - - -2003-09-05 John Camelon - Continue to add support for parsing within function bodies. - Add workaround for 1.2 for inline function declaration-before-use chicken-and-egg. - -2003-09-05 John Camelon - Fixed NPE on nested declarations in code blocks. - -2003-09-04 John Camelon - First pass of parsing function bodies with X-Reference information. - Updated IASTFactory/ISourceElementRequestor to include IASTCodeScope - constructs, clients should keep this in mind and update their implementations. - -2003-09-04 Andrew Niefer - Fix bug42541 - Anonymous structures cause NPE in full parse - -2003-09-03 Andrew Niefer - fix bug in PST that prevents > 2 constructors - -2003-09-03 John Camelon - Fixed bug41445 - QualifiedLookup succeeds where it should fail. - -2003-09-02 Andrew Niefer - bug41935 - Modifications to PST to allow for namespace aliases - -2003-08-28 John Camelon - Fixed bug39535 - Parser fails on namesapce aliases - -2003-08-26 Bogdan Gheorghe - Added parser constant to all debugLog tracing statements. - -2003-08-25 John Camelon - Fixed bug39526 - Parser doesn't handle initializers correctly. - Fixed bug41520 - FullParse : Constructor Initializer is mistaken as function prototype - -2003-08-25 John Camelon - Fixed Bug 39530 - More problems with initializers. - Fixed Bug 37424 - Crash when opening big files - Refactored pointerOperators & cvQualifiers to not throw backtracks in optional case. - Added tracing support to cdt.core plugin via .options file. - -2003-08-14 John Camelon - Removed warnings from SymbolTable & QuickParseCallback (removing implicit accessor generation). - Made IASTElaboratedTypeSpecifier derive from IASTOffsetableNamedElement (as it should). - -2003-08-14 John Camelon - Added X-Reference support for ArrayModifiers and Exception Specifications. - Fixed Bug 41551 - HandleInclusion always throws ScannerException on local includes. - -2003-08-13 John Camelon - Added constructor expression support for variables. - Added constructor chain x-reference support for methods. - -2003-08-13 John Camelon - Added Expression x-reference support into Parser. - -2003-08-12 John Camelon - Added X-Ref/Elaborated type support w/element requestor callbacks. - -2003-08-11 John Camelon - Added Complete Parse support for ASM Definitions. - Added isVolatile() to abstract declarations. - Added Complte Parse support for elaborated types / forward declaration of classes. - Fixed some robustness issues. - -2003-08-05 Andrew Niefer - - Refactor symbol table functions to start with lower case letters - - Added better constructor support : - IDerivableContainerSymbol.addConstructor - IDerivableContainerSymbol.lookupConstructor - IDerivableContainerSymbol.getConstructors - - Changed ParserSymbolTableException.r_Unspecified to r_InternalError - - implicit user-defined conversion sequences now only use constructors not marked explicit - - user-defined conversion sequences are now only applied at most once (12.3-4 in spec) - -2003-07-31 Andrew Niefer - Added better support to the parser symbol table for forward declarations - -2003-07-31 Victor Mozgin - Fixed PR 39540 : Parser fails on const qualifier after class specifier. - -2003-07-30 Victor Mozgin - Fixed PR 39532 : Parser fails on fully-qualified class names. - -2003-07-29 John Camelon - Updated AST to better represent pointers to functions/methods. - Implemented typedef declaration/x-ref infrastructure. - -2003-07-29 Victor Mozgin - Fixed PR 39546 : Parser fails on 'signed' casts. - -2003-07-28 John Camelon - Fixed Bug 40842 - Parser: NPE while parsing class declaration in full parse mode - Fixed Bug 40843 - Parser: failParse doesn't set parsePassed = false on EOF. - Fixed Miscellaneous overrides issues involving parameters & functions. - -2003-07-28 John Camelon - Fixed Bug 40730 : Parser is not searching the include path for #include"" - -2003-07-28 Victor Mozgin - Fixed PR 39537 : Parser fails if template parameters contain '>' or '<' characters. - -2003-07-25 Victor Mozgin - Fixed PR 39553 : Macros are not expanded in #include statements. - -2003-07-24 John Camelon - Added COMPLETE_PARSE support for Method and Field declarations and cross-references. - Fixed some small ParserSymbolTable bugs. - Added support for linkage specification under COMPLETE_PARSE. - -2003-07-24 John Camelon - Added CompleteParse - UsingDirective & UsingDeclarations w/namespace/class/field variable references. - Added CompleteParse support for enumeration specifiers and references in variables & fields. - Stubbed out other Scopes/Declarations for COMPLETE_PARSE mode to allow indexer team to switch over ASAP. - -2003-07-22 John Camelon - Added in preliminary support for Field/Variable w/cross references on their types. - -2003-07-21 John Camelon - Addded in support for BaseSpecifier & class/namespace reference callbacks upon those. - -2003-07-21 John Camelon - Fleshed out basic declarations for FullParse AST. - Fixed Bug 40554 - Fields coming back as Vars - Fixed Bug 40555 - Methods come back as Functions - -2003-07-18 John Camelon - Added ISourceElementCallbackDelegate interface for AST constructs to allow the Parser to delegate callback's to the nodes themselves. - Got rid of ParserMode.STRUCTURAL_PARSE for the time being. - Removed org.eclipse.cdt.internal.core.parser.ast.full. - Created org.eclipse.cdt.internal.core.parser.ast.complete. - Updated ParserFactory.createScanner() to force the user to provide a callback and a ParserMode. - Introduced ASTSemanticException for COMPLETE_PARSE mode. - Fleshed out preliminary IASTReference interfaces and added callbacks to ISourceElementRequestor. - Removed acceptElaboratedTypeSpecifier() from ISourceElementRequestor. - -2003-07-18 John Camelon - Removed DeclaratorDuple as it was obsolete. - Fixed offsets in quickParse's IASTTypedefDeclaration implementation. - Fixed Bug 40436 - Fully Qualified Names Needed (for Indexer/Search features) - -2003-07-17 John Camelon - Removed IParserCallback. - Partially converted DOM to ISourceElementRequestor (requires refactoring of CModelBuilder & StuctureComparator modules in near future). - Completely finished ISourceElementRequestor/IASTFactory work for QuickParse mode. - Added pointer to methods/functions into AST callback structure. - Restructured AST class hierarchy. - Removed the old IParserCallback return Objects from every Parser method. - -2003-07-17 Victor Mozgin - Added support for digraphs and trigraphs. - Added support for hex floating point literals. - Fixed stack overflow problem with string literals concatenation. - Fixed problem with token pasting in macros. - This solves PR 39523, 39550, 39552. - -2003-07-15 Victor Mozgin - Fixed PR 39349 : Scanner fails on long long literals. - Fixed PR 39544 : Scanner fails on wide char literals. - -2003-07-10 John Camelon - Added in template support to IAST hierarchy. - Updated instantiation & specialization hierarchy. - Removed ASTTemplateDeclarationType. - Added full requestor callbacks for fields, variables, functions, methods & typedefs. - -2003-07-08 John Camelon - Filled out IASTMethod & IASTFunction & added implementations. - Updated IScanner, clients & implementations to use IScannerInfo. - Finished SimpleDeclaration porting to new architecture, only thing left is templates. - -2003-07-07 John Camelon - Bug 39652 - AST: Nested Classes incorrectly report null qualified Names - Fuller specification of Field/Method interfaces. - -2003-07-04 John Camelon - Fixed NPE in Parser::declarator(). - Bug 39652 - AST: Nested Classes incorrectly report null qualified Names - -2003-07-04 Victor Mozgin - Added CTaskTagsReconciler. - Extended ParserFactory with createProblemReporter() and createTranslationResult(). - -2003-07-02 Victor Mozgin - Fixed PR 39501 : Parser problems with throw clauses. - -2003-06-30 John Camelon - Further restructuring of Parser for ISourceElementRequestor. - Added interfaces/implementation for Simple Declarations. - Cleaned up DOM's representation of Constructor chains. - -2003-06-28 John Camelon - Completed Quickparse expression representation. - Updated ExpressionEvaluation and associated tests. - -2003-06-26 John Camelon - Update IASTExpression. - Move Parser.Backtrack and Parser.EndOfFile to external interface. - -2003-06-26 Victor Mozgin - Task tags support in C/C++ comments (initial revision). - Infrastructure to support problem reporting during translation. - Additional infrastructure for options/preferences handling. - -2003-06-25 John Camelon - Fixed bug39348 - sizeof elaborated types fail in parsing expression - -2003-06-25 John Camelon - Create new interface and support for calculating lineNumber/offset mapping. - Updated IASTClassSpecifier for qualified name query. - Began structuring expressions and declarators in Parser for ISourceElementRequestor. - Updated other packages to use new interfaces. - -2003-06-24 John Camelon - Updates for ISourceElementRequestor - elaborated types & enumerations. - -2003-06-23 John Camelon - Updating SimpleDeclarations to move towards new Callback structure. - -2003-06-23 John Camelon - Updated Factory infrastructure, constructors, etc. - Introduced Preprocessor class for transitive closure calc. client. - -2003-06-20 Victor Mozgin - Fixed PR 36463 : Offsets of macros are incorrect. - -2003-06-17 Victor Mozgin - Implemented correct handling of nested declarators in CModelBuilder. - Added proper support for function pointers as parameters. - This fixes PR 38921 and 39002. - -2003-06-16 Victor Mozgin - Implemented support for old K&R-style C function declarations. - Added oldKRParametersBegin() and oldKRParametersEnd() to IParserCallback. - Added getParameterTypes() with support of K&R to CModelBuilder. - Fixed ExpressionEvaluator and NullSourceElementRequestor for additions to IParserCallback. - Added handling of K&R syntax to the parser. - This fixes PR 7541, 35320 and 38434. - -2003-06-14 Victor Mozgin - Fixed handling of parameter lists for typedefs for functions. - More errorhandling in CModelBuilder. - Added handling of pointers to members. - Added handling of declarations for nested scopes (like A::B::C). - This fixes PR 36290, 36931 and partially 38920. - -2003-06-13 John Camelon - Added Class/Base infrastructure to public interfaces & requestor callback. - Moved many internal interfaces to external packages. - Organized imports. - -2003-06-13 Victor Mozgin - Renamed NullParserCallback into NullSourceElementRequester. - NullSourceElementRequester now dummy-implements both IParserCallback and ISourceElementRequester. - -2003-06-13 John Camelon - Merged ParserSymbolTable branch back into HEAD. - -2003-06-12 John Camelon - Get rest of JUnit tests working, will merge back to HEAD branch. - -2003-06-12 John Camelon - Introduction of ASTFactory strategy, some restructuring of packages and interfaces. - -2003-06-10 John Camelon - Futher pursuit of the golden hammer, symbol table integration. - -2003-06-09 John Camelon - First step in replacing IParserCallback with ISourceElementRequestor. - -2003-06-05 Andrew Niefer - Begin implementation of functions for template specializations: deduceTemplateArgument, - classTemplateSpecializationToFunctionTemplate, transformFunctionTemplateForOrdering - -2003-06-09 Victor Mozgin - Fixed for conversion operator declarations. - This fixes PR 36769 (finally) and PR 38657. - -2003-06-09 Victor Mozgin - Fixed Bug 36932 - RTS: Parser fails on "new" in ctor initializer - Improved handling of new-expressions: placements, arrays and - multiple parameters in initializers are now parsed. - -2003-06-09 Victor Mozgin - Fixed Bug 36701 - Scanner looses non-token chars while macro stringizing - -2003-06-07 Victor Mozgin - Fixes for templated constructor/destructor/operator declarations. - This fixed PR 36766, 36767, 36769 (STL parsing problems). - -2003-06-06 Victor Mozgin - Fixed Bug 38065 - Scanner skipped backslashes inside the code - -2003-06-05 John Camelon - Fix Bug 38380 "Include" class public methods fails JUnit tests - -2003-05-29 Andrew Niefer - new Class eType for stronger type safety in TypeInfo - new class PtrOp for better handling of pointer operators and cv qualifiers - new class TemplateInstance to support templates - Start of implementation for templates & specializations - -2003-05-29 John Camelon - Remove all AST components. - -2003-05-26 John Camelon - Rollback PST/Parser integration. - -2003-05-13 Andrew Niefer - Moved symbol table to org.eclipse.cdt.internal.core.pst - Created interface for symbol table: ISymbol, IContainerSymbol, IDerivableContainerSymbol, - IParameterizedSymbol, and ISpecializedSymbol. These are all implemented by Declaration - The symbol table itself uses this interface instead of using its Declaration directly - (with the exception of the undo command framework) - -2003-05-08 Andrew Niefer - Added a basic command structure to support rollbacks - -2003-05-06 John Camelon - Further integration of SymbolTable into Parser, some refactoring. - -2003-05-05 John Camelon/Andrew Niefer - Added Symboltable infrastructure into main parser. - -2003-05-05 Andrew Niefer - Structural changes to ParserSymbolTable: - - moved TypeInfo & Declaration inside ParserSymbolTable - - removed the stack & push/pop/peek - - moved nonstatic add/lookup fuctions from the table to Declaration - - began undo framework: added AddDeclarationCommand - -2003-05-01 Andrew Niefer - Fixed Bug 36287 - Parser failure with new CDT 1.1 parser - Fixed Bug 37011 - Scanner: #define A "//" not properly handled - -2003-04-30 John Camelon - Added some Javadoc to IParser.java and Parser.java. - -2003-04-28 John Camelon - Fixed Bug 37019 - RTS: Parser fails on variable defn using constructor - Fixed Bug 36767 - STL Testing: Parser is confused and goes into template function body - -2003-04-28 John Camelon - Partial fix for Bug37002 - Order of Offsetables is wrong - -2003-04-27 John Camelon - Partial fix for Bug 36932 - RTS: Parser fails on "new" in ctor initializer - Fixed Bug 36704 - Problem parsing Loki's Reference Typelist.h - Fixed Bug 36699 - Problem parsing Loki's Reference SmartPtr.h Impl - Fixed Bug 36691 - Problem parsing Loki's Reference HierarchyGenerators.h Impl - -2003-04-25 Andrew Niefer - Fixed bug36771 - Outline view shows include with no name - Fixed bug36714 - Parser fails on initial assignment using floating-suffix - Revisted bug36816 - Incomplete #include stops outline view - -2003-04-25 John Camelon - Fixed bug36852 - outline window doesn't show all functions - Fixed bug36764 - Bit fields cause parse errors - Fixed bug36702 - Parser error when having function pointers as parameters - -2003-04-24 John Camelon - Fixed Bug36799 STL Testing: Parser fails on Variable Definition - -2003-04-24 John Camelon - Fixed bug36693 - Problem parsing Loki's Reference SmallObj.cpp Impl - Fixed bug36696 - Problem parsing Loki's Reference SmartPtr.h Impl - Improved our error handling robustness. - Fixed bug36713 - Parser fails on definitions of pointers to functions - Fixed Dave's performance test parse failure. - Fixed bug36811 - The using directive causes parser to fail - Fixed bug36794 - ClassCastException for A template with no parameters - -2003-04-24 Andrew Niefer - Fixed Bug36816 Scanner infinite loop on incomplete #include - Fixed Bug36255 Parser hangs/goes infinite - -2003-04-21 John Camelon - Revisited bug36247 Parser confused by symbols #defined elsewhere - Fixed Bug36708 Problem parsing Loki's Reference TypeTraits.h - Fixed Bug36690 Problem parsing Loki's Reference Functor.h Implementation - Fixed Bug36692 Problem parsing Loki's Reference Singleton.h Impl - Fixed Bug36703 Problem parsing Loki's Reference TypeInfo.h Impl - Fixed Bug36689 Problem parsing Loki's Reference AbstractFactory.h Implementation - Fixed Bug36707 Problem parsing Loki's Reference TypeManip.h - -2003-04-21 Andrew Niefer - Fixed Bug36475 - Scanner does not concatenate strings - Fixed Bug36509 - Scanner turns strings into identifiers when expanding macros - Fixed Bug36521 - Scanner gets confused over commas in function like macros - Fixed Bug36695 - Scanner looses escaping on chars (ie '\4' to '4') - -2003-04-20 John Camelon - Fixed Bug36551 Bad parse on attached file. - Partial Fix for Bug36631 remove linear search algorithm from OffsetMapping - Some debunking of line numbers. - -2003-04-17 John Camelon - Fixed error in Elaborated Enumeration Types. - Fixed Bug36559 - Parsing Templates... - Fixed Bug36634 - Enum start line error - -2003-04-16 John Camelon - Fixed Bug36532 - Hang on partial template definition. - Fixed Bug36432 - Trying to open attached source code hangs Eclipse. - Fixed Bug36594 - Parser Stack Overflow on unaryExpression - Fixed Bug36600 - Elaborated Enumerated Types Parse Incorrectly. - -2003-04-15 John Camelon - Fixed bug36434 - Broken outline in winbase.h - Partial Fix for bug36379 - The parser to set Line informations when scanning. - Fixed CModelManager to include header files with .H extension as C++ headers. - Fixed bug36448 - Parser fails for C programs containing C++ keywords as identifiers - -2003-04-15 Andrew Niefer - Added scanner support to fix Bug36047 - -2003-04-13 John Camelon - Minor cleanup of callbacks due to removal of NewModelBuilder. - Added parser support to partially fix bug36416 & bug36294. Also added minimal C-Model support for these fixes. - -2003-04-11 John Camelon - Minimized the number of objects being returned from Parser callbacks. - Fixed CModelBuilder to handle errors better. - Reorganized the DOM Hierarchy to ensure that nodes were added to the tree on End() callbacks. - Fixed defect 36247(). - -2003-04-11 John Camelon - Fixed Bug 36243 DomBuilder Offsetable List - -2003-04-10 John Camelon - Fixed Bug36237 Parser fails on casts in ctor initializer. - Added AccessSpecifier to TemplateDeclaration. - -2003-04-10 John Camelon - Updated callbacks and parser to add offset information to template declarations, - thus making TemplateDeclaration implement IOffsetable. - -2003-04-09 John Camelon - Removed all the old Code Model Builder source that was no longer being used (NewModelBuilder.java, etc.). - Moved all the files in parser.util directory to the dom. - Organized imports. - Fixed bug36250 Parser ignores functions with default parameters that have no name. - Fixed bug36240 Parser incorrectly parses operator= - Fixed bug36254 Parser doesn't recognize unsigned as a type by itself. - -2003-04-09 John Camelon - Added timing printout for CModelTests. - Provided partial fix for bug36255 to get past infinite loop, will leave defect open. - Fixed bug36045 (Again). - Fixed bug36287. - -2003-04-06 Andrew Niefer - Added ParserSymbolTable::Cost and used it to fix up the conversion sequence ranking - -2003-04-06 John Camelon - Fixed defect 36073. - Fixed error handling for unterminated strings in Scanner. - Significantly updated callback structure to better suite the nature of the Code Model. - Updated all callbacks and parser to accommodate altered callbacks. - -2003-04-04 John Camelon - Fixed defect 35939. Proper CElement::pos() is set on Simple Declarations, - Class Specifications, Namespaces, Enumerations and Enumerators, Macros and Inclusions. - -2003-04-03 John Camelon - Fixed defects 36019, 36020, 36045. - Finished template declarations and their callbacks for the DOM (not the Code Model). - -2003-04-01 John Camelon - Updated Scanner to convert control-characters to ' '. - Fixed logic error in SimpleDeclarationWrapper. - Added operator support to grammar. - Fixed Name.toString() to support non-qualified yet multi-part names. - -2003-04-01 Andrew Niefer - Parser Symbol Table, modified lookup with respect to resolving ambiguous names, - reducing the number of temporary lists/sets. Modified adding using declarations - to properly support overloaded functions. Added initial support for user defined - conversion sequences when resolving overloaded functions. - -2003-04-01 John Camelon - Fixed bug35906 - Udated Scanner to not puke on certain control characters. - -2003-03-31 John Camelon - Fixed unsigned short SimpleDeclarations not showing up in the outline view. - Fixed default visibilities for structs in outline view. - Fixed bug35892. - Added icon-less typedefs and enums to the outline view. - Fixed NPEs relating to anonymous structs, unions, enums in outline view. - -2003-03-31 Andrew Niefer - Parser Symbol Table, better support for function resolution with pointers and - references as parameters. Also support for typedefs as function parameters - -2003-03-31 John Camelon - Updated NewModelBuilder to work for ElaboratedTypeSpecifiers, PointerOperators, Const Methods. - Fixed bug35878. - -2003-03-31 John Camelon - Updated Scanner to work for Strings literals like L"this string" - Updated Scanner to work for floating points literals. - Updated Scanner to be more forgiving on errors in QuickScan mode. - Got template instantiation and specialization working (w/callbacks and DOM). - Updated Parser/Callbacks for handle pure virtual function declarations. - Added callback support for some template declarations (not all branches). - -2003-03-28 John Camelon - Added AccessSpecifier and ClassKind to parser.util package and refactored callbacks. - Better encapsulated ExceptionSpecification in the DOM. - Updated DOM structures to return unmodifiable collections. - Added callback support for asmdefinitions. - Added callback support for constructor initializer chains. - Fixed bug 35781 and updated parser to catch all exceptions from callbacks to ensure best-effort parsing. - Removed Main.java from Parser package. - -2003-03-26 Andrew Niefer - Moved type information and ParameterInfo from Declaration into util.TypeInfo - Initial implementation of standard conversion sequences for function resolution - -2003-03-24 John Camelon - Added callback support for namespace definitions. - Updated Parser exception hierarchy. - Added callback support for linkage specifications. - Added callback support for using declarations and directives. - -2003-03-23 John Camelon - Added callback support for class member visibility. - Added callback support for pointer and reference operators on declarators. - Added callback support for throws clauses an const operations. - Added callback support for array declarators. - -2003-03-20 Andrew Niefer - Parser Symbol Table updates for: - * friends - * "this" pointer - * enumerators - * Argument dependent lookup - * adding parameters to functions & function overloading - -2003-03-19 John Camelon - Updated Parser method visibility to solidify external interface. - Solved and removed TODO's from Scanner implementation. - Updated Parser and callbacks to handle basic expressions. - -2003-03-18 John Camelon - Updated IParserCallback (and implementations) to add a typeName to DeclSpecifier. - Updated IParserCallback and NewModelBuilder to distinguish between Function declarations and definitions. - -2003-03-17 Doug Schaefer - Changed EOF to be a Backtrack exception instead of a token so simplify - error handling. - -2003-03-13 John Camelon - Moved ## token to IScanner from Scanner. - Updated IParserCallback and implementations to deal with Elaborated Type Specifiers. - Moved IScope into the internal DOM package. - -2003-03-11 John Camelon - added ChangeLog to parser directory - updated IParserCallback (and all implementors) for expressions - removed inheritance relationship between ExpressionEvaluator and NullParserCallback - removed redundant assignmentOperator() calls in Parser::initDeclarator - removed class util.DeclarationSpecifier, merged Container interface into util.DeclSpecifier - organized imports on the parser folder - * dom/org/eclipse/cdt/internal/core/dom/DOMBuilder.java - * dom/org/eclipse/cdt/internal/core/dom/Declarator.java - * dom/org/eclipse/cdt/internal/core/dom/ParameterDeclaration.java - * dom/org/eclipse/cdt/internal/core/dom/SimpleDeclaration.java - * parser/org/eclipse/cdt/internal/core/model/NewModelBuilder.java - * parser/org/eclipse/cdt/internal/core/model/Parameter.java - * parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java - * parser/org/eclipse/cdt/internal/core/parser/ExpressionEvaluator.java - * parser/org/eclipse/cdt/internal/core/parser/IParserCallback.java - * parser/org/eclipse/cdt/internal/core/parser/NullParserCallback.java - * parser/org/eclipse/cdt/internal/core/parser/Parser.java - * parser/org/eclipse/cdt/internal/core/parser/util/DeclSpecifier.java - -2003-03-10 John Camelon - added in support for detecting and reporting circular inclusions - added optimization by caching inclusion directories - added macro pasting capabilities - updated inclusion searching algorithm for local inclusions - -2003-03-07 John Camelon - fixed initDeclarators for the outline view. - -2003-03-06 Doug Schaefer - Some minor fixes to get constructors/destructors parsing as well as some minor clean up and robustness. - -2003-03-06 John Camelon - added quickParse heuristic to Scanner for handling #if conditionals to avoid throwing - ScannerExceptions on undefined preprocessor symbols - added minimal enum support to Parser (though not to DOM or CModel) - -2003-03-06 Andrew Niefer - Implementation of Namespaces & using directives in new parser's symbol table - -2003-03-05 Doug Schaefer - Some minor fixes to the parser. - -2003-03-04 Doug Schaefer - Added Parser in the "parser" source folder in cdt.core - Preference in the C/C++ preference page to enable/disable use of the new parser (disabled by default) - Start on the DOM which we are using to test the parser (source folder "dom") - Start on a new Model Builder for creating CElements using the new parser (currently in source folder "parser") diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/BacktrackException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/BacktrackException.java deleted file mode 100644 index 766edb3b0ec..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/BacktrackException.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public class BacktrackException extends Exception -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultLogService.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultLogService.java deleted file mode 100644 index b109f067c6b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultLogService.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public class DefaultLogService implements IParserLogService -{ - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParserLogService#traceLog(java.lang.String) - */ - public void traceLog(String message) - { - // do nothing - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParserLogService#errorLog(java.lang.String) - */ - public void errorLog(String message) - { - // do nothing - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultProblemHandler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultProblemHandler.java deleted file mode 100644 index 0c8065cddc4..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/DefaultProblemHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - - -/** - * @author jcamelon - * - */ -public class DefaultProblemHandler -{ - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblemHandler#ruleOnProblem(org.eclipse.cdt.core.parser.IProblem) - */ - public static boolean ruleOnProblem( IProblem p, ParserMode mode ) - { - if( p == null ) return true; - if( p.checkCategory( IProblem.SCANNER_RELATED ) || p.checkCategory( IProblem.PREPROCESSOR_RELATED )) - { - switch( p.getID() ) - { - case IProblem.PREPROCESSOR_INVALID_DIRECTIVE: - return false; - case IProblem.PREPROCESSOR_POUND_ERROR: - case IProblem.PREPROCESSOR_UNBALANCE_CONDITION: - case IProblem.PREPROCESSOR_INVALID_MACRO_DEFN: - case IProblem.PREPROCESSOR_MACRO_USAGE_ERROR: - case IProblem.PREPROCESSOR_MACRO_PASTING_ERROR: - case IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR: - case IProblem.SCANNER_UNEXPECTED_EOF: - case IProblem.PREPROCESSOR_INVALID_MACRO_REDEFN: - if( mode == ParserMode.COMPLETE_PARSE ) - return false; - default: - return true; - } - } - return true; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/EndOfFileException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/EndOfFileException.java deleted file mode 100644 index 91faf911f9b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/EndOfFileException.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public class EndOfFileException extends Exception -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Enum.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Enum.java deleted file mode 100644 index a4302365dca..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Enum.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public class Enum -{ - protected Enum( int enumValue ) - { - this.enumValue = enumValue; - } - - private final int enumValue; - /** - * @return - */ - public int getEnumValue() - { - return enumValue; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ILineOffsetReconciler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ILineOffsetReconciler.java deleted file mode 100644 index dece7606121..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ILineOffsetReconciler.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public interface ILineOffsetReconciler -{ - public int getLineNumberForOffset( int offset ); - public IOffsetDuple getOffsetRangeForLineNumber( int LineNumber ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java deleted file mode 100644 index bb677002fab..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IMacroDescriptor.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.cdt.core.parser; -import java.util.List; -/** - * @author jcamelon - * - * To change this generated comment edit the template variable -"typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public interface IMacroDescriptor { - void initialize(String name, List identifiers, List tokens, String sig); - List getParameters(); - List getTokenizedExpansion(); - String getName(); - String getSignature(); - boolean compatible(IMacroDescriptor descriptor); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IOffsetDuple.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IOffsetDuple.java deleted file mode 100644 index a50d88b24fd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IOffsetDuple.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public interface IOffsetDuple -{ - public int getCeilingOffset(); - public int getFloorOffset(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParser.java deleted file mode 100644 index b547010ed45..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParser.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; - - - -/** - * This is the external interface that all C and C++ parsers in the CDT - * must implement. - * - * @author jcamelon - */ -public interface IParser { - - - /** - * Request a parse from a pre-configured parser to parse a whole translation unit or file. - * - * @return whether or not the parse was successful - */ - public boolean parse(); - - /** - * @param offset offset in the input file where code completion is being requested for - * @return an IASTCompletionConstruct that provides a mechanism for determining C/C++ code completion contributions - */ - public IASTCompletionNode parse( int offset )throws ParserNotImplementedException; - - /** - * - * @param startingOffset - * @param endingOffset - * @return - */ - public IASTNode parse( int startingOffset, int endingOffset ) throws ParserNotImplementedException; - - - /** - * Request a parse from a pre-configured parser to parse an expression. - * - * @param expression Optional parameter representing an expression object that - * your particular IParserCallback instance would appreciate - * - * @throws BacktrackException thrown if the Scanner/Stream provided does not yield a valid - * expression - */ - public IASTExpression expression(IASTScope scope) throws BacktrackException, EndOfFileException; - - /** - * If an error was encountered, give us the offset of the token that caused the error. - * - * @return -1 for no error, otherwise the character offset where we encountered - * our first unrecoverable error. - */ - public int getLastErrorOffset(); - - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParserLogService.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParserLogService.java deleted file mode 100644 index 1da817e2e25..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IParserLogService.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public interface IParserLogService -{ - - public void traceLog( String message ); - public void errorLog( String message ); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IPreprocessor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IPreprocessor.java deleted file mode 100644 index 9a023f51ddb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IPreprocessor.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - - -/** - * @author jcamelon - * - */ -public interface IPreprocessor extends IScanner { - - public void process(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java deleted file mode 100644 index f2cfa11ae44..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java +++ /dev/null @@ -1,349 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.core.parser; - -import java.util.Map; - -/** - * Description of a C/C++ problem, as detected by the translation or some of the underlying - * technology reusing it. - * A problem provides access to: - *

            - *
          • its location (originating source file name, source position, line number),
          • - *
          • its message description and a predicate to check its severity (warning or error).
          • - *
          • its ID : an number identifying the very nature of this problem. All possible IDs are listed - * as constants on this interface.
          • - *
          - */ -public interface IProblem -{ - - /** - * Returns the problem id - * - * @return the problem id - */ - int getID(); - - /** - * Answer a localized, human-readable message string which describes the problem. - * - * @return a localized, human-readable message string which describes the problem - */ - String getMessage(); - - /** - * Return to the client a map between parameter names and values. - * - * The keys and values are all Strings. - * - * - * @return a map between parameter names and values. - */ - Map getArguments(); - - /** - * Answer the file name in which the problem was found. - * - * @return the file name in which the problem was found - */ - char[] getOriginatingFileName(); - - /** - * Answer the end position of the problem (inclusive), or -1 if unknown. - * - * @return the end position of the problem (inclusive), or -1 if unknown - */ - int getSourceEnd(); - - /** - * Answer the line number in source where the problem begins. - * - * @return the line number in source where the problem begins, or -1 if unknown - */ - int getSourceLineNumber(); - - /** - * Answer the start position of the problem (inclusive), or -1 if unknown. - * - * @return the start position of the problem (inclusive), or -1 if unknown - */ - int getSourceStart(); - - /** - * Checks the severity to see if the Error bit is set. - * - * @return true if the Error bit is set for the severity, false otherwise - */ - boolean isError(); - - /** - * Checks the severity to see if the Warning bit is not set. - * - * @return true if the Warning bit is not set for the severity, false otherwise - */ - boolean isWarning(); - - /** - * Unknown Numeric Value for line numbers and offsets; use this constant - */ - public final static int INT_VALUE_NOT_PROVIDED = -1; - - /** - * Unknown filename sentinel value - */ - public final static String FILENAME_NOT_PROVIDED = ""; - - /** - * Problem Categories - * The high bits of a problem ID contains information about the category of a problem. - * For example, (problemID & TypeRelated) != 0, indicates that this problem is type related. - * - * A problem category can help to implement custom problem filters. Indeed, when numerous problems - * are listed, focusing on import related problems first might be relevant. - * - * When a problem is tagged as Internal, it means that no change other than a local source code change - * can fix the corresponding problem. - */ - - /** - * IProblem relates to a valid error on the Scanner - */ - public final static int SCANNER_RELATED = 0x01000000; - - /** - * IProblem relates to a valid error on the preprocessor - */ - public final static int PREPROCESSOR_RELATED = 0x02000000; - - /** - * IProblem relates to a valid syntax error in the parser - */ - public final static int SYNTAX_RELATED = 0x04000000; - - /** - * IProblem relates to a valid semantical error in the parser - */ - public final static int SEMANTICS_RELATED = 0x08000000; - - /** - * IProblem relates to an implementation of design limitation - */ - public final static int INTERNAL_RELATED = 0x10000000; - - - /** - * Check the parameter bitmask against an IProblem's ID to broadly segregate the - * types of problems. - * - * @param bitmask - * @return true if ( (id & bitmask ) != 0 ) - */ - public boolean checkCategory(int bitmask); - - /** - * Mask to use in order to filter out the category portion of the problem ID. - */ - public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF; - - /** - * Below are listed all available problem attributes. The JavaDoc for each problem ID indicates - * when they should be contributed to creating a problem of that type. - */ - - // Preprocessor IProblem attributes - /** - * The text that follows a #error preprocessor directive - */ - public final static String A_PREPROC_POUND_ERROR = "#error text"; - - /** - * The filename that failed somehow in an preprocessor include directive - */ - public final static String A_PREPROC_INCLUDE_FILENAME = "include file"; - - /** - * A preprocessor macro name - */ - public final static String A_PREPROC_MACRO_NAME = "macro name"; - - /** - * A preprocessor conditional that could not be evaluated - * - * #if X + Y == Z <== that one, if X, Y or Z are not defined - * #endif - */ - public final static String A_PREPROC_CONDITION = "preprocessor condition"; - - /** - * A preprocessor directive that could not be interpretted - * - * e.g. #blah - */ - public final static String A_PREPROC_UNKNOWN_DIRECTIVE = "bad preprocessor directive"; - - /** - * The preprocessor conditional statement that caused an unbalanced mismatch. - * - * #if X - * #else - * #else <=== that one - * #endif - */ - public final static String A_PREPROC_CONDITIONAL_MISMATCH = "conditional mismatch"; - - /** - * The Bad character encountered in scanner - */ - public static final String A_SCANNER_BADCHAR = null; - - /** - * Below are listed all available problem IDs. Note that this list could be augmented in the future, - * as new features are added to the C/C++ core implementation. - */ - - /* - * Scanner Problems - */ - - /** - * Bad character encountered by Scanner. - * Required attributes: A_SCANNER_BADCHAR - * @see #A_SCANNER_BADCHAR - */ - public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001; - - /** - * Unbounded literal string encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002; - - /** - * Invalid escape sequence encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003; - - /** - * Bad floating point encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004; - - /** - * Bad hexidecimal encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005; - - /** - * Unexpected EOF encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006; - - /* - * Preprocessor Problems - */ - - /** - * #error encountered by Preprocessor. - * Required attributes: A_PREPROC_POUND_ERROR - * @see #A_PREPROC_POUND_ERROR - */ - public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001; - - /** - * Inclusion not found by Preprocessor. - * Required attributes: A_PREPROC_INCLUDE_FILENAME - * @see #A_PREPROC_INCLUDE_FILENAME - */ - public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002; - - /** - * Macro definition not found by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_DEFINITION_NOT_FOUND = PREPROCESSOR_RELATED | 0x003; - - /** - * Preprocessor conditionals seem unbalanced. - * Required attributes: A_PREPROC_CONDITIONAL_MISMATCH - * @see #A_PREPROC_CONDITIONAL_MISMATCH - */ - - public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004; - - /** - * Invalid format to Macro definition. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_INVALID_MACRO_DEFN = PREPROCESSOR_RELATED | 0x005; - - /** - * Invalid or unknown preprocessor directive encountered by Preprocessor. - * Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE - * @see #A_PREPROC_UNKNOWN_DIRECTIVE - */ - public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006; - - /** - * Invalid macro redefinition encountered by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007; - - /** - * Preprocessor Conditional cannot not be evaluated due. - * Required attributes: A_PREPROC_CONDITION - * @see #A_PREPROC_CONDITION - */ - public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008; - - /** - * Invalid macro usage encountered by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009; - - /** - * Invalid Macro Pasting encountered by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A; - - /** - * Circular inclusion encountered by Preprocessor. - * Required attributes: A_PREPROC_INCLUDE_FILENAME - * @see #A_PREPROC_INCLUDE_FILENAME - */ - public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B; - - /* - * Parser Syntactic Problems - */ - - /* - * Parser Semantic Problems - */ - - /** - * ID reserved for referencing an internal error inside the CCorePlugin implementation which - * may be surfaced as a problem associated with the translation unit which caused it to occur. - */ - public final static int UNCLASSIFIED_ERROR = 0; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java deleted file mode 100644 index 4e222f931c8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IQuickParseCallback.java +++ /dev/null @@ -1,28 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -/** - * @author jcamelon - * - */ -public interface IQuickParseCallback extends ISourceElementRequestor -{ - public abstract Iterator getInclusions(); - public abstract Iterator getMacros(); - /** - * @return - */ - public abstract IASTCompilationUnit getCompilationUnit(); - public abstract Iterator iterateOffsetableElements(); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScanner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScanner.java deleted file mode 100644 index 422eb9455b5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScanner.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cdt.core.parser; - -import org.eclipse.cdt.core.parser.ast.IASTFactory; - -/** - * @author jcamelon - * - */ -public interface IScanner { - - public static final int tPOUNDPOUND = -6; - public static final int tPOUND = -7; - - public void setOffsetBoundary( int offset ); - - public void setASTFactory( IASTFactory f ); - public void addDefinition(String key, IMacroDescriptor macroToBeAdded ); - public void addDefinition(String key, String value); - public Object getDefinition(String key); - - public String[] getIncludePaths(); - public void addIncludePath(String includePath); - public void overwriteIncludePath( String [] newIncludePaths ); - - public IToken nextToken() throws ScannerException, EndOfFileException, OffsetLimitReachedException; - public IToken nextToken( boolean next ) throws ScannerException, EndOfFileException, OffsetLimitReachedException; - - public int getCount(); - public int getDepth(); - - public IToken nextTokenForStringizing() throws ScannerException, EndOfFileException, OffsetLimitReachedException; - public void setTokenizingMacroReplacementList(boolean b); - public void setThrowExceptionOnBadCharacterRead( boolean throwOnBad ); - - /** - * @param i - * @return - */ - public int getLineNumberForOffset(int i); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfo.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfo.java deleted file mode 100644 index f6eba0db89c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.core.parser; - -import java.util.Map; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -public interface IScannerInfo { - /** - * Answers a Map containing all the defined preprocessor - * symbols and their values as string tuples, (symbol_name, symbol_value). - * Symbols defined without values have an empty string for a value. For - * example,-Dsymbol=value would have a map entry (symbol,value). A symbol - * defined as -Dsymbol would have a map entry of (symbol,""). - * - * If there are no defined symbols, the receiver will return - * an empty Map, never null. - * - * @return - */ - public Map getDefinedSymbols(); - - /** - * Answers a String array containing the union of all the - * built-in include search paths followed by the user-defined include - * search paths. - * - * If there are no paths defined, the receiver will return an empty - * array, never null - * - * @return - */ - public String[] getIncludePaths(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementCallbackDelegate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementCallbackDelegate.java deleted file mode 100644 index b6e2c82705d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementCallbackDelegate.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public interface ISourceElementCallbackDelegate -{ - public void acceptElement( ISourceElementRequestor requestor ); - public void enterScope( ISourceElementRequestor requestor ); - public void exitScope( ISourceElementRequestor requestor ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java deleted file mode 100644 index 068437a4770..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ISourceElementRequestor.java +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; - -/** - * @author jcamelon - * - */ -public interface ISourceElementRequestor { - - public boolean acceptProblem( IProblem problem ); - - public void acceptMacro( IASTMacro macro ); - public void acceptVariable( IASTVariable variable ); - public void acceptFunctionDeclaration( IASTFunction function ); - public void acceptUsingDirective( IASTUsingDirective usageDirective ); - public void acceptUsingDeclaration( IASTUsingDeclaration usageDeclaration ); - public void acceptASMDefinition( IASTASMDefinition asmDefinition ); - public void acceptTypedefDeclaration( IASTTypedefDeclaration typedef ); - public void acceptEnumerationSpecifier( IASTEnumerationSpecifier enumeration ); - public void acceptElaboratedForewardDeclaration( IASTElaboratedTypeSpecifier elaboratedType ); - public void acceptAbstractTypeSpecDeclaration( IASTAbstractTypeSpecifierDeclaration abstractDeclaration ); - - public void enterFunctionBody( IASTFunction function ); - public void exitFunctionBody( IASTFunction function ); - - public void enterCodeBlock( IASTCodeScope scope ); - public void exitCodeBlock( IASTCodeScope scope ); - - public void enterCompilationUnit( IASTCompilationUnit compilationUnit ); - public void enterInclusion( IASTInclusion inclusion ); - public void enterNamespaceDefinition( IASTNamespaceDefinition namespaceDefinition ); - public void enterClassSpecifier( IASTClassSpecifier classSpecification ); - public void enterLinkageSpecification( IASTLinkageSpecification linkageSpec ); - - public void enterTemplateDeclaration( IASTTemplateDeclaration declaration ); - public void enterTemplateSpecialization( IASTTemplateSpecialization specialization ); - public void enterTemplateInstantiation( IASTTemplateInstantiation instantiation ); - - public void acceptMethodDeclaration( IASTMethod method ); - public void enterMethodBody( IASTMethod method ); - public void exitMethodBody( IASTMethod method ); - public void acceptField( IASTField field ); - - public void acceptClassReference( IASTClassReference reference ); - public void acceptTypedefReference( IASTTypedefReference reference ); - public void acceptNamespaceReference( IASTNamespaceReference reference ); - public void acceptEnumerationReference( IASTEnumerationReference reference ); - public void acceptVariableReference( IASTVariableReference reference ); - public void acceptFunctionReference( IASTFunctionReference reference ); - public void acceptFieldReference( IASTFieldReference reference ); - public void acceptMethodReference( IASTMethodReference reference ); - public void acceptEnumeratorReference( IASTEnumeratorReference reference ); - public void acceptParameterReference(IASTParameterReference reference); - - public void exitTemplateDeclaration( IASTTemplateDeclaration declaration ); - public void exitTemplateSpecialization( IASTTemplateSpecialization specialization ); - public void exitTemplateExplicitInstantiation( IASTTemplateInstantiation instantiation ); - - public void exitLinkageSpecification( IASTLinkageSpecification linkageSpec ); - public void exitClassSpecifier( IASTClassSpecifier classSpecification ); - public void exitNamespaceDefinition( IASTNamespaceDefinition namespaceDefinition ); - public void exitInclusion( IASTInclusion inclusion ); - public void exitCompilationUnit( IASTCompilationUnit compilationUnit ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java deleted file mode 100644 index e907913afff..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java +++ /dev/null @@ -1,306 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - - -/** - * @author jcamelon - * - */ -public interface IToken { - public abstract String toString(); - public abstract int getType(); - public abstract String getImage(); - public void setImage( String i ); - public abstract int getOffset(); - public abstract int getLength(); - public abstract int getEndOffset(); - public abstract int getDelta(IToken other); - public abstract IToken getNext(); - public abstract void setNext(IToken t); - public abstract void setType(int i); - public abstract boolean looksLikeExpression(); - public abstract boolean isPointer(); - public abstract boolean isOperator(); - // Token types - static public final int tIDENTIFIER = 1; - - static public final int tINTEGER = 2; - - static public final int tCOLONCOLON = 3; - - static public final int tCOLON = 4; - - static public final int tSEMI = 5; - - static public final int tCOMMA = 6; - - static public final int tQUESTION = 7; - - static public final int tLPAREN = 8; - - static public final int tRPAREN = 9; - - static public final int tLBRACKET = 10; - - static public final int tRBRACKET = 11; - - static public final int tLBRACE = 12; - - static public final int tRBRACE = 13; - - static public final int tPLUSASSIGN = 14; - - static public final int tINCR = 15; - - static public final int tPLUS = 16; - - static public final int tMINUSASSIGN = 17; - - static public final int tDECR = 18; - - static public final int tARROWSTAR = 19; - - static public final int tARROW = 20; - - static public final int tMINUS = 21; - - static public final int tSTARASSIGN = 22; - - static public final int tSTAR = 23; - - static public final int tMODASSIGN = 24; - - static public final int tMOD = 25; - - static public final int tXORASSIGN = 26; - - static public final int tXOR = 27; - - static public final int tAMPERASSIGN = 28; - - static public final int tAND = 29; - - static public final int tAMPER = 30; - - static public final int tBITORASSIGN = 31; - - static public final int tOR = 32; - - static public final int tBITOR = 33; - - static public final int tCOMPL = 34; - - static public final int tNOTEQUAL = 35; - - static public final int tNOT = 36; - - static public final int tEQUAL = 37; - - static public final int tASSIGN = 38; - - static public final int tSHIFTL = 40; - - static public final int tLTEQUAL = 41; - - static public final int tLT = 42; - - static public final int tSHIFTRASSIGN = 43; - - static public final int tSHIFTR = 44; - - static public final int tGTEQUAL = 45; - - static public final int tGT = 46; - - static public final int tSHIFTLASSIGN = 47; - - static public final int tELLIPSIS = 48; - - static public final int tDOTSTAR = 49; - - static public final int tDOT = 50; - - static public final int tDIVASSIGN = 51; - - static public final int tDIV = 52; - - static public final int tCLASSNAME = 53; - - static public final int t_and = 54; - - static public final int t_and_eq = 55; - - static public final int t_asm = 56; - - static public final int t_auto = 57; - - static public final int t_bitand = 58; - - static public final int t_bitor = 59; - - static public final int t_bool = 60; - - static public final int t_break = 61; - - static public final int t_case = 62; - - static public final int t_catch = 63; - - static public final int t_char = 64; - - static public final int t_class = 65; - - static public final int t_compl = 66; - - static public final int t_const = 67; - - static public final int t_const_cast = 69; - - static public final int t_continue = 70; - - static public final int t_default = 71; - - static public final int t_delete = 72; - - static public final int t_do = 73; - - static public final int t_double = 74; - - static public final int t_dynamic_cast = 75; - - static public final int t_else = 76; - - static public final int t_enum = 77; - - static public final int t_explicit = 78; - - static public final int t_export = 79; - - static public final int t_extern = 80; - - static public final int t_false = 81; - - static public final int t_float = 82; - - static public final int t_for = 83; - - static public final int t_friend = 84; - - static public final int t_goto = 85; - - static public final int t_if = 86; - - static public final int t_inline = 87; - - static public final int t_int = 88; - - static public final int t_long = 89; - - static public final int t_mutable = 90; - - static public final int t_namespace = 91; - - static public final int t_new = 92; - - static public final int t_not = 93; - - static public final int t_not_eq = 94; - - static public final int t_operator = 95; - - static public final int t_or = 96; - - static public final int t_or_eq = 97; - - static public final int t_private = 98; - - static public final int t_protected = 99; - - static public final int t_public = 100; - - static public final int t_register = 101; - - static public final int t_reinterpret_cast = 102; - - static public final int t_return = 103; - - static public final int t_short = 104; - - static public final int t_sizeof = 105; - - static public final int t_static = 106; - - static public final int t_static_cast = 107; - - static public final int t_signed = 108; - - static public final int t_struct = 109; - - static public final int t_switch = 110; - - static public final int t_template = 111; - - static public final int t_this = 112; - - static public final int t_throw = 113; - - static public final int t_true = 114; - - static public final int t_try = 115; - - static public final int t_typedef = 116; - - static public final int t_typeid = 117; - - static public final int t_typename = 118; - - static public final int t_union = 119; - - static public final int t_unsigned = 120; - - static public final int t_using = 121; - - static public final int t_virtual = 122; - - static public final int t_void = 123; - - static public final int t_volatile = 124; - - static public final int t_wchar_t = 125; - - static public final int t_while = 126; - - static public final int t_xor = 127; - - static public final int t_xor_eq = 128; - - static public final int tFLOATINGPT = 129; - - static public final int tSTRING = 130; - - static public final int tLSTRING = 131; - - static public final int tCHAR = 132; - - static public final int tLCHAR = 133; - - static public final int t__Bool = 134; - - static public final int t__Complex = 135; - - static public final int t__Imaginary = 136; - - static public final int t_restrict = 137; - - static public final int tLAST = t_restrict; - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ITokenDuple.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ITokenDuple.java deleted file mode 100644 index e77af7c4200..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ITokenDuple.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -import java.util.Iterator; - - -/** - * @author jcamelon - */ -public interface ITokenDuple { - /** - * @return - */ - public abstract IToken getFirstToken(); - /** - * @return - */ - public abstract IToken getLastToken(); - public abstract Iterator iterator(); - public abstract String toString(); - public abstract boolean isIdentifier(); - public abstract int length(); - - public abstract ITokenDuple getSubrange( int startIndex, int endIndex ); - public IToken getToken(int index); - - public int findLastTokenType( int type ); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java deleted file mode 100644 index f5ebb89d15c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/Keywords.java +++ /dev/null @@ -1,97 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - */ -public class Keywords { - - public static final String _BOOL = "_Bool"; - public static final String _COMPLEX = "_Complex"; - public static final String _IMAGINARY = "_Imaginary"; - public static final String AND = "and"; - public static final String AND_EQ = "and_eq"; - public static final String ASM = "asm"; - public static final String AUTO = "auto"; - public static final String BITAND = "bitand"; - public static final String BITOR = "bitor"; - public static final String BOOL = "bool"; - public static final String BREAK = "break"; - public static final String CASE = "case"; - public static final String CATCH = "catch"; - public static final String CHAR = "char"; - public static final String CLASS = "class"; - public static final String COMPL = "compl"; - public static final String CONST = "const"; - public static final String CONST_CAST = "const_cast"; - public static final String CONTINUE = "continue"; - public static final String DEFAULT = "default"; - public static final String DELETE = "delete"; - public static final String DO = "do"; - public static final String DOUBLE = "double"; - public static final String DYNAMIC_CAST = "dynamic_cast"; - public static final String ELSE = "else"; - public static final String ENUM = "enum"; - public static final String EXPLICIT = "explicit"; - public static final String EXPORT = "export"; - public static final String EXTERN = "extern"; - public static final String FALSE = "false"; - public static final String FLOAT = "float"; - public static final String FOR = "for"; - public static final String FRIEND = "friend"; - public static final String GOTO = "goto"; - public static final String IF = "if"; - public static final String INLINE = "inline"; - public static final String INT = "int"; - public static final String LONG = "long"; - public static final String MUTABLE = "mutable"; - public static final String NAMESPACE = "namespace"; - public static final String NEW = "new"; - public static final String NOT = "not"; - public static final String NOT_EQ = "not_eq"; - public static final String OPERATOR = "operator"; - public static final String OR = "or"; - public static final String OR_EQ = "or_eq"; - public static final String PRIVATE = "private"; - public static final String PROTECTED = "protected"; - public static final String PUBLIC = "public"; - public static final String REGISTER = "register"; - public static final String REINTERPRET_CAST = "reinterpret_cast"; - public static final String RESTRICT = "restrict"; - public static final String RETURN = "return"; - public static final String SHORT = "short"; - public static final String SIGNED = "signed"; - public static final String SIZEOF = "sizeof"; - public static final String STATIC = "static"; - public static final String STATIC_CAST = "static_cast"; - public static final String STRUCT = "struct"; - public static final String SWITCH = "switch"; - public static final String TEMPLATE = "template"; - public static final String THIS = "this"; - public static final String THROW = "throw"; - public static final String TRUE = "true"; - public static final String TRY = "try"; - public static final String TYPEDEF = "typedef"; - public static final String TYPEID = "typeid"; - public static final String TYPENAME = "typename"; - public static final String UNION = "union"; - public static final String UNSIGNED = "unsigned"; - public static final String USING = "using"; - public static final String VIRTUAL = "virtual"; - public static final String VOID = "void"; - public static final String VOLATILE = "volatile"; - public static final String WCHAR_T = "wchar_t"; - public static final String WHILE = "while"; - public static final String XOR = "xor"; - public static final String XOR_EQ = "xor_eq"; - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java deleted file mode 100644 index 7cc60547d39..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java +++ /dev/null @@ -1,452 +0,0 @@ -package org.eclipse.cdt.core.parser; - -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; - - -public class NullSourceElementRequestor implements ISourceElementRequestor -{ - private ParserMode mode = ParserMode.COMPLETE_PARSE; - - public NullSourceElementRequestor() - { - } - - public NullSourceElementRequestor( ParserMode mode ) - { - this.mode = mode; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem) - */ - public boolean acceptProblem(IProblem problem) - { - return DefaultProblemHandler.ruleOnProblem( problem, mode ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro) - */ - public void acceptMacro(IASTMacro macro) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable) - */ - public void acceptVariable(IASTVariable variable) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void acceptFunctionDeclaration(IASTFunction function) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective) - */ - public void acceptUsingDirective(IASTUsingDirective usageDirective) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration) - */ - public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptASMDefinition(org.eclipse.cdt.core.parser.ast.IASTASMDefinition) - */ - public void acceptASMDefinition(IASTASMDefinition asmDefinition) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedef(org.eclipse.cdt.core.parser.ast.IASTTypedef) - */ - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier) - */ - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void enterFunctionBody(IASTFunction function) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void exitFunctionBody(IASTFunction function) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void enterClassSpecifier(IASTClassSpecifier classSpecification) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void enterTemplateSpecialization(IASTTemplateSpecialization specialization) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void acceptMethodDeclaration(IASTMethod method) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void enterMethodBody(IASTMethod method) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void exitMethodBody(IASTMethod method) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField) - */ - public void acceptField(IASTField field) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassReference) - */ - public void acceptClassReference(IASTClassReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void exitTemplateDeclaration(IASTTemplateDeclaration declaration) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void exitClassSpecifier(IASTClassSpecifier classSpecification) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion(IASTInclusion inclusion) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void exitCompilationUnit(IASTCompilationUnit compilationUnit) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration) - */ - public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) - { - // TODO Auto-generated method stub - - } - - - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference) - */ - public void acceptTypedefReference(IASTTypedefReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference) - */ - public void acceptNamespaceReference(IASTNamespaceReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumerationReference(IASTEnumerationReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference) - */ - public void acceptVariableReference(IASTVariableReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference) - */ - public void acceptFunctionReference(IASTFunctionReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference) - */ - public void acceptFieldReference(IASTFieldReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference) - */ - public void acceptMethodReference(IASTMethodReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier) - */ - public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void enterCodeBlock(IASTCodeScope scope) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void exitCodeBlock(IASTCodeScope scope) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumeratorReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumeratorReference(IASTEnumeratorReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference) - */ - public void acceptParameterReference(IASTParameterReference reference) - { - // TODO Auto-generated method stub - - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java deleted file mode 100644 index 3bd27e8dda9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - */ -public class OffsetLimitReachedException extends EndOfFileException { - - private final IToken finalToken; - - public OffsetLimitReachedException( IToken token ) - { - finalToken = token; - } - - /** - * @return Returns the finalToken. - */ - public IToken getFinalToken() { - return finalToken; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactory.java deleted file mode 100644 index 16be519ba62..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactory.java +++ /dev/null @@ -1,102 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -import java.io.Reader; - -import org.eclipse.cdt.core.parser.ast.IASTFactory; -import org.eclipse.cdt.internal.core.parser.CompleteParser; -import org.eclipse.cdt.internal.core.parser.ContextualParser; -import org.eclipse.cdt.internal.core.parser.LineOffsetReconciler; -import org.eclipse.cdt.internal.core.parser.Preprocessor; -import org.eclipse.cdt.internal.core.parser.QuickParseCallback; -import org.eclipse.cdt.internal.core.parser.QuickParser; -import org.eclipse.cdt.internal.core.parser.Scanner; -import org.eclipse.cdt.internal.core.parser.StructuralParser; -import org.eclipse.cdt.internal.core.parser.StructuralParseCallback; -import org.eclipse.cdt.internal.core.parser.ast.complete.CompleteParseASTFactory; -import org.eclipse.cdt.internal.core.parser.ast.quick.QuickParseASTFactory; - - -/** - * @author jcamelon - * - */ -public class ParserFactory { - - public static IASTFactory createASTFactory( ParserMode mode, ParserLanguage language ) - { - if( mode == ParserMode.QUICK_PARSE ) - return new QuickParseASTFactory(); - else - return new CompleteParseASTFactory( language ); - } - - public static IParser createParser( IScanner scanner, ISourceElementRequestor callback, ParserMode mode, ParserLanguage language, IParserLogService log ) throws ParserFactoryException - { - if( scanner == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_SCANNER ); - if( language == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_LANGUAGE ); - IParserLogService logService = ( log == null ) ? createDefaultLogService() : log; - ParserMode ourMode = ( (mode == null )? ParserMode.COMPLETE_PARSE : mode ); - ISourceElementRequestor ourCallback = (( callback == null) ? new NullSourceElementRequestor() : callback ); - if( ourMode == ParserMode.COMPLETE_PARSE) - return new CompleteParser( scanner, ourCallback, language, logService ); - else if( ourMode == ParserMode.STRUCTURAL_PARSE ) - return new StructuralParser( scanner, ourCallback, language, logService ); - else if( ourMode == ParserMode.CONTEXTUAL_PARSE ) - return new ContextualParser( scanner, ourCallback, language, logService ); - else - return new QuickParser( scanner, ourCallback, language, logService ); - } - - public static IScanner createScanner( Reader input, String fileName, IScannerInfo config, ParserMode mode, ParserLanguage language, ISourceElementRequestor requestor, IParserLogService log ) throws ParserFactoryException - { - if( input == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_READER ); - if( fileName == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_FILENAME ); - if( config == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_CONFIG ); - if( language == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_LANGUAGE ); - IParserLogService logService = ( log == null ) ? createDefaultLogService() : log; - ParserMode ourMode = ( (mode == null )? ParserMode.COMPLETE_PARSE : mode ); - ISourceElementRequestor ourRequestor = (( requestor == null) ? new NullSourceElementRequestor() : requestor ); - IScanner s = new Scanner( input, fileName, config, ourRequestor, ourMode, language, logService ); - return s; - } - - public static IPreprocessor createPreprocessor( Reader input, String fileName, IScannerInfo info, ParserMode mode, ParserLanguage language, ISourceElementRequestor requestor, IParserLogService logService ) - { - ParserMode ourMode = ( (mode == null )? ParserMode.COMPLETE_PARSE : mode ); - ISourceElementRequestor ourRequestor = (( requestor == null) ? new NullSourceElementRequestor() : requestor ); - IPreprocessor s = new Preprocessor( input, fileName, info, ourRequestor, ourMode, language, logService ); - return s; - } - - public static ILineOffsetReconciler createLineOffsetReconciler( Reader input ) - { - return new LineOffsetReconciler( input ); - } - - public static IQuickParseCallback createQuickParseCallback() - { - return new QuickParseCallback(); - } - - public static IQuickParseCallback createStructuralParseCallback() - { - return new StructuralParseCallback(); - } - - public static IParserLogService createDefaultLogService() - { - return defaultLogService; - } - - private static IParserLogService defaultLogService = new DefaultLogService(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactoryException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactoryException.java deleted file mode 100644 index f1c3a0d02bc..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactoryException.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public class ParserFactoryException extends Exception { - - public static class Kind extends Enum { - - public static final Kind NULL_READER = new Kind( 1 ); - public static final Kind NULL_FILENAME = new Kind( 2 ); - public static final Kind NULL_CONFIG = new Kind( 3 ); - public static final Kind NULL_LANGUAGE = new Kind( 4 ); - public static final Kind NULL_SCANNER = new Kind( 5 ); - - protected Kind( int arg ) - { - super( arg ); - } - } - - public ParserFactoryException( Kind e ) - { - kind = e; - } - - public Kind getKind() - { - return kind; - } - - private Kind kind; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserLanguage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserLanguage.java deleted file mode 100644 index c97f2f8c9d6..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserLanguage.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ - -package org.eclipse.cdt.core.parser; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ParserLanguage extends Enum { - public final static ParserLanguage C = new ParserLanguage( 1 ); - public final static ParserLanguage CPP = new ParserLanguage( 2 ); - - private ParserLanguage( int value ) - { - super( value ); - } - - /** - * @return - */ - public boolean isCPP() { - return ( this == CPP ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserMode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserMode.java deleted file mode 100644 index e2d9e320598..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserMode.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - * - */ -public class ParserMode extends Enum { - - // follow inclusions, parse function/method bodies - public static final ParserMode COMPLETE_PARSE = new ParserMode( 1 ); - - // follow inclusions, do not parse function/method bodies - public static final ParserMode STRUCTURAL_PARSE = new ParserMode( 2 ); - - // do not follow inclusions, do not parse function/method bodies - public static final ParserMode QUICK_PARSE = new ParserMode( 3 ); - - // follow inclusions, parse function/method bodies, stop at particular offset - public static final ParserMode CONTEXTUAL_PARSE = new ParserMode( 4 ); - - protected ParserMode( int value ) - { - super( value ); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserNotImplementedException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserNotImplementedException.java deleted file mode 100644 index 57dd85a6809..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserNotImplementedException.java +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - */ -public class ParserNotImplementedException extends Exception { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerException.java deleted file mode 100644 index d3e421ee7f6..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerException.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.core.parser; - - -public class ScannerException extends Exception { - - private final IProblem problem; - - public ScannerException( IProblem p ) - { - problem = p; - } - /** - * @return - */ - public IProblem getProblem() - { - return problem; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java deleted file mode 100644 index 2ddc7e69ebd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ScannerInfo.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -import java.util.Map; - -import org.eclipse.cdt.core.parser.IScannerInfo; - -/** - * @author jcamelon - * - */ -public class ScannerInfo implements IScannerInfo -{ - private Map definedSymbols = null; - private String [] includePaths = null; - - public ScannerInfo() - { - } - - public ScannerInfo( Map d, String [] incs ) - { - definedSymbols = d; - includePaths = incs; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols() - */ - public Map getDefinedSymbols() - { - return definedSymbols; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScannerInfo#getIncludePaths() - */ - public String[] getIncludePaths() - { - return includePaths; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/SyntaxErrorException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/SyntaxErrorException.java deleted file mode 100644 index 65f0cdae3fd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/SyntaxErrorException.java +++ /dev/null @@ -1,29 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -/** - * @author jcamelon - */ -public class SyntaxErrorException extends Exception { - - private final IProblem problem; - - public IProblem getProblem() - { - return problem; - } - - public SyntaxErrorException( IProblem problem ) - { - this.problem = problem; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java deleted file mode 100644 index 7329a5a144a..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTAccessVisibility.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public class ASTAccessVisibility extends Enum { - - public static final ASTAccessVisibility PUBLIC = new ASTAccessVisibility( 1 ); - public static final ASTAccessVisibility PROTECTED = new ASTAccessVisibility( 2 ); - public static final ASTAccessVisibility PRIVATE = new ASTAccessVisibility( 3 ); - - private ASTAccessVisibility( int constant) - { - super( constant ); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java deleted file mode 100644 index 3a7270fda48..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTClassKind.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public class ASTClassKind extends Enum { - - public final static ASTClassKind CLASS = new ASTClassKind( 1 ); - public final static ASTClassKind STRUCT = new ASTClassKind( 2 ); - public final static ASTClassKind UNION = new ASTClassKind( 3 ); - public final static ASTClassKind ENUM = new ASTClassKind( 4 ); - - private ASTClassKind( int value ) - { - super( value ); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTNotImplementedException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTNotImplementedException.java deleted file mode 100644 index e17b3bc3796..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTNotImplementedException.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public class ASTNotImplementedException extends Exception -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java deleted file mode 100644 index a141698d405..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTPointerOperator.java +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public class ASTPointerOperator extends Enum -{ - public static final ASTPointerOperator REFERENCE = new ASTPointerOperator( 0 ); - public static final ASTPointerOperator POINTER = new ASTPointerOperator( 1 ); - public static final ASTPointerOperator CONST_POINTER = new ASTPointerOperator( 2 ); - public static final ASTPointerOperator VOLATILE_POINTER = new ASTPointerOperator( 3 ); - public static final ASTPointerOperator RESTRICT_POINTER = new ASTPointerOperator( 4 ); - - /** - * @param enumValue - */ - protected ASTPointerOperator(int enumValue) - { - super(enumValue); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTSemanticException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTSemanticException.java deleted file mode 100644 index 431f0ead0d0..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ASTSemanticException.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.IProblem; - -/** - * @author jcamelon - * - */ -public class ASTSemanticException extends Exception -{ - private final IProblem theProblem; - - public ASTSemanticException() - { - theProblem = null; - } - - - /** - * - */ - public ASTSemanticException( IProblem reason ) - { - super(); - theProblem = reason; - } - - - /** - * @return - */ - public IProblem getProblem() - { - return theProblem; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ExpressionEvaluationException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ExpressionEvaluationException.java deleted file mode 100644 index 63731121201..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/ExpressionEvaluationException.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public class ExpressionEvaluationException extends Exception -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTASMDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTASMDefinition.java deleted file mode 100644 index 344cc5747c8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTASMDefinition.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTASMDefinition extends IASTOffsetableElement, IASTDeclaration { - - public String getBody(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java deleted file mode 100644 index fb8aa7168ee..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractDeclaration.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTAbstractDeclaration extends IASTTypeSpecifierOwner, ISourceElementCallbackDelegate -{ - public boolean isConst(); - public boolean isVolatile(); - public Iterator getPointerOperators(); - public Iterator getArrayModifiers(); - public Iterator getParameters(); - public ASTPointerOperator getPointerToFunctionOperator(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractTypeSpecifierDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractTypeSpecifierDeclaration.java deleted file mode 100644 index 23eb9fac48f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTAbstractTypeSpecifierDeclaration.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTAbstractTypeSpecifierDeclaration - extends IASTDeclaration, IASTTypeSpecifierOwner, IASTTemplatedDeclaration, IASTOffsetableElement -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTArrayModifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTArrayModifier.java deleted file mode 100644 index 3f4dd9edcce..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTArrayModifier.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - - -/** - * @author jcamelon - * - */ -public interface IASTArrayModifier extends ISourceElementCallbackDelegate -{ - public IASTExpression getExpression(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java deleted file mode 100644 index 1925f22e91e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTBaseSpecifier.java +++ /dev/null @@ -1,28 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - - -/** - * @author jcamelon - * - */ -public interface IASTBaseSpecifier extends ISourceElementCallbackDelegate { - - public ASTAccessVisibility getAccess(); - public boolean isVirtual(); - public String getParentClassName(); - public IASTClassSpecifier getParentClassSpecifier() throws ASTNotImplementedException; - public int getNameOffset(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassReference.java deleted file mode 100644 index 1c4e1d87a5e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassReference.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTClassReference extends IASTReference -{ - public boolean isResolved(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java deleted file mode 100644 index 82e91e270a2..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTClassSpecifier.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTClassSpecifier extends IASTScope, IASTOffsetableNamedElement, IASTScopedTypeSpecifier, ISourceElementCallbackDelegate { - - public class ClassNameType extends Enum { - - public static final ClassNameType IDENTIFIER = new ClassNameType( 1 ); - public static final ClassNameType TEMPLATE = new ClassNameType( 2 ); - - private ClassNameType( int t ) - { - super( t ); - } - } - - public ClassNameType getClassNameType(); - - public ASTClassKind getClassKind(); - - public Iterator getBaseClauses(); - - public ASTAccessVisibility getCurrentVisibilityMode(); - public void setCurrentVisibility( ASTAccessVisibility visibility ); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java deleted file mode 100644 index ceaa395ac1b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCodeScope.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Created on Sep 2, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IASTCodeScope extends IASTScope, ISourceElementCallbackDelegate{ - - public IASTCodeScope getOwnerCodeScope(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompilationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompilationUnit.java deleted file mode 100644 index 5a43160128b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompilationUnit.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTCompilationUnit extends IASTScope, ISourceElementCallbackDelegate { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompletionNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompletionNode.java deleted file mode 100644 index 4bc2c4c9514..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTCompletionNode.java +++ /dev/null @@ -1,116 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public interface IASTCompletionNode { - - public static class CompletionKind extends Enum - { - // x.[ ] x->[ ] - public static final CompletionKind MEMBER_REFERENCE = new CompletionKind( 0 ); - - // x::[ ] - public static final CompletionKind SCOPED_REFERENCE = new CompletionKind( 1 ); - - // class member declaration type reference - public static final CompletionKind FIELD_TYPE = new CompletionKind( 2 ); - - // stand-alone declaration type reference - public static final CompletionKind VARIABLE_TYPE = new CompletionKind( 3 ); - - // function/method argument type reference - public static final CompletionKind ARGUMENT_TYPE = new CompletionKind( 4 ); - - // inside code body - name reference - public static final CompletionKind SINGLE_NAME_REFERENCE = new CompletionKind( 5 ); - - // any place one can expect a type - public static final CompletionKind TYPE_REFERENCE = new CompletionKind( 6 ); - - // any place where one can expect a class name - public static final CompletionKind CLASS_REFERENCE = new CompletionKind( 7 ); - - // any place where a namespace name is expected - public static final CompletionKind NAMESPACE_REFERENCE = new CompletionKind( 8 ); - - // any place where an exception name is expected - public static final CompletionKind EXCEPTION_REFERENCE = new CompletionKind( 9 ); - - // any place where exclusively a preprocessor macro name would be expected - public static final CompletionKind MACRO_REFERENCE = new CompletionKind( 10 ); - - // any place where function arguments are expected - public static final CompletionKind FUNCTION_REFERENCE = new CompletionKind( 11 ); - - // any place where constructor arguments are expected - public static final CompletionKind CONSTRUCTOR_REFERENCE = new CompletionKind( 12 ); - - // any place where exclusively a keyword is expected - public static final CompletionKind KEYWORD = new CompletionKind( 13 ); - - // any place where exclusively a preprocessor directive is expected - public static final CompletionKind PREPROCESSOR_DIRECTIVE = new CompletionKind( 14 ); - - // any place where a type or variable name is expected to be introduced - public static final CompletionKind USER_SPECIFIED_NAME = new CompletionKind( 15 ); - - // the beginning of a statement - public static final CompletionKind STATEMENT_START = new CompletionKind( 16 ); - - // error condition -- a place in the grammar where there is nothing to lookup - public static final CompletionKind NO_SUCH_KIND = new CompletionKind( 200 ); - /** - * @param enumValue - */ - protected CompletionKind(int enumValue) { - super(enumValue); - } - - } - - - /** - * @return kind of completion expected - */ - public CompletionKind getCompletionKind(); - - /** - * @return the scope the code completion is within - * should never be null - */ - public IASTScope getCompletionScope(); - - /** - * @return the context (inter-statement) - * e.g. LHS of postfix expression a->b, a.b or qualified name a::b is 'a' - * this can be null - */ - public IASTNode getCompletionContext(); - - /** - * @return the prefix - */ - public String getCompletionPrefix(); - - /** - * @return iterator of string keywords - */ - public Iterator getKeywords(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java deleted file mode 100644 index 033694d66ef..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTConstructorMemberInitializer.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTConstructorMemberInitializer extends ISourceElementCallbackDelegate -{ - public IASTExpression getExpressionList(); - public String getName(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDeclaration.java deleted file mode 100644 index 5c678fe07d4..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDeclaration.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTDeclaration extends IASTScopedElement, ISourceElementCallbackDelegate { - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java deleted file mode 100644 index f10c5957aca..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTDesignator.java +++ /dev/null @@ -1,40 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public interface IASTDesignator -{ - public static class DesignatorKind extends Enum - { - public static final DesignatorKind FIELD = new DesignatorKind( 0 ); - public static final DesignatorKind SUBSCRIPT = new DesignatorKind( 1 ); - /** - * @param enumValue - */ - protected DesignatorKind(int enumValue) - { - super(enumValue); - // TODO Auto-generated constructor stub - } - } - - public DesignatorKind getKind(); - public IASTExpression arraySubscriptExpression(); - public String fieldName(); - public int fieldOffset(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java deleted file mode 100644 index f2345f80d59..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTElaboratedTypeSpecifier.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - - - -/** - * @author jcamelon - * - */ -public interface IASTElaboratedTypeSpecifier extends IASTTypeSpecifier, IASTOffsetableElement, IASTQualifiedNameElement, ISourceElementCallbackDelegate, IASTOffsetableNamedElement { - - public String getName(); - public ASTClassKind getClassKind(); - public boolean isResolved() throws ASTNotImplementedException; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationReference.java deleted file mode 100644 index ec66b2529dd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTEnumerationReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java deleted file mode 100644 index 8c8b13bea00..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerationSpecifier.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTEnumerationSpecifier extends ISourceElementCallbackDelegate, IASTScopedTypeSpecifier, IASTOffsetableNamedElement { - - public Iterator getEnumerators(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerator.java deleted file mode 100644 index 2aa6f8744a4..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumerator.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTEnumerator extends IASTOffsetableNamedElement, ISourceElementCallbackDelegate { - - public IASTEnumerationSpecifier getOwnerEnumerationSpecifier(); - public IASTExpression getInitialValue(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumeratorReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumeratorReference.java deleted file mode 100644 index 6b5d75f570d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTEnumeratorReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTEnumeratorReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExceptionSpecification.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExceptionSpecification.java deleted file mode 100644 index d00509cb06f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExceptionSpecification.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTExceptionSpecification extends ISourceElementCallbackDelegate -{ - public Iterator getTypeIds(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java deleted file mode 100644 index 3359d1c1532..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java +++ /dev/null @@ -1,146 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTExpression extends ISourceElementCallbackDelegate -{ - public class Kind extends Enum - { - public static final Kind PRIMARY_EMPTY = new Kind( -1 ); - public static final Kind PRIMARY_INTEGER_LITERAL = new Kind( 0 ); - public static final Kind PRIMARY_CHAR_LITERAL = new Kind( 1 ); - public static final Kind PRIMARY_FLOAT_LITERAL = new Kind( 2 ); - public static final Kind PRIMARY_STRING_LITERAL = new Kind( 3 ); - public static final Kind PRIMARY_BOOLEAN_LITERAL = new Kind( 4 ); - public static final Kind PRIMARY_THIS = new Kind( 5 ); - public static final Kind PRIMARY_BRACKETED_EXPRESSION = new Kind( 6 ); - public static final Kind ID_EXPRESSION = new Kind( 7 ); - public static final Kind POSTFIX_SUBSCRIPT = new Kind( 8 ); - public static final Kind POSTFIX_FUNCTIONCALL = new Kind( 9 ); - public static final Kind POSTFIX_SIMPLETYPE_INT = new Kind( 10 ); - public static final Kind POSTFIX_SIMPLETYPE_SHORT = new Kind( 11 ); - public static final Kind POSTFIX_SIMPLETYPE_DOUBLE = new Kind( 12 ); - public static final Kind POSTFIX_SIMPLETYPE_FLOAT = new Kind( 13 ); - public static final Kind POSTFIX_SIMPLETYPE_CHAR = new Kind( 14 ); - public static final Kind POSTFIX_SIMPLETYPE_WCHART = new Kind( 15 ); - public static final Kind POSTFIX_SIMPLETYPE_SIGNED = new Kind( 16 ); - public static final Kind POSTFIX_SIMPLETYPE_UNSIGNED = new Kind( 17 ); - public static final Kind POSTFIX_SIMPLETYPE_BOOL = new Kind( 18 ); - public static final Kind POSTFIX_SIMPLETYPE_LONG = new Kind( 19 ); - public static final Kind POSTFIX_TYPENAME_IDENTIFIER = new Kind( 20 ); - public static final Kind POSTFIX_TYPENAME_TEMPLATEID = new Kind( 21 ); - public static final Kind POSTFIX_DOT_IDEXPRESSION = new Kind( 22 ); - public static final Kind POSTFIX_ARROW_IDEXPRESSION = new Kind( 23 ); - public static final Kind POSTFIX_DOT_TEMPL_IDEXPRESS = new Kind( 24 ); - public static final Kind POSTFIX_ARROW_TEMPL_IDEXP = new Kind( 25 ); - public static final Kind POSTFIX_DOT_DESTRUCTOR = new Kind( 26 ); - public static final Kind POSTFIX_ARROW_DESTRUCTOR = new Kind( 27 ); - public static final Kind POSTFIX_INCREMENT = new Kind( 28 ); - public static final Kind POSTFIX_DECREMENT = new Kind( 29 ); - public static final Kind POSTFIX_DYNAMIC_CAST = new Kind( 30 ); - public static final Kind POSTFIX_REINTERPRET_CAST = new Kind( 31 ); - public static final Kind POSTFIX_STATIC_CAST = new Kind( 32 ); - public static final Kind POSTFIX_CONST_CAST = new Kind( 33 ); - public static final Kind POSTFIX_TYPEID_EXPRESSION = new Kind( 34 ); - public static final Kind POSTFIX_TYPEID_TYPEID = new Kind( 35 ); - public static final Kind UNARY_INCREMENT = new Kind( 36 ); - public static final Kind UNARY_DECREMENT = new Kind( 37 ); - public static final Kind UNARY_STAR_CASTEXPRESSION = new Kind( 38 ); - public static final Kind UNARY_AMPSND_CASTEXPRESSION = new Kind( 39 ); - public static final Kind UNARY_PLUS_CASTEXPRESSION = new Kind( 40 ); - public static final Kind UNARY_MINUS_CASTEXPRESSION = new Kind( 41 ); - public static final Kind UNARY_NOT_CASTEXPRESSION = new Kind( 42 ); - public static final Kind UNARY_TILDE_CASTEXPRESSION = new Kind( 43 ); - public static final Kind UNARY_SIZEOF_UNARYEXPRESSION = new Kind( 44 ); - public static final Kind UNARY_SIZEOF_TYPEID = new Kind( 45 ); - public static final Kind NEW_NEWTYPEID = new Kind( 46 ); - public static final Kind NEW_TYPEID = new Kind( 47 ); - public static final Kind DELETE_CASTEXPRESSION = new Kind( 48 ); - public static final Kind DELETE_VECTORCASTEXPRESSION = new Kind( 49 ); - public static final Kind CASTEXPRESSION = new Kind( 50 ); - public static final Kind PM_DOTSTAR = new Kind( 51 ); - public static final Kind PM_ARROWSTAR = new Kind( 52 ); - public static final Kind MULTIPLICATIVE_MULTIPLY = new Kind( 53 ); - public static final Kind MULTIPLICATIVE_DIVIDE = new Kind( 54 ); - public static final Kind MULTIPLICATIVE_MODULUS = new Kind( 55 ); - public static final Kind ADDITIVE_PLUS = new Kind( 56 ); - public static final Kind ADDITIVE_MINUS = new Kind( 57 ); - public static final Kind SHIFT_LEFT = new Kind( 58 ); - public static final Kind SHIFT_RIGHT = new Kind( 59 ); - public static final Kind RELATIONAL_LESSTHAN = new Kind( 60 ); - public static final Kind RELATIONAL_GREATERTHAN = new Kind( 61 ); - public static final Kind RELATIONAL_LESSTHANEQUALTO = new Kind( 62 ); - public static final Kind RELATIONAL_GREATERTHANEQUALTO= new Kind( 63 ); - public static final Kind EQUALITY_EQUALS = new Kind( 64 ); - public static final Kind EQUALITY_NOTEQUALS = new Kind( 65 ); - public static final Kind ANDEXPRESSION = new Kind( 66 ); - public static final Kind EXCLUSIVEOREXPRESSION = new Kind( 67 ); - public static final Kind INCLUSIVEOREXPRESSION = new Kind( 68 ); - public static final Kind LOGICALANDEXPRESSION = new Kind( 69 ); - public static final Kind LOGICALOREXPRESSION = new Kind( 70 ); - public static final Kind CONDITIONALEXPRESSION = new Kind( 71 ); - public static final Kind THROWEXPRESSION = new Kind( 72 ); - public static final Kind ASSIGNMENTEXPRESSION_NORMAL = new Kind( 73 ); - public static final Kind ASSIGNMENTEXPRESSION_PLUS = new Kind( 74 ); - public static final Kind ASSIGNMENTEXPRESSION_MINUS = new Kind( 75 ); - public static final Kind ASSIGNMENTEXPRESSION_MULT = new Kind( 76 ); - public static final Kind ASSIGNMENTEXPRESSION_DIV = new Kind( 77 ); - public static final Kind ASSIGNMENTEXPRESSION_MOD = new Kind( 78 ); - public static final Kind ASSIGNMENTEXPRESSION_LSHIFT = new Kind( 79 ); - public static final Kind ASSIGNMENTEXPRESSION_RSHIFT = new Kind( 80 ); - public static final Kind ASSIGNMENTEXPRESSION_AND = new Kind( 81 ); - public static final Kind ASSIGNMENTEXPRESSION_OR = new Kind( 82 ); - public static final Kind ASSIGNMENTEXPRESSION_XOR = new Kind( 83 ); - public static final Kind EXPRESSIONLIST = new Kind( 84 ); - - - /** - * @param enumValue - */ - private Kind(int enumValue) - { - super(enumValue); - } - - } - - public interface IASTNewExpressionDescriptor extends ISourceElementCallbackDelegate - { - public Iterator getNewPlacementExpressions(); - public Iterator getNewTypeIdExpressions(); - public Iterator getNewInitializerExpressions(); - } - - - - public Kind getExpressionKind(); - public IASTExpression getLHSExpression(); - public IASTExpression getRHSExpression(); - public IASTExpression getThirdExpression(); - public String getLiteralString(); - public String getIdExpression(); - public IASTTypeId getTypeId(); - public IASTNewExpressionDescriptor getNewExpressionDescriptor(); - - public int evaluateExpression() throws ExpressionEvaluationException; - public void reconcileReferences() throws ASTNotImplementedException; - public void purgeReferences() throws ASTNotImplementedException; - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java deleted file mode 100644 index d83f69d4422..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java +++ /dev/null @@ -1,243 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; -import java.util.List; - -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType; -import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor; -import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind; -/** - * @author jcamelon - * - */ -public interface IASTFactory -{ - public IASTMacro createMacro( - String name, - int startingOffset, - int nameOffset, - int nameEndOffset, int endingOffset); - - public IASTInclusion createInclusion( - String name, - String fileName, - boolean local, - int startingOffset, - int nameOffset, - int nameEndOffset, int endingOffset) ; - - public IASTUsingDirective createUsingDirective( - IASTScope scope, - ITokenDuple duple, int startingOffset, int endingOffset) - throws ASTSemanticException; - - public IASTUsingDeclaration createUsingDeclaration( - IASTScope scope, - boolean isTypeName, - ITokenDuple name, int startingOffset, int endingOffset) throws ASTSemanticException; - - public IASTASMDefinition createASMDefinition( - IASTScope scope, - String assembly, - int first, - int last); - - public IASTNamespaceDefinition createNamespaceDefinition( - IASTScope scope, - String identifier, - int startingOffset, - int nameOffset, int nameEndOffset) throws ASTSemanticException; - - public IASTNamespaceAlias createNamespaceAlias( - IASTScope scope, - String identifier, - ITokenDuple alias, - int startingOffset, - int nameOffset, - int nameEndOffset, int endOffset ) throws ASTSemanticException; - - public IASTCompilationUnit createCompilationUnit() ; - - public IASTLinkageSpecification createLinkageSpecification( - IASTScope scope, - String spec, int startingOffset) ; - - public IASTClassSpecifier createClassSpecifier( - IASTScope scope, - ITokenDuple name, - ASTClassKind kind, - ClassNameType type, - ASTAccessVisibility access, - int startingOffset, - int nameOffset, int nameEndOffset) throws ASTSemanticException; - - /** - * @param astClassSpec - * @param isVirtual - * @param visibility - * @param string - */ - public void addBaseSpecifier( - IASTClassSpecifier astClassSpec, - boolean isVirtual, - ASTAccessVisibility visibility, - ITokenDuple parentClassName) throws ASTSemanticException; - - public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier( - IASTScope scope, - ASTClassKind elaboratedClassKind, - ITokenDuple typeName, - int startingOffset, int endOffset, boolean isForewardDecl, boolean isFriend) throws ASTSemanticException; - - public IASTEnumerationSpecifier createEnumerationSpecifier( - IASTScope scope, - String name, - int startingOffset, int nameOffset, int nameEndOffset) throws ASTSemanticException; - - public void addEnumerator( - IASTEnumerationSpecifier enumeration, - String string, - int startingOffset, - int nameOffset, int nameEndOffset, int endingOffset, IASTExpression initialValue)throws ASTSemanticException; - - public IASTExpression createExpression( - IASTScope scope, - IASTExpression.Kind kind, - IASTExpression lhs, - IASTExpression rhs, - IASTExpression thirdExpression, - IASTTypeId typeId, - ITokenDuple idExpression, String literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException; - - public IASTExpression.IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions); - - public IASTInitializerClause createInitializerClause( - IASTScope scope, - IASTInitializerClause.Kind kind, - IASTExpression assignmentExpression, List initializerClauses, List designators) ; - - public IASTExceptionSpecification createExceptionSpecification(IASTScope scope, List typeIds) throws ASTSemanticException; - - /** - * @param exp - */ - public IASTArrayModifier createArrayModifier(IASTExpression exp); - - /** - * @param duple - * @param expressionList - * @return - */ - - public IASTConstructorMemberInitializer createConstructorMemberInitializer( - IASTScope scope, - ITokenDuple duple, IASTExpression expressionList) throws ASTSemanticException; - - public IASTSimpleTypeSpecifier createSimpleTypeSpecifier( - IASTScope scope, - IASTSimpleTypeSpecifier.Type kind, - ITokenDuple typeName, - boolean isShort, - boolean isLong, - boolean isSigned, - boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary) throws ASTSemanticException; - - public IASTFunction createFunction( - IASTScope scope, - ITokenDuple name, - List parameters, - IASTAbstractDeclaration returnType, - IASTExceptionSpecification exception, - boolean isInline, - boolean isFriend, - boolean isStatic, - int startOffset, - int nameOffset, - int nameEndOffset, - IASTTemplate ownerTemplate, - boolean isConst, - boolean isVolatile, - boolean isVirtual, - boolean isExplicit, - boolean isPureVirtual, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException; - - - public IASTAbstractDeclaration createAbstractDeclaration( - boolean isConst, - boolean isVolatile, - IASTTypeSpecifier typeSpecifier, - List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOperator); - - public IASTMethod createMethod( - IASTScope scope, - ITokenDuple name, - List parameters, - IASTAbstractDeclaration returnType, - IASTExceptionSpecification exception, - boolean isInline, - boolean isFriend, - boolean isStatic, - int startOffset, - int nameOffset, - int nameEndOffset, - IASTTemplate ownerTemplate, - boolean isConst, - boolean isVolatile, - boolean isVirtual, - boolean isExplicit, - boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments) throws ASTSemanticException; - - public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression ) throws ASTSemanticException; - - public IASTField createField( IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException; - - public IASTDesignator createDesignator( IASTDesignator.DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier ); - - public IASTParameterDeclaration createParameterDeclaration( boolean isConst, boolean isVolatile, IASTTypeSpecifier getTypeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset ) ; - - public IASTTemplateDeclaration createTemplateDeclaration( IASTScope scope, List templateParameters, boolean exported, int startingOffset ) ; - - public IASTTemplateParameter createTemplateParameter( IASTTemplateParameter.ParamKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms ) ; - - public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset); - - public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset); - - public IASTTypedefDeclaration createTypedef( IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, int nameEndOffset ) throws ASTSemanticException; - - public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset); - - public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion ) ; - - static final String DOUBLE_COLON = "::"; - static final String TELTA = "~"; - /** - * @param scope - * @return - */ - public IASTCodeScope createNewCodeBlock(IASTScope scope); - - public IASTTypeId createTypeId( IASTScope scope, IASTSimpleTypeSpecifier.Type kind, boolean isConst, boolean isVolatile, boolean isShort, - boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods ) throws ASTSemanticException; - /** - * @param astClassSpecifier - */ - public void signalEndOfClassSpecifier(IASTClassSpecifier astClassSpecifier); - - /** - * @param kind - * @param firstExpression - */ - public IASTNode getCompletionContext(Kind kind, IASTExpression expression); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTField.java deleted file mode 100644 index 261d82f82f6..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTField.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTField extends IASTVariable, IASTMember { - - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFieldReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFieldReference.java deleted file mode 100644 index fe09826c7d4..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFieldReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTFieldReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java deleted file mode 100644 index bd322cce2c1..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -/** - * @author jcamelon - * - */ -public interface IASTFunction extends IASTCodeScope, IASTOffsetableNamedElement, IASTTemplatedDeclaration, IASTDeclaration, IASTQualifiedNameElement { - - public boolean isInline(); - public boolean isFriend(); - public boolean isStatic(); - - public boolean takesVarArgs(); - - public String getName(); - - public IASTAbstractDeclaration getReturnType(); - public Iterator getParameters(); - public IASTExceptionSpecification getExceptionSpec(); - /** - * @param b - */ - public void setHasFunctionBody(boolean b); - public boolean hasFunctionBody(); - - public void setHasFunctionTryBlock( boolean b ); - public boolean hasFunctionTryBlock(); - - public boolean previouslyDeclared(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunctionReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunctionReference.java deleted file mode 100644 index ee4334272d9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunctionReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTFunctionReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInclusion.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInclusion.java deleted file mode 100644 index 2368659919d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInclusion.java +++ /dev/null @@ -1,28 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - - -/** - * @author jcamelon - * - */ -public interface IASTInclusion extends IASTOffsetableNamedElement, ISourceElementCallbackDelegate { - - public String getName(); - - public String getFullFileName(); - - public boolean isLocal(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java deleted file mode 100644 index 826b99bfc40..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTInitializerClause.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - */ -public interface IASTInitializerClause extends ISourceElementCallbackDelegate{ - - public class Kind extends Enum - { - public static final Kind ASSIGNMENT_EXPRESSION = new Kind( 1 ); - public static final Kind INITIALIZER_LIST = new Kind( 2 ); - public static final Kind EMPTY = new Kind( 3 ); - public static final Kind DESIGNATED_INITIALIZER_LIST = new Kind( 4 ); - public static final Kind DESIGNATED_ASSIGNMENT_EXPRESSION = new Kind( 5 ); - - /** - * @param enumValue - */ - protected Kind(int enumValue) { - super(enumValue); - } - } - - public Kind getKind(); - public Iterator getInitializers(); - public IASTExpression getAssigmentExpression(); - public Iterator getDesignators(); - - public void setOwnerVariableDeclaration( IASTVariable declaration ); - public IASTVariable getOwnerVariableDeclaration(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTLinkageSpecification.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTLinkageSpecification.java deleted file mode 100644 index bebbb73577c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTLinkageSpecification.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTLinkageSpecification extends IASTScope, IASTDeclaration, IASTOffsetableElement { - - public String getLinkageString(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMacro.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMacro.java deleted file mode 100644 index 9b6a9818c6c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMacro.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTMacro extends IASTOffsetableNamedElement, ISourceElementCallbackDelegate { - - public String getName(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMember.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMember.java deleted file mode 100644 index c4599e73320..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMember.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTMember extends IASTDeclaration, IASTQualifiedNameElement -{ - public ASTAccessVisibility getVisiblity(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java deleted file mode 100644 index 6acc88dee8c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethod.java +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - - -/** - * @author jcamelon - * - */ -public interface IASTMethod extends IASTFunction, IASTMember { - - public boolean isVirtual(); - public boolean isExplicit(); - - public boolean isConstructor(); - public boolean isDestructor(); - - public boolean isConst(); - public boolean isVolatile(); - public boolean isPureVirtual(); - - public Iterator getConstructorChainInitializers(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethodReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethodReference.java deleted file mode 100644 index 6bca748fd46..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTMethodReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTMethodReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceAlias.java deleted file mode 100644 index 1d080a3e075..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceAlias.java +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTNamespaceAlias - extends ISourceElementCallbackDelegate, IASTDeclaration, IASTOffsetableNamedElement -{ - public String getAlias(); - public IASTNamespaceDefinition getNamespace() throws ASTNotImplementedException; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java deleted file mode 100644 index 06b43343168..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceDefinition.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTNamespaceDefinition extends IASTOffsetableNamedElement, IASTScope, IASTDeclaration, IASTQualifiedNameElement { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceReference.java deleted file mode 100644 index 9d1d0895933..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNamespaceReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTNamespaceReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNode.java deleted file mode 100644 index 308cf090d8c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTNode.java +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public interface IASTNode { - - public static class LookupKind extends Enum { - - public static final LookupKind ALL = new LookupKind( 0 ); - public static final LookupKind STRUCTURES = new LookupKind( 1 ); - public static final LookupKind STRUCS = new LookupKind( 2 ); - public static final LookupKind UNIONS = new LookupKind( 3 ); - public static final LookupKind CLASSES = new LookupKind( 4 ); - public static final LookupKind FUNCTIONS = new LookupKind( 5 ); - public static final LookupKind VARIABLES = new LookupKind( 6 ); - public static final LookupKind LOCAL_VARIABLES = new LookupKind( 7 ); - public static final LookupKind MEMBERS = new LookupKind( 8 ); - public static final LookupKind METHODS = new LookupKind( 9 ); - public static final LookupKind FIELDS = new LookupKind( 10 ); - public static final LookupKind CONSTRUCTORS = new LookupKind (11); - public static final LookupKind NAMESPACES = new LookupKind( 12 ); - public static final LookupKind MACROS = new LookupKind( 13 ); - public static final LookupKind ENUMERATIONS = new LookupKind( 14 ); - public static final LookupKind ENUMERATORS = new LookupKind( 15 ); - public static final LookupKind THIS = new LookupKind(16); - - /** - * @param enumValue - */ - protected LookupKind(int enumValue) { - super(enumValue); - // TODO Auto-generated constructor stub - } - } - - public static class LookupException extends Exception - { - } - - public static interface LookupResult - { - public String getPrefix(); - public Iterator getNodes(); - public int getResultsSize(); - } - - /** - * @param prefix - * @param kind - * @param context - * @return - * @throws LookupException - */ - public LookupResult lookup( String prefix, LookupKind[] kind, IASTNode context) throws LookupException; -} - diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableElement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableElement.java deleted file mode 100644 index 7d098aaea35..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableElement.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTOffsetableElement { - - public void setStartingOffset( int o ); - public void setEndingOffset( int o ); - - public int getStartingOffset(); - public int getEndingOffset(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableNamedElement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableNamedElement.java deleted file mode 100644 index 545e1327c8e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTOffsetableNamedElement.java +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTOffsetableNamedElement extends IASTOffsetableElement { - - public String getName(); - public int getNameOffset(); - public void setNameOffset( int o ); - public int getNameEndOffset(); - public void setNameEndOffset( int o ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterDeclaration.java deleted file mode 100644 index d91690303d4..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterDeclaration.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTParameterDeclaration extends IASTAbstractDeclaration, IASTOffsetableNamedElement -{ - public IASTInitializerClause getDefaultValue(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterReference.java deleted file mode 100644 index 64cf24936fb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTParameterReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTParameterReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTPointerOperatorOwner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTPointerOperatorOwner.java deleted file mode 100644 index aefe8bf6df5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTPointerOperatorOwner.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTPointerOperatorOwner -{ - public ASTPointerOperator getPointerOperator(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java deleted file mode 100644 index 0f79f068ae8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTQualifiedNameElement.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTQualifiedNameElement -{ - public String[] getFullyQualifiedName(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTReference.java deleted file mode 100644 index 7c358bdc49b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTReference.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author jcamelon - * - */ -public interface IASTReference extends ISourceElementCallbackDelegate -{ - - public int getOffset(); - public String getName(); - public ISourceElementCallbackDelegate getReferencedElement(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScope.java deleted file mode 100644 index 4ad41f1e805..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScope.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -/** - * @author jcamelon - * - */ -public interface IASTScope extends IASTNode{ - - public Iterator getDeclarations() throws ASTNotImplementedException; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedElement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedElement.java deleted file mode 100644 index eaca3003bf2..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedElement.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTScopedElement extends IASTNode -{ - IASTScope getOwnerScope(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedTypeSpecifier.java deleted file mode 100644 index 2245f3c48fb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTScopedTypeSpecifier.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTScopedTypeSpecifier extends IASTTypeSpecifier, IASTScopedElement, IASTQualifiedNameElement -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java deleted file mode 100644 index 2cb20933901..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTSimpleTypeSpecifier.java +++ /dev/null @@ -1,56 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public interface IASTSimpleTypeSpecifier extends IASTTypeSpecifier -{ - public static class Type extends Enum - { - public static final Type UNSPECIFIED = new Type( 1 ); - public static final Type CHAR = new Type( 1 ); - public static final Type WCHAR_T = new Type( 2 ); - public static final Type BOOL = new Type( 3 ); - public static final Type INT = new Type( 4 ); - public static final Type FLOAT = new Type( 5 ); - public static final Type DOUBLE = new Type( 6 ); - public static final Type VOID = new Type( 7 ); - public static final Type CLASS_OR_TYPENAME = new Type( 8 ); - public static final Type TEMPLATE = new Type( 9 ); - public static final Type _BOOL = new Type( 10 ); - /** - * @param enumValue - */ - protected Type(int enumValue) - { - super(enumValue); - } - - - } - - public Type getType(); - public String getTypename(); - public boolean isLong(); - public boolean isShort(); - public boolean isSigned(); - public boolean isUnsigned(); - public boolean isTypename(); - public boolean isComplex(); - public boolean isImaginary(); - - public IASTTypeSpecifier getTypeSpecifier() throws ASTNotImplementedException; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplate.java deleted file mode 100644 index cadd8731fc9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplate.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTemplate -{ - public IASTDeclaration getOwnedDeclaration(); - public void setOwnedDeclaration( IASTDeclaration declaration ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java deleted file mode 100644 index a54b5bf6cd9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateDeclaration.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTTemplateDeclaration extends IASTDeclaration, IASTTemplate, IASTTemplateParameterList, IASTOffsetableElement { - - public boolean isExported(); - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java deleted file mode 100644 index e6c30e943fe..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateInstantiation.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTemplateInstantiation extends IASTTemplate, IASTDeclaration, IASTOffsetableElement { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameter.java deleted file mode 100644 index 893356d2965..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameter.java +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public interface IASTTemplateParameter extends IASTTemplateParameterList { - - public class ParamKind extends Enum - { - public static final ParamKind CLASS = new ParamKind( 1 ); - public static final ParamKind TYPENAME = new ParamKind( 2 ); - public static final ParamKind TEMPLATE_LIST = new ParamKind( 3 ); - public static final ParamKind PARAMETER = new ParamKind( 4 ); - - /** - * @param enumValue - */ - protected ParamKind(int enumValue) - { - super(enumValue); - } - - } - - public ParamKind getTemplateParameterKind(); - public String getIdentifier(); - public String getDefaultValueIdExpression(); - public IASTParameterDeclaration getParameterDeclaration(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameterList.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameterList.java deleted file mode 100644 index b9a01938e80..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateParameterList.java +++ /dev/null @@ -1,22 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -/** - * @author jcamelon - * - */ -public interface IASTTemplateParameterList -{ - public Iterator getTemplateParameters(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java deleted file mode 100644 index 1c3f437f246..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplateSpecialization.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTemplateSpecialization extends IASTDeclaration, IASTTemplate, IASTOffsetableElement { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplatedDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplatedDeclaration.java deleted file mode 100644 index aa20a697b1b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTemplatedDeclaration.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTemplatedDeclaration { - - public IASTTemplate getOwnerTemplateDeclaration(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeId.java deleted file mode 100644 index 77ec5dd9560..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeId.java +++ /dev/null @@ -1,40 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public interface IASTTypeId extends ISourceElementCallbackDelegate -{ - public IASTSimpleTypeSpecifier.Type getKind(); - public String getTypeOrClassName(); - public Iterator getPointerOperators(); - public Iterator getArrayModifiers(); - - public boolean isConst(); - public boolean isVolatile(); - public boolean isLong(); - public boolean isShort(); - public boolean isSigned(); - public boolean isUnsigned(); - public boolean isTypename(); - - - public String getFullSignature() throws ASTNotImplementedException; - public ISymbol getTypeSymbol() throws ASTNotImplementedException; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java deleted file mode 100644 index 5b3aba2daa2..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifier.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTypeSpecifier extends IASTNode { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifierOwner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifierOwner.java deleted file mode 100644 index 491cd35260b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypeSpecifierOwner.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTypeSpecifierOwner -{ - public IASTTypeSpecifier getTypeSpecifier(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefDeclaration.java deleted file mode 100644 index 68d2e3582b1..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefDeclaration.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTTypedefDeclaration extends IASTDeclaration, IASTOffsetableNamedElement, IASTQualifiedNameElement { - - public String getName(); - public IASTAbstractDeclaration getAbstractDeclarator(); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefReference.java deleted file mode 100644 index a3d16848f14..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTTypedefReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTTypedefReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDeclaration.java deleted file mode 100644 index 1a168ed16f2..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDeclaration.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTUsingDeclaration extends IASTDeclaration, IASTOffsetableElement { - - public boolean isTypename(); - public String usingTypeName(); - public IASTDeclaration getUsingType() throws ASTNotImplementedException; - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDirective.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDirective.java deleted file mode 100644 index bb8f1ba5a2b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTUsingDirective.java +++ /dev/null @@ -1,21 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTUsingDirective extends IASTDeclaration, IASTOffsetableElement { - - public String getNamespaceName(); - public IASTNamespaceDefinition getNamespaceDefinition() throws ASTNotImplementedException; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java deleted file mode 100644 index 74a59c11381..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariable.java +++ /dev/null @@ -1,33 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public interface IASTVariable extends IASTDeclaration, IASTOffsetableNamedElement, IASTQualifiedNameElement { - - public boolean isAuto(); - public boolean isRegister(); - public boolean isStatic(); - public boolean isExtern(); - public boolean isMutable(); - - public IASTAbstractDeclaration getAbstractDeclaration(); - public String getName(); - public IASTInitializerClause getInitializerClause(); - - public boolean isBitfield(); - public IASTExpression getBitfieldExpression(); - public IASTExpression getConstructorExpression(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariableReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariableReference.java deleted file mode 100644 index bdb53f4fe36..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTVariableReference.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser.ast; - -/** - * @author jcamelon - * - */ -public interface IASTVariableReference extends IASTReference -{ -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BaseProblemFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BaseProblemFactory.java deleted file mode 100644 index 54f8e8c912f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BaseProblemFactory.java +++ /dev/null @@ -1,65 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Map; - -import org.eclipse.cdt.core.parser.IProblem; - - -/** - * @author jcamelon - */ -public abstract class BaseProblemFactory { - - protected final static String PROBLEM = "IProblem : "; - protected final static String IN_FILE = " in file: "; - protected final static String ON_LINE = " on line: "; - - public abstract String createMessage(int id, Map arguments, int lineNumber, char[] fileName ); - - public IProblem createProblem(int id, int start, int end, int line, char[] file, String message, Map arguments, boolean warn, boolean error) { - return new Problem( id, start, end, line, file, message, arguments, warn, error); - } - - public boolean checkBitmask( int id, int bitmask ) - { - return ( id & bitmask ) != 0; - } - - protected IProblem createInternalProblem( int id, int start, int end, int line, char [] file, Map arguments, boolean warn, boolean error ) - { - return createProblem( id, start, end, line, file, createInternalMessage( id, arguments, line, file), arguments, warn, error ); - } - - /** - * @param id - * @param arguments - * @param line - * @param file - * @return - */ - private String createInternalMessage(int id, Map arguments, int line, char[] file) - { - if( checkBitmask( id, IProblem.INTERNAL_RELATED )) - { - StringBuffer buffer = new StringBuffer(); - - switch( id ) - { - } - - return buffer.toString(); - } - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java deleted file mode 100644 index 1a49b4ef6c1..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/BranchTracker.java +++ /dev/null @@ -1,166 +0,0 @@ -package org.eclipse.cdt.internal.core.parser; - -import java.util.EmptyStackException; -import java.util.Stack; - -/** - * @author jcamelon - * - * To change this generated comment edit the template variable -"typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class BranchTracker { - - private static final int IGNORE_SENTINEL = -1; - - /** - * Default constructor. - * - * @see java.lang.Object#Object() - */ - public BranchTracker() - { - } - - private Stack branches = new Stack(); - - private int ignore = IGNORE_SENTINEL; - private static final Boolean FALSE = new Boolean( false ); - private static final Boolean TRUE = new Boolean( true ); - - /** - * Method poundif. - * - * This method is called whenever one encounters a #if, #ifndef - * or #ifdef preprocessor directive. - * - * @param taken - boolean indicates whether or not the condition - * evaluates to true or false - * @return boolean - are we set to continue scanning or not? - */ - public boolean poundif( boolean taken ) - { - if( ignore == IGNORE_SENTINEL ) - { - // we are entering an if - // push the taken value onto the stack - branches.push( new Boolean( taken ) ); - - if( taken == false ) - { - ignore = branches.size(); - } - - return taken; - } - else - { - branches.push( FALSE ); - return false; - } - } - - public boolean poundelif( boolean taken ) throws EmptyStackException - { - if( ignore != IGNORE_SENTINEL && ignore < branches.size() ) - { - branches.pop(); - branches.push( FALSE ); - return false; - } - - // so at this point we are either - // --> ignore == IGNORE_SENTINEL - // --> ignore >= branches.size() - // check the branch queue to see whether or not the branch has already been taken - Boolean branchAlreadyTaken; - branchAlreadyTaken = (Boolean) branches.peek(); - - if( ignore == IGNORE_SENTINEL ) - { - if( ! branchAlreadyTaken.booleanValue() ) - { - branches.pop(); - branches.push( new Boolean( taken ) ); - if( ! taken ) - ignore = branches.size(); - - return taken; - } - - // otherwise this section is to be ignored as well - ignore = branches.size(); - return false; - } - - // if we have gotten this far then ignore == branches.size() - if( ! branchAlreadyTaken.booleanValue() ) - { - branches.pop(); - branches.push( new Boolean( taken ) ); - if( taken ) - ignore = IGNORE_SENTINEL; - - return taken; - } - ignore = branches.size(); - return false; - } - - public boolean poundelse() throws EmptyStackException - { - if( ignore != IGNORE_SENTINEL && ignore < branches.size() ) - { - branches.pop(); - branches.push( FALSE ); - return false; - } - - Boolean branchAlreadyTaken; - branchAlreadyTaken = (Boolean) branches.peek(); - - if( ignore == IGNORE_SENTINEL ) - { - if( branchAlreadyTaken.booleanValue() ) - { - ignore = branches.size(); - return false; - } - - branches.pop(); - branches.push( TRUE ); - return true; - - } - - // now ignore >= branches.size() - if( branchAlreadyTaken.booleanValue() ) - { - ignore = branches.size(); - return false; - } - - branches.pop(); - branches.push( TRUE ); - ignore = IGNORE_SENTINEL; - return true; - - } - - // taken only on an #endif - public boolean poundendif( ) - { - if( ignore == branches.size() ) - ignore = IGNORE_SENTINEL; - branches.pop(); - return ( ignore == IGNORE_SENTINEL ); - } - - public int getDepth() - { - return branches.size(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CompleteParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CompleteParser.java deleted file mode 100644 index e618bee5b28..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/CompleteParser.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.parser.BacktrackException; -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - */ -public class CompleteParser extends Parser { - - /** - * @param scanner - * @param callback - * @param mode - * @param language - * @param log - */ - public CompleteParser(IScanner scanner, ISourceElementRequestor callback, ParserLanguage language, IParserLogService log) { - super(scanner, callback, language, log); - astFactory = ParserFactory.createASTFactory( ParserMode.COMPLETE_PARSE, language); - scanner.setASTFactory(astFactory); - } - - protected void handleFunctionBody(IASTScope scope, boolean isInlineFunction) throws BacktrackException, EndOfFileException - { - if ( isInlineFunction ) - skipOverCompoundStatement(); - else - functionBody(scope); - } - - protected void catchBlockCompoundStatement(IASTScope scope) throws BacktrackException, EndOfFileException - { - compoundStatement(scope, true); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int) - */ - public IASTCompletionNode parse(int offset) throws ParserNotImplementedException { - throw new ParserNotImplementedException(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int, int) - */ - public IASTNode parse(int startingOffset, int endingOffset) throws ParserNotImplementedException { - throw new ParserNotImplementedException(); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextException.java deleted file mode 100644 index 1fa5bbbeb5d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextException.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -/** - * @author jcamelon - * - */ -public class ContextException extends Exception -{ - private final int id; - - /** - * @param i - */ - public ContextException(int i) - { - id = i; - } - - /** - * @return - */ - public int getId() - { - return id; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextStack.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextStack.java deleted file mode 100644 index 110166b3579..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextStack.java +++ /dev/null @@ -1,193 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ - -package org.eclipse.cdt.internal.core.parser; - -import java.io.IOException; -import java.io.Reader; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.Set; -import java.util.Stack; - -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.internal.core.parser.IScannerContext.ContextKind; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ContextStack { - - private final IParserLogService log; - - public ContextStack( IParserLogService l ) { - log = l; - } - - public void updateContext(Reader reader, String filename, ContextKind type, IASTInclusion inclusion, ISourceElementRequestor requestor) throws ContextException { - updateContext(reader, filename, type, inclusion, requestor, -1, -1); - } - - public void updateContext(Reader reader, String filename, ContextKind type, IASTInclusion inclusion, ISourceElementRequestor requestor, int macroOffset, int macroLength) throws ContextException - { - int startLine = 1; - - // If we expand a macro within a macro, then keep offsets of the top-level one, - // as only the top level macro identifier is properly positioned - if (type == IScannerContext.ContextKind.MACROEXPANSION) { - if (currentContext.getKind() == IScannerContext.ContextKind.MACROEXPANSION) { - macroOffset = currentContext.getMacroOffset(); - macroLength = currentContext.getMacroLength(); - } - - startLine = currentContext.getLine(); - } - - undoStack.clear(); - IScannerContext context = new ScannerContext( reader, filename, type, null, macroOffset, macroLength, startLine ); - context.setExtension(inclusion); - push( context, requestor ); - } - - protected void push( IScannerContext context, ISourceElementRequestor requestor ) throws ContextException - { - if( context.getKind() == IScannerContext.ContextKind.INCLUSION ) - { - if( !inclusions.add( context.getFilename() ) ) - throw new ContextException( IProblem.PREPROCESSOR_CIRCULAR_INCLUSION ); - context.getExtension().enterScope( requestor ); - - } else if( context.getKind() == IScannerContext.ContextKind.MACROEXPANSION ) - { - if( !defines.add( context.getFilename() ) ) - throw new ContextException( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN ); - } - if( currentContext != null ) - contextStack.push(currentContext); - - currentContext = context; - if( context.getKind() == IScannerContext.ContextKind.TOP ) - topContext = context; - } - - public boolean rollbackContext(ISourceElementRequestor requestor) { - try { - currentContext.getReader().close(); - } catch (IOException ie) { - log.traceLog("ContextStack : Error closing reader "); - } - - if( currentContext.getKind() == IScannerContext.ContextKind.INCLUSION ) - { - inclusions.remove( currentContext.getFilename() ); - currentContext.getExtension().exitScope( requestor ); - } else if( currentContext.getKind() == IScannerContext.ContextKind.MACROEXPANSION ) - { - defines.remove( currentContext.getFilename() ); - } - - undoStack.addFirst( currentContext ); - - if (contextStack.isEmpty()) { - currentContext = null; - return false; - } - - currentContext = (ScannerContext) contextStack.pop(); - return true; - } - - public void undoRollback( IScannerContext undoTo, ISourceElementRequestor requestor ) throws ContextException { - if( currentContext == undoTo ){ - return; - } - - int size = undoStack.size(); - if( size > 0 ) - { - for( int i = size; i > 0; i-- ) - { - push( (IScannerContext) undoStack.removeFirst(), requestor ); - - if( currentContext == undoTo ) - break; - } - } - } - - /** - * - * @param symbol - * @return boolean, whether or not we should expand this definition - * - * 16.3.4-2 If the name of the macro being replaced is found during - * this scan of the replacement list it is not replaced. Further, if - * any nested replacements encounter the name of the macro being replaced, - * it is not replaced. - */ - protected boolean shouldExpandDefinition( String symbol ) - { - return !defines.contains( symbol ); - } - - public IScannerContext getCurrentContext(){ - return currentContext; - } - - private IScannerContext currentContext, topContext; - private Stack contextStack = new Stack(); - private LinkedList undoStack = new LinkedList(); - private Set inclusions = new HashSet(); - private Set defines = new HashSet(); - - /** - * @return - */ - public IScannerContext getTopContext() { - return topContext; - } - - public IScannerContext getMostRelevantFileContext() - { - if( currentContext != null ) - { - if( currentContext.getKind() == IScannerContext.ContextKind.TOP ) return currentContext; - if( currentContext.getKind() == IScannerContext.ContextKind.INCLUSION ) return currentContext; - } - - IScannerContext context = null; - for( int i = contextStack.size() - 1; i >= 0; --i ) - { - context = (IScannerContext)contextStack.get(i); - if( context.getKind() == IScannerContext.ContextKind.INCLUSION || context.getKind() == IScannerContext.ContextKind.TOP ) - break; - if( i == 0 ) context = null; - } - - return context; - } - - public int getCurrentLineNumber() - { - return getMostRelevantFileContext() != null ? getMostRelevantFileContext().getLine() : -1; - } - - public int getTopFileLineNumber() - { - return topContext.getLine(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextualParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextualParser.java deleted file mode 100644 index cb32036f5a0..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ContextualParser.java +++ /dev/null @@ -1,194 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Iterator; -import java.util.Set; -import java.util.TreeSet; - -import org.eclipse.cdt.core.parser.BacktrackException; -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.internal.core.parser.ast.ASTCompletionNode; - -/** - * @author jcamelon - */ -public class ContextualParser extends Parser implements IParser { - - protected CompletionKind kind; - protected IASTScope scope; - protected IASTNode context; - protected IToken finalToken; - private Set keywordSet; - private int boundaryOffset; - - /** - * @param scanner - * @param callback - * @param language - * @param log - */ - public ContextualParser(IScanner scanner, ISourceElementRequestor callback, ParserLanguage language, IParserLogService log) { - super(scanner, callback, language, log); - astFactory = ParserFactory.createASTFactory( ParserMode.COMPLETE_PARSE, language); - scanner.setASTFactory(astFactory); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int) - */ - public IASTCompletionNode parse(int offset) throws ParserNotImplementedException { - scanner.setOffsetBoundary(offset); - boundaryOffset = offset; - translationUnit(); - return new ASTCompletionNode( getCompletionKind(), getCompletionScope(), getCompletionContext(), getCompletionPrefix(), reconcileKeywords( getKeywordSet(), getCompletionPrefix() ) ); - } - - /** - * @param set - * @param string - * @return - */ - private Set reconcileKeywords(Set keywords, String prefix) { - Set resultSet = new TreeSet(); - Iterator i = keywords.iterator(); - while( i.hasNext() ) - { - String value = (String) i.next(); - if( value.startsWith( prefix ) ) - resultSet.add( value ); - else if( value.compareTo( prefix ) > 0 ) - break; - } - return resultSet; - } - - /** - * @return - */ - private Set getKeywordSet() { - return keywordSet; - } - - /** - * @return - */ - private String getCompletionPrefix() { - return ( finalToken == null ? "" : finalToken.getImage() ); - } - - /** - * @return - */ - private IASTNode getCompletionContext() { - return context; - } - - /** - * @return - */ - private IASTScope getCompletionScope() { - return scope; - } - - /** - * @return - */ - protected IASTCompletionNode.CompletionKind getCompletionKind() { - return kind; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int, int) - */ - public IASTNode parse(int startingOffset, int endingOffset) throws ParserNotImplementedException { - scanner.setOffsetBoundary(endingOffset); - translationUnit(); - return getCompletionContext(); - } - - - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.Parser#setCurrentScope(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - protected void setCurrentScope(IASTScope scope) { - this.scope = scope; - } - - protected void setCompletionContext( IASTNode node ) - { - this.context = node; - } - - protected void setCompletionKind( IASTCompletionNode.CompletionKind kind ) - { - this.kind = kind; - } - - - protected void handleFunctionBody(IASTScope scope, boolean isInlineFunction) throws BacktrackException, EndOfFileException - { - if ( isInlineFunction ) - skipOverCompoundStatement(); - else - functionBody(scope); - } - - protected void catchBlockCompoundStatement(IASTScope scope) throws BacktrackException, EndOfFileException - { - compoundStatement(scope, true); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.Parser#handleOffsetLimitException() - */ - protected void handleOffsetLimitException(OffsetLimitReachedException exception) throws EndOfFileException, OffsetLimitReachedException { - setCompletionToken( exception.getFinalToken() ); - if( (finalToken!= null )&& (finalToken.getEndOffset() != boundaryOffset )) - setCompletionToken(null); - throw exception; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.Parser#setCompletionKeywords(java.lang.String[]) - */ - protected void setCompletionKeywords(KeywordSets.Key key) { - this.keywordSet = KeywordSets.getKeywords( key, language ); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.Parser#setCompletionToken(org.eclipse.cdt.core.parser.IToken) - */ - protected void setCompletionToken(IToken token) { - finalToken = token; - } - - protected IToken getCompletionToken() - { - return finalToken; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java deleted file mode 100644 index 0d8ccdcdfd3..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java +++ /dev/null @@ -1,809 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.ASTSemanticException; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTFactory; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type; -/** - * @author jcamelon - * - */ -public class DeclarationWrapper implements IDeclaratorOwner -{ - private boolean imaginary, complex; - private boolean restrict; - private int endOffset; - private ITokenDuple name; - private Type simpleType = - IASTSimpleTypeSpecifier.Type.UNSPECIFIED; - private boolean isSigned; - private boolean isLong; - private boolean isShort; - private boolean isUnsigned; - private final IASTTemplate templateDeclaration; - private final IASTScope scope; - private IASTTypeSpecifier typeSpecifier; - private List declarators = new ArrayList(); - private boolean typeNamed = false; - private boolean volatil = false; - private boolean virtual = false; - private boolean typedef = false; - private boolean staticc = false; - private boolean register = false; - private boolean extern = false; - private boolean explicit = false; - private boolean constt = false; - private int startingOffset = 0; - private boolean auto = false, - mutable = false, - friend = false, - inline = false; - /** - * @param b - */ - public void setAuto(boolean b) - { - auto = b; - } - /** - * @return - */ - public IASTScope getScope() - { - return scope; - } - /** - * @param scope - */ - public DeclarationWrapper( - IASTScope scope, - int startingOffset, - IASTTemplate templateDeclaration) - { - this.scope = scope; - this.startingOffset = startingOffset; - this.templateDeclaration = templateDeclaration; - } - /** - * @param b - */ - public void setTypenamed(boolean b) - { - typeNamed = b; - } - /** - * @param b - */ - public void setMutable(boolean b) - { - mutable = b; - } - /** - * @param b - */ - public void setFriend(boolean b) - { - friend = b; - } - /** - * @param b - */ - public void setInline(boolean b) - { - inline = b; - } - /** - * @param b - */ - public void setRegister(boolean b) - { - register = b; - } - /** - * @param b - */ - public void setStatic(boolean b) - { - staticc = b; - } - /** - * @param b - */ - public void setTypedef(boolean b) - { - typedef = b; - } - /** - * @param b - */ - public void setVirtual(boolean b) - { - virtual = b; - } - /** - * @param b - */ - public void setVolatile(boolean b) - { - volatil = b; - } - /** - * @param b - */ - public void setExtern(boolean b) - { - extern = b; - } - /** - * @param b - */ - public void setExplicit(boolean b) - { - explicit = b; - } - /** - * @param b - */ - public void setConst(boolean b) - { - constt = b; - } - /** - * @return - */ - public boolean isAuto() - { - return auto; - } - /** - * @return - */ - public boolean isConst() - { - return constt; - } - /** - * @return - */ - public boolean isExplicit() - { - return explicit; - } - /** - * @return - */ - public boolean isExtern() - { - return extern; - } - /** - * @return - */ - public boolean isFriend() - { - return friend; - } - /** - * @return - */ - public boolean isInline() - { - return inline; - } - /** - * @return - */ - public boolean isMutable() - { - return mutable; - } - /** - * @return - */ - public boolean isRegister() - { - return register; - } - /** - * @return - */ - public int getStartingOffset() - { - return startingOffset; - } - /** - * @return - */ - public boolean isStatic() - { - return staticc; - } - /** - * @return - */ - public boolean isTypedef() - { - return typedef; - } - /** - * @return - */ - public boolean isTypeNamed() - { - return typeNamed; - } - /** - * @return - */ - public boolean isVirtual() - { - return virtual; - } - /** - * @return - */ - public boolean isVolatile() - { - return volatil; - } - public void addDeclarator(Declarator d) - { - declarators.add(d); - } - public Iterator getDeclarators() - { - return Collections.unmodifiableList(declarators).iterator(); - } - /** - * @return - */ - public IASTTypeSpecifier getTypeSpecifier() - { - return typeSpecifier; - } - /** - * @param specifier - */ - public void setTypeSpecifier(IASTTypeSpecifier specifier) - { - typeSpecifier = specifier; - } - private IASTFactory astFactory = null; - /** - * @param requestor - */ - public List createASTNodes(IASTFactory astFactory) throws ASTSemanticException - { - this.astFactory = astFactory; - Iterator i = declarators.iterator(); - List l = new ArrayList(); - while (i.hasNext()) - l.add(createASTNode((Declarator)i.next())); - return l; - } - /** - * @param declarator - */ - private IASTDeclaration createASTNode(Declarator declarator) throws ASTSemanticException - { - boolean isWithinClass = (getScope() instanceof IASTClassSpecifier); //TODO fix this for COMPLETE_PARSE - boolean isFunction = declarator.isFunction(); - boolean hasInnerDeclarator = ( declarator.getOwnedDeclarator() != null ); - - if( hasInnerDeclarator ) - return createIndirectDeclaration( declarator ); - - if (isTypedef()) - return createTypedef(declarator, false); - - if (isWithinClass ) - { - if( isFunction) - return createMethodASTNode(declarator, false); - else - return createFieldASTNode(declarator, false ); - } - else - { - if (isFunction) - return createFunctionASTNode(declarator, false); - else - return createVariableASTNode(declarator, false); - } - } - /** - * @param declarator - * @return - */ - private IASTDeclaration createIndirectDeclaration(Declarator declarator) throws ASTSemanticException - { - if( declarator.getOwnedDeclarator().getOwnedDeclarator() == null ) - { - - Declarator d = declarator.getOwnedDeclarator(); - Iterator i = d.getPointerOperators().iterator(); - if( !i.hasNext() ) - { - boolean isWithinClass = scope instanceof IASTClassSpecifier; - boolean isFunction = (declarator.getParameters().size() != 0); - if (isTypedef()) - return createTypedef(declarator, true); - - if (isWithinClass ) - { - if( isFunction) - return createMethodASTNode(declarator, true); - else - return createFieldASTNode(declarator, true ); - } - else - { - if (isFunction) - return createFunctionASTNode(declarator, true); - else - return createVariableASTNode(declarator, true); - } - - } - - List convertedParms = createParameterList( declarator.getParameters() ); - IASTAbstractDeclaration abs = null; - try - { - abs = - astFactory.createAbstractDeclaration( - constt, - volatil, - getTypeSpecifier(), - declarator.getPointerOperators(), - declarator.getArrayModifiers(), - convertedParms, - (ASTPointerOperator)i.next()); - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - String name = ( d.getPointerOperatorNameDuple() != null ) ? d.getPointerOperatorNameDuple().toString() + d.getName() : d.getName(); - if( typedef ) - try - { - return astFactory.createTypedef( - scope, - name, - abs, getStartingOffset(), d.getNameStartOffset(), d.getNameEndOffset() ); - } - catch (ASTSemanticException e1) - { - throw e1; - } - catch (Exception e1) - { - throw new ASTSemanticException(); - } - else - try - { - return astFactory.createVariable( scope, name, auto, d.getInitializerClause(), d.getBitFieldExpression(), abs, mutable, extern, register, staticc, getStartingOffset(), d.getNameStartOffset(), d.getNameEndOffset(), d.getConstructorExpression() ); - } - catch (Exception e2) - { - throw new ASTSemanticException(); - } - - } - else - { - throw new ASTSemanticException(); - } - - } - - /** - * @param declarator - * @return - */ - private IASTTypedefDeclaration createTypedef(Declarator declarator, boolean nested ) throws ASTSemanticException - { - try - { - return astFactory.createTypedef( - scope, - nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(), - astFactory.createAbstractDeclaration( - constt, - volatil, - getTypeSpecifier(), - declarator.getPointerOperators(), declarator.getArrayModifiers(), null, null), startingOffset, declarator.getNameStartOffset(), declarator.getNameEndOffset()); - } - catch (ASTSemanticException e) - { - throw e; - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - } - /** - * @param declarator - * @return - */ - private IASTMethod createMethodASTNode(Declarator declarator, boolean nested) throws ASTSemanticException - { - try - { - return astFactory - .createMethod( - scope, - nested ? declarator.getOwnedDeclarator().getNameDuple() : declarator.getNameDuple(), - createParameterList(declarator.getParameters()), - astFactory.createAbstractDeclaration( - constt, - volatil, - getTypeSpecifier(), - declarator.getPointerOperators(), declarator.getArrayModifiers(), null, null), - declarator.getExceptionSpecification(), - inline, - friend, - staticc, - startingOffset, - declarator.getNameStartOffset(), - declarator.getNameEndOffset(), - templateDeclaration, - declarator.isConst(), - declarator.isVolatile(), - virtual, - explicit, - declarator.isPureVirtual(), ((IASTClassSpecifier)scope).getCurrentVisibilityMode(), - declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody(), declarator.hasFunctionTryBlock(), declarator.isVarArgs()); - } - catch (ASTSemanticException e) - { - throw e; - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - } - /** - * @param declarator - * @return - */ - private IASTFunction createFunctionASTNode(Declarator declarator, boolean nested) throws ASTSemanticException - { - try - { - return astFactory.createFunction( - scope, - nested ? declarator.getOwnedDeclarator().getNameDuple() : declarator.getNameDuple(), - createParameterList(declarator.getParameters()), - astFactory.createAbstractDeclaration( - constt, - volatil, - getTypeSpecifier(), - declarator.getPointerOperators(), declarator.getArrayModifiers(), null, null), - declarator.getExceptionSpecification(), - inline, - friend, - staticc, - startingOffset, - declarator.getNameStartOffset(), - declarator.getNameEndOffset(), - templateDeclaration, - declarator.isConst(), - declarator.isVolatile(), - virtual, - explicit, - declarator.isPureVirtual(), - declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody(), declarator.hasFunctionTryBlock(), - declarator.isVarArgs() ); - } - catch (ASTSemanticException e) - { - throw e; - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - } - /** - * @param declarator - * @return - */ - private IASTField createFieldASTNode(Declarator declarator, boolean nested) throws ASTSemanticException - { - try - { - return astFactory.createField( - scope, - nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(), - auto, - declarator.getInitializerClause(), - declarator.getBitFieldExpression(), - astFactory.createAbstractDeclaration( - constt, - volatil, - getTypeSpecifier(), - declarator.getPointerOperators(), declarator.getArrayModifiers(), null, null), - mutable, - extern, - register, - staticc, - startingOffset, - declarator.getNameStartOffset(), - declarator.getNameEndOffset(), declarator.getConstructorExpression(), ((IASTClassSpecifier)scope).getCurrentVisibilityMode()); - } - catch (ASTSemanticException e) - { - throw e; - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - } - private List createParameterList(List currentParameters) throws ASTSemanticException - { - List result = new ArrayList(); - Iterator i = currentParameters.iterator(); - while (i.hasNext()) - { - DeclarationWrapper wrapper = (DeclarationWrapper)i.next(); - Iterator j = wrapper.getDeclarators(); - while (j.hasNext()) - { - Declarator declarator = (Declarator)j.next(); - try - { - result.add( - astFactory.createParameterDeclaration( - wrapper.isConst(), - wrapper.isVolatile(), - wrapper.getTypeSpecifier(), - declarator.getPointerOperators(), - declarator.getArrayModifiers(), - null, null, declarator.getName() == null - ? "" - : declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), wrapper.getEndOffset())); - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - } - } - return result; - } - /** - * @param declarator - * @return - */ - private IASTVariable createVariableASTNode(Declarator declarator, boolean nested ) throws ASTSemanticException - { - try - { - return astFactory.createVariable( - scope, - nested ? declarator.getOwnedDeclarator().getName() : declarator.getName(), - isAuto(), - declarator.getInitializerClause(), - declarator.getBitFieldExpression(), - astFactory.createAbstractDeclaration( - constt, - volatil, - getTypeSpecifier(), - declarator.getPointerOperators(), declarator.getArrayModifiers(), null, null), - mutable, - extern, - register, - staticc, - getStartingOffset(), - declarator.getNameStartOffset(), declarator.getNameEndOffset(), declarator.getConstructorExpression()); - } - catch (ASTSemanticException e) - { - throw e; - } - catch (Exception e) - { - throw new ASTSemanticException(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarationWrapper() - */ - public DeclarationWrapper getDeclarationWrapper() - { - return this; - } - /** - * @return - */ - public boolean isUnsigned() - { - return isUnsigned; - } - /** - * @return - */ - public boolean isSigned() - { - return isSigned; - } - /** - * @return - */ - public boolean isShort() - { - return isShort; - } - /** - * @return - */ - public boolean isLong() - { - return isLong; - } - /** - * @param b - */ - public void setLong(boolean b) - { - isLong = b; - } - /** - * @param b - */ - public void setShort(boolean b) - { - isShort = b; - } - /** - * @param b - */ - public void setSigned(boolean b) - { - isSigned = b; - } - /** - * @param b - */ - public void setUnsigned(boolean b) - { - isUnsigned = b; - } - /** - * @return - */ - public Type getSimpleType() - { - return simpleType; - } - /** - * @param type - */ - public void setSimpleType(Type type) - { - simpleType = type; - } - /** - * @param duple - */ - public void setTypeName(ITokenDuple duple) - { - name = duple; - } - /** - * @return - */ - public ITokenDuple getName() - { - return name; - } - /** - * @param duple - */ - public void setName(ITokenDuple duple) - { - name = duple; - } - /** - * @return - */ - public IASTTemplate getOwnerTemplate() - { - return templateDeclaration; - } - /** - * @param i - */ - public void setEndingOffset(int i) - { - endOffset = i; - } - /** - * @return - */ - public int getEndOffset() - { - return endOffset; - } - /** - * @param b - */ - public void setRestrict(boolean b) - { - restrict = b; - } - - - /** - * @return - */ - public boolean isRestrict() - { - return restrict; - } - /** - * @param b - */ - public void setImaginary(boolean b) - { - imaginary = b; - } - - /** - * @return - */ - public boolean isComplex() - { - return complex; - } - - /** - * @return - */ - public boolean isImaginary() - { - return imaginary; - } - - /** - * @param b - */ - public void setComplex(boolean b) - { - complex = b; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java deleted file mode 100644 index 1d4d0f120c8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java +++ /dev/null @@ -1,451 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; - -/** - * @author jcamelon - * - */ -public class Declarator implements IParameterCollection, IDeclaratorOwner, IDeclarator -{ - private boolean hasFunctionTryBlock; - private ITokenDuple pointerOperatorNameDuple; - private ITokenDuple namedDuple; - private boolean isFunction; - private boolean hasFunctionBody; - private IASTExpression constructorExpression; - private boolean pureVirtual = false; - private final IDeclaratorOwner owner; - private Declarator ownedDeclarator = null; - private String name = ""; - private IASTInitializerClause initializerClause = null; - private List ptrOps = new ArrayList(); - private List parameters = new ArrayList(); - private List arrayModifiers = new ArrayList(); - private List constructorMemberInitializers = new ArrayList(); - private IASTExceptionSpecification exceptionSpecification = null; - private IASTExpression bitFieldExpression = null; - private boolean isConst = false; - private boolean isVolatile = false; - private boolean isKandR = false; - - - private int nameStartOffset, nameEndOffset; - private boolean varArgs; - - public Declarator( IDeclaratorOwner owner ) - { - this.owner = owner; - } - - /** - * @return - */ - public String getName() - { - return name; - } - - /** - * @return - */ - public int getNameEndOffset() - { - return nameEndOffset; - } - - /** - * @return - */ - public int getNameStartOffset() - { - return nameStartOffset; - } - - /** - * @return - */ - public IDeclaratorOwner getOwner() - { - return owner; - } - - /** - * @param string - */ - public void setName(String string) - { - name = string; - } - - /** - * @param i - */ - public void setNameEndOffset(int i) - { - nameEndOffset = i; - } - - /** - * @param i - */ - public void setNameStartOffset(int i) - { - nameStartOffset = i; - } - - /** - * @return - */ - public List getPointerOperators() - { - return Collections.unmodifiableList( ptrOps ); - } - - public void addPointerOperator( ASTPointerOperator ptrOp ) - { - ptrOps.add( ptrOp ); - } - /** - * @return - */ - public List getParameters() - { - return parameters; - } - - public void addParameter( DeclarationWrapper param ) - { - parameters.add( param ); - } - /** - * @return - */ - public IASTInitializerClause getInitializerClause() - { - return initializerClause; - } - - /** - * @param expression - */ - public void setInitializerClause(IASTInitializerClause expression) - { - initializerClause = expression; - } - - /** - * @return - */ - public Declarator getOwnedDeclarator() - { - return ownedDeclarator; - } - - /** - * @param declarator - */ - public void setOwnedDeclarator(Declarator declarator) - { - ownedDeclarator = declarator; - } - - public void setName( ITokenDuple duple ) - { - setName( duple.toString() ); - setNameStartOffset( duple.getFirstToken().getOffset()); - setNameEndOffset( duple.getLastToken().getEndOffset()); - namedDuple = duple; - } - - /** - * @return - */ - public IASTExceptionSpecification getExceptionSpecification() - { - return exceptionSpecification; - } - - /** - * @return - */ - public boolean isConst() - { - return isConst; - } - - /** - * @return - */ - public boolean isVolatile() - { - return isVolatile; - } - - /** - * @param specification - */ - public void setExceptionSpecification(IASTExceptionSpecification specification) - { - exceptionSpecification = specification; - } - - /** - * @param b - */ - public void setConst(boolean b) - { - isConst = b; - } - - /** - * @param b - */ - public void setVolatile(boolean b) - { - isVolatile = b; - } - - /** - * @return - */ - public boolean isKandR() - { - return isKandR; - } - - /** - * @param b - */ - public void setKandR(boolean b) - { - isKandR = b; - } - - /** - * @param b - */ - public void setPureVirtual(boolean b) - { - pureVirtual = b; - } - - /** - * @return - */ - public boolean isPureVirtual() - { - return pureVirtual; - } - - /** - * @param arrayMod - */ - public void addArrayModifier(IASTArrayModifier arrayMod) - { - arrayModifiers.add( arrayMod ); - } - - /** - * @return - */ - public List getArrayModifiers() - { - return arrayModifiers; - } - - /** - * @return - */ - public IASTExpression getBitFieldExpression() - { - return bitFieldExpression; - } - - /** - * @param expression - */ - public void setBitFieldExpression(IASTExpression expression) - { - bitFieldExpression = expression; - } - - /** - * @param astExpression - */ - public void setConstructorExpression(IASTExpression astExpression) - { - constructorExpression = astExpression; - } - - /** - * @return - */ - public IASTExpression getConstructorExpression() - { - return constructorExpression; - } - - /** - * @param initializer - */ - public void addConstructorMemberInitializer(IASTConstructorMemberInitializer initializer) - { - constructorMemberInitializers.add( initializer ); - } - - /** - * @return - */ - public List getConstructorMemberInitializers() - { - return constructorMemberInitializers; - } - - /** - * @param b - */ - public void hasFunctionBody(boolean b) - { - hasFunctionBody = b; - } - - /** - * @return - */ - public boolean isFunction() - { - return isFunction; - } - - /** - * @param b - */ - public void setIsFunction(boolean b) - { - isFunction = b; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarators() - */ - public Iterator getDeclarators() - { - List l = new ArrayList(); - if( ownedDeclarator != null ) - l.add( ownedDeclarator ); - return l.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclaratorOwner#getDeclarationWrapper() - */ - public DeclarationWrapper getDeclarationWrapper() - { - Declarator d = this; - while( d.getOwner() instanceof IDeclarator ) - d = (Declarator)d.getOwner(); - return (DeclarationWrapper)d.getOwner(); - } - - - /** - * @return - */ - public ITokenDuple getNameDuple() - { - return namedDuple; - } - - /** - * @param nameDuple - */ - public void setPointerOperatorName(ITokenDuple nameDuple) - { - pointerOperatorNameDuple = nameDuple; - } - - /** - * @return - */ - public ITokenDuple getPointerOperatorNameDuple() - { - return pointerOperatorNameDuple; - } - - /** - * @return - */ - public boolean hasFunctionBody() - { - return hasFunctionBody; - } - - /** - * @param b - */ - public void setHasFunctionBody(boolean b) - { - hasFunctionBody = b; - } - - /** - * @param b - */ - public void setFunctionTryBlock(boolean b) - { - hasFunctionTryBlock = true; - } - - /** - * @return - */ - public boolean hasFunctionTryBlock() - { - return hasFunctionTryBlock; - } - - /** - * @param b - */ - public void setHasFunctionTryBlock(boolean b) - { - hasFunctionTryBlock = b; - } - - /** - * @param b - */ - public void setIsVarArgs(boolean b) { - varArgs = b; - } - - /** - * @return Returns the varArgs. - */ - public boolean isVarArgs() { - return varArgs; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclarator.java deleted file mode 100644 index 36a1a0aa324..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclarator.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; -import java.util.List; - -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -/** - * @author jcamelon - * - */ -public interface IDeclarator -{ - /** - * @return - */ - public abstract List getPointerOperators(); - public abstract void addPointerOperator(ASTPointerOperator ptrOp); - /** - * @param arrayMod - */ - public abstract void addArrayModifier(IASTArrayModifier arrayMod); - /** - * @return - */ - public abstract List getArrayModifiers(); - - /** - * @param nameDuple - */ - public void setPointerOperatorName(ITokenDuple nameDuple); - - public ITokenDuple getPointerOperatorNameDuple(); - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java deleted file mode 100644 index 2904f0b2231..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IDeclaratorOwner.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Iterator; - -/** - * @author jcamelon - * - */ -public interface IDeclaratorOwner -{ - public Iterator getDeclarators(); - public DeclarationWrapper getDeclarationWrapper(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParameterCollection.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParameterCollection.java deleted file mode 100644 index 2733b26e180..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IParameterCollection.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.List; - -/** - * @author jcamelon - * - */ -public interface IParameterCollection -{ - public List getParameters(); - public void addParameter( DeclarationWrapper param ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IProblemFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IProblemFactory.java deleted file mode 100644 index 7702e8f52ed..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IProblemFactory.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Map; - -import org.eclipse.cdt.core.parser.IProblem; - -/** - * @author jcamelon - * - */ -public interface IProblemFactory { - - public IProblem createProblem( int id, int start, int end, int line, char [] file, Map arguments, boolean warn, boolean error ); - public String [] getRequiredAttributesForId( int id ); - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java deleted file mode 100644 index 29433ee2c36..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/IScannerContext.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.eclipse.cdt.internal.core.parser; -import java.io.IOException; -import java.io.Reader; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -/** - * @author jcamelon - * - */ -public interface IScannerContext { - - - public static class ContextKind extends Enum - { - public static ContextKind SENTINEL = new ContextKind( 0 ); - public static ContextKind TOP = new ContextKind( 1 ); - public static ContextKind INCLUSION = new ContextKind( 2 ); - public static ContextKind MACROEXPANSION = new ContextKind( 3 ); - - /** - * @param enumValue - */ - protected ContextKind(int enumValue) { - super(enumValue); - // - } - } - - /** - * This initializer is used for scanner contexts which are macro expansions. - * - * @param macroOffset Offset of the expanding macro - * @param macroLength Length of the macro identifier - * @return - */ - public int read() throws IOException; - public String getFilename(); - - /** - * Returns macro offset (the offset of the top expanded macro). - * @return int - */ - public int getMacroOffset(); - - /** - * Returns macro length (the length of the top expanded macro identifier). - * @return int - */ - public int getMacroLength(); - - /** - * Returns the offset. - * @return int - */ - public int getOffset(); - - /** - * Returns relative offset (relative to the beginning of the ScannerContext). - * @return int - */ - public int getRelativeOffset(); - - public Reader getReader(); - - public int undoStackSize(); - public int popUndo(); - public void pushUndo(int undo); - - public ContextKind getKind(); - public void setKind( ContextKind kind ); - - public IASTInclusion getExtension(); - public void setExtension( IASTInclusion ext ); - - /** - * @return - */ - public int getLine(); - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/KeywordSets.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/KeywordSets.java deleted file mode 100644 index a86cc5a10fc..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/KeywordSets.java +++ /dev/null @@ -1,167 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Set; -import java.util.TreeSet; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.Keywords; -import org.eclipse.cdt.core.parser.ParserLanguage; - -/** - * @author jcamelon - */ -public class KeywordSets { - - - public static class Key extends Enum - { - public static final Key EMPTY = new Key( 0 ); - public static final Key DECL_SPECIFIER_SEQUENCE = new Key( 1 ); - public static final Key DECLARATION = new Key( 2 ); - public static final Key STATEMENT = new Key(3); - /** - * @param enumValue - */ - protected Key(int enumValue) { - super(enumValue); - } - - } - - public static Set getKeywords( Key kind, ParserLanguage language ) - { - if( kind == Key.EMPTY ) - return EMPTY; - if( kind == Key.DECL_SPECIFIER_SEQUENCE ) - return (Set) DECL_SPECIFIER_SEQUENCE.get( language ); - if( kind == Key.DECLARATION ) - return (Set) DECLARATION.get( language ); - if( kind == Key.STATEMENT ) - return (Set) STATEMENT.get( language ); - - //TODO finish this - return null; - } - - private static final Set EMPTY = new HashSet(); - - private static final Set DECL_SPECIFIER_SEQUENCE_C; - static - { - DECL_SPECIFIER_SEQUENCE_C = new TreeSet(); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.INLINE ); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.AUTO); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.REGISTER); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.STATIC); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.EXTERN); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.MUTABLE); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.TYPEDEF); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.CONST); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.VOLATILE); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.SIGNED); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.UNSIGNED); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.SHORT); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.LONG); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords._COMPLEX); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords._IMAGINARY); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.CHAR); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.WCHAR_T); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords._BOOL); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.INT); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.FLOAT); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.DOUBLE); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.VOID); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.STRUCT); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.UNION); - DECL_SPECIFIER_SEQUENCE_C.add( Keywords.ENUM); - } - - private static final Set DECL_SPECIFIER_SEQUENCE_CPP; - static - { - DECL_SPECIFIER_SEQUENCE_CPP = new TreeSet(); - // add all of C then remove the ones we don't need - DECL_SPECIFIER_SEQUENCE_CPP.addAll( DECL_SPECIFIER_SEQUENCE_C ); - DECL_SPECIFIER_SEQUENCE_CPP.remove( Keywords._COMPLEX); - DECL_SPECIFIER_SEQUENCE_CPP.remove( Keywords._IMAGINARY); - DECL_SPECIFIER_SEQUENCE_CPP.remove( Keywords._BOOL); - // CPP specific stuff - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.VIRTUAL); - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.MUTABLE); - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.EXPLICIT); - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.FRIEND); - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.BOOL); - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.TYPENAME); - DECL_SPECIFIER_SEQUENCE_CPP.add( Keywords.CLASS); - } - - private static final Hashtable DECL_SPECIFIER_SEQUENCE; - static - { - DECL_SPECIFIER_SEQUENCE = new Hashtable(); - DECL_SPECIFIER_SEQUENCE.put( ParserLanguage.CPP, DECL_SPECIFIER_SEQUENCE_CPP ); - DECL_SPECIFIER_SEQUENCE.put( ParserLanguage.C, DECL_SPECIFIER_SEQUENCE_C ); - } - - private static final Set DECLARATION_CPP; - static - { - DECLARATION_CPP = new TreeSet(); - DECLARATION_CPP.addAll( DECL_SPECIFIER_SEQUENCE_CPP ); - DECLARATION_CPP.add( Keywords.ASM ); - // more to come - } - - private static final Set DECLARATION_C; - static - { - DECLARATION_C = new TreeSet(); - DECLARATION_C.addAll(DECL_SPECIFIER_SEQUENCE_C ); - DECLARATION_C.add(Keywords.ASM ); - // more to come - } - - private static final Hashtable DECLARATION; - static - { - DECLARATION = new Hashtable(); - DECLARATION.put( ParserLanguage.CPP, DECLARATION_CPP ); - DECLARATION.put( ParserLanguage.C, DECLARATION_C ); - } - - private static final Set STATEMENT_C; - static - { - STATEMENT_C= new TreeSet(); - STATEMENT_C.addAll( DECLARATION_C ); - STATEMENT_C.add( Keywords.FOR ); - // more to come - } - - private static final Set STATEMENT_CPP; - static - { - STATEMENT_CPP = new TreeSet( STATEMENT_C ); - STATEMENT_CPP.add( Keywords.TRY ); - } - - private static final Hashtable STATEMENT; - static - { - STATEMENT = new Hashtable(); - STATEMENT.put( ParserLanguage.CPP, STATEMENT_CPP); - STATEMENT.put( ParserLanguage.C, STATEMENT_C ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LimitedScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LimitedScannerContext.java deleted file mode 100644 index f01443529d0..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LimitedScannerContext.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.io.IOException; -import java.io.Reader; - -/** - * @author jcamelon - */ -public class LimitedScannerContext - extends ScannerContext - implements IScannerContext { - - private final int limit; - - /** - * @param reader - * @param string - * @param i - * @param object - * @param offsetLimit - */ - public LimitedScannerContext(Reader reader, String string, ContextKind kind, int offsetLimit) { - super( reader, string, kind, null ); - limit = offsetLimit; - } - - - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#read() - */ - public int read() throws IOException { - if( getOffset() == limit ) throw new IOException(); - return super.read(); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LineOffsetReconciler.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LineOffsetReconciler.java deleted file mode 100644 index ca114da655c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/LineOffsetReconciler.java +++ /dev/null @@ -1,104 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.io.IOException; -import java.io.Reader; - -import org.eclipse.cdt.core.parser.ILineOffsetReconciler; -import org.eclipse.cdt.core.parser.IOffsetDuple; - -/** - * @author jcamelon - * - */ -public class LineOffsetReconciler implements ILineOffsetReconciler -{ - private Reader ourReader; - int currentOffset = 0; - /** - * @param input - */ - public LineOffsetReconciler(Reader input) - { - ourReader = input; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ILineOffsetReconciler#getLineNumberForOffset(int) - */ - public int getLineNumberForOffset(int offset) - { - if( offset < currentOffset ) - resetReader(); - int lineNumber = 1; - for( int i = currentOffset; i < offset; ++i ) - { - int c = getChar(); - if( c == -1 ) - return -1; - if( c == '\n' ) - ++lineNumber; - } - return lineNumber; - } - - private int getChar() - { - int c; - try - { - c = ourReader.read(); - ++currentOffset; - } - catch (IOException e) - { - return -1; - } - return c; - } - private void resetReader() - { - try - { - ourReader.reset(); - currentOffset = 0; - } - catch (IOException e) - { - throw new Error( "Could not reset Reader" ); - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ILineOffsetReconciler#getOffsetRangeForLineNumber(int) - */ - public IOffsetDuple getOffsetRangeForLineNumber(int LineNumber) - { - int lineNumber = 1; - int floor= -1, ceiling = -1; - int offset = 0; - while( lineNumber != LineNumber ) - { - int c = getChar(); - ++offset; - if( c == '\n' ) ++lineNumber; - } - floor = offset; - while( lineNumber == LineNumber ) - { - int c = getChar(); - ++offset; - if( c == '\n' ) ++lineNumber; - } - ceiling = offset; - return new OffsetDuple( floor, ceiling ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java deleted file mode 100644 index 7a2e0f37016..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/MacroDescriptor.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.IMacroDescriptor; -import org.eclipse.cdt.core.parser.IToken; - -public class MacroDescriptor implements IMacroDescriptor { - - public MacroDescriptor() - { - } - - /** - * Method initialize. - * @param name The name or label that the Macro can be identified by. - * @param identifiers An ordered list of parameters in the macro - * definition. - * @param tokens An ordered list of tokens that describe the - * RHS expansion in the macro definition. - * @param sig The complete signature of the macro, as a string. - */ - public void initialize( String name, List identifiers, List tokens, String sig ) - { - this.name = name; - identifierParameters = identifiers; - tokenizedExpansion = tokens; - signature = sig; - } - - private String name; - private List identifierParameters; - private List tokenizedExpansion; - private String signature; - /** - * Returns the identifiers. - * @return List - */ - public final List getParameters() { - return identifierParameters; - } - - /** - * Returns the tokens. - * @return List - */ - public final List getTokenizedExpansion() { - return tokenizedExpansion; - } - - /** - * Returns the name. - * @return String - */ - public final String getName() - { - return name; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() - { - StringBuffer buffer = new StringBuffer( 128 ); - int count = getParameters().size(); - - buffer.append( "MacroDescriptor with name=" + getName() + "\n" ); - buffer.append( "Number of parameters = " + count + "\n" ); - Iterator iter = getParameters().iterator(); - int current = 0; - while( iter.hasNext() ) - { - buffer.append( "Parameter #" + current++ + " with name=" + (String) iter.next() + "\n" ); - } - - count = getTokenizedExpansion().size(); - iter = getTokenizedExpansion().iterator(); - - buffer.append( "Number of tokens = " + count + "\n" ); - current = 0; - while( iter.hasNext() ) - { - buffer.append( "Token #" + current++ + " is " + ((IToken)iter.next()).toString() + "\n" ); - } - - return buffer.toString(); - } - - /** - * Returns the signature. - * @return String - */ - public final String getSignature() - { - return signature; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IMacroDescriptor#compatible(org.eclipse.cdt.core.parser.IMacroDescriptor) - */ - public boolean compatible(IMacroDescriptor descriptor) { - if( descriptor.getName() == null ) return false; - if( descriptor.getTokenizedExpansion() == null ) return false; - if( descriptor.getParameters() == null ) return false; - if( ! name.equals( descriptor.getName() )) return false; - if( descriptor.getParameters().size() != identifierParameters.size() ) return false; - if( descriptor.getTokenizedExpansion().size() != tokenizedExpansion.size() ) return false; - - if( ! (descriptor.getParameters().containsAll( identifierParameters ) )) return false; - if( ! (descriptor.getTokenizedExpansion().containsAll( tokenizedExpansion ))) return false; - return true; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/OffsetDuple.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/OffsetDuple.java deleted file mode 100644 index a04166cdb0f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/OffsetDuple.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.parser.IOffsetDuple; - -/** - * @author jcamelon - * - */ -public class OffsetDuple implements IOffsetDuple -{ - private final int lineFloor, lineCeiling; - /** - * @param floor - * @param ceiling - */ - public OffsetDuple(int floor, int ceiling) - { - lineFloor = floor; - lineCeiling = ceiling; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IOffsetDuple#getCeilingOffset() - */ - public int getCeilingOffset() - { - return lineCeiling; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IOffsetDuple#getFloorOffset() - */ - public int getFloorOffset() - { - return lineFloor; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParameterCollection.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParameterCollection.java deleted file mode 100644 index 9c34ad8a44f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParameterCollection.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author jcamelon - * - */ -public class ParameterCollection implements IParameterCollection -{ - private List list = new ArrayList(); - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParameterCollection#getParameters() - */ - public List getParameters() - { - return list; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParameterCollection#addParameter(org.eclipse.cdt.internal.core.parser.DeclarationWrapper) - */ - public void addParameter(DeclarationWrapper param) - { - list.add( param ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java deleted file mode 100644 index 45e842e31a9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java +++ /dev/null @@ -1,5420 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Stack; - -import org.eclipse.cdt.core.parser.BacktrackException; -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ScannerException; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.ASTSemanticException; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTDesignator; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTFactory; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind; -import org.eclipse.cdt.internal.core.parser.KeywordSets.Key; - -/** - * This is our first implementation of the IParser interface, serving as a parser for - * ANSI C and C++. - * - * From time to time we will make reference to the ANSI ISO specifications. - * - * @author jcamelon - */ -public abstract class Parser implements IParser -{ - protected final IParserLogService log; - private static final List EMPTY_LIST = new ArrayList(); - private static int FIRST_ERROR_OFFSET_UNSET = -1; - // sentinel initial value for offsets - protected int firstErrorOffset = FIRST_ERROR_OFFSET_UNSET; - // offset where the first parse error occurred - - // are we doing the high-level parse, or an in depth parse? - protected boolean parsePassed = true; // did the parse pass? - protected ParserLanguage language = ParserLanguage.CPP; // C or CPP - protected ISourceElementRequestor requestor = null; - // new callback mechanism - protected IASTFactory astFactory = null; // ast factory - /** - * This is the single entry point for setting parsePassed to - * false, and also making note what token offset we failed upon. - * - * @throws EndOfFileException - */ - protected void failParse() - { - try - { - if (firstErrorOffset == FIRST_ERROR_OFFSET_UNSET ) - firstErrorOffset = LA(1).getOffset(); - } catch( EndOfFileException eof ) - { - // do nothing - } - finally - { - parsePassed = false; - } - } - /** - * This is the standard cosntructor that we expect the Parser to be instantiated - * with. - * - * @param s IScanner instance that has been initialized to the code input - * @param c IParserCallback instance that will receive callbacks as we parse - * @param quick Are we asking for a high level parse or not? - */ - public Parser( - IScanner scanner, - ISourceElementRequestor callback, - ParserLanguage language, - IParserLogService log ) - { - this.scanner = scanner; - this.requestor = callback; - this.language = language; - this.log = log; - } - - // counter that keeps track of the number of times Parser.parse() is called - private static int parseCount = 0; - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParser#parse() - */ - public boolean parse() - { - long startTime = System.currentTimeMillis(); - translationUnit(); - // For the debuglog to take place, you have to call - // Util.setDebugging(true); - // Or set debug to true in the core plugin preference - log.traceLog( - "Parse " - + (++parseCount) - + ": " - + (System.currentTimeMillis() - startTime) - + "ms" - + (parsePassed ? "" : " - parse failure") ); - return parsePassed; - } - - - /** - * This is the top-level entry point into the ANSI C++ grammar. - * - * translationUnit : (declaration)* - */ - protected void translationUnit() - { - IASTCompilationUnit compilationUnit; - try - { - compilationUnit = astFactory.createCompilationUnit(); - } - catch (Exception e2) - { - return; - } - - compilationUnit.enterScope( requestor ); - IToken lastBacktrack = null; - IToken checkToken = null; - while (true) - { - try - { - checkToken = LA(1); - declaration(compilationUnit, null); - if (LA(1) == checkToken) - errorHandling(); - } - catch (EndOfFileException e) - { - // Good - break; - } - catch (BacktrackException b) - { - try - { - // Mark as failure and try to reach a recovery point - failParse(); - if (lastBacktrack != null && lastBacktrack == LA(1)) - { - // we haven't progressed from the last backtrack - // try and find tne next definition - errorHandling(); - } - else - { - // start again from here - lastBacktrack = LA(1); - } - } - catch (EndOfFileException e) - { - break; - } - } - catch (Exception e) - { - failParse(); - break; - } - } - compilationUnit.exitScope( requestor ); - } - /** - * This function is called whenever we encounter and error that we cannot backtrack out of and we - * still wish to try and continue on with the parse to do a best-effort parse for our client. - * - * @throws EndOfFileException We can potentially hit EndOfFile here as we are skipping ahead. - */ - protected void errorHandling() throws EndOfFileException - { - failParse(); - consume(); - int depth = 0; - while (!((LT(1) == IToken.tSEMI && depth == 0) - || (LT(1) == IToken.tRBRACE && depth == 1))) - { - switch (LT(1)) - { - case IToken.tLBRACE : - ++depth; - break; - case IToken.tRBRACE : - --depth; - break; - } - consume(); - } - // eat the SEMI/RBRACE as well - consume(); - } - /** - * The merger of using-declaration and using-directive in ANSI C++ grammar. - * - * using-declaration: - * using typename? ::? nested-name-specifier unqualified-id ; - * using :: unqualified-id ; - * using-directive: - * using namespace ::? nested-name-specifier? namespace-name ; - * - * @param container Callback object representing the scope these definitions fall into. - * @throws BacktrackException request for a backtrack - */ - protected void usingClause(IASTScope scope) - throws EndOfFileException, BacktrackException - { - IToken firstToken = consume(IToken.t_using); - if (LT(1) == IToken.t_namespace) - { - // using-directive - consume(IToken.t_namespace); - // optional :: and nested classes handled in name - TokenDuple duple = null; - if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON) - duple = name(); - else - throw backtrack; - if (LT(1) == IToken.tSEMI) - { - IToken last = consume(IToken.tSEMI); - IASTUsingDirective astUD = null; - - try - { - astUD = astFactory.createUsingDirective(scope, duple, firstToken.getOffset(), last.getEndOffset()); - } - catch (Exception e1) - { - throw backtrack; - } - astUD.acceptElement(requestor); - return; - } - else - { - throw backtrack; - } - } - else - { - boolean typeName = false; - if (LT(1) == IToken.t_typename) - { - typeName = true; - consume(IToken.t_typename); - } - TokenDuple name = null; - if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON) - { - // optional :: and nested classes handled in name - name = name(); - } - else - { - throw backtrack; - } - if (LT(1) == IToken.tSEMI) - { - IToken last = consume(IToken.tSEMI); - IASTUsingDeclaration declaration = null; - try - { - declaration = - astFactory.createUsingDeclaration( - scope, - typeName, - name, - firstToken.getOffset(), - last.getEndOffset()); - } - catch (Exception e1) - { - throw backtrack; - } - declaration.acceptElement( requestor ); - } - else - { - throw backtrack; - } - } - } - /** - * Implements Linkage specification in the ANSI C++ grammar. - * - * linkageSpecification - * : extern "string literal" declaration - * | extern "string literal" { declaration-seq } - * - * @param container Callback object representing the scope these definitions fall into. - * @throws BacktrackException request for a backtrack - */ - protected void linkageSpecification(IASTScope scope) - throws EndOfFileException, BacktrackException - { - IToken firstToken = consume(IToken.t_extern); - if (LT(1) != IToken.tSTRING) - throw backtrack; - IToken spec = consume(IToken.tSTRING); - - if (LT(1) == IToken.tLBRACE) - { - consume(IToken.tLBRACE); - IASTLinkageSpecification linkage; - try - { - linkage = - astFactory.createLinkageSpecification( - scope, - spec.getImage(), - firstToken.getOffset()); - } - catch (Exception e) - { - throw backtrack; - } - - linkage.enterScope( requestor ); - linkageDeclarationLoop : while (LT(1) != IToken.tRBRACE) - { - IToken checkToken = LA(1); - switch (LT(1)) - { - case IToken.tRBRACE : - consume(IToken.tRBRACE); - break linkageDeclarationLoop; - default : - try - { - declaration(linkage, null); - } - catch (BacktrackException bt) - { - failParse(); - if (checkToken == LA(1)) - errorHandling(); - } - } - if (checkToken == LA(1)) - errorHandling(); - } - // consume the } - IToken lastToken = consume(); - linkage.setEndingOffset(lastToken.getEndOffset()); - linkage.exitScope( requestor ); - } - else // single declaration - { - IASTLinkageSpecification linkage; - try - { - linkage = - astFactory.createLinkageSpecification( - scope, - spec.getImage(), - firstToken.getOffset()); - } - catch (Exception e) - { - throw backtrack; - } - linkage.enterScope( requestor ); - declaration(linkage, null); - linkage.exitScope( requestor ); - } - } - /** - * - * Represents the emalgamation of template declarations, template instantiations and - * specializations in the ANSI C++ grammar. - * - * template-declaration: export? template < template-parameter-list > declaration - * explicit-instantiation: template declaration - * explicit-specialization: template <> declaration - * - * @param container Callback object representing the scope these definitions fall into. - * @throws BacktrackException request for a backtrack - */ - protected void templateDeclaration(IASTScope scope) - throws EndOfFileException, BacktrackException - { - IToken firstToken = null; - boolean exported = false; - if (LT(1) == IToken.t_export) - { - exported = true; - firstToken = consume(IToken.t_export); - consume(IToken.t_template); - } - else - firstToken = consume(IToken.t_template); - if (LT(1) != IToken.tLT) - { - // explicit-instantiation - IASTTemplateInstantiation templateInstantiation; - try - { - templateInstantiation = - astFactory.createTemplateInstantiation( - scope, - firstToken.getOffset()); - } - catch (Exception e) - { - throw backtrack; - } - templateInstantiation.enterScope( requestor ); - declaration(scope, templateInstantiation); - templateInstantiation.setEndingOffset(lastToken.getEndOffset()); - templateInstantiation.exitScope( requestor ); - - return; - } - else - { - consume(IToken.tLT); - if (LT(1) == IToken.tGT) - { - consume(IToken.tGT); - // explicit-specialization - - IASTTemplateSpecialization templateSpecialization; - try - { - templateSpecialization = - astFactory.createTemplateSpecialization( - scope, - firstToken.getOffset()); - } - catch (Exception e) - { - throw backtrack; - } - templateSpecialization.enterScope(requestor); - declaration(scope, templateSpecialization); - templateSpecialization.setEndingOffset( - lastToken.getEndOffset()); - templateSpecialization.exitScope(requestor); - return; - } - } - - try - { - List parms = templateParameterList(scope); - consume(IToken.tGT); - IASTTemplateDeclaration templateDecl; - try - { - templateDecl = - astFactory.createTemplateDeclaration( - scope, - parms, - exported, - firstToken.getOffset()); - } - catch (Exception e) - { - throw backtrack; - } - templateDecl.enterScope( requestor ); - declaration(scope, templateDecl ); - templateDecl.setEndingOffset( - lastToken.getEndOffset() ); - templateDecl.exitScope( requestor ); - - } - catch (BacktrackException bt) - { - throw bt; - } - } - /** - * - * - * - * template-parameter-list: template-parameter - * template-parameter-list , template-parameter - * template-parameter: type-parameter - * parameter-declaration - * type-parameter: class identifier? - * class identifier? = type-id - * typename identifier? - * typename identifier? = type-id - * template < template-parameter-list > class identifier? - * template < template-parameter-list > class identifier? = id-expression - * template-id: template-name < template-argument-list?> - * template-name: identifier - * template-argument-list: template-argument - * template-argument-list , template-argument - * template-argument: assignment-expression - * type-id - * id-expression - * - * @param templateDeclaration Callback's templateDeclaration which serves as a scope to this list. - * @throws BacktrackException request for a backtrack - */ - protected List templateParameterList(IASTScope scope) - throws BacktrackException, EndOfFileException - { - // if we have gotten this far then we have a true template-declaration - // iterate through the template parameter list - List returnValue = new ArrayList(); - - for (;;) - { - if (LT(1) == IToken.tGT) - return returnValue; - if (LT(1) == IToken.t_class || LT(1) == IToken.t_typename) - { - IASTTemplateParameter.ParamKind kind = - (consume().getType() == IToken.t_class) - ? IASTTemplateParameter.ParamKind.CLASS - : IASTTemplateParameter.ParamKind.TYPENAME; - - IToken id = null; - IASTTypeId typeId = null; - try - { - if (LT(1) == IToken.tIDENTIFIER) // optional identifier - { - id = identifier(); - - if (LT(1) == IToken.tASSIGN) // optional = type-id - { - consume(IToken.tASSIGN); - typeId = typeId(scope, false); // type-id - } - } - - } - catch (BacktrackException bt) - { - throw bt; - } - try - { - returnValue.add( - astFactory.createTemplateParameter( - kind, - ( id == null )? "" : id.getImage(), - (typeId == null) ? null : typeId.getTypeOrClassName(), - null, - null)); - } - catch (Exception e) - { - throw backtrack; - } - - } - else if (LT(1) == IToken.t_template) - { - consume(IToken.t_template); - consume(IToken.tLT); - - List subResult = templateParameterList(scope); - consume(IToken.tGT); - consume(IToken.t_class); - IToken optionalId = null; - IASTTypeId optionalTypeId = null; - if (LT(1) == IToken.tIDENTIFIER) // optional identifier - { - optionalId = identifier(); - - if (LT(1) == IToken.tASSIGN) // optional = type-id - { - consume(IToken.tASSIGN); - optionalTypeId = typeId(scope, false); - - } - } - - try - { - returnValue.add( - astFactory.createTemplateParameter( - IASTTemplateParameter.ParamKind.TEMPLATE_LIST, - ( optionalId == null )? "" : optionalId.getImage(), - ( optionalTypeId == null ) ? "" : optionalTypeId.toString(), - null, - subResult)); - } - catch (Exception e) - { - throw backtrack; - } - } - else if (LT(1) == IToken.tCOMMA) - { - consume(IToken.tCOMMA); - continue; - } - else - { - ParameterCollection c = new ParameterCollection(); - parameterDeclaration(c, scope); - DeclarationWrapper wrapper = - (DeclarationWrapper)c.getParameters().get(0); - Declarator declarator = - (Declarator)wrapper.getDeclarators().next(); - try - { - returnValue.add( - astFactory.createTemplateParameter( - IASTTemplateParameter.ParamKind.PARAMETER, - null, - null, - astFactory.createParameterDeclaration( - wrapper.isConst(), - wrapper.isVolatile(), - wrapper.getTypeSpecifier(), - declarator.getPointerOperators(), - declarator.getArrayModifiers(), - null, null, declarator.getName() == null - ? "" - : declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), wrapper.getEndOffset()), - null)); - } - catch (Exception e) - { - throw backtrack; - } - } - } - } - /** - * The most abstract construct within a translationUnit : a declaration. - * - * declaration - * : {"asm"} asmDefinition - * | {"namespace"} namespaceDefinition - * | {"using"} usingDeclaration - * | {"export"|"template"} templateDeclaration - * | {"extern"} linkageSpecification - * | simpleDeclaration - * - * Notes: - * - folded in blockDeclaration - * - merged alternatives that required same LA - * - functionDefinition into simpleDeclaration - * - namespaceAliasDefinition into namespaceDefinition - * - usingDirective into usingDeclaration - * - explicitInstantiation and explicitSpecialization into - * templateDeclaration - * - * @param container IParserCallback object which serves as the owner scope for this declaration. - * @throws BacktrackException request a backtrack - */ - protected void declaration( - IASTScope scope, - IASTTemplate ownerTemplate) - throws EndOfFileException, BacktrackException - { - setCurrentScope(scope); - setCompletionKeywords( Key.DECLARATION ); - switch (LT(1)) - { - case IToken.t_asm : - IToken first = consume(IToken.t_asm); - setCompletionKind( CompletionKind.NO_SUCH_KIND ); - consume(IToken.tLPAREN); - String assembly = consume(IToken.tSTRING).getImage(); - consume(IToken.tRPAREN); - IToken last = consume(IToken.tSEMI); - IASTASMDefinition asmDefinition; - try - { - asmDefinition = - astFactory.createASMDefinition( - scope, - assembly, - first.getOffset(), - last.getEndOffset()); - } - catch (Exception e) - { - throw backtrack; - } - // if we made it this far, then we have all we need - // do the callback - asmDefinition.acceptElement(requestor); - return; - case IToken.t_namespace : - namespaceDefinition(scope); - return; - case IToken.t_using : - usingClause(scope); - return; - case IToken.t_export : - case IToken.t_template : - templateDeclaration(scope); - return; - case IToken.t_extern : - if (LT(2) == IToken.tSTRING) - { - linkageSpecification(scope); - return; - } - default : - simpleDeclarationStrategyUnion(scope, ownerTemplate); - } - setCurrentScope(scope); - setCompletionKeywords( Key.DECLARATION ); - - } - protected void simpleDeclarationStrategyUnion( - IASTScope scope, - IASTTemplate ownerTemplate) - throws EndOfFileException, BacktrackException - { - IToken mark = mark(); - - if( scope instanceof IASTClassSpecifier ) - setCompletionKind( CompletionKind.FIELD_TYPE ); - else if (scope instanceof IASTCodeScope) - setCompletionKind( CompletionKind.SINGLE_NAME_REFERENCE); - else - setCompletionKind( CompletionKind.VARIABLE_TYPE ); - try - { - simpleDeclaration( - SimpleDeclarationStrategy.TRY_CONSTRUCTOR, - scope, - ownerTemplate); - // try it first with the original strategy - } - catch (BacktrackException bt) - { - // did not work - backup(mark); - - try - { - simpleDeclaration( - SimpleDeclarationStrategy.TRY_FUNCTION, - scope, - ownerTemplate); - } - catch( BacktrackException bt2 ) - { - backup( mark ); - - try - { - simpleDeclaration( - SimpleDeclarationStrategy.TRY_VARIABLE, - scope, - ownerTemplate); - } - catch( BacktrackException b3 ) - { - backup( mark ); - throw b3; - } - } - } - } - /** - * Serves as the namespace declaration portion of the ANSI C++ grammar. - * - * namespace-definition: - * namespace identifier { namespace-body } | namespace { namespace-body } - * namespace-body: - * declaration-seq? - * @param container IParserCallback object which serves as the owner scope for this declaration. - * @throws BacktrackException request a backtrack - - */ - protected void namespaceDefinition(IASTScope scope) - throws BacktrackException, EndOfFileException - { - IToken first = consume(IToken.t_namespace); - - IToken identifier = null; - // optional name - if (LT(1) == IToken.tIDENTIFIER) - identifier = identifier(); - - if (LT(1) == IToken.tLBRACE) - { - consume(); - IASTNamespaceDefinition namespaceDefinition = null; - try - { - namespaceDefinition = - astFactory.createNamespaceDefinition( - scope, - (identifier == null ? "" : identifier.getImage()), - first.getOffset(), - (identifier == null ? first.getOffset() : identifier.getOffset()), - (identifier == null ? first.getEndOffset() : identifier.getEndOffset() )); - } - catch (Exception e1) - { - throw backtrack; - } - namespaceDefinition.enterScope( requestor ); - namepsaceDeclarationLoop : while (LT(1) != IToken.tRBRACE) - { - IToken checkToken = LA(1); - switch (LT(1)) - { - case IToken.tRBRACE : - //consume(Token.tRBRACE); - break namepsaceDeclarationLoop; - default : - try - { - declaration(namespaceDefinition, null); - } - catch (BacktrackException bt) - { - failParse(); - if (checkToken == LA(1)) - errorHandling(); - } - } - if (checkToken == LA(1)) - errorHandling(); - } - // consume the } - IToken last = consume(IToken.tRBRACE); - - namespaceDefinition.setEndingOffset( - last.getOffset() + last.getLength()); - namespaceDefinition.exitScope( requestor ); - } - else if( LT(1) == IToken.tASSIGN ) - { - consume( IToken.tASSIGN ); - - if( identifier == null ) - throw backtrack; - - ITokenDuple duple = name(); - consume( IToken.tSEMI ); - try - { - astFactory.createNamespaceAlias( - scope, identifier.getImage(), duple, first.getOffset(), - identifier.getOffset(), identifier.getEndOffset(), duple.getLastToken().getEndOffset() ); - } - catch (Exception e1) - { - throw backtrack; - } - } - else - { - throw backtrack; - } - } - /** - * Serves as the catch-all for all complicated declarations, including function-definitions. - * - * simpleDeclaration - * : (declSpecifier)* (initDeclarator ("," initDeclarator)*)? - * (";" | { functionBody } - * - * Notes: - * - append functionDefinition stuff to end of this rule - * - * To do: - * - work in functionTryBlock - * - * @param container IParserCallback object which serves as the owner scope for this declaration. - * @param tryConstructor true == take strategy1 (constructor ) : false == take strategy 2 ( pointer to function) - * @throws BacktrackException request a backtrack - */ - protected void simpleDeclaration( - SimpleDeclarationStrategy strategy, - IASTScope scope, - IASTTemplate ownerTemplate) - throws BacktrackException, EndOfFileException - { - IToken firstToken = LA(1); - DeclarationWrapper sdw = - new DeclarationWrapper(scope, firstToken.getOffset(), ownerTemplate); - - setCompletionKeywords( Key.DECL_SPECIFIER_SEQUENCE ); - declSpecifierSeq(sdw, false, strategy == SimpleDeclarationStrategy.TRY_CONSTRUCTOR ); - if (sdw.getTypeSpecifier() == null && sdw.getSimpleType() != IASTSimpleTypeSpecifier.Type.UNSPECIFIED ) - try - { - sdw.setTypeSpecifier( - astFactory.createSimpleTypeSpecifier( - scope, - sdw.getSimpleType(), - sdw.getName(), - sdw.isShort(), - sdw.isLong(), - sdw.isSigned(), - sdw.isUnsigned(), sdw.isTypeNamed(), sdw.isComplex(), sdw.isImaginary())); - } - catch (Exception e1) - { - throw backtrack; - } - - Declarator declarator = null; - if (LT(1) != IToken.tSEMI) - { - declarator = initDeclarator(sdw, strategy); - - while (LT(1) == IToken.tCOMMA) - { - consume(); - initDeclarator(sdw, strategy); - } - } - - boolean hasFunctionBody = false; - boolean hasFunctionTryBlock = false; - boolean consumedSemi = false; - - switch (LT(1)) - { - case IToken.tSEMI : - consume(IToken.tSEMI); - consumedSemi = true; - break; - case IToken.t_try : - consume( IToken.t_try ); - if( LT(1) == IToken.tCOLON ) - ctorInitializer( declarator ); - hasFunctionTryBlock = true; - declarator.setFunctionTryBlock( true ); - break; - case IToken.tCOLON : - ctorInitializer(declarator); - break; - case IToken.tLBRACE: - break; - default: - throw backtrack; - } - - if( ! consumedSemi ) - { - if( LT(1) == IToken.tLBRACE ) - { - if( firstToken == LA(1) ) - throw backtrack; - declarator.setHasFunctionBody(true); - hasFunctionBody = true; - } - - if( hasFunctionTryBlock && ! hasFunctionBody ) - throw backtrack; - } - - List l = null; - try - { - l = sdw.createASTNodes(astFactory); - } - catch (ASTSemanticException e) - { - throw backtrack; - } - Iterator i = l.iterator(); - if (hasFunctionBody && l.size() != 1) - { - throw backtrack; //TODO Should be an IProblem - } - if (i.hasNext()) // no need to do this unless we have a declarator - { - if (!hasFunctionBody) - { - while (i.hasNext()) - { - IASTDeclaration declaration = (IASTDeclaration)i.next(); - ((IASTOffsetableElement)declaration).setEndingOffset( - lastToken.getEndOffset()); - declaration.acceptElement( requestor ); - } - } - else - { - IASTDeclaration declaration = (IASTDeclaration)i.next(); - declaration.enterScope( requestor ); - - if ( !( declaration instanceof IASTScope ) ) - throw backtrack; - - handleFunctionBody((IASTScope)declaration, - sdw.isInline() ); - ((IASTOffsetableElement)declaration).setEndingOffset( - lastToken.getEndOffset()); - - declaration.exitScope( requestor ); - - if( hasFunctionTryBlock ) - catchHandlerSequence( scope ); - - } - } - else - { - try - { - astFactory - .createTypeSpecDeclaration( - sdw.getScope(), - sdw.getTypeSpecifier(), - ownerTemplate, - sdw.getStartingOffset(), - lastToken.getEndOffset()) - .acceptElement(requestor); - } - catch (Exception e1) - { - throw backtrack; - } - } - - } - protected abstract void handleFunctionBody(IASTScope scope, boolean isInlineFunction) throws BacktrackException, EndOfFileException; - - protected void skipOverCompoundStatement() throws BacktrackException, EndOfFileException - { - // speed up the parser by skiping the body - // simply look for matching brace and return - consume(IToken.tLBRACE); - int depth = 1; - while (depth > 0) - { - switch (consume().getType()) - { - case IToken.tRBRACE : - --depth; - break; - case IToken.tLBRACE : - ++depth; - break; - } - } - } - /** - * This method parses a constructor chain - * ctorinitializer: : meminitializerlist - * meminitializerlist: meminitializer | meminitializer , meminitializerlist - * meminitializer: meminitializerid | ( expressionlist? ) - * meminitializerid: ::? nestednamespecifier? - * classname - * identifier - * @param declarator IParserCallback object that represents the declarator (constructor) that owns this initializer - * @throws BacktrackException request a backtrack - */ - protected void ctorInitializer(Declarator d ) - throws EndOfFileException, BacktrackException - { - consume(IToken.tCOLON); - - try - { - for (;;) - { - if (LT(1) == IToken.tLBRACE) - break; - - - ITokenDuple duple = name(); - - consume(IToken.tLPAREN); - IASTExpression expressionList = null; - - expressionList = expression(d.getDeclarationWrapper().getScope()); - - consume(IToken.tRPAREN); - - try - { - d.addConstructorMemberInitializer( - astFactory.createConstructorMemberInitializer( - d.getDeclarationWrapper().getScope(), - duple, expressionList)); - } - catch (Exception e1) - { - throw backtrack; - } - if (LT(1) == IToken.tLBRACE) - break; - consume(IToken.tCOMMA); - } - } - catch (BacktrackException bt) - { - - throw backtrack; - } - - } - /** - * This routine parses a parameter declaration - * - * @param containerObject The IParserCallback object representing the parameterDeclarationClause owning the parm. - * @throws BacktrackException request a backtrack - */ - protected void parameterDeclaration( - IParameterCollection collection, IASTScope scope) - throws BacktrackException, EndOfFileException - { - IToken current = LA(1); - - DeclarationWrapper sdw = - new DeclarationWrapper(scope, current.getOffset(), null); - declSpecifierSeq(sdw, true, false); - if (sdw.getTypeSpecifier() == null - && sdw.getSimpleType() - != IASTSimpleTypeSpecifier.Type.UNSPECIFIED) - try - { - sdw.setTypeSpecifier( - astFactory.createSimpleTypeSpecifier( - scope, - sdw.getSimpleType(), - sdw.getName(), - sdw.isShort(), - sdw.isLong(), - sdw.isSigned(), - sdw.isUnsigned(), sdw.isTypeNamed(), sdw.isComplex(), sdw.isImaginary())); - } - catch (ASTSemanticException e) - { - throw backtrack; - } - catch (Exception e) - { - throw backtrack; - } - - if (LT(1) != IToken.tSEMI) - initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION ); - - if( lastToken != null ) - sdw.setEndingOffset( lastToken.getEndOffset() ); - - if (current == LA(1)) - throw backtrack; - collection.addParameter(sdw); - } - /** - * This class represents the state and strategy for parsing declarationSpecifierSequences - */ - private class Flags - { - private boolean encounteredTypename = false; - // have we encountered a typeName yet? - private boolean encounteredRawType = false; - // have we encountered a raw type yet? - private final boolean parm; - // is this for a simpleDeclaration or parameterDeclaration? - private final boolean constructor; - // are we attempting the constructor strategy? - public Flags(boolean parm, boolean c) - { - this.parm = parm; - constructor = c; - } - /** - * @return true if we have encountered a simple type up to this point, false otherwise - */ - public boolean haveEncounteredRawType() - { - return encounteredRawType; - } - /** - * @return true if we have encountered a typename up to this point, false otherwise - */ - public boolean haveEncounteredTypename() - { - return encounteredTypename; - } - /** - * @param b - set to true if we encounter a raw type (int, short, etc.) - */ - public void setEncounteredRawType(boolean b) - { - encounteredRawType = b; - } - /** - * @param b - set to true if we encounter a typename - */ - public void setEncounteredTypename(boolean b) - { - encounteredTypename = b; - } - /** - * @return true if we are parsing for a ParameterDeclaration - */ - public boolean isForParameterDeclaration() - { - return parm; - } - /** - * @return whether or not we are attempting the constructor strategy or not - */ - public boolean isForConstructor() - { - return constructor; - } - } - /** - * @param flags input flags that are used to make our decision - * @return whether or not this looks like a constructor (true or false) - * @throws EndOfFileException we could encounter EOF while looking ahead - */ - private boolean lookAheadForConstructorOrConversion(Flags flags, DeclarationWrapper sdw ) - throws EndOfFileException - { - if (flags.isForParameterDeclaration()) - return false; - if (LT(2) == IToken.tLPAREN && flags.isForConstructor()) - return true; - - IToken mark = mark(); - Declarator d = new Declarator( sdw ); - try - { - consumeTemplatedOperatorName( d ); - } - catch (BacktrackException e) - { - backup( mark ); - return false; - } - - ITokenDuple duple = d.getNameDuple(); - if( duple == null ) - { - backup( mark ); - return false; - } - - int lastColon = duple.findLastTokenType(IToken.tCOLON); - if( lastColon == -1 ) - { - int lt1 = LT(1); - backup( mark ); - return flags.isForConstructor() && (lt1 == IToken.tLPAREN); - } - - IToken className = null; - int index = lastColon - 1; - if( duple.getToken( index ).getType() == IToken.tGT ) - { - int depth = -1; - while( depth == -1 ) - { - if( duple.getToken( --index ).getType() == IToken.tLT ) - ++depth; - } - className = duple.getToken( index ); - } - - boolean result = className.getImage().equals( duple.getLastToken()); - backup( mark ); - return result; - } - /** - * @param flags input flags that are used to make our decision - * @return whether or not this looks like a a declarator follows - * @throws EndOfFileException we could encounter EOF while looking ahead - */ - private boolean lookAheadForDeclarator(Flags flags) throws EndOfFileException - { - return flags.haveEncounteredTypename() - && ((LT(2) != IToken.tIDENTIFIER - || (LT(3) != IToken.tLPAREN && LT(3) != IToken.tASSIGN)) - && !LA(2).isPointer()); - } - private void callbackSimpleDeclToken(Flags flags) throws BacktrackException, EndOfFileException - { - flags.setEncounteredRawType(true); - consume(); - } - /** - * This function parses a declaration specifier sequence, as according to the ANSI C++ spec. - * - * declSpecifier - * : "auto" | "register" | "static" | "extern" | "mutable" - * | "inline" | "virtual" | "explicit" - * | "char" | "wchar_t" | "bool" | "short" | "int" | "long" - * | "signed" | "unsigned" | "float" | "double" | "void" - * | "const" | "volatile" - * | "friend" | "typedef" - * | ("typename")? name - * | {"class"|"struct"|"union"} classSpecifier - * | {"enum"} enumSpecifier - * - * Notes: - * - folded in storageClassSpecifier, typeSpecifier, functionSpecifier - * - folded elaboratedTypeSpecifier into classSpecifier and enumSpecifier - * - find template names in name - * - * @param decl IParserCallback object representing the declaration that owns this specifier sequence - * @param parm Is this for a parameter declaration (true) or simple declaration (false) - * @param tryConstructor true for constructor, false for pointer to function strategy - * @throws BacktrackException request a backtrack - */ - protected void declSpecifierSeq( - DeclarationWrapper sdw, - boolean parm, - boolean tryConstructor ) - throws BacktrackException, EndOfFileException - { - Flags flags = new Flags(parm, tryConstructor); - IToken typeNameBegin = null; - IToken typeNameEnd = null; - declSpecifiers : for (;;) - { - switch (LT(1)) - { - case IToken.t_inline : - consume(); - sdw.setInline(true); - break; - case IToken.t_auto : - consume(); - sdw.setAuto(true); - break; - case IToken.t_register : - sdw.setRegister(true); - consume(); - break; - case IToken.t_static : - sdw.setStatic(true); - consume(); - break; - case IToken.t_extern : - sdw.setExtern(true); - consume(); - break; - case IToken.t_mutable : - sdw.setMutable(true); - consume(); - break; - case IToken.t_virtual : - sdw.setVirtual(true); - consume(); - break; - case IToken.t_explicit : - sdw.setExplicit(true); - consume(); - break; - case IToken.t_typedef : - sdw.setTypedef(true); - consume(); - break; - case IToken.t_friend : - sdw.setFriend(true); - consume(); - break; - case IToken.t_const : - sdw.setConst(true); - consume(); - break; - case IToken.t_volatile : - sdw.setVolatile(true); - consume(); - break; - case IToken.t_signed : - sdw.setSigned(true); - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT); - break; - case IToken.t_unsigned : - sdw.setUnsigned(true); - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT); - break; - case IToken.t_short : - sdw.setShort(true); - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT); - break; - case IToken.t_long : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT); - sdw.setLong(true); - break; - case IToken.t__Complex : - consume( IToken.t__Complex ); - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - sdw.setComplex( true ); - break; - case IToken.t__Imaginary : - consume( IToken.t__Imaginary ); - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - sdw.setImaginary( true ); - break; - case IToken.t_char : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.CHAR); - break; - case IToken.t_wchar_t : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType( - IASTSimpleTypeSpecifier.Type.WCHAR_T); - break; - case IToken.t_bool : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.BOOL); - break; - case IToken.t__Bool: - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type._BOOL); - break; - case IToken.t_int : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.INT); - break; - case IToken.t_float : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.FLOAT); - break; - case IToken.t_double : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType( - IASTSimpleTypeSpecifier.Type.DOUBLE); - break; - case IToken.t_void : - if (typeNameBegin == null) - typeNameBegin = LA(1); - typeNameEnd = LA(1); - callbackSimpleDeclToken(flags); - sdw.setSimpleType(IASTSimpleTypeSpecifier.Type.VOID); - break; - case IToken.t_typename : - sdw.setTypenamed(true); - consume(IToken.t_typename ); - IToken first = LA(1); - IToken last = null; - last = name().getLastToken(); - if (LT(1) == IToken.t_template) - { - consume(IToken.t_template); - last = templateId(); - } - ITokenDuple duple = new TokenDuple(first, last); - sdw.setTypeName(duple); - - break; - case IToken.tCOLONCOLON : - consume(IToken.tCOLONCOLON); - case IToken.tIDENTIFIER : - // TODO - Kludgy way to handle constructors/destructors - if (flags.haveEncounteredRawType()) - { - if (typeNameBegin != null) - sdw.setTypeName( - new TokenDuple(typeNameBegin, typeNameEnd)); - return; - } - if (parm && flags.haveEncounteredTypename()) - { - if (typeNameBegin != null) - sdw.setTypeName( - new TokenDuple(typeNameBegin, typeNameEnd)); - return; - } - if (lookAheadForConstructorOrConversion(flags, sdw)) - { - if (typeNameBegin != null) - sdw.setTypeName( - new TokenDuple(typeNameBegin, typeNameEnd)); - return; - } - if (lookAheadForDeclarator(flags)) - { - if (typeNameBegin != null) - sdw.setTypeName( - new TokenDuple(typeNameBegin, typeNameEnd)); - - return; - } - - ITokenDuple d = name(); - sdw.setTypeName(d); - sdw.setSimpleType( IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ); - flags.setEncounteredTypename(true); - break; - case IToken.t_class : - case IToken.t_struct : - case IToken.t_union : - try - { - classSpecifier(sdw); - flags.setEncounteredTypename(true); - break; - } - catch (BacktrackException bt) - { - elaboratedTypeSpecifier(sdw); - flags.setEncounteredTypename(true); - break; - } - case IToken.t_enum : - try - { - enumSpecifier(sdw); - flags.setEncounteredTypename(true); - break; - } - catch (BacktrackException bt) - { - // this is an elaborated class specifier - elaboratedTypeSpecifier(sdw); - flags.setEncounteredTypename(true); - break; - } - default : - break declSpecifiers; - } - } - if (typeNameBegin != null) - sdw.setTypeName(new TokenDuple(typeNameBegin, typeNameEnd)); - } - /** - * Parse an elaborated type specifier. - * - * @param decl Declaration which owns the elaborated type - * @throws BacktrackException request a backtrack - */ - protected void elaboratedTypeSpecifier(DeclarationWrapper sdw) - throws BacktrackException, EndOfFileException - { - // this is an elaborated class specifier - IToken t = consume(); - ASTClassKind eck = null; - switch (t.getType()) - { - case Token.t_class : - eck = ASTClassKind.CLASS; - break; - case Token.t_struct : - eck = ASTClassKind.STRUCT; - break; - case Token.t_union : - eck = ASTClassKind.UNION; - break; - case Token.t_enum : - eck = ASTClassKind.ENUM; - break; - default : - break; - } - - ITokenDuple d = name(); - IASTTypeSpecifier elaboratedTypeSpec = null; - final boolean isForewardDecl = ( LT(1) == IToken.tSEMI ); - - try - { - elaboratedTypeSpec = - astFactory.createElaboratedTypeSpecifier( - sdw.getScope(), - eck, - d, - t.getOffset(), - d.getLastToken().getEndOffset(), - isForewardDecl, sdw.isFriend() ); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - sdw.setTypeSpecifier(elaboratedTypeSpec); - - if( isForewardDecl ) - ((IASTElaboratedTypeSpecifier)elaboratedTypeSpec).acceptElement( requestor ); - } - /** - * Consumes template parameters. - * - * @param previousLast Previous "last" token (returned if nothing was consumed) - * @return Last consumed token, or previousLast if nothing was consumed - * @throws BacktrackException request a backtrack - */ - protected IToken consumeTemplateParameters(IToken previousLast) - throws EndOfFileException, BacktrackException - { - IToken last = previousLast; - if (LT(1) == IToken.tLT) - { - last = consume(IToken.tLT); - // until we get all the names sorted out - Stack scopes = new Stack(); - scopes.push(new Integer(IToken.tLT)); - - while (!scopes.empty()) - { - int top; - last = consume(); - - switch (last.getType()) { - case IToken.tGT : - if (((Integer)scopes.peek()).intValue() == IToken.tLT) { - scopes.pop(); - } - break; - case IToken.tRBRACKET : - do { - top = ((Integer)scopes.pop()).intValue(); - } while (!scopes.empty() && (top == IToken.tGT || top == IToken.tLT)); - if (top != IToken.tLBRACKET) throw backtrack; - - break; - case IToken.tRPAREN : - do { - top = ((Integer)scopes.pop()).intValue(); - } while (!scopes.empty() && (top == IToken.tGT || top == IToken.tLT)); - if (top != IToken.tLPAREN) throw backtrack; - - break; - case IToken.tLT : - case IToken.tLBRACKET: - case IToken.tLPAREN: - scopes.push(new Integer(last.getType())); - break; - } - } - } - return last; - } - /** - * Parse an identifier. - * - * @throws BacktrackException request a backtrack - */ - protected IToken identifier() throws EndOfFileException, BacktrackException - { - IToken first = consume(IToken.tIDENTIFIER); // throws backtrack if its not that - return first; - } - /** - * Parses a className. - * - * class-name: identifier | template-id - * - * @throws BacktrackException - */ - protected ITokenDuple className() throws EndOfFileException, BacktrackException - { - ITokenDuple duple = name(); - IToken last = duple.getLastToken(); - if (LT(1) == IToken.tLT) { - last = consumeTemplateParameters(duple.getLastToken()); - } - - return new TokenDuple(duple.getFirstToken(), last); - } - - /** - * Parse a template-id, according to the ANSI C++ spec. - * - * template-id: template-name < template-argument-list opt > - * template-name : identifier - * - * @return the last token that we consumed in a successful parse - * - * @throws BacktrackException request a backtrack - */ - protected IToken templateId() throws EndOfFileException, BacktrackException - { - ITokenDuple duple = name(); - IToken last = consumeTemplateParameters(duple.getLastToken()); - return last; - } - /** - * Parse a name. - * - * name - * : ("::")? name2 ("::" name2)* - * - * name2 - * : IDENTIFER - * - * @throws BacktrackException request a backtrack - */ - protected TokenDuple name() throws BacktrackException, EndOfFileException - { - IToken first = LA(1); - IToken last = null; - IToken mark = mark(); - - try - { - if (LT(1) == IToken.tCOLONCOLON) - last = consume( IToken.tCOLONCOLON ); - // TODO - whacky way to deal with destructors, please revisit - if (LT(1) == IToken.tCOMPL) - consume(); - switch (LT(1)) - { - case IToken.tIDENTIFIER : - last = consume(IToken.tIDENTIFIER); - IToken secondMark = null; - try - { - secondMark = mark(); - } - catch( OffsetLimitReachedException olre ) - { - return new TokenDuple(last, last); - } - try - { - last = consumeTemplateParameters(last); - } catch( BacktrackException bt ) - { - backup( secondMark ); - } - break; - default : - backup(mark); - throw backtrack; - } - while (LT(1) == IToken.tCOLONCOLON) - { - last = consume(); - if (LT(1) == IToken.t_template) - consume(); - if (LT(1) == IToken.tCOMPL) - consume(); - switch (LT(1)) - { - case IToken.t_operator : - backup(mark); - throw backtrack; - case IToken.tIDENTIFIER : - last = consume(); - last = consumeTemplateParameters(last); - } - } - - return new TokenDuple(first, last); - } catch( OffsetLimitReachedException olre ) - { - backup(mark); - throw backtrack; - } - } - /** - * Parse a const-volatile qualifier. - * - * cvQualifier - * : "const" | "volatile" - * - * TODO: fix this - * @param ptrOp Pointer Operator that const-volatile applies to. - * @return Returns the same object sent in. - * @throws BacktrackException - */ - protected IToken cvQualifier( - IDeclarator declarator) - throws EndOfFileException, BacktrackException - { - IToken result = null; - switch (LT(1)) - { - case IToken.t_const : - result = consume( IToken.t_const ); - declarator.addPointerOperator(ASTPointerOperator.CONST_POINTER); - break; - case IToken.t_volatile : - result = consume( IToken.t_volatile ); - declarator.addPointerOperator(ASTPointerOperator.VOLATILE_POINTER); - break; - case IToken.t_restrict : - if( language == ParserLanguage.C ) - { - result = consume( IToken.t_restrict ); - declarator.addPointerOperator(ASTPointerOperator.RESTRICT_POINTER); - break; - } - else - throw backtrack; - default : - - } - return result; - } - /** - * Parses the initDeclarator construct of the ANSI C++ spec. - * - * initDeclarator - * : declarator ("=" initializerClause | "(" expressionList ")")? - * @param owner IParserCallback object that represents the owner declaration object. - * @return declarator that this parsing produced. - * @throws BacktrackException request a backtrack - */ - protected Declarator initDeclarator( - DeclarationWrapper sdw, SimpleDeclarationStrategy strategy ) - throws EndOfFileException, BacktrackException - { - Declarator d = declarator(sdw, sdw.getScope(), strategy ); - if( language == ParserLanguage.CPP ) - optionalCPPInitializer(d); - else if( language == ParserLanguage.C ) - optionalCInitializer(d); - sdw.addDeclarator(d); - return d; - } - - protected void optionalCPPInitializer(Declarator d) - throws EndOfFileException, BacktrackException - { - // handle initializer - if (LT(1) == IToken.tASSIGN) - { - consume(IToken.tASSIGN); - d.setInitializerClause(initializerClause(d.getDeclarationWrapper().getScope())); - } - else if (LT(1) == IToken.tLPAREN ) - { - IToken mark = mark(); - // initializer in constructor - try - { - consume(IToken.tLPAREN); // EAT IT! - IASTExpression astExpression = null; - astExpression = expression(d.getDeclarationWrapper().getScope()); - consume(IToken.tRPAREN); - d.setConstructorExpression(astExpression); - } catch( BacktrackException bt ) - { - backup( mark ); - throw bt; - } - } - } - - protected void optionalCInitializer( Declarator d ) throws EndOfFileException, BacktrackException - { - if( LT(1) == IToken.tASSIGN ) - { - consume( IToken.tASSIGN ); - d.setInitializerClause( cInitializerClause(d.getDeclarationWrapper().getScope(), EMPTY_LIST ) ); - } - } - /** - * @param scope - * @return - */ - protected IASTInitializerClause cInitializerClause( - IASTScope scope, - List designators) - throws EndOfFileException, BacktrackException - { - if (LT(1) == IToken.tLBRACE) - { - consume(IToken.tLBRACE); - List initializerList = new ArrayList(); - for (;;) - { - // required at least one initializer list - // get designator list - List newDesignators = designatorList(scope); - if( newDesignators.size() != 0 ) - consume( IToken.tASSIGN ); - IASTInitializerClause initializer = - cInitializerClause(scope, newDesignators ); - initializerList.add(initializer); - // can end with just a '}' - if (LT(1) == IToken.tRBRACE) - break; - // can end with ", }" - if (LT(1) == IToken.tCOMMA) - consume(IToken.tCOMMA); - if (LT(1) == IToken.tRBRACE) - break; - // otherwise, its another initializer in the list - } - // consume the closing brace - consume(IToken.tRBRACE); - return astFactory.createInitializerClause( - scope, - ( - ( designators.size() == 0 ) ? - IASTInitializerClause.Kind.INITIALIZER_LIST : - IASTInitializerClause.Kind.DESIGNATED_INITIALIZER_LIST ), - null, initializerList, designators ); - } - // if we get this far, it means that we have not yet succeeded - // try this now instead - // assignmentExpression - try - { - IASTExpression assignmentExpression = assignmentExpression(scope); - try - { - return astFactory.createInitializerClause( - scope, - ( - ( designators.size() == 0 ) ? - IASTInitializerClause.Kind.ASSIGNMENT_EXPRESSION : - IASTInitializerClause.Kind.DESIGNATED_ASSIGNMENT_EXPRESSION ), - assignmentExpression, null, designators ); - } - catch (Exception e) - { - throw backtrack; - } - } - catch (BacktrackException b) - { - // do nothing - } - throw backtrack; - } - /** - * - */ - protected IASTInitializerClause initializerClause(IASTScope scope) - throws EndOfFileException, BacktrackException - { - if (LT(1) == IToken.tLBRACE) - { - consume(IToken.tLBRACE); - if (LT(1) == (IToken.tRBRACE)) - { - consume(IToken.tRBRACE); - try - { - return astFactory.createInitializerClause( - scope, - IASTInitializerClause.Kind.EMPTY, - null, null, EMPTY_LIST ); - } - catch (Exception e) - { - throw backtrack; - } - } - - // otherwise it is a list of initializer clauses - List initializerClauses = new ArrayList(); - for (;;) - { - IASTInitializerClause clause = initializerClause(scope); - initializerClauses.add(clause); - if (LT(1) == IToken.tRBRACE) - break; - consume(IToken.tCOMMA); - } - consume(IToken.tRBRACE); - try - { - return astFactory.createInitializerClause( - scope, - IASTInitializerClause.Kind.INITIALIZER_LIST, - null, initializerClauses, EMPTY_LIST ); - } - catch (Exception e) - { - throw backtrack; - } - } - - // if we get this far, it means that we did not - // try this now instead - // assignmentExpression - try - { - IASTExpression assignmentExpression = - assignmentExpression(scope); - - try - { - return astFactory.createInitializerClause( - scope, - IASTInitializerClause.Kind.ASSIGNMENT_EXPRESSION, - assignmentExpression, null, EMPTY_LIST ); - } - catch (Exception e) - { - throw backtrack; - } - } - catch (BacktrackException b) - { - // do nothing - } - catch ( EndOfFileException eof ) - { - - } - throw backtrack; - } - - protected List designatorList(IASTScope scope) throws EndOfFileException, BacktrackException - { - List designatorList = new ArrayList(); - // designated initializers for C - - if( LT(1) == IToken.tDOT || LT(1) == IToken.tLBRACKET ) - { - - while( LT(1) == IToken.tDOT || LT(1) == IToken.tLBRACKET ) - { - IToken id = null; - IASTExpression constantExpression = null; - IASTDesignator.DesignatorKind kind = null; - - if( LT(1) == IToken.tDOT ) - { - consume( IToken.tDOT ); - id = identifier(); - kind = IASTDesignator.DesignatorKind.FIELD; - } - else if( LT(1) == IToken.tLBRACKET ) - { - consume( IToken.tLBRACKET ); - constantExpression = expression( scope ); - consume( IToken.tRBRACKET ); - kind = IASTDesignator.DesignatorKind.SUBSCRIPT; - } - - IASTDesignator d = - astFactory.createDesignator( kind, constantExpression, id ); - designatorList.add( d ); - - } - } - return designatorList; - } - /** - * Parse a declarator, as according to the ANSI C++ specification. - * - * declarator - * : (ptrOperator)* directDeclarator - * - * directDeclarator - * : declaratorId - * | directDeclarator "(" parameterDeclarationClause ")" (cvQualifier)* - * (exceptionSpecification)* - * | directDeclarator "[" (constantExpression)? "]" - * | "(" declarator")" - * | directDeclarator "(" parameterDeclarationClause ")" (oldKRParameterDeclaration)* - * - * declaratorId - * : name - * - * @param container IParserCallback object that represents the owner declaration. - * @return declarator that this parsing produced. - * @throws BacktrackException request a backtrack - */ - protected Declarator declarator( - IDeclaratorOwner owner, IASTScope scope, SimpleDeclarationStrategy strategy ) - throws EndOfFileException, BacktrackException - { - Declarator d = null; - DeclarationWrapper sdw = owner.getDeclarationWrapper(); - overallLoop : do - { - d = new Declarator(owner); - - consumePointerOperators(d); - - if (LT(1) == IToken.tLPAREN) - { - consume(); - declarator(d, scope, strategy ); - consume(IToken.tRPAREN); - } - else - consumeTemplatedOperatorName(d); - - for (;;) - { - switch (LT(1)) - { - case IToken.tLPAREN : - - // temporary fix for initializer/function declaration ambiguity - if (!LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE ) - { - boolean failed = false; - if( LT(2) == IToken.tIDENTIFIER ) - { - IToken newMark = mark(); - consume( IToken.tLPAREN ); - - try - { - try - { - if( ! astFactory.queryIsTypeName( scope, name() ) ) - failed = true; - } - catch (Exception e) - { - throw backtrack; - } - } catch( BacktrackException b ) - { - failed = true; - } - - backup( newMark ); - } - if( !failed ) - { - // parameterDeclarationClause - d.setIsFunction(true); - // TODO need to create a temporary scope object here - consume(IToken.tLPAREN); - boolean seenParameter = false; - parameterDeclarationLoop : for (;;) - { - switch (LT(1)) - { - case IToken.tRPAREN : - consume(); - break parameterDeclarationLoop; - case IToken.tELLIPSIS : - consume(); - d.setIsVarArgs( true ); - break; - case IToken.tCOMMA : - consume(); - seenParameter = false; - break; - default : - if (seenParameter) - throw backtrack; - parameterDeclaration(d, scope); - seenParameter = true; - } - } - } - - if (LT(1) == IToken.tCOLON || LT(1) == IToken.t_try ) - break overallLoop; - - IToken beforeCVModifier = mark(); - IToken cvModifier = null; - IToken afterCVModifier = beforeCVModifier; - // const-volatile - // 2 options: either this is a marker for the method, - // or it might be the beginning of old K&R style parameter declaration, see - // void getenv(name) const char * name; {} - // This will be determined further below - if (LT(1) == IToken.t_const - || LT(1) == IToken.t_volatile) - { - cvModifier = consume(); - afterCVModifier = mark(); - } - //check for throws clause here - List exceptionSpecIds = null; - if (LT(1) == IToken.t_throw) - { - exceptionSpecIds = new ArrayList(); - consume(); // throw - consume(IToken.tLPAREN); // ( - boolean done = false; - IASTTypeId duple = null; - while (!done) - { - switch (LT(1)) - { - case IToken.tRPAREN : - consume(); - done = true; - break; - case IToken.tCOMMA : - consume(); - break; - default : - String image = LA(1).getImage(); - try - { - duple = typeId(scope, false); - exceptionSpecIds.add(duple); - } - catch (BacktrackException e) - { - failParse(); - log.traceLog( - "Unexpected Token =" - + image ); - consume(); - // eat this token anyway - continue; - } - break; - } - } - if (exceptionSpecIds != null) - try - { - d.setExceptionSpecification( - astFactory - .createExceptionSpecification( - d.getDeclarationWrapper().getScope(), exceptionSpecIds)); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - // check for optional pure virtual - if (LT(1) == IToken.tASSIGN - && LT(2) == IToken.tINTEGER - && LA(2).getImage().equals("0")) - { - consume(IToken.tASSIGN); - consume(IToken.tINTEGER); - d.setPureVirtual(true); - } - if (afterCVModifier != LA(1) - || LT(1) == IToken.tSEMI) - { - // There were C++-specific clauses after const/volatile modifier - // Then it is a marker for the method - if (cvModifier != null) - { - - if (cvModifier.getType() == IToken.t_const) - d.setConst(true); - if (cvModifier.getType() - == IToken.t_volatile) - d.setVolatile(true); - } - afterCVModifier = mark(); - // In this case (method) we can't expect K&R parameter declarations, - // but we'll check anyway, for errorhandling - } - } - break; - case IToken.tLBRACKET : - consumeArrayModifiers(d, sdw.getScope()); - continue; - case IToken.tCOLON : - consume(IToken.tCOLON); - IASTExpression exp = null; - exp = constantExpression(scope); - d.setBitFieldExpression(exp); - default : - break; - } - break; - } - if (LA(1).getType() != IToken.tIDENTIFIER) - break; - - } - while (true); - if (d.getOwner() instanceof IDeclarator) - ((Declarator)d.getOwner()).setOwnedDeclarator(d); - return d; - } - protected void consumeTemplatedOperatorName(Declarator d) - throws EndOfFileException, BacktrackException - { - if (LT(1) == IToken.t_operator) - operatorId(d, null); - else - { - try - { - ITokenDuple duple = name(); - d.setName(duple); - - } - catch (BacktrackException bt) - { - Declarator d1 = d; - Declarator d11 = d1; - IToken start = null; - IToken mark = mark(); - if (LT(1) == IToken.tCOLONCOLON - || LT(1) == IToken.tIDENTIFIER) - { - start = consume(); - IToken end = null; - if (start.getType() == IToken.tIDENTIFIER) - end = consumeTemplateParameters(end); - while (LT(1) == IToken.tCOLONCOLON - || LT(1) == IToken.tIDENTIFIER) - { - end = consume(); - if (end.getType() == IToken.tIDENTIFIER) - end = consumeTemplateParameters(end); - } - if (LT(1) == IToken.t_operator) - operatorId(d11, start); - else - { - backup(mark); - throw backtrack; - } - } - } - } - } - protected void consumeArrayModifiers( IDeclarator d, IASTScope scope ) - throws EndOfFileException, BacktrackException - { - while (LT(1) == IToken.tLBRACKET) - { - consume( IToken.tLBRACKET ); // eat the '[' - - IASTExpression exp = null; - if (LT(1) != IToken.tRBRACKET) - { - exp = constantExpression(scope); - } - consume(IToken.tRBRACKET); - IASTArrayModifier arrayMod; - try - { - arrayMod = astFactory.createArrayModifier(exp); - } - catch (Exception e) - { - throw backtrack; - } - d.addArrayModifier(arrayMod); - } - } - - protected void operatorId( - Declarator d, - IToken originalToken) - throws BacktrackException, EndOfFileException - { - // we know this is an operator - IToken operatorToken = consume(IToken.t_operator); - IToken toSend = null; - if (LA(1).isOperator() - || LT(1) == IToken.tLPAREN - || LT(1) == IToken.tLBRACKET) - { - if ((LT(1) == IToken.t_new || LT(1) == IToken.t_delete) - && LT(2) == IToken.tLBRACKET - && LT(3) == IToken.tRBRACKET) - { - consume(); - consume(IToken.tLBRACKET); - toSend = consume(IToken.tRBRACKET); - // vector new and delete operators - } - else if (LT(1) == IToken.tLPAREN && LT(2) == IToken.tRPAREN) - { - // operator () - consume(IToken.tLPAREN); - toSend = consume(IToken.tRPAREN); - } - else if (LT(1) == IToken.tLBRACKET && LT(2) == IToken.tRBRACKET) - { - consume(IToken.tLBRACKET); - toSend = consume(IToken.tRBRACKET); - } - else if (LA(1).isOperator()) - toSend = consume(); - else - throw backtrack; - } - else - { - // must be a conversion function - typeId(d.getDeclarationWrapper().getScope(), true ); - toSend = lastToken; - } - ITokenDuple duple = - new TokenDuple( - originalToken == null ? operatorToken : originalToken, - toSend); - - d.setName(duple); - } - /** - * Parse a Pointer Operator. - * - * ptrOperator - * : "*" (cvQualifier)* - * | "&" - * | ::? nestedNameSpecifier "*" (cvQualifier)* - * - * @param owner Declarator that this pointer operator corresponds to. - * @throws BacktrackException request a backtrack - */ - protected IToken consumePointerOperators(IDeclarator d) throws EndOfFileException, BacktrackException - { - IToken result = null; - for( ; ; ) - { - if (LT(1) == IToken.tAMPER) - { - result = consume( IToken.tAMPER ); - d.addPointerOperator(ASTPointerOperator.REFERENCE); - return result; - - } - IToken mark = mark(); - - ITokenDuple nameDuple = null; - if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON) - { - try - { - nameDuple = name(); - } - catch( BacktrackException bt ) - { - backup( mark ); - return null; - } - } - if ( LT(1) == IToken.tSTAR) - { - result = consume(Token.tSTAR); // tokenType = "*" - - d.setPointerOperatorName(nameDuple); - - IToken successful = null; - for (;;) - { - IToken newSuccess = cvQualifier(d); - if( newSuccess != null ) successful = newSuccess; - else break; - - } - - if( successful == null ) - { - d.addPointerOperator( ASTPointerOperator.POINTER ); - } - continue; - } - backup(mark); - return result; - } - } - /** - * Parse an enumeration specifier, as according to the ANSI specs in C & C++. - * - * enumSpecifier: - * "enum" (name)? "{" (enumerator-list) "}" - * enumerator-list: - * enumerator-definition - * enumerator-list , enumerator-definition - * enumerator-definition: - * enumerator - * enumerator = constant-expression - * enumerator: identifier - * - * @param owner IParserCallback object that represents the declaration that owns this type specifier. - * @throws BacktrackException request a backtrack - */ - protected void enumSpecifier(DeclarationWrapper sdw) - throws BacktrackException, EndOfFileException - { - IToken mark = mark(); - IToken identifier = null; - consume( IToken.t_enum ); - if (LT(1) == IToken.tIDENTIFIER) - { - identifier = identifier(); - } - if (LT(1) == IToken.tLBRACE) - { - IASTEnumerationSpecifier enumeration = null; - try - { - enumeration = astFactory.createEnumerationSpecifier( - sdw.getScope(), - ((identifier == null) ? "" : identifier.getImage()), - mark.getOffset(), - ((identifier == null) - ? mark.getOffset() - : identifier.getOffset()), - ((identifier == null)? mark.getEndOffset() - : identifier.getEndOffset())); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - consume(IToken.tLBRACE); - while (LT(1) != IToken.tRBRACE) - { - IToken enumeratorIdentifier = null; - if (LT(1) == IToken.tIDENTIFIER) - { - enumeratorIdentifier = identifier(); - } - else - { - throw backtrack; - } - IASTExpression initialValue = null; - if (LT(1) == IToken.tASSIGN) - { - consume(IToken.tASSIGN); - initialValue = constantExpression(sdw.getScope()); - } - - if (LT(1) == IToken.tRBRACE) - { - try - { - astFactory.addEnumerator( - enumeration, - enumeratorIdentifier.getImage(), - enumeratorIdentifier.getOffset(), - enumeratorIdentifier.getOffset(), - enumeratorIdentifier.getEndOffset(), enumeratorIdentifier.getEndOffset(), initialValue); - } - catch (ASTSemanticException e1) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - } - if (LT(1) != IToken.tCOMMA) - { - throw backtrack; - } - try - { - astFactory.addEnumerator( - enumeration, - enumeratorIdentifier.getImage(), - enumeratorIdentifier.getOffset(), - enumeratorIdentifier.getOffset(), - enumeratorIdentifier.getEndOffset(), enumeratorIdentifier.getEndOffset(), initialValue); - } - catch (ASTSemanticException e1) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - consume(IToken.tCOMMA); - } - IToken t = consume(IToken.tRBRACE); - enumeration.setEndingOffset(t.getEndOffset()); - enumeration.acceptElement( requestor ); - sdw.setTypeSpecifier(enumeration); - } - else - { - // enumSpecifierAbort - backup(mark); - throw backtrack; - } - } - /** - * Parse a class/struct/union definition. - * - * classSpecifier - * : classKey name (baseClause)? "{" (memberSpecification)* "}" - * - * @param owner IParserCallback object that represents the declaration that owns this classSpecifier - * @throws BacktrackException request a backtrack - */ - protected void classSpecifier(DeclarationWrapper sdw) - throws BacktrackException, EndOfFileException - { - ClassNameType nameType = ClassNameType.IDENTIFIER; - ASTClassKind classKind = null; - ASTAccessVisibility access = ASTAccessVisibility.PUBLIC; - IToken classKey = null; - IToken mark = mark(); - - // class key - switch (LT(1)) - { - case IToken.t_class : - classKey = consume(); - classKind = ASTClassKind.CLASS; - access = ASTAccessVisibility.PRIVATE; - break; - case IToken.t_struct : - classKey = consume(); - classKind = ASTClassKind.STRUCT; - break; - case IToken.t_union : - classKey = consume(); - classKind = ASTClassKind.UNION; - break; - default : - throw backtrack; - } - - - ITokenDuple duple = null; - - setCompletionKind( CompletionKind.USER_SPECIFIED_NAME ); - setCompletionKeywords( Key.EMPTY ); - // class name - if (LT(1) == IToken.tIDENTIFIER) - duple = className(); - if (duple != null && !duple.isIdentifier()) - nameType = ClassNameType.TEMPLATE; - if (LT(1) != IToken.tCOLON && LT(1) != IToken.tLBRACE) - { - backup(mark); - throw backtrack; - } - IASTClassSpecifier astClassSpecifier = null; - - try - { - astClassSpecifier = - astFactory - .createClassSpecifier( - sdw.getScope(), - duple, - classKind, - nameType, - access, - classKey.getOffset(), - duple == null ? classKey.getOffset() : duple.getFirstToken().getOffset(), - duple == null ? classKey.getEndOffset() : duple.getFirstToken().getEndOffset() ); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - sdw.setTypeSpecifier(astClassSpecifier); - // base clause - if (LT(1) == IToken.tCOLON) - { - baseSpecifier(astClassSpecifier); - } - if (LT(1) == IToken.tLBRACE) - { - consume(IToken.tLBRACE); - astClassSpecifier.enterScope( requestor ); - memberDeclarationLoop : while (LT(1) != IToken.tRBRACE) - { - IToken checkToken = LA(1); - switch (LT(1)) - { - case IToken.t_public : - consume(); - consume(IToken.tCOLON); - astClassSpecifier.setCurrentVisibility( ASTAccessVisibility.PUBLIC ); - break; - case IToken.t_protected : - consume(); - consume(IToken.tCOLON); - astClassSpecifier.setCurrentVisibility( ASTAccessVisibility.PROTECTED); - break; - - case IToken.t_private : - consume(); - consume(IToken.tCOLON); - astClassSpecifier.setCurrentVisibility( ASTAccessVisibility.PRIVATE); - break; - case IToken.tRBRACE : - consume(IToken.tRBRACE); - break memberDeclarationLoop; - default : - try - { - declaration(astClassSpecifier, null); - } - catch (BacktrackException bt) - { - failParse(); - if (checkToken == LA(1)) - errorHandling(); - } - } - if (checkToken == LA(1)) - errorHandling(); - } - // consume the } - IToken lt = consume(IToken.tRBRACE); - astClassSpecifier.setEndingOffset(lt.getEndOffset()); - - try - { - astFactory.signalEndOfClassSpecifier( astClassSpecifier ); - } - catch (Exception e1) - { - throw backtrack; - } - - astClassSpecifier.exitScope( requestor ); - - } - } - /** - * Parse the subclass-baseclauses for a class specification. - * - * baseclause: : basespecifierlist - * basespecifierlist: basespecifier - * basespecifierlist, basespecifier - * basespecifier: ::? nestednamespecifier? classname - * virtual accessspecifier? ::? nestednamespecifier? classname - * accessspecifier virtual? ::? nestednamespecifier? classname - * accessspecifier: private | protected | public - * @param classSpecOwner - * @throws BacktrackException - */ - protected void baseSpecifier( - IASTClassSpecifier astClassSpec) - throws EndOfFileException, BacktrackException - { - consume(IToken.tCOLON); - boolean isVirtual = false; - ASTAccessVisibility visibility = ASTAccessVisibility.PUBLIC; - ITokenDuple nameDuple = null; - baseSpecifierLoop : for (;;) - { - switch (LT(1)) - { - case IToken.t_virtual : - consume(IToken.t_virtual); - isVirtual = true; - break; - case IToken.t_public : - consume(); - break; - case IToken.t_protected : - consume(); - visibility = ASTAccessVisibility.PROTECTED; - break; - case IToken.t_private : - visibility = ASTAccessVisibility.PRIVATE; - consume(); - break; - case IToken.tCOLONCOLON : - case IToken.tIDENTIFIER : - nameDuple = name(); - break; - case IToken.tCOMMA : - try - { - astFactory.addBaseSpecifier( - astClassSpec, - isVirtual, - visibility, - nameDuple ); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - isVirtual = false; - visibility = ASTAccessVisibility.PUBLIC; - nameDuple = null; - consume(); - continue baseSpecifierLoop; - default : - break baseSpecifierLoop; - } - } - - try - { - astFactory.addBaseSpecifier( - astClassSpec, - isVirtual, - visibility, - nameDuple ); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * Parses a function body. - * - * @throws BacktrackException request a backtrack - */ - protected void functionBody( IASTScope scope ) throws EndOfFileException, BacktrackException - { - compoundStatement( scope, false ); - } - /** - * Parses a statement. - * - * @throws BacktrackException request a backtrack - */ - protected void statement(IASTScope scope) throws EndOfFileException, BacktrackException - { - setCurrentScope(scope); - - setCompletionKind( CompletionKind.STATEMENT_START ); - setCompletionKeywords( Key.STATEMENT ); - - switch (LT(1)) - { - case IToken.t_case : - consume(IToken.t_case); - IASTExpression constant_expression = constantExpression(scope); - constant_expression.acceptElement(requestor); - consume(IToken.tCOLON); - statement(scope); - return; - case IToken.t_default : - consume(IToken.t_default); - consume(IToken.tCOLON); - statement(scope); - return; - case IToken.tLBRACE : - compoundStatement(scope, true); - return; - case IToken.t_if : - consume( IToken.t_if ); - consume(IToken.tLPAREN); - condition( scope ); - consume(IToken.tRPAREN); - if( LT(1) != IToken.tLBRACE ) - singleStatementScope(scope); - else - statement( scope ); - if (LT(1) == IToken.t_else) - { - consume( IToken.t_else ); - if( LT(1) != IToken.tLBRACE ) - singleStatementScope(scope); - else - statement( scope ); - } - return; - case IToken.t_switch : - consume(); - consume(IToken.tLPAREN); - condition(scope); - consume(IToken.tRPAREN); - statement(scope); - return; - case IToken.t_while : - consume(IToken.t_while); - consume(IToken.tLPAREN); - condition(scope); - consume(IToken.tRPAREN); - if( LT(1) != IToken.tLBRACE ) - singleStatementScope(scope); - else - statement(scope); - return; - case IToken.t_do : - consume(IToken.t_do); - if( LT(1) != IToken.tLBRACE ) - singleStatementScope(scope); - else - statement(scope); - consume(IToken.t_while); - consume(IToken.tLPAREN); - condition(scope); - consume(IToken.tRPAREN); - return; - case IToken.t_for : - consume(); - consume(IToken.tLPAREN); - forInitStatement(scope); - if (LT(1) != IToken.tSEMI) - condition(scope); - consume(IToken.tSEMI); - if (LT(1) != IToken.tRPAREN) - { - IASTExpression finalExpression = expression(scope); - finalExpression.acceptElement(requestor); - } - consume(IToken.tRPAREN); - statement(scope); - return; - case IToken.t_break : - consume(); - consume(IToken.tSEMI); - return; - case IToken.t_continue : - consume(); - consume(IToken.tSEMI); - return; - case IToken.t_return : - consume(); - if (LT(1) != IToken.tSEMI) - { - IASTExpression retVal = expression(scope); - retVal.acceptElement(requestor); - } - consume(IToken.tSEMI); - return; - case IToken.t_goto : - consume(); - consume(IToken.tIDENTIFIER); - consume(IToken.tSEMI); - return; - case IToken.t_try : - consume(); - compoundStatement(scope,true); - catchHandlerSequence(scope); - return; - case IToken.tSEMI : - consume(); - return; - default : - // can be many things: - // label - - try - { - if (LT(1) == IToken.tIDENTIFIER && LT(2) == IToken.tCOLON) - { - consume(IToken.tIDENTIFIER); - consume(IToken.tCOLON); - statement(scope); - return; - } - }catch( OffsetLimitReachedException olre ) - { - // ok - } - // expressionStatement - // Note: the function style cast ambiguity is handled in expression - // Since it only happens when we are in a statement - IToken mark = mark(); - try - { - IASTExpression thisExpression = expression(scope); - if( queryLookaheadCapability() ) - consume(IToken.tSEMI); - else - throw new EndOfFileException(); - thisExpression.acceptElement( requestor ); - return; - } - catch (BacktrackException b) - { - backup( mark ); - } - catch( OffsetLimitReachedException olre ) - { - backup(mark); - } - - // declarationStatement - declaration(scope, null); - } - - } - protected void catchHandlerSequence(IASTScope scope) - throws EndOfFileException, BacktrackException - { - if( LT(1) != IToken.t_catch ) - throw backtrack; // error, need at least one of these - while (LT(1) == IToken.t_catch) - { - consume(IToken.t_catch); - consume(IToken.tLPAREN); - if( LT(1) == IToken.tELLIPSIS ) - consume( IToken.tELLIPSIS ); - else - declaration(scope, null); // was exceptionDeclaration - consume(IToken.tRPAREN); - - catchBlockCompoundStatement(scope); - } - } - - protected abstract void catchBlockCompoundStatement(IASTScope scope) throws BacktrackException, EndOfFileException; - - protected void singleStatementScope(IASTScope scope) throws EndOfFileException, BacktrackException - { - IASTCodeScope newScope; - try - { - newScope = astFactory.createNewCodeBlock(scope); - } - catch (Exception e) - { - throw backtrack; - } - newScope.enterScope( requestor ); - try - { - statement( newScope ); - } - finally - { - newScope.exitScope( requestor ); - } - } - - /** - * @throws BacktrackException - */ - protected void condition( IASTScope scope ) throws BacktrackException, EndOfFileException - { - IASTExpression someExpression = expression( scope ); - someExpression.acceptElement(requestor); - //TODO type-specifier-seq declarator = assignment expression - } - - /** - * @throws BacktrackException - */ - protected void forInitStatement( IASTScope scope ) throws BacktrackException, EndOfFileException - { - try - { - simpleDeclarationStrategyUnion(scope,null); - } - catch( BacktrackException bt ) - { - try - { - IASTExpression e = expression( scope ); - e.acceptElement(requestor); - } - catch( BacktrackException b ) - { - failParse(); - throw b; - } - } - - } - /** - * @throws BacktrackException - */ - protected void compoundStatement( IASTScope scope, boolean createNewScope ) throws EndOfFileException, BacktrackException - { - consume(IToken.tLBRACE); - - IASTCodeScope newScope = null; - if( createNewScope ) - { - try - { - newScope = astFactory.createNewCodeBlock(scope); - } - catch (Exception e) - { - throw backtrack; - } - newScope.enterScope( requestor ); - } - IToken checkToken = null; - setCurrentScope(createNewScope ? newScope : scope); - setCompletionKind( CompletionKind.STATEMENT_START ); - while (queryLookaheadCapability() && LT(1) != IToken.tRBRACE) - { - checkToken = LA(1); - setCurrentScope(createNewScope ? newScope : scope); - try - { - statement(createNewScope ? newScope : scope ); - } - catch( BacktrackException b ) - { - failParse(); - if( LA(1) == checkToken ) - errorHandling(); - } - setCurrentScope(createNewScope ? newScope : scope); - - setCompletionKind( CompletionKind.STATEMENT_START ); - setCompletionKeywords( Key.STATEMENT ); - } - - if( queryLookaheadCapability() ) consume(IToken.tRBRACE); - else throw new EndOfFileException(); - if( createNewScope ) - newScope.exitScope( requestor ); - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression constantExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - return conditionalExpression(scope); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParser#expression(java.lang.Object) - */ - public IASTExpression expression(IASTScope scope) throws BacktrackException, EndOfFileException - { - IASTExpression assignmentExpression = assignmentExpression(scope); - if( !queryLookaheadCapability() ) return assignmentExpression; - while (LT(1) == IToken.tCOMMA) - { - consume(); - IASTExpression secondExpression = assignmentExpression(scope); - try - { - assignmentExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.EXPRESSIONLIST, - assignmentExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - return assignmentExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression assignmentExpression(IASTScope scope) - throws EndOfFileException, BacktrackException { - if (LT(1) == IToken.t_throw) { - return throwExpression(scope); - } - IASTExpression conditionalExpression = conditionalExpression(scope); - // if the condition not taken, try assignment operators - if (conditionalExpression != null - && conditionalExpression.getExpressionKind() - == IASTExpression.Kind.CONDITIONALEXPRESSION) - return conditionalExpression; - if( !queryLookaheadCapability() ) return conditionalExpression; - switch (LT(1)) { - case IToken.tASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_NORMAL, - conditionalExpression); - case IToken.tSTARASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_MULT, - conditionalExpression); - case IToken.tDIVASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_DIV, - conditionalExpression); - case IToken.tMODASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_MOD, - conditionalExpression); - case IToken.tPLUSASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_PLUS, - conditionalExpression); - case IToken.tMINUSASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_MINUS, - conditionalExpression); - case IToken.tSHIFTRASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_RSHIFT, - conditionalExpression); - case IToken.tSHIFTLASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_LSHIFT, - conditionalExpression); - case IToken.tAMPERASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_AND, - conditionalExpression); - case IToken.tXORASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_XOR, - conditionalExpression); - case IToken.tBITORASSIGN : - return assignmentOperatorExpression( - scope, - IASTExpression.Kind.ASSIGNMENTEXPRESSION_OR, - conditionalExpression); - } - return conditionalExpression; - } - protected IASTExpression assignmentOperatorExpression( - IASTScope scope, - IASTExpression.Kind kind, IASTExpression lhs ) - throws EndOfFileException, BacktrackException - { - consume(); - IASTExpression assignmentExpression = assignmentExpression(scope); - - try - { - return astFactory.createExpression( - scope, - kind, - lhs, - assignmentExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression throwExpression( IASTScope scope ) - throws EndOfFileException, BacktrackException - { - consume(IToken.t_throw); - IASTExpression throwExpression = null; - try - { - throwExpression = expression(scope); - } - catch (BacktrackException b) - { - } - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.THROWEXPRESSION, - throwExpression, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * @param expression - * @return - * @throws BacktrackException - */ - protected IASTExpression conditionalExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = logicalOrExpression(scope); - if( !queryLookaheadCapability() ) return firstExpression; - if (LT(1) == IToken.tQUESTION) - { - consume(); - IASTExpression secondExpression = expression(scope); - consume(IToken.tCOLON); - IASTExpression thirdExpression = assignmentExpression(scope); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.CONDITIONALEXPRESSION, - firstExpression, - secondExpression, - thirdExpression, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - else - return firstExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression logicalOrExpression(IASTScope scope) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = logicalAndExpression(scope); - if( !queryLookaheadCapability() ) return firstExpression; - while (LT(1) == IToken.tOR) - { - consume(); - IASTExpression secondExpression = logicalAndExpression(scope); - - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.LOGICALOREXPRESSION, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - return firstExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression logicalAndExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = inclusiveOrExpression( scope ); - if( !queryLookaheadCapability() ) return firstExpression; - while (LT(1) == IToken.tAND) - { - consume(); - IASTExpression secondExpression = inclusiveOrExpression( scope ); - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.LOGICALANDEXPRESSION, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - return firstExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression inclusiveOrExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = exclusiveOrExpression(scope); - if( !queryLookaheadCapability() ) return firstExpression; - while (LT(1) == IToken.tBITOR) - { - consume(); - IASTExpression secondExpression = exclusiveOrExpression(scope); - - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.INCLUSIVEOREXPRESSION, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - return firstExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression exclusiveOrExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = andExpression( scope ); - if( !queryLookaheadCapability() ) return firstExpression; - while (LT(1) == IToken.tXOR) - { - consume(); - - IASTExpression secondExpression = andExpression( scope ); - - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.EXCLUSIVEOREXPRESSION, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - return firstExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression andExpression(IASTScope scope) throws EndOfFileException, BacktrackException - { - IASTExpression firstExpression = equalityExpression(scope); - if( !queryLookaheadCapability() ) return firstExpression; - while (LT(1) == IToken.tAMPER) - { - consume(); - IASTExpression secondExpression = equalityExpression(scope); - - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.ANDEXPRESSION, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - return firstExpression; - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression equalityExpression( IASTScope scope ) - throws EndOfFileException, BacktrackException - { - IASTExpression firstExpression = relationalExpression(scope); - for (;;) - { - if( !queryLookaheadCapability() ) return firstExpression; - switch (LT(1)) - { - case IToken.tEQUAL : - case IToken.tNOTEQUAL : - IToken t = consume(); - IASTExpression secondExpression = - relationalExpression(scope); - - try - { - firstExpression = - astFactory.createExpression( - scope, - (t.getType() == IToken.tEQUAL) - ? IASTExpression.Kind.EQUALITY_EQUALS - : IASTExpression.Kind.EQUALITY_NOTEQUALS, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - default : - return firstExpression; - } - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression relationalExpression(IASTScope scope) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = shiftExpression(scope); - for (;;) - { - if( !queryLookaheadCapability() ) return firstExpression; - switch (LT(1)) - { - case IToken.tGT : - case IToken.tLT : - case IToken.tLTEQUAL : - case IToken.tGTEQUAL : - IToken mark = mark(); - IToken t = consume(); - IToken next = LA(1); - IASTExpression secondExpression = - shiftExpression(scope); - if (next == LA(1)) - { - // we did not consume anything - // this is most likely an error - backup(mark); - return firstExpression; - } - else - { - IASTExpression.Kind kind = null; - switch (t.getType()) - { - case IToken.tGT : - kind = - IASTExpression.Kind.RELATIONAL_GREATERTHAN; - break; - case IToken.tLT : - kind = IASTExpression.Kind.RELATIONAL_LESSTHAN; - break; - case IToken.tLTEQUAL : - kind = - IASTExpression - .Kind - .RELATIONAL_LESSTHANEQUALTO; - break; - case IToken.tGTEQUAL : - kind = - IASTExpression - .Kind - .RELATIONAL_GREATERTHANEQUALTO; - break; - } - try - { - firstExpression = - astFactory.createExpression( - scope, - kind, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - break; - default : - return firstExpression; - } - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression shiftExpression(IASTScope scope) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = additiveExpression(scope); - for (;;) - { - if( !queryLookaheadCapability() ) return firstExpression; - switch (LT(1)) - { - case IToken.tSHIFTL : - case IToken.tSHIFTR : - IToken t = consume(); - IASTExpression secondExpression = - additiveExpression(scope); - try - { - firstExpression = - astFactory.createExpression( - scope, - ((t.getType() == IToken.tSHIFTL) - ? IASTExpression.Kind.SHIFT_LEFT - : IASTExpression.Kind.SHIFT_RIGHT), - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - default : - return firstExpression; - } - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression additiveExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = multiplicativeExpression( scope ); - for (;;) - { - if( !queryLookaheadCapability() ) return firstExpression; - switch (LT(1)) - { - case IToken.tPLUS : - case IToken.tMINUS : - IToken t = consume(); - IASTExpression secondExpression = - multiplicativeExpression(scope); - try - { - firstExpression = - astFactory.createExpression( - scope, - ((t.getType() == IToken.tPLUS) - ? IASTExpression.Kind.ADDITIVE_PLUS - : IASTExpression.Kind.ADDITIVE_MINUS), - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - default : - return firstExpression; - } - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression multiplicativeExpression( IASTScope scope ) - throws BacktrackException, EndOfFileException - { - IASTExpression firstExpression = pmExpression(scope); - for (;;) - { - if( !queryLookaheadCapability() ) return firstExpression; - switch (LT(1)) - { - case IToken.tSTAR : - case IToken.tDIV : - case IToken.tMOD : - IToken t = consume(); - IASTExpression secondExpression = pmExpression(scope); - IASTExpression.Kind kind = null; - switch (t.getType()) - { - case IToken.tSTAR : - kind = IASTExpression.Kind.MULTIPLICATIVE_MULTIPLY; - break; - case IToken.tDIV : - kind = IASTExpression.Kind.MULTIPLICATIVE_DIVIDE; - break; - case IToken.tMOD : - kind = IASTExpression.Kind.MULTIPLICATIVE_MODULUS; - break; - } - try - { - firstExpression = - astFactory.createExpression( - scope, - kind, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - default : - return firstExpression; - } - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression pmExpression( IASTScope scope ) throws EndOfFileException, BacktrackException - { - IASTExpression firstExpression = castExpression(scope); - for (;;) - { - if( ! queryLookaheadCapability() ) return firstExpression; - switch (LT(1)) - { - case IToken.tDOTSTAR : - case IToken.tARROWSTAR : - IToken t = consume(); - IASTExpression secondExpression = - castExpression(scope); - try - { - firstExpression = - astFactory.createExpression( - scope, - ((t.getType() == IToken.tDOTSTAR) - ? IASTExpression.Kind.PM_DOTSTAR - : IASTExpression.Kind.PM_ARROWSTAR), - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - default : - return firstExpression; - } - } - } - /** - * castExpression - * : unaryExpression - * | "(" typeId ")" castExpression - */ - protected IASTExpression castExpression( IASTScope scope ) throws EndOfFileException, BacktrackException - { - // TO DO: we need proper symbol checkint to ensure type name - if( ! queryLookaheadCapability() ) return unaryExpression(scope); - if (LT(1) == IToken.tLPAREN) - { - IToken mark = mark(); - consume(); - IASTTypeId typeId = null; - // If this isn't a type name, then we shouldn't be here - try - { - typeId = typeId(scope, false); - consume(IToken.tRPAREN); - IASTExpression castExpression = castExpression(scope); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.CASTEXPRESSION, - castExpression, - null, - null, - typeId, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - catch (BacktrackException b) - { - backup(mark); - } - } - return unaryExpression(scope); - - } - - /** - * @throws BacktrackException - */ - protected IASTTypeId typeId(IASTScope scope, boolean skipArrayModifiers ) throws EndOfFileException, BacktrackException - { - IToken mark = mark(); - ITokenDuple name = null; - boolean isConst = false, isVolatile = false; - boolean isSigned = false, isUnsigned = false; - boolean isShort = false, isLong = false; - boolean isTypename = false; - - IASTSimpleTypeSpecifier.Type kind = null; - do - { - try - { - name = name(); - kind = IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME; - break; - } - catch (BacktrackException b) - { - // do nothing - } - - boolean encounteredType = false; - simpleMods : for (;;) - { - switch (LT(1)) - { - case IToken.t_signed : - consume(); - isSigned = true; - break; - - case IToken.t_unsigned : - consume(); - isUnsigned = true; - break; - - case IToken.t_short : - consume(); - isShort = true; - break; - - case IToken.t_long : - consume(); - isLong = true; - break; - - case IToken.t_const : - consume(); - isConst = true; - break; - - case IToken.t_volatile : - consume(); - isVolatile = true; - break; - - case IToken.tIDENTIFIER : - if( encounteredType ) break simpleMods; - encounteredType = true; - name = name(); - kind = IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME; - break; - - case IToken.t_int : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.INT; - consume(); - break; - - case IToken.t_char : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.CHAR; - consume(); - break; - - case IToken.t_bool : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.BOOL; - consume(); - break; - - case IToken.t_double : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.DOUBLE; - consume(); - break; - - case IToken.t_float : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.FLOAT; - consume(); - break; - - case IToken.t_wchar_t : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.WCHAR_T; - consume(); - break; - - - case IToken.t_void : - if( encounteredType ) break simpleMods; - encounteredType = true; - kind = IASTSimpleTypeSpecifier.Type.VOID; - consume(); - break; - - - default : - break simpleMods; - } - } - - if( kind != null ) break; - - if( isShort || isLong || isUnsigned || isSigned ) - { - kind = IASTSimpleTypeSpecifier.Type.INT; - break; - } - - if ( - LT(1) == IToken.t_typename - || LT(1) == IToken.t_struct - || LT(1) == IToken.t_class - || LT(1) == IToken.t_enum - || LT(1) == IToken.t_union) - { - consume(); - try - { - name = name(); - kind = IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME; - } catch( BacktrackException b ) - { - backup( mark ); - throw backtrack; - } - } - - } while( false ); - - if( kind == null ) - throw backtrack; - - TypeId id = new TypeId(); - IToken last = lastToken; - - lastToken = consumeTemplateParameters( last ); - if( lastToken == null ) lastToken = last; - - consumePointerOperators( id ); - if( lastToken == null ) lastToken = last; - - if( ! skipArrayModifiers ) - { - last = lastToken; - consumeArrayModifiers( id, scope ); - if( lastToken == null ) lastToken = last; - } - - try - { - return astFactory.createTypeId( scope, kind, isConst, isVolatile, isShort, isLong, isSigned, isUnsigned, isTypename, name, id.getPointerOperators(), id.getArrayModifiers()); - } - catch (ASTSemanticException e) - { - backup( mark ); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression deleteExpression( IASTScope scope ) - throws EndOfFileException, BacktrackException - { - if (LT(1) == IToken.tCOLONCOLON) - { - // global scope - consume(); - } - consume(IToken.t_delete); - boolean vectored = false; - if (LT(1) == IToken.tLBRACKET) - { - // array delete - consume(); - consume(IToken.tRBRACKET); - vectored = true; - } - IASTExpression castExpression = castExpression(scope); - try - { - return astFactory.createExpression( - scope, - (vectored - ? IASTExpression.Kind.DELETE_VECTORCASTEXPRESSION - : IASTExpression.Kind.DELETE_CASTEXPRESSION), - castExpression, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * Pazse a new-expression. - * - * @param expression - * @throws BacktrackException - * - * - * newexpression: ::? new newplacement? newtypeid newinitializer? - * ::? new newplacement? ( typeid ) newinitializer? - * newplacement: ( expressionlist ) - * newtypeid: typespecifierseq newdeclarator? - * newdeclarator: ptroperator newdeclarator? | directnewdeclarator - * directnewdeclarator: [ expression ] - * directnewdeclarator [ constantexpression ] - * newinitializer: ( expressionlist? ) - */ - protected IASTExpression newExpression( IASTScope scope ) throws BacktrackException, EndOfFileException - { - if (LT(1) == IToken.tCOLONCOLON) - { - // global scope - consume(); - } - consume(IToken.t_new); - boolean typeIdInParen = false; - boolean placementParseFailure = true; - IToken beforeSecondParen = null; - IToken backtrackMarker = null; - IASTTypeId typeId = null; - ArrayList newPlacementExpressions = new ArrayList(); - ArrayList newTypeIdExpressions = new ArrayList(); - ArrayList newInitializerExpressions = new ArrayList(); - - if (LT(1) == IToken.tLPAREN) - { - consume(IToken.tLPAREN); - try - { - // Try to consume placement list - // Note: since expressionList and expression are the same... - backtrackMarker = mark(); - newPlacementExpressions.add(expression(scope)); - consume(IToken.tRPAREN); - placementParseFailure = false; - if (LT(1) == IToken.tLPAREN) - { - beforeSecondParen = mark(); - consume(IToken.tLPAREN); - typeIdInParen = true; - } - } - catch (BacktrackException e) - { - backup(backtrackMarker); - } - if (placementParseFailure) - { - // CASE: new (typeid-not-looking-as-placement) ... - // the first expression in () is not a placement - // - then it has to be typeId - typeId = typeId(scope, true ); - consume(IToken.tRPAREN); - } - else - { - if (!typeIdInParen) - { - if (LT(1) == IToken.tLBRACKET) - { - // CASE: new (typeid-looking-as-placement) [expr]... - // the first expression in () has been parsed as a placement; - // however, we assume that it was in fact typeId, and this - // new statement creates an array. - // Do nothing, fallback to array/initializer processing - } - else - { - // CASE: new (placement) typeid ... - // the first expression in () is parsed as a placement, - // and the next expression doesn't start with '(' or '[' - // - then it has to be typeId - try - { - backtrackMarker = mark(); - typeId = typeId(scope, true); - } - catch (BacktrackException e) - { - // Hmmm, so it wasn't typeId after all... Then it is - // CASE: new (typeid-looking-as-placement) - backup(backtrackMarker); - // TODO fix this - return null; - } - } - } - else - { - // Tricky cases: first expression in () is parsed as a placement, - // and the next expression starts with '('. - // The problem is, the first expression might as well be a typeid - try - { - typeId = typeId(scope, true); - consume(IToken.tRPAREN); - if (LT(1) == IToken.tLPAREN - || LT(1) == IToken.tLBRACKET) - { - // CASE: new (placement)(typeid)(initializer) - // CASE: new (placement)(typeid)[] ... - // Great, so far all our assumptions have been correct - // Do nothing, fallback to array/initializer processing - } - else - { - // CASE: new (placement)(typeid) - // CASE: new (typeid-looking-as-placement)(initializer-looking-as-typeid) - // Worst-case scenario - this cannot be resolved w/o more semantic information. - // Luckily, we don't need to know what was that - we only know that - // new-expression ends here. - try - { - return astFactory.createExpression( - scope, IASTExpression.Kind.NEW_TYPEID, - null, null, null, typeId, null, - "", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - } - catch (BacktrackException e) - { - // CASE: new (typeid-looking-as-placement)(initializer-not-looking-as-typeid) - // Fallback to initializer processing - backup(beforeSecondParen); - } - } - } - } - else - { - // CASE: new typeid ... - // new parameters do not start with '(' - // i.e it has to be a plain typeId - typeId = typeId(scope, true); - } - while (LT(1) == IToken.tLBRACKET) - { - // array new - consume(); - newTypeIdExpressions.add(assignmentExpression(scope)); - consume(IToken.tRBRACKET); - } - // newinitializer - if (LT(1) == IToken.tLPAREN) - { - consume(IToken.tLPAREN); - if (LT(1) != IToken.tRPAREN) - newInitializerExpressions.add(expression(scope)); - consume(IToken.tRPAREN); - } - try - { - return astFactory.createExpression( - scope, IASTExpression.Kind.NEW_TYPEID, - null, null, null, typeId, null, - "", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); - } - catch (ASTSemanticException e) - { - return null; - } catch (Exception e) - { - throw backtrack; - } - } - protected IASTExpression unaryOperatorCastExpression( IASTScope scope, - IASTExpression.Kind kind) - throws EndOfFileException, BacktrackException - { - IASTExpression castExpression = castExpression(scope); - try - { - return astFactory.createExpression( - scope, - kind, - castExpression, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression unaryExpression( IASTScope scope ) - throws EndOfFileException, BacktrackException - { - if( ! queryLookaheadCapability() ) return postfixExpression( scope ); - switch (LT(1)) - { - case IToken.tSTAR : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_STAR_CASTEXPRESSION); - case IToken.tAMPER : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_AMPSND_CASTEXPRESSION); - case IToken.tPLUS : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_PLUS_CASTEXPRESSION); - case IToken.tMINUS : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_MINUS_CASTEXPRESSION); - case IToken.tNOT : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_NOT_CASTEXPRESSION); - case IToken.tCOMPL : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_TILDE_CASTEXPRESSION); - case IToken.tINCR : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_INCREMENT); - case IToken.tDECR : - consume(); - return unaryOperatorCastExpression(scope, - IASTExpression.Kind.UNARY_DECREMENT); - case IToken.t_sizeof : - consume(IToken.t_sizeof); - IToken mark = LA(1); - IASTTypeId d = null; - IASTExpression unaryExpression = null; - if (LT(1) == IToken.tLPAREN) - { - try - { - consume(IToken.tLPAREN); - d = typeId(scope, false); - consume(IToken.tRPAREN); - } - catch (BacktrackException bt) - { - backup(mark); - unaryExpression = unaryExpression(scope); - } - } - else - { - unaryExpression = unaryExpression(scope); - } - if (d != null & unaryExpression == null) - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.UNARY_SIZEOF_TYPEID, - null, - null, - null, - d, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - else if (unaryExpression != null && d == null) - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.UNARY_SIZEOF_UNARYEXPRESSION, - unaryExpression, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e1) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - else - throw backtrack; - case IToken.t_new : - return newExpression(scope); - case IToken.t_delete : - return deleteExpression(scope); - case IToken.tCOLONCOLON : - switch (LT(2)) - { - case IToken.t_new : - return newExpression(scope); - case IToken.t_delete : - return deleteExpression(scope); - default : - return postfixExpression(scope); - } - default : - return postfixExpression(scope); - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression postfixExpression( IASTScope scope ) - throws EndOfFileException, BacktrackException - { - IASTExpression firstExpression = null; - boolean isTemplate = false; - - if( ! queryLookaheadCapability() ) return primaryExpression(scope); - switch (LT(1)) - { - case IToken.t_typename : - consume(IToken.t_typename); - ITokenDuple nestedName = name(); - boolean templateTokenConsumed = false; - if( LT(1) == IToken.t_template ) - { - consume( IToken.t_template ); - templateTokenConsumed = true; - } - IToken current = mark(); - ITokenDuple templateId = null; - try - { - templateId = new TokenDuple( current, templateId() ); - } - catch( BacktrackException bt ) - { - if( templateTokenConsumed ) - throw bt; - backup( current ); - } - consume( IToken.tLPAREN ); - IASTExpression expressionList = expression( scope ); - consume( IToken.tRPAREN ); - try { - firstExpression = - astFactory.createExpression( scope, - (( templateId != null )? IASTExpression.Kind.POSTFIX_TYPENAME_TEMPLATEID : IASTExpression.Kind.POSTFIX_TYPENAME_IDENTIFIER ), - expressionList, - null, - null, - null, - nestedName, - "", - null ); - } catch (ASTSemanticException ase ) { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - // simple-type-specifier ( assignment-expression , .. ) - case IToken.t_char : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_CHAR); - break; - case IToken.t_wchar_t : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_WCHART); - break; - case IToken.t_bool : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_BOOL); - break; - case IToken.t_short : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_SHORT); - break; - case IToken.t_int : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_INT); - break; - case IToken.t_long : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_LONG); - break; - case IToken.t_signed : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_SIGNED); - break; - case IToken.t_unsigned : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_UNSIGNED); - break; - case IToken.t_float : - firstExpression = - simpleTypeConstructorExpression(scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_FLOAT); - break; - case IToken.t_double : - firstExpression = - simpleTypeConstructorExpression( scope, - IASTExpression.Kind.POSTFIX_SIMPLETYPE_DOUBLE); - break; - case IToken.t_dynamic_cast : - firstExpression = - specialCastExpression(scope, - IASTExpression.Kind.POSTFIX_DYNAMIC_CAST); - break; - case IToken.t_static_cast : - firstExpression = - specialCastExpression(scope, - IASTExpression.Kind.POSTFIX_STATIC_CAST); - break; - case IToken.t_reinterpret_cast : - firstExpression = - specialCastExpression(scope, - IASTExpression.Kind.POSTFIX_REINTERPRET_CAST); - break; - case IToken.t_const_cast : - firstExpression = - specialCastExpression(scope, - IASTExpression.Kind.POSTFIX_CONST_CAST); - break; - case IToken.t_typeid : - consume(); - consume(IToken.tLPAREN); - boolean isTypeId = true; - IASTExpression lhs = null; - IASTTypeId typeId = null; - try - { - typeId = typeId(scope, false); - } - catch (BacktrackException b) - { - isTypeId = false; - lhs = expression(scope); - } - consume(IToken.tRPAREN); - try - { - firstExpression = - astFactory.createExpression( - scope, - (isTypeId - ? IASTExpression.Kind.POSTFIX_TYPEID_TYPEID - : IASTExpression.Kind.POSTFIX_TYPEID_EXPRESSION), - lhs, - null, - null, - typeId, - null, "", null); - } - catch (ASTSemanticException e6) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - default : - firstExpression = primaryExpression(scope); - } - IASTExpression secondExpression = null; - for (;;) - { - if( ! queryLookaheadCapability() )return firstExpression; - switch (LT(1)) - { - case IToken.tLBRACKET : - // array access - consume(); - secondExpression = expression(scope); - consume(IToken.tRBRACKET); - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.POSTFIX_SUBSCRIPT, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e2) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - case IToken.tLPAREN : - // function call - consume(IToken.tLPAREN); - secondExpression = expression(scope); - consume(IToken.tRPAREN); - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.POSTFIX_FUNCTIONCALL, - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e3) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - case IToken.tINCR : - consume(); - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.POSTFIX_INCREMENT, - firstExpression, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e1) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - case IToken.tDECR : - consume(); - try - { - firstExpression = - astFactory.createExpression( - scope, - IASTExpression.Kind.POSTFIX_DECREMENT, - firstExpression, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e4) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - break; - case IToken.tDOT : - // member access - consume(IToken.tDOT); - - try - { - if (LT(1) == IToken.t_template) - { - consume(IToken.t_template); - isTemplate = true; - } - } catch( OffsetLimitReachedException olre ) - { - setCompletionToken( null ); - } - - IASTNode context = astFactory.getCompletionContext( (isTemplate - ? IASTExpression.Kind.POSTFIX_DOT_TEMPL_IDEXPRESS - : IASTExpression.Kind.POSTFIX_DOT_IDEXPRESSION), - firstExpression ); - setCompletionContext( context ); - setCompletionKind( IASTCompletionNode.CompletionKind.MEMBER_REFERENCE ); - - secondExpression = primaryExpression(scope); - try - { - firstExpression = - astFactory.createExpression( - scope, - (isTemplate - ? IASTExpression.Kind.POSTFIX_DOT_TEMPL_IDEXPRESS - : IASTExpression.Kind.POSTFIX_DOT_IDEXPRESSION), - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e5) - { - failParse(); - setCompletionContext( null ); - throw backtrack; - } catch (Exception e) - { - setCompletionContext( null ); - throw backtrack; - } - - break; - case IToken.tARROW : - // member access - consume(IToken.tARROW); - - try - { - if (LT(1) == IToken.t_template) - { - consume(IToken.t_template); - isTemplate = true; - } - } catch( OffsetLimitReachedException olre ) - { - setCompletionToken( null ); - } - - context = astFactory.getCompletionContext( (isTemplate - ? IASTExpression.Kind.POSTFIX_ARROW_TEMPL_IDEXP - : IASTExpression.Kind.POSTFIX_ARROW_IDEXPRESSION), - firstExpression ); - setCompletionContext( context ); - setCompletionKind( IASTCompletionNode.CompletionKind.MEMBER_REFERENCE ); - - secondExpression = primaryExpression(scope); - try - { - firstExpression = - astFactory.createExpression( - scope, - (isTemplate - ? IASTExpression.Kind.POSTFIX_ARROW_TEMPL_IDEXP - : IASTExpression.Kind.POSTFIX_ARROW_IDEXPRESSION), - firstExpression, - secondExpression, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - failParse(); - setCompletionContext( null ); - throw backtrack; - } catch (Exception e) - { - setCompletionContext( null ); - throw backtrack; - } - break; - default : - return firstExpression; - } - } - } - - - - /** - * @return - * @throws EndOfFileException - */ - protected boolean queryLookaheadCapability() throws EndOfFileException { - //make sure we can look ahead one before doing this - boolean result = true; - try - { - LA(1); - } - catch( OffsetLimitReachedException olre ) - { - result = false; - } - return result; - } - protected IASTExpression specialCastExpression( IASTScope scope, - IASTExpression.Kind kind) - throws EndOfFileException, BacktrackException - { - consume(); - consume(IToken.tLT); - IASTTypeId duple = typeId(scope, false); - consume(IToken.tGT); - consume(IToken.tLPAREN); - IASTExpression lhs = expression(scope); - consume(IToken.tRPAREN); - try - { - return astFactory.createExpression( - scope, - kind, - lhs, - null, - null, - duple, - null, "", null); - } - catch (ASTSemanticException e) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - protected IASTExpression simpleTypeConstructorExpression( IASTScope scope, - Kind type) - throws EndOfFileException, BacktrackException - { - consume(); - consume(IToken.tLPAREN); - IASTExpression inside = expression(scope); - consume(IToken.tRPAREN); - try - { - return astFactory.createExpression( - scope, - type, - inside, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e) - { - failParse(); - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - } - /** - * @param expression - * @throws BacktrackException - */ - protected IASTExpression primaryExpression( IASTScope scope ) - throws EndOfFileException, BacktrackException - { - IToken t = null; - IASTExpression emptyExpression = null; - try { - emptyExpression = astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_EMPTY, - null, - null, - null, - null, - null, "", null); - } catch (ASTSemanticException e9) { - // TODO Auto-generated catch block - e9.printStackTrace(); - } - if( !queryLookaheadCapability() ) return emptyExpression; - switch (LT(1)) - { - // TO DO: we need more literals... - case IToken.tINTEGER : - t = consume(); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_INTEGER_LITERAL, - null, - null, - null, - null, - null, t.getImage(), null); - } - catch (ASTSemanticException e1) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - case IToken.tFLOATINGPT : - t = consume(); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_FLOAT_LITERAL, - null, - null, - null, - null, - null, t.getImage(), null); - } - catch (ASTSemanticException e2) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - case IToken.tSTRING : - case IToken.tLSTRING : - t = consume(); - try - { - return astFactory.createExpression( scope, IASTExpression.Kind.PRIMARY_STRING_LITERAL, null, null, null, null, null, t.getImage(), null ); - } - catch (ASTSemanticException e5) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - - case IToken.t_false : - case IToken.t_true : - t = consume(); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_BOOLEAN_LITERAL, - null, - null, - null, - null, - null, t.getImage(), null); - } - catch (ASTSemanticException e3) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - - case IToken.tCHAR : - case IToken.tLCHAR : - - t = consume(); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_CHAR_LITERAL, - null, - null, - null, - null, - null, t.getImage(), null); - } - catch (ASTSemanticException e4) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - - case IToken.t_this : - consume(IToken.t_this); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_THIS, - null, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e7) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - case IToken.tLPAREN : - consume(); - IASTExpression lhs = expression(scope); - consume(IToken.tRPAREN); - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.PRIMARY_BRACKETED_EXPRESSION, - lhs, - null, - null, - null, - null, "", null); - } - catch (ASTSemanticException e6) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - case IToken.tIDENTIFIER : - case IToken.tCOLONCOLON : - case IToken.t_operator : - ITokenDuple duple = null; - - IToken mark = mark(); - try - { - duple = name(); - } - catch( BacktrackException bt ) - { - Declarator d = new Declarator( new DeclarationWrapper(scope, 0, null) ); - - if (LT(1) == IToken.tCOLONCOLON || LT(1) == IToken.tIDENTIFIER) - { - IToken start = consume(); - IToken end = null; - if (start.getType() == IToken.tIDENTIFIER) - end = consumeTemplateParameters(end); - while (LT(1) == IToken.tCOLONCOLON || LT(1) == IToken.tIDENTIFIER) - { - end = consume(); - if (end.getType() == IToken.tIDENTIFIER) - end = consumeTemplateParameters(end); - } - if (LT(1) == IToken.t_operator) - operatorId(d, start); - else - { - backup(mark); - throw backtrack; - } - } - else if( LT(1) == IToken.t_operator ) - operatorId( d, null); - - duple = d.getNameDuple(); - } - catch(OffsetLimitReachedException olre ) - { - backup(mark); - throw backtrack; - } - - - try - { - return astFactory.createExpression( - scope, - IASTExpression.Kind.ID_EXPRESSION, - null, - null, - null, - null, - duple, "", null); - } - catch (ASTSemanticException e8) - { - throw backtrack; - } catch (Exception e) - { - throw backtrack; - } - default : - return emptyExpression; - } - } - /** - * @throws Exception - */ - protected void varName() throws Exception - { - if (LT(1) == IToken.tCOLONCOLON) - consume(); - for (;;) - { - switch (LT(1)) - { - case IToken.tIDENTIFIER : - consume(); - //if (isTemplateArgs()) { - // rTemplateArgs(); - //} - if (LT(1) == IToken.tCOLONCOLON) - { - switch (LT(2)) - { - case IToken.tIDENTIFIER : - case IToken.tCOMPL : - case IToken.t_operator : - consume(); - break; - default : - return; - } - } - else - return; - break; - case IToken.tCOMPL : - consume(); - consume(IToken.tIDENTIFIER); - return; - case IToken.t_operator : - consume(); - //rOperatorName(); - return; - default : - throw backtrack; - } - } - } - - // the static instance we always use - private static BacktrackException backtrack = new BacktrackException(); - - // Token management - protected IScanner scanner; - protected IToken currToken, // current token we plan to consume next - lastToken; // last token we consumed - private boolean limitReached = false; - - protected void setCurrentScope( IASTScope scope ) - { - } - - /** - * Fetches a token from the scanner. - * - * @return the next token from the scanner - * @throws EndOfFileException thrown when the scanner.nextToken() yields no tokens - */ - protected IToken fetchToken() throws EndOfFileException - { - if(limitReached) throw new OffsetLimitReachedException(getCompletionToken()); - - try - { - return scanner.nextToken(); - } - catch( OffsetLimitReachedException olre ) - { - limitReached = true; - handleOffsetLimitException(olre); - return null; - } - catch (ScannerException e) - { - log.traceLog( "ScannerException thrown : " + e.getProblem().getMessage() ); - log.errorLog( "Scanner Exception: " + e.getProblem().getMessage()); //$NON-NLS-1$h - failParse(); - return fetchToken(); - } - } - - protected void handleOffsetLimitException(OffsetLimitReachedException exception) throws EndOfFileException { - // unexpected, throw EOF instead (equivalent) - throw new EndOfFileException(); - } - /** - * Look Ahead in the token list to see what is coming. - * - * @param i How far ahead do you wish to peek? - * @return the token you wish to observe - * @throws EndOfFileException if looking ahead encounters EOF, throw EndOfFile - */ - protected IToken LA(int i) throws EndOfFileException - { - if (i < 1) // can't go backwards - return null; - if (currToken == null) - currToken = fetchToken(); - IToken retToken = currToken; - for (; i > 1; --i) - { - retToken = retToken.getNext(); - if (retToken == null) - retToken = fetchToken(); - } - return retToken; - } - /** - * Look ahead in the token list and return the token type. - * - * @param i How far ahead do you wish to peek? - * @return The type of that token - * @throws EndOfFileException if looking ahead encounters EOF, throw EndOfFile - */ - protected int LT(int i) throws EndOfFileException - { - return LA(i).getType(); - } - /** - * Consume the next token available, regardless of the type. - * - * @return The token that was consumed and removed from our buffer. - * @throws EndOfFileException If there is no token to consume. - */ - protected IToken consume() throws EndOfFileException - { - if (currToken == null) - currToken = fetchToken(); - if (currToken != null) - lastToken = currToken; - currToken = currToken.getNext(); - return lastToken; - } - /** - * Consume the next token available only if the type is as specified. - * - * @param type The type of token that you are expecting. - * @return the token that was consumed and removed from our buffer. - * @throws BacktrackException If LT(1) != type - */ - protected IToken consume(int type) throws EndOfFileException, BacktrackException - { - if (LT(1) == type) - return consume(); - else - throw backtrack; - } - /** - * Mark our place in the buffer so that we could return to it should we have to. - * - * @return The current token. - * @throws EndOfFileException If there are no more tokens. - */ - protected IToken mark() throws EndOfFileException - { - if (currToken == null) - currToken = fetchToken(); - return currToken; - } - /** - * Rollback to a previous point, reseting the queue of tokens. - * - * @param mark The point that we wish to restore to. - * - */ - protected void backup(IToken mark) - { - currToken = (Token)mark; - lastToken = null; // this is not entirely right ... - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParser#getLanguage() - */ - public ParserLanguage getLanguage() - { - return language; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParser#setLanguage(Language) - */ - public void setLanguage( ParserLanguage l ) - { - language = l; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IParser#getLastErrorOffset() - */ - public int getLastErrorOffset() - { - return firstErrorOffset; - } - - protected void setCompletionContext( IASTNode node ) - { - } - - protected void setCompletionKind( IASTCompletionNode.CompletionKind kind ) - { - } - - protected void setCompletionKeywords(KeywordSets.Key key ) - { - } - - protected void setCompletionToken( IToken token ) - { - } - - protected IToken getCompletionToken() - { - return null; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserException.java deleted file mode 100644 index d50223aebef..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserException.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser; - - -public class ParserException extends Exception { - - public ParserException( String msg ) - { - super( msg ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java deleted file mode 100644 index 43c78edf831..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java +++ /dev/null @@ -1,63 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.io.Reader; - -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IPreprocessor; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerException; - - -/** - * @author jcamelon - * - */ -public class Preprocessor extends Scanner implements IPreprocessor { - - /** - * @param reader - * @param filename - * @param defns - */ - public Preprocessor(Reader reader, String filename, IScannerInfo info, ISourceElementRequestor requestor, ParserMode mode, ParserLanguage language, IParserLogService logService ) { - super(reader, filename, info, requestor, mode, language, logService ); - } - - public void process() - { - try - { - while( true ) - nextToken(); - } - catch( ScannerException se ) - { - // callback IProblem here - log.errorLog("Preprocessor Exception "+ se.getProblem().getMessage()); //$NON-NLS-1$h - } - catch( OffsetLimitReachedException olre ) - { - // callback IProblem here - log.errorLog("Preprocessor Exception "+ olre.getMessage()); //$NON-NLS-1$h - } - catch( EndOfFileException eof ) - { - // expected - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Problem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Problem.java deleted file mode 100644 index 3470108560f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Problem.java +++ /dev/null @@ -1,118 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Map; - -import org.eclipse.cdt.core.parser.IProblem; - -/** - * @author jcamelon - * - */ -public class Problem implements IProblem { - - private final Map arguments; - private final int id; - private final int sourceStart; - private final int sourceEnd; - private final int lineNumber; - - private final boolean isError; - private final boolean isWarning; - private final char[] originatingFileName; - private final String message; - - public Problem( int id, int start, int end, int line, char [] file, String message, Map arguments, boolean warn, boolean error ) - { - this.id = id; - this.sourceStart = start; - this.sourceEnd = end; - this.lineNumber = line; - this.originatingFileName = file; - this.message = message; - this.arguments = arguments; - this.isWarning = warn; - this.isError = error; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#getID() - */ - public int getID() { - return id; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#getOriginatingFileName() - */ - public char[] getOriginatingFileName() { - return originatingFileName; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#getSourceEnd() - */ - public int getSourceEnd() { - return sourceEnd; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#getSourceLineNumber() - */ - public int getSourceLineNumber() { - return lineNumber; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#getSourceStart() - */ - public int getSourceStart() { - return sourceStart; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#isError() - */ - public boolean isError() { - return isError; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#isWarning() - */ - public boolean isWarning() { - return isWarning; - } - - - public String getMessage() - { - return message; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#checkCategory(int) - */ - public boolean checkCategory(int bitmask) { - return ((id & bitmask) != 0 ); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IProblem#getArguments() - */ - public Map getArguments() { - return arguments; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java deleted file mode 100644 index cf413b3291c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java +++ /dev/null @@ -1,197 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -import org.eclipse.cdt.core.parser.*; -import org.eclipse.cdt.core.parser.IQuickParseCallback; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement; - - -public class QuickParseCallback extends NullSourceElementRequestor implements IQuickParseCallback -{ - protected IASTCompilationUnit compilationUnit = null; - protected List inclusions = new ArrayList(); - protected List macros = new ArrayList(); - - public Iterator getInclusions() - { - return inclusions.iterator(); - } - - public Iterator getMacros() - { - return macros.iterator(); - } - - public Iterator getDeclarations(){ - try{ - return compilationUnit.getDeclarations(); - } - catch (ASTNotImplementedException ne ) - { - return null; - } - } - - public void exitMethodBody( IASTMethod method ) - { - method.setHasFunctionBody( true ); - } - - - public void exitFunctionBody( IASTFunction function ) - { - function.setHasFunctionBody( true ); - } - - - - public void exitCompilationUnit( IASTCompilationUnit compilationUnit ) - { - this.compilationUnit = compilationUnit; - } - - public void exitInclusion( IASTInclusion inclusion ) - { - inclusions.add( inclusion ); - } - - public void acceptMacro( IASTMacro macro ) - { - macros.add( macro ); - } - - /** - * @return - */ - public IASTCompilationUnit getCompilationUnit() - { - return compilationUnit; - } - - public class OffsetableIterator implements Iterator - { - private Iterator declarationIter; - private final Iterator inclusionIter; - private final Iterator macroIter; - - private IASTOffsetableElement currentMacro = null, currentInclusion= null, currentDeclaration= null; - - public OffsetableIterator() - { - declarationIter = getDeclarations(); - inclusionIter = getInclusions(); - macroIter = getMacros(); - updateInclusionIterator(); - updateMacroIterator(); - updateDeclarationIterator(); - } - - private Object updateDeclarationIterator() - { - Object offsetable = currentDeclaration; - if(declarationIter != null) - currentDeclaration = ( declarationIter.hasNext() ) ? (IASTOffsetableElement)declarationIter.next() : null; - return offsetable; - } - - private Object updateMacroIterator() - { - Object offsetable = currentMacro; - currentMacro = ( macroIter.hasNext() ) ? (IASTOffsetableElement)macroIter.next() : null; - return offsetable; - } - - private Object updateInclusionIterator() - { - Object offsetable = currentInclusion; - currentInclusion = ( inclusionIter.hasNext() ) ? (IASTOffsetableElement)inclusionIter.next() : null; - return offsetable; - } - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() { - return (( currentMacro == null && currentInclusion == null && currentDeclaration == null ) ? - false : true); - } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() { - // case 1: all are null - if( ! hasNext() ) - throw new NoSuchElementException(); - - // case 2: two of three are null - if( currentMacro == null && currentInclusion == null ) - return updateDeclarationIterator(); - if( currentDeclaration == null && currentInclusion == null ) - return updateMacroIterator(); - if( currentMacro == null && currentDeclaration == null ) - return updateInclusionIterator(); - - // case 3: 1 is null - if( currentMacro == null ) - if( currentDeclaration.getStartingOffset() < currentInclusion.getStartingOffset() ) - return updateDeclarationIterator(); - else - return updateInclusionIterator(); - - if( currentInclusion == null ) - if( currentDeclaration.getStartingOffset() < currentMacro.getStartingOffset() ) - return updateDeclarationIterator(); - else - return updateMacroIterator(); - - if( currentDeclaration == null ) - if( currentInclusion.getStartingOffset() < currentMacro.getStartingOffset() ) - return updateInclusionIterator(); - else - return updateMacroIterator(); - - // case 4: none are null - if( currentInclusion.getStartingOffset() < currentMacro.getStartingOffset() && - currentInclusion.getStartingOffset() < currentDeclaration.getStartingOffset() ) - return updateInclusionIterator(); - - if( currentMacro.getStartingOffset() < currentInclusion.getStartingOffset() && - currentMacro.getStartingOffset() < currentDeclaration.getStartingOffset() ) - return updateMacroIterator(); - // only remaining case - return updateDeclarationIterator(); - } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() { - throw new UnsupportedOperationException( "OffsetableIterator is a const iterator"); - } - } - - public Iterator iterateOffsetableElements() - { - return new OffsetableIterator(); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParser.java deleted file mode 100644 index a5c05a5d58d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParser.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.parser.BacktrackException; -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - */ -public class QuickParser extends Parser { - - /** - * @param scanner - * @param callback - * @param mode - * @param language - * @param log - */ - public QuickParser(IScanner scanner, ISourceElementRequestor callback, ParserLanguage language, IParserLogService log) { - super(scanner, callback, language, log); - astFactory = ParserFactory.createASTFactory( ParserMode.QUICK_PARSE, language); - scanner.setASTFactory(astFactory); - } - - protected void handleFunctionBody(IASTScope scope, boolean isInlineFunction) throws BacktrackException, EndOfFileException - { - skipOverCompoundStatement(); - } - - protected void catchBlockCompoundStatement(IASTScope scope) throws BacktrackException, EndOfFileException - { - skipOverCompoundStatement(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int) - */ - public IASTCompletionNode parse(int offset) throws ParserNotImplementedException { - throw new ParserNotImplementedException(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int, int) - */ - public IASTNode parse(int startingOffset, int endingOffset) throws ParserNotImplementedException { - throw new ParserNotImplementedException(); - } - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java deleted file mode 100644 index 6b6959b3384..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java +++ /dev/null @@ -1,2749 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.EmptyStackException; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.Vector; - -import org.eclipse.cdt.core.parser.BacktrackException; -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.ILineOffsetReconciler; -import org.eclipse.cdt.core.parser.IMacroDescriptor; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.Keywords; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerException; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.ExpressionEvaluationException; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTFactory; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; - -/** - * @author jcamelon - * - */ - -public class Scanner implements IScanner { - - - protected final IParserLogService log; - private final static String SCRATCH = ""; - private Reader backupReader; - private IProblemFactory problemFactory = new ScannerProblemFactory(); - private boolean initialContextInitialized = false; - private final String filename; - private final Reader reader; - protected IToken finalToken; - - protected void handleProblem( int problemID, String argument, int beginningOffset, boolean warning, boolean error ) throws ScannerException - { - handleProblem( problemID, argument, beginningOffset, warning, error, true ); - } - - protected void handleProblem( int problemID, String argument, int beginningOffset, boolean warning, boolean error, boolean extra ) throws ScannerException - { - Map arguments = new HashMap(); - if( argument != null ) - { - String attributes [] = problemFactory.getRequiredAttributesForId( problemID ); - arguments.put( attributes[ 0 ], argument ); - } - IProblem p = problemFactory.createProblem( problemID, beginningOffset, getCurrentOffset(), contextStack.getCurrentLineNumber(), getCurrentFile().toCharArray(), arguments, warning, error ); - if( (! requestor.acceptProblem( p )) && extra ) - throw new ScannerException( p ); - } - - public Scanner(Reader reader, String filename, IScannerInfo info, ISourceElementRequestor requestor, ParserMode parserMode, ParserLanguage language, IParserLogService log ) { - this.log = log; - this.requestor = requestor; - this.mode = parserMode; - this.filename = filename; - this.reader = reader; - this.language = language; - astFactory = ParserFactory.createASTFactory( mode, language ); - this.backupReader = reader; - contextStack = new ContextStack( log ); - try { - //this is a hack to get around a sudden EOF experience - contextStack.push( - new ScannerContext( - new StringReader("\n"), - START, - ScannerContext.ContextKind.SENTINEL, null), requestor); - - } catch( ContextException ce ) { - //won't happen since we aren't adding an include or a macro - } - - originalConfig = info; - if( info.getDefinedSymbols() != null ) - definitions.putAll( info.getDefinedSymbols() ); - - if( info.getIncludePaths() != null ) - overwriteIncludePath( info.getIncludePaths() ); - - - } - - private void setupInitialContext() - { - String resolvedFilename = filename == null ? TEXT : filename; - IScannerContext context = null; - try - { - if( offsetLimit == NO_OFFSET_LIMIT ) - context = new ScannerContext(reader, resolvedFilename, ScannerContext.ContextKind.TOP, null ); - else - context = new LimitedScannerContext( reader, resolvedFilename, ScannerContext.ContextKind.TOP, offsetLimit ); - contextStack.push( context, requestor ); - } catch( ContextException ce ) - { - handleInternalError(); - } - initialContextInitialized = true; - } - public void addIncludePath(String includePath) { - includePathNames.add(includePath); - includePaths.add( new File( includePath ) ); - } - - public void overwriteIncludePath(String [] newIncludePaths) { - if( newIncludePaths == null ) return; - includePathNames = null; - includePaths = null; - includePathNames = new ArrayList(); - includePaths = new ArrayList(); - - for( int i = 0; i < newIncludePaths.length; ++i ) - includePathNames.add( newIncludePaths[i] ); - - Iterator i = includePathNames.iterator(); - while( i.hasNext() ) - { - String path = (String) i.next(); - includePaths.add( new File( path )); - } - - - } - - public void addDefinition(String key, IMacroDescriptor macro) { - definitions.put(key, macro); - } - - public void addDefinition(String key, String value) { - definitions.put(key, value); - } - - public final Object getDefinition(String key) { - return definitions.get(key); - } - - public final String[] getIncludePaths() { - return (String[])includePathNames.toArray(); - } - - protected boolean skipOverWhitespace() throws ScannerException { - int c = getChar(); - boolean result = false; - while ((c != NOCHAR) && ((c == ' ') || (c == '\t'))) - { - c = getChar(); - result = true; - } - if (c != NOCHAR) - ungetChar(c); - return result; - - } - - protected String getRestOfPreprocessorLine() throws ScannerException { - StringBuffer buffer = new StringBuffer(); - skipOverWhitespace(); - int c = getChar(); - boolean inString = false; - boolean inChar = false; - while (true) { - while ((c != '\n') - && (c != '\r') - && (c != '\\') - && (c != '/') - && (c != '"' || ( c == '"' && inChar ) ) - && (c != '\'' || ( c == '\'' && inString ) ) - && (c != NOCHAR)) { - buffer.append((char) c); - c = getChar( true ); - } - - if (c == '/') { - //only care about comments outside of a quote - if( inString || inChar ){ - buffer.append( (char) c ); - c = getChar( true ); - continue; - } - - // we need to peek ahead at the next character to see if - // this is a comment or not - int next = getChar(); - if (next == '/') { - // single line comment - skipOverSinglelineComment(); - break; - } else if (next == '*') { - // multiline comment - if (skipOverMultilineComment()) - break; - else - c = getChar( true ); - continue; - } else { - // we are not in a comment - buffer.append((char) c); - c = next; - continue; - } - } else if( c == '"' ){ - inString = !inString; - buffer.append((char) c); - c = getChar( true ); - continue; - } else if( c == '\'' ){ - inChar = !inChar; - buffer.append((char) c); - c = getChar( true ); - continue; - } else if( c == '\\' ){ - c = getChar(true); - if( c == '\r' ){ - c = getChar(true); - if( c == '\n' ){ - c = getChar(true); - } - } else if( c == '\n' ){ - c = getChar(true); - } else { - buffer.append('\\'); - if( c == '"' || c == '\'' ){ - buffer.append((char)c); - c = getChar( true ); - } - } - continue; - } else { - ungetChar(c); - break; - } - } - - return buffer.toString(); - } - - protected void skipOverTextUntilNewline() throws ScannerException { - for (;;) { - switch (getChar()) { - case NOCHAR : - case '\n' : - return; - case '\\' : - getChar(); - } - } - } - - private void setCurrentToken(IToken t) { - if (currentToken != null) - currentToken.setNext(t); - finalToken = t; - currentToken = t; - } - - protected void resetStorageBuffer() - { - if( storageBuffer != null ) - storageBuffer = null; - } - - protected IToken newToken(int t, String i, IScannerContext c) { - setCurrentToken(new Token(t, i, c)); - return currentToken; - } - - protected IToken newToken(int t, String i) { - setCurrentToken(new Token(t, i)); - return currentToken; - } - - protected String getNextIdentifier() throws ScannerException { - StringBuffer buffer = new StringBuffer(); - skipOverWhitespace(); - int c = getChar(); - - if (((c >= 'a') && (c <= 'z')) - || ((c >= 'A') && (c <= 'Z')) | (c == '_')) { - buffer.append((char) c); - - c = getChar(); - while (((c >= 'a') && (c <= 'z')) - || ((c >= 'A') && (c <= 'Z')) - || ((c >= '0') && (c <= '9')) - || (c == '_')) { - buffer.append((char) c); - c = getChar(); - } - } - ungetChar(c); - - return buffer.toString(); - } - - protected void handleInclusion(String fileName, boolean useIncludePaths, int nameOffset, int beginOffset, int endOffset ) throws ScannerException { - - FileReader inclusionReader = null; - String newPath = null; - if( useIncludePaths ) // search include paths for this file - { - // iterate through the include paths - Iterator iter = includePaths.iterator(); - - while (iter.hasNext()) { - - File pathFile = (File)iter.next(); - String path = pathFile.getPath(); - if( !pathFile.exists() && path.indexOf('\"') != -1 ) - { - StringTokenizer tokenizer = new StringTokenizer(path, "\"" ); //$NON-NLS-1$ - StringBuffer buffer = new StringBuffer(path.length() ); - while( tokenizer.hasMoreTokens() ){ - buffer.append( tokenizer.nextToken() ); - } - pathFile = new File( buffer.toString() ); - } - if (pathFile.isDirectory()) { - newPath = pathFile.getPath() + File.separatorChar + fileName; - File includeFile = new File(newPath); - if (includeFile.exists() && includeFile.isFile()) { - try { - inclusionReader = new FileReader(includeFile); - break; - } catch (FileNotFoundException fnf) { - // do nothing - check the next directory - } - } - } - } - - if (inclusionReader == null ) - { - handleProblem( IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND, fileName, beginOffset, false, true, true ); - } - } - else // local inclusion - { - String currentFilename = contextStack.getCurrentContext().getFilename(); - File currentIncludeFile = new File( currentFilename ); - String parentDirectory = currentIncludeFile.getParentFile().getAbsolutePath(); - currentIncludeFile = null; - newPath = parentDirectory + File.separatorChar + fileName; - File includeFile = new File( newPath ); - if (includeFile.exists() && includeFile.isFile()) { - try { - inclusionReader = - new FileReader(includeFile); - } catch (FileNotFoundException fnf) { - // the spec says that if finding in the local directory fails, search the include paths - handleInclusion( fileName, true, nameOffset, beginOffset, endOffset ); - } - } - else - { - // the spec says that if finding in the local directory fails, search the include paths - handleInclusion( fileName, true, nameOffset, beginOffset, endOffset ); - } - } - if (inclusionReader != null) { - IASTInclusion inclusion = null; - try - { - inclusion = - astFactory.createInclusion( - fileName, - newPath, - !useIncludePaths, - beginOffset, - nameOffset, - nameOffset + fileName.length(), - endOffset); - } - catch (Exception e) - { - /* do nothing */ - } - - try - { - contextStack.updateContext(inclusionReader, newPath, ScannerContext.ContextKind.INCLUSION, inclusion, requestor ); - } - catch (ContextException e1) - { - handleProblem( e1.getId(), fileName, beginOffset, false, true, true ); - } - } - } - - // constants - private static final int NOCHAR = -1; - - private static final String TEXT = ""; - private static final String START = ""; - private static final String EXPRESSION = ""; - private static final String PASTING = ""; - - private static final String DEFINED = "defined"; - private static final String _PRAGMA = "_Pragma"; - private static final String POUND_DEFINE = "#define "; - - private ContextStack contextStack = null; - private IScannerContext lastContext = null; - - private IScannerInfo originalConfig; - private List includePathNames = new ArrayList(); - private List includePaths = new ArrayList(); - private Hashtable definitions = new Hashtable(); - private StringBuffer storageBuffer = null; - - private int count = 0; - private static HashMap cppKeywords = new HashMap(); - private static HashMap cKeywords = new HashMap(); - private static HashMap ppDirectives = new HashMap(); - - private IToken currentToken = null; - private IToken cachedToken = null; - - private boolean passOnToClient = true; - private BranchTracker branches = new BranchTracker(); - - // these are scanner configuration aspects that we perhaps want to tweak - // eventually, these should be configurable by the client, but for now - // we can just leave it internal - private boolean enableDigraphReplacement = true; - private boolean enableTrigraphReplacement = true; - private boolean enableTrigraphReplacementInStrings = true; - private boolean throwExceptionOnBadCharacterRead = false; - private boolean atEOF = false; - - private boolean tokenizingMacroReplacementList = false; - public void setTokenizingMacroReplacementList( boolean mr ){ - tokenizingMacroReplacementList = mr; - } - - private final ParserMode mode; - - public int getCharacter() throws ScannerException - { - if( ! initialContextInitialized ) - setupInitialContext(); - - return getChar(); - } - - private int getChar() throws ScannerException - { - return getChar( false ); - } - - private int getChar( boolean insideString ) throws ScannerException { - int c = NOCHAR; - - lastContext = contextStack.getCurrentContext(); - - if (contextStack.getCurrentContext() == null) - // past the end of file - return c; - - c = accountForUndo(c); - - int baseOffset = lastContext.getOffset() - lastContext.undoStackSize() - 1; - - if (enableTrigraphReplacement && (!insideString || enableTrigraphReplacementInStrings)) { - // Trigraph processing - enableTrigraphReplacement = false; - if (c == '?') { - c = getChar(insideString); - if (c == '?') { - c = getChar(insideString); - switch (c) { - case '(': - expandDefinition("??(", "[", baseOffset); - c = getChar(insideString); - break; - case ')': - expandDefinition("??)", "]", baseOffset); - c = getChar(insideString); - break; - case '<': - expandDefinition("??<", "{", baseOffset); - c = getChar(insideString); - break; - case '>': - expandDefinition("??>", "}", baseOffset); - c = getChar(insideString); - break; - case '=': - expandDefinition("??=", "#", baseOffset); - c = getChar(insideString); - break; - case '/': - expandDefinition("??/", "\\", baseOffset); - c = getChar(insideString); - break; - case '\'': - expandDefinition("??\'", "^", baseOffset); - c = getChar(insideString); - break; - case '!': - expandDefinition("??!", "|", baseOffset); - c = getChar(insideString); - break; - case '-': - expandDefinition("??-", "~", baseOffset); - c = getChar(insideString); - break; - default: - // Not a trigraph - ungetChar(c); - ungetChar('?'); - c = '?'; - } - } else { - // Not a trigraph - ungetChar(c); - c = '?'; - } - } - enableTrigraphReplacement = true; - } - - if (!insideString) - { - if (c == '\\') { - c = getChar(false); - if (c == '\r') { - c = getChar(false); - if (c == '\n') - { - c = getChar(false); - } - } else if (c == '\n') - { - c = getChar(false); - - } else // '\' is not the last character on the line - { - ungetChar(c); - c = '\\'; - } - } else if (enableDigraphReplacement) { - enableDigraphReplacement = false; - // Digraph processing - if (c == '<') { - c = getChar(false); - if (c == '%') { - expandDefinition("<%", "{", baseOffset); - c = getChar(false); - } else if (c == ':') { - expandDefinition("<:", "[", baseOffset); - c = getChar(false); - } else { - // Not a digraph - ungetChar(c); - c = '<'; - } - } else if (c == ':') { - c = getChar(false); - if (c == '>') { - expandDefinition(":>", "]", baseOffset); - c = getChar(false); - } else { - // Not a digraph - ungetChar(c); - c = ':'; - } - } else if (c == '%') { - c = getChar(false); - if (c == '>') { - expandDefinition("%>", "}", baseOffset); - c = getChar(false); - } else if (c == ':') { - expandDefinition("%:", "#", baseOffset); - c = getChar(false); - } else { - // Not a digraph - ungetChar(c); - c = '%'; - } - } - enableDigraphReplacement = true; - } - } - - return c; - } - - - - protected int accountForUndo(int c) - { - boolean done; - do { - done = true; - - if (contextStack.getCurrentContext().undoStackSize() != 0 ) { - c = contextStack.getCurrentContext().popUndo(); - } else { - try { - c = contextStack.getCurrentContext().read(); - if (c == NOCHAR) { - if (contextStack.rollbackContext(requestor) == false) { - c = NOCHAR; - break; - } else { - done = false; - } - } - } catch (IOException e) { - if (contextStack.rollbackContext(requestor) == false) { - c = NOCHAR; - } else { - done = false; - } - } - } - } while (!done); - return c; - } - - private void ungetChar(int c) throws ScannerException{ - contextStack.getCurrentContext().pushUndo(c); - try - { - contextStack.undoRollback( lastContext, requestor ); - } - catch (ContextException e) - { - handleProblem( e.getId(), contextStack.getCurrentContext().getFilename(), getCurrentOffset(), false, true, true ); - } - } - - protected boolean lookAheadForTokenPasting() throws ScannerException - { - int c = getChar(); - if( c == '#' ) - { - c = getChar(); - if( c == '#' ) - { - return true; - } - else - { - ungetChar( c ); - } - } - - ungetChar( c ); - return false; - - } - - protected void consumeUntilOutOfMacroExpansion() throws ScannerException - { - while( contextStack.getCurrentContext().getKind() == IScannerContext.ContextKind.MACROEXPANSION ) - getChar(); - } - - public IToken nextToken() throws ScannerException, EndOfFileException, OffsetLimitReachedException { - return nextToken( true, false ); - } - - public IToken nextToken(boolean pasting) throws ScannerException, EndOfFileException, OffsetLimitReachedException { - return nextToken( pasting, false ); - } - - public IToken nextToken( boolean pasting, boolean lookingForNextAlready ) throws ScannerException, EndOfFileException, OffsetLimitReachedException - { - if( ! initialContextInitialized ) - setupInitialContext(); - - if( cachedToken != null ){ - setCurrentToken( cachedToken ); - cachedToken = null; - return currentToken; - } - - count++; - boolean possibleWideLiteral = true; - boolean wideLiteral = false; - int c = getChar(); - - while (c != NOCHAR) { - if ( ! passOnToClient ) { - - - while (c != NOCHAR && c != '#' ) - { - c = getChar(); - if( c == '/' ) - { - c = getChar(); - if( c == '/' ) - { - skipOverSinglelineComment(); - c = getChar(); - continue; - } - else if( c == '*' ) - { - skipOverMultilineComment(); - c = getChar(); - continue; - } - } - } - - if( c == NOCHAR ) continue; - } - - if ((c == ' ') || (c == '\r') || (c == '\t') || (c == '\n')) { - c = getChar(); - continue; - } else if (c == 'L' && possibleWideLiteral ) { - int oldChar = c; - c = getChar(); - if(!(c == '"' || c == '\'')) { - // we have made a mistake - ungetChar(c); - c = oldChar; - possibleWideLiteral = false; - continue; - } - wideLiteral = true; - continue; - } else if (c == '"') { - int beginOffset = getCurrentOffset(); - // string - StringBuffer buff = new StringBuffer(); - int beforePrevious = NOCHAR; - int previous = c; - c = getChar(true); - - for( ; ; ) - { - if ( ( c =='"' ) && ( previous != '\\' || beforePrevious == '\\') ) break; - if ( ( c == '\n' ) && ( previous != '\\' || beforePrevious == '\\') ) - { - handleProblem( IProblem.SCANNER_UNBOUNDED_STRING, null, beginOffset, false, true, true ); - } - - if( c == NOCHAR) break; - buff.append((char) c); - beforePrevious = previous; - previous = c; - c = getChar(true); - } - - if (c != NOCHAR ) - { - int type = wideLiteral ? IToken.tLSTRING : IToken.tSTRING; - - //If the next token is going to be a string as well, we need to concatenate - //it with this token. - IToken returnToken = newToken( type, buff.toString(), contextStack.getCurrentContext()); - - if (!lookingForNextAlready) { - IToken next = null; - try{ - next = nextToken( true, true ); - } catch( EndOfFileException e ){ - next = null; - } - - while( next != null && ( next.getType() == IToken.tSTRING || - next.getType() == IToken.tLSTRING ) ){ - returnToken.setImage( returnToken.getImage() + next.getImage() ); - returnToken.setNext( null ); - currentToken = returnToken; - try{ - next = nextToken( true, true ); - } catch( EndOfFileException e ){ - next = null; - } - } - - cachedToken = next; - - } - - currentToken = returnToken; - returnToken.setNext( null ); - - return returnToken; - - } else - handleProblem( IProblem.SCANNER_UNBOUNDED_STRING, null, beginOffset, false, true, true ); - - - } else if ( - ((c >= 'a') && (c <= 'z')) - || ((c >= 'A') && (c <= 'Z')) || (c == '_')) { - - int baseOffset = lastContext.getOffset() - lastContext.undoStackSize() - 1; - - // String buffer is slow, we need a better way such as memory mapped files - StringBuffer buff = new StringBuffer(); - buff.append((char) c); - - c = getChar(); - - while (((c >= 'a') && (c <= 'z')) - || ((c >= 'A') && (c <= 'Z')) - || ((c >= '0') && (c <= '9')) - || (c == '_')) { - buff.append((char) c); - c = getChar(); - } - - ungetChar(c); - - String ident = buff.toString(); - - if (ident.equals(DEFINED)) - return newToken(IToken.tINTEGER, handleDefinedMacro()); - - if( ident.equals(_PRAGMA) && language == ParserLanguage.C ) - { - handlePragmaOperator(); - c = getChar(); - continue; - } - - Object mapping = definitions.get(ident); - - if (mapping != null) { - if( contextStack.shouldExpandDefinition( POUND_DEFINE + ident ) ) { - expandDefinition(ident, mapping, baseOffset); - c = getChar(); - continue; - } - } - - Object tokenTypeObject; - - if( language == ParserLanguage.CPP ) - tokenTypeObject = cppKeywords.get(ident); - else - tokenTypeObject = cKeywords.get(ident); - - int tokenType = IToken.tIDENTIFIER; - if (tokenTypeObject != null) - tokenType = ((Integer) tokenTypeObject).intValue(); - - if( pasting ) - { - if( lookAheadForTokenPasting() ) - { - if( storageBuffer == null ) - storageBuffer = buff; - else - storageBuffer.append( ident ); - - c = getChar(); - continue; - } - else - { - if( storageBuffer != null ) - { - storageBuffer.append( ident ); - try - { - contextStack.updateContext( new StringReader( storageBuffer.toString()), PASTING, IScannerContext.ContextKind.MACROEXPANSION, null, requestor ); - } - catch (ContextException e) - { - handleProblem( e.getId(), contextStack.getCurrentContext().getFilename(), getCurrentOffset(), false, true, true ); - } - storageBuffer = null; - c = getChar(); - continue; - } - } - } - - return newToken(tokenType, ident, contextStack.getCurrentContext()); - } else if ((c >= '0') && (c <= '9') || c == '.' ) { - int beginOffset = getCurrentOffset(); - StringBuffer buff; - - if( pasting ) - { - if( storageBuffer != null ) - buff = storageBuffer; - else - buff = new StringBuffer(); - } - else - buff = new StringBuffer(); - - - boolean hex = false; - boolean floatingPoint = ( c == '.' ) ? true : false; - boolean firstCharZero = ( c== '0' )? true : false; - - buff.append((char) c); - - c = getChar(); - - if( ! firstCharZero && floatingPoint && !(c >= '0' && c <= '9') ){ - //if pasting, there could actually be a float here instead of just a . - if( buff.toString().equals( "." ) ){ - if( c == '*' ){ - return newToken( IToken.tDOTSTAR, ".*", contextStack.getCurrentContext() ); - } else if( c == '.' ){ - if( getChar() == '.' ) - return newToken( IToken.tELLIPSIS, "..." ); - else - handleProblem( IProblem.SCANNER_BAD_FLOATING_POINT, null, beginOffset, false, true, true ); - } else { - ungetChar( c ); - return newToken( IToken.tDOT, ".", contextStack.getCurrentContext() ); - } - } - } else if (c == 'x') { - if( ! firstCharZero ) - { - handleProblem( IProblem.SCANNER_BAD_HEX_FORMAT, null, beginOffset, false, true, true ); - c = getChar(); - continue; - } - buff.append( (char)c ); - hex = true; - c = getChar(); - } - - while ((c >= '0' && c <= '9') - || (hex - && ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')))) { - buff.append((char) c); - c = getChar(); - } - - if( c == '.' ) - { - buff.append( (char)c); - - floatingPoint = true; - c= getChar(); - while ((c >= '0' && c <= '9') - || (hex - && ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')))) - { - buff.append((char) c); - c = getChar(); - } - } - - - if (c == 'e' || c == 'E' || (hex && (c == 'p' || c == 'P'))) - { - if( ! floatingPoint ) floatingPoint = true; - // exponent type for floating point - buff.append((char)c); - c = getChar(); - - // optional + or - - if( c == '+' || c == '-' ) - { - buff.append( (char)c ); - c = getChar(); - } - - // digit sequence of exponent part - while ((c >= '0' && c <= '9') ) - { - buff.append((char) c); - c = getChar(); - } - - // optional suffix - if( c == 'l' || c == 'L' || c == 'f' || c == 'F' ) - { - buff.append( (char)c ); - c = getChar(); - } - } else { - if( floatingPoint ){ - //floating-suffix - if( c == 'l' || c == 'L' || c == 'f' || c == 'F' ){ - c = getChar(); - } - } else { - //integer suffix - if( c == 'u' || c == 'U' ){ - c = getChar(); - if( c == 'l' || c == 'L') - c = getChar(); - if( c == 'l' || c == 'L') - c = getChar(); - } else if( c == 'l' || c == 'L' ){ - c = getChar(); - if( c == 'l' || c == 'L') - c = getChar(); - if( c == 'u' || c == 'U' ) - c = getChar(); - } - } - } - - ungetChar( c ); - - if( pasting ) - { - if( lookAheadForTokenPasting() ) - { - storageBuffer = buff; - c = getChar(); - continue; - } - else - { - if( storageBuffer != null ) - { - try - { - contextStack.updateContext( new StringReader( buff.toString()), PASTING, IScannerContext.ContextKind.MACROEXPANSION, null, requestor ); - } - catch (ContextException e) - { - handleProblem( e.getId(), contextStack.getCurrentContext().getFilename(), getCurrentOffset(), false, true, true ); - } - storageBuffer = null; - c = getChar(); - continue; - } - } - } - - int tokenType; - String result = buff.toString(); - - if( floatingPoint && result.equals(".") ) - tokenType = IToken.tDOT; - else - tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER; - - return newToken( - tokenType, - result, - contextStack.getCurrentContext()); - - } else if (c == '#') { - int beginningOffset = contextStack.getCurrentContext().getOffset() - 1; - // lets prepare for a preprocessor statement - StringBuffer buff = new StringBuffer(); - buff.append((char) c); - - // we are allowed arbitrary whitespace after the '#' and before the rest of the text - boolean skipped = skipOverWhitespace(); - - c = getChar(); - - if( c == '#' ) - { - if( skipped ) - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "# #", beginningOffset, false, true, true ); - else - return newToken( tPOUNDPOUND, "##" ); - } else if( tokenizingMacroReplacementList ) { - ungetChar( c ); - return newToken( tPOUND, "#" ); - } - - while (((c >= 'a') && (c <= 'z')) - || ((c >= 'A') && (c <= 'Z')) || (c == '_') ) { - buff.append((char) c); - c = getChar(); - } - ungetChar(c); - - String token = buff.toString(); - - Object directive = ppDirectives.get(token); - if (directive == null) { - if (true) - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#"+token, beginningOffset, false, true, true ); - } else { - int type = ((Integer) directive).intValue(); - switch (type) { - case PreprocessorDirectives.DEFINE : - if ( ! passOnToClient ) { - skipOverTextUntilNewline(); - c = getChar(); - continue; - } - - poundDefine(beginningOffset); - - c = getChar(); - continue; - - case PreprocessorDirectives.INCLUDE : - if (! passOnToClient ) { - skipOverTextUntilNewline(); - c = getChar(); - continue; - } - - poundInclude( beginningOffset ); - - c = getChar(); - continue; - case PreprocessorDirectives.UNDEFINE : - if (! passOnToClient) { - skipOverTextUntilNewline(); - c = getChar(); - continue; - } - skipOverWhitespace(); - // definition - String toBeUndefined = getNextIdentifier(); - - definitions.remove(toBeUndefined); - - skipOverTextUntilNewline(); - c = getChar(); - continue; - case PreprocessorDirectives.IF : - // get the rest of the line - int currentOffset = getCurrentOffset(); - String expression = getRestOfPreprocessorLine(); - - boolean expressionEvalResult = false; - try{ - expressionEvalResult = evaluateExpression(expression, currentOffset); - } catch( ScannerException e ){} - - passOnToClient = branches.poundif( expressionEvalResult ); - c = getChar(); - continue; - - - - case PreprocessorDirectives.IFDEF : - skipOverWhitespace(); - String definition = getNextIdentifier(); - Object mapping = definitions.get(definition); - - if (mapping == null) { - // not defined - passOnToClient = branches.poundif( false ); - skipOverTextUntilNewline(); - } else { - passOnToClient = branches.poundif( true ); - // continue along, act like nothing is wrong :-) - c = getChar(); - } - continue; - case PreprocessorDirectives.ENDIF : - String restOfLine = getRestOfPreprocessorLine().trim(); - if( ! restOfLine.equals( "" ) && true ) - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#endif " + restOfLine, beginningOffset, false, true, true ); - passOnToClient = branches.poundendif(); - c = getChar(); - continue; - - case PreprocessorDirectives.IFNDEF : - skipOverWhitespace(); - String def = getNextIdentifier(); - Object map = definitions.get(def); - - if (map != null) { - // not defined - skipOverTextUntilNewline(); - passOnToClient = branches.poundif( false ); - } else { - passOnToClient = branches.poundif( true ); - // continue along, act like nothing is wrong :-) - c = getChar(); - } - continue; - - case PreprocessorDirectives.ELSE : - try - { - passOnToClient = branches.poundelse(); - } - catch( EmptyStackException ese ) - { - handleProblem( IProblem.PREPROCESSOR_UNBALANCE_CONDITION, - token, - beginningOffset, - false, true, true ); - } - - skipOverTextUntilNewline(); - c = getChar(); - continue; - - case PreprocessorDirectives.ELIF : - int co = getCurrentOffset(); - String elsifExpression = getRestOfPreprocessorLine().trim(); - - if (elsifExpression.equals("")) - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#elif", beginningOffset, false, true, true ); - - boolean elsifResult = false; - elsifResult = evaluateExpression(elsifExpression, co ); - - try - { - passOnToClient = branches.poundelif( elsifResult ); - } - catch( EmptyStackException ese ) - { - handleProblem( IProblem.PREPROCESSOR_UNBALANCE_CONDITION, - token + ' ' + elsifExpression, - beginningOffset, - false, true, true ); - } - c = getChar(); - continue; - - case PreprocessorDirectives.LINE : - //TO DO - skipOverTextUntilNewline(); - c = getChar(); - continue; - case PreprocessorDirectives.ERROR : - if (! passOnToClient) { - skipOverTextUntilNewline(); - c = getChar(); - continue; - } - handleProblem( IProblem.PREPROCESSOR_POUND_ERROR, getRestOfPreprocessorLine(), beginningOffset, false, true, true ); - c = getChar(); - continue; - case PreprocessorDirectives.PRAGMA : - skipOverTextUntilNewline(); - c = getChar(); - continue; - case PreprocessorDirectives.BLANK : - String remainderOfLine = - getRestOfPreprocessorLine().trim(); - if (!remainderOfLine.equals("")) { - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "# " + remainderOfLine, beginningOffset, false, true, true ); - } - c = getChar(); - continue; - default : - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#" + token, beginningOffset, false, true, true ); - } - } - } else { - switch (c) { - case '\'' : - return processCharacterLiteral( c, wideLiteral ); - case ':' : - c = getChar(); - switch (c) { - case ':' : - return newToken( - IToken.tCOLONCOLON, - "::", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tCOLON, - ":", - contextStack.getCurrentContext()); - } - case ';' : - return newToken(IToken.tSEMI, ";", contextStack.getCurrentContext()); - case ',' : - return newToken(IToken.tCOMMA, ",", contextStack.getCurrentContext()); - case '?' : - return newToken(IToken.tQUESTION, "?", contextStack.getCurrentContext()); - case '(' : - return newToken(IToken.tLPAREN, "(", contextStack.getCurrentContext()); - case ')' : - return newToken(IToken.tRPAREN, ")", contextStack.getCurrentContext()); - case '[' : - return newToken(IToken.tLBRACKET, "[", contextStack.getCurrentContext()); - case ']' : - return newToken(IToken.tRBRACKET, "]", contextStack.getCurrentContext()); - case '{' : - return newToken(IToken.tLBRACE, "{", contextStack.getCurrentContext()); - case '}' : - return newToken(IToken.tRBRACE, "}", contextStack.getCurrentContext()); - case '+' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tPLUSASSIGN, - "+=", - contextStack.getCurrentContext()); - case '+' : - return newToken( - IToken.tINCR, - "++", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tPLUS, - "+", - contextStack.getCurrentContext()); - } - case '-' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tMINUSASSIGN, - "-=", - contextStack.getCurrentContext()); - case '-' : - return newToken( - IToken.tDECR, - "--", - contextStack.getCurrentContext()); - case '>' : - c = getChar(); - switch (c) { - case '*' : - return newToken( - IToken.tARROWSTAR, - "->*", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tARROW, - "->", - contextStack.getCurrentContext()); - } - default : - ungetChar(c); - return newToken( - IToken.tMINUS, - "-", - contextStack.getCurrentContext()); - } - case '*' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tSTARASSIGN, - "*=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tSTAR, - "*", - contextStack.getCurrentContext()); - } - case '%' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tMODASSIGN, - "%=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tMOD, - "%", - contextStack.getCurrentContext()); - } - case '^' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tXORASSIGN, - "^=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tXOR, - "^", - contextStack.getCurrentContext()); - } - case '&' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tAMPERASSIGN, - "&=", - contextStack.getCurrentContext()); - case '&' : - return newToken( - IToken.tAND, - "&&", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tAMPER, - "&", - contextStack.getCurrentContext()); - } - case '|' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tBITORASSIGN, - "|=", - contextStack.getCurrentContext()); - case '|' : - return newToken( - IToken.tOR, - "||", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tBITOR, - "|", - contextStack.getCurrentContext()); - } - case '~' : - return newToken(IToken.tCOMPL, "~", contextStack.getCurrentContext()); - case '!' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tNOTEQUAL, - "!=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tNOT, - "!", - contextStack.getCurrentContext()); - } - case '=' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tEQUAL, - "==", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tASSIGN, - "=", - contextStack.getCurrentContext()); - } - case '<' : - c = getChar(); - switch (c) { - case '<' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tSHIFTLASSIGN, - "<<=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tSHIFTL, - "<<", - contextStack.getCurrentContext()); - } - case '=' : - return newToken( - IToken.tLTEQUAL, - "<=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - if( forInclusion ) - temporarilyReplaceDefinitionsMap(); - return newToken(IToken.tLT, "<", contextStack.getCurrentContext()); - } - case '>' : - c = getChar(); - switch (c) { - case '>' : - c = getChar(); - switch (c) { - case '=' : - return newToken( - IToken.tSHIFTRASSIGN, - ">>=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tSHIFTR, - ">>", - contextStack.getCurrentContext()); - } - case '=' : - return newToken( - IToken.tGTEQUAL, - ">=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - if( forInclusion ) - restoreDefinitionsMap(); - return newToken(IToken.tGT, ">", contextStack.getCurrentContext()); - } - case '.' : - c = getChar(); - switch (c) { - case '.' : - c = getChar(); - switch (c) { - case '.' : - return newToken( - IToken.tELLIPSIS, - "...", - contextStack.getCurrentContext()); - default : - break; - } - break; - case '*' : - return newToken( - IToken.tDOTSTAR, - ".*", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tDOT, - ".", - contextStack.getCurrentContext()); - } - break; - case '/' : - c = getChar(); - switch (c) { - case '/' : - skipOverSinglelineComment(); - c = getChar(); - continue; - case '*' : - skipOverMultilineComment(); - c = getChar(); - continue; - case '=' : - return newToken( - IToken.tDIVASSIGN, - "/=", - contextStack.getCurrentContext()); - default : - ungetChar(c); - return newToken( - IToken.tDIV, - "/", - contextStack.getCurrentContext()); - } - default : - handleProblem( IProblem.SCANNER_BAD_CHARACTER, new Character( (char)c ).toString(), getCurrentOffset(), false, true, throwExceptionOnBadCharacterRead ); - c = getChar(); - continue; - } - - throwEOF(); - } - } - - if (( getDepth() != 0) && !atEOF ) - { - atEOF = true; - handleProblem( IProblem.SCANNER_UNEXPECTED_EOF, null, getCurrentOffset(), false, true, true ); - } - - // we're done - throwEOF(); - return null; - } - - - - /** - * - */ - protected void handlePragmaOperator() throws ScannerException - { - // until we know what to do with pragmas, do the equivalent as - // to what we do for #pragma blah blah blah (ignore it) - getRestOfPreprocessorLine(); - } - - /** - * @param c - * @param wideLiteral - */ - protected IToken processCharacterLiteral(int c, boolean wideLiteral) - throws ScannerException - { - int beginOffset = getCurrentOffset(); - int type = wideLiteral ? IToken.tLCHAR : IToken.tCHAR; - - StringBuffer buffer = new StringBuffer(); - int prev = c; - int prevPrev = c; - c = getChar(true); - - for( ; ; ) - { - // error conditions - if( ( c == '\n' ) || - ( ( c == '\\' || c =='\'' )&& prev == '\\' ) || - ( c == NOCHAR ) ) - { - handleProblem( IProblem.SCANNER_BAD_CHARACTER, new Character( (char)c ).toString(),beginOffset, false, true, throwExceptionOnBadCharacterRead ); - c = ' '; - } - // exit condition - if ( ( c =='\'' ) && ( prev != '\\' || prevPrev == '\\' ) ) break; - - buffer.append( (char)c); - prevPrev = prev; - prev = c; - c = getChar(true); - } - - return newToken( type, buffer.toString(), contextStack.getCurrentContext()); - } - - - - protected String getCurrentFile() - { - return contextStack.getMostRelevantFileContext() != null ? contextStack.getMostRelevantFileContext().getFilename() : ""; - } - - - protected int getCurrentOffset() - { - return contextStack.getMostRelevantFileContext() != null ? contextStack.getMostRelevantFileContext().getOffset() : -1; - } - - - protected static class endOfMacroTokenException extends Exception {}; - // the static instance we always use - protected static endOfMacroTokenException endOfMacroToken = new endOfMacroTokenException(); - - public IToken nextTokenForStringizing() throws ScannerException, EndOfFileException, OffsetLimitReachedException - { - int beginOffset = getCurrentOffset(); - int c = getChar(); - StringBuffer tokenImage = new StringBuffer(); - - try { - while (c != NOCHAR) { - - if ((c == ' ') || (c == '\r') || (c == '\t') || (c == '\n')) { - - if (tokenImage.length() > 0) throw endOfMacroToken; - c = getChar(); - continue; - - } else if (c == '"') { - - if (tokenImage.length() > 0) throw endOfMacroToken; - - // string - StringBuffer buff = new StringBuffer(); - c = getChar(true); - - for( ; ; ) - { - if ( c =='"' ) break; - if( c == NOCHAR) break; - buff.append((char) c); - c = getChar(true); - } - - if (c != NOCHAR ) - { - return newToken( IToken.tSTRING, buff.toString(), contextStack.getCurrentContext()); - - } else { - handleProblem( IProblem.SCANNER_UNBOUNDED_STRING, null, beginOffset, false, true, true ); - c = getChar(); - continue; - } - - } else { - switch (c) { - case '\'' : - if (tokenImage.length() > 0) throw endOfMacroToken; - return processCharacterLiteral( c, false ); - case ',' : - if (tokenImage.length() > 0) throw endOfMacroToken; - return newToken(IToken.tCOMMA, ",", contextStack.getCurrentContext()); - case '(' : - if (tokenImage.length() > 0) throw endOfMacroToken; - return newToken(IToken.tLPAREN, "(", contextStack.getCurrentContext()); - case ')' : - if (tokenImage.length() > 0) throw endOfMacroToken; - return newToken(IToken.tRPAREN, ")", contextStack.getCurrentContext()); - case '/' : - if (tokenImage.length() > 0) throw endOfMacroToken; - c = getChar(); - switch (c) { - case '/' : - skipOverSinglelineComment(); - c = getChar(); - continue; - case '*' : - skipOverMultilineComment(); - c = getChar(); - continue; - default: - tokenImage.append('/'); - continue; - } - default : - tokenImage.append((char)c); - c = getChar(); - } - } - } - } catch (endOfMacroTokenException e) { - // unget the first character after the end of token - ungetChar(c); - } - - // return completed token - if (tokenImage.length() > 0) { - return newToken(IToken.tIDENTIFIER, tokenImage.toString(), contextStack.getCurrentContext()); - } - - // we're done - throwEOF(); - return null; - } - - - /** - * - */ - protected void throwEOF() throws EndOfFileException, OffsetLimitReachedException { - if( offsetLimit == NO_OFFSET_LIMIT ) - throw new EndOfFileException(); - - if( finalToken.getEndOffset() == offsetLimit ) - throw new OffsetLimitReachedException(finalToken); - throw new OffsetLimitReachedException( null ); - } - - - static { - cppKeywords.put( Keywords.AND, new Integer(IToken.t_and)); - cppKeywords.put( Keywords.AND_EQ, new Integer(IToken.t_and_eq)); - cppKeywords.put( Keywords.ASM, new Integer(IToken.t_asm)); - cppKeywords.put( Keywords.AUTO, new Integer(IToken.t_auto)); - cppKeywords.put( Keywords.BITAND, new Integer(IToken.t_bitand)); - cppKeywords.put( Keywords.BITOR, new Integer(IToken.t_bitor)); - cppKeywords.put( Keywords.BOOL, new Integer(IToken.t_bool)); - cppKeywords.put( Keywords.BREAK, new Integer(IToken.t_break)); - cppKeywords.put( Keywords.CASE, new Integer(IToken.t_case)); - cppKeywords.put( Keywords.CATCH, new Integer(IToken.t_catch)); - cppKeywords.put( Keywords.CHAR, new Integer(IToken.t_char)); - cppKeywords.put( Keywords.CLASS, new Integer(IToken.t_class)); - cppKeywords.put( Keywords.COMPL, new Integer(IToken.t_compl)); - cppKeywords.put( Keywords.CONST, new Integer(IToken.t_const)); - cppKeywords.put( Keywords.CONST_CAST, new Integer(IToken.t_const_cast)); - cppKeywords.put( Keywords.CONTINUE, new Integer(IToken.t_continue)); - cppKeywords.put( Keywords.DEFAULT, new Integer(IToken.t_default)); - cppKeywords.put( Keywords.DELETE, new Integer(IToken.t_delete)); - cppKeywords.put( Keywords.DO, new Integer(IToken.t_do)); - cppKeywords.put( Keywords.DOUBLE, new Integer(IToken.t_double)); - cppKeywords.put( Keywords.DYNAMIC_CAST, new Integer(IToken.t_dynamic_cast)); - cppKeywords.put( Keywords.ELSE, new Integer(IToken.t_else)); - cppKeywords.put( Keywords.ENUM, new Integer(IToken.t_enum)); - cppKeywords.put( Keywords.EXPLICIT, new Integer(IToken.t_explicit)); - cppKeywords.put( Keywords.EXPORT, new Integer(IToken.t_export)); - cppKeywords.put( Keywords.EXTERN, new Integer(IToken.t_extern)); - cppKeywords.put( Keywords.FALSE, new Integer(IToken.t_false)); - cppKeywords.put( Keywords.FLOAT, new Integer(IToken.t_float)); - cppKeywords.put( Keywords.FOR, new Integer(IToken.t_for)); - cppKeywords.put( Keywords.FRIEND, new Integer(IToken.t_friend)); - cppKeywords.put( Keywords.GOTO, new Integer(IToken.t_goto)); - cppKeywords.put( Keywords.IF, new Integer(IToken.t_if)); - cppKeywords.put( Keywords.INLINE, new Integer(IToken.t_inline)); - cppKeywords.put( Keywords.INT, new Integer(IToken.t_int)); - cppKeywords.put( Keywords.LONG, new Integer(IToken.t_long)); - cppKeywords.put( Keywords.MUTABLE, new Integer(IToken.t_mutable)); - cppKeywords.put( Keywords.NAMESPACE, new Integer(IToken.t_namespace)); - cppKeywords.put( Keywords.NEW, new Integer(IToken.t_new)); - cppKeywords.put( Keywords.NOT, new Integer(IToken.t_not)); - cppKeywords.put( Keywords.NOT_EQ, new Integer(IToken.t_not_eq)); - cppKeywords.put( Keywords.OPERATOR, new Integer(IToken.t_operator)); - cppKeywords.put( Keywords.OR, new Integer(IToken.t_or)); - cppKeywords.put( Keywords.OR_EQ, new Integer(IToken.t_or_eq)); - cppKeywords.put( Keywords.PRIVATE, new Integer(IToken.t_private)); - cppKeywords.put( Keywords.PROTECTED, new Integer(IToken.t_protected)); - cppKeywords.put( Keywords.PUBLIC, new Integer(IToken.t_public)); - cppKeywords.put( Keywords.REGISTER, new Integer(IToken.t_register)); - cppKeywords.put( Keywords.REINTERPRET_CAST, new Integer(IToken.t_reinterpret_cast)); - cppKeywords.put( Keywords.RETURN, new Integer(IToken.t_return)); - cppKeywords.put( Keywords.SHORT, new Integer(IToken.t_short)); - cppKeywords.put( Keywords.SIGNED, new Integer(IToken.t_signed)); - cppKeywords.put( Keywords.SIZEOF, new Integer(IToken.t_sizeof)); - cppKeywords.put( Keywords.STATIC, new Integer(IToken.t_static)); - cppKeywords.put( Keywords.STATIC_CAST, new Integer(IToken.t_static_cast)); - cppKeywords.put( Keywords.STRUCT, new Integer(IToken.t_struct)); - cppKeywords.put( Keywords.SWITCH, new Integer(IToken.t_switch)); - cppKeywords.put( Keywords.TEMPLATE, new Integer(IToken.t_template)); - cppKeywords.put( Keywords.THIS, new Integer(IToken.t_this)); - cppKeywords.put( Keywords.THROW, new Integer(IToken.t_throw)); - cppKeywords.put( Keywords.TRUE, new Integer(IToken.t_true)); - cppKeywords.put( Keywords.TRY, new Integer(IToken.t_try)); - cppKeywords.put( Keywords.TYPEDEF, new Integer(IToken.t_typedef)); - cppKeywords.put( Keywords.TYPEID, new Integer(IToken.t_typeid)); - cppKeywords.put( Keywords.TYPENAME, new Integer(IToken.t_typename)); - cppKeywords.put( Keywords.UNION, new Integer(IToken.t_union)); - cppKeywords.put( Keywords.UNSIGNED, new Integer(IToken.t_unsigned)); - cppKeywords.put( Keywords.USING, new Integer(IToken.t_using)); - cppKeywords.put( Keywords.VIRTUAL, new Integer(IToken.t_virtual)); - cppKeywords.put( Keywords.VOID, new Integer(IToken.t_void)); - cppKeywords.put( Keywords.VOLATILE, new Integer(IToken.t_volatile)); - cppKeywords.put( Keywords.WCHAR_T, new Integer(IToken.t_wchar_t)); - cppKeywords.put( Keywords.WHILE, new Integer(IToken.t_while)); - cppKeywords.put( Keywords.XOR, new Integer(IToken.t_xor)); - cppKeywords.put( Keywords.XOR_EQ, new Integer(IToken.t_xor_eq)); - - ppDirectives.put("#define", new Integer(PreprocessorDirectives.DEFINE)); - ppDirectives.put("#undef",new Integer(PreprocessorDirectives.UNDEFINE)); - ppDirectives.put("#if", new Integer(PreprocessorDirectives.IF)); - ppDirectives.put("#ifdef", new Integer(PreprocessorDirectives.IFDEF)); - ppDirectives.put("#ifndef", new Integer(PreprocessorDirectives.IFNDEF)); - ppDirectives.put("#else", new Integer(PreprocessorDirectives.ELSE)); - ppDirectives.put("#endif", new Integer(PreprocessorDirectives.ENDIF)); - ppDirectives.put( - "#include", - new Integer(PreprocessorDirectives.INCLUDE)); - ppDirectives.put("#line", new Integer(PreprocessorDirectives.LINE)); - ppDirectives.put("#error", new Integer(PreprocessorDirectives.ERROR)); - ppDirectives.put("#pragma", new Integer(PreprocessorDirectives.PRAGMA)); - ppDirectives.put("#elif", new Integer(PreprocessorDirectives.ELIF)); - ppDirectives.put("#", new Integer(PreprocessorDirectives.BLANK)); - - cKeywords.put( Keywords.AUTO, new Integer(IToken.t_auto)); - cKeywords.put( Keywords.BREAK, new Integer(IToken.t_break)); - cKeywords.put( Keywords.CASE, new Integer(IToken.t_case)); - cKeywords.put( Keywords.CHAR, new Integer(IToken.t_char)); - cKeywords.put( Keywords.CONST, new Integer(IToken.t_const)); - cKeywords.put( Keywords.CONTINUE, new Integer(IToken.t_continue)); - cKeywords.put( Keywords.DEFAULT, new Integer(IToken.t_default)); - cKeywords.put( Keywords.DELETE, new Integer(IToken.t_delete)); - cKeywords.put( Keywords.DO, new Integer(IToken.t_do)); - cKeywords.put( Keywords.DOUBLE, new Integer(IToken.t_double)); - cKeywords.put( Keywords.ELSE, new Integer(IToken.t_else)); - cKeywords.put( Keywords.ENUM, new Integer(IToken.t_enum)); - cKeywords.put( Keywords.EXTERN, new Integer(IToken.t_extern)); - cKeywords.put( Keywords.FLOAT, new Integer(IToken.t_float)); - cKeywords.put( Keywords.FOR, new Integer(IToken.t_for)); - cKeywords.put( Keywords.GOTO, new Integer(IToken.t_goto)); - cKeywords.put( Keywords.IF, new Integer(IToken.t_if)); - cKeywords.put( Keywords.INLINE, new Integer(IToken.t_inline)); - cKeywords.put( Keywords.INT, new Integer(IToken.t_int)); - cKeywords.put( Keywords.LONG, new Integer(IToken.t_long)); - cKeywords.put( Keywords.REGISTER, new Integer(IToken.t_register)); - cKeywords.put( Keywords.RESTRICT, new Integer(IToken.t_restrict)); - cKeywords.put( Keywords.RETURN, new Integer(IToken.t_return)); - cKeywords.put( Keywords.SHORT, new Integer(IToken.t_short)); - cKeywords.put( Keywords.SIGNED, new Integer(IToken.t_signed)); - cKeywords.put( Keywords.SIZEOF, new Integer(IToken.t_sizeof)); - cKeywords.put( Keywords.STATIC, new Integer(IToken.t_static)); - cKeywords.put( Keywords.STRUCT, new Integer(IToken.t_struct)); - cKeywords.put( Keywords.SWITCH, new Integer(IToken.t_switch)); - cKeywords.put( Keywords.TYPEDEF, new Integer(IToken.t_typedef)); - cKeywords.put( Keywords.UNION, new Integer(IToken.t_union)); - cKeywords.put( Keywords.UNSIGNED, new Integer(IToken.t_unsigned)); - cKeywords.put( Keywords.VOID, new Integer(IToken.t_void)); - cKeywords.put( Keywords.VOLATILE, new Integer(IToken.t_volatile)); - cKeywords.put( Keywords.WHILE, new Integer(IToken.t_while)); - cKeywords.put( Keywords._BOOL, new Integer(IToken.t__Bool)); - cKeywords.put( Keywords._COMPLEX, new Integer(IToken.t__Complex)); - cKeywords.put( Keywords._IMAGINARY, new Integer(IToken.t__Imaginary)); - - } - - static public class PreprocessorDirectives { - static public final int DEFINE = 0; - static public final int UNDEFINE = 1; - static public final int IF = 2; - static public final int IFDEF = 3; - static public final int IFNDEF = 4; - static public final int ELSE = 5; - static public final int ENDIF = 6; - static public final int INCLUDE = 7; - static public final int LINE = 8; - static public final int ERROR = 9; - static public final int PRAGMA = 10; - static public final int BLANK = 11; - static public final int ELIF = 12; - } - - public final int getCount() { - return count; - } - - public final int getDepth() { - return branches.getDepth(); - } - - protected boolean evaluateExpression(String expression, int beginningOffset ) - throws ScannerException { - - if( mode == ParserMode.QUICK_PARSE ) - { - if( expression.trim().equals( "0" ) ) - return false; - return true; - } - else - { - final NullSourceElementRequestor nullCallback = new NullSourceElementRequestor(); - IParser parser = null; - try - { - IScanner trial = - ParserFactory.createScanner( - new StringReader(expression + ";"), - EXPRESSION, - new ScannerInfo( definitions, originalConfig.getIncludePaths()), - ParserMode.QUICK_PARSE, language, nullCallback, log ); - parser = ParserFactory.createParser(trial, nullCallback, ParserMode.QUICK_PARSE, language, log ); - } catch( ParserFactoryException pfe ) - { - handleInternalError(); - } - try { - IASTExpression exp = parser.expression(null); - if( exp.evaluateExpression() == 0 ) - return false; - return true; - } catch( BacktrackException backtrack ) - { - handleProblem( IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR, expression, beginningOffset, false, true, true ); - } - catch (ExpressionEvaluationException e) { - handleProblem( IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR, expression, beginningOffset, false, true, true ); - } catch (EndOfFileException e) { - handleProblem( IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR, expression, beginningOffset, false, true, true ); - } - return true; - } - } - - - protected void skipOverSinglelineComment() throws ScannerException { - - StringBuffer comment = new StringBuffer("//"); - int c; - - loop: - for (;;) { - c = getChar(); - comment.append((char)c); - switch (c) { - case NOCHAR : - case '\n' : - break loop; - default : - break; - } - } - - } - - protected boolean skipOverMultilineComment() throws ScannerException { - int state = 0; - boolean encounteredNewline = false; - StringBuffer comment = new StringBuffer("/*"); - // simple state machine to handle multi-line comments - // state 0 == no end of comment in site - // state 1 == encountered *, expecting / - // state 2 == we are no longer in a comment - - int c = getChar(); - comment.append((char)c); - while (state != 2 && c != NOCHAR) { - if (c == '\n') - encounteredNewline = true; - - switch (state) { - case 0 : - if (c == '*') - state = 1; - break; - case 1 : - if (c == '/') - state = 2; - else if (c != '*') - state = 0; - break; - } - c = getChar(); - comment.append((char)c); - } - - if (c == NOCHAR) - handleProblem( IProblem.SCANNER_UNEXPECTED_EOF, null, getCurrentOffset(), false, true, true ); - - ungetChar(c); - - return encounteredNewline; - } - - protected void poundInclude( int beginningOffset ) throws ScannerException { - - skipOverWhitespace(); - int baseOffset = lastContext.getOffset() - lastContext.undoStackSize(); - String includeLine = getRestOfPreprocessorLine(); - StringBuffer fileName = new StringBuffer(); - boolean useIncludePath = true; - int startOffset = baseOffset; - int endOffset = baseOffset; - - if (! includeLine.equals("")) { - Scanner helperScanner = new Scanner( - new StringReader(includeLine), - null, - new ScannerInfo(definitions, originalConfig.getIncludePaths()), - new NullSourceElementRequestor(), - mode, - language, log ); - helperScanner.setForInclusion( true ); - IToken t = null; - - try { - t = helperScanner.nextToken(false); - } catch (OffsetLimitReachedException e) { - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - return; - } catch (EndOfFileException eof) { - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - return; - } - - try { - if (t.getType() == IToken.tSTRING) { - fileName.append(t.getImage()); - startOffset = baseOffset + t.getOffset(); - endOffset = baseOffset + t.getEndOffset(); - useIncludePath = false; - - // This should throw EOF - t = helperScanner.nextToken(false); - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - return; - } else if (t.getType() == IToken.tLT) { - - try { - - t = helperScanner.nextToken(false); - startOffset = baseOffset + t.getOffset(); - - while (t.getType() != IToken.tGT) { - fileName.append(t.getImage()); - helperScanner.skipOverWhitespace(); - int c = helperScanner.getChar(); - if (c == '\\') fileName.append('\\'); else helperScanner.ungetChar(c); - t = helperScanner.nextToken(false); - } - - endOffset = baseOffset + t.getEndOffset(); - - } catch (EndOfFileException eof) { - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - return; - } - - // This should throw EOF - t = helperScanner.nextToken(false); - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - - return; - - } else - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - } - catch (OffsetLimitReachedException e) { - handleInternalError(); - } - catch( EndOfFileException eof ) - { - // good - } - - } else - handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#include " + includeLine, beginningOffset, false, true, true ); - - String f = fileName.toString(); - - if( mode == ParserMode.QUICK_PARSE ) - { - if( requestor != null ) - { - IASTInclusion i = null; - try - { - i = - astFactory.createInclusion( - f, - "", - !useIncludePath, - beginningOffset, - startOffset, - startOffset + f.length(), - endOffset); - } - catch (Exception e) - { - /* do nothing */ - } - if( i != null ) - { - i.enterScope( requestor ); - i.exitScope( requestor ); - } - } - } - else - handleInclusion(f.trim(), useIncludePath, startOffset, beginningOffset, endOffset); - } - - protected static final Hashtable emptyMap = new Hashtable(); - protected Hashtable holderMap = null; - - protected void temporarilyReplaceDefinitionsMap() - { - holderMap = definitions; - definitions = emptyMap; - } - - protected void restoreDefinitionsMap() - { - definitions = holderMap; - holderMap = null; - } - - - protected boolean forInclusion = false; - /** - * @param b - */ - protected void setForInclusion(boolean b) - { - forInclusion = b; - } - - protected void poundDefine(int beginning) throws ScannerException, EndOfFileException { - skipOverWhitespace(); - // definition - String key = getNextIdentifier(); - int offset = contextStack.getCurrentContext().getOffset() - key.length() - contextStack.getCurrentContext().undoStackSize(); - - // store the previous definition to check against later - Object previousDefinition = definitions.get( key ); - - // get the next character - // the C++ standard says that macros must not put - // whitespace between the end of the definition - // identifier and the opening parenthesis - int c = getChar(); - if (c == '(') { - StringBuffer buffer = new StringBuffer(); - c = getChar(true); - while (c != ')') { - if( c == '\\' ){ - c = getChar(); - if( c == '\r' ) - c = getChar(); - - if( c == '\n' ){ - c = getChar(); - continue; - } else { - ungetChar( c ); - handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, "#define " + buffer.toString() + '\\' + (char)c, beginning, false, true, true ); - return; - } - } else if( c == '\r' || c == '\n' ){ - handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, "#define " + buffer.toString() + (char)c, beginning, false, true, true ); - return; - } else if( c == NOCHAR ){ - handleProblem( IProblem.SCANNER_UNEXPECTED_EOF, null, beginning, false, true, true ); - return; - } - - buffer.append((char) c); - c = getChar(true); - } - - String parameters = buffer.toString(); - - // replace StringTokenizer later -- not performant - StringTokenizer tokenizer = new StringTokenizer(parameters, ","); - ArrayList parameterIdentifiers = - new ArrayList(tokenizer.countTokens()); - while (tokenizer.hasMoreTokens()) { - parameterIdentifiers.add(tokenizer.nextToken().trim()); - } - - skipOverWhitespace(); - - ArrayList macroReplacementTokens = new ArrayList(); - String replacementString = getRestOfPreprocessorLine(); - - if( ! replacementString.equals( "" ) ) - { - IScanner helperScanner=null; - try { - helperScanner = - ParserFactory.createScanner( - new StringReader(replacementString), - SCRATCH, - new ScannerInfo(), - mode, - language, - new NullSourceElementRequestor(), log); - } catch (ParserFactoryException e1) { - } - helperScanner.setTokenizingMacroReplacementList( true ); - IToken t = null; - try { - t = helperScanner.nextToken(false); - } catch (OffsetLimitReachedException e2) { - handleInternalError(); - } - try { - while (true) { - //each # preprocessing token in the replacement list shall be followed - //by a parameter as the next reprocessing token in the list - if( t.getType() == tPOUND ){ - macroReplacementTokens.add( t ); - t = helperScanner.nextToken(false); - int index = parameterIdentifiers.indexOf(t.getImage()); - if (index == -1 ) { - //not found - - handleProblem( IProblem.PREPROCESSOR_MACRO_PASTING_ERROR, "#define " + key + " " + replacementString, - beginning, false, true, true ); - return; - } - } - - macroReplacementTokens.add(t); - t = helperScanner.nextToken(false); - } - } - catch( OffsetLimitReachedException olre ) - { - handleInternalError(); - } - catch( EndOfFileException eof ) - { - // good - } - } - - IMacroDescriptor descriptor = new MacroDescriptor(); - descriptor.initialize( - key, - parameterIdentifiers, - macroReplacementTokens, - key + "(" + parameters + ")"); - - checkValidMacroRedefinition(key, previousDefinition, descriptor, beginning); - addDefinition(key, descriptor); - - } - else if ((c == '\n') || (c == '\r')) - { - checkValidMacroRedefinition(key, previousDefinition, "", beginning); - addDefinition( key, "" ); - } - else if ((c == ' ') || (c == '\t') ) { - // this is a simple definition - skipOverWhitespace(); - - // get what we are to map the name to and add it to the definitions list - String value = getRestOfPreprocessorLine(); - - checkValidMacroRedefinition(key, previousDefinition, value, beginning); - addDefinition( key, value ); - - } else if (c == '/') { - // this could be a comment - c = getChar(); - if (c == '/') // one line comment - { - skipOverSinglelineComment(); - checkValidMacroRedefinition(key, previousDefinition, "", beginning); - addDefinition(key, ""); - } else if (c == '*') // multi-line comment - { - if (skipOverMultilineComment()) { - // we have gone over a newline - // therefore, this symbol was defined to an empty string - checkValidMacroRedefinition(key, previousDefinition, "", beginning); - addDefinition(key, ""); - } else { - String value = getRestOfPreprocessorLine(); - - checkValidMacroRedefinition(key, previousDefinition, "", beginning); - addDefinition(key, value); - } - } else { - // this is not a comment - // it is a bad statement - handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, "#define " + key + " /" + getRestOfPreprocessorLine(), beginning, false, true, true ); - return; - } - } else { - log.traceLog("Scanner : Encountered unexpected character " + ((char) c)); - handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, "#define " + key + (char)c + getRestOfPreprocessorLine(), beginning, false, true, true ); - return; - } - - try - { - astFactory.createMacro( key, beginning, offset, offset + key.length(), contextStack.getCurrentContext().getOffset() ).acceptElement( requestor ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - - - protected void checkValidMacroRedefinition( - String key, - Object previousDefinition, - Object newDefinition, int beginningOffset ) - throws ScannerException - { - if( mode != ParserMode.QUICK_PARSE && previousDefinition != null ) - { - if( newDefinition instanceof IMacroDescriptor ) - { - if( previousDefinition instanceof IMacroDescriptor ) - { - if( ((IMacroDescriptor)previousDefinition).compatible( (IMacroDescriptor) newDefinition ) ) - return; - } - } - else if( newDefinition instanceof String ) - { - if( previousDefinition instanceof String ) - { - Scanner previous = new Scanner( new StringReader( (String)previousDefinition ), "redef-test", new ScannerInfo(), new NullSourceElementRequestor(), - mode, language, log ); - Scanner current = new Scanner( new StringReader( (String)newDefinition ), "redef-test", new ScannerInfo(), new NullSourceElementRequestor(), - mode, language, log ); - for ( ; ; ) - { - IToken p = null; - IToken c = null; - try - { - p = previous.nextToken(); - c = current.nextToken(); - - if ( c.equals( p ) ) continue; - break; - - } - catch( OffsetLimitReachedException olre ) - { - handleInternalError(); - } - catch( EndOfFileException eof ) - { - if( ( p != null ) && ( c == null ) ) - break; - if( p == null ) - { - try - { - c = current.nextToken(); - break; - } - catch( OffsetLimitReachedException olre ) - { - handleInternalError(); - } - catch( EndOfFileException eof2 ) - { - return; - } - } - } - } - } - } - - handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_REDEFN, key, beginningOffset, false, true, true ); - } - } - - /** - * - */ - protected void handleInternalError() { - // TODO Auto-generated method stub - - } - - protected Vector getMacroParameters (String params, boolean forStringizing) throws ScannerException { - - Scanner tokenizer = new Scanner(new StringReader(params), TEXT, new ScannerInfo( definitions, originalConfig.getIncludePaths() ), new NullSourceElementRequestor(), mode, language, log); - tokenizer.setThrowExceptionOnBadCharacterRead(false); - Vector parameterValues = new Vector(); - Token t = null; - String str = new String(); - boolean space = false; - int nParen = 0; - - try { - while (true) { - int c = tokenizer.getCharacter(); - if ((c != ' ') && (c != '\t') && (c != '\r') && (c != '\n')) { - space = false; - } - if (c != NOCHAR) tokenizer.ungetChar(c); - - t = (Token)(forStringizing ? tokenizer.nextTokenForStringizing() : tokenizer.nextToken(false)); - if (t.type == IToken.tLPAREN) { - nParen++; - } else if (t.type == IToken.tRPAREN) { - nParen--; - } else if (t.type == IToken.tCOMMA && nParen == 0) { - parameterValues.add(str); - str = ""; - space = false; - continue; - } - - if (space) - str += ' '; - - switch (t.type) { - case IToken.tSTRING : str += '\"' + t.image + '\"'; break; - case IToken.tLSTRING : str += "L\"" + t.image + '\"'; break; - case IToken.tCHAR : str += '\'' + t.image + '\''; break; - default : str += t.image; break; - } - space = true; - } - } - catch( OffsetLimitReachedException olre ) - { - handleInternalError(); - } - catch (EndOfFileException e) { - // Good - parameterValues.add(str); - } - - - return parameterValues; - } - - protected void expandDefinition(String symbol, Object expansion, int symbolOffset) - throws ScannerException - { - // All the tokens generated by the macro expansion - // will have dimensions (offset and length) equal to the expanding symbol. - if (expansion instanceof String ) { - String replacementValue = (String) expansion; - try - { - contextStack.updateContext( new StringReader(replacementValue), (POUND_DEFINE + symbol ), ScannerContext.ContextKind.MACROEXPANSION, null, requestor, symbolOffset, symbol.length()); - } - catch (ContextException e) - { - handleProblem( e.getId(), contextStack.getCurrentContext().getFilename(), getCurrentOffset(), false, true, true ); - consumeUntilOutOfMacroExpansion(); - return; - } - } else if (expansion instanceof IMacroDescriptor ) { - IMacroDescriptor macro = (IMacroDescriptor) expansion; - skipOverWhitespace(); - int c = getChar(); - - if (c == '(') { - StringBuffer buffer = new StringBuffer(); - int bracketCount = 1; - c = getChar(); - - while (true) { - if (c == '(') - ++bracketCount; - else if (c == ')') - --bracketCount; - - if(bracketCount == 0 || c == NOCHAR) - break; - buffer.append((char) c); - c = getChar( true ); - } - - // Position of the closing ')' - int endMacroOffset = lastContext.getOffset() - lastContext.undoStackSize() - 1; - - String betweenTheBrackets = buffer.toString().trim(); - - Vector parameterValues = getMacroParameters(betweenTheBrackets, false); - Vector parameterValuesForStringizing = getMacroParameters(betweenTheBrackets, true); - Token t = null; - - // create a string that represents what needs to be tokenized - buffer = new StringBuffer(); - List tokens = macro.getTokenizedExpansion(); - List parameterNames = macro.getParameters(); - - if (parameterNames.size() != parameterValues.size()) - { - handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, symbol, getCurrentOffset(), false, true, true ); - consumeUntilOutOfMacroExpansion(); - return; - } - - int numberOfTokens = tokens.size(); - - for (int i = 0; i < numberOfTokens; ++i) { - t = (Token) tokens.get(i); - if (t.type == IToken.tIDENTIFIER) { - - // is this identifier in the parameterNames - // list? - int index = parameterNames.indexOf(t.image); - if (index == -1 ) { - // not found - // just add image to buffer - buffer.append(t.image ); - } else { - buffer.append( - (String) parameterValues.elementAt(index) ); - } - } else if (t.type == tPOUND) { - //next token should be a parameter which needs to be turned into - //a string literal - t = (Token) tokens.get( ++i ); - int index = parameterNames.indexOf(t.image); - if( index == -1 ){ - handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, macro.getName(), getCurrentOffset(), false, true, true ); - return; - } else { - buffer.append('\"'); - String value = (String)parameterValuesForStringizing.elementAt(index); - char val [] = value.toCharArray(); - char ch; - int length = value.length(); - for( int j = 0; j < length; j++ ){ - ch = val[j]; - if( ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' ){ - //Each occurance of whitespace becomes a single space character - while( ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' ){ - ch = val[++j]; - } - buffer.append(' '); - } - //a \ character is inserted before each " and \ - if( ch == '\"' || ch == '\\' ){ - buffer.append('\\'); - buffer.append(ch); - } else { - buffer.append(ch); - } - } - buffer.append('\"'); - } - } else { - switch( t.type ) - { - case IToken.tSTRING: buffer.append('\"' + t.image + '\"'); break; - case IToken.tLSTRING: buffer.append("L\"" + t.image + '\"'); break; - case IToken.tCHAR: buffer.append('\'' + t.image + '\''); break; - default: buffer.append(t.image); break; - } - } - - boolean pastingNext = false; - - if( i != numberOfTokens - 1) - { - IToken t2 = (IToken) tokens.get(i+1); - if( t2.getType() == tPOUNDPOUND ) { - pastingNext = true; - i++; - } - } - - if( t.getType() != tPOUNDPOUND && ! pastingNext ) - if (i < (numberOfTokens-1)) // Do not append to the last one - buffer.append( " " ); - } - String finalString = buffer.toString(); - try - { - contextStack.updateContext( - new StringReader(finalString), - POUND_DEFINE + macro.getSignature(), ScannerContext.ContextKind.MACROEXPANSION, null, requestor, symbolOffset, endMacroOffset - symbolOffset + 1 ); - } - catch (ContextException e) - { - handleProblem( e.getId(), contextStack.getCurrentContext().getFilename(), getCurrentOffset(), false, true, true ); - consumeUntilOutOfMacroExpansion(); - return; - } - } else - { - handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, symbol, getCurrentOffset(), false, true, true ); - consumeUntilOutOfMacroExpansion(); - return; - } - - } else { - log.traceLog( - "Unexpected class stored in definitions table. " - + expansion.getClass().getName() ); - } - - } - - protected String handleDefinedMacro() throws ScannerException { - int o = getCurrentOffset(); - skipOverWhitespace(); - - int c = getChar(); - - String definitionIdentifier = null; - if (c == '(') { - - definitionIdentifier = getNextIdentifier(); - skipOverWhitespace(); - c = getChar(); - if (c != ')') - { - handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, "defined()", o, false, true, true); - return "0"; - } - } - else - { - ungetChar(c); - definitionIdentifier = getNextIdentifier(); - } - - if (definitions.get(definitionIdentifier) != null) - return "1"; - - return "0"; - } - - - - private ParserLanguage language = ParserLanguage.CPP; - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScanner#setCppNature(boolean) - */ - public void setLanguage( ParserLanguage value) { - language = value; - } - - public void setThrowExceptionOnBadCharacterRead( boolean throwOnBad ){ - throwExceptionOnBadCharacterRead = throwOnBad; - } - - private final ISourceElementRequestor requestor; - private IASTFactory astFactory = null; - private static final int NO_OFFSET_LIMIT = -1; - private int offsetLimit = NO_OFFSET_LIMIT; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScanner#setASTFactory(org.eclipse.cdt.internal.core.parser.ast.IASTFactory) - */ - public void setASTFactory(IASTFactory f) { - astFactory = f; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScanner#getLineNumberForOffset(int) - */ - public int getLineNumberForOffset(int i) - { - ILineOffsetReconciler reconciler = ParserFactory.createLineOffsetReconciler( backupReader ); - return reconciler.getLineNumberForOffset(i); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IScanner#setOffsetBoundary(int) - */ - public void setOffsetBoundary(int offset) { - offsetLimit = offset; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java deleted file mode 100644 index 726587d559b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerContext.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.io.IOException; -import java.io.Reader; -import java.util.Stack; - -import org.eclipse.cdt.core.parser.ast.IASTInclusion; - -public class ScannerContext implements IScannerContext -{ - private Reader reader; - private String filename; - private int macroOffset = -1; - private int macroLength = -1; - private int line = 1; - private int offset; - private Stack undo = new Stack(); - private ContextKind kind; - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#initialize(Reader, String, int, IASTInclusion, int, int, int) - */ - public ScannerContext(Reader r, String f, ContextKind k, IASTInclusion i, int mO, int mL, int l) - { - reader = r; - filename = f; - offset = 0; - kind = k; - inc = i; - macroOffset = mO; - macroLength = mL; - line = l; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#initialize(Reader, String, int, IASTInclusion) - */ - public ScannerContext(Reader r, String f, ContextKind k, IASTInclusion i) - { - this(r, f, k, i, -1, -1, 1); - } - - public int read() throws IOException { - ++offset; - int c = reader.read(); - if ((char)c == '\n') line++; - return c; - } - - /** - * Returns the filename. - * @return String - */ - public final String getFilename() - { - return filename; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#getExtension() - */ - public final int getMacroOffset() - { - return macroOffset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#getMacroLength() - */ - public final int getMacroLength() - { - return macroLength; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#getOffset() - */ - public final int getOffset() - { - // All the tokens generated by the macro expansion - // will have dimensions (offset and length) equal to the expanding symbol. - return (macroOffset < 0) ? offset : macroOffset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#getRelativeOffset() - */ - public final int getRelativeOffset() - { - return offset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#getLine() - */ - public final int getLine() - { - return line; - } - - /** - * Returns the reader. - * @return Reader - */ - public final Reader getReader() - { - return reader; - } - - public final int undoStackSize() - { - return undo.size(); - } - - /** - * Returns the undo. - * @return int - */ - public final int popUndo() - { - int c = ((Integer)undo.pop()).intValue(); - if ((char)c == '\n') line++; - return c; - } - - /** - * Sets the undo. - * @param undo The undo to set - */ - public void pushUndo(int undo) - { - if ((char)undo == '\n') line--; - this.undo.push( new Integer( undo )); - } - - - /** - * Returns the kind. - * @return int - */ - public ContextKind getKind() { - return kind; - } - - /** - * Sets the kind. - * @param kind The kind to set - */ - public void setKind(ContextKind kind) { - this.kind = kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#getExtension() - */ - public IASTInclusion getExtension() { - return inc; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IScannerContext#setExtension(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void setExtension(IASTInclusion ext) { - inc = ext; - } - - private IASTInclusion inc = null; - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerProblemFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerProblemFactory.java deleted file mode 100644 index ed5c64a9546..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ScannerProblemFactory.java +++ /dev/null @@ -1,228 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.parser.IProblem; - -/** - * @author jcamelon - * - */ -public class ScannerProblemFactory extends BaseProblemFactory implements IProblemFactory -{ - protected static Map errorMessages = new HashMap(); - static { - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_POUND_ERROR), - "#error encountered with text: "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND), - "Preprocessor Inclusion not found: "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_DEFINITION_NOT_FOUND), - "Macro definition not found: "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_INVALID_MACRO_DEFN), - "Macro definition malformed for macro: "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_INVALID_MACRO_REDEFN), - "Invalid macro redefinition for macro : "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_UNBALANCE_CONDITION), - "Preprocessor Conditionals unbalanced : "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR), - "Expression Evaluation error for condition : "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_MACRO_USAGE_ERROR), - "Macro usage error for macro :"); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_CIRCULAR_INCLUSION), - "Circular inclusion for file : "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_INVALID_DIRECTIVE), - "Invalid preprocessor directive : "); - errorMessages.put( - new Integer(IProblem.PREPROCESSOR_MACRO_PASTING_ERROR), - "Invalid use of macro pasting in macro : "); - errorMessages.put( - new Integer(IProblem.SCANNER_INVALID_ESCAPECHAR), - "Invalid escape character encountered "); - errorMessages.put( - new Integer(IProblem.SCANNER_UNBOUNDED_STRING), - "Unbounded string encountered "); - errorMessages.put( - new Integer(IProblem.SCANNER_BAD_FLOATING_POINT), - "Invalid floating point format encountered "); - errorMessages.put( - new Integer(IProblem.SCANNER_BAD_HEX_FORMAT), - "Invalid hexidecimal format encountered "); - errorMessages.put( - new Integer(IProblem.SCANNER_UNEXPECTED_EOF), - "Unexpected End Of File encountered "); - errorMessages.put( - new Integer(IProblem.SCANNER_BAD_CHARACTER), - "Bad character sequence encountered : "); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.BaseProblemFactory#createMessage() - */ - public String createMessage(int id, Map arguments, int lineNumber, char[] fileName) - { - StringBuffer buffer = new StringBuffer(); - - buffer.append(PROBLEM); - buffer.append(errorMessages.get(new Integer(id))); - switch (id) - { - case IProblem.PREPROCESSOR_POUND_ERROR : - buffer.append(arguments.get(IProblem.A_PREPROC_POUND_ERROR)); - break; - case IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND : - buffer.append(arguments.get(IProblem.A_PREPROC_INCLUDE_FILENAME)); - break; - case IProblem.PREPROCESSOR_DEFINITION_NOT_FOUND : - buffer.append(arguments.get(IProblem.A_PREPROC_MACRO_NAME)); - break; - case IProblem.PREPROCESSOR_UNBALANCE_CONDITION : - buffer.append(arguments.get(IProblem.A_PREPROC_CONDITIONAL_MISMATCH)); - break; - case IProblem.PREPROCESSOR_INVALID_MACRO_DEFN : - buffer.append(arguments.get(IProblem.A_PREPROC_MACRO_NAME)); - break; - case IProblem.PREPROCESSOR_INVALID_DIRECTIVE : - buffer.append(arguments.get(IProblem.A_PREPROC_UNKNOWN_DIRECTIVE)); - break; - case IProblem.PREPROCESSOR_INVALID_MACRO_REDEFN : - buffer.append(arguments.get(IProblem.A_PREPROC_MACRO_NAME)); - break; - case IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR : - buffer.append(arguments.get(IProblem.A_PREPROC_CONDITION)); - break; - case IProblem.PREPROCESSOR_MACRO_USAGE_ERROR : - buffer.append(arguments.get(IProblem.A_PREPROC_MACRO_NAME)); - break; - case IProblem.PREPROCESSOR_MACRO_PASTING_ERROR : - buffer.append(arguments.get(IProblem.A_PREPROC_MACRO_NAME)); - break; - case IProblem.PREPROCESSOR_CIRCULAR_INCLUSION : - buffer.append(arguments.get(IProblem.A_PREPROC_INCLUDE_FILENAME)); - break; - case IProblem.SCANNER_BAD_CHARACTER : - buffer.append( arguments.get(IProblem.A_SCANNER_BADCHAR)); - break; - case IProblem.SCANNER_UNBOUNDED_STRING : - case IProblem.SCANNER_INVALID_ESCAPECHAR : - case IProblem.SCANNER_BAD_FLOATING_POINT : - case IProblem.SCANNER_BAD_HEX_FORMAT : - case IProblem.SCANNER_UNEXPECTED_EOF : - break; - default : - return null; - } - - buffer.append( IN_FILE ); - buffer.append(fileName); - buffer.append( ON_LINE ); - buffer.append(lineNumber); - return buffer.toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IProblemFactory#createProblem(int, int, int, int, char[], java.lang.String, boolean, boolean) - */ - public IProblem createProblem( - int id, - int start, - int end, - int line, - char[] file, - Map arguments, - boolean warn, - boolean error) - { - if( checkBitmask( id, IProblem.INTERNAL_RELATED ) ) - return createInternalProblem( id, start, end, line, file, arguments, warn, error ); - - if ( checkBitmask( id, IProblem.SCANNER_RELATED ) || - checkBitmask( id, IProblem.PREPROCESSOR_RELATED ) ) - return super.createProblem( - id, - start, - end, - line, - file, - createMessage(id, arguments, line, file), - arguments, - warn, - error); - - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IProblemFactory#getRequiredAttributesForId(int) - */ - public String[] getRequiredAttributesForId(int id) - { - String [] result = new String[1]; - switch (id) - { - case IProblem.PREPROCESSOR_POUND_ERROR : - result[0] = IProblem.A_PREPROC_POUND_ERROR; - break; - case IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND : - result[0] = IProblem.A_PREPROC_INCLUDE_FILENAME; - break; - case IProblem.PREPROCESSOR_DEFINITION_NOT_FOUND : - result[0] = IProblem.A_PREPROC_MACRO_NAME; - break; - case IProblem.PREPROCESSOR_UNBALANCE_CONDITION : - result[0] = IProblem.A_PREPROC_CONDITIONAL_MISMATCH; - break; - case IProblem.PREPROCESSOR_INVALID_MACRO_DEFN : - result[0] = IProblem.A_PREPROC_MACRO_NAME; - break; - case IProblem.PREPROCESSOR_INVALID_DIRECTIVE : - result[0] = IProblem.A_PREPROC_UNKNOWN_DIRECTIVE; - break; - case IProblem.PREPROCESSOR_INVALID_MACRO_REDEFN : - result[0] = IProblem.A_PREPROC_MACRO_NAME; - break; - case IProblem.PREPROCESSOR_CONDITIONAL_EVAL_ERROR : - result[0] = IProblem.A_PREPROC_CONDITION; - break; - case IProblem.PREPROCESSOR_MACRO_USAGE_ERROR : - result[0] = IProblem.A_PREPROC_MACRO_NAME; - break; - case IProblem.PREPROCESSOR_MACRO_PASTING_ERROR : - result[0] = IProblem.A_PREPROC_MACRO_NAME; - break; - case IProblem.PREPROCESSOR_CIRCULAR_INCLUSION : - result[0] = IProblem.A_PREPROC_INCLUDE_FILENAME; - break; - case IProblem.SCANNER_BAD_CHARACTER : - result[0] = IProblem.A_SCANNER_BADCHAR; - break; - case IProblem.SCANNER_UNBOUNDED_STRING : - case IProblem.SCANNER_INVALID_ESCAPECHAR : - case IProblem.SCANNER_BAD_FLOATING_POINT : - case IProblem.SCANNER_BAD_HEX_FORMAT : - case IProblem.SCANNER_UNEXPECTED_EOF : - break; - } - return result; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/SimpleDeclarationStrategy.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/SimpleDeclarationStrategy.java deleted file mode 100644 index 2a0fef675bf..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/SimpleDeclarationStrategy.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.parser.Enum; - -/** - * @author jcamelon - * - */ -public class SimpleDeclarationStrategy extends Enum -{ - public static final SimpleDeclarationStrategy TRY_CONSTRUCTOR = new SimpleDeclarationStrategy( 1 ); - public static final SimpleDeclarationStrategy TRY_FUNCTION = new SimpleDeclarationStrategy( 2 ); - public static final SimpleDeclarationStrategy TRY_VARIABLE = new SimpleDeclarationStrategy( 3 ); - - /** - * @param enumValue - */ - public SimpleDeclarationStrategy(int enumValue) - { - super(enumValue); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParseCallback.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParseCallback.java deleted file mode 100644 index 6273867783d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParseCallback.java +++ /dev/null @@ -1,247 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; -import java.util.LinkedList; - -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.QuickParseCallback; -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTScope; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class StructuralParseCallback extends QuickParseCallback{ - - protected LinkedList scopeStack = new LinkedList(); - protected IASTScope currentScope = null; - protected int inclusionLevel = 0; - - - private void addElement (IASTDeclaration element){ - if(inclusionLevel == 0) - ((ASTScope)currentScope).addDeclaration(element); - } - - private void enterScope(IASTNode node){ - if(node instanceof IASTScope){ - pushScope((IASTScope)node); - } - } - - private void exitScope(IASTNode node){ - if(node instanceof IASTScope){ - popScope(); - } - } - - private void pushScope( IASTScope scope ){ - scopeStack.addFirst( currentScope ); - currentScope = (IASTScope)scope; - } - - private IASTScope popScope(){ - IASTScope oldScope = currentScope; - currentScope = (scopeStack.size() > 0 ) ? (IASTScope) scopeStack.removeFirst() : null; - return oldScope; - } - - private IASTScope peekAtScope(){ - return currentScope; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro) - */ - public void acceptMacro(IASTMacro macro) { - if(inclusionLevel == 0) - macros.add(macro); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable) - */ - public void acceptVariable(IASTVariable variable) { - addElement(variable); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void acceptFunctionDeclaration(IASTFunction function) { - addElement(function); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefDeclaration(org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration) - */ - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) { - addElement(typedef); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier) - */ - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) { - enterScope(enumeration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier) - */ - public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType) { - enterScope(elaboratedType); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration) - */ - public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) { - addElement(abstractDeclaration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) { - if(inclusionLevel == 0) - inclusions.add(inclusion); - inclusionLevel++; - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - addElement(namespaceDefinition); - enterScope(namespaceDefinition); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void enterClassSpecifier(IASTClassSpecifier classSpecification) { - enterScope(classSpecification); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) { - enterScope(linkageSpec); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) { - enterScope(compilationUnit); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void acceptMethodDeclaration(IASTMethod method) { - addElement(method); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField) - */ - public void acceptField(IASTField field) { - addElement(field); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void exitCompilationUnit(IASTCompilationUnit compilationUnit) { - exitScope(compilationUnit); - this.compilationUnit = compilationUnit; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion( IASTInclusion inclusion ) - { - inclusionLevel--; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IQuickParseCallback#getCompilationUnit() - */ - public IASTCompilationUnit getCompilationUnit() { - return compilationUnit; } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void exitClassSpecifier(IASTClassSpecifier classSpecification) { - exitScope(classSpecification); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec) { - exitScope(linkageSpec); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - exitScope(namespaceDefinition); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void enterFunctionBody(IASTFunction function) { - addElement(function); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void enterMethodBody(IASTMethod method) { - addElement(method); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) { - addElement(declaration); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParser.java deleted file mode 100644 index 06c3b24c322..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/StructuralParser.java +++ /dev/null @@ -1,77 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.parser.BacktrackException; -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - */ -public class StructuralParser extends Parser implements IParser { - - /** - * @param scanner - * @param ourCallback - * @param language - * @param logService - */ - public StructuralParser(IScanner scanner, ISourceElementRequestor ourCallback, ParserLanguage language, IParserLogService logService) { - super(scanner, ourCallback, language, logService); - astFactory = ParserFactory.createASTFactory( ParserMode.COMPLETE_PARSE, language); - scanner.setASTFactory(astFactory); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.Parser#handleFunctionBody(org.eclipse.cdt.core.parser.ast.IASTScope, boolean) - */ - protected void handleFunctionBody( - IASTScope scope, - boolean isInlineFunction) - throws BacktrackException, EndOfFileException { - skipOverCompoundStatement(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.Parser#catchBlockCompoundStatement(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - protected void catchBlockCompoundStatement(IASTScope scope) - throws BacktrackException, EndOfFileException { - skipOverCompoundStatement(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int) - */ - public IASTCompletionNode parse(int offset) throws ParserNotImplementedException { - throw new ParserNotImplementedException(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParser#parse(int, int) - */ - public IASTNode parse(int startingOffset, int endingOffset) throws ParserNotImplementedException { - throw new ParserNotImplementedException(); - } - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Token.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Token.java deleted file mode 100644 index 4a5a87da7cb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Token.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.parser.IToken; - -public class Token implements IToken { - - public Token(int t, String i, IScannerContext context ) { - type = t; - image = i; - filename = context.getFilename(); - offset = context.getOffset() - image.length() - context.undoStackSize(); - macroOffset = context.getMacroOffset(); - macroLength = context.getMacroLength(); - - if( type == tLSTRING || type == tSTRING || type == tCHAR ){ - offset--; - } - } - - public Token(int t, String i) { - type = t; - image = i; - } - - public String toString() - { - return "Token type=" + type + " image =" + image + " offset=" + offset; - } - - public int type; - public int getType() { return type; } - - protected String image; - public String getImage() { return image; } - - public String filename; - - protected int offset; - protected int macroOffset = -1; - protected int macroLength = -1; - // All the tokens generated by the macro expansion - // will have dimensions (offset and length) equal to the expanding symbol. - public int getOffset() { return (macroOffset < 0) ? offset : macroOffset; } - public int getLength() { return (macroLength < 0) ? image.length() : macroLength; } - public int getEndOffset() { return getOffset() + getLength(); } - - - public int getDelta( IToken other ) - { - return other.getOffset() + other.getLength() - getOffset(); - } - - private IToken next; - public IToken getNext() { return next; } - public void setNext(IToken t) { next = t; } - - public boolean looksLikeExpression() - { - switch( getType() ) - { - case tINTEGER: - case t_false: - case t_true: - case tSTRING: - case tLSTRING: - case tFLOATINGPT: - case tCHAR: - case tAMPER: - case tDOT: - case tLPAREN: - case tMINUS: - case tSTAR: - case tPLUS: - case tNOT: - case tCOMPL: - return true; - default: - break; - } - - - return false; - } - - public boolean isPointer() - { - return (getType() == tAMPER || getType() == tSTAR); - } - - public boolean isOperator() - { - switch( getType() ) - { - case IToken.t_new: - case IToken.t_delete: - case IToken.tPLUS: - case IToken.tMINUS: - case IToken.tSTAR: - case IToken.tDIV: - case IToken.tXOR: - case IToken.tMOD: - case IToken.tAMPER: - case IToken.tBITOR: - case IToken.tCOMPL: - case IToken.tNOT: - case IToken.tASSIGN: - case IToken.tLT: - case IToken.tGT: - case IToken.tPLUSASSIGN: - case IToken.tMINUSASSIGN: - case IToken.tSTARASSIGN: - case IToken.tDIVASSIGN: - case IToken.tMODASSIGN: - case IToken.tBITORASSIGN: - case IToken.tAMPERASSIGN: - case IToken.tXORASSIGN: - case IToken.tSHIFTL: - case IToken.tSHIFTR: - case IToken.tSHIFTLASSIGN: - case IToken.tSHIFTRASSIGN: - case IToken.tEQUAL: - case IToken.tNOTEQUAL: - case IToken.tLTEQUAL: - case IToken.tGTEQUAL: - case IToken.tAND: - case IToken.tOR: - case IToken.tINCR: - case IToken.tDECR: - case IToken.tCOMMA: - case IToken.tARROW: - case IToken.tARROWSTAR: - return true; - default: - return false; - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IToken#setImage() - */ - public void setImage( String i ) { - image = i; - } - - - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if( other == null ) return false; - if( !( other instanceof IToken ) ) - return false; - if( !(((IToken)other).getImage().equals( image ))) - return false; - if( ((IToken)other).getType() != type ) - return false; - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IToken#setType(int) - */ - public void setType(int i) { - type = i; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java deleted file mode 100644 index e0d0c99b78f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TokenDuple.java +++ /dev/null @@ -1,176 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.ITokenDuple; - -/** - * @author jcamelon - * - */ -public class TokenDuple implements ITokenDuple { - - public TokenDuple( IToken first, IToken last ) - { - firstToken = first; - lastToken = last; - } - protected final IToken firstToken, lastToken; - /** - * @return - */ - public IToken getFirstToken() { - return firstToken; - } - - /** - * @return - */ - public IToken getLastToken() { - return lastToken; - } - - public Iterator iterator() - { - return new TokenIterator(); - } - - private class TokenIterator implements Iterator - { - private IToken iter = TokenDuple.this.firstToken; - - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() { - return ( iter != null ); - } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() { - if( ! hasNext() ) - throw new NoSuchElementException(); - IToken temp = iter; - if( iter == lastToken ) - iter = null; - else - iter = iter.getNext(); - return temp; - } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() { - throw new UnsupportedOperationException(); - } - - } - - public String toString() - { - StringBuffer buff = new StringBuffer(); - IToken prev = null; - IToken iter = firstToken; - for( ; ; ) - { - if( prev != null && - prev.getType() != IToken.tCOLONCOLON && - prev.getType() != IToken.tIDENTIFIER && - prev.getType() != IToken.tLT && - prev.getType() != IToken.tCOMPL && - iter.getType() != IToken.tGT && - prev.getType() != IToken.tLBRACKET && - iter.getType() != IToken.tRBRACKET && - iter.getType() != IToken.tCOLONCOLON ) - buff.append( ' '); - - - buff.append( iter.getImage() ); - if( iter == lastToken ) break; - prev = iter; - iter = iter.getNext(); - } - return buff.toString().trim(); - } - - public boolean isIdentifier() - { - return ( firstToken == lastToken ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ITokenDuple#length() - */ - public int length() - { - int count = 0; - Iterator i = iterator(); - while( i.hasNext() ) - { - ++count; - i.next(); - } - return count; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ITokenDuple#getSubDuple(int, int) - */ - public ITokenDuple getSubrange(int startIndex, int endIndex) - { - return new TokenDuple( getToken( startIndex ), getToken( endIndex) ); - } - - /** - * @param endIndex - */ - public IToken getToken(int index) - { - if( index < 0 || index >= length() ) return null; - Iterator i = iterator(); - int count = 0; - while( i.hasNext() ) - { - IToken r = (IToken)i.next(); - if( count == index ) - return r; - ++count; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ITokenDuple#findLastTokenType(int) - */ - public int findLastTokenType(int type) - { - int count = 0; - int lastFound = -1; - Iterator i = iterator(); - while( i.hasNext() ) - { - IToken token = (IToken)i.next(); - if( token.getType() == type ) - lastFound = count; - ++count; - } - - return lastFound; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TypeId.java deleted file mode 100644 index af554f0a2b8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/TypeId.java +++ /dev/null @@ -1,79 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; - -/** - * @author jcamelon - * - */ -public class TypeId implements IDeclarator -{ - private ITokenDuple name; - private List arrayModifiers = new ArrayList(); - private List pointerOperators = new ArrayList(); - /** - * - */ - public TypeId() - { - super(); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclarator#getPointerOperators() - */ - public List getPointerOperators() - { - return pointerOperators; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclarator#addPointerOperator(org.eclipse.cdt.core.parser.ast.ASTPointerOperator) - */ - public void addPointerOperator(ASTPointerOperator ptrOp) - { - pointerOperators.add( ptrOp ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclarator#addArrayModifier(org.eclipse.cdt.core.parser.ast.IASTArrayModifier) - */ - public void addArrayModifier(IASTArrayModifier arrayMod) - { - arrayModifiers.add( arrayMod ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclarator#getArrayModifiers() - */ - public List getArrayModifiers() - { - return arrayModifiers; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclarator#setPointerOperatorName(org.eclipse.cdt.core.parser.ITokenDuple) - */ - public void setPointerOperatorName(ITokenDuple nameDuple) - { - name = nameDuple; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.IDeclarator#getPointerOperatorNameDuple() - */ - public ITokenDuple getPointerOperatorNameDuple() - { - return name; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java deleted file mode 100644 index e3468ee10cb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTAbstractDeclaration.java +++ /dev/null @@ -1,124 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; - -/** - * @author jcamelon - * - */ -public class ASTAbstractDeclaration implements IASTAbstractDeclaration -{ - private final boolean isVolatile; - private final List parms; - private final boolean isConst; - private final IASTTypeSpecifier typeSpecifier; - private final List pointerOperators; - private final List arrayModifiers; - private final ASTPointerOperator pointerOperator; - /** - * @param isConst - * @param typeSpecifier - * @param pointerOperators - * @param arrayModifiers - */ - public ASTAbstractDeclaration(boolean isConst, boolean isVolatile, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp ) - { - this.isConst = isConst; - this.typeSpecifier = typeSpecifier; - this.pointerOperators = pointerOperators; - this.arrayModifiers = arrayModifiers; - this.parms = parameters; - this.pointerOperator = pointerOp; - this.isVolatile = isVolatile; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isConst() - */ - public boolean isConst() - { - return isConst; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getTypeSpecifier() - */ - public IASTTypeSpecifier getTypeSpecifier() - { - return typeSpecifier; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerOperators() - */ - public Iterator getPointerOperators() - { - if( pointerOperators == null ) return new EmptyIterator(); - return pointerOperators.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getArrayModifiers() - */ - public Iterator getArrayModifiers() - { - if( arrayModifiers == null ) return new EmptyIterator(); - return arrayModifiers.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getParameters() - */ - public Iterator getParameters() - { - if( parms == null ) return new EmptyIterator(); - return parms.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerToFunctionOperator() - */ - public ASTPointerOperator getPointerToFunctionOperator() - { - return pointerOperator; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isVolatile() - */ - public boolean isVolatile() - { - return isVolatile; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - Iterator arrayMods = getArrayModifiers(); - while( arrayMods.hasNext() ) - ((IASTArrayModifier)arrayMods.next()).acceptElement(requestor); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTArrayModifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTArrayModifier.java deleted file mode 100644 index bd0839088a0..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTArrayModifier.java +++ /dev/null @@ -1,62 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTExpression; - -/** - * @author jcamelon - * - */ -public class ASTArrayModifier implements IASTArrayModifier -{ - private final IASTExpression expression; - /** - * @param exp - */ - public ASTArrayModifier(IASTExpression exp) - { - expression = exp; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTArrayModifier#getExpression() - */ - public IASTExpression getExpression() - { - return expression; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - if( expression != null ) - expression.acceptElement( requestor ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTCompletionNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTCompletionNode.java deleted file mode 100644 index 6dfa5dac3dd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTCompletionNode.java +++ /dev/null @@ -1,77 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - */ -public class ASTCompletionNode implements IASTCompletionNode { - - private final String prefix; - private final IASTNode context; - private final IASTScope scope; - private final CompletionKind kind; - private final Set keywordSet; - - public ASTCompletionNode( CompletionKind kind, IASTScope scope, IASTNode context, String prefix, Set keywords ) - { - this.kind = kind; - this.context = context; - this.scope = scope; - this.prefix = prefix; - this.keywordSet = keywords; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCompletionNode#getCompletionKind() - */ - public CompletionKind getCompletionKind() { - return kind; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCompletionNode#getCompletionScope() - */ - public IASTScope getCompletionScope() { - return scope; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCompletionNode#getCompletionContext() - */ - public IASTNode getCompletionContext() { - return context; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCompletionNode#getCompletionPrefix() - */ - public String getCompletionPrefix() { - return prefix; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCompletionNode#getKeywords() - */ - public Iterator getKeywords() { - if( keywordSet == null ) - return new EmptyIterator(); - return keywordSet.iterator(); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java deleted file mode 100644 index 39f1af97226..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTDesignator.java +++ /dev/null @@ -1,88 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDesignator; -import org.eclipse.cdt.core.parser.ast.IASTExpression; - -/** - * @author jcamelon - * - */ -public class ASTDesignator implements IASTDesignator -{ - /** - * @param kind - * @param constantExpression - * @param string - */ - public ASTDesignator(DesignatorKind kind, IASTExpression constantExpression, String fieldName, int fieldOffset ) - { - this.fieldName = fieldName; - this.constantExpression = constantExpression; - this.kind = kind; - this.fieldOffset = fieldOffset; - } - - private int fieldOffset; - private final String fieldName; - private final IASTExpression constantExpression; - private final DesignatorKind kind; - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#getKind() - */ - public DesignatorKind getKind() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#arraySubscriptExpression() - */ - public IASTExpression arraySubscriptExpression() - { - return constantExpression; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#fieldName() - */ - public String fieldName() - { - return fieldName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - if( constantExpression != null ) - constantExpression.acceptElement(requestor); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTDesignator#fieldOffset() - */ - public int fieldOffset() - { - return fieldOffset; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInclusion.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInclusion.java deleted file mode 100644 index 2e4c9df1538..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTInclusion.java +++ /dev/null @@ -1,156 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; - -/** - * @author jcamelon - * - */ -public class ASTInclusion implements IASTInclusion { - - public ASTInclusion( String name, String fileName, boolean local, int startingOffset, int nameOffset, int nameEndOffset, int endOffset ) - { - this.name = name; - this.fileName = fileName; - this.local = local; - setStartingOffset(startingOffset); - setNameOffset(nameOffset); - setNameEndOffset(nameEndOffset); - setEndingOffset(endOffset); - } - - private int nameEndOffset; - private final String name, fileName; - private final boolean local; - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInclusion#getName() - */ - public String getName() { - return name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInclusion#getFullFileName() - */ - public String getFullFileName() { - return fileName; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInclusion#isLocal() - */ - public boolean isLocal() { - return local; - } - - - private int startingOffset = 0, nameOffset = 0, endingOffset = 0; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() { - return startingOffset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() { - return endingOffset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElement#getElementNameOffset() - */ - public int getNameOffset() { - return nameOffset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IOffsetableElementRW#setStartingOffset(int) - */ - public void setStartingOffset(int o) { - startingOffset = o; - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IOffsetableElementRW#setEndingOffset(int) - */ - public void setEndingOffset(int o) { - endingOffset = o; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IOffsetableElementRW#setNameOffset(int) - */ - public void setNameOffset(int o) { - nameOffset = o; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterInclusion(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitInclusion(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return nameEndOffset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - nameEndOffset = o; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTMacro.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTMacro.java deleted file mode 100644 index 257e74345e8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTMacro.java +++ /dev/null @@ -1,118 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTMacro; - -/** - * @author jcamelon - * - */ -public class ASTMacro implements IASTMacro { - - private int nameEndOffset = 0; - private final String name; - public ASTMacro( String name, int start, int end, int nameBeg, int nameEnd ) - { - this.name =name; - setStartingOffset(start); - setNameOffset(nameBeg); - setNameEndOffset(nameEnd); - setEndingOffset(end); - } - - private int startingOffset = 0, endingOffset = 0, nameOffset = 0; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMacro#getName() - */ - public String getName() { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElementRW#setStartingOffset(int) - */ - public void setStartingOffset(int o) { - startingOffset = o; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElementRW#setEndingOffset(int) - */ - public void setEndingOffset(int o) { - endingOffset = o; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElementRW#setNameOffset(int) - */ - public void setNameOffset(int o) { - nameOffset = o; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() { - return startingOffset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() { - return endingOffset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IOffsetableElement#getElementNameOffset() - */ - public int getNameOffset() { - return nameOffset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptMacro( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return nameEndOffset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - nameEndOffset = o; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTQualifiedNamedElement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTQualifiedNamedElement.java deleted file mode 100644 index 2c094c78da4..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/ASTQualifiedNamedElement.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import java.util.Stack; - -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTScopedElement; - -/** - * @author jcamelon - * - */ -public class ASTQualifiedNamedElement implements IASTQualifiedNameElement -{ - - /** - * @param scope - */ - public ASTQualifiedNamedElement(IASTScope scope, String name ) - { - Stack names = new Stack(); - IASTScope parent = scope; - - names.push( name ); // push on our own name - while (parent != null) - { - if (parent instanceof IASTNamespaceDefinition - || parent instanceof IASTClassSpecifier ) - { - names.push(((IASTOffsetableNamedElement)parent).getName()); - if( parent instanceof IASTScopedElement ) - parent = ((IASTScopedElement)parent).getOwnerScope(); - } - else - break; - } - if (names.size() != 0) - { - qualifiedNames = new String[names.size()]; - int counter = 0; - while (!names.empty()) - qualifiedNames[counter++] = (String)names.pop(); - } - else - qualifiedNames = null; - - } - - public String[] getFullyQualifiedName() - { - return qualifiedNames; - } - - private final String[] qualifiedNames; - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java deleted file mode 100644 index fe9e0807446..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/BaseASTFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import java.util.List; - -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTDesignator; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTDesignator.DesignatorKind; - - -/** - * @author jcamelon - * - */ -public class BaseASTFactory { - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createMacro(java.lang.String, int, int, int) - */ - public IASTMacro createMacro(String name, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset) { - IASTMacro m = new ASTMacro( name, startingOffset, endingOffset, nameOffset, nameEndOffset ); - return m; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createInclusion(java.lang.String, java.lang.String, boolean) - */ - public IASTInclusion createInclusion(String name, String fileName, boolean local, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset) { - IASTInclusion inclusion = new ASTInclusion( name, fileName, local, startingOffset, nameOffset, nameEndOffset, endingOffset ); - return inclusion; - } - - public IASTAbstractDeclaration createAbstractDeclaration(boolean isConst, boolean isVolatile, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOperator) - { - return new ASTAbstractDeclaration( isConst, isVolatile, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOperator ); - } - - public IASTArrayModifier createArrayModifier(IASTExpression exp) - { - return new ASTArrayModifier( exp ); - } - - public IASTDesignator createDesignator(DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier) - { - return new ASTDesignator( kind, constantExpression, - fieldIdentifier == null ? "" : fieldIdentifier.getImage(), - fieldIdentifier == null ? -1 : fieldIdentifier.getOffset() ); - } - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java deleted file mode 100644 index 7024c6e16a6..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/EmptyIterator.java +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -import java.util.Iterator; -import java.util.NoSuchElementException; - - -public class EmptyIterator implements Iterator -{ - - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() - { - return false; - } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() - { - throw new NoSuchElementException(); - } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() - { - throw new UnsupportedOperationException(); - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/NamedOffsets.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/NamedOffsets.java deleted file mode 100644 index 885c038c4b3..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/NamedOffsets.java +++ /dev/null @@ -1,47 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - - -/** - * @author jcamelon - * - */ -public class NamedOffsets extends Offsets { - - private int nameEndOffset = 0; - private int nameOffset = 0; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() { - return nameOffset; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) { - nameOffset = o; - } - - public int getNameEndOffset() - { - return nameEndOffset; - } - - public void setNameEndOffset( int offset ) - { - nameEndOffset = offset; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/Offsets.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/Offsets.java deleted file mode 100644 index 5e11a809611..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/Offsets.java +++ /dev/null @@ -1,39 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast; - -/** - * @author jcamelon - * - */ -public class Offsets { - - protected int startingOffset = 0; - - protected int endingOffset = 0; - - public void setStartingOffset(int o) { - startingOffset = o; - } - - public void setEndingOffset(int o) { - endingOffset = o; - } - - public int getStartingOffset() { - return startingOffset; - } - - public int getEndingOffset() { - return endingOffset; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTASMDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTASMDefinition.java deleted file mode 100644 index a21cdcfd5ea..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTASMDefinition.java +++ /dev/null @@ -1,98 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; - -/** - * @author jcamelon - * - */ -public class ASTASMDefinition extends ASTAnonymousDeclaration implements IASTASMDefinition -{ - private Offsets offsets = new Offsets(); - private final String assembly; - /** - * - */ - public ASTASMDefinition( IContainerSymbol scope, String assembly, int first, int last ) - { - super( scope ); - this.assembly = assembly; - setStartingOffset(first); - setEndingOffset(last); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTASMDefinition#getBody() - */ - public String getBody() - { - return assembly; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptASMDefinition(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAbstractTypeSpecifierDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAbstractTypeSpecifierDeclaration.java deleted file mode 100644 index b18bd438c23..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAbstractTypeSpecifierDeclaration.java +++ /dev/null @@ -1,120 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; - - -/** - * @author jcamelon - * - */ -public class ASTAbstractTypeSpecifierDeclaration - extends ASTAnonymousDeclaration - implements IASTAbstractTypeSpecifierDeclaration -{ - private final IASTTypeSpecifier typeSpec; - private final IASTTemplate ownerTemplate; - private Offsets offsets = new Offsets(); - /** - * @param ownerScope - */ - public ASTAbstractTypeSpecifierDeclaration(IContainerSymbol ownerScope, IASTTypeSpecifier typeSpecifier, IASTTemplate ownerTemplate, int startingOffset, int endingOffset ) - { - super(ownerScope); - this.typeSpec = typeSpecifier; - this.ownerTemplate = ownerTemplate; - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptAbstractTypeSpecDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeSpecifierOwner#getTypeSpecifier() - */ - public IASTTypeSpecifier getTypeSpecifier() - { - return typeSpec; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration() - */ - public IASTTemplate getOwnerTemplateDeclaration() - { - return ownerTemplate; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAnonymousDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAnonymousDeclaration.java deleted file mode 100644 index dca696eb68d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTAnonymousDeclaration.java +++ /dev/null @@ -1,39 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; - -/** - * @author jcamelon - * - */ -public abstract class ASTAnonymousDeclaration extends ASTNode implements IASTDeclaration -{ - private final IContainerSymbol ownerScope; - /** - * - */ - public ASTAnonymousDeclaration( IContainerSymbol ownerScope ) - { - this.ownerScope = ownerScope; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - return (IASTScope)ownerScope.getASTExtension().getPrimaryDeclaration(); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTBaseSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTBaseSpecifier.java deleted file mode 100644 index 1b3f9b44afd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTBaseSpecifier.java +++ /dev/null @@ -1,115 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTBaseSpecifier implements IASTBaseSpecifier -{ - private ASTReferenceStore referenceDelegate; - private final boolean isVirtual; - private final ISymbol symbol; - private final ASTAccessVisibility visibility; - private final int offset; - /** - * @param symbol - * @param b - * @param visibility - */ - public ASTBaseSpecifier(ISymbol symbol, boolean b, ASTAccessVisibility visibility, int nameOffset, List references) - { - isVirtual = b; - this.visibility = visibility; - this.symbol = symbol; - this.offset = nameOffset; - referenceDelegate = new ASTReferenceStore( references ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getAccess() - */ - public ASTAccessVisibility getAccess() - { - return visibility; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#isVirtual() - */ - public boolean isVirtual() - { - return isVirtual; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassName() - */ - public String getParentClassName() - { - return symbol.getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier() - */ - public IASTClassSpecifier getParentClassSpecifier() - throws ASTNotImplementedException - { - return (IASTClassSpecifier)symbol.getASTExtension().getPrimaryDeclaration(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getNameOffset() - */ - public int getNameOffset() - { - return offset; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReferenceStore#processReferences() - */ - public void processReferences(ISourceElementRequestor requestor) throws ASTNotImplementedException - { - referenceDelegate.processReferences(requestor); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - referenceDelegate.processReferences(requestor); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassReference.java deleted file mode 100644 index 99424e8ac63..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassReference.java +++ /dev/null @@ -1,78 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; - -/** - * @author jcamelon - * - */ -public class ASTClassReference - extends ASTReference - implements IASTClassReference -{ - private final IASTTypeSpecifier reference; - /** - * @param i - * @param string - * @param specifier - */ - public ASTClassReference(int i, String string, IASTTypeSpecifier specifier) - { - super( i, string ); - reference = specifier; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return (ISourceElementCallbackDelegate)reference; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptClassReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassReference#isResolved() - */ - public boolean isResolved() - { - return ( reference instanceof IASTClassSpecifier ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassSpecifier.java deleted file mode 100644 index d343045049b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTClassSpecifier.java +++ /dev/null @@ -1,271 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol.IParentSymbol; - -/** - * @author jcamelon - * - */ -public class ASTClassSpecifier extends ASTScope implements IASTClassSpecifier -{ - private List declarations = new ArrayList(); - public class BaseIterator implements Iterator - { - - private final Iterator parents; - /** - * @param symbol - */ - public BaseIterator(IDerivableContainerSymbol symbol) - { - if( symbol.getParents() != null ) - parents = symbol.getParents().iterator(); - else - parents = null; - } - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() - { - if( parents == null ) - return false; - return parents.hasNext(); - } - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() - { - if( ! hasNext() ) - throw new NoSuchElementException(); - - IParentSymbol pw = (IParentSymbol)parents.next(); - - return new ASTBaseSpecifier( pw.getParent(), pw.isVirtual(), pw.getAccess(), pw.getOffset(), pw.getReferences() ); - - } - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() - { - throw new UnsupportedOperationException(); - } - } - - - - private NamedOffsets offsets = new NamedOffsets(); - private final ClassNameType classNameType; - private final ASTClassKind classKind; - private ASTAccessVisibility currentVisibility; - private final ASTQualifiedNamedElement qualifiedName; - private final ASTReferenceStore references; - - /** - * @param symbol - */ - public ASTClassSpecifier(ISymbol symbol, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, int startingOffset, int nameOffset, int nameEndOffset, List references ) - { - super(symbol); - classKind = kind; - classNameType = type; - currentVisibility = access; - setStartingOffset(startingOffset); - setNameOffset(nameOffset); - setNameEndOffset(nameEndOffset); - qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() ); - this.references = new ASTReferenceStore( references ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassNameType() - */ - public ClassNameType getClassNameType() - { - return classNameType; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassKind() - */ - public ASTClassKind getClassKind() - { - return classKind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getBaseClauses() - */ - public Iterator getBaseClauses() - { - return new BaseIterator( (IDerivableContainerSymbol)getSymbol() ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getCurrentVisibilityMode() - */ - public ASTAccessVisibility getCurrentVisibilityMode() - { - return currentVisibility; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#setCurrentVisibility(org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) - */ - public void setCurrentVisibility(ASTAccessVisibility visibility) - { - currentVisibility = visibility; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return symbol.getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - references.processReferences( requestor ); - try - { - requestor.enterClassSpecifier(this); - } - catch (Exception e) - { - /* do nothing */ - } - Iterator i = getBaseClauses(); - while( i.hasNext() ) - { - IASTBaseSpecifier baseSpec = (IASTBaseSpecifier)i.next(); - baseSpec.acceptElement(requestor); - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitClassSpecifier(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - return (IASTScope)symbol.getContainingSymbol().getASTExtension().getPrimaryDeclaration(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - - public Iterator getDeclarations() - { - return declarations.iterator(); - } - public void addDeclaration(IASTDeclaration declaration) - { - declarations.add(declaration); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java deleted file mode 100644 index 218dc24809d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCodeScope.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Created on Sep 2, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; - -/** - * @author jcamelon - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ASTCodeScope extends ASTScope implements IASTCodeScope { - - private List declarations = new ArrayList(); - private final IASTCodeScope ownerCodeScope; - - /** - * @param newScope - */ - public ASTCodeScope(IContainerSymbol newScope) { - super( newScope ); - ownerCodeScope = ( newScope.getContainingSymbol().getASTExtension().getPrimaryDeclaration() instanceof IASTCodeScope ) ? - (IASTCodeScope) newScope.getContainingSymbol().getASTExtension().getPrimaryDeclaration() : null; - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) { - try - { - requestor.enterCodeBlock( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) { - try - { - requestor.exitCodeBlock( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getOwnerCodeScope() - */ - public IASTCodeScope getOwnerCodeScope() - { - return ownerCodeScope; - } - - public Iterator getDeclarations() - { - return declarations.iterator(); - } - - public void addDeclaration(IASTDeclaration declaration) - { - declarations.add(declaration); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCompilationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCompilationUnit.java deleted file mode 100644 index 2b926efec56..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTCompilationUnit.java +++ /dev/null @@ -1,82 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTCompilationUnit - extends ASTScope - implements IASTCompilationUnit -{ - private List declarations = new ArrayList(); - /** - * @param symbol - */ - public ASTCompilationUnit(ISymbol symbol) - { - super(symbol); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterCompilationUnit( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitCompilationUnit( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - public Iterator getDeclarations() - { - return declarations.iterator(); - } - public void addDeclaration(IASTDeclaration declaration) - { - declarations.add(declaration); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java deleted file mode 100644 index bc395dcae94..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTConstructorMemberInitializer.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; -import org.eclipse.cdt.core.parser.ast.IASTExpression; - -/** - * @author jcamelon - * - */ -public class ASTConstructorMemberInitializer - implements IASTConstructorMemberInitializer -{ - private final int nameOffset; - private final boolean requireNameResolution; - private final String name; - private final IASTExpression expression; - private final List references; - /** - * - */ - public ASTConstructorMemberInitializer( IASTExpression expression, String name, int nameOffset, List references, boolean requireNameResolution ) - { - this.expression = expression; - this.name = name; - this.nameOffset = nameOffset; - this.references = references; - this.requireNameResolution = requireNameResolution; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer#getExpressionList() - */ - public IASTExpression getExpressionList() - { - return expression; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - ASTReferenceStore store = new ASTReferenceStore( references ); - store.processReferences( requestor ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /** - * @return - */ - public boolean requiresNameResolution() - { - return requireNameResolution; - } - - /** - * @return - */ - public List getReferences() - { - return references; - } - /** - * @return - */ - public int getNameOffset() - { - return nameOffset; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTElaboratedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTElaboratedTypeSpecifier.java deleted file mode 100644 index 576e84ef206..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTElaboratedTypeSpecifier.java +++ /dev/null @@ -1,171 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElaboratedTypeSpecifier -{ - private List references; - private final boolean isForwardDeclaration; - private final ASTClassKind kind; - private final ASTQualifiedNamedElement qualifiedName; - private NamedOffsets offsets = new NamedOffsets(); - private final ASTReferenceStore store; - - /** - * @param checkSymbol - * @param kind - * @param startingOffset - * @param endOffset - */ - public ASTElaboratedTypeSpecifier(ISymbol checkSymbol, ASTClassKind kind, int startingOffset, int nameOffset, int nameEndOffset, int endOffset, List references, boolean isDecl ) - { - super( checkSymbol ); - this.kind = kind; - setStartingOffset( startingOffset ); - setNameOffset( nameOffset ); - setNameEndOffset(nameEndOffset); - setEndingOffset( endOffset ); - qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), checkSymbol.getName() ); - store = new ASTReferenceStore( references ); - isForwardDeclaration = isDecl; - this.references = references; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getName() - */ - public String getName() - { - return getSymbol().getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getClassKind() - */ - public ASTClassKind getClassKind() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#isResolved() - */ - public boolean isResolved() throws ASTNotImplementedException - { - return ! getSymbol().isForwardDeclaration(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset( o ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - if( isForwardDeclaration ) - try - { - requestor.acceptElaboratedForewardDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - store.processReferences(requestor); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) { - offsets.setNameOffset(o); - } - - public List getReferences() - { - return references; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationReference.java deleted file mode 100644 index d7d503aa3d1..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationReference.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; - -/** - * @author jcamelon - * - */ -public class ASTEnumerationReference - extends ASTReference - implements IASTEnumerationReference -{ - private final IASTEnumerationSpecifier referencedElement; - /** - * @param offset - * @param string - * @param specifier - */ - public ASTEnumerationReference(int offset, String string, IASTEnumerationSpecifier specifier) - { - super( offset, string ); - referencedElement = specifier; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return referencedElement; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptEnumerationReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationSpecifier.java deleted file mode 100644 index 0fd3ae5a5af..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerationSpecifier.java +++ /dev/null @@ -1,158 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTEnumerationSpecifier - extends ASTSymbol - implements IASTEnumerationSpecifier -{ - private NamedOffsets offsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedName; - /** - * @param symbol - */ - public ASTEnumerationSpecifier(ISymbol symbol, int startingOffset, int nameOffset, int nameEndOffset ) - { - super(symbol); - setStartingOffset(startingOffset); - setNameOffset( nameOffset ); - setNameEndOffset(nameEndOffset); - qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() ); - } - - - private List enumerators = new ArrayList(); - public void addEnumerator(IASTEnumerator enumerator) - { - enumerators.add(enumerator); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier#getEnumerators() - */ - public Iterator getEnumerators() - { - return enumerators.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptEnumerationSpecifier(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return getSymbol().getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset( o ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset( o ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerator.java deleted file mode 100644 index 43b8e482115..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumerator.java +++ /dev/null @@ -1,141 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTEnumerator extends ASTSymbol implements IASTEnumerator -{ - private NamedOffsets offsets = new NamedOffsets(); - private final IASTExpression initialValue; - private final IASTEnumerationSpecifier owner; - /** - * @param enumeratorSymbol - * @param startingOffset - * @param endingOffset - * @param initialValue - */ - public ASTEnumerator(ISymbol enumeratorSymbol, IASTEnumerationSpecifier owner, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset, IASTExpression initialValue) - { - super( enumeratorSymbol ); - setStartingOffset(startingOffset); - setNameOffset( nameOffset ); - setNameEndOffset( nameEndOffset ); - setEndingOffset( endingOffset ); - this.initialValue = initialValue; - this.owner = owner; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTEnumerator#getOwnerEnumerationSpecifier() - */ - public IASTEnumerationSpecifier getOwnerEnumerationSpecifier() - { - return owner; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTEnumerator#getInitialValue() - */ - public IASTExpression getInitialValue() - { - return initialValue; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return symbol.getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumeratorReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumeratorReference.java deleted file mode 100644 index 7c68f7efe10..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEnumeratorReference.java +++ /dev/null @@ -1,70 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; - -/** - * @author jcamelon - * - */ -public class ASTEnumeratorReference extends ASTReference implements IASTEnumeratorReference -{ - - private final IASTEnumerator enumerator; - /** - * @param offset - * @param string - * @param enumerator - */ - public ASTEnumeratorReference(int offset, String string, IASTEnumerator enumerator) - { - super( offset, string ); - this.enumerator = enumerator; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return enumerator; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptEnumeratorReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExceptionSpecification.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExceptionSpecification.java deleted file mode 100644 index a1d46cee274..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExceptionSpecification.java +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; - -/** - * @author jcamelon - * - */ -public class ASTExceptionSpecification implements IASTExceptionSpecification -{ - private final List typeIds; - private final ASTReferenceStore store; - /** - * @param newTypeIds - * @param references - */ - public ASTExceptionSpecification(List newTypeIds, List references) - { - this.typeIds = newTypeIds; - store = new ASTReferenceStore( references ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification#getTypeIds() - */ - public Iterator getTypeIds() - { - if( typeIds == null ) return new EmptyIterator(); - return typeIds.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - store.processReferences(requestor); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java deleted file mode 100644 index 7f2c2f1075b..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTExpression.java +++ /dev/null @@ -1,260 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.ExpressionEvaluationException; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; - -/** - * @author jcamelon - * - */ -public class ASTExpression implements IASTExpression -{ - private final Kind kind; - private final IASTExpression lhs; - private final IASTExpression rhs; - private final IASTExpression thirdExpression; - private final String literal, idExpression; - private ITokenDuple idExpressionDuple; - private final IASTTypeId typeId; - private final IASTNewExpressionDescriptor newDescriptor; - private final List references; - private ExpressionResult resultType; - /** - * - */ - public ASTExpression( Kind kind, IASTExpression lhs, IASTExpression rhs, - IASTExpression thirdExpression, IASTTypeId typeId, ITokenDuple idExpression, String literal, IASTNewExpressionDescriptor newDescriptor, List references ) - { - this.kind = kind; - this.lhs = lhs; - this.rhs = rhs; - this.thirdExpression = thirdExpression; - this.literal = literal; - this.typeId = typeId; - this.newDescriptor = newDescriptor; - this.references = references; - this.idExpressionDuple = idExpression; - this.idExpression = idExpressionDuple == null ? "" : idExpressionDuple.toString(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getExpressionKind() - */ - public Kind getExpressionKind() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getLHSExpression() - */ - public IASTExpression getLHSExpression() - { - return lhs; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getRHSExpression() - */ - public IASTExpression getRHSExpression() - { - return rhs; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getThirdExpression() - */ - public IASTExpression getThirdExpression() - { - return thirdExpression; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getLiteralString() - */ - public String getLiteralString() - { - return literal; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getTypeId() - */ - public IASTTypeId getTypeId() - { - return typeId; - } - /* - * returns the type id token - */ - public ITokenDuple getTypeIdTokenDuple() - { - if( typeId == null ) return null; - return ((ASTTypeId)typeId).getTokenDuple(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getNewExpressionDescriptor() - */ - public IASTNewExpressionDescriptor getNewExpressionDescriptor() - { - return newDescriptor; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#evaluateExpression() - */ - public int evaluateExpression() throws ExpressionEvaluationException - { - throw new ExpressionEvaluationException(); - } - - public List getReferences() - { - return references; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - reconcileReferences(); - } - catch (ASTNotImplementedException e) - { - // will not get thrown - } - if( ! references.isEmpty() ) - new ASTReferenceStore( references ).processReferences(requestor); - - if( typeId != null ) - typeId.acceptElement(requestor); - - if( lhs != null ) - lhs.acceptElement(requestor); - - if( rhs!= null ) - rhs.acceptElement(requestor); - - if( thirdExpression != null ) - thirdExpression.acceptElement(requestor); - - if( newDescriptor != null ) - newDescriptor.acceptElement(requestor); - - try - { - purgeReferences(); - } - catch (ASTNotImplementedException e) - { - // will not get thrown - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /** - * @return - */ - public ExpressionResult getResultType() { - return resultType; - } - - /** - * @param i - */ - public void setResultType(ExpressionResult i) { - resultType = i; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getIdExpression() - */ - public String getIdExpression() - { - return idExpression; - } - /** - * @return - */ - public ITokenDuple getIdExpressionTokenDuple() - { - return idExpressionDuple; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#reconcileReferences() - */ - public void reconcileReferences() throws ASTNotImplementedException - { - if( lhs != null ) - lhs.reconcileReferences(); - if( rhs != null ) - rhs.reconcileReferences(); - if( thirdExpression != null ) - thirdExpression.reconcileReferences(); - - reconcileSubExpression((ASTExpression)lhs); - reconcileSubExpression((ASTExpression)rhs); - reconcileSubExpression((ASTExpression)thirdExpression); - } - protected void reconcileSubExpression(ASTExpression subExpression) - { - if( subExpression != null && subExpression.getReferences() != null ) - { - Iterator subExp = subExpression.getReferences().iterator(); - while( subExp.hasNext() ) - { - IASTReference aReference = (IASTReference)subExp.next(); - if( aReference != null && references.contains( aReference ) ) - subExp.remove(); - } - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#purgeReferences() - */ - public void purgeReferences() throws ASTNotImplementedException - { - if( lhs != null ) - lhs.purgeReferences(); - if( rhs != null ) - rhs.purgeReferences(); - if( thirdExpression != null ) - thirdExpression.purgeReferences(); - - purgeSubExpression((ASTExpression)lhs); - purgeSubExpression((ASTExpression)rhs); - purgeSubExpression((ASTExpression)thirdExpression); - } - protected void purgeSubExpression(ASTExpression subExpression) - { - if( subExpression != null && subExpression.getReferences() != null ) - { - subExpression.getReferences().clear(); - } - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java deleted file mode 100644 index 0ca3e0617e7..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTField.java +++ /dev/null @@ -1,70 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTField extends ASTVariable implements IASTField -{ - private final ASTAccessVisibility visibility; - /** - * @param newSymbol - * @param abstractDeclaration - * @param initializerClause - * @param bitfieldExpression - * @param startingOffset - * @param nameOffset - * @param references - * @param visibility - */ - public ASTField(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, int nameEndOffset, List references, boolean previouslyDeclared, IASTExpression constructorExpression, ASTAccessVisibility visibility) - { - super( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, nameEndOffset, references, constructorExpression, previouslyDeclared ); - this.visibility = visibility; - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMember#getVisiblity() - */ - public ASTAccessVisibility getVisiblity() - { - return visibility; - } - - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptField(this); - } - catch (Exception e) - { - /* do nothing */ - } - referenceDelegate.processReferences(requestor); - if( getInitializerClause() != null ) - getInitializerClause().acceptElement(requestor); - if( getAbstractDeclaration() != null ) - getAbstractDeclaration().acceptElement(requestor); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFieldReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFieldReference.java deleted file mode 100644 index 287cd8c3bc7..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFieldReference.java +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTReference; - -/** - * @author jcamelon - * - */ -public class ASTFieldReference - extends ASTReference - implements IASTReference, IASTFieldReference -{ - private final IASTField referencedElement; - /** - * @param offset - * @param string - * @param field - */ - public ASTFieldReference(int offset, String string, IASTField field) - { - super(offset, string); - referencedElement = field; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return referencedElement; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptFieldReference(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java deleted file mode 100644 index fe800d53c1a..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java +++ /dev/null @@ -1,341 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; - -/** - * @author jcamelon - * - */ -public class ASTFunction extends ASTScope implements IASTFunction -{ - private final boolean previouslyDeclared; - private boolean hasFunctionBody = false; - private final IASTTemplate ownerTemplate; - private final IASTAbstractDeclaration returnType; - private final IASTExceptionSpecification exception; - private NamedOffsets offsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedName; - private final List parameters; - protected final ASTReferenceStore references; - private final int nameEndOffset; - private List declarations = new ArrayList(); - /** - * @param symbol - * @param parameters - * @param returnType - * @param exception - * @param startOffset - * @param nameOffset - * @param ownerTemplate - * @param references - */ - public ASTFunction(IParameterizedSymbol symbol, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, int startOffset, int nameOffset, IASTTemplate ownerTemplate, List references, boolean previouslyDeclared, boolean hasFunctionTryBlock ) - { - super( symbol ); - this.parameters = parameters; - this.nameEndOffset = nameEndOffset; - this.returnType = returnType; - this.exception = exception; - setStartingOffset(startOffset); - setNameOffset(nameOffset); - setNameEndOffset(nameEndOffset); - this.ownerTemplate = ownerTemplate; - this.references = new ASTReferenceStore( references ); - qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() ); - this.previouslyDeclared =previouslyDeclared; - this.hasFunctionTryBlock = hasFunctionTryBlock; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isInline() - */ - public boolean isInline() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isInline ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isFriend() - */ - public boolean isFriend() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isFriend ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isStatic() - */ - public boolean isStatic() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isStatic ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return symbol.getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getReturnType() - */ - public IASTAbstractDeclaration getReturnType() - { - return returnType; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getParameters() - */ - public Iterator getParameters() - { - return parameters.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getExceptionSpec() - */ - public IASTExceptionSpecification getExceptionSpec() - { - return exception; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionBody(boolean) - */ - public void setHasFunctionBody(boolean b) - { - hasFunctionBody = true; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionBody() - */ - public boolean hasFunctionBody() - { - return hasFunctionBody; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration() - */ - public IASTTemplate getOwnerTemplateDeclaration() - { - return ownerTemplate; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptFunctionDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - functionCallbacks(requestor); - } - - protected void functionCallbacks(ISourceElementRequestor requestor) - { - references.processReferences(requestor); - processParameterInitializersAndArrayMods(requestor); - if( getReturnType() != null ) - getReturnType().acceptElement(requestor); - if( getExceptionSpec() != null ) - getExceptionSpec().acceptElement(requestor); - } - /** - * @param requestor - */ - protected void processParameterInitializersAndArrayMods(ISourceElementRequestor requestor) - { - Iterator i = parameters.iterator(); - while( i.hasNext() ) - { - IASTParameterDeclaration parm = (IASTParameterDeclaration)i.next(); - if( parm.getDefaultValue() != null ) - parm.getDefaultValue().acceptElement(requestor); - Iterator arrays = parm.getArrayModifiers(); - while( arrays.hasNext() ) - { - ((IASTArrayModifier)arrays.next()).acceptElement(requestor); - } - } - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterFunctionBody( this ); - } - catch (Exception e) - { - /* do nothing */ - } - functionCallbacks( requestor ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitFunctionBody( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getOwnerCodeScope() - */ - public IASTCodeScope getOwnerCodeScope() - { - return ( getSymbol().getContainingSymbol().getASTExtension().getPrimaryDeclaration() ) instanceof IASTCodeScope ? - (IASTCodeScope) getSymbol().getContainingSymbol().getASTExtension().getPrimaryDeclaration() : null; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#previouslyDeclared() - */ - public boolean previouslyDeclared() - { - return previouslyDeclared; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - - - private boolean hasFunctionTryBlock = false; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionTryBlock(boolean) - */ - public void setHasFunctionTryBlock(boolean b) - { - hasFunctionTryBlock = b; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionTryBlock() - */ - public boolean hasFunctionTryBlock() - { - return hasFunctionTryBlock; - } - - public Iterator getDeclarations() - { - return declarations.iterator(); - } - public void addDeclaration(IASTDeclaration declaration) - { - declarations.add(declaration); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#takesVarArgs() - */ - public boolean takesVarArgs() { - return ((IParameterizedSymbol)getSymbol()).hasVariableArgs(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunctionReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunctionReference.java deleted file mode 100644 index d359dd38e12..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunctionReference.java +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTReference; - -/** - * @author jcamelon - * - */ -public class ASTFunctionReference - extends ASTReference - implements IASTReference, IASTFunctionReference -{ - private final IASTFunction declaration; - /** - * @param offset - * @param name - */ - public ASTFunctionReference(int offset, String name, IASTFunction referencedDeclaration ) - { - super(offset, name); - this.declaration = referencedDeclaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return declaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptFunctionReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java deleted file mode 100644 index 09de3fe33a3..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTInitializerClause.java +++ /dev/null @@ -1,130 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; - -/** - * @author jcamelon - * - */ -public class ASTInitializerClause implements IASTInitializerClause -{ - private List references = new ArrayList(); - private IASTVariable ownerDeclaration = null; - private final IASTInitializerClause.Kind kind; - private final IASTExpression assignmentExpression; - private final List initializerClauses; - private final List designators; - - /** - * @param kind - * @param assignmentExpression - * @param initializerClauses - * @param designators - */ - public ASTInitializerClause(Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators) - { - this.kind = kind; - this.assignmentExpression = assignmentExpression; - this.initializerClauses = initializerClauses; - this.designators = designators; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getKind() - */ - public Kind getKind() { - return kind; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getInitializerList() - */ - public Iterator getInitializers() { - if( initializerClauses == null ) - return new EmptyIterator(); - return initializerClauses.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getAssigmentExpression() - */ - public IASTExpression getAssigmentExpression() { - return assignmentExpression; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - Iterator i = getInitializers(); - while( i.hasNext() ) - ((IASTInitializerClause)i.next()).acceptElement(requestor); - - if( assignmentExpression != null ) - assignmentExpression.acceptElement( requestor ); - - ASTReferenceStore store = new ASTReferenceStore( getReferences() ); - store.processReferences(requestor); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getDesignators() - */ - public Iterator getDesignators() - { - return designators.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#setOwnerDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnerVariableDeclaration(IASTVariable declaration) - { - ownerDeclaration = declaration; - Iterator subInitializers = getInitializers(); - while( subInitializers.hasNext() ) - ((IASTInitializerClause)subInitializers.next()).setOwnerVariableDeclaration(declaration); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getOwnerDeclaration() - */ - public IASTVariable getOwnerVariableDeclaration() - { - return ownerDeclaration; - } - - public List getReferences() - { - return references; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLinkageSpecification.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLinkageSpecification.java deleted file mode 100644 index 82de4e82c4d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLinkageSpecification.java +++ /dev/null @@ -1,115 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; - -/** - * @author jcamelon - * - */ -public class ASTLinkageSpecification extends ASTAnonymousDeclaration implements IASTLinkageSpecification -{ - private final String linkageString; - private Offsets offsets = new Offsets(); - /** - * - */ - public ASTLinkageSpecification( IContainerSymbol scope, String linkageString, int startingOffset ) - { - super( scope ); - this.linkageString = linkageString; - setStartingOffset(startingOffset); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification#getLinkageString() - */ - public String getLinkageString() - { - return linkageString; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterLinkageSpecification(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitLinkageSpecification(this); - } - catch (Exception e) - { - /* do nothing */ - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java deleted file mode 100644 index b1fbb19e06e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java +++ /dev/null @@ -1,195 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; -import org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; - -/** - * @author jcamelon - * - */ -public class ASTMethod extends ASTFunction implements IASTMethod -{ - private final List constructorChain; - private final boolean isConstructor; - private final boolean isPureVirtual; - private final ASTAccessVisibility visibility; - private final boolean isDestructor; - /** - * @param symbol - * @param parameters - * @param returnType - * @param exception - * @param startOffset - * @param nameOffset - * @param ownerTemplate - * @param references - */ - public ASTMethod(IParameterizedSymbol symbol, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, int startOffset, int nameOffset, IASTTemplate ownerTemplate, List references, boolean previouslyDeclared, - boolean isConstructor, boolean isDestructor, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean hasFunctionTryBlock ) - { - super( - symbol, - nameEndOffset, - parameters, - returnType, - exception, - startOffset, - nameOffset, - ownerTemplate, - references, previouslyDeclared, hasFunctionTryBlock ); - this.visibility = visibility; - this.isConstructor = isConstructor; - this.isDestructor = isDestructor; - this.isPureVirtual = isPureVirtual; - this.constructorChain = constructorChain; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVirtual() - */ - public boolean isVirtual() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isVirtual ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isExplicit() - */ - public boolean isExplicit() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isExplicit); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isConstructor() - */ - public boolean isConstructor() - { - return isConstructor; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isDestructor() - */ - public boolean isDestructor() - { - return isDestructor; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isConst() - */ - public boolean isConst() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isConst); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVolatile() - */ - public boolean isVolatile() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isVolatile ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isPureVirtual() - */ - public boolean isPureVirtual() - { - return isPureVirtual; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMember#getVisiblity() - */ - public ASTAccessVisibility getVisiblity() - { - return visibility; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptMethodDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - methodCallbacks(requestor); - } - protected void methodCallbacks(ISourceElementRequestor requestor) - { - functionCallbacks(requestor); - processConstructorChain(requestor); - } - - protected void processConstructorChain(ISourceElementRequestor requestor) - { - if( constructorChain != null ) - { - Iterator i = getConstructorChainInitializers(); - while( i.hasNext() ) - { - IASTConstructorMemberInitializer c = (IASTConstructorMemberInitializer)i.next(); - c.acceptElement(requestor); - } - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterMethodBody(this); - } - catch (Exception e) - { - /* do nothing */ - } - methodCallbacks( requestor ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitMethodBody( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#getConstructorChainInitializers() - */ - public Iterator getConstructorChainInitializers() - { - if( constructorChain == null ) - return new EmptyIterator(); - return constructorChain.iterator(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethodReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethodReference.java deleted file mode 100644 index 59bdd4160df..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethodReference.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; - -/** - * @author jcamelon - * - */ -public class ASTMethodReference - extends ASTReference - implements IASTMethodReference -{ - private final IASTMethod method; - /** - * @param offset - * @param name - */ - public ASTMethodReference(int offset, String name, IASTMethod method ) - { - super(offset, name); - this.method = method; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return method; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptMethodReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceAlias.java deleted file mode 100644 index df7484483e2..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceAlias.java +++ /dev/null @@ -1,150 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTNamespaceAlias extends ASTSymbol implements IASTNamespaceAlias -{ - private NamedOffsets offsets = new NamedOffsets(); - private final String alias; - private final IASTNamespaceDefinition namespace; - private final ASTReferenceStore store; - /** - * @param scope - * @param symbol - * @param startingOffset - * @param nameOffset - * @param endOffset - */ - public ASTNamespaceAlias(ISymbol s, String alias, IASTNamespaceDefinition namespaceDefinition, int startingOffset, int nameOffset, int nameEndOffset, int endOffset, List references) - { - super( s ); - this.alias = alias; - this.namespace = namespaceDefinition; - setStartingOffset(startingOffset); - setEndingOffset(endOffset); - setNameOffset(nameOffset); - setNameEndOffset(nameEndOffset); - store = new ASTReferenceStore( references); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias#getAlias() - */ - public String getAlias() - { - return alias; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias#getNamespace() - */ - public IASTNamespaceDefinition getNamespace() - throws ASTNotImplementedException - { - return namespace; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return getSymbol().getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset( o ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceDefinition.java deleted file mode 100644 index 276a570d3d3..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceDefinition.java +++ /dev/null @@ -1,177 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTNamespaceDefinition - extends ASTScope - implements IASTNamespaceDefinition -{ - - private NamedOffsets namedOffsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedName; - private List declarations = new ArrayList(); - - /** - * @param namespaceSymbol - * @param startingOffset - * @param nameOffset - */ - public ASTNamespaceDefinition(ISymbol namespaceSymbol, int startingOffset, int nameOffset, int nameEndOffset ) - { - super( namespaceSymbol ); - setStartingOffset( startingOffset ); - setNameOffset( nameOffset ); - setNameEndOffset( nameEndOffset ); - qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), namespaceSymbol.getName() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return symbol.getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return namedOffsets.getNameOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - namedOffsets.setNameOffset( o ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - namedOffsets.setStartingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - namedOffsets.setEndingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return namedOffsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return namedOffsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterNamespaceDefinition( this ); - } - catch (Exception e) - { - /* do nothing */ - } - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitNamespaceDefinition( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return namedOffsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - namedOffsets.setNameEndOffset(o); - } - - public Iterator getDeclarations() - { - return declarations.iterator(); - } - public void addDeclaration(IASTDeclaration declaration) - { - declarations.add(declaration); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceReference.java deleted file mode 100644 index d7b87dd24a3..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNamespaceReference.java +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; - -/** - * @author jcamelon - * - */ -public class ASTNamespaceReference - extends ASTReference - implements IASTNamespaceReference -{ - private final IASTNamespaceDefinition reference; - - /** - * @param offset - * @param string - * @param definition - */ - public ASTNamespaceReference(int offset, String string, IASTNamespaceDefinition definition) - { - super(offset, string); - reference = definition; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return reference; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptNamespaceReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java deleted file mode 100644 index 0ac32f98e48..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewDescriptor.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ASTNewDescriptor implements IASTNewExpressionDescriptor { - - List newPlacementExpressions; - List newTypeIdExpressions; - List newInitializerExpressions; - public ASTNewDescriptor(List newPlacementExpressions, List newTypeIdExpressions, List newInitializerExpressions) { - super(); - this.newPlacementExpressions = newPlacementExpressions; - this.newTypeIdExpressions = newTypeIdExpressions; - this.newInitializerExpressions = newInitializerExpressions; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getExpressions() - */ - public Iterator getNewPlacementExpressions() { - return newPlacementExpressions.iterator(); - } - public Iterator getNewTypeIdExpressions() { - return newTypeIdExpressions.iterator(); - } - public Iterator getNewInitializerExpressions() { - return newInitializerExpressions.iterator(); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - accept( requestor, getNewPlacementExpressions() ); - accept( requestor, getNewTypeIdExpressions() ); - accept( requestor, getNewInitializerExpressions() ); - } - - - /** - * @param requestor - * @param iterator - */ - protected void accept(ISourceElementRequestor requestor, Iterator iterator) - { - while( iterator.hasNext() ) - ((IASTExpression)iterator.next()).acceptElement(requestor); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNode.java deleted file mode 100644 index 1c86f687e38..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNode.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTableException; -import org.eclipse.cdt.internal.core.parser.pst.TypeFilter; - -/** - * @author aniefer - */ -public class ASTNode implements IASTNode { - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNode#lookup(java.lang.String, org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind, org.eclipse.cdt.core.parser.ast.IASTNode) - */ - public LookupResult lookup(String prefix, LookupKind[] kind, IASTNode context) throws LookupException { - if( ! ( this instanceof ISymbolOwner ) || ( context != null && !(context instanceof ISymbolOwner) ) ){ - return null; - } - - IContainerSymbol thisContainer = (IContainerSymbol) ((ISymbolOwner)this).getSymbol(); - IContainerSymbol qualification = null; - - if( context != null ){ - ISymbol sym = (IContainerSymbol) ((ISymbolOwner)context).getSymbol(); - if( sym == null || !(sym instanceof IContainerSymbol) ){ - throw new LookupException(); - } - qualification = (IContainerSymbol) sym; - } - - ISymbolOwner owner = (ISymbolOwner) this; - ISymbol symbol = owner.getSymbol(); - if( symbol == null || !(symbol instanceof IContainerSymbol) ){ - throw new LookupException(); - } - - boolean lookInThis = false; - - TypeFilter filter = new TypeFilter(); - if( kind != null ){ - for( int i = 0; i < kind.length; i++ ){ - filter.addAcceptedType( kind[i] ); - if( kind[i] == LookupKind.THIS ){ - lookInThis = true; - if( kind.length == 1 ){ - filter.addAcceptedType( LookupKind.ALL ); - } - } else { - filter.addAcceptedType( kind[i] ); - } - } - } else { - filter.addAcceptedType( LookupKind.ALL ); - } - - List lookupResults = null; - try { - if( lookInThis ){ - ISymbol thisPointer = thisContainer.lookup( ParserSymbolTable.THIS ); - ISymbol thisClass = ( thisPointer != null ) ? thisPointer.getTypeSymbol() : null; - if( thisClass != null && thisClass instanceof IContainerSymbol ){ - lookupResults = ((IContainerSymbol) thisClass).prefixLookup( filter, prefix, true ); - } - } else if( qualification != null ){ - lookupResults = qualification.prefixLookup( filter, prefix, true ); - } else { - lookupResults = thisContainer.prefixLookup( filter, prefix, false ); - } - } catch (ParserSymbolTableException e) { - throw new LookupException(); - } - - if(lookupResults == null) - return null; - - ListIterator iter = lookupResults.listIterator(); - while( iter.hasNext() ){ - ISymbol s = (ISymbol) iter.next(); - if( !thisContainer.isVisible( s, qualification ) ){ - iter.remove(); - } - } - - SymbolIterator iterator = new SymbolIterator( lookupResults.iterator() ); - - return new Result( prefix, iterator, lookupResults.size() ); - } - - private class Result implements LookupResult{ - private String prefix; - private Iterator iterator; - private int resultsNumber; - - public Result( String pref, Iterator iter, int resultsSize ){ - prefix = pref; - iterator = iter; - resultsNumber = resultsSize; - - } - - public String getPrefix() { return prefix; } - public Iterator getNodes() { return iterator; } - public int getResultsSize() { return resultsNumber; } - } - - private class SymbolIterator implements Iterator{ - Iterator interalIterator; - - public SymbolIterator( Iterator iter ){ - interalIterator = iter; - } - - public boolean hasNext() { - return interalIterator.hasNext(); - } - - public Object next() { - ISymbol nextSymbol = (ISymbol) interalIterator.next(); - - ISymbolASTExtension extension = (nextSymbol != null ) ? nextSymbol.getASTExtension() : null; - - return (extension != null ) ? extension.getPrimaryDeclaration() : null; - } - - public void remove() { - interalIterator.remove(); - } - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterDeclaration.java deleted file mode 100644 index b58cf01de3d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterDeclaration.java +++ /dev/null @@ -1,197 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.ASTAbstractDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTParameterDeclaration extends ASTSymbol implements IASTParameterDeclaration -{ - private final ASTAbstractDeclaration abstractDeclaration; - private final String parameterName; - private final IASTInitializerClause initializerClause; - private final NamedOffsets offsets = new NamedOffsets(); - /** - * @param isConst - * @param typeSpecifier - * @param pointerOperators - * @param arrayModifiers - * @param parameterName - * @param initializerClause - */ - public ASTParameterDeclaration(ISymbol symbol, boolean isConst, boolean isVolatile, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int endingOffset, int nameOffset, int nameEndOffset ) - { - super( symbol ); - abstractDeclaration = new ASTAbstractDeclaration( isConst, isVolatile, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOp ); - this.parameterName = parameterName; - this.initializerClause = initializerClause; - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - setNameOffset(nameOffset); - setNameEndOffset( nameEndOffset ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration#getName() - */ - public String getName() - { - return parameterName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration#getDefaultValue() - */ - public IASTInitializerClause getDefaultValue() - { - return initializerClause; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isConst() - */ - public boolean isConst() - { - return abstractDeclaration.isConst(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#isVolatile() - */ - public boolean isVolatile() - { - return abstractDeclaration.isVolatile(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerOperators() - */ - public Iterator getPointerOperators() - { - return abstractDeclaration.getPointerOperators(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getArrayModifiers() - */ - public Iterator getArrayModifiers() - { - return abstractDeclaration.getArrayModifiers(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getParameters() - */ - public Iterator getParameters() - { - return abstractDeclaration.getParameters(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getPointerToFunctionOperator() - */ - public ASTPointerOperator getPointerToFunctionOperator() - { - return abstractDeclaration.getPointerToFunctionOperator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeSpecifierOwner#getTypeSpecifier() - */ - public IASTTypeSpecifier getTypeSpecifier() - { - return abstractDeclaration.getTypeSpecifier(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterReference.java deleted file mode 100644 index 3f196073e08..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTParameterReference.java +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; - -/** - * @author jcamelon - * - */ -public class ASTParameterReference extends ASTReference implements IASTParameterReference -{ - private final IASTParameterDeclaration parm; - - /** - * @param offset - * @param string - * @param declaration - */ - public ASTParameterReference(int offset, String string, IASTParameterDeclaration declaration) - { - super( offset, string ); - parm = declaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return parm; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptParameterReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReference.java deleted file mode 100644 index 21dda293009..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReference.java +++ /dev/null @@ -1,59 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ast.IASTReference; - - -/** - * @author jcamelon - * - */ -public abstract class ASTReference implements IASTReference -{ - protected final String name; - protected final int offset; - /** - * - */ - public ASTReference(int offset, String name) - { - this.offset = offset; - this.name = name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getOffset() - */ - public int getOffset() - { - return offset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getName() - */ - public String getName() - { - return name; - } - - public boolean equals(Object obj) - { - if( obj == null ) - return false; - if( ! (obj instanceof IASTReference ) ) - return false; - - if( ((IASTReference)obj).getName().equals( getName() ) && - ((IASTReference)obj).getOffset() == getOffset() ) - return true; - return false; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReferenceStore.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReferenceStore.java deleted file mode 100644 index f84c0ec77bf..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTReferenceStore.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTReference; - -/** - * @author jcamelon - * - */ -public class ASTReferenceStore -{ - private List references = new ArrayList(); - - public ASTReferenceStore( List assortedReferences ) - { - references.addAll( assortedReferences ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReferenceStore#processReferences() - */ - public void processReferences(ISourceElementRequestor requestor) - { - Iterator i = references.iterator(); - while( i.hasNext() ) - ((IASTReference)i.next()).acceptElement(requestor); - references.clear(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTScope.java deleted file mode 100644 index 530eab9e064..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTScope.java +++ /dev/null @@ -1,51 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public abstract class ASTScope extends ASTSymbol implements IASTScope -{ - /** - * @param symbol - */ - public ASTScope(ISymbol symbol) - { - super(symbol); - } - - public IContainerSymbol getContainerSymbol() - { - return (IContainerSymbol)symbol; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() - { - return null; - } - - public void addDeclaration(IASTDeclaration declaration) - { - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java deleted file mode 100644 index 52d217edf0e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSimpleTypeSpecifier.java +++ /dev/null @@ -1,150 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; - -/** - * @author jcamelon - * - */ -public class ASTSimpleTypeSpecifier extends ASTNode implements IASTSimpleTypeSpecifier -{ - private final List refs; - private ISymbol symbol; - private final boolean isTypename; - private final String name; - - /** - * @param s - * @param b - * @param string - */ - public ASTSimpleTypeSpecifier(ISymbol s, boolean b, String string, List references ) - { - this.symbol = s; - this.isTypename = b; - this.name = string; - this.refs = references; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#getType() - */ - public Type getType() - { - if( symbol.getType() == TypeInfo.t_int ) - return IASTSimpleTypeSpecifier.Type.INT; - if( symbol.getType() == TypeInfo.t_double ) - return IASTSimpleTypeSpecifier.Type.DOUBLE; - if( symbol.getType() == TypeInfo.t_float ) - return IASTSimpleTypeSpecifier.Type.FLOAT; - if( symbol.getType() == TypeInfo.t_bool ) - return IASTSimpleTypeSpecifier.Type.BOOL; - if( symbol.getType() == TypeInfo.t_type ) - return IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME; - if( symbol.getType() == TypeInfo.t_char ) - return IASTSimpleTypeSpecifier.Type.CHAR; - if( symbol.getType() == TypeInfo.t_void ) - return IASTSimpleTypeSpecifier.Type.VOID; - if( symbol.getType() == TypeInfo.t_wchar_t) - return IASTSimpleTypeSpecifier.Type.WCHAR_T; - if( symbol.getType() == TypeInfo.t__Bool ) - return IASTSimpleTypeSpecifier.Type._BOOL; - - return IASTSimpleTypeSpecifier.Type.UNSPECIFIED; - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#getTypename() - */ - public String getTypename() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isLong() - */ - public boolean isLong() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isLong ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isShort() - */ - public boolean isShort() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isShort ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isSigned() - */ - public boolean isSigned() - { - return ! symbol.getTypeInfo().checkBit( TypeInfo.isUnsigned); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isUnsigned() - */ - public boolean isUnsigned() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isUnsigned ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isTypename() - */ - public boolean isTypename() - { - return isTypename; - } - /** - * @return - */ - public ISymbol getSymbol() - { - return symbol; - } - - public List getReferences() - { - return refs; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#getTypeSpecifier() - */ - public IASTTypeSpecifier getTypeSpecifier() throws ASTNotImplementedException - { - return (IASTTypeSpecifier)getSymbol().getTypeSymbol().getASTExtension().getPrimaryDeclaration(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isComplex() - */ - public boolean isComplex() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isComplex ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isImaginary() - */ - public boolean isImaginary() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isImaginary ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbol.java deleted file mode 100644 index 658266dc46c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbol.java +++ /dev/null @@ -1,40 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner; - -/** - * @author jcamelon - * - */ -public abstract class ASTSymbol extends ASTSymbolOwner implements ISymbolOwner, IASTDeclaration -{ - - public ASTSymbol( ISymbol symbol ) - { - super(symbol); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - if( symbol.getContainingSymbol() != null ) - return (IASTScope)symbol.getContainingSymbol().getASTExtension().getPrimaryDeclaration(); - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbolOwner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbolOwner.java deleted file mode 100644 index d76e35ad4fb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTSymbolOwner.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner; - -/** - * @author jcamelon - * - */ -public class ASTSymbolOwner extends ASTNode implements ISymbolOwner -{ - protected ISymbol symbol; - /** - * - */ - public ASTSymbolOwner( ISymbol symbol ) - { - this.symbol = symbol; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner#getSymbol() - */ - public ISymbol getSymbol() - { - return symbol; - } - - public void setSymbol( ISymbol symbol ) - { - this.symbol = symbol; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateDeclaration.java deleted file mode 100644 index a7d301eaf11..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateDeclaration.java +++ /dev/null @@ -1,124 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; - -/** - * @author jcamelon - * - */ -public class ASTTemplateDeclaration extends ASTNode implements IASTTemplateDeclaration -{ - /** - * - */ - public ASTTemplateDeclaration() - { - super(); - // TODO Auto-generated constructor stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#isExported() - */ - public boolean isExported() - { - // TODO Auto-generated method stub - return false; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration() - */ - public IASTDeclaration getOwnedDeclaration() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnedDeclaration(IASTDeclaration declaration) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameterList#getTemplateParameters() - */ - public Iterator getTemplateParameters() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateInstantiation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateInstantiation.java deleted file mode 100644 index 5bd2752a452..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateInstantiation.java +++ /dev/null @@ -1,106 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; - -/** - * @author jcamelon - * - */ -public class ASTTemplateInstantiation extends ASTNode implements IASTTemplateInstantiation -{ - /** - * - */ - public ASTTemplateInstantiation() - { - super(); - // TODO Auto-generated constructor stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration() - */ - public IASTDeclaration getOwnedDeclaration() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnedDeclaration(IASTDeclaration declaration) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateSpecialization.java deleted file mode 100644 index 5e72f4652b5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTemplateSpecialization.java +++ /dev/null @@ -1,106 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; - -/** - * @author jcamelon - * - */ -public class ASTTemplateSpecialization extends ASTNode implements IASTTemplateSpecialization -{ - /** - * - */ - public ASTTemplateSpecialization() - { - super(); - // TODO Auto-generated constructor stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration() - */ - public IASTDeclaration getOwnedDeclaration() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnedDeclaration(IASTDeclaration declaration) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - // TODO Auto-generated method stub - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - // TODO Auto-generated method stub - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeId.java deleted file mode 100644 index 18a659de5b9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeId.java +++ /dev/null @@ -1,229 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTArrayModifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTTypeId implements IASTTypeId -{ - private final boolean isTypename; - private final boolean isUnsigned; - private final boolean isSigned; - private final boolean isShort; - private final boolean isLong; - private final boolean isVolatile; - private final boolean isConst; - private final String signature; - private ITokenDuple tokenDuple; - private final List arrayModifiers; - private final String typeName; - private final List pointerOps; - private final Type kind; - private List references = new ArrayList(); - private ISymbol symbol; - - /** - * - */ - public ASTTypeId( Type kind, ITokenDuple duple, List pointerOps, List arrayMods, String signature, - boolean isConst, boolean isVolatile, boolean isUnsigned, boolean isSigned, boolean isShort, boolean isLong, boolean isTypeName ) - { - typeName = ( duple == null ) ? "" : duple.toString() ; - this.tokenDuple = duple; - this.kind = kind; - this.pointerOps = pointerOps; - this.arrayModifiers = arrayMods; - this.signature = signature; - this.isConst = isConst; - this.isVolatile = isVolatile; - this.isUnsigned = isUnsigned; - this.isSigned = isSigned; - this.isShort = isShort; - this.isLong = isLong; - this.isTypename = isTypeName; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getKind() - */ - public Type getKind() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getType() - */ - public String getTypeOrClassName() - { - return typeName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getPointerOperators() - */ - public Iterator getPointerOperators() - { - return pointerOps.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getArrayModifiers() - */ - public Iterator getArrayModifiers() - { - return arrayModifiers.iterator(); - } - - public List getReferences() - { - return references; - } - - public void finalize() - { - references.clear(); - references = null; - tokenDuple = null; - } - - public ITokenDuple getTokenDuple() - { - return tokenDuple; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getFullSignature() - */ - public String getFullSignature() - { - return signature; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#createTypeSymbol(org.eclipse.cdt.core.parser.ast.IASTFactory) - */ - public ISymbol getTypeSymbol() throws ASTNotImplementedException - { - return symbol; - } - - public void setTypeSymbol( ISymbol symbol ) - { - this.symbol = symbol; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isConst() - */ - public boolean isConst() - { - return isConst; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isVolatile() - */ - public boolean isVolatile() - { - return isVolatile; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isLong() - */ - public boolean isLong() - { - return isLong; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isShort() - */ - public boolean isShort() - { - return isShort; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isSigned() - */ - public boolean isSigned() - { - return isSigned; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isUnsigned() - */ - public boolean isUnsigned() - { - return isUnsigned; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isTypename() - */ - public boolean isTypename() - { - return isTypename; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - if( references != null && ! references.isEmpty() ) - { - ASTReferenceStore store = new ASTReferenceStore( references ); - store.processReferences(requestor); - } - Iterator arrayMods = getArrayModifiers(); - while( arrayMods.hasNext() ) - { - ((IASTArrayModifier)arrayMods.next()).acceptElement(requestor); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /** - * @param list - */ - public void addReferences(List list) - { - references.addAll( list ); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java deleted file mode 100644 index 475473dcc77..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedef.java +++ /dev/null @@ -1,170 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTTypedef extends ASTSymbol implements IASTTypedefDeclaration -{ - - private final IASTAbstractDeclaration mapping; - private NamedOffsets offsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedName; - private final ASTReferenceStore referenceStore; - - /** - * @param newSymbol - * @param mapping - * @param startingOffset - * @param nameOffset - * @param references - */ - public ASTTypedef(ISymbol newSymbol, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, int nameEndOffset, List references) - { - super( newSymbol ); - this.mapping = mapping; - this.referenceStore = new ASTReferenceStore( references ); - this.qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), newSymbol.getName()); - setStartingOffset(startingOffset); - setNameOffset(nameOffset); - setNameEndOffset( nameEndOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration#getName() - */ - public String getName() - { - return getSymbol().getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration#getAbstractDeclarator() - */ - public IASTAbstractDeclaration getAbstractDeclarator() - { - return mapping; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptTypedefDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - referenceStore.processReferences(requestor); - getAbstractDeclarator().acceptElement( requestor ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java deleted file mode 100644 index 91e557dfec1..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypedefReference.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; - -/** - * @author jcamelon - * - */ -public class ASTTypedefReference - extends ASTReference - implements IASTTypedefReference -{ - private final IASTTypedefDeclaration referencedItem; - /** - * @param offset - * @param name - */ - public ASTTypedefReference(int offset, String name, IASTTypedefDeclaration referencedItem ) - { - super(offset, name); - this.referencedItem = referencedItem; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return referencedItem; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptTypedefReference(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDeclaration.java deleted file mode 100644 index 65465ad7442..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDeclaration.java +++ /dev/null @@ -1,130 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTUsingDeclaration extends ASTNode implements IASTUsingDeclaration -{ - private final IASTScope ownerScope; - private final boolean isTypeName; - private final IASTDeclaration declaration; - private Offsets offsets = new Offsets(); - private final ASTReferenceStore delegate; - - /** - * - */ - public ASTUsingDeclaration( IASTScope ownerScope, IASTDeclaration declaration, boolean isTypeName, int startingOffset, int endingOffset, List references ) - { - this.ownerScope = ownerScope; - this.isTypeName = isTypeName; - this.declaration = declaration; - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - delegate = new ASTReferenceStore( references ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#isTypename() - */ - public boolean isTypename() - { - return isTypeName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#usingTypeName() - */ - public String usingTypeName() - { - return ((IASTOffsetableNamedElement)declaration).getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - return ownerScope; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptUsingDeclaration( this ); - } - catch (Exception e) - { - /* do nothing */ - } - delegate.processReferences(requestor); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#getUsingType() - */ - public IASTDeclaration getUsingType() throws ASTNotImplementedException - { - return declaration; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDirective.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDirective.java deleted file mode 100644 index af8557caf21..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUsingDirective.java +++ /dev/null @@ -1,125 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; - -/** - * @author jcamelon - * - */ -public class ASTUsingDirective extends ASTAnonymousDeclaration implements IASTUsingDirective -{ - private final IASTNamespaceDefinition namespace; - private Offsets offsets = new Offsets(); - private final ASTReferenceStore referenceDelegate; - /** - * @param namespaceDefinition - * @param startingOffset - * @param endingOffset - */ - public ASTUsingDirective(IContainerSymbol ownerSymbol, IASTNamespaceDefinition namespaceDefinition, int startingOffset, int endingOffset, List references ) - { - super( ownerSymbol ); - namespace = namespaceDefinition; - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - referenceDelegate = new ASTReferenceStore( references ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDirective#getNamespaceName() - */ - public String getNamespaceName() - { - String [] fqn = namespace.getFullyQualifiedName(); - StringBuffer buffer = new StringBuffer(); - for( int i = 0; i < fqn.length; ++i ) - { - buffer.append( fqn[ i ] ); - if( i + 1 != fqn.length ) - buffer.append( "::"); - } - return buffer.toString(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset( o ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptUsingDirective( this ); - } - catch (Exception e) - { - /* do nothing */ - } - referenceDelegate.processReferences(requestor); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDirective#getNamespaceDefinition() - */ - public IASTNamespaceDefinition getNamespaceDefinition() throws ASTNotImplementedException - { - return namespace; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java deleted file mode 100644 index f40232d4106..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariable.java +++ /dev/null @@ -1,246 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; - -/** - * @author jcamelon - * - */ -public class ASTVariable extends ASTSymbol implements IASTVariable -{ - private final boolean previouslyDeclared; - private final IASTExpression constructorExpression; - protected final ASTReferenceStore referenceDelegate; - private final ASTQualifiedNamedElement qualifiedName; - private NamedOffsets offsets = new NamedOffsets(); - private final IASTExpression bitfieldExpression; - private final IASTInitializerClause initializerClause; - private final IASTAbstractDeclaration abstractDeclaration; - /** - * @param newSymbol - * @param abstractDeclaration - * @param initializerClause - * @param bitfieldExpression - * @param startingOffset - * @param nameOffset - * @param references - */ - public ASTVariable(ISymbol newSymbol, IASTAbstractDeclaration abstractDeclaration, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, int startingOffset, int nameOffset, int nameEndOffset, List references, IASTExpression constructorExpression, boolean previouslyDeclared ) - { - super( newSymbol ); - this.abstractDeclaration = abstractDeclaration; - this.initializerClause = initializerClause; - this.bitfieldExpression = bitfieldExpression; - this.constructorExpression = constructorExpression; - setStartingOffset( startingOffset ); - setNameOffset( nameOffset ); - setNameEndOffset(nameEndOffset); - referenceDelegate = new ASTReferenceStore( references ); - qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), newSymbol.getName() ); - this.previouslyDeclared =previouslyDeclared; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isAuto() - */ - public boolean isAuto() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isAuto ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isRegister() - */ - public boolean isRegister() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isRegister); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isStatic() - */ - public boolean isStatic() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isStatic); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isExtern() - */ - public boolean isExtern() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isExtern ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isMutable() - */ - public boolean isMutable() - { - return symbol.getTypeInfo().checkBit( TypeInfo.isMutable); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getAbstractDeclaration() - */ - public IASTAbstractDeclaration getAbstractDeclaration() - { - return abstractDeclaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return getSymbol().getName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getInitializerClause() - */ - public IASTInitializerClause getInitializerClause() - { - return initializerClause; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isBitfield() - */ - public boolean isBitfield() - { - return ( bitfieldExpression != null ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getBitfieldExpression() - */ - public IASTExpression getBitfieldExpression() - { - return bitfieldExpression; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - return (IASTScope)getSymbol().getContainingSymbol().getASTExtension().getPrimaryDeclaration(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptVariable(this); - } - catch (Exception e) - { - /* do nothing */ - } - referenceDelegate.processReferences(requestor); - if( initializerClause != null ) - initializerClause.acceptElement(requestor); - if( constructorExpression != null ) - constructorExpression.acceptElement(requestor); - if( getAbstractDeclaration() != null ) - getAbstractDeclaration().acceptElement(requestor); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getConstructorExpression() - */ - public IASTExpression getConstructorExpression() - { - return constructorExpression; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariableReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariableReference.java deleted file mode 100644 index 83663af42ce..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTVariableReference.java +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; - -/** - * @author jcamelon - * - */ -public class ASTVariableReference - extends ASTReference - implements IASTReference, IASTVariableReference -{ - - private final IASTVariable referencedElement; - /** - * @param offset - * @param string - * @param variable - */ - public ASTVariableReference(int offset, String string, IASTVariable variable) - { - super( offset, string ); - referencedElement = variable; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReference#getReferencedElement() - */ - public ISourceElementCallbackDelegate getReferencedElement() - { - return referencedElement; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptVariableReference( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java deleted file mode 100644 index c68f7b28b3f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java +++ /dev/null @@ -1,2812 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.ASTSemanticException; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; -import org.eclipse.cdt.core.parser.ast.IASTDesignator; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTFactory; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType; -import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor; -import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParamKind; -import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory; -import org.eclipse.cdt.internal.core.parser.pst.ForewardDeclaredSymbolExtension; -import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol; -import org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner; -import org.eclipse.cdt.internal.core.parser.pst.NamespaceSymbolExtension; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTableException; -import org.eclipse.cdt.internal.core.parser.pst.StandardSymbolExtension; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; -import org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension.ExtensionException; - - -/** - * @author jcamelon - * - * The CompleteParseASTFactory class creates a complete AST - * for a given parsed code. - * - */ -public class CompleteParseASTFactory extends BaseASTFactory implements IASTFactory -{ - /** - * - */ - - private final static List SUBSCRIPT; - static - { - SUBSCRIPT = new ArrayList(); - SUBSCRIPT.add( TypeInfo.OperatorExpression.subscript ); - } - - static private class LookupType extends Enum { - public static final LookupType QUALIFIED = new LookupType( 1 ); - public static final LookupType UNQUALIFIED = new LookupType( 2 ); - public static final LookupType FORDEFINITION = new LookupType( 3 ); - public static final LookupType FORFRIENDSHIP = new LookupType( 4 ); - - private LookupType( int constant) - { - super( constant ); - } - } - - public CompleteParseASTFactory( ParserLanguage language ) - { - super(); - - pst = new ParserSymbolTable( language ); - } - - /* - * Adds a reference to a reference list - * Overrides an existing reference if it has the same name and offset - */ - protected void addReference(List references, IASTReference reference){ - if( references == null ) return; - Iterator i = references.iterator(); - while (i.hasNext()){ - IASTReference ref = (IASTReference)i.next(); - if (ref != null){ - if( (ref.getName().equals(reference.getName())) - && (ref.getOffset() == reference.getOffset()) - ){ - i.remove(); - break; - } - } - } - references.add(reference); - } - /* - * Test if the provided list is a valid parameter list - * Parameters are list of TypeInfos - */ - protected boolean validParameterList(List parameters){ - Iterator i = parameters.iterator(); - while (i.hasNext()){ - TypeInfo info = (TypeInfo)i.next(); - if (info != null){ - if((info.getType() == TypeInfo.t_type) - && (info.getTypeSymbol() == null)) - return false; - }else - return false; - } - return true; - } - - private ISymbol lookupElement (IContainerSymbol startingScope, String name, TypeInfo.eType type, List parameters, LookupType lookupType ) throws ParserSymbolTableException{ - ISymbol result = null; - try { - if((type == TypeInfo.t_function) || (type == TypeInfo.t_constructor)){ - // looking for a function - if(validParameterList(parameters)) - if(type == TypeInfo.t_constructor){ - IDerivableContainerSymbol startingDerivableScope = (IDerivableContainerSymbol) startingScope; - result = startingDerivableScope.lookupConstructor( new LinkedList(parameters)); - } - else { - if( lookupType == LookupType.QUALIFIED ) - result = startingScope.qualifiedFunctionLookup(name, new LinkedList(parameters)); - else if( lookupType == LookupType.UNQUALIFIED ) - result = startingScope.unqualifiedFunctionLookup( name, new LinkedList( parameters ) ); - else if( lookupType == LookupType.FORDEFINITION ) - result = startingScope.lookupMethodForDefinition( name, new LinkedList( parameters ) ); - else if( lookupType == LookupType.FORFRIENDSHIP ){ - result = ((IDerivableContainerSymbol)startingScope).lookupFunctionForFriendship( name, new LinkedList( parameters) ); - } - } - else - result = null; - }else{ - // looking for something else - if( lookupType == LookupType.QUALIFIED ) - result = startingScope.qualifiedLookup(name, type); - else if( lookupType == LookupType.UNQUALIFIED ) - result = startingScope.elaboratedLookup( type, name ); - else if( lookupType == LookupType.FORDEFINITION ) - result = startingScope.lookupMemberForDefinition( name ); - else if( lookupType == LookupType.FORFRIENDSHIP ) - result = ((IDerivableContainerSymbol)startingScope).lookupForFriendship( name ); - } - } catch (ParserSymbolTableException e) { - if( e.reason != ParserSymbolTableException.r_UnableToResolveFunction ) - throw e; - } - return result; - } - - protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, String name, List references, boolean throwOnError, LookupType lookup ) throws ASTSemanticException{ - return lookupQualifiedName(startingScope, name, TypeInfo.t_any, null, 0, references, throwOnError, lookup ); - } - - protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, String name, TypeInfo.eType type, List parameters, int offset, List references, boolean throwOnError, LookupType lookup ) throws ASTSemanticException - { - ISymbol result = null; - try - { - if( name == null ) throw new ASTSemanticException(); - try - { - result = lookupElement(startingScope, name, type, parameters, lookup); - if( result != null ) - addReference(references, createReference( result, name, offset )); - else - throw new ASTSemanticException(); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - } - catch( ASTSemanticException se ) - { - if( throwOnError ) - throw se; - return null; - } - return result; - - } - - protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, ITokenDuple name, List references, boolean throwOnError ) throws ASTSemanticException{ - return lookupQualifiedName(startingScope, name, references, throwOnError, LookupType.UNQUALIFIED); - } - protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, ITokenDuple name, List references, boolean throwOnError, LookupType lookup ) throws ASTSemanticException{ - return lookupQualifiedName(startingScope, name, TypeInfo.t_any, null, references, throwOnError, lookup ); - } - protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, ITokenDuple name, TypeInfo.eType type, List parameters, List references, boolean throwOnError ) throws ASTSemanticException{ - return lookupQualifiedName( startingScope, name, type, parameters, references, throwOnError, LookupType.UNQUALIFIED ); - } - - protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, ITokenDuple name, TypeInfo.eType type, List parameters, List references, boolean throwOnError, LookupType lookup ) throws ASTSemanticException - { - ISymbol result = null; - IToken firstSymbol = null; - try - { - if( name == null ) throw new ASTSemanticException(); - - switch( name.length() ) - { - case 0: - if( throwOnError ) - throw new ASTSemanticException(); - case 1: - firstSymbol = name.getFirstToken(); - try - { - result = lookupElement(startingScope, firstSymbol.getImage(), type, parameters, lookup ); - if( result != null ) - addReference( references, createReference( result, firstSymbol.getImage(), firstSymbol.getOffset() )); - else - throw new ASTSemanticException(); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - break; - default: - Iterator iter = name.iterator(); - firstSymbol = name.getFirstToken(); - result = startingScope; - if( firstSymbol.getType() == IToken.tCOLONCOLON ) - result = pst.getCompilationUnit(); - - while( iter.hasNext() ) - { - IToken t = (IToken)iter.next(); - if( t.getType() == IToken.tCOLONCOLON ) continue; - if( t.isPointer() ) break; - try - { - if( t == name.getLastToken() ) - result = lookupElement((IContainerSymbol)result, t.getImage(), type, parameters, ( lookup == LookupType.FORDEFINITION ) ? lookup : LookupType.QUALIFIED ); - else - result = ((IContainerSymbol)result).lookupNestedNameSpecifier( t.getImage() ); - addReference( references, createReference( result, t.getImage(), t.getOffset() )); - } - catch( ParserSymbolTableException pste ) - { - throw new ASTSemanticException(); - } - } - - } - } - catch( ASTSemanticException se ) - { - if( throwOnError ) - throw se; - return null; - } - return result; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createUsingDirective(org.eclipse.cdt.core.parser.ast.IASTScope, org.eclipse.cdt.core.parser.ITokenDuple, int, int) - */ - public IASTUsingDirective createUsingDirective( - IASTScope scope, - ITokenDuple duple, - int startingOffset, - int endingOffset) - throws ASTSemanticException - { - List references = new ArrayList(); - ISymbol symbol = lookupQualifiedName( - scopeToSymbol( scope), duple, references, true ); - - try { - ((ASTScope)scope).getContainerSymbol().addUsingDirective( (IContainerSymbol)symbol ); - } catch (ParserSymbolTableException pste) { - throw new ASTSemanticException(); - } - - IASTUsingDirective astUD = new ASTUsingDirective( scopeToSymbol(scope), ((IASTNamespaceDefinition)symbol.getASTExtension().getPrimaryDeclaration()), startingOffset, endingOffset, references ); - return astUD; - } - - - protected IContainerSymbol getScopeToSearchUpon( - IASTScope currentScope, - IToken firstToken, Iterator iterator ) throws ASTSemanticException - { - if( firstToken.getType() == IToken.tCOLONCOLON ) - { - iterator.next(); - return pst.getCompilationUnit(); - } - else - { - return (IContainerSymbol)scopeToSymbol(currentScope); - } - - - } - protected IContainerSymbol scopeToSymbol(IASTScope currentScope) - { - if( currentScope instanceof ASTScope ) - return ((ASTScope)currentScope).getContainerSymbol(); - else - return scopeToSymbol(((ASTAnonymousDeclaration)currentScope).getOwnerScope()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, boolean, org.eclipse.cdt.core.parser.ITokenDuple, int, int) - */ - public IASTUsingDeclaration createUsingDeclaration( - IASTScope scope, - boolean isTypeName, - ITokenDuple name, - int startingOffset, - int endingOffset) throws ASTSemanticException - { - List references = new ArrayList(); - ISymbol symbol = lookupQualifiedName( scopeToSymbol(scope), name, references, true ); - - try - { - scopeToSymbol(scope).addUsingDeclaration( name.getLastToken().getImage(), symbol.getContainingSymbol() ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - return new ASTUsingDeclaration( scope, - symbol.getASTExtension().getPrimaryDeclaration(), isTypeName, startingOffset, endingOffset, references ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createASMDefinition(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int, int) - */ - public IASTASMDefinition createASMDefinition( - IASTScope scope, - String assembly, - int first, - int last) - { - - return new ASTASMDefinition( scopeToSymbol(scope), assembly, first, last ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int, int) - */ - public IASTNamespaceDefinition createNamespaceDefinition( - IASTScope scope, - String identifier, - int startingOffset, - int nameOffset, int nameEndOffset) throws ASTSemanticException - { - - IContainerSymbol pstScope = scopeToSymbol(scope); - ISymbol namespaceSymbol = null; - - - if( ! identifier.equals( "" ) ) - { - try - { - namespaceSymbol = pstScope.qualifiedLookup( identifier ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - } - - if( namespaceSymbol != null ) - { - if( namespaceSymbol.getType() != TypeInfo.t_namespace ) - throw new ASTSemanticException(); - } - else - { - namespaceSymbol = pst.newContainerSymbol( identifier, TypeInfo.t_namespace ); - if( identifier.equals( "" ) ) - namespaceSymbol.setContainingSymbol( pstScope ); - else - { - - try - { - pstScope.addSymbol( namespaceSymbol ); - } - catch (ParserSymbolTableException e1) - { - // not overloading, should never happen - } - } - } - - ASTNamespaceDefinition namespaceDef = new ASTNamespaceDefinition( namespaceSymbol, startingOffset, nameOffset, nameEndOffset ); - try - { - attachSymbolExtension( namespaceSymbol, namespaceDef ); - } - catch (ExtensionException e1) - { - // will not happen with namespaces - } - return namespaceDef; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createCompilationUnit() - */ - public IASTCompilationUnit createCompilationUnit() - { - ISymbol symbol = pst.getCompilationUnit(); - ASTCompilationUnit compilationUnit = new ASTCompilationUnit( symbol ); - try - { - attachSymbolExtension(symbol, compilationUnit ); - } - catch (ExtensionException e) - { - //should not happen with CompilationUnit - } - return compilationUnit; - } - - - protected void attachSymbolExtension( - ISymbol symbol, - ASTSymbol astSymbol ) throws ExtensionException - { - ISymbolASTExtension extension = symbol.getASTExtension(); - if( extension == null ) - { - if( astSymbol instanceof IASTNamespaceDefinition || - astSymbol instanceof IASTEnumerationSpecifier || - astSymbol instanceof IASTClassSpecifier || - astSymbol instanceof IASTElaboratedTypeSpecifier ) - - extension = new NamespaceSymbolExtension( symbol, astSymbol ); - else if( astSymbol instanceof IASTFunction || astSymbol instanceof IASTMethod ) - { - extension = new ForewardDeclaredSymbolExtension( symbol, astSymbol ); - } - else - { - extension = new StandardSymbolExtension( symbol, astSymbol ); - } - symbol.setASTExtension( extension ); - } - else - { - extension.addDefinition( astSymbol ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int) - */ - public IASTLinkageSpecification createLinkageSpecification( - IASTScope scope, - String spec, - int startingOffset) - { - return new ASTLinkageSpecification( scopeToSymbol( scope ), spec, startingOffset ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ASTClassKind, org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplate, int, int) - */ - public IASTClassSpecifier createClassSpecifier( - IASTScope scope, - ITokenDuple name, - ASTClassKind kind, - ClassNameType type, - ASTAccessVisibility access, - int startingOffset, - int nameOffset, int nameEndOffset) throws ASTSemanticException - { - IContainerSymbol currentScopeSymbol = scopeToSymbol(scope); - TypeInfo.eType pstType = classKindToTypeInfo(kind); - List references = new ArrayList(); - - String newSymbolName = ""; - - if( name != null ){ - IToken lastToken = name.getLastToken(); - if( name.length() != 1 ) // qualified name - { - ITokenDuple containerSymbolName = - name.getSubrange( 0, name.length() - 3 ); // -1 for index, -2 for last hop of qualified name - currentScopeSymbol = (IContainerSymbol)lookupQualifiedName( currentScopeSymbol, - containerSymbolName, references, true); - if( currentScopeSymbol == null ) - throw new ASTSemanticException(); - } - newSymbolName = lastToken.getImage(); - } - - ISymbol classSymbol = null; - if( !newSymbolName.equals("") ){ - try - { - classSymbol = currentScopeSymbol.lookupMemberForDefinition(newSymbolName); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - if( classSymbol != null && ! classSymbol.isForwardDeclaration() ) - throw new ASTSemanticException(); - - if( classSymbol != null && classSymbol.getType() != pstType ) - throw new ASTSemanticException(); - } - - IDerivableContainerSymbol newSymbol = pst.newDerivableContainerSymbol( newSymbolName, pstType ); - - if( classSymbol != null ) - classSymbol.setTypeSymbol( newSymbol ); - - try - { - currentScopeSymbol.addSymbol( newSymbol ); - } - catch (ParserSymbolTableException e2) - { - throw new ASTSemanticException(); - } - - ASTClassSpecifier classSpecifier = new ASTClassSpecifier( newSymbol, kind, type, access, startingOffset, nameOffset, nameEndOffset, references ); - try - { - attachSymbolExtension(newSymbol, classSpecifier ); - } - catch (ExtensionException e1) - { - throw new ASTSemanticException(); - } - return classSpecifier; - } - - protected TypeInfo.eType classKindToTypeInfo(ASTClassKind kind) - throws ASTSemanticException - { - TypeInfo.eType pstType = null; - - if( kind == ASTClassKind.CLASS ) - pstType = TypeInfo.t_class; - else if( kind == ASTClassKind.STRUCT ) - pstType = TypeInfo.t_struct; - else if( kind == ASTClassKind.UNION ) - pstType = TypeInfo.t_union; - else if( kind == ASTClassKind.ENUM ) - pstType = TypeInfo.t_enumeration; - else - throw new ASTSemanticException(); - return pstType; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#addBaseSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, java.lang.String) - */ - public void addBaseSpecifier( - IASTClassSpecifier astClassSpec, - boolean isVirtual, - ASTAccessVisibility visibility, - ITokenDuple parentClassName) throws ASTSemanticException - { - IDerivableContainerSymbol classSymbol = (IDerivableContainerSymbol)scopeToSymbol( astClassSpec); - Iterator iterator = parentClassName.iterator(); - List references = new ArrayList(); - - if( ! iterator.hasNext() ) - throw new ASTSemanticException(); - - IContainerSymbol symbol = null; - - symbol = getScopeToSearchUpon(astClassSpec, (IToken)parentClassName.getFirstToken(), iterator ); - - while( iterator.hasNext() ) - { - IToken t = (IToken)iterator.next(); - if( t.getType() == IToken.tCOLONCOLON ) continue; - try - { - if( t == parentClassName.getLastToken()) - symbol = (IContainerSymbol)symbol.lookup( t.getImage() ); - else - symbol = symbol.lookupNestedNameSpecifier( t.getImage() ); - - if( symbol != null ) - addReference( references, createReference( symbol, t.getImage(), t.getOffset() )); - else - throw new ASTSemanticException(); - } - catch( ParserSymbolTableException pste ) - { - throw new ASTSemanticException(); - } - } - - classSymbol.addParent( symbol, isVirtual, visibility, parentClassName.getFirstToken().getOffset(), references ); - - } - /** - * @param symbol - * @param string - * @return - */ - protected IASTReference createReference(ISymbol symbol, String string, int offset ) throws ASTSemanticException - { - if( symbol == null ) - throw new ASTSemanticException(); - - if( symbol.getType() == TypeInfo.t_namespace ) - { - return new ASTNamespaceReference( offset, string, (IASTNamespaceDefinition)symbol.getASTExtension().getPrimaryDeclaration()); - } - else if( symbol.getType() == TypeInfo.t_class || - symbol.getType() == TypeInfo.t_struct || - symbol.getType() == TypeInfo.t_union ) - { - return new ASTClassReference( offset, string, (IASTTypeSpecifier)symbol.getASTExtension().getPrimaryDeclaration() ); - } - else if( symbol.getTypeInfo().checkBit( TypeInfo.isTypedef )) - { - return new ASTTypedefReference( offset, string, (IASTTypedefDeclaration)symbol.getASTExtension().getPrimaryDeclaration()); - } - else if( symbol.getType() == TypeInfo.t_enumeration ) - return new ASTEnumerationReference( offset, string, (IASTEnumerationSpecifier)symbol.getASTExtension().getPrimaryDeclaration() ); - else if( symbol.getType() == TypeInfo.t_enumerator ) - return new ASTEnumeratorReference( offset, string, (IASTEnumerator)symbol.getASTExtension().getPrimaryDeclaration() ); - else if(( symbol.getType() == TypeInfo.t_function ) || (symbol.getType() == TypeInfo.t_constructor)) - { - if( symbol.getContainingSymbol().getTypeInfo().isType( TypeInfo.t_class, TypeInfo.t_union ) ) - return new ASTMethodReference( offset, string, (IASTMethod)symbol.getASTExtension().getPrimaryDeclaration() ); - else - return new ASTFunctionReference( offset, string, (IASTFunction)symbol.getASTExtension().getPrimaryDeclaration() ); - } - else if( ( symbol.getType() == TypeInfo.t_type ) || - ( symbol.getType() == TypeInfo.t_bool )|| - ( symbol.getType() == TypeInfo.t_char ) || - ( symbol.getType() == TypeInfo.t_wchar_t )|| - ( symbol.getType() == TypeInfo.t_int ) || - ( symbol.getType() == TypeInfo.t_float )|| - ( symbol.getType() == TypeInfo.t_double ) || - ( symbol.getType() == TypeInfo.t_void ) ) - - { - if( symbol.getContainingSymbol().getType() == TypeInfo.t_class || - symbol.getContainingSymbol().getType() == TypeInfo.t_struct || - symbol.getContainingSymbol().getType() == TypeInfo.t_union ) - { - return new ASTFieldReference( offset, string, (IASTField)symbol.getASTExtension().getPrimaryDeclaration()); - } - else if( ( symbol.getContainingSymbol().getType() == TypeInfo.t_function || - symbol.getContainingSymbol().getType() == TypeInfo.t_constructor ) && - symbol.getContainingSymbol() instanceof IParameterizedSymbol && - ((IParameterizedSymbol)symbol.getContainingSymbol()).getParameterList() != null && - ((IParameterizedSymbol)symbol.getContainingSymbol()).getParameterList().contains( symbol ) ) - { - return new ASTParameterReference( offset, string, (IASTParameterDeclaration)symbol.getASTExtension().getPrimaryDeclaration() ); - } - else - { - ASTSymbol s = symbol.getASTExtension().getPrimaryDeclaration(); - if(s instanceof IASTVariable) - return new ASTVariableReference( offset, string, (IASTVariable)s); - else if (s instanceof IASTParameterDeclaration) - return new ASTParameterReference( offset, string, (IASTParameterDeclaration)s); - } - } - throw new ASTSemanticException(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, int, int) - */ - public IASTEnumerationSpecifier createEnumerationSpecifier( - IASTScope scope, - String name, - int startingOffset, - int nameOffset, int nameEndOffset) throws ASTSemanticException - { - IContainerSymbol containerSymbol = scopeToSymbol(scope); - TypeInfo.eType pstType = TypeInfo.t_enumeration; - - IDerivableContainerSymbol classSymbol = pst.newDerivableContainerSymbol( name, pstType ); - try - { - containerSymbol.addSymbol( classSymbol ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - ASTEnumerationSpecifier enumSpecifier = new ASTEnumerationSpecifier( classSymbol, startingOffset, nameOffset, nameEndOffset ); - - try - { - attachSymbolExtension(classSymbol, enumSpecifier ); - } - catch (ExtensionException e1) - { - throw new ASTSemanticException(); - } - return enumSpecifier; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#addEnumerator(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier, java.lang.String, int, int, org.eclipse.cdt.core.parser.ast.IASTExpression) - */ - public void addEnumerator( - IASTEnumerationSpecifier enumeration, - String string, - int startingOffset, - int nameOffset, - int nameEndOffset, int endingOffset, IASTExpression initialValue) throws ASTSemanticException - { - IContainerSymbol enumerationSymbol = (IContainerSymbol)((ISymbolOwner)enumeration).getSymbol(); - - ISymbol enumeratorSymbol = pst.newSymbol( string, TypeInfo.t_enumerator ); - try - { - enumerationSymbol.addSymbol( enumeratorSymbol ); - } - catch (ParserSymbolTableException e1) - { - throw new ASTSemanticException(); - } - ASTEnumerator enumerator = new ASTEnumerator( enumeratorSymbol, enumeration, startingOffset, nameOffset, nameEndOffset, endingOffset, initialValue ); - ((ASTEnumerationSpecifier)enumeration).addEnumerator( enumerator ); - try - { - attachSymbolExtension( enumeratorSymbol, enumerator ); - } - catch (ExtensionException e) - { - throw new ASTSemanticException(); - } - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createExpression(org.eclipse.cdt.core.parser.ast.IASTExpression.Kind, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTExpression, java.lang.String, java.lang.String, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor) - */ - public IASTExpression createExpression( - IASTScope scope, - Kind kind, - IASTExpression lhs, - IASTExpression rhs, - IASTExpression thirdExpression, - IASTTypeId typeId, - ITokenDuple idExpression, String literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException - { - try{ - List references = new ArrayList(); - ISymbol symbol = getExpressionSymbol(scope, kind, lhs, rhs, idExpression, references ); - - // Try to figure out the result that this expression evaluates to - ExpressionResult expressionResult = getExpressionResultType(kind, lhs, rhs, thirdExpression, typeId, literal, symbol); - - // expression results could be empty, but should not be null - if(expressionResult == null) - throw new ASTSemanticException(); - - // create the ASTExpression - ASTExpression expression = new ASTExpression( kind, lhs, rhs, thirdExpression, - typeId, idExpression, literal, newDescriptor, references); - - // Assign the result to the created expression - expression.setResultType (expressionResult); - - return expression; - - }catch (ASTSemanticException e){ - throw e; - } - - } - /* - * Try and dereference the symbol in the expression - */ - private ISymbol getExpressionSymbol( - IASTScope scope, - Kind kind, - IASTExpression lhs, - IASTExpression rhs, - ITokenDuple idExpression, - List references )throws ASTSemanticException - { - ISymbol symbol = null; - IContainerSymbol startingScope = scopeToSymbol( scope ); - - //If the expression has an id, look up id and add it to references - if( idExpression != null ) - symbol = lookupQualifiedName( startingScope, idExpression, references, false ); - - // If the expression is lookup symbol if it is in the scope of a type after a "." or an "->" - IContainerSymbol searchScope = getSearchScope(kind, lhs, startingScope); - if (!searchScope.equals(startingScope)) - symbol = lookupQualifiedName(searchScope, ((ASTExpression)rhs).getIdExpressionTokenDuple(), references, false, LookupType.QUALIFIED ); - - // get symbol if it is the "this" pointer - // go up the scope until you hit a class - if (kind == IASTExpression.Kind.PRIMARY_THIS){ - try{ - symbol = startingScope.lookup("this"); - }catch (ParserSymbolTableException e){ - throw new ASTSemanticException(); - } - } - // lookup symbol if it is a function call - if (kind == IASTExpression.Kind.POSTFIX_FUNCTIONCALL){ - ITokenDuple functionId = getFunctionId(lhs); - IContainerSymbol functionScope = getSearchScope(lhs.getExpressionKind(), lhs.getLHSExpression(), startingScope); - ExpressionResult expResult = ((ASTExpression)rhs).getResultType(); - List parameters = null; - if(expResult instanceof ExpressionResultList){ - ExpressionResultList expResultList = (ExpressionResultList) expResult; - parameters = expResultList.getResultList(); - - }else { - parameters = new ArrayList(); - parameters.add(expResult.getResult()); - } - if( functionScope.equals( startingScope ) ) - symbol = lookupQualifiedName(functionScope, functionId, TypeInfo.t_function, parameters, references, false); - else - symbol = lookupQualifiedName(functionScope, functionId, TypeInfo.t_function, parameters, references, false, LookupType.QUALIFIED ); - } - - return symbol; - } - /* - * Returns the function ID token - */ - private ITokenDuple getFunctionId (IASTExpression expression){ - if((expression.getExpressionKind() == IASTExpression.Kind.POSTFIX_DOT_IDEXPRESSION) - || (expression.getExpressionKind() == IASTExpression.Kind.POSTFIX_ARROW_IDEXPRESSION) - || (expression.getExpressionKind() == IASTExpression.Kind.POSTFIX_DOT_TEMPL_IDEXPRESS) - || (expression.getExpressionKind() == IASTExpression.Kind.POSTFIX_ARROW_TEMPL_IDEXP) - || (expression.getExpressionKind() == IASTExpression.Kind.PM_DOTSTAR) - || (expression.getExpressionKind() == IASTExpression.Kind.PM_ARROWSTAR) - ){ - return ((ASTExpression)expression.getRHSExpression()).getIdExpressionTokenDuple(); - } - else { - return ((ASTExpression)expression).getIdExpressionTokenDuple(); - } - } - - private IContainerSymbol getSearchScope (Kind kind, IASTExpression lhs, IContainerSymbol startingScope) throws ASTSemanticException{ - if((kind == IASTExpression.Kind.POSTFIX_DOT_IDEXPRESSION) - || (kind == IASTExpression.Kind.POSTFIX_ARROW_IDEXPRESSION) - || (kind == IASTExpression.Kind.POSTFIX_DOT_TEMPL_IDEXPRESS) - || (kind == IASTExpression.Kind.POSTFIX_ARROW_TEMPL_IDEXP) - || (kind == IASTExpression.Kind.PM_DOTSTAR) - || (kind == IASTExpression.Kind.PM_ARROWSTAR) - ){ - TypeInfo lhsInfo = (TypeInfo) ((ASTExpression)lhs).getResultType().getResult(); - if(lhsInfo != null){ - ISymbol firstContainingScope = (ISymbol) lhsInfo.getTypeSymbol(); - if(firstContainingScope != null){ - ISymbol containingScope = firstContainingScope.getTypeSymbol(); - if(containingScope != null){ - return (IContainerSymbol)containingScope; - } else { - throw new ASTSemanticException(); - } - } else { - throw new ASTSemanticException(); - } - } else { - throw new ASTSemanticException(); - } - } - else { - return startingScope; - } - } - - /* - * Conditional Expression conversion - */ - protected TypeInfo conditionalExpressionConversions(TypeInfo second, TypeInfo third){ - TypeInfo info = new TypeInfo(); - if(second.equals(third)){ - info = second; - return info; - } - if((second.getType() == TypeInfo.t_void) && (third.getType() != TypeInfo.t_void)){ - info = third; - return info; - } - if((second.getType() != TypeInfo.t_void) && (third.getType() == TypeInfo.t_void)){ - info = second; - return info; - } - if((second.getType() == TypeInfo.t_void) && (third.getType() == TypeInfo.t_void)){ - info = second; - return info; - } - try{ - info = ParserSymbolTable.getConditionalOperand(second, third); - return info; - } catch(ParserSymbolTableException e){ - // empty info - return info; - } - } - /* - * Apply the usual arithmetic conversions to find out the result of an expression - * that has a lhs and a rhs as indicated in the specs (section 5.Expressions, page 64) - */ - protected TypeInfo usualArithmeticConversions(TypeInfo lhs, TypeInfo rhs) throws ASTSemanticException{ - - // if you have a variable of type basic type, then we need to go to the basic type first - while( (lhs.getType() == TypeInfo.t_type) && (lhs.getTypeSymbol() != null)){ - lhs = lhs.getTypeSymbol().getTypeInfo(); - } - while( (rhs.getType() == TypeInfo.t_type) && (rhs.getTypeSymbol() != null)){ - rhs = rhs.getTypeSymbol().getTypeInfo(); - } - - if( !lhs.isType(TypeInfo.t_bool, TypeInfo.t_enumerator ) && - !rhs.isType(TypeInfo.t_bool, TypeInfo.t_enumerator ) ) - { - throw new ASTSemanticException(); - } - - TypeInfo info = new TypeInfo(); - if( - ( lhs.checkBit(TypeInfo.isLong) && lhs.getType() == TypeInfo.t_double) - || ( rhs.checkBit(TypeInfo.isLong) && rhs.getType() == TypeInfo.t_double) - ){ - info.setType(TypeInfo.t_double); - info.setBit(true, TypeInfo.isLong); - return info; - } - else if( - ( lhs.getType() == TypeInfo.t_double ) - || ( rhs.getType() == TypeInfo.t_double ) - ){ - info.setType(TypeInfo.t_double); - return info; - } - else if ( - ( lhs.getType() == TypeInfo.t_float ) - || ( rhs.getType() == TypeInfo.t_float ) - ){ - info.setType(TypeInfo.t_float); - return info; - } else { - // perform intergral promotions (Specs section 4.5) - info.setType(TypeInfo.t_int); - } - - if( - ( lhs.checkBit(TypeInfo.isUnsigned) && lhs.checkBit(TypeInfo.isLong)) - || ( rhs.checkBit(TypeInfo.isUnsigned) && rhs.checkBit(TypeInfo.isLong)) - ){ - info.setBit(true, TypeInfo.isUnsigned); - info.setBit(true, TypeInfo.isLong); - return info; - } - else if( - ( lhs.checkBit(TypeInfo.isUnsigned) && rhs.checkBit(TypeInfo.isLong) ) - || ( rhs.checkBit(TypeInfo.isUnsigned) && lhs.checkBit(TypeInfo.isLong) ) - ){ - info.setBit(true, TypeInfo.isUnsigned); - info.setBit(true, TypeInfo.isLong); - return info; - } - else if ( - ( lhs.checkBit(TypeInfo.isLong)) - || ( rhs.checkBit(TypeInfo.isLong)) - ){ - info.setBit(true, TypeInfo.isLong); - return info; - } - else if ( - ( lhs.checkBit(TypeInfo.isUnsigned) ) - || ( rhs.checkBit(TypeInfo.isUnsigned) ) - ){ - info.setBit(true, TypeInfo.isUnsigned); - return info; - } else { - // it should be both = int - return info; - } - } - - private TypeInfo addToInfo(ASTExpression exp, boolean flag, int mask) - throws ASTSemanticException{ - if(exp == null) - throw new ASTSemanticException(); - TypeInfo info = (TypeInfo)((ASTExpression)exp).getResultType().getResult(); - info.setBit(flag, mask); - return info; - } - - protected ExpressionResult getExpressionResultType( - Kind kind, - IASTExpression lhs, - IASTExpression rhs, - IASTExpression thirdExpression, - IASTTypeId typeId, - String literal, - ISymbol symbol) - throws ASTSemanticException{ - ExpressionResult result = null; - TypeInfo info = new TypeInfo(); - try { - // types that resolve to void - if ((kind == IASTExpression.Kind.PRIMARY_EMPTY) - || (kind == IASTExpression.Kind.THROWEXPRESSION) - || (kind == IASTExpression.Kind.POSTFIX_DOT_DESTRUCTOR) - || (kind == IASTExpression.Kind.POSTFIX_ARROW_DESTRUCTOR) - || (kind == IASTExpression.Kind.DELETE_CASTEXPRESSION) - || (kind == IASTExpression.Kind.DELETE_VECTORCASTEXPRESSION) - ){ - info.setType(TypeInfo.t_void); - result = new ExpressionResult(info); - return result; - } - // types that resolve to int - if ((kind == IASTExpression.Kind.PRIMARY_INTEGER_LITERAL) - || (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_INT) - ){ - info.setType(TypeInfo.t_int); - result = new ExpressionResult(info); - return result; - } - // size of is always unsigned int - if ((kind == IASTExpression.Kind.UNARY_SIZEOF_TYPEID) - || (kind == IASTExpression.Kind.UNARY_SIZEOF_UNARYEXPRESSION) - ){ - info.setType(TypeInfo.t_int); - info.setBit(true, TypeInfo.isUnsigned); - result = new ExpressionResult(info); - return result; - } - // types that resolve to char - if( (kind == IASTExpression.Kind.PRIMARY_CHAR_LITERAL) - || (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_CHAR)){ - info.setType(TypeInfo.t_char); - // check that this is really only one literal - if(literal.length() > 1){ - // this is a string - info.addPtrOperator(new TypeInfo.PtrOp(TypeInfo.PtrOp.t_pointer)); - } - result = new ExpressionResult(info); - return result; - } - // types that resolve to string - if (kind == IASTExpression.Kind.PRIMARY_STRING_LITERAL){ - info.setType(TypeInfo.t_char); - info.addPtrOperator(new TypeInfo.PtrOp(TypeInfo.PtrOp.t_pointer)); - result = new ExpressionResult(info); - return result; - } - // types that resolve to float - if( (kind == IASTExpression.Kind.PRIMARY_FLOAT_LITERAL) - || (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_FLOAT)){ - info.setType(TypeInfo.t_float); - result = new ExpressionResult(info); - return result; - } - // types that resolve to double - if( kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_DOUBLE){ - info.setType(TypeInfo.t_double); - result = new ExpressionResult(info); - return result; - } - // types that resolve to wchar - if(kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_WCHART){ - info.setType(TypeInfo.t_wchar_t); - result = new ExpressionResult(info); - return result; - } - // types that resolve to bool - if( (kind == IASTExpression.Kind.PRIMARY_BOOLEAN_LITERAL) - || (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_BOOL) - || (kind == IASTExpression.Kind.RELATIONAL_GREATERTHAN) - || (kind == IASTExpression.Kind.RELATIONAL_GREATERTHANEQUALTO) - || (kind == IASTExpression.Kind.RELATIONAL_LESSTHAN) - || (kind == IASTExpression.Kind.RELATIONAL_LESSTHANEQUALTO) - || (kind == IASTExpression.Kind.EQUALITY_EQUALS) - || (kind == IASTExpression.Kind.EQUALITY_NOTEQUALS) - || (kind == IASTExpression.Kind.LOGICALANDEXPRESSION) - || (kind == IASTExpression.Kind.LOGICALOREXPRESSION) - ) - { - info.setType(TypeInfo.t_bool); - result = new ExpressionResult(info); - return result; - } - // short added to a type - if (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_SHORT ){ - info = addToInfo((ASTExpression)lhs, true, TypeInfo.isShort); - result = new ExpressionResult(info); - return result; - } - // long added to a type - if (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_LONG ){ - info = addToInfo((ASTExpression)lhs, true, TypeInfo.isLong); - result = new ExpressionResult(info); - return result; - } - // signed added to a type - if (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_SIGNED ){ - info = addToInfo((ASTExpression)lhs, false, TypeInfo.isUnsigned); - result = new ExpressionResult(info); - return result; - } - // unsigned added to a type - if (kind == IASTExpression.Kind.POSTFIX_SIMPLETYPE_UNSIGNED ){ - info = addToInfo((ASTExpression)lhs, true, TypeInfo.isUnsigned); - result = new ExpressionResult(info); - return result; - } - // Id expressions resolve to t_type, symbol already looked up - if( kind == IASTExpression.Kind.ID_EXPRESSION ) - { - info.setType(TypeInfo.t_type); - info.setTypeSymbol(symbol); - result = new ExpressionResult(info); - if (symbol == null) - result.setFailedToDereference(true); - return result; - } - // an ampersand implies a pointer operation of type reference - if (kind == IASTExpression.Kind.UNARY_AMPSND_CASTEXPRESSION){ - ASTExpression left =(ASTExpression)lhs; - if(left == null) - throw new ASTSemanticException(); - info = (TypeInfo)left.getResultType().getResult(); - if ((info != null) && (info.getTypeSymbol() != null)){ - info.addOperatorExpression( TypeInfo.OperatorExpression.addressof ); - } else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - - // a star implies a pointer operation of type pointer - if (kind == IASTExpression.Kind.UNARY_STAR_CASTEXPRESSION){ - ASTExpression left =(ASTExpression)lhs; - if(left == null) - throw new ASTSemanticException(); - info = (TypeInfo)left.getResultType().getResult(); - if ((info != null)&& (info.getTypeSymbol() != null)){ - info.addOperatorExpression( TypeInfo.OperatorExpression.indirection ); - }else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // subscript - if (kind == IASTExpression.Kind.POSTFIX_SUBSCRIPT){ - ASTExpression left =(ASTExpression)lhs; - if(left == null) - throw new ASTSemanticException(); - info = (TypeInfo)left.getResultType().getResult(); - if ((info != null) && (info.getTypeSymbol() != null)){ - info.addOperatorExpression( TypeInfo.OperatorExpression.subscript ); - }else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // the dot and the arrow resolves to the type of the member - if ((kind == IASTExpression.Kind.POSTFIX_DOT_IDEXPRESSION) - || (kind == IASTExpression.Kind.POSTFIX_ARROW_IDEXPRESSION) - || (kind == IASTExpression.Kind.POSTFIX_DOT_TEMPL_IDEXPRESS) - || (kind == IASTExpression.Kind.POSTFIX_ARROW_TEMPL_IDEXP) - ){ - if(symbol != null){ - info = new TypeInfo(symbol.getTypeInfo()); - } -// else { -// throw new ASTSemanticException(); -// } - result = new ExpressionResult(info); - return result; - } - // the dot* and the arrow* are the same as dot/arrow + unary star - if ((kind == IASTExpression.Kind.PM_DOTSTAR) - || (kind == IASTExpression.Kind.PM_ARROWSTAR) - ){ - ASTExpression right =(ASTExpression)rhs; - if (right == null) - throw new ASTSemanticException(); - info = (TypeInfo)right.getResultType().getResult(); - if ((info != null) && (symbol != null)){ - info.addOperatorExpression( TypeInfo.OperatorExpression.indirection ); - info.setTypeSymbol(symbol); - } else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // this - if (kind == IASTExpression.Kind.PRIMARY_THIS){ - if(symbol != null) - { - info.setType(TypeInfo.t_type); - info.setTypeSymbol(symbol); - } else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // conditional - if (kind == IASTExpression.Kind.CONDITIONALEXPRESSION){ - ASTExpression right = (ASTExpression)rhs; - ASTExpression third = (ASTExpression)thirdExpression; - if((right != null ) && (third != null)){ - TypeInfo rightType =(TypeInfo)right.getResultType().getResult(); - TypeInfo thirdType =(TypeInfo)third.getResultType().getResult(); - if((rightType != null) && (thirdType != null)){ - info = conditionalExpressionConversions(rightType, thirdType); - } else { - throw new ASTSemanticException(); - } - } else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // new - if( ( kind == IASTExpression.Kind.NEW_TYPEID ) - || ( kind == IASTExpression.Kind.NEW_NEWTYPEID ) ) - { - try - { - info = typeId.getTypeSymbol().getTypeInfo(); - info.addPtrOperator( new TypeInfo.PtrOp(TypeInfo.PtrOp.t_pointer)); - } - catch (ASTNotImplementedException e) - { - // will never happen - } - result = new ExpressionResult(info); - return result; - } - // types that use the usual arithmetic conversions - if((kind == IASTExpression.Kind.MULTIPLICATIVE_MULTIPLY) - || (kind == IASTExpression.Kind.MULTIPLICATIVE_DIVIDE) - || (kind == IASTExpression.Kind.MULTIPLICATIVE_MODULUS) - || (kind == IASTExpression.Kind.ADDITIVE_PLUS) - || (kind == IASTExpression.Kind.ADDITIVE_MINUS) - || (kind == IASTExpression.Kind.ANDEXPRESSION) - || (kind == IASTExpression.Kind.EXCLUSIVEOREXPRESSION) - || (kind == IASTExpression.Kind.INCLUSIVEOREXPRESSION) - ){ - ASTExpression left = (ASTExpression)lhs; - ASTExpression right = (ASTExpression)rhs; - if((left != null ) && (right != null)){ - TypeInfo leftType =(TypeInfo)left.getResultType().getResult(); - TypeInfo rightType =(TypeInfo)right.getResultType().getResult(); - info = usualArithmeticConversions(leftType, rightType); - } - else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // types that resolve to LHS types - if ((kind == IASTExpression.Kind.PRIMARY_BRACKETED_EXPRESSION) - || (kind == IASTExpression.Kind.POSTFIX_INCREMENT) - || (kind == IASTExpression.Kind.POSTFIX_DECREMENT) - || (kind == IASTExpression.Kind.POSTFIX_TYPEID_EXPRESSION) - || (kind == IASTExpression.Kind.UNARY_INCREMENT) - || (kind == IASTExpression.Kind.UNARY_DECREMENT) - || (kind == IASTExpression.Kind.UNARY_PLUS_CASTEXPRESSION) - || (kind == IASTExpression.Kind.UNARY_MINUS_CASTEXPRESSION) - || (kind == IASTExpression.Kind.UNARY_NOT_CASTEXPRESSION) - || (kind == IASTExpression.Kind.UNARY_TILDE_CASTEXPRESSION) - || (kind == IASTExpression.Kind.SHIFT_LEFT) - || (kind == IASTExpression.Kind.SHIFT_RIGHT) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_NORMAL) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_PLUS) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_MINUS) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_MULT) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_DIV) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_MOD) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_LSHIFT) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_RSHIFT) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_AND) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_OR) - || (kind == IASTExpression.Kind.ASSIGNMENTEXPRESSION_XOR) - ){ - ASTExpression left = (ASTExpression)lhs; - if(left != null){ - info =(TypeInfo)left.getResultType().getResult(); - } else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - // the cast changes the types to the type looked up in typeId = symbol - if(( kind == IASTExpression.Kind.CASTEXPRESSION ) - || ( kind == IASTExpression.Kind.POSTFIX_DYNAMIC_CAST ) - || ( kind == IASTExpression.Kind.POSTFIX_STATIC_CAST ) - || ( kind == IASTExpression.Kind.POSTFIX_REINTERPRET_CAST ) - || ( kind == IASTExpression.Kind.POSTFIX_CONST_CAST ) - ){ - try{ - info = new TypeInfo(typeId.getTypeSymbol().getTypeInfo()); - }catch (ASTNotImplementedException e) - { - // will never happen - } - result = new ExpressionResult(info); - return result; - } - // a list collects all types of left and right hand sides - if(kind == IASTExpression.Kind.EXPRESSIONLIST){ - result = new ExpressionResultList(); - if(lhs != null){ - TypeInfo leftType = ((ASTExpression)lhs).getResultType().getResult(); - result.setResult(leftType); - } - if(rhs != null){ - TypeInfo rightType = ((ASTExpression)rhs).getResultType().getResult(); - result.setResult(rightType); - } - return result; - } - // a function call type is the return type of the function - if(kind == IASTExpression.Kind.POSTFIX_FUNCTIONCALL){ - if(symbol != null){ - IParameterizedSymbol psymbol = (IParameterizedSymbol) symbol; - ISymbol returnTypeSymbol = psymbol.getReturnType(); - if(returnTypeSymbol != null){ - info.setType(returnTypeSymbol.getType()); - info.setTypeSymbol(returnTypeSymbol); - }else { - // this is call to a constructor - } - } - result = new ExpressionResult(info); - if(symbol == null) - result.setFailedToDereference(true); - return result; - } - // typeid - if( kind == IASTExpression.Kind.POSTFIX_TYPEID_TYPEID ) - { - try - { - info = typeId.getTypeSymbol().getTypeInfo(); - } - catch (ASTNotImplementedException e) - { - // will not ever happen from within CompleteParseASTFactory - } - result = new ExpressionResult(info); - return result; - } - // typename - if ( ( kind == IASTExpression.Kind.POSTFIX_TYPENAME_IDENTIFIER ) - || ( kind == IASTExpression.Kind.POSTFIX_TYPENAME_TEMPLATEID ) ) - { - if(symbol != null){ - info.setType(TypeInfo.t_type); - info.setTypeSymbol(symbol); - } else { - throw new ASTSemanticException(); - } - result = new ExpressionResult(info); - return result; - } - } catch (Exception e){ - throw new ASTSemanticException(); - } - return null; - } - - protected void getExpressionReferences(IASTExpression expression, List references) - { - if( expression != null ) - { - references.addAll( ((ASTExpression)expression).getReferences() ); - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewDescriptor() - */ - public IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions) - { - return new ASTNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createExceptionSpecification(java.util.List) - */ - public IASTExceptionSpecification createExceptionSpecification(IASTScope scope, List typeIds) throws ASTSemanticException - { - List references = new ArrayList(); - List newTypeIds = new ArrayList(); - if( typeIds != null ) - { - Iterator iter =typeIds.iterator(); - while( iter.hasNext() ) - { - IASTTypeId duple = (IASTTypeId)iter.next(); - if( duple != null ) - { - lookupQualifiedName( scopeToSymbol( scope ), ((ASTTypeId)duple).getTokenDuple(), references, false ); - newTypeIds.add( duple.toString() ); - } - } - } - return new ASTExceptionSpecification( newTypeIds, references ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createConstructorMemberInitializer(org.eclipse.cdt.core.parser.ITokenDuple, org.eclipse.cdt.core.parser.ast.IASTExpression) - */ - public IASTConstructorMemberInitializer createConstructorMemberInitializer( - IASTScope scope, - ITokenDuple duple, IASTExpression expressionList) throws ASTSemanticException - { - List references = new ArrayList(); - - IContainerSymbol scopeSymbol = scopeToSymbol(scope); - - boolean requireReferenceResolution = false; - if( duple != null ) - { - try - { - lookupQualifiedName( scopeSymbol, duple, references, true ); - } catch( ASTSemanticException ase ) - { - requireReferenceResolution = true; - } - } - - getExpressionReferences( expressionList, references ); - return new ASTConstructorMemberInitializer( - expressionList, - duple == null ? "" : duple.toString(), - duple == null ? 0 : duple.getFirstToken().getOffset(), - references, requireReferenceResolution ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createSimpleTypeSpecifier(org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type, org.eclipse.cdt.core.parser.ITokenDuple, boolean, boolean, boolean, boolean, boolean) - */ - public IASTSimpleTypeSpecifier createSimpleTypeSpecifier( - IASTScope scope, - Type kind, - ITokenDuple typeName, - boolean isShort, - boolean isLong, - boolean isSigned, - boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary) throws ASTSemanticException - { - TypeInfo.eType type = null; - - if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) - type = TypeInfo.t_type; - else if( kind == IASTSimpleTypeSpecifier.Type.BOOL ) - type = TypeInfo.t_bool; - else if( kind == IASTSimpleTypeSpecifier.Type.CHAR ) - type = TypeInfo.t_char; - else if( kind == IASTSimpleTypeSpecifier.Type.DOUBLE ||kind == IASTSimpleTypeSpecifier.Type.FLOAT ) - type = TypeInfo.t_double; - else if( kind == IASTSimpleTypeSpecifier.Type.INT ) - type = TypeInfo.t_int; - else if( kind == IASTSimpleTypeSpecifier.Type.VOID ) - type = TypeInfo.t_void; - else if( kind == IASTSimpleTypeSpecifier.Type.WCHAR_T) - type = TypeInfo.t_wchar_t; - else if( kind == IASTSimpleTypeSpecifier.Type._BOOL ) - type = TypeInfo.t__Bool; - - List references = new ArrayList(); - ISymbol s = pst.newSymbol( "", type ); - if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) - { - // lookup the duple - Iterator i = typeName.iterator(); - IToken first = typeName.getFirstToken(); - - ISymbol typeSymbol = getScopeToSearchUpon( scope, first, i ); - - while( i.hasNext() ) - { - IToken current = (IToken)i.next(); - if( current.getType() == IToken.tCOLONCOLON ) continue; - - try - { - if( current != typeName.getLastToken() ) - typeSymbol = ((IContainerSymbol)typeSymbol).lookupNestedNameSpecifier( current.getImage()); - else - typeSymbol = ((IContainerSymbol)typeSymbol).lookup( current.getImage()); - - if( typeSymbol != null ) - addReference( references, createReference( typeSymbol, current.getImage(), current.getOffset() )); - else - throw new ASTSemanticException(); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - } - s.setTypeSymbol( typeSymbol ); - } - - s.getTypeInfo().setBit( isLong, TypeInfo.isLong ); - s.getTypeInfo().setBit( isShort, TypeInfo.isShort); - s.getTypeInfo().setBit( isUnsigned, TypeInfo.isUnsigned ); - s.getTypeInfo().setBit( isComplex, TypeInfo.isComplex ); - s.getTypeInfo().setBit( isImaginary, TypeInfo.isImaginary ); - - return new ASTSimpleTypeSpecifier( s, false, typeName.toString(), references ); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplate) - */ - public IASTFunction createFunction( - IASTScope scope, - ITokenDuple name, - List parameters, - IASTAbstractDeclaration returnType, - IASTExceptionSpecification exception, - boolean isInline, - boolean isFriend, - boolean isStatic, - int startOffset, - int nameOffset, - int nameEndOffset, - IASTTemplate ownerTemplate, - boolean isConst, - boolean isVolatile, - boolean isVirtual, - boolean isExplicit, - boolean isPureVirtual, - List constructorChain, - boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException - { - List references = new ArrayList(); - IContainerSymbol ownerScope = scopeToSymbol( scope ); - - // check if this is a method in a body file - if(name.length() > 1){ - IContainerSymbol parentScope = (IContainerSymbol) - lookupQualifiedName( - ownerScope, - name.getSubrange( 0, name.findLastTokenType( IToken.tCOLONCOLON ) - 1), - references, - false ); - - - if((parentScope != null) && - ( (parentScope.getType() == TypeInfo.t_class) - || (parentScope.getType() == TypeInfo.t_struct) - || (parentScope.getType() == TypeInfo.t_union)) - ){ - IASTScope methodParentScope = (IASTScope)parentScope.getASTExtension().getPrimaryDeclaration(); - ITokenDuple newName = name.getSubrange( - name.findLastTokenType( IToken.tCOLONCOLON) + 1, - name.length() - 1 ); - return createMethod( - methodParentScope, - newName, - parameters, - returnType, - exception, - isInline, - isFriend, - isStatic, - startOffset, - newName.getFirstToken().getOffset(), - nameEndOffset, - ownerTemplate, - isConst, - isVolatile, - isVirtual, - isExplicit, - isPureVirtual, - ASTAccessVisibility.PRIVATE, - constructorChain, - references, - isFunctionDefinition, hasFunctionTryBlock, hasVariableArguments ); - } - } - - IParameterizedSymbol symbol = pst.newParameterizedSymbol( name.getLastToken().getImage(), TypeInfo.t_function ); - setFunctionTypeInfoBits(isInline, isFriend, isStatic, symbol); - - symbol.setHasVariableArgs( hasVariableArguments ); - - setParameter( symbol, returnType, false, references ); - setParameters( symbol, references, parameters.iterator() ); - - symbol.setIsForwardDeclaration(!isFunctionDefinition); - boolean previouslyDeclared = false; - if( isFunctionDefinition ) - { - List functionParameters = new LinkedList(); - // the lookup requires a list of type infos - // instead of a list of IASTParameterDeclaration - Iterator p = parameters.iterator(); - while (p.hasNext()){ - ASTParameterDeclaration param = (ASTParameterDeclaration)p.next(); - functionParameters.add(param.getSymbol().getTypeInfo()); - } - - IParameterizedSymbol functionDeclaration = null; - - functionDeclaration = - (IParameterizedSymbol) lookupQualifiedName(ownerScope, name.getLastToken().getImage(), TypeInfo.t_function, functionParameters, 0, new ArrayList(), false, LookupType.UNQUALIFIED ); - - if( functionDeclaration != null ) - { - functionDeclaration.setTypeSymbol( symbol ); - previouslyDeclared = true; - } - } - - try - { - ownerScope.addSymbol( symbol ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - ASTFunction function = new ASTFunction( symbol, nameEndOffset, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, previouslyDeclared, hasFunctionTryBlock ); - try - { - attachSymbolExtension(symbol, function); - } - catch (ExtensionException e1) - { - throw new ASTSemanticException(); - } - return function; - } - - protected void setFunctionTypeInfoBits( - boolean isInline, - boolean isFriend, - boolean isStatic, - IParameterizedSymbol symbol) - { - symbol.getTypeInfo().setBit( isInline, TypeInfo.isInline ); - symbol.getTypeInfo().setBit( isFriend, TypeInfo.isFriend ); - symbol.getTypeInfo().setBit( isStatic, TypeInfo.isStatic ); - } - - /** - * @param symbol - * @param iterator - */ - protected void setParameters(IParameterizedSymbol symbol, List references, Iterator iterator) throws ASTSemanticException - { - while( iterator.hasNext() ) - { - setParameter( symbol, (IASTParameterDeclaration)iterator.next(), true, references ); - } - } - - protected TypeInfo getParameterTypeInfo( IASTAbstractDeclaration absDecl)throws ASTSemanticException{ - TypeInfo type = new TypeInfo(); - if( absDecl.getTypeSpecifier() instanceof IASTSimpleTypeSpecifier ) - { - IASTSimpleTypeSpecifier.Type kind = ((IASTSimpleTypeSpecifier)absDecl.getTypeSpecifier()).getType(); - if( kind == IASTSimpleTypeSpecifier.Type.BOOL ) - type.setType(TypeInfo.t_bool); - else if( kind == IASTSimpleTypeSpecifier.Type.CHAR ) - type.setType(TypeInfo.t_char); - else if( kind == IASTSimpleTypeSpecifier.Type.DOUBLE ) - type.setType(TypeInfo.t_double); - else if( kind == IASTSimpleTypeSpecifier.Type.FLOAT ) - type.setType(TypeInfo.t_float); - else if( kind == IASTSimpleTypeSpecifier.Type.INT ) - type.setType(TypeInfo.t_int); - else if( kind == IASTSimpleTypeSpecifier.Type.VOID ) - type.setType(TypeInfo.t_void); - else if( kind == IASTSimpleTypeSpecifier.Type.WCHAR_T) - type.setType(TypeInfo.t_wchar_t); - else if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) - type.setType(TypeInfo.t_type); - else - throw new ASTSemanticException(); - } - else if( absDecl.getTypeSpecifier() instanceof IASTClassSpecifier ) - { - ASTClassKind kind = ((IASTClassSpecifier)absDecl.getTypeSpecifier()).getClassKind(); - if( kind == ASTClassKind.CLASS ) - type.setType(TypeInfo.t_class); - else if( kind == ASTClassKind.STRUCT ) - type.setType(TypeInfo.t_struct); - else if( kind == ASTClassKind.UNION ) - type.setType(TypeInfo.t_union); - else - throw new ASTSemanticException(); - } - else if( absDecl.getTypeSpecifier() instanceof IASTEnumerationSpecifier ) - { - type.setType(TypeInfo.t_enumeration); - } - else if( absDecl.getTypeSpecifier() instanceof IASTElaboratedTypeSpecifier ) - { - ASTClassKind kind = ((IASTElaboratedTypeSpecifier)absDecl.getTypeSpecifier()).getClassKind(); - if( kind == ASTClassKind.CLASS ) - type.setType(TypeInfo.t_class); - else if( kind == ASTClassKind.STRUCT ) - type.setType(TypeInfo.t_struct); - else if( kind == ASTClassKind.UNION ) - type.setType(TypeInfo.t_union); - else if( kind == ASTClassKind.ENUM ) - type.setType(TypeInfo.t_enumeration); - else - throw new ASTSemanticException(); - } - else - throw new ASTSemanticException(); - return type; - } - /** - * @param symbol - * @param returnType - */ - protected void setParameter(IParameterizedSymbol symbol, IASTAbstractDeclaration absDecl, boolean isParameter, List references) throws ASTSemanticException - { - if (absDecl.getTypeSpecifier() == null) - return; - - // now determined by another function - TypeInfo.eType type = getParameterTypeInfo(absDecl).getType(); - - ISymbol xrefSymbol = null; - List newReferences = null; - if( absDecl.getTypeSpecifier() instanceof IASTSimpleTypeSpecifier ) - { - if( ((IASTSimpleTypeSpecifier)absDecl.getTypeSpecifier()).getType() == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) - { - xrefSymbol = ((ASTSimpleTypeSpecifier)absDecl.getTypeSpecifier()).getSymbol(); - newReferences = ((ASTSimpleTypeSpecifier)absDecl.getTypeSpecifier()).getReferences(); - } - } - else if( absDecl.getTypeSpecifier() instanceof ASTElaboratedTypeSpecifier ) - { - ASTElaboratedTypeSpecifier elab = (ASTElaboratedTypeSpecifier)absDecl.getTypeSpecifier(); - xrefSymbol = elab.getSymbol(); - newReferences = new ArrayList(); - newReferences.addAll( elab.getReferences() ); - newReferences.add( createReference( xrefSymbol, elab.getName(), elab.getNameOffset()) ); - } - - String paramName = ""; - if(absDecl instanceof IASTParameterDeclaration){ - paramName = ((IASTParameterDeclaration)absDecl).getName(); - } - - ISymbol paramSymbol = pst.newSymbol( paramName, type ); - if( xrefSymbol != null ) - paramSymbol.setTypeSymbol( xrefSymbol.getTypeSymbol() ); - - setPointerOperators( paramSymbol, absDecl.getPointerOperators(), absDecl.getArrayModifiers() ); - - if( isParameter) - symbol.addParameter( paramSymbol ); - else - symbol.setReturnType( paramSymbol ); - - if( newReferences != null ) - references.addAll( newReferences ); - - if( absDecl instanceof ASTParameterDeclaration ) - { - ASTParameterDeclaration parm = (ASTParameterDeclaration)absDecl; - parm.setSymbol( paramSymbol ); - try - { - attachSymbolExtension( paramSymbol, parm ); - } - catch (ExtensionException e) - { - throw new ASTSemanticException(); - } - } - } - - /** - * @param paramSymbol - * @param iterator - */ - protected void setPointerOperators(ISymbol symbol, Iterator pointerOpsIterator, Iterator arrayModsIterator) throws ASTSemanticException - { - while( pointerOpsIterator.hasNext() ) - { - ASTPointerOperator pointerOperator = (ASTPointerOperator)pointerOpsIterator.next(); - if( pointerOperator == ASTPointerOperator.REFERENCE ) - symbol.addPtrOperator( new TypeInfo.PtrOp( TypeInfo.PtrOp.t_reference )); - else if( pointerOperator == ASTPointerOperator.POINTER ) - symbol.addPtrOperator( new TypeInfo.PtrOp( TypeInfo.PtrOp.t_pointer )); - else if( pointerOperator == ASTPointerOperator.CONST_POINTER ) - symbol.addPtrOperator( new TypeInfo.PtrOp( TypeInfo.PtrOp.t_pointer, true, false )); - else if( pointerOperator == ASTPointerOperator.VOLATILE_POINTER ) - symbol.addPtrOperator( new TypeInfo.PtrOp( TypeInfo.PtrOp.t_pointer, false, true)); - else - throw new ASTSemanticException(); - } - - while( arrayModsIterator.hasNext() ) - { - arrayModsIterator.next(); - symbol.addPtrOperator( new TypeInfo.PtrOp( TypeInfo.PtrOp.t_array )); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplate, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) - */ - - public IASTMethod createMethod( - IASTScope scope, - ITokenDuple name, - List parameters, - IASTAbstractDeclaration returnType, - IASTExceptionSpecification exception, - boolean isInline, - boolean isFriend, - boolean isStatic, - int startOffset, - int nameOffset, - int nameEndOffset, - IASTTemplate ownerTemplate, - boolean isConst, - boolean isVolatile, - boolean isVirtual, - boolean isExplicit, - boolean isPureVirtual, - ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException - { - return createMethod(scope, name, parameters, returnType, exception, - isInline, isFriend, isStatic, startOffset, nameOffset, nameEndOffset, - ownerTemplate, isConst, isVolatile, isVirtual, isExplicit, isPureVirtual, - visibility, constructorChain, null, isFunctionDefinition, hasFunctionTryBlock, hasVariableArguments ); - } - - public IASTMethod createMethod( - IASTScope scope, - ITokenDuple nameDuple, - List parameters, - IASTAbstractDeclaration returnType, - IASTExceptionSpecification exception, - boolean isInline, - boolean isFriend, - boolean isStatic, - int startOffset, - int nameOffset, - int nameEndOffset, - IASTTemplate ownerTemplate, - boolean isConst, - boolean isVolatile, - boolean isVirtual, - boolean isExplicit, - boolean isPureVirtual, - ASTAccessVisibility visibility, - List constructorChain, - List references, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException - { - boolean isConstructor = false; - boolean isDestructor = false; - - IContainerSymbol ownerScope = scopeToSymbol( scope ); - IParameterizedSymbol symbol = pst.newParameterizedSymbol( nameDuple.toString(), TypeInfo.t_function ); - setFunctionTypeInfoBits(isInline, isFriend, isStatic, symbol); - setMethodTypeInfoBits( symbol, isConst, isVolatile, isVirtual, isExplicit ); - symbol.setHasVariableArgs( hasVariableArguments ); - - if(references == null) - references = new ArrayList(); - - if( returnType.getTypeSpecifier() != null ) - setParameter( symbol, returnType, false, references ); - setParameters( symbol, references, parameters.iterator() ); - - String parentName = ((IASTClassSpecifier)scope).getName(); - - // check constructor / destructor if no return type - if ( returnType.getTypeSpecifier() == null ){ - if(parentName.indexOf(DOUBLE_COLON) != -1){ - parentName = parentName.substring(parentName.lastIndexOf(DOUBLE_COLON) + DOUBLE_COLON.length()); - } - if( parentName.equals(nameDuple.toString()) ){ - isConstructor = true; - } else if(nameDuple.getFirstToken().getType() == IToken.tCOMPL && parentName.equals(nameDuple.getLastToken().getImage())){ - isDestructor = true; - } - } - - symbol.setIsForwardDeclaration(!isFunctionDefinition); - boolean previouslyDeclared = false; - - IParameterizedSymbol functionDeclaration = null; - - if( isFunctionDefinition || isFriend ) - { - List functionParameters = new LinkedList(); - // the lookup requires a list of type infos - // instead of a list of IASTParameterDeclaration - Iterator p = parameters.iterator(); - while (p.hasNext()){ - ASTParameterDeclaration param = (ASTParameterDeclaration)p.next(); - functionParameters.add(param.getSymbol().getTypeInfo()); - } - - List functionReferences = new ArrayList(); - - if( isFriend ) - { - functionDeclaration = - (IParameterizedSymbol) lookupQualifiedName(ownerScope, nameDuple, isConstructor ? TypeInfo.t_constructor : TypeInfo.t_function, functionParameters, functionReferences, false, LookupType.FORFRIENDSHIP ); - } else { - functionDeclaration = - (IParameterizedSymbol) lookupQualifiedName(ownerScope, nameDuple.toString(), isConstructor ? TypeInfo.t_constructor : TypeInfo.t_function, functionParameters, 0, functionReferences, false, LookupType.FORDEFINITION ); - } - - previouslyDeclared = ( functionDeclaration != null ); - - if( isFriend ) - { - if( functionDeclaration != null ) - { - symbol.setTypeSymbol( functionDeclaration ); - // friend declaration, has no real visibility, set private - visibility = ASTAccessVisibility.PRIVATE; - } else - { - //for a friend function declaration, if there is no prior declaration, the program is illformed - throw new ASTSemanticException(); - } - - } else if( functionDeclaration != null ) - { - functionDeclaration.setTypeSymbol( symbol ); - // set the definition visibility = declaration visibility - ASTMethodReference reference = (ASTMethodReference) functionReferences.iterator().next(); - visibility = ((IASTMethod)reference.getReferencedElement()).getVisiblity(); - } - } - - try - { - if( isFriend ) - { - ((IDerivableContainerSymbol)ownerScope).addFriend( functionDeclaration ); - } else if( !isConstructor ) - ownerScope.addSymbol( symbol ); - else - { - symbol.setType( TypeInfo.t_constructor ); - ((IDerivableContainerSymbol)ownerScope).addConstructor( symbol ); - } - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - resolveLeftoverConstructorInitializerMembers( symbol, constructorChain ); - - ASTMethod method = new ASTMethod( symbol, nameEndOffset, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, previouslyDeclared, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain, hasFunctionTryBlock ); - try - { - attachSymbolExtension( symbol, method ); - } - catch (ExtensionException e1) - { - throw new ASTSemanticException(); - } - return method; - } - /** - * @param symbol - * @param constructorChain - */ - protected void resolveLeftoverConstructorInitializerMembers(IParameterizedSymbol symbol, List constructorChain) - { - if( constructorChain != null ) - { - Iterator initializers = constructorChain.iterator(); - while( initializers.hasNext()) - { - IASTConstructorMemberInitializer initializer = (IASTConstructorMemberInitializer)initializers.next(); - if( !initializer.getName().equals( "") && - initializer instanceof ASTConstructorMemberInitializer && - ((ASTConstructorMemberInitializer)initializer).requiresNameResolution() ) - { - ASTConstructorMemberInitializer realInitializer = ((ASTConstructorMemberInitializer)initializer); - try - { - IDerivableContainerSymbol container = (IDerivableContainerSymbol) symbol.getContainingSymbol(); - lookupQualifiedName(container, initializer.getName(), TypeInfo.t_any, null, realInitializer.getNameOffset(), realInitializer.getReferences(), false, LookupType.QUALIFIED); - } - catch( ASTSemanticException ase ) - { - } - } - - // TODO try and resolve parameter references now in the expression list - - } - } - - - } - - /** - * @param symbol - * @param isConst - * @param isVolatile - * @param isConstructor - * @param isDestructor - * @param isVirtual - * @param isExplicit - * @param isPureVirtual - */ - protected void setMethodTypeInfoBits(IParameterizedSymbol symbol, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit) - { - symbol.getTypeInfo().setBit( isConst, TypeInfo.isConst ); - symbol.getTypeInfo().setBit( isVolatile, TypeInfo.isConst ); - symbol.getTypeInfo().setBit( isVirtual, TypeInfo.isVirtual ); - symbol.getTypeInfo().setBit( isExplicit, TypeInfo.isExplicit ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createVariable(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, int, int) - */ - public IASTVariable createVariable( - IASTScope scope, - String name, - boolean isAuto, - IASTInitializerClause initializerClause, - IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, - boolean isMutable, - boolean isExtern, - boolean isRegister, - boolean isStatic, - int startingOffset, - int nameOffset, int nameEndOffset, IASTExpression constructorExpression) throws ASTSemanticException - { - List references = new ArrayList(); - IContainerSymbol ownerScope = scopeToSymbol( scope ); - - // check if this is a scoped field, not a variable - StringTokenizer tokenizer = new StringTokenizer(name,DOUBLE_COLON); - int tokencount = tokenizer.countTokens(); - if(tokencount > 1){ - List tokens = new ArrayList(); - String oneToken = ""; - // This is NOT a function. This is a method definition - while (tokenizer.hasMoreTokens()){ - oneToken = tokenizer.nextToken(); - tokens.add(oneToken); - } - - String fieldName = oneToken; - - int numOfTokens = 1; - int offset = nameOffset; - IContainerSymbol parentScope = ownerScope; - Iterator i = tokens.iterator(); - while (i.hasNext() && (numOfTokens++) < tokens.size()){ - String token = (String) i.next(); - - IContainerSymbol parentSymbol = null; - try { - parentSymbol = (IContainerSymbol) parentScope.lookupNestedNameSpecifier( token ); - if( parentSymbol != null ) - addReference( references, createReference( parentSymbol, name, offset )); - } catch (ParserSymbolTableException e1) { - //do nothing - } - - if(parentSymbol == null) - break; - else { - parentScope = parentSymbol; - offset += token.length()+ DOUBLE_COLON.length(); - } - } - - if((parentScope != null) && - ( (parentScope.getType() == TypeInfo.t_class) - || (parentScope.getType() == TypeInfo.t_struct) - || (parentScope.getType() == TypeInfo.t_union)) - ){ - IASTScope fieldParentScope = (IASTScope)parentScope.getASTExtension().getPrimaryDeclaration(); - return createField(fieldParentScope, fieldName,isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, - isRegister, isStatic, startingOffset, offset, nameEndOffset, constructorExpression, ASTAccessVisibility.PRIVATE, references); - } - } - - ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); - setVariableTypeInfoBits( - isAuto, - abstractDeclaration, - isMutable, - isExtern, - isRegister, - isStatic, - newSymbol); - setPointerOperators( newSymbol, abstractDeclaration.getPointerOperators(), abstractDeclaration.getArrayModifiers() ); - - newSymbol.setIsForwardDeclaration(isStatic); - boolean previouslyDeclared = false; - if(!isStatic){ - ISymbol variableDeclaration = (ISymbol) lookupQualifiedName(ownerScope, name, new ArrayList(), false, LookupType.UNQUALIFIED); - - if( variableDeclaration != null ) - { - variableDeclaration.setTypeSymbol( newSymbol ); - previouslyDeclared = true; - } - } - try - { - ownerScope.addSymbol( newSymbol ); - } - catch (ParserSymbolTableException e) - { - // TODO Auto-generated catch block - } - - ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, nameEndOffset, references, constructorExpression, previouslyDeclared ); - if( variable.getInitializerClause() != null ) - { - variable.getInitializerClause().setOwnerVariableDeclaration(variable); - addDesignatorReferences( (ASTInitializerClause)variable.getInitializerClause() ); - } - - try - { - attachSymbolExtension(newSymbol, variable ); - } - catch (ExtensionException e) - { - throw new ASTSemanticException(); - } - return variable; - } - - - /** - * @param clause - */ - protected void addDesignatorReferences( ASTInitializerClause clause ) - { - if( clause.getKind() == IASTInitializerClause.Kind.DESIGNATED_INITIALIZER_LIST || - clause.getKind() == IASTInitializerClause.Kind.DESIGNATED_ASSIGNMENT_EXPRESSION ) - { - ISymbol variableSymbol = ((ASTVariable)clause.getOwnerVariableDeclaration()).getSymbol(); - ISymbol currentSymbol = variableSymbol.getTypeSymbol(); - - TypeInfo currentTypeInfo = new TypeInfo( currentSymbol.getTypeInfo() ); - Iterator designators = clause.getDesignators(); - while( designators.hasNext() ) - { - IASTDesignator designator = (IASTDesignator)designators.next(); - if( designator.getKind() == IASTDesignator.DesignatorKind.FIELD ) - { - ISymbol lookup = null; - if( ! ( currentSymbol instanceof IContainerSymbol ) ) - break; - - try - { - lookup = ((IContainerSymbol)currentSymbol).lookup( designator.fieldName() ); - } - catch (ParserSymbolTableException e){ - break; - } - - if( lookup == null || lookup.getContainingSymbol() != currentSymbol ) - break; - - try - { - clause.getReferences().add( createReference( lookup, designator.fieldName(), designator.fieldOffset() )); - } - catch (ASTSemanticException e1) - { - // error - } - - // we have found the correct field - currentTypeInfo = new TypeInfo( lookup.getTypeInfo() ); - if( lookup.getTypeInfo() == null ) - break; - currentSymbol = lookup.getTypeSymbol(); - - } - else if( designator.getKind() == IASTDesignator.DesignatorKind.SUBSCRIPT ) - currentTypeInfo.applyOperatorExpressions( SUBSCRIPT ); - } - - } - - if( clause.getKind() == IASTInitializerClause.Kind.DESIGNATED_INITIALIZER_LIST || - clause.getKind() == IASTInitializerClause.Kind.INITIALIZER_LIST ) - { - Iterator subInitializers = clause.getInitializers(); - while( subInitializers.hasNext() ) - addDesignatorReferences( (ASTInitializerClause)subInitializers.next() ); - } - } - - protected void setVariableTypeInfoBits( - boolean isAuto, - IASTAbstractDeclaration abstractDeclaration, - boolean isMutable, - boolean isExtern, - boolean isRegister, - boolean isStatic, - ISymbol newSymbol) - { - newSymbol.getTypeInfo().setBit( isMutable, TypeInfo.isMutable ); - newSymbol.getTypeInfo().setBit( isAuto, TypeInfo.isAuto ); - newSymbol.getTypeInfo().setBit( isExtern, TypeInfo.isExtern ); - newSymbol.getTypeInfo().setBit( isRegister, TypeInfo.isRegister ); - newSymbol.getTypeInfo().setBit( isStatic, TypeInfo.isStatic ); - newSymbol.getTypeInfo().setBit( abstractDeclaration.isConst(), TypeInfo.isConst ); - } - - protected ISymbol cloneSimpleTypeSymbol( - String name, - IASTAbstractDeclaration abstractDeclaration, - List references) throws ASTSemanticException - { - if( abstractDeclaration.getTypeSpecifier() == null ) - throw new ASTSemanticException(); - ISymbol newSymbol = null; - ISymbol symbolToBeCloned = null; - if( abstractDeclaration.getTypeSpecifier() instanceof ASTSimpleTypeSpecifier ) - { - symbolToBeCloned = ((ASTSimpleTypeSpecifier)abstractDeclaration.getTypeSpecifier()).getSymbol(); - references.addAll( ((ASTSimpleTypeSpecifier)abstractDeclaration.getTypeSpecifier()).getReferences() ); - } - else if( abstractDeclaration.getTypeSpecifier() instanceof ASTClassSpecifier ) - { - symbolToBeCloned = pst.newSymbol(name, TypeInfo.t_type); - symbolToBeCloned.setTypeSymbol(((ASTClassSpecifier)abstractDeclaration.getTypeSpecifier()).getSymbol()); - } - else if( abstractDeclaration.getTypeSpecifier() instanceof ASTElaboratedTypeSpecifier ) - { - ASTElaboratedTypeSpecifier elab = ((ASTElaboratedTypeSpecifier)abstractDeclaration.getTypeSpecifier()); - symbolToBeCloned = pst.newSymbol(name, TypeInfo.t_type); - symbolToBeCloned.setTypeSymbol(elab.getSymbol()); - references.add( createReference( elab.getSymbol(), elab.getName(), elab.getNameOffset()) ); - } - newSymbol = (ISymbol) symbolToBeCloned.clone(); - newSymbol.setName( name ); - - return newSymbol; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createField(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) - */ - public IASTField createField( - IASTScope scope, - String name, - boolean isAuto, - IASTInitializerClause initializerClause, - IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, - boolean isMutable, - boolean isExtern, - boolean isRegister, - boolean isStatic, - int startingOffset, - int nameOffset, - int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) throws ASTSemanticException - { - return createField(scope, name,isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, - isRegister, isStatic, startingOffset, nameOffset, nameEndOffset, constructorExpression, visibility, null); - } - - public IASTField createField( - IASTScope scope, - String name, - boolean isAuto, - IASTInitializerClause initializerClause, - IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, - boolean isMutable, - boolean isExtern, - boolean isRegister, - boolean isStatic, - int startingOffset, - int nameOffset, - int nameEndOffset, - IASTExpression constructorExpression, - ASTAccessVisibility visibility, - List references) throws ASTSemanticException - { - IContainerSymbol ownerScope = scopeToSymbol( scope ); - - if(references == null) - references = new ArrayList(); - ISymbol newSymbol = cloneSimpleTypeSymbol(name, abstractDeclaration, references); - setVariableTypeInfoBits( - isAuto, - abstractDeclaration, - isMutable, - isExtern, - isRegister, - isStatic, - newSymbol); - setPointerOperators( newSymbol, abstractDeclaration.getPointerOperators(), abstractDeclaration.getArrayModifiers() ); - - newSymbol.setIsForwardDeclaration(isStatic); - boolean previouslyDeclared = false; - if(!isStatic){ - List fieldReferences = new ArrayList(); - ISymbol fieldDeclaration = lookupQualifiedName(ownerScope, name, fieldReferences, false, LookupType.FORDEFINITION); - - if( fieldDeclaration != null ) - { - previouslyDeclared = true; - fieldDeclaration.setTypeSymbol( newSymbol ); - // set the definition visibility = declaration visibility - ASTReference reference = (ASTReference) fieldReferences.iterator().next(); - visibility = ((IASTField)reference.getReferencedElement()).getVisiblity(); - } - } - - try - { - ownerScope.addSymbol( newSymbol ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, nameOffset, nameEndOffset, references, previouslyDeclared, constructorExpression, visibility ); - try - { - attachSymbolExtension(newSymbol, field ); - } - catch (ExtensionException e) - { - throw new ASTSemanticException(); - } - return field; - - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, java.util.List, boolean, int) - */ - public IASTTemplateDeclaration createTemplateDeclaration( - IASTScope scope, - List templateParameters, - boolean exported, - int startingOffset) - { - // TODO Auto-generated method stub - return new ASTTemplateDeclaration(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateParameter(org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParamKind, java.lang.String, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration, java.util.List) - */ - public IASTTemplateParameter createTemplateParameter( - ParamKind kind, - String identifier, - String defaultValue, - IASTParameterDeclaration parameter, - List parms) - { - // TODO Auto-generated method stub - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateInstantiation(org.eclipse.cdt.core.parser.ast.IASTScope, int) - */ - public IASTTemplateInstantiation createTemplateInstantiation( - IASTScope scope, - int startingOffset) - { - // TODO Auto-generated method stub - return new ASTTemplateInstantiation(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTScope, int) - */ - public IASTTemplateSpecialization createTemplateSpecialization( - IASTScope scope, - int startingOffset) - { - // TODO Auto-generated method stub - return new ASTTemplateSpecialization(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypedef(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, int, int) - */ - public IASTTypedefDeclaration createTypedef( - IASTScope scope, - String name, - IASTAbstractDeclaration mapping, - int startingOffset, - int nameOffset, int nameEndOffset) throws ASTSemanticException - { - IContainerSymbol containerSymbol = scopeToSymbol(scope); - ISymbol newSymbol = pst.newSymbol( name, TypeInfo.t_type); - newSymbol.getTypeInfo().setBit( true,TypeInfo.isTypedef ); - - - List references = new ArrayList(); - if( mapping.getTypeSpecifier() instanceof ASTSimpleTypeSpecifier ) - { - references.addAll( ((ASTSimpleTypeSpecifier)mapping.getTypeSpecifier()).getReferences() ); - } - - try - { - containerSymbol.addSymbol( newSymbol ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - ASTTypedef d = new ASTTypedef( newSymbol, mapping, startingOffset, nameOffset, nameEndOffset, references ); - try - { - attachSymbolExtension(newSymbol, d ); - } - catch (ExtensionException e1) - { - throw new ASTSemanticException(); - } - return d; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier, org.eclipse.cdt.core.parser.ast.IASTTemplate, int, int) - */ - public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration( - IASTScope scope, - IASTTypeSpecifier typeSpecifier, - IASTTemplate template, - int startingOffset, - int endingOffset) - { - return new ASTAbstractTypeSpecifierDeclaration( scopeToSymbol(scope), typeSpecifier, template, startingOffset, endingOffset); - } - - - public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(IASTScope scope, ASTClassKind kind, ITokenDuple name, int startingOffset, int endOffset, boolean isForewardDecl, boolean isFriend) throws ASTSemanticException - { - IContainerSymbol currentScopeSymbol = scopeToSymbol(scope); - TypeInfo.eType pstType = classKindToTypeInfo(kind); - List references = new ArrayList(); - IToken lastToken = name.getLastToken(); - if( name.length() != 1 ) // qualified name - { - ITokenDuple containerSymbolName = - name.getSubrange( 0, name.length() - 3 ); // -1 for index, -2 for last hop of qualified name - currentScopeSymbol = (IContainerSymbol)lookupQualifiedName( currentScopeSymbol, - containerSymbolName, references, true); - if( currentScopeSymbol == null ) - throw new ASTSemanticException(); - } - - ISymbol checkSymbol = null; - try - { - if( isFriend ){ - if( !(currentScopeSymbol instanceof IDerivableContainerSymbol) ){ - throw new ASTSemanticException(); - } - checkSymbol = ((IDerivableContainerSymbol)currentScopeSymbol).lookupForFriendship( lastToken.getImage() ); - } else { - checkSymbol = currentScopeSymbol.elaboratedLookup( pstType, lastToken.getImage()); - } - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - - if( isForewardDecl ) - { - if( checkSymbol == null ) - { - checkSymbol = pst.newDerivableContainerSymbol( lastToken.getImage(), pstType ); - checkSymbol.setIsForwardDeclaration( true ); - try - { - if( isFriend ){ - ((IDerivableContainerSymbol)currentScopeSymbol).addFriend( checkSymbol ); - } else { - currentScopeSymbol.addSymbol( checkSymbol ); - } - } - catch (ParserSymbolTableException e1) - { - throw new ASTSemanticException(); - } - - ASTElaboratedTypeSpecifier elab = - new ASTElaboratedTypeSpecifier( checkSymbol, kind, startingOffset, name.getFirstToken().getOffset(), name.getLastToken().getEndOffset(), endOffset, references, isForewardDecl ); - - try - { - attachSymbolExtension( checkSymbol, elab ); - } - catch (ExtensionException e2) - { - throw new ASTSemanticException(); - } - } else if( isFriend ){ - try { - ((IDerivableContainerSymbol)currentScopeSymbol).addFriend( checkSymbol ); - } catch (ParserSymbolTableException e1) { - throw new ASTSemanticException(); - } - - } - } - - if( checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTClassSpecifier || - checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTEnumerationSpecifier - ) - { - ASTElaboratedTypeSpecifier elab = new ASTElaboratedTypeSpecifier( checkSymbol, kind, startingOffset, name.getFirstToken().getOffset(), name.getLastToken().getEndOffset(), endOffset, references, isForewardDecl ); - try - { - attachSymbolExtension( checkSymbol, elab ); - } - catch (ExtensionException e2) - { - throw new ASTSemanticException(); - } - return elab; - } - - if( checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTElaboratedTypeSpecifier ) - return (IASTElaboratedTypeSpecifier)checkSymbol.getASTExtension().getPrimaryDeclaration(); - - - throw new ASTSemanticException(); - } - - protected ParserSymbolTable pst; - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNamespaceAlias(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ITokenDuple, int, int, int) - */ - public IASTNamespaceAlias createNamespaceAlias(IASTScope scope, String identifier, ITokenDuple alias, int startingOffset, int nameOffset, int nameEndOffset, int endOffset) throws ASTSemanticException - { - IContainerSymbol startingSymbol = scopeToSymbol(scope); - List references = new ArrayList(); - - ISymbol namespaceSymbol = lookupQualifiedName( startingSymbol, alias, references, true ); - - if( namespaceSymbol.getType() != TypeInfo.t_namespace ) - throw new ASTSemanticException(); - - ISymbol newSymbol = pst.newContainerSymbol( identifier, TypeInfo.t_namespace ); - newSymbol.setTypeSymbol( namespaceSymbol ); - - try - { - startingSymbol.addSymbol( newSymbol ); - } - catch (ParserSymbolTableException e) - { - throw new ASTSemanticException(); - } - - ASTNamespaceAlias astAlias = new ASTNamespaceAlias( - newSymbol, alias.toString(), (IASTNamespaceDefinition)namespaceSymbol.getASTExtension().getPrimaryDeclaration(), - startingOffset, nameOffset, nameEndOffset, endOffset, references ); - try - { - attachSymbolExtension( newSymbol, astAlias ); - } - catch (ExtensionException e1) - { - throw new ASTSemanticException(); - } - return astAlias; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public IASTCodeScope createNewCodeBlock(IASTScope scope) { - IContainerSymbol symbol = scopeToSymbol( scope ); - - IContainerSymbol newScope = pst.newContainerSymbol("", TypeInfo.t_block); - newScope.setContainingSymbol(symbol); - - ASTCodeScope codeScope = new ASTCodeScope( newScope ); - try - { - attachSymbolExtension( newScope, codeScope ); - } - catch (ExtensionException e) - { - } - return codeScope; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#queryIsTypeName(org.eclipse.cdt.core.parser.ITokenDuple) - */ - public boolean queryIsTypeName(IASTScope scope, ITokenDuple nameInQuestion) { - ISymbol lookupSymbol = null; - try { - lookupSymbol = - lookupQualifiedName( - scopeToSymbol(scope), - nameInQuestion, - new ArrayList(), - false); - } catch (ASTSemanticException e) { - // won't get thrown - } - if( lookupSymbol == null ) return false; - if( lookupSymbol.isType( TypeInfo.t_type, TypeInfo.t_enumeration ) ) return true; - return false; - } - - public IASTParameterDeclaration createParameterDeclaration(boolean isConst, boolean isVolatile, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset) - { - return new ASTParameterDeclaration( null, isConst, isVolatile, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOp, parameterName, initializerClause, startingOffset, endingOffset, nameOffset, nameEndOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypeId(org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type, org.eclipse.cdt.core.parser.ITokenDuple, java.util.List, java.util.List) - */ - public IASTTypeId createTypeId(IASTScope scope, Type kind, boolean isConst, boolean isVolatile, boolean isShort, - boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods) throws ASTSemanticException - { - ASTTypeId result = - new ASTTypeId( kind, name, pointerOps, arrayMods, "", //TODO - isConst, isVolatile, isUnsigned, isSigned, isShort, isLong, isTypename ); - result.setTypeSymbol( createSymbolForTypeId( scope, result ) ); - return result; - } - - /** - * @param id - * @return - */ - public static TypeInfo.eType getTypeKind(IASTTypeId id) - { - IASTSimpleTypeSpecifier.Type type = id.getKind(); - if( type == IASTSimpleTypeSpecifier.Type.BOOL ) - return TypeInfo.t_bool; - else if( type == IASTSimpleTypeSpecifier.Type.CHAR ) - return TypeInfo.t_char; - else if( type == IASTSimpleTypeSpecifier.Type.DOUBLE ) - return TypeInfo.t_double; - else if( type == IASTSimpleTypeSpecifier.Type.FLOAT ) - return TypeInfo.t_float; - else if( type == IASTSimpleTypeSpecifier.Type.INT ) - return TypeInfo.t_int; - else if( type == IASTSimpleTypeSpecifier.Type.VOID ) - return TypeInfo.t_void; - else if( id.isShort() || id.isLong() || id.isUnsigned() || id.isSigned() ) - return TypeInfo.t_int; - else - return TypeInfo.t_type; - } - - protected ISymbol createSymbolForTypeId( IASTScope scope, IASTTypeId id ) throws ASTSemanticException - { - if( id == null ) return null; - - ASTTypeId typeId = (ASTTypeId)id; - ISymbol result = pst.newSymbol( "", CompleteParseASTFactory.getTypeKind(id)); - - result.getTypeInfo().setBit( id.isConst(), TypeInfo.isConst ); - result.getTypeInfo().setBit( id.isVolatile(), TypeInfo.isVolatile ); - - result.getTypeInfo().setBit( id.isShort(), TypeInfo.isShort); - result.getTypeInfo().setBit( id.isLong(), TypeInfo.isLong); - result.getTypeInfo().setBit( id.isUnsigned(), TypeInfo.isUnsigned); - - List refs = new ArrayList(); - if( result.getType() == TypeInfo.t_type ) - { - ISymbol typeSymbol = lookupQualifiedName( scopeToSymbol(scope), typeId.getTokenDuple(), refs, true ); - if( typeSymbol.getType() == TypeInfo.t_type ) - throw new ASTSemanticException(); - result.setTypeSymbol( typeSymbol ); - typeId.addReferences( refs ); - } - - setPointerOperators( result, id.getPointerOperators(), id.getArrayModifiers() ); - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#signalEndOfClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void signalEndOfClassSpecifier(IASTClassSpecifier astClassSpecifier) - { - if( astClassSpecifier == null ) return; - try - { - ((IDerivableContainerSymbol)((ASTClassSpecifier)astClassSpecifier).getSymbol()).addCopyConstructor(); - } - catch (ParserSymbolTableException e) - { - // do nothing, this is best effort - } - } - - public IASTInitializerClause createInitializerClause(IASTScope scope, IASTInitializerClause.Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators) - { - return new ASTInitializerClause( kind, assignmentExpression, initializerClauses, designators ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#getCompletionContext(org.eclipse.cdt.core.parser.ast.IASTExpression.Kind, org.eclipse.cdt.core.parser.ast.IASTExpression) - */ - public IASTNode getCompletionContext(Kind kind, IASTExpression expression) { - IContainerSymbol context = null; - try { - context = getSearchScope( kind, expression, null ); - } catch (ASTSemanticException e) { - return null; - } - - if( context != null ){ - ISymbolASTExtension extension = context.getASTExtension(); - return ( extension != null ) ? extension.getPrimaryDeclaration() : null; - } - - return null; - - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResult.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResult.java deleted file mode 100644 index 90af18f10e7..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResult.java +++ /dev/null @@ -1,59 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; - -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; - -/** - * @author hamer - * - */ -public class ExpressionResult { - - - private TypeInfo result; - private boolean failedToDereference = false; - - ExpressionResult(){ - result = new TypeInfo(); - } - ExpressionResult(TypeInfo result){ - this.result = result; - } -/** - * @return - */ -public TypeInfo getResult() { - return result; -} - -/** - * @param info - */ -public void setResult(TypeInfo info) { - result = info; -} - -/** - * @return - */ -public boolean isFailedToDereference() { - return failedToDereference; -} - -/** - * @param b - */ -public void setFailedToDereference(boolean b) { - failedToDereference = b; -} - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResultList.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResultList.java deleted file mode 100644 index 1531f0cac41..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ExpressionResultList.java +++ /dev/null @@ -1,57 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.complete; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo; - -/** - * @author hamer - * - */ -public class ExpressionResultList extends ExpressionResult { - private List resultList = new ArrayList(); - ExpressionResultList(){ - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.complete.ExpressionResult#getResult() - */ - public TypeInfo getResult() { - // TODO Auto-generated method stub - return (TypeInfo)resultList.get(0); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.complete.ExpressionResult#setResult(org.eclipse.cdt.internal.core.parser.pst.TypeInfo) - */ - public void setResult(TypeInfo info) { - // TODO Auto-generated method stub - resultList.add(info); - } - - /** - * @return - */ - public List getResultList() { - return resultList; - } - - /** - * @param list - */ - public void setResultList(List list) { - resultList = list; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTASMDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTASMDefinition.java deleted file mode 100644 index cfebd6dc257..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTASMDefinition.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTASMDefinition - extends ASTDeclaration - implements IASTASMDefinition { - - private Offsets offsets = new Offsets(); - private final String assembly; - /** - * @param scope - */ - public ASTASMDefinition(IASTScope scope, String assembly) { - super(scope); - this.assembly = assembly; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTASMDefinition#getBody() - */ - public String getBody() { - return assembly; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) { - offsets.setStartingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) { - offsets.setEndingOffset( o ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptASMDefinition(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTAbstractTypeSpecifierDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTAbstractTypeSpecifierDeclaration.java deleted file mode 100644 index c6560c635e0..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTAbstractTypeSpecifierDeclaration.java +++ /dev/null @@ -1,117 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTAbstractTypeSpecifierDeclaration - extends ASTDeclaration - implements IASTAbstractTypeSpecifierDeclaration -{ - private final IASTTemplate ownerTemplate; - private final IASTTypeSpecifier typeSpecifier; - /** - * @param scope - * @param typeSpecifier - */ - public ASTAbstractTypeSpecifierDeclaration(IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate ownerTemplate, int startingOffset, int endingOffset) - { - super( ownerTemplate != null ? null : scope ); - this.typeSpecifier = typeSpecifier; - this.ownerTemplate = ownerTemplate; - if( ownerTemplate != null ) - ownerTemplate.setOwnedDeclaration( this ); - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration#getTypeSpecifier() - */ - public IASTTypeSpecifier getTypeSpecifier() - { - return typeSpecifier; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration() - */ - public IASTTemplate getOwnerTemplateDeclaration() - { - return ownerTemplate; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - private Offsets offsets = new Offsets(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptAbstractTypeSpecDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java deleted file mode 100644 index ea16a768b25..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTBaseSpecifier.java +++ /dev/null @@ -1,106 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTReference; - -/** - * @author jcamelon - * - */ -public class ASTBaseSpecifier implements IASTBaseSpecifier { - - private final int offset; - private final ASTAccessVisibility visibility; - private final boolean isVirtual; - private final String parentClassName; - - public ASTBaseSpecifier( String className, boolean v, ASTAccessVisibility a, int o ) - { - parentClassName = className; - isVirtual = v; - visibility = a; - offset = o; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getAccess() - */ - public ASTAccessVisibility getAccess() { - return visibility; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#isVirtual() - */ - public boolean isVirtual() { - return isVirtual; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParent() - */ - public String getParentClassName() { - return parentClassName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier() - */ - public IASTClassSpecifier getParentClassSpecifier() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getNameOffset() - */ - public int getNameOffset() - { - return offset; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReferenceStore#addReference(org.eclipse.cdt.core.parser.ast.IASTReference) - */ - public void addReference(IASTReference reference) throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTReferenceStore#processReferences() - */ - public void processReferences(ISourceElementRequestor requestor)throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - // no references to process - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java deleted file mode 100644 index 0be206ae74f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTClassSpecifier.java +++ /dev/null @@ -1,218 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; -/** - * @author jcamelon - * - */ -public class ASTClassSpecifier extends ASTScopedTypeSpecifier implements IASTQClassSpecifier, IASTQScope -{ - - private final IASTScope scope; - public ASTClassSpecifier( - IASTScope scope, - String name, - ASTClassKind kind, - ClassNameType type, - int startingOffset, - int nameOffset, - int nameEndOffset, - ASTAccessVisibility access) - { - super( scope, name ); - this.scope = scope; - qualifiedNameElement = new ASTQualifiedNamedElement( scope, name ); - classNameType = type; - classKind = kind; - offsets.setStartingOffset(startingOffset); - offsets.setNameOffset(nameOffset); - offsets.setNameEndOffset(nameEndOffset); - this.access = access; - this.name = name; - } - - private final ASTQualifiedNamedElement qualifiedNameElement; - private final String name; - private List declarations = new ArrayList(); - private List baseClauses = new ArrayList(); - private ASTAccessVisibility access; - private NamedOffsets offsets = new NamedOffsets(); - private final ClassNameType classNameType; - private final ASTClassKind classKind; - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassNameType() - */ - public ClassNameType getClassNameType() - { - return classNameType; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getClassKind() - */ - public ASTClassKind getClassKind() - { - return classKind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getBaseClauses() - */ - public Iterator getBaseClauses() - { - return baseClauses.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#getCurrentVisiblity() - */ - public ASTAccessVisibility getCurrentVisibilityMode() - { - return access; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() - { - return declarations.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQScope#addDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void addDeclaration(IASTDeclaration declaration) - { - declarations.add(declaration); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQClassSpecifier#addBaseClass(org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier) - */ - public void addBaseClass(IASTBaseSpecifier baseSpecifier) - { - baseClauses.add(baseSpecifier); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTClassSpecifier#setCurrentVisibility(org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) - */ - public void setCurrentVisibility(ASTAccessVisibility visibility) - { - this.access = visibility; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterClassSpecifier(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitClassSpecifier(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTCompilationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTCompilationUnit.java deleted file mode 100644 index 264c0a451b9..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTCompilationUnit.java +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; - -/** - * @author jcamelon - * - */ -public class ASTCompilationUnit extends ASTNode implements IASTCompilationUnit, IASTQScope { - - private List declarations = new ArrayList(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() { - return declarations.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQScope#addDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void addDeclaration(IASTDeclaration declaration) { - declarations.add( declaration ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterCompilationUnit(this); - } - catch (Exception e) - { - /* do nothing */ - } - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitCompilationUnit(this); - } - catch (Exception e) - { - /* do nothing */ - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java deleted file mode 100644 index 3ab19d0c67d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTConstructorMemberInitializer.java +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; -import org.eclipse.cdt.core.parser.ast.IASTExpression; - -/** - * @author jcamelon - * - */ -public class ASTConstructorMemberInitializer - implements IASTConstructorMemberInitializer -{ - /** - * @param string - * @param expressionList - */ - public ASTConstructorMemberInitializer(String name, IASTExpression expressionList) - { - this.name = name; - this.expressionList = expressionList; - } - - private final IASTExpression expressionList; - private final String name; - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer#getExpressionList() - */ - public IASTExpression getExpressionList() - { - return expressionList; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTDeclaration.java deleted file mode 100644 index d4588e6b461..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTDeclaration.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - * - */ -public abstract class ASTDeclaration extends ASTNode implements IASTDeclaration { - - private final IASTScope scope; - public ASTDeclaration( IASTScope scope ) - { - this.scope = scope; - if( scope != null && scope instanceof IASTQScope ) - ((IASTQScope)scope).addDeclaration(this); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTDeclaration#getOwnerScope() - */ - public IASTScope getOwnerScope() { - return scope; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java deleted file mode 100644 index 9eb8e6cec67..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTElaboratedTypeSpecifier.java +++ /dev/null @@ -1,158 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTElaboratedTypeSpecifier extends ASTNode implements IASTElaboratedTypeSpecifier -{ - - private NamedOffsets offsets = new NamedOffsets(); - private final String typeName; - private final ASTClassKind classKind; - private final ASTQualifiedNamedElement qualifiedName; - /** - * @param elaboratedClassKind - * @param typeName - * @param startingOffset - * @param endOffset - */ - public ASTElaboratedTypeSpecifier(IASTScope scope, ASTClassKind elaboratedClassKind, String typeName, int startingOffset, int nameOffset, int nameEndOffset, int endOffset) - { - classKind = elaboratedClassKind; - this.typeName = typeName; - setStartingOffset( startingOffset ); - setNameOffset( nameOffset ); - setNameEndOffset( nameEndOffset ); - setEndingOffset( endOffset ); - qualifiedName = new ASTQualifiedNamedElement( scope, typeName ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getTypeName() - */ - public String getName() - { - return typeName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#getClassKind() - */ - public ASTClassKind getClassKind() - { - return classKind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier#isResolved() - */ - public boolean isResolved() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptElaboratedForewardDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) { - offsets.setNameOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerationSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerationSpecifier.java deleted file mode 100644 index 8fad20630aa..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerationSpecifier.java +++ /dev/null @@ -1,151 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTEnumerationSpecifier extends ASTScopedTypeSpecifier - implements IASTEnumerationSpecifier, IASTOffsetableNamedElement -{ - private final String name; - private NamedOffsets offsets = new NamedOffsets(); - - /** - * @param name - * @param startingOffset - */ - public ASTEnumerationSpecifier(IASTScope scope, String name, int startingOffset, int nameOffset, int nameEndOffset ) - { - super( scope, name ); - this.name = name; - offsets.setNameOffset( nameOffset ); - offsets.setStartingOffset( startingOffset); - setNameEndOffset(nameEndOffset); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - private List enumerators = new ArrayList(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier#getEnumerators() - */ - public Iterator getEnumerators() - { - return Collections.unmodifiableList( enumerators ).iterator(); - } - - public void addEnumerator(IASTEnumerator enumerator) - { - enumerators.add(enumerator); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptEnumerationSpecifier(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerator.java deleted file mode 100644 index 776ec65bb53..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTEnumerator.java +++ /dev/null @@ -1,145 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTEnumerator - implements IASTEnumerator, IASTOffsetableNamedElement -{ - private final IASTExpression initialValue; - private final String name; - private final IASTEnumerationSpecifier enumeration; - private final NamedOffsets offsets = new NamedOffsets(); - - /** - * @param enumeration - * @param string - * @param startingOffset - * @param endingOffset - */ - public ASTEnumerator(IASTEnumerationSpecifier enumeration, String string, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset, IASTExpression initialValue) - { - this.enumeration = enumeration; - name = string; - offsets.setStartingOffset( startingOffset ); - offsets.setNameOffset( nameOffset ); - offsets.setNameEndOffset( nameEndOffset ); - offsets.setEndingOffset( endingOffset ); - this.initialValue = initialValue; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTEnumerator#getOwnerEnumerationSpecifier() - */ - public IASTEnumerationSpecifier getOwnerEnumerationSpecifier() - { - return enumeration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTEnumerator#getInitialValue() - */ - public IASTExpression getInitialValue() - { - return initialValue; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExceptionSpecification.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExceptionSpecification.java deleted file mode 100644 index d7930d9203c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExceptionSpecification.java +++ /dev/null @@ -1,67 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; - -/** - * @author jcamelon - * - */ -public class ASTExceptionSpecification implements IASTExceptionSpecification -{ - private final List typeIds; - /** - * @param typeIds - */ - public ASTExceptionSpecification(List typeIds) - { - Iterator i = typeIds.iterator(); - this.typeIds = new ArrayList(); - while( i.hasNext() ) - this.typeIds.add( ((IASTTypeId)i.next()).getTypeOrClassName()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification#getTypeIds() - */ - public Iterator getTypeIds() - { - return typeIds.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java deleted file mode 100644 index 018d72bda84..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Created on Jun 26, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.ExpressionEvaluationException; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; - - - -/** - * @author jcamelon - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ASTExpression implements IASTExpression { - - private final Kind kind; - private final IASTExpression lhs, rhs, third; - private final IASTTypeId typeId; - private final String literal, idExpression; - private final IASTNewExpressionDescriptor newDescriptor; - - /** - * @param kind - * @param lhs - * @param rhs - * @param id - * @param typeId - * @param literal - */ - public ASTExpression(Kind kind, IASTExpression lhs, IASTExpression rhs, IASTExpression third, IASTTypeId typeId, String idExpression, String literal, IASTNewExpressionDescriptor newDescriptor) { - this.kind = kind; - this.lhs =lhs; - this.rhs = rhs; - this.third = third; - this.typeId = typeId; - this.literal = literal; - this.newDescriptor = newDescriptor; - this.idExpression = idExpression; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getExpressionKind() - */ - public Kind getExpressionKind() { - return kind; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getLHSExpression() - */ - public IASTExpression getLHSExpression() { - return lhs; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getRHSExpression() - */ - public IASTExpression getRHSExpression() { - return rhs; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getLiteralString() - */ - public String getLiteralString() { - return literal; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getTypeId() - */ - public IASTTypeId getTypeId() { - return typeId; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getNewExpressionDescriptor() - */ - public IASTNewExpressionDescriptor getNewExpressionDescriptor() { - return newDescriptor; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getThirdExpression() - */ - public IASTExpression getThirdExpression() { - return third; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#evaluateExpression() - */ - public int evaluateExpression() throws ExpressionEvaluationException { - // primary expressions - if( getExpressionKind() == IASTExpression.Kind.PRIMARY_INTEGER_LITERAL ) - { - try - { - if( getLiteralString().startsWith( "0x") || getLiteralString().startsWith( "0x") ) - { - return Integer.parseInt( getLiteralString().substring(2), 16 ); - } - if( getLiteralString().startsWith( "0") && getLiteralString().length() > 1 ) - return Integer.parseInt( getLiteralString().substring(1), 8 ); - return Integer.parseInt( getLiteralString() ); - } - catch( NumberFormatException nfe ) - { - throw new ExpressionEvaluationException(); - } - } - if( getExpressionKind() == IASTExpression.Kind.PRIMARY_BRACKETED_EXPRESSION ) - return getLHSExpression().evaluateExpression(); - // unary not - if( getExpressionKind() == IASTExpression.Kind.UNARY_NOT_CASTEXPRESSION ) - return ( ( getLHSExpression().evaluateExpression() == 0 ) ? 1 : 0 ); - - // multiplicative expressions - if( getExpressionKind() == IASTExpression.Kind.MULTIPLICATIVE_MULTIPLY ) - return ( getLHSExpression().evaluateExpression() * getRHSExpression().evaluateExpression()) ; - if( getExpressionKind() == IASTExpression.Kind.MULTIPLICATIVE_DIVIDE ) - return ( getLHSExpression().evaluateExpression() / getRHSExpression().evaluateExpression()) ; - if( getExpressionKind() == IASTExpression.Kind.MULTIPLICATIVE_MODULUS ) - return ( getLHSExpression().evaluateExpression() % getRHSExpression().evaluateExpression()) ; - // additives - if( getExpressionKind() == IASTExpression.Kind.ADDITIVE_PLUS ) - return ( getLHSExpression().evaluateExpression() + getRHSExpression().evaluateExpression()) ; - if( getExpressionKind() == IASTExpression.Kind.ADDITIVE_MINUS ) - return ( getLHSExpression().evaluateExpression() - getRHSExpression().evaluateExpression()) ; - // shift expression - if( getExpressionKind() == IASTExpression.Kind.SHIFT_LEFT ) - return ( getLHSExpression().evaluateExpression() << getRHSExpression().evaluateExpression()) ; - if( getExpressionKind() == IASTExpression.Kind.SHIFT_RIGHT ) - return ( getLHSExpression().evaluateExpression() >> getRHSExpression().evaluateExpression()) ; - // relational - if( getExpressionKind() == IASTExpression.Kind.RELATIONAL_LESSTHAN ) - return ( getLHSExpression().evaluateExpression() < getRHSExpression().evaluateExpression() ? 1 : 0 ) ; - if( getExpressionKind() == IASTExpression.Kind.RELATIONAL_GREATERTHAN ) - return ( getLHSExpression().evaluateExpression() > getRHSExpression().evaluateExpression() ? 1 : 0 ) ; - if( getExpressionKind() == IASTExpression.Kind.RELATIONAL_LESSTHANEQUALTO ) - return ( getLHSExpression().evaluateExpression() <= getRHSExpression().evaluateExpression() ? 1 : 0 ) ; - if( getExpressionKind() == IASTExpression.Kind.RELATIONAL_GREATERTHANEQUALTO ) - return ( getLHSExpression().evaluateExpression() >= getRHSExpression().evaluateExpression() ? 1 : 0 ) ; - // equality - if( getExpressionKind() == IASTExpression.Kind.EQUALITY_EQUALS ) - return ( getLHSExpression().evaluateExpression() == getRHSExpression().evaluateExpression() ? 1 : 0 ) ; - if( getExpressionKind() == IASTExpression.Kind.EQUALITY_NOTEQUALS ) - return ( getLHSExpression().evaluateExpression() != getRHSExpression().evaluateExpression() ? 1 : 0 ) ; - // and - if( getExpressionKind() == IASTExpression.Kind.ANDEXPRESSION ) - return ( getLHSExpression().evaluateExpression() & getRHSExpression().evaluateExpression() ) ; - // xor - if( getExpressionKind() == IASTExpression.Kind.EXCLUSIVEOREXPRESSION ) - return ( getLHSExpression().evaluateExpression() ^ getRHSExpression().evaluateExpression() ) ; - // or - if( getExpressionKind() == IASTExpression.Kind.INCLUSIVEOREXPRESSION ) - return ( getLHSExpression().evaluateExpression() | getRHSExpression().evaluateExpression() ) ; - // logical and - if( getExpressionKind() == IASTExpression.Kind.LOGICALANDEXPRESSION ) - return( ( getLHSExpression().evaluateExpression() != 0 ) && ( getRHSExpression().evaluateExpression() != 0 ) ) ? 1 : 0 ; - // logical or - if( getExpressionKind() == IASTExpression.Kind.LOGICALOREXPRESSION ) - return( ( getLHSExpression().evaluateExpression() != 0 ) || ( getRHSExpression().evaluateExpression() != 0 ) ) ? 1 : 0 ; - - throw new ExpressionEvaluationException(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getIdExpression() - */ - public String getIdExpression() - { - return idExpression; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#reconcileReferences() - */ - public void reconcileReferences() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression#purgeReferences() - */ - public void purgeReferences() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java deleted file mode 100644 index f2112cda9cc..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTField.java +++ /dev/null @@ -1,85 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - * - */ -public class ASTField extends ASTVariable implements IASTField -{ - private final ASTAccessVisibility visibility; - - /** - * @param scope - * @param name - * @param isAuto - * @param initializerClause - * @param bitfieldExpression - * @param abstractDeclaration - * @param isMutable - * @param isExtern - * @param isRegister - * @param isStatic - */ - public ASTField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) - { - super( - scope, - name, - isAuto, - initializerClause, - bitfieldExpression, - abstractDeclaration, - isMutable, - isExtern, - isRegister, - isStatic, startingOffset, nameOffset, nameEndOffset, constructorExpression ); - this.visibility = visibility; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMember#getVisiblity() - */ - public ASTAccessVisibility getVisiblity() - { - return visibility; - } - - public void acceptElement( ISourceElementRequestor requestor ) - { - try - { - requestor.acceptField( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - public void enterScope( ISourceElementRequestor requestor ) - { - } - - public void exitScope( ISourceElementRequestor requestor ) - { - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java deleted file mode 100644 index d96d63e4545..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java +++ /dev/null @@ -1,291 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTFunction extends ASTDeclaration implements IASTFunction -{ - /** - * @param scope - */ - public ASTFunction(IASTScope scope, String name, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, - boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean hasFunctionTryBlock, boolean hasVarArgs ) - { - super(ownerTemplate != null ? null : scope ); - this.name = name; - this.parms = parameters; - this.returnType = returnType; - this.exceptionSpec = exception; - this.isInline = isInline; - this.isFriend = isFriend; - this.isStatic = isStatic; - this.ownerTemplateDeclaration = ownerTemplate; - if( ownerTemplate != null ) - ownerTemplate.setOwnedDeclaration( this ); - offsets.setStartingOffset( startOffset ); - offsets.setNameOffset( nameOffset ); - qualifiedName = new ASTQualifiedNamedElement( scope, name ); - setNameEndOffset(nameEndOffset); - this.hasFunctionTryBlock = hasFunctionTryBlock; - this.varArgs = hasVarArgs; - } - - private boolean previouslyDeclared; - private boolean hasFunctionBody = false; - private final IASTQualifiedNameElement qualifiedName; - private final IASTTemplate ownerTemplateDeclaration; - private NamedOffsets offsets = new NamedOffsets(); - private List declarations = new ArrayList(); - private final IASTExceptionSpecification exceptionSpec; - private final String name; - private final List parms; - private final IASTAbstractDeclaration returnType; - private final boolean isInline, isFriend, isStatic; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isInline() - */ - public boolean isInline() - { - return isInline; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isFriend() - */ - public boolean isFriend() - { - return isFriend; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#isStatic() - */ - public boolean isStatic() - { - return isStatic; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getReturnType() - */ - public IASTAbstractDeclaration getReturnType() - { - return returnType; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getParameters() - */ - public Iterator getParameters() - { - return parms.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#getExceptionSpec() - */ - public IASTExceptionSpecification getExceptionSpec() - { - return exceptionSpec; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset( o ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplatedDeclaration#getOwnerTemplateDeclaration() - */ - public IASTTemplate getOwnerTemplateDeclaration() - { - return ownerTemplateDeclaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() - { - return declarations.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptFunctionDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterFunctionBody( this ); - } - catch (Exception e) - { - /* do nothing */ - } - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitFunctionBody( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionBody(boolean) - */ - public void setHasFunctionBody(boolean b) { - hasFunctionBody = true; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionBody() - */ - public boolean hasFunctionBody() { - return hasFunctionBody; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getOwnerCodeScope() - */ - public IASTCodeScope getOwnerCodeScope() - { - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#previouslyDeclared() - */ - public boolean previouslyDeclared() - { - return previouslyDeclared; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } - - private boolean hasFunctionTryBlock = false; - private final boolean varArgs; - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionTryBlock(boolean) - */ - public void setHasFunctionTryBlock(boolean b) - { - hasFunctionTryBlock = b; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionTryBlock() - */ - public boolean hasFunctionTryBlock() - { - return hasFunctionTryBlock; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFunction#takesVarArgs() - */ - public boolean takesVarArgs() { - return varArgs; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java deleted file mode 100644 index 59a0997b21f..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTInitializerClause.java +++ /dev/null @@ -1,112 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; - -/** - * @author jcamelon - */ -public class ASTInitializerClause implements IASTInitializerClause { - - private final IASTInitializerClause.Kind kind; - private final IASTExpression assignmentExpression; - private final List initializerClauses; - private final List designators; - private IASTVariable ownerDeclaration = null; - /** - * @param kind - * @param assignmentExpression - * @param initializerClauses - */ - public ASTInitializerClause(Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators ) { - this.kind = kind; - this.assignmentExpression = assignmentExpression; - this.initializerClauses = initializerClauses; - this.designators = designators; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getKind() - */ - public Kind getKind() { - return kind; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getInitializerList() - */ - public Iterator getInitializers() { - if( initializerClauses == null ) - return new EmptyIterator(); - return initializerClauses.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getAssigmentExpression() - */ - public IASTExpression getAssigmentExpression() { - return assignmentExpression; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getDesignators() - */ - public Iterator getDesignators() - { - return designators.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#setOwnerDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnerVariableDeclaration(IASTVariable declaration) - { - ownerDeclaration = declaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTInitializerClause#getOwnerDeclaration() - */ - public IASTVariable getOwnerVariableDeclaration() - { - return ownerDeclaration; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTLinkageSpecification.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTLinkageSpecification.java deleted file mode 100644 index 1bd65a51802..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTLinkageSpecification.java +++ /dev/null @@ -1,128 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTLinkageSpecification - extends ASTDeclaration - implements IASTDeclaration, IASTLinkageSpecification, IASTQScope { - - private final String linkage; - - public ASTLinkageSpecification( IASTScope scope, String linkage, int startingOffset ) - { - super( scope ); - this.linkage = linkage; - setStartingOffset(startingOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification#getLinkageString() - */ - public String getLinkageString() { - return linkage; - } - - private List declarations = new ArrayList(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() { - return declarations.iterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQScope#addDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void addDeclaration(IASTDeclaration declaration) { - declarations.add( declaration ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - private Offsets offsets = new Offsets(); - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterLinkageSpecification(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitLinkageSpecification(this); - } - catch (Exception e) - { - /* do nothing */ - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java deleted file mode 100644 index eca84f1c592..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java +++ /dev/null @@ -1,213 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.EmptyIterator; -/** - * @author jcamelon - * - */ -public class ASTMethod extends ASTFunction implements IASTMethod -{ - private final List constructorChainElements; - private final boolean isConst; - private final boolean isDestructor; - private final boolean isConstructor; - private final boolean isExplicit; - private final boolean isPureVirtual; - private final boolean isVirtual; - private final boolean isVolatile; - private final ASTAccessVisibility visibility; - private final IASTQualifiedNameElement qualifiedName; - /** - * @param scope - * @param name - * @param parameters - * @param returnType - * @param exception - * @param isInline - * @param isFriend - * @param isStatic - * @param startOffset - * @param nameOffset - * @param ownerTemplate - */ - public ASTMethod( - IASTScope scope, - String name, - int nameEndOffset, - List parameters, - IASTAbstractDeclaration returnType, - IASTExceptionSpecification exception, - boolean isInline, - boolean isFriend, - boolean isStatic, - int startOffset, - int nameOffset, - IASTTemplate ownerTemplate, - boolean isConst, - boolean isVolatile, - boolean isConstructor, - boolean isDestructor, - boolean isVirtual, - boolean isExplicit, - boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChainElements, - boolean hasFunctionTryBlock, boolean hasVarArgs ) - { - super( - scope, - name, - nameEndOffset, - parameters, - returnType, - exception, - isInline, - isFriend, - isStatic, - startOffset, - nameOffset, - ownerTemplate, hasFunctionTryBlock, hasVarArgs); - this.isVirtual = isVirtual; - this.isPureVirtual = isPureVirtual; - this.isConstructor = isConstructor; - this.isDestructor = isDestructor; - this.isExplicit = isExplicit; - this.isConst = isConst; - this.isVolatile = isVolatile; - this.visibility = visibility; - this.constructorChainElements = constructorChainElements; - qualifiedName = new ASTQualifiedNamedElement( scope, name ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVirtual() - */ - public boolean isVirtual() - { - return isVirtual; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isExplicit() - */ - public boolean isExplicit() - { - // TODO Auto-generated method stub - return isExplicit; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isConstructor() - */ - public boolean isConstructor() - { - return isConstructor; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isDestructor() - */ - public boolean isDestructor() - { - return isDestructor; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isConst() - */ - public boolean isConst() - { - return isConst; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isVolatile() - */ - public boolean isVolatile() - { - return isVolatile; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#isPureVirtual() - */ - public boolean isPureVirtual() - { - return isPureVirtual; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMember#getVisiblity() - */ - public ASTAccessVisibility getVisiblity() - { - return visibility; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMember#getOwnerClassSpecifier() - */ - - - public void acceptElement( ISourceElementRequestor requestor ) - { - try - { - requestor.acceptMethodDeclaration( this ); - } - catch (Exception e) - { - /* do nothing */ - } - } - - public void enterScope( ISourceElementRequestor requestor ) - { - try - { - requestor.enterMethodBody(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - public void exitScope( ISourceElementRequestor requestor ) - { - try - { - requestor.exitMethodBody(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTMethod#getConstructorChainInitializers() - */ - public Iterator getConstructorChainInitializers() - { - if( constructorChainElements == null ) - return new EmptyIterator(); - return constructorChainElements.iterator(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceAlias.java deleted file mode 100644 index 34e5017885e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceAlias.java +++ /dev/null @@ -1,148 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTNamespaceAlias extends ASTDeclaration implements IASTNamespaceAlias -{ - - private final String alias; - private final String identifier; - private NamedOffsets offsets = new NamedOffsets(); - /** - * @param scope - * @param identifier - * @param string - * @param startingOffset - * @param nameOffset - * @param endOffset - */ - public ASTNamespaceAlias(IASTScope scope, String identifier, String string, int startingOffset, int nameOffset, int nameEndOffset, int endOffset) - { - super( scope ); - setStartingOffset(startingOffset); - setNameOffset(nameOffset); - setNameEndOffset( nameEndOffset ); - setEndingOffset(endOffset); - this.identifier = identifier; - this.alias = string; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias#getAlias() - */ - public String getAlias() - { - return alias; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias#getNamespace() - */ - public IASTNamespaceDefinition getNamespace() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() - { - return identifier; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java deleted file mode 100644 index 12ed9c28859..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNamespaceDefinition.java +++ /dev/null @@ -1,162 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTNamespaceDefinition extends ASTDeclaration implements IASTNamespaceDefinition, IASTQScope { - - private final String name; - private NamedOffsets offsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedNameElement; - - public ASTNamespaceDefinition( IASTScope scope, String name, int startOffset, int nameOffset, int nameEndOffset ) - { - super( scope ); - qualifiedNameElement = new ASTQualifiedNamedElement( scope, name ); - this.name = name; - setStartingOffset(startOffset); - setNameOffset(nameOffset); - setNameEndOffset(nameEndOffset); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getName() - */ - public String getName() { - return name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() { - return offsets.getNameOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) { - offsets.setNameOffset( o ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) { - offsets.setStartingOffset(o); - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) { - offsets.setEndingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() { - return offsets.getEndingOffset(); - } - - private List declarations = new ArrayList(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScope#getDeclarations() - */ - public Iterator getDeclarations() { - return declarations.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.quick.IASTQScope#addDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void addDeclaration(IASTDeclaration declaration) { - declarations.add( declaration ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedNameElement.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterNamespaceDefinition(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitNamespaceDefinition(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java deleted file mode 100644 index 47973901ccd..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNewDescriptor.java +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor; - -/** - * @author jcamelon - */ -public class ASTNewDescriptor implements IASTNewExpressionDescriptor { - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getNewInitializerExpressions() - */ - public Iterator getNewInitializerExpressions() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getNewPlacementExpressions() - */ - public Iterator getNewPlacementExpressions() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor#getTypeIdExpressions() - */ - public Iterator getNewTypeIdExpressions() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNode.java deleted file mode 100644 index 30f9933ef09..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTNode.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Created on 17/12/2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ast.IASTNode; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class ASTNode implements IASTNode { - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNode#lookup(java.lang.String, org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind[], org.eclipse.cdt.core.parser.ast.IASTNode) - */ - public LookupResult lookup( - String prefix, - LookupKind[] kind, - IASTNode context) - throws LookupException { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTParameterDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTParameterDeclaration.java deleted file mode 100644 index aecd00e5fa5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTParameterDeclaration.java +++ /dev/null @@ -1,121 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.ASTAbstractDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTParameterDeclaration extends ASTAbstractDeclaration implements IASTParameterDeclaration -{ - private final NamedOffsets offsets = new NamedOffsets(); - private final String parameterName; - private final IASTInitializerClause initializerClause; - /** - * @param isConst - * @param typeSpecifier - * @param pointerOperators - * @param arrayModifiers - * @param parameterName - * @param initializerClause - */ - public ASTParameterDeclaration(boolean isConst, boolean isVolatile, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int endingOffset, int nameOffset, int nameEndOffset ) - { - super( isConst, isVolatile, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOp ); - this.parameterName = parameterName; - this.initializerClause = initializerClause; - setStartingOffset( startingOffset ); - setEndingOffset( endingOffset ); - setNameOffset( nameOffset ); - setNameEndOffset(nameEndOffset); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration#getName() - */ - public String getName() - { - return parameterName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration#getDefaultValue() - */ - public IASTInitializerClause getDefaultValue() - { - return initializerClause; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java deleted file mode 100644 index 535ad6c7928..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTScopedTypeSpecifier.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTScopedTypeSpecifier; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; - -/** - * @author jcamelon - * - */ -public class ASTScopedTypeSpecifier extends ASTQualifiedNamedElement implements IASTScopedTypeSpecifier -{ - private final IASTScope scope; - - public ASTScopedTypeSpecifier( IASTScope scope, String name ) - { - super( scope, name ); - this.scope = scope; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTScopedElement#getOwnerScope() - */ - public IASTScope getOwnerScope() - { - return scope; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTNode#lookup(java.lang.String, org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind[], org.eclipse.cdt.core.parser.ast.IASTNode) - */ - public LookupResult lookup( - String prefix, - LookupKind[] kind, - IASTNode context) - throws LookupException { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java deleted file mode 100644 index 6cd92feeef5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTSimpleTypeSpecifier.java +++ /dev/null @@ -1,195 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.Hashtable; -import java.util.Map; - -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; - -/** - * @author jcamelon - * - */ -public class ASTSimpleTypeSpecifier extends ASTNode implements IASTSimpleTypeSpecifier -{ - private final boolean imaginary; - private final boolean complex; - private final boolean isTypename; - private final Type kind; - private final String typeName; - private final boolean isLong, isShort, isSigned, isUnsigned; - - private static final Map nameMap; - static - { - nameMap = new Hashtable(); - nameMap.put( Type.BOOL, "bool"); - nameMap.put( Type.CHAR, "char"); - nameMap.put( Type.DOUBLE, "double"); - nameMap.put( Type.FLOAT, "float"); - nameMap.put( Type.INT, "int"); - nameMap.put( Type.VOID, "void" ); - nameMap.put( Type.WCHAR_T, "wchar_t" ); - nameMap.put( Type._BOOL, "_Bool"); - } - /** - * @param kind - * @param typeName - */ - public ASTSimpleTypeSpecifier(Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary ) - { - this.kind = kind; - this.isLong = isLong; - this.isShort = isShort; - this.isSigned = isSigned; - this.isUnsigned = isUnsigned; - this.isTypename = isTypename; - this.complex = isComplex; - this.imaginary = isImaginary; - - StringBuffer type = new StringBuffer(); - if( this.kind == IASTSimpleTypeSpecifier.Type.CHAR || this.kind == IASTSimpleTypeSpecifier.Type.WCHAR_T ) - { - if (isUnsigned()) - type.append("unsigned "); - type.append( (String)nameMap.get( this.kind )); - } - else if( this.kind == Type.BOOL || this.kind == Type.VOID || this.kind == Type._BOOL ) - { - type.append( (String) nameMap.get( this.kind )); - } - else if( this.kind == Type.INT ) - { - if (isUnsigned()) - type.append("unsigned "); - if (isShort()) - type.append("short "); - if (isLong()) - type.append("long "); - type.append( (String)nameMap.get( this.kind )); - } - else if( this.kind == Type.FLOAT ) - { - type.append( (String)nameMap.get( this.kind )); - if( isComplex() ) - type.append( "_Complex" ); - else if( isImaginary() ) - type.append( "_Imaginary" ); - } - else if( this.kind == Type.DOUBLE ) - { - if (isLong()) - type.append("long "); - type.append( (String)nameMap.get( this.kind )); - if( isComplex() ) - type.append( "_Complex" ); - else if( isImaginary() ) - type.append( "_Imaginary" ); - } - else if( this.kind == Type.CLASS_OR_TYPENAME || this.kind == Type.TEMPLATE ) - { - if (isTypename() ) - type.append("typename "); - type.append(typeName.toString()); - } - else if( this.kind == Type.UNSPECIFIED ) - { - if (isUnsigned()) - type.append("unsigned "); - if (isShort()) - type.append("short "); - if (isLong()) - type.append("long "); - if (isSigned()) - type.append("signed "); - } - this.typeName = type.toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#getType() - */ - public Type getType() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#getTypename() - */ - public String getTypename() - { - return typeName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isLong() - */ - public boolean isLong() - { - return isLong; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isShort() - */ - public boolean isShort() - { - return isShort; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isSigned() - */ - public boolean isSigned() - { - return isSigned; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isUnsigned() - */ - public boolean isUnsigned() - { - return isUnsigned; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isTypename() - */ - public boolean isTypename() - { - return isTypename; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#getTypeSpecifier() - */ - public IASTTypeSpecifier getTypeSpecifier() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isComplex() - */ - public boolean isComplex() - { - return complex; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier#isImaginary() - */ - public boolean isImaginary() - { - return imaginary; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateDeclaration.java deleted file mode 100644 index 207ce880c2c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateDeclaration.java +++ /dev/null @@ -1,139 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTTemplateDeclaration extends ASTDeclaration implements IASTTemplateDeclaration -{ - private IASTDeclaration ownedDeclaration; - private List templateParameters; - private Offsets offsets = new Offsets(); - private final boolean isExported; - /** - * @param templateParameters - */ - public ASTTemplateDeclaration(IASTScope scope, List templateParameters, int startingOffset, boolean isExported) - { - super( scope ); - this.templateParameters = templateParameters; - setStartingOffset(startingOffset); - this.isExported = isExported; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#getTemplateParameters() - */ - public Iterator getTemplateParameters() - { - return templateParameters.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#getOwnedDeclaration() - */ - public IASTDeclaration getOwnedDeclaration() - { - return ownedDeclaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnedDeclaration(IASTDeclaration declaration) - { - ownedDeclaration = declaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration#isExported() - */ - public boolean isExported() - { - return isExported; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterTemplateDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitTemplateDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateInstantiation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateInstantiation.java deleted file mode 100644 index 6287b6a8420..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateInstantiation.java +++ /dev/null @@ -1,122 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTTemplateInstantiation extends ASTDeclaration implements IASTTemplateInstantiation -{ - private IASTDeclaration declaration; - private Offsets offsets = new Offsets(); - - /** - * @param scope - */ - public ASTTemplateInstantiation(IASTScope scope, int startingOffset) - { - super( scope ); - setStartingOffset(startingOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration() - */ - public IASTDeclaration getOwnedDeclaration() - { - return declaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnedDeclaration(IASTDeclaration declaration) - { - this.declaration = declaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset( o ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterTemplateInstantiation(this); - } - catch (Exception e) - { - /* do nothing */ - } - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitTemplateExplicitInstantiation(this); - } - catch (Exception e) - { - /* do nothing */ - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateParameter.java deleted file mode 100644 index 93886eefea0..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateParameter.java +++ /dev/null @@ -1,79 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter; - -/** - * @author jcamelon - * - */ -public class ASTTemplateParameter implements IASTTemplateParameter -{ - private final List templateParms; - private final IASTParameterDeclaration parameter; - private final ParamKind kind; - private final String identifier; - private final String defaultValue; - /** - * @param kind - * @param identifier - * @param defaultValue - * @param parameter - */ - public ASTTemplateParameter(ParamKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List templateParms) - { - this.kind = kind; - this.identifier = identifier; - this.defaultValue = defaultValue; - this.parameter = parameter; - this.templateParms = templateParms; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getTemplateParameterKind() - */ - public ParamKind getTemplateParameterKind() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getIdentifier() - */ - public String getIdentifier() - { - return identifier; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getDefaultValueIdExpression() - */ - public String getDefaultValueIdExpression() - { - return defaultValue; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameterList#getTemplateParameters() - */ - public Iterator getTemplateParameters() - { - return templateParms.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplateParameter#getParameterDeclaration() - */ - public IASTParameterDeclaration getParameterDeclaration() - { - return parameter; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateSpecialization.java deleted file mode 100644 index 9ff0d909120..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTemplateSpecialization.java +++ /dev/null @@ -1,116 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTTemplateSpecialization extends ASTDeclaration implements IASTTemplateSpecialization -{ - private Offsets offsets = new Offsets(); - private IASTDeclaration ownedDeclaration; - /** - * @param scope - */ - public ASTTemplateSpecialization(IASTScope scope, int startingOffset ) - { - super(scope); - setStartingOffset(startingOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#getOwnedDeclaration() - */ - public IASTDeclaration getOwnedDeclaration() - { - return ownedDeclaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTemplate#setOwnedDeclaration(org.eclipse.cdt.core.parser.ast.IASTDeclaration) - */ - public void setOwnedDeclaration(IASTDeclaration declaration) - { - ownedDeclaration = declaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - try - { - requestor.enterTemplateSpecialization(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - try - { - requestor.exitTemplateSpecialization(this); - } - catch (Exception e) - { - /* do nothing */ - } - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypeId.java deleted file mode 100644 index b8ad5bbff5d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypeId.java +++ /dev/null @@ -1,169 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type; -import org.eclipse.cdt.internal.core.parser.pst.ISymbol; - -/** - * @author jcamelon - * - */ -public class ASTTypeId implements IASTTypeId -{ - private final boolean isVolatile; - private final boolean isUnsigned; - private final boolean isTypeName; - private final boolean isSigned; - private final boolean isShort; - private final boolean isLong; - private final boolean isConst; - private final Type kind; - private final String name; - private final List pointerOps; - private final List arrayMods; - /** - * @param kind - * @param string - * @param pointerOps - * @param arrayMods - */ - public ASTTypeId(Type kind, String string, List pointerOps, List arrayMods, boolean isConst, boolean isVolatile, - boolean isUnsigned, boolean isSigned, boolean isShort, boolean isLong, boolean isTypeName) - { - this.kind = kind; - this.name = string; - this.pointerOps = pointerOps; - this.arrayMods = arrayMods; - this.isVolatile =isVolatile; - this.isUnsigned =isUnsigned; - this.isTypeName =isTypeName; - this.isSigned =isSigned; - this.isShort =isShort; - this.isLong =isLong; - this.isConst =isConst; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getKind() - */ - public Type getKind() - { - return kind; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getType() - */ - public String getTypeOrClassName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getPointerOperators() - */ - public Iterator getPointerOperators() - { - return pointerOps.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getArrayModifiers() - */ - public Iterator getArrayModifiers() - { - return arrayMods.iterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getFullSignature() - */ - public String getFullSignature() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#createTypeSymbol(org.eclipse.cdt.core.parser.ast.IASTFactory) - */ - public ISymbol getTypeSymbol() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isConst() - */ - public boolean isConst() - { - return isConst; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isVolatile() - */ - public boolean isVolatile() - { - return isVolatile; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isLong() - */ - public boolean isLong() - { - return isLong; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isShort() - */ - public boolean isShort() - { - return isShort; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isSigned() - */ - public boolean isSigned() - { - return isSigned; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isUnsigned() - */ - public boolean isUnsigned() - { - return isUnsigned; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypeId#isTypename() - */ - public boolean isTypename() - { - return isTypeName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#acceptElement(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enterScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exitScope(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java deleted file mode 100644 index 2625f158845..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTTypedefDeclaration.java +++ /dev/null @@ -1,150 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTTypedefDeclaration extends ASTDeclaration implements IASTTypedefDeclaration -{ - private final String name; - private final IASTAbstractDeclaration mapping; - private NamedOffsets offsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedName; - /** - * @param scope - * @param name - * @param mapping - */ - public ASTTypedefDeclaration(IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, int nameEndOffset ) - { - super( scope ); - this.name = name; - this.mapping = mapping; - setStartingOffset(startingOffset); - setNameOffset(nameOffset); - setNameEndOffset(nameEndOffset); - qualifiedName = new ASTQualifiedNamedElement( scope, name ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypedef#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTTypedef#getAbstractDeclarator() - */ - public IASTAbstractDeclaration getAbstractDeclarator() - { - return mapping; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptTypedefDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDeclaration.java deleted file mode 100644 index a4c80cb17cf..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDeclaration.java +++ /dev/null @@ -1,115 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTUsingDeclaration - extends ASTDeclaration - implements IASTUsingDeclaration { - - private final boolean isTypename; - private final String mappingName; - - public ASTUsingDeclaration( IASTScope scope, boolean isTypeName, String mappingName, int startingOffset, int endingOffset ) - { - super( scope ); - isTypename = isTypeName; - this.mappingName = mappingName; - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#isTypename() - */ - public boolean isTypename() { - return isTypename; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#usingTypeName() - */ - public String usingTypeName() { - return mappingName; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - private Offsets offsets = new Offsets(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptUsingDeclaration(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration#getUsingType() - */ - public IASTDeclaration getUsingType() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDirective.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDirective.java deleted file mode 100644 index 27b691292b5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTUsingDirective.java +++ /dev/null @@ -1,107 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.internal.core.parser.ast.Offsets; - -/** - * @author jcamelon - * - */ -public class ASTUsingDirective - extends ASTDeclaration - implements IASTUsingDirective { - - - public ASTUsingDirective( IASTScope scope, String name, int startingOffset, int endingOffset ) - { - super( scope ); - this.namespaceName = name; - setStartingOffset(startingOffset); - setEndingOffset(endingOffset); - - } - private final String namespaceName; - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDirective#getNamespaceName() - */ - public String getNamespaceName() { - return namespaceName; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - private Offsets offsets = new Offsets(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptUsingDirective(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTUsingDirective#getNamespaceDefinition() - */ - public IASTNamespaceDefinition getNamespaceDefinition() throws ASTNotImplementedException - { - throw new ASTNotImplementedException(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java deleted file mode 100644 index 44ff158a80c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTVariable.java +++ /dev/null @@ -1,231 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement; -import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets; - -/** - * @author jcamelon - * - */ -public class ASTVariable extends ASTDeclaration implements IASTVariable -{ - private IASTExpression constructorExpression; - private final boolean isAuto; - private final IASTInitializerClause initializerClause; - private final IASTExpression bitfieldExpression; - private final IASTAbstractDeclaration abstractDeclaration; - private final boolean isMutable; - private final boolean isExtern; - private final boolean isRegister; - private final boolean isStatic; - private final String name; - private NamedOffsets offsets = new NamedOffsets(); - private final ASTQualifiedNamedElement qualifiedName; - /** - * @param scope - */ - public ASTVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, - IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression ) - { - super(scope); - this.isAuto = isAuto; - this.initializerClause = initializerClause; - this.bitfieldExpression = bitfieldExpression; - this.abstractDeclaration = abstractDeclaration; - this.isMutable= isMutable; - this.isExtern = isExtern; - this.isRegister = isRegister; - this.isStatic = isStatic; - this.name = name; - this.constructorExpression = constructorExpression; - qualifiedName = new ASTQualifiedNamedElement( scope, name ); - setStartingOffset(startingOffset); - setNameOffset(nameOffset); - setNameEndOffset( nameEndOffset ); - if( initializerClause != null ) - initializerClause.setOwnerVariableDeclaration(this); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isAuto() - */ - public boolean isAuto() - { - return isAuto; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isRegister() - */ - public boolean isRegister() - { - return isRegister; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isStatic() - */ - public boolean isStatic() - { - return isStatic; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isExtern() - */ - public boolean isExtern() - { - return isExtern; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isMutable() - */ - public boolean isMutable() - { - return isMutable; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getAbstractDeclaration() - */ - public IASTAbstractDeclaration getAbstractDeclaration() - { - return abstractDeclaration; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getName() - */ - public String getName() - { - return name; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getInitializerClause() - */ - public IASTInitializerClause getInitializerClause() - { - return initializerClause; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#isBitfield() - */ - public boolean isBitfield() - { - return ( bitfieldExpression != null ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getBitfieldExpression() - */ - public IASTExpression getBitfieldExpression() - { - return bitfieldExpression; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffset(int) - */ - public void setStartingOffset(int o) - { - offsets.setStartingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffset(int) - */ - public void setEndingOffset(int o) - { - offsets.setEndingOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementStartingOffset() - */ - public int getStartingOffset() - { - return offsets.getStartingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getElementEndingOffset() - */ - public int getEndingOffset() - { - return offsets.getEndingOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getElementNameOffset() - */ - public int getNameOffset() - { - return offsets.getNameOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameOffset(int) - */ - public void setNameOffset(int o) - { - offsets.setNameOffset(o); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement#getFullyQualifiedName() - */ - public String[] getFullyQualifiedName() - { - return qualifiedName.getFullyQualifiedName(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#accept(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void acceptElement(ISourceElementRequestor requestor) - { - try - { - requestor.acceptVariable(this); - } - catch (Exception e) - { - /* do nothing */ - } - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#enter(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void enterScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate#exit(org.eclipse.cdt.core.parser.ISourceElementRequestor) - */ - public void exitScope(ISourceElementRequestor requestor) - { - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTVariable#getConstructorExpression() - */ - public IASTExpression getConstructorExpression() - { - return constructorExpression; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#getNameEndOffset() - */ - public int getNameEndOffset() - { - return offsets.getNameEndOffset(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement#setNameEndOffset(int) - */ - public void setNameEndOffset(int o) - { - offsets.setNameEndOffset(o); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java deleted file mode 100644 index 0d28deb31e8..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQClassSpecifier.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; - -/** - * @author jcamelon - * - */ -public interface IASTQClassSpecifier extends IASTClassSpecifier { - - public void addBaseClass( IASTBaseSpecifier baseSpecifier ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQScope.java deleted file mode 100644 index a0ce2007e5e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/IASTQScope.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import org.eclipse.cdt.core.parser.ast.IASTDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; - -/** - * @author jcamelon - * - */ -public interface IASTQScope extends IASTScope { - - public void addDeclaration( IASTDeclaration declaration ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java deleted file mode 100644 index c2cce2f696e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java +++ /dev/null @@ -1,328 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.ast.quick; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ITokenDuple; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.ASTSemanticException; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTConstructorMemberInitializer; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTFactory; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceAlias; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTemplate; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypeId; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType; -import org.eclipse.cdt.core.parser.ast.IASTExpression.IASTNewExpressionDescriptor; -import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type; -import org.eclipse.cdt.internal.core.parser.ast.BaseASTFactory; - -/** - - * @author jcamelon - * - */ -public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory { - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createUsingDirective(org.eclipse.cdt.internal.core.parser.ast.IASTScope, org.eclipse.cdt.internal.core.parser.TokenDuple) - */ - public IASTUsingDirective createUsingDirective(IASTScope scope, ITokenDuple duple, int startingOffset, int endingOffset) throws ASTSemanticException { - return new ASTUsingDirective( scope, duple.toString(), startingOffset, endingOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createASMDefinition(org.eclipse.cdt.internal.core.parser.ast.IASTScope, java.lang.String, int, int) - */ - public IASTASMDefinition createASMDefinition(IASTScope scope, String assembly, int first, int last) { - IASTASMDefinition definition = new ASTASMDefinition( scope, assembly ); - definition.setStartingOffset( first ); - definition.setEndingOffset( last ); - return definition; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createNamespaceDefinition(int, java.lang.String, int) - */ - public IASTNamespaceDefinition createNamespaceDefinition(IASTScope scope, String identifier, int first, int nameOffset, int nameEndOffset) { - IASTNamespaceDefinition definition = new ASTNamespaceDefinition( scope, identifier, first, nameOffset, nameEndOffset ); - return definition; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createCompilationUnit() - */ - public IASTCompilationUnit createCompilationUnit() { - return new ASTCompilationUnit(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.ast.IASTFactory#createLinkageSpecification(java.lang.String) - */ - public IASTLinkageSpecification createLinkageSpecification(IASTScope scope, String spec, int startingOffset) { - return new ASTLinkageSpecification( scope, spec, startingOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, boolean, org.eclipse.cdt.internal.core.parser.TokenDuple) - */ - public IASTUsingDeclaration createUsingDeclaration(IASTScope scope, boolean isTypeName, ITokenDuple name, int startingOffset, int endingOffset) { - return new ASTUsingDeclaration( scope, isTypeName, name.toString(), startingOffset, endingOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ClassKind, org.eclipse.cdt.core.parser.ast.ClassNameType, org.eclipse.cdt.core.parser.ast.AccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public IASTClassSpecifier createClassSpecifier(IASTScope scope, ITokenDuple name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, int startingOffset, int nameOffset, int nameEndOffset ) throws ASTSemanticException { - return new ASTClassSpecifier( scope, name == null ? "" : name.toString() , kind, type, startingOffset, nameOffset, nameEndOffset, access ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#addBaseSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier, boolean, org.eclipse.cdt.core.parser.ast.AccessVisibility, java.lang.String) - */ - public void addBaseSpecifier(IASTClassSpecifier astClassSpec, boolean isVirtual, ASTAccessVisibility visibility, ITokenDuple parentClassName) { - IASTBaseSpecifier baseSpecifier = new ASTBaseSpecifier( parentClassName.toString(), isVirtual, visibility, parentClassName.getFirstToken().getOffset() ); - ((IASTQClassSpecifier)astClassSpec).addBaseClass(baseSpecifier); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createEnumerationSpecifier(java.lang.String, int) - */ - public IASTEnumerationSpecifier createEnumerationSpecifier(IASTScope scope, String name, int startingOffset, int nameOffset, int nameEndOffset) - { - return new ASTEnumerationSpecifier( scope, name, startingOffset, nameOffset, nameEndOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#addEnumerator(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier, java.lang.String, int, int) - */ - public void addEnumerator(IASTEnumerationSpecifier enumeration, String string, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset, IASTExpression initialValue) - { - IASTEnumerator enumerator = new ASTEnumerator( enumeration, string, startingOffset, nameOffset, nameEndOffset, endingOffset, initialValue ); - ((ASTEnumerationSpecifier)enumeration).addEnumerator( enumerator ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createExpression(org.eclipse.cdt.core.parser.ast.IASTExpression.ExpressionKind, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTExpression, java.lang.String, java.lang.String, java.lang.String) - */ - public IASTExpression createExpression(IASTScope scope, Kind kind, IASTExpression lhs, IASTExpression rhs, IASTExpression thirdExpression, IASTTypeId typeId, ITokenDuple idExpression, String literal, IASTNewExpressionDescriptor newDescriptor) { - return new ASTExpression( kind, lhs, rhs, thirdExpression, typeId, idExpression == null ? "" : idExpression.toString(), literal, newDescriptor ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewDescriptor() - */ - public IASTNewExpressionDescriptor createNewDescriptor(List newPlacementEpressions, List newTypeIdExpressions, List newInitializerExpressions) { - return new ASTNewDescriptor(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createExceptionSpecification(java.util.List) - */ - public IASTExceptionSpecification createExceptionSpecification(IASTScope scope, List typeIds) - { - return new ASTExceptionSpecification( typeIds ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createConstructorMemberInitializer(org.eclipse.cdt.core.parser.ITokenDuple, org.eclipse.cdt.core.parser.ast.IASTExpression) - */ - public IASTConstructorMemberInitializer createConstructorMemberInitializer(IASTScope scope, ITokenDuple duple, IASTExpression expressionList ) - { - return new ASTConstructorMemberInitializer( duple.toString(), expressionList ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createSimpleTypeSpecifier(org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.SimpleType, org.eclipse.cdt.core.parser.ITokenDuple) - */ - public IASTSimpleTypeSpecifier createSimpleTypeSpecifier(IASTScope scope, Type kind, ITokenDuple typeName, boolean isShort, boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, boolean isComplex, boolean isImaginary ) - { - return new ASTSimpleTypeSpecifier( kind, typeName, isShort, isLong, isSigned, isUnsigned, isTypename, isComplex, isImaginary); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public IASTFunction createFunction(IASTScope scope, ITokenDuple name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) - { - return new ASTFunction(scope, name.toString(), nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, hasFunctionTryBlock, hasVariableArguments ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) - */ - public IASTMethod createMethod(IASTScope scope, ITokenDuple name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) - { - return new ASTMethod(scope, name.toString(), nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, false, false, isVirtual, isExplicit, isPureVirtual, visibility, constructorChain, hasFunctionTryBlock, hasVariableArguments); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createVariable(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean) - */ - public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression) - { - return new ASTVariable(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, nameEndOffset, constructorExpression); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createField(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, boolean, org.eclipse.cdt.core.parser.ast.IASTInitializerClause, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) - */ - public IASTField createField(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression, ASTAccessVisibility visibility) - { - final ASTField field = new ASTField(scope, name, isAuto, initializerClause, bitfieldExpression, abstractDeclaration, isMutable, isExtern, isRegister, isStatic, startingOffset, nameOffset, nameEndOffset, constructorExpression, visibility); - return field; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateDeclaration(java.util.List) - */ - public IASTTemplateDeclaration createTemplateDeclaration(IASTScope scope, List templateParameters, boolean exported, int startingOffset) - { - return new ASTTemplateDeclaration( scope, templateParameters, startingOffset, exported ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateParameter(org.eclipse.cdt.core.parser.ast.IASTTemplateParameter.ParameterKind, org.eclipse.cdt.core.parser.IToken, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration) - */ - public IASTTemplateParameter createTemplateParameter(IASTTemplateParameter.ParamKind kind, String identifier, String defaultValue, IASTParameterDeclaration parameter, List parms) - { - return new ASTTemplateParameter( kind, identifier, defaultValue, parameter, parms ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateInstantiation() - */ - public IASTTemplateInstantiation createTemplateInstantiation(IASTScope scope, int startingOffset) - { - return new ASTTemplateInstantiation(scope, startingOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTemplateSpecialization() - */ - public IASTTemplateSpecialization createTemplateSpecialization(IASTScope scope, int startingOffset) - { - return new ASTTemplateSpecialization(scope, startingOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypedef(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration) - */ - public IASTTypedefDeclaration createTypedef(IASTScope scope, String name, IASTAbstractDeclaration mapping, int startingOffset, int nameOffset, int nameEndOffset) - { - return new ASTTypedefDeclaration( scope, name, mapping, startingOffset, nameOffset, nameEndOffset); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTScope, boolean, org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier, java.util.List, java.util.List) - */ - public IASTAbstractTypeSpecifierDeclaration createTypeSpecDeclaration(IASTScope scope, IASTTypeSpecifier typeSpecifier, IASTTemplate template, int startingOffset, int endingOffset) - { - return new ASTAbstractTypeSpecifierDeclaration( scope, typeSpecifier, template, startingOffset, endingOffset ); - } - - public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(IASTScope scope, ASTClassKind elaboratedClassKind, ITokenDuple typeName, int startingOffset, int endOffset, boolean isForewardDecl, boolean isFriend) - { - return new ASTElaboratedTypeSpecifier( scope, elaboratedClassKind, typeName.toString(), startingOffset, typeName.getFirstToken().getOffset(), typeName.getLastToken().getEndOffset(), endOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNamespaceAlias(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ITokenDuple, int, int, int) - */ - public IASTNamespaceAlias createNamespaceAlias(IASTScope scope, String identifier, ITokenDuple alias, int startingOffset, int nameOffset, int nameEndOffset, int endOffset) - { - return new ASTNamespaceAlias( scope, identifier, alias.toString(), startingOffset, nameOffset, nameEndOffset, endOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createNewCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public IASTCodeScope createNewCodeBlock(IASTScope scope) { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#queryIsTypeName(org.eclipse.cdt.core.parser.ITokenDuple) - */ - public boolean queryIsTypeName(IASTScope scope, ITokenDuple nameInQuestion) { - return true; // we have no information to say that it is not - } - - public IASTParameterDeclaration createParameterDeclaration(boolean isConst, boolean isVolatile, IASTTypeSpecifier typeSpecifier, List pointerOperators, List arrayModifiers, List parameters, ASTPointerOperator pointerOp, String parameterName, IASTInitializerClause initializerClause, int startingOffset, int nameOffset, int nameEndOffset, int endingOffset) - { - return new ASTParameterDeclaration( isConst, isVolatile, typeSpecifier, pointerOperators, arrayModifiers, parameters, pointerOp, parameterName, initializerClause, startingOffset, endingOffset, nameOffset, nameEndOffset ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createTypeId(org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier.Type, org.eclipse.cdt.core.parser.ITokenDuple, java.util.List, java.util.List) - */ - public IASTTypeId createTypeId(IASTScope scope, Type kind, boolean isConst, boolean isVolatile, boolean isShort, - boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods) - { - return new ASTTypeId( kind, name == null ? "" : name.toString(), pointerOps, arrayMods, isConst, - isVolatile, isUnsigned, isSigned, isShort, isLong, isTypename ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#signalEndOfClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void signalEndOfClassSpecifier(IASTClassSpecifier astClassSpecifier) - { - } - - public IASTInitializerClause createInitializerClause(IASTScope scope, IASTInitializerClause.Kind kind, IASTExpression assignmentExpression, List initializerClauses, List designators) - { - return new ASTInitializerClause( kind, assignmentExpression, initializerClauses, designators ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ast.IASTFactory#getCompletionContext(org.eclipse.cdt.core.parser.ast.IASTExpression.Kind, org.eclipse.cdt.core.parser.ast.IASTExpression) - */ - public IASTNode getCompletionContext(Kind kind, IASTExpression expression) { - //we have no cross-reference information about the type of the expression - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/AbstractSymbolExtension.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/AbstractSymbolExtension.java deleted file mode 100644 index 582a3535e3c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/AbstractSymbolExtension.java +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol; - -/** - * @author jcamelon - * - */ -public abstract class AbstractSymbolExtension implements ISymbolASTExtension -{ - protected final ISymbol symbol; - protected final ASTSymbol primaryDeclaration; - - /** - * - */ - public AbstractSymbolExtension( ISymbol symbol, ASTSymbol primaryDeclaration ) - { - this.symbol = symbol; - this.primaryDeclaration = primaryDeclaration; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolOwner#getSymbol() - */ - public ISymbol getSymbol() - { - return symbol; - } - - public ASTSymbol getPrimaryDeclaration() - { - return primaryDeclaration; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/BasicSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/BasicSymbol.java deleted file mode 100644 index 00521aecc7e..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/BasicSymbol.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Created on Nov 4, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; - - - -public class BasicSymbol implements Cloneable, ISymbol -{ - private final ParserSymbolTable _table; - public BasicSymbol( ParserSymbolTable table, String name ){ - super(); - this._table = table; - _name = name; - _typeInfo = new TypeInfo(); - } - - public BasicSymbol( ParserSymbolTable table, String name, ISymbolASTExtension obj ){ - super(); - this._table = table; - _name = name; - _object = obj; - _typeInfo = new TypeInfo(); - } - - public BasicSymbol( ParserSymbolTable table, String name, TypeInfo.eType typeInfo ) - { - super(); - this._table = table; - _name = name; - _typeInfo = new TypeInfo( typeInfo, 0, null ); - } - - public ParserSymbolTable getSymbolTable(){ - return _table; - } - - public Object clone(){ - BasicSymbol copy = null; - try{ - copy = (BasicSymbol)super.clone(); - } catch ( CloneNotSupportedException e ){ - //should not happen - return null; - } - copy._object = null; - return copy; - } - - public String getName() { return _name; } - public void setName(String name) { _name = name; } - - public ISymbolASTExtension getASTExtension() { return _object; } - public void setASTExtension( ISymbolASTExtension obj ) { _object = obj; } - - public IContainerSymbol getContainingSymbol() { return _containingScope; } - public void setContainingSymbol( IContainerSymbol scope ){ - _containingScope = scope; - _depth = scope.getDepth() + 1; - } - - public void setType(TypeInfo.eType t){ - getTypeInfo().setType( t ); - } - - public TypeInfo.eType getType(){ - return getTypeInfo().getType(); - } - - public boolean isType( TypeInfo.eType type ){ - return getTypeInfo().isType( type, TypeInfo.t_undef ); - } - - public boolean isType( TypeInfo.eType type, TypeInfo.eType upperType ){ - return getTypeInfo().isType( type, upperType ); - } - - public ISymbol getTypeSymbol(){ - ISymbol symbol = getTypeInfo().getTypeSymbol(); - - if( symbol != null && symbol.getTypeInfo().isForwardDeclaration() && symbol.getTypeSymbol() != null ){ - return symbol.getTypeSymbol(); - } - - return symbol; - } - - public void setTypeSymbol( ISymbol type ){ - getTypeInfo().setTypeSymbol( type ); - } - - public TypeInfo getTypeInfo(){ - return _typeInfo; - } - - public void setTypeInfo( TypeInfo info ) { - _typeInfo = info; - } - - public boolean isForwardDeclaration(){ - return getTypeInfo().isForwardDeclaration(); - } - - public void setIsForwardDeclaration( boolean forward ){ - getTypeInfo().setIsForwardDeclaration( forward ); - } - - /** - * returns 0 if same, non zero otherwise - */ - public int compareCVQualifiersTo( ISymbol symbol ){ - int size = symbol.getTypeInfo().hasPtrOperators() ? symbol.getTypeInfo().getPtrOperators().size() : 0; - int size2 = getTypeInfo().hasPtrOperators() ? getTypeInfo().getPtrOperators().size() : 0; - - if( size != size2 ){ - return size2 - size; - } else if( size == 0 ) - return 0; - else { - - Iterator iter1 = symbol.getTypeInfo().getPtrOperators().iterator(); - Iterator iter2 = getTypeInfo().getPtrOperators().iterator(); - - TypeInfo.PtrOp op1 = null, op2 = null; - - for( int i = size; i > 0; i-- ){ - op1 = (TypeInfo.PtrOp)iter1.next(); - op2 = (TypeInfo.PtrOp)iter2.next(); - - if( op1.compareCVTo( op2 ) != 0 ){ - return -1; - } - } - } - - return 0; - } - - public List getPtrOperators(){ - return getTypeInfo().getPtrOperators(); - } - public void addPtrOperator( TypeInfo.PtrOp ptrOp ){ - getTypeInfo().addPtrOperator( ptrOp ); - } - - public int getDepth(){ - return _depth; - } - - public boolean isTemplateMember(){ - return _isTemplateMember; - } - public void setIsTemplateMember( boolean isMember ){ - _isTemplateMember = isMember; - } - public ISymbol getTemplateInstance(){ - return _templateInstance; - } - public void setTemplateInstance( TemplateInstance instance ){ - _templateInstance = instance; - } - public Map getArgumentMap(){ - return null; - } - - public boolean getIsInvisible(){ - return _isInvisible; - } - public void setIsInvisible( boolean invisible ){ - _isInvisible = invisible ; - } - - private String _name; //our name - private ISymbolASTExtension _object; //the object associated with us - private TypeInfo _typeInfo; //our type info - private IContainerSymbol _containingScope; //the scope that contains us - private int _depth; //how far down the scope stack we are - - private boolean _isInvisible = false; //used by friend declarations (11.4-9) - private boolean _isTemplateMember = false; - private TemplateInstance _templateInstance; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ContainerSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ContainerSymbol.java deleted file mode 100644 index 59753458afe..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ContainerSymbol.java +++ /dev/null @@ -1,793 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Nov 4, 2003 - */ - -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTMember; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.Command; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.LookupData; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ContainerSymbol extends BasicSymbol implements IContainerSymbol { - - protected ContainerSymbol( ParserSymbolTable table, String name ){ - super( table, name ); - } - - protected ContainerSymbol( ParserSymbolTable table, String name, ISymbolASTExtension obj ){ - super( table, name, obj ); - } - - protected ContainerSymbol( ParserSymbolTable table, String name, TypeInfo.eType typeInfo ){ - super( table, name, typeInfo ); - } - - public Object clone(){ - ContainerSymbol copy = (ContainerSymbol)super.clone(); - - copy._usingDirectives = ( _usingDirectives != null ) ? (LinkedList) _usingDirectives.clone() : null; - copy._containedSymbols = ( _containedSymbols != null )? (HashMap) _containedSymbols.clone() : null; - - return copy; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addSymbol(org.eclipse.cdt.internal.core.parser.pst.ISymbol) - */ - public void addSymbol( ISymbol obj ) throws ParserSymbolTableException{ - IContainerSymbol containing = this; - - //handle enumerators - if( obj.getType() == TypeInfo.t_enumerator ){ - //a using declaration of an enumerator will not be contained in a - //enumeration. - if( containing.getType() == TypeInfo.t_enumeration ){ - //Following the closing brace of an enum-specifier, each enumerator has the type of its - //enumeration - obj.setTypeSymbol( containing ); - //Each enumerator is declared in the scope that immediately contains the enum-specifier - containing = containing.getContainingSymbol(); - } - } - - //Templates contain 1 declaration - if( getType() == TypeInfo.t_template ){ - //declaration must be a class or a function - if( ( obj.getType() != TypeInfo.t_class && obj.getType() != TypeInfo.t_function ) || - ( getContainedSymbols() != null && getContainedSymbols().size() == 1 ) ) - { - //throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate ); - } - } - - Map declarations = containing.getContainedSymbols(); - - boolean unnamed = obj.getName().equals( ParserSymbolTable.EMPTY_NAME ); - - Object origObj = null; - - obj.setContainingSymbol( containing ); - - //does this name exist already? - origObj = declarations.get( obj.getName() ); - - if( origObj != null ) - { - ISymbol origDecl = null; - LinkedList origList = null; - - if( origObj instanceof ISymbol ){ - origDecl = (ISymbol)origObj; - } else if( origObj.getClass() == LinkedList.class ){ - origList = (LinkedList)origObj; - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_InternalError ); - } - - boolean validOverride = ((origList == null) ? ParserSymbolTable.isValidOverload( origDecl, obj ) : ParserSymbolTable.isValidOverload( origList, obj ) ); - if( unnamed || validOverride ) - { - if( origList == null ){ - origList = new LinkedList(); - origList.add( origDecl ); - origList.add( obj ); - - declarations.remove( origDecl ); - declarations.put( obj.getName(), origList ); - } else { - origList.add( obj ); - //origList is already in _containedDeclarations - } - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidOverload ); - } - } else { - declarations.put( obj.getName(), obj ); - } - - obj.setIsTemplateMember( isTemplateMember() || getType() == TypeInfo.t_template ); - - Command command = new AddSymbolCommand( (ISymbol) obj, containing ); - getSymbolTable().pushCommand( command ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#hasUsingDirectives() - */ - public boolean hasUsingDirectives(){ - return ( _usingDirectives != null && !_usingDirectives.isEmpty() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#getUsingDirectives() - */ - public List getUsingDirectives(){ - if( _usingDirectives == null ){ - _usingDirectives = new LinkedList(); - } - - return _usingDirectives; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addUsingDirective(org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol) - */ - public void addUsingDirective( IContainerSymbol namespace ) throws ParserSymbolTableException{ - if( namespace.getType() != TypeInfo.t_namespace ){ - throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing ); - } - //7.3.4 A using-directive shall not appear in class scope - if( isType( TypeInfo.t_class, TypeInfo.t_union ) ){ - throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing ); - } - - //handle namespace aliasing - ISymbol alias = namespace.getTypeSymbol(); - if( alias != null && alias.isType( TypeInfo.t_namespace ) ){ - namespace = (IContainerSymbol) alias; - } - - List usingDirectives = getUsingDirectives(); - - usingDirectives.add( namespace ); - - Command command = new AddUsingDirectiveCommand( this, namespace ); - getSymbolTable().pushCommand( command ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addUsingDeclaration(java.lang.String) - */ - /** - * addUsingDeclaration - * @param obj - * @throws ParserSymbolTableException - * - * 7.3.3-9 The entity declared by a using-declaration shall be known in the - * context using it according to its definition at the point of the using- - * declaration. Definitions added to the namespace after the using- - * declaration are not considered when a use of the name is made. - * - * 7.3.3-4 A using-declaration used as a member-declaration shall refer to a - * member of a base class of the class being defined, shall refer to a - * member of an anonymous union that is a member of a base class of the - * class being defined, or shall refer to an enumerator for an enumeration - * type that is a member of a base class of the class being defined. - */ - public ISymbol addUsingDeclaration( String name ) throws ParserSymbolTableException { - return addUsingDeclaration( name, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addUsingDeclaration(java.lang.String, org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol) - */ - public ISymbol addUsingDeclaration( String name, IContainerSymbol declContext ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_any, null ); - - if( declContext != null ){ - data.qualified = true; - data.templateInstance = declContext.getTemplateInstance(); - ParserSymbolTable.lookup( data, declContext ); - } else { - ParserSymbolTable.lookup( data, this ); - } - - //figure out which declaration we are talking about, if it is a set of functions, - //then they will be in data.foundItems (since we provided no parameter info); - ISymbol symbol = null; - ISymbol clone = null; - Iterator iter = null; - - try{ - symbol = ParserSymbolTable.resolveAmbiguities( data ); - } catch ( ParserSymbolTableException e ) { - if( e.reason != ParserSymbolTableException.r_UnableToResolveFunction ){ - throw e; - } - } - - if( symbol == null && (data.foundItems == null || data.foundItems.isEmpty()) ){ - throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing ); - } - - if( symbol == null ){ - Object object = data.foundItems.get( data.name ); - iter = ( object instanceof List ) ? ((List) object).iterator() : null; - symbol = ( iter != null && iter.hasNext() ) ? (ISymbol)iter.next() : null; - } - - while( symbol != null ){ - if( ParserSymbolTable.okToAddUsingDeclaration( symbol, this ) ){ - clone = (ISymbol) symbol.clone(); //7.3.3-9 - addSymbol( clone ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing ); - } - - if( iter != null && iter.hasNext() ){ - symbol = (ISymbol) iter.next(); - } else { - symbol = null; - } - } - - return clone; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#getContainedSymbols() - */ - public Map getContainedSymbols(){ - if( _containedSymbols == null ){ - _containedSymbols = new HashMap(); - } - return _containedSymbols; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#elaboratedLookup(org.eclipse.cdt.internal.core.parser.pst.TypeInfo.eType, java.lang.String) - */ - public ISymbol elaboratedLookup( TypeInfo.eType type, String name ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, type, getTemplateInstance() ); - - ParserSymbolTable.lookup( data, this ); - - return ParserSymbolTable.resolveAmbiguities( data ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookup(java.lang.String) - */ - public ISymbol lookup( String name ) throws ParserSymbolTableException { - LookupData data = new LookupData( name, TypeInfo.t_any, getTemplateInstance() ); - - ParserSymbolTable.lookup( data, this ); - - return ParserSymbolTable.resolveAmbiguities( data ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookupMemberForDefinition(java.lang.String) - */ - /** - * LookupMemberForDefinition - * @param name - * @return Declaration - * @throws ParserSymbolTableException - * - * In a definition for a namespace member in which the declarator-id is a - * qualified-id, given that the qualified-id for the namespace member has - * the form "nested-name-specifier unqualified-id", the unqualified-id shall - * name a member of the namespace designated by the nested-name-specifier. - * - * ie: - * you have this: - * namespace A{ - * namespace B{ - * void f1(int); - * } - * using namespace B; - * } - * - * if you then do this - * void A::f1(int) { ... } //ill-formed, f1 is not a member of A - * but, you can do this (Assuming f1 has been defined elsewhere) - * A::f1( 1 ); //ok, finds B::f1 - * - * ie, We need a seperate lookup function for looking up the member names - * for a definition. - */ - public ISymbol lookupMemberForDefinition( String name ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_any, getTemplateInstance() ); - data.qualified = true; - - IContainerSymbol container = this; - - //handle namespace aliases - if( container.isType( TypeInfo.t_namespace ) ){ - ISymbol symbol = container.getTypeSymbol(); - if( symbol != null && symbol.isType( TypeInfo.t_namespace ) ){ - container = (IContainerSymbol) symbol; - } - } - - data.foundItems = ParserSymbolTable.lookupInContained( data, container ); - - return ParserSymbolTable.resolveAmbiguities( data ); - } - - public IParameterizedSymbol lookupMethodForDefinition( String name, List parameters ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_any, getTemplateInstance() ); - data.qualified = true; - data.parameters = ( parameters == null ) ? new LinkedList() : parameters; - - IContainerSymbol container = this; - - //handle namespace aliases - if( container.isType( TypeInfo.t_namespace ) ){ - ISymbol symbol = container.getTypeSymbol(); - if( symbol != null && symbol.isType( TypeInfo.t_namespace ) ){ - container = (IContainerSymbol) symbol; - } - } - - data.foundItems = ParserSymbolTable.lookupInContained( data, container ); - - ISymbol symbol = ParserSymbolTable.resolveAmbiguities( data ); - return (IParameterizedSymbol) (( symbol instanceof IParameterizedSymbol ) ? symbol : null); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookupNestedNameSpecifier(java.lang.String) - */ - /** - * Method LookupNestedNameSpecifier. - * @param name - * @return Declaration - * The name of a class or namespace member can be referred to after the :: - * scope resolution operator applied to a nested-name-specifier that - * nominates its class or namespace. During the lookup for a name preceding - * the ::, object, function and enumerator names are ignored. If the name - * is not a class-name or namespace-name, the program is ill-formed - */ - public IContainerSymbol lookupNestedNameSpecifier( String name ) throws ParserSymbolTableException { - return lookupNestedNameSpecifier( name, this ); - } - private IContainerSymbol lookupNestedNameSpecifier(String name, IContainerSymbol inSymbol ) throws ParserSymbolTableException{ - ISymbol foundSymbol = null; - - LookupData data = new LookupData( name, TypeInfo.t_namespace, getTemplateInstance() ); - data.filter.addAcceptedType( TypeInfo.t_class ); - data.filter.addAcceptedType( TypeInfo.t_struct ); - data.filter.addAcceptedType( TypeInfo.t_union ); - - data.foundItems = ParserSymbolTable.lookupInContained( data, inSymbol ); - - if( data.foundItems != null ){ - foundSymbol = (ISymbol) ParserSymbolTable.resolveAmbiguities( data );//, data.foundItems ); - } - - if( foundSymbol == null && inSymbol.getContainingSymbol() != null ){ - foundSymbol = lookupNestedNameSpecifier( name, inSymbol.getContainingSymbol() ); - } - - if( foundSymbol instanceof IContainerSymbol ) - return (IContainerSymbol) foundSymbol; - else - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#qualifiedLookup(java.lang.String) - */ - public ISymbol qualifiedLookup( String name ) throws ParserSymbolTableException{ - - return qualifiedLookup(name, TypeInfo.t_any); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#qualifiedLookup(java.lang.String, org.eclipse.cdt.internal.core.parser.pst.TypeInfo.eType) - */ - public ISymbol qualifiedLookup( String name, TypeInfo.eType t ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, t, getTemplateInstance() ); - data.qualified = true; - ParserSymbolTable.lookup( data, this ); - - return ParserSymbolTable.resolveAmbiguities( data ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#unqualifiedFunctionLookup(java.lang.String, java.util.List) - */ - /** - * UnqualifiedFunctionLookup - * @param name - * @param parameters - * @return Declaration - * @throws ParserSymbolTableException - * - * 3.4.2-1 When an unqualified name is used as the post-fix expression in a - * function call, other namespaces not consdiered during the usual - * unqualified lookup may be searched. - * - * 3.4.2-2 For each argument type T in the function call, there is a set of - * zero or more associated namespaces and a set of zero or more associated - * classes to be considered. - * - * If the ordinary unqualified lookup of the name find the declaration of a - * class member function, the associated namespaces and classes are not - * considered. Otherwise, the set of declarations found by the lookup of - * the function name is the union of the set of declarations found using - * ordinary unqualified lookup and the set of declarations found in the - * namespaces and classes associated with the argument types. - */ - public IParameterizedSymbol unqualifiedFunctionLookup( String name, List parameters ) throws ParserSymbolTableException{ - //figure out the set of associated scopes first, so we can remove those that are searched - //during the normal lookup to avoid doing them twice - HashSet associated = new HashSet(); - - //collect associated namespaces & classes. - int size = ( parameters == null ) ? 0 : parameters.size(); - Iterator iter = ( parameters == null ) ? null : parameters.iterator(); - - TypeInfo param = null; - ISymbol paramType = null; - for( int i = size; i > 0; i-- ){ - param = (TypeInfo) iter.next(); - paramType = ParserSymbolTable.getFlatTypeInfo( param ).getTypeSymbol(); - - if( paramType == null ){ - continue; - } - - ParserSymbolTable.getAssociatedScopes( paramType, associated ); - - //if T is a pointer to a data member of class X, its associated namespaces and classes - //are those associated with the member type together with those associated with X - if( param.hasPtrOperators() && param.getPtrOperators().size() == 1 ){ - TypeInfo.PtrOp op = (TypeInfo.PtrOp)param.getPtrOperators().iterator().next(); - if( op.getType() == TypeInfo.PtrOp.t_pointer && - paramType.getContainingSymbol().isType( TypeInfo.t_class, TypeInfo.t_union ) ) - { - ParserSymbolTable.getAssociatedScopes( paramType.getContainingSymbol(), associated ); - } - } - } - - LookupData data = new LookupData( name, TypeInfo.t_function, getTemplateInstance() ); - //if parameters == null, thats no parameters, but we need to distinguish that from - //no parameter information at all, so make an empty list. - data.parameters = ( parameters == null ) ? new LinkedList() : parameters; - data.associated = associated; - - ParserSymbolTable.lookup( data, this ); - - ISymbol found = ParserSymbolTable.resolveAmbiguities( data ); - - //if we haven't found anything, or what we found is not a class member, consider the - //associated scopes - if( found == null || found.getContainingSymbol().getType() != TypeInfo.t_class ){ -// if( found != null ){ -// data.foundItems.add( found ); -// } - - IContainerSymbol associatedScope; - //dump the hash to an array and iterate over the array because we - //could be removing items from the collection as we go and we don't - //want to get ConcurrentModificationExceptions - Object [] scopes = associated.toArray(); - - size = associated.size(); - - for( int i = 0; i < size; i++ ){ - associatedScope = (IContainerSymbol) scopes[ i ]; - if( associated.contains( associatedScope ) ){ - data.qualified = true; - data.ignoreUsingDirectives = true; - data.usingDirectivesOnly = false; - ParserSymbolTable.lookup( data, associatedScope ); - } - } - - found = ParserSymbolTable.resolveAmbiguities( data ); - } - - if( found instanceof IParameterizedSymbol ) - return (IParameterizedSymbol) found; - else - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#memberFunctionLookup(java.lang.String, java.util.List) - */ - /** - * MemberFunctionLookup - * @param name - * @param parameters - * @return Declaration - * @throws ParserSymbolTableException - * - * Member lookup really proceeds as an unqualified lookup, but doesn't - * include argument dependant scopes - */ - public IParameterizedSymbol memberFunctionLookup( String name, List parameters ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_function, getTemplateInstance() ); - //if parameters == null, thats no parameters, but we need to distinguish that from - //no parameter information at all, so make an empty list. - data.parameters = ( parameters == null ) ? new LinkedList() : parameters; - - ParserSymbolTable.lookup( data, (IContainerSymbol) this ); - return (IParameterizedSymbol) ParserSymbolTable.resolveAmbiguities( data ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#qualifiedFunctionLookup(java.lang.String, java.util.List) - */ - public IParameterizedSymbol qualifiedFunctionLookup( String name, List parameters ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_function, getTemplateInstance() ); - data.qualified = true; - //if parameters == null, thats no parameters, but we need to distinguish that from - //no parameter information at all, so make an empty list. - data.parameters = ( parameters == null ) ? new LinkedList() : parameters; - - ParserSymbolTable.lookup( data, (IContainerSymbol)this ); - - return (IParameterizedSymbol) ParserSymbolTable.resolveAmbiguities( data ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#templateLookup(java.lang.String, java.util.List) - */ - public TemplateInstance templateLookup( String name, List arguments ) throws ParserSymbolTableException - { - LookupData data = new LookupData( name, TypeInfo.t_any, getTemplateInstance() ); - data.parameters = arguments; - - ParserSymbolTable.lookup( data, (IContainerSymbol) this ); - ISymbol found = ParserSymbolTable.resolveAmbiguities( data ); - if( found.isType( TypeInfo.t_template ) ){ - return ((IParameterizedSymbol) found).instantiate( arguments ); - } - return null; - } - - public List prefixLookup( TypeFilter filter, String prefix, boolean qualified ) throws ParserSymbolTableException{ - LookupData data = new LookupData( prefix, filter, getTemplateInstance() ); - data.qualified = qualified; - data.mode = ParserSymbolTable.LookupMode.PREFIX; - - ParserSymbolTable.lookup( data, this ); - - if( data.foundItems == null || data.foundItems.isEmpty() ){ - return null; - } else { - //remove any ambiguous symbols - if( data.ambiguities != null && !data.ambiguities.isEmpty() ){ - Iterator iter = data.ambiguities.iterator(); - while( iter.hasNext() ){ - data.foundItems.remove( iter.next() ); - } - } - - List list = new LinkedList(); - - Iterator iter = data.foundItems.keySet().iterator(); - Object obj = null; - while( iter.hasNext() ){ - obj = data.foundItems.get( iter.next() ); - - if( obj instanceof List ){ - list.addAll( (List) obj ); - } else{ - list.add( obj ); - } - } - - return list; - } - } - - public boolean isVisible( ISymbol symbol, IContainerSymbol qualifyingSymbol ){ - ISymbolASTExtension extension = symbol.getASTExtension(); - IASTNode node = extension.getPrimaryDeclaration(); - - if( node instanceof IASTMember ){ - ASTAccessVisibility visibility; - try { - visibility = ParserSymbolTable.getVisibility( symbol, qualifyingSymbol ); - } catch (ParserSymbolTableException e) { - return false; - } - if( visibility == ASTAccessVisibility.PUBLIC ){ - return true; - } - - IContainerSymbol container = getContainingSymbol(); - IContainerSymbol symbolContainer = ( qualifyingSymbol != null ) ? qualifyingSymbol : symbol.getContainingSymbol(); - - if( !symbolContainer.isType( TypeInfo.t_class, TypeInfo.t_union ) || - symbolContainer.equals( container ) ) - { - return true; - } - - //if this is a friend of the symbolContainer, then we are good - if( isFriendOf( symbolContainer ) ){ - return true; - } - - if( visibility == ASTAccessVisibility.PROTECTED ) - { - try { - return ( ParserSymbolTable.hasBaseClass( container, symbolContainer ) >= 0 ); - } catch (ParserSymbolTableException e) { - return false; - } - } else { //PRIVATE - return false; - } - } - return true; - } - - protected boolean isFriendOf( IContainerSymbol symbol ){ - if( symbol instanceof IDerivableContainerSymbol ){ - IContainerSymbol container = this.getContainingSymbol(); - - while( container != null && container.isType( TypeInfo.t_block ) ){ - container = container.getContainingSymbol(); - } - if( container != null && !container.isType( TypeInfo.t_class, TypeInfo.t_union ) ){ - container = null; - } - - IDerivableContainerSymbol derivable = (IDerivableContainerSymbol) symbol; - - Iterator iter = derivable.getFriends().iterator(); - while( iter.hasNext() ){ - ISymbol friend = (ISymbol) iter.next(); - ISymbol typeSymbol = friend.getTypeSymbol(); - if( friend == this || typeSymbol == this || - friend == container || ( container != null && typeSymbol == container ) ) - { - return true; - } - } - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#instantiate(java.util.List) - */ - public TemplateInstance instantiate( List arguments ) throws ParserSymbolTableException{ - if( getType() != TypeInfo.t_template ){ - return null; - } - - //TODO uncomment when template specialization matching & ordering is working - //IParameterizedSymbol template = ParserSymbolTable.matchTemplatePartialSpecialization( this, arguments ); - IParameterizedSymbol template = null; - - if( template == null ){ - template = (IParameterizedSymbol) this; - } - - List paramList = template.getParameterList(); - int numParams = ( paramList != null ) ? paramList.size() : 0; - - if( numParams == 0 ){ - return null; - } - - HashMap map = new HashMap(); - Iterator paramIter = paramList.iterator(); - Iterator argIter = arguments.iterator(); - - ISymbol param = null; - TypeInfo arg = null; - for( int i = 0; i < numParams; i++ ){ - param = (ISymbol) paramIter.next(); - - if( argIter.hasNext() ){ - arg = (TypeInfo) argIter.next(); - map.put( param, arg ); - } else { - Object obj = param.getTypeInfo().getDefault(); - if( obj != null && obj instanceof TypeInfo ){ - map.put( param, obj ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate ); - } - } - } - - if( template.getContainedSymbols().size() != 1 ){ - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate ); - } - - Iterator iter = template.getContainedSymbols().keySet().iterator(); - IContainerSymbol symbol = (IContainerSymbol) template.getContainedSymbols().get( iter.next() ); - - TemplateInstance instance = new TemplateInstance( getSymbolTable(), symbol, map ); - return instance; - } - - static private class AddSymbolCommand extends Command{ - AddSymbolCommand( ISymbol newDecl, IContainerSymbol context ){ - _symbol = newDecl; - _context = context; - } - - public void undoIt(){ - Object obj = _context.getContainedSymbols().get( _symbol.getName() ); - - if( obj instanceof LinkedList ){ - LinkedList list = (LinkedList)obj; - ListIterator iter = list.listIterator(); - int size = list.size(); - ISymbol item = null; - for( int i = 0; i < size; i++ ){ - item = (ISymbol)iter.next(); - if( item == _symbol ){ - iter.remove(); - break; - } - } - if( list.size() == 1 ){ - _context.getContainedSymbols().remove( _symbol.getName() ); - _context.getContainedSymbols().put( _symbol.getName(), list.getFirst() ); - } - } else if( obj instanceof BasicSymbol ){ - _context.getContainedSymbols().remove( _symbol.getName() ); - } -// if( _removeThis && _symbol instanceof IParameterizedSymbol ){ -// ((IParameterizedSymbol)_symbol).getContainedSymbols().remove( ParserSymbolTable.THIS ); -// } - } - - private ISymbol _symbol; - private IContainerSymbol _context; - } - - static private class AddUsingDirectiveCommand extends Command{ - public AddUsingDirectiveCommand( IContainerSymbol container, IContainerSymbol namespace ){ - _decl = container; - _namespace = namespace; - } - public void undoIt(){ - _decl.getUsingDirectives().remove( _namespace ); - } - private IContainerSymbol _decl; - private IContainerSymbol _namespace; - } - - private LinkedList _usingDirectives; //collection of nominated namespaces - private HashMap _containedSymbols; //declarations contained by us. - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/DerivableContainerSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/DerivableContainerSymbol.java deleted file mode 100644 index 003b9830f7c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/DerivableContainerSymbol.java +++ /dev/null @@ -1,388 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Nov 6, 2003 - */ - -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; - -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.Command; -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.LookupData; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class DerivableContainerSymbol extends ContainerSymbol implements IDerivableContainerSymbol { - - protected DerivableContainerSymbol( ParserSymbolTable table, String name ){ - super( table, name ); - } - - protected DerivableContainerSymbol( ParserSymbolTable table, String name, ISymbolASTExtension obj ){ - super( table, name, obj ); - } - - protected DerivableContainerSymbol( ParserSymbolTable table, String name, TypeInfo.eType typeInfo ){ - super( table, name, typeInfo ); - } - - - public Object clone(){ - DerivableContainerSymbol copy = (DerivableContainerSymbol)super.clone(); - - copy._parentScopes = ( _parentScopes != null ) ? (LinkedList) _parentScopes.clone() : null; - copy._constructors = ( _constructors != null ) ? (LinkedList) _constructors.clone() : null; - - return copy; - } - - public void addSymbol(ISymbol symbol) throws ParserSymbolTableException { - super.addSymbol( symbol ); - - //take care of the this pointer - if( symbol instanceof IParameterizedSymbol ){ - addThis( (IParameterizedSymbol) symbol ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#addParent(org.eclipse.cdt.internal.core.parser.pst.ISymbol) - */ - public void addParent( ISymbol parent ){ - addParent( parent, false, ASTAccessVisibility.PUBLIC, -1, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#addParent(org.eclipse.cdt.internal.core.parser.pst.ISymbol, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, int, java.util.List) - */ - public void addParent( ISymbol parent, boolean virtual, ASTAccessVisibility visibility, int offset, List references ){ - if( _parentScopes == null ){ - _parentScopes = new LinkedList(); - } - - ParentWrapper wrapper = new ParentWrapper( parent, virtual, visibility, offset, references ); - _parentScopes.add( wrapper ); - - Command command = new AddParentCommand( this, wrapper ); - getSymbolTable().pushCommand( command ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#getParents() - */ - public List getParents(){ - if( _parentScopes == null ){ - _parentScopes = new LinkedList(); - } - return _parentScopes; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#hasParents() - */ - public boolean hasParents(){ - return ( _parentScopes != null && !_parentScopes.isEmpty() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#addConstructor(org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol) - */ - public void addConstructor(IParameterizedSymbol constructor) throws ParserSymbolTableException { - if( !constructor.isType( TypeInfo.t_constructor ) ) - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo ); - - List constructors = getConstructors(); - - if( constructors.size() == 0 || ParserSymbolTable.isValidOverload( constructors, constructor ) ){ - constructors.add( constructor ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidOverload ); - } - - constructor.setContainingSymbol( this ); - addThis( constructor ); - - Command command = new AddConstructorCommand( constructor, this ); - getSymbolTable().pushCommand( command ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#addCopyConstructor() - */ - public void addCopyConstructor() throws ParserSymbolTableException{ - List parameters = new LinkedList(); - - TypeInfo param = new TypeInfo( TypeInfo.t_type, 0, this, new TypeInfo.PtrOp( TypeInfo.PtrOp.t_reference, true, false ), false ); - parameters.add( param ); - - IParameterizedSymbol constructor = lookupConstructor( parameters ); - - if( constructor == null ){ - constructor = getSymbolTable().newParameterizedSymbol( getName(), TypeInfo.t_constructor ); - constructor.addParameter( this, new TypeInfo.PtrOp( TypeInfo.PtrOp.t_reference, true, false ), false ); - addConstructor( constructor ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#lookupConstructor(java.util.List) - */ - public IParameterizedSymbol lookupConstructor( List parameters ) throws ParserSymbolTableException - { - LookupData data = new LookupData( ParserSymbolTable.EMPTY_NAME, TypeInfo.t_constructor, null ); - data.parameters = parameters; - - List constructors = new LinkedList(); - if( !getConstructors().isEmpty() ) - constructors.addAll( getConstructors() ); - - return ParserSymbolTable.resolveFunction( data, constructors ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol#getConstructors() - */ - public List getConstructors(){ - if( _constructors == null ){ - _constructors = new LinkedList(); - } - return _constructors; - } - - /** - * - * @param obj - * @throws ParserSymbolTableException - * 9.3.2-1 In the body of a nonstatic member function... the type of this of - * a class X is X*. If the member function is declared const, the type of - * this is const X*, if the member function is declared volatile, the type - * of this is volatile X*.... - */ - private boolean addThis( IParameterizedSymbol obj ){ - if( getSymbolTable().getLanguage() != ParserLanguage.CPP ){ - return false; - } - - TypeInfo type = obj.getTypeInfo(); - if( ( !type.isType( TypeInfo.t_function ) && !type.isType( TypeInfo.t_constructor) ) || - type.checkBit( TypeInfo.isStatic ) ){ - return false; - } - - if( obj.getContainingSymbol().isType( TypeInfo.t_class, TypeInfo.t_union ) ){ - //check to see if there is already a this object, since using declarations - //of function will have them from the original declaration - boolean foundThis = false; - - LookupData data = new LookupData( ParserSymbolTable.THIS, TypeInfo.t_any, null ); - try { - Map map = ParserSymbolTable.lookupInContained( data, obj ); - foundThis = map.containsKey( data.name ); - } catch (ParserSymbolTableException e) { - return false; - } - - //if we didn't find "this" then foundItems will still be null, no need to actually - //check its contents - if( !foundThis ){ - ISymbol thisObj = getSymbolTable().newSymbol( ParserSymbolTable.THIS, TypeInfo.t_type ); - thisObj.setTypeSymbol( obj.getContainingSymbol() ); - //thisObj.setCVQualifier( obj.getCVQualifier() ); - TypeInfo.PtrOp ptr = new TypeInfo.PtrOp(); - ptr.setType( TypeInfo.PtrOp.t_pointer ); - if( obj.getTypeInfo().hasPtrOperators() ){ - ptr.setConst( ((TypeInfo.PtrOp) obj.getPtrOperators().iterator().next()).isConst() ); - ptr.setVolatile( ((TypeInfo.PtrOp) obj.getPtrOperators().iterator().next()).isVolatile() ); - } - - thisObj.addPtrOperator(ptr); - - try{ - obj.addSymbol( thisObj ); - } catch ( ParserSymbolTableException e ) { - //shouldn't happen because we checked that "this" didn't exist already - return false; - } - - } - } - return true; - } - - - /** - * - * @param name - * @return Declaration - * @throws ParserSymbolTableException - * - * 7.3.1.2-3 If a friend declaration in a non-local class first declares a - * class or function, the friend class or function is a member of the - * innermost enclosing namespace. - * - * TODO: if/when the parser symbol table starts caring about visibility - * (public/protected/private) we will need to do more to record friendship. - */ - public void addFriend( ISymbol friend ) throws ParserSymbolTableException{ - //is this symbol already in the table? - IContainerSymbol containing = friend.getContainingSymbol(); - if( containing == null ){ - //its not, it goes in the innermost enclosing namespace - IContainerSymbol enclosing = getContainingSymbol(); - while( enclosing != null && !enclosing.isType( TypeInfo.t_namespace ) ){ - enclosing = enclosing.getContainingSymbol(); - } - - friend.setIsInvisible( true ); - friend.setIsForwardDeclaration( true ); - enclosing.addSymbol( friend ); - } - - getFriends().add( friend ); - } - - /** - * LookupForFriendship - * @param name - * @return Declaration - * 7.3.1.2-3 When looking for a prior declaration of a class or a function - * declared as a friend, scopes outside the innermost enclosing namespace - * scope are not considered. - * 11.4-9 If a friend declaration appears in a local class and the name - * specified is an unqualified name, a prior declaration is looked up - * without considering scopes that are outside the innermost enclosing non- - * class scope. - */ - public ISymbol lookupForFriendship( String name ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_any, getTemplateInstance() ); - - IContainerSymbol enclosing = getContainingSymbol(); - if( enclosing != null && enclosing.isType( TypeInfo.t_namespace, TypeInfo.t_union ) ){ - while( enclosing != null && ( enclosing.getType() != TypeInfo.t_namespace) ) - { - enclosing = enclosing.getContainingSymbol(); - } - } - data.stopAt = enclosing; - - ParserSymbolTable.lookup( data, this ); - return ParserSymbolTable.resolveAmbiguities( data ); - } - - public IParameterizedSymbol lookupFunctionForFriendship( String name, List parameters ) throws ParserSymbolTableException{ - LookupData data = new LookupData( name, TypeInfo.t_any, getTemplateInstance() ); - - data.parameters = parameters; - - IContainerSymbol enclosing = getContainingSymbol(); - if( enclosing != null && enclosing.isType( TypeInfo.t_namespace, TypeInfo.t_union ) ){ - while( enclosing != null && ( enclosing.getType() != TypeInfo.t_namespace) ) - { - enclosing = enclosing.getContainingSymbol(); - } - } - data.stopAt = enclosing; - - ParserSymbolTable.lookup( data, this ); - return (IParameterizedSymbol) ParserSymbolTable.resolveAmbiguities( data ); - } - - - public List getFriends(){ - if( _friends == null ){ - _friends = new LinkedList(); - } - return _friends; - } - - static private class AddParentCommand extends Command{ - public AddParentCommand( IDerivableContainerSymbol container, ParentWrapper wrapper ){ - _decl = container; - _wrapper = wrapper; - } - - public void undoIt(){ - List parents = _decl.getParents(); - parents.remove( _wrapper ); - } - - private IDerivableContainerSymbol _decl; - private ParentWrapper _wrapper; - } - - static private class AddConstructorCommand extends Command{ - AddConstructorCommand( IParameterizedSymbol newConstr, IDerivableContainerSymbol context ){ - _constructor = newConstr; - _context = context; - } - public void undoIt(){ - List constructors = _context.getConstructors(); - ListIterator iter = constructors.listIterator(); - - int size = constructors.size(); - IParameterizedSymbol item = null; - for( int i = 0; i < size; i++ ){ - item = (IParameterizedSymbol)iter.next(); - if( item == _constructor ){ - iter.remove(); - break; - } - } - } - - private IParameterizedSymbol _constructor; - private IDerivableContainerSymbol _context; - } - - public class ParentWrapper implements IDerivableContainerSymbol.IParentSymbol - { - public ParentWrapper( ISymbol p, boolean v, ASTAccessVisibility s, int offset, List r ){ - parent = p; - isVirtual = v; - access = s; - this.offset = offset; - this.references = r; - } - - public void setParent( ISymbol parent ){ this.parent = parent; } - - public ISymbol getParent() { return parent; } - public boolean isVirtual() { return isVirtual; } - - public void setVirtual( boolean virtual ){ isVirtual = virtual; } - - public ASTAccessVisibility getVisibility(){ return access; } - public ASTAccessVisibility getAccess() { return access; } - - public int getOffset() { return offset; } - public List getReferences() { return references; } - - private boolean isVirtual = false; - protected ISymbol parent = null; - private final ASTAccessVisibility access; - private final int offset; - private final List references; - } - - private LinkedList _constructors; //constructor list - private LinkedList _parentScopes; //inherited scopes (is base classes) - private LinkedList _friends; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java deleted file mode 100644 index c18052d3d00..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ForewardDeclaredSymbolExtension.java +++ /dev/null @@ -1,109 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol; - -/** - * @author jcamelon - * - */ -public class ForewardDeclaredSymbolExtension extends AbstractSymbolExtension -{ - /** - * @author jcamelon - * - */ - private class DualIterator implements Iterator - { - private int state = 0; - /** - * - */ - public DualIterator() - { - super(); - } - - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() - { - if( state == 0 ) return true; - if( state == 1 && definitionSymbol != null ) return true; - return false; - } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() - { - switch( state ) - { - case 0: - state = 1; - return primaryDeclaration; - case 1: - if( definitionSymbol != null ) - { - state = 2; - return definitionSymbol; - } - break; - } - throw new NoSuchElementException(); - - } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() - { - throw new UnsupportedOperationException(); - } - } - - protected ASTSymbol definitionSymbol = null; - /** - * @param symbol - * @param primaryDeclaration - */ - public ForewardDeclaredSymbolExtension( - ISymbol symbol, - ASTSymbol primaryDeclaration) - { - super(symbol, primaryDeclaration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension#getAllDefinitions() - */ - public Iterator getAllDefinitions() - { - return new DualIterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension#addDefinition(org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol) - */ - public void addDefinition(ASTSymbol definition) throws ExtensionException - { - if( definitionSymbol != null ) - throw new ExtensionException(); - definitionSymbol = definition; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IContainerSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IContainerSymbol.java deleted file mode 100644 index 3aa91e4c59c..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IContainerSymbol.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 9, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.List; -import java.util.Map; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IContainerSymbol extends ISymbol { - - public void addSymbol( ISymbol symbol ) throws ParserSymbolTableException; - - public boolean hasUsingDirectives(); - public List getUsingDirectives(); - public void addUsingDirective( IContainerSymbol namespace ) throws ParserSymbolTableException; - - public ISymbol addUsingDeclaration( String name ) throws ParserSymbolTableException; - public ISymbol addUsingDeclaration( String name, IContainerSymbol declContext ) throws ParserSymbolTableException; - - public Map getContainedSymbols(); - - public List prefixLookup( TypeFilter filter, String prefix, boolean qualified ) throws ParserSymbolTableException; - - public ISymbol elaboratedLookup( TypeInfo.eType type, String name ) throws ParserSymbolTableException; - public ISymbol lookup( String name ) throws ParserSymbolTableException; - public ISymbol lookupMemberForDefinition( String name ) throws ParserSymbolTableException; - public IParameterizedSymbol lookupMethodForDefinition( String name, List parameters ) throws ParserSymbolTableException; - public IContainerSymbol lookupNestedNameSpecifier( String name ) throws ParserSymbolTableException; - public ISymbol qualifiedLookup( String name ) throws ParserSymbolTableException; - public ISymbol qualifiedLookup( String name, TypeInfo.eType t ) throws ParserSymbolTableException; - public IParameterizedSymbol unqualifiedFunctionLookup( String name, List parameters ) throws ParserSymbolTableException; - public IParameterizedSymbol memberFunctionLookup( String name, List parameters ) throws ParserSymbolTableException; - public IParameterizedSymbol qualifiedFunctionLookup( String name, List parameters ) throws ParserSymbolTableException; - public TemplateInstance templateLookup( String name, List arguments ) throws ParserSymbolTableException; - public TemplateInstance instantiate( List arguments ) throws ParserSymbolTableException; - - public boolean isVisible( ISymbol symbol, IContainerSymbol qualifyingSymbol ); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java deleted file mode 100644 index 985acc6bd73..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IDerivableContainerSymbol.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 9, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.List; - -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IDerivableContainerSymbol extends IContainerSymbol { - - public void addParent( ISymbol parent ); - public void addParent( ISymbol parent, boolean virtual, ASTAccessVisibility visibility, int offset, List references ); - public List getParents(); - public boolean hasParents(); - - public void addConstructor( IParameterizedSymbol constructor ) throws ParserSymbolTableException; - public void addCopyConstructor() throws ParserSymbolTableException; - public IParameterizedSymbol lookupConstructor( List parameters ) throws ParserSymbolTableException; - public List getConstructors(); - - public void addFriend( ISymbol friend ) throws ParserSymbolTableException; - public ISymbol lookupForFriendship( String name ) throws ParserSymbolTableException; - public IParameterizedSymbol lookupFunctionForFriendship( String name, List parameters ) throws ParserSymbolTableException; - - public List getFriends(); - - public interface IParentSymbol{ - public void setParent( ISymbol parent ); - public ISymbol getParent(); - public boolean isVirtual(); - public void setVirtual( boolean virtual ); - - public ASTAccessVisibility getVisibility(); - public ASTAccessVisibility getAccess(); - public int getOffset(); - public List getReferences(); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IParameterizedSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IParameterizedSymbol.java deleted file mode 100644 index 4dd4ca86c74..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/IParameterizedSymbol.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 9, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.List; -import java.util.Map; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IParameterizedSymbol extends IContainerSymbol { - - public void addParameter( ISymbol param ); - public void addParameter( TypeInfo.eType type, int info, TypeInfo.PtrOp ptrOp, boolean hasDefault ); - public void addParameter( ISymbol typeSymbol, TypeInfo.PtrOp ptrOp, boolean hasDefault ); - - public void addArgument( ISymbol arg ); - public List getArgumentList(); - //public void setArgumentList( List list ); - - public Map getParameterMap(); - public List getParameterList(); - //public void setParameterList( List list ); - - public boolean hasSameParameters(IParameterizedSymbol newDecl); - - public void setReturnType( ISymbol type ); - public ISymbol getReturnType(); - - public void setHasVariableArgs( boolean var ); - public boolean hasVariableArgs( ); - - public boolean hasSpecializations(); - public void addSpecialization( IParameterizedSymbol spec ); - public List getSpecializations(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISpecializedSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISpecializedSymbol.java deleted file mode 100644 index cf44c75eb69..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISpecializedSymbol.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 9, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.parser.pst; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface ISpecializedSymbol extends IParameterizedSymbol { - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java deleted file mode 100644 index d51184d6bca..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbol.java +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.List; -import java.util.Map; - -/** - * @author jcamelon - * - */ -public interface ISymbol extends Cloneable { - - public ParserSymbolTable getSymbolTable(); - - public Object clone(); - - public ISymbolASTExtension getASTExtension(); - public void setASTExtension( ISymbolASTExtension obj ); - - public String getName(); - - public IContainerSymbol getContainingSymbol(); - public void setContainingSymbol( IContainerSymbol containing ); - - public boolean isType( TypeInfo.eType type ); - public boolean isType( TypeInfo.eType type, TypeInfo.eType upperType ); - public TypeInfo.eType getType(); - public void setType(TypeInfo.eType t); - public TypeInfo getTypeInfo(); - public void setTypeInfo( TypeInfo info ); - public ISymbol getTypeSymbol(); - public void setTypeSymbol( ISymbol type ); - - public boolean isForwardDeclaration(); - public void setIsForwardDeclaration( boolean forward ); - - public int compareCVQualifiersTo( ISymbol symbol ); - public List getPtrOperators(); - public void addPtrOperator( TypeInfo.PtrOp ptrOp ); - - public boolean isTemplateMember(); - public void setIsTemplateMember( boolean isMember ); - public ISymbol getTemplateInstance(); - public Map getArgumentMap(); - public void setTemplateInstance( TemplateInstance instance ); - - public int getDepth(); - public boolean getIsInvisible(); - public void setIsInvisible( boolean invisible ); - - /** - * @param name - */ - public void setName(String name); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolASTExtension.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolASTExtension.java deleted file mode 100644 index 9555a4d633d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolASTExtension.java +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.Iterator; - -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol; - -/** - * @author jcamelon - * - */ -public interface ISymbolASTExtension extends ISymbolOwner -{ - public class ExtensionException extends Exception - { - } - - - public ASTSymbol getPrimaryDeclaration(); - public Iterator getAllDefinitions(); - public void addDefinition( ASTSymbol definition ) throws ExtensionException; - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolOwner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolOwner.java deleted file mode 100644 index 3f89e8b49b3..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ISymbolOwner.java +++ /dev/null @@ -1,20 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -/** - * @author jcamelon - * - */ -public interface ISymbolOwner -{ - public ISymbol getSymbol(); -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java deleted file mode 100644 index aafefa1092d..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/NamespaceSymbolExtension.java +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol; - -/** - * @author jcamelon - * - */ -public class NamespaceSymbolExtension extends AbstractSymbolExtension -{ - /** - * @author jcamelon - * - */ - private class LocalIterator implements Iterator - { - private boolean donePrimary = false; - private Iterator secondaries = otherDefinitions.iterator(); - /** - * - */ - public LocalIterator() - { - super(); - } - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() - { - if( ! donePrimary ) return true; - return secondaries.hasNext(); - } - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() - { - if( ! hasNext() ) - throw new NoSuchElementException(); - - if( ! donePrimary ) - { - donePrimary = true; - return primaryDeclaration; - } - - return secondaries.next(); - } - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() - { - throw new UnsupportedOperationException(); - } - } - protected List otherDefinitions = new ArrayList(); - /** - * @param symbol - * @param primaryDeclaration - */ - public NamespaceSymbolExtension( - ISymbol symbol, - ASTSymbol primaryDeclaration) - { - super(symbol, primaryDeclaration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension#getAllDefinitions() - */ - public Iterator getAllDefinitions() - { - return new LocalIterator(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension#addDefinition(org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol) - */ - public void addDefinition(ASTSymbol definition) throws ExtensionException - { - otherDefinitions.add( definition ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParameterizedSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParameterizedSymbol.java deleted file mode 100644 index 076c65eb904..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParameterizedSymbol.java +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Nov 6, 2003 - */ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.Command; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ParameterizedSymbol extends ContainerSymbol implements IParameterizedSymbol { - - protected ParameterizedSymbol( ParserSymbolTable table, String name ){ - super( table, name ); - } - - protected ParameterizedSymbol( ParserSymbolTable table, String name, ISymbolASTExtension obj ){ - super( table, name, obj ); - } - - protected ParameterizedSymbol( ParserSymbolTable table, String name, TypeInfo.eType typeInfo ){ - super( table, name, typeInfo ); - } - - public Object clone(){ - ParameterizedSymbol copy = (ParameterizedSymbol)super.clone(); - - copy._parameterList = ( _parameterList != null ) ? (LinkedList) _parameterList.clone() : null; - copy._parameterMap = ( _parameterMap != null ) ? (HashMap) _parameterMap.clone() : null; - - copy._argumentList = ( _argumentList != null ) ? (LinkedList) _argumentList.clone() : null; - copy._specializations = ( _specializations != null ) ? (LinkedList) _specializations.clone() : null; - - return copy; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#addParameter(org.eclipse.cdt.internal.core.parser.pst.ISymbol) - */ - public void addParameter( ISymbol param ){ - List paramList = getParameterList(); - - paramList.add( param ); - - String name = param.getName(); - if( name != null && !name.equals(ParserSymbolTable.EMPTY_NAME) ) - { - Map paramMap = getParameterMap(); - - if( !paramMap.containsKey( name ) ) - paramMap.put( name, param ); - } - - param.setContainingSymbol( this ); - param.setIsTemplateMember( isTemplateMember() || getType() == TypeInfo.t_template ); - - Command command = new AddParameterCommand( this, (BasicSymbol)param ); - getSymbolTable().pushCommand( command ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#addParameter(org.eclipse.cdt.internal.core.parser.pst.TypeInfo.eType, int, org.eclipse.cdt.internal.core.parser.pst.TypeInfo.PtrOp, boolean) - */ - public void addParameter( TypeInfo.eType type, int info, TypeInfo.PtrOp ptrOp, boolean hasDefault ){ - BasicSymbol param = new BasicSymbol(getSymbolTable(), ParserSymbolTable.EMPTY_NAME); - - TypeInfo t = param.getTypeInfo(); - t.setTypeInfo( info ); - t.setType( type ); - t.addPtrOperator( ptrOp ); - t.setHasDefault( hasDefault ); - - addParameter( param ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#addParameter(org.eclipse.cdt.internal.core.parser.pst.ISymbol, org.eclipse.cdt.internal.core.parser.pst.TypeInfo.PtrOp, boolean) - */ - public void addParameter( ISymbol typeSymbol, TypeInfo.PtrOp ptrOp, boolean hasDefault ){ - BasicSymbol param = new BasicSymbol(getSymbolTable(), ParserSymbolTable.EMPTY_NAME); - - TypeInfo info = param.getTypeInfo(); - info.setType( TypeInfo.t_type ); - info.setTypeSymbol( typeSymbol ); - info.addPtrOperator( ptrOp ); - info.setHasDefault( hasDefault ); - - addParameter( param ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#addArgument(org.eclipse.cdt.internal.core.parser.pst.ISymbol) - */ - public void addArgument( ISymbol arg ){ - List argumentList = getArgumentList(); - argumentList.add( arg ); - - arg.setIsTemplateMember( isTemplateMember() || getType() == TypeInfo.t_template ); - - Command command = new AddArgumentCommand( this, (BasicSymbol) arg ); - getSymbolTable().pushCommand( command ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#getArgumentList() - */ - public List getArgumentList(){ - if( _argumentList == null ){ - _argumentList = new LinkedList(); - } - return _argumentList; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#setArgumentList(java.util.List) - */ -// public void setArgumentList( List list ){ -// _argumentList = new LinkedList( list ); -// } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#getParameterMap() - */ - public Map getParameterMap(){ - if( _parameterMap == null ){ - _parameterMap = new HashMap(); - } - return _parameterMap; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#getParameterList() - */ - public List getParameterList(){ - if( _parameterList == null ){ - _parameterList = new LinkedList(); - } - return _parameterList; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#setParameterList(java.util.List) - */ -// public void setParameterList( List list ){ -// _parameterList = new LinkedList( list ); -// } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#hasSameParameters(org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol) - */ - public boolean hasSameParameters( IParameterizedSymbol function ){ - if( function.getType() != getType() ){ - return false; - } - - int size = ( getParameterList() == null ) ? 0 : getParameterList().size(); - int fsize = ( function.getParameterList() == null ) ? 0 : function.getParameterList().size(); - if( fsize != size ){ - return false; - } - if( fsize == 0 ) - return true; - - Iterator iter = getParameterList().iterator(); - Iterator fIter = function.getParameterList().iterator(); - - TypeInfo info = null; - TypeInfo fInfo = null; - - for( int i = size; i > 0; i-- ){ - info = ((BasicSymbol)iter.next()).getTypeInfo(); - fInfo = ((BasicSymbol) fIter.next()).getTypeInfo(); - - if( !info.equals( fInfo ) ){ - return false; - } - } - - - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#setReturnType(org.eclipse.cdt.internal.core.parser.pst.ISymbol) - */ - public void setReturnType( ISymbol type ){ - _returnType = type; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#getReturnType() - */ - public ISymbol getReturnType(){ - return _returnType; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#hasSpecializations() - */ - public boolean hasSpecializations(){ - return ( _specializations != null && !_specializations.isEmpty() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#addSpecialization(org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol) - */ - public void addSpecialization( IParameterizedSymbol spec ){ - List specializationList = getSpecializations(); - specializationList.add( spec ); - - spec.setContainingSymbol( getContainingSymbol() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.IParameterizedSymbol#getSpecializations() - */ - public List getSpecializations() { - if( _specializations == null ){ - _specializations = new LinkedList(); - } - return _specializations; - } - - public void setHasVariableArgs( boolean var ){ - _hasVarArgs = var; - } - - public boolean hasVariableArgs( ){ - return _hasVarArgs; - } - - static private class AddParameterCommand extends Command{ - public AddParameterCommand( IParameterizedSymbol container, ISymbol parameter ){ - _decl = container; - _param = parameter; - } - - public void undoIt(){ - _decl.getParameterList().remove( _param ); - - String name = _param.getName(); - if( name != null && !name.equals( ParserSymbolTable.EMPTY_NAME) ) - { - _decl.getParameterMap().remove( name ); - } - } - - private IParameterizedSymbol _decl; - private ISymbol _param; - } - - static private class AddArgumentCommand extends Command{ - public AddArgumentCommand( IParameterizedSymbol container, ISymbol arg ){ - _decl = container; - _arg = arg; - } - public void undoIt(){ - _decl.getArgumentList().remove( _arg ); - } - - private IParameterizedSymbol _decl; - private ISymbol _arg; - } - - private LinkedList _parameterList; //have my cake - private HashMap _parameterMap; //and eat it too - private LinkedList _specializations; //template specializations - private LinkedList _argumentList; //template specialization arguments - private ISymbol _returnType; - private boolean _hasVarArgs = false; //whether or not this function has variable arguments -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java deleted file mode 100644 index 891b65e8874..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTable.java +++ /dev/null @@ -1,2481 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05. html - * - * Contributors: - * Rational Software - Initial API and implementation - * -***********************************************************************/ - - -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Set; - -import org.eclipse.cdt.core.parser.Enum; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTMember; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol.IParentSymbol; -import org.eclipse.cdt.internal.core.parser.pst.TypeInfo.PtrOp; - -/** - * @author aniefer - */ - -public class ParserSymbolTable { - - public static final String EMPTY_NAME = ""; //$NON-NLS-1$ - public static final String THIS = "this"; //$NON-NLS-1$ - - /** - * Constructor for ParserSymbolTable. - */ - public ParserSymbolTable( ParserLanguage language ) { - super(); - _compilationUnit = newContainerSymbol( EMPTY_NAME, TypeInfo.t_namespace ); - _language = language; - } - - public IContainerSymbol getCompilationUnit(){ - return _compilationUnit; - } - - public IContainerSymbol newContainerSymbol( String name ){ - return new ContainerSymbol( this, name ); - } - public IContainerSymbol newContainerSymbol( String name, TypeInfo.eType type ){ - return new ContainerSymbol( this, name, type ); - } - - public ISymbol newSymbol( String name ){ - return new BasicSymbol( this, name ); - } - public ISymbol newSymbol( String name, TypeInfo.eType type ){ - return new BasicSymbol( this, name, type ); - } - - public IDerivableContainerSymbol newDerivableContainerSymbol( String name ){ - return new DerivableContainerSymbol( this, name ); - } - public IDerivableContainerSymbol newDerivableContainerSymbol( String name, TypeInfo.eType type ){ - return new DerivableContainerSymbol( this, name, type ); - } - public IParameterizedSymbol newParameterizedSymbol( String name ){ - return new ParameterizedSymbol( this, name ); - } - public IParameterizedSymbol newParameterizedSymbol( String name, TypeInfo.eType type ){ - return new ParameterizedSymbol( this, name, type ); - } - public ISpecializedSymbol newSpecializedSymbol( String name ){ - return new SpecializedSymbol( this, name ); - } -// public ISpecializedSymbol newSpecializedSymbol( String name, TypeInfo.eType type ){ -// return new Declaration( this, name, type ); -// } - /** - * Lookup the name from LookupData starting in the inDeclaration - * @param data - * @param inDeclaration - * @return Declaration - * @throws ParserSymbolTableException - */ - static protected void lookup( LookupData data, IContainerSymbol inSymbol ) throws ParserSymbolTableException - { -// if( data.type != TypeInfo.t_any && data.type.compareTo(TypeInfo.t_class) < 0 && data.upperType.compareTo(TypeInfo.t_union) > 0 ){ -// throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo ); -// } - - //handle namespace aliases - if( inSymbol.isType( TypeInfo.t_namespace ) ){ - ISymbol symbol = inSymbol.getTypeSymbol(); - if( symbol != null && symbol.isType( TypeInfo.t_namespace ) ){ - inSymbol = (IContainerSymbol) symbol; - } - } - - ISymbol symbol = null; //the return value - LinkedList transitives = new LinkedList(); //list of transitive using directives - - //if this name define in this scope? - Map map = null; - if( !data.usingDirectivesOnly ){ - map = lookupInContained( data, inSymbol ); - if( data.foundItems == null || data.foundItems.isEmpty() ){ - data.foundItems = map; - } else { - mergeResults( data, data.foundItems, map ); - } - } - - if( inSymbol.getSymbolTable().getLanguage() == ParserLanguage.CPP && - !data.ignoreUsingDirectives ) - { - //check nominated namespaces - //the transitives list is populated in LookupInNominated, and then - //processed in ProcessDirectives - - data.visited.clear(); //each namesapce is searched at most once, so keep track - - lookupInNominated( data, inSymbol, transitives ); - - //if we are doing a qualified lookup, only process using directives if - //we haven't found the name yet (and if we aren't ignoring them). - if( !data.qualified || data.foundItems == null || data.foundItems.isEmpty() ){ - processDirectives( inSymbol, data, transitives ); - - if( inSymbol.hasUsingDirectives() ){ - processDirectives( inSymbol, data, inSymbol.getUsingDirectives() ); - } - - while( data.usingDirectives != null && data.usingDirectives.get( inSymbol ) != null ){ - transitives.clear(); - - lookupInNominated( data, inSymbol, transitives ); - - if( !data.qualified || data.foundItems == null ){ - processDirectives( inSymbol, data, transitives ); - } - } - } - } - - if( data.mode == LookupMode.NORMAL && ( !data.foundItems.isEmpty() || data.stopAt == inSymbol ) ){ - return; - } - - if( !data.usingDirectivesOnly && inSymbol instanceof IDerivableContainerSymbol ){ - //if we still havn't found it, check any parents we have - data.visited.clear(); //each virtual base class is searched at most once - map = lookupInParents( data, (IDerivableContainerSymbol)inSymbol ); - - if( data.foundItems == null || data.foundItems.isEmpty() ){ - data.foundItems = map; - } else { - mergeInheritedResults( data.foundItems, map ); - } - } - - //if still not found, check our containing scope. - if( ( data.foundItems == null || data.foundItems.isEmpty() || data.mode == LookupMode.PREFIX ) - && inSymbol.getContainingSymbol() != null ) - { - if( data.qualified ){ - if( data.usingDirectives != null && !data.usingDirectives.isEmpty() ){ - data.usingDirectivesOnly = true; - lookup( data, inSymbol.getContainingSymbol() ); - - } - } else { - lookup( data, inSymbol.getContainingSymbol() ); - } - - } - - return; - } - - /** - * function LookupInNominated - * @param data - * @param transitiveDirectives - * @return List - * - * for qualified: - * 3.4.3.2-2 "let S be the set of all declarations of m in X - * and in the transitive closure of all namespaces nominated by using- - * directives in X and its used namespaces, except that using-directives are - * ignored in any namespace, including X, directly containing one or more - * declarations of m." - * - * for unqualified: - * 7.3.4-2 The using-directive is transitive: if a scope contains a using - * directive that nominates a second namespace that itself contains using- - * directives, the effect is as if the using-directives from the second - * namespace also appeared in the first. - */ - static private void lookupInNominated( LookupData data, IContainerSymbol symbol, LinkedList transitiveDirectives ) throws ParserSymbolTableException{ - //if the data.usingDirectives is empty, there is nothing to do. - if( data.usingDirectives == null ){ - return; - } - - //local variables - LinkedList directives = null; //using directives association with declaration - Iterator iter = null; - IContainerSymbol temp = null; - - boolean foundSomething = false; - int size = 0; - - directives = (LinkedList) data.usingDirectives.remove( symbol ); - - if( directives == null ){ - return; - } - - iter = directives.iterator(); - size = directives.size(); - for( int i = size; i > 0; i-- ){ - temp = (IContainerSymbol) iter.next(); - - //namespaces are searched at most once - if( !data.visited.contains( temp ) ){ - data.visited.add( temp ); - - Map map = lookupInContained( data, temp ); - foundSomething = !map.isEmpty(); - mergeResults( data, data.foundItems, map ); - - //only consider the transitive using directives if we are an unqualified - //lookup, or we didn't find the name in decl - if( (!data.qualified || !foundSomething || data.mode == LookupMode.PREFIX ) && temp.getUsingDirectives() != null ){ - //name wasn't found, add transitive using directives for later consideration - transitiveDirectives.addAll( temp.getUsingDirectives() ); - } - } - } - - return; - } - - /** - * @param map - * @param map2 - */ - private static void mergeResults( LookupData data, Map resultMap, Map map ) throws ParserSymbolTableException { - if( resultMap == null || map == null || map.isEmpty() ){ - return; - } - - Iterator keyIterator = map.keySet().iterator(); - Object key = null; - while( keyIterator.hasNext() ){ - key = keyIterator.next(); - if( resultMap.containsKey( key ) ){ - List list = new LinkedList(); - Object obj = resultMap.get( key ); - - if ( obj instanceof List ) list.addAll( (List) obj ); - else list.add( obj ); - - obj = map.get( key ); - - if( obj instanceof List ) list.addAll( (List) obj ); - else list.add( obj ); - - resultMap.put( key, collectSymbol( data, list ) ); - } else { - resultMap.put( key, map.get( key ) ); - } - } - } - - /** - * function LookupInContained - * @param data - * @return List - * - * Look for data.name in our collection _containedDeclarations - */ - protected static Map lookupInContained( LookupData data, IContainerSymbol lookIn ) throws ParserSymbolTableException{ - Map found = new LinkedHashMap(); - - boolean foundSomething = false; - ISymbol temp = null; - Object obj = null; - - if( data.associated != null ){ - //we are looking in lookIn, remove it from the associated scopes list - data.associated.remove( lookIn ); - } - - Map declarations = lookIn.getContainedSymbols(); - - Iterator iterator = ( data.mode == LookupMode.PREFIX ) ? declarations.keySet().iterator() : null; - String name = ( iterator != null && iterator.hasNext() ) ? (String) iterator.next() : data.name; - - while( name != null ) { - if( nameMatches( data, name ) ){ - obj = ( declarations != null ) ? declarations.get( name ) : null; - - obj = collectSymbol( data, obj ); - - if( obj != null ) - found.put( name, obj ); - } - - if( iterator != null && iterator.hasNext() ){ - name = (String) iterator.next(); - } else { - name = null; - } - } - - if( !found.isEmpty() && data.mode == LookupMode.NORMAL ){ - return found; - } - - if( lookIn instanceof IParameterizedSymbol ){ - Map parameters = ((IParameterizedSymbol)lookIn).getParameterMap(); - if( parameters != null ){ - iterator = ( data.mode == LookupMode.PREFIX ) ? parameters.keySet().iterator() : null; - name = ( iterator != null && iterator.hasNext() ) ? (String) iterator.next() : data.name; - while( name != null ){ - if( nameMatches( data, name ) ){ - obj = parameters.get( name ); - obj = collectSymbol( data, obj ); - if( obj != null ){ - found.put( name, obj ); - } - } - if( iterator != null && iterator.hasNext() ){ - name = (String) iterator.next(); - } else { - name = null; - } - } - - } - } - - return found; - } - - private static boolean nameMatches( LookupData data, String name ){ - if( data.mode == LookupMode.PREFIX ){ - return name.regionMatches( true, 0, data.name, 0, data.name.length() ); - } else { - return name.equals( data.name ); - } - } - private static boolean checkType( LookupData data, ISymbol symbol ) { //, TypeInfo.eType type, TypeInfo.eType upperType ){ - if( data.filter == null ){ - return true; - } - - if( data.templateInstance != null && symbol.isTemplateMember() ){ - if( symbol.isType( TypeInfo.t_type ) ){ - symbol = symbol.getTypeSymbol(); - } - if( symbol.isType( TypeInfo.t_undef ) && symbol.getContainingSymbol().isType( TypeInfo.t_template ) ){ - TypeInfo info = (TypeInfo) data.templateInstance.getArgumentMap().get( symbol ); - return data.filter.shouldAccept( symbol, info ); - } - } - return data.filter.shouldAccept( symbol ); - } - - private static Object collectSymbol(LookupData data, Object object ) throws ParserSymbolTableException { - if( object == null ){ - return null; - } - - ISymbol foundSymbol = null; - - Iterator iter = ( object instanceof List ) ? ((List)object).iterator() : null; - ISymbol symbol = ( iter != null ) ? (ISymbol) iter.next() : (ISymbol) object; - - Set functionSet = new HashSet(); - ISymbol obj = null; - IContainerSymbol cls = null; - - while( symbol != null ){ - if( !symbol.getIsInvisible() && checkType( data, symbol ) ){//, data.type, data.upperType ) ){ - if( symbol.isTemplateMember() && data.templateInstance != null ) - foundSymbol = new TemplateInstance( symbol.getSymbolTable(), symbol, data.templateInstance.getArgumentMap() ); - else - foundSymbol = symbol; - - if( foundSymbol.isType( TypeInfo.t_function ) ){ - if( foundSymbol.isForwardDeclaration() && foundSymbol.getTypeSymbol() != null ){ - foundSymbol = foundSymbol.getTypeSymbol(); - } - - functionSet.add( foundSymbol ); - } else { - //if this is a class-name, other stuff hides it - if( foundSymbol.isType( TypeInfo.t_class, TypeInfo.t_enumeration ) ){ - if( cls == null ){ - cls = (IContainerSymbol) foundSymbol; - } else { - if( cls.getTypeInfo().isForwardDeclaration() && cls.getTypeSymbol() == foundSymbol ){ - //cls is a forward declaration of decl, we want decl. - cls = (IContainerSymbol) foundSymbol; - } else if( foundSymbol.getTypeInfo().isForwardDeclaration() && foundSymbol.getTypeSymbol() == cls ){ - //decl is a forward declaration of cls, we already have what we want (cls) - } else { - if( data.mode == LookupMode.PREFIX ){ - if( data.ambiguities == null ){ - data.ambiguities = new HashSet(); - } - data.ambiguities.add( foundSymbol.getName() ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } - } - } - } else { - //an object, can only have one of these - if( obj == null ){ - obj = foundSymbol; - } else { - if( data.mode == LookupMode.PREFIX ){ - if( data.ambiguities == null ){ - data.ambiguities = new HashSet(); - } - data.ambiguities.add( foundSymbol.getName() ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } - } - } - } - } - - if( iter != null ){ - symbol = iter.hasNext() ? (ISymbol) iter.next() : null; - } else { - symbol = null; - } - } - - int numFunctions = functionSet.size(); - - boolean ambiguous = false; - - if( cls != null ){ - //the class is only hidden by other stuff if they are from the same scope - if( obj != null && cls.getContainingSymbol() != obj.getContainingSymbol()){ - ambiguous = true; - } - if( !functionSet.isEmpty() ){ - Iterator fnIter = functionSet.iterator(); - IParameterizedSymbol fn = null; - for( int i = numFunctions; i > 0; i-- ){ - fn = (IParameterizedSymbol) fnIter.next(); - if( cls.getContainingSymbol()!= fn.getContainingSymbol()){ - ambiguous = true; - break; - } - } - } - } - - if( obj != null && !ambiguous ){ - if( numFunctions > 0 ){ - ambiguous = true; - } else { - return obj; - } - } else if( numFunctions > 0 ) { - return new LinkedList( functionSet ); - } - - if( ambiguous ){ - if( data.mode == LookupMode.PREFIX ){ - if( data.ambiguities == null ){ - data.ambiguities = new HashSet(); - } - data.ambiguities.add( foundSymbol.getName() ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } - } - - return cls; - } - /** - * - * @param data - * @param lookIn - * @return Declaration - * @throws ParserSymbolTableException - */ - private static Map lookupInParents( LookupData data, ISymbol lookIn ) throws ParserSymbolTableException{ - IDerivableContainerSymbol container = null; - /*if( lookIn instanceof TemplateInstance ){ - - } else*/ - if( lookIn instanceof IDerivableContainerSymbol ){ - container = (IDerivableContainerSymbol) lookIn; - } else{ - throw new ParserSymbolTableException( ParserSymbolTableException.r_InternalError ); - } - - List scopes = container.getParents(); - - Map temp = null; - Map symbol = null; - Map inherited = null; - - Iterator iterator = null; - IDerivableContainerSymbol.IParentSymbol wrapper = null; - - if( scopes == null ) - return null; - - //use data to detect circular inheritance - if( data.inheritanceChain == null ) - data.inheritanceChain = new HashSet(); - - data.inheritanceChain.add( container ); - - iterator = scopes.iterator(); - - int size = scopes.size(); - - for( int i = size; i > 0; i-- ) - { - wrapper = (IDerivableContainerSymbol.IParentSymbol) iterator.next(); - ISymbol parent = wrapper.getParent(); - if( parent.isType( TypeInfo.t_undef ) && parent.getContainingSymbol().isType( TypeInfo.t_template ) ){ - TypeInfo info = (TypeInfo) data.templateInstance.getArgumentMap().get( parent ); - if( info.getTypeSymbol() instanceof IDerivableContainerSymbol ){ - parent = (IDerivableContainerSymbol) info.getTypeSymbol(); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate ); - } - } - if( !wrapper.isVirtual() || !data.visited.contains( parent ) ){ - if( wrapper.isVirtual() ){ - data.visited.add( parent ); - } - - //if the inheritanceChain already contains the parent, then that - //is circular inheritance - if( ! data.inheritanceChain.contains( parent ) ){ - //is this name define in this scope? - if( parent instanceof TemplateInstance ){ - ISymbol tempInstance = data.templateInstance; - data.templateInstance = (TemplateInstance) parent; - ISymbol instance = ((TemplateInstance)parent).getInstantiatedSymbol(); - if( instance instanceof IContainerSymbol ) - temp = lookupInContained( data, (IContainerSymbol)instance ); - else - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate ); - data.templateInstance = tempInstance; - } else if( parent instanceof IDerivableContainerSymbol ){ - temp = lookupInContained( data, (IDerivableContainerSymbol) parent ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTypeInfo ); - } - - if( temp.isEmpty() || data.mode == LookupMode.PREFIX ){ - inherited = lookupInParents( data, parent ); - mergeInheritedResults( temp, inherited ); - } - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_CircularInheritance ); - } - } - - if( temp != null && !temp.isEmpty() ){ - if( symbol == null || symbol.isEmpty() ){ - symbol = temp; - } else if ( temp != null && !temp.isEmpty() ) { - Iterator iter = temp.keySet().iterator(); - Object key = null; - while( iter.hasNext() ){ - key = iter.next(); - if( symbol.containsKey( key ) ){ - ISymbol sym = (ISymbol) symbol.get( key ); - if( !checkAmbiguity( sym, temp.get( key ) ) ){ - if( data.mode == LookupMode.PREFIX ){ - if( data.ambiguities == null ){ - data.ambiguities = new HashSet(); - } - data.ambiguities.add( sym.getName() ); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } - } - } else { - symbol.put( key, temp.get( key ) ); - } - } - } - } else { - temp = null; //reset temp for next iteration - } - } - - data.inheritanceChain.remove( container ); - - return symbol; - } - - private static boolean checkAmbiguity( Object obj1, Object obj2 ) throws ParserSymbolTableException{ - //it is not ambiguous if they are the same thing and it is static or an enumerator - if( obj1 == obj2 ){ - - Iterator iter = ( obj1 instanceof List ) ? ((List) obj1).iterator() : null; - ISymbol symbol = ( iter != null ) ? (ISymbol) iter.next() : ( ISymbol )obj1; - while( symbol != null ) { - TypeInfo type = ((ISymbol)obj1).getTypeInfo(); - if( !type.checkBit( TypeInfo.isStatic ) && !type.isType( TypeInfo.t_enumerator ) ){ - return false; - } - - if( iter != null && iter.hasNext() ){ - symbol = (ISymbol) iter.next(); - } else { - symbol = null; - } - } - return true; - } - return false; - } - - /** - * Symbols in map are added to the resultMap if a symbol with that name does not already exist there - * @param resultMap - * @param map - * @throws ParserSymbolTableException - */ - private static void mergeInheritedResults( Map resultMap, Map map ) throws ParserSymbolTableException{ - if( resultMap == null || map == null || map.isEmpty() ){ - return; - } - - Iterator keyIterator = map.keySet().iterator(); - Object key = null; - while( keyIterator.hasNext() ){ - key = keyIterator.next(); - if( !resultMap.containsKey( key ) ){ - resultMap.put( key, map.get( key ) ); - } - } - } - - /** - * function isValidOverload - * @param origDecl - * @param newDecl - * @return boolean - * - * 3.3.7 "A class name or enumeration name can be hidden by the name of an - * object, function or enumerator declared in the same scope" - * - * 3.4-1 "Name lookup may associate more than one declaration with a name if - * it finds the name to be a function name" - */ - protected static boolean isValidOverload( ISymbol origSymbol, ISymbol newSymbol ){ - TypeInfo.eType origType = origSymbol.getType(); - TypeInfo.eType newType = newSymbol.getType(); - - //handle forward decls - if( origSymbol.getTypeInfo().isForwardDeclaration() ){ - if( origSymbol.getTypeSymbol() == newSymbol ) - return true; - - //friend class declarations - if( origSymbol.getIsInvisible() && origSymbol.isType( newSymbol.getType() ) ){ - origSymbol.getTypeInfo().setTypeSymbol( newSymbol ); - return true; - } - } - - if( (origType.compareTo(TypeInfo.t_class) >= 0 && origType.compareTo(TypeInfo.t_enumeration) <= 0) && //class name or enumeration ... - ( newType == TypeInfo.t_type || (newType.compareTo( TypeInfo.t_function ) >= 0 /*&& newType <= TypeInfo.typeMask*/) ) ){ - - return true; - } - //if the origtype is not a class-name or enumeration name, then the only other - //allowable thing is if they are both functions. - if( origSymbol instanceof IParameterizedSymbol && newSymbol instanceof IParameterizedSymbol ) - return isValidFunctionOverload( (IParameterizedSymbol) origSymbol, (IParameterizedSymbol) newSymbol ); - else - return false; - } - - protected static boolean isValidOverload( List origList, ISymbol newSymbol ){ - if( origList.size() == 1 ){ - return isValidOverload( (ISymbol)origList.iterator().next(), newSymbol ); - } else if ( origList.size() > 1 ){ - - //the first thing can be a class-name or enumeration name, but the rest - //must be functions. So make sure the newDecl is a function before even - //considering the list - if( newSymbol.getType() != TypeInfo.t_function && newSymbol.getType() != TypeInfo.t_constructor ){ - return false; - } - - Iterator iter = origList.iterator(); - ISymbol symbol = (ISymbol) iter.next(); - boolean valid = isValidOverload( symbol, newSymbol );//( (symbol.getType().compareTo( TypeInfo.t_class ) >= 0 ) && (symbol.getType().compareTo( TypeInfo.t_enumeration ) <= 0 ) ); - - if( !valid && (symbol instanceof IParameterizedSymbol) ) - valid = isValidFunctionOverload( (IParameterizedSymbol)symbol, (IParameterizedSymbol)newSymbol ); - - while( valid && iter.hasNext() ){ - symbol = (ISymbol) iter.next(); - valid = ( symbol instanceof IParameterizedSymbol) && isValidFunctionOverload( (IParameterizedSymbol)symbol, (IParameterizedSymbol)newSymbol ); - } - - return valid; - } - - //empty list, return true - return true; - } - - private static boolean isValidFunctionOverload( IParameterizedSymbol origSymbol, IParameterizedSymbol newSymbol ){ - if( ( !origSymbol.isType( TypeInfo.t_function ) && !origSymbol.isType( TypeInfo.t_constructor ) ) || - ( ! newSymbol.isType( TypeInfo.t_function ) && ! newSymbol.isType( TypeInfo.t_constructor ) ) ){ - return false; - } - - //handle forward decls - if( origSymbol.getTypeInfo().isForwardDeclaration() && - origSymbol.getTypeSymbol() == newSymbol ) - { - return true; - } - if( origSymbol.hasSameParameters( newSymbol ) ){ - //functions with the same name and same parameter types cannot be overloaded if any of them - //is static - if( origSymbol.getTypeInfo().checkBit( TypeInfo.isStatic ) || newSymbol.getTypeInfo().checkBit( TypeInfo.isStatic ) ){ - return false; - } - - //if none of them are static, then the function can be overloaded if they differ in the type - //of their implicit object parameter. - if( origSymbol.compareCVQualifiersTo( newSymbol ) != 0 ){ - return true; - } - - return false; - } - - return true; - } - - /** - * - * @param data - * @return Declaration - * @throws ParserSymbolTableException - * - * Resolve the foundItems set down to one declaration and return that - * declaration. - * If we successfully resolve, then the data.foundItems list will be - * cleared. If however, we were not able to completely resolve the set, - * then the data.foundItems set will be left with those items that - * survived the partial resolution and we will return null. (currently, - * this case applies to when we have overloaded functions and no parameter - * information) - * - * NOTE: data.parameters == null means there is no parameter information at - * all, when looking for functions with no parameters, an empty list must be - * provided in data.parameters. - */ - static protected ISymbol resolveAmbiguities( LookupData data ) throws ParserSymbolTableException{ - ISymbol decl = null; - ISymbol obj = null; - IContainerSymbol cls = null; - - if( data.foundItems == null || data.foundItems.isEmpty() || data.mode == LookupMode.PREFIX ){ - return null; - } - - int size = data.foundItems.size(); - //Iterator iter = data.foundItems.iterator(); - - Object object = data.foundItems.get( data.name ); - - LinkedList functionList = new LinkedList(); - - if( object instanceof List ){ - functionList.addAll( (List) object ); - } else { - ISymbol symbol = (ISymbol) object; - if( symbol.isType( TypeInfo.t_function ) ){ - functionList.add( symbol ); - } else { - return symbol; - } - } - - if( data.parameters == null ){ - //we have no parameter information, if we only have one function, return - //that, otherwise we can't decide between them - if( functionList.size() == 1){ - return (ISymbol) functionList.getFirst(); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_UnableToResolveFunction ); - } - } else { - return resolveFunction( data, functionList ); - } - } - - static protected IParameterizedSymbol resolveFunction( LookupData data, List functions ) throws ParserSymbolTableException{ - if( functions == null ){ - return null; - } - - reduceToViable( data, functions ); - - int numSourceParams = ( data.parameters == null ) ? 0 : data.parameters.size(); - int numFns = functions.size(); - - if( numSourceParams == 0 ){ - //no parameters - //if there is only 1 viable function, return it, if more than one, its ambiguous - if( numFns == 0 ){ - return null; - } else if ( numFns == 1 ){ - return (IParameterizedSymbol)functions.iterator().next(); - } else if ( numFns == 2 ){ - Iterator iter = functions.iterator(); - while( iter.hasNext() ){ - IParameterizedSymbol fn = (IParameterizedSymbol) iter.next(); - if( fn.getTypeInfo().isForwardDeclaration() && fn.getTypeSymbol() != null ){ - if( functions.contains( fn.getTypeSymbol() ) ){ - return (IParameterizedSymbol) fn.getTypeSymbol(); - } - } - } - } - - if( data.parameters == null ) - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } - - IParameterizedSymbol bestFn = null; //the best function - IParameterizedSymbol currFn = null; //the function currently under consideration - Cost [] bestFnCost = null; //the cost of the best function - Cost [] currFnCost = null; //the cost for the current function - - Iterator iterFns = functions.iterator(); - Iterator sourceParams = null; - Iterator targetParams = null; - - int numTargetParams = 0; - int comparison; - Cost cost = null; - Cost temp = null; - - TypeInfo source = null; - TypeInfo target = null; - - boolean hasWorse = false; - boolean hasBetter = false; - boolean ambiguous = false; - boolean currHasAmbiguousParam = false; - boolean bestHasAmbiguousParam = false; - - List parameters = null; - - if( numSourceParams == 0 ){ - parameters = new LinkedList(); - parameters.add( new TypeInfo( TypeInfo.t_void, 0, null ) ); - numSourceParams = 1; - } else { - parameters = data.parameters; - } - - for( int i = numFns; i > 0; i-- ){ - currFn = (IParameterizedSymbol) iterFns.next(); - - if( bestFn != null ){ - if( bestFn.isForwardDeclaration() && bestFn.getTypeSymbol() == currFn ){ - bestFn = currFn; - continue; - } else if( currFn.isForwardDeclaration() && currFn.getTypeSymbol() == bestFn ){ - continue; - } - } - - sourceParams = parameters.iterator(); - - List parameterList = null; - if( currFn.getParameterList().isEmpty() && !currFn.hasVariableArgs() ){ - //the only way we get here and have no parameters, is if we are looking - //for a function that takes void parameters ie f( void ) - parameterList = new LinkedList(); - parameterList.add( currFn.getSymbolTable().newSymbol( "", TypeInfo.t_void ) ); - } else { - parameterList = currFn.getParameterList(); - } - - targetParams = parameterList.iterator(); - numTargetParams = parameterList.size(); - - if( currFnCost == null ){ - currFnCost = new Cost [ numSourceParams ]; - } - - comparison = 0; - boolean varArgs = false; - - for( int j = 0; j < numSourceParams; j++ ){ - source = (TypeInfo) sourceParams.next(); - - if( targetParams.hasNext() ) - target = ((ISymbol)targetParams.next()).getTypeInfo(); - else - varArgs = true; - - if( varArgs ){ - cost = new Cost( source, null ); - cost.rank = Cost.ELLIPSIS_CONVERSION; - } else if ( target.getHasDefault() && source.isType( TypeInfo.t_void ) && !source.hasPtrOperators() ){ - //source is just void, ie no parameter, if target had a default, then use that - cost = new Cost( source, target ); - cost.rank = Cost.IDENTITY_RANK; - } else if( source.equals( target ) ){ - cost = new Cost( source, target ); - cost.rank = Cost.IDENTITY_RANK; //exact match, no cost - } else { - - cost = checkStandardConversionSequence( source, target ); - - //12.3-4 At most one user-defined conversion is implicitly applied to - //a single value. (also prevents infinite loop) - if( cost.rank == Cost.NO_MATCH_RANK && !data.forUserDefinedConversion ){ - temp = checkUserDefinedConversionSequence( source, target ); - if( temp != null ){ - cost = temp; - } - } - } - - currFnCost[ j ] = cost; - } - - - hasWorse = false; - hasBetter = false; - //In order for this function to be better than the previous best, it must - //have at least one parameter match that is better that the corresponding - //match for the other function, and none that are worse. - for( int j = 0; j < numSourceParams; j++ ){ - if( currFnCost[ j ].rank < 0 ){ - hasWorse = true; - hasBetter = false; - break; - } - - //an ambiguity in the user defined conversion sequence is only a problem - //if this function turns out to be the best. - currHasAmbiguousParam = ( currFnCost[ j ].userDefined == 1 ); - - if( bestFnCost != null ){ - comparison = currFnCost[ j ].compare( bestFnCost[ j ] ); - hasWorse |= ( comparison < 0 ); - hasBetter |= ( comparison > 0 ); - } else { - hasBetter = true; - } - } - - //If function has a parameter match that is better than the current best, - //and another that is worse (or everything was just as good, neither better nor worse). - //then this is an ambiguity (unless we find something better than both later) - ambiguous |= ( hasWorse && hasBetter ) || ( !hasWorse && !hasBetter ); - - if( !hasWorse ){ - if( hasBetter ){ - //the new best function. - ambiguous = false; - bestFnCost = currFnCost; - bestHasAmbiguousParam = currHasAmbiguousParam; - currFnCost = null; - bestFn = currFn; - } - } - } - - if( ambiguous || bestHasAmbiguousParam ){ - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } - - return bestFn; - } - - static private void reduceToViable( LookupData data, List functions ){ - int numParameters = ( data.parameters == null ) ? 0 : data.parameters.size(); - int num; - - //Trim the list down to the set of viable functions - IParameterizedSymbol function; - Iterator iter = functions.iterator(); - while( iter.hasNext() ){ - function = (IParameterizedSymbol) iter.next(); - num = ( function.getParameterList() == null ) ? 0 : function.getParameterList().size(); - - //if there are m arguments in the list, all candidate functions having m parameters - //are viable - if( num == numParameters ){ - continue; - } - //check for void - else if( numParameters == 0 && num == 1 ){ - ISymbol param = (ISymbol)function.getParameterList().iterator().next(); - if( param.isType( TypeInfo.t_void ) ) - continue; - } - else if( numParameters == 1 && num == 0 ){ - TypeInfo paramType = (TypeInfo) data.parameters.iterator().next(); - if( paramType.isType( TypeInfo.t_void ) ) - continue; - } - - //A candidate function having fewer than m parameters is viable only if it has an - //ellipsis in its parameter list. - if( num < numParameters ){ - if( function.hasVariableArgs() ) { - continue; - } else { - //not enough parameters, remove it - iter.remove(); - } - } - //a candidate function having more than m parameters is viable only if the (m+1)-st - //parameter has a default argument - else { - ListIterator listIter = function.getParameterList().listIterator( num ); - TypeInfo param; - for( int i = num; i > ( numParameters - num + 1); i-- ){ - param = ((ISymbol)listIter.previous()).getTypeInfo(); - if( !param.getHasDefault() ){ - iter.remove(); - break; - } - } - } - } - } - - /** - * function ProcessDirectives - * @param Declaration decl - * @param LookupData data - * @param LinkedList directives - * - * Go through the directives and for each nominated namespace find the - * closest enclosing declaration for that namespace and decl, then add the - * nominated namespace to the lookup data for consideration when we reach - * the enclosing declaration. - */ - static private void processDirectives( IContainerSymbol symbol, LookupData data, List directives ){ - IContainerSymbol enclosing = null; - IContainerSymbol temp = null; - - int size = directives.size(); - Iterator iter = directives.iterator(); - - for( int i = size; i > 0; i-- ){ - temp = (IContainerSymbol) iter.next(); - - //namespaces are searched at most once - if( !data.visited.contains( temp ) ){ - enclosing = getClosestEnclosingDeclaration( symbol, temp ); - - //the data.usingDirectives is a map from enclosing declaration to - //a list of namespaces to consider when we reach that enclosing - //declaration - LinkedList list = (data.usingDirectives == null ) - ? null - : (LinkedList) data.usingDirectives.get( enclosing ); - if ( list == null ){ - list = new LinkedList(); - list.add( temp ); - if( data.usingDirectives == null ){ - data.usingDirectives = new HashMap(); - } - data.usingDirectives.put( enclosing, list ); - } else { - list.add( temp ); - } - } - } - } - - /** - * function getClosestEnclosingDeclaration - * @param decl1 - * @param decl2 - * @return Declaration - * - * 7.3.4-1 "During unqualified lookup, the names appear as if they were - * declared in the nearest enclosing namespace which contains both the - * using-directive and the nominated namespace" - * - * TBD: Consider rewriting this iteratively instead of recursively, for - * performance - */ - static private IContainerSymbol getClosestEnclosingDeclaration( ISymbol symbol1, ISymbol symbol2 ){ - if( symbol1 == symbol2 ){ - return ( symbol1 instanceof IContainerSymbol ) ? (IContainerSymbol) symbol1 : symbol1.getContainingSymbol(); - } - - if( symbol1.getDepth() == symbol2.getDepth() ){ - return getClosestEnclosingDeclaration( symbol1.getContainingSymbol(), symbol2.getContainingSymbol() ); - } else if( symbol1.getDepth() > symbol2.getDepth() ) { - return getClosestEnclosingDeclaration( symbol1.getContainingSymbol(), symbol2 ); - } else { - return getClosestEnclosingDeclaration( symbol1, symbol2.getContainingSymbol() ); - } - } - - /** - * - * @param obj - * @param base - * @return int - * figure out if base is a base class of obj, and return the "distance" to - * the base class. - * ie: - * A -> B -> C - * the distance from A to B is 1 and from A to C is 2. This distance is used - * to rank standard pointer conversions. - * - * TBD: Consider rewriting iteratively for performance. - */ - static protected int hasBaseClass( ISymbol obj, ISymbol base ) throws ParserSymbolTableException { - return hasBaseClass( obj, base, false ); - } - - static private int hasBaseClass( ISymbol obj, ISymbol base, boolean throwIfNotVisible ) throws ParserSymbolTableException{ - if( obj == base ){ - return 0; - } - IDerivableContainerSymbol symbol = null; - TemplateInstance instance = null; - if( obj instanceof TemplateInstance ){ - instance = (TemplateInstance) obj; - ISymbol temp = instance.getInstantiatedSymbol(); - if( temp instanceof IDerivableContainerSymbol ){ - symbol = (IDerivableContainerSymbol) temp; - } else { - return -1; - } - } else if( obj instanceof IDerivableContainerSymbol ){ - symbol = (IDerivableContainerSymbol) obj; - } else { - return -1; - } - - if( symbol.hasParents() ){ - ISymbol temp = null; - IDerivableContainerSymbol parent = null; - IDerivableContainerSymbol.IParentSymbol wrapper; - - Iterator iter = symbol.getParents().iterator(); - int size = symbol.getParents().size(); - - for( int i = size; i > 0; i-- ){ - wrapper = (IDerivableContainerSymbol.IParentSymbol) iter.next(); - temp = wrapper.getParent(); - boolean isVisible = ( wrapper.getVisibility() == ASTAccessVisibility.PUBLIC ); - if( temp instanceof TemplateInstance ){ - instance = (TemplateInstance) temp; - if( instance.getInstantiatedSymbol() instanceof IDerivableContainerSymbol ){ - if( instance.getInstantiatedSymbol() == base ){ - if( throwIfNotVisible && !isVisible ) - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadVisibility ); - else - return 1; - } else { - int n = hasBaseClass( instance, base, throwIfNotVisible ); - if( n > 0 ){ - return n + 1; - } - } - } - } else { - if( temp.isType( TypeInfo.t_undef ) && temp.getContainingSymbol().isType( TypeInfo.t_template ) ){ - if( instance == null ) continue; - TypeInfo info = (TypeInfo) instance.getArgumentMap().get( temp ); - if( info == null || !info.isType( TypeInfo.t_class, TypeInfo.t_struct ) ){ - continue; - } - parent = (IDerivableContainerSymbol) info.getTypeSymbol(); - } - else if ( temp instanceof IDerivableContainerSymbol ){ - parent = (IDerivableContainerSymbol)temp; - } else { - continue; - } - if( parent == base ){ - if( throwIfNotVisible && !isVisible ) - throw new ParserSymbolTableException( ParserSymbolTableException.r_BadVisibility ); - else - return 1; - } else { - int n = hasBaseClass( parent, base, throwIfNotVisible ); - if( n > 0 ){ - return n + 1; - } - } - } - } - } - - return -1; - } - - static protected void getAssociatedScopes( ISymbol symbol, HashSet associated ){ - if( symbol == null ){ - return; - } - //if T is a class type, its associated classes are the class itself, - //and its direct and indirect base classes. its associated Namespaces are the - //namespaces in which its associated classes are defined - //if( symbol.getType() == TypeInfo.t_class ){ - if( symbol instanceof IDerivableContainerSymbol ){ - associated.add( symbol ); - associated.add( symbol.getContainingSymbol() ); - getBaseClassesAndContainingNamespaces( (IDerivableContainerSymbol) symbol, associated ); - } - //if T is a union or enumeration type, its associated namespace is the namespace in - //which it is defined. if it is a class member, its associated class is the member's - //class - else if( symbol.getType() == TypeInfo.t_union || symbol.getType() == TypeInfo.t_enumeration ){ - associated.add( symbol.getContainingSymbol() ); - } - } - - static private void getBaseClassesAndContainingNamespaces( IDerivableContainerSymbol obj, HashSet classes ){ - if( obj.getParents() != null ){ - if( classes == null ){ - return; - } - - Iterator iter = obj.getParents().iterator(); - int size = obj.getParents().size(); - IDerivableContainerSymbol.IParentSymbol wrapper; - ISymbol base; - - for( int i = size; i > 0; i-- ){ - wrapper = (IDerivableContainerSymbol.IParentSymbol) iter.next(); - base = wrapper.getParent(); - classes.add( base ); - if( base.getContainingSymbol().getType() == TypeInfo.t_namespace ){ - classes.add( base.getContainingSymbol()); - } - - getBaseClassesAndContainingNamespaces( (IDerivableContainerSymbol) base, classes ); - } - } - } - - static protected boolean okToAddUsingDeclaration( ISymbol obj, IContainerSymbol context ){ - boolean okToAdd = false; - - //7.3.3-5 A using-declaration shall not name a template-id - if( obj.isTemplateMember() && obj.getContainingSymbol().isType( TypeInfo.t_template ) ){ - okToAdd = false; - } - //7.3.3-4 - else if( context.isType( TypeInfo.t_class, TypeInfo.t_struct ) ){ - IContainerSymbol container = obj.getContainingSymbol(); - - try{ - //a member of a base class - if( obj.getContainingSymbol().getType() == context.getType() ){ - okToAdd = ( hasBaseClass( (IDerivableContainerSymbol) context, (IDerivableContainerSymbol) container ) > 0 ); - } - else if ( obj.getContainingSymbol().getType() == TypeInfo.t_union ) { - // TODO : must be an _anonymous_ union - container = container.getContainingSymbol(); - okToAdd = ( container instanceof IDerivableContainerSymbol ) - ? ( hasBaseClass( (IDerivableContainerSymbol)context, (IDerivableContainerSymbol) container ) > 0 ) - : false; - } - //an enumerator for an enumeration - else if ( obj.getType() == TypeInfo.t_enumerator ){ - container = container.getContainingSymbol(); - okToAdd = ( container instanceof IDerivableContainerSymbol ) - ? ( hasBaseClass( (IDerivableContainerSymbol)context, (IDerivableContainerSymbol) container ) > 0 ) - : false; - } - } catch ( ParserSymbolTableException e ) { - //not going to happen since we didn't ask for the visibility exception from hasBaseClass - } - } else { - okToAdd = true; - } - - return okToAdd; - } - - static private Cost lvalue_to_rvalue( TypeInfo source, TypeInfo target ){ - - //lvalues will have type t_type - if( source.isType( TypeInfo.t_type ) ){ - source = getFlatTypeInfo( source ); - } - - if( target.isType( TypeInfo.t_type ) ){ - ISymbol symbol = target.getTypeSymbol(); - if( symbol != null && symbol.isForwardDeclaration() && symbol.getTypeSymbol() != null ){ - target = new TypeInfo( target ); - target.setType( TypeInfo.t_type ); - target.setTypeSymbol( symbol.getTypeSymbol() ); - } - } - - Cost cost = new Cost( source, target ); - - //if either source or target is null here, then there was a problem - //with the parameters and we can't match them. - if( cost.source == null || cost.target == null ){ - return cost; - } - - TypeInfo.PtrOp op = null; - - if( cost.source.hasPtrOperators() ){ - List sourcePtrs = cost.source.getPtrOperators(); - Iterator iterator = sourcePtrs.iterator(); - TypeInfo.PtrOp ptr = (TypeInfo.PtrOp)iterator.next(); - if( ptr.getType() == TypeInfo.PtrOp.t_reference ){ - iterator.remove(); - } - int size = sourcePtrs.size(); - Iterator iter = sourcePtrs.iterator(); - - for( int i = size; i > 0; i-- ){ - op = (TypeInfo.PtrOp) iter.next(); - if( op.getType() == TypeInfo.PtrOp.t_array ){ - op.setType( TypeInfo.PtrOp.t_pointer ); - } - } - } - - if( cost.target.hasPtrOperators() ){ - List targetPtrs = cost.target.getPtrOperators(); - ListIterator iterator = targetPtrs.listIterator(); - TypeInfo.PtrOp ptr = (TypeInfo.PtrOp)iterator.next(); - - if( ptr.getType() == TypeInfo.PtrOp.t_reference ){ - if( ptr.isConst() || ptr.isVolatile() ){ - iterator.set( new PtrOp( PtrOp.t_undef, ptr.isConst(), ptr.isVolatile() ) ); - } else { - iterator.remove(); - } - cost.targetHadReference = true; - } - int size = targetPtrs.size(); - Iterator iter = targetPtrs.iterator(); - - for( int i = size; i > 0; i-- ){ - op = (TypeInfo.PtrOp) iter.next(); - if( op.getType() == TypeInfo.PtrOp.t_array ){ - op.setType( TypeInfo.PtrOp.t_pointer ); - } - } - } - - return cost; - } - - /** - * qualificationConversion - * @param cost - * - * see spec section 4.4 regarding qualification conversions - */ - static private void qualificationConversion( Cost cost ){ - int size = cost.source.getPtrOperators().size(); - int size2 = cost.target.getPtrOperators().size(); - - TypeInfo.PtrOp op1 = null, op2 = null; - boolean canConvert = true; - - Iterator iter1 = cost.source.getPtrOperators().iterator(); - Iterator iter2 = cost.target.getPtrOperators().iterator(); - - if( size != size2 ){ - if( size2 - size == 1 ){ - op2 = (PtrOp) iter2.next(); - if( op2.isConst() || op2.isVolatile() ){ - canConvert = true; - } else { - canConvert = false; - } - } else { - canConvert = false; - } - } else if ( size == 1 ){ - op1 = (TypeInfo.PtrOp) iter1.next(); - op2 = (TypeInfo.PtrOp) iter2.next(); - - //can only convert if op2 is more qualified - if( ( op1.isConst() && !op2.isConst() ) || - ( op1.isVolatile() && !op2.isVolatile() ) ) - { - cost.qualification = 0; - return; - } - canConvert = true; - } else if( size > 0 ){ - op1 = (TypeInfo.PtrOp) iter1.next(); - op2 = (TypeInfo.PtrOp) iter2.next(); - - boolean constInEveryCV2k = true; - - for( int j= 1; j < size; j++ ){ - op1 = (TypeInfo.PtrOp) iter1.next(); - op2 = (TypeInfo.PtrOp) iter2.next(); - - //pointer types must be similar - if( op1.getType() != op2.getType() ){ - canConvert = false; - break; - } - //if const is in cv1,j then const is in cv2,j. Similary for volatile - if( ( op1.isConst() && !op2.isConst() ) || - ( op1.isVolatile() && !op2.isVolatile() ) ) - { - canConvert = false; - break; - } - - //if cv1,j and cv2,j are different then const is in every cv2,k for 0 0 ) ? Cost.PROMOTION_RANK : Cost.NO_MATCH_RANK; - } - - /** - * - * @param source - * @param target - * @return int - * - */ - static private void conversion( Cost cost ){ - TypeInfo src = cost.source; - TypeInfo trg = cost.target; - - int temp = -1; - - cost.conversion = 0; - cost.detail = 0; - - if( !src.hasSamePtrs( trg ) ){ - return; - } - if( src.hasPtrOperators() && src.getPtrOperators().size() == 1 ){ - TypeInfo.PtrOp ptr = (TypeInfo.PtrOp)src.getPtrOperators().iterator().next(); - ISymbol srcDecl = src.isType( TypeInfo.t_type ) ? src.getTypeSymbol() : null; - ISymbol trgDecl = trg.isType( TypeInfo.t_type ) ? trg.getTypeSymbol() : null; - if( ptr.getType() == TypeInfo.PtrOp.t_pointer ){ - if( srcDecl == null || (trgDecl == null && !trg.isType( TypeInfo.t_void )) ){ - return; - } - - //4.10-2 an rvalue of type "pointer to cv T", where T is an object type can be - //converted to an rvalue of type "pointer to cv void" - if( trg.isType( TypeInfo.t_void ) ){ - cost.rank = Cost.CONVERSION_RANK; - cost.conversion = 1; - cost.detail = 2; - return; - } - - cost.detail = 1; - - //4.10-3 An rvalue of type "pointer to cv D", where D is a class type can be converted - // to an rvalue of type "pointer to cv B", where B is a base class of D. - if( (srcDecl instanceof IDerivableContainerSymbol) && trgDecl.isType( srcDecl.getType() ) ){ - try { - temp = hasBaseClass( (IDerivableContainerSymbol) srcDecl, (IDerivableContainerSymbol) trgDecl ); - } catch (ParserSymbolTableException e) { - //not going to happen since we didn't ask for the visibility exception - } - cost.rank = ( temp > -1 ) ? Cost.CONVERSION_RANK : Cost.NO_MATCH_RANK; - cost.conversion = ( temp > -1 ) ? temp : 0; - cost.detail = 1; - return; - } - } else if( ptr.getType() == TypeInfo.PtrOp.t_memberPointer ){ - //4.11-2 An rvalue of type "pointer to member of B of type cv T", where B is a class type, - //can be converted to an rvalue of type "pointer to member of D of type cv T" where D is a - //derived class of B - if( srcDecl == null || trgDecl == null ){ - return; - } - - TypeInfo.PtrOp srcPtr = trg.hasPtrOperators() ? (TypeInfo.PtrOp)trg.getPtrOperators().iterator().next() : null; - if( trgDecl.isType( srcDecl.getType() ) && srcPtr != null && srcPtr.getType() == TypeInfo.PtrOp.t_memberPointer ){ - try { - temp = hasBaseClass( (IDerivableContainerSymbol)ptr.getMemberOf(), (IDerivableContainerSymbol)srcPtr.getMemberOf() ); - } catch (ParserSymbolTableException e) { - //not going to happen since we didn't ask for the visibility exception - } - cost.rank = ( temp > -1 ) ? Cost.CONVERSION_RANK : Cost.NO_MATCH_RANK; - cost.detail = 1; - cost.conversion = ( temp > -1 ) ? temp : 0; - return; - } - } - } else if( !src.hasPtrOperators() ) { - //4.7 An rvalue of an integer type can be converted to an rvalue of another integer type. - //An rvalue of an enumeration type can be converted to an rvalue of an integer type. - if( src.isType( TypeInfo.t_bool, TypeInfo.t_int ) || - src.isType( TypeInfo.t_float, TypeInfo.t_double ) || - src.isType( TypeInfo.t_enumeration ) ) - { - if( trg.isType( TypeInfo.t_bool, TypeInfo.t_int ) || - trg.isType( TypeInfo.t_float, TypeInfo.t_double ) ) - { - cost.rank = Cost.CONVERSION_RANK; - cost.conversion = 1; - } - } - } - } - - static private void derivedToBaseConversion( Cost cost ) throws ParserSymbolTableException{ - TypeInfo src = cost.source; - TypeInfo trg = cost.target; - - ISymbol srcDecl = src.isType( TypeInfo.t_type ) ? src.getTypeSymbol() : null; - ISymbol trgDecl = trg.isType( TypeInfo.t_type ) ? trg.getTypeSymbol() : null; - - if( !src.hasSamePtrs( trg ) || srcDecl == null || trgDecl == null || !cost.targetHadReference ){ - return; - } - - int temp = hasBaseClass( (IDerivableContainerSymbol) srcDecl, (IDerivableContainerSymbol) trgDecl, true ); - - if( temp > -1 ){ - cost.rank = Cost.DERIVED_TO_BASE_CONVERSION; - cost.conversion = temp; - } - } - - static private Cost checkStandardConversionSequence( TypeInfo source, TypeInfo target ) throws ParserSymbolTableException{ - Cost cost = lvalue_to_rvalue( source, target ); - - if( cost.source == null || cost.target == null ){ - return cost; - } - - if( cost.source.equals( cost.target ) ){ - cost.rank = Cost.IDENTITY_RANK; - return cost; - } - - qualificationConversion( cost ); - - //if we can't convert the qualifications, then we can't do anything - if( cost.qualification == 0 ){ - return cost; - } - - //was the qualification conversion enough? - if( cost.source.isType( TypeInfo.t_type ) && cost.target.isType( TypeInfo.t_type ) ){ - if( cost.target.hasSamePtrs( cost.source ) ){ - ISymbol srcSymbol = cost.source.getTypeSymbol(); - ISymbol trgSymbol = cost.target.getTypeSymbol(); - if( srcSymbol != null && trgSymbol != null ){ - if( srcSymbol.equals( trgSymbol ) ) - { - return cost; - } - } - } - } - - promotion( cost ); - if( cost.promotion > 0 || cost.rank > -1 ){ - return cost; - } - - conversion( cost ); - - if( cost.rank > -1 ) - return cost; - - derivedToBaseConversion( cost ); - - return cost; - } - - static private Cost checkUserDefinedConversionSequence( TypeInfo source, TypeInfo target ) throws ParserSymbolTableException { - Cost cost = null; - Cost constructorCost = null; - Cost conversionCost = null; - - ISymbol targetDecl = null; - ISymbol sourceDecl = null; - IParameterizedSymbol constructor = null; - IParameterizedSymbol conversion = null; - - //constructors - if( target.getType() == TypeInfo.t_type ){ - targetDecl = target.getTypeSymbol(); - if( targetDecl.isType( TypeInfo.t_class, TypeInfo.t_union ) ){ - LookupData data = new LookupData( EMPTY_NAME, TypeInfo.t_constructor, null ); - data.parameters = new LinkedList(); - data.parameters.add( source ); - data.forUserDefinedConversion = true; - - IDerivableContainerSymbol container = (IDerivableContainerSymbol) targetDecl; - - if( targetDecl instanceof TemplateInstance ){ - data.templateInstance = targetDecl; - container = (IDerivableContainerSymbol)((TemplateInstance) targetDecl).getInstantiatedSymbol(); - } - - if( !container.getConstructors().isEmpty() ){ - LinkedList constructors = new LinkedList( container.getConstructors() ); - constructor = resolveFunction( data, constructors ); - } - if( constructor != null && constructor.getTypeInfo().checkBit( TypeInfo.isExplicit ) ){ - constructor = null; - } - - } - } - - //conversion operators - if( source.getType() == TypeInfo.t_type ){ - source = getFlatTypeInfo( source ); - sourceDecl = ( source != null ) ? source.getTypeSymbol() : null; - - if( sourceDecl != null && (sourceDecl instanceof IContainerSymbol) ){ - String name = target.toString(); - - if( !name.equals(EMPTY_NAME) ){ - LookupData data = new LookupData( "operator " + name, TypeInfo.t_function, null ); //$NON-NLS-1$ - LinkedList params = new LinkedList(); - data.parameters = params; - data.forUserDefinedConversion = true; - - data.foundItems = lookupInContained( data, (IContainerSymbol) sourceDecl ); - conversion = (IParameterizedSymbol)resolveAmbiguities( data ); - } - } - } - - if( constructor != null ){ - constructorCost = checkStandardConversionSequence( (TypeInfo) new TypeInfo( TypeInfo.t_type, 0, constructor.getContainingSymbol() ), target ); - } - if( conversion != null ){ - conversionCost = checkStandardConversionSequence( (TypeInfo) new TypeInfo( target.getType(), 0, target.getTypeSymbol() ), target ); - } - - //if both are valid, then the conversion is ambiguous - if( constructorCost != null && constructorCost.rank != Cost.NO_MATCH_RANK && - conversionCost != null && conversionCost.rank != Cost.NO_MATCH_RANK ) - { - cost = constructorCost; - cost.userDefined = Cost.AMBIGUOUS_USERDEFINED_CONVERSION; - cost.rank = Cost.USERDEFINED_CONVERSION_RANK; - } else { - if( constructorCost != null && constructorCost.rank != Cost.NO_MATCH_RANK ){ - cost = constructorCost; - cost.userDefined = constructor.hashCode(); - cost.rank = Cost.USERDEFINED_CONVERSION_RANK; - } else if( conversionCost != null && conversionCost.rank != Cost.NO_MATCH_RANK ){ - cost = conversionCost; - cost.userDefined = conversion.hashCode(); - cost.rank = Cost.USERDEFINED_CONVERSION_RANK; - } - } - - return cost; - } - - /** - * Determine the type of a conditional operator based on the second and third operands - * @param secondOp - * @param thirdOp - * @return - * Spec 5.16 - * Determine if the second operand can be converted to match the third operand, and vice versa. - * - If both can be converted, or one can be converted but the conversion is ambiguous, the program - * is illformed (throw ParserSymbolTableException) - * - If neither can be converted, further checking must be done (return null) - * - If exactly one conversion is possible, that conversion is applied ( return the other TypeInfo ) - */ - static public TypeInfo getConditionalOperand( TypeInfo secondOp, TypeInfo thirdOp ) throws ParserSymbolTableException{ - - //can secondOp convert to thirdOp ? - Cost secondCost = checkStandardConversionSequence( secondOp, getFlatTypeInfo( thirdOp ) ); - - if( secondCost.rank == Cost.NO_MATCH_RANK ){ - secondCost = checkUserDefinedConversionSequence( secondOp, getFlatTypeInfo( thirdOp ) ); - } - - Cost thirdCost = checkStandardConversionSequence( thirdOp, getFlatTypeInfo( secondOp ) ); - if( thirdCost.rank == Cost.NO_MATCH_RANK ){ - thirdCost = checkUserDefinedConversionSequence( thirdOp, getFlatTypeInfo( secondOp ) ); - } - - - boolean canConvertSecond = ( secondCost != null && secondCost.rank != Cost.NO_MATCH_RANK ); - boolean canConvertThird = ( thirdCost != null && thirdCost.rank != Cost.NO_MATCH_RANK ); - - if( !canConvertSecond && !canConvertThird ){ - //neither can be converted - return null; - } else if ( canConvertSecond && canConvertThird ){ - //both can be converted -> illformed - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } else { - if( canConvertSecond ){ - if( secondCost.userDefined == Cost.AMBIGUOUS_USERDEFINED_CONVERSION ){ - //conversion is ambiguous -> ill-formed - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } else { - return thirdOp; - } - } else { - if( thirdCost.userDefined == Cost.AMBIGUOUS_USERDEFINED_CONVERSION ){ - //conversion is ambiguous -> ill-formed - throw new ParserSymbolTableException( ParserSymbolTableException.r_Ambiguous ); - } else { - return secondOp; - } - } - } - } - - /** - * - * @param decl - * @return TypeInfo - * The top level TypeInfo represents modifications to the object and the - * remaining TypeInfo's represent the object. - */ - // TODO move this to ITypeInfo ? - static protected TypeInfo getFlatTypeInfo( TypeInfo topInfo ){ - TypeInfo returnInfo = topInfo; - TypeInfo info = null; - - if( topInfo.getType() == TypeInfo.t_type && topInfo.getTypeSymbol() != null ){ - returnInfo = (TypeInfo)new TypeInfo(); - - ISymbol typeSymbol = topInfo.getTypeSymbol(); - - info = typeSymbol.getTypeInfo(); - - while( info.getTypeSymbol() != null && ( info.getType() == TypeInfo.t_type || info.isForwardDeclaration() ) ){ - typeSymbol = info.getTypeSymbol(); - - returnInfo.addPtrOperator( info.getPtrOperators() ); - - info = typeSymbol.getTypeInfo(); - } - - if( info.isType( TypeInfo.t_class, TypeInfo.t_enumeration ) ){ - returnInfo.setType( TypeInfo.t_type ); - returnInfo.setTypeSymbol( typeSymbol ); - } else { - returnInfo.setTypeInfo( info.getTypeInfo() ); - returnInfo.setType( info.getType() ); - returnInfo.setTypeSymbol( null ); - returnInfo.addPtrOperator( info.getPtrOperators() ); - } - - returnInfo.applyOperatorExpressions( topInfo.getOperatorExpressions() ); - - if( topInfo.hasPtrOperators() ){ - TypeInfo.PtrOp topPtr = (PtrOp) topInfo.getPtrOperators().iterator().next(); - TypeInfo.PtrOp ptr = null; - if( returnInfo.hasPtrOperators() ){ - ptr = (PtrOp)returnInfo.getPtrOperators().iterator().next(); - } else { - ptr = new PtrOp(); - returnInfo.addPtrOperator( ptr ); - ptr.setType( topPtr.getType() ); - } - - ptr.setConst( topPtr.isConst() ); - ptr.setVolatile( topPtr.isVolatile() ); - } - } else { - returnInfo = new TypeInfo( topInfo ); - } - - return returnInfo; - } - - static private IParameterizedSymbol matchTemplatePartialSpecialization( IParameterizedSymbol template, List args ){ - if( template == null ){ - return null; - } - - List specs = template.getSpecializations(); - int size = ( specs != null ) ? specs.size() : 0; - if( size == 0 ){ - return template; - } - - IParameterizedSymbol bestMatch = null; - boolean bestMatchIsBest = true; - Iterator iter = specs.iterator(); - IParameterizedSymbol spec = null; - List specArgs = null; - for( int i = size; i > 0; i-- ){ - spec = (IParameterizedSymbol) iter.next(); - specArgs = spec.getArgumentList(); - if( specArgs == null || specArgs.size() != args.size() ){ - continue; - } - - ISymbol sym1 = null, sym2 = null; - Iterator iter1 = specArgs.iterator(); - Iterator iter2 = args.iterator(); - - HashMap map = new HashMap(); - //String name = null; - boolean match = true; - for( int j = specArgs.size(); j > 0; j-- ){ - sym1 = (ISymbol)iter1.next(); - TypeInfo info2 = (TypeInfo) iter2.next(); - if( info2.isType( TypeInfo.t_type ) ){ - sym2 = sym2.getTypeSymbol(); - } else { - sym2 = template.getSymbolTable().newSymbol( EMPTY_NAME ); - sym2.setTypeInfo( info2 ); - } - - if( !deduceTemplateArgument( map, sym1, sym2, null ) ){ - match = false; - break; - } - /* - name = sym1.getName(); - if( name.equals( "" ) ){ - //no name, only type - } else if( map.containsKey( name ) ) { - ISymbol val = (ISymbol) map.get( name ); - if( val.getType() != sym2.getType() ){ - match = false; - break; - } - } else { - map.put( name, sym2 ); - } - */ - } - if( match ){ - int compare = orderSpecializations( bestMatch, spec ); - if( compare == 0 ){ - bestMatchIsBest = false; - } else if( compare < 0 ) { - bestMatch = spec; - bestMatchIsBest = true; - } - } - } - - return bestMatchIsBest ? bestMatch : null; - } - - /** - * Compare spec1 to spec2. Return > 0 if spec1 is more specialized, < 0 if spec2 - * is more specialized, = 0 otherwise. - * @param spec1 - * @param spec2 - * @return - */ - static private int orderSpecializations( IParameterizedSymbol spec1, IParameterizedSymbol spec2 ){ - if( spec1 == null ){ - return -1; - } - - Iterator iter = spec1.getContainedSymbols().keySet().iterator(); - ISymbol decl = (ISymbol) spec1.getContainedSymbols().get( iter.next() ); - - //to order class template specializations, we need to transform them into function templates - if( decl.isType( TypeInfo.t_class ) ) { - spec1 = classTemplateSpecializationToFunctionTemplate( spec1 ); - spec2 = classTemplateSpecializationToFunctionTemplate( spec2 ); - } - - TemplateInstance transformed1 = transformFunctionTemplateForOrdering( spec1 ); - TemplateInstance transformed2 = transformFunctionTemplateForOrdering( spec2 ); - - //Using the transformed parameter list, perform argument deduction against the other - //function template - boolean d1 = deduceTemplateArguments( spec2, transformed1 ); - boolean d2 = deduceTemplateArguments( spec1, transformed2 ); - - //The transformed template is at least as specialized as the other iff the deduction - //succeeds and the deduced parameter types are an exact match - //A template is more specialized than another iff it is at least as specialized as the - //other template and that template is not at least as specialized as the first. - if( d1 && d2 || !d1 && !d2 ) - return 0; - else if( d1 && !d2 ) - return 1; - else - return -1; - } - - /** - * - * @param template - * @param args - * @return - * - * A type that is specified in terms of template parameters (P) is compared with an actual - * type (A), and an attempt is made to find template argument vaules that will make P, - * after substitution of the deduced values, compatible with A. - */ - static private boolean deduceTemplateArguments( IParameterizedSymbol template, TemplateInstance argSource ){ - if( template.getContainedSymbols() == null || template.getContainedSymbols().size() != 1 ){ - return false; - } - Iterator iter = template.getContainedSymbols().keySet().iterator(); - ISymbol templateSymbol = (ISymbol) template.getContainedSymbols().get( iter.next() ); - if( !templateSymbol.isType( TypeInfo.t_function ) ){ - return false; - } - - IParameterizedSymbol argTemplate = (IParameterizedSymbol)argSource.getInstantiatedSymbol(); - iter = argTemplate.getContainedSymbols().keySet().iterator(); - ISymbol argFunction = (ISymbol) argTemplate.getContainedSymbols().get( iter.next() ); - if( !argFunction.isType( TypeInfo.t_function ) ){ - return false; - } - - List args = ((IParameterizedSymbol) argFunction).getParameterList(); - - IParameterizedSymbol function = (IParameterizedSymbol) templateSymbol; - - if( function.getParameterList() == null || function.getParameterList().size() != args.size() ){ - return false; - } - - HashMap map = new HashMap(); - - Iterator pIter = function.getParameterList().iterator(); - Iterator aIter = args.iterator(); - while( pIter.hasNext() ){ - if( !deduceTemplateArgument( map, (ISymbol) pIter.next(), (ISymbol) aIter.next(), argSource.getArgumentMap() ) ){ - return false; - } - } - - return true; - } - - static private boolean deduceTemplateArgument( Map map, ISymbol p, ISymbol a, Map argumentMap ){ - if( argumentMap != null && argumentMap.containsKey( a ) ){ - a = (ISymbol) argumentMap.get( a ); - } - - ISymbol pSymbol = p, aSymbol = a; - - if( p.isType( TypeInfo.t_type ) ){ - pSymbol = p.getTypeSymbol(); - aSymbol = a.isType( TypeInfo.t_type ) ? a.getTypeSymbol() : a; - return deduceTemplateArgument( map, pSymbol, aSymbol, argumentMap ); - } else { - if( pSymbol.isTemplateMember() && pSymbol.isType( TypeInfo.t_undef ) ){ - //T* or T& or T[ const ] - //also - List pPtrs = pSymbol.getPtrOperators(); - List aPtrs = aSymbol.getPtrOperators(); - - if( pPtrs != null ){ - TypeInfo.PtrOp pOp = (TypeInfo.PtrOp) pPtrs.iterator().next();; - TypeInfo.PtrOp aOp = ( aPtrs != null ) ? (TypeInfo.PtrOp)pPtrs.iterator().next() : null; - - if( pOp != null && aOp != null && pOp.getType() == aOp.getType() ){ - if( pOp.getType() == TypeInfo.PtrOp.t_memberPointer ){ - - } else { - TypeInfo type = new TypeInfo( aSymbol.getTypeInfo() ); - type.getPtrOperators().clear(); - map.put( pSymbol.getName(), type ); - return true; - } - } else { - return false; - } - } else { - //T - map.put( pSymbol.getName(), a.getTypeInfo() ); - return true; - } - - - } - //template-name or template-name - else if( pSymbol.isType( TypeInfo.t_template ) && aSymbol.isType( TypeInfo.t_template ) ){ - List pArgs = ((IParameterizedSymbol)pSymbol).getArgumentList(); - List aArgs = ((IParameterizedSymbol)aSymbol).getArgumentList(); - - if( pArgs == null || aArgs == null || pArgs.size() != aArgs.size()){ - return false; - } - Iterator pIter = pArgs.iterator(); - Iterator aIter = aArgs.iterator(); - while( pIter.hasNext() ){ - if( !deduceTemplateArgument( map, (ISymbol) pIter.next(), (ISymbol) aIter.next(), argumentMap ) ){ - return false; - } - } - } - //T (*) ( ), T ( T::* ) ( T ), & variations - else if( pSymbol.isType( TypeInfo.t_function ) && aSymbol.isType( TypeInfo.t_function ) ){ - IParameterizedSymbol pFunction = (IParameterizedSymbol)pSymbol; - IParameterizedSymbol aFunction = (IParameterizedSymbol)aSymbol; - - if( !deduceTemplateArgument( map, aFunction.getReturnType(), pFunction.getReturnType(), argumentMap ) ){ - return false; - } - if( pSymbol.getPtrOperators() != null ){ - List ptrs = pSymbol.getPtrOperators(); - TypeInfo.PtrOp op = (TypeInfo.PtrOp) ptrs.iterator().next();; - if( op.getType() == TypeInfo.PtrOp.t_memberPointer ){ - if( !deduceTemplateArgument( map, op.getMemberOf(), pFunction.getContainingSymbol(), argumentMap ) ){ - return false; - } - } - } - - List pParams = pFunction.getParameterList(); - List aParams = aFunction.getParameterList(); - if( pParams.size() != aParams.size() ){ - return false; - } else { - Iterator pIter = pParams.iterator(); - Iterator aIter = aParams.iterator(); - while( pIter.hasNext() ){ - if( !deduceTemplateArgument( map, (ISymbol) pIter.next(), (ISymbol) aIter.next(), argumentMap ) ){ - return false; - } - } - } - - } else if( pSymbol.getType() == aSymbol.getType() ){ - if( pSymbol.getTypeInfo().getHasDefault() ){ - if( !aSymbol.getTypeInfo().getHasDefault() || - aSymbol.getTypeInfo().getDefault().equals( pSymbol.getTypeInfo().getDefault() ) ) - { - return false; - } - } - //value - map.put( pSymbol.getName(), aSymbol.getTypeInfo() ); - return true; - } - } - - return false; - } - /** - * transform the class template to a function template as described in the spec - * 14.5.4.2-1 - * @param template - * @return IParameterizedSymbol - * the function template has the same template parameters as the partial specialization and - * has a single function parameter whose type is a class template specialization with the template - * arguments of the partial specialization - */ - static private IParameterizedSymbol classTemplateSpecializationToFunctionTemplate( IParameterizedSymbol template ){ - IParameterizedSymbol transformed = (IParameterizedSymbol) template.clone(); - transformed.getArgumentList().clear(); - transformed.getContainedSymbols().clear(); - - IParameterizedSymbol function = template.getSymbolTable().newParameterizedSymbol( transformed.getName(), TypeInfo.t_function ); - try{ - transformed.addSymbol( function ); - } catch ( ParserSymbolTableException e ){ - //we shouldn't get this because there aren't any other symbols in the template - } - - function.addParameter( template ); - - return transformed; - } - - /** - * transform a function template for use in partial ordering, as described in the - * spec 14.5.5.2-3 - * @param template - * @return - * -for each type template parameter, synthesize a unique type and substitute that for each - * occurence of that parameter in the function parameter list - * -for each non-type template parameter, synthesize a unique value of the appropriate type and - * susbstitute that for each occurence of that parameter in the function parameter list - * for each template template parameter, synthesize a unique class template and substitute that - * for each occurence of that parameter in the function parameter list - */ - static private TemplateInstance transformFunctionTemplateForOrdering( IParameterizedSymbol template ){ - - List paramList = template.getParameterList(); - - int size = ( paramList != null ) ? paramList.size() : 0; - if( size == 0 ){ - return null; - } - - HashMap map = new HashMap(); - for( Iterator iterator = paramList.iterator(); iterator.hasNext(); ) { - ISymbol param = (ISymbol) iterator.next(); - ISymbol val = template.getSymbolTable().newSymbol( EMPTY_NAME, TypeInfo.t_type ); - if( false /* is value */ ){ - //val.getTypeInfo().setHasDefault() - } - map.put( param, val ); - } - - return new TemplateInstance( template.getSymbolTable(), template, map ); - } - - //private Stack _contextStack = new Stack(); - private IContainerSymbol _compilationUnit; - private ParserLanguage _language; - private LinkedList undoList = new LinkedList(); - private HashSet markSet = new HashSet(); - - public void setLanguage( ParserLanguage language ){ - _language = language; - } - - public ParserLanguage getLanguage(){ - return _language; - } - - protected void pushCommand( Command command ){ - undoList.addFirst( command ); - } - - public Mark setMark(){ - Mark mark = new Mark(); - undoList.addFirst( mark ); - markSet.add( mark ); - return mark; - } - - public boolean rollBack( Mark toMark ){ - if( markSet.contains( toMark ) ){ - markSet.remove( toMark ); - Command command = ( Command )undoList.removeFirst(); - while( command != toMark ){ - command.undoIt(); - command = ( Command ) undoList.removeFirst(); - } - - return true; - } - - return false; - } - - public boolean commit( Mark toMark ){ - if( markSet.contains( toMark ) ){ - markSet.remove( toMark ); - Command command = ( Command )undoList.removeLast(); - while( command != toMark ){ - command = (Command) undoList.removeLast(); - } - return true; - } - - return false; - } - - static abstract protected class Command{ - abstract public void undoIt(); - } - - static public class Mark extends Command{ - public void undoIt(){ }; - } - - - static public class LookupMode extends Enum{ - public static final LookupMode PREFIX = new LookupMode( 1 ); - public static final LookupMode NORMAL = new LookupMode( 2 ); - - private LookupMode( int constant) - { - super( constant ); - } - } - - - static protected class LookupData - { - public Set ambiguities; - public String name; - public Map usingDirectives; - public Set visited = new HashSet(); //used to ensure we don't visit things more than once - - public HashSet inheritanceChain; //used to detect circular inheritance - - public List parameters; //parameter info for resolving functions - public HashSet associated; //associated namespaces for argument dependant lookup - public ISymbol stopAt; //stop looking along the stack once we hit this declaration - public TypeFilter filter = null; - - public boolean qualified = false; - public boolean ignoreUsingDirectives = false; - public boolean usingDirectivesOnly = false; - public boolean forUserDefinedConversion = false; - - public Map foundItems = null; - - public ISymbol templateInstance = null; - public LookupMode mode = LookupMode.NORMAL; - - public LookupData( String n, TypeInfo.eType t, ISymbol i ){ - name = n; - filter = new TypeFilter( t ); - templateInstance = i; - } - public LookupData( String n, TypeFilter f, ISymbol i ){ - name = n; - filter = ( f != null ) ? f : new TypeFilter( TypeInfo.t_any ); - templateInstance = i; - } - } - - static private class Cost - { - - public Cost( TypeInfo s, TypeInfo t ){ - source = ( s != null ) ? new TypeInfo( s ) : new TypeInfo(); - target = ( t != null ) ? new TypeInfo( t ) : new TypeInfo(); - } - - public TypeInfo source; - public TypeInfo target; - - public boolean targetHadReference = false; - - public int lvalue; - public int promotion; - public int conversion; - public int qualification; - public int userDefined; - public int rank = -1; - public int detail; - - //Some constants to help clarify things - public static final int AMBIGUOUS_USERDEFINED_CONVERSION = 1; - - public static final int NO_MATCH_RANK = -1; - public static final int IDENTITY_RANK = 0; - public static final int LVALUE_OR_QUALIFICATION_RANK = 0; - public static final int PROMOTION_RANK = 1; - public static final int CONVERSION_RANK = 2; - public static final int DERIVED_TO_BASE_CONVERSION = 3; - public static final int USERDEFINED_CONVERSION_RANK = 4; - public static final int ELLIPSIS_CONVERSION = 5; - - - public int compare( Cost cost ){ - int result = 0; - - if( rank != cost.rank ){ - return cost.rank - rank; - } - - if( userDefined != 0 || cost.userDefined != 0 ){ - if( userDefined == 0 || cost.userDefined == 0 ){ - return cost.userDefined - userDefined; - } else { - if( (userDefined == AMBIGUOUS_USERDEFINED_CONVERSION || cost.userDefined == AMBIGUOUS_USERDEFINED_CONVERSION) || - (userDefined != cost.userDefined ) ) - { - return 0; - } - // else they are the same constructor/conversion operator and are ranked - //on the standard conversion sequence - } - } - - if( promotion > 0 || cost.promotion > 0 ){ - result = cost.promotion - promotion; - } - if( conversion > 0 || cost.conversion > 0 ){ - if( detail == cost.detail ){ - result = cost.conversion - conversion; - } else { - result = cost.detail - detail; - } - } - - if( result == 0 ){ - if( cost.qualification != qualification ){ - return cost.qualification - qualification; - } else if( (cost.qualification == qualification) && qualification == 0 ){ - return 0; - } else { - int size = cost.target.hasPtrOperators() ? cost.target.getPtrOperators().size() : 0; - int size2 = target.hasPtrOperators() ? target.getPtrOperators().size() : 0; - - ListIterator iter1 = cost.target.getPtrOperators().listIterator( size ); - ListIterator iter2 = target.getPtrOperators().listIterator( size2 ); - - TypeInfo.PtrOp op1 = null, op2 = null; - - int subOrSuper = 0; - for( int i = ( size < size2 ) ? size : size2; i > 0; i-- ){ - op1 = (TypeInfo.PtrOp)iter1.previous(); - op2 = (TypeInfo.PtrOp)iter2.previous(); - - if( subOrSuper == 0) - subOrSuper = op1.compareCVTo( op2 ); - else if( ( subOrSuper > 0 && ( op1.compareCVTo( op2 ) < 0 )) || - ( subOrSuper < 0 && ( op1.compareCVTo( op2 ) > 0 )) ) - { - result = -1; - break; - } - } - if( result == -1 ){ - result = 0; - } else { - if( size == size2 ){ - result = subOrSuper; - } else { - result = size - size2; - } - } - } - } - - return result; - } - } - - /** - * The visibility of the symbol is modified by the visibility of the base classes - * @param symbol - * @param qualifyingSymbol - * @return - */ - public static ASTAccessVisibility getVisibility(ISymbol symbol, IContainerSymbol qualifyingSymbol) throws ParserSymbolTableException { - - IContainerSymbol container = symbol.getContainingSymbol(); - if( qualifyingSymbol == null || container.equals( qualifyingSymbol ) ){ - ISymbolASTExtension extension = symbol.getASTExtension(); - IASTNode node = extension != null ? extension.getPrimaryDeclaration() : null; - if( node != null && node instanceof IASTMember ){ - return ((IASTMember)node).getVisiblity(); - } else { - throw new ParserSymbolTableException( ParserSymbolTableException.r_InternalError ); - } - } - - if( ! (qualifyingSymbol instanceof IDerivableContainerSymbol) ){ - throw new ParserSymbolTableException( ParserSymbolTableException.r_InternalError ); - } - - List parents = ((IDerivableContainerSymbol) qualifyingSymbol).getParents(); - Iterator iter = parents.iterator(); - IParentSymbol parent = null; - ASTAccessVisibility symbolAccess = null; - ASTAccessVisibility parentAccess = null; - - while( iter.hasNext() ){ - parent = (IParentSymbol) iter.next(); - - if( container == parent.getParent() ){ - parentAccess = parent.getAccess(); - symbolAccess = ((IASTMember)symbol.getASTExtension().getPrimaryDeclaration()).getVisiblity(); - - return ( parentAccess.getEnumValue() > symbolAccess.getEnumValue() ) ? parentAccess : symbolAccess; - } - } - - iter = parents.iterator(); - - //if static or an enumerator, the symbol could be visible through more than one path through the heirarchy, - //so we need to check all paths - boolean checkAllPaths = ( symbol.isType( TypeInfo.t_enumerator ) || symbol.getTypeInfo().checkBit( TypeInfo.isStatic ) ); - ASTAccessVisibility resultingAccess = null; - while( iter.hasNext() ){ - parent = (IParentSymbol) iter.next(); - parentAccess = parent.getAccess(); - symbolAccess = getVisibility( symbol, (IContainerSymbol) parent.getParent() ); - - if( symbolAccess != null ){ - symbolAccess = ( parentAccess.getEnumValue() > symbolAccess.getEnumValue() ) ? parentAccess : symbolAccess; - if( checkAllPaths ){ - if( resultingAccess != null ) - resultingAccess = ( resultingAccess.getEnumValue() > symbolAccess.getEnumValue() ) ? symbolAccess : resultingAccess; - else - resultingAccess = symbolAccess; - } else { - return symbolAccess; - } - } - } - return resultingAccess; - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTableException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTableException.java deleted file mode 100644 index b562e49fddc..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/ParserSymbolTableException.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.internal.core.parser.pst; - -/** - * @author aniefer - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class ParserSymbolTableException extends Exception { - - /** - * Constructor for ParserSymbolTableException. - */ - public ParserSymbolTableException() { - super(); - } - - /** - * Constructor for ParserSymbolTableException. - * @param int r: reason - */ - public ParserSymbolTableException( int r ) { - reason = r; - } - - public static final int r_InternalError = -1; - public static final int r_Ambiguous = 0; - public static final int r_BadTypeInfo = 1; - public static final int r_CircularInheritance = 2; - public static final int r_InvalidOverload = 3; - public static final int r_BadTemplate = 4; - public static final int r_InvalidUsing = 5; - public static final int r_BadVisibility = 6; - public static final int r_UnableToResolveFunction = 7; - - public int reason = -1; -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/SpecializedSymbol.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/SpecializedSymbol.java deleted file mode 100644 index f6b6c331cbb..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/SpecializedSymbol.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Nov 6, 2003 - */ -package org.eclipse.cdt.internal.core.parser.pst; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class SpecializedSymbol extends ParameterizedSymbol implements ISpecializedSymbol { - protected SpecializedSymbol( ParserSymbolTable table, String name ){ - super( table, name, TypeInfo.t_template ); - } - - protected SpecializedSymbol( ParserSymbolTable table, String name, ISymbolASTExtension obj ){ - super( table, name, obj ); - } -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java deleted file mode 100644 index 4e7a7928cbe..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/StandardSymbolExtension.java +++ /dev/null @@ -1,94 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol; - -/** - * @author jcamelon - * - */ -public class StandardSymbolExtension extends AbstractSymbolExtension -{ - - /** - * @author jcamelon - * - */ - private class SimpleIterator implements Iterator - { - boolean hasNext = true; - /** - * - */ - public SimpleIterator() - { - } - - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ - public boolean hasNext() - { - return hasNext; - } - - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ - public Object next() - { - if( hasNext ) - { - hasNext = false; - return primaryDeclaration; - } - - throw new NoSuchElementException(); - } - - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ - public void remove() - { - throw new UnsupportedOperationException(); - } - } - /** - * @param symbol - * @param primaryDeclaration - */ - public StandardSymbolExtension(ISymbol symbol, ASTSymbol primaryDeclaration) - { - super(symbol, primaryDeclaration); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension#getAllDefinitions() - */ - public Iterator getAllDefinitions() - { - return this.new SimpleIterator(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.parser.pst.ISymbolASTExtension#addDefinition(org.eclipse.cdt.internal.core.parser.ast.complete.ASTSymbol) - */ - public void addDefinition(ASTSymbol definition) throws ExtensionException - { - throw new ExtensionException(); - } - -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateInstance.java deleted file mode 100644 index 277463169d6..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TemplateInstance.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Nov 6, 2003 - */ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.Iterator; -import java.util.Map; - - -public class TemplateInstance extends BasicSymbol -{ - private final ParserSymbolTable _table; - - protected TemplateInstance( ParserSymbolTable table, ISymbol symbol, Map argMap ){ - super(table, ParserSymbolTable.EMPTY_NAME ); - this._table = table; - _instantiatedSymbol = symbol; - symbol.setTemplateInstance( this ); - _argumentMap = argMap; - } - - public boolean equals( Object t ){ - if( t == null || !( t instanceof TemplateInstance ) ){ - return false; - } - - TemplateInstance instance = (TemplateInstance) t; - - if( _instantiatedSymbol != instance._instantiatedSymbol ){ - return false; - } - - //check arg map - Iterator iter1 = _argumentMap.keySet().iterator(); - Iterator iter2 = instance._argumentMap.keySet().iterator(); - int size = _argumentMap.size(); - int size2 = instance._argumentMap.size(); - ISymbol t1 = null, t2 = null; - if( size == size2 ){ - for( int i = size; i > 0; i-- ){ - t1 = (ISymbol)iter1.next(); - t2 = (ISymbol)iter2.next(); - if( t1 != t2 || !_argumentMap.get(t1).equals( instance._argumentMap.get(t2) ) ){ - return false; - } - } - } - - return true; - } - - public ISymbol getInstantiatedSymbol(){ - _instantiatedSymbol.setTemplateInstance( this ); - return _instantiatedSymbol; - } - - public TypeInfo.eType getType(){ - ISymbol symbol = _instantiatedSymbol; - TypeInfo.eType returnType = _instantiatedSymbol.getType(); - if( returnType == TypeInfo.t_type ){ - symbol = symbol.getTypeSymbol(); - TypeInfo info = null; - while( symbol != null && symbol.getType() == TypeInfo.t_undef && symbol.getContainingSymbol().getType() == TypeInfo.t_template ){ - info = (TypeInfo) _argumentMap.get( symbol ); - if( !info.isType( TypeInfo.t_type ) ){ - break; - } - symbol = info.getTypeSymbol(); - } - - return ( info != null ) ? info.getType() : TypeInfo.t_type; - } - - return returnType; - } - - public boolean isType( TypeInfo.eType type ){ - return ( type == TypeInfo.t_any || getType() == type ); - } - - public boolean isType( TypeInfo.eType type, TypeInfo.eType upperType ){ - if( type == TypeInfo.t_any ) - return true; - - if( upperType == TypeInfo.t_undef ){ - return ( getType() == type ); - } else { - return ( getType().compareTo( type ) >= 0 && getType().compareTo( upperType ) <= 0 ); - } - } - - public ISymbol getTypeSymbol(){ - ISymbol symbol = _instantiatedSymbol.getTypeSymbol(); - if( symbol != null && symbol.getType() == TypeInfo.t_undef && - symbol.getContainingSymbol().getType() == TypeInfo.t_template ) - { - TypeInfo info = (TypeInfo) _argumentMap.get( symbol ); - return ( info != null ) ? info.getTypeSymbol() : null; - } - - return symbol; - } - - public TypeInfo getTypeInfo(){ - ISymbol symbol = _instantiatedSymbol.getTypeSymbol(); - if( symbol != null && symbol.getType() == TypeInfo.t_undef && - symbol.getContainingSymbol().getType() == TypeInfo.t_template ) - { - TypeInfo info = (TypeInfo) _argumentMap.get( symbol ); - return info; - } - - return _instantiatedSymbol.getTypeInfo(); - } - - public Map getArgumentMap(){ - return _argumentMap; - } - - - private ISymbol _instantiatedSymbol; - //private LinkedList _arguments; - private Map _argumentMap; -} diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeFilter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeFilter.java deleted file mode 100644 index 7b45291bca5..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeFilter.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ - -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind; - -/** - * @author aniefer - */ -public class TypeFilter { - - public TypeFilter(){ - } - - public TypeFilter( Set types ){ - acceptedTypes.addAll( types ); - } - - public TypeFilter( TypeInfo.eType type ){ - acceptedTypes.add( type ); - } - - public TypeFilter( LookupKind kind ){ - acceptedKinds.add( kind ); - populatedAcceptedTypes( kind ); - } - - public void addAcceptedType( TypeInfo.eType type ){ - acceptedTypes.add( type ); - } - - public void addAcceptedType( LookupKind kind ) { - populatedAcceptedTypes( kind ); - acceptedKinds.add( kind ); - } - - public boolean shouldAccept( ISymbol symbol ){ - return shouldAccept( symbol, symbol.getTypeInfo() ); - } - public boolean shouldAccept( ISymbol symbol, TypeInfo typeInfo ){ - if( acceptedTypes.contains( TypeInfo.t_any ) ){ - return true; - } - - if( acceptedKinds.isEmpty() ){ - return acceptedTypes.contains( typeInfo.getType() ); - } - - IContainerSymbol container = symbol.getContainingSymbol(); - - boolean symbolIsMember = container.isType( TypeInfo.t_class, TypeInfo.t_union ); - boolean symbolIsLocal = container.isType( TypeInfo.t_constructor, TypeInfo.t_function ) || - container.isType( TypeInfo.t_block ); - - if( typeInfo.isType( TypeInfo.t_function ) ) - { - if( ( acceptedKinds.contains( LookupKind.FUNCTIONS ) && !symbolIsMember ) || - ( acceptedKinds.contains( LookupKind.METHODS ) && symbolIsMember ) ) - { - return true; - } else { - return false; - } - } - else if ( typeInfo.isType( TypeInfo.t_type ) || typeInfo.isType( TypeInfo.t_bool, TypeInfo.t_enumerator ) ) - { - if( ( acceptedKinds.contains( LookupKind.VARIABLES ) && !symbolIsMember && !symbolIsLocal ) || - ( acceptedKinds.contains( LookupKind.LOCAL_VARIABLES ) && !symbolIsMember && symbolIsLocal ) || - ( acceptedKinds.contains( LookupKind.FIELDS ) && symbolIsMember ) ) - { - return true; - } else { - return false; - } - } - else - { - return acceptedTypes.contains( typeInfo.getType() ); - } - } - - /** - * @param lookupKind - */ - private void populatedAcceptedTypes(LookupKind kind) { - if ( kind == LookupKind.ALL ) { acceptedTypes.add( TypeInfo.t_any ); } - else if ( kind == LookupKind.STRUCTURES ) { acceptedTypes.add( TypeInfo.t_class ); - acceptedTypes.add( TypeInfo.t_struct ); - acceptedTypes.add( TypeInfo.t_union ); } - else if ( kind == LookupKind.STRUCS ) { acceptedTypes.add( TypeInfo.t_struct ); } - else if ( kind == LookupKind.UNIONS ) { acceptedTypes.add( TypeInfo.t_union ); } - else if ( kind == LookupKind.CLASSES ) { acceptedTypes.add( TypeInfo.t_class ); } - else if ( kind == LookupKind.CONSTRUCTORS ){ acceptedTypes.add( TypeInfo.t_constructor ); } - else if ( kind == LookupKind.NAMESPACES ) { acceptedTypes.add( TypeInfo.t_namespace ); } - else if ( kind == LookupKind.ENUMERATIONS ){ acceptedTypes.add( TypeInfo.t_enumeration ); } - else if ( kind == LookupKind.ENUMERATORS ) { acceptedTypes.add( TypeInfo.t_enumerator ); } - } - - - private Set acceptedTypes = new HashSet(); - private Set acceptedKinds = new HashSet(); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java deleted file mode 100644 index 958832d87c1..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/pst/TypeInfo.java +++ /dev/null @@ -1,527 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser.pst; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; - -import org.eclipse.cdt.core.parser.Enum; - - -public class TypeInfo { - public TypeInfo(){ - super(); - } - - public TypeInfo( TypeInfo.eType type, int info, ISymbol symbol ){ - super(); - _typeInfo = info; - _type = type; - _typeDeclaration = symbol; - } - - public TypeInfo( TypeInfo.eType type, int info, ISymbol symbol, TypeInfo.PtrOp op, boolean hasDefault ){ - super(); - _typeInfo = info; - _type = type; - _typeDeclaration = symbol; - if( op != null ){ - _ptrOperators = new LinkedList(); - _ptrOperators.add( op ); - } else { - _ptrOperators = null; - } - _hasDefaultValue = hasDefault; - } - - public TypeInfo( TypeInfo.eType type, int info, ISymbol symbol, TypeInfo.PtrOp op, Object def ){ - super(); - _typeInfo = info; - _type = type; - _typeDeclaration = symbol; - if( op != null ){ - _ptrOperators = new LinkedList(); - _ptrOperators.add( op ); - } else { - _ptrOperators = null; - } - _hasDefaultValue = true; - setDefault( def ); - } - - public TypeInfo( TypeInfo info ){ - super(); - - _typeInfo = info._typeInfo; - _type = info._type; - _typeDeclaration = info._typeDeclaration; - _ptrOperators = ( info._ptrOperators == null ) ? null : (LinkedList)info._ptrOperators.clone(); - _hasDefaultValue = info._hasDefaultValue; - } - - public static final int typeMask = 0x001f; - public static final int isAuto = 0x0020; - public static final int isRegister = 0x0040; - public static final int isStatic = 0x0080; - public static final int isExtern = 0x0100; - public static final int isMutable = 0x0200; - public static final int isInline = 0x0400; - public static final int isVirtual = 0x0800; - public static final int isExplicit = 0x1000; - public static final int isTypedef = 0x2000; - public static final int isFriend = 0x4000; - public static final int isConst = 0x8000; - public static final int isVolatile = 0x10000; - public static final int isUnsigned = 0x20000; - public static final int isShort = 0x40000; - public static final int isLong = 0x80000; - public static final int isForward = 0x100000; - public static final int isComplex = 0x200000; - public static final int isImaginary= 0x400000; - - // Types (maximum type is typeMask - // Note that these should be considered ordered and if you change - // the order, you should consider the ParserSymbolTable uses - public static final TypeInfo.eType t_any = new TypeInfo.eType( -1 ); //don't care - public static final TypeInfo.eType t_undef = new TypeInfo.eType( 0 ); //not specified - public static final TypeInfo.eType t_type = new TypeInfo.eType( 1 ); //Type Specifier - public static final TypeInfo.eType t_namespace = new TypeInfo.eType( 2 ); - public static final TypeInfo.eType t_class = new TypeInfo.eType( 3 ); - public static final TypeInfo.eType t_struct = new TypeInfo.eType( 4 ); - public static final TypeInfo.eType t_union = new TypeInfo.eType( 5 ); - public static final TypeInfo.eType t_enumeration = new TypeInfo.eType( 6 ); - public static final TypeInfo.eType t_constructor = new TypeInfo.eType( 7 ); - public static final TypeInfo.eType t_function = new TypeInfo.eType( 8 ); - public static final TypeInfo.eType t__Bool = new TypeInfo.eType( 9 ); - public static final TypeInfo.eType t_bool = new TypeInfo.eType( 10 ); - public static final TypeInfo.eType t_char = new TypeInfo.eType( 11 ); - public static final TypeInfo.eType t_wchar_t = new TypeInfo.eType( 12 ); - public static final TypeInfo.eType t_int = new TypeInfo.eType( 13 ); - public static final TypeInfo.eType t_float = new TypeInfo.eType( 14 ); - public static final TypeInfo.eType t_double = new TypeInfo.eType( 15 ); - public static final TypeInfo.eType t_void = new TypeInfo.eType( 16 ); - public static final TypeInfo.eType t_enumerator = new TypeInfo.eType( 17 ); - public static final TypeInfo.eType t_block = new TypeInfo.eType( 18 ); - public static final TypeInfo.eType t_template = new TypeInfo.eType( 19 ); - public static final TypeInfo.eType t_asm = new TypeInfo.eType( 20 ); - public static final TypeInfo.eType t_linkage = new TypeInfo.eType( 21 ); - - //public static final eType t_templateParameter = new eType( 18 ); - - public static class eType implements Comparable{ - protected eType( int v ){ - _val = v; - } - - public int compareTo( Object o ){ - TypeInfo.eType t = (TypeInfo.eType) o; - return _val - t._val; - } - - public int toInt(){ - return _val; - } - - private int _val; - } - - public static class OperatorExpression extends Enum{ - - //5.3.1-1 : The unary * operator, the expression to which it is applied shall be - //a pointer to an object type or a pointer to a function type and the result - //is an lvalue refering to the object or function to which the expression points - public static final OperatorExpression indirection = new OperatorExpression( 1 ); - - //5.3.1-2 : The result of the unary & operator is a pointer to its operand - public static final OperatorExpression addressof = new OperatorExpression( 0 ); - - //5.2.1 A postfix expression followed by an expression in square brackets is a postfix - //expression. one of the expressions shall have the type "pointer to T" and the other - //shall have a enumeration or integral type. The result is an lvalue of type "T" - public static final OperatorExpression subscript = new OperatorExpression( 2 ); - - protected OperatorExpression(int enumValue) { - super(enumValue); - } - } - - public static class PtrOp { - public PtrOp( TypeInfo.eType type ){ - this.type = type; - } - public PtrOp( TypeInfo.eType type, boolean isConst, boolean isVolatile ){ - this.type = type; - this.isConst = isConst; - this.isVolatile = isVolatile; - } - public PtrOp( ISymbol memberOf, boolean isConst, boolean isVolatile ){ - this.type = PtrOp.t_memberPointer; - this.isConst = isConst; - this.isVolatile = isVolatile; - this.memberOf = memberOf; - } - - public PtrOp(){ - super(); - } - - public static final TypeInfo.eType t_undef = new TypeInfo.eType( 0 ); - public static final TypeInfo.eType t_pointer = new TypeInfo.eType( 1 ); - public static final TypeInfo.eType t_reference = new TypeInfo.eType( 2 ); - public static final TypeInfo.eType t_array = new TypeInfo.eType( 3 ); - public static final TypeInfo.eType t_memberPointer = new TypeInfo.eType( 4 ); - - public TypeInfo.eType getType() { return type; } - public void setType( TypeInfo.eType type ) { this.type = type; } - - public boolean isConst() { return isConst; } - public boolean isVolatile() { return isVolatile; } - public void setConst( boolean isConst ) { this.isConst = isConst; } - public void setVolatile(boolean isVolatile) { this.isVolatile = isVolatile; } - - public ISymbol getMemberOf() { return memberOf; } - public void setMemberOf( ISymbol member ) { this.memberOf = member; } - - public int compareCVTo( TypeInfo.PtrOp ptr ){ - int cv1 = ( isConst() ? 1 : 0 ) + ( isVolatile() ? 1 : 0 ); - int cv2 = ( ptr.isConst() ? 1 : 0 ) + ( ptr.isVolatile() ? 1 : 0 ); - - return cv1 - cv2; - } - public boolean equals( Object o ){ - if( o == null || !(o instanceof TypeInfo.PtrOp) ){ - return false; - } - TypeInfo.PtrOp op = (TypeInfo.PtrOp)o; - - return ( isConst() == op.isConst() && - isVolatile() == op.isVolatile() && - getType() == op.getType() ); - } - - private TypeInfo.eType type = PtrOp.t_undef; - private boolean isConst = false; - private boolean isVolatile = false; - private ISymbol memberOf = null; - } - - private static final String _image[] = { "", //$NON-NLS-1$ t_undef - "", //$NON-NLS-1$ t_type - "namespace", //$NON-NLS-1$ t_namespace - "class", //$NON-NLS-1$ t_class - "struct", //$NON-NLS-1$ t_struct - "union", //$NON-NLS-1$ t_union - "enum", //$NON-NLS-1$ t_enumeration - "", //$NON-NLS-1$ t_constructor - "", //$NON-NLS-1$ t_function - "bool", //$NON-NLS-1$ t_bool - "char", //$NON-NLS-1$ t_char - "wchar_t", //$NON-NLS-1$ t_wchar_t - "int", //$NON-NLS-1$ t_int - "float", //$NON-NLS-1$ t_float - "double", //$NON-NLS-1$ t_double - "void", //$NON-NLS-1$ t_void - "", //$NON-NLS-1$ t_enumerator - "", //$NON-NLS-1$ t_block - "template", //$NON-NLS-1$ t_template - "", //$NON-NLS-1$ t_asm - "" //$NON-NLS-1$ t_linkage - }; - //Partial ordering : - // none < const - // none < volatile - // none < const volatile - // const < const volatile - // volatile < const volatile - public static final int cvConst = 2; - public static final int cvVolatile = 3; - public static final int cvConstVolatile = 5; - - // Convenience methods - public void setBit(boolean b, int mask){ - if( b ){ - _typeInfo = _typeInfo | mask; - } else { - _typeInfo = _typeInfo & ~mask; - } - } - - public boolean checkBit(int mask){ - return (_typeInfo & mask) != 0; - } - - public void setType( TypeInfo.eType t){ - _type = t; - } - - public TypeInfo.eType getType(){ - return _type; - } - - public boolean isType( TypeInfo.eType type ){ - return isType( type, TypeInfo.t_undef ); - } - - public int getTypeInfo(){ - return _typeInfo; - } - - public void setTypeInfo( int typeInfo ){ - _typeInfo = typeInfo; - } - - /** - * - * @param type - * @param upperType - * @return boolean - * - * type checking, check that this declaration's type is between type and - * upperType (inclusive). upperType of 0 means no range and our type must - * be type. - */ - public boolean isType( TypeInfo.eType type, TypeInfo.eType upperType ){ - //type of -1 means we don't care - if( type == TypeInfo.t_any ) - return true; - - //upperType of 0 means no range - if( upperType == TypeInfo.t_undef ){ - return ( getType() == type ); - } else { - return ( getType().compareTo( type ) >= 0 && getType().compareTo( upperType ) <= 0 ); - } - } - - public ISymbol getTypeSymbol(){ - return _typeDeclaration; - } - - public void setTypeSymbol( ISymbol type ){ - _typeDeclaration = type; - } - - public boolean hasPtrOperators(){ - return ( _ptrOperators != null && _ptrOperators.size() > 0 ); - } - - public List getPtrOperators(){ - if( _ptrOperators == null ){ - _ptrOperators = new LinkedList(); - } - return _ptrOperators; - } - - public boolean hasSamePtrs( TypeInfo type ){ - int size = getPtrOperators().size(); - int size2 = type.getPtrOperators().size(); - Iterator iter1 = getPtrOperators().iterator(); - Iterator iter2 = type.getPtrOperators().iterator(); - TypeInfo.PtrOp ptr1 = null, ptr2 = null; - if( size2 < size ) { - for( int i = size; i > size2; i-- ){ - ptr2 = (PtrOp) iter1.next(); - if( ptr2.getType() != PtrOp.t_undef ){ - return false; - } - } - size = size2; - } else if ( size < size2 ){ - for( int i = size2; i > size; i-- ){ - ptr1 = (PtrOp)iter2.next(); - if( ptr1.getType() != PtrOp.t_undef ){ - return false; - } - } - size2 = size; - } - - if( size == size2 ){ - if( size > 0 ){ - for( int i = size; i > 0; i-- ){ - ptr1 = (TypeInfo.PtrOp)iter1.next(); - ptr2 = (TypeInfo.PtrOp)iter2.next(); - if( ptr1.getType() != ptr2.getType() ){ - return false; - } - } - } - return true; - } - return false; - } - - public List getOperatorExpressions(){ - if( _operatorExpressions == null ){ - _operatorExpressions = new LinkedList(); - } - return _operatorExpressions; - } - - - public void applyOperatorExpressions( List ops ){ - if( ops == null || ops.isEmpty() ) - return; - - int size = ops.size(); - Iterator iter = ops.iterator(); - OperatorExpression op = null; - for( int i = size; i > 0; i-- ){ - op = (OperatorExpression)iter.next(); - if( op == OperatorExpression.indirection || - op == OperatorExpression.subscript ) - { - //indirection operator, can only be applied to a pointer - //subscript should be applied to something that is "pointer to T", the result is a lvalue of type "T" - if( hasPtrOperators() ){ - ListIterator iterator = getPtrOperators().listIterator( getPtrOperators().size() ); - TypeInfo.PtrOp last = (TypeInfo.PtrOp)iterator.previous(); - if( last.getType() == TypeInfo.PtrOp.t_pointer || - last.getType() == TypeInfo.PtrOp.t_array ) - { - iterator.remove(); - } - } - } else if( op == OperatorExpression.addressof ){ - //Address-of unary operator, results in pointer to T - //TODO or pointer to member - TypeInfo.PtrOp newOp = new TypeInfo.PtrOp( PtrOp.t_pointer ); - addPtrOperator( newOp ); - } - } - } - - public void addPtrOperator( TypeInfo.PtrOp ptr ){ - if( _ptrOperators == null ){ - _ptrOperators = new LinkedList(); - } - if( ptr != null ) - _ptrOperators.add( ptr ); - } - - public void addPtrOperator( List ptrs ){ - if( _ptrOperators == null ){ - _ptrOperators = new LinkedList(); - } - if( ptrs != null ) - _ptrOperators.addAll( ptrs ); - } - - public void addOperatorExpression( OperatorExpression exp ){ - if( _operatorExpressions == null ){ - _operatorExpressions = new LinkedList(); - } - _operatorExpressions.add( exp ); - } - - public boolean getHasDefault(){ - return _hasDefaultValue; - } - - public void setHasDefault( boolean def ){ - _hasDefaultValue = def; - } - public void setDefault( Object t ){ - _defaultValue = t; - } - public Object getDefault(){ - return _defaultValue; - } - - public boolean isForwardDeclaration(){ - return checkBit( isForward ); - } - - public void setIsForwardDeclaration( boolean forward ){ - setBit( forward, isForward ); - } - - /** - * canHold - * @param type - * @return boolean - * return true is the our type can hold all the values of the passed in - * type. - * TODO, for now return true if our type is "larger" (based on ordering of - * the type values) - */ - public boolean canHold( TypeInfo type ){ - return getType().compareTo( type.getType() ) >= 0; - } - - public boolean equals( Object t ){ - if( t == null || !(t instanceof TypeInfo) ){ - return false; - } - - TypeInfo type = (TypeInfo)t; - - boolean result = ( _typeInfo == type._typeInfo ); - result &= ( _type == type._type ); - - if( _typeDeclaration instanceof TemplateInstance ){ - result &= _typeDeclaration.equals( type._typeDeclaration ); - } else { - if( _typeDeclaration != null && type._typeDeclaration != null && - _typeDeclaration.isType( TypeInfo.t_bool, TypeInfo.t_void ) && - type._typeDeclaration.isType( TypeInfo.t_bool, TypeInfo.t_void ) ) - { - //if typeDeclaration is a basic type, then only need the types the same - result &= ( _typeDeclaration.getType() == type._typeDeclaration.getType() ); - } else { - //otherwise, its a user defined type, need the decls the same - result &= ( _typeDeclaration == type._typeDeclaration ); - } - } - - int size1 = (_ptrOperators == null) ? 0 : _ptrOperators.size(); - int size2 = (type._ptrOperators == null) ? 0 : type._ptrOperators.size(); - if( size1 == size2 ){ - if( size1 != 0 ){ - Iterator iter1 = _ptrOperators.iterator(); - Iterator iter2 = type._ptrOperators.iterator(); - - TypeInfo.PtrOp op1 = null, op2 = null; - for( int i = size1; i > 0; i-- ){ - op1 = (TypeInfo.PtrOp)iter1.next(); - op2 = (TypeInfo.PtrOp)iter2.next(); - - if( !op1.equals(op2) ){ - return false; - } - } - } - } else { - return false; - } - - return result; - } - - public String toString(){ - if( isType( TypeInfo.t_type ) ){ - return _typeDeclaration.getName(); - } else { - return TypeInfo._image[ getType().toInt() ]; - } - } - - private int _typeInfo = 0; - private TypeInfo.eType _type = TypeInfo.t_undef; - private ISymbol _typeDeclaration; - - private boolean _hasDefaultValue = false; - private Object _defaultValue = null; - private LinkedList _ptrOperators; - private LinkedList _operatorExpressions; -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java deleted file mode 100644 index 04cced9ba18..00000000000 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java +++ /dev/null @@ -1,238 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.core.parser.util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTExpression; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateParameter; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; - -/** - * This is a utility class to help convert AST elements to Strings. - */ - -public class ASTUtil { - public static String[] getTemplateParameters(IASTTemplateDeclaration templateDeclaration){ - // add the parameters - Iterator i = templateDeclaration.getTemplateParameters(); - return getTemplateParameters(i); - } - public static String[] getTemplateParameters(Iterator templateParams){ - List paramList = new ArrayList(); - while (templateParams.hasNext()){ - StringBuffer paramType = new StringBuffer(); - IASTTemplateParameter parameter = (IASTTemplateParameter)templateParams.next(); - if((parameter.getIdentifier() != null) && (parameter.getIdentifier().length() != 0)) - { - paramList.add(parameter.getIdentifier().toString()); - } - else - { - IASTTemplateParameter.ParamKind kind = parameter.getTemplateParameterKind(); - if(kind == IASTTemplateParameter.ParamKind.CLASS){ - paramType.append("class"); - } - if(kind == IASTTemplateParameter.ParamKind.TYPENAME){ - paramType.append("typename"); - } - if(kind == IASTTemplateParameter.ParamKind.TEMPLATE_LIST){ - paramType.append("template<"); - String[] subParams = getTemplateParameters(parameter.getTemplateParameters()); - int p = 0; - if ( subParams.length > 0) - paramType.append(subParams[p++]); - while( p < subParams.length){ - paramType.append(", "); - paramType.append(subParams[p++]); - } - paramType.append(">"); - } - if(kind == IASTTemplateParameter.ParamKind.PARAMETER){ - paramType.append(getType(parameter.getParameterDeclaration())); - } - paramList.add(paramType.toString()); - } // end else - }// end while - String[] parameterTypes = new String[paramList.size()]; - for(int j=0; j 0) - initializer.append("="); - initializer.append(literal); - } - } - } - return initializer.toString(); - } - public static String getPointerToFunctionType(IASTAbstractDeclaration declaration){ - StringBuffer type = new StringBuffer(); - ASTPointerOperator po = declaration.getPointerToFunctionOperator(); - if(po != null){ - type.append("("); - type.append(getPointerOperator(po)); - type.append(")"); - String[] parameters =getParameterTypes(declaration.getParameters()); - type.append(getParametersString(parameters)); - } - return type.toString(); - } - public static String getDeclarationType(IASTAbstractDeclaration declaration){ - StringBuffer type = new StringBuffer(); - - if(declaration.isConst()) - type.append("const "); - IASTTypeSpecifier typeSpecifier = declaration.getTypeSpecifier(); - if(typeSpecifier instanceof IASTElaboratedTypeSpecifier){ - IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier) typeSpecifier; - type.append(getElaboratedTypeSignature(elab)); - }else if(typeSpecifier instanceof IASTSimpleTypeSpecifier){ - IASTSimpleTypeSpecifier simpleSpecifier = (IASTSimpleTypeSpecifier) typeSpecifier; - type.append(simpleSpecifier.getTypename()); - } - return type.toString(); - } - - public static String getElaboratedTypeSignature(IASTElaboratedTypeSpecifier elab){ - StringBuffer type = new StringBuffer(); - ASTClassKind t = elab.getClassKind(); - if( t == ASTClassKind.CLASS){ - type.append("class"); - } - else if( t == ASTClassKind.STRUCT){ - type.append("struct"); - } - else if( t == ASTClassKind.UNION){ - type.append("union"); - } - else if( t == ASTClassKind.STRUCT){ - type.append("enum"); - } - type.append(" "); - type.append(elab.getName().toString()); - return type.toString(); - } - - public static String getPointerOperation(IASTAbstractDeclaration declaration){ - StringBuffer pointerString = new StringBuffer(); - Iterator i = declaration.getPointerOperators(); - while(i.hasNext()){ - ASTPointerOperator po = (ASTPointerOperator) i.next(); - pointerString.append(getPointerOperator(po)); - } - return pointerString.toString(); - } - - public static String getPointerOperator(ASTPointerOperator po){ - String pointerString =""; - if(po == ASTPointerOperator.POINTER) - pointerString = ("*"); - - if(po == ASTPointerOperator.REFERENCE) - pointerString =("&"); - - if(po == ASTPointerOperator.CONST_POINTER) - pointerString =("* const"); - - if(po == ASTPointerOperator.VOLATILE_POINTER) - pointerString =("* volatile"); - - return pointerString; - } - - public static String getArrayQualifiers(IASTAbstractDeclaration declaration){ - StringBuffer arrayString = new StringBuffer(); - Iterator i = declaration.getArrayModifiers(); - while (i.hasNext()){ - i.next(); - arrayString.append("[]"); - } - return arrayString.toString(); - } - - public static String[] getFunctionParameterTypes(IASTFunction functionDeclaration) - { - Iterator parameters = functionDeclaration.getParameters(); - return getParameterTypes(parameters); - } - - public static String[] getParameterTypes(Iterator parameters){ - List paramList = new ArrayList(); - while (parameters.hasNext()){ - IASTParameterDeclaration param = (IASTParameterDeclaration)parameters.next(); - paramList.add(getType(param)); - } - String[] parameterTypes = new String[paramList.size()]; - for(int i=0; i 0)) { - parameters.append("("); - int i = 0; - parameters.append(parameterTypes[i++]); - while (i < parameterTypes.length) { - parameters.append(", "); - parameters.append(parameterTypes[i++]); - } - parameters.append(")"); - } else { - if (parameterTypes != null) parameters.append("()"); - } - - return parameters.toString(); - } - -} diff --git a/core/org.eclipse.cdt.core/plugin.properties b/core/org.eclipse.cdt.core/plugin.properties deleted file mode 100644 index 5a55fb0d6e4..00000000000 --- a/core/org.eclipse.cdt.core/plugin.properties +++ /dev/null @@ -1,14 +0,0 @@ -pluginName=C/C++ Development Tools Core -providerName=Eclipse.org - -cnature.name=C Nature -ccnature.name=C++ Nature -CProblemMarker.name=C Problem - -CBuildCommand.name=C Builder Command -CBuildConsole.name=C Builder Console -CProject.name=C Project -ProcessList.name=Process List -ErrorParser.name=Error Parser - -CTaskName=C/C++ Task diff --git a/core/org.eclipse.cdt.core/plugin.xml b/core/org.eclipse.cdt.core/plugin.xml deleted file mode 100644 index 42655d2a60c..00000000000 --- a/core/org.eclipse.cdt.core/plugin.xml +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core/schema/CProject.exsd b/core/org.eclipse.cdt.core/schema/CProject.exsd deleted file mode 100644 index 0b981ea3c71..00000000000 --- a/core/org.eclipse.cdt.core/schema/CProject.exsd +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - [Enter description of this extension point] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core/schema/ProcessList.exsd b/core/org.eclipse.cdt.core/schema/ProcessList.exsd deleted file mode 100644 index dccbc5a35ae..00000000000 --- a/core/org.eclipse.cdt.core/schema/ProcessList.exsd +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - [Enter description of this extension point] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.core/search/ChangeLog b/core/org.eclipse.cdt.core/search/ChangeLog deleted file mode 100644 index ea03a2967c4..00000000000 --- a/core/org.eclipse.cdt.core/search/ChangeLog +++ /dev/null @@ -1,258 +0,0 @@ -2003-10-23 Bogdan Gheorghe - - - Added AcceptMatchOperation to get around Bug 45324. The search - operation is no longer a WorkspaceModifyOperation (which used to - lock the workspace for the duration of search). Instead, we now - lock the workspace only when we tag the resources with markers. - - - Modified SearchEngine : we now receive a list of matches - from the search that we pass into the AcceptMatchOperation. - - - Modified MatchLocator to add matches to passed in list instead - of reporting them right away - - - Modified JobManager: -added in jobToIgnore parm to unblock dependency - jobs - - -2003-10-06 Bogdan Gheorghe - - added createCFileSearchScope() to SearchEngine.java to improve - code complete performance - -2003-10-01 Andrew Niefer - - fix bug 44026 by checking scope before reporting match in MatchLocator.report - -2003-10-01 Andrew Niefer - - fix BasicSearchMatch.equals() for bug43988 - -2003-09-30 Bogdan Gheorghe - - changed logging in JobManager to use new ICLogConstants - -2003-09-30 Andrew Niefer - -fix bug43862 - Cannot find macro delcarations using all occurences. - * modified CSearchPattern.createMacroPattern - -2003-09-29 Andrew Niefer - - fix bug 43062 outline is confused on operator methods containing spaces - - modify CSearchPattern.scanForNames to use same naming convention as TokenDuple.toString() - - modify MatchLocator.report to use IASTOffsetableNamedElement.getNameEndOffset() - -2003-09-29 Andrew Niefer - -bug42911 - Search: cannot find beyond use of data member - - fix NPE's in BasicSearchMatch.equals & hashCode - -2003-09-29 Andrew Niefer - -fix NPE if IScannerInfoProvider returns null IScannerInfo - -2003-09-25 Andrew Niefer - - bug43129 - Cannot search for definitions of global variables - - check definitions for variables, fields, enumerators and namespaces - - handle enter/exitLinkageSpecification - * search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java - * search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java - -2003-09-25 Bogdan Gheorghe - - added SearchFor INCLUDE in ICSearchConstants - - added acceptIncludeDeclaration to IIndexSearchRequestor - - modified PathCollector to acceptIncludeDeclarations - - modified CSearchPattern to create an IncludePattern - - added IncludePattern.java - -2003-09-25 Andrew Niefer - - partial fix for 43664 Modify Matchlocator to not try and create a link if we have no - resource, instead just use the path - -2003-09-23 Andrew Niefer - fix bug 43498 Search with ? fails on first letter of second word - -modifications to CSearchPattern.scanForNames() - -add getSimpleName to MethodDeclarationPattern - -2003-09-19 Andrew Niefer - fix bug 43327 Code Complete finds local variables - - modified MatchLocator to not report local declarations when boolean is set - - modified SearchEngine.search to take an additional parameter "excludeLocalDeclarations" - -2003-09-15 Andrew Niefer - - modify CSearchPattern to handle escaping wildcards (bug43063) - - modify enterFunctionBody and enterMethodBody to fix bug42979 - - search for Parameter References - -2003-09-13 Andrew Niefer - -Searching for Typedefs: (bug42902) - - modified setElementInfo in BasicSearchResultCollector - - added TYPEDEF to ICSearchConstants - - modified CSearchPattern & ClassDeclarationPattern - - implemented acceptTypedef* in MatchLocator - - modified BasicSearchMatch to implement Comparable - -2003-09-11 Andrew Niefer - - Modified ICSearchResultCollector.createMatch to not take a parent parameter - - modified BasicSearchResultCollector to create the parent string from the fully qualified name of the node - - modified MatchLocator to keep track of most recent declaration for reporting purposes - - modified MatchLocator.report to use the most recent declaration - -2003-09-09 Andrew Niefer - pattern matching on function parameters: - - modified scanForParameters in CSearchPattern - - added getParamString in CSearchPattern - - modified matchLevel in MethodDeclarationPattern - - Enumeration references - - modified acceptEnumeratorReference in MatchLocator - -2003-09-05 Andrew Niefer - - fix searching for enumerators - -2003-09-03 Andrew Niefer - - added CLASS_STRUCT to the SearchFor constants - - Modified CSearchPattern to handle CLASS_STRUCT - -2003-08-26 Bogdan Gheorghe - - Added debug tracing statements to SearchEngine - - Modified scanForNames in CSearchPattern to treat append - a token after "~" to allow for destructors search - - Added scope checking to MatchLocator - - Added debug trace statements to MatchLocator - -2003-08-20 Bogdan Gheorghe - - Changed matching and reporting functions to handle nodes - of type IElaboratedTypeSpecifier - -2003-08-12 Bogdan Gheorghe - - Rolled field and variable search patterns into one pattern, in - order to allow for qualified var searches - -2003-08-11 Andrew Niefer - - Added Macro ICSearchConstant - - Added acceptMacro to IIndexSearchRequestor and PathCollector - - Added MacroDeclaration Pattern - - Rolled method and function patterns into one method pattern - - Added WorkingCopy support to search - -2003-08-08 Bogdan Gheorghe - - Added CreateSearchScope to create a search scope out of - CElements - - Filled out CSearchScope to enable: - - adding a project to scope, include referenced projects - - adding individual CElements to scope - -2003-08-08 Andrew Niefer - - add function parameter information to search results - -2003-08-06 Andrew Niefer - - Create OrPattern which matches for search if any of its constituent patterns matches - - modified MatchLocator to support the OrPattern - - searching for All occurences now uses the OrPattern - -2003-08-01 Andrew Niefer - - Modified BasicSearchResultCollector to only accept matches it has not already seen - - fixed bug in finding a resource when entering includes - -2003-07-29 Andrew Niefer - Refactoring Search result collection: - - Modified ICSearchResultCollector - - Modified IMatch - - Modified MatchLocator to reflect changes in ICSearchResultCollector - - Created BasicSearchMatch implements IMatch - - Created BasicSearchResultCollector implements ICSearchResultCollector - -2003-07-28 Andrew Niefer - - added abstract CSearchPattern.resetIndexInfo fix bug with searching with globally - qualified names - - fixed bug in CSearchPattern.matchQualifications to do with globally qualified names - - fixed bug in CSearchPattern.createFunctionPattern to do with parameter lists. - -2003-07-25 Bogdan Gheorghe - - Added refs to PathCollector - - Filled in feedIndexRequestor for the new search patterns - - Fixed the FunctionDeclarationPattern to work with no parms - -2003-07-24 Andrew Niefer - - Implemented decodeIndexEntry & matchIndexEntry for all patterns - - changed MatchLocator to use a COMPLETE_PARSE. - -2003-07-23 Andrew Niefer - -Changed ICSearchPattern.matchLevel to take a ISourceElementCallbackDelegate - -Changed ICSearchResultCollector.createMatch to take a ISourceElementCallbackDelegate - -first implementations of: - -CSearchPattern.createFunctionPattern - -CSearchPattern.createVariablePattern - -CSearchPattern.createMethodPattern - -preliminary matching for remaining patterns - -handling of remaining parser callbacks - -generating index Prefixes for the patterns - -2003-07-14 Andrew Niefer - -Modified SearchFor instances in ICSearchConstants to more closely match what we are searching for - -added IMatch interface, it represents matches found by the search engine, implementors can store - whatever information they like, see ICSearchResultCollector::createMatch - -added createMatch to the ICSearchResultCollector interface, the result collector is responsible for - implementing IMatch to store whatever data they want out of the AST nodes. - -added skeleton patterns: - search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java - search/org/eclipse/cdt/internal/core/search/matching/FunctionDeclarationPattern.java - search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java - search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java - search/org/eclipse/cdt/internal/core/search/matching/VariableDeclarationPattern.java - -added beginnings of CSearchPattern::create*Pattern functions - -modifications to MatchLocator to keep track of current scope - -added CSearchPattern::matchQualifications - -2003-07-10 Bogdan Gheorghe - Provided implementation for ICSearchScope.java, CSearchScope.java - - Hooked up new CWorkspaceScope, PathCollector, PatternSearchJob in SearchEngine.java - - Provided implementation for PatternSearchJob.java - PatternSearchJob is where the first part - of the search occurs - using an IndexSelector to filter the indexes, it gets the indexes from - the IndexManager and then uses the passed in pattern to find the index matched. Once it finds - an index match it adds the file path to the PathCollector. - - Modified CSearchPattern - added support to find index entries. - - Modified ClassDeclarationPattern - added support to decode, match and report - index entries. - - - Added: - * search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java - * search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java - * search/org/eclipse/cdt/internal/core/search/IndexSelector.java - * search/org/eclipse/cdt/internal/core/search/PathCollector.java - - Modified: - * search/org/eclipse/cdt/core/search/ICSearchScope.java - * search/org/eclipse/cdt/core/search/SearchEngine.java - * search/org/eclipse/cdt/internal/core/search/CSearchScope.java - * search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java - * search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java - * search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java - -2003-07-04 Andrew Niefer - Modified ICSearchConstants to use new nested classes SearchFor and LimitTo instead of int - for stronger type safety - - Updated MatchLocator to invoke parser to do actual search. - -2003-06-27 Andrew Niefer - Modified: - search/org.eclipse.cdt.core.search.matching/MatchLocator.java - - enter/exitInclusion - - enterClassSpecifier - search/org.eclipse.cdt.core.search.matching/CSearchPattern.java - - createClassPattern - - matchesName - search/org.eclipse.cdt.core.search.matching/ClassDeclarationPattern.java - - matchLevel - search/org.eclipse.cdt.core.search/ICSearchPattern.java - search/org.eclipse.cdt.core.search/ICSearchResultCollector.java - search/org.eclipse.cdt.core.search/SearchEngine.java - -2003-06-25 Bogdan Gheorghe - Modified: - * search/org/eclipse/cdt/core/search/ICSearchConstants.java - * search/org/eclipse/cdt/internal/core/search/Utils.java - - moved to index/org/eclipse/cdt/internal/core/search/Utils.java - * search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java - * search/org/eclipse/cdt/internal/core/search/processing/IJob.java - * search/org/eclipse/cdt/internal/core/search/processing/JobManager.java \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchMatch.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchMatch.java deleted file mode 100644 index d641881c6e3..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchMatch.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 29, 2003 - */ -package org.eclipse.cdt.core.search; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class BasicSearchMatch implements IMatch, Comparable { - - public BasicSearchMatch() { - } - - public BasicSearchMatch(BasicSearchMatch basicMatch) { - name = basicMatch.name; - parentName = basicMatch.parentName; - returnType = basicMatch.returnType; - resource = basicMatch.resource; - path = basicMatch.path; - startOffset = basicMatch.startOffset; - endOffset = basicMatch.endOffset; - } - - public int hashCode(){ - String hashString = ""; - - hashString += name; - hashString += ":" + parentName; - hashString += ":" + returnType; - - if( getLocation() != null) - hashString += ":" + getLocation().toString(); - - hashString += ":" + startOffset + ":" + endOffset; - hashString += ":" + type + ":" + visibility; - - return hashString.hashCode(); - } - - public boolean equals(Object obj){ - if( !(obj instanceof BasicSearchMatch ) ){ - return false; - } - BasicSearchMatch match = (BasicSearchMatch)obj; - - IPath path = getLocation(); - - if( startOffset != match.getStartOffset() || endOffset != match.getEndOffset() ) - return false; - - if( type != match.getElementType() || visibility != match.getVisibility() ) - return false; - - if( name != null && match.getName() != null){ - if( !name.equals( match.getName() ) ) - return false; - } else if( name != match.getName() ){ - return false; - } - - if( parentName != null && match.getParentName() != null){ - if( !parentName.equals( match.getParentName() ) ) - return false; - } else if( parentName != match.getParentName() ){ - return false; - } - - if( returnType != null && match.getReturnType() != null){ - if( !returnType.equals( match.getReturnType() ) ) - return false; - } else if( returnType != match.getReturnType() ){ - return false; - } - - IPath thisPath = getLocation(); - IPath matchPath = match.getLocation(); - if( thisPath != null && matchPath != null ){ - if( !thisPath.equals( matchPath ) ) - return false; - } else if( thisPath != matchPath ){ - return false; - } - - return true; - } - - public int compareTo( Object o ){ - if( !( o instanceof BasicSearchMatch ) ){ - throw new ClassCastException(); - } - - BasicSearchMatch match = (BasicSearchMatch) o; - - String str1 = getLocation().toString(); - String str2 = match.getLocation().toString(); - - str1 += " " + getStartOffset()+ " "; - str2 += " " + match.getStartOffset()+ " "; - - str1 += getName() + " " + getParentName()+ " " + getReturnType(); - str2 += match.getName() + " " + match.getParentName()+ " " + getReturnType(); - - return str1.compareTo( str2 ); - } - - public String name = null; - public String parentName = null; - public String returnType; - - public IResource resource = null; - public IPath path = null; - - public int startOffset = 0; - public int endOffset = 0; - - public int type = 0; - public int visibility = 0; - - boolean isConst = false; - boolean isVolatile = false; - boolean isStatic = false; - - public int getElementType() { - return type; - } - - public int getVisibility() { - return visibility; - } - - public String getName() { - return name; - } - - public String getParentName() { - return parentName; - } - - public String getReturnType() { - return returnType; - } - - public IResource getResource() { - return resource; - } - - public IPath getLocation() { - if(resource != null) - return resource.getLocation(); - else if (path != null) - return path; - else return null; - } - - public int getStartOffset() { - return startOffset; - } - - public int getEndOffset() { - return endOffset; - } - - public boolean isStatic() { - return isStatic; - } - public boolean isConst() { - return isConst; - } - - public boolean isVolatile() { - return isVolatile; - } - /** - * @return - */ - public int getType() { - return type; - } - - /** - * @param i - */ - public void setEndOffset(int i) { - endOffset = i; - } - - /** - * @param b - */ - public void setConst(boolean b) { - isConst = b; - } - - /** - * @param b - */ - public void setStatic(boolean b) { - isStatic = b; - } - - /** - * @param b - */ - public void setVolatile(boolean b) { - isVolatile = b; - } - - /** - * @param string - */ - public void setName(String string) { - name = string; - } - - /** - * @param string - */ - public void setParentName(String string) { - parentName = string; - } - - /** - * @param string - */ - public void setReturnType(String string) { - returnType = string; - } - - /** - * @param i - */ - public void setStartOffset(int i) { - startOffset = i; - } - - /** - * @param i - */ - public void setType(int i) { - type = i; - } - - /** - * @param i - */ - public void setVisibility(int i) { - visibility = i; - } - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java deleted file mode 100644 index e9185f43321..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/BasicSearchResultCollector.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 29, 2003 - */ -package org.eclipse.cdt.core.search; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.internal.core.parser.util.ASTUtil; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class BasicSearchResultCollector implements ICSearchResultCollector { - - public void aboutToStart() { - results = new HashSet(); - } - - public void done() { - } - - public IProgressMonitor getProgressMonitor() { - return null; - } - - public IMatch createMatch(Object fileResource, int start, int end, ISourceElementCallbackDelegate node ) throws CoreException - { - BasicSearchMatch result = new BasicSearchMatch(); - return createMatch( result, fileResource, start, end, node ); - } - - public IMatch createMatch( BasicSearchMatch result, Object fileResource, int start, int end, ISourceElementCallbackDelegate node ) throws CoreException { - if( fileResource instanceof IResource ) - result.resource = (IResource) fileResource; - else if( fileResource instanceof IPath ) - result.path = (IPath) fileResource; - - result.startOffset = start; - result.endOffset = end; - result.parentName = ""; - - IASTOffsetableNamedElement offsetable = null; - - if( node instanceof IASTReference ){ - offsetable = (IASTOffsetableNamedElement) ((IASTReference)node).getReferencedElement(); - result.name = ((IASTReference)node).getName(); - } else if( node instanceof IASTOffsetableNamedElement ){ - offsetable = (IASTOffsetableNamedElement)node; - result.name = offsetable.getName(); - } - - result.parentName = ""; - String [] names = null; - if( offsetable instanceof IASTEnumerator ){ - IASTEnumerator enumerator = (IASTEnumerator) offsetable; - names = enumerator.getOwnerEnumerationSpecifier().getFullyQualifiedName(); - } else if( offsetable instanceof IASTQualifiedNameElement ) { - names = ((IASTQualifiedNameElement) offsetable).getFullyQualifiedName(); - } - - if( names != null ){ - for( int i = 0; i < names.length - 1; i++ ){ - if( i > 0 ) - result.parentName += "::"; - - result.parentName += names[ i ]; - } - } - if (offsetable instanceof IASTVariable){ - result.returnType = ASTUtil.getType(((IASTVariable)offsetable).getAbstractDeclaration()); - } - if( offsetable instanceof IASTFunction ){ - result.name += getParameterString( (IASTFunction) offsetable ); - result.returnType = ASTUtil.getType(((IASTFunction)offsetable).getReturnType()); - } - - setElementInfo( result, offsetable ); - - return result; - } - - - /** - * @param function - * @return - */ - private String getParameterString(IASTFunction function) { - if( function == null ) - return ""; - - String paramString = "("; - - Iterator iter = function.getParameters(); - - boolean first = true; - while( iter.hasNext() ){ - IASTParameterDeclaration param = (IASTParameterDeclaration) iter.next(); - - if( !first ) paramString += ", "; - - IASTTypeSpecifier typeSpec = param.getTypeSpecifier(); - if( param.isConst() ) - paramString += "const "; - - if( typeSpec instanceof IASTSimpleTypeSpecifier ){ - paramString += ((IASTSimpleTypeSpecifier)typeSpec).getTypename(); - } else if( typeSpec instanceof IASTOffsetableNamedElement ){ - paramString += ((IASTOffsetableNamedElement)typeSpec).getName(); - } else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){ - ASTClassKind kind = ((IASTElaboratedTypeSpecifier)typeSpec).getClassKind(); - if( kind == ASTClassKind.CLASS ){ - paramString += "class "; - } else if( kind == ASTClassKind.STRUCT ){ - paramString += "struct "; - } else if( kind == ASTClassKind.ENUM ){ - paramString += "enum "; - } else if( kind == ASTClassKind.UNION ){ - paramString += "union "; - } - paramString += ((IASTElaboratedTypeSpecifier)typeSpec).getName(); - } - - Iterator ptrs = param.getPointerOperators(); - if( ptrs.hasNext() ) paramString += " "; - - while( ptrs.hasNext() ){ - ASTPointerOperator ptr = (ASTPointerOperator)ptrs.next(); - if( ptr == ASTPointerOperator.POINTER ) - paramString += "*"; - else if( ptr == ASTPointerOperator.REFERENCE ) - paramString += "&"; - else if( ptr == ASTPointerOperator.CONST_POINTER ) - paramString += " const * "; - else if( ptr == ASTPointerOperator.VOLATILE_POINTER ) - paramString += " volatile * "; - - ptr = ASTPointerOperator.POINTER; - } - - first = false; - } - - paramString += ")"; - return paramString; - } - - public boolean acceptMatch(IMatch match) throws CoreException { - if( !results.contains( match ) ){ - results.add( match ); - return true; - } - return false; - } - - public Set getSearchResults(){ - return results; - } - - private void setElementInfo( BasicSearchMatch match, IASTOffsetableElement node ){ - //ImageDescriptor imageDescriptor = null; - if( node instanceof IASTClassSpecifier || - node instanceof IASTElaboratedTypeSpecifier ){ - - ASTClassKind kind = null; - if (node instanceof IASTClassSpecifier){ - kind = ((IASTClassSpecifier)node).getClassKind(); - } - else{ - kind = ((IASTElaboratedTypeSpecifier)node).getClassKind(); - } - - if( kind == ASTClassKind.CLASS ){ - match.type = ICElement.C_CLASS; - } else if ( kind == ASTClassKind.STRUCT ){ - match.type = ICElement.C_STRUCT; - } else if ( kind == ASTClassKind.UNION ){ - match.type = ICElement.C_UNION; - } - } else if ( node instanceof IASTNamespaceDefinition ){ - match.type = ICElement.C_NAMESPACE; - } else if ( node instanceof IASTEnumerationSpecifier ){ - match.type = ICElement.C_ENUMERATION; - } else if ( node instanceof IASTMacro ){ - match.type = ICElement.C_MACRO; - } else if ( node instanceof IASTField ){ - match.type = ICElement.C_FIELD; - IASTField field = (IASTField)node; - ASTAccessVisibility visibility = field.getVisiblity(); - if( visibility == ASTAccessVisibility.PUBLIC ){ - match.visibility = ICElement.CPP_PUBLIC; - } else if ( visibility == ASTAccessVisibility.PRIVATE ) { - match.visibility = ICElement.CPP_PRIVATE; - } // else protected, there is no ICElement.CPP_PROTECTED - match.isConst = field.getAbstractDeclaration().isConst(); - match.isStatic = field.isStatic(); - } else if ( node instanceof IASTVariable ){ - match.type = ICElement.C_VARIABLE; - IASTVariable variable = (IASTVariable)node; - match.isConst = variable.getAbstractDeclaration().isConst(); - } else if ( node instanceof IASTEnumerator ){ - match.type = ICElement.C_ENUMERATOR; - } else if ( node instanceof IASTMethod ){ - match.type = ICElement.C_METHOD; - IASTMethod method = (IASTMethod) node; - ASTAccessVisibility visibility = method.getVisiblity(); - if( visibility == ASTAccessVisibility.PUBLIC ){ - match.visibility = ICElement.CPP_PUBLIC; - } else if ( visibility == ASTAccessVisibility.PRIVATE ) { - match.visibility = ICElement.CPP_PRIVATE; - } // else protected, there is no ICElement.CPP_PROTECTED - match.isConst = method.isConst(); - match.isVolatile = method.isVolatile(); - match.isStatic = method.isStatic(); - } else if ( node instanceof IASTFunction ){ - match.type = ICElement.C_FUNCTION; - IASTFunction function = (IASTFunction)node; - match.isStatic = function.isStatic(); - } else if ( node instanceof IASTTypedefDeclaration ){ - match.type = ICElement.C_TYPEDEF; - } - } - - private Set results; -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchConstants.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchConstants.java deleted file mode 100644 index 13e8ee097f6..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchConstants.java +++ /dev/null @@ -1,207 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 31, 2003 - */ -package org.eclipse.cdt.core.search; - -/** - * @author bgheorgh - */ -import org.eclipse.cdt.internal.core.search.processing.*; - - -/** - *

          - * This interface defines the constants used by the search engine. - *

          - *

          - * This interface declares constants only; it is not intended to be implemented. - *

          - * @see org.eclipse.cdt.core.search.SearchEngine - */ -public interface ICSearchConstants { - /** - * The nature of searched element or the nature - * of match in unknown. - */ - public static final SearchFor UNKNOWN_SEARCH_FOR = new SearchFor( -1 ); - public static final LimitTo UNKNOWN_LIMIT_TO = new LimitTo( -1 ); - - /* Nature of searched element */ - - /** - * The searched element is a type. - */ - public static final SearchFor TYPE = new SearchFor( 0 ); - - /** - * The searched element is a function. - */ - public static final SearchFor FUNCTION = new SearchFor( 1 ); - - /** - * The searched element is a namespace. - */ - public static final SearchFor NAMESPACE = new SearchFor( 2 ); - - /** - * The searched element is a method (member function). - */ - public static final SearchFor METHOD = new SearchFor( 3 ); - - /** - * The searched element is a field (member variable). - */ - public static final SearchFor FIELD = new SearchFor( 4 ); - - /** - * The searched element is a variable. - * More selective than using TYPE - */ - public static final SearchFor VAR = new SearchFor( 5 ); - - /** - * The searched element is a class. - * More selective than using TYPE - */ - public static final SearchFor CLASS = new SearchFor( 6 ); - - /** - * The searched element is a struct. - * More selective than using TYPE - */ - public static final SearchFor STRUCT = new SearchFor( 7 ); - - /** - * The searched element is a enum. - * More selective than using TYPE - */ - public static final SearchFor ENUM = new SearchFor( 8 ); - - /** - * The searched element is a union. - * More selective than using TYPE - */ - public static final SearchFor UNION = new SearchFor( 9 ); - - public static final SearchFor MACRO = new SearchFor( 10 ); - - public static final SearchFor CLASS_STRUCT = new SearchFor( 11 ); - - public static final SearchFor TYPEDEF = new SearchFor( 12 ); - - public static final SearchFor INCLUDE = new SearchFor( 13 ); - - - /* Nature of match */ - - /** - * The search result is a declaration. - * Can be used in conjunction with any of the nature of searched elements - * so as to better narrow down the search. - */ - public static final LimitTo DECLARATIONS = new LimitTo( 0 ); - - /** - * The search result is a type that implements an interface. - * Used in conjunction with either TYPE or CLASS or INTERFACE, it will - * respectively search for any type implementing/extending an interface, or - * rather exclusively search for classes implementing an interface, or interfaces - * extending an interface. - */ - public static final LimitTo DEFINITIONS = new LimitTo( 1 ); - - /** - * The search result is a reference. - * Can be used in conjunction with any of the nature of searched elements - * so as to better narrow down the search. - * References can contain implementers since they are more generic kind - * of matches. - */ - public static final LimitTo REFERENCES = new LimitTo( 2 ); - - /** - * The search result is a declaration, a reference, or an implementer - * of an interface. - * Can be used in conjunction with any of the nature of searched elements - * so as to better narrow down the search. - */ - public static final LimitTo ALL_OCCURRENCES = new LimitTo( 3 ); - - - /* Syntactic match modes */ - - /** - * The search pattern matches exactly the search result, - * that is, the source of the search result equals the search pattern. - */ - int EXACT_MATCH = 0; - /** - * The search pattern is a prefix of the search result. - */ - int PREFIX_MATCH = 1; - /** - * The search pattern contains one or more wild cards ('*') where a - * wild-card can replace 0 or more characters in the search result. - */ - int PATTERN_MATCH = 2; - - - /* Case sensitivity */ - - /** - * The search pattern matches the search result only - * if cases are the same. - */ - boolean CASE_SENSITIVE = true; - /** - * The search pattern ignores cases in the search result. - */ - boolean CASE_INSENSITIVE = false; - - - /* Waiting policies */ - - /** - * The search operation starts immediately, even if the underlying indexer - * has not finished indexing the workspace. Results will more likely - * not contain all the matches. - */ - int FORCE_IMMEDIATE_SEARCH = IJob.ForceImmediate; - /** - * The search operation throws an org.eclipse.core.runtime.OperationCanceledException - * if the underlying indexer has not finished indexing the workspace. - */ - int CANCEL_IF_NOT_READY_TO_SEARCH = IJob.CancelIfNotReady; - /** - * The search operation waits for the underlying indexer to finish indexing - * the workspace before starting the search. - */ - int WAIT_UNTIL_READY_TO_SEARCH = IJob.WaitUntilReady; - - - public class SearchFor{ - private SearchFor( int value ) - { - this.value = value; - } - private final int value; - } - - public class LimitTo { - private LimitTo( int value ) - { - this.value = value; - } - private final int value; - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchPattern.java deleted file mode 100644 index 8dc2edc2acc..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchPattern.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 13, 2003 - */ -package org.eclipse.cdt.core.search; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface ICSearchPattern extends ICSearchConstants{ - - public static final int IMPOSSIBLE_MATCH = 0; - public static final int POSSIBLE_MATCH = 1; - public static final int ACCURATE_MATCH = 2; - public static final int INACCURATE_MATCH = 3; - - /** - * @param node - * @return - */ - int matchLevel( ISourceElementCallbackDelegate node, LimitTo limit ); - - LimitTo getLimitTo(); - boolean canAccept( LimitTo limit ); -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchResultCollector.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchResultCollector.java deleted file mode 100644 index e0fb0b463f9..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchResultCollector.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 11, 2003 - */ -package org.eclipse.cdt.core.search; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface ICSearchResultCollector { - /** - * The search result corresponds exactly to the search pattern. - */ - int EXACT_MATCH = 0; - - /** - * The search result is potentially a match for the search pattern, - * but a problem prevented the search engine from being more accurate - * (typically because of the classpath was not correctly set). - */ - int POTENTIAL_MATCH = 1; - - /** - * Called before the actual search starts. - */ - public void aboutToStart(); - - /** - * Called when the search has ended. - */ - public void done(); - - public IMatch createMatch( Object fileResource, int start, int end, - ISourceElementCallbackDelegate node ) throws CoreException; - - //return whether or not the match was accepted - public boolean acceptMatch( IMatch match ) throws CoreException; - - /** - * Returns the progress monitor used to report progress. - * - * @return a progress monitor or null if no progress monitor is provided - */ - public IProgressMonitor getProgressMonitor(); - - - /** - * returns an IMatch object that contains any information the client cared - * to extract from the IAST node. - * Note that clients should not reference information in the node itself so - * that it can be garbage collected - * @param node - * @return - */ - //public IMatch createMatch(ISourceElementCallbackDelegate node, IASTScope parent ); -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchScope.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchScope.java deleted file mode 100644 index f2722b593ef..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/ICSearchScope.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Jun 12, 2003 - */ -package org.eclipse.cdt.core.search; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.runtime.IPath; - -public interface ICSearchScope { - /** - * Checks whether the resource at the given path is enclosed by this scope. - * - * @param resourcePath if the resource is contained in - * @return whether the resource is enclosed by this scope - */ - public boolean encloses(String resourcePath); - /** - * Checks whether this scope encloses the given element. - * - * @param element the given element - * @return true if the element is in this scope - */ - public boolean encloses(ICElement element); - /** - * Returns the paths to the enclosing projects for this search scope. - *
            - *
          • If the path is a project path, this is the full path of the project - * (see IResource.getFullPath()). - * For example, /MyProject - *
          • - * - * @return an array of paths to the enclosing projects. - */ - IPath[] enclosingProjects(); - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/IMatch.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/IMatch.java deleted file mode 100644 index b76e43b8ffc..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/IMatch.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 10, 2003 - */ -package org.eclipse.cdt.core.search; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface IMatch { - - int getElementType(); - - int getVisibility(); - - String getName(); - - String getParentName(); - - IResource getResource(); - - IPath getLocation(); - - int getStartOffset(); - - int getEndOffset(); - - boolean isStatic(); - boolean isConst(); - boolean isVolatile(); -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/SearchEngine.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/SearchEngine.java deleted file mode 100644 index 23f7a3c6c48..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/SearchEngine.java +++ /dev/null @@ -1,213 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Jun 11, 2003 - */ -package org.eclipse.cdt.core.search; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.core.search.AcceptMatchOperation; -import org.eclipse.cdt.internal.core.search.CSearchScope; -import org.eclipse.cdt.internal.core.search.CWorkspaceScope; -import org.eclipse.cdt.internal.core.search.PathCollector; -import org.eclipse.cdt.internal.core.search.PatternSearchJob; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.matching.CSearchPattern; -import org.eclipse.cdt.internal.core.search.matching.MatchLocator; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class SearchEngine implements ICSearchConstants{ - - public static boolean VERBOSE = false; - - /** - * A list of working copies that take precedence over their original - * compilation units. - */ - private IWorkingCopy[] workingCopies = null; - - /** - * - */ - public SearchEngine() { - super(); - // TODO Auto-generated constructor stub - } - - public SearchEngine(IWorkingCopy[] workingCopies) { - this.workingCopies = workingCopies; - } - - /** - * @return - */ - public static ICSearchScope createWorkspaceScope() { - // TODO Auto-generated method stub - return new CWorkspaceScope(); - } - - public static ICSearchScope createCSearchScope(ICElement[] elements) { - return createCSearchScope(elements, true); - } - /** - * @param objects - * @return - */ - public static ICSearchScope createCSearchScope(ICElement[] elements, boolean includeReferencedProjects) { - CSearchScope scope = new CSearchScope(); - HashSet visitedProjects = new HashSet(2); - for (int i = 0, length = elements.length; i < length; i++) { - ICElement element = elements[i]; - if (element != null) { - try { - if (element instanceof ICProject) { - scope.add((ICProject)element, includeReferencedProjects, visitedProjects); - } else { - scope.add(element); - } - } catch (Exception e) { - // ignore - } - } - } - return scope; - } - - /** - * @param objects - * @return - */ - public static ICSearchScope createCFileSearchScope(IFile sourceFile, ArrayList elements) { - CSearchScope scope = new CSearchScope(); - HashSet visitedProjects = new HashSet(2); - - if (sourceFile != null){ - //Add the source file and project - scope.addFile(sourceFile.getFullPath(), sourceFile.getProject()); - IPath rootPath = CCorePlugin.getWorkspace().getRoot().getLocation(); - int segCount = CCorePlugin.getWorkspace().getRoot().getLocation().segmentCount(); - if (elements!=null){ - Iterator i = elements.iterator(); - while (i.hasNext()){ - IPath tempPath = new Path((String) i.next()); - if (rootPath.isPrefixOf(tempPath)){ - //path is in workspace - IFile tempFile = CCorePlugin.getWorkspace().getRoot().getFile(tempPath); - IPath finalPath = tempFile.getFullPath().removeFirstSegments(segCount); - tempFile = CCorePlugin.getWorkspace().getRoot().getFile(finalPath); - scope.addFile(tempFile.getFullPath(), tempFile.getProject()); - } - else{ - scope.addFile(tempPath,null); - } - - } - } - } - return scope; - } - - public static ICSearchPattern createSearchPattern( String stringPattern, SearchFor searchFor, LimitTo limitTo, boolean isCaseSensitive){ - int mode; - - if( stringPattern.indexOf( '*' ) != -1 || stringPattern.indexOf( '?' ) != -1 ){ - mode = ICSearchConstants.PATTERN_MATCH; - } else { - mode = ICSearchConstants.EXACT_MATCH; - } - - return CSearchPattern.createPattern( stringPattern, searchFor, limitTo, mode, isCaseSensitive ); - } - - /** - * @param _workspace - * @param pattern - * @param _scope - * @param _collector - */ - public void search(IWorkspace workspace, ICSearchPattern pattern, ICSearchScope scope, ICSearchResultCollector collector, boolean excludeLocalDeclarations) { - if( VERBOSE ) { - System.out.println("Searching for " + pattern + " in " + scope); //$NON-NLS-1$//$NON-NLS-2$ - } - - if( pattern == null ){ - return; - } - - /* search is starting */ - collector.aboutToStart(); - ArrayList matches = new ArrayList(); - try{ - //initialize progress monitor - IProgressMonitor progressMonitor = collector.getProgressMonitor(); - if( progressMonitor != null ){ - progressMonitor.beginTask( Util.bind("engine.searching"), 100 ); //$NON_NLS-1$ - } - - /* index search */ - PathCollector pathCollector = new PathCollector(); - - CModelManager modelManager = CModelManager.getDefault(); - IndexManager indexManager = modelManager.getIndexManager(); - - SubProgressMonitor subMonitor = (progressMonitor == null ) ? null : new SubProgressMonitor( progressMonitor, 5 ); - - indexManager.performConcurrentJob( - new PatternSearchJob( - (CSearchPattern) pattern, - scope, - pathCollector, - indexManager - ), - ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, - subMonitor, - null ); - - subMonitor = (progressMonitor == null ) ? null : new SubProgressMonitor( progressMonitor, 95 ); - - MatchLocator matchLocator = new MatchLocator( pattern, collector, scope, subMonitor ); - matchLocator.setShouldExcludeLocalDeclarations( excludeLocalDeclarations ); - - if( progressMonitor != null && progressMonitor.isCanceled() ) - throw new OperationCanceledException(); - - //TODO: BOG Filter Working Copies... - matchLocator.locateMatches( pathCollector.getPaths(), workspace, this.workingCopies, matches); - } finally { - AcceptMatchOperation acceptMatchOp = new AcceptMatchOperation(collector, matches); - try { - CCorePlugin.getWorkspace().run(acceptMatchOp,null); - } catch (CoreException e) {} - } - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/AcceptMatchOperation.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/AcceptMatchOperation.java deleted file mode 100644 index 13e390629ac..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/AcceptMatchOperation.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Created on Oct 20, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.core.search; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.cdt.core.search.ICSearchResultCollector; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * @author bgheorgh - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class AcceptMatchOperation implements IWorkspaceRunnable { - - ICSearchResultCollector collector; - ArrayList matches; - /** - * @param collector - */ - public AcceptMatchOperation(ICSearchResultCollector collector, ArrayList matches) { - this.collector = collector; - this.matches = matches; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor) - */ - public void run(IProgressMonitor monitor) throws CoreException { - Iterator i = matches.iterator(); - while (i.hasNext()){ - IMatch match = (IMatch) i.next(); - collector.acceptMatch(match); - } - collector.done(); - } - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java deleted file mode 100644 index 5142b55652c..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/CSearchScope.java +++ /dev/null @@ -1,251 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.core.search; - -import java.util.ArrayList; -import java.util.HashSet; - -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IMember; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -public class CSearchScope implements ICSearchScope { - - private ArrayList elements; - /* The paths of the resources in this search scope*/ - private IPath[] paths; - private boolean[] pathWithSubFolders; - private int pathsCount; - - private IPath[] enclosingProjects; - - public CSearchScope() { - super(); - this.initialize(); - } - - protected void initialize() { - this.paths = new IPath[1]; - this.pathWithSubFolders = new boolean[1]; - this.pathsCount = 0; - this.enclosingProjects = new IPath[0]; - } - - private void addEnclosingProject(IPath path) { - int length = this.enclosingProjects.length; - for (int i = 0; i < length; i++) { - if (this.enclosingProjects[i].equals(path)) return; - } - System.arraycopy( - this.enclosingProjects, - 0, - this.enclosingProjects = new IPath[length+1], - 0, - length); - this.enclosingProjects[length] = path; - } - - public void add(ICProject cProject, boolean includesPrereqProjects, HashSet visitedProjects) { - IProject project = cProject.getProject(); - if (!project.isAccessible() || !visitedProjects.add(project)) return; - - this.addEnclosingProject(project.getFullPath()); - ICElement[] projChildren = cProject.getChildren(); - for (int i=0; i< projChildren.length; i++){ - this.add(projChildren[i]); - } - - if (includesPrereqProjects){ - IProject[] refProjects=null; - try { - refProjects = project.getReferencedProjects(); - } catch (CoreException e) { - } - for (int i=0; i - * Note that the resource path can be null if the search query doesn't require it (eg. get all class names). - */ -void acceptClassDeclaration(String resourcePath, char[] simpleTypeName, char[][] enclosingTypeNames); -/** - * Accepts the declaration of a constructor in the compilation unit with the given resource path. - * The constructor is declared with a given name and number of arguments. - */ -void acceptConstructorDeclaration(String resourcePath, char[] typeName, int parameterCount); -/** - * Accepts the reference to a constructor in the compilation unit with the given resource path. - * The constructor is referenced using the given name and a number of arguments. - * - * Note that the resource path can be null if the search query doesn't require it. - */ -void acceptConstructorReference(String resourcePath, char[] typeName, int parameterCount); -/** - * Accepts the declaration of a field in the compilation unit with the given resource path. - *

            - * Note that the resource path can be null if the search query doesn't require it (eg. get all class names). - * Likewise, the declaring package name and the declaring type names if the query doesn't require them. - */ -void acceptFieldDeclaration(String resourcePath, char[] fieldName); -/** - * Accepts the reference to a field in the compilation unit with the given resource path. - * The field is referenced using the given name - */ -void acceptFieldReference(String resourcePath, char[] fieldName); -/** - * Accepts the declaration of a method in the compilation unit with the given resource path. - * The method is declared with a given method name and number of arguments. - */ -void acceptMethodDeclaration(String resourcePath, char[] methodName, int parameterCount, char[][] enclosingTypeNames); -/** - * Accepts the reference to a method in the compilation unit with the given resource path. - * The method is referenced using the given selector and a number of arguments. - * - * Note that the resource path can be null if the search query doesn't require it. - */ -void acceptMethodReference(String resourcePath, char[] methodName, int parameterCount); -/** - * Accepts the reference to a supertype in the compilation unit with the given resource path. - * Note that the resource path and/or the package name can be null. - */ -void acceptSuperTypeReference(String resourcePath, char[] qualification, char[] typeName, char[] enclosingTypeName, char classOrInterface, char[] superQualification, char[] superTypeName, char superClassOrInterface, int modifiers); -/** - * Accepts the reference to a class in the compilation unit with the given resource path. - * The class is referenced using the given type name. - *

            - * Note that the resource path can be null if the search query doesn't require it. - */ -void acceptTypeReference(String resourcePath, char[] typeName); -/** - * Accepts the declaration of a namespace in the compilation unit with the given resource path. - */ -void acceptNamespaceDeclaration(String resourcePath, char[] typeName, char[][] enclosingTypeNames); -/** - * Accepts the declaration of a function in the compilation unit with the given resource path. - * The function is declared with a given function name and number of arguments. - */ -void acceptFunctionDeclaration(String resourcePath, char[] methodName, int parameterCount); - -void acceptVariableDeclaration(String resourcePath, char[] simpleTypeName); - -void acceptFieldDeclaration(String resourcePath, char[] simpleTypeName, char[][] enclosingTypeNames); - -void acceptMacroDeclaration(String resourcePath, char[] decodedSimpleName); - -void acceptIncludeDeclaration(String resourcePath, char[] decodedSimpleName); - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IndexSelector.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IndexSelector.java deleted file mode 100644 index f7ec5b0f305..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/IndexSelector.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.search; - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; - -/** - * Selects the indexes that correspond to projects in a given search scope - * and that are dependent on a given focus element. - */ -public class IndexSelector { - ICSearchScope searchScope; - ICElement focus; - IndexManager indexManager; - IPath[] indexKeys; // cache of the keys for looking index up - boolean isPolymorphicSearch; - public IndexSelector( - ICSearchScope searchScope, - ICElement focus, - boolean isPolymorphicSearch, - IndexManager indexManager) { - this.searchScope = searchScope; - this.focus = focus; - this.indexManager = indexManager; - this.isPolymorphicSearch = isPolymorphicSearch; - } - /** - * Returns whether elements of the given project can see the given focus (an ICProject) - */ - public static boolean canSeeFocus(ICElement focus, boolean isPolymorphicSearch, IPath projectPath) { - //TODO: BOG Temp - Provide Proper Impl - ICModel model = focus.getCModel(); - ICProject project = getCProject(projectPath, model); - return true; - } - /* - * Compute the list of paths which are keying index files. - */ - private void initializeIndexKeys() { - - ArrayList requiredIndexKeys = new ArrayList(); - IPath[] projects = this.searchScope.enclosingProjects(); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - ICElement projectFocus = this.focus == null ? null : getProject(this.focus); - for (int i = 0; i < projects.length; i++) { - IPath location; - IPath path = projects[i]; - if ((!root.getProject(path.lastSegment()).exists()) // if project does not exist - && path.segmentCount() > 1 - && ((location = root.getFile(path).getLocation()) == null - || !new java.io.File(location.toOSString()).exists()) // and internal jar file does not exist - && !new java.io.File(path.toOSString()).exists()) { // and external jar file does not exist - continue; - } - if (projectFocus == null || canSeeFocus(projectFocus, this.isPolymorphicSearch, path)) { - if (requiredIndexKeys.indexOf(path) == -1) { - requiredIndexKeys.add(path); - } - } - } - this.indexKeys = new IPath[requiredIndexKeys.size()]; - requiredIndexKeys.toArray(this.indexKeys); - } - public IIndex[] getIndexes() { - if (this.indexKeys == null) { - this.initializeIndexKeys(); - } - // acquire the in-memory indexes on the fly - int length = this.indexKeys.length; - IIndex[] indexes = new IIndex[length]; - int count = 0; - for (int i = 0; i < length; i++){ - // may trigger some index recreation work - IIndex index = indexManager.getIndex(indexKeys[i], true /*reuse index file*/, false /*do not create if none*/); - if (index != null) indexes[count++] = index; // only consider indexes which are ready yet - } - if (count != length) { - System.arraycopy(indexes, 0, indexes=new IIndex[count], 0, count); - } - return indexes; - } - /** - * Returns the project that corresponds to the given path. - * Returns null if the path doesn't correspond to a project. - */ - private static ICProject getCProject(IPath path, ICModel model) { - ICProject project = model.getCProject(path.lastSegment()); - if (project.exists()) { - return project; - } else { - return null; - } - } - public static ICElement getProject(ICElement element) { - while (!(element instanceof ICProject)) { - element = element.getParent(); - } - return element; - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PathCollector.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PathCollector.java deleted file mode 100644 index 0ef18a514e1..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PathCollector.java +++ /dev/null @@ -1,168 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core.search; - -import java.util.HashSet; -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - - /** - * Collects the resource paths reported by a client to this search requestor. - */ - public class PathCollector implements IIndexSearchRequestor { - - /* a set of resource paths */ - public HashSet paths = new HashSet(5); - /** - * @see IIndexSearchRequestor - */ - public void acceptClassDeclaration(String resourcePath, char[] simpleTypeName, char[][] enclosingTypeNames) { - this.paths.add( resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptConstructorDeclaration(String resourcePath, char[] typeName, int parameterCount) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptConstructorReference(String resourcePath, char[] typeName, int parameterCount) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptFieldDeclaration(String resourcePath, char[] fieldName) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptFieldReference(String resourcePath, char[] fieldName) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptInterfaceDeclaration(String resourcePath, char[] simpleTypeName, char[][] enclosingTypeNames, char[] packageName) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptFunctionDeclaration(String resourcePath, char[] methodName, int parameterCount) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptMethodDeclaration(String resourcePath, char[] methodName, int parameterCount, char[][] enclosingTypeNames) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptMethodReference(String resourcePath, char[] methodName, int parameterCount) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptPackageReference(String resourcePath, char[] packageName) { - - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptSuperTypeReference(String resourcePath, char[] qualification, char[] typeName, char[] enclosingTypeName, char classOrInterface, char[] superQualification, char[] superTypeName, char superClassOrInterface, int modifiers) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptSuperTypeReference(String resourcePath, char[] qualification, char[] typeName, char classOrInterface, char[] superQualification, char[] superTypeName, char superClassOrInterface, int modifiers) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptTypeReference(String resourcePath, char[] typeName) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptNamespaceDeclaration(String resourcePath, char[] typeName, char[][] enclosingTypeNames) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptVariableDeclaration(String resourcePath, char[] simpleTypeName) { - this.paths.add(resourcePath); - } - /** - * @see IIndexSearchRequestor - */ - public void acceptFieldDeclaration(String resourcePath, char[] simpleTypeName, char[][] enclosingTypeNames) { - this.paths.add(resourcePath); - } - /** - * Returns the files that correspond to the paths that have been collected. - */ - public IFile[] getFiles(IWorkspace workspace) { - IFile[] result = new IFile[this.paths.size()]; - int i = 0; - for (Iterator iter = this.paths.iterator(); iter.hasNext();) { - String resourcePath = (String)iter.next(); - IPath path = new Path(resourcePath); - result[i++] = workspace.getRoot().getFile(path); - } - return result; - } - /** - * Returns the paths that have been collected. - */ - public String[] getPaths() { - String[] result = new String[this.paths.size()]; - int i = 0; - for (Iterator iter = this.paths.iterator(); iter.hasNext();) { - result[i++] = (String)iter.next(); - } - return result; - } - - public void acceptMacroDeclaration(String resourcePath, char[] decodedSimpleName) { - this.paths.add(resourcePath); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.IIndexSearchRequestor#acceptIncludeDeclaration(java.lang.String, char[]) - */ - public void acceptIncludeDeclaration(String resourcePath, char[] decodedSimpleName) { - this.paths.add(resourcePath); - } - - - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java deleted file mode 100644 index 06e2f301262..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java +++ /dev/null @@ -1,168 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Jun 13, 2003 - */ -package org.eclipse.cdt.internal.core.search; - -import java.io.IOException; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.indexing.ReadWriteMonitor; -import org.eclipse.cdt.internal.core.search.matching.CSearchPattern; -import org.eclipse.cdt.internal.core.search.processing.IJob; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; - - -public class PatternSearchJob implements IJob { - - - protected CSearchPattern pattern; - protected ICSearchScope scope; - protected ICElement focus; - protected IIndexSearchRequestor requestor; - protected IndexManager indexManager; - protected int detailLevel; - protected IndexSelector indexSelector; - protected boolean isPolymorphicSearch; - protected long executionTime = 0; - - public PatternSearchJob( - CSearchPattern pattern, - ICSearchScope scope, - IIndexSearchRequestor requestor, - IndexManager indexManager) { - - this( - pattern, - scope, - null, - false, - requestor, - indexManager); - } - public PatternSearchJob( - CSearchPattern pattern, - ICSearchScope scope, - ICElement focus, - boolean isPolymorphicSearch, - IIndexSearchRequestor requestor, - IndexManager indexManager) { - - this.pattern = pattern; - this.scope = scope; - this.focus = focus; - this.isPolymorphicSearch = isPolymorphicSearch; - this.requestor = requestor; - this.indexManager = indexManager; - } - public boolean belongsTo(String jobFamily) { - return true; - } - public void cancel() { - } - public boolean execute(IProgressMonitor progressMonitor) { - - if (progressMonitor != null && progressMonitor.isCanceled()) - throw new OperationCanceledException(); - boolean isComplete = COMPLETE; - executionTime = 0; - if (this.indexSelector == null) { - this.indexSelector = - new IndexSelector(this.scope, this.focus, this.isPolymorphicSearch, this.indexManager); - } - IIndex[] searchIndexes = this.indexSelector.getIndexes(); - try { - int max = searchIndexes.length; - if (progressMonitor != null) { - progressMonitor.beginTask("", max); //$NON-NLS-1$ - } - for (int i = 0; i < max; i++) { - isComplete &= search(searchIndexes[i], progressMonitor); - if (progressMonitor != null) { - if (progressMonitor.isCanceled()) { - throw new OperationCanceledException(); - } else { - progressMonitor.worked(1); - } - } - } - if (JobManager.VERBOSE) { - JobManager.verbose("-> execution time: " + executionTime + "ms - " + this);//$NON-NLS-1$//$NON-NLS-2$ - } - return isComplete; - } finally { - if (progressMonitor != null) { - progressMonitor.done(); - } - } - } - public boolean isReadyToRun() { - if (this.indexSelector == null) { // only check once. As long as this job is used, it will keep the same index picture - this.indexSelector = new IndexSelector(this.scope, this.focus, this.isPolymorphicSearch, this.indexManager); - this.indexSelector.getIndexes(); // will only cache answer if all indexes were available originally - } - return true; - } - public boolean search(IIndex index, IProgressMonitor progressMonitor) { - - if (progressMonitor != null && progressMonitor.isCanceled()) - throw new OperationCanceledException(); - -// IIndex inMemIndex = indexManager.peekAtIndex(new Path(((Index)index).toString.substring("Index for ".length()).replace('\\','/'))); -// if (inMemIndex != index) { -// System.out.println("SANITY CHECK: search job using obsolete index: ["+index+ "] instead of: ["+inMemIndex+"]"); -// } - - if (index == null) - return COMPLETE; - ReadWriteMonitor monitor = indexManager.getMonitorFor(index); - if (monitor == null) - return COMPLETE; // index got deleted since acquired - try { - monitor.enterRead(); // ask permission to read - - /* if index has changed, commit these before querying */ - if (index.hasChanged()) { - try { - monitor.exitRead(); // free read lock - monitor.enterWrite(); // ask permission to write - this.indexManager.saveIndex(index); - } catch (IOException e) { - return FAILED; - } finally { - monitor.exitWriteEnterRead(); // finished writing and reacquire read permission - } - } - long start = System.currentTimeMillis(); - pattern.findIndexMatches( - index, - requestor, - detailLevel, - progressMonitor, - this.scope); - executionTime += System.currentTimeMillis() - start; - return COMPLETE; - } catch (IOException e) { - return FAILED; - } finally { - monitor.exitRead(); // finished reading - } - } - public String toString() { - return "searching " + pattern.toString(); //$NON-NLS-1$ - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java deleted file mode 100644 index 566862dd221..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java +++ /dev/null @@ -1,716 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Jun 13, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; -import java.io.StringReader; -import java.util.Iterator; -import java.util.LinkedList; - -import org.eclipse.cdt.core.parser.EndOfFileException; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.IQuickParseCallback; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; -import org.eclipse.cdt.core.parser.OffsetLimitReachedException; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserUtil; -import org.eclipse.cdt.core.parser.ScannerException; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; -import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.IIndex; -import org.eclipse.cdt.internal.core.index.impl.BlocksIndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; - -/** - * @author aniefer - */ -public abstract class CSearchPattern implements ICSearchConstants, ICSearchPattern, IIndexConstants { - - public static final int IMPOSSIBLE_MATCH = 0; - public static final int POSSIBLE_MATCH = 1; - public static final int ACCURATE_MATCH = 2; - public static final int INACCURATE_MATCH = 3; - - protected static class Requestor extends NullSourceElementRequestor - { - public Requestor( ParserMode mode ) - { - super( mode ); - } - - public boolean acceptProblem( IProblem problem ) - { - if( problem.getID() == IProblem.SCANNER_BAD_CHARACTER ) return false; - return super.acceptProblem( problem ); - } - } - - private static Requestor callback = new Requestor( ParserMode.COMPLETE_PARSE ); - /** - * @param matchMode - * @param caseSensitive - */ - public CSearchPattern(int matchMode, boolean caseSensitive, LimitTo limitTo ) { - _matchMode = matchMode; - _caseSensitive = caseSensitive; - _limitTo = limitTo; - } - - public CSearchPattern() { - super(); - } - - public LimitTo getLimitTo(){ - return _limitTo; - } - - public boolean canAccept(LimitTo limit) { - return ( limit == getLimitTo() ); - } - - public static CSearchPattern createPattern( String patternString, SearchFor searchFor, LimitTo limitTo, int matchMode, boolean caseSensitive ){ - if( patternString == null || patternString.length() == 0 ){ - return null; - } - - CSearchPattern pattern = null; - if( searchFor == TYPE || searchFor == CLASS || searchFor == STRUCT || - searchFor == ENUM || searchFor == UNION || searchFor == CLASS_STRUCT || - searchFor == TYPEDEF ) - { - pattern = createClassPattern( patternString, searchFor, limitTo, matchMode, caseSensitive ); - } else if ( searchFor == METHOD || searchFor == FUNCTION ){ - pattern = createMethodPattern( patternString, searchFor, limitTo, matchMode, caseSensitive ); - } else if ( searchFor == FIELD || searchFor == VAR ){ - pattern = createFieldPattern( patternString, searchFor, limitTo, matchMode, caseSensitive ); - } else if ( searchFor == NAMESPACE ){ - pattern = createNamespacePattern( patternString, limitTo, matchMode, caseSensitive ); - } else if ( searchFor == MACRO ){ - pattern = createMacroPattern( patternString, limitTo, matchMode, caseSensitive ); - } else if ( searchFor == INCLUDE){ - pattern = createIncludePattern( patternString, limitTo, matchMode, caseSensitive); - } - - return pattern; - } - - /** - * @param patternString - * @param limitTo - * @param matchMode - * @param caseSensitive - * @return - */ - private static CSearchPattern createIncludePattern(String patternString, LimitTo limitTo, int matchMode, boolean caseSensitive) { - if( limitTo != REFERENCES ) - return null; - - return new IncludePattern ( patternString.toCharArray(), matchMode, limitTo, caseSensitive ); - } - - /** - * @param patternString - * @param limitTo - * @param matchMode - * @param caseSensitive - * @return - */ - private static CSearchPattern createMacroPattern(String patternString, LimitTo limitTo, int matchMode, boolean caseSensitive) { - if( limitTo != DECLARATIONS && limitTo != ALL_OCCURRENCES ) - return null; - - return new MacroDeclarationPattern( patternString.toCharArray(), matchMode, DECLARATIONS, caseSensitive ); - } - - /** - * @param patternString - * @param limitTo - * @param matchMode - * @param caseSensitive - * @return - */ - private static CSearchPattern createNamespacePattern(String patternString, LimitTo limitTo, int matchMode, boolean caseSensitive) { - if( limitTo == ALL_OCCURRENCES ){ - OrPattern orPattern = new OrPattern(); - orPattern.addPattern( createNamespacePattern( patternString, DECLARATIONS, matchMode, caseSensitive ) ); - orPattern.addPattern( createNamespacePattern( patternString, DEFINITIONS, matchMode, caseSensitive ) ); - orPattern.addPattern( createNamespacePattern( patternString, REFERENCES, matchMode, caseSensitive ) ); - return orPattern; - } - - IScanner scanner = null; - try { - scanner = - ParserFactory.createScanner( - new StringReader(patternString), - "TEXT", - new ScannerInfo(), - ParserMode.QUICK_PARSE, - ParserLanguage.CPP, - callback, - ParserUtil.getParserLogService()); - } catch (ParserFactoryException e) { - - } - LinkedList list = scanForNames( scanner, null ); - - char [] name = (char []) list.removeLast(); - char [][] qualifications = new char [0][]; - - return new NamespaceDeclarationPattern( name, (char[][]) list.toArray( qualifications ), matchMode, limitTo, caseSensitive ); - } - -// /** -// * @param patternString -// * @param limitTo -// * @param matchMode -// * @param caseSensitive -// * @return -// */ -// private static CSearchPattern createFunctionPattern(String patternString, LimitTo limitTo, int matchMode, boolean caseSensitive) { -// if( limitTo == ALL_OCCURRENCES ){ -// OrPattern orPattern = new OrPattern(); -// orPattern.addPattern( createFunctionPattern( patternString, DECLARATIONS, matchMode, caseSensitive ) ); -// orPattern.addPattern( createFunctionPattern( patternString, REFERENCES, matchMode, caseSensitive ) ); -// orPattern.addPattern( createFunctionPattern( patternString, DEFINITIONS, matchMode, caseSensitive ) ); -// return orPattern; -// } -// -// int index = patternString.indexOf( '(' ); -// -// String paramString = ( index == -1 ) ? "" : patternString.substring( index ); -// -// String nameString = ( index == -1 ) ? patternString : patternString.substring( 0, index ); -// -// IScanner scanner = ParserFactory.createScanner( new StringReader( paramString ), "TEXT", new ScannerInfo(), ParserMode.QUICK_PARSE, null ); -// -// LinkedList params = scanForParameters( scanner ); -// -// char [] name = nameString.toCharArray(); -// char [][] parameters = new char [0][]; -// parameters = (char[][])params.toArray( parameters ); -// -// return new MethodDeclarationPattern( name, parameters, matchMode, FUNCTION, limitTo, caseSensitive ); -// } - - /** - * @param patternString - * @param limitTo - * @param matchMode - * @param caseSensitive - * @return - */ - private static CSearchPattern createFieldPattern(String patternString, SearchFor searchFor, LimitTo limitTo, int matchMode, boolean caseSensitive) { - if( limitTo == ALL_OCCURRENCES ){ - OrPattern orPattern = new OrPattern(); - orPattern.addPattern( createFieldPattern( patternString, searchFor, DECLARATIONS, matchMode, caseSensitive ) ); - orPattern.addPattern( createFieldPattern( patternString, searchFor, REFERENCES, matchMode, caseSensitive ) ); - orPattern.addPattern( createFieldPattern( patternString, searchFor, DEFINITIONS, matchMode, caseSensitive ) ); - return orPattern; - } - - IScanner scanner=null; - try { - scanner = - ParserFactory.createScanner( - new StringReader(patternString), - "TEXT", - new ScannerInfo(), - ParserMode.QUICK_PARSE, - ParserLanguage.CPP, - callback,ParserUtil.getParserLogService()); - } catch (ParserFactoryException e) { - - } - LinkedList list = scanForNames( scanner, null ); - - char [] name = (char []) list.removeLast(); - char [][] qualifications = new char[0][]; - - return new FieldDeclarationPattern( name, (char[][]) list.toArray( qualifications ), matchMode, searchFor, limitTo, caseSensitive ); - } - - /** - * @param patternString - * @param limitTo - * @param matchMode - * @param caseSensitive - * @return - */ - private static CSearchPattern createMethodPattern(String patternString, SearchFor searchFor, LimitTo limitTo, int matchMode, boolean caseSensitive) { - - if( limitTo == ALL_OCCURRENCES ){ - OrPattern orPattern = new OrPattern(); - orPattern.addPattern( createMethodPattern( patternString, searchFor, DECLARATIONS, matchMode, caseSensitive ) ); - orPattern.addPattern( createMethodPattern( patternString, searchFor, REFERENCES, matchMode, caseSensitive ) ); - orPattern.addPattern( createMethodPattern( patternString, searchFor, DEFINITIONS, matchMode, caseSensitive ) ); - return orPattern; - } - - int index = patternString.indexOf( '(' ); - String paramString = ( index == -1 ) ? "" : patternString.substring( index ); - String nameString = ( index == -1 ) ? patternString : patternString.substring( 0, index ); - - IScanner scanner=null; - try { - scanner = - ParserFactory.createScanner( - new StringReader(nameString), - "TEXT", - new ScannerInfo(), - ParserMode.QUICK_PARSE, - ParserLanguage.CPP, - callback,ParserUtil.getParserLogService()); - } catch (ParserFactoryException e) { - } - - LinkedList names = scanForNames( scanner, null ); - - LinkedList params = scanForParameters( paramString ); - - char [] name = (char [])names.removeLast(); - char [][] qualifications = new char[0][]; - qualifications = (char[][])names.toArray( qualifications ); - char [][] parameters = new char [0][]; - parameters = (char[][])params.toArray( parameters ); - - return new MethodDeclarationPattern( name, qualifications, parameters, matchMode, searchFor, limitTo, caseSensitive ); - } - - /** - * @param patternString - * @param limitTo - * @param matchMode - * @param caseSensitive - * @return - */ - private static CSearchPattern createClassPattern(String patternString, SearchFor searchFor, LimitTo limitTo, int matchMode, boolean caseSensitive) { - - if( limitTo == ALL_OCCURRENCES ){ - OrPattern orPattern = new OrPattern(); - orPattern.addPattern( createClassPattern( patternString, searchFor, DECLARATIONS, matchMode, caseSensitive ) ); - orPattern.addPattern( createClassPattern( patternString, searchFor, REFERENCES, matchMode, caseSensitive ) ); - return orPattern; - } - - if( searchFor == CLASS_STRUCT ){ - OrPattern orPattern = new OrPattern(); - orPattern.addPattern( createClassPattern( patternString, CLASS, limitTo, matchMode, caseSensitive ) ); - orPattern.addPattern( createClassPattern( patternString, STRUCT, limitTo, matchMode, caseSensitive ) ); - return orPattern; - } -// else if( searchFor == TYPE ){ -// OrPattern orPattern = new OrPattern(); -// orPattern.addPattern( createClassPattern( patternString, CLASS, limitTo, matchMode, caseSensitive ) ); -// orPattern.addPattern( createClassPattern( patternString, STRUCT, limitTo, matchMode, caseSensitive ) ); -// orPattern.addPattern( createClassPattern( patternString, UNION, limitTo, matchMode, caseSensitive ) ); -// orPattern.addPattern( createClassPattern( patternString, ENUM, limitTo, matchMode, caseSensitive ) ); -// orPattern.addPattern( createClassPattern( patternString, TYPEDEF, limitTo, matchMode, caseSensitive ) ); -// return orPattern; -// } - - IScanner scanner =null; - try { - scanner = - ParserFactory.createScanner( - new StringReader(patternString), - "TEXT", - new ScannerInfo(), - ParserMode.QUICK_PARSE, - ParserLanguage.CPP, - callback,ParserUtil.getParserLogService()); - } catch (ParserFactoryException e1) { - } - - IToken token = null; - ASTClassKind kind = null; - - try { - token = scanner.nextToken(); - } catch (EndOfFileException e) { - } catch (ScannerException e) { - } - - if( token != null ){ - boolean nullifyToken = true; - if( token.getType() == IToken.t_class ){ - searchFor = CLASS; - } else if ( token.getType() == IToken.t_struct ){ - searchFor = STRUCT; - } else if ( token.getType() == IToken.t_union ){ - searchFor = UNION; - } else if ( token.getType() == IToken.t_enum ){ - searchFor = ENUM; - } else if ( token.getType() == IToken.t_typedef ){ - searchFor = TYPEDEF; - } else { - nullifyToken = false; - } - if( nullifyToken ) - token = null; - } - - LinkedList list = scanForNames( scanner, token ); - - char[] name = (char [])list.removeLast(); - char [][] qualifications = new char[0][]; - - return new ClassDeclarationPattern( name, (char[][])list.toArray( qualifications ), searchFor, limitTo, matchMode, caseSensitive ); - } - - - - /** - * @param scanner - * @param object - * @return - */ - private static LinkedList scanForParameters( String paramString ) { - LinkedList list = new LinkedList(); - - if( paramString == null || paramString.equals("") ) - return list; - - String functionString = "void f " + paramString + ";"; - - IScanner scanner=null; - try { - scanner = - ParserFactory.createScanner( - new StringReader(functionString), - "TEXT", - new ScannerInfo(), - ParserMode.QUICK_PARSE, - ParserLanguage.CPP, - callback,ParserUtil.getParserLogService()); - } catch (ParserFactoryException e1) { - } - IQuickParseCallback callback = ParserFactory.createQuickParseCallback(); - IParser parser=null; - try { - parser = - ParserFactory.createParser( - scanner, - callback, - ParserMode.QUICK_PARSE, - ParserLanguage.CPP, ParserUtil.getParserLogService()); - } catch (ParserFactoryException e2) { - } - - if( parser.parse() ){ - IASTCompilationUnit compUnit = callback.getCompilationUnit(); - Iterator declarations = null; - try { - declarations = compUnit.getDeclarations(); - } catch (ASTNotImplementedException e) { - } - - if( declarations == null || ! declarations.hasNext() ) - return null; - IASTFunction function = (IASTFunction) declarations.next(); - - Iterator parameters = function.getParameters(); - char [] param = null; - while( parameters.hasNext() ){ - param = getParamString( (IASTParameterDeclaration)parameters.next() ); - list.add( param ); - } - } - - return list; - } - - static public char [] getParamString( IASTParameterDeclaration param ){ - if( param == null ) return null; - - String signature = ""; - - IASTTypeSpecifier typeSpec = param.getTypeSpecifier(); - if( typeSpec instanceof IASTSimpleTypeSpecifier ){ - IASTSimpleTypeSpecifier simple = (IASTSimpleTypeSpecifier)typeSpec; - signature += simple.getTypename(); - } else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){ - IASTElaboratedTypeSpecifier elaborated = (IASTElaboratedTypeSpecifier)typeSpec; - if( elaborated.getClassKind() == ASTClassKind.CLASS ){ - signature += "class "; - } else if( elaborated.getClassKind() == ASTClassKind.ENUM ) { - signature += "enum "; - } else if( elaborated.getClassKind() == ASTClassKind.STRUCT ) { - signature += "struct "; - } else if( elaborated.getClassKind() == ASTClassKind.UNION ) { - signature += "union"; - } - - signature += elaborated.getName(); - } else if( typeSpec instanceof IASTClassSpecifier ){ - IASTClassSpecifier classSpec = (IASTClassSpecifier)typeSpec; - signature += classSpec.getName(); - } else if( typeSpec instanceof IASTEnumerationSpecifier ){ - IASTEnumerationSpecifier enumSpec = (IASTEnumerationSpecifier)typeSpec; - signature += enumSpec.getName(); - } - - signature += " "; - - if( param.isConst() ) signature += "const "; - if( param.isVolatile() ) signature += "volatile "; - - Iterator ptrs = param.getPointerOperators(); - while( ptrs.hasNext() ){ - ASTPointerOperator ptrOp = (ASTPointerOperator) ptrs.next(); - if( ptrOp == ASTPointerOperator.POINTER ){ - signature += " * "; - } else if( ptrOp == ASTPointerOperator.REFERENCE ){ - signature += " & "; - } else if( ptrOp == ASTPointerOperator.CONST_POINTER ){ - signature += " const * "; - } else if( ptrOp == ASTPointerOperator.VOLATILE_POINTER ){ - signature += " volatile * "; - } - } - - Iterator arrayModifiers = param.getArrayModifiers(); - while( arrayModifiers.hasNext() ){ - arrayModifiers.next(); - signature += " [] "; - } - - return signature.toCharArray(); - } - - static private LinkedList scanForNames( IScanner scanner, IToken unusedToken ){ - LinkedList list = new LinkedList(); - - String name = new String(""); - - try { - IToken token = ( unusedToken != null ) ? unusedToken : scanner.nextToken(); - IToken prev = null; - - scanner.setThrowExceptionOnBadCharacterRead( true ); - - boolean encounteredWild = false; - boolean lastTokenWasOperator = false; - - while( true ){ - switch( token.getType() ){ - case IToken.tCOLONCOLON : - list.addLast( name.toCharArray() ); - name = new String(""); - lastTokenWasOperator = false; - break; - - case IToken.t_operator : - name += token.getImage() + " "; - lastTokenWasOperator = true; - break; - - default: - if( token.getType() == IToken.tSTAR || - token.getType() == IToken.tQUESTION - ){ - encounteredWild = true; - } else if( !encounteredWild && !lastTokenWasOperator && name.length() > 0 && - prev.getType() != IToken.tIDENTIFIER && - prev.getType() != IToken.tLT && - prev.getType() != IToken.tCOMPL && - prev.getType() != IToken.tLBRACKET && - token.getType() != IToken.tRBRACKET && - token.getType()!= IToken.tGT - ){ - name += " "; - } else { - encounteredWild = false; - } - - name += token.getImage(); - - lastTokenWasOperator = false; - break; - } - prev = token; - - token = null; - while( token == null ){ - try{ - token = scanner.nextToken(); - } catch ( ScannerException e ){ - if( e.getProblem().getID() == IProblem.SCANNER_BAD_CHARACTER ){ - //TODO : This may not be \\, it could be another bad character - if( !encounteredWild && !lastTokenWasOperator ) name += " "; - name += "\\"; - encounteredWild = true; - lastTokenWasOperator = false; - prev = null; - } - } - } - } - } catch (EndOfFileException e) { - list.addLast( name.toCharArray() ); - } catch (ScannerException e) { - } - - return list; - } - - protected boolean matchesName( char[] pattern, char[] name ){ - if( pattern == null ){ - return true; //treat null as "*" - } - - if( name != null ){ - switch( _matchMode ){ - case EXACT_MATCH: - return CharOperation.equals( pattern, name, _caseSensitive ); - case PREFIX_MATCH: - return CharOperation.prefixEquals( pattern, name, _caseSensitive ); - case PATTERN_MATCH: - if( !_caseSensitive ){ - pattern = CharOperation.toLowerCase( pattern ); - } - - return CharOperation.match( pattern, name, _caseSensitive ); - } - } - return false; - } - - protected boolean matchQualifications( char[][] qualifications, char[][] candidate ){ - - int qualLength = qualifications != null ? qualifications.length : 0; - int candidateLength = candidate != null ? candidate.length : 0; - - if( qualLength == 0 ){ - return true; - } - - int root = ( qualifications[0].length == 0 ) ? 1 : 0; - - if( (root == 1 && candidateLength != qualLength - 1 ) || - (root == 0 && candidateLength < qualLength ) ) - { - return false; - } - - for( int i = 1; i <= qualLength - root; i++ ){ - if( !matchesName( qualifications[ qualLength - i ], candidate[ candidateLength - i ] ) ){ - return false; - } - } - - return true; - } - - /** - * Query a given index for matching entries. - */ - public void findIndexMatches(IIndex index, IIndexSearchRequestor requestor, int detailLevel, IProgressMonitor progressMonitor, ICSearchScope scope) throws IOException { - - if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException(); - - IndexInput input = new BlocksIndexInput(index.getIndexFile()); - try { - input.open(); - findIndexMatches(input, requestor, detailLevel, progressMonitor,scope); - } finally { - input.close(); - } - } - /** - * Query a given index for matching entries. - */ - public void findIndexMatches(IndexInput input, IIndexSearchRequestor requestor, int detailLevel, IProgressMonitor progressMonitor, ICSearchScope scope) throws IOException { - - if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException(); - - /* narrow down a set of entries using prefix criteria */ - char [] prefix = indexEntryPrefix(); - if( prefix == null ) return; - - IEntryResult[] entries = input.queryEntriesPrefixedBy( prefix ); - if (entries == null) return; - - /* only select entries which actually match the entire search pattern */ - for (int i = 0, max = entries.length; i < max; i++){ - - if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException(); - - /* retrieve and decode entry */ - IEntryResult entry = entries[i]; - resetIndexInfo(); - decodeIndexEntry(entry); - if (matchIndexEntry()){ - feedIndexRequestor(requestor, detailLevel, entry.getFileReferences(), input, scope); - } - } - } - - /** - * Feed the requestor according to the current search pattern - */ - public abstract void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException ; - - /** - * Called to reset any variables used in the decoding of index entries, - * this ensures that the matchIndexEntry is not polluted by index info - * from previous entries. - */ - protected abstract void resetIndexInfo(); - - /** - * Decodes the index entry - */ - protected abstract void decodeIndexEntry(IEntryResult entryResult); - /** - * Answers the suitable prefix that should be used in order - * to query indexes for the corresponding item. - * The more accurate the prefix and the less false hits will have - * to be eliminated later on. - */ - public abstract char[] indexEntryPrefix(); - /** - * Checks whether an entry matches the current search pattern - */ - protected abstract boolean matchIndexEntry(); - - protected int _matchMode; - protected boolean _caseSensitive; - protected LimitTo _limitTo; -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java deleted file mode 100644 index 493841508c9..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java +++ /dev/null @@ -1,253 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Jun 13, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer; - - -/** - * @author aniefer - */ - -public class ClassDeclarationPattern extends CSearchPattern { - -// public ClassDeclarationPattern( int matchMode, boolean caseSensitive ){ -// super( matchMode, caseSensitive, DECLARATIONS ); -// } - - public ClassDeclarationPattern( char[] name, char[][] containers, SearchFor searchFor, LimitTo limit, int mode, boolean caseSensitive ){ - super( mode, caseSensitive, limit ); - - simpleName = caseSensitive ? name : CharOperation.toLowerCase( name ); - if( caseSensitive || containers == null ){ - qualifications = containers; - } else { - int len = containers.length; - this.qualifications = new char[ len ][]; - for( int i = 0; i < len; i++ ){ - this.qualifications[i] = CharOperation.toLowerCase( containers[i] ); - } - } - - this.searchFor = searchFor; - - if( searchFor == CLASS ){ - classKind = ASTClassKind.CLASS; - } else if( searchFor == STRUCT ) { - classKind = ASTClassKind.STRUCT; - } else if ( searchFor == ENUM ) { - classKind = ASTClassKind.ENUM; - } else if ( searchFor == UNION ) { - classKind = ASTClassKind.UNION; - } else { - classKind = null; - } - - } - - public int matchLevel( ISourceElementCallbackDelegate node, LimitTo limit ){ - if( searchFor == TYPEDEF ){ - if( !( node instanceof IASTTypedefDeclaration ) ) - return IMPOSSIBLE_MATCH; - } else if( searchFor == ENUM ){ - if( !( node instanceof IASTEnumerationSpecifier ) ) - return IMPOSSIBLE_MATCH; - } else if ( !( node instanceof IASTClassSpecifier ) && - !( node instanceof IASTElaboratedTypeSpecifier ) ) - { - return IMPOSSIBLE_MATCH; - } - - if( ! canAccept( limit ) ) - return IMPOSSIBLE_MATCH; - - String nodeName = null; - if (node instanceof IASTElaboratedTypeSpecifier) - { - nodeName = ((IASTElaboratedTypeSpecifier)node).getName(); - } - else if( node instanceof IASTOffsetableNamedElement ) - { - nodeName = ((IASTOffsetableNamedElement)node).getName(); - } else { - return IMPOSSIBLE_MATCH; - } - - //check name, if simpleName == null, its treated the same as "*" - if( simpleName != null && !matchesName( simpleName, nodeName.toCharArray() ) ){ - return IMPOSSIBLE_MATCH; - } - - if( node instanceof IASTQualifiedNameElement ){ - //create char[][] out of full name, - String [] fullName = ((IASTQualifiedNameElement) node).getFullyQualifiedName(); - char [][] qualName = new char [ fullName.length - 1 ][]; - for( int i = 0; i < fullName.length - 1; i++ ){ - qualName[i] = fullName[i].toCharArray(); - } - //check containing scopes - if( !matchQualifications( qualifications, qualName ) ){ - return IMPOSSIBLE_MATCH; - } - } - - //check type - if( classKind != null ){ - if( node instanceof IASTClassSpecifier ){ - IASTClassSpecifier clsSpec = (IASTClassSpecifier) node; - return ( classKind == clsSpec.getClassKind() ) ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; - } else if (node instanceof IASTEnumerationSpecifier){ - return ( classKind == ASTClassKind.ENUM ) ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; - } else if (node instanceof IASTElaboratedTypeSpecifier ){ - IASTElaboratedTypeSpecifier elabTypeSpec = (IASTElaboratedTypeSpecifier) node; - return ( classKind == elabTypeSpec.getClassKind() ) ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; - } - } - - return ACCURATE_MATCH; - } - - public char [] getName() { - return simpleName; - } - public char[] [] getContainingTypes () { - return qualifications; - } - public ASTClassKind getKind(){ - return classKind; - } - - private char[] simpleName; - private char[][] qualifications; - private ASTClassKind classKind; - private SearchFor searchFor; - - protected char[] decodedSimpleName; - private char[][] decodedContainingTypes; - protected char decodedType; - - - public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException { - boolean isClass = decodedType == CLASS_SUFFIX; - for (int i = 0, max = references.length; i < max; i++) { - IndexedFile file = input.getIndexedFile(references[i]); - String path; - if (file != null && scope.encloses(path =file.getPath())) { - //TODO: BOG Fix this up - even if it's not a class we still care - if (isClass) { - requestor.acceptClassDeclaration(path, decodedSimpleName, decodedContainingTypes); - } else { - requestor.acceptClassDeclaration(path, decodedSimpleName, decodedContainingTypes); - } - } - } - } - - protected void resetIndexInfo(){ - decodedType = 0; - decodedSimpleName = null; - decodedContainingTypes = null; - } - - protected void decodeIndexEntry(IEntryResult entryResult) { - char[] word = entryResult.getWord(); - int size = word.length; - - int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 ); - - this.decodedType = word[ firstSlash + 1 ]; - firstSlash += 2; - - int slash = CharOperation.indexOf( SEPARATOR, word, firstSlash + 1 ); - - this.decodedSimpleName = CharOperation.subarray( word, firstSlash + 1, slash ); - - if( slash != -1 && slash+1 < size ){ - char [][] temp = CharOperation.splitOn('/', CharOperation.subarray( word, slash + 1, size )); - this.decodedContainingTypes = new char [ temp.length ][]; - for( int i = 0; i < temp.length; i++ ){ - this.decodedContainingTypes[ i ] = temp[ temp.length - i - 1 ]; - } - } - } - - public char[] indexEntryPrefix() { - return AbstractIndexer.bestTypePrefix( - searchFor, - getLimitTo(), - simpleName, - qualifications, - _matchMode, - _caseSensitive - ); - } - - protected boolean matchIndexEntry() { - //check type matches - if( classKind == null ){ - if( searchFor == TYPEDEF && decodedType != TYPEDEF_SUFFIX ){ - return false; - } - //don't match variable entries - if( decodedType == VAR_SUFFIX ){ - return false; - } - } else if( classKind == ASTClassKind.CLASS ) { - if( decodedType != CLASS_SUFFIX ){ - return false; - } - } else if ( classKind == ASTClassKind.STRUCT ) { - if( decodedType != STRUCT_SUFFIX ){ - return false; - } - } else if ( classKind == ASTClassKind.UNION ) { - if( decodedType != UNION_SUFFIX ){ - return false; - } - } else if ( classKind == ASTClassKind.ENUM ) { - if( decodedType != ENUM_SUFFIX ) { - return false; - } - } - - /* check simple name matches */ - if (simpleName != null){ - if( ! matchesName( simpleName, decodedSimpleName ) ){ - return false; - } - } - - if( !matchQualifications( qualifications, decodedContainingTypes ) ){ - return false; - } - - return true; - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java deleted file mode 100644 index 493321c4adb..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java +++ /dev/null @@ -1,195 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 11, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class FieldDeclarationPattern extends CSearchPattern { - - /** - * @param name - * @param cs - * @param matchMode - * @param limitTo - * @param caseSensitive - */ - public FieldDeclarationPattern(char[] name, char[][] qual, int matchMode, SearchFor sfor, LimitTo limitTo, boolean caseSensitive) { - super( matchMode, caseSensitive, limitTo ); - qualifications = qual; - searchFor = sfor; - simpleName = name; - } - - - public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit ) { - if( node instanceof IASTField ){ - if( searchFor != FIELD || !canAccept( limit ) ) - return IMPOSSIBLE_MATCH; - } else if ( node instanceof IASTVariable ){ - if( searchFor != VAR || !canAccept( limit ) ) - return IMPOSSIBLE_MATCH; - } else if ( node instanceof IASTEnumerator ){ - if( searchFor != FIELD || !canAccept( limit ) ) - return IMPOSSIBLE_MATCH; - } else if( node instanceof IASTParameterDeclaration ){ - if( searchFor != VAR || !canAccept( limit ) ) - return IMPOSSIBLE_MATCH; - } else return IMPOSSIBLE_MATCH; - - String nodeName = ((IASTOffsetableNamedElement)node).getName(); - - //check name, if simpleName == null, its treated the same as "*" - if( simpleName != null && !matchesName( simpleName, nodeName.toCharArray() ) ){ - return IMPOSSIBLE_MATCH; - } - - //check containing scopes - //create char[][] out of full name, - String [] fullName = null; - - if( node instanceof IASTEnumerator ){ - //Enumerators don't derive from IASTQualifiedElement, so make the fullName - //from the enumerations name. - // 7.2 - 10 : each enumerator declared by an enum-specifier is declared in the - //scope that immediately contains the enum-specifier. - IASTEnumerationSpecifier enumeration = ((IASTEnumerator)node).getOwnerEnumerationSpecifier(); - fullName = enumeration.getFullyQualifiedName(); - - String[] enumeratorFullName = new String[ fullName.length ]; - - System.arraycopy( fullName, 0, enumeratorFullName, 0, fullName.length); - enumeratorFullName[ fullName.length - 1 ] = nodeName; - - fullName = enumeratorFullName; - } else if( node instanceof IASTQualifiedNameElement ){ - fullName = ((IASTQualifiedNameElement) node).getFullyQualifiedName(); - } - - if( fullName != null ){ - char [][] qualName = new char [ fullName.length - 1 ][]; - for( int i = 0; i < fullName.length - 1; i++ ){ - qualName[i] = fullName[i].toCharArray(); - } - //check containing scopes - if( !matchQualifications( qualifications, qualName ) ){ - return IMPOSSIBLE_MATCH; - } - } - - return ACCURATE_MATCH; - } - - public char[] indexEntryPrefix() { - if( searchFor == FIELD ){ - return AbstractIndexer.bestFieldPrefix( _limitTo, simpleName, qualifications, _matchMode, _caseSensitive ); - } else if( searchFor == VAR ) { - return AbstractIndexer.bestVariablePrefix( - _limitTo, - simpleName, qualifications, - _matchMode, _caseSensitive - ); - } - return null; - } - - protected void resetIndexInfo(){ - decodedSimpleName = null; - decodedQualifications = null; - } - - protected void decodeIndexEntry(IEntryResult entryResult) { - char[] word = entryResult.getWord(); - int size = word.length; - int firstSlash = 0; - int slash = 0; - - if( searchFor == FIELD ){ - firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 ); - slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1); - } else if( searchFor == VAR ) { - int realStart = CharOperation.indexOf( SEPARATOR, word, 0 ); - firstSlash = CharOperation.indexOf( SEPARATOR, word, realStart + 1); - slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1); - } - - this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, slash); - - if( slash != -1 && slash+1 < size ){ - char [][] temp = CharOperation.splitOn('/', CharOperation.subarray(word, slash+1, size)); - this.decodedQualifications = new char [ temp.length ][]; - for( int i = 0; i < temp.length; i++ ){ - this.decodedQualifications[ i ] = temp[ temp.length - i - 1 ]; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#feedIndexRequestor(org.eclipse.cdt.internal.core.search.IIndexSearchRequestor, int, int[], org.eclipse.cdt.internal.core.index.impl.IndexInput, org.eclipse.cdt.core.search.ICSearchScope) - */ - public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException { - for (int i = 0, max = references.length; i < max; i++) { - IndexedFile file = input.getIndexedFile(references[i]); - String path; - if (file != null && scope.encloses(path =file.getPath())) { - requestor.acceptFieldDeclaration(path, decodedSimpleName,decodedQualifications); - } - } - } - - protected boolean matchIndexEntry() { - /* check simple name matches */ - if (simpleName != null){ - if( ! matchesName( simpleName, decodedSimpleName ) ){ - return false; - } - } - - if( !matchQualifications( qualifications, decodedQualifications ) ){ - return false; - } - - return true; - } - - private char [][] qualifications; - private char [][] decodedQualifications; - private char [] simpleName; - private char [] decodedSimpleName; - private char decodedType; - - private SearchFor searchFor; -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java deleted file mode 100644 index 76af4bb8d2c..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/IncludePattern.java +++ /dev/null @@ -1,105 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer; - -/** - * @author bgheorgh - */ -public class IncludePattern extends CSearchPattern { - protected char [] simpleName; - protected char [] decodedSimpleName; - /** - * - */ - public IncludePattern(char[] name, int matchMode, LimitTo limitTo, boolean caseSensitive) { - super( matchMode, caseSensitive, limitTo ); - simpleName = name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#decodeIndexEntry(org.eclipse.cdt.internal.core.index.IEntryResult) - */ - protected void decodeIndexEntry(IEntryResult entryResult) { - char[] word = entryResult.getWord(); - int size = word.length; - - int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 ); - - this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, -1); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#feedIndexRequestor(org.eclipse.cdt.internal.core.search.IIndexSearchRequestor, int, int[], org.eclipse.cdt.internal.core.index.impl.IndexInput, org.eclipse.cdt.core.search.ICSearchScope) - */ - public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException { - for (int i = 0, max = references.length; i < max; i++) { - IndexedFile file = input.getIndexedFile(references[i]); - String path; - if (file != null && scope.encloses(path =file.getPath())) { - requestor.acceptIncludeDeclaration(path, decodedSimpleName); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#resetIndexInfo() - */ - protected void resetIndexInfo() { - decodedSimpleName = null; - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#indexEntryPrefix() - */ - public char[] indexEntryPrefix() { - return AbstractIndexer.bestIncludePrefix( - _limitTo, - simpleName, - _matchMode, _caseSensitive - ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#matchIndexEntry() - */ - protected boolean matchIndexEntry() { - /* check simple name matches */ - if (simpleName != null){ - if( ! matchesName( simpleName, decodedSimpleName ) ){ - return false; - } - } - - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.search.ICSearchPattern#matchLevel(org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate, org.eclipse.cdt.core.search.ICSearchConstants.LimitTo) - */ - public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit) { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MacroDeclarationPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MacroDeclarationPattern.java deleted file mode 100644 index 893b5c630ae..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MacroDeclarationPattern.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Aug 8, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MacroDeclarationPattern extends CSearchPattern { - - /** - * @param name - * @param matchMode - * @param limitTo - * @param caseSensitive - */ - public MacroDeclarationPattern(char[] name, int matchMode, LimitTo limitTo, boolean caseSensitive) { - super( matchMode, caseSensitive, limitTo ); - - simpleName = name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.search.ICSearchPattern#matchLevel(org.eclipse.cdt.core.parser.ast.IASTOffsetableElement) - */ - public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit ) { - if( !(node instanceof IASTMacro) || !canAccept( limit ) ){ - return IMPOSSIBLE_MATCH; - } - - String nodeName = ((IASTOffsetableNamedElement)node).getName(); - - //check name, if simpleName == null, its treated the same as "*" - if( simpleName != null && !matchesName( simpleName, nodeName.toCharArray() ) ){ - return IMPOSSIBLE_MATCH; - } - - return ACCURATE_MATCH; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#feedIndexRequestor(org.eclipse.cdt.internal.core.search.IIndexSearchRequestor, int, int[], org.eclipse.cdt.internal.core.index.impl.IndexInput, org.eclipse.cdt.core.search.ICSearchScope) - */ - public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException { - for (int i = 0, max = references.length; i < max; i++) { - IndexedFile file = input.getIndexedFile(references[i]); - String path; - if (file != null && scope.encloses(path =file.getPath())) { - requestor.acceptMacroDeclaration(path, decodedSimpleName); - } - } - } - - protected void resetIndexInfo(){ - decodedSimpleName = null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#decodeIndexEntry(org.eclipse.cdt.internal.core.index.IEntryResult) - */ - protected void decodeIndexEntry(IEntryResult entryResult) { - char[] word = entryResult.getWord(); - int size = word.length; - - int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 ); - - this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, -1); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#indexEntryPrefix() - */ - public char[] indexEntryPrefix() { - return AbstractIndexer.bestMacroPrefix( - _limitTo, - simpleName, - _matchMode, _caseSensitive - ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#matchIndexEntry() - */ - protected boolean matchIndexEntry() { - /* check simple name matches */ - if (simpleName != null){ - if( ! matchesName( simpleName, decodedSimpleName ) ){ - return false; - } - } - - return true; - } - - protected char [] simpleName; - protected char [] decodedSimpleName; -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java deleted file mode 100644 index a39baaef70c..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java +++ /dev/null @@ -1,582 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 13, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.CharArrayReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.parser.DefaultProblemHandler; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserUtil; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; -import org.eclipse.cdt.core.parser.ast.IASTOffsetableNamedElement; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; -import org.eclipse.cdt.core.parser.ast.IASTReference; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MatchLocator implements ISourceElementRequestor, ICSearchConstants { - - - ArrayList matchStorage; - - public static boolean VERBOSE = false; - /** - * - */ - public MatchLocator( ICSearchPattern pattern, ICSearchResultCollector collector, ICSearchScope scope, IProgressMonitor monitor) { - super(); - searchPattern = pattern; - resultCollector = collector; - searchScope = scope; - progressMonitor = monitor; - } - - public boolean acceptProblem(IProblem problem) { return DefaultProblemHandler.ruleOnProblem(problem, ParserMode.COMPLETE_PARSE ); } - public void acceptUsingDirective(IASTUsingDirective usageDirective) { } - public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration) { } - public void acceptASMDefinition(IASTASMDefinition asmDefinition) { } - public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) {} - - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) { } - public void enterTemplateSpecialization(IASTTemplateSpecialization specialization) { } - public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation) { } - - public void exitTemplateDeclaration(IASTTemplateDeclaration declaration) {} - public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) { } - public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation) { } - - public void enterCodeBlock(IASTCodeScope scope) { } - public void exitCodeBlock(IASTCodeScope scope) { } - - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec){ - pushScope( linkageSpec ); - } - - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec){ - popScope(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference) - */ - public void acceptParameterReference(IASTParameterReference reference) - { - check( REFERENCES, reference ); - } - - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef){ - lastDeclaration = typedef; - check( DECLARATIONS, typedef ); - } - - public void acceptTypedefReference( IASTTypedefReference reference ){ - check( REFERENCES, reference ); - } - - public void acceptEnumeratorReference(IASTEnumeratorReference reference){ - check( REFERENCES, reference ); - } - - public void acceptMacro(IASTMacro macro){ - check( DECLARATIONS, macro ); - } - - public void acceptVariable(IASTVariable variable){ - lastDeclaration = variable; - - check( DECLARATIONS, variable ); - - //A declaration is a definition unless...: - //it contains the extern specifier or a linkage-spec and no initializer - if( variable.getInitializerClause() != null || - ( !variable.isExtern() && !(currentScope instanceof IASTLinkageSpecification) ) ){ - check( DEFINITIONS, variable ); - } - } - - public void acceptField(IASTField field){ - lastDeclaration = field; - if( currentScope instanceof IASTClassSpecifier ){ - check( DECLARATIONS, field ); - if( !field.isStatic() ){ - check( DEFINITIONS, field ); - } - } else { - check( DEFINITIONS, field ); - } - } - - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration){ - lastDeclaration = enumeration; - check( DECLARATIONS, enumeration ); - Iterator iter = enumeration.getEnumerators(); - while( iter.hasNext() ){ - IASTEnumerator enumerator = (IASTEnumerator) iter.next(); - lastDeclaration = enumerator; - check ( DECLARATIONS, enumerator ); - check ( DEFINITIONS, enumerator ); - } - } - - public void acceptFunctionDeclaration(IASTFunction function){ - lastDeclaration = function; - check( DECLARATIONS, function ); - } - - public void acceptMethodDeclaration(IASTMethod method){ - lastDeclaration = method; - check( DECLARATIONS, method ); - } - - public void acceptClassReference(IASTClassReference reference) { - check( REFERENCES, reference ); - } - - public void acceptNamespaceReference( IASTNamespaceReference reference ){ - check( REFERENCES, reference ); - } - - public void acceptVariableReference( IASTVariableReference reference ){ - check( REFERENCES, reference ); - } - - public void acceptFieldReference( IASTFieldReference reference ){ - check( REFERENCES, reference ); - } - - public void acceptEnumerationReference( IASTEnumerationReference reference ){ - check( REFERENCES, reference ); - } - - public void acceptFunctionReference( IASTFunctionReference reference ){ - check( REFERENCES, reference ); - } - - public void acceptMethodReference( IASTMethodReference reference ){ - check( REFERENCES, reference ); - } - - public void enterFunctionBody(IASTFunction function){ - lastDeclaration = function; - - if( !function.previouslyDeclared() ) - check( DECLARATIONS, function ); - - check( DEFINITIONS, function ); - pushScope( function ); - } - - public void enterMethodBody(IASTMethod method) { - lastDeclaration = method; - if( !method.previouslyDeclared() ) - check( DECLARATIONS, method ); - - check( DEFINITIONS, method ); - pushScope( method ); - } - - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) { - pushScope( compilationUnit ); - } - - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - lastDeclaration = namespaceDefinition; - check( DECLARATIONS, namespaceDefinition ); - check( DEFINITIONS, namespaceDefinition ); - pushScope( namespaceDefinition ); - } - - public void enterClassSpecifier(IASTClassSpecifier classSpecification) { - lastDeclaration = classSpecification; - check( DECLARATIONS, classSpecification ); - pushScope( classSpecification ); - } - - public void exitFunctionBody(IASTFunction function) { - popScope(); - } - - public void exitMethodBody(IASTMethod method) { - popScope(); - } - - public void exitClassSpecifier(IASTClassSpecifier classSpecification) { - popScope(); - } - - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - popScope(); - } - - public void exitCompilationUnit(IASTCompilationUnit compilationUnit){ - popScope(); - } - - public void enterInclusion(IASTInclusion inclusion) { - String includePath = inclusion.getFullFileName(); - - IPath path = new Path( includePath ); - IResource resource = null; - - if( workspaceRoot != null ){ - resource = workspaceRoot.getFileForLocation( path ); -// if( resource == null ){ -// //TODO:What to do if the file is not in the workspace? -// IFile file = currentResource.getProject().getFile( inclusion.getName() ); -// try{ -// file.createLink( path, 0, null ); -// } catch ( CoreException e ){ -// file = null; -// } -// resource = file; -// } - } - - resourceStack.addFirst( ( currentResource != null ) ? (Object)currentResource : (Object)currentPath ); - - currentResource = resource; - currentPath = ( resource == null ) ? path : null; - } - - public void exitInclusion(IASTInclusion inclusion) { - Object obj = resourceStack.removeFirst(); - if( obj instanceof IResource ){ - currentResource = (IResource)obj; - currentPath = null; - } else { - currentPath = (IPath) obj; - currentResource = null; - } - } - - - public void locateMatches( String [] paths, IWorkspace workspace, IWorkingCopy[] workingCopies,ArrayList matches ){ - matchStorage = matches; - workspaceRoot = (workspace != null) ? workspace.getRoot() : null; - - HashMap wcPaths = new HashMap(); - int wcLength = (workingCopies == null) ? 0 : workingCopies.length; - if( wcLength > 0 ){ - String [] newPaths = new String[ wcLength ]; - - for( int i = 0; i < wcLength; i++ ){ - IWorkingCopy workingCopy = workingCopies[ i ]; - String path = workingCopy.getOriginalElement().getPath().toString(); - wcPaths.put( path, workingCopy ); - newPaths[ i ] = path; - } - - int len = paths.length; - String [] tempArray = new String[ len + wcLength ]; - System.arraycopy( paths, 0, tempArray, 0, len ); - System.arraycopy( newPaths, 0, tempArray, len, wcLength ); - paths = tempArray; - } - - Arrays.sort( paths ); - - int length = paths.length; - if( progressMonitor != null ){ - progressMonitor.beginTask( "", length ); - } - - for( int i = 0; i < length; i++ ){ - if( progressMonitor != null ) { - if( progressMonitor.isCanceled() ){ - throw new OperationCanceledException(); - } else { - progressMonitor.worked( 1 ); - } - } - - String pathString = paths[ i ]; - - //skip duplicates - if( i > 0 && pathString.equals( paths[ i - 1 ] ) ) continue; - - if (!searchScope.encloses(pathString)) continue; - - Reader reader = null; - - IPath realPath = null; - IProject project = null; - - if( workspaceRoot != null ){ - IWorkingCopy workingCopy = (IWorkingCopy)wcPaths.get( pathString ); - - if( workingCopy != null ){ - reader = new CharArrayReader( workingCopy.getContents() ); - currentResource = workingCopy.getResource(); - realPath = currentResource.getLocation(); - project = currentResource.getProject(); - } else { - currentResource = workspaceRoot.findMember( pathString, true ); - - try{ - if( currentResource != null && currentResource instanceof IFile ){ - IFile file = (IFile) currentResource; - reader = new InputStreamReader( file.getContents() ); - realPath = currentResource.getLocation(); - project = file.getProject(); - } - } catch ( CoreException e ){ - continue; - } - } - } - if( currentResource == null ) { - IPath path = new Path( pathString ); - try { - currentPath = path; - reader = new FileReader( path.toFile() ); - realPath = currentPath; - } catch (FileNotFoundException e) { - continue; - } - } - - //Get the scanner info - IScannerInfo scanInfo = new ScannerInfo(); - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project); - if (provider != null){ - IScannerInfo buildScanInfo = provider.getScannerInformation(project); - if( buildScanInfo != null ) - scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths()); - } - - ParserLanguage language = null; - if( project != null ){ - language = CoreModel.getDefault().hasCCNature( project ) ? ParserLanguage.CPP : ParserLanguage.C; - } else { - //TODO no project, what language do we use? - language = ParserLanguage.CPP; - } - - IParser parser = null; - try - { - IScanner scanner = ParserFactory.createScanner( reader, realPath.toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, this, ParserUtil.getParserLogService() ); - parser = ParserFactory.createParser( scanner, this, ParserMode.COMPLETE_PARSE, language, ParserUtil.getParserLogService() ); - } - catch( ParserFactoryException pfe ) - { - - } - - if (VERBOSE) - MatchLocator.verbose("*** New Search for path: " + pathString); - - parser.parse(); - } - } - - protected void report( ISourceElementCallbackDelegate node, int accuracyLevel ){ - try { - if( currentResource != null && !searchScope.encloses(currentResource.getFullPath().toOSString() ) ){ - return; - } - - int offset = 0; - int end = 0; - - if( node instanceof IASTReference ){ - IASTReference reference = (IASTReference) node; - offset = reference.getOffset(); - end = offset + reference.getName().length();; - if (VERBOSE) - MatchLocator.verbose("Report Match: " + reference.getName()); - } else if( node instanceof IASTOffsetableNamedElement ){ - IASTOffsetableNamedElement offsetableElement = (IASTOffsetableNamedElement) node; - offset = offsetableElement.getNameOffset() != 0 ? offsetableElement.getNameOffset() - : offsetableElement.getStartingOffset(); - end = offsetableElement.getNameEndOffset(); - if( end == 0 ){ - end = offset + offsetableElement.getName().length();; - } - - if (VERBOSE) - MatchLocator.verbose("Report Match: " + offsetableElement.getName()); - } - - IMatch match = null; - ISourceElementCallbackDelegate object = null; - - if( node instanceof IASTReference ){ - if( currentScope instanceof IASTFunction || currentScope instanceof IASTMethod ){ - object = (ISourceElementCallbackDelegate) currentScope; - } else { - object = lastDeclaration; - } - } else { - if( currentScope instanceof IASTFunction || currentScope instanceof IASTMethod ){ - //local declaration, only report if not being filtered - if( shouldExcludeLocalDeclarations ){ - return; - } - - object = (ISourceElementCallbackDelegate) currentScope; - } else { - object = node; - } - } - - if( currentResource != null ){ - match = resultCollector.createMatch( currentResource, offset, end, object ); - } else if( currentPath != null ){ - match = resultCollector.createMatch( currentPath, offset, end, object ); - } - if( match != null ){ - //Save till later - //resultCollector.acceptMatch( match ); - matchStorage.add(match); - } - - } catch (CoreException e) { - } - } - - private void check( LimitTo limit, ISourceElementCallbackDelegate node ){ - if( !searchPattern.canAccept( limit ) ) - return; - - int level = ICSearchPattern.IMPOSSIBLE_MATCH; - - if( node instanceof IASTReference ){ - level = searchPattern.matchLevel( ((IASTReference)node).getReferencedElement(), limit ); - } else { - level = searchPattern.matchLevel( node, limit ); - } - - if( level != ICSearchPattern.IMPOSSIBLE_MATCH ) - { - report( node, level ); - } - } - - private void pushScope( IASTScope scope ){ - scopeStack.addFirst( currentScope ); - currentScope = scope; - } - - private IASTScope popScope(){ - IASTScope oldScope = currentScope; - currentScope = (scopeStack.size() > 0 ) ? (IASTScope) scopeStack.removeFirst() : null; - return oldScope; - } - - public void setShouldExcludeLocalDeclarations( boolean exclude ){ - shouldExcludeLocalDeclarations = exclude; - } - - private boolean shouldExcludeLocalDeclarations = false; - - private ISourceElementCallbackDelegate lastDeclaration; - - private ICSearchPattern searchPattern; - private ICSearchResultCollector resultCollector; - private IProgressMonitor progressMonitor; - private IPath currentPath = null; - private ICSearchScope searchScope; - private IWorkspaceRoot workspaceRoot; - - private IResource currentResource = null; - private LinkedList resourceStack = new LinkedList(); - - private IASTScope currentScope = null; - private LinkedList scopeStack = new LinkedList(); - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier) - */ - public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType){ - check( DECLARATIONS, elaboratedType ); - } - - public static void verbose(String log) { - System.out.println("(" + Thread.currentThread() + ") " + log); - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java deleted file mode 100644 index 0e0afddd642..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 11, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; -import java.util.Iterator; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class MethodDeclarationPattern extends CSearchPattern { - - private SearchFor searchFor; - - private char[][] parameterNames; - private char[] simpleName; - private char[][] qualifications; - - private char[] decodedSimpleName; - private char[][] decodedQualifications; - - public MethodDeclarationPattern(char[] name, char[][] qual, char [][] params, int matchMode, SearchFor search, LimitTo limitTo, boolean caseSensitive) { - //super( name, params, matchMode, limitTo, caseSensitive ); - super( matchMode, caseSensitive, limitTo ); - - qualifications = qual; - simpleName = name; - parameterNames = params; - - searchFor = search; - } - - public char [] getSimpleName(){ - return simpleName; - } - - public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit ) { - if( node instanceof IASTMethod ){ - if( searchFor != METHOD || !canAccept( limit ) ){ - return IMPOSSIBLE_MATCH; - } - } else if ( node instanceof IASTFunction ){ - if( searchFor != FUNCTION || !canAccept( limit ) ){ - return IMPOSSIBLE_MATCH; - } - } else { - return IMPOSSIBLE_MATCH; - } - - IASTFunction function = (IASTFunction) node; - String nodeName = function.getName(); - - //check name, if simpleName == null, its treated the same as "*" - if( simpleName != null && !matchesName( simpleName, nodeName.toCharArray() ) ){ - return IMPOSSIBLE_MATCH; - } - - if( node instanceof IASTQualifiedNameElement ){ - //create char[][] out of full name, - String [] fullName = ((IASTQualifiedNameElement) node).getFullyQualifiedName(); - char [][] qualName = new char [ fullName.length - 1 ][]; - for( int i = 0; i < fullName.length - 1; i++ ){ - qualName[i] = fullName[i].toCharArray(); - } - - //check containing scopes - if( !matchQualifications( qualifications, qualName ) ){ - return IMPOSSIBLE_MATCH; - } - } - - //parameters - if( parameterNames != null && parameterNames.length > 0 && parameterNames[0].length > 0 ){ - - Iterator params = function.getParameters(); - - for( int i = 0; i < parameterNames.length; i++ ){ - - //if this function doesn't have this many parameters, it is not a match. - //or if this function has a parameter, but parameterNames only has null. - if( !params.hasNext() || parameterNames[ i ] == null ) - return IMPOSSIBLE_MATCH; - - IASTParameterDeclaration parameter = (IASTParameterDeclaration) params.next(); - char[] param = CSearchPattern.getParamString( parameter ); - - //no wildcards in parameters strings - if( !CharOperation.equals( parameterNames[i], param, _caseSensitive ) ) - return IMPOSSIBLE_MATCH; - } - - //if this function still has more parameters, it is not a match - if( params.hasNext() ) - return IMPOSSIBLE_MATCH; - } - - return ACCURATE_MATCH; - } - - public char[] indexEntryPrefix() { - if( searchFor == FUNCTION ) - return AbstractIndexer.bestFunctionPrefix( _limitTo, simpleName, _matchMode, _caseSensitive ); - else if( searchFor == METHOD ) - return AbstractIndexer.bestMethodPrefix( _limitTo, simpleName, qualifications, _matchMode, _caseSensitive ); - else return null; - } - - protected void resetIndexInfo(){ - decodedSimpleName = null; - decodedQualifications = null; - } - - protected void decodeIndexEntry(IEntryResult entryResult) { - char[] word = entryResult.getWord(); - int size = word.length; - - int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 ); - - int slash = CharOperation.indexOf( SEPARATOR, word, firstSlash + 1 ); - - this.decodedSimpleName = CharOperation.subarray(word, firstSlash + 1, slash); - - if( slash != -1 && slash+1 < size ){ - char [][] temp = CharOperation.splitOn('/', CharOperation.subarray(word, slash + 1, size)); - this.decodedQualifications = new char [ temp.length ][]; - for( int i = 0; i < temp.length; i++ ){ - this.decodedQualifications[ i ] = temp[ temp.length - i - 1 ]; - } - } - } - - protected boolean matchIndexEntry() { - /* check simple name matches */ - if (simpleName != null){ - if( ! matchesName( simpleName, decodedSimpleName ) ){ - return false; - } - } - - if( !matchQualifications( qualifications, decodedQualifications ) ){ - return false; - } - - return true; - } - - public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException { - for (int i = 0, max = references.length; i < max; i++) { - IndexedFile file = input.getIndexedFile(references[i]); - String path; - if (file != null && scope.encloses(path =file.getPath())) { - if( searchFor == METHOD ) - requestor.acceptMethodDeclaration(path, decodedSimpleName, parameterNames.length, decodedQualifications); - else if ( searchFor == FUNCTION ) - requestor.acceptFunctionDeclaration(path, decodedSimpleName, parameterNames.length); - } - } - } -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java deleted file mode 100644 index 952ff562d6c..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jul 11, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.index.impl.IndexedFile; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.cdt.internal.core.search.indexing.AbstractIndexer; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class NamespaceDeclarationPattern extends CSearchPattern { - - - /** - * @param name - * @param cs - * @param matchMode - * @param limitTo - * @param caseSensitive - */ - public NamespaceDeclarationPattern(char[] name, char[][] quals, int matchMode, LimitTo limitTo, boolean caseSensitive) { - super( matchMode, caseSensitive, limitTo ); - - simpleName = name; - qualifications = quals; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.search.ICSearchPattern#matchLevel(org.eclipse.cdt.core.parser.ast.IASTOffsetableElement) - */ - public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit ) { - if( !( node instanceof IASTNamespaceDefinition ) || !canAccept( limit ) ) - return IMPOSSIBLE_MATCH; - - IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)node; - - if( simpleName != null && !matchesName( simpleName, namespace.getName().toCharArray() ) ){ - return IMPOSSIBLE_MATCH; - } - - //create char[][] out of full name, - String [] fullName = namespace.getFullyQualifiedName(); - char [] [] qualName = new char [ fullName.length - 1 ][]; - for( int i = 0; i < fullName.length - 1; i++ ){ - qualName[i] = fullName[i].toCharArray(); - } - - if( !matchQualifications( qualifications, qualName ) ){ - return IMPOSSIBLE_MATCH; - } - - return ACCURATE_MATCH; - } - - private char[][] decodedContainingTypes; - private char[] decodedSimpleName; - private char[][] qualifications; - private char[] simpleName; - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#feedIndexRequestor(org.eclipse.cdt.internal.core.search.IIndexSearchRequestor, int, int[], org.eclipse.cdt.internal.core.index.impl.IndexInput, org.eclipse.cdt.core.search.ICSearchScope) - */ - public void feedIndexRequestor(IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope) throws IOException { - for (int i = 0, max = references.length; i < max; i++) { - IndexedFile file = input.getIndexedFile(references[i]); - String path; - if (file != null && scope.encloses(path =file.getPath())) { - requestor.acceptNamespaceDeclaration(path, decodedSimpleName, decodedContainingTypes); - } - } - } - - protected void resetIndexInfo(){ - decodedSimpleName = null; - decodedContainingTypes = null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#decodeIndexEntry(org.eclipse.cdt.internal.core.index.IEntryResult) - */ - protected void decodeIndexEntry(IEntryResult entryResult) { - char[] word = entryResult.getWord(); - int size = word.length; - - int firstSlash = CharOperation.indexOf( SEPARATOR, word, 0 ); - - int slash = CharOperation.indexOf(SEPARATOR, word, firstSlash + 1); - - this.decodedSimpleName = CharOperation.subarray(word, firstSlash+1, slash); - - if( slash != -1 && slash+1 < size ){ - char [][] temp = CharOperation.splitOn('/', CharOperation.subarray(word, slash+1, size)); - this.decodedContainingTypes = new char [ temp.length ][]; - for( int i = 0; i < temp.length; i++ ){ - this.decodedContainingTypes[ i ] = temp[ temp.length - i - 1 ]; - } - } - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#indexEntryPrefix() - */ - public char[] indexEntryPrefix() { - return AbstractIndexer.bestNamespacePrefix( - _limitTo, - simpleName, - qualifications, - _matchMode, _caseSensitive - ); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.search.matching.CSearchPattern#matchIndexEntry() - */ - protected boolean matchIndexEntry() { - /* check simple name matches */ - if( simpleName != null ){ - if( ! matchesName( simpleName, decodedSimpleName ) ){ - return false; - } - } - - if( !matchQualifications( qualifications, decodedContainingTypes ) ){ - return false; - } - - return true; - } - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/OrPattern.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/OrPattern.java deleted file mode 100644 index 5a35d8b60c1..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/OrPattern.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Aug 6, 2003 - */ -package org.eclipse.cdt.internal.core.search.matching; - -import java.io.IOException; -import java.util.Iterator; -import java.util.LinkedList; - -import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.internal.core.index.IEntryResult; -import org.eclipse.cdt.internal.core.index.impl.IndexInput; -import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor; -import org.eclipse.core.runtime.IProgressMonitor; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class OrPattern extends CSearchPattern { - - public OrPattern(){ - super(); - patterns = new LinkedList(); - } - - /** - * @param pattern - */ - public void addPattern( ICSearchPattern pattern) { - if( pattern != null ) - patterns.add( pattern ); - } - - public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit ) { - Iterator iter = patterns.iterator(); - int size = patterns.size(); - - int result = IMPOSSIBLE_MATCH; - - for( int i = 0; i < size; i++ ){ - ICSearchPattern pattern = (ICSearchPattern) iter.next(); - result = pattern.matchLevel( node, limit ); - if( result != IMPOSSIBLE_MATCH ) - break; - } - - return result; - } - - public boolean canAccept(LimitTo limit) { - if( limit == ALL_OCCURRENCES ){ - return true; - } - - Iterator iter = patterns.iterator(); - int size = patterns.size(); - - for( int i = 0; i < size; i++ ){ - ICSearchPattern pattern = (ICSearchPattern) iter.next(); - if( pattern.canAccept( limit ) ) - return true; - } - - return false; - } - - public void findIndexMatches(IndexInput input, IIndexSearchRequestor requestor, int detailLevel, IProgressMonitor progressMonitor, ICSearchScope scope) throws IOException { - Iterator iter = patterns.iterator(); - int size = patterns.size(); - - for( int i = 0; i < size; i++ ){ - CSearchPattern pattern = (CSearchPattern) iter.next(); - pattern.findIndexMatches( input, requestor, detailLevel, progressMonitor, scope ); - } - } - - public void feedIndexRequestor( IIndexSearchRequestor requestor, int detailLevel, int[] references, IndexInput input, ICSearchScope scope ) - throws IOException { - //never called for OrPattern - } - - protected void resetIndexInfo() { - //never called for OrPattern - } - - protected void decodeIndexEntry(IEntryResult entryResult) { - //never called for OrPattern - } - - public char[] indexEntryPrefix() { - //never called for OrPattern - return null; - } - - protected boolean matchIndexEntry() { - //never called for OrPattern - return false; - } - - private LinkedList patterns; - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/IJob.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/IJob.java deleted file mode 100644 index b5169701791..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/IJob.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 30, 2003 - */ -package org.eclipse.cdt.internal.core.search.processing; - -/** - * @author bgheorgh - */ -import org.eclipse.core.runtime.IProgressMonitor; - -public interface IJob { - - /* Waiting policies */ - int ForceImmediate = 1; - int CancelIfNotReady = 2; - int WaitUntilReady = 3; - - /* Job's result */ - boolean FAILED = false; - boolean COMPLETE = true; - - /** - * True if job belongs to the passed in jobFamily - */ - public boolean belongsTo(String jobFamily); - /** - * Asks this job to cancel its execution. The cancellation - * can take an undertermined amount of time. - */ - public void cancel(); - /** - * Execute the current job, answer whether it was successful. - */ - public boolean execute(IProgressMonitor progress); - /** - * Answer whether the job is ready to run. - */ - public boolean isReadyToRun(); - -} diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/JobManager.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/JobManager.java deleted file mode 100644 index 11f49cb90a1..00000000000 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/processing/JobManager.java +++ /dev/null @@ -1,451 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on May 30, 2003 - */ -package org.eclipse.cdt.internal.core.search.processing; - -import org.eclipse.cdt.core.ICLogConstants; -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.SubProgressMonitor; - -public abstract class JobManager implements Runnable { - - /* queue of jobs to execute */ - protected IJob[] awaitingJobs = new IJob[10]; - protected int jobStart = 0; - protected int jobEnd = -1; - protected boolean executing = false; - - /* background processing */ - protected Thread thread; - - /* flag indicating whether job execution is enabled or not */ - private boolean enabled = true; - - public static boolean VERBOSE = false; - /* flag indicating that the activation has completed */ - public boolean activated = false; - - private int awaitingClients = 0; - - public static void verbose(String log) { - System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$//$NON-NLS-2$ - } - - /** - * Invoked exactly once, in background, before starting processing any job - */ - public void activateProcessing() { - this.activated = true; - } - /** - * Answer the amount of awaiting jobs. - */ - public synchronized int awaitingJobsCount() { - - // pretend busy in case concurrent job attempts performing before activated - if (!activated) - return 1; - - return jobEnd - jobStart + 1; - - } - /** - * Answers the first job in the queue, or null if there is no job available - * Until the job has completed, the job manager will keep answering the same job. - */ - public synchronized IJob currentJob() { - - if (!enabled) - return null; - - if (jobStart <= jobEnd) { - return awaitingJobs[jobStart]; - } - return null; - } - - public synchronized void disable() { - enabled = false; - if (VERBOSE) - JobManager.verbose("DISABLING background indexing"); //$NON-NLS-1$ - } - /** - * Remove the index from cache for a given project. - * Passing null as a job family discards them all. - */ - public void discardJobs(String jobFamily) { - - if (VERBOSE) - JobManager.verbose("DISCARD background job family - " + jobFamily); //$NON-NLS-1$ - - boolean wasEnabled = isEnabled(); - try { - IJob currentJob; - // cancel current job if it belongs to the given family - synchronized(this){ - currentJob = this.currentJob(); - disable(); - } - if (currentJob != null - && (jobFamily == null || currentJob.belongsTo(jobFamily))) { - - currentJob.cancel(); - - // wait until current active job has finished - while (thread != null && executing){ - try { - if (VERBOSE) - JobManager.verbose("-> waiting end of current background job - " + currentJob); //$NON-NLS-1$ //$NON-NLS-2$ - Thread.sleep(50); - } catch(InterruptedException e){ - } - } - } - - // flush and compact awaiting jobs - int loc = -1; - synchronized(this) { - for (int i = jobStart; i <= jobEnd; i++) { - currentJob = awaitingJobs[i]; - awaitingJobs[i] = null; - if (!(jobFamily == null - || currentJob.belongsTo(jobFamily))) { // copy down, compacting - awaitingJobs[++loc] = currentJob; - } else { - if (VERBOSE) - JobManager.verbose("-> discarding background job - " + currentJob); //$NON-NLS-1$ - currentJob.cancel(); - } - } - jobStart = 0; - jobEnd = loc; - } - } finally { - if (wasEnabled) - enable(); - } - if (VERBOSE) - JobManager.verbose("DISCARD DONE with background job family - " + jobFamily); //$NON-NLS-1$ - } - - public synchronized void enable() { - enabled = true; - if (VERBOSE) - JobManager.verbose("ENABLING background indexing"); //$NON-NLS-1$ - } - - public synchronized boolean isEnabled() { - return enabled; - } - /** - * Advance to the next available job, once the current one has been completed. - * Note: clients awaiting until the job count is zero are still waiting at this point. - */ - protected synchronized void moveToNextJob() { - - //if (!enabled) return; - - if (jobStart <= jobEnd) { - awaitingJobs[jobStart++] = null; - if (jobStart > jobEnd) { - jobStart = 0; - jobEnd = -1; - } - } - } - /** - * When idle, give chance to do something - */ - protected void notifyIdle(long idlingTime) { - } - /** - * This API is allowing to run one job in concurrence with background processing. - * Indeed since other jobs are performed in background, resource sharing might be - * an issue.Therefore, this functionality allows a given job to be run without - * colliding with background ones. - * Note: multiple thread might attempt to perform concurrent jobs at the same time, - * and should synchronize (it is deliberately left to clients to decide whether - * concurrent jobs might interfere or not. In general, multiple read jobs are ok). - * - * Waiting policy can be: - * IJobConstants.ForceImmediateSearch - * IJobConstants.CancelIfNotReadyToSearch - * IJobConstants.WaitUntilReadyToSearch - * - */ - public boolean performConcurrentJob( - IJob searchJob, - int waitingPolicy, - IProgressMonitor progress, - IJob jobToIgnore) { - - if (VERBOSE) - JobManager.verbose("STARTING concurrent job - " + searchJob); //$NON-NLS-1$ - if (!searchJob.isReadyToRun()) { - if (VERBOSE) - JobManager.verbose("ABORTED concurrent job - " + searchJob); //$NON-NLS-1$ - return IJob.FAILED; - } - - int concurrentJobWork = 100; - if (progress != null) - progress.beginTask("", concurrentJobWork); //$NON-NLS-1$ - boolean status = IJob.FAILED; - if (awaitingJobsCount() > 0) { - switch (waitingPolicy) { - - case IJob.ForceImmediate : - if (VERBOSE) - JobManager.verbose("-> NOT READY - forcing immediate - " + searchJob);//$NON-NLS-1$ - boolean wasEnabled = isEnabled(); - try { - disable(); // pause indexing - status = searchJob.execute(progress == null ? null : new SubProgressMonitor(progress, concurrentJobWork)); - } finally { - if (wasEnabled) - enable(); - } - if (VERBOSE) - JobManager.verbose("FINISHED concurrent job - " + searchJob); //$NON-NLS-1$ - return status; - - case IJob.CancelIfNotReady : - if (VERBOSE) - JobManager.verbose("-> NOT READY - cancelling - " + searchJob); //$NON-NLS-1$ - if (progress != null) progress.setCanceled(true); - if (VERBOSE) - JobManager.verbose("CANCELED concurrent job - " + searchJob); //$NON-NLS-1$ - throw new OperationCanceledException(); - - case IJob.WaitUntilReady : - int awaitingWork; - IJob previousJob = null; - IJob currentJob; - IProgressMonitor subProgress = null; - int totalWork = this.awaitingJobsCount(); - if (progress != null && totalWork > 0) { - subProgress = new SubProgressMonitor(progress, concurrentJobWork / 2); - subProgress.beginTask("", totalWork); //$NON-NLS-1$ - concurrentJobWork = concurrentJobWork / 2; - } - int originalPriority = this.thread.getPriority(); - try { - synchronized(this) { - - // use local variable to avoid potential NPE (see Bug 20435 NPE when searching java method) - Thread t = this.thread; - if (t != null) { - t.setPriority(Thread.currentThread().getPriority()); - } - this.awaitingClients++; - } - while (((awaitingWork = awaitingJobsCount()) > 0) - && (!jobShouldBeIgnored(jobToIgnore))) { - if (subProgress != null && subProgress.isCanceled()) - throw new OperationCanceledException(); - currentJob = currentJob(); - // currentJob can be null when jobs have been added to the queue but job manager is not enabled - if (currentJob != null && currentJob != previousJob) { - if (VERBOSE) - JobManager.verbose("-> NOT READY - waiting until ready - " + searchJob);//$NON-NLS-1$ - if (subProgress != null) { - subProgress.subTask( - Util.bind("manager.filesToIndex", Integer.toString(awaitingWork))); //$NON-NLS-1$ - subProgress.worked(1); - } - previousJob = currentJob; - } - try { - Thread.sleep(50); - } catch (InterruptedException e) { - } - } - } finally { - synchronized(this) { - this.awaitingClients--; - - // use local variable to avoid potential NPE (see Bug 20435 NPE when searching java method) - Thread t = this.thread; - if (t != null) { - t.setPriority(originalPriority); - } - } - } - if (subProgress != null) { - subProgress.done(); - } - } - } - status = searchJob.execute(progress == null ? null : new SubProgressMonitor(progress, concurrentJobWork)); - if (progress != null) { - progress.done(); - } - if (VERBOSE) - JobManager.verbose("FINISHED concurrent job - " + searchJob); //$NON-NLS-1$ - return status; - } - - /** - * @param jobToIgnore - * @return - */ - private boolean jobShouldBeIgnored(IJob jobToIgnore) { - if (jobToIgnore == null) - return false; - - if (currentJob() == jobToIgnore) - return true; - - return false; - } - - public abstract String processName(); - - public synchronized void request(IJob job) { - if (!job.isReadyToRun()) { - if (VERBOSE) - JobManager.verbose("ABORTED request of background job - " + job); //$NON-NLS-1$ - return; - } - - // append the job to the list of ones to process later on - int size = awaitingJobs.length; - if (++jobEnd == size) { // when growing, relocate jobs starting at position 0 - jobEnd -= jobStart; - System.arraycopy( - awaitingJobs, - jobStart, - (awaitingJobs = new IJob[size * 2]), - 0, - jobEnd); - jobStart = 0; - } - awaitingJobs[jobEnd] = job; - if (VERBOSE) - JobManager.verbose("REQUEST background job - " + job); //$NON-NLS-1$ - - } - /** - * Flush current state - */ - public void reset() { - if (VERBOSE) - JobManager.verbose("Reset"); //$NON-NLS-1$ - - if (thread != null) { - discardJobs(null); // discard all jobs - } else { - /* initiate background processing */ - thread = new Thread(this, this.processName()); - thread.setDaemon(true); - // less prioritary by default, priority is raised if clients are actively waiting on it - thread.setPriority(Thread.NORM_PRIORITY-1); - thread.start(); - } - } - /** - * Infinite loop performing resource indexing - */ - public void run() { - - long idlingStart = -1; - activateProcessing(); - try { - while (this.thread != null) { - try { - IJob job; - if ((job = currentJob()) == null) { - if (idlingStart < 0) - idlingStart = System.currentTimeMillis(); - notifyIdle(System.currentTimeMillis() - idlingStart); - Thread.sleep(500); - continue; - } else { - idlingStart = -1; - } - if (VERBOSE) { - JobManager.verbose(awaitingJobsCount() + " awaiting jobs"); //$NON-NLS-1$ - JobManager.verbose("STARTING background job - " + job); //$NON-NLS-1$ - } - try { - executing = true; - /*boolean status = */job.execute(null); - //if (status == FAILED) request(job); - } finally { - executing = false; - if (VERBOSE) { - JobManager.verbose("FINISHED background job - " + job); //$NON-NLS-1$ - } - moveToNextJob(); - if (this.awaitingClients == 0) { - Thread.sleep(50); - } - } - } catch (InterruptedException e) { // background indexing was interrupted - } - } - } catch (RuntimeException e) { - if (this.thread != null) { // if not shutting down - // log exception - org.eclipse.cdt.internal.core.model.Util.log(e, "Background Indexer Crash Recovery", ICLogConstants.PDE); //$NON-NLS-1$ - - // keep job manager alive - this.discardJobs(null); - this.thread = null; - this.reset(); // this will fork a new thread with no waiting jobs, some indexes will be inconsistent - } - throw e; - } catch (Error e) { - if (this.thread != null && !(e instanceof ThreadDeath)) { - // log exception - org.eclipse.cdt.internal.core.model.Util.log(e, "Background Indexer Crash Recovery", ICLogConstants.PDE); //$NON-NLS-1$ - - // keep job manager alive - this.discardJobs(null); - this.thread = null; - this.reset(); // this will fork a new thread with no waiting jobs, some indexes will be inconsistent - } - throw e; - } - } - /** - * Stop background processing, and wait until the current job is completed before returning - */ - public void shutdown() { - - disable(); - discardJobs(null); // will wait until current executing job has completed - Thread thread = this.thread; - this.thread = null; // mark the job manager as shutting down so that the thread will stop by itself - try { - if (thread != null) { // see http://bugs.eclipse.org/bugs/show_bug.cgi?id=31858 - thread.join(); - } - } catch (InterruptedException e) { - } - } - - public String toString() { - StringBuffer buffer = new StringBuffer(10); - buffer.append("Enabled:").append(this.enabled).append('\n'); //$NON-NLS-1$ - int numJobs = jobEnd - jobStart + 1; - buffer.append("Jobs in queue:").append(numJobs).append('\n'); //$NON-NLS-1$ - for (int i = 0; i < numJobs && i < 15; i++) { - buffer.append(i).append(" - job["+i+"]: ").append(awaitingJobs[jobStart+i]).append('\n'); //$NON-NLS-1$ //$NON-NLS-2$ - } - return buffer.toString(); - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java deleted file mode 100644 index 1c386db8d83..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core; - -import org.eclipse.cdt.internal.core.InternalCExtension; -import org.eclipse.core.resources.IProject; - -public abstract class AbstractCExtension extends InternalCExtension implements ICExtension { - - /** - * Returns the project for which this extrension is defined. - * - * @return the project - */ - public final IProject getProject() { - return super.getProject(); - } - - public final ICExtensionReference getExtensionReference() { - return super.getExtensionReference(); - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java deleted file mode 100644 index 8f9cbe4fe5d..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCProjectNature.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -public class CCProjectNature extends CProjectNature { - - public static final String CC_NATURE_ID= CCorePlugin.PLUGIN_ID + ".ccnature"; - - public static void addCCNature(IProject project, IProgressMonitor mon) throws CoreException { - addNature(project, CC_NATURE_ID, mon); - } - - public static void removeCCNature(IProject project, IProgressMonitor mon) throws CoreException { - removeNature(project, CC_NATURE_ID, mon); - } - - /** - * Checks to ensure that a cnature already exists, - * if not throw a CoreException. Does NOT add a default builder - * @see IProjectNature#configure - */ - public void configure() throws CoreException { - if (!getProject().hasNature(CProjectNature.C_NATURE_ID)){ - IStatus status = new Status(IStatus.ERROR, - CCorePlugin.PLUGIN_ID, - CCorePlugin.CDT_PROJECT_NATURE_ID_MISMATCH, - "project must have a cnature", null); // $NON_NLS - throw new CoreException(status); - } - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java deleted file mode 100644 index 2a849770541..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CConventions.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.core; - -import java.util.StringTokenizer; - -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.Util; -import org.eclipse.cdt.internal.core.model.CModelStatus; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ - -public class CConventions { - private final static String scopeResolutionOperator= "::"; - private final static char fgDot= '.'; - private final static char fgColon= ':'; - - /** - * Validate the given CPP class name, either simple or qualified. - * For example, "A::B::C", or "C". - *

            - * - * @param name the name of a class - * @return a status object with code IStatus.OK if - * the given name is valid as a CPP class name, - * a status with code IStatus.WARNING - * indicating why the given name is discouraged, - * otherwise a status object indicating what is wrong with - * the name - */ - public static IStatus validateClassName(String name) { - if (name == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.nullName"), null); //$NON-NLS-1$ - } - String trimmed = name.trim(); - if ((!name.equals(trimmed)) || (name.indexOf(" ") != -1) ){ - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.nameWithBlanks"), null); //$NON-NLS-1$ - } - int index = name.lastIndexOf(scopeResolutionOperator); - char[] scannedID; - if (index == -1) { - // simple name - scannedID = name.toCharArray(); - } else { - // qualified name - String pkg = name.substring(0, index).trim(); - IStatus status = validateScopeName(pkg); - if (!status.isOK()) { - return status; - } - String type = name.substring(index + 1).trim(); - scannedID = type.toCharArray(); - } - - if (scannedID != null) { - IStatus status = ResourcesPlugin.getWorkspace().validateName(new String(scannedID), IResource.FILE); - if (!status.isOK()) { - return status; - } - if (CharOperation.contains('$', scannedID)) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.dollarName"), null); //$NON-NLS-1$ - } - if ((scannedID.length > 0 && Character.isLowerCase(scannedID[0]))) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.lowercaseName"), null); //$NON-NLS-1$ - } - return CModelStatus.VERIFIED_OK; - } else { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.class.invalidName", name), null); //$NON-NLS-1$ - } - } - /** - * Validate the given scope name. - *

            - * @return a status object with code IStatus.OK if - * the given name is valid as a class name, otherwise a status - * object indicating what is wrong with the name - */ - public static IStatus validateScopeName(String name) { - - if (name == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.nullName"), null); //$NON-NLS-1$ - } - int length; - if ((length = name.length()) == 0) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.emptyName"), null); //$NON-NLS-1$ - } - if (name.charAt(0) == fgDot || name.charAt(length-1) == fgDot) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.dotName"), null); //$NON-NLS-1$ - } - if (CharOperation.isWhitespace(name.charAt(0)) || CharOperation.isWhitespace(name.charAt(name.length() - 1))) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.nameWithBlanks"), null); //$NON-NLS-1$ - } -// int dot = 0; -// while (dot != -1 && dot < length-1) { -// if ((dot = name.indexOf(fgDot, dot+1)) != -1 && dot < length-1 && name.charAt(dot+1) == fgDot) { -// return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.package.consecutiveDotsName"), null); //$NON-NLS-1$ -// } -// } - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - StringTokenizer st = new StringTokenizer(name, scopeResolutionOperator); - boolean firstToken = true; - while (st.hasMoreTokens()) { - String typeName = st.nextToken(); - typeName = typeName.trim(); // grammar allows spaces - char[] scannedID = typeName.toCharArray(); - if (scannedID == null) { - return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.illegalIdentifier", typeName), null); //$NON-NLS-1$ - } - IStatus status = workspace.validateName(new String(scannedID), IResource.FOLDER); - if (!status.isOK()) { - return status; - } - if (firstToken && scannedID.length > 0 && Character.isLowerCase(scannedID[0])) { - return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.scope.lowercaseName"), null); //$NON-NLS-1$ - } - firstToken = false; - } - return CModelStatus.VERIFIED_OK; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java deleted file mode 100644 index e338490f1c5..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java +++ /dev/null @@ -1,774 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.CDTLogWriter; -import org.eclipse.cdt.internal.core.CDescriptorManager; -import org.eclipse.cdt.internal.core.model.BufferManager; -import org.eclipse.cdt.internal.core.model.CModelManager; -import org.eclipse.cdt.internal.core.model.DeltaProcessor; -import org.eclipse.cdt.internal.core.model.IBufferFactory; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.core.model.Util; -import org.eclipse.cdt.internal.core.search.indexing.IndexManager; -import org.eclipse.cdt.internal.core.search.indexing.SourceIndexer; -import org.eclipse.cdt.internal.core.search.matching.MatchLocator; -import org.eclipse.cdt.internal.core.search.processing.JobManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; - -public class CCorePlugin extends Plugin { - - public static final int STATUS_CDTPROJECT_EXISTS = 1; - public static final int STATUS_CDTPROJECT_MISMATCH = 2; - public static final int CDT_PROJECT_NATURE_ID_MISMATCH = 3; - - public static final String PLUGIN_ID = "org.eclipse.cdt.core"; - - public static final String BUILDER_MODEL_ID = PLUGIN_ID + ".CBuildModel"; - public static final String BINARY_PARSER_SIMPLE_ID = "BinaryParser"; - public final static String BINARY_PARSER_UNIQ_ID = PLUGIN_ID + "." + BINARY_PARSER_SIMPLE_ID; - public final static String PREF_BINARY_PARSER = "binaryparser"; - public final static String DEFAULT_BINARY_PARSER_SIMPLE_ID = "ELF"; - public final static String DEFAULT_BINARY_PARSER_UNIQ_ID = PLUGIN_ID + "." + DEFAULT_BINARY_PARSER_SIMPLE_ID; - public final static String PREF_USE_STRUCTURAL_PARSE_MODE = "useStructualParseMode"; - - public final static String ERROR_PARSER_SIMPLE_ID = "ErrorParser"; //$NON-NLS-1$ - - // Build Model Interface Discovery - public final static String BUILD_SCANNER_INFO_SIMPLE_ID = "ScannerInfoProvider"; - public final static String BUILD_SCANNER_INFO_UNIQ_ID = PLUGIN_ID + "." + BUILD_SCANNER_INFO_SIMPLE_ID; - - - /** - * Possible configurable option ID. - * @see #getDefaultOptions - */ - public static final String TRANSLATION_TASK_PRIORITIES = PLUGIN_ID + ".translation.taskPriorities"; //$NON-NLS-1$ - /** - * Possible configurable option value for TRANSLATION_TASK_PRIORITIES. - * @see #getDefaultOptions - */ - public static final String TRANSLATION_TASK_PRIORITY_HIGH = "HIGH"; //$NON-NLS-1$ - /** - * Possible configurable option value for TRANSLATION_TASK_PRIORITIES. - * @see #getDefaultOptions - */ - public static final String TRANSLATION_TASK_PRIORITY_LOW = "LOW"; //$NON-NLS-1$ - /** - * Possible configurable option value for TRANSLATION_TASK_PRIORITIES. - * @see #getDefaultOptions - */ - public static final String TRANSLATION_TASK_PRIORITY_NORMAL = "NORMAL"; //$NON-NLS-1$ - /** - * Possible configurable option ID. - * @see #getDefaultOptions - */ - public static final String TRANSLATION_TASK_TAGS = PLUGIN_ID + ".translation.taskTags"; //$NON-NLS-1$ - - /** - * Default task tag - */ - public static final String DEFAULT_TASK_TAG = "TODO"; //$NON-NLS-1$ - /** - * Default task priority - */ - public static final String DEFAULT_TASK_PRIORITY = TRANSLATION_TASK_PRIORITY_NORMAL; - /** - * Possible configurable option ID. - * @see #getDefaultOptions - */ - public static final String CORE_ENCODING = PLUGIN_ID + ".encoding"; //$NON-NLS-1$ - public CDTLogWriter cdtLog = null; - - private static CCorePlugin fgCPlugin; - private static ResourceBundle fgResourceBundle; - - private CDescriptorManager fDescriptorManager; - private CoreModel fCoreModel; - - // -------- static methods -------- - - static { - try { - fgResourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.internal.core.CCorePluginResources"); - } catch (MissingResourceException x) { - fgResourceBundle = null; - } - } - - /** - * Answers the shared working copies currently registered for this buffer factory. - * Working copies can be shared by several clients using the same buffer factory,see - * IWorkingCopy.getSharedWorkingCopy. - * - * @param factory the given buffer factory - * @return the list of shared working copies for a given buffer factory - * @see IWorkingCopy - */ - public static IWorkingCopy[] getSharedWorkingCopies(IBufferFactory factory){ - - // if factory is null, default factory must be used - if (factory == null) factory = BufferManager.getDefaultBufferManager().getDefaultBufferFactory(); - Map sharedWorkingCopies = CModelManager.getDefault().sharedWorkingCopies; - - Map perFactoryWorkingCopies = (Map) sharedWorkingCopies.get(factory); - if (perFactoryWorkingCopies == null) return CModelManager.NoWorkingCopy; - Collection copies = perFactoryWorkingCopies.values(); - IWorkingCopy[] result = new IWorkingCopy[copies.size()]; - copies.toArray(result); - return result; - } - - public static String getResourceString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!"; - } catch (NullPointerException e) { - return "#" + key + "#"; - } - } - - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - public static String getFormattedString(String key, String arg) { - return MessageFormat.format(getResourceString(key), new String[] { arg }); - } - - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(getResourceString(key), args); - } - - public static ResourceBundle getResourceBundle() { - return fgResourceBundle; - } - - public static CCorePlugin getDefault() { - return fgCPlugin; - } - - public static void log(Throwable e) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); - } - - public static void log(IStatus status) { - ((Plugin) getDefault()).getLog().log(status); - } - - // ------ CPlugin - - public CCorePlugin(IPluginDescriptor descriptor) { - super(descriptor); - fgCPlugin = this; - } - - /** - * @see Plugin#shutdown - */ - public void shutdown() throws CoreException { - super.shutdown(); - if (fDescriptorManager != null) { - fDescriptorManager.shutdown(); - } - - if (fCoreModel != null) { - fCoreModel.shutdown(); - } - - if (cdtLog != null) { - cdtLog.shutdown(); - } - } - - /** - * @see Plugin#startup - */ - public void startup() throws CoreException { - super.startup(); - - cdtLog = new CDTLogWriter(CCorePlugin.getDefault().getStateLocation().append(".log").toFile()); - - //Set debug tracing options - CCorePlugin.getDefault().configurePluginDebugOptions(); - - // Fired up the model. - fCoreModel = CoreModel.getDefault(); - fCoreModel.startup(); - - //Fired up the indexer - fCoreModel.startIndexing(); - - fDescriptorManager = new CDescriptorManager(); - fDescriptorManager.startup(); - - // Set the default for using the structual parse mode to build the CModel - getPluginPreferences().setDefault(PREF_USE_STRUCTURAL_PARSE_MODE, false); - - } - - - /** - * TODO: Add all options here - * Returns a table of all known configurable options with their default values. - * These options allow to configure the behaviour of the underlying components. - * The client may safely use the result as a template that they can modify and - * then pass to setOptions. - * - * Helper constants have been defined on CCorePlugin for each of the option ID and - * their possible constant values. - * - * Note: more options might be added in further releases. - *

            -     * RECOGNIZED OPTIONS:
            -     * TRANSLATION / Define the Automatic Task Tags
            -     *    When the tag list is not empty, translation will issue a task marker whenever it encounters
            -     *    one of the corresponding tags inside any comment in C/C++ source code.
            -     *    Generated task messages will include the tag, and range until the next line separator or comment ending.
            -     *    Note that tasks messages are trimmed. If a tag is starting with a letter or digit, then it cannot be leaded by
            -     *    another letter or digit to be recognized ("fooToDo" will not be recognized as a task for tag "ToDo", but "foo#ToDo"
            -     *    will be detected for either tag "ToDo" or "#ToDo"). Respectively, a tag ending with a letter or digit cannot be followed
            -     *    by a letter or digit to be recognized ("ToDofoo" will not be recognized as a task for tag "ToDo", but "ToDo:foo" will
            -     *    be detected either for tag "ToDo" or "ToDo:").
            -     *     - option id:         "org.eclipse.cdt.core.translation.taskTags"
            -     *     - possible values:   { "[,]*" } where  is a String without any wild-card or leading/trailing spaces 
            -     *     - default:           ""
            -     * 
            -     * TRANSLATION / Define the Automatic Task Priorities
            -     *    In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low)
            -     *    of the task markers issued by the translation.
            -     *    If the default is specified, the priority of each task marker is "NORMAL".
            -     *     - option id:         "org.eclipse.cdt.core.transltaion.taskPriorities"
            -     *     - possible values:   { "[,]*" } where  is one of "HIGH", "NORMAL" or "LOW"
            -     *     - default:           ""
            -     * 
            -     * CORE / Specify Default Source Encoding Format
            -     *    Get the encoding format for translated sources. This setting is read-only, it is equivalent
            -     *    to 'ResourcesPlugin.getEncoding()'.
            -     *     - option id:         "org.eclipse.cdt.core.encoding"
            -     *     - possible values:   { any of the supported encoding names}.
            -     *     - default:           
            -     * 
            - * - * @return a mutable map containing the default settings of all known options - * (key type: String; value type: String) - * @see #setOptions - */ - - public static HashMap getDefaultOptions() - { - HashMap defaultOptions = new HashMap(10); - - // see #initializeDefaultPluginPreferences() for changing default settings - Preferences preferences = getDefault().getPluginPreferences(); - HashSet optionNames = CModelManager.OptionNames; - - // get preferences set to their default - String[] defaultPropertyNames = preferences.defaultPropertyNames(); - for (int i = 0; i < defaultPropertyNames.length; i++){ - String propertyName = defaultPropertyNames[i]; - if (optionNames.contains(propertyName)) { - defaultOptions.put(propertyName, preferences.getDefaultString(propertyName)); - } - } - // get preferences not set to their default - String[] propertyNames = preferences.propertyNames(); - for (int i = 0; i < propertyNames.length; i++){ - String propertyName = propertyNames[i]; - if (optionNames.contains(propertyName)) { - defaultOptions.put(propertyName, preferences.getDefaultString(propertyName)); - } - } - // get encoding through resource plugin - defaultOptions.put(CORE_ENCODING, ResourcesPlugin.getEncoding()); - - return defaultOptions; - } - - - /** - * Initializes the default preferences settings for this plug-in. - * TODO: Add all options here - */ - protected void initializeDefaultPluginPreferences() - { - Preferences preferences = getPluginPreferences(); - HashSet optionNames = CModelManager.OptionNames; - - // Compiler settings - preferences.setDefault(TRANSLATION_TASK_TAGS, DEFAULT_TASK_TAG); - optionNames.add(TRANSLATION_TASK_TAGS); - - preferences.setDefault(TRANSLATION_TASK_PRIORITIES, DEFAULT_TASK_PRIORITY); - optionNames.add(TRANSLATION_TASK_PRIORITIES); - } - - /** - * Helper method for returning one option value only. Equivalent to (String)CCorePlugin.getOptions().get(optionName) - * Note that it may answer null if this option does not exist. - *

            - * For a complete description of the configurable options, see getDefaultOptions. - *

            - * - * @param optionName the name of an option - * @return the String value of a given option - * @see CCorePlugin#getDefaultOptions - */ - public static String getOption(String optionName) { - - if (CORE_ENCODING.equals(optionName)){ - return ResourcesPlugin.getEncoding(); - } - if (CModelManager.OptionNames.contains(optionName)){ - Preferences preferences = getDefault().getPluginPreferences(); - return preferences.getString(optionName).trim(); - } - return null; - } - - /** - * Returns the table of the current options. Initially, all options have their default values, - * and this method returns a table that includes all known options. - *

            - * For a complete description of the configurable options, see getDefaultOptions. - *

            - * - * @return table of current settings of all options - * (key type: String; value type: String) - * @see CCorePlugin#getDefaultOptions - */ - public static HashMap getOptions() { - - HashMap options = new HashMap(10); - - // see #initializeDefaultPluginPreferences() for changing default settings - Plugin plugin = getDefault(); - if (plugin != null) { - Preferences preferences = plugin.getPluginPreferences(); - HashSet optionNames = CModelManager.OptionNames; - - // get preferences set to their default - String[] defaultPropertyNames = preferences.defaultPropertyNames(); - for (int i = 0; i < defaultPropertyNames.length; i++){ - String propertyName = defaultPropertyNames[i]; - if (optionNames.contains(propertyName)){ - options.put(propertyName, preferences.getDefaultString(propertyName)); - } - } - // get preferences not set to their default - String[] propertyNames = preferences.propertyNames(); - for (int i = 0; i < propertyNames.length; i++){ - String propertyName = propertyNames[i]; - if (optionNames.contains(propertyName)){ - options.put(propertyName, preferences.getString(propertyName).trim()); - } - } - // get encoding through resource plugin - options.put(CORE_ENCODING, ResourcesPlugin.getEncoding()); - } - return options; - } - - /** - * Sets the current table of options. All and only the options explicitly included in the given table - * are remembered; all previous option settings are forgotten, including ones not explicitly - * mentioned. - *

            - * For a complete description of the configurable options, see getDefaultOptions. - *

            - * - * @param newOptions the new options (key type: String; value type: String), - * or null to reset all options to their default values - * @see CCorePlugin#getDefaultOptions - */ - public static void setOptions(HashMap newOptions) { - - // see #initializeDefaultPluginPreferences() for changing default settings - Preferences preferences = getDefault().getPluginPreferences(); - - if (newOptions == null){ - newOptions = getDefaultOptions(); - } - Iterator keys = newOptions.keySet().iterator(); - while (keys.hasNext()){ - String key = (String)keys.next(); - if (!CModelManager.OptionNames.contains(key)) continue; // unrecognized option - if (key.equals(CORE_ENCODING)) continue; // skipped, contributed by resource prefs - String value = (String)newOptions.get(key); - preferences.setValue(key, value); - } - - // persist options - getDefault().savePluginPreferences(); - } - - - public IConsole getConsole(String id) { - try { - IExtensionPoint extension = getDescriptor().getExtensionPoint("CBuildConsole"); - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - for (int i = 0; i < extensions.length; i++) { - IConfigurationElement[] configElements = extensions[i].getConfigurationElements(); - for (int j = 0; j < configElements.length; j++) { - String builderID = configElements[j].getAttribute("builderID"); - if ((id == null && builderID == null) || (id != null && builderID.equals(id))) { - return (IConsole) configElements[j].createExecutableExtension("class"); - } - } - } - } - } catch (CoreException e) { - } - return new IConsole() { - public void clear() { - } - public void start(IProject project) { - } - public ConsoleOutputStream getOutputStream() { - return new ConsoleOutputStream(); - } - }; - } - - public IConsole getConsole() throws CoreException { - return getConsole(null); - } - - public IBinaryParser getBinaryParser(IProject project) throws CoreException { - IBinaryParser parser = null; - if (project != null) { - try { - ICDescriptor cdesc = (ICDescriptor) getCProjectDescription(project); - ICExtensionReference[] cextensions = cdesc.get(BINARY_PARSER_UNIQ_ID, true); - if (cextensions.length > 0) - parser = (IBinaryParser) cextensions[0].createExtension(); - } catch (CoreException e) { - } - } - if (parser == null) { - parser = getDefaultBinaryParser(); - } - return parser; - } - - public IBinaryParser getDefaultBinaryParser() throws CoreException { - IBinaryParser parser = null; - String id = getPluginPreferences().getDefaultString(PREF_BINARY_PARSER); - if (id == null || id.length() == 0) { - id = DEFAULT_BINARY_PARSER_UNIQ_ID; - } - IExtensionPoint extensionPoint = getDescriptor().getExtensionPoint(BINARY_PARSER_SIMPLE_ID); - IExtension extension = extensionPoint.getExtension(id); - if (extension != null) { - IConfigurationElement element[] = extension.getConfigurationElements(); - for (int i = 0; i < element.length; i++) { - if (element[i].getName().equalsIgnoreCase("cextension")) { - parser = (IBinaryParser) element[i].createExecutableExtension("run"); - break; - } - } - } else { - IStatus s = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "No Binary Format", null); - throw new CoreException(s); - } - return parser; - } - - public CoreModel getCoreModel() { - return fCoreModel; - } - - public ICDescriptor getCProjectDescription(IProject project) throws CoreException { - return fDescriptorManager.getDescriptor(project); - } - - public void mapCProjectOwner(IProject project, String id, boolean override) throws CoreException { - if (!override) { - fDescriptorManager.configure(project, id); - } else { - fDescriptorManager.convert(project, id); - } - } - - /** - * Creates a C project resource given the project handle and description. - * - * @param description the project description to create a project resource for - * @param projectHandle the project handle to create a project resource for - * @param monitor the progress monitor to show visual progress with - * @param projectID required for mapping the project to an owner - * - * @exception CoreException if the operation fails - * @exception OperationCanceledException if the operation is canceled - */ - public IProject createCProject( - IProjectDescription description, - IProject projectHandle, - IProgressMonitor monitor, - String projectID) - throws CoreException, OperationCanceledException { - try { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Creating C Project...", 3); //$NON-NLS-1$ - if (!projectHandle.exists()) { - projectHandle.create(description, new SubProgressMonitor(monitor, 1)); - } - - if (monitor.isCanceled()) { - throw new OperationCanceledException(); - } - - // Open first. - projectHandle.open(new SubProgressMonitor(monitor, 1)); - - // Add C Nature ... does not add duplicates - mapCProjectOwner(projectHandle, projectID, false); - CProjectNature.addCNature(projectHandle, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - return projectHandle; - } - - /** - * Method convertProjectFromCtoCC converts - * a C Project to a C++ Project - * The newProject MUST, not be null, already have a C Nature - * && must NOT already have a C++ Nature - * - * @param projectHandle - * @param monitor - * @throws CoreException - */ - - public void convertProjectFromCtoCC(IProject projectHandle, IProgressMonitor monitor) throws CoreException { - if ((projectHandle != null) - && projectHandle.hasNature(CCProjectNature.C_NATURE_ID) - && !projectHandle.hasNature(CCProjectNature.CC_NATURE_ID)) { - // Add C++ Nature ... does not add duplicates - CCProjectNature.addCCNature(projectHandle, monitor); - } - } - - /** - * Method to convert a project to a C nature - * All checks should have been done externally - * (as in the Conversion Wizards). - * This method blindly does the conversion. - * - * @param project - * @param String targetNature - * @param monitor - * @param projectID - * @exception CoreException - */ - - public void convertProjectToC(IProject projectHandle, IProgressMonitor monitor, String projectID) - throws CoreException { - if ((projectHandle == null) || (monitor == null) || (projectID == null)) { - return; - } - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProjectDescription description = workspace.newProjectDescription(projectHandle.getName()); - description.setLocation(projectHandle.getFullPath()); - createCProject(description, projectHandle, monitor, projectID); - } - - /** - * Method to convert a project to a C++ nature - * - * @param project - * @param String targetNature - * @param monitor - * @param projectID - * @exception CoreException - */ - - public void convertProjectToCC(IProject projectHandle, IProgressMonitor monitor, String projectID) - throws CoreException { - if ((projectHandle == null) || (monitor == null) || (projectID == null)) { - return; - } - createCProject(projectHandle.getDescription(), projectHandle, monitor, projectID); - // now add C++ nature - convertProjectFromCtoCC(projectHandle, monitor); - } - - // Extract the builder from the .cdtproject. - // public ICBuilder[] getBuilders(IProject project) throws CoreException { - // ICExtension extensions[] = fDescriptorManager.createExtensions(BUILDER_MODEL_ID, project); - // ICBuilder builders[] = new ICBuilder[extensions.length]; - // System.arraycopy(extensions, 0, builders, 0, extensions.length); - // return builders; - // } - - public IProcessList getProcessList() { - IExtensionPoint extension = getDescriptor().getExtensionPoint("ProcessList"); - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - IConfigurationElement[] configElements = extensions[0].getConfigurationElements(); - if (configElements.length != 0) { - try { - return (IProcessList) configElements[0].createExecutableExtension("class"); - } catch (CoreException e) { - } - } - } - return null; - } - - /** - * Array of error parsers ids. - * @return - */ - public String[] getAllErrorParsersIDs() { - IExtensionPoint extension = getDescriptor().getExtensionPoint(ERROR_PARSER_SIMPLE_ID); - String[] empty = new String[0]; - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - ArrayList list = new ArrayList(extensions.length); - for (int i = 0; i < extensions.length; i++) { - list.add(extensions[i].getUniqueIdentifier()); - } - return (String[]) list.toArray(empty); - } - return empty; - } - - public IErrorParser[] getErrorParser(String id) { - IErrorParser[] empty = new IErrorParser[0]; - try { - IExtensionPoint extension = getDescriptor().getExtensionPoint(ERROR_PARSER_SIMPLE_ID); - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - List list = new ArrayList(extensions.length); - for (int i = 0; i < extensions.length; i++) { - String parserID = extensions[i].getUniqueIdentifier(); - if ((id == null && parserID == null) || (id != null && parserID.equals(id))) { - IConfigurationElement[] configElements = extensions[i]. getConfigurationElements(); - for (int j = 0; j < configElements.length; j++) { - IErrorParser parser = (IErrorParser)configElements[j].createExecutableExtension("class"); - list.add(parser); - } - } - } - return (IErrorParser[]) list.toArray(empty); - } - } catch (CoreException e) { - } - return empty; - } - - public IScannerInfoProvider getScannerInfoProvider(IProject project) { - IScannerInfoProvider provider = null; - if (project != null) { - try { - ICDescriptor desc = (ICDescriptor) getCProjectDescription(project); - ICExtensionReference[] extensions = desc.get(BUILD_SCANNER_INFO_UNIQ_ID, true); - if (extensions.length > 0) - provider = (IScannerInfoProvider) extensions[0].createExtension(); - } catch (CoreException e) { - } - } - return provider; - } - - private static final String MODEL = CCorePlugin.PLUGIN_ID + "/debug/model" ; //$NON-NLS-1$ - private static final String INDEXER = CCorePlugin.PLUGIN_ID + "/debug/indexer"; - private static final String INDEX_MANAGER = CCorePlugin.PLUGIN_ID + "/debug/indexmanager"; - private static final String SEARCH = CCorePlugin.PLUGIN_ID + "/debug/search" ; //$NON-NLS-1$ - private static final String MATCH_LOCATOR = CCorePlugin.PLUGIN_ID + "/debug/matchlocator" ; //$NON-NLS-1$ - private static final String PARSER = CCorePlugin.PLUGIN_ID + "/debug/parser" ; //$NON-NLS-1$ - private static final String DELTA = CCorePlugin.PLUGIN_ID + "/debug/deltaprocessor" ; - private static final String CONTENTASSIST = CCorePlugin.PLUGIN_ID + "/debug/contentassist" ; //$NON-NLS-1$ - /** - * Configure the plugin with respect to option settings defined in ".options" file - */ - public void configurePluginDebugOptions(){ - - if(CCorePlugin.getDefault().isDebugging()){ - String option = Platform.getDebugOption(PARSER); - if(option != null) Util.VERBOSE_PARSER = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - option = Platform.getDebugOption(MODEL); - if(option != null) Util.VERBOSE_MODEL = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - option = Platform.getDebugOption(CONTENTASSIST); - if(option != null) Util.VERBOSE_CONTENTASSIST = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - boolean indexFlag = false; - option = Platform.getDebugOption(INDEX_MANAGER); - if(option != null) { - indexFlag = option.equalsIgnoreCase("true"); - IndexManager.VERBOSE = indexFlag; - } //$NON-NLS-1$ - - option = Platform.getDebugOption(INDEXER); - if(option != null) SourceIndexer.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - option = Platform.getDebugOption(SEARCH); - if(option != null) SearchEngine.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - option = Platform.getDebugOption(DELTA); - if(option != null) DeltaProcessor.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - option = Platform.getDebugOption(MATCH_LOCATOR); - if(option != null) MatchLocator.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ - - if (indexFlag == true){ - JobManager.VERBOSE = true; - } - } - } - - // Preference to turn on/off the use of structural parse mode to build the CModel - public void setStructuralParseMode(boolean useNewParser) { - getPluginPreferences().setValue(PREF_USE_STRUCTURAL_PARSE_MODE, useNewParser); - savePluginPreferences(); - } - - public boolean useStructuralParseMode() { - return getPluginPreferences().getBoolean(PREF_USE_STRUCTURAL_PARSE_MODE); - } - - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java deleted file mode 100644 index 8d30811b924..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CProjectNature implements IProjectNature { - - public static final String C_NATURE_ID = CCorePlugin.PLUGIN_ID + ".cnature"; - - private IProject fProject; - - public CProjectNature() { - } - - public CProjectNature(IProject project) { - setProject(project); - } - - public static void addCNature(IProject project, IProgressMonitor mon) throws CoreException { - addNature(project, C_NATURE_ID, mon); - } - - public static void removeCNature(IProject project, IProgressMonitor mon) throws CoreException { - removeNature(project, C_NATURE_ID, mon); - } - - /** - * Utility method for adding a nature to a project. - * - * @param proj - * the project to add the nature - * @param natureId - * the id of the nature to assign to the project - * @param monitor - * a progress monitor to indicate the duration of the operation, - * or null if progress reporting is not required. - * - */ - public static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = project.getDescription(); - String[] prevNatures = description.getNatureIds(); - for (int i = 0; i < prevNatures.length; i++) { - if (natureId.equals(prevNatures[i])) - return; - } - String[] newNatures = new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length] = natureId; - description.setNatureIds(newNatures); - project.setDescription(description, monitor); - } - - /** - * Utility method for removing a project nature from a project. - * - * @param proj - * the project to remove the nature from - * @param natureId - * the nature id to remove - * @param monitor - * a progress monitor to indicate the duration of the operation, - * or null if progress reporting is not required. - */ - public static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = project.getDescription(); - String[] prevNatures = description.getNatureIds(); - List newNatures = new ArrayList(Arrays.asList(prevNatures)); - newNatures.remove(natureId); - description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()])); - project.setDescription(description, monitor); - } - - /** - * @see IProjectNature#configure - */ - public void configure() throws CoreException { - } - - /** - * @see IProjectNature#deconfigure - */ - public void deconfigure() throws CoreException { - } - - /** - * @see IProjectNature#getProject - */ - public IProject getProject() { - return fProject; - } - - /** - * @see IProjectNature#setProject - */ - public void setProject(IProject project) { - fProject = project; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java deleted file mode 100644 index a25760c5f1e..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.util.Properties; - -import org.eclipse.cdt.internal.core.ProcessClosure; -import org.eclipse.cdt.utils.spawner.EnvironmentReader; -import org.eclipse.cdt.utils.spawner.ProcessFactory; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; - - -public class CommandLauncher { - - public final static int COMMAND_CANCELED= 1; - public final static int ILLEGAL_COMMAND= -1; - public final static int OK= 0; - - protected Process fProcess; - protected boolean fShowCommand; - protected String[] fCommandArgs; - - protected String fErrorMessage = ""; - - private String lineSeparator; - - /** - * The number of milliseconds to pause - * between polling. - */ - protected static final long DELAY = 50L; - - /** - * Creates a new launcher - * Fills in stderr and stdout output to the given streams. - * Streams can be set to null, if output not required - */ - public CommandLauncher() { - fProcess= null; - fShowCommand= false; - lineSeparator = System.getProperty("line.separator", "\n"); - } - - /** - * Sets if the command should be printed out first before executing - */ - public void showCommand(boolean show) { - fShowCommand= show; - } - - public String getErrorMessage() { - return fErrorMessage; - } - - public void setErrorMessage(String error) { - fErrorMessage = error; - } - - public String[] getCommandArgs() { - return fCommandArgs; - } - - public Properties getEnvironment() { - return EnvironmentReader.getEnvVars(); - } - - /** - * return the constructed Command line. - * - * @return - */ - public String getCommandLine() { - return getCommandLine(getCommandArgs()); - } - - /** - * Constructs a command array that will be passed to the process - */ - protected String[] constructCommandArray(String command, String[] commandArgs) { - String[] args = new String[1 + commandArgs.length]; - args[0] = command; - System.arraycopy(commandArgs, 0, args, 1, commandArgs.length); - return args; - } - - /** - * Execute a command - */ - public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory) { - try { - // add platform specific arguments (shell invocation) - fCommandArgs= constructCommandArray(commandPath.toOSString(), args); - fProcess= ProcessFactory.getFactory().exec(fCommandArgs, env, changeToDirectory.toFile()); - fErrorMessage= ""; - } catch (IOException e) { - setErrorMessage(e.getMessage()); - fProcess= null; - } - return fProcess; - } - - /** - * Reads output form the process to the streams. - */ - public int waitAndRead(OutputStream out, OutputStream err) { - if (fShowCommand) { - printCommandLine(out); - } - - if (fProcess == null) { - return ILLEGAL_COMMAND; - } - - ProcessClosure closure= new ProcessClosure(fProcess, out, err); - closure.runBlocking(); // a blocking call - return OK; - } - - /** - * Reads output form the process to the streams. A progress monitor is polled to - * test if the cancel button has been pressed. - * Destroys the process if the monitor becomes canceled - * override to implement a different way to read the process inputs - */ - public int waitAndRead(OutputStream output, OutputStream err, IProgressMonitor monitor) { - if (fShowCommand) { - printCommandLine(output); - } - - if (fProcess == null) { - return ILLEGAL_COMMAND; - } - - PipedOutputStream errOutPipe = new PipedOutputStream(); - PipedOutputStream outputPipe = new PipedOutputStream(); - PipedInputStream errInPipe, inputPipe; - try { - errInPipe = new PipedInputStream(errOutPipe); - inputPipe = new PipedInputStream(outputPipe); - } catch( IOException e ) { - setErrorMessage("Command canceled"); - return COMMAND_CANCELED; - } - - ProcessClosure closure= new ProcessClosure(fProcess, outputPipe, errOutPipe); - closure.runNonBlocking(); - byte buffer[] = new byte[1024]; - int nbytes; - while (!monitor.isCanceled() && closure.isAlive()) { - nbytes = 0; - try { - if ( errInPipe.available() > 0 ) { - nbytes = errInPipe.read(buffer); - err.write(buffer, 0, nbytes); - err.flush(); - } - if ( inputPipe.available() > 0 ) { - nbytes = inputPipe.read(buffer); - output.write(buffer, 0, nbytes); - output.flush(); - } - } catch( IOException e) { - } - monitor.worked(0); - if (nbytes == 0) { - try { - Thread.sleep(DELAY); - } catch (InterruptedException ie) { - } - } - } - - int state = OK; - - // Operation canceled by the user, terminate abnormally. - if (monitor.isCanceled()) { - closure.terminate(); - state = COMMAND_CANCELED; - setErrorMessage("Command canceled"); - } - - try { - fProcess.waitFor(); - } catch (InterruptedException e) { - //System.err.println("Closure exception " +e); - //e.printStackTrace(); - } - - // Drain the pipes. - try { - while (errInPipe.available() > 0 || inputPipe.available() > 0) { - if ( errInPipe.available() > 0 ) { - nbytes = errInPipe.read(buffer); - err.write(buffer, 0, nbytes); - err.flush(); - } - if ( inputPipe.available() > 0 ) { - nbytes = inputPipe.read(buffer); - output.write(buffer, 0, nbytes); - output.flush(); - } - } - errInPipe.close(); - inputPipe.close(); - } catch (IOException e) { - } - - return state; - } - - protected void printCommandLine(OutputStream os) { - if (os != null) { - String cmd = getCommandLine(getCommandArgs()); - try { - os.write(cmd.getBytes()); - os.flush(); - } catch (IOException e) { - // ignore; - } - } - } - - protected String getCommandLine(String[] commandArgs) { - StringBuffer buf = new StringBuffer(); - if (fCommandArgs != null) { - for (int i= 0; i < commandArgs.length; i++) { - buf.append(commandArgs[i]); - buf.append(' '); - } - buf.append(lineSeparator); - } - return buf.toString(); - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ConsoleOutputStream.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ConsoleOutputStream.java deleted file mode 100644 index 89521202ef0..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ConsoleOutputStream.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.io.OutputStream; - - -/** - * Output stream which storing the console output - */ -public class ConsoleOutputStream extends OutputStream { - - protected StringBuffer fBuffer; - - public ConsoleOutputStream() { - fBuffer= new StringBuffer(); - } - - - public synchronized String readBuffer() { - String buf = fBuffer.toString(); - fBuffer.setLength(0); - return buf; - } - - public void clear() { - fBuffer.setLength (0); - } - - /** - * Implements buffered output at the lowest level - * @see OutputStream#write - */ - public synchronized void write(int c) throws IOException { - fBuffer.append((char) c); - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java deleted file mode 100644 index ad64092633d..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java +++ /dev/null @@ -1,445 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.eclipse.cdt.core.resources.ACBuilder; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -public class ErrorParserManager extends OutputStream { - - private int nOpens; - - private final static String OLD_PREF_ERROR_PARSER = "errorOutputParser"; // $NON-NLS-1$ - public final static String PREF_ERROR_PARSER = CCorePlugin.PLUGIN_ID + ".errorOutputParser"; // $NON-NLS-1$ - - private IProject fProject; - private IMarkerGenerator fMarkerGenerator; - private Map fFilesInProject; - private List fNameConflicts; - - private Map fErrorParsers; - private ArrayList fErrors; - - private Vector fDirectoryStack; - private IPath fBaseDirectory; - - private String previousLine; - private OutputStream outputStream; - private StringBuffer currentLine = new StringBuffer(); - - private StringBuffer scratchBuffer = new StringBuffer(); - - public ErrorParserManager(ACBuilder builder) { - this(builder.getProject(), builder); - } - - public ErrorParserManager(IProject project, IMarkerGenerator markerGenerator) { - this(project, markerGenerator, null); - } - - public ErrorParserManager(IProject project, IMarkerGenerator markerGenerator, String[] parsersIDs) { - fProject = project; - if (parsersIDs == null) { - enableAllParsers(); - } else { - fErrorParsers = new HashMap(parsersIDs.length); - for (int i = 0; i < parsersIDs.length; i++) { - IErrorParser[] parsers = CCorePlugin.getDefault().getErrorParser(parsersIDs[i]); - fErrorParsers.put(parsersIDs[i], parsers); - } - } - fMarkerGenerator = markerGenerator; - initErrorParserManager(); - } - - private void initErrorParserManager() { - fFilesInProject = new HashMap(); - fNameConflicts = new ArrayList(); - fDirectoryStack = new Vector(); - fErrors = new ArrayList(); - - // prepare file lists - fFilesInProject.clear(); - fNameConflicts.clear(); - - List collectedFiles = new ArrayList(); - fBaseDirectory = fProject.getLocation(); - collectFiles(fProject, collectedFiles); - - for (int i = 0; i < collectedFiles.size(); i++) { - IFile curr = (IFile) collectedFiles.get(i); - Object existing = fFilesInProject.put(curr.getName(), curr); - if (existing != null) { - fNameConflicts.add(curr.getName()); - } - } - } - - public IPath getWorkingDirectory() { - if (fDirectoryStack.size() != 0) { - return (IPath) fDirectoryStack.lastElement(); - } - // Fallback to the Project Location - // FIXME: if the build did not start in the Project ? - return fBaseDirectory; - } - - public void pushDirectory(IPath dir) { - if (dir != null) { - IPath pwd = null; - if (fBaseDirectory.isPrefixOf(dir)) { - int segments = fBaseDirectory.matchingFirstSegments(dir); - pwd = dir.removeFirstSegments(segments); - } else { - pwd = dir; - } - fDirectoryStack.addElement(pwd); - } - } - - public IPath popDirectory() { - int i = fDirectoryStack.size(); - if (i != 0) { - IPath dir = (IPath) fDirectoryStack.lastElement(); - fDirectoryStack.removeElementAt(i - 1); - return dir; - } - return new Path(""); - } - - public int getDirectoryLevel() { - return fDirectoryStack.size(); - } - - private void enableAllParsers() { - fErrorParsers = new HashMap(); - String[] parserIDs = CCorePlugin.getDefault().getAllErrorParsersIDs(); - for (int i = 0; i < parserIDs.length; i++) { - IErrorParser[] parsers = CCorePlugin.getDefault().getErrorParser(parserIDs[i]); - fErrorParsers.put(parserIDs[i], parsers); - } - if (fErrorParsers.size() == 0) { - initErrorParsersMap(); - CCorePlugin.getDefault().getPluginPreferences().setValue(OLD_PREF_ERROR_PARSER, ""); // remove old prefs - } - } - - private void initErrorParsersMap() { - String[] parserIDs = CCorePlugin.getDefault().getAllErrorParsersIDs(); - for (int i = 0; i < parserIDs.length; i++) { - IErrorParser[] parsers = CCorePlugin.getDefault().getErrorParser(parserIDs[i]); - fErrorParsers.put(parserIDs[i], parsers); - } - } - - protected void collectFiles(IContainer parent, List result) { - try { - IResource[] resources = parent.members(); - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - if (resource instanceof IFile) { - result.add(resource); - } else if (resource instanceof IContainer) { - collectFiles((IContainer) resource, result); - } - } - } catch (CoreException e) { - CCorePlugin.log(e.getStatus()); - } - } - - /** - * Parses the input and try to generate error or warning markers - */ - private void processLine(String line) { - if (fErrorParsers.size() == 0) - return; - - String[] parserIDs = new String[fErrorParsers.size()]; - Iterator items = fErrorParsers.keySet().iterator(); - for (int i = 0; items.hasNext(); i++) { - parserIDs[i] = (String) items.next(); - } - - int top = parserIDs.length - 1; - int i = top; - do { - IErrorParser[] parsers = (IErrorParser[]) fErrorParsers.get(parserIDs[i]); - for (int j = 0; j < parsers.length; j++) { - IErrorParser curr = parsers[j]; - if (curr.processLine(line, this)) { - if (i != top) { - // move to top - Object used = fErrorParsers.remove(parserIDs[i]); - fErrorParsers.put(parserIDs[i], used); - //savePreferences(); - } - return; - } - } - i--; - } while (i >= 0); - } - - /** - * Called by the error parsers. - */ - public IFile findFileName(String fileName) { - IPath path = new Path(fileName); - return (IFile) fFilesInProject.get(path.lastSegment()); - } - - protected IFile findFileInWorkspace(IPath path) { - IFile file = null; - if (path.isAbsolute()) { - IWorkspaceRoot root = fProject.getWorkspace().getRoot(); - file = root.getFileForLocation(path); - // It may be a link resource so we must check it also. - if (file == null) { - IFile[] files = root.findFilesForLocation(path); - for (int i = 0; i < files.length; i++) { - if (files[i].getProject().equals(fProject)) { - file = files[i]; - break; - } - } - } - - } else { - file = fProject.getFile(path); - } - return file; - } - - /** - * Called by the error parsers. - */ - public boolean isConflictingName(String fileName) { - IPath path = new Path(fileName); - return fNameConflicts.contains(path.lastSegment()); - } - - /** - * Called by the error parsers. - */ - public IFile findFilePath(String filePath) { - IPath path = null; - IPath fp = new Path(filePath); - if (fp.isAbsolute()) { - if (fBaseDirectory.isPrefixOf(fp)) { - int segments = fBaseDirectory.matchingFirstSegments(fp); - path = fp.removeFirstSegments(segments); - } else { - path = fp; - } - } else { - path = (IPath) getWorkingDirectory().append(filePath); - } - - IFile file = null; - // The workspace may throw an IllegalArgumentException - // Catch it and the parser should fallback to scan the entire project. - try { - file = findFileInWorkspace(path); - } catch (Exception e) { - } - - // We have to do another try, on Windows for cases like "TEST.C" vs "test.c" - // We use the java.io.File canonical path. - if (file == null || !file.exists()) { - File f = path.toFile(); - try { - String canon = f.getCanonicalPath(); - path = new Path(canon); - file = findFileInWorkspace(path); - } catch (IOException e1) { - } - } - return (file != null && file.exists()) ? file : null; - } - - protected class Problem { - protected IResource file; - protected int lineNumber; - protected String description; - protected int severity; - protected String variableName; - - public Problem(IResource file, int lineNumber, String desciption, int severity, String variableName) { - this.file = file; - this.lineNumber = lineNumber; - this.description = desciption; - this.severity = severity; - this.variableName = variableName; - } - } - - /** - * Called by the error parsers. - */ - public void generateMarker(IResource file, int lineNumber, String desc, int severity, String varName) { - Problem problem = new Problem(file, lineNumber, desc, severity, varName); - fErrors.add(problem); - } - - /** - * Called by the error parsers. Return the previous line, save in the working buffer. - */ - public String getPreviousLine() { - return new String((previousLine) == null ? "" : previousLine); - } - - /** - * Method setOutputStream. - * @param cos - */ - public void setOutputStream(OutputStream os) { - outputStream = os; - } - - /** - * Method getOutputStream. It has a reference count - * the stream must be close the same number of time this method was call. - * @return OutputStream - */ - public OutputStream getOutputStream() { - nOpens++; - return this; - } - - /** - * @see java.io.OutputStream#close() - */ - public void close() throws IOException { - if (nOpens > 0 && --nOpens == 0) { - checkLine(true); - fDirectoryStack.removeAllElements(); - fBaseDirectory = null; - if (outputStream != null) - outputStream.close(); - } - } - - /** - * @see java.io.OutputStream#flush() - */ - public void flush() throws IOException { - if (outputStream != null) - outputStream.flush(); - } - - /** - * @see java.io.OutputStream#write(int) - */ - public synchronized void write(int b) throws IOException { - currentLine.append((char) b); - checkLine(false); - if (outputStream != null) - outputStream.write(b); - } - - public synchronized void write(byte[] b, int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if (off != 0 || (len < 0) || (len > b.length)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - currentLine.append(new String(b, 0, len)); - checkLine(false); - if (outputStream != null) - outputStream.write(b, off, len); - } - - private void checkLine(boolean flush) { - String buffer = currentLine.toString(); - int i = 0; - while ((i = buffer.indexOf('\n')) != -1) { - String line = buffer.substring(0, i).trim(); // get rid of any trailing \r - processLine(line); - previousLine = line; - buffer = buffer.substring(i + 1); // skip the \n and advance - } - currentLine.setLength(0); - if (flush) { - if (buffer.length() > 0) { - processLine(buffer); - previousLine = buffer; - } - } else { - currentLine.append(buffer); - } - } - - public boolean reportProblems() { - boolean reset = false; - if (nOpens == 0) { - Iterator iter = fErrors.iterator(); - while (iter.hasNext()) { - Problem problem = (Problem) iter.next(); - if (problem.severity == IMarkerGenerator.SEVERITY_ERROR_BUILD) { - reset = true; - } - if (problem.file == null) { - fMarkerGenerator.addMarker( - fProject, - problem.lineNumber, - problem.description, - problem.severity, - problem.variableName); - } else { - fMarkerGenerator.addMarker( - problem.file, - problem.lineNumber, - problem.description, - problem.severity, - problem.variableName); - } - } - fErrors.clear(); - } - return reset; - } - - /** - * - */ - public String getScratchBuffer() { - return scratchBuffer.toString(); - } - - /** - * @param line - */ - public void appendToScratchBuffer(String line) { - scratchBuffer.append(line); - } - - /** - * - */ - public void clearScratchBuffer() { - scratchBuffer.setLength(0); - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IBinaryParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IBinaryParser.java deleted file mode 100644 index 2b500d18e5b..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IBinaryParser.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; - -/** - */ -public interface IBinaryParser { - - /** - * Represents a binary file for example an ELF executable. - */ - interface IBinaryFile extends IAdaptable { - static final int OBJECT = 0x1; - static final int EXECUTABLE = 0x02; - static final int SHARED = 0x04; - static final int ARCHIVE = 0x08; - static final int CORE = 0x10; - - IPath getPath(); - int getType(); - InputStream getContents(); - } - - /** - * Represents an archive. - */ - interface IBinaryArchive extends IBinaryFile { - IBinaryObject[] getObjects(); - } - - /** - * Represents a binary, for example an ELF excutable. - */ - interface IBinaryObject extends IBinaryFile { - - boolean hasDebug(); - - String getCPU(); - - long getText(); - - long getData(); - - long getBSS(); - - boolean isLittleEndian(); - - ISymbol[] getSymbols(); - - ISymbol getSymbol(long addr); - - String getName(); - - } - - /** - * An executable. - */ - interface IBinaryExecutable extends IBinaryObject { - String[] getNeededSharedLibs(); - } - - /** - * A DLL. - */ - interface IBinaryShared extends IBinaryExecutable { - String getSoName(); - } - - interface ISymbol extends Comparable { - static final int FUNCTION = 0x01; - static final int VARIABLE = 0x02; - - String getName(); - long getAddress(); - long getSize(); - int getStartLine(); - int getEndLine(); - IPath getFilename(); - int getType(); - int getLineNumber(long offset); - } - - IBinaryFile getBinary(IPath path) throws IOException; - - boolean isBinary(byte[] array, IPath path); - - String getFormat(); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICDescriptor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICDescriptor.java deleted file mode 100644 index edc1c385758..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICDescriptor.java +++ /dev/null @@ -1,31 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.w3c.dom.Element; - -public interface ICDescriptor { - public ICOwnerInfo getProjectOwner(); - public String getPlatform(); - public IProject getProject(); - - public ICExtensionReference[] get(String extensionPoint); - public ICExtensionReference[] get(String extensionPoint, boolean update) throws CoreException; - public ICExtensionReference create(String extensionPoint, String id) throws CoreException; - - public void remove(ICExtensionReference extension) throws CoreException; - public void remove(String extensionPoint) throws CoreException; - - public Element getProjectData(String id) throws CoreException; - public void saveProjectData() throws CoreException; -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtension.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtension.java deleted file mode 100644 index 26255b1f51d..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtension.java +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core; - -import org.eclipse.core.resources.IProject; - -public interface ICExtension { - public IProject getProject(); - public ICExtensionReference getExtensionReference(); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtensionReference.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtensionReference.java deleted file mode 100644 index 57bf1ede8ab..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICExtensionReference.java +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core; - -import org.eclipse.core.runtime.CoreException; - -public interface ICExtensionReference { - - /** - * Return the extension point of this reference. - * @return String - */ - public String getExtension(); - - /** - * Return the extension ID of this reference. - * @return String - */ - public String getID(); - - /** - * Sets a name/value data pair on this reference in the .cdtproject file - */ - public void setExtensionData(String key, String value); - - /** - * Gets a value of the key from the .cdtproject file set by setExtensionData() - */ - public String getExtensionData(String key); - - /** - * Creates the executable extension for the reference. - */ - public ICExtension createExtension() throws CoreException; -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICLogConstants.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICLogConstants.java deleted file mode 100644 index 2e0ceb7ae9c..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICLogConstants.java +++ /dev/null @@ -1,30 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.core; - -/** - * @author bgheorgh - */ -public interface ICLogConstants { - public class LogConst{ - private LogConst( int value ) - { - this.value = value; - } - private final int value; - } - - - public static final LogConst PDE = new LogConst( 1 ); - public static final LogConst CDT = new LogConst( 2 ); - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwner.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwner.java deleted file mode 100644 index 12a45d55026..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwner.java +++ /dev/null @@ -1,18 +0,0 @@ -/********************************************************************** -* Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core; - -import org.eclipse.core.runtime.CoreException; - -public interface ICOwner { - public void configure(ICDescriptor cproject) throws CoreException; - public void update(ICDescriptor cproject, String extensionID) throws CoreException; -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwnerInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwnerInfo.java deleted file mode 100644 index 95bde3a58f4..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICOwnerInfo.java +++ /dev/null @@ -1,17 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core; - -public interface ICOwnerInfo { - public String getID(); - public String getName(); - public String getPlatform(); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IErrorParser.java deleted file mode 100644 index b88a2cb174f..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IErrorParser.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.cdt.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -public interface IErrorParser { - /** - * Finds error or warnings on the given line - */ - boolean processLine(String line, ErrorParserManager eoParser); - -} - diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IMarkerGenerator.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IMarkerGenerator.java deleted file mode 100644 index 6d9adf25841..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IMarkerGenerator.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.cdt.core; - -import org.eclipse.core.resources.IResource; - -/** - * @author sam.robb - */ -public interface IMarkerGenerator { - int SEVERITY_INFO = 0; - int SEVERITY_WARNING = 1; - int SEVERITY_ERROR_RESOURCE = 2; - int SEVERITY_ERROR_BUILD = 3; - - void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessInfo.java deleted file mode 100644 index d4714770dd9..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessInfo.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.core; - -public interface IProcessInfo { - public int getPid(); - public String getName(); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessList.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessList.java deleted file mode 100644 index e9d1a02d32d..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IProcessList.java +++ /dev/null @@ -1,9 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.core; - -public interface IProcessList { - public IProcessInfo[] getProcessList(); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java deleted file mode 100644 index 161dc941e4a..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.cdt.core.parser; - -import org.eclipse.core.resources.IResource; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -public interface IScannerInfoChangeListener { - - /** - * The listener must implement this method in order to receive the new - * information from the provider. - * - * @param info - */ - public void changeNotification(IResource project, IScannerInfo info); - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoProvider.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoProvider.java deleted file mode 100644 index 54b9e6fa28e..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/IScannerInfoProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.cdt.core.parser; - -import org.eclipse.core.resources.IResource; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ - -public interface IScannerInfoProvider { - - /** - * The receiver will answer the current state of the build information for the - * resource specified in the argument. - * - * @param resource - * @return - */ - public IScannerInfo getScannerInformation(IResource resource); - - /** - * The receiver will register the listener specified in the argument - * to receive change notifications when the information for the - * IResource it is responsible for changes. - * - * @param listener - */ - public void subscribe(IResource resource, IScannerInfoChangeListener listener); - - /** - * The receiver will no longer notify the listener specified in - * the argument when information about the reource it is responsible - * for changes. - * - * @param listener - */ - public void unsubscribe(IResource resource, IScannerInfoChangeListener listener); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java deleted file mode 100644 index b2b00322520..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/ParserUtil.java +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.core.parser; - -import org.eclipse.cdt.internal.core.parser.ParserLogService; - -/** - * @author jcamelon - * - */ -public class ParserUtil -{ - public static IParserLogService getParserLogService() - { - return parserLogService; - } - - private static IParserLogService parserLogService = new ParserLogService(); -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java deleted file mode 100644 index 62add0f683c..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.eclipse.cdt.core.resources; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.cdt.core.model.ICModelMarker; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; - -public abstract class ACBuilder extends IncrementalProjectBuilder implements IMarkerGenerator { - - /** - * Constructor for ACBuilder - */ - public ACBuilder() { - super(); - } - - /* - * callback from Output Parser - */ - public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) { - - try { - IMarker[] cur = file.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ONE); - /* - * Try to find matching markers and don't put in duplicates - */ - if ((cur != null) && (cur.length > 0)) { - for (int i = 0; i < cur.length; i++) { - if ((((Integer) cur[i].getAttribute(IMarker.LOCATION)).intValue() == lineNumber) - && (((Integer) cur[i].getAttribute(IMarker.SEVERITY)).intValue() == severity) - && (((String) cur[i].getAttribute(IMarker.MESSAGE)).equals(errorDesc))) { - return; - } - } - } - - IMarker marker = file.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER); - marker.setAttribute(IMarker.LOCATION, lineNumber); - marker.setAttribute(IMarker.MESSAGE, errorDesc); - marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(severity)); - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); - marker.setAttribute(IMarker.CHAR_START, -1); - marker.setAttribute(IMarker.CHAR_END, -1); - if (errorVar != null) { - marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, errorVar); - } - } - catch (CoreException e) { - CCorePlugin.log(e.getStatus()); - } - - } - - int mapMarkerSeverity(int severity) { - switch (severity) { - case SEVERITY_ERROR_BUILD : - case SEVERITY_ERROR_RESOURCE : - return IMarker.SEVERITY_ERROR; - case SEVERITY_INFO : - return IMarker.SEVERITY_INFO; - case SEVERITY_WARNING : - return IMarker.SEVERITY_WARNING; - } - return IMarker.SEVERITY_ERROR; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java deleted file mode 100644 index 7858b1b309d..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.eclipse.cdt.core.resources; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.InputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; - -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.cdt.core.CCorePlugin; - -/** - * - * @see IStorage - */ -public class FileStorage extends PlatformObject implements IStorage { - IPath path; - InputStream in = null; - - public InputStream getContents() throws CoreException { - if (in == null) { - try { - return new FileInputStream(path.toFile()); - } catch (FileNotFoundException e) { - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, - IStatus.ERROR, e.toString(), e)); - } - } else { - return in; - } - } - - /** - * @see IStorage#getFullPath - */ - public IPath getFullPath() { - return this.path; - } - - /** - * @see IStorage#getName - */ - public String getName() { - return this.path.lastSegment(); - } - - /** - * @see IStorage#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - public FileStorage(IPath path){ - this.path = path; - } - - public FileStorage(InputStream in, IPath path){ - this.path = path; - this.in = in; - } - - /** - * @see IStorage#isReadOnly() - */ - public String toString() { - return path.toOSString(); - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IConsole.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IConsole.java deleted file mode 100644 index 6d13ddb050a..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/IConsole.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.cdt.core.resources; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.ConsoleOutputStream; -import org.eclipse.core.resources.IProject; - - -public interface IConsole { - ConsoleOutputStream getOutputStream(); - void start(IProject project); - void clear(); -} - diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties deleted file mode 100644 index b74630d25ce..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties +++ /dev/null @@ -1,7 +0,0 @@ -################################################ -# -# (c) Copyright QNX Software Systems Ltd. 2002. -# All Rights Reserved. -# -################################################ -CBuilder.build_error= Build Error diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDTLogWriter.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDTLogWriter.java deleted file mode 100644 index bdd26f2cb21..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDTLogWriter.java +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.core; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.UnsupportedEncodingException; -import java.io.Writer; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; - - -public class CDTLogWriter { - protected File logFile = null; - protected Writer log = null; - protected boolean newSession = true; - - protected static final String SESSION = "*** SESSION";//$NON-NLS-1$ - protected static final String ENTRY = "ENTRY";//$NON-NLS-1$ - protected static final String SUBENTRY = "SUBENTRY";//$NON-NLS-1$ - protected static final String MESSAGE = "MESSAGE";//$NON-NLS-1$ - protected static final String STACK = "STACK";//$NON-NLS-1$ - - protected static final String LINE_SEPARATOR; - protected static final String TAB_STRING = "\t";//$NON-NLS-1$ - protected static final long MAXLOG_SIZE = 10000000; - static { - String s = System.getProperty("line.separator");//$NON-NLS-1$ - LINE_SEPARATOR = s == null ? "\n" : s;//$NON-NLS-1$ - } - /** - * - */ - public CDTLogWriter(File log) { - this.logFile = log; - if(log.length() > MAXLOG_SIZE){ - log.delete(); - this.logFile = CCorePlugin.getDefault().getStateLocation().append(".log").toFile(); - } - openLogFile(); - } - - protected void closeLogFile() throws IOException { - try { - if (log != null) { - log.flush(); - log.close(); - } - } finally { - log = null; - } - } - - protected void openLogFile() { - try { - log = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(logFile.getAbsolutePath(), true), "UTF-8"));//$NON-NLS-1$ - if (newSession) { - writeHeader(); - newSession = false; - } - } catch (IOException e) { - // there was a problem opening the log file so log to the console - //log = logForStream(System.err); - } - } - protected void writeHeader() throws IOException { - write(SESSION); - writeSpace(); - String date = getDate(); - write(date); - writeSpace(); - for (int i=SESSION.length()+date.length(); i<78; i++) { - write("-");//$NON-NLS-1$ - } - writeln(); - } - - protected String getDate() { - try { - DateFormat formatter = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss.SS"); //$NON-NLS-1$ - return formatter.format(new Date()); - } catch (Exception e) { - // If there were problems writing out the date, ignore and - // continue since that shouldn't stop us from losing the rest - // of the information - } - return Long.toString(System.currentTimeMillis()); - } - protected Writer logForStream(OutputStream output) { - try { - return new BufferedWriter(new OutputStreamWriter(output, "UTF-8"));//$NON-NLS-1$ - } catch (UnsupportedEncodingException e) { - return new BufferedWriter(new OutputStreamWriter(output)); - } - } - /** - * Writes the given string to the log, followed by the line terminator string. - */ - protected void writeln(String s) throws IOException { - write(s); - writeln(); - } - /** - * Shuts down the log. - */ - public synchronized void shutdown() { - try { - if (logFile != null) { - closeLogFile(); - logFile = null; - } else { - if (log != null) { - Writer old = log; - log = null; - old.flush(); - old.close(); - } - } - } catch (Exception e) { - //we've shutdown the log, so not much else we can do! - e.printStackTrace(); - } - } - - protected void write(Throwable throwable) throws IOException { - if (throwable == null) - return; - write(STACK); - writeSpace(); - boolean isCoreException = throwable instanceof CoreException; - if (isCoreException) - writeln("1");//$NON-NLS-1$ - else - writeln("0");//$NON-NLS-1$ - throwable.printStackTrace(new PrintWriter(log)); - if (isCoreException) { - CoreException e = (CoreException) throwable; - write(e.getStatus(), 0); - } - } - - public synchronized void log(IStatus status){ - try { - this.write(status, 0); - } catch (IOException e) { - } - } - protected void write(IStatus status, int depth) throws IOException { - if (depth == 0) { - write(ENTRY); - } else { - write(SUBENTRY); - writeSpace(); - write(Integer.toString(depth)); - } - writeSpace(); - write(status.getPlugin()); - writeSpace(); - write(Integer.toString(status.getSeverity())); - writeSpace(); - write(Integer.toString(status.getCode())); - writeSpace(); - write(getDate()); - writeln(); - - write(MESSAGE); - writeSpace(); - writeln(status.getMessage()); - - //Took out the stack dump - too much space - //write(status.getException()); - - if (status.isMultiStatus()) { - IStatus[] children = status.getChildren(); - for (int i = 0; i < children.length; i++) { - write(children[i], depth+1); - } - } - } - - protected void writeln() throws IOException { - write(LINE_SEPARATOR); - } - protected void write(String message) throws IOException { - if (message != null) - log.write(message); - } - protected void writeSpace() throws IOException { - write(" ");//$NON-NLS-1$ - } - - public synchronized void flushLog(){ - try { - log.flush(); - } catch (IOException e) {} - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptor.java deleted file mode 100644 index 0663c24de05..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptor.java +++ /dev/null @@ -1,460 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map.Entry; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xerces.dom.DocumentImpl; -import org.apache.xml.serialize.Method; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.Serializer; -import org.apache.xml.serialize.SerializerFactory; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.ICExtension; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.cdt.core.ICOwnerInfo; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginRegistry; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class CDescriptor implements ICDescriptor { - private COwner fOwner; - private IProject fProject; - private HashMap extMap = new HashMap(4); - private HashMap extInfoMap = new HashMap(4); - private Document dataDoc; - - static final String DESCRIPTION_FILE_NAME = ".cdtproject"; - private static final char[][] NO_CHAR_CHAR = new char[0][]; - private static final String PROJECT_DESCRIPTION = "cdtproject"; - private static final String PROJECT_EXTENSION = "extension"; - private static final String PROJECT_EXTENSION_ATTRIBUTE = "attribute"; - private static final String PATH_ENTRY = "cpathentry"; - private static final String PROJECT_DATA = "data"; - private static final String PROJECT_DATA_ITEM = "item"; - private static final String PROJECT_DATA_ID = "id"; - - private boolean fDirty; - private boolean autoSave; - - protected CDescriptor(IProject project, String id) throws CoreException { - fProject = project; - IPath projectLocation = project.getDescription().getLocation(); - - if (projectLocation == null) { - projectLocation = getProjectDefaultLocation(project); - } - IPath descriptionPath = projectLocation.append(DESCRIPTION_FILE_NAME); - - if (descriptionPath.toFile().exists()) { - IStatus status; - String ownerID = readCDTProject(descriptionPath); - if (ownerID.equals(id)) { - fOwner = new COwner(ownerID); - status = - new Status( - IStatus.WARNING, - CCorePlugin.PLUGIN_ID, - CCorePlugin.STATUS_CDTPROJECT_EXISTS, - "CDTProject already exisits", - (Throwable) null); - } else { - status = - new Status( - IStatus.ERROR, - CCorePlugin.PLUGIN_ID, - CCorePlugin.STATUS_CDTPROJECT_MISMATCH, - "CDTProject already exisits but does not match owner ID of creator", - (Throwable) null); - } - throw new CoreException(status); - } - fOwner = new COwner(id); - } - - protected CDescriptor(IProject project) throws CoreException { - fProject = project; - IPath projectLocation = project.getDescription().getLocation(); - - if (projectLocation == null) { - projectLocation = getProjectDefaultLocation(project); - } - IPath descriptionPath = projectLocation.append(DESCRIPTION_FILE_NAME); - - if (!descriptionPath.toFile().exists()) { - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "CDTProject file not found", (Throwable) null); - throw new CoreException(status); - } - fOwner = new COwner(readCDTProject(descriptionPath)); - } - - protected CDescriptor(IProject project, COwner owner) throws CoreException { - fProject = project; - IPath projectLocation = project.getDescription().getLocation(); - - if (projectLocation == null) { - projectLocation = getProjectDefaultLocation(project); - } - IPath descriptionPath = projectLocation.append(DESCRIPTION_FILE_NAME); - - if (!descriptionPath.toFile().exists()) { - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "CDTProject file not found", (Throwable) null); - throw new CoreException(status); - } - readCDTProject(descriptionPath); - fOwner = owner; - setDirty(); - } - - protected COwner getOwner() { - return fOwner; - } - - private String readCDTProject(IPath descriptionPath) throws CoreException { - FileInputStream file = null; - try { - file = new FileInputStream(descriptionPath.toFile()); - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document document = parser.parse(file); - Node node = document.getFirstChild(); - if (node.getNodeName().equals(PROJECT_DESCRIPTION)) { - String ownerID = node.getAttributes().getNamedItem("id").getNodeValue(); - if ( ownerID != null) { - readProjectDescription(node); - return ownerID; - } - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Missing owner id", null); - throw new CoreException(status); - } - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Missing cdtproject element", null); - throw new CoreException(status); - } catch (Exception e) { - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, e.getLocalizedMessage(), e); - throw new CoreException(status); - } finally { - if (file != null) { - try { - file.close(); - } catch (IOException e) { - } - } - } - } - - private IPath getProjectDefaultLocation(IProject project) { - return Platform.getLocation().append(project.getFullPath()); - } - - public ICOwnerInfo getProjectOwner() { - return fOwner; - } - - public String getPlatform() { - return fOwner.getPlatform(); - } - - public IProject getProject() { - return fProject; - } - - public ICExtensionReference[] get(String extensionID) { - CExtensionReference[] refs = (CExtensionReference[]) extMap.get(extensionID); - if (refs == null) - return new ICExtensionReference[0]; - return refs; - } - - public ICExtensionReference[] get(String extensionID, boolean update) { - ICExtensionReference[] ext = get(extensionID); - if (ext.length == 0 && update) { - try { - fOwner.update(fProject, this, extensionID); - saveInfo(); - ext = get(extensionID); - } catch (CoreException e) { - } - } - return ext; - } - - public ICExtensionReference create(String extensionPoint, String extensionID) throws CoreException { - CExtensionReference extensions[] = (CExtensionReference[]) extMap.get(extensionPoint); - if (extensions == null) { - extensions = new CExtensionReference[1]; - extMap.put(extensionPoint, extensions); - } else { - CExtensionReference[] newExtensions = new CExtensionReference[extensions.length + 1]; - System.arraycopy(extensions, 0, newExtensions, 0, extensions.length); - extensions = newExtensions; - extMap.put(extensionPoint, extensions); - } - extensions[extensions.length - 1] = new CExtensionReference(this, extensionPoint, extensionID); - setDirty(); - return extensions[extensions.length - 1]; - } - - public void remove(ICExtensionReference ext) throws CoreException { - CExtensionReference extensions[] = (CExtensionReference[]) extMap.get(ext.getExtension()); - for (int i = 0; i < extensions.length; i++) { - if (extensions[i] == ext) { - System.arraycopy(extensions, i, extensions, i + 1, extensions.length - 1 - i); - CExtensionReference[] newExtensions = new CExtensionReference[extensions.length - 1]; - System.arraycopy(extensions, 0, newExtensions, 0, extensions.length); - extensions = newExtensions; - if (extensions.length == 0) { - extMap.put(ext.getExtension(), null); - } else { - extMap.put(ext.getExtension(), extensions); - } - setDirty(); - } - } - } - - public void remove(String extensionPoint) throws CoreException { - CExtensionReference extensions[] = (CExtensionReference[]) extMap.get(extensionPoint); - if (extensions != null) { - extMap.remove(extensionPoint); - setDirty(); - } - } - - public CExtensionInfo getInfo(CExtensionReference cProjectExtension) { - CExtensionInfo info = (CExtensionInfo) extInfoMap.get(cProjectExtension); - if (info == null) { - info = new CExtensionInfo(); - extInfoMap.put(cProjectExtension, info); - } - return info; - } - - protected void saveInfo() throws CoreException { - String xml; - if (!isDirty()) { - return; - } - try { - xml = getAsXML(); - } catch (IOException e) { - IStatus s = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, e.getMessage(), e); - throw new CoreException(s); - } - - IFile rscFile = getProject().getFile(DESCRIPTION_FILE_NAME); - InputStream inputStream = new ByteArrayInputStream(xml.getBytes()); - // update the resource content - if (rscFile.exists()) { - rscFile.setContents(inputStream, IResource.FORCE, null); - } else { - rscFile.create(inputStream, IResource.FORCE, null); - } - fDirty = false; - } - - public boolean isAutoSave() { - return autoSave; - } - - public void setAutoSave(boolean autoSave) { - this.autoSave = autoSave; - } - - protected void setDirty() throws CoreException { - fDirty = true; - if (isAutoSave()) - saveInfo(); - } - - protected boolean isDirty() { - return fDirty; - } - - protected String serializeDocument(Document doc) throws IOException { - ByteArrayOutputStream s = new ByteArrayOutputStream(); - OutputFormat format = new OutputFormat(); - format.setIndenting(true); - format.setLineSeparator(System.getProperty("line.separator")); //$NON-NLS-1$ - Serializer serializer = - SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(s, "UTF8"), format); - serializer.asDOMSerializer().serialize(doc); - return s.toString("UTF8"); //$NON-NLS-1$ - } - - private void readProjectDescription(Node node) { - Node childNode; - ArrayList pathEntries = new ArrayList(); - NodeList list = node.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - childNode = list.item(i); - if (childNode.getNodeType() == Node.ELEMENT_NODE) { - if (childNode.getNodeName().equals(PROJECT_EXTENSION)) { - try { - decodeProjectExtension((Element) childNode); - } catch (CoreException e) { - CCorePlugin.log(e); - } - } else if (childNode.getNodeName().equals(PROJECT_DATA)) { - try { - decodeProjectData((Element)childNode); - } catch (CoreException e) { - CCorePlugin.log(e); - } - } - } - } - } - - private void decodeProjectExtension(Element element) throws CoreException { - ICExtensionReference ext = create(element.getAttribute("point"), element.getAttribute("id")); - NodeList extAttrib = element.getChildNodes(); - for (int j = 0; j < extAttrib.getLength(); j++) { - if (extAttrib.item(j).getNodeName().equals(PROJECT_EXTENSION_ATTRIBUTE)) { - NamedNodeMap attrib = extAttrib.item(j).getAttributes(); - ext.setExtensionData(attrib.getNamedItem("key").getNodeValue(), attrib.getNamedItem("value").getNodeValue()); - } - } - } - - - protected String getAsXML() throws IOException { - Document doc = new DocumentImpl(); - Element configRootElement = doc.createElement(PROJECT_DESCRIPTION); - doc.appendChild(configRootElement); - configRootElement.setAttribute("id", fOwner.getID()); //$NON-NLS-1$ - encodeProjectExtensions(doc, configRootElement); - encodeProjectData(doc, configRootElement); - return serializeDocument(doc); - } - - private void encodeProjectExtensions(Document doc, Element configRootElement) { - Element element; - Iterator extIterator = extMap.values().iterator(); - while (extIterator.hasNext()) { - CExtensionReference extension[] = (CExtensionReference[]) extIterator.next(); - for (int i = 0; i < extension.length; i++) { - configRootElement.appendChild(element = doc.createElement(PROJECT_EXTENSION)); - element.setAttribute("point", extension[i].getExtension()); - element.setAttribute("id", extension[i].getID()); - CExtensionInfo info = (CExtensionInfo) extInfoMap.get(extension[i]); - if (info != null) { - Iterator attribIterator = info.getAttributes().entrySet().iterator(); - while (attribIterator.hasNext()) { - Entry entry = (Entry) attribIterator.next(); - Element extAttributes = doc.createElement(PROJECT_EXTENSION_ATTRIBUTE); - extAttributes.setAttribute("key", (String) entry.getKey()); - extAttributes.setAttribute("value", (String) entry.getValue()); - element.appendChild(extAttributes); - } - } - } - } - } - - - protected ICExtension createExtensions(ICExtensionReference ext) throws CoreException { - InternalCExtension cExtension = null; - IPluginRegistry pluginRegistry = Platform.getPluginRegistry(); - IExtensionPoint extensionPoint = pluginRegistry.getExtensionPoint(ext.getExtension()); - IExtension extension = extensionPoint.getExtension(ext.getID()); - if ( extension == null) { - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Extension provider not found.", null)); - } - IConfigurationElement element[] = extension.getConfigurationElements(); - for (int i = 0; i < element.length; i++) { - if (element[i].getName().equalsIgnoreCase("cextension")) { - cExtension = (InternalCExtension) element[i].createExecutableExtension("run"); - cExtension.setExtenionReference(ext); - cExtension.setProject(fProject); - break; - } - } - return (ICExtension) cExtension; - } - - // The project data allows for the storage of any structured information - // into the cdtproject file. - private Document getProjectDataDoc() throws CoreException { - if (dataDoc == null) { - try { - dataDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); - } catch (ParserConfigurationException e) { - throw new CoreException( - new Status( - IStatus.ERROR, - CCorePlugin.PLUGIN_ID, - IStatus.ERROR, - "getProjectDataDoc", - e)); - } - Element rootElem = dataDoc.createElement(PROJECT_DATA); - dataDoc.appendChild(rootElem); - } - return dataDoc; - } - - private void decodeProjectData(Element data) throws CoreException { - Document doc = getProjectDataDoc(); - doc.replaceChild(doc.importNode(data, true), doc.getDocumentElement()); - } - - public Element getProjectData(String id) throws CoreException { - NodeList nodes = getProjectDataDoc().getDocumentElement().getElementsByTagName(PROJECT_DATA_ITEM); - for (int i = 0; i < nodes.getLength(); ++i) { - Element element = (Element)nodes.item(i); - if (element.getAttribute(PROJECT_DATA_ID).equals(id)) - return element; - } - - // Not found, make a new one - Element element = dataDoc.createElement(PROJECT_DATA_ITEM); - element.setAttribute(PROJECT_DATA_ID, id); - dataDoc.getDocumentElement().appendChild(element); - return element; - } - - public void saveProjectData() throws CoreException { - setDirty(); - } - - private void encodeProjectData(Document doc, Element root) { - // Don't create or encode the doc if it isn't there already - if (dataDoc != null) - root.appendChild(doc.importNode(dataDoc.getDocumentElement(), true)); - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptorManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptorManager.java deleted file mode 100644 index 073419ee934..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CDescriptorManager.java +++ /dev/null @@ -1,142 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core; - -import java.util.HashMap; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -public class CDescriptorManager implements IResourceChangeListener { - private static HashMap fDescriptorMap; - - private IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - public void shutdown() { - getWorkspace().removeResourceChangeListener(this); - } - - public void startup() { - getWorkspace().addResourceChangeListener(this); - } - - /** - * Traverses the delta looking for added/removed/changed launch - * configuration files. - * - * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - if ( fDescriptorMap == null ) { - return; - } - IResource resource = event.getResource(); - - int eventType = event.getType(); - - switch(eventType) { - case IResourceChangeEvent.PRE_DELETE: - if (resource.getType() == IResource.PROJECT){ - fDescriptorMap.remove(resource); - } - break; - case IResourceChangeEvent.POST_CHANGE: - IResourceDelta delta= event.getDelta(); - if (delta == null) { - break; - } - IResource dResource = delta.getResource(); - //if (0 != (delta.getFlags() & IResourceDelta.OPEN)) { - if (dResource instanceof IFile) { - IFile file = (IFile)dResource; - - // the .cdtproject file has been deleted - if ((file != null) && (file.getName().endsWith(CDescriptor.DESCRIPTION_FILE_NAME)) && !file.exists()){ - // must remove the corresponding reference to it in the fDescriptorMap - if (fDescriptorMap != null){ - fDescriptorMap.remove(resource); - } - } - - } - //} - break; - } - } - - - public synchronized ICDescriptor getDescriptor(IProject project) throws CoreException { - if ( fDescriptorMap == null ) { - fDescriptorMap = new HashMap(); - } - CDescriptor cproject; - cproject = (CDescriptor)fDescriptorMap.get(project) ; - if ( cproject == null ) { - cproject = new CDescriptor(project); - cproject.setAutoSave(true); - fDescriptorMap.put(project, cproject); - } - return cproject; - } - - public synchronized void configure(IProject project, String id) throws CoreException { - CDescriptor cproject; - if ( fDescriptorMap == null ) { - fDescriptorMap = new HashMap(); - } - if ( fDescriptorMap.get(project) != null ) { - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, CCorePlugin.STATUS_CDTPROJECT_EXISTS, "CDTProject already configured", (Throwable)null); - throw new CoreException(status); - } - try { - cproject = new CDescriptor(project, id); - } - catch (CoreException e) { // if .cdtproject already exists will use that - IStatus status = e.getStatus(); - if ( status.getCode() == CCorePlugin.STATUS_CDTPROJECT_EXISTS ) { - cproject = new CDescriptor(project); - fDescriptorMap.put(project, cproject); - return; - } - else - throw e; - } - cproject.getOwner().configure(project, cproject); - cproject.saveInfo(); - cproject.setAutoSave(true); - fDescriptorMap.put(project, cproject); - } - - public synchronized void convert(IProject project, String id) throws CoreException { - CDescriptor cproject; - if ( fDescriptorMap == null ) { - fDescriptorMap = new HashMap(); - } - cproject = new CDescriptor(project, new COwner(id)); - cproject.getOwner().configure(project, cproject); - cproject.saveInfo(); - cproject.setAutoSave(true); - fDescriptorMap.put(project, cproject); - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java deleted file mode 100644 index 7d9e146bb91..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core; - -import java.util.HashMap; - -public class CExtensionInfo { - - protected HashMap attribMap = new HashMap(4); - - protected HashMap getAttributes() { - return attribMap; - } - - public void setAttribute(String key, String value) { - if (value == null) { - attribMap.remove(key); - } else { - attribMap.put(key, value); - } - } - - public String getAttribute(String key) { - return (String) attribMap.get(key); - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionReference.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionReference.java deleted file mode 100644 index 1126d682474..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionReference.java +++ /dev/null @@ -1,52 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core; - -import org.eclipse.cdt.core.ICExtension; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.core.runtime.CoreException; - -public class CExtensionReference implements ICExtensionReference { - private CDescriptor fDescriptor; - private String fName; - private String fId; - - public CExtensionReference(CDescriptor descriptor, String name, String id) { - fDescriptor = descriptor; - fName = name; - fId = id; - } - - public String getExtension() { - return fName; - } - - public String getID() { - return fId; - } - - private CExtensionInfo getInfo() { - return fDescriptor.getInfo(this); - } - - public void setExtensionData(String key, String value) { - getInfo().setAttribute(key, value); - } - - public String getExtensionData(String key) { - return getInfo().getAttribute(key); - } - - public ICExtension createExtension() throws CoreException { - return fDescriptor.createExtensions(this); - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java deleted file mode 100644 index 4ab305a186a..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java +++ /dev/null @@ -1,88 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.ICOwner; -import org.eclipse.cdt.core.ICOwnerInfo; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -public class COwner implements ICOwnerInfo { - String ownerID; - String fPlatform; - IExtension extension; - - public COwner(String id) throws CoreException { - ownerID = id; - IExtensionPoint extpoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("CProject"); - extension = extpoint.getExtension(ownerID); - - if (extension == null) { - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Invalid CDTProject owner ID", (Throwable)null); - throw new CoreException(status); - } - } - - public String getID() { - return ownerID; - } - - public String getName() { - return extension == null ? null : extension.getLabel(); - } - - public String getPlatform() { - if ( fPlatform == null ) { - IConfigurationElement element[] = extension.getConfigurationElements(); - for( int i = 0; i < element.length; i++ ) { - if ( element[i].getName().equalsIgnoreCase("cproject") ) { - fPlatform = element[i].getAttribute("platform"); - break; - } - } - } - return fPlatform == null ? "*" : fPlatform; - } - - void configure(IProject project, ICDescriptor cproject) throws CoreException { - IConfigurationElement element[] = extension.getConfigurationElements(); - for( int i = 0; i < element.length; i++ ) { - if ( element[i].getName().equalsIgnoreCase("cproject") ) { - ICOwner owner = (ICOwner) element[i].createExecutableExtension("class"); - owner.configure(cproject); - return; - } - } - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Invalid CDTProject owner extension", (Throwable)null); - throw new CoreException(status); - } - - void update(IProject project, ICDescriptor cproject, String extensionID) throws CoreException { - IConfigurationElement element[] = extension.getConfigurationElements(); - for( int i = 0; i < element.length; i++ ) { - if ( element[i].getName().equalsIgnoreCase("cproject") ) { - ICOwner owner = (ICOwner) element[i].createExecutableExtension("class"); - owner.update(cproject, extensionID); - return; - } - } - IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Invalid CDTProject owner extension", (Throwable)null); - throw new CoreException(status); - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/InternalCExtension.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/InternalCExtension.java deleted file mode 100644 index fe676426146..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/InternalCExtension.java +++ /dev/null @@ -1,36 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core; - -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.core.resources.IProject; - -public abstract class InternalCExtension { - - private IProject project; - private ICExtensionReference extensionRef; - - void setProject(IProject project) { - this.project = project; - } - - void setExtenionReference(ICExtensionReference extReference) { - extensionRef = extReference; - } - - protected IProject getProject() { - return project; - } - - protected ICExtensionReference getExtensionReference() { - return extensionRef; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java deleted file mode 100644 index 34caa9ac782..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.eclipse.cdt.internal.core; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; - - -/** - * Bundled state of a launched process including the threads linking the process in/output - * to console documents. - */ -public class ProcessClosure { - - /** - * Thread which continuously reads from a input stream and pushes the read data - * to an output stream which is immediately flushed afterwards. - */ - protected static class ReaderThread extends Thread { - - private InputStream fInputStream; - private OutputStream fOutputStream; - private boolean fFinished = false; - private String lineSeparator; - /* - * outputStream can be null - */ - public ReaderThread(ThreadGroup group, String name, InputStream in, OutputStream out) { - super(group, name); - fOutputStream= out; - fInputStream= in; - setDaemon(true); - lineSeparator = (String) System.getProperty("line.separator"); - } - - public void run() { - try { - BufferedReader reader = new BufferedReader(new InputStreamReader(fInputStream)); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fOutputStream)); - String line; - while ((line = reader.readLine()) != null) { - line += lineSeparator; - char[] array = line.toCharArray(); - writer.write(array, 0, array.length); - writer.flush(); - } - } catch (IOException x) { - // ignore - } finally { - try { - fInputStream.close(); - } catch (IOException e) { - // ignore - } - try { - fOutputStream.close(); - } catch (IOException e) { - // ignore - } - complete(); - } - } - - public synchronized boolean finished() { - return fFinished; - } - - public synchronized void waitFor() { - while (!fFinished) { - try { - wait(); - } catch (InterruptedException e) { - } - } - } - - public synchronized void complete() { - fFinished = true; - notify(); - } - } - - protected static int fCounter= 0; - - protected Process fProcess; - - protected OutputStream fOutput; - protected OutputStream fError; - - protected ReaderThread fOutputReader; - protected ReaderThread fErrorReader; - - /** - * Creates a process closure and connects the launched process with - * a console document. - * @param outputStream prcess stdout is written to this stream. Can be null, if - * not interested in reading the output - * @param errorStream prcess stderr is written to this stream. Can be null, if - * not interested in reading the output - */ - public ProcessClosure(Process process, OutputStream outputStream, OutputStream errorStream) { - fProcess= process; - fOutput= outputStream; - fError= errorStream; - } - - /** - * Live links the launched process with the configured in/out streams using - * reader threads. - */ - public void runNonBlocking() { - ThreadGroup group= new ThreadGroup("CBuilder" + fCounter++); - - InputStream stdin= fProcess.getInputStream(); - InputStream stderr= fProcess.getErrorStream(); - - fOutputReader= new ReaderThread(group, "OutputReader", stdin, fOutput); - fErrorReader= new ReaderThread(group, "ErrorReader", stderr, fError); - - fOutputReader.start(); - fErrorReader.start(); - } - - public void runBlocking() { - runNonBlocking(); - - boolean finished = false; - while (!finished) { - try { - fProcess.waitFor(); - } catch (InterruptedException e) { - //System.err.println("Closure exception " +e); - } - try { - fProcess.exitValue(); - finished = true; - } catch (IllegalThreadStateException e) { - //System.err.println("Closure exception " +e); - } - } - - // @@@FIXME: Windows 2000 is screwed; double-check using output threads - if (!fOutputReader.finished()) { - fOutputReader.waitFor(); - } - - if (!fErrorReader.finished()) { - fErrorReader.waitFor(); - } - - // it seems that thread termination and stream closing is working without - // any help - fProcess= null; - fOutputReader= null; - fErrorReader= null; - } - - - public boolean isAlive() { - if (fProcess != null) { - if (fOutputReader.isAlive() || fErrorReader.isAlive()) { - return true; - } else { - fProcess= null; - fOutputReader= null; - fErrorReader= null; - } - } - return false; - } - - /** - * Forces the termination the launched process - */ - public void terminate() { - if (fProcess != null) { - fProcess.destroy(); - fProcess= null; - } - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java deleted file mode 100644 index f8600192134..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/parser/ParserLogService.java +++ /dev/null @@ -1,41 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.core.parser; - -import org.eclipse.cdt.core.ICLogConstants; -import org.eclipse.cdt.core.parser.IParserLogService; -import org.eclipse.cdt.internal.core.model.IDebugLogConstants; -import org.eclipse.cdt.internal.core.model.Util; - -/** - * @author jcamelon - * - */ -public class ParserLogService implements IParserLogService -{ - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParserLogService#traceLog(java.lang.String) - */ - public void traceLog(String message) - { - Util.debugLog( message, IDebugLogConstants.PARSER ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.IParserLogService#errorLog(java.lang.String) - */ - public void errorLog(String message) - { - Util.log( message, ICLogConstants.CDT ); - } - -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GASErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GASErrorParser.java deleted file mode 100644 index 8d5b5fc8b8a..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GASErrorParser.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.cdt.internal.errorparsers; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.IErrorParser; -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.core.resources.IFile; - -public class GASErrorParser implements IErrorParser { - - public boolean processLine(String line, ErrorParserManager eoParser) { - // cc -c x.c - // Only when the previous line sasys Assembler - // /tmp/cc8EXnKk.s: Assembler messages: - // /tmp/cc8EXnKk.s:46: Error: no such 386 instruction: `b' - try { - String previous = eoParser.getPreviousLine(); - String fileName = ""; - IFile file = null; - int num = 0; - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - String desc = line; - if (previous != null && previous.startsWith("Assembler")) { - if (! line.startsWith("FATAL")) { - int firstColon= line.indexOf(':'); - if (firstColon != -1) { - fileName = line.substring(0, firstColon); - desc = line.substring(firstColon + 1); - int secondColon= line.indexOf(':', firstColon + 1); - if (secondColon != -1) { - String lineNumber = line.substring(firstColon + 1, secondColon); - try { - num = Integer.parseInt(lineNumber); - } catch (NumberFormatException e) { - } - if (num != 0) { - desc = line.substring(secondColon + 2); - } - } - file = eoParser.findFilePath(fileName); - } - } - if (file == null) { - desc = fileName + " " + desc; - } - eoParser.generateMarker(file, num, desc, severity, null); - } - } catch (IndexOutOfBoundsException e) { - } - return false; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java deleted file mode 100644 index 92c63199b29..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java +++ /dev/null @@ -1,236 +0,0 @@ -package org.eclipse.cdt.internal.errorparsers; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.IErrorParser; -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.core.resources.IFile; - -public class GCCErrorParser implements IErrorParser { - - public boolean processLine(String line, ErrorParserManager eoParser) { - // Known patterns. - // (a) - // filename:lineno: description - // - // (b) - // filename:lineno:column: description - // - // (b) - // In file included from b.h:2, - // from a.h:3, - // from hello.c:3: - // c.h:2:15: missing ')' in macro parameter list - // - // (c) - // h.c: In function `main': - // h.c:41: `foo' undeclared (first use in this function) - // h.c:41: (Each undeclared identifier is reported only once - // h.c:41: for each function it appears in.) - // h.c:41: parse error before `char' - // h.c:75: `p' undeclared (first use in this function) - - int firstColon = line.indexOf(':'); - - /* Guard against drive in Windows platform. */ - if (firstColon == 1) { - try { - String os = System.getProperty("os.name"); - if (os != null && os.startsWith("Win")) { - try { - if (Character.isLetter(line.charAt(0))) { - firstColon = line.indexOf(':', 2); - } - } catch (StringIndexOutOfBoundsException e) { - } - } - } catch (SecurityException e) { - } - } - - if (firstColon != -1) { - try { - int secondColon = -1; - int num = -1; - - while ((secondColon = line.indexOf(':', firstColon + 1)) != -1) { - String lineNumber = line.substring(firstColon + 1, secondColon); - try { - num = Integer.parseInt(lineNumber); - } catch (NumberFormatException e) { - // Failed. - } - if (num != -1) { - break; // Find possible match. - } - firstColon = secondColon; - } - - if (secondColon != -1) { - int col = -1; - - String fileName = line.substring(0, firstColon); - String varName = null; - String desc = line.substring(secondColon + 1).trim(); - int severity = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - /* Then check for the column */ - int thirdColon= line.indexOf(':', secondColon + 1); - if (thirdColon != -1) { - String columnNumber = line.substring(secondColon + 1, thirdColon); - try { - col = Integer.parseInt(columnNumber); - } catch (NumberFormatException e) { - } - } - if (col != -1) { - desc = line.substring(thirdColon + 1).trim(); - } - - // gnu c: filename:no: (Each undeclared identifier is reported - // only once. filename:no: for each function it appears in.) - if (desc.startsWith ("(Each undeclared")) { - // Do nothing. - return false; - } else { - String previous = eoParser.getPreviousLine(); - if (desc.endsWith(")") - && previous.indexOf("(Each undeclared") >= 0 ) { - // Do nothing. - return false; - } - } - - /* See if we can get a var name - * Look for: - * `foo' undeclared - * `foo' defined but not used - * conflicting types for `foo' - * previous declaration of `foo' - * parse error before `foo' - * - */ - int s; - if((s = desc.indexOf("\' undeclared")) != -1) { - int p = desc.indexOf("`"); - if (p != -1) { - varName = desc.substring(p+1, s); - //System.out.println("undex varName "+ varName); - } - } else if((s = desc.indexOf("\' defined but not used")) != -1) { - int p = desc.indexOf("`"); - if (p != -1) { - varName = desc.substring(p+1, s); - //System.out.println("unused varName "+ varName); - } - } else if((s = desc.indexOf("conflicting types for `")) != -1) { - int p = desc.indexOf("\'", s); - if (p != -1) { - varName = desc.substring(desc.indexOf("`") + 1, p); - //System.out.println("confl varName "+ varName); - } - } else if((s = desc.indexOf("previous declaration of `")) != -1) { - int p = desc.indexOf("\'", s); - if (p != -1) { - varName = desc.substring(desc.indexOf("`") + 1, p); - //System.out.println("prev varName "+ varName); - } - } else if ((s = desc.indexOf("parse error before ")) != -1) { - int p = desc.indexOf("\'", s); - if (p != -1) { - varName = desc.substring(desc.indexOf("`") + 1, p); - //System.out.println("prev varName "+ varName); - } - } - - /* - * In file included from b.h:2, - * from a.h:3, - * from hello.c:3: - * c.h:2:15: missing ')' in macro parameter list - * - * We reconstruct the multiline gcc errors to multiple errors: - * c.h:3:15: missing ')' in macro parameter list - * b.h:2: in inclusion c.h:3:15 - * a.h:3: in inclusion b.h:2 - * hello.c:3: in inclusion a.h:3 - * - */ - if (eoParser.getScratchBuffer().startsWith("In file included from ")) { - if (line.startsWith("from ")) { - // We want the last error in the chain, so continue. - eoParser.appendToScratchBuffer(line); - return false; - } - String buffer = eoParser.getScratchBuffer(); - eoParser.clearScratchBuffer(); - int from = -1; - String inclusionError = fileName + ":" + num; - while ((from = buffer.indexOf("from ")) != -1) { - int coma = buffer.indexOf(',', from); - String buf; - if (coma != -1) { - buf = buffer.substring(from + 5, coma) + ':'; - buffer = buffer.substring(coma); - } else { - buf = buffer.substring(from + 5); - buffer = ""; - } - String t = buf; - buf += " in inclusion " + inclusionError; - inclusionError = t; - // Call the parsing process again. - processLine(buf, eoParser); - } - } - - IFile file = eoParser.findFilePath(fileName); - - if (file == null) { - // Parse the entire project. - file = eoParser.findFileName(fileName); - if (file != null) { - // If there is a conflict set the error on the project. - if (eoParser.isConflictingName(fileName)) { - desc = "*" + desc; - file = null; - } - } - } - - if (desc.startsWith("warning") || desc.startsWith("Warning")) { - severity = IMarkerGenerator.SEVERITY_WARNING; - // Remove the warning. - String d = desc.substring("warning".length()).trim(); - if (d.startsWith(":")) { - d = d.substring(1).trim(); - } - - if (d.length() != 0) { - desc = d; - } - } - - // Display the fileName. - if (file == null) { - desc = desc +"[" + fileName + "]"; - } - - eoParser.generateMarker(file, num, desc, severity, varName); - } else { - if (line.startsWith("In file included from ")) { - eoParser.appendToScratchBuffer(line); - } else if (line.startsWith("from ")) { - eoParser.appendToScratchBuffer(line); - } - } - } catch (StringIndexOutOfBoundsException e) { - } catch (NumberFormatException e) { - } - } - return false; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java deleted file mode 100644 index 762cc2ad6e8..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GLDErrorParser.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.cdt.internal.errorparsers; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.IErrorParser; -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.core.resources.IFile; - -public class GLDErrorParser implements IErrorParser { - - public boolean processLine(String line, ErrorParserManager eoParser) { - // binutils linker error: - // 1- an error when trying to link - // tempfile: In function `function': - // tempfile(.text+0xhex): undefined reference to `symbol' - // 2- - // Something went wrong check if it is "ld" the linkeer bay cheching - // the last letter for "ld" - // An example might be (not all are warnings): - // ntox86-ld: warning: libcpp.so.2, needed by C:/temp//libdisplay.so, may conflict with libcpp.so.3 - int firstColon= line.indexOf(':'); - if (firstColon != -1) { - String buf= line.substring(0, firstColon); - String desc= line.substring(firstColon + 1); - int firstPara= buf.indexOf('('); - int secondPara= buf.indexOf(')'); - if (firstPara >= 0 && secondPara >= 0) { - String fileName = buf.substring(0, firstPara); - String previous = eoParser.getPreviousLine(); - if (previous == null) - previous = ""; - int colon = previous.indexOf(':'); - if (colon != -1) { - previous = previous.substring(colon + 1); - } - - desc = "*" + previous + " " + desc; - // Since we do not have any way to know the name of the C file - // where the undefined reference is refering we set the error - // on the project. - IFile file = eoParser.findFilePath(fileName); - if (file == null) { - desc = fileName + " " + desc; - } - eoParser.generateMarker(file, 0, desc, IMarkerGenerator.SEVERITY_ERROR_RESOURCE, null); - } else if (buf.endsWith("ld")){ - // By default treat the condition as fatal/error, unless marked as a warning - int errorType = IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - desc = desc.trim(); - if(desc.startsWith("warning") || desc.startsWith("Warning")) { - errorType = IMarkerGenerator.SEVERITY_WARNING; - } - - String fileName = line.substring(0, firstColon); - IFile file = eoParser.findFilePath(fileName); - if (file == null) { - desc = fileName + " " + desc; - } - - eoParser.generateMarker(file, 0, desc, errorType, null); - } - } - return false; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java deleted file mode 100644 index 05a75cf5713..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/MakeErrorParser.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.cdt.internal.errorparsers; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.IErrorParser; -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.core.runtime.Path; - -public class MakeErrorParser implements IErrorParser { - - public MakeErrorParser() { - } - - static int getDirectoryLevel(String line) { - int s = line.indexOf('['); - int num = 0; - if (s != -1) { - int e = line.indexOf(']'); - String number = line.substring(s + 1, e).trim(); - try { - num = Integer.parseInt(number); - } catch (NumberFormatException exc) { - } - } - return num; - } - - public boolean processLine(String line, ErrorParserManager eoParser) { - // make\[[0-9]*\]: error_desc - int firstColon= line.indexOf(':'); - if (firstColon != -1 && line.startsWith("make")) { //$NON-NLS-1$ - boolean enter = false; - String msg= line.substring(firstColon + 1).trim(); - if ((enter = msg.startsWith("Entering directory")) || //$NON-NLS-1$ - (msg.startsWith("Leaving directory"))) { //$NON-NLS-1$ - int s = msg.indexOf('`'); - int e = msg.indexOf('\''); - if (s != -1 && e != -1) { - String dir = msg.substring(s+1, e); - if (enter) { - /* Sometimes make screws up the output, so - * "leave" events can't be seen. Double-check level - * here. - */ - int level = getDirectoryLevel(line); - int parseLevel = eoParser.getDirectoryLevel(); - for (; level < parseLevel; level++) { - eoParser.popDirectory(); - } - eoParser.pushDirectory(new Path(dir)); - } else { - eoParser.popDirectory(); - /* Could check to see if they match */ - } - } - } else if (msg.startsWith("***")) { //$NON-NLS-1$ - boolean warning = false; - if (msg.length() > 4) { - String s = msg.substring(3).trim(); - warning = s.startsWith("Warning"); //$NON-NLS-1$ - } - if (warning) { - eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_WARNING, null); - } else { - eoParser.generateMarker(null, -1, msg, IMarkerGenerator.SEVERITY_ERROR_BUILD, null); - } - } - } - return false; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/VCErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/VCErrorParser.java deleted file mode 100644 index 9680e5e7c37..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/VCErrorParser.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.cdt.internal.errorparsers; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.File; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.core.IErrorParser; -import org.eclipse.cdt.core.IMarkerGenerator; -import org.eclipse.core.resources.IFile; - -public class VCErrorParser implements IErrorParser { - - public boolean processLine(String line, ErrorParserManager eoParser) { - // msdev: filname(linenumber) : error/warning error_desc - int firstColon= line.indexOf(':'); - if (firstColon != -1) { - String firstPart= line.substring(0, firstColon); - StringTokenizer tok= new StringTokenizer(firstPart, "()"); - if (tok.hasMoreTokens()) { - String fileName= tok.nextToken(); - if (tok.hasMoreTokens()) { - String lineNumber= tok.nextToken(); - try { - int num= Integer.parseInt(lineNumber); - int i= fileName.lastIndexOf(File.separatorChar); - if (i != -1) { - fileName= fileName.substring(i + 1); - } - IFile file= eoParser.findFileName(fileName); - if (file != null || eoParser.isConflictingName(fileName)) { - String desc= line.substring(firstColon + 1).trim(); - if (file == null) { - desc= "*" + desc; - } - int severity= IMarkerGenerator.SEVERITY_ERROR_RESOURCE; - if (desc.startsWith("warning")) { - severity= IMarkerGenerator.SEVERITY_WARNING; - } - eoParser.generateMarker(file, num, desc, severity, null); - return true; - } - } catch (NumberFormatException e) { - } - } - } - } - return false; - } -} diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java deleted file mode 100644 index 0e9022d85ba..00000000000 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CCodeFormatter.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.cdt.internal.formatter; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -public class CCodeFormatter { - //public FormatterOptions options; - - public CCodeFormatter() { - } - -// CCodeFormatter(FormatterOptions options) { -// } - - public String formatSourceString(String content) { - return content; - } - - -} - - diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Addr2line.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Addr2line.java deleted file mode 100644 index a68565e775f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Addr2line.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.eclipse.cdt.utils; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; - -import org.eclipse.cdt.utils.spawner.ProcessFactory; - -public class Addr2line { - private Process addr2line; - private BufferedReader stdout; - private BufferedWriter stdin; - private String lastaddr, lastsymbol, lastline; - - public Addr2line(String command, String file) throws IOException { - String[] args = {command, "-C", "-f", "-e", file}; - addr2line = ProcessFactory.getFactory().exec(args); - stdin = new BufferedWriter(new OutputStreamWriter(addr2line.getOutputStream())); - stdout = new BufferedReader(new InputStreamReader(addr2line.getInputStream())); - } - - public Addr2line(String file) throws IOException { - this("addr2line", file); - } - - private void getOutput(String address) throws IOException { - if ( address.equals(lastaddr) == false ) { - stdin.write(address + "\n"); - stdin.flush(); - lastsymbol = stdout.readLine(); - lastline = stdout.readLine(); - lastaddr = address; - } - } - - public String getLine(long address) throws IOException { - getOutput(Integer.toHexString((int)address)); - return lastline; - } - - public String getFunction(long address) throws IOException { - getOutput(Integer.toHexString((int)address)); - return lastsymbol; - } - - /** - * The format of the output: - * addr2line -C -f -e hello - * 08048442 - * main - * hello.c:39 - */ - public String getFileName(long address) throws IOException { - String filename = null; - String line = getLine(address); - int index1, index2; - if (line != null && (index1 = line.lastIndexOf(':')) != -1) { - // we do this because addr2line on win produces - // - index2 = line.indexOf(':'); - if (index1 == index2) { - index2 = 0; - } else { - index2--; - } - filename = line.substring(index2, index1); - } - return filename; - } - - /** - * The format of the output: - * addr2line -C -f -e hello - * 08048442 - * main - * hello.c:39 - */ - public int getLineNumber(long address) throws IOException { - // We try to get the nearest match - // since the symbol may not exactly align with debug info. - // In C line number 0 is invalid, line starts at 1 for file, we use - // this for validation. - for (int i = 0; i <= 20; i += 4, address += i) { - String line = getLine(address); - if (line != null) { - int colon = line.lastIndexOf(':'); - String number = line.substring(colon + 1); - if (!number.startsWith("0")) { - return Integer.parseInt(number); - } - } - } - return -1; - } - - public void dispose() { - try { - stdout.close(); - stdin.close(); - addr2line.getErrorStream().close(); - } catch (IOException e) { - } - addr2line.destroy(); - } -} - - diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CPPFilt.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CPPFilt.java deleted file mode 100644 index 3344b7d8a3f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CPPFilt.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.cdt.utils; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; - -import org.eclipse.cdt.utils.spawner.ProcessFactory; - -public class CPPFilt { - private Process cppfilt; - private BufferedReader stdout; - private BufferedWriter stdin; - - public CPPFilt(String command) throws IOException { - String[] args = {command}; - cppfilt = ProcessFactory.getFactory().exec(args); - //cppfilt = new Spawner(args); - stdin = new BufferedWriter(new OutputStreamWriter(cppfilt.getOutputStream())); - stdout = new BufferedReader(new InputStreamReader(cppfilt.getInputStream())); - } - - public CPPFilt() throws IOException { - this("c++filt"); - } - - public String getFunction(String symbol) throws IOException { - stdin.write(symbol + "\n"); - stdin.flush(); - String str = stdout.readLine(); - if ( str != null ) { - return str.trim(); - } - throw new IOException(); - } - - public void dispose() { - try { - //stdin.write(-1); - stdout.close(); - stdin.close(); - cppfilt.getErrorStream().close(); - } - catch (IOException e) { - } - cppfilt.destroy(); - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java deleted file mode 100644 index 188e9df76e9..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CygPath.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.cdt.utils; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; - -import org.eclipse.cdt.utils.spawner.ProcessFactory; - -public class CygPath { - private Process cygpath; - private BufferedReader stdout; - private BufferedWriter stdin; - - public CygPath(String command) throws IOException { - String[] args = {command, "--windows", "--file", "-"}; - cygpath = ProcessFactory.getFactory().exec(args); - //cppfilt = new Spawner(args); - stdin = new BufferedWriter(new OutputStreamWriter(cygpath.getOutputStream())); - stdout = new BufferedReader(new InputStreamReader(cygpath.getInputStream())); - } - - public CygPath() throws IOException { - this("cygpath"); - } - - public String getFileName(String name) throws IOException { - stdin.write(name + "\n"); - stdin.flush(); - String str = stdout.readLine(); - if ( str != null ) { - return str.trim(); - } - throw new IOException(); - } - - public void dispose() { - try { - stdout.close(); - stdin.close(); - cygpath.getErrorStream().close(); - } - catch (IOException e) { - } - cygpath.destroy(); - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/ICygwinToolsProvider.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/ICygwinToolsProvider.java deleted file mode 100644 index fcec917bca8..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/ICygwinToolsProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils; - -/** - */ -public interface ICygwinToolsProvider extends IToolsProvider { - - CygPath getCygPath(); - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/IToolsProvider.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/IToolsProvider.java deleted file mode 100644 index 274699c2465..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/IToolsProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils; - -import org.eclipse.core.runtime.IPath; - -/** - */ -public interface IToolsProvider { - - Addr2line getAddr2Line(IPath path); - - CPPFilt getCPPFilt(); - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java deleted file mode 100644 index 63d47972a16..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java +++ /dev/null @@ -1,583 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.utils.coff; - -import java.io.IOException; -import java.io.RandomAccessFile; -import java.text.DateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class Coff { - - public static final String NL = System.getProperty("line.separator", "\n"); - FileHeader filehdr; - OptionalHeader opthdr; - RandomAccessFile rfile; - long startingOffset; - byte[] string_table; - SectionHeader[] scnhdrs; - Symbol[] symbols; - - public static class FileHeader { - public final static int FILHSZ = 20; - - public final static int F_RELFLG = 0x0001; // relocation info stripped from file - public final static int F_EXEC = 0x0002; // file is executable - // (no unresolved external references) - public final static int F_LNNO = 0x0004; // line numbers stripped from file - public final static int F_LSYMS = 0x0008; // local symbols stripped from file - public final static int F_AR16WR = 0x0080; // file is 16-bit little-endian - public final static int F_AR32WR = 0x0100; // file is 32-bit little-endian - public final static int F_AR32W = 0x0200; // file is 32-bit big-endian - public final static int F_DYNLOAD = 0x1000;// rs/6000 aix: dynamically - // loadable w/imports & exports - public final static int F_SHROBJ = 0x2000; // rs/6000 aix: file is a shared object - public final static int F_DLL = 0x2000; // PE format DLL. - - public int f_magic; /* 00-01 2 bytes: magic number */ - public int f_nscns; /* 02-03 2 bytes: number of sections: 2 bytes */ - public int f_timdat; /* 04-07 4 bytes: time & date stamp */ - public int f_symptr; /* 08-11 4 bytes: file pointer to symtab */ - public int f_nsyms; /* 12-15 4 bytes: number of symtab entries */ - public int f_opthdr; /* 16-17 2 bytes: sizeof(optional hdr) */ - public int f_flags; /* 18-19 2 bytes: flags */ - - public FileHeader (RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public FileHeader (RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] hdr = new byte[FILHSZ]; - file.readFully(hdr); - ReadMemoryAccess memory = new ReadMemoryAccess(hdr, true); - f_magic = memory.getUnsignedShort(); - f_nscns = memory.getUnsignedShort(); - f_timdat = memory.getInt(); - f_symptr = memory.getInt(); - f_nsyms = memory.getInt(); - f_opthdr = memory.getUnsignedShort(); - f_flags = memory.getUnsignedShort(); - } - - public boolean isStrip() { - return (f_flags & F_RELFLG) == F_RELFLG; - } - - public boolean isExec() { - return (f_flags & F_EXEC) == F_EXEC; - } - - public boolean isDebug() { - return !((f_flags & F_LNNO) == F_LNNO); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("FILE HEADER VALUES").append(NL); - - buffer.append("f_magic = ").append(f_magic).append(NL); - buffer.append("f_nscns = ").append(f_nscns).append(NL); - - buffer.append("f_timdat = "); - buffer.append(DateFormat.getDateInstance().format(new Date(f_timdat))); - buffer.append(NL); - - buffer.append("f_symptr = ").append(f_symptr).append(NL); - buffer.append("f_nsyms = ").append(f_nsyms).append(NL); - buffer.append("f_opthdr = ").append(f_opthdr).append(NL); - buffer.append("f_flags = ").append(f_flags).append(NL); - return buffer.toString(); - } - } - - public static class OptionalHeader { - public final static int AOUTHDRSZ = 28; - - public short magic; /* 2 bytes: type of file */ - public short vstamp; /* 2 bytes: version stamp */ - public int tsize; /* 4 bytes: text size in bytes, padded to FW bdry*/ - public int dsize; /* 4 bytes: initialized data " " */ - public int bsize; /* 4 bytes: uninitialized data " " */ - public int entry; /* 4 bytes: entry pt. */ - public int text_start; /* 4 bytes: base of text used for this file */ - public int data_start; /* 4 bytes: base of data used for this file */ - - public OptionalHeader(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer() + FileHeader.FILHSZ); - } - - public OptionalHeader(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] hdr = new byte[AOUTHDRSZ]; - file.readFully(hdr); - ReadMemoryAccess memory = new ReadMemoryAccess(hdr, true); - magic = memory.getShort(); - vstamp = memory.getShort(); - tsize = memory.getInt(); - dsize = memory.getInt(); - bsize = memory.getInt(); - entry = memory.getInt(); - text_start = memory.getInt(); - data_start = memory.getInt(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("OPTIONAL HEADER VALUES").append(NL); - buffer.append("magic = ").append(magic).append(NL); - buffer.append("vstamp = ").append(vstamp).append(NL); - buffer.append("tsize = ").append(tsize).append(NL); - buffer.append("dsize = ").append(dsize).append(NL); - buffer.append("bsize = ").append(bsize).append(NL); - buffer.append("entry = ").append(entry).append(NL); - buffer.append("text_start = ").append(text_start).append(NL); - buffer.append("data_start = ").append(data_start).append(NL); - return buffer.toString(); - } - } - - public static class SectionHeader { - - public final static int SCNHSZ = 40; - - /* names of "special" sections */ - public final static String _TEXT = ".text"; - public final static String _DATA = ".data"; - public final static String _BSS = ".bss"; - public final static String _COMMENT = ".comment"; - public final static String _LIB = ".lib"; - - /* s_flags "type". */ - public final static int STYP_REG = 0x0000; /* "regular": allocated, relocated, - loaded */ - public final static int STYP_DSECT = 0x0001; /* "dummy": relocated only */ - public final static int STYP_NOLOAD = 0x0002; /* "noload": allocated, relocated, - not loaded */ - public final static int STYP_GROUP = 0x0004; /* "grouped": formed of input - sections */ - public final static int STYP_PAD = 0x0008; /* "padding": not allocated, not - relocated, loaded */ - public final static int STYP_COPY = 0x0010; /* "copy": for decision function - used by field update; - not allocated, not relocated, - loaded; reloc & lineno entries - processed normally */ - public final static int STYP_TEXT = 0x0020; /* section contains text only. */ - public final static int S_SHRSEG = 0x0020; /* In 3b Update files (output of - ogen), sections which appear in - SHARED segments of the Pfile - will have the S_SHRSEG flag set - by ogen, to inform dufr that - updating 1 copy of the proc. will - update all process invocations. */ - public final static int STYP_DATA = 0x0040; /* section contains data only */ - public final static int STYP_BSS = 0x0080; /* section contains bss only */ - public final static int S_NEWFCN = 0x0100; /* In a minimal file or an update - file, a new function (as - compared with a replaced - function) */ - public final static int STYP_INFO = 0x0200; /* comment: not allocated not - relocated, not loaded */ - public final static int STYP_OVER = 0x0400; /* overlay: relocated not allocated - or loaded */ - public final static int STYP_LIB = 0x0800; /* for .lib: same as INFO */ - public final static int STYP_MERGE = 0x2000; /* merge section -- combines with - text, data or bss sections only */ - public final static int STYP_REVERSE_PAD = 0x4000; /* section will be padded - with no-op instructions - wherever padding is necessary - and there is a word of - contiguous bytes beginning on a - word boundary. */ - - public final static int STYP_LIT = 0x8020; /* Literal data (like STYP_TEXT) */ - - - public byte[] s_name= new byte[8]; // 8 bytes: section name - public int s_paddr; // 4 bytes: physical address, aliased s_nlib - public int s_vaddr; // 4 bytes: virtual address - public int s_size; // 4 bytes: section size - public int s_scnptr; // 4 bytes: file ptr to raw data for section - public int s_relptr; // 4 bytes: file ptr to relocation - public int s_lnnoptr; // 4 bytes: file ptr to line numbers - public int s_nreloc; // 2 bytes: number of relocation entries - public int s_nlnno; // 2 bytes: number of line number entries - public int s_flags; // 4 bytes: flags - - RandomAccessFile sfile; - - public SectionHeader(RandomAccessFile file, long offset) throws IOException { - sfile = file; - file.seek(offset); - byte[] hdr = new byte[SCNHSZ]; - file.readFully(hdr); - ReadMemoryAccess memory = new ReadMemoryAccess(hdr, true); - memory.getBytes(s_name); - s_paddr = memory.getInt(); - s_vaddr = memory.getInt(); - s_size = memory.getInt(); - s_scnptr = memory.getInt(); - s_relptr = memory.getInt(); - s_lnnoptr = memory.getInt(); - s_nreloc = memory.getUnsignedShort(); - s_nlnno = memory.getUnsignedShort(); - s_flags = memory.getInt(); - } - - public byte[] getRawData() throws IOException { - byte[] data = new byte[s_size]; - sfile.seek(s_scnptr); - sfile.readFully(data); - return data; - } - - public Reloc[] getRelocs() throws IOException { - Reloc[] relocs = new Reloc[s_nreloc]; - sfile.seek(s_relptr); - for (int i = 0; i < s_nreloc; i++) { - relocs[i] = new Reloc(sfile); - } - return relocs; - } - - public Lineno[] getLinenos() throws IOException { - Lineno[] lines = new Lineno[s_nlnno]; - sfile.seek(s_lnnoptr); - for (int i = 0; i < s_nlnno; i++) { - lines[i] = new Lineno(sfile); - } - return lines; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("SECTION HEADER VALUES").append(NL); - buffer.append(new String(s_name)).append(NL); - buffer.append("s_paddr = ").append(s_paddr).append(NL); - buffer.append("s_vaddr = ").append(s_vaddr).append(NL); - buffer.append("s_size = ").append(s_size).append(NL); - buffer.append("s_scnptr = ").append(s_scnptr).append(NL); - buffer.append("s_relptr = ").append(s_relptr).append(NL); - buffer.append("s_lnnoptr = ").append(s_lnnoptr).append(NL); - buffer.append("s_nreloc = ").append(s_nreloc).append(NL); - buffer.append("s_nlnno = ").append(s_nlnno).append(NL); - buffer.append("s_flags = ").append(s_flags).append(NL); -///* - try { - Reloc[] rcs = getRelocs(); - for (int i = 0; i < rcs.length; i++) { - buffer.append(rcs[i]); - } - } catch (IOException e) { - } - try { - Lineno[] nos = getLinenos(); - for (int i = 0; i < nos.length; i++) { - buffer.append(nos[i]); - } - } catch (IOException e) { - } -//*/ - return buffer.toString(); - } - } - - public static class Reloc { - public static final int RELSZ = 16; - public int r_vaddr; /* 4 byte: Pointer to an area in raw data that represents a - referenced address. */ - public int r_symndx; /* 4 byte: Index into symbol table. */ - public int r_type; /* 2 byte(unsigned short): Type of address reference. */ - - public Reloc(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public Reloc(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] bytes = new byte[RELSZ]; - file.readFully(bytes); - ReadMemoryAccess memory = new ReadMemoryAccess(bytes, true); - r_vaddr = memory.getInt(); - r_symndx = memory.getInt(); - r_type = memory.getUnsignedShort(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("RELOC VALUES").append(NL); - buffer.append("r_vaddr = ").append(r_vaddr); - buffer.append(" r_symndx = ").append(r_symndx).append(NL); - return buffer.toString(); - } - } - - public static class Lineno { - public final static int LINESZ = 6; - public int l_addr; /* long. Index into symbol table if l_linn0 == 0. - Break-pointable address if l_lnno > 0. */ - public int l_lnno; /* unsigned short. Line number */ - - public Lineno(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public Lineno(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] bytes = new byte[LINESZ]; - file.readFully(bytes); - ReadMemoryAccess memory = new ReadMemoryAccess(bytes, true); - l_addr = memory.getInt(); - l_lnno = memory.getUnsignedShort(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - if (l_lnno == 0) { - buffer.append("Function address = ").append(l_addr).append(NL); - } else { - buffer.append("line# ").append(l_lnno); - buffer.append(" at address = ").append(l_addr).append(NL); - } - return buffer.toString(); - } - } - - public static class Symbol { - public final static int SYMSZ = 18; - public final static int SYMNMLEN = 8; - - /* Derived types, in n_type. */ - public final static int DT_NON = 0; /* no derived type */ - public final static int DT_PTR = 1; /* pointer */ - public final static int DT_FCN = 2; /* function */ - public final static int DT_ARY = 3; /* array */ - - public final static int N_TMASK = 0x30; - public final static int N_BTSHFT = 4; - public final static int N_TSHIFT = 2; - - - public byte[] _n_name = new byte[SYMNMLEN]; /* Symbol name, or pointer into - string table if symbol name - is greater than SYMNMLEN. */ - public int n_value; /* long. Symbol;s value: dependent on section number, - storage class and type. */ - public short n_scnum; /* short, Section number. */ - public int n_type; /* Unsigned short. Symbolic type. */ - public byte n_sclass; /* char, Storage class. */ - public byte n_numaux; /* char. Nuymber of auxiliary enties. */ - - public Symbol(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public Symbol(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] bytes = new byte[SYMSZ]; - file.readFully(bytes); - ReadMemoryAccess memory = new ReadMemoryAccess(bytes, true); - memory.getBytes(_n_name); - n_value = memory.getInt(); - n_scnum = memory.getShort(); - n_type = memory.getUnsignedShort(); - n_sclass = memory.getByte(); - n_numaux = memory.getByte(); - } - - public boolean isLongName() { - return (_n_name[0] == 0); - } - - public String getName() { - for (int i = 0; i < _n_name.length; i++) { - if (_n_name[i] == 0) { - return new String(_n_name, 0, i); - } - } - return ""; - } - - public String getName(byte[] table) { - if (table.length > 0 && isLongName()) { - ReadMemoryAccess memory = new ReadMemoryAccess(_n_name, true); - memory.getInt(); // pass over the first 4 bytes. - // The first for bytes of the string table represent the - // number of bytes in the string table. - int offset = memory.getInt() - 4; - if (offset > 0) { - for (int i = offset; i < table.length; i++) { - if (table[i] == 0) { - return new String(table, offset, i - offset); - } - } - } - } - return getName(); - } - - public boolean isPointer() { - return (n_type & N_TMASK) == (DT_PTR << N_BTSHFT); - } - - public boolean isFunction() { - return (n_type & N_TMASK) == (DT_FCN << N_BTSHFT); - } - - public boolean isArray() { - return (n_type & N_TMASK) == (DT_ARY << N_BTSHFT); - } - - public String toString() { - return getName(); - } - - } - - public FileHeader getFileHeader() throws IOException { - return filehdr; - } - - public OptionalHeader getOptionalHeader() throws IOException { - return opthdr; - } - - public SectionHeader[] getSectionHeaders() throws IOException { - if (scnhdrs == null) { - scnhdrs = new SectionHeader[getFileHeader().f_nscns]; - long sec = FileHeader.FILHSZ + getFileHeader().f_opthdr; - for (int i = 0; i < scnhdrs.length; i++, sec += SectionHeader.SCNHSZ) { - scnhdrs[i] = new SectionHeader(rfile, sec); - } - } - return scnhdrs; - } - - public Symbol[] getSymbols() throws IOException { - if (symbols == null) { - long offset = getFileHeader().f_symptr; - rfile.seek(offset); - symbols = new Symbol[getFileHeader().f_nsyms]; - for (int i = 0; i < symbols.length; i++) { - symbols[i] = new Symbol(rfile); - } - } - return symbols; - } - - public byte[] getStringTable() throws IOException { - if (string_table == null) { - long symbolsize = Symbol.SYMSZ * getFileHeader().f_nsyms; - long offset = getFileHeader().f_symptr + symbolsize; - rfile.seek(offset); - byte[] bytes = new byte[4]; - rfile.readFully(bytes); - int str_len = ReadMemoryAccess.getIntLE(bytes); - if (str_len > 4) { - str_len -= 4; - string_table = new byte[str_len]; - rfile.seek(offset + 4); - rfile.readFully(string_table); - } else { - string_table = new byte[0]; - } - } - return string_table; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - try { - FileHeader header = null; - header = getFileHeader(); - if (header != null) { - buffer.append(header); - } - } catch (IOException e) { - e.printStackTrace(); - } - try { - OptionalHeader opt = null; - opt = getOptionalHeader(); - if (opt != null) { - buffer.append(opt); - } - } catch (IOException e) { - e.printStackTrace(); - } - try { - SectionHeader[] sections = getSectionHeaders(); - for (int i = 0; i < sections.length; i++) { - buffer.append(sections[i]); - } - } catch (IOException e) { - } - - try { - Symbol[] table = getSymbols(); - for (int i = 0; i < table.length; i++) { - buffer.append(table[i].getName(getStringTable())).append(NL); - } - } catch (IOException e) { - } - -// try { -// String[] strings = getStringTable(getStringTable()); -// for (int i = 0; i < strings.length; i++) { -// buffer.append(strings[i]); -// } -// } catch (IOException e) { -// e.printStackTrace(); -// } - return buffer.toString(); - } - - public static String[] getStringTable(byte[] bytes) { - List aList = new ArrayList(); - int offset = 0; - for (int i = 0; i < bytes.length; i++) { - if (bytes[i] == 0) { - aList.add(new String(bytes, offset, i - offset)); - offset = i + 1; - } - } - return (String[])aList.toArray(new String[0]); - } - - public Coff(String filename) throws IOException { - this(new RandomAccessFile(filename, "r"), 0); - } - - public Coff(RandomAccessFile file, long offset) throws IOException { - commonSetup(file, offset); - } - - void commonSetup(RandomAccessFile file, long offset) throws IOException { - startingOffset = offset; - rfile = file; - try { - filehdr = new FileHeader(rfile, offset); - if (filehdr.f_opthdr > 0) { - opthdr = new OptionalHeader(rfile, startingOffset + 20); - } - } finally { - if (filehdr == null) { - rfile.close(); - } - } - } - - public static void main(String[] args) { - try { - Coff coff = new Coff(args[0]); - System.out.println(coff); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java deleted file mode 100644 index b7942a77866..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Exe.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.utils.coff; - -import java.io.IOException; -import java.io.RandomAccessFile; - -public class Exe { - - public static final String NL = System.getProperty("line.separator", "\n"); - protected RandomAccessFile rfile; - ExeHeader ehdr; - - static public class ExeHeader { - - public final static int EXEHDRSZ = 28; - public byte[] e_signature = new byte[2]; // 00-01 "MZ" - Link file .EXE signature - public short e_lastsize; // 02-03 Length of EXE file modulo 512 - public short e_nblocks; // 04-05 Number of 512 pages (including the last page) - public short e_nreloc; // 06-07 Number of relocation entries - public short e_hdrsize; // 08-09 Size of header in 16 byte paragraphs, - // occupied by "EXE" header and relo table. - - public short e_minalloc; // 0A-0B Minimum paragraphs of memory allocated - public short e_maxalloc; // 0C-0D Maximum number of paragraphs allocated - // in addition to the code size - public short e_ss; // 0E-0F Initial SS relative to start of executable - public short e_sp; // 10-11 Initial SP - public short e_checksum; // 12-13 Checksum (or 0) of executable - public short e_ip; // 14-15 CS:IP relative to start of executable - public short e_cs; // 16-17 CS:IP relative to start of executable - public short e_relocoffs; // 18-19 Offset of relocation table; - // 40h for new-(NE,LE,LX,W3,PE etc.) executable - public short e_noverlay; // 1A-1B Overlay number (0h = main program) - - protected ExeHeader(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - protected ExeHeader(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] hdr = new byte[EXEHDRSZ]; - file.readFully(hdr); - ReadMemoryAccess memory = new ReadMemoryAccess(hdr, true); - memory.getBytes(e_signature); - if (e_signature[0] != 'M' || e_signature[1] != 'Z') { - throw new IOException("Not DOS EXE format"); - } - e_lastsize = memory.getShort(); - e_nblocks = memory.getShort(); - e_nreloc = memory.getShort(); - e_hdrsize = memory.getShort(); - e_minalloc = memory.getShort(); - e_maxalloc = memory.getShort(); - e_ss = memory.getShort(); - e_sp = memory.getShort(); - e_checksum = memory.getShort(); - e_ip = memory.getShort(); - e_cs = memory.getShort(); - e_relocoffs = memory.getShort(); - e_noverlay = memory.getShort(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - - buffer.append("EXE HEADER VALUES").append(NL); - buffer.append("signature "); - buffer.append((char)e_signature[0] + " " + (char)e_signature[1]); - buffer.append(NL); - - buffer.append("lastsize: 0x"); - buffer.append(Long.toHexString(new Short(e_lastsize).longValue())); - buffer.append(NL); - - buffer.append("nblocks: 0x"); - buffer.append(Long.toHexString(new Short(e_nblocks).longValue())); - buffer.append(NL); - - buffer.append("nreloc: 0x"); - buffer.append(Long.toHexString(new Short(e_nreloc).longValue())); - buffer.append(NL); - - buffer.append("hdrsize: 0x"); - buffer.append(Long.toHexString(new Short(e_hdrsize).longValue())); - buffer.append(NL); - - buffer.append("minalloc: 0x"); - buffer.append(Long.toHexString(new Short(e_minalloc).longValue())); - buffer.append(NL); - - buffer.append("maxalloc: 0x"); - buffer.append(Long.toHexString(new Short(e_maxalloc).longValue())); - buffer.append(NL); - buffer.append("ss: 0x"); - buffer.append(Long.toHexString(new Short(e_ss).longValue())); - buffer.append(NL); - - buffer.append("sp: 0x"); - buffer.append(Long.toHexString(new Short(e_sp).longValue())); - buffer.append(NL); - - buffer.append("checksum: 0x"); - buffer.append(Long.toHexString(new Short(e_checksum).longValue())); - buffer.append(NL); - - buffer.append("ip: 0x"); - buffer.append(Long.toHexString(new Short(e_ip).longValue())); - buffer.append(NL); - - buffer.append("cs: 0x"); - buffer.append(Long.toHexString(new Short(e_cs).longValue())); - buffer.append(NL); - - buffer.append("relocoffs: 0x"); - buffer.append(Long.toHexString(new Short(e_relocoffs).longValue())); - buffer.append(NL); - - buffer.append("overlay: 0x"); - buffer.append(Long.toHexString(new Short(e_noverlay).longValue())); - buffer.append(NL); - return buffer.toString(); - } - } - - public ExeHeader getExeHeader() throws IOException { - return ehdr; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(rfile).append(NL); - buffer.append(ehdr); - return buffer.toString(); - } - - public Exe(String file) throws IOException { - rfile = new RandomAccessFile(file, "r"); - try { - ehdr = new ExeHeader(rfile); - } finally { - if (ehdr == null) { - rfile.close(); - } - } - } - - public static void main(String[] args) { - try { - Exe exe = new Exe(args[0]); - System.out.println(exe); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java deleted file mode 100644 index d95e27ab4f0..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java +++ /dev/null @@ -1,637 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.utils.coff; - -import java.io.IOException; -import java.io.RandomAccessFile; - -import org.eclipse.cdt.utils.coff.Coff.FileHeader; -import org.eclipse.cdt.utils.coff.Coff.OptionalHeader; -import org.eclipse.cdt.utils.coff.Coff.SectionHeader; -import org.eclipse.cdt.utils.coff.Coff.Symbol; -import org.eclipse.cdt.utils.coff.Exe.ExeHeader; - -/** - * The PE file header consists of an MS-DOS stub, the PE signalture, the COFF file Header - * and an Optional Header. - *
            - *  +-------------------+
            - *  | DOS-stub          |
            - *  +-------------------+
            - *  | file-header       |
            - *  +-------------------+
            - *  | optional header   |
            - *  |- - - - - - - - - -|
            - *  |                   |
            - *  | data directories  |
            - *  |                   |
            - *  +-------------------+
            - *  |                   |
            - *  | section headers   |
            - *  |                   |
            - *  +-------------------+
            - *  |                   |
            - *  | section 1         |
            - *  |                   |
            - *  +-------------------+
            - *  |                   |
            - *  | section 2         |
            - *  |                   |
            - *  +-------------------+
            - *  |                   |
            - *  | ...               |
            - *  |                   |
            - *  +-------------------+
            - *  |                   |
            - *  | section n         |
            - *  |                   |
            - *  +-------------------+
            - * 
            - */ -public class PE { - - public static final String NL = System.getProperty("line.separator", "\n"); - RandomAccessFile rfile; - String filename; - ExeHeader exeHeader; - DOSHeader dosHeader; - FileHeader fileHeader; - OptionalHeader optionalHeader; - NTOptionalHeader ntHeader; - ImageDataDirectory[] dataDirectories; - SectionHeader[] scnhdrs; - Symbol[] symbolTable; - byte[] stringTable; - - public class Attribute { - public static final int PE_TYPE_EXE = 1; - public static final int PE_TYPE_SHLIB = 2; - public static final int PE_TYPE_OBJ = 3; - public static final int PE_TYPE_CORE = 4; - - String cpu; - int type; - int word; - boolean bDebug; - boolean isle; - - public String getCPU() { - return cpu; - } - - public int getType() { - return type; - } - - public boolean hasDebug() { - return bDebug; - } - - public boolean isLittleEndian() { - return isle; - } - - public int getWord() { - return word; - } - } - - /** - */ - public static class DOSHeader { - final static int DOSHDRSZ = 100; - byte[] e_res = new byte[8]; /* Reserved words, all 0x0. */ - byte[] e_oemid = new byte[2]; /* OEM identifier (for e_oeminfo), 0x0. */ - byte[] e_oeminfo = new byte[2]; /* OEM information; e_oemid specific, 0x0. */ - byte[] e_res2 = new byte[20]; /* Reserved words, all 0x0. */ - int e_lfanew; /* 4 byte File address of new exe header, offset 60(0x3c), 0x80. */ - byte[] dos_message = new byte[64]; /* Other stuff, always follow DOS header. */ - - public DOSHeader(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public DOSHeader(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] hdr = new byte[DOSHDRSZ]; - file.readFully(hdr); - ReadMemoryAccess memory = new ReadMemoryAccess(hdr, true); - memory.getBytes(e_res); - memory.getBytes(e_oemid); - memory.getBytes(e_oeminfo); - memory.getBytes(e_res2); - e_lfanew = memory.getInt(); - memory.getBytes(dos_message); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("DOS STUB VALUES").append(NL); - buffer.append("e_lfanew = ").append(e_lfanew).append(NL); - buffer.append(new String(dos_message)).append(NL); - return buffer.toString(); - } - } - - public static class NTOptionalHeader { - - public final static int NTHDRSZ = 68; - public int ImageBase; // 4 bytes. - public int SectionAlignment; // 4 bytes. - public int FileAlignment; // 4 bytes. - public short MajorOperatingSystemVersion; // 2 bytes. - public short MinorOperatingSystemVersion; // 2 bytes. - public short MajorImageVersion; // 2 bytes. - public short MinorImageVersion; // 2 bytes. - public short MajorSubsystemVersion; // 2 bytes. - public short MinorSubsystemVersion; // 2 bytes. - public byte[] Reserved = new byte[4]; // 4 bytes. - public int SizeOfImage; // 4 bytes. - public int SizeOfHeaders; // 4 bytes. - public int CheckSum; // 4 bytes. - public short Subsystem; // 2 bytes. - public short DLLCharacteristics; // 2 bytes. - public int SizeOfStackReserve; // 4 bytes. - public int SizeOfStackCommit; // 4 bytes. - public int SizeOfHeapReserve; // 4 bytes. - public int SizeOfHeapCommit; // 4 bytes. - public int LoaderFlags; // 4 bytes. - public int NumberOfRvaAndSizes; // 4 bytes. - - public NTOptionalHeader(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public NTOptionalHeader(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] hdr = new byte[NTHDRSZ]; - file.readFully(hdr); - ReadMemoryAccess memory = new ReadMemoryAccess(hdr, true); - ImageBase = memory.getInt(); - SectionAlignment = memory.getInt(); - FileAlignment = memory.getInt(); - MajorOperatingSystemVersion = memory.getShort(); - MinorOperatingSystemVersion = memory.getShort(); - MajorImageVersion = memory.getShort(); - MinorImageVersion = memory.getShort(); - MajorSubsystemVersion = memory.getShort(); - MinorSubsystemVersion = memory.getShort(); - memory.getBytes(Reserved); - SizeOfImage = memory.getInt(); - SizeOfHeaders = memory.getInt(); - CheckSum = memory.getInt(); - Subsystem = memory.getShort(); - DLLCharacteristics = memory.getShort(); - SizeOfStackReserve = memory.getInt(); - SizeOfStackCommit = memory.getInt(); - SizeOfHeapReserve = memory.getInt(); - SizeOfHeapCommit = memory.getInt(); - LoaderFlags = memory.getInt(); - NumberOfRvaAndSizes = memory.getInt(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("NT OPTIONAL HEADER VALUES").append(NL); - buffer.append("ImageBase = ").append(ImageBase).append(NL); - buffer.append("SexctionAlignement = ").append(SectionAlignment).append(NL); - buffer.append("FileAlignment = ").append(FileAlignment).append(NL); - buffer.append("MajorOSVersion = ").append(MajorOperatingSystemVersion).append(NL); - buffer.append("MinorOSVersion = ").append(MinorOperatingSystemVersion).append(NL); - buffer.append("MajorImageVersion = ").append(MajorImageVersion).append(NL); - buffer.append("MinorImageVersion = ").append(MinorImageVersion).append(NL); - buffer.append("MajorSubVersion = ").append(MajorSubsystemVersion).append(NL); - buffer.append("MinorSubVersion = ").append(MinorSubsystemVersion).append(NL); - buffer.append("Reserved = ").append(Reserved).append(NL); - buffer.append("SizeOfImage = ").append(SizeOfImage).append(NL); - buffer.append("SizeOfHeaders = ").append(SizeOfHeaders).append(NL); - buffer.append("CheckSum = ").append(CheckSum).append(NL); - buffer.append("Subsystem = ").append(Subsystem).append(NL); - buffer.append("DLL = ").append(DLLCharacteristics).append(NL); - buffer.append("StackReserve = ").append(SizeOfStackReserve).append(NL); - buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL); - buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL); - buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL); - buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL);; - buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL); - return buffer.toString(); - } - } - - public class ImageDataDirectory { - public int rva; - public int size; - - public ImageDataDirectory(int r, int s) { - rva = r; - size = s; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("rva = ").append(rva).append(" "); - buffer.append("size = ").append(size).append(NL); - return buffer.toString(); - } - } - - public class ImportDirectoryEntry { - public final static int ENTRYSZ = 20; - public int rva; - public int timestamp; - public int forwarder; - public int name; - public int thunk; - - public ImportDirectoryEntry(RandomAccessFile file) throws IOException { - this(file, file.getFilePointer()); - } - - public ImportDirectoryEntry(RandomAccessFile file, long offset) throws IOException { - file.seek(offset); - byte[] bytes = new byte[ENTRYSZ]; - file.readFully(bytes); - ReadMemoryAccess memory = new ReadMemoryAccess(bytes, true); - rva = memory.getInt(); - timestamp = memory.getInt(); - forwarder = memory.getInt(); - name = memory.getInt(); - thunk = memory.getInt(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("rva = ").append(rva); - buffer.append(" timestamp = ").append(timestamp); - buffer.append(" forwarder = ").append(forwarder); - buffer.append(" name = ").append(name); - buffer.append(" thunk = ").append(thunk).append(NL); - return buffer.toString(); - } - } - - public PE (String filename) throws IOException { - this(filename, 0); - } - - public PE(String filename, long pos) throws IOException { - this(filename, pos, true); - } - - public PE (String filename, long pos, boolean filter) throws IOException { - try { - rfile = new RandomAccessFile(filename, "r"); - this.filename = filename; - rfile.seek(pos); - - // Object files do not have exe/dos header. - try { - exeHeader = new ExeHeader(rfile); - dosHeader = new DOSHeader(rfile); - // Jump the Coff header, and Check the sig. - rfile.seek(dosHeader.e_lfanew); - byte[] sig = new byte[4]; - rfile.readFully(sig); - if (!((sig[0] == 'P') && (sig[1] == 'E') - && (sig[2] == '\0') && (sig[3] == '\0'))) { - throw new IOException("Not a PE format"); - } - } catch (IOException e) { - rfile.seek(pos); - } - - fileHeader = new Coff.FileHeader(rfile, rfile.getFilePointer()); - - // Check if this a valid machine. - switch (fileHeader.f_magic) { - case PEConstants.IMAGE_FILE_MACHINE_ALPHA: - case PEConstants.IMAGE_FILE_MACHINE_ARM: - case PEConstants.IMAGE_FILE_MACHINE_ALPHA64: - case PEConstants.IMAGE_FILE_MACHINE_I386: - case PEConstants.IMAGE_FILE_MACHINE_IA64: - case PEConstants.IMAGE_FILE_MACHINE_M68K: - case PEConstants.IMAGE_FILE_MACHINE_MIPS16: - case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU: - case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU16: - case PEConstants.IMAGE_FILE_MACHINE_POWERPC: - case PEConstants.IMAGE_FILE_MACHINE_R3000: - case PEConstants.IMAGE_FILE_MACHINE_R4000: - case PEConstants.IMAGE_FILE_MACHINE_R10000: - case PEConstants.IMAGE_FILE_MACHINE_SH3: - case PEConstants.IMAGE_FILE_MACHINE_SH4: - case PEConstants.IMAGE_FILE_MACHINE_THUMB: - // Ok; - break; - - default: - throw new IOException("Unknow machine/format"); - } - - if (fileHeader.f_opthdr > 0) { - optionalHeader = new Coff.OptionalHeader(rfile, rfile.getFilePointer()); - ntHeader = new NTOptionalHeader(rfile, rfile.getFilePointer()); - } - } finally { - if (rfile != null) { - rfile.close(); - rfile = null; - } - } - } - - public Attribute getAttribute() { - Attribute attrib = new Attribute(); - FileHeader filhdr = getFileHeader(); - - // Machine type. - switch (filhdr.f_magic) { - case PEConstants.IMAGE_FILE_MACHINE_UNKNOWN: - attrib.cpu = "none"; - break; - case PEConstants.IMAGE_FILE_MACHINE_ALPHA: - attrib.cpu = "alpha"; - break; - case PEConstants.IMAGE_FILE_MACHINE_ARM: - attrib.cpu = "arm"; - break; - case PEConstants.IMAGE_FILE_MACHINE_ALPHA64: - attrib.cpu = "arm64"; - break; - case PEConstants.IMAGE_FILE_MACHINE_I386: - attrib.cpu = "x86"; - break; - case PEConstants.IMAGE_FILE_MACHINE_IA64: - attrib.cpu = "ia64"; - break; - case PEConstants.IMAGE_FILE_MACHINE_M68K: - attrib.cpu = "m68k"; - break; - case PEConstants.IMAGE_FILE_MACHINE_MIPS16: - attrib.cpu = "mips16"; - break; - case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU: - attrib.cpu = "mipsfpu"; - break; - case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU16: - attrib.cpu = "mipsfpu16"; - break; - case PEConstants.IMAGE_FILE_MACHINE_POWERPC: - attrib.cpu = "powerpc"; - break; - case PEConstants.IMAGE_FILE_MACHINE_R3000: - attrib.cpu = "r3000"; - break; - case PEConstants.IMAGE_FILE_MACHINE_R4000: - attrib.cpu = "r4000"; - break; - case PEConstants.IMAGE_FILE_MACHINE_R10000: - attrib.cpu = "r10000"; - break; - case PEConstants.IMAGE_FILE_MACHINE_SH3: - attrib.cpu = "sh3"; - break; - case PEConstants.IMAGE_FILE_MACHINE_SH4: - attrib.cpu = "sh4"; - break; - case PEConstants.IMAGE_FILE_MACHINE_THUMB: - attrib.cpu = "thumb"; - break; - } - - /* PE characteristics, FileHeader.f_flags. */ - if ((filhdr.f_flags & PEConstants.IMAGE_FILE_DLL) != 0) { - attrib.type = Attribute.PE_TYPE_SHLIB; - } else if ((filhdr.f_flags & PEConstants.IMAGE_FILE_EXECUTABLE_IMAGE) != 0) { - attrib.type = Attribute.PE_TYPE_EXE; - } else { - attrib.type = Attribute.PE_TYPE_OBJ; - } - - // For PE always assume little endian unless otherwise. - attrib.isle = true; - // Little Endian. - if ((filhdr.f_flags & PEConstants.IMAGE_FILE_BYTES_REVERSED_LO) != 0) { - attrib.isle = true; - } - // Big Endian. - if ((filhdr.f_flags & PEConstants.IMAGE_FILE_BYTES_REVERSED_HI) != 0) { - attrib.isle = false; - } - - // No debug information. - if ((filhdr.f_flags & PEConstants.IMAGE_FILE_DEBUG_STRIPPED) != 0) { - attrib.bDebug = false; - } else { - attrib.bDebug = true; - } - - // sizeof word. - if ((filhdr.f_flags & PEConstants.IMAGE_FILE_16BIT_MACHINE) != 0) { - attrib.word = 16; - } - if ((filhdr.f_flags & PEConstants.IMAGE_FILE_32BIT_MACHINE) != 0) { - attrib.word = 32; - } - return attrib; - } - - public static boolean isExeHeader(byte[] e_signature) { - if (e_signature.length < 2 || e_signature[0] != 'M' || e_signature[1] != 'Z') - return false; - return true; - } - - public static Attribute getAttributes(String file) throws IOException { - PE pe = new PE(file); - Attribute attrib = pe.getAttribute(); - pe.dispose(); - return attrib; - } - - - public void dispose() throws IOException { - if (rfile != null) { - rfile.close(); - rfile = null; - } - } - - protected void finalize() throws Throwable { - try { - dispose(); - } finally { - super.finalize(); - } - } - - public ExeHeader getExeHeader() { - return exeHeader; - } - - public DOSHeader getDOSHeader() { - return dosHeader; - } - - public FileHeader getFileHeader() { - return fileHeader; - } - - public OptionalHeader getOptionalHeader() { - return optionalHeader; - } - - public NTOptionalHeader getNTOptionalHeader() { - return ntHeader; - } - - public ImageDataDirectory[] getImageDataDirectories() throws IOException { - if (dataDirectories == null) { - RandomAccessFile accessFile = getRandomAccessFile(); - long offset = 0; - if (dosHeader != null) { - offset = dosHeader.e_lfanew + 4/*NT SIG*/; - } - offset += FileHeader.FILHSZ + OptionalHeader.AOUTHDRSZ + NTOptionalHeader.NTHDRSZ; - accessFile.seek(offset); - dataDirectories = new ImageDataDirectory[PEConstants.IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; - byte[] data = new byte[dataDirectories.length * (4 + 4)]; - accessFile.readFully(data); - ReadMemoryAccess memory = new ReadMemoryAccess(data, true); - for (int i = 0; i < dataDirectories.length; i++) { - int rva = memory.getInt(); - int size = memory.getInt(); - dataDirectories[i] = new ImageDataDirectory(rva, size); - } - } - return dataDirectories; - } - public SectionHeader[] getSectionHeaders() throws IOException { - if (scnhdrs == null) { - RandomAccessFile accessFile = getRandomAccessFile(); - scnhdrs = new SectionHeader[fileHeader.f_nscns]; - long offset = 0; - if (dosHeader != null) { - offset = dosHeader.e_lfanew + 4 /* NT SIG */; - } - offset += FileHeader.FILHSZ + fileHeader.f_opthdr; - for (int i = 0; i < scnhdrs.length; i++, offset += SectionHeader.SCNHSZ) { - scnhdrs[i] = new SectionHeader(accessFile, offset); - } - } - return scnhdrs; - } - - public Symbol[] getSymbols() throws IOException { - if (symbolTable == null) { - RandomAccessFile accessFile = getRandomAccessFile(); - long offset = fileHeader.f_symptr; - symbolTable = new Symbol[fileHeader.f_nsyms]; - for (int i = 0; i < symbolTable.length; i++, offset += Symbol.SYMSZ) { - symbolTable[i] = new Symbol(accessFile, offset); - NTOptionalHeader ntHeader = getNTOptionalHeader(); - // FIXME: What is this again ? - if (ntHeader != null) - symbolTable[i].n_value += ntHeader.ImageBase + ntHeader.FileAlignment; - } - } - return symbolTable; - } - - public byte[] getStringTable() throws IOException { - if (stringTable == null) { - if (fileHeader.f_nsyms > 0) { - RandomAccessFile accessFile = getRandomAccessFile(); - long symbolsize = Symbol.SYMSZ * fileHeader.f_nsyms; - long offset = fileHeader.f_symptr + symbolsize; - accessFile.seek(offset); - byte[] bytes = new byte[4]; - accessFile.readFully(bytes); - int str_len = ReadMemoryAccess.getIntLE(bytes); - if (str_len > 4) { - str_len -= 4; - stringTable = new byte[str_len]; - accessFile.seek(offset + 4); - accessFile.readFully(stringTable); - } else { - stringTable = new byte[0]; - } - } else { - stringTable = new byte[0]; - } - } - return stringTable; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - if (exeHeader != null) { - buffer.append(exeHeader); - } - if (dosHeader != null) { - buffer.append(dosHeader); - } - buffer.append(fileHeader); - if (optionalHeader != null) { - buffer.append(optionalHeader); - } - if (ntHeader != null) { - buffer.append(ntHeader); - } - try { - ImageDataDirectory[] dirs = getImageDataDirectories(); - for (int i = 0; i < dirs.length; i++) { - buffer.append("Entry ").append(i); - buffer.append(" ").append(dirs[i]); - } - } catch (IOException e) { - e.printStackTrace(); - } - - try { - SectionHeader[] sections = getSectionHeaders(); - for (int i = 0; i < sections.length; i++) { - buffer.append(sections[i]); - } - } catch (IOException e) { - e.printStackTrace(); - } - - try { - Symbol[] symbols = getSymbols(); - for (int i = 0; i < symbols.length; i++) { - buffer.append(symbols[i]); - } - } catch (IOException e) { - e.printStackTrace(); - } - - try { - byte[] bytes = getStringTable(); - String[] strings = Coff.getStringTable(bytes); - for (int i = 0; i < strings.length; i++) { - buffer.append(strings[i]); - } - } catch (IOException e) { - e.printStackTrace(); - } - return buffer.toString(); - } - - RandomAccessFile getRandomAccessFile () throws IOException { - if (rfile == null) { - rfile = new RandomAccessFile(filename, "r"); - } - return rfile; - } - public static void main(String[] args) { - try { - PE pe = new PE(args[0]); - System.out.println(pe); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java deleted file mode 100644 index 35cb63c392f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEArchive.java +++ /dev/null @@ -1,328 +0,0 @@ -package org.eclipse.cdt.utils.coff; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.Vector; - -/** - * The AR class is used for parsing standard ELF archive (ar) files. - * - * Each object within the archive is represented by an ARHeader class. Each of - * of these objects can then be turned into an PE object for performing PE - * class operations. - * @see ARHeader - */ -public class PEArchive { - - protected String filename; - protected RandomAccessFile rfile; - protected long strtbl_pos = -1; - private ARHeader[] headers; - - public void dispose() { - try { - if (rfile != null) { - rfile.close(); - rfile = null; - } - } catch (IOException e) { - } - } - - /** - * Do not leak fds. - */ - protected void finalize() throws Throwable { - try { - dispose(); - } finally { - super.finalize(); - } - } - - /** - * The ARHeader class is used to store the per-object file - * archive headers. It can also create an PE object for inspecting - * the object file data. - */ - public class ARHeader { - - private String object_name; - private String modification_time; - private String uid; - private String gid; - private String mode; - private long size; - private long elf_offset; - - /** - * Remove the padding from the archive header strings. - */ - private String removeBlanks(String str) { - while (str.charAt(str.length() - 1) == ' ') - str = str.substring(0, str.length() - 1); - return str; - } - - /** - * Look up the name stored in the archive's string table based - * on the offset given. - * - * Maintains rfile file location. - * - * @param offset - * Offset into the string table for first character of the name. - * @throws IOException - * offset not in string table bounds. - */ - private String nameFromStringTable(long offset) throws IOException { - StringBuffer name = new StringBuffer(0); - long pos = rfile.getFilePointer(); - - try { - if (strtbl_pos != -1) { - byte temp; - rfile.seek(strtbl_pos + offset); - while ((temp = rfile.readByte()) != '\n') - name.append((char) temp); - } - } finally { - rfile.seek(pos); - } - - return name.toString(); - } - - /** - * Creates a new archive header object. - * - * Assumes that rfile is already at the correct location in the file. - * - * @throws IOException - * There was an error processing the header data from the file. - */ - public ARHeader() throws IOException { - byte[] object_name = new byte[16]; - byte[] modification_time = new byte[12]; - byte[] uid = new byte[6]; - byte[] gid = new byte[6]; - byte[] mode = new byte[8]; - byte[] size = new byte[10]; - byte[] trailer = new byte[2]; - - // - // Read in the archive header data. Fixed sizes. - // - rfile.read(object_name); - rfile.read(modification_time); - rfile.read(uid); - rfile.read(gid); - rfile.read(mode); - rfile.read(size); - rfile.read(trailer); - - // - // Save this location so we can create the PE object later. - // - elf_offset = rfile.getFilePointer(); - - // - // Convert the raw bytes into strings and numbers. - // - this.object_name = removeBlanks(new String(object_name)); - this.modification_time = new String(modification_time); - this.uid = new String(uid); - this.gid = new String(gid); - this.mode = new String(mode); - this.size = Long.parseLong(removeBlanks(new String(size))); - - // - // If the name is of the format "/", get name from the - // string table. - // - if (strtbl_pos != -1 - && this.object_name.length() > 1 - && this.object_name.charAt(0) == '/') { - try { - long offset = Long.parseLong(this.object_name.substring(1)); - this.object_name = nameFromStringTable(offset); - } catch (java.lang.Exception e) { - } - } - - // - // Strip the trailing / from the object name. - // - int len = this.object_name.length(); - if (len > 2 && this.object_name.charAt(len - 1) == '/') { - this.object_name = this.object_name.substring(0, len - 1); - } - - } - - /** Get the name of the object file */ - public String getObjectName() { - return object_name; - } - - /** Get the size of the object file . */ - public long getSize() { - return size; - } - - /** - * Create an new PE object for the object file. - * - * @throws IOException - * Not a valid PE object file. - * @return A new PE object. - * @see PE#PE( String, long ) - */ - public PE getPE() throws IOException { - return new PE(filename, elf_offset); - } - - public PE getPE(boolean filter_on) throws IOException { - return new PE(filename, elf_offset, filter_on); - } - - public byte[] getObjectData() throws IOException { - byte[] temp = new byte[(int) size]; - rfile.seek(elf_offset); - rfile.read(temp); - return temp; - } - } - - public static boolean isARHeader(byte[] ident) { - if (ident.length < 7 - || ident[0] != '!' - || ident[1] != '<' - || ident[2] != 'a' - || ident[3] != 'r' - || ident[4] != 'c' - || ident[5] != 'h' - || ident[6] != '>') - return false; - return true; - } - - /** - * Creates a new AR object from the contents of - * the given file. - * - * @param filename The file to process. - * @throws IOException The file is not a valid archive. - */ - public PEArchive(String filename) throws IOException { - this.filename = filename; - rfile = new RandomAccessFile(filename, "r"); - String hdr = rfile.readLine(); - if (hdr == null || hdr.compareTo("!") != 0) { - rfile.close(); - throw new IOException("Not a valid archive file."); - } - } - - /** Load the headers from the file (if required). */ - private void loadHeaders() throws IOException { - if (headers != null) - return; - - Vector v = new Vector(); - try { - // - // Check for EOF condition - // - while (rfile.getFilePointer() < rfile.length()) { - ARHeader header = new ARHeader(); - String name = header.getObjectName(); - - long pos = rfile.getFilePointer(); - - // - // If the name starts with a / it is specical. - // - if (name.charAt(0) != '/') - v.add(header); - - // - // If the name is "//" then this is the string table section. - // - if (name.compareTo("//") == 0) - strtbl_pos = pos; - - // - // Compute the location of the next header in the archive. - // - pos += header.getSize(); - if ((pos % 2) != 0) - pos++; - - rfile.seek(pos); - } - } catch (IOException e) { - } - headers = (ARHeader[]) v.toArray(new ARHeader[0]); - } - - /** - * Get an array of all the object file headers for this archive. - * - * @throws IOException - * Unable to process the archive file. - * @return An array of headers, one for each object within the archive. - * @see ARHeader - */ - public ARHeader[] getHeaders() throws IOException { - loadHeaders(); - return headers; - } - - private boolean stringInStrings(String str, String[] set) { - for (int i = 0; i < set.length; i++) - if (str.compareTo(set[i]) == 0) - return true; - return false; - } - - public String[] extractFiles(String outdir, String[] names) - throws IOException { - Vector names_used = new Vector(); - String object_name; - int count; - - loadHeaders(); - - count = 0; - for (int i = 0; i < headers.length; i++) { - object_name = headers[i].getObjectName(); - if (names != null && !stringInStrings(object_name, names)) - continue; - - object_name = "" + count + "_" + object_name; - count++; - - byte[] data = headers[i].getObjectData(); - File output = new File(outdir, object_name); - names_used.add(object_name); - - RandomAccessFile rfile = new RandomAccessFile(output, "rw"); - rfile.write(data); - rfile.close(); - } - - return (String[]) names_used.toArray(new String[0]); - } - - public String[] extractFiles(String outdir) throws IOException { - return extractFiles(outdir, null); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEConstants.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEConstants.java deleted file mode 100644 index 3f7796479f4..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PEConstants.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.utils.coff; - -public class PEConstants { - -/* PE characteristics, FileHeader.f_flags. */ -public final static int IMAGE_FILE_RELOCS_STRIPPED = 0x0001; -public final static int IMAGE_FILE_EXECUTABLE_IMAGE = 0x0002; -public final static int IMAGE_FILE_LINE_NUMS_STRIPPED = 0x0004; -public final static int IMAGE_FILE_LOCAL_SYMS_STRIPPED = 0x0008; -public final static int IMAGE_FILE_AGGRESSIVE_WS_TRIM = 0x0010; -public final static int IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x0020; -public final static int IMAGE_FILE_16BIT_MACHINE = 0x0040; -public final static int IMAGE_FILE_BYTES_REVERSED_LO = 0x0080; -public final static int IMAGE_FILE_32BIT_MACHINE = 0x0100; -public final static int IMAGE_FILE_DEBUG_STRIPPED = 0x0200; -public final static int IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400; -public final static int IMAGE_FILE_SYSTEM = 0x1000; -public final static int IMAGE_FILE_DLL = 0x2000; -public final static int IMAGE_FILE_UP_SYSTEM_ONLY = 0x4000; -public final static int IMAGE_FILE_BYTES_REVERSED_HI = 0x8000; - -/* FileHader.f_magic. Indicate the machine numbers. */ -public final static int IMAGE_FILE_MACHINE_UNKNOWN = 0x0; -public final static int IMAGE_FILE_MACHINE_ALPHA = 0x184; -public final static int IMAGE_FILE_MACHINE_ARM = 0x1c0; -public final static int IMAGE_FILE_MACHINE_ALPHA64 = 0x284; -public final static int IMAGE_FILE_MACHINE_I386 = 0x14c; -public final static int IMAGE_FILE_MACHINE_IA64 = 0x200; -public final static int IMAGE_FILE_MACHINE_M68K = 0x268; -public final static int IMAGE_FILE_MACHINE_MIPS16 = 0x266; -public final static int IMAGE_FILE_MACHINE_MIPSFPU = 0x366; -public final static int IMAGE_FILE_MACHINE_MIPSFPU16 = 0x466; -public final static int IMAGE_FILE_MACHINE_POWERPC = 0x1f0; -public final static int IMAGE_FILE_MACHINE_R3000 = 0x162; -public final static int IMAGE_FILE_MACHINE_R4000 = 0x166; -public final static int IMAGE_FILE_MACHINE_R10000 = 0x168; -public final static int IMAGE_FILE_MACHINE_SH3 = 0x1a2; -public final static int IMAGE_FILE_MACHINE_SH4 = 0x1a6; -public final static int IMAGE_FILE_MACHINE_THUMB = 0x1c2; - -/* OptionalHeader.magic */ -public final static int PE32 = 0x10b; -public final static int PE32PLUS = 0x20b; - -/* Windows NT Subsystem. NTOptionalHeader.Subsystem */ -public final static int IMAGE_SUBSYSTEM_UNKNOWN = 0; -public final static int IMAGE_SUBSYSTEM_NATIVE = 1; -public final static int IMAGE_SUBSYSTEM_WINDOWS_GUI = 2; -public final static int IMAGE_SUBSYSTEM_WINDOWS_CUI = 3; -public final static int IMAGE_SUBSYSTEM_POSIX_CUI = 7; -public final static int IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9; -public final static int IMAGE_SUBSYSTEM_EFI_APPLICATION = 10; -public final static int IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11; -public final static int IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12; - -/* DLL CHarcteristics, NTOptionalHeader.DLLCharcteristics */ -public final static int IMAGE_DLLCHARACTERISTICS_NO_BIND = 0x0800; // Do not bind image. -// Driver is a WDM Driver. -public final static int IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 0x2000; -// Image is Terminal Sever aware. -public final static int IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER = 0x2000; - -/* Array of Directories */ -public final static int IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16; - -/* The directory of exported symbols; mostly used for DLLs. - Described below. */ -public final static int IMAGE_DIRECTORY_ENTRY_EXPORT = 0; - -/* The directory of imported symbols; see below. */ -public final static int IMAGE_DIRECTORY_ENTRY_IMPORT = 1; - -/* Directory of resources. Described below. */ -public final static int IMAGE_DIRECTORY_ENTRY_RESOURCE = 2; - -/* Exception directory - structure and purpose unknown. */ -public final static int IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3; - -/* Security directory - structure and purpose unknown. */ -public final static int IMAGE_DIRECTORY_ENTRY_SECURITY = 4; - -/* Base relocation table - see below. */ -public final static int IMAGE_DIRECTORY_ENTRY_BASERELOC = 5; - -/* Debug directory - contents is compiler dependent. Moreover, many - compilers stuff the debug information into the code section and - don't create a separate section for it. */ -public final static int IMAGE_DIRECTORY_ENTRY_DEBUG = 6; - -/* Description string - some arbitrary copyright note or the like. */ -public final static int IMAGE_DIRECTORY_ENTRY_COPYRIGHT = 7; - -/* Machine Value (MIPS GP) - structure and purpose unknown. */ -public final static int IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8; - -/* Thread local storage directory - structure unknown; contains - variables that are declared "__declspec(thread)", i.e. - per-thread global variables. */ -public final static int IMAGE_DIRECTORY_ENTRY_TLS = 9; - -/* Load configuration directory - structure and purpose unknown. */ -public final static int IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10; - -/* Bound import directory - see description of import directory. */ -public final static int IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11; - -/* Import Address Table - see description of import directory. */ -public final static int IMAGE_DIRECTORY_ENTRY_IAT = 12; - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/ReadMemoryAccess.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/ReadMemoryAccess.java deleted file mode 100644 index 75318e38a66..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/ReadMemoryAccess.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.utils.coff; - -public class ReadMemoryAccess { - - byte[] bytes; - int memOffset; - byte[] val = new byte[8]; - boolean isle; - - public ReadMemoryAccess(byte[] octets) { - this(octets, true); - } - - public ReadMemoryAccess(byte[] octets, boolean le) { - bytes = octets; - memOffset = 0; - isle = le; - } - - public void getBytes(byte[] octets) { - getBytes(octets, memOffset); - memOffset += octets.length; - } - - public void getBytes(byte[] octets, int offset) { - getBytes(octets, offset, octets.length); - } - - public void getBytes(byte[] octets, int offset, int length) { - System.arraycopy(bytes, offset, octets, 0, length); - } - - public byte getByte() { - return getByte(memOffset++); - } - - public short getUnsignedByte() { - return getUnsignedByte(memOffset++); - } - - public byte getByte(int offset) { - return bytes[offset]; - } - - public short getUnsignedByte(int offset) { - return (short)bytes[offset]; - } - - public short getShort() { - if (isle) { - return getShortLE(); - } - return getShortBE(); - } - - public int getUnsignedShort() { - if (isle) { - return getUnsignedShortLE(); - } - return getUnsignedShortBE(); - } - - public short getShortLE() { - short s = getShortLE(memOffset); - memOffset +=2; - return s; - } - - public int getUnsignedShortLE() { - int i = getUnsignedShortLE(memOffset); - memOffset +=2; - return i; - } - - public short getShortLE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - return getShortLE(val); - } - - public static short getShortLE(byte[] b) { - return (short)(((b[1]&0xff) << 8) | (b[0]&0xff)); - } - - public int getUnsignedShortLE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - return getUnsignedShortLE(val); - } - - public static int getUnsignedShortLE(byte[] b) { - return (((b[1] & 0xff) << 8) | (b[0] & 0xff)); - } - - public short getShortBE() { - short s = getShortBE(memOffset); - memOffset +=2; - return s; - } - - public int getUnsignedShortBE() { - int i = getUnsignedShortBE(memOffset); - memOffset +=2; - return i; - } - - public short getShortBE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - return getShortBE(val); - } - - public static short getShortBE(byte[] b) { - return (short)(((b[0] & 0xff) << 8) | (b[1] & 0xff)); - } - - public int getUnsignedShortBE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - return getUnsignedShortBE(val); - } - - public static int getUnsignedShortBE(byte[] b) { - return (((b[0] & 0xff) << 8) + (b[1] & 0xff)); - } - - public int getInt() { - if (isle) { - return getIntLE(); - } - return getIntBE(); - } - - public int getIntLE() { - int i = getIntLE(memOffset); - memOffset += 4; - return i; - } - - public long getUnsignedIntLE() { - long l = getUnsignedIntLE(memOffset); - memOffset += 4; - return l; - } - - public long getUnsignedIntLE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - val[2] = getByte(offset + 2); - val[3] = getByte(offset + 3); - return getUnsignedIntLE(val); - } - - public static long getUnsignedIntLE(byte[] b) { - return (long)(((b[3] & 0xff) << 24) | - ((b[2] & 0xff) << 16) | - ((b[1] & 0xff) << 8) | - (b[0] & 0xff)); - } - - public int getIntLE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - val[2] = getByte(offset + 2); - val[3] = getByte(offset + 3); - return getIntLE(val); - } - - public static int getIntLE(byte[] b) { - return (int)(((b[3] & 0xff) << 24) | - ((b[2] & 0xff) << 16) | - ((b[1] & 0xff) << 8) | - (b[0] & 0xff)); - } - - public int getIntBE() { - int i = getIntBE(memOffset); - memOffset += 4; - return i; - } - - public long getUnsignedIntBE() { - long l = getUnsignedIntBE(memOffset); - memOffset += 4; - return l; - } - - public int getIntBE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - val[2] = getByte(offset + 2); - val[3] = getByte(offset + 3); - return getIntBE(val); - } - - public static int getIntBE(byte[] b) { - return (int)(((b[0] & 0xff) << 24) | - ((b[1] & 0xff) << 16) | - ((b[2] & 0xff) << 8) | - (b[3] & 0xff)); - } - - public long getUnsignedIntBE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - val[2] = getByte(offset + 2); - val[3] = getByte(offset + 3); - return getUnsignedIntBE(val); - } - - public static long getUnsignedIntBE(byte[] b) { - return (long)(((b[0] & 0xff) << 24) | - ((b[1] & 0xff) << 16) | - ((b[2] & 0xff) << 8) | - (b[3] & 0xff)); - } - - public long getLong() { - if (isle) { - return getLongLE(); - } - return getLongBE(); - } - - public long getLongLE() { - long l = getLongLE(memOffset); - memOffset += 8; - return l; - } - - public long getLongLE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - val[2] = getByte(offset + 2); - val[3] = getByte(offset + 3); - val[4] = getByte(offset + 4); - val[5] = getByte(offset + 5); - val[6] = getByte(offset + 6); - val[7] = getByte(offset + 7); - return getLongLE(val); - } - - public long getLongLE(byte[] b) { - return ((long)(b[7] & 0xff) << 56) | - ((long)(b[6] & 0xff) << 48) | - ((long)(b[5] & 0xff) << 40) | - ((long)(b[4] & 0xff) << 32) | - ((long)(b[3] & 0xff) << 24) | - ((long)(b[2] & 0xff) << 16) | - ((long)(b[1] & 0xff) << 8) | - ((long)(b[0] & 0xff)); - } - - - public long getLongBE() { - long l = getLongBE(memOffset); - memOffset += 8; - return l; - } - - public long getLongBE(int offset) { - val[0] = getByte(offset); - val[1] = getByte(offset + 1); - val[2] = getByte(offset + 2); - val[3] = getByte(offset + 3); - val[4] = getByte(offset + 4); - val[5] = getByte(offset + 5); - val[6] = getByte(offset + 6); - val[7] = getByte(offset + 7); - return getLongBE(val); - } - - public long getLongBE(byte[] b) { - return ((long)(b[0] & 0xff) << 56) | - ((long)(b[1] & 0xff) << 48) | - ((long)(b[2] & 0xff) << 40) | - ((long)(b[3] & 0xff) << 32) | - ((long)(b[4] & 0xff) << 24) | - ((long)(b[5] & 0xff) << 16) | - ((long)(b[6] & 0xff) << 8) | - ((long)(b[7] & 0xff)); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/ARMember.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/ARMember.java deleted file mode 100644 index 73ec760ad76..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/ARMember.java +++ /dev/null @@ -1,90 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.CygPath; -import org.eclipse.cdt.utils.ICygwinToolsProvider; -import org.eclipse.cdt.utils.coff.Coff; -import org.eclipse.cdt.utils.coff.PE; -import org.eclipse.cdt.utils.coff.PEArchive; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class ARMember extends BinaryObject { - PEArchive.ARHeader header; - - public ARMember(IPath p, PEArchive.ARHeader h, ICygwinToolsProvider provider) throws IOException { - super(p, h.getPE(), provider); - header = h; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getContents() - */ - public InputStream getContents() { - InputStream stream = null; - if (path != null && header != null) { - try { - stream = new ByteArrayInputStream(header.getObjectData()); - } catch (IOException e) { - } - } - if (stream == null) { - stream = super.getContents(); - } - return stream; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getName() - */ - public String getName() { - if (header != null) { - return header.getObjectName(); - } - return ""; - } - - protected PE getPE() throws IOException { - if (header != null) { - return header.getPE(); - } - throw new IOException("No file assiocated with Binary"); - } - - protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, Addr2line addr2line, CPPFilt cppfilt, CygPath cypath, List list) { - for (int i = 0; i < peSyms.length; i++) { - if (peSyms[i].isFunction() || peSyms[i].isPointer() ||peSyms[i].isArray()) { - String name = peSyms[i].getName(table); - if (name == null || name.trim().length() == 0 || - !Character.isJavaIdentifierStart(name.charAt(0))) { - continue; - } - Symbol sym = new Symbol(this); - sym.type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - - sym.name = name; - sym.addr = peSyms[i].n_value; - list.add(sym); - } - } - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java deleted file mode 100644 index d32d6e22dfb..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryArchive.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.eclipse.cdt.utils.coff.parser; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.util.ArrayList; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.utils.coff.PEArchive; -import org.eclipse.cdt.utils.coff.PE.Attribute; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryArchive extends BinaryFile implements IBinaryArchive { - - ArrayList children; - - public BinaryArchive(IPath p) throws IOException { - super(p); - new PEArchive(p.toOSString()).dispose(); // check file type - children = new ArrayList(5); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryArchive#getObjects() - */ - public IBinaryObject[] getObjects() { - if (hasChanged()) { - children.clear(); - PEArchive ar = null; - try { - ar = new PEArchive(getPath().toOSString()); - PEArchive.ARHeader[] headers = ar.getHeaders(); - for (int i = 0; i < headers.length; i++) { - IBinaryObject bin = new ARMember(path, headers[i], toolsProvider); - children.add(bin); - } - } catch (IOException e) { - //e.printStackTrace(); - } - if (ar != null) { - ar.dispose(); - } - children.trimToSize(); - } - return (IBinaryObject[])children.toArray(new IBinaryObject[0]); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getFile() - */ - public IPath getPath() { - return path; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return IBinaryFile.ARCHIVE; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryArchive#add(IBinaryObject[]) - */ - public void add(IBinaryObject[] objs) throws IOException { - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryArchive#delete(IBinaryObject[]) - */ - public void delete(IBinaryObject[] objs) throws IOException { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.utils.coff.parser.BinaryFile#getAttribute() - */ - protected Attribute getAttribute() { - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryExecutable.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryExecutable.java deleted file mode 100644 index 1b358bd8285..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryExecutable.java +++ /dev/null @@ -1,41 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryExecutable extends BinaryObject implements IBinaryExecutable { - - public BinaryExecutable(IPath path) throws IOException { - super(path); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryExecutable#getNeededSharedLibs() - */ - public String[] getNeededSharedLibs() { - return new String[0]; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return IBinaryFile.EXECUTABLE; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryFile.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryFile.java deleted file mode 100644 index a5056540278..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryFile.java +++ /dev/null @@ -1,103 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.CygPath; -import org.eclipse.cdt.utils.ICygwinToolsProvider; -import org.eclipse.cdt.utils.coff.PE.Attribute; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.PlatformObject; - -/** - * - */ -public abstract class BinaryFile extends PlatformObject implements IBinaryFile { - - protected IPath path; - protected ICygwinToolsProvider toolsProvider; - protected long timestamp; - - public BinaryFile(IPath p) { - path = p; - } - - public void setToolsProvider(ICygwinToolsProvider p) { - toolsProvider = p; - } - - public Addr2line getAddr2Line() { - if (toolsProvider != null) - return toolsProvider.getAddr2Line(path); - return null; - } - - public CPPFilt getCPPFilt() { - if (toolsProvider != null) - return toolsProvider.getCPPFilt(); - return null; - } - - public CygPath getCygPath() { - if (toolsProvider != null) - return toolsProvider.getCygPath(); - return null; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getFile() - */ - public IPath getPath() { - return path; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public abstract int getType(); - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getContents() - */ - public InputStream getContents() { - InputStream stream = null; - if (path != null) { - try { - stream = new FileInputStream(path.toFile()); - } catch (IOException e) { - } - } - if (stream == null) { - stream = new ByteArrayInputStream(new byte[0]); - } - return stream; - } - - /** - * @return - */ - protected abstract Attribute getAttribute(); - - protected boolean hasChanged() { - long modification = getPath().toFile().lastModified(); - boolean changed = modification != timestamp; - timestamp = modification; - return changed; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java deleted file mode 100644 index c522a9aed5d..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java +++ /dev/null @@ -1,285 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.CygPath; -import org.eclipse.cdt.utils.ICygwinToolsProvider; -import org.eclipse.cdt.utils.coff.Coff; -import org.eclipse.cdt.utils.coff.PE; -import org.eclipse.cdt.utils.coff.PE.Attribute; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - */ -public class BinaryObject extends BinaryFile implements IBinaryObject { - - PE.Attribute attribute; - ISymbol[] symbols; - int type = IBinaryFile.OBJECT; - private ISymbol[] NO_SYMBOLS = new ISymbol[0]; - - public BinaryObject(IPath p) throws IOException { - super(p); - } - - public BinaryObject(IPath p, PE pe, ICygwinToolsProvider provider) throws IOException { - super(p); - setToolsProvider(provider); - loadInformation(pe); - pe.dispose(); - hasChanged(); - } - - public void setType(int t) { - type = t; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.IBinaryObject#getSymbol(long) - */ - public ISymbol getSymbol(long addr) { - ISymbol[] syms = getSymbols(); - int insertion = Arrays.binarySearch(syms, new Long(addr)); - if (insertion >= 0) { - return syms[insertion]; - } - if (insertion == -1) { - return null; - } - insertion = -insertion - 1; - ISymbol symbol = syms[insertion - 1]; - if (addr < (symbol.getAddress() + symbol.getSize())) { - return syms[insertion - 1]; - } - return null; - - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return type; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getBSS() - */ - public long getBSS() { - return 0; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getCPU() - */ - public String getCPU() { - Attribute attr = getAttribute(); - if (attr != null) { - return attribute.getCPU(); - } - return ""; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getData() - */ - public long getData() { - return 0; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getName() - */ - public String getName() { - return getPath().lastSegment().toString(); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getSymbols() - */ - public ISymbol[] getSymbols() { - if (hasChanged() || symbols == null) { - try { - loadInformation(); - } catch (IOException e) { - } - if (symbols == null) { - symbols = NO_SYMBOLS; - } - } - return symbols; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getText() - */ - public long getText() { - return 0; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#hasDebug() - */ - public boolean hasDebug() { - Attribute attr = getAttribute(); - if (attr != null) { - return attr.hasDebug(); - } - return false; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#isLittleEndian() - */ - public boolean isLittleEndian() { - Attribute attr = getAttribute(); - if (attr != null) { - return attr.isLittleEndian(); - } - return false; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryExecutable#getNeededSharedLibs() - */ - public String[] getNeededSharedLibs() { - return new String[0]; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryShared#getSoName() - */ - public String getSoName() { - return ""; - } - - protected PE getPE() throws IOException { - return new PE(getPath().toOSString()); - } - - protected PE.Attribute getAttribute() { - if (hasChanged()) { - PE pe = null; - try { - pe = getPE(); - loadAttributes(pe); - } catch (IOException e) { - } finally { - if (pe != null) { - try { - pe.dispose(); - } catch (IOException e1) { - } - } - } - } - return attribute; - } - - protected void loadInformation() throws IOException { - PE pe = getPE(); - loadInformation(pe); - pe.dispose(); - } - - private void loadInformation(PE pe) throws IOException { - loadAttributes(pe); - loadSymbols(pe); - } - - private void loadAttributes(PE pe) throws IOException { - attribute = pe.getAttribute(); - } - - private void loadSymbols(PE pe) throws IOException { - ArrayList list = new ArrayList(); - Addr2line addr2line = getAddr2Line(); - CPPFilt cppfilt = getCPPFilt(); - CygPath cygpath = getCygPath(); - - Coff.Symbol[] peSyms = pe.getSymbols(); - byte[] table = pe.getStringTable(); - addSymbols(peSyms, table, addr2line, cppfilt, cygpath, list); - - if (addr2line != null) { - addr2line.dispose(); - } - if (cppfilt != null) { - cppfilt.dispose(); - } - if (cygpath != null) { - cygpath.dispose(); - } - - symbols = (ISymbol[])list.toArray(NO_SYMBOLS); - Arrays.sort(symbols); - list.clear(); - } - - protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, Addr2line addr2line, CPPFilt cppfilt, CygPath cygpath, List list) { - for (int i = 0; i < peSyms.length; i++) { - if (peSyms[i].isFunction() || peSyms[i].isPointer() ||peSyms[i].isArray()) { - String name = peSyms[i].getName(table); - if (name == null || name.trim().length() == 0 || - !Character.isJavaIdentifierStart(name.charAt(0))) { - continue; - } - Symbol sym = new Symbol(this); - sym.type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - sym.addr = peSyms[i].n_value; - - sym.name = name; - if (cppfilt != null) { - try { - sym.name = cppfilt.getFunction(sym.name); - } catch (IOException e1) { - } - } - - sym.filename = null; - sym.startLine = 0; - sym.endLine = 0; - if (addr2line != null) { - try { - String filename = addr2line.getFileName(sym.addr); - // Addr2line returns the funny "??" when it can not find the file. - if (filename != null && filename.equals("??")) { - filename = null; - } - - if (filename != null) { - if (cygpath != null) { - sym.filename = new Path(cygpath.getFileName(filename)); - } else { - sym.filename = new Path(filename); - } - } - sym.startLine = addr2line.getLineNumber(sym.addr); - } catch (IOException e) { - } - } - list.add(sym); - } - } - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryShared.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryShared.java deleted file mode 100644 index 7a9cd629b57..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/BinaryShared.java +++ /dev/null @@ -1,51 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryShared; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryShared extends BinaryExecutable implements IBinaryShared { - String soname; - - public BinaryShared(IPath path) throws IOException { - super(path); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryShared#getSoName() - */ - public String getSoName() { - if (hasChanged()) { - try { - loadInformation(); - } catch (IOException e) { - } - } - if (soname != null) { - return soname; - } - return ""; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return IBinaryFile.SHARED; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEParser.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEParser.java deleted file mode 100644 index 6fdb6e873cf..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEParser.java +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.CygPath; -import org.eclipse.cdt.utils.ICygwinToolsProvider; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - */ -public class CygwinPEParser extends PEParser implements IBinaryParser, ICygwinToolsProvider { - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IPath) - */ - public IBinaryFile getBinary(IPath path) throws IOException { - IBinaryFile binary = super.getBinary(path); - if (binary instanceof BinaryFile) { - ((BinaryFile)binary).setToolsProvider(this); - } - return binary; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() - */ - public String getFormat() { - return "Cygwin PE"; - } - - public IPath getAddr2LinePath() { - ICExtensionReference ref = getExtensionReference(); - String value = ref.getExtensionData("addr2line"); //$NON-NLS-1 - if (value == null || value.length() == 0) { - value = "addr2line"; //$NON-NLS-1 - } - return new Path(value); - } - - public IPath getCPPFiltPath() { - ICExtensionReference ref = getExtensionReference(); - String value = ref.getExtensionData("c++filt"); //$NON-NLS-1 - if (value == null || value.length() == 0) { - value = "c++filt"; //$NON-NLS-1 - } - return new Path(value); - } - - public IPath getCygPathPath() { - ICExtensionReference ref = getExtensionReference(); - String value = ref.getExtensionData("cygpath"); //$NON-NLS-1 - if (value == null || value.length() == 0) { - value = "cygpath"; //$NON-NLS-1 - } - return new Path(value); - } - - public Addr2line getAddr2Line(IPath execFile) { - IPath addr2LinePath = getAddr2LinePath(); - Addr2line addr2line = null; - if (addr2LinePath != null && !addr2LinePath.isEmpty()) { - try { - addr2line = new Addr2line(addr2LinePath.toOSString(), execFile.toOSString()); - } catch (IOException e1) { - } - } - return addr2line; - } - - public CPPFilt getCPPFilt() { - IPath cppFiltPath = getCPPFiltPath(); - CPPFilt cppfilt = null; - if (cppFiltPath != null && ! cppFiltPath.isEmpty()) { - try { - cppfilt = new CPPFilt(cppFiltPath.toOSString()); - } catch (IOException e2) { - } - } - return cppfilt; - } - - public CygPath getCygPath() { - IPath cygPathPath = getCygPathPath(); - CygPath cygpath = null; - if (cygPathPath != null && !cygPathPath.isEmpty()) { - try { - cygpath = new CygPath(cygPathPath.toOSString()); - } catch (IOException e1) { - } - } - return cygpath; - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEParser.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEParser.java deleted file mode 100644 index 884265c56ee..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/PEParser.java +++ /dev/null @@ -1,108 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.utils.coff.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.AbstractCExtension; -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.utils.coff.PE; -import org.eclipse.cdt.utils.coff.PEArchive; -import org.eclipse.cdt.utils.coff.PEConstants; -import org.eclipse.cdt.utils.coff.PE.Attribute; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class PEParser extends AbstractCExtension implements IBinaryParser { - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IFile) - */ - public IBinaryFile getBinary(IPath path) throws IOException { - if (path == null) { - throw new IOException("path is null"); - } - - BinaryFile binary = null; - try { - PE.Attribute attribute = PE.getAttributes(path.toOSString()); - if (attribute != null) { - switch (attribute.getType()) { - case Attribute.PE_TYPE_EXE : - binary = new BinaryExecutable(path); - break; - - case Attribute.PE_TYPE_SHLIB : - binary = new BinaryShared(path); - break; - - case Attribute.PE_TYPE_OBJ : - binary = new BinaryObject(path); - break; - - case Attribute.PE_TYPE_CORE : - BinaryObject obj = new BinaryObject(path); - obj.setType(IBinaryFile.CORE); - binary = obj; - break; - } - } - } catch (IOException e) { - // Is it an Archive? - binary = new BinaryArchive(path); - } - - return binary; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() - */ - public String getFormat() { - return "PE"; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser#isBinary(byte[], org.eclipse.core.runtime.IPath) - */ - public boolean isBinary(byte[] array, IPath path) { - boolean isBin = PE.isExeHeader(array) || PEArchive.isARHeader(array); - // It maybe an object file try the known machine types. - if (!isBin && array.length > 1) { - int f_magic = (((array[1] & 0xff) << 8) | (array[0] & 0xff)); - switch (f_magic) { - case PEConstants.IMAGE_FILE_MACHINE_ALPHA: - case PEConstants.IMAGE_FILE_MACHINE_ARM: - case PEConstants.IMAGE_FILE_MACHINE_ALPHA64: - case PEConstants.IMAGE_FILE_MACHINE_I386: - case PEConstants.IMAGE_FILE_MACHINE_IA64: - case PEConstants.IMAGE_FILE_MACHINE_M68K: - case PEConstants.IMAGE_FILE_MACHINE_MIPS16: - case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU: - case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU16: - case PEConstants.IMAGE_FILE_MACHINE_POWERPC: - case PEConstants.IMAGE_FILE_MACHINE_R3000: - case PEConstants.IMAGE_FILE_MACHINE_R4000: - case PEConstants.IMAGE_FILE_MACHINE_R10000: - case PEConstants.IMAGE_FILE_MACHINE_SH3: - case PEConstants.IMAGE_FILE_MACHINE_SH4: - case PEConstants.IMAGE_FILE_MACHINE_THUMB: - // Ok; - isBin = true; - break; - } - } - return isBin; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/Symbol.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/Symbol.java deleted file mode 100644 index 228e1ae360c..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/Symbol.java +++ /dev/null @@ -1,152 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.coff.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.core.runtime.IPath; - -public class Symbol implements ISymbol { - - BinaryObject binary; - Addr2line addr2line; - long timestamp; - - public IPath filename; - public int startLine; - public int endLine; - public long addr; - public long size; - public String name; - public int type; - - public Symbol(BinaryObject bin) { - binary = bin; - } - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.ISymbol#getFilename() - */ - public IPath getFilename() { - return filename; - } - - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.ISymbol#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.ISymbol#getType() - */ - public int getType() { - return type; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getAdress() - */ - public long getAddress() { - return addr; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getEndLine() - */ - public int getEndLine() { - return endLine; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getStartLine() - */ - public int getStartLine() { - return startLine; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getLineNumber(long) - */ - public int getLineNumber(long offset) { - int line = -1; - try { - Addr2line addressToLine = startAddr2Line(); - if (addressToLine != null) { - line = addressToLine.getLineNumber(addr + offset); - } - } catch (IOException e) { - } - return line; - } - - /* (non-Javadoc) - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - public int compareTo(Object obj) { - long thisVal = 0; - long anotherVal = 0; - if (obj instanceof Symbol) { - Symbol sym = (Symbol) obj; - thisVal = this.addr; - anotherVal = sym.addr; - } else if (obj instanceof Long) { - Long val = (Long) obj; - anotherVal = val.longValue(); - thisVal = (long) this.addr; - } - return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getSize() - */ - public long getSize() { - return size; - } - - synchronized Addr2line startAddr2Line () { - if (addr2line == null) { - addr2line = binary.getAddr2Line(); - if (addr2line != null) { - timestamp = System.currentTimeMillis(); - Runnable worker = new Runnable () { - public void run() { - long diff = System.currentTimeMillis() - timestamp; - while (diff < 10000) { - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - break; - } - diff = System.currentTimeMillis() - timestamp; - } - stopAddr2Line(); - } - }; - new Thread(worker, "Addr2line Reaper").start(); - } - } else { - timestamp = System.currentTimeMillis(); - } - return addr2line; - } - - synchronized void stopAddr2Line() { - if (addr2line != null) { - addr2line.dispose(); - } - addr2line = null; - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java deleted file mode 100644 index fcb9e7d6e9d..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java +++ /dev/null @@ -1,334 +0,0 @@ -package org.eclipse.cdt.utils.elf; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.Vector; - -/** - * The AR class is used for parsing standard ELF archive (ar) files. - * - * Each object within the archive is represented by an ARHeader class. Each of - * of these objects can then be turned into an Elf object for performing Elf - * class operations. - * @see ARHeader - */ -public class AR { - - protected String filename; - protected ERandomAccessFile efile; - protected long strtbl_pos = -1; - private ARHeader[] headers; - - public void dispose() { - try { - if (efile != null) { - efile.close(); - efile = null; - } - } catch (IOException e) { - } - } - - protected void finalize() throws Throwable { - try { - dispose(); - } finally { - super.finalize(); - } - } - - /** - * The ARHeader class is used to store the per-object file - * archive headers. It can also create an Elf object for inspecting - * the object file data. - */ - public class ARHeader { - - private String object_name; - private String modification_time; - private String uid; - private String gid; - private String mode; - private long size; - private long elf_offset; - - /** - * Remove the padding from the archive header strings. - */ - private String removeBlanks(String str) { - while (str.charAt(str.length() - 1) == ' ') - str = str.substring(0, str.length() - 1); - return str; - } - - /** - * Look up the name stored in the archive's string table based - * on the offset given. - * - * Maintains efile file location. - * - * @param offset - * Offset into the string table for first character of the name. - * @throws IOException - * offset not in string table bounds. - */ - private String nameFromStringTable(long offset) throws IOException { - StringBuffer name = new StringBuffer(0); - long pos = efile.getFilePointer(); - - try { - if (strtbl_pos != -1) { - byte temp; - efile.seek(strtbl_pos + offset); - while ((temp = efile.readByte()) != '\n') - name.append((char) temp); - } - } finally { - efile.seek(pos); - } - - return name.toString(); - } - - /** - * Creates a new archive header object. - * - * Assumes that efile is already at the correct location in the file. - * - * @throws IOException - * There was an error processing the header data from the file. - */ - public ARHeader() throws IOException { - byte[] object_name = new byte[16]; - byte[] modification_time = new byte[12]; - byte[] uid = new byte[6]; - byte[] gid = new byte[6]; - byte[] mode = new byte[8]; - byte[] size = new byte[10]; - byte[] trailer = new byte[2]; - - // - // Read in the archive header data. Fixed sizes. - // - efile.read(object_name); - efile.read(modification_time); - efile.read(uid); - efile.read(gid); - efile.read(mode); - efile.read(size); - efile.read(trailer); - - // - // Save this location so we can create the Elf object later. - // - elf_offset = efile.getFilePointer(); - - // - // Convert the raw bytes into strings and numbers. - // - this.object_name = removeBlanks(new String(object_name)); - this.modification_time = new String(modification_time); - this.uid = new String(uid); - this.gid = new String(gid); - this.mode = new String(mode); - this.size = Long.parseLong(removeBlanks(new String(size))); - - // - // If the name is of the format "/", get name from the - // string table. - // - if (strtbl_pos != -1 && this.object_name.length() > 1 && this.object_name.charAt(0) == '/') { - try { - long offset = Long.parseLong(this.object_name.substring(1)); - this.object_name = nameFromStringTable(offset); - } catch (java.lang.Exception e) { - } - } - - // - // Strip the trailing / from the object name. - // - int len = this.object_name.length(); - if (len > 2 && this.object_name.charAt(len - 1) == '/') { - this.object_name = this.object_name.substring(0, len - 1); - } - - } - - /** Get the name of the object file */ - public String getObjectName() { - return object_name; - } - - /** Get the size of the object file . */ - public long getSize() { - return size; - } - - public String getArchiveName() { - return filename; - } - - /** - * Create an new Elf object for the object file. - * - * @throws IOException - * Not a valid Elf object file. - * @return A new Elf object. - * @see Elf#Elf( String, long ) - */ - public Elf getElf() throws IOException { - return new Elf(filename, elf_offset); - } - - public Elf getElf(boolean filter_on) throws IOException { - return new Elf(filename, elf_offset, filter_on); - } - - public byte[] getObjectData() throws IOException { - byte[] temp = new byte[(int) size]; - if (efile != null) { - efile.seek(elf_offset); - efile.read(temp); - } else { - efile = new ERandomAccessFile(filename, "r"); - efile.seek(elf_offset); - efile.read(temp); - efile.close(); - efile = null; - } - return temp; - } - } - - public static boolean isARHeader(byte[] ident) { - if (ident.length < 7 - || ident[0] != '!' - || ident[1] != '<' - || ident[2] != 'a' - || ident[3] != 'r' - || ident[4] != 'c' - || ident[5] != 'h' - || ident[6] != '>') - return false; - return true; - } - - /** - * Creates a new AR object from the contents of - * the given file. - * - * @param filename The file to process. - * @throws IOException The file is not a valid archive. - */ - public AR(String filename) throws IOException { - this.filename = filename; - efile = new ERandomAccessFile(filename, "r"); - String hdr = efile.readLine(); - if (hdr == null || hdr.compareTo("!") != 0) { - efile.close(); - throw new IOException("Not a valid archive file."); - } - } - - /** Load the headers from the file (if required). */ - private void loadHeaders() throws IOException { - if (headers != null) - return; - - Vector v = new Vector(); - try { - // - // Check for EOF condition - // - while (efile.getFilePointer() < efile.length()) { - ARHeader header = new ARHeader(); - String name = header.getObjectName(); - - long pos = efile.getFilePointer(); - - // - // If the name starts with a / it is specical. - // - if (name.charAt(0) != '/') - v.add(header); - - // - // If the name is "//" then this is the string table section. - // - if (name.compareTo("//") == 0) - strtbl_pos = pos; - - // - // Compute the location of the next header in the archive. - // - pos += header.getSize(); - if ((pos % 2) != 0) - pos++; - - efile.seek(pos); - } - } catch (IOException e) { - } - headers = (ARHeader[]) v.toArray(new ARHeader[0]); - } - - /** - * Get an array of all the object file headers for this archive. - * - * @throws IOException - * Unable to process the archive file. - * @return An array of headers, one for each object within the archive. - * @see ARHeader - */ - public ARHeader[] getHeaders() throws IOException { - loadHeaders(); - return headers; - } - - private boolean stringInStrings(String str, String[] set) { - for (int i = 0; i < set.length; i++) - if (str.compareTo(set[i]) == 0) - return true; - return false; - } - - public String[] extractFiles(String outdir, String[] names) throws IOException { - Vector names_used = new Vector(); - String object_name; - int count; - - loadHeaders(); - - count = 0; - for (int i = 0; i < headers.length; i++) { - object_name = headers[i].getObjectName(); - if (names != null && !stringInStrings(object_name, names)) - continue; - - object_name = "" + count + "_" + object_name; - count++; - - byte[] data = headers[i].getObjectData(); - File output = new File(outdir, object_name); - names_used.add(object_name); - - RandomAccessFile rfile = new RandomAccessFile(output, "rw"); - rfile.write(data); - rfile.close(); - } - - return (String[]) names_used.toArray(new String[0]); - } - - public String[] extractFiles(String outdir) throws IOException { - return extractFiles(outdir, null); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ERandomAccessFile.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ERandomAccessFile.java deleted file mode 100644 index d51fa582459..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ERandomAccessFile.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.cdt.utils.elf; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.EOFException; -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; - -public class ERandomAccessFile extends RandomAccessFile { - private boolean isle; - private long ptr_offset; - int val[] = new int[4]; - - public ERandomAccessFile(String file, String mode) throws IOException { - super(file, mode); - } - - public ERandomAccessFile(File file, String mode) throws IOException { - super(file, mode); - } - - public void setEndian(boolean le) - { - isle = le; - } - - public final short readShortE() throws IOException { - val[0] = read(); - val[1] = read(); - if ((val[0] | val[1]) < 0) - throw new EOFException(); - if ( isle ) { - return (short)((val[1] << 8) + val[0]); - } else { - return (short)((val[0] << 8) + val[1]); - } - } - - public final long readIntE() throws IOException - { - val[0] = read(); - val[1] = read(); - val[2] = read(); - val[3] = read(); - if ((val[0] | val[1] | val[2] | val[3]) < 0) - throw new EOFException(); - if ( isle ) { - return ((val[3] << 24) + (val[2] << 16) + (val[1] << 8) + val[0]); - } else { - return ((val[0] << 24) + (val[1] << 16) + (val[2] << 8) + val[3]); - } - } - - public void setFileOffset( long offset ) throws IOException { - ptr_offset = offset; - super.seek( offset ); - } - - public long getFilePointer() throws IOException { - long ptr = super.getFilePointer(); - ptr = ptr - ptr_offset; - return ptr; - } - - public void seek( long pos ) throws IOException { - long real_pos = pos + ptr_offset; - super.seek( real_pos ); - } -} - - diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java deleted file mode 100644 index 45fbaabd1e8..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java +++ /dev/null @@ -1,921 +0,0 @@ -package org.eclipse.cdt.utils.elf; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; - -import java.util.Comparator; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; - -// test checkin -public class Elf { - protected ERandomAccessFile efile; - - protected ELFhdr ehdr; - protected Section[] sections; - protected Addr2line addr2line; - protected boolean cppFiltEnabled = true; - protected CPPFilt cppFilt; - protected String file; - protected byte[] section_strtab; - - private int syms = 0; - private Symbol[] symbols; - private Symbol[] symtab_symbols; - private Section symtab_sym; - private Symbol[] dynsym_symbols; - private Section dynsym_sym; - - protected String EMPTY_STRING = ""; - - - public class ELFhdr { - /* e_ident offsets */ - public final static int EI_MAG0 = 0; - public final static int EI_MAG1 = 1; - public final static int EI_MAG2 = 2; - public final static int EI_MAG3 = 3; - public final static int EI_CLASS = 4; - public final static int EI_DATA = 5; - public final static int EI_VERSION = 6; - public final static int EI_PAD = 7; - public final static int EI_NDENT = 16; - - /* e_ident[EI_CLASS] */ - public final static int ELFCLASSNONE = 0; - public final static int ELCLASS32 = 1; - public final static int ELFCLASS64 = 2; - - /* e_ident[EI_DATA] */ - public final static int ELFDATANONE = 0; - public final static int ELFDATA2LSB = 1; - public final static int ELFDATA2MSB = 2; - - /* values of e_type */ - public final static int ET_NONE = 0; - public final static int ET_REL = 1; - public final static int ET_EXEC = 2; - public final static int ET_DYN = 3; - public final static int ET_CORE = 4; - public final static int ET_LOPROC = 0xff00; - public final static int ET_HIPROC = 0xffff; - - /* values of e_machine */ - public final static int EM_NONE = 0; - public final static int EM_M32 = 1; - public final static int EM_SPARC = 2; - public final static int EM_386 = 3; - public final static int EM_68K = 4; - public final static int EM_88K = 5; - public final static int EM_486 = 6; - public final static int EM_860 = 7; - public final static int EM_MIPS = 8; - public final static int EM_MIPS_RS3_LE = 10; - public final static int EM_RS6000 = 11; - public final static int EM_PA_RSIC = 15; - public final static int EM_nCUBE = 16; - public final static int EM_VPP500 = 17; - public final static int EM_SPARC32PLUS = 18; - public final static int EM_PPC = 20; - public final static int EM_ARM = 40; - public final static int EM_SH = 42; - - public byte e_ident[] = new byte[EI_NDENT]; - public short e_type; /* file type (Elf32_Half) */ - public short e_machine; /* machine type (Elf32_Half) */ - public long e_version; /* version number (Elf32_Word) */ - public long e_entry; /* entry point (Elf32_Addr)*/ - public long e_phoff; /* Program hdr offset (Elf32_Off)*/ - public long e_shoff; /* Section hdr offset (Elf32_Off)*/ - public long e_flags; /* Processor flags (Elf32_Word)*/ - public short e_ehsize; /* sizeof ehdr (Elf32_Half)*/ - public short e_phentsize; /* Program header entry size (Elf32_Half)*/ - public short e_phnum; /* Number of program headers (Elf32_Half)*/ - public short e_shentsize; /* Section header entry size (Elf32_Half)*/ - public short e_shnum; /* Number of section headers (Elf32_Half)*/ - public short e_shstrndx; /* String table index (Elf32_Half)*/ - - protected ELFhdr() throws IOException { - efile.seek(0); - efile.readFully(e_ident); - if ( e_ident[ELFhdr.EI_MAG0] != 0x7f || e_ident[ELFhdr.EI_MAG1] != 'E' || - e_ident[ELFhdr.EI_MAG2] != 'L' || e_ident[ELFhdr.EI_MAG3] != 'F' ) - throw new IOException("Not ELF format"); - efile.setEndian(e_ident[ELFhdr.EI_DATA] == ELFhdr.ELFDATA2LSB); - e_type = efile.readShortE(); - e_machine = efile.readShortE(); - e_version = efile.readIntE(); - e_entry = efile.readIntE(); - e_phoff = efile.readIntE(); - e_shoff = efile.readIntE(); - e_flags = efile.readIntE(); - e_ehsize = efile.readShortE(); - e_phentsize = efile.readShortE(); - e_phnum = efile.readShortE(); - e_shentsize = efile.readShortE(); - e_shnum = efile.readShortE(); - e_shstrndx = efile.readShortE(); - } - } - - public class Section { - /* sh_type */ - public final static int SHT_NULL = 0; - public final static int SHT_PROGBITS = 1; - public final static int SHT_SYMTAB = 2; - public final static int SHT_STRTAB = 3; - public final static int SHT_RELA = 4; - public final static int SHT_HASH = 5; - public final static int SHT_DYNAMIC = 6; - public final static int SHT_NOTE = 7; - public final static int SHT_NOBITS = 8; - public final static int SHT_REL = 9; - public final static int SHT_SHLIB = 10; - public final static int SHT_DYNSYM = 11; - - public final static int SHT_LOPROC = 0x70000000; - - /* sh_flags */ - public final static int SHF_WRITE = 1; - public final static int SHF_ALLOC = 2; - public final static int SHF_EXECINTR = 4; - - public long sh_name; - public long sh_type; - public long sh_flags; - public long sh_addr; - public long sh_offset; - public long sh_size; - public long sh_link; - public long sh_info; - public long sh_addralign; - public long sh_entsize; - - public byte[] loadSectionData() throws IOException { - byte[] data = new byte[(int)sh_size]; - efile.seek( sh_offset ); - efile.read( data ); - return data; - } - - public String toString() { - try { - if ( section_strtab == null ) { - if ( ehdr.e_shstrndx > sections.length || ehdr.e_shstrndx < 0) - return EMPTY_STRING; - int size = (int)sections[ehdr.e_shstrndx].sh_size; - if ( size <= 0 || size > efile.length() ) - return EMPTY_STRING; - section_strtab = new byte[size]; - efile.seek(sections[ehdr.e_shstrndx].sh_offset); - efile.read(section_strtab); - } - int str_size = 0; - if ( sh_name > section_strtab.length) { - return EMPTY_STRING; - } - while( section_strtab[(int)sh_name + str_size] != 0) - str_size++; - return new String(section_strtab, (int)sh_name, str_size); - } catch (IOException e) { - return EMPTY_STRING; - } - } - } - - protected String string_from_elf_section(Elf.Section section, int index) throws IOException { - StringBuffer str = new StringBuffer(); - byte tmp; - if ( index > section.sh_size ) { - return EMPTY_STRING; - } - efile.seek(section.sh_offset + index); - while( true ) { - tmp = efile.readByte(); - if ( tmp == 0 ) - break; - str.append((char)tmp); - } - return str.toString(); - } - - public class Symbol implements Comparable { - /* Symbol bindings */ - public final static int STB_LOCAL = 0; - public final static int STB_GLOBAL = 1; - public final static int STB_WEAK = 2; - /* Symbol type */ - public final static int STT_NOTYPE = 0; - public final static int STT_OBJECT = 1; - public final static int STT_FUNC = 2; - public final static int STT_SECTION = 3; - public final static int STT_FILE = 4; - /* Special Indexes */ - public final static int SHN_UNDEF = 0; - public final static int SHN_LORESERVE = 0xffffff00; - public final static int SHN_LOPROC = 0xffffff00; - public final static int SHN_HIPROC = 0xffffff1f; - public final static int SHN_LOOS = 0xffffff20; - public final static int SHN_HIOS = 0xffffff3f; - public final static int SHN_ABS = 0xfffffff1; - public final static int SHN_COMMON = 0xfffffff2; - public final static int SHN_XINDEX = 0xffffffff; - public final static int SHN_HIRESERVE = 0xffffffff; - - - public long st_name; - public long st_value; - public long st_size; - public short st_info; - public short st_other; - public short st_shndx; - - private String name = null; - private String line = null; - private String func = null; - - private Section sym_section; - - private String cppFilt(String in) { - if (cppFiltEnabled) { - try { - if (in.indexOf("__") != -1 || in.indexOf("_._") != -1) { - if (cppFilt == null) { - cppFilt = new CPPFilt(); - } - return cppFilt.getFunction(in); - } - } catch (IOException e) { - return in; - } - } - return in; - } - - public Symbol( Section section ) { - sym_section = section; - } - - public int st_type() { - return st_info & 0xf; - } - - public int st_bind() { - return (st_info >> 4) & 0xf; - } - - public int compareTo(Object obj) { - long thisVal = 0; - long anotherVal = 0; - if ( obj instanceof Symbol ) { - Symbol sym = (Symbol)obj; - thisVal = this.st_value; - anotherVal = sym.st_value; - } else if ( obj instanceof Long ) { - Long val = (Long)obj; - anotherVal = val.longValue(); - thisVal = (long)this.st_value; - } - return (thisVal - - index2 = line.indexOf(':'); - if ( index1 == index2 ) { - index2 = 0; - } else { - index2--; - } - return line.substring(index2, index1); - } - - /** - * Returns the line number of the function which is closest - * associated with the address if it is available. - * from the symbol information. If it is not available, - * then -1 is returned. - */ - public int getFuncLineNumber() throws IOException { - if ( line == null ) { - lineInfo(); - } - int index; - if(line == null || (index = line.lastIndexOf(':')) == -1) { - return -1; - } - try { - int lineno = Integer.parseInt(line.substring(index + 1)); - return (lineno == 0) ? -1 : lineno; - } catch(Exception e) { - return -1; - } - } - - /** - * Returns the line number of the file if it is available - * from the symbol information. If it is not available, - * then -1 is returned. - */ - public int getLineNumber(long vma) throws IOException { - int index; - String ligne = lineInfo(vma); - if(ligne == null || (index = ligne.lastIndexOf(':')) == -1) { - return -1; - } - try { - int lineno = Integer.parseInt(ligne.substring(index + 1)); - return (lineno == 0) ? -1 : lineno; - } catch(Exception e) { - return -1; - } - } - } - - /** - * We have to implement a separate compararator since when we do the - * binary search down below we are using a Long and a Symbol object - * and the Long doesn't know how to compare against a Symbol so if - * we compare Symbol vs Long it is ok, but not if we do Long vs Symbol. - */ - class SymbolComparator implements Comparator { - long val1, val2; - public int compare(Object o1, Object o2) { - - if(o1 instanceof Long) { - val1 = ((Long)o1).longValue(); - } else if(o1 instanceof Symbol) { - val1 = ((Symbol)o1).st_value; - } else { - return -1; - } - - if(o2 instanceof Long) { - val2 = ((Long)o2).longValue(); - } else if(o2 instanceof Symbol) { - val2 = ((Symbol)o2).st_value; - } else { - return -1; - } - return (val1 == val2) ? 0 - : ((val1 < val2) ? -1 : 1); - } - } - - - public class PHdr { - public final static int PT_NULL = 0; - public final static int PT_LOAD = 1; - public final static int PT_DYNAMIC = 2; - public final static int PT_INTERP = 3; - public final static int PT_NOTE = 4; - public final static int PT_SHLIB = 5; - public final static int PT_PHDR = 6; - - public final static int PF_X = 1; - public final static int PF_W = 2; - public final static int PF_R = 4; - - public long p_type; - public long p_offset; - public long p_vaddr; - public long p_paddr; - public long p_filesz; - public long p_memsz; - public long p_flags; - public long p_align; - } - - public PHdr[] getPHdrs() throws IOException { - if ( ehdr.e_phnum == 0 ) { - return new PHdr[0]; - } - efile.seek(ehdr.e_phoff); - PHdr phdrs[] = new PHdr[ehdr.e_phnum]; - for( int i = 0; i < ehdr.e_phnum; i++ ) { - phdrs[i] = new PHdr(); - phdrs[i].p_type = efile.readIntE(); - phdrs[i].p_offset = efile.readIntE(); - phdrs[i].p_vaddr = efile.readIntE(); - phdrs[i].p_paddr = efile.readIntE(); - phdrs[i].p_filesz = efile.readIntE(); - phdrs[i].p_memsz = efile.readIntE(); - phdrs[i].p_flags = efile.readIntE(); - phdrs[i].p_align = efile.readIntE(); - } - return phdrs; - } - - public class Dynamic { - public final static int DYN_ENT_SIZE = 8; - - public final static int DT_NULL = 0; - public final static int DT_NEEDED = 1; - public final static int DT_PLTRELSZ = 2; - public final static int DT_PLTGOT = 3; - public final static int DT_HASH = 4; - public final static int DT_STRTAB = 5; - public final static int DT_SYMTAB = 6; - public final static int DT_RELA = 7; - public final static int DT_RELASZ = 8; - public final static int DT_RELAENT = 9; - public final static int DT_STRSZ = 10; - public final static int DT_SYMENT = 11; - public final static int DT_INIT = 12; - public final static int DT_FINI = 13; - public final static int DT_SONAME = 14; - public final static int DT_RPATH = 15; - public long d_tag; - public long d_val; - private Section section; - private String name; - - protected Dynamic(Section section, long tag, long val) { - this.section = section; - d_tag = tag; - d_val = val; - } - - public String toString() { - if ( name == null ) { - switch ( (int)d_tag ) { - case DT_NEEDED: - case DT_SONAME: - case DT_RPATH: - try { - Section symstr = sections[(int)section.sh_link]; - name = string_from_elf_section(symstr, (int)d_val); - } catch (IOException e) { - name = EMPTY_STRING; - } - break; - default: - name = EMPTY_STRING; - } - } - return name; - } - } - - public Dynamic[] getDynamicSections(Section section) throws IOException { - if ( section.sh_type != Section.SHT_DYNAMIC ) { - return new Dynamic[0]; - } - ArrayList dynList = new ArrayList(); - efile.seek(section.sh_offset); - int off = 0; - // We must assume the section is a table ignoring the sh_entsize as it is not - // set for MIPS. - while( off < section.sh_size ) { - Dynamic dynEnt = new Dynamic(section, efile.readIntE(), efile.readIntE()); - if ( dynEnt.d_tag == Dynamic.DT_NULL ) - break; - dynList.add(dynEnt); - off+= Dynamic.DYN_ENT_SIZE; - } - return (Dynamic[])dynList.toArray(new Dynamic[0]); - } - - private void commonSetup( String file, long offset, boolean filton ) - throws IOException - { - this.cppFiltEnabled = filton; - - try { - efile = new ERandomAccessFile(file, "r"); - efile.setFileOffset( offset ); - ehdr = new ELFhdr(); - this.file = file; - } finally { - if ( ehdr == null ) { - dispose(); - } - } - } - - public Elf (String file, long offset) throws IOException { - commonSetup( file, offset, true ); - } - - public Elf (String file) throws IOException { - commonSetup( file, 0, true ); - } - - public Elf (String file, long offset, boolean filton) throws IOException { - commonSetup( file, offset, filton ); - } - - public Elf (String file, boolean filton) throws IOException { - commonSetup( file, 0, filton ); - } - - public boolean cppFilterEnabled() { - return cppFiltEnabled; - } - - public void setCppFilter( boolean enabled ) { - cppFiltEnabled = enabled; - } - - public ELFhdr getELFhdr() throws IOException { - return ehdr; - } - - public class Attribute { - public static final int ELF_TYPE_EXE = 1; - public static final int ELF_TYPE_SHLIB = 2; - public static final int ELF_TYPE_OBJ = 3; - public static final int ELF_TYPE_CORE = 4; - - public static final int DEBUG_TYPE_NONE = 0; - public static final int DEBUG_TYPE_STABS = 1; - public static final int DEBUG_TYPE_DWARF = 2; - - String cpu; - int type; - int debugType; - boolean bDebug; - boolean isle; - - public String getCPU() { - return cpu; - } - - public int getType() { - return type; - } - - public boolean hasDebug() { - return debugType != DEBUG_TYPE_NONE; - } - - public int getDebugType() { - return debugType; - } - - public boolean isLittleEndian() { - return isle; - } - } - - - public Attribute getAttributes() throws IOException { - Attribute attrib = new Attribute(); - - switch( ehdr.e_type ) { - case Elf.ELFhdr.ET_CORE: - attrib.type = Attribute.ELF_TYPE_CORE; - break; - case Elf.ELFhdr.ET_EXEC: - attrib.type = Attribute.ELF_TYPE_EXE; - break; - case Elf.ELFhdr.ET_REL: - attrib.type = Attribute.ELF_TYPE_OBJ; - break; - case Elf.ELFhdr.ET_DYN: - attrib.type = Attribute.ELF_TYPE_SHLIB; - break; - } - - switch (ehdr.e_machine) { - case Elf.ELFhdr.EM_386 : - case Elf.ELFhdr.EM_486 : - attrib.cpu = new String("x86"); - break; - case Elf.ELFhdr.EM_PPC : - attrib.cpu = new String("ppc"); - break; - case Elf.ELFhdr.EM_SH : - attrib.cpu = new String("sh"); - break; - case Elf.ELFhdr.EM_ARM : - attrib.cpu = new String("arm"); - break; - case Elf.ELFhdr.EM_MIPS_RS3_LE : - case Elf.ELFhdr.EM_MIPS : - case Elf.ELFhdr.EM_RS6000 : - attrib.cpu = "mips"; - break; - case Elf.ELFhdr.EM_SPARC32PLUS: - case Elf.ELFhdr.EM_SPARC: - attrib.cpu = "sparc"; - break; - case Elf.ELFhdr.EM_68K: - attrib.cpu = "m68k"; - break; - case Elf.ELFhdr.EM_NONE: - default: - attrib.cpu = "none"; - } - switch (ehdr.e_ident[Elf.ELFhdr.EI_DATA]) { - case Elf.ELFhdr.ELFDATA2LSB : - attrib.isle = true; - break; - case Elf.ELFhdr.ELFDATA2MSB : - attrib.isle = false; - break; - } - // getSections - // find .debug using toString - Section [] sec = getSections(); - for (int i = 0; i < sec.length; i++) { - String s = sec[i].toString(); - if (s.equals(".debug_info")) { - attrib.debugType = Attribute.DEBUG_TYPE_DWARF; - break; - } else if (s.equals(".stab")) { - attrib.debugType = Attribute.DEBUG_TYPE_STABS; - break; - } - } - return attrib; - } - - - public static Attribute getAttributes(String file) throws IOException { - Elf elf = new Elf(file); - Attribute attrib = elf.getAttributes(); - elf.dispose(); - return attrib; - } - - public static boolean isElfHeader(byte[] e_ident) { - if (e_ident.length < 4 || e_ident[ELFhdr.EI_MAG0] != 0x7f || e_ident[ELFhdr.EI_MAG1] != 'E' || - e_ident[ELFhdr.EI_MAG2] != 'L' || e_ident[ELFhdr.EI_MAG3] != 'F') - return false; - return true; - } - - public void dispose() { - if (addr2line != null) { - addr2line.dispose(); - } - if (cppFilt != null) { - cppFilt.dispose(); - } - try { - if (efile != null) { - efile.close(); - efile = null; - } - } catch (IOException e) { - } - } - - /** - * Make sure we do not leak the fds. - */ - protected void finalize() throws Throwable { - try { - dispose(); - } finally { - super.finalize(); - } - } - - public Section getSectionByName(String name) throws IOException { - if ( sections == null ) - getSections(); - for( int i = 0; i < sections.length; i++) { - if ( sections[i].toString().equals(name)) { - return sections[i]; - } - } - return null; - } - - public Section[] getSections(int type) throws IOException { - if ( sections == null ) - getSections(); - ArrayList slist = new ArrayList(); - for( int i = 0; i < sections.length; i++ ) { - if ( sections[i].sh_type == type) - slist.add(sections[i]); - } - return (Section[])slist.toArray(new Section[0]); - } - - public Section[] getSections() throws IOException { - if ( sections == null ) { - if ( ehdr.e_shoff == 0 ) { - sections = new Section[0]; - return sections; - } - efile.seek(ehdr.e_shoff); - sections = new Section[ehdr.e_shnum]; - for ( int i = 0; i < ehdr.e_shnum; i++ ) { - sections[i] = new Section(); - sections[i].sh_name = efile.readIntE(); - sections[i].sh_type = efile.readIntE(); - sections[i].sh_flags = efile.readIntE(); - sections[i].sh_addr = efile.readIntE(); - sections[i].sh_offset = efile.readIntE(); - sections[i].sh_size = efile.readIntE(); - sections[i].sh_link = efile.readIntE(); - sections[i].sh_info = efile.readIntE(); - sections[i].sh_addralign = efile.readIntE(); - sections[i].sh_entsize = efile.readIntE(); - if ( sections[i].sh_type == Section.SHT_SYMTAB ) - syms = i; - if ( syms == 0 && sections[i].sh_type == Section.SHT_DYNSYM ) - syms = i; - } - } - return sections; - } - - - private Symbol[] loadSymbolsBySection( Section section ) throws IOException { - int numSyms = 1; - if (section.sh_entsize != 0) { - numSyms = (int)section.sh_size / (int)section.sh_entsize; - } - ArrayList symList = new ArrayList(numSyms); - for( int c = 0; c < numSyms; c++) { - efile.seek(section.sh_offset + (section.sh_entsize * c)); - Symbol symbol = new Symbol( section ); - symbol.st_name = efile.readIntE(); - symbol.st_value = efile.readIntE(); - symbol.st_size = efile.readIntE(); - symbol.st_info = efile.readByte(); - symbol.st_other = efile.readByte(); - symbol.st_shndx = efile.readShortE(); - if ( symbol.st_info == 0 ) - continue; - symList.add(symbol); - } - Symbol[] results = (Symbol[])symList.toArray(new Symbol[0]); - Arrays.sort(results); - return results; - } - - - public void loadSymbols() throws IOException { - if ( symbols == null ) { - Section section[] = getSections(Section.SHT_SYMTAB); - if( section.length > 0 ) { - symtab_sym = section[0]; - symtab_symbols = loadSymbolsBySection( section[0] ); - } else { - symtab_sym = null; - symtab_symbols = new Symbol[0]; - } - - section = getSections(Section.SHT_DYNSYM); - if( section.length > 0 ) { - dynsym_sym = section[0]; - dynsym_symbols = loadSymbolsBySection( section[0] ); - } else { - dynsym_sym = null; - dynsym_symbols = new Symbol[0]; - } - - if( symtab_sym != null ) { - // sym = symtab_sym; - symbols = symtab_symbols; - } else if( dynsym_sym != null ) { - // sym = dynsym_sym; - symbols = dynsym_symbols; - } - } - } - - public Symbol[] getSymbols() { - return symbols; - } - - public Symbol[] getDynamicSymbols() { - return dynsym_symbols; - } - - public Symbol[] getSymtabSymbols() { - return symtab_symbols; - } - - - - /* return the address of the function that address is in */ - public Symbol getSymbol( long vma ) { - if ( symbols == null ) { - return null; - } - - //@@@ If this works, move it to a single instance in this class. - SymbolComparator symbol_comparator = new SymbolComparator(); - - int ndx = Arrays.binarySearch(symbols, new Long(vma), symbol_comparator); - if ( ndx > 0 ) - return symbols[ndx]; - if ( ndx == -1 ) { - return null; - } - ndx = -ndx - 1; - return symbols[ndx-1]; - } - - public long swapInt( long val ) { - if ( ehdr.e_ident[ELFhdr.EI_DATA] == ELFhdr.ELFDATA2LSB ) { - short tmp[] = new short[4]; - tmp[0] = (short)(val & 0x00ff); - tmp[1] = (short)((val >> 8) & 0x00ff); - tmp[2] = (short)((val >> 16) & 0x00ff); - tmp[3] = (short)((val >> 24) & 0x00ff); - return (long)((tmp[0] << 24) + (tmp[1] << 16) + (tmp[2] << 8) + tmp[3]); - } - return val; - } - - public int swapShort( short val ) { - if ( ehdr.e_ident[ELFhdr.EI_DATA] == ELFhdr.ELFDATA2LSB ) { - short tmp[] = new short[2]; - tmp[0] = (short)(val & 0x00ff); - tmp[1] = (short)((val >> 8) & 0x00ff); - return (short)((tmp[0] << 8) + tmp[1]); - } - return val; - } - - public String getFilename() { - return file; - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java deleted file mode 100644 index b4d91e7d0e0..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/ElfHelper.java +++ /dev/null @@ -1,359 +0,0 @@ -package org.eclipse.cdt.utils.elf; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Vector; - -/** - * ElfHelper is a wrapper class for the Elf class - * to provide higher level API for sorting/searching the ELF data. - * - * @see Elf - */ -public class ElfHelper { - - private Elf elf; - private Elf.ELFhdr hdr; - private Elf.Attribute attrib; - private Elf.Symbol[] dynsyms; - private Elf.Symbol[] symbols; - private Elf.Section[] sections; - private Elf.Dynamic[] dynamics; - - public void dispose() { - if (elf != null) { - elf.dispose(); - elf = null; - } - } - - public class Sizes { - public long text; - public long data; - public long bss; - public long total; - public Sizes(long t, long d, long b) { - text = t; - data = d; - bss = b; - total = text + data + bss; - } - } - - private void loadSymbols() throws IOException { - if (symbols == null) { - elf.loadSymbols(); - symbols = elf.getSymtabSymbols(); - dynsyms = elf.getDynamicSymbols(); - - if (symbols.length <= 0) - symbols = dynsyms; - if (dynsyms.length <= 0) - dynsyms = symbols; - } - } - - private void loadSections() throws IOException { - if (sections == null) - sections = elf.getSections(); - } - - private void loadDynamics() throws IOException { - if (dynamics == null) { - dynamics = new Elf.Dynamic[0]; - Elf.Section dynSect = elf.getSectionByName(".dynamic"); - if (dynSect != null) { - dynamics = elf.getDynamicSections(dynSect); - } - - } - } - - /** Common code used by all constructors */ - private void commonSetup() throws IOException { - hdr = elf.getELFhdr(); - attrib = elf.getAttributes(); - } - - /** - * Create a new ElfHelper using an existing Elf - * object. - * @param elf An existing Elf object to wrap. - * @throws IOException Error processing the Elf file. - */ - public ElfHelper(Elf elf) throws IOException { - this.elf = elf; - commonSetup(); - } - - /** - * Create a new ElfHelper based on the given filename. - * - * @param filename The file to use for creating a new Elf object. - * @throws IOException Error processing the Elf file. - * @see Elf#Elf( String ) - */ - public ElfHelper(String filename) throws IOException { - elf = new Elf(filename); - commonSetup(); - } - - public ElfHelper(String filename, boolean filton) throws IOException { - elf = new Elf(filename, filton); - commonSetup(); - } - - /** Give back the Elf object that this helper is wrapping */ - public Elf getElf() { - return elf; - } - - public Elf.Symbol[] getExternalFunctions() throws IOException { - Vector v = new Vector(); - - loadSymbols(); - loadSections(); - - for (int i = 0; i < dynsyms.length; i++) { - if (dynsyms[i].st_bind() == Elf.Symbol.STB_GLOBAL && dynsyms[i].st_type() == Elf.Symbol.STT_FUNC) { - int idx = dynsyms[i].st_shndx; - if (idx < Elf.Symbol.SHN_HIPROC && idx > Elf.Symbol.SHN_LOPROC) { - String name = dynsyms[i].toString(); - if (name != null && name.trim().length() > 0) - v.add(dynsyms[i]); - } else if (idx >= 0 && sections[idx].sh_type == Elf.Section.SHT_NULL) { - v.add(dynsyms[i]); - } - } - } - - Elf.Symbol[] ret = (Elf.Symbol[]) v.toArray(new Elf.Symbol[0]); - Arrays.sort(ret, new SymbolSortCompare()); - return ret; - } - - public Elf.Symbol[] getExternalObjects() throws IOException { - Vector v = new Vector(); - - loadSymbols(); - loadSections(); - - for (int i = 0; i < dynsyms.length; i++) { - if (dynsyms[i].st_bind() == Elf.Symbol.STB_GLOBAL && dynsyms[i].st_type() == Elf.Symbol.STT_OBJECT) { - int idx = dynsyms[i].st_shndx; - if (idx < Elf.Symbol.SHN_HIPROC && idx > Elf.Symbol.SHN_LOPROC) { - String name = dynsyms[i].toString(); - if (name != null && name.trim().length() > 0) - v.add(dynsyms[i]); - } else if (idx >= 0 && sections[idx].sh_type == Elf.Section.SHT_NULL) { - v.add(dynsyms[i]); - } - } - } - - Elf.Symbol[] ret = (Elf.Symbol[]) v.toArray(new Elf.Symbol[0]); - Arrays.sort(ret, new SymbolSortCompare()); - return ret; - } - - public Elf.Symbol[] getUndefined() throws IOException { - Vector v = new Vector(); - - loadSymbols(); - - for (int i = 0; i < dynsyms.length; i++) { - if (dynsyms[i].st_shndx == Elf.Symbol.SHN_UNDEF) - v.add(dynsyms[i]); - } - - Elf.Symbol[] ret = (Elf.Symbol[]) v.toArray(new Elf.Symbol[0]); - Arrays.sort(ret, new SymbolSortCompare()); - return ret; - } - - public Elf.Symbol[] getLocalFunctions() throws IOException { - Vector v = new Vector(); - - loadSymbols(); - loadSections(); - - for (int i = 0; i < symbols.length; i++) { - if (symbols[i].st_bind() == Elf.Symbol.STB_GLOBAL && symbols[i].st_type() == Elf.Symbol.STT_FUNC) { - int idx = symbols[i].st_shndx; - if (idx < Elf.Symbol.SHN_HIPROC && idx > Elf.Symbol.SHN_LOPROC) { - String name = symbols[i].toString(); - if (name != null && name.trim().length() > 0) - v.add(symbols[i]); - } else if (idx >= 0 && sections[idx].sh_type != Elf.Section.SHT_NULL) { - v.add(symbols[i]); - } - } - } - - Elf.Symbol[] ret = (Elf.Symbol[]) v.toArray(new Elf.Symbol[0]); - Arrays.sort(ret, new SymbolSortCompare()); - return ret; - } - - public Elf.Symbol[] getLocalObjects() throws IOException { - Vector v = new Vector(); - - loadSymbols(); - loadSections(); - - for (int i = 0; i < symbols.length; i++) { - if (symbols[i].st_bind() == Elf.Symbol.STB_GLOBAL && symbols[i].st_type() == Elf.Symbol.STT_OBJECT) { - int idx = symbols[i].st_shndx; - if (idx < Elf.Symbol.SHN_HIPROC && idx > Elf.Symbol.SHN_LOPROC) { - String name = symbols[i].toString(); - if (name != null && name.trim().length() > 0) - v.add(symbols[i]); - } else if (idx >= 0 && sections[idx].sh_type != Elf.Section.SHT_NULL) { - v.add(symbols[i]); - } - } - } - - Elf.Symbol[] ret = (Elf.Symbol[]) v.toArray(new Elf.Symbol[0]); - Arrays.sort(ret, new SymbolSortCompare()); - return ret; - } - - public Elf.Symbol[] getCommonObjects() throws IOException { - Vector v = new Vector(); - - loadSymbols(); - loadSections(); - - for (int i = 0; i < symbols.length; i++) { - if (symbols[i].st_bind() == Elf.Symbol.STB_GLOBAL && symbols[i].st_type() == Elf.Symbol.STT_OBJECT) { - int idx = symbols[i].st_shndx; - if (idx == Elf.Symbol.SHN_COMMON) { - v.add(symbols[i]); - } - } - } - - Elf.Symbol[] ret = (Elf.Symbol[]) v.toArray(new Elf.Symbol[0]); - Arrays.sort(ret, new SymbolSortCompare()); - return ret; - } - - public Elf.Dynamic[] getNeeded() throws IOException { - Vector v = new Vector(); - - loadDynamics(); - - for (int i = 0; i < dynamics.length; i++) { - if (dynamics[i].d_tag == Elf.Dynamic.DT_NEEDED) - v.add(dynamics[i]); - } - return (Elf.Dynamic[]) v.toArray(new Elf.Dynamic[0]); - } - - public String getSoname() throws IOException { - String soname = ""; - - loadDynamics(); - - for (int i = 0; i < dynamics.length; i++) { - if (dynamics[i].d_tag == Elf.Dynamic.DT_SONAME) - soname = dynamics[i].toString(); - } - return soname; - } - - private String getSubUsage(String full, String name) { - int start, end; - //boolean has_names = false; - //boolean has_languages = false; - start = 0; - end = 0; - - for (int i = 0; i < full.length(); i++) { - if (full.charAt(i) == '%') { - if (full.charAt(i + 1) == '-') { - if (start == 0) { - int eol = full.indexOf('\n', i + 2); - String temp = full.substring(i + 2, eol); - if (temp.compareTo(name) == 0) - start = eol; - - //has_names = true; - } else if (end == 0) { - end = i - 1; - } - } - - //if( full.charAt( i+1 ) == '=' ) - //has_languages = true; - } - } - - if (end == 0) - end = full.length(); - - if (start == 0) - return full; - - return full.substring(start, end); - } - - public String getQnxUsage() throws IOException { - - loadSections(); - - for (int i = 0; i < sections.length; i++) { - if (sections[i].toString().compareTo("QNX_usage") == 0) { - File file = new File(elf.getFilename()); - - String full_usage = new String(sections[i].loadSectionData()); - String usage = getSubUsage(full_usage, file.getName()); - StringBuffer buffer = new StringBuffer(usage); - - for (int j = 0; j < buffer.length(); j++) { - if (buffer.charAt(j) == '%') { - if (buffer.charAt(j + 1) == 'C') - buffer.replace(j, j + 2, file.getName()); - } - } - - return buffer.toString(); - } - } - return new String(""); - } - - public Sizes getSizes() throws IOException { - long text, data, bss; - - text = 0; - data = 0; - bss = 0; - - loadSections(); - - for (int i = 0; i < sections.length; i++) { - if (sections[i].sh_type != Elf.Section.SHT_NOBITS) { - if (sections[i].sh_flags == (Elf.Section.SHF_WRITE | Elf.Section.SHF_ALLOC)) { - data += sections[i].sh_size; - } else if ((sections[i].sh_flags & Elf.Section.SHF_ALLOC) != 0) { - text += sections[i].sh_size; - } - } else { - if (sections[i].sh_flags == (Elf.Section.SHF_WRITE | Elf.Section.SHF_ALLOC)) { - bss += sections[i].sh_size; - } - } - } - - return new Sizes(text, data, bss); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java deleted file mode 100644 index 09bcd771374..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.cdt.utils.elf; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Comparator; - -public class SymbolSortCompare implements Comparator { - public int compare( Object o1, Object o2 ) { - String s1 = o1.toString().toLowerCase(); - String s2 = o2.toString().toLowerCase(); - - while( s1.length() > 0 && s1.charAt( 0 ) == '_' ) - s1 = s1.substring( 1 ); - - while( s2.length() > 0 && s2.charAt( 0 ) == '_' ) - s2 = s2.substring( 1 ); - - return s1.compareTo( s2 ); - } -} - diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ARMember.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ARMember.java deleted file mode 100644 index a9162ef000f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ARMember.java +++ /dev/null @@ -1,80 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; - -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.IToolsProvider; -import org.eclipse.cdt.utils.elf.AR; -import org.eclipse.cdt.utils.elf.Elf; -import org.eclipse.cdt.utils.elf.ElfHelper; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class ARMember extends BinaryObject { - AR.ARHeader header; - - public ARMember(IPath p, AR.ARHeader h, IToolsProvider provider) throws IOException { - super(p, new ElfHelper(h.getElf()), provider); - header = h; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getContents() - */ - public InputStream getContents() { - InputStream stream = null; - if (path != null && header != null) { - try { - stream = new ByteArrayInputStream(header.getObjectData()); - } catch (IOException e) { - } - } - if (stream == null) { - stream = super.getContents(); - } - return stream; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getName() - */ - public String getName() { - if (header != null) { - return header.getObjectName(); - } - return ""; - } - - protected ElfHelper getElfHelper() throws IOException { - if (header != null) { - return new ElfHelper(header.getElf()); - } - throw new IOException("No file assiocated with Binary"); - } - - protected void addSymbols(Elf.Symbol[] array, int type, Addr2line addr2line, CPPFilt cppfilt, List list) { - for (int i = 0; i < array.length; i++) { - Symbol sym = new Symbol(this); - sym.type = type; - sym.name = array[i].toString(); - sym.addr = array[i].st_value; - list.add(sym); - } - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java deleted file mode 100644 index d91f4190974..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryArchive.java +++ /dev/null @@ -1,87 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; -import java.util.ArrayList; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.utils.elf.AR; -import org.eclipse.cdt.utils.elf.Elf.Attribute; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryArchive extends BinaryFile implements IBinaryArchive { - - ArrayList children; - long timestamp; - - public BinaryArchive(IPath p) throws IOException { - super(p); - new AR(p.toOSString()).dispose(); // check file type - children = new ArrayList(5); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryArchive#getObjects() - */ - public IBinaryObject[] getObjects() { - if (hasChanged()) { - children.clear(); - AR ar = null; - try { - ar = new AR(getPath().toOSString()); - AR.ARHeader[] headers = ar.getHeaders(); - for (int i = 0; i < headers.length; i++) { - IBinaryObject bin = new ARMember(getPath(), headers[i], toolsProvider); - children.add(bin); - } - } catch (IOException e) { - //e.printStackTrace(); - } - if (ar != null) { - ar.dispose(); - } - children.trimToSize(); - } - return (IBinaryObject[]) children.toArray(new IBinaryObject[0]); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return IBinaryFile.ARCHIVE; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryArchive#add(IBinaryObject[]) - */ - public void add(IBinaryObject[] objs) throws IOException { - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryArchive#delete(IBinaryObject[]) - */ - public void delete(IBinaryObject[] objs) throws IOException { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.utils.elf.parser.BinaryFile#getAttribute() - */ - protected Attribute getAttribute() { - return null; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryExecutable.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryExecutable.java deleted file mode 100644 index b1611466617..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryExecutable.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryExecutable extends BinaryObject implements IBinaryExecutable { - - public BinaryExecutable(IPath path) throws IOException { - super(path); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryExecutable#getNeededSharedLibs() - */ - public String[] getNeededSharedLibs() { - if (hasChanged()) { - try { - loadInformation(); - } catch (IOException e) { - } - } - if (needed != null) { - return needed; - } - return new String[0]; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return IBinaryFile.EXECUTABLE; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryFile.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryFile.java deleted file mode 100644 index 08a219547e0..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryFile.java +++ /dev/null @@ -1,97 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.utils.*; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.elf.Elf.Attribute; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.PlatformObject; - -/** - * - */ -public abstract class BinaryFile extends PlatformObject implements IBinaryFile { - - protected IPath path; - protected IToolsProvider toolsProvider; - protected long timestamp; - - public BinaryFile(IPath p) { - path = p; - } - - public void setToolsProvider(IToolsProvider p) { - toolsProvider = p; - } - - public Addr2line getAddr2Line() { - if (toolsProvider != null) - return toolsProvider.getAddr2Line(path); - return null; - } - - public CPPFilt getCPPFilt() { - if (toolsProvider != null) - return toolsProvider.getCPPFilt(); - return null; - } - - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getFile() - */ - public IPath getPath() { - return path; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public abstract int getType(); - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getContents() - */ - public InputStream getContents() { - InputStream stream = null; - if (path != null) { - try { - stream = new FileInputStream(path.toFile()); - } catch (IOException e) { - } - } - if (stream == null) { - stream = new ByteArrayInputStream(new byte[0]); - } - return stream; - } - - /** - * @return - */ - protected abstract Attribute getAttribute(); - - protected boolean hasChanged() { - long modification = getPath().toFile().lastModified(); - boolean changed = modification != timestamp; - timestamp = modification; - return changed; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java deleted file mode 100644 index 1adc8adf007..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryObject.java +++ /dev/null @@ -1,298 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.cdt.utils.IToolsProvider; -import org.eclipse.cdt.utils.elf.Elf; -import org.eclipse.cdt.utils.elf.ElfHelper; -import org.eclipse.cdt.utils.elf.Elf.Attribute; -import org.eclipse.cdt.utils.elf.ElfHelper.Sizes; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - */ -public class BinaryObject extends BinaryFile implements IBinaryObject { - protected String soname; - protected String[] needed; - protected int type = IBinaryFile.OBJECT; - private Sizes sizes; - private Attribute attribute; - private ISymbol[] symbols; - private ISymbol[] NO_SYMBOLS = new ISymbol[0]; - - public BinaryObject(IPath path) throws IOException { - super(path); - } - - public BinaryObject(IPath path, ElfHelper helper, IToolsProvider provider) throws IOException { - super(path); - setToolsProvider(provider); - loadInformation(helper); - helper.dispose(); - hasChanged(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.IBinaryObject#getSymbol(long) - */ - public ISymbol getSymbol(long addr) { - ISymbol[] syms = getSymbols(); - int insertion = Arrays.binarySearch(syms, new Long(addr)); - if (insertion >= 0) { - return syms[insertion]; - } - if (insertion == -1) { - return null; - } - insertion = -insertion - 1; - ISymbol symbol = syms[insertion - 1]; - if (addr < (symbol.getAddress() + symbol.getSize())) { - return syms[insertion - 1]; - } - return null; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getBSS() - */ - public long getBSS() { - Sizes sz = getSizes(); - if (sz != null) { - return sizes.bss; - } - return 0; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getCPU() - */ - public String getCPU() { - Attribute attr = getAttribute(); - if (attr != null) { - return attribute.getCPU(); - } - return ""; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getData() - */ - public long getData() { - Sizes sz = getSizes(); - if (sz != null) { - return sizes.data; - } - return 0; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getText() - */ - public long getText() { - Sizes sz = getSizes(); - if (sz != null) { - return sizes.text; - } - return 0; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#hasDebug() - */ - public boolean hasDebug() { - Attribute attr = getAttribute(); - if (attr != null) { - return attribute.hasDebug(); - } - return false; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#isLittleEndian() - */ - public boolean isLittleEndian() { - Attribute attr = getAttribute(); - if (attr != null) { - return attribute.isLittleEndian(); - } - return false; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return type; - } - - public void setType(int t) { - type = t; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getSymbols() - */ - public ISymbol[] getSymbols() { - if (hasChanged() || symbols == null) { - try { - loadInformation(); - } catch (IOException e) { - } - if (symbols == null) { - symbols = NO_SYMBOLS; - } - } - return symbols; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getName() - */ - public String getName() { - return getPath().lastSegment().toString(); - } - - public String toString() { - return getName(); - } - - protected Attribute getAttribute() { - if (hasChanged()) { - ElfHelper helper = null; - try { - helper = getElfHelper(); - loadAttributes(helper); - } catch (IOException e) { - } finally { - if (helper != null) { - helper.dispose(); - } - } - } - return attribute; - } - - protected Sizes getSizes() { - if (hasChanged()) { - ElfHelper helper = null; - try { - helper = getElfHelper(); - loadAttributes(helper); - } catch (IOException e) { - } finally { - if (helper != null) { - helper.dispose(); - } - } - } - return sizes; - } - - protected ElfHelper getElfHelper() throws IOException { - return new ElfHelper(getPath().toOSString()); - } - - protected void loadInformation() throws IOException { - ElfHelper helper = null; - try { - helper = getElfHelper(); - loadInformation(helper); - } finally { - if (helper != null) { - helper.dispose(); - } - } - } - - private void loadInformation(ElfHelper helper) throws IOException { - loadAttributes(helper); - loadSymbols(helper); - } - - private void loadAttributes(ElfHelper helper) throws IOException { - Elf.Dynamic[] sharedlibs = helper.getNeeded(); - needed = new String[sharedlibs.length]; - for (int i = 0; i < sharedlibs.length; i++) { - needed[i] = sharedlibs[i].toString(); - } - sizes = helper.getSizes(); - soname = helper.getSoname(); - attribute = helper.getElf().getAttributes(); - } - - private void loadSymbols(ElfHelper helper) throws IOException { - ArrayList list = new ArrayList(); - // Hack should be remove when Elf is clean - helper.getElf().setCppFilter(false); - - Addr2line addr2line = getAddr2Line(); - CPPFilt cppfilt = getCPPFilt(); - - addSymbols(helper.getExternalFunctions(), ISymbol.FUNCTION, addr2line, cppfilt, list); - addSymbols(helper.getLocalFunctions(), ISymbol.FUNCTION, addr2line, cppfilt, list); - addSymbols(helper.getExternalObjects(), ISymbol.VARIABLE, addr2line, cppfilt, list); - addSymbols(helper.getLocalObjects(), ISymbol.VARIABLE, addr2line, cppfilt, list); - list.trimToSize(); - - if (addr2line != null) { - addr2line.dispose(); - } - if (cppfilt != null) { - cppfilt.dispose(); - } - - symbols = (ISymbol[])list.toArray(NO_SYMBOLS); - Arrays.sort(symbols); - list.clear(); - } - - protected void addSymbols(Elf.Symbol[] array, int type, Addr2line addr2line, CPPFilt cppfilt, List list) { - for (int i = 0; i < array.length; i++) { - Symbol sym = new Symbol(this); - sym.type = type; - sym.name = array[i].toString(); - if (cppfilt != null) { - try { - sym.name = cppfilt.getFunction(sym.name); - } catch (IOException e1) { - } - } - sym.addr = array[i].st_value; - sym.size = array[i].st_size; - sym.filename = null; - sym.startLine = 0; - sym.endLine = sym.startLine; - if (addr2line != null) { - try { - String filename = addr2line.getFileName(sym.addr); - // Addr2line returns the funny "??" when it can not find the file. - sym.filename = (filename != null && !filename.equals("??")) ? new Path(filename) : null; - sym.startLine = addr2line.getLineNumber(sym.addr); - sym.endLine = addr2line.getLineNumber(sym.addr + sym.size - 1); - } catch (IOException e) { - } - } - list.add(sym); - } - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java deleted file mode 100644 index 4bdea01c231..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.core.IBinaryParser.IBinaryShared; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class BinaryShared extends BinaryExecutable implements IBinaryShared { - - public BinaryShared(IPath path) throws IOException { - super(path); - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryShared#getSoName() - */ - public String getSoName() { - if (hasChanged()) { - try { - loadInformation(); - } catch (IOException e) { - } - } - if (soname != null) { - return soname; - } - return ""; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryFile#getType() - */ - public int getType() { - return IBinaryFile.SHARED; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java deleted file mode 100644 index b3c4679ab65..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfParser.java +++ /dev/null @@ -1,78 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.AbstractCExtension; -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.utils.elf.AR; -import org.eclipse.cdt.utils.elf.Elf; -import org.eclipse.cdt.utils.elf.Elf.Attribute; -import org.eclipse.core.runtime.IPath; - -/** - */ -public class ElfParser extends AbstractCExtension implements IBinaryParser { - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IPath) - */ - public IBinaryFile getBinary(IPath path) throws IOException { - if (path == null) { - throw new IOException("path is null"); - } - - BinaryFile binary = null; - try { - Elf.Attribute attribute = Elf.getAttributes(path.toOSString()); - if (attribute != null) { - switch (attribute.getType()) { - case Attribute.ELF_TYPE_EXE : - binary = new BinaryExecutable(path); - break; - - case Attribute.ELF_TYPE_SHLIB : - binary = new BinaryShared(path); - break; - - case Attribute.ELF_TYPE_OBJ : - binary = new BinaryObject(path); - break; - - case Attribute.ELF_TYPE_CORE : - BinaryObject obj = new BinaryObject(path); - obj.setType(IBinaryFile.CORE); - binary = obj; - break; - } - } - } catch (IOException e) { - binary = new BinaryArchive(path); - } - return binary; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() - */ - public String getFormat() { - return "ELF"; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser#isBinary(byte[], org.eclipse.core.runtime.IPath) - */ - public boolean isBinary(byte[] array, IPath path) { - return Elf.isElfHeader(array) || AR.isARHeader(array); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfParser.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfParser.java deleted file mode 100644 index 474edfd8052..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfParser.java +++ /dev/null @@ -1,87 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.cdt.utils.*; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.cdt.utils.CPPFilt; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - */ -public class GNUElfParser extends ElfParser implements IBinaryParser, IToolsProvider { - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IPath) - */ - public IBinaryFile getBinary(IPath path) throws IOException { - IBinaryFile binary = super.getBinary(path); - if (binary instanceof BinaryFile) { - ((BinaryFile)binary).setToolsProvider(this); - } - return binary; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() - */ - public String getFormat() { - return "GNU ELF"; - } - - public IPath getAddr2LinePath() { - ICExtensionReference ref = getExtensionReference(); - String value = ref.getExtensionData("addr2line"); //$NON-NLS-1 - if (value == null || value.length() == 0) { - value = "addr2line"; //$NON-NLS-1 - } - return new Path(value); - } - - public IPath getCPPFiltPath() { - ICExtensionReference ref = getExtensionReference(); - String value = ref.getExtensionData("c++filt"); //$NON-NLS-1 - if (value == null || value.length() == 0) { - value = "c++filt"; //$NON-NLS-1 - } - return new Path(value); - } - - public Addr2line getAddr2Line(IPath path) { - IPath addr2LinePath = getAddr2LinePath(); - Addr2line addr2line = null; - if (addr2LinePath != null && !addr2LinePath.isEmpty()) { - try { - addr2line = new Addr2line(addr2LinePath.toOSString(), path.toOSString()); - } catch (IOException e1) { - } - } - return addr2line; - } - - public CPPFilt getCPPFilt() { - IPath cppFiltPath = getCPPFiltPath(); - CPPFilt cppfilt = null; - if (cppFiltPath != null && ! cppFiltPath.isEmpty()) { - try { - cppfilt = new CPPFilt(cppFiltPath.toOSString()); - } catch (IOException e2) { - } - } - return cppfilt; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/Symbol.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/Symbol.java deleted file mode 100644 index e27cf381e9b..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/Symbol.java +++ /dev/null @@ -1,149 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.utils.elf.parser; - -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.cdt.utils.Addr2line; -import org.eclipse.core.runtime.IPath; - -public class Symbol implements ISymbol, Comparable { - - BinaryObject binary; - long timestamp; - Addr2line addr2line; - - public IPath filename; - public int startLine; - public int endLine; - public long addr; - public String name; - public int type; - public long size; - - public Symbol(BinaryObject bin) { - binary = bin; - } - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.ISymbol#getFilename() - */ - public IPath getFilename() { - return filename; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.ISymbol#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.core.model.IBinaryParser.ISymbol#getType() - */ - public int getType() { - return type; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getAdress() - */ - public long getAddress() { - return addr; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getEndLine() - */ - public int getEndLine() { - return endLine; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getStartLine() - */ - public int getStartLine() { - return startLine; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getLineNumber(long) - */ - public int getLineNumber(long offset) { - int line = -1; - try { - Addr2line addressToLine = startAddr2Line(); - if (addressToLine != null) { - line = addressToLine.getLineNumber(addr + offset); - } - } catch (IOException e) { - } - return line; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getSize() - */ - public long getSize() { - return size; - } - - public int compareTo(Object obj) { - long thisVal = 0; - long anotherVal = 0; - if (obj instanceof Symbol) { - Symbol sym = (Symbol) obj; - thisVal = this.addr; - anotherVal = sym.addr; - } else if (obj instanceof Long) { - Long val = (Long) obj; - anotherVal = val.longValue(); - thisVal = (long) this.addr; - } - return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); - } - - synchronized Addr2line startAddr2Line () { - if (addr2line == null) { - addr2line = binary.getAddr2Line(); - if (addr2line != null) { - timestamp = System.currentTimeMillis(); - Runnable worker = new Runnable () { - public void run() { - long diff = System.currentTimeMillis() - timestamp; - while (diff < 10000) { - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - break; - } - diff = System.currentTimeMillis() - timestamp; - } - stopAddr2Line(); - } - }; - new Thread(worker, "Addr2line Reaper").start(); - } - } else { - timestamp = System.currentTimeMillis(); - } - return addr2line; - } - - synchronized void stopAddr2Line() { - if (addr2line != null) { - addr2line.dispose(); - } - addr2line = null; - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java deleted file mode 100644 index 9c7a6345f9f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTY.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.eclipse.cdt.utils.pty; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class PTY { - - String slave; - InputStream in; - OutputStream out; - int master; - - private static boolean hasPTY; - - /** - * The master fd is use on two streams. We need to wrap the fd - * so when stream.close() is call the other stream is disable. - */ - public class MasterFD { - - public int getFD() { - return master; - } - - public void setFD(int fd) { - master = fd; - } - } - - public PTY() throws IOException { - if (hasPTY) { - slave= forkpty(); - } - - if (slave == null) { - throw new IOException("Can not create pty"); - } - - in = new PTYInputStream(new MasterFD()); - out = new PTYOutputStream(new MasterFD()); - } - - public String getSlaveName() { - return slave; - } - - public OutputStream getOutputStream() { - return out; - } - - public InputStream getInputStream() { - return in; - } - - native String forkpty(); - - static { - try { - System.loadLibrary("pty"); - hasPTY = true; - } catch (SecurityException e) { - } catch (UnsatisfiedLinkError e) { - } - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java deleted file mode 100644 index b4198feb385..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.utils.pty; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.InputStream; -import java.io.IOException; - -import org.eclipse.cdt.utils.pty.PTY.MasterFD; - -class PTYInputStream extends InputStream { - - MasterFD master; - - /** - * Fome a Unix valid file descriptor set a Reader. - * @param desc file descriptor. - */ - public PTYInputStream(MasterFD fd) { - master = fd; - } - - /** - * Implementation of read for the InputStream. - * - * @exception IOException on error. - */ - public int read() throws IOException { - byte b[] = new byte[1]; - if (1 != read(b, 0, 1)) - return -1; - return (int) b[0]; - } - - /** - * @see InputStream#read(byte[], int, int) - */ - public int read(byte[] buf, int off, int len) throws IOException { - if (buf == null) { - throw new NullPointerException(); - } else if ((off < 0) || (off > buf.length) - || (len < 0) || ((off + len) > buf.length) - || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return 0; - } - byte[] tmpBuf = new byte[len]; - - len = read0(master.getFD(), tmpBuf, len); - if (len <= 0) - return -1; - - System.arraycopy(tmpBuf, 0, buf, off, len); - return len; - } - - /** - * Close the Reader - * @exception IOException on error. - */ - public void close() throws IOException { - if (master.getFD() == -1) - return; - int status = close0(master.getFD()); - if (status == -1) - throw new IOException("close error"); - master.setFD(-1); - } - - private native int read0(int fd, byte[] buf, int len) throws IOException; - private native int close0(int fd) throws IOException; - - static { - System.loadLibrary("pty"); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java deleted file mode 100644 index 4537478e1ce..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYOutputStream.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.cdt.utils.pty; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.OutputStream; -import java.io.IOException; - -import org.eclipse.cdt.utils.pty.PTY.MasterFD; - -public class PTYOutputStream extends OutputStream { - - MasterFD master; - - /** - * Fome a Unix valid file descriptor set a Reader. - * @param desc file descriptor. - */ - public PTYOutputStream(MasterFD fd) { - master = fd; - } - - /** - * @see OutputStream#write(byte[], int, int) - */ - public void write(byte[] b, int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if ( - (off < 0) - || (off > b.length) - || (len < 0) - || ((off + len) > b.length) - || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - byte[] tmpBuf = new byte[len]; - System.arraycopy(b, off, tmpBuf, off, len); - write0(master.getFD(), tmpBuf, len); - } - /** - * Implementation of read for the InputStream. - * - * @exception IOException on error. - */ - public void write(int b) throws IOException { - byte[] buf = new byte[1]; - buf[0] = (byte) b; - write(buf, 0, 1); - } - - /** - * Close the Reader - * @exception IOException on error. - */ - public void close() throws IOException { - if (master.getFD() == -1) - return; - int status = close0(master.getFD()); - if (status == -1) - throw new IOException("close error"); //$NON-NLS-1$ - master.setFD(-1); - } - - private native int write0(int fd, byte[] b, int len) throws IOException; - private native int close0(int fd) throws IOException; - - static { - System.loadLibrary("pty"); //$NON-NLS-1$ - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java deleted file mode 100644 index ec853a3005f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/EnvironmentReader.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.eclipse.cdt.utils.spawner; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.InputStream; -import java.util.Properties; -import java.util.Vector; - -public class EnvironmentReader { - private static Properties envVars = null; - private static Vector rawVars = null; - - public static Properties getEnvVars() { - - if (null != envVars) - return envVars; - - String OS = System.getProperty("os.name").toLowerCase(); - Process p = null; - envVars = new Properties(); - rawVars = new Vector(32); - String command = "env"; - InputStream in = null; - boolean check_ready = false; - boolean isWin32 = false; - try { - if (OS.indexOf("windows 9") > -1) { - command = "command.com /c set"; - //The buffered stream doesn't always like windows 98 - check_ready = true; - isWin32 = true; - } else if ((OS.indexOf("nt") > -1) || (OS.indexOf("windows 2000") > -1) || (OS.indexOf("windows xp") > -1)) { - command = "cmd.exe /c set"; - isWin32 = true; - } - p = ProcessFactory.getFactory().exec(command); - in = p.getInputStream(); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - String line; - while ((line = br.readLine()) != null) { - rawVars.add(line); - int idx = line.indexOf('='); - if (idx != -1) { - String key = line.substring(0, idx); - if (isWin32) //Since windows env ignores case let normalize to Upper here. - key = key.toUpperCase(); - String value = line.substring(idx + 1); - envVars.setProperty(key, value); - } else { - envVars.setProperty(line, ""); - } - if (check_ready && br.ready() == false) { - break; - } - } - } catch (IOException e) { - } finally { - try { - if (in != null) { - in.close(); - } - } catch (IOException e) { - } - try { - if (p != null) - p.waitFor(); - } catch (InterruptedException e) { - } - } - rawVars.trimToSize(); - return envVars; - } - - public static String getEnvVar(String key) { - Properties p = getEnvVars(); - return p.getProperty(key); - } - - public static String[] getRawEnvVars() { - getEnvVars(); - return (String[]) rawVars.toArray(new String[0]); - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java deleted file mode 100644 index 2a36ee882d9..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.cdt.utils.spawner; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; - -public class ProcessFactory { - - static private ProcessFactory instance; - private boolean hasSpawner; - private Runtime runtime; - - private ProcessFactory() { - hasSpawner = false; - runtime = Runtime.getRuntime(); - try { - System.loadLibrary("spawner"); //$NON-NLS-1$ - hasSpawner = true; - } catch (SecurityException e) { - //e.printStackTrace(); - } catch (UnsatisfiedLinkError e) { - //e.printStackTrace(); - } - } - - public static ProcessFactory getFactory() { - if (instance == null) - instance = new ProcessFactory(); - return instance; - } - - public Process exec(String cmd) throws IOException { - if (hasSpawner) - return new Spawner(cmd); - return runtime.exec(cmd); - } - - public Process exec(String[] cmdarray) throws IOException { - if (hasSpawner) - return new Spawner(cmdarray); - return runtime.exec(cmdarray); - } - - public Process exec(String[] cmdarray, String[] envp) throws IOException { - if (hasSpawner) - return new Spawner(cmdarray, envp); - return runtime.exec(cmdarray, envp); - } - - public Process exec(String cmd, String[] envp) throws IOException { - if (hasSpawner) - return new Spawner(cmd, envp); - return runtime.exec(cmd, envp); - } - - public Process exec(String cmd, String[] envp, File dir) - throws IOException { - if (hasSpawner) - return new Spawner(cmd, envp, dir); - return runtime.exec(cmd, envp, dir); - } - - public Process exec(String cmdarray[], String[] envp, File dir) - throws IOException { - if (hasSpawner) - return new Spawner(cmdarray, envp, dir); - return runtime.exec(cmdarray, envp, dir); - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java deleted file mode 100644 index 1a8424d6f7c..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java +++ /dev/null @@ -1,290 +0,0 @@ -package org.eclipse.cdt.utils.spawner; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.StringTokenizer; - -public class Spawner extends Process { - - public int NOOP = 0; - public int HUP = 1; - public int INT = 2; - public int KILL = 9; - public int TERM = 15; - - int pid = 0; - int status; - int[] channels = new int[3]; - boolean isDone; - OutputStream out; - InputStream in; - InputStream err; - - public Spawner(String command, boolean bNoRedirect) throws IOException { - StringTokenizer tokenizer = new StringTokenizer(command); - String[] cmdarray = new String[tokenizer.countTokens()]; - for (int n = 0; tokenizer.hasMoreTokens(); n++) - cmdarray[n] = tokenizer.nextToken(); - if (bNoRedirect) - exec_detached(cmdarray, new String[0], "."); //$NON-NLS-1$ - else - exec(cmdarray, new String[0], "."); //$NON-NLS-1$ - } - /** - * Executes the specified command and arguments in a separate process with the - * specified environment and working directory. - **/ - protected Spawner(String[] cmdarray, String[] envp, File dir) throws IOException { - String dirpath = "."; //$NON-NLS-1$ - if (dir != null) - dirpath = dir.getAbsolutePath(); - exec(cmdarray, envp, dirpath); - } - - /** - * Executes the specified string command in a separate process. - **/ - protected Spawner(String command) throws IOException { - this(command, null); - } - - /** - * Executes the specified command and arguments in a separate process. - **/ - protected Spawner(String[] cmdarray) throws IOException { - this(cmdarray, null); - } - - /** - * Executes the specified command and arguments in a separate process with the - * specified environment. - **/ - protected Spawner(String[] cmdarray, String[] envp) throws IOException { - this(cmdarray, envp, null); - } - - /** - * Executes the specified string command in a separate process with the specified - * environment. - **/ - protected Spawner(String cmd, String[] envp) throws IOException { - this(cmd, envp, null); - } - - /** - * Executes the specified string command in a separate process with the specified - * environment and working directory. - **/ - protected Spawner(String command, String[] envp, File dir) throws IOException { - StringTokenizer tokenizer = new StringTokenizer(command); - String[] cmdarray = new String[tokenizer.countTokens()]; - for (int n = 0; tokenizer.hasMoreTokens(); n++) - cmdarray[n] = tokenizer.nextToken(); - String dirpath = "."; //$NON-NLS-1$ - if (dir != null) - dirpath = dir.getAbsolutePath(); - exec(cmdarray, envp, dirpath); - } - - /** - * See java.lang.Process#getInputStream (); - **/ - public InputStream getInputStream() { - return in; - } - - /** - * See java.lang.Process#getOutputStream (); - **/ - public OutputStream getOutputStream() { - return out; - } - - /** - * See java.lang.Process#getErrorStream (); - **/ - public InputStream getErrorStream() { - return err; - } - - /** - * See java.lang.Process#waitFor (); - **/ - public synchronized int waitFor() throws InterruptedException { - while (!isDone) { - wait(); - } - try { - ((SpawnerInputStream)getErrorStream()).close(); - ((SpawnerInputStream)getInputStream()).close(); - ((SpawnerOutputStream)getOutputStream()).close(); - } catch (IOException e) { - } - return status; - } - - /** - * See java.lang.Process#exitValue (); - **/ - public synchronized int exitValue() { - if (!isDone) { - throw new IllegalThreadStateException("Process not Terminated"); //$NON-NLS-1$ - } - return status; - } - - /** - * See java.lang.Process#destroy (); - **/ - public synchronized void destroy() { - // Sends the TERM - terminate(); - // Close the streams on this side. - try { - ((SpawnerInputStream)getErrorStream()).close(); - ((SpawnerInputStream)getInputStream()).close(); - ((SpawnerOutputStream)getOutputStream()).close(); - } catch (IOException e) { - } - // Grace before using the heavy gone. - if (!isDone) { - try { - wait(1000); - } catch (InterruptedException e) { - } - } - if (!isDone) { - kill(); - } - } - - /** - * Our extensions. - **/ - public int interrupt() { - return raise(pid, INT); - } - - public int hangup() { - return raise(pid, HUP); - } - - public int kill() { - return raise(pid, KILL); - } - - public int terminate() { - return raise(pid, TERM); - } - - public boolean isRunning() { - return (raise(pid, NOOP) == 0); - } - - private void exec(String[] cmdarray, String[] envp, String dirpath) throws IOException { - String command = cmdarray[0]; - SecurityManager s = System.getSecurityManager(); - if (s != null) - s.checkExec(command); - if (envp == null) - envp = new String[0]; - - Reaper reaper = new Reaper(cmdarray, envp, dirpath); - reaper.setDaemon(true); - reaper.start(); - - // Wait until the subprocess is started or error. - synchronized (this) { - while (pid == 0) { - try { - wait(); - } catch (InterruptedException e) { - } - } - } - - // Check for errors. - if (pid == -1) { - throw new IOException("Exec error:" + reaper.getErrorMessage()); //$NON-NLS-1$ - } - in = new SpawnerInputStream(channels[1]); - err = new SpawnerInputStream(channels[2]); - out = new SpawnerOutputStream(channels[0]); - } - - public void exec_detached(String[] cmdarray, String[] envp, String dirpath) throws IOException { - String command = cmdarray[0]; - SecurityManager s = System.getSecurityManager(); - if (s != null) - s.checkExec(command); - - if (envp == null) - envp = new String[0]; - pid = exec1(cmdarray, envp, dirpath); - if (pid == -1) { - throw new IOException("Exec error"); //$NON-NLS-1$ - } - } - - native int exec0( String[] cmdarray, String[] envp, String dir, int[] chan) throws IOException; - native int exec1( String[] cmdarray, String[] envp, String dir) throws IOException; - public native int raise(int pid, int sig); - native int waitFor(int pid); - - static { - System.loadLibrary("spawner"); //$NON-NLS-1$ - } - - // Spawn a thread to handle the forking and waiting - // We do it this way because on linux the SIGCHLD is - // send to the one thread. So do the forking and - // the wait in the same thread. - class Reaper extends Thread { - String[] cmdarray; - String[] envp; - String dirpath; - String errMesg; - - public Reaper(String[] array, String[] env, String dir) { - super("Spawner Reaper"); //$NON-NLS-1$ - cmdarray = array; - envp = env; - dirpath = dir; - errMesg = new String("Cannot run " + cmdarray[0]); - } - - public void run() { - try { - pid = exec0(cmdarray, envp, dirpath, channels); - } catch (IOException e) { - pid = -1; - errMesg = e.getMessage(); - } - - // Tell spawner that the process started. - synchronized (Spawner.this) { - Spawner.this.notifyAll(); - } - - if (pid != -1) { - // Sync with spawner and notify when done. - status = waitFor(pid); - synchronized (Spawner.this) { - isDone = true; - Spawner.this.notifyAll(); - } - } - } - - public String getErrorMessage() { - return errMesg; - } - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java deleted file mode 100644 index 102eb9063bc..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerInputStream.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.utils.spawner; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.InputStream; -import java.io.IOException; - -class SpawnerInputStream extends InputStream { - private int fd; - - /** - * Fome a Unix valid file descriptor set a Reader. - * @param desc file descriptor. - */ - public SpawnerInputStream(int fd) { - this.fd = fd; - } - - /** - * Implementation of read for the InputStream. - * - * @exception IOException on error. - */ - public int read() throws IOException { - byte b[] = new byte[1]; - if (1 != read(b, 0, 1)) - return -1; - return (int) b[0]; - } - - /** - * @see InputStream#read(byte[], int, int) - */ - public int read(byte[] buf, int off, int len) throws IOException { - if (buf == null) { - throw new NullPointerException(); - } else if ( - (off < 0) - || (off > buf.length) - || (len < 0) - || ((off + len) > buf.length) - || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return 0; - } - byte[] tmpBuf = new byte[len]; - - len = read0(fd, tmpBuf, len); - if (len <= 0) - return -1; - - System.arraycopy(tmpBuf, 0, buf, off, len); - return len; - } - - /** - * Close the Reader - * @exception IOException on error. - */ - public void close() throws IOException { - if (fd == -1) - return; - int status = close0(fd); - if (status == -1) - throw new IOException("close error"); - fd = -1; - } - - private native int read0(int fd, byte[] buf, int len) throws IOException; - private native int close0(int fd) throws IOException; - - static { - System.loadLibrary("spawner"); - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java deleted file mode 100644 index b279df57d8f..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/SpawnerOutputStream.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.cdt.utils.spawner; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.OutputStream; -import java.io.IOException; - -public class SpawnerOutputStream extends OutputStream { - private int fd; - - /** - * Fome a Unix valid file descriptor set a Reader. - * @param desc file descriptor. - */ - public SpawnerOutputStream(int fd) { - this.fd = fd; - } - - /** - * @see OutputStream#write(byte[], int, int) - */ - public void write(byte[] b, int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if ( - (off < 0) - || (off > b.length) - || (len < 0) - || ((off + len) > b.length) - || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - byte[] tmpBuf = new byte[len]; - System.arraycopy(b, off, tmpBuf, off, len); - write0(fd, tmpBuf, len); - } - /** - * Implementation of read for the InputStream. - * - * @exception IOException on error. - */ - public void write(int b) throws IOException { - byte[] buf = new byte[1]; - buf[0] = (byte) b; - write(buf, 0, 1); - } - - /** - * Close the Reader - * @exception IOException on error. - */ - public void close() throws IOException { - if (fd == -1) - return; - int status = close0(fd); - if (status == -1) - throw new IOException("close error"); //$NON-NLS-1$ - fd = -1; - } - - private native int write0(int fd, byte[] b, int len) throws IOException; - private native int close0(int fd); - - static { - System.loadLibrary("spawner"); //$NON-NLS-1$ - } - -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabConstant.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabConstant.java deleted file mode 100644 index e78d2b9ca09..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabConstant.java +++ /dev/null @@ -1,157 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.utils.stabs; - -public final class StabConstant { - - // Stab Symbol Types - public final static int N_UNDF = 0x00; - public final static int N_GSYM = 0x20; - public final static int N_FNAME = 0x22; - public final static int N_FUN = 0x24; - public final static int N_STSYM = 0x26; - public final static int N_LCSYM = 0x28; - public final static int N_MAIN = 0x2a; - public final static int N_ROSYM = 0x2c; - public final static int N_PC = 0x30; - public final static int N_NSYMS = 0x32; - public final static int N_NOMAP = 0x34; - public final static int N_OBJ = 0x38; - public final static int N_OPT = 0x3c; - public final static int N_RSYM = 0x40; - public final static int N_M2C = 0x42; - public final static int N_SLINE = 0x44; - public final static int N_DSLINE = 0x46; - public final static int N_BSLINE = 0x48; - public final static int N_DEFD = 0x4a; - public final static int N_FLINE = 0x4c; - public final static int N_EHDECL = 0x50; - public final static int N_CATCH = 0x54; - public final static int N_SSYM = 0x60; - public final static int N_ENDM = 0x62; - public final static int N_SO = 0x64; - public final static int N_LSYM = 0x80; - public final static int N_BINCL = 0x82; - public final static int N_SOL = 0x84; - public final static int N_PSYM = 0xa0; - public final static int N_EINCL = 0xa2; - public final static int N_ENTRY = 0xa4; - public final static int N_LBRAC = 0xc0; - public final static int N_EXCL = 0xc2; - public final static int N_SCOPE = 0xc4; - public final static int N_RBRAC = 0xe0; - public final static int N_BCOMM = 0xe2; - public final static int N_ECOMM = 0xe4; - public final static int N_ECOML = 0xe8; - public final static int N_WITH = 0xea; - public final static int N_NBTEXT = 0xef; - public final static int N_NBDATA = 0xf2; - public final static int N_NBBSS = 0xf4; - public final static int N_NBSTS = 0xf6; - public final static int N_NBLCS = 0xf8; - - public final static int SIZE = 12; // 4 + 1 + 1 + 2 + 4 - - public static String type2String(int t) { - switch (t) { - case N_UNDF : - return "UNDF"; - case N_GSYM : - return "GSYM"; - case N_FNAME : - return "FNAME"; - case N_FUN : - return "FUN"; - case N_STSYM : - return "STSYM"; - case N_LCSYM : - return "LCSYM"; - case N_MAIN : - return "MAIN"; - case N_ROSYM : - return "ROSYM"; - case N_PC : - return "PC"; - case N_NSYMS : - return "SSYMS"; - case N_NOMAP : - return "NOMAP"; - case N_OBJ : - return "OBJ"; - case N_OPT : - return "OPT"; - case N_RSYM : - return "RSYM"; - case N_M2C : - return "M2C"; - case N_SLINE : - return "SLINE"; - case N_DSLINE : - return "DSLINE"; - case N_BSLINE : - return "BSLINE"; - case N_DEFD : - return "DEFD"; - case N_FLINE : - return "FLINE"; - case N_EHDECL : - return "EHDECL"; - case N_CATCH : - return "CATCH"; - case N_SSYM : - return "SSYM"; - case N_ENDM : - return "ENDM"; - case N_SO : - return "SO"; - case N_LSYM : - return "LSYM"; - case N_BINCL : - return "BINCL"; - case N_SOL : - return "SOL"; - case N_PSYM : - return "PSYM"; - case N_EINCL : - return "EINCL"; - case N_ENTRY : - return "ENTRY"; - case N_LBRAC : - return "LBRAC"; - case N_EXCL : - return "EXCL"; - case N_SCOPE: - return "SCOPE"; - case N_RBRAC : - return "RBRAC"; - case N_BCOMM : - return "COMM"; - case N_ECOMM : - return "ECOMM"; - case N_ECOML : - return "ECOML"; - case N_WITH : - return "WITH"; - case N_NBTEXT : - return "NBTEXT"; - case N_NBDATA : - return "NBDATA"; - case N_NBBSS : - return "NBBSS"; - case N_NBSTS : - return "NBSTS"; - case N_NBLCS : - return "NBLCS"; - } - return "" + t; - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/Stabs.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/Stabs.java deleted file mode 100644 index 5253ca2a27c..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/Stabs.java +++ /dev/null @@ -1,458 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.utils.stabs; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.cdt.utils.elf.Elf; - -public class Stabs { - - byte[] stabData; - byte[] stabstrData; - boolean isLe; - Entry[] entries; - - public class Entry implements Comparable{ - public long addr; - public long size; - public int startLine; - public String string; - - public Entry(String s) { - string = s; - } - public int compareTo(Object obj) { - long thisVal = 0; - long anotherVal = 0; - if (obj instanceof Entry) { - Entry entry = (Entry) obj; - thisVal = this.addr; - anotherVal = entry.addr; - } else if (obj instanceof Long) { - Long val = (Long) obj; - anotherVal = val.longValue(); - thisVal = (long) this.addr; - } - return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); - } - - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("Name: ").append(string).append("\n"); - buf.append("\taddress:").append("0x").append(Long.toHexString(addr)).append("\n"); - buf.append("\tstartLine:").append(startLine).append("\n"); - //buf.append("\tName:").append(string).append("\n"); - return buf.toString(); - } - } - - public abstract class LocatableEntry extends Entry { - public String filename; - - public LocatableEntry(String s) { - super(s); - } - } - - public class Variable extends LocatableEntry { - public int kind; - public Function function; - - public Variable(String s) { - super(s); - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("Variable: "); - buf.append(super.toString()); - buf.append("\tkind:").append(kind).append("\n"); - buf.append("\tfilename:").append(filename).append("\n"); - return buf.toString(); - } - } - - public class Function extends LocatableEntry { - public int endLine; - public ArrayList lines; - public ArrayList variables; - - public Function(String s) { - super(s); - variables = new ArrayList(); - lines = new ArrayList(); - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("Function: "); - buf.append(super.toString()); - buf.append("\tendLine:").append(endLine).append("\n"); - buf.append("\tfilename:").append(filename).append("\n"); - buf.append("\tSource code: "); - for (int i = 0; i < lines.size(); i++) { - buf.append(" ").append(lines.get(i)); - } - buf.append("\n"); - buf.append("\tVariables\n"); - for (int i = 0; i < variables.size(); i++) { - buf.append("\t\t").append("[" + i + "]").append("\n"); - buf.append("\t\t\t").append(variables.get(i)).append("\n"); - } - return buf.toString(); - } - } - - public class Include extends Entry { - int index; - - public Include(String s) { - super(s); - } - - public String toString() { - return super.toString() + "\tindex:" + index + "\n"; - } - } - - // type-information = type-number | type-definition - // type-number = type-reference - // type-reference = number | '(' number ',' number ')' - // type-definition = type_number '=' (type-descriptor | type-reference) - public class TypeInformation { - int typeNumber; - int fileNumber; - boolean isTypeDefinition; - - public TypeInformation(String s) { - parserTypeInformation(s.toCharArray()); - } - - void parserTypeInformation(char[] array) { - } - } - - /** - * Format: string_field = name ':' symbol-descriptor type-information - */ - public class StringField { - String name; - char symbolDescriptor; - String typeInformation; - - public StringField(String s) { - parseStringField(s.toCharArray()); - } - - /** - * Format: string_field = name ':' symbol-descriptor type-information - */ - void parseStringField(char[] array) { - int index = 0; - - // Some String field may contain format like: - // "foo::bar::baz:t5=*6" in that case the name is "foo::bar::baz" - char prev = 0; - for (int i = 0; index < array.length; index++) { - char c = array[index]; - if (prev != ':') { - break; - } - prev = c; - } - - if (index < array.length) { - name = new String(array, 0, index); - } else { - name = new String(array); - } - - // get the symbol descriptor - if (index < array.length) { - index++; - symbolDescriptor = array[index]; - } - - // get the type-information - if (index < array.length) { - typeInformation = new String(array, index, array.length); - } else { - typeInformation = new String(); - } - } - } - - public String makeString(long offset) { - StringBuffer buf = new StringBuffer(); - for (; offset < stabstrData.length; offset++) { - byte b = stabstrData[(int) offset]; - if (b == 0) { - break; - } - buf.append((char) b); - } - return buf.toString(); - } - - public Stabs(byte[] stab, byte[] stabstr, boolean le) { - stabData = stab; - stabstrData = stabstr; - isLe = le; - } - - public Entry[] getEntries() throws IOException { - if (entries == null) { - parse(); - } - return entries; - } - - public Entry getEntry(long addr) throws IOException { - if (entries == null) { - parse(); - } - int insertion = Arrays.binarySearch(entries, new Long(addr)); - if (insertion >= 0) { - return entries[insertion]; - } - if (insertion == -1) { - return null; - } - insertion = -insertion - 1; - Entry entry = entries[insertion - 1]; - if (addr < (entry.addr + entry.size)) { - return entries[insertion - 1]; - } - return null; - } - - void parse() throws IOException { - - List list = new ArrayList(); - - long nstab = stabData.length / StabConstant.SIZE; - int i, offset, bracket; - int includeCount = 0; - Function currentFunction = null; - String currentFile = ""; - String holder = null; - - for (bracket = i = offset = 0; i < nstab; i++, offset += StabConstant.SIZE) { - - long stroff = 0; - int type = 0; - int other = 0; - short desc = 0; - long value = 0; - String name = new String(); - - // get the offset for the string; 4 bytes - if (isLe) { - stroff = - (((stabData[offset + 3] & 0xff) << 24) - + ((stabData[offset + 2] & 0xff) << 16) - + ((stabData[offset + 1] & 0xff) << 8) - + (stabData[offset] & 0xff)); - } else { - stroff = - (((stabData[offset] & 0xff) << 24) - + ((stabData[offset + 1] & 0xff) << 16) - + ((stabData[offset + 2] & 0xff) << 8) - + (stabData[offset + 3] & 0xff)); - } - - if (stroff > 0) { - name = makeString(stroff); - } - - // Check for continuation and if any go to the next stab - // until we find a string that is not terminated with a continuation line '\\' - // According to the spec all the other fields are duplicated so we still have the data. - // From the spec continuation line on AIX is '?' - if (name.endsWith("\\") || name.endsWith("?")) { - name = name.substring(0, name.length() - 1); - if (holder == null) { - holder = name; - } else { - holder += name; - } - continue; - } else if (holder != null) { - name = holder + name; - holder = null; - } - - /* FIXME: Sometimes the special C++ names start with '.'. */ - if (name.length() > 1 && name.charAt(0) == '$') { - switch (name.charAt(1)) { - case 't' : - name = "this"; - break; - case 'v' : - /* Was: name = "vptr"; */ - break; - case 'e' : - name = "eh_throw"; - break; - case '_' : - /* This was an anonymous type that was never fixed up. */ - break; - case 'X' : - /* SunPRO (3.0 at least) static variable encoding. */ - break; - default : - name = "unknown C++ encoded name"; - break; - } - } - - // get the type; 1 byte; - type = 0xff & stabData[offset + 4]; - - // get the other - other = 0xff & stabData[offset + 5]; - - // get the desc - if (isLe) { - desc = (short) (((stabData[offset + 7] & 0xff) << 8) + (stabData[offset + 6] & 0xff)); - } else { - desc = (short) (((stabData[offset + 6] & 0xff) << 8) + (stabData[offset + 7] & 0xff)); - } - - // get the value - if (isLe) { - value = - (((stabData[offset + 11] & 0xff) << 24) - + ((stabData[offset + 10] & 0xff) << 16) - + ((stabData[offset + 9] & 0xff) << 8) - + (stabData[offset + 8] & 0xff)); - } else { - value = - (((stabData[offset + 8] & 0xff) << 24) - + ((stabData[offset + 9] & 0xff) << 16) - + ((stabData[offset + 10] & 0xff) << 8) - + (stabData[offset + 11] & 0xff)); - } - - // Parse the string - switch (type) { - case StabConstant.N_GSYM : - case StabConstant.N_LSYM : - case StabConstant.N_PSYM : - Variable variable = new Variable(name); - variable.kind = type; - variable.addr = value; - variable.startLine = desc; - variable.function = currentFunction; - variable.filename = currentFile; - list.add(variable); - if (currentFunction != null) { - currentFunction.variables.add(variable); - } - break; - case StabConstant.N_SLINE : - if (currentFunction != null) { - if (currentFunction.startLine == 0) { - currentFunction.endLine = currentFunction.startLine = desc; - } else { - currentFunction.endLine = desc; - currentFunction.size = value; - } - currentFunction.lines.add(new Integer(desc)); - } - break; - case StabConstant.N_FUN : - if (name.length() == 0) { - name = "anon"; - } - currentFunction = null; - currentFunction = new Function(name); - currentFunction.addr = value; - currentFunction.startLine = desc; - currentFunction.filename = currentFile; - list.add(currentFunction); - break; - case StabConstant.N_LBRAC : - bracket++; - break; - case StabConstant.N_RBRAC : - bracket--; - break; - case StabConstant.N_BINCL : - Include include = new Include(name); - include.index = includeCount++; - list.add(include); - break; - case StabConstant.N_EINCL : - break; - case StabConstant.N_SO : - if (name.length() == 0) { - currentFile = name; - } else { - if (currentFile != null && currentFile.endsWith("/")) { - currentFile += name; - } else { - currentFile = name; - } - } - break; - } - //System.out.println(" " + i + "\t" + Stab.type2String(type) + "\t" + other + "\t\t" + - // desc + "\t" + Long.toHexString(value) + "\t" + + stroff + "\t\t" +name); - } - entries = new Entry[list.size()]; - list.toArray(entries); - list.clear(); - Arrays.sort(entries); - } - - public void print() { - for (int i = 0; i < entries.length; i++) { - Entry entry = entries[i]; - System.out.println(entry); - } - } - - public static void main(String[] args) { - try { - Elf.Section stab = null; - Elf.Section stabstr = null; - Elf exe = new Elf(args[0]); - Elf.Section[] sections = exe.getSections(); - for (int i = 0; i < sections.length; i++) { - String name = sections[i].toString(); - if (name.equals(".stab")) { - stab = sections[i]; - } else if (name.equals(".stabstr")) { - stabstr = sections[i]; - } - } - if (stab != null && stabstr != null) { - long nstab = stab.sh_size / StabConstant.SIZE; - System.out.println("Number of stabs" + nstab); - byte[] array = stab.loadSectionData(); - byte[] strtab = stabstr.loadSectionData(); - Stabs stabs = new Stabs(array, strtab, true); - stabs.parse(); - stabs.print(); - } - } catch (IOException e) { - e.printStackTrace(); - } - - } -} diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabsAddr2line.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabsAddr2line.java deleted file mode 100644 index f6e0050adf1..00000000000 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/stabs/StabsAddr2line.java +++ /dev/null @@ -1,127 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - ***********************************************************************/ - -package org.eclipse.cdt.utils.stabs; - -import java.io.IOException; - -import org.eclipse.cdt.utils.elf.Elf; - -/** - * StabsAddr2ine - * - * @author alain - */ -public class StabsAddr2line { - - Stabs stabs; - - public StabsAddr2line(byte[] stab, byte[] stabstr, boolean le) throws IOException { - stabs = new Stabs(stab, stabstr, le); - } - - /* - * (non-Javadoc) - * - * @see IAddr2line#dispose() - */ - public void dispose() { - } - - /* - * (non-Javadoc) - * - * @see IAddr2line#getStartLine(long) - */ - public int getStartLine(long address) throws IOException { - Stabs.Entry entry = stabs.getEntry(address); - if (entry != null) { - return entry.startLine; - } - return 0; - } - - /* - * (non-Javadoc) - * - * @see IAddr2line#getEndLine(long) - */ - public int getEndLine(long address) throws IOException { - Stabs.Entry entry = stabs.getEntry(address); - if (entry != null) { - if (entry instanceof Stabs.Function) { - return ((Stabs.Function)entry).endLine; - } - return entry.startLine; - } - return 0; - } - - /* - * (non-Javadoc) - * - * @see IAddr2line#getFunction(long) - */ - public String getFunction(long address) throws IOException { - Stabs.Entry entry = stabs.getEntry(address); - if (entry != null) { - return entry.string; - } - return null; - } - - /* - * (non-Javadoc) - * - * @see IAddr2line#getFileName(long) - */ - public String getFileName(long address) throws IOException { - Stabs.Entry entry = stabs.getEntry(address); - if (entry instanceof Stabs.LocatableEntry) { - return ((Stabs.LocatableEntry)entry).filename; - } - return null; - } - - public static void main(String[] args) { - try { - Elf.Section stab = null; - Elf.Section stabstr = null; - Elf exe = new Elf(args[0]); - Elf.Section[] sections = exe.getSections(); - for (int i = 0; i < sections.length; i++) { - String name = sections[i].toString(); - if (name.equals(".stab")) { - stab = sections[i]; - } else if (name.equals(".stabstr")) { - stabstr = sections[i]; - } - } - if (stab != null && stabstr != null) { - long nstab = stab.sh_size / StabConstant.SIZE; - System.out.println("Number of stabs" + nstab); - byte[] array = stab.loadSectionData(); - byte[] strtab = stabstr.loadSectionData(); - StabsAddr2line addr2line = new StabsAddr2line(array, strtab, true); - long address = Integer.decode(args[1]).longValue(); - int startLine = addr2line.getStartLine(address); - int endLine = addr2line.getEndLine(address); - String function = addr2line.getFunction(address); - String filename = addr2line.getFileName(address); - System.out.println(Long.toHexString(address)); - System.out.println(filename + ":" + function + ":" + startLine + ":" + endLine); - } - } catch (IOException e) { - e.printStackTrace(); - } - - } -} diff --git a/core/org.eclipse.cdt.ui.tests/.classpath b/core/org.eclipse.cdt.ui.tests/.classpath deleted file mode 100644 index 7b90a41c7e6..00000000000 --- a/core/org.eclipse.cdt.ui.tests/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/core/org.eclipse.cdt.ui.tests/.cvsignore b/core/org.eclipse.cdt.ui.tests/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/core/org.eclipse.cdt.ui.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/core/org.eclipse.cdt.ui.tests/.project b/core/org.eclipse.cdt.ui.tests/.project deleted file mode 100644 index de367d9e4cb..00000000000 --- a/core/org.eclipse.cdt.ui.tests/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - org.eclipse.cdt.ui.tests - - - org.eclipse.cdt.core - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.ui.tests/ChangeLog b/core/org.eclipse.cdt.ui.tests/ChangeLog deleted file mode 100644 index 93e16940e23..00000000000 --- a/core/org.eclipse.cdt.ui.tests/ChangeLog +++ /dev/null @@ -1,599 +0,0 @@ -2003-07-17 Peter Graves - Remove the usage of the assert, as it's a reserved keyword in - Java 1.4 (Bugzilla 40377) - -2003-07-15 Peter Graves - Clean up some left over stuff that was moved into org.eclipse.cdt.core.tests, - and fixed the test.xml to point to the correct test suite. - -2003-06-25 John Camelon - Create new interface and support for calculating lineNumber/offset mapping. - Updated IASTClassSpecifier for qualified name query. - Began structuring expressions and declarators in Parser for ISourceElementRequestor. - Updated other packages to use new interfaces. - Updated automatedtests/torture test to use new line number information. - -2003-06-24 John Camelon - Updates for ISourceElementRequestor - elaborated types & enumerations. - -2003-06-23 John Camelon - Updated Factory infrastructure, constructors, etc. - Introduced Preprocessor class for transitive closure calc. client. - -2003-06-20 Sean Evoy - Moved the ManagedBuildInfo extension point to the plugin file in org.eclipse.cdt.core.tests - -2003-06-17 Brent Nicolle - Added Interface tests of IStructure.java. - -2003-06-17 Victor Mozgin - Added DeclaratorsTests.java (invocation in AllCoreTests). - Added DeclaratorsTests.cpp to org.eclipse.cdt.core.model.tests.resources. - -2003-06-16 Vladimir Hirsl - Added /build, /parser, /failures and /suite directories to the library. - Copied resources from /model/org.eclipse.cdt.core.model.tests.resources - to /model/org/clipse/cdt/core/model/tests/resources/cmodel. - Added class AISResultPrinter to format test results. - Class AutomatedIntegrationSuite now implements IPlatformRunnable. - -2003-06-16 Victor Mozgin - Added testOldKRFunctionDeclarations() to DOMTests. - Added testKRFunctionDeclarations() to TranslationUnitTests. - -2003-06-14 Victor Mozgin - Moved testBugSingleton192() from LokiFailures to DOMTests. - Added testPointersToMembers() and testPointersToMemberFunctions() to DOMTests. - Added testBug36290() and testBug36931() to DOMTests. - -2003-06-13 John Camelon - Added Class/Base infrastructure to public interfaces & requestor callback. - Moved many internal interfaces to external packages. - Organized imports. - -2003-06-13 Victor Mozgin - Renamed NullParserCallback into NullSourceElementRequester in AutomatedFramework. - -2003-06-13 John Camelon - Merged ParserSymbolTable branch back into HEAD. - -2003-06-12 John Camelon - Get rest of JUnit tests working, will merge back to HEAD branch. - -2003-06-12 John Camelon - Introduction of ASTFactory strategy, some restructuring of packages and interfaces. - -2003-06-11 Victor Mozgin - Old Java TestCase.txt and TestCase2.txt for partioning testing have been replaced with C/C++ files. - Modified AutomatedIntegrationSuite.java so it doesn't produce JUnit warning anymore. - All tests in org.eclipse.cdt.ui.tests should pass now. - -3003-06-11 Peter Graves - Update the test.xml to get the location of org.eclipse.test from a property - if set. If the property is not set, it will default to the old value. - -2003-06-11 Victor Mozgin - Added TortureTest to test CDT C++ parser with GCC testsuites. - GCC testsuites are not included. - -2003-06-10 John Camelon - Futher pursuit of the golden hammer, symbol table integration. - -2003-06-10 Brent Nicolle - Added some Interface tests of (IInclude, IMacro, IStructure). - Made sure all the Test Suites have names in the JUnit hierarchy. - -2003-06-09 John Camelon - First step in replacing IParserCallback with ISourceElementRequestor. - -2003-06-09 Victor Mozgin - Moved testBug36769() from ACEFailedTest.java to DOMTests.java. - Removed ACEFailedTest.java as it is empty now. - Added DOMTests.testBug36769B(). - -2003-06-09 Victor Mozgin - Moved testBug36932() from DOMFailedTest.java to DOMTests.java. - Added DOMTests.testBug36932B() and DOMTests.testBug36932C(). - -2003-06-09 Victor Mozgin - Moved testBug36701() from ScannerFailedTests.java to ScannerTestCase.java. - Renamed it to testBug36701A() and fixed it. - Added ScannerTestCase.testBug36701B(). - -2003-06-07 Victor Mozgin - Moved testBug36766A(), testBug36766B() & testBug36766C() from STLFailedTests.java to DOMTests.java. - Renamed them to testBug36766and36769x(), as they cover both PRs. - Added testBug36766and36769D() - test for templated destructor. - -2003-06-05 John Camelon - Moved testBug23478A() & testBug23478B() from failed tests to TranslationUnitTests.java. - Removed TranslationUnitFailedTests.java as it was empty. - -2003-05-29 Andrew Niefer - Modified tests to support eType & PtrOp changes in core - Added ParserSymbolTableTest::testTemplateParameterAsParent - Added ParserSymbolTableTest::testTemplateInstanceAsParent - Added ParserSymbolTableTest::testTemplateParameterDefaults - Added ParserSymbolTableTest::testTemplateParameterAsFunctionArgument - started ParserSymbolTableTest::incompletetestTemplateSpecialization - -2003-05-26 John Camelon - Rollback PST/Parser integration. - -2003-05-13 Andrew Niefer - Modified ParserSymbolTableTest to use new interface - -2003-05-08 Andrew Niefer - Added ParserSymbolTableTest::testMarkRollback - -2003-05-06 John Camelon - Further integration of SymbolTable into Parser, some refactoring. - -2003-05-05 John Camelon/Andrew Niefer - Added CrossReferenceTests to ParserTestSuite to test symbol-table/DOM interworking. - -2003-05-05 Andrew Niefer - Rewrote ParserSymbolTableTest to reflect structural changes to the symbol table. - -2003-05-01 Andrew Niefer - Updated FractionalAutomatedTest to use threads - Modified ScannerTestCase::testBug36287 - Added ScannerTestCase::testBug37011 - Added ScannerTestCase::testOtherPreprocessorDefines - -2003-04-28 John Camelon - Moved testBug36730() & testBug37019() from DOMFailedTests to DOMTests. - -2003-04-28 Andrew Niefer - Added DOMFailedTest::testBug37019 - Added DOMFailedTest::testBug36932 - Added ScannerFailedTest::testBug37011 - -2003-04-28 John Camelon - Added DOMTests::testOrder(). - -2003-04-28 Peter Graves - * model/org/eclipse/cdt/core/model/tests/BinaryTests: - Updated to remove a few small errors, and deal with some changes - to the core CDT - -2003-04-27 John Camelon - Added testBug36932() to DOMTests. - Moved testBugFunctor758() from LokiFailures to DOMTests. - Moved testBug36704() from DOMFailedTest to DOMTests. - Moved testBug36699() from DOMFailedTest to DOMTests. - Moved testBug36691() from DOMFailedTest to DOMTests. - -2003-04-25 Andrew Niefer - Moved ACEFailedTest::testBug36771 to DOMTests - Moved DOMFailedTest::testBug36714 to DOMTests - Updated ScannerTestCase::testBug36816 - -2003-04-25 John Camelon - Added DOMTests::testBug36852(). - Added DOMTests::testBug36764(). - Moved DOMFailedTests::testBug36702() to DOMTests(). - -2003-04-24 John Camelon - Moved fixed tests from FailedTests to DOMTests. - Added DOMTests::testBug36799(). - Cleaned up tests to reduce amount of code necessary to maintain these things. - -2003-04-24 John Camelon - Moved fixed tests from FailedTests to DOMTests. - Added LokiFailures.java to failed tests directory. - -2003-04-24 Andrew Niefer - Added AutomatedFramework.java - Added FractionalAutomatedTest (which derives from AutomatedFramework) - Refactored AutomatedTest to derive from AutomatdFramework - Added ScannerTestCase.testBug36816 - Added ScannerTestCase.testBug36255 - -2003-04-24 John Camelon - Fixed Java 1.3 compliance issue w/AutomatedTest.java - Fixed False failure in HelloWorld.java. - -2003-04-21 John Camelon - Updated DOMTests::testBug36247(). - Moved testBug36692(), testBug36703(), testBug36708(), testBug36707(), testBug36689() - and testBug36690() from DOMFailedTests to DOMTests and updated them. - -2003-04-20 John Camelon - Added DOMTests::testBug36551(). - Adjusted AutomatedTest to turn on line numbering. - Added DOMFailedTests and 11 failed test cases. - -2003-04-17 Andrew Niefer - Added ScannerTestCase::testBug36695() - Moved ScannerFailedTest::testBug36521 to ScannerTestCase::testBug36521() - Moved ScannerFailedTest::testBug36509 to ScannerTestCase::testBug36509() - Moved ScannerFailedTest::testBug36475 to ScannerTestCase::testBug36475() - Updated ScannerTestCase::testBug36047 - Updated ScannerTestCase::testBug36045 - -2003-04-17 John Camelon - Updated DOMTests::testBug36600(). - Updated LineNumberTest::testDOMLineNos(). - Added DOMTests::testBug36559(). - -2003-04-17 Andrew Niefer - Added AutomatedTest - Added resources.cFiles - Added resources.cppFiles - -2003-04-16 John Camelon - Added DOMTests::testBug36532(). - Added DOMTests::testBug36432(). - Added DOMTests::testBug36594(). - Added DOMTests::testBug36600(). - Added DOMTests::testArrayOfPointerToFunctions(). - -2003-04-15 John Camelon - Added ScannerTestCase::testBug36434(). - Added ScannerTestCase::testMultipleLines(). - Added ParserTestSuite. - Added LineNumberTest. - Updated CModelElementsTests to set the Nature of the C++ project appropriately. - -2003-04-15 Andrew Niefer - Moved ScannerFailedTest::testBug36047 to ScannerTestCase::testBug36047 - Added ScannerFailedTest::testBug36475 - -2003-04-13 John Camelon - Added DOMTests::testPointersToFunctions. - -2003-04-11 John Camelon - Added DOMTests::testBug36247(). - -2003-04-11 Andrew Niefer - Moved ScannerFailedTest::testBug36316 to ScannerTestCase::testBug36316 - Added ScannerFailedTest::testBug36047 - Added ScannerTestCase::testNestedRecursiveDefines - -2003-04-10 John Camelon - Added DOMTests::testBug36237(). - -2003-04-09 John Camelon - Removed all the old Code Model Builder source that was no longer being used (NewModelBuilder.java, etc.). - Moved all the files in parser.util directory to the dom. - Organized imports. - Added DOMTests::testTemplateDeclarationOfMethod(). - Added DOMTests::testBug36250(). - Added DOMTests::testBug36240(). - Added DOMTests::testBug36254(). - -2003-04-09 John Camelon - Updated ScannerTest::testBug36045(). - Added ScannerTest::testBug36287(). - Added DOMTests::testBug36288(). - -2003-04-06 Andrew Niefer - Added ParserSymbolTableTest::testOverloadRanking() - -2003-04-04 Alain Magloire - * src/org/eclipse/cdt/testplugin/util/VerifyDialog.java: - Remove some warnings. - -2003-04-03 John Camelon - Updated ScannerTest::testSimpleIfdef() for bug36019. - Updated ScannerTest::testNumerics() for bug36020. - Added ScannerTest::testBug36045(). - Updated DOMTests::testTemplateDeclaration() for template grammar updates. - -2003-04-01 Andrew Niefer - ParserSymbolTableTest. modifications to using declaration tests to reflect changes in the - symbol table. Also added testUserDefinedConversionSequences() - -2003-04-01 John Camelon - Added testBug35906() to DOMTests. - -2003-03-31 John Camelon - Added testStruct() to DOMTests. - Added test35892()to ScannerTest. - -2003-03-31 Andrew Niefer - In ParserSymbolTableTest, renamed testFunctionResolution_2() to testFunctionResolution_PointersAndBaseClasses(), - and modified to reflect changes in function resolution. - Added testFunctionResolution_TypedefsAndPointers(). - -2003-03-31 John Camelon - Added testWeirdStrings() and testNumerics() to ScannerTestCase. - Added testTemplateSpecialization(), testTemplateDeclaration(), testBug26467(), - testTypedef() and testTemplateInstantiation() to DOMTests. - -2003-03-28 John Camelon - Added testConstructorChain() and testASMDefinition() to DOMTests. - -2003-03-27 Alain Magloire - Changes were done in the Core Model API, the hierarchy is now - ICModel - ICProject - ICContainer - ITranslationUnit - IArchive - IBinary - We adjust the tests. - * model/org/eclipse/cdt/core/model/tests/ArchiveTests.java - * model/org/eclipse/cdt/core/model/tests/BinaryTests.java - * model/org/eclipse/cdt/core/model/tests/TranslationUniTests.java - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - -2003-03-26 Andrew Niefer - In ParserSymbolTableTest : - updated all tests to reflect TypeInfo changes - Added testFunctionResolution() & testFunctionResolution_2() in - -2003-03-25 John Camelon - Added testDeclSpecifier(), testNamespaceDefinition(), testLinkageSpecification(), - testUsingClauses() and testEnumSpecifier() to DOMTests. - -2003-03-23 John Camelon - Added ptrOperator() test to DOMTests. - Added testFunctionModifiers() test to DOMTests. - Added testArrays() test to DOMTests. - -2003-03-20 Alain Magloire - - Patch from Amer Hoda, tests for the CElement deltas for Translation Units. - * model/org/eclipse/cdt/core/model/tests/ElementDeltaTest.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-19 Alain Magloire - Patch from Amer Hoda, introducing a simple test for the core model. - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-18 John Camelon - Updated DOMTests to validate simple case of a function declaration with multiple parameters. - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - -2003-03-11 John Camelon - Updated DOMTests for core.internal.parser change of merging DeclarationSpecifier and DeclSpecifier - Organized imports - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - * parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java - -2003-03-10 John Camelon - Added macro pasting tests - -2003-03-06 Andrew Niefer - Added tests for exercising Namespaces & using directives in new parser's symbol table - -2003-03-04 Doug Schaefer - This is a pretty big patch, but it is the merge of the NewParser1 branch into the HEAD branch. lder "parser") - JUnit tests for testing various pieces (source folder "parser" in cdt.ui.tests. - -2003-01-29 Peter Graves - - Fixed the warnings when accessing static methods - * src/org/eclipse/cdt/testplugin/util/DialogCheck.java: - * src/org/eclipse/cdt/testplugin/CTestPlugin.java - * src/org/eclipse/cdt/testplugin/TestWorkbench.java - * ChangeLog: make all entries have the same formatting - -2002-12-17 Peter Graves - - * plugin.xml,test.xml: Some simple cleanups to remove refrences to the jdt and - to move closer to automated running - -2002-11-27 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java: - Use CoreModel.getDefault(). - -2002-10-30 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java (testGetNatureID): - The fields and the methods use in this test was removed from the CoreModel class. - (testHasNature): The method use in this case was refactor in the classes - CProjectNature and CCProjectNature, fix the test. - -2002-10-18 Peter Graves - - src/org/eclipse/cdt/testplugin/CProjectHelper.jada - Cleanup of the CProjectHelper file to remove unused imports, commeted out code etc. - -======= -2003-04-21 Andrew Niefer - Added DOMFailedTests::testBug36713() - Added DOMFailedTests::testBug36714() - Added DOMFailedTests::testBug36717() - Added DOMFailedTests::testBug36730() - -2003-04-21 Andrew Niefer - Added ScannerTestCase::testBug36695() - Moved ScannerFailedTest::testBug36521 to ScannerTestCase::testBug36521() - Moved ScannerFailedTest::testBug36509 to ScannerTestCase::testBug36509() - Moved ScannerFailedTest::testBug36475 to ScannerTestCase::testBug36475() - Updated ScannerTestCase::testBug36047 - Updated ScannerTestCase::testBug36045 - -2003-04-20 John Camelon - Added DOMTests::testBug36551(). - Adjusted AutomatedTest to turn on line numbering. - Added DOMFailedTests and 11 failed test cases. - -2003-04-17 John Camelon - Updated DOMTests::testBug36600(). - Updated LineNumberTest::testDOMLineNos(). - Added DOMTests::testBug36559(). - -2003-04-17 Andrew Niefer - Added AutomatedTest - Added resources.cFiles - Added resources.cppFiles - -2003-04-16 John Camelon - Added DOMTests::testBug36532(). - Added DOMTests::testBug36432(). - Added DOMTests::testBug36594(). - Added DOMTests::testBug36600(). - Added DOMTests::testArrayOfPointerToFunctions(). - -2003-04-15 John Camelon - Added ScannerTestCase::testBug36434(). - Added ScannerTestCase::testMultipleLines(). - Added ParserTestSuite. - Added LineNumberTest. - Updated CModelElementsTests to set the Nature of the C++ project appropriately. - -2003-04-15 Andrew Niefer - Moved ScannerFailedTest::testBug36047 to ScannerTestCase::testBug36047 - Added ScannerFailedTest::testBug36475 - -2003-04-13 John Camelon - Added DOMTests::testPointersToFunctions. - -2003-04-11 John Camelon - Added DOMTests::testBug36247(). - -2003-04-11 Andrew Niefer - Moved ScannerFailedTest::testBug36316 to ScannerTestCase::testBug36316 - Added ScannerFailedTest::testBug36047 - Added ScannerTestCase::testNestedRecursiveDefines - -2003-04-10 John Camelon - Added DOMTests::testBug36237(). - -2003-04-09 John Camelon - Removed all the old Code Model Builder source that was no longer being used (NewModelBuilder.java, etc.). - Moved all the files in parser.util directory to the dom. - Organized imports. - Added DOMTests::testTemplateDeclarationOfMethod(). - Added DOMTests::testBug36250(). - Added DOMTests::testBug36240(). - Added DOMTests::testBug36254(). - -2003-04-09 John Camelon - Updated ScannerTest::testBug36045(). - Added ScannerTest::testBug36287(). - Added DOMTests::testBug36288(). - -2003-04-06 Andrew Niefer - Added ParserSymbolTableTest::testOverloadRanking() - -2003-04-04 Alain Magloire - * src/org/eclipse/cdt/testplugin/util/VerifyDialog.java: - Remove some warnings. - -2003-04-03 John Camelon - Updated ScannerTest::testSimpleIfdef() for bug36019. - Updated ScannerTest::testNumerics() for bug36020. - Added ScannerTest::testBug36045(). - Updated DOMTests::testTemplateDeclaration() for template grammar updates. - -2003-04-01 Andrew Niefer - ParserSymbolTableTest. modifications to using declaration tests to reflect changes in the - symbol table. Also added testUserDefinedConversionSequences() - -2003-04-01 John Camelon - Added testBug35906() to DOMTests. - -2003-03-31 John Camelon - Added testStruct() to DOMTests. - Added test35892()to ScannerTest. - -2003-03-31 Andrew Niefer - In ParserSymbolTableTest, renamed testFunctionResolution_2() to testFunctionResolution_PointersAndBaseClasses(), - and modified to reflect changes in function resolution. - Added testFunctionResolution_TypedefsAndPointers(). - -2003-03-31 John Camelon - Added testWeirdStrings() and testNumerics() to ScannerTestCase. - Added testTemplateSpecialization(), testTemplateDeclaration(), testBug26467(), - testTypedef() and testTemplateInstantiation() to DOMTests. - -2003-03-28 John Camelon - Added testConstructorChain() and testASMDefinition() to DOMTests. - -2003-03-27 Alain Magloire - Changes were done in the Core Model API, the hierarchy is now - ICModel - ICProject - ICContainer - ITranslationUnit - IArchive - IBinary - We adjust the tests. - * model/org/eclipse/cdt/core/model/tests/ArchiveTests.java - * model/org/eclipse/cdt/core/model/tests/BinaryTests.java - * model/org/eclipse/cdt/core/model/tests/TranslationUniTests.java - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - -2003-03-26 Andrew Niefer - In ParserSymbolTableTest : - updated all tests to reflect TypeInfo changes - Added testFunctionResolution() & testFunctionResolution_2() in - -2003-03-25 John Camelon - Added testDeclSpecifier(), testNamespaceDefinition(), testLinkageSpecification(), - testUsingClauses() and testEnumSpecifier() to DOMTests. - -2003-03-23 John Camelon - Added ptrOperator() test to DOMTests. - Added testFunctionModifiers() test to DOMTests. - Added testArrays() test to DOMTests. - -2003-03-20 Alain Magloire - - Patch from Amer Hoda, tests for the CElement deltas for Translation Units. - * model/org/eclipse/cdt/core/model/tests/ElementDeltaTest.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-19 Alain Magloire - Patch from Amer Hoda, introducing a simple test for the core model. - * model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java - * model/org/eclipse/cdt/core/model/tests/resource/WorkingCopyTestStart.h - -2003-03-18 John Camelon - Updated DOMTests to validate simple case of a function declaration with multiple parameters. - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - -2003-03-11 John Camelon - Updated DOMTests for core.internal.parser change of merging DeclarationSpecifier and DeclSpecifier - Organized imports - * parser/org/eclipse/cdt/core/parser/tests/DOMTests.java - * parser/org/eclipse/cdt/core/parser/tests/ParserSymbolTableTest.java - -2003-03-10 John Camelon - Added macro pasting tests - -2003-03-06 Andrew Niefer - Added tests for exercising Namespaces & using directives in new parser's symbol table - -2003-03-04 Doug Schaefer - This is a pretty big patch, but it is the merge of the NewParser1 branch into the HEAD branch. lder "parser") - JUnit tests for testing various pieces (source folder "parser" in cdt.ui.tests. - -2003-01-29 Peter Graves - - Fixed the warnings when accessing static methods - * src/org/eclipse/cdt/testplugin/util/DialogCheck.java: - * src/org/eclipse/cdt/testplugin/CTestPlugin.java - * src/org/eclipse/cdt/testplugin/TestWorkbench.java - * ChangeLog: make all entries have the same formatting - -2002-12-17 Peter Graves - - * plugin.xml,test.xml: Some simple cleanups to remove refrences to the jdt and - to move closer to automated running - -2002-11-27 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java: - Use CoreModel.getDefault(). - -2002-10-30 Alain Magloire - - * model/org/eclipse/cdt/core/model/tests/CModelTests.java (testGetNatureID): - The fields and the methods use in this test was removed from the CoreModel class. - (testHasNature): The method use in this case was refactor in the classes - CProjectNature and CCProjectNature, fix the test. - -2002-10-18 Peter Graves - - src/org/eclipse/cdt/testplugin/CProjectHelper.jada - Cleanup of the CProjectHelper file to remove unused imports, commeted out code etc. - ->>>>>>> 1.36 diff --git a/core/org.eclipse.cdt.ui.tests/about.html b/core/org.eclipse.cdt.ui.tests/about.html deleted file mode 100644 index fad1e4a429b..00000000000 --- a/core/org.eclipse.cdt.ui.tests/about.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            20th June, 2002

            -

            License

            -

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

            - -

            Third Party Content

            - -

            The Content includes items that may be have been sourced from third parties as follows:

            - -

            JUnit 3.7

            -

            The plug-in is based on software developed by JUnit.org. Your use of JUnit 3.7 in both source and binary code -form contained in the plug-in is subject to the terms and conditions of the IBM Public License 1.0 which is available at -http://oss.software.ibm.com/developerworks/opensource/license10.html. -The source code is located in testresources/junit37-noUI-src.zip.

            - -

            i) IBM effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

            -

            ii) IBM effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

            -

            iii) IBM states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/build.properties b/core/org.eclipse.cdt.ui.tests/build.properties deleted file mode 100644 index 66865c3199e..00000000000 --- a/core/org.eclipse.cdt.ui.tests/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -source.cdtuitests.jar = src/,\ - ui/,\ - core/ -bin.includes = plugin.xml,\ - about.html,\ - plugin.properties,\ - test.xml,\ - cdtuitests.jar -src.includes = plugin.xml,\ - about.html,\ - plugin.properties,\ - test.xml -about.html = diff --git a/core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java b/core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java deleted file mode 100644 index 8b6292d2e20..00000000000 --- a/core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java +++ /dev/null @@ -1,472 +0,0 @@ -/* - * Copyright (c) 2002 IBM Corp. All rights reserved. - * This file is made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - */ - -package org.eclipse.cdt.ui.tests.textmanipulation; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.internal.corext.textmanipulation.MoveTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.SimpleTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.SwapTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBuffer; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBufferEditor; -import org.eclipse.cdt.internal.corext.textmanipulation.TextRange; -import org.eclipse.cdt.internal.corext.textmanipulation.UndoMemento; -import org.eclipse.cdt.testplugin.TestPluginLauncher; - - - -public class TextBufferTest extends TestCase { - - private static final Class THIS= TextBufferTest.class; - - private TextBuffer fBuffer; - private TextBufferEditor fEditor; - - public TextBufferTest(String name) { - super(name); - } - - public static void main(String[] args) { - TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), THIS, args); - } - - public static Test suite() { - TestSuite result= new TestSuite(THIS); - if (false) { // For hot code replace when debugging test cases - result.addTestSuite(THIS); - result.addTestSuite(THIS); - result.addTestSuite(THIS); - result.addTestSuite(THIS); - result.addTestSuite(THIS); - result.addTestSuite(THIS); - } - return result; - } - - protected void setUp() throws Exception { - fBuffer= TextBuffer.create("0123456789"); - fEditor= new TextBufferEditor(fBuffer); - } - - protected void tearDown() throws Exception { - fEditor= null; - } - - public void testOverlap1() throws Exception { - // [ [ ] ] - fEditor.add(SimpleTextEdit.createReplace(0, 2, "01")); - fEditor.add(SimpleTextEdit.createReplace(1, 2, "12")); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testOverlap2() throws Exception { - // [[ ] ] - fEditor.add(SimpleTextEdit.createReplace(0, 2, "01")); - fEditor.add(SimpleTextEdit.createReplace(0, 1, "0")); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testOverlap3() throws Exception { - // [ [ ]] - fEditor.add(SimpleTextEdit.createReplace(0, 2, "01")); - fEditor.add(SimpleTextEdit.createReplace(1, 1, "1")); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testOverlap4() throws Exception { - // [ [ ] ] - fEditor.add(SimpleTextEdit.createReplace(0, 3, "012")); - fEditor.add(SimpleTextEdit.createReplace(1, 1, "1")); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testOverlap5() throws Exception { - // [ [] ] - fEditor.add(SimpleTextEdit.createReplace(0, 3, "012")); - fEditor.add(SimpleTextEdit.createInsert(1, "xx")); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testOverlap6() throws Exception { - // [ [] ] - fEditor.add(SimpleTextEdit.createReplace(0, 3, "012")); - fEditor.add(SimpleTextEdit.createInsert(2, "xx")); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testOverlap7() throws Exception { - boolean catched= false; - try { - new MoveTextEdit(2,5,3); - } catch (Exception e) { - catched= true; - } - assertTrue(catched); - } - - public void testOverlap8() throws Exception { - boolean catched= false; - try { - new MoveTextEdit(2,5,6); - } catch (Exception e) { - catched= true; - } - assertTrue(catched); - } - - public void testOverlap9() throws Exception { - MoveTextEdit e1= new MoveTextEdit(3, 1, 7); - MoveTextEdit e2= new MoveTextEdit(2, 3, 8); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(!fEditor.canPerformEdits()); - } - - public void testInsert1() throws Exception { - // [][ ] - SimpleTextEdit e1= SimpleTextEdit.createInsert(2, "yy"); - SimpleTextEdit e2= SimpleTextEdit.createReplace(2, 3, "3456"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTextRange(), 2, 2); - tb_assert(e2.getTextRange(), 4, 4); - assertEquals("Buffer content", "01yy345656789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 2, 0); - tb_assert(e2.getTextRange(), 2, 3); - } - - public void testInsert2() throws Exception { - // [][] - SimpleTextEdit e1= SimpleTextEdit.createInsert(2, "yy"); - SimpleTextEdit e2= SimpleTextEdit.createInsert(2, "xx"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTextRange(), 2, 2); - tb_assert(e2.getTextRange(), 4, 2); - assertEquals("Buffer content", "01yyxx23456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 2, 0); - tb_assert(e2.getTextRange(), 2, 0); - } - - public void testInsert3() throws Exception { - // [ ][][ ] - SimpleTextEdit e1= SimpleTextEdit.createReplace(0, 2, "011"); - SimpleTextEdit e2= SimpleTextEdit.createInsert(2, "xx"); - SimpleTextEdit e3= SimpleTextEdit.createReplace(2, 2, "2"); - fEditor.add(e1); - fEditor.add(e2); - fEditor.add(e3); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTextRange(), 0, 3); - tb_assert(e2.getTextRange(), 3, 2); - tb_assert(e3.getTextRange(), 5, 1); - assertEquals("Buffer content", "011xx2456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 0, 2); - tb_assert(e2.getTextRange(), 2, 0); - tb_assert(e3.getTextRange(), 2, 2); - } - - public void testInsert4() throws Exception { - SimpleTextEdit e1= SimpleTextEdit.createInsert(0, "xx"); - fEditor.add(e1); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer length", 12, fBuffer.getLength()); - tb_assert(e1.getTextRange(), 0, 2); - assertEquals("Buffer content", "xx0123456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 0, 0); - } - - public void testInsert5() throws Exception { - SimpleTextEdit e1= SimpleTextEdit.createInsert(10, "xx"); - fEditor.add(e1); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer length", 12, fBuffer.getLength()); - tb_assert(e1.getTextRange(), 10, 2); - assertEquals("Buffer content", "0123456789xx", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 10, 0); - } - - public void testDelete1() throws Exception { - SimpleTextEdit e1= SimpleTextEdit.createDelete(3, 1); - fEditor.add(e1); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTextRange(), 3, 0); - assertEquals("Buffer content", "012456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 3, 1); - } - - public void testDelete2() throws Exception { - SimpleTextEdit e1= SimpleTextEdit.createDelete(4, 1); - SimpleTextEdit e2= SimpleTextEdit.createDelete(3, 1); - SimpleTextEdit e3= SimpleTextEdit.createDelete(5, 1); - fEditor.add(e1); - fEditor.add(e2); - fEditor.add(e3); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTextRange(), 3, 0); - tb_assert(e2.getTextRange(), 3, 0); - tb_assert(e3.getTextRange(), 3, 0); - assertEquals("Buffer content", "0126789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 4, 1); - tb_assert(e2.getTextRange(), 3, 1); - tb_assert(e3.getTextRange(), 5, 1); - } - - public void testDelete3() throws Exception { - SimpleTextEdit e1= SimpleTextEdit.createInsert(3, "x"); - SimpleTextEdit e2= SimpleTextEdit.createDelete(3, 1); - fEditor.add(e1); - fEditor.add(e2); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTextRange(), 3, 1); - tb_assert(e2.getTextRange(), 4, 0); - assertEquals("Buffer content", "012x456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getTextRange(), 3, 0); - tb_assert(e2.getTextRange(), 3, 1); - } - - public void testMove1() throws Exception { - MoveTextEdit e1= new MoveTextEdit(2, 2, 5); - fEditor.add(e1); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0142356789", fBuffer.getContent()); - tb_assert(e1.getTargetRange(), 3, 2); - tb_assert(e1.getSourceRange(), 2, 0); - doUndo(undo); - tb_assert(e1.getSourceRange(), 2, 2); - tb_assert(e1.getTargetRange(), 5, 0); - } - - public void testMove2() throws Exception { - MoveTextEdit e1= new MoveTextEdit(5, 2, 2); - fEditor.add(e1); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0156234789", fBuffer.getContent()); - tb_assert(e1.getTargetRange(), 2, 2); - tb_assert(e1.getSourceRange(), 7, 0); - doUndo(undo); - tb_assert(e1.getSourceRange(), 5, 2); - tb_assert(e1.getTargetRange(), 2, 0); - } - - public void testMove3() throws Exception { - MoveTextEdit e1= new MoveTextEdit(2, 2, 7); - SimpleTextEdit e2= SimpleTextEdit.createReplace(4, 1, "x"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "01x5623789", fBuffer.getContent()); - tb_assert(e1.getTargetRange(), 5, 2); - tb_assert(e1.getSourceRange(), 2, 0); - tb_assert(e2.getTextRange(), 2, 1); - doUndo(undo); - tb_assert(e1.getSourceRange(), 2, 2); - tb_assert(e1.getTargetRange(), 7, 0); - tb_assert(e2.getTextRange(), 4, 1); - } - - public void testMove4() throws Exception { - MoveTextEdit e1= new MoveTextEdit(7, 2, 2); - SimpleTextEdit e2= SimpleTextEdit.createReplace(5, 1, "x"); - fEditor.add(e2); - fEditor.add(e1); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0178234x69", fBuffer.getContent()); - tb_assert(e1.getTargetRange(), 2, 2); - tb_assert(e1.getSourceRange(), 9, 0); - tb_assert(e2.getTextRange(), 7, 1); - doUndo(undo); - tb_assert(e1.getSourceRange(), 7, 2); - tb_assert(e1.getTargetRange(), 2, 0); - tb_assert(e2.getTextRange(), 5, 1); - } - - public void testMove5() throws Exception { - // Move onto itself - MoveTextEdit e1= new MoveTextEdit(2, 1, 3); - SimpleTextEdit e2= SimpleTextEdit.createReplace(2,1,"x"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTargetRange(), 2, 1); - tb_assert(e1.getSourceRange(), 3, 0); - tb_assert(e2.getTextRange(), 2, 1); - assertEquals("Buffer content", "01x3456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getSourceRange(), 2, 1); - tb_assert(e1.getTargetRange(), 3, 0); - tb_assert(e2.getTextRange(), 2, 1); - } - - public void testMove6() throws Exception { - // Move onto itself - MoveTextEdit e1= new MoveTextEdit(2, 1, 2); - SimpleTextEdit e2= SimpleTextEdit.createReplace(2,1,"x"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTargetRange(), 2, 1); - tb_assert(e1.getSourceRange(), 3, 0); // This gets normalized since a move from [2,1] -> 2 == [2,1] -> 3 - tb_assert(e2.getTextRange(), 2, 1); - assertEquals("Buffer content", "01x3456789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getSourceRange(), 2, 1); - tb_assert(e1.getTargetRange(), 3, 0); - tb_assert(e2.getTextRange(), 2, 1); - } - - public void testMove7() throws Exception { - MoveTextEdit e1= new MoveTextEdit(2, 3, 7); - SimpleTextEdit e2= SimpleTextEdit.createReplace(3, 1, "x"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "01562x4789", fBuffer.getContent()); - tb_assert(e1.getTargetRange(), 4, 3); - tb_assert(e1.getSourceRange(), 2, 0); - tb_assert(e2.getTextRange(), 5, 1); - doUndo(undo); - tb_assert(e1.getSourceRange(), 2, 3); - tb_assert(e1.getTargetRange(), 7, 0); - tb_assert(e2.getTextRange(), 3, 1); - } - - public void testMove8() throws Exception { - MoveTextEdit e1= new MoveTextEdit(5, 3, 1); - SimpleTextEdit e2= SimpleTextEdit.createReplace(6, 1, "x"); - fEditor.add(e2); - fEditor.add(e1); - assertTrue(fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "05x7123489", fBuffer.getContent()); - tb_assert(e1.getTargetRange(), 1, 3); - tb_assert(e1.getSourceRange(), 8, 0); - tb_assert(e2.getTextRange(), 2, 1); - doUndo(undo); - tb_assert(e1.getSourceRange(), 5, 3); - tb_assert(e1.getTargetRange(), 1, 0); - tb_assert(e2.getTextRange(), 6, 1); - } - - public void testMove9() throws Exception { - MoveTextEdit e1= new MoveTextEdit(1, 1, 3); - MoveTextEdit e2= new MoveTextEdit(1, 3, 5); - fEditor.add(e1); - fEditor.add(e2); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - tb_assert(e1.getTargetRange(), 3, 1); - tb_assert(e1.getSourceRange(), 2, 0); - tb_assert(e2.getTargetRange(), 2, 3); - tb_assert(e2.getSourceRange(), 1, 0); - assertEquals("Buffer content", "0421356789", fBuffer.getContent()); - doUndo(undo); - tb_assert(e1.getSourceRange(), 1, 1); - tb_assert(e1.getTargetRange(), 3, 0); - tb_assert(e2.getSourceRange(), 1, 3); - tb_assert(e2.getTargetRange(), 5, 0); - } - - public void testMove10() throws Exception { - MoveTextEdit e1= new MoveTextEdit(2, 2, 8); - MoveTextEdit e2= new MoveTextEdit(5, 2, 1); - fEditor.add(e1); - fEditor.add(e2); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0561472389", fBuffer.getContent()); - doUndo(undo); - } - - public void testSwap1() throws Exception { - SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1); - fEditor.add(e1); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0321456789", fBuffer.getContent()); - doUndo(undo); - } - - public void testSwap2() throws Exception { - SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1); - SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1); - fEditor.add(e1); - fEditor.add(e2); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0321476589", fBuffer.getContent()); - doUndo(undo); - } - - public void testSwap3() throws Exception { - SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1); - SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1); - SwapTextEdit e3= new SwapTextEdit(1, 3, 5, 3); - fEditor.add(e1); - fEditor.add(e2); - fEditor.add(e3); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "0765432189", fBuffer.getContent()); - doUndo(undo); - } - - public void testSwapAndReplace() throws Exception { - SwapTextEdit e1= new SwapTextEdit(1, 3, 5, 3); - SimpleTextEdit e2= SimpleTextEdit.createReplace(6, 1, "ab"); - fEditor.add(e1); - fEditor.add(e2); - assertTrue("Can perform edits", fEditor.canPerformEdits()); - UndoMemento undo= fEditor.performEdits(null); - assertEquals("Buffer content", "05ab7412389", fBuffer.getContent()); - doUndo(undo); - } - - private void doUndo(UndoMemento undo) throws Exception { - fEditor.add(undo); - fEditor.performEdits(null); - assertBufferContent(); - } - - private void tb_assert(TextRange r, int offset, int length) { - assertEquals("Offset", offset, r.getOffset()); - assertEquals("Length", length, r.getLength()); - } - - private void assertBufferContent() { - assertEquals("Buffer content restored", "0123456789", fBuffer.getContent()); - } -} - diff --git a/core/org.eclipse.cdt.ui.tests/plugin.xml b/core/org.eclipse.cdt.ui.tests/plugin.xml deleted file mode 100644 index 69f1bbfc36b..00000000000 --- a/core/org.eclipse.cdt.ui.tests/plugin.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java deleted file mode 100644 index b6b239f11a9..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import org.eclipse.swt.graphics.Image; - -import org.eclipse.jface.viewers.ILabelDecorator; -import org.eclipse.jface.viewers.LabelProvider; - -/** - * Allows to test decorators for Java elements - */ -public class CElementDecorator extends LabelProvider implements ILabelDecorator { - - /* - * @see ILabelDecorator#decorateImage(Image, Object) - */ - public Image decorateImage(Image image, Object element) { - return null; - } - - /* - * @see ILabelDecorator#decorateText(String, Object) - */ - public String decorateText(String text, Object element) { - return text + "*"; - } -} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java deleted file mode 100644 index 98b399254c8..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import java.io.File; -import java.io.IOException; -import java.net.URL; - -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceDescription; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Plugin; - - -public class CTestPlugin extends Plugin { - - private static CTestPlugin fgDefault; - - public CTestPlugin(IPluginDescriptor descriptor) { - super(descriptor); - fgDefault= this; - } - - public static CTestPlugin getDefault() { - return fgDefault; - } - - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - public static void enableAutobuild(boolean enable) throws CoreException { - // disable auto build - IWorkspace workspace= CTestPlugin.getWorkspace(); - IWorkspaceDescription desc= workspace.getDescription(); - desc.setAutoBuilding(enable); - workspace.setDescription(desc); - } - - public File getFileInPlugin(IPath path) { - try { - URL installURL= new URL(getDescriptor().getInstallURL(), path.toString()); - URL localURL= Platform.asLocalURL(installURL); - return new File(localURL.getFile()); - } catch (IOException e) { - return null; - } - } - - - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java deleted file mode 100644 index 2843c2703b7..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import junit.extensions.TestSetup; -import junit.framework.Test; - - - -public class CTestSetup extends TestSetup { - - /** - * @deprecated - * Not needed anymore. No added value - */ - public CTestSetup(Test test) { - super(test); - } - - protected void setUp() throws Exception { - } - - protected void tearDown() throws Exception { - } - - - - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java deleted file mode 100644 index a6d6af47ca0..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java +++ /dev/null @@ -1,528 +0,0 @@ -package org.eclipse.cdt.testplugin; - -// copied from startup.jar. planned to be removed soon - - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.net.*; -import java.lang.reflect.*; -import java.io.*; -import java.util.*; -/** - * Startup class for Eclipse. Creates a class loader using - * supplied URL of platform installation, loads and calls - * the Eclipse Boot Loader. The startup arguments are as follows: - *
            - *
            - * -application <id>: the identifier of the application to run - *
            - *
            - * -boot <location>: the location, expressed as a URL, of the platform's boot.jar - *
            - *
            - * -consolelog : enables log to the console. Handy when combined with -debug - *
            - *
            - * -data <location>: sets the workspace location and the default location for projects - *
            - *
            - * -debug [options file]: turns on debug mode for the platform and optionally specifies a location - * for the .options file. This file indicates what debug points are available for a - * plug-in and whether or not they are enabled. If a location is not specified, the platform searches - * for the .options file under the install directory - *
            - *
            - * -dev [entries]: turns on dev mode and optionally specifies comma-separated class path entries - * which are added to the class path of each plug-in - *
            - *
            - * -keyring <location>: the location of the authorization database on disk. This argument - * has to be used together with the -password argument - *
            - *
            - * -password <passwd>: the password for the authorization database - *
            - *
            - * -plugins <location>: The arg is a URL pointing to a file which specs the plugin - * path for the platform. The file is in property file format where the keys are user-defined - * names and the values are comma separated lists of either explicit paths to plugin.xml - * files or directories containing plugins. (e.g., .../eclipse/plugins). - *
            - *
            - * -ws <window system>: sets the window system value - *
            - *
            - */ -public class Main { - /** - * Indicates whether this instance is running in debug mode. - */ - protected boolean debug = false; - - /** - * The location of the launcher to run. - */ - protected String bootLocation = null; - - /** - * The identifier of the application to run. - */ - protected String application; - - /** - * The path for finding find plugins. - */ - protected URL pluginPathLocation; - - /** - * The boot path location. - */ - protected String location; - - /** - * Indicates whether items for UNinstallation should be looked for. - */ - protected boolean uninstall = false; - - /** - * The item to be uninstalled. - */ - protected String uninstallCookie; - - /** - * The class path entries. - */ - protected String devClassPath = null; - - /** - * Indicates whether this instance is running in development mode. - */ - protected boolean inDevelopmentMode = false; - - // static token describing how to take down the splash screen - private static String endSplash = null; - - // constants - private static final String APPLICATION = "-application"; - private static final String BOOT = "-boot"; - private static final String DEBUG = "-debug"; - private static final String DEV = "-dev"; - private static final String ENDSPLASH = "-endsplash"; - private static final String UNINSTALL = "-uninstall"; - private static final String PI_BOOT = "org.eclipse.core.boot"; - private static final String BOOTLOADER = "org.eclipse.core.boot.BootLoader"; - private static final String UPDATELOADER = "org.eclipse.core.internal.boot.LaunchInfo"; - - // The project containing the boot loader code. This is used to construct - // the correct class path for running in VAJ and VAME. - private static final String PROJECT_NAME = "Eclipse Core Boot"; - - private static boolean inVAJ; - static { - try { - Class.forName("com.ibm.uvm.lang.ProjectClassLoader"); - inVAJ = true; - } catch (Exception e) { - inVAJ = false; - } - } - private static boolean inVAME; - static { - try { - Class.forName("com.ibm.eclipse.core.VAME"); - inVAME = true; - } catch (Exception e) { - inVAME = false; - } - } - -/** - * Executes the launch. - * - * @return the result of performing the launch - * @param args command-line arguments - * @exception Exception thrown if a problem occurs during the launch - */ -protected Object basicRun(String[] args) throws Exception { - Class clazz = getBootLoader(bootLocation); - Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, URL.class, String.class, String[].class }); - try { - return method.invoke(clazz, new Object[] { application, pluginPathLocation, location, args }); - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof Error) - throw (Error) e.getTargetException(); - else - throw e; - } -} - -/** - * Returns the result of converting a list of comma-separated tokens into an array - * - * @return the array of string tokens - * @param prop the initial comma-separated string - */ -private String[] getArrayFromList(String prop) { - if (prop == null || prop.trim().equals("")) - return new String[0]; - Vector list = new Vector(); - StringTokenizer tokens = new StringTokenizer(prop, ","); - while (tokens.hasMoreTokens()) { - String token = tokens.nextToken().trim(); - if (!token.equals("")) - list.addElement(token); - } - return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[0]); -} -/** - * Creates and returns a platform BootLoader which can be used to start - * up and run the platform. The given base, if not null, - * is the location of the boot loader code. If the value is null - * then the boot loader is located relative to this class. - * - * @return the new boot loader - * @param base the location of the boot loader - */ -public Class getBootLoader(String base) throws Exception { - URLClassLoader loader = new URLClassLoader(getBootPath(base), null); - return loader.loadClass(BOOTLOADER); -} -/** - * Returns the URL-based class path describing where the boot classes - * are located when running in development mode. - * - * @return the url-based class path - * @param base the base location - * @exception MalformedURLException if a problem occurs computing the class path - */ -protected URL[] getDevPath(URL base) throws MalformedURLException { - URL url; - String devBase = base.toExternalForm(); - if (!inDevelopmentMode) { - url = new URL(devBase + "boot.jar"); - return new URL[] {url}; - } - String[] locations = getArrayFromList(devClassPath); - ArrayList result = new ArrayList(locations.length); - for (int i = 0; i < locations.length; i++) { - String spec = devBase + locations[i]; - char lastChar = spec.charAt(spec.length() - 1); - if ((spec.endsWith(".jar") || (lastChar == '/' || lastChar == '\\'))) - url = new URL (spec); - else - url = new URL(spec + "/"); - //make sure URL exists before adding to path - if (new java.io.File(url.getFile()).exists()) - result.add(url); - } - url = new URL(devBase + "boot.jar"); - if (new java.io.File(url.getFile()).exists()) - result.add(url); - return (URL[])result.toArray(new URL[result.size()]); -} - -/** - * Returns the URL-based class path describing where the boot classes are located. - * - * @return the url-based class path - * @param base the base location - * @exception MalformedURLException if a problem occurs computing the class path - */ -protected URL[] getBootPath(String base) throws MalformedURLException { - URL url = null; - // if the given location is not null, assume it is correct and use it. - if (base != null) { - url = new URL(base); - if (debug) - System.out.println("Boot URL: " + url.toExternalForm()); - return new URL[] {url}; - } - // Create a URL based on the location of this class' code. - // strip off jar file and/or last directory to get - // to the directory containing projects. - URL[] result = null; - url = getClass().getProtectionDomain().getCodeSource().getLocation(); - String path = url.getFile(); - if (path.endsWith(".jar")) - path = path.substring(0, path.lastIndexOf("/")); - else - if (path.endsWith("/")) - path = path.substring(0, path.length() - 1); - if (inVAJ || inVAME) { - int ix = path.lastIndexOf("/"); - path = path.substring(0, ix + 1); - path = path + PROJECT_NAME + "/"; - url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); - result = new URL[] {url}; - } else { - path = searchForPlugins(path); - path = searchForBoot(path); - // add on any dev path elements - url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); - result = getDevPath(url); - } - if (debug) { - System.out.println("Boot URL:"); - for (int i = 0; i < result.length; i++) - System.out.println(" " + result[i].toExternalForm()); - } - return result; -} - -/** - * Searches for a plugins root starting at a given location. If one is - * found then this location is returned; otherwise an empty string is - * returned. - * - * @return the location where plugins were found, or an empty string - * @param start the location to begin searching at - */ -protected String searchForPlugins(String start) { - File path = new File(start); - while (path != null) { - File test = new File(path, "plugins"); - if (test.exists()) - return test.toString(); - path = path.getParentFile(); - path = (path == null || path.length() == 1) ? null : path; - } - return ""; -} -/** - * Searches for a boot directory starting at a given location. If one - * is found then this location is returned; otherwise an empty string - * is returned. - * - * @return the location where plugins were found, or an empty string - * @param start the location to begin searching at - */ -protected String searchForBoot(String start) { - FileFilter filter = new FileFilter() { - public boolean accept(File candidate) { - return candidate.getName().startsWith(PI_BOOT); - } - }; - File[] boots = new File(start).listFiles(filter); - String result = null; - String maxVersion = null; - for (int i = 0; i < boots.length; i++) { - String name = boots[i].getName(); - int index = name.lastIndexOf('_'); - if (index == -1) { - result = boots[i].getAbsolutePath(); - i = boots.length; - } else { - if (index > 0) { - String version = name.substring(index + 1); - if (maxVersion == null) { - result = boots[i].getAbsolutePath(); - maxVersion = version; - } else - if (maxVersion.compareTo(version) == -1) { - result = boots[i].getAbsolutePath(); - maxVersion = version; - } - } - } - } - if (result == null) - throw new RuntimeException("Could not find bootstrap code. Check location of boot plug-in or specify -boot."); - return result.replace(File.separatorChar, '/') + "/"; -} -/** - * Returns the update loader for the given boot path. - * - * @return the update loader - * @param base the boot path base - * @exception Exception thrown is a problem occurs determining this loader - */ -public Class getUpdateLoader(String base) throws Exception { - URLClassLoader loader = new URLClassLoader(getBootPath(base), null); - return loader.loadClass(UPDATELOADER); -} -/** - * Runs the platform with the given arguments. The arguments must identify - * an application to run (e.g., -application com.example.application). - * After running the application System.exit(N) is executed. - * The value of N is derived from the value returned from running the application. - * If the application's return value is an Integer, N is this value. - * In all other cases, N = 0. - *

            - * Clients wishing to run the platform without a following System.exit - * call should use run(). - * - * @see #run - * - * @param args the command line arguments - */ -public static void main(String[] args) { - Object result = null; - try { - result = new Main().run(args); - } catch (Throwable e) { - // try and take down the splash screen. - endSplash(); - System.out.println("Exception launching the Eclipse Platform:"); - e.printStackTrace(); - } - int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0; - System.exit(exitCode); -} -/** - * Tears down the currently-displayed splash screen. - */ -public static void endSplash() { - if (endSplash == null) - return; - try { - Runtime.getRuntime().exec(endSplash); - } catch (Exception e) { - } -} - -/** - * Runs this launcher with the arguments specified in the given string. - * - * @param argString the arguments string - * @exception Exception thrown if a problem occurs during launching - */ -public static void main(String argString) throws Exception { - Vector list = new Vector(5); - for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) - list.addElement((String) tokens.nextElement()); - main((String[]) list.toArray(new String[list.size()])); -} - -/** - * Processes the command line arguments - * - * @return the arguments to pass through to the launched application - * @param args the command line arguments - */ -protected String[] processCommandLine(String[] args) throws Exception { - int[] configArgs = new int[100]; - configArgs[0] = -1; // need to initialize the first element to something that could not be an index. - int configArgIndex = 0; - for (int i = 0; i < args.length; i++) { - boolean found = false; - // check for args without parameters (i.e., a flag arg) - // check if debug should be enabled for the entire platform - if (args[i].equalsIgnoreCase(DEBUG)) { - debug = true; - // passed thru this arg (i.e., do not set found = true - continue; - } - - // check if development mode should be enabled for the entire platform - // If this is the last arg or there is a following arg (i.e., arg+1 has a leading -), - // simply enable development mode. Otherwise, assume that that the following arg is - // actually some additional development time class path entries. This will be processed below. - if (args[i].equalsIgnoreCase(DEV) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) { - inDevelopmentMode = true; - // do not mark the arg as found so it will be passed through - continue; - } - - // done checking for args. Remember where an arg was found - if (found) { - configArgs[configArgIndex++] = i; - continue; - } - // check for args with parameters. If we are at the last argument or if the next one - // has a '-' as the first character, then we can't have an arg with a parm so continue. - if (i == args.length - 1 || args[i + 1].startsWith("-")) - continue; - String arg = args[++i]; - - // look for the laucher to run - if (args[i - 1].equalsIgnoreCase(BOOT)) { - bootLocation = arg; - found = true; - } - - // look for the development mode and class path entries. - if (args[i - 1].equalsIgnoreCase(DEV)) { - inDevelopmentMode = true; - devClassPath = arg; - continue; - } - - // look for the application to run - if (args[i - 1].equalsIgnoreCase(APPLICATION)) { - application = arg; - found = true; - } - - // look for token to use to end the splash screen - if (args[i - 1].equalsIgnoreCase(ENDSPLASH)) { - endSplash = arg; - continue; - } - - // look for items to uninstall - if (args[i - 1].equalsIgnoreCase(UNINSTALL)) { - uninstall = true; - uninstallCookie = arg; - found = true; - } - - // done checking for args. Remember where an arg was found - if (found) { - configArgs[configArgIndex++] = i - 1; - configArgs[configArgIndex++] = i; - } - } - // remove all the arguments consumed by this argument parsing - if (configArgIndex == 0) - return args; - String[] passThruArgs = new String[args.length - configArgIndex]; - configArgIndex = 0; - int j = 0; - for (int i = 0; i < args.length; i++) { - if (i == configArgs[configArgIndex]) - configArgIndex++; - else - passThruArgs[j++] = args[i]; - } - return passThruArgs; -} -/** - * Runs the application to be launched. - * - * @return the return value from the launched application - * @param args the arguments to pass to the application - * @exception thrown if a problem occurs during launching - */ -public Object run(String[] args) throws Exception { - String[] passThruArgs = processCommandLine(args); - if (uninstall) - return updateRun(UNINSTALL, uninstallCookie, passThruArgs); - else - return basicRun(passThruArgs); -} -/** - * Performs an update run. - * - * @return the return value from the update loader - * @param flag flag to give to the update loader - * @param value value to give to the update loader - * @param args arguments to give to the update loader. - * @exception Exception thrown if a problem occurs during execution - */ -protected Object updateRun(String flag, String value, String[] args) throws Exception { - Class clazz = getUpdateLoader(bootLocation); - Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, String.class, String.class, String[].class }); - try { - return method.invoke(clazz, new Object[] { flag, value, location, args }); - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof Error) - throw (Error) e.getTargetException(); - else - throw e; - } -} -} diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java deleted file mode 100644 index 66161e7a7bf..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URL; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.Vector; - -/** - * Application is responsible for calling core launch api - */ - -public class NewMain extends Main { - private static final String DEFAULT_APPLICATION= "org.eclipse.ui.workbench"; - - - public NewMain(String application, String location, URL pluginPathLocation, String bootLocation, boolean debug) throws IOException { - this.application= application; - this.location= location; - this.pluginPathLocation= pluginPathLocation; - this.bootLocation= bootLocation; - } - - public static void main(String[] args) { - try { - String location= getLocationFromProperties("platform"); - new NewMain(DEFAULT_APPLICATION, location, null, null, true).run(args); - } catch (Throwable e) { - System.out.println("Exception launching the Eclipse Platform UI:"); - e.printStackTrace(); - } - System.exit(0); - } - - - /** - * Run this launcher with the arguments specified in the given string. - * This is a short cut method for people running the launcher from - * a scrapbook (i.e., swip-and-doit facility). - */ - public static void main(String argString) throws Exception { - Vector list= new Vector(5); - for (StringTokenizer tokens= new StringTokenizer(argString, " "); tokens.hasMoreElements();) - list.addElement((String) tokens.nextElement()); - main((String[]) list.toArray(new String[list.size()])); - } - - public static String getLocationFromProperties(String key) { - Properties properties= new Properties(); - try { - FileInputStream fis= new FileInputStream(getSettingsFile()); - properties.load(fis); - return properties.getProperty(key); - } catch (IOException e) { - } - return null; - } - - private static File getSettingsFile() { - String home= System.getProperty("user.home"); - if (home == null) { - System.out.println("Home dir not defined"); - return null; - } - return new File(home, "eclipse-workspaces.properties"); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java deleted file mode 100644 index 4ee939df6b5..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.testplugin; - -import java.net.URL; - -/** - * Helper class to launch a test - */ -public class TestPluginLauncher { - - public static final String APP_NAME= "org.eclipse.jdt.ui.tests.app"; - - public static void run(String location, Class testCase, String[] args) { - run(APP_NAME, location, testCase, args); - } - - public static void run(String application, String location, Class testCase, String[] args) { - try { - String bootLocation= getBootLocation(); - int nArgs= args.length; - String[] newArgs= new String[4 + nArgs]; - newArgs[0]= testCase.getName(); - for (int i= 0; i < nArgs; i++) { - newArgs[1 + i]= args[i]; - } - newArgs[1 + nArgs]= "-dev"; - newArgs[1 + nArgs + 1]= "bin"; - newArgs[1 + nArgs + 2]= "-debug"; - NewMain newMain= new NewMain(application, location, null, bootLocation, false); - newMain.run(newArgs); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static String getLocationFromProperties(String key) { - return NewMain.getLocationFromProperties(key); - } - - public static String getLocationFromProperties() { - return NewMain.getLocationFromProperties("tests"); - } - - public static String getBootLocation() { - URL url= TestPluginLauncher.class.getResource("TestPluginLauncher.class"); - String s= url.toString(); - int index= s.indexOf("/org.eclipse.jdt.ui.tests"); - if (index == -1) - throw new IllegalArgumentException(); - s= s.substring(0, index); - s= s + "/org.eclipse.core.boot/boot.jar"; - return s; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java deleted file mode 100644 index 2a6e8fe44bd..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.cdt.testplugin.util; - - -import java.util.ArrayList; - - -public class AccessibilityTestPass implements IDialogTestPass { - private static final int CHECKLIST_SIZE = 5; - - /** - * @see IDialogTestPass#title() - */ - public String title() { - return "Test Pass: Accessibility"; - } - /** - * @see IDialogTestPass#description() - */ - public String description() { - return "Verify the accessibility of the dialogs."; - } - /** - * @see IDialogTestPass#label() - */ - public String label() { - return "&Accessibility"; - } - /** - * @see IDialogTestPass#checkListTexts() - */ - public ArrayList checkListTexts() { - ArrayList list = new ArrayList(CHECKLIST_SIZE); - list.add("&1) all widgets are accessible by tabbing."); - list.add("&2) forwards and backwards tabbing is in a logical order"); - list.add("&3) all the widgets with labels have an appropriate mnemonic."); - list.add("&4) there are no duplicate mnemonics."); - list.add("&5) selectable widgets can be selected using the spacebar."); - return list; - } - /** - * @see IDialogTestPass#failureTexts() - * Size of the return array must be the same size as the checkListTexts' - * ArrayList. - */ - public String[] failureTexts() { - String[] failureText = new String[CHECKLIST_SIZE]; - failureText[0] = "Some widgets aren't accessible by tabbing."; - failureText[1] = "Tabbing order is illogical."; - failureText[2] = "Missing or inappropriate mnemonics."; - failureText[3] = "Duplicate mnemonics."; - failureText[4] = "Some widgets cannot be selected using the spacebar."; - return failureText; - } - /** - * @see IDialogTestPass#queryText() - */ - public String queryText() { - return "Is the accessibility of the dialog acceptable?"; - } - /** - * @see IDialogTestPass#getID() - */ - public int getID() { - return VerifyDialog.TEST_ACCESS; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java deleted file mode 100644 index d7cc8c48187..00000000000 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.eclipse.cdt.testplugin.util; - - -import java.util.Stack; -/** - * @author Peter Graves - * - * This utility class maintains a list of strings, and as a tests finds strings - * in a structure/list, it will maintain a list of unfound/extra strings. - */ -public class ExpectedStrings { - - public String [] expStrings; - private boolean[] foundStrings; - private Stack extraStrings; /* A stack of the unecpected strings we - * recieved - */ - private boolean extra; - - /** - * Constructor for ExpectedStrings. - */ - public ExpectedStrings() { - } - /** - * Constructor for ExpectedStrings that accepts a list of strings that - * we expect to get. - */ - public ExpectedStrings(String[] values) { - int x; - expStrings=new String[values.length]; - for (x=0;x= 0) ) { - TEST_TYPE = TEST_SIZING; - } - _failureText = ""; - _dialogTests[0] = new SizingTestPass(); - _dialogTests[1] = new FocusTestPass(); - _dialogTests[2] = new AccessibilityTestPass(); - } - - /* (non-Javadoc) - * Method declared on Window. - */ - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Dialog Verification"); - setShellStyle(SWT.NONE); - } - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected void createButtonsForButtonBar(Composite parent) { - _yesButton = createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true); - _noButton = createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false); - } - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected void buttonPressed(int buttonId) { - if (IDialogConstants.YES_ID == buttonId) { - setReturnCode(IDialogConstants.YES_ID); - if (_testDialog.getShell() != null) { - _testDialog.close(); - } - close(); - } else if (IDialogConstants.NO_ID == buttonId) { - handleFailure(); - } - } - /* (non-Javadoc) - * Method declared on Dialog. - */ - protected Control createDialogArea(Composite parent) { - // top level composite - Composite parentComposite = (Composite)super.createDialogArea(parent); - - - // create a composite with standard margins and spacing - Composite composite = new Composite(parentComposite, SWT.NONE); - composite.setSize(SIZING_WIDTH, SWT.DEFAULT); - GridLayout layout = new GridLayout(); - layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); - layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - - createTestSelectionGroup(composite); - createCheckListGroup(composite); - - - _queryLabel = new Label(composite, SWT.NONE); - _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - initializeTest(); - return composite; - } - /* - * Group for selecting type of test. - */ - private void createTestSelectionGroup(Composite parent) { - Group group = new Group(parent, SWT.SHADOW_NONE); - group.setText("Testing:"); - group.setLayout( new GridLayout() ); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - group.setLayoutData(data); - - for (int i = 0; i < _dialogTests.length; i++) { - Button radio = new Button(group, SWT.RADIO); - radio.setText( _dialogTests[i].label() ); - final int testID = _dialogTests[i].getID(); - radio.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - TEST_TYPE = testID; - initializeTest(); - _yesButton.setEnabled(true); - } - }); - if ( TEST_TYPE == _dialogTests[i].getID() ) { - radio.setSelection(true); - } - } - } - /* - * Initializes the checklist with empty checks. - */ - private void createCheckListGroup(Composite parent) { - Group group = new Group(parent, SWT.SHADOW_NONE); - group.setText("Verify that:"); - group.setLayout( new GridLayout() ); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - group.setLayoutData(data); - - int checkListSize = 0; - for (int i = 0; i < _dialogTests.length; i++) { - int size = _dialogTests[i].checkListTexts().size(); - if (size > checkListSize) { - checkListSize = size; - } - } - _checkList = new Button[checkListSize]; - SelectionAdapter selectionAdapter = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - checkYesEnable(); - } - }; - for (int i = 0; i < checkListSize; i++) { - _checkList[i] = new Button(group, SWT.CHECK); - _checkList[i].addSelectionListener(selectionAdapter); - data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.grabExcessHorizontalSpace = true; - _checkList[i].setLayoutData(data); - } - } - /* - * Disables the yes button if any of the items in the checklist - * are unchecked. Enables the yes button otherwise. - */ - void checkYesEnable() { - boolean enable = true; - for (int i = 0; i < _checkList.length; i++) { - if ( !_checkList[i].getSelection() ) { - enable = false; - } - } - _yesButton.setEnabled(enable); - } - /* - * Initializes the checklist, banner texts, and query label - */ - void initializeTest() { - IDialogTestPass test = _dialogTests[TEST_TYPE]; - setTitle( test.title() ); - setMessage( test.description() ); - Iterator iterator = test.checkListTexts().iterator(); - for (int i = 0; i < _checkList.length; i++) { - if ( iterator.hasNext() ) { - _checkList[i].setText( iterator.next().toString() ); - _checkList[i].setVisible(true); - _checkList[i].update(); - } else { - _checkList[i].setVisible(false); - _checkList[i].update(); - } - _checkList[i].setSelection(true); - } - _queryLabel.setText( test.queryText() ); - } - public String getFailureText() { - return _failureText; - } - /* - * Can't open the verification dialog without a specified - * test dialog, this simply returns a failure and prevents - * opening. Should use open(Dialog) instead. - * - */ - public int open() { - _failureText = "Testing dialog is required, use VerifyDialog::open(Dialog)"; - return IDialogConstants.NO_ID; - } - /* - * Opens the verification dialog to test the specified dialog. - */ - public int open(Dialog testDialog) { - if (getShell() == null) { - create(); - } - getShell().setLocation(0, 0); - getShell().setSize(Math.max(SIZING_WIDTH, getShell().getSize().x), getShell().getSize().y); - _testDialog = testDialog; - if (_testDialog.getShell() == null) { - _testDialog.create(); - } - _testDialogSize = _testDialog.getShell().getSize(); - openNewTestDialog(); - - return super.open(); - } - /* - * Opens the dialog to be verified. - */ - private void openNewTestDialog() { - if (_testDialog.getShell() == null) { - _testDialog.create(); - } - _testDialog.setBlockOnOpen(false); - _testDialog.getShell().setLocation(getShell().getSize().x + 1, 0); - _testDialog.getShell().setSize(_testDialogSize); - _testDialog.getShell().addShellListener(new ShellAdapter() { - public void shellClosed(ShellEvent e) { - e.doit = false; - } - - }); - _testDialog.open(); - } - /* - * The test dialog failed, open the failure dialog. - */ - private void handleFailure() { - IDialogTestPass test = _dialogTests[TEST_TYPE]; - StringBuffer text = new StringBuffer(); - String label = test.label(); - label = label.substring(0, label.indexOf("&")) + - label.substring(label.indexOf("&") + 1); - text.append(label). - append(" failed on the "). - append(SWT.getPlatform()). - append(" platform:\n"); - - String failureMessages[] = test.failureTexts(); - for (int i = 0; i < test.checkListTexts().size(); i++) { - if ( !_checkList[i].getSelection() ) { - text.append("- ").append(failureMessages[i]).append("\n"); - } - } - FailureDialog dialog = new FailureDialog( getShell() ); - dialog.create(); - //String temp = text.toString(); - dialog.setText( text.toString() ); - if (dialog.open() == IDialogConstants.OK_ID) { - _failureText = dialog.toString(); - setReturnCode(IDialogConstants.NO_ID); - if (_testDialog.getShell() != null) { - _testDialog.close(); - } - close(); - } - } - /* - * In case the shell was closed by a means other than - * the NO button. - */ - protected void handleShellCloseEvent() { - handleFailure(); - } -} - - diff --git a/core/org.eclipse.cdt.ui.tests/test.xml b/core/org.eclipse.cdt.ui.tests/test.xml deleted file mode 100644 index bc8852dae8a..00000000000 --- a/core/org.eclipse.cdt.ui.tests/test.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java deleted file mode 100644 index e26d664c77d..00000000000 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cdt.ui.tests; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.cdt.ui.tests.text.PartitionTokenScannerTest; -import org.eclipse.cdt.ui.tests.textmanipulation.TextBufferTest; - - - -/** - * Test all areas of the UI. - */ -public class AutomatedSuite extends TestSuite { - - /** - * Returns the suite. This is required to - * use the JUnit Launcher. - */ - public static Test suite() { - return new AutomatedSuite(); - } - - /** - * Construct the test suite. - */ - public AutomatedSuite() { - addTest(PartitionTokenScannerTest.suite()); - addTest(TextBufferTest.suite()); - - - } - -} - diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java deleted file mode 100644 index a5efb1efe63..00000000000 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.eclipse.cdt.ui.tests.text; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.internal.ui.text.CPartitionScanner; -import org.eclipse.cdt.internal.ui.text.FastCPartitionScanner; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.rules.IPartitionTokenScanner; -import org.eclipse.jface.text.rules.IToken; - -/** - * Compares two IParitionTokenScanners for conformance and performance. - */ -public class PartitionTokenScannerTest extends TestCase { - - private IPartitionTokenScanner fReference; - private IPartitionTokenScanner fTestee; - - public PartitionTokenScannerTest(String name) { - super(name); - } - - protected void setUp() { - fReference= new CPartitionScanner(); - fTestee= new FastCPartitionScanner(); - } - - // read sample java file - private IDocument getDocument(String name, String lineDelimiter) { - try { - InputStream stream= getClass().getResourceAsStream(name); - BufferedReader reader= new BufferedReader(new InputStreamReader(stream)); - - StringBuffer buffer= new StringBuffer(); - String line= reader.readLine(); - while (line != null) { - buffer.append(line); - buffer.append(lineDelimiter); - line= reader.readLine(); - } - - return new Document(buffer.toString()); - - } catch (IOException e) { - } - - return null; - } - - private static IDocument getRandomDocument(int size) { - final char[] characters= {'/', '*', '\'', '"', '\r', '\n', '\\'}; - final StringBuffer buffer= new StringBuffer(); - - for (int i= 0; i < size; i++) { - final int randomIndex= (int) (Math.random() * characters.length); - buffer.append(characters[randomIndex]); - } - - return new Document(buffer.toString()); - } - - public static Test suite() { - return new TestSuite(PartitionTokenScannerTest.class); - } - - public void testTestCaseLF() { - testConformance(getDocument("TestCase.txt", "\n")); - } - - public void testTestCaseCRLF() { - testConformance(getDocument("TestCase.txt", "\r\n")); - } - - public void testTestCaseCR() { - testConformance(getDocument("TestCase.txt", "\r")); - } - - public void testTestCase2LF() { - testConformance(getDocument("TestCase2.txt", "\n")); - } - - public void testTestCase2CRLF() { - testConformance(getDocument("TestCase2.txt", "\r\n")); - } - - public void testTestCase2CR() { - testConformance(getDocument("TestCase2.txt", "\r")); - } - -// XXX not fully passing because of "\ and '\ -// public void testRandom() { -// testConformance(getRandomDocument(2048)); -// } - - /** - * Tests performance of the testee against the reference IPartitionTokenScanner. - */ - public void testPerformance() { - final int COUNT= 5000; - final IDocument document= getDocument("TestCase.txt", "\n"); - - final long referenceTime= getTime(fReference, document, COUNT); - final long testeeTime= getTime(fTestee, document, COUNT); - - if (false) { - System.out.println("reference time = " + referenceTime / 1000.0f); - System.out.println("testee time = " + testeeTime / 1000.0f); - System.out.println("factor = " + (float) referenceTime / testeeTime); - } - - // dangerous: assert no regression in performance - // assertTrue(testeeTime <= referenceTime); - } - - private long getTime(IPartitionTokenScanner scanner, IDocument document, int count) { - final long start= System.currentTimeMillis(); - - for (int i= 0; i < count; i++) - testPerformance(scanner, document); - - final long end= System.currentTimeMillis(); - - return end - start; - } - - private void testConformance(final IDocument document) { - - final StringBuffer message= new StringBuffer(); - - fReference.setRange(document, 0, document.getLength()); - fTestee.setRange(document, 0, document.getLength()); - - while (true) { - - message.setLength(0); - - final IToken referenceToken= fReference.nextToken(); - final IToken testeeToken= fTestee.nextToken(); - assertTokenEquals(referenceToken, testeeToken); - - final int referenceOffset= fReference.getTokenOffset(); - final int testeeOffset= fTestee.getTokenOffset(); - message.append(", offset = " + referenceOffset); - message.append(", " + extractString(document, referenceOffset)); - assertEquals(message.toString(), referenceOffset, testeeOffset); - - int referenceLength= fReference.getTokenLength(); - final int testeeLength= fTestee.getTokenLength(); - if(referenceLength != testeeLength) { - // Special case where the dum scanner creates a token for every character... - IToken t; - while(referenceLength < testeeLength) { - t = fReference.nextToken(); - referenceLength += fReference.getTokenLength(); - if(referenceToken != t) - assertEquals(message.toString(), referenceToken, t); - } - } - message.append(", length = " + referenceLength); - assertEquals(message.toString(), referenceLength, testeeLength); - - if (referenceToken.isEOF()) - break; - } - } - - private static void testPerformance(final IPartitionTokenScanner scanner, final IDocument document) { - - scanner.setRange(document, 0, document.getLength()); - - IToken token; - do { - token= scanner.nextToken(); - scanner.getTokenOffset(); - scanner.getTokenLength(); - - } while (!token.isEOF()); - } - - private void assertTokenEquals(IToken expected, IToken actual) { - assertEquals(expected.isEOF(), actual.isEOF()); - assertEquals(expected.isOther(), actual.isOther()); - assertEquals(expected.isUndefined(), actual.isUndefined()); - assertEquals(expected.isWhitespace(), actual.isWhitespace()); - } - - private static String extractString(IDocument document, int offset) { - final StringBuffer buffer= new StringBuffer(); - - try { - IRegion region= document.getLineInformationOfOffset(offset); - String line= document.get(region.getOffset(), region.getLength()); - - int offsetIndex= offset - region.getOffset(); - - // XXX kludge - if (offsetIndex > line.length()) - offsetIndex= line.length(); - - buffer.append("line = " + document.getLineOfOffset(offset) + ": ["); - buffer.append(line.substring(0, offsetIndex)); - buffer.append(""); - buffer.append(line.substring(offsetIndex)); - buffer.append(']'); - - } catch (BadLocationException e) { - } - - return buffer.toString(); - } - - /** - * Escapes CR, LF and TAB in a string. - */ - private static String escape(String string) { - final StringBuffer buffer= new StringBuffer(); - - final int length= string.length(); - for (int i= 0; i < length; i++) { - final char character= string.charAt(i); - switch (character) { - case '\t': - buffer.append("\\t"); - break; - - case '\r': - buffer.append("\\r"); - break; - - case '\n': - buffer.append("\\n"); - break; - - default: - buffer.append(character); - break; - } - } - - return buffer.toString(); - } - -} diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt deleted file mode 100644 index 16bc625fe55..00000000000 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt +++ /dev/null @@ -1,43 +0,0 @@ -#include - -const SimpleStruct simpleStruct = -{ - 1 - , "mySimple" - , 0.1232 -}; - -#define SIZEOF( A, B ) sizeof( A.B ) - -const OtherStruct array[] = -{ - { -#if FOO - "foo" -#else - "bar" -#endif - , SIZEOF( simpleStruct, num ) - , &t_int - , 0 - } - , { - "name" - , SIZEOF( simpleStruct, floatnum ) - , &t_float - , 1 - } -}; - - -void SimpleStruct_construct( struct SimpleStruct * const this ) -{ - this->num = 1; - this->name = "boo"; - this->floatNum = 1.5; -} - -int ConnectParams_doSomething( const struct SimpleStruct * const this ) -{ - return 1; -} diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt deleted file mode 100644 index 09002042db8..00000000000 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -/******** - * This is a sample C file that will be used in testing the TranslationUnit - * class. It has a specific structure that will be looked for within the - * test case. - * This file is only ment to contain various C elements, and may not compile - * into a running application (but should be valid C) - */ - -#include -#include - -/* A function prototype */ -int func2p(void); - -/* A global variable */ -int globalvar; - -/* A enumeration */ -enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4}; - -/* A structure. This also includes a typedef around the strcture def - * which at the time of writing was not picked up. - */ -typedef struct mystruct { - int a; - char b; - long c; -} mystruct_t; - -/* A union */ -union myunion { - int x; - char y; - long z; -}; - -/* A typedef */ -typedef struct mystruct mytype; - - -/* A couple functions */ - -void * func1(void) -{ - return(NULL); -} - - -int func2(void) -{ - return(0); -} - -int main(int argc, char ** argv) -{ - int var1; - printf("Hello world\n"); -} - - -void func3() -{ - printf("This is not really here\n"); -} diff --git a/core/org.eclipse.cdt.ui/.classpath b/core/org.eclipse.cdt.ui/.classpath deleted file mode 100644 index d585f114592..00000000000 --- a/core/org.eclipse.cdt.ui/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/core/org.eclipse.cdt.ui/.cvsignore b/core/org.eclipse.cdt.ui/.cvsignore deleted file mode 100644 index 693869726de..00000000000 --- a/core/org.eclipse.cdt.ui/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -doc diff --git a/core/org.eclipse.cdt.ui/.project b/core/org.eclipse.cdt.ui/.project deleted file mode 100644 index 04403a7b87c..00000000000 --- a/core/org.eclipse.cdt.ui/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.ui - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog deleted file mode 100644 index a7dce044e29..00000000000 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ /dev/null @@ -1,2198 +0,0 @@ -2004-01-13 John Camelon - Updated CompletionEngine to handle IASTCompletionKind.CompletionKind.STATEMENT_START - -2004-01-08 Hoda Amer - Added Content assist log cpabilities - -2004-01-07 Alain Magloire - - Fix for bug 49595 - The error parser order were not save correctly. - - * src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java - -2003-12-31 Hoda Amer - Displayed "No Completions Found" message in status bar - -2003-12-30 Hoda Amer - - Fix for bug#44359: Content Assist: foo(void) does not require args to be filled - - Fix for bug#44378: Content Assist: easy keyboard exit of argument-providing mode - -2003-12-29 Hoda Amer - - Added context checking for completions comming from contributions - - Added preference : Show proposals in Alphabetical Order - - Fix for bug #44043: code assist letter by letter doesn't update properly - - Fix for bug #44251: Code Assist: bad error message on preference page - -2003-12-22 Hoda Amer - Content Assist work : Added context information to templates. - Added scope information into relevance calculations - Added special icon to indicate a local variable - -2003-12-19 Alain Magloire - - Fix for PR 40247. - We have to overload Eclipse ViewSorter.compare() it uses - the label provider, it adds ">" to the project name and - mixing the sorting. - - * src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java - -2003-12-17 Hoda Amer - Content Assist work: Completion Engine calling new lookups - -2003-12-15 Andrew Niefer - Updated CompletionEngine to match new signature for IASTNode.lookup - -2003-12-15 Alain Magloire - - Header icon provide by Mirza Hadzic PR 26486. Thanks. - - * icons/full/obj16/h_file_obj.gif - * src/org/eclipse/cdtzxinternal/ui/CElementImagerProvider.java - * src/org/eclipse/cdt/internal/ui/CPluginImages.java - * plugin.xml - -2003-12-15 Hoda Amer - Fixed [Bug 47234] new ParserMode required for a better CModel : - - Added a user preference to build the CModel using Structural mode - Enabled the Completion Engine and called the parser in Contextual Mode - Changed default user preference to Project scope until the completion engine is ready - -2003-12-15 Thomas Fletcher - Re-activate the hover help based on the function summary extension point. - Fix a bug in the FunctionSummary class which displayed arguments as - the return value for functions. - -2003-12-11 John Camelon - Updated CompletionEngine to deal with new signatures/exceptions in parser. - -2002-12-11 David Inglis - Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=48596 - - * src/org/eclipse/cdt/ui/CElementContentProvider.java - -2003-12-10 Alain Magloire - - A quick fix for PR 47751. The correct way to deal with this - is a rewrite of CDocumentProvider.java ... - - * src/org/eclipse/cdt/internal/ui/CEditor.java (setInput): - Change the DocumentProvider if the file is external. - -2003-12-09 Hoda Amer - Content Assist work: Modified the project scope user preference - Removed the case sensitivily user preference. - Exported content assist strings to a properties file. - -2003-12-05 Andrew Niefer - fix bug 43932 Search: Wrong icons for context search in Outline View - fix bug 48020 Duplicate Mnemonics in Search Dialog - -2003-12-03 Hoda Amer - Content Assist work :Added a new internal package for content assist - Added more functionality to the CompletionEngine. - Added the Case Sensitive user preference. - -2003-11-27 Hoda Amer - Content Assist work : Added a ResultCollector class - and moved the ICCompletionProposal from an internal package - to an external one. - -2003-11-14 David Inglis - Fixed bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=46685 - -2003-11-11 Sean Evoy - There is a duplicate set of these string resources in the standard make - UI plugin, so there is little need to keep these resources in the common UI - plugin if the managed builder is the only one using them. Moving them also - reduces the dependencies between the builder UI and the core UI packages. The - managed builder UI is the only client of these strings, so there should be no - impact. - * src/org/eclipse/cdt/internal/ui/CPluginResources.properties - -2003-11-10 Bogdan Gheorghe - fix bug 45688: must highlight keyword to use "Open Declarations" or "Add Include" - -2003-11-05 John Camelon - Updated parser clients to use new ParserFactory (stand-alone parser work item). - -2003-11-05 John Camelon - Updated parser clients to use new IProblem strategy. - -2003-10-28 Andrew Niefer - fix bug 44337 : Disabling of "definition" not making sense in Search dialog - fix bug 44947 : Navigate from Outline: Enumeration type not pre-populated - fix bug 44948 : Navigate via Open Declarations: typedef decl not found - -2003-10-22 Hoda Amer - Fixed bug#45115: New Class Wizard: Error in base class doesn't clear when ... - -2003-10-20 Hoda Amer - Fixed bug#44507 outline flickers with CDT1.2 RC0 - In CReconcilingStrategy, the outliner is asked to redraw only - if there was a real change. - -2003-10-18 Alain Magloire - - New Binary Parser tab page for Cygwin PE Parser. - - * src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParser.java - * plugin.xml: Advertise this new parser. - -2003-10-17 David Inglis - - Fix build error with Eclipse 3.0. - - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java - * src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java - * src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java - * src/org/eclipse/cdt/ui/CUIPlugin.java - -2003-10-16 Alain Magloire - - Fix null out the dynamic parser page, it not selected. - - * src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java - -2003-10-14 Alain Magloire - - Added a new method to ICOptionContainer.java - Preferences getPreferences(); - This needed for UI contributions in the Tabs. - - * src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java - * src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java - * src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java - * src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java - -2003-10-10 Alain Magloire - - Add new method getPreferenceStore() in ICOptionPage - - * src/org/eclipse/cdt/ui/dialogs/ICOptionpage.java - * src/org/eclipse/cdt/ui/wizard/NewCProjectWizardOptionPage.java - -2003-10-08 Alain Magloire - - For Open on the header do a fallback and look for the header - in the project. This code should be revisit once, the - CPathEntry and the ScannerInfoProvider are getting smarter. - - * src/org/eclipse/cdt/internal/ui/OpenIncludeAction.java - -2003-10-08 Alain Magloire - - Do selection better for Binary objects, the binary - elements do not have offset information but only line number. - We can leverage, by looking at the offset corresponding to - the line. - - * src/org/eclipse/cdt/internal/ui/CEditor.java - -2003-10-08 Bogdan Gheorghe - - - Modified CCompletionProcessor.java to create a file scope - instead of a project scope - - * src/org/eclipse/cdt/internal/ui/txt/CCompletionProcessor.java - -2003-10-01 Andrew Niefer - -bug44032 - deleting/moving files breaks search - * modified src/org/eclipse/cdt/ui/CSearchResultLabelProvider getText to return empty string instead of null - -bug43130 - Selected resources is disabled but selected - * src/org/eclipse/cdt/internal/ui/search/CSearchPage - -2003-10-01 Alain Magloire - - Fix PR 44013, not defining a resource. - - * src/org/eclipse/cdt/internal/ui/CPluginResource.properties - -2003-10-01 David Inglis - - Fixed bug with binary parser page not saving change to preference. - * src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java - -2003-09-30 Bogdan Gheorghe - - Added F3 key binding for the Open Declarations Action - - Bug 42047: Added Ctrl+H binding for the C++ Search Dialog - -2003-09-30 Andrew Niefer - Bug 43923 - Search: Results pane title missing Working Set's name - - implement CSearchUtil.toString( IWorkingSet [] ) - * src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java - -2003-09-30 Alain Magloire - - PR 39339, a definition is missing the CPluginResource.properties file. - - * src/org/eclipse/cdt/internal/ui/CPluginResource.properties. - -2003-09-30 Hoda Amer - - Fix for bug#43524 : Removing a define from a .c file causes issues in the outline - -2003-09-29 Hoda Amer - - Fixed Help IDs for C_Editor preference tabs. - -2003-09-26 David Inglis - fixes: https://bugs.eclipse.org/bugs/show_bug.cgi?id=43776 - - * src/org/eclipse/cdt/internal/ui/text/CWordFinder.java - -2003-09-25 Andrew Niefer - -bug43129 - Search: Cannot search for definitions of global variables - - modify UI to allow selecting Definitions for more items - * src/org/eclipse/cdt/internal/ui/search/CSearchPage.java - -2003-09-26 Hoda Amer - Solution to : - bug#43149: Code Assist Preferences: Background Color not working.... - bug#43153: Code Assist Preferences: Disabling "Insert single proposa... - bug#43154: Code Assist Preferences: Enable Auto activation not working - bug#42224: Code Assist preferences Do not work properly - -2003-09-25 Bogdan Gheorghe - Deleted the remaining CProjectPropertyPage artifacts. - - * src/org/eclipse/cdt/internal/ui/preferences/CProjectOptionBlock.java - * src/org/eclipse/cdt/internal/ui/preferences/CProjectPropertyPage.java - * src/org/eclipse/cdt/ui/dialogs/IndexerBlock.java - -2003-09-25 Hoda Amer - Solution to bug#43646: Code Assist won't work if missing end bracket - -2003-09-25 Andrew Niefer - modify CSearchResultCollector to accept matches without resources, but not attempt to report - them in the UI. Addresses 43664 for non-ui clients of search - * src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java - -2003-09-25 Alain Magloire - - Add HelpContext IDs in the preference page. - For annotation page and color Page - - * src/org/eclipse/cdt/internal/ui/CEditorPreferencePage.java - -2003-09-24 Alain Magloire - - Remove of unuse function with the clean up of Translation Unit - - * src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java -2003-09-24 Alain Magloire - - Remove unneeded Folder/File Wizard definitions. - - * plugin.xml - -2003-09-23 Alain Magloire - - Remove some warnings in the ErrorParser blocks. - Refactor LocalSelectionTransfer vs CLocalSelectionTransfer to minimise - clashes. - - * src/org/eclipse/cdt/internal/ui/CLocalSelectionTransfer - * src/org/eclipse/cdt/internal/ui/cview/CView.java - * src/org/eclipse/cdt/internal/ui/cview/LocalSelectionTransferDragAdapter.java - * src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java - * src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java - -2003-09-23 Hoda Amer - Solution to bug#43143: Naming of Code Assist Menus/Tab are not consistent - changed both names to Content Assist. No tests provided. - -2003-09-22 Bogdan Gheorghe - Got rid of the C/C++ Project property page (only the indexer tab - was left). Here are the changes: - - Modified: - * plugin.xml - * org.eclipse.cdt.internal.ui.text.CCompletionProcessor - * org.eclipse.cdt.internal.ui.editor.DefaultCEditorTextHover - - Deleted: - * org.eclipse.cdt.ui.wizards.IndexerBlock - - Slated for deletion before 1.2 GA: - * org.eclipse.cdt.internal.ui.preferences.CProjectPropertyPage - * org.eclipse.cdt.internal.ui.preferences.CProjectOptionBlock - * org.eclipse.cdt.ui.dialogs.IndexerBlock - -2003-09-22 Hoda Amer - Solutions to - bug#43162 : Code Assist not showing the right return value - Bug#43145 : foo function still showing in Code Assist even if "f" is deleted - Bug#42810 : Code Assist adding characters after pressing - Bug#42861 : Code Assist should be case insensitive. - -2003-09-22 Andrew Niefer - fix for bug 43327 Code Complete finds local variables - - update calls to SearchEngine.search. CodeCompletion passes true for excludeLocalDeclarations - -2003-09-22 Andrew Niefer - associate context ID ICHelpContextIds.C_SEARCH_PAGE with the CSearchPage dialog - add C_SEARCH_PAGE to the ICHelpContextIds. - -2003-09-22 Alain Magloire - - Disable the C-Task Property and Preference page. - The generation of those tasks was inadvertly remove any in the - parser. The UI code is still there since it is a feature - that we will want for CDT-2.0 - - * plugin.xml - ->>>>>>> 1.181 -2003-09-21 Alain Magloire - - Patch contributed by Keith Campbell. - - Patch to enable dragging non-resource selections from - the C/C++ Projects view. - - The code has been reorganized to use the delegation pattern found in the - JDT and a new LocalSelectionTransfer specific to the CDT has been - introduced to avoid potential incompatibilities of using - org.eclipse.ui.views.navigator.LocalSelectionTransfer. - - * src/org/eclipse/cdt/internal/ui/drag/DelegatingDraAdapter.java - * src/org/eclipse/cdt/internal/ui/drag/FileTransferDragAdapter.java - * src/org/eclipse/cdt/internal/ui/drag/LocalSelectionTransferDragAdapter.java - * src/org/eclipse/cdt/internal/ui/drag/ResourceTransferDragAdapter.java - * src/org/eclipse/cdt/internal/ui/drag/TransferDragSourceListener.java - - * src/org/eclipse/cdt/internal/ui/cview/CView.java - - * src/org/eclipse/cdt/ui/LocalSelectionTransfer.java - -2003-09-21 Alain Magloire - - Bug #41960, The asm editor did not know about '#' comment style - - * src/org/eclipse/cdt/internal/ui/editor/asm/AsmPartitionScanner.java - ->>>>>>> 1.179 -2003-09-18 Hoda Amer - Solution to bug#42611 : New Class Wizard should be hidden for C projects - -2003-09-18 David Inglis - Add workbench build/rebuild in context menu. - - * src/org/eclipse/cdt/internal/ui/cview/CView.java - -2003-09-16 Alain Magloire - - Work to the new BinaryParserBlock to add dynamic UI - contribution for binary parsers that need the flexibility. - - * src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java - * src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java - * src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java - -2003-09-16 David Inglis - Removal of make builder ui components. - - plugin.xml - removed wizards and views. - - * src/org/eclipse/cdt/internal/ui/cview/CView.java - removed build actions. - - * src/org/eclipse/cdt/internal/ui/preferences/CProjectPropertyPage.java - removed tabs that are now in make plugin. - - * src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java - * src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java - updated to use new c wizards. - - * src/org/eclipse/cdt/internal/ui/makeview/MakeAction.java - * src/org/eclipse/cdt/internal/ui/makeview/MakeContentProvider.java - * src/org/eclipse/cdt/internal/ui/makeview/MakeLabelProvider.java - * src/org/eclipse/cdt/internal/ui/makeview/MakeTarget.java - * src/org/eclipse/cdt/internal/ui/makeview/MakeTargetAction.java - * src/org/eclipse/cdt/internal/ui/makeview/MakeView.java - * src/org/eclipse/cdt/ui/wizards/conversion/ConvertToStdMakeConversionWizard.java - * src/org/eclipse/cdt/ui/wizards/conversion/ConvertToStdMakeProjectWizardPage.java - * src/org/eclipse/cdt/ui/wizards/BuildPathInfoBlock.java - * src/org/eclipse/cdt/ui/wizards/SettingsBlock.java - * src/org/eclipse/cdt/ui/wizards/StdCCWizard.java - * src/org/eclipse/cdt/ui/wizards/StdCWizard.java - * src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java - All removed now in make plugins. - -2003-09-15 John Camelon - Fixed Bug 43126 : ISourceElementRequestor.acceptParameterReference accesses internal class - -2003-09-13 Andrew Niefer - - bug42836 - prepopulate template classes from Outline View - - bug43016 - Search: Cannot find macro declarations - - bug42902 - Search: Cannot find typedef - - modified performAction & determineInitValuesFrom in CSearchPage - - modified getImage in CSearchResultLabelProvider - -2003-09-11 Andrew Niefer - - bug42837 - fixed populating search dialog on function declarations - - modified determineInitValuesFrom in CSearchPage - - bug42829 - prepopulated search dialog to any element declarations - - modified trySimpleTextSelection in CSearchPage - - bug42815 - group together search results with same label - - modified GroupByKeyComputer to use Name, ParentName & Path in the group key - - modified CSearchResultCollector to properly use the GroupByKeyComputer - - modified CSearchResultLabelProvider to not display the "-" in the search label - while sorting by name if there is no parent. - -2003-09-11 David Inglis - Deprecated - - * src/org/eclipse/cdt/ui/wizards/BinaryParserBlock.java - * src/org/eclipse/cdt/ui/wizards/BuildPathInfoBlock.java - * src/org/eclipse/cdt/ui/wizards/CCProjectWizard.java - * src/org/eclipse/cdt/ui/wizards/CProjectWizard.java - * src/org/eclipse/cdt/ui/wizards/CProjectWizardPage.java - * src/org/eclipse/cdt/ui/wizards/IWizardTab.java - * src/org/eclipse/cdt/ui/wizards/IndexerBlock.java - * src/org/eclipse/cdt/ui/wizards/TabFolderPage.java - * utils.ui/org/eclipse/cdt/utils/ui/swt/IValidation.java - -2003-09-11 John Camelon - Updated SourceElementRequestor callbacks to include IASTParameterReference callbacks. - -2003-09-11 Bogdan Gheorghe - - Added Search Menu to CView.java - - Added queryWorkingSets to CSearchScopeFactory to bring up the working - set dialog - - Modified Search Menu in CEditor.java, CContentOutlinePage.java - - Added new action FileSearchActionInWorkingSet - - Modified actions FileSearchAction, SearchDialogAction - -2003-09-10 Sean Evoy - Work completed to resolve [Bug 41412] Restore Default in Managed Build - project's settings Not Working. Added an event handler to reset the selected - configuration settings back to the defaults defined in the plugin manifest. - Work to resolve [Bug 42736] New: C/C++ Build Settings not remembering Configuration. - Used the managed build info to get the current config for the target. - * build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java - -2003-09-11 Hoda Amer - - Removed any reference to jdt.ineternal package for propertiy files - in TextManipulationMessages and CUIMessages - - Added a CUIMessages.properties file to org.eclipse.cdt.internal.ui - -2003-09-08 Bogdan Gheorghe - - Changed search pop up menu in CEditor and CContentOutlinePage - -2003-09-08 John Camelon - Refactored ISourceElementRequestor (enter|exit)CodeBlock() to take IASTCodeScope rather than IASTScope. - Added enumerator references to ISourceElementRequestor. - -2003-09-08 Andrew Niefer - - Modified call to ParserFactory in CStructureCreator to specify which language to use - -2003-09-05 Andrew Niefer - C++ Search: - - enable Selected Resource Scope - - populate dialog base on selection when opened from outline view - - fix small bug that found namespaces when searching for enumerations - - tweak sorting by path to consider line number second - -2003-09-04 John Camelon - First pass of parsing function bodies with X-Reference information. - Updated IASTFactory/ISourceElementRequestor to include IASTCodeScope - constructs, clients should keep this in mind and update their implementations. - -2003-09-04 Alain Magloire - - Faulty logic when checking the build console preferences. - - * src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java - -2003-09-03 Andrew Niefer - C++ Search: Changed default sort order to be by path - changed search dialog to have checkboxes for Search For items. - * src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java - * src/org/eclipse/cdt/internal/ui/search/CSearchPage.java - * src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java - * src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties - -2003-09-04 Hoda Amer - - Solution to bug#42414 :Extraneous semi-colons in generated class methods - -2003-09-03 David Inglis - Fixed parser block to save ids properly. - Use shared preference key for error parsers. - - * src/org/eclipse/cdt/internal/ui/CPluginResources.properties - * src/org/eclipse/cdt/ui/dialogs/ErrorParserBlock.java - -2003-09-03 David Inglis - - src/org/eclipse/cdt/ui/TabFolderOptionBlock.java - - src/org/eclipse/cdt/ui/AbstractCOptionPage.java - - src/org/eclipse/cdt/ui/BinaryParserBlock.java - - src/org/eclipse/cdt/ui/ErrorParserBlock.java - - src/org/eclipse/cdt/ui/ICOptionContainer.java - - src/org/eclipse/cdt/ui/ICOptionPage.java - - src/org/eclipse/cdt/ui/IndexerBlock.java - - src/org/eclipse/cdt/ui/ReferenceBlock.java - - src/org/eclipse/cdt/ui/TabFolderOptionBlock.java - moved to org.eclipse.cdt.ui.dialogs package. - - * src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java - change due to refactor - -2003-09-03 Alain Magloire - - Change to abstract and let the client provides the saving algorithm. - - * src/org/eclipse/cdt/uui/ErroParserBlock.java - -2003-09-03 Alain Magloire - - Wrong fix to a warning the call is needed but not the variable. - Thanks to Hoda for noticing. - - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java - -2003-09-01 Alain Magloire - - The Drag&Drop code is revisited with a facelift. - The good news much of the code can be removed, the Eclise - platform/Worbench folks refactor there code so more can now - be shared. We take adavantage of this. - The bad news much of the code will have to be revisited - and rewrite again when we will start dealing with refactoring. - - * src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java - * src/org/eclipse/cdt/internal/ui/cview/CViewDragAdapter.java - -2003-08-31 Alain Magloire - - Added new block ErrorParserBlock, not enable yet. - - * src/org/eclipse/cdt/ui/ErrorParserBlock.java - -2003-08-30 Alain Magloire - - Deal with the annoying warnings from eclipse about syntetic methods. - All the fix are in the wizard.dialogfields package. A new addition - CheckedListDialogField.java - - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ComboDialogField.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java - -2003-08-30 Alain Magloire - - Remove completely the Old C Parser references and the ComparatorBuilder class. - The Struture comparator is now base entirely on ISourceElemenRequestor. - Making things more stable: Fix part of 39090, Fix 39725, 41006 - - * src/org/eclipse/cdt/internal/ui/compare.CNode.java - * src/org/eclipse/cdt/internal/ui/compare.CParseTreeBuilder.java - * src/org/eclipse/cdt/internal/ui/compare.CStructureCreator.java - * src/org/eclipse/cdt/internal/ui/compare.SourceElementRequestorAdaptor.java - - * src/org/eclipse/cdt/internal/ui/compare.ComparatorModelBuilder.java - Removed. - -2003-08-28 Hoda Amer - Solution to Bug #39968: - -Template Union missing an icon - -2003-08-28 Alain Magloire - - Changes to be able to see external file in the CEditor. The main problem - was that the way the Core/Model ICElement and IWorkingCopy was designed - they always assume that files are inside the workspace .... So to always have - an IFile. One of the problem was the CContentOutliner. We provid and - extern WorkingCopy: CFileWorkingCopy. But this should be revisited. - - Changes aslo to the OpenIncludAction to use the IScannerInfo to search - for headers. - - * src/org/eclipse/cdt/internal/ui/CFileElmentWorkingCopy.java - * src/org/eclipse/cdt/internal/ui/editor/CContentOutliner.java - * src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java - -2003-08-27 Thomas Fletcher - - Update code completion to include () for functions and methods and - to position the cursor appropriately. - - * src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java - * src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java - -2003-08-26 Alain Magloire - - PR 41416, Not enough info in the error message for - the preference line number for the the build-console - - * src/org/eclipse/cdt/internal/ui/CPluginResources.properties - * src/org/eclipse/cdt/internal/ui/preferences/BuildConsolePreferencePage.java - -2003-08-26 Bogdan Gheorghe - - Converted CTags based OpenOnSelectionAction to OpenDeclarationsAction - - Hooked up OpenDeclarationsAction to search engine - -2003-08-20 Bogdan Gheorghe - Added a search dialog pop up to the context menu for the - CEditor and CContentOutlinePage - -2003-08-19 Keith Campbell - Extended CView and CViewDragAdapter to use LocalSelectionTransfer. - Eventually this will permit dragging elements from the "C/C++ Projects" view - to trigger refactoring operations as in the JDT, for example. - * src/org/eclipse/cdt/internal/ui/cview/CView.java - * src/org/eclipse/cdt/internal/ui/cview/CViewDragAdapter.java - -2003-08-19 Sean Evoy - Switched the property page edit area to a scrolled composite instead of resizing - for large option sets. This actually makes the selection event code simpler. - * build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java - - I added an accessor method for getting the internal Map in the settings store. - The code was vulnerable because there was never a check to make sure the - Map had been instantiated before use. - * build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java - - Added some builtin symbols and include paths for the Gnu compilers. - * plugin.xml - - Fixed a spelling error in a category name. - * plugin.properties - -2003-08-14 Sean Evoy - Added initial toolchain description for Solaris and Linux targets using Gnu tools. - * plugin.xml - - Moved tool and option category names into the properties for eventual I18N - * plugin.properties - - For build targets without an extension, the new project wizard was appending a 'dot' to the - name. It no loonger does this. - * build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java - -2003-08-13 Sean Evoy - A simple change to add transparency information to the build property page - GIFs. They were not being drawn properly on Solaris/Motif and would probably - have shown the same behaviour on Linux. Now, they all get blitted correctly - even with a different widget background colour. - * icons/full/build16/build_configs.gif - * icons/full/build16/config-category.gif - * icons/full/build16/config-tool.gif - - Updated the new project wizard to register the correct build manager at - project creation time. We have switched to using the CDescriptor mechanism - for provider discovery. In order for the to work, the project has to be updated - properly and the only time it can be easily done is at creation time. - * build/org/eclipse/cdt/ui/build/wizards/ManagedProjectWizard.java - * src/org/eclipse/cdt/ui/wizards/CProjectWizard.java - -2003-08-13 John Camelon - Fixed Bug 41480 - ceditor extension point is not default editor for C++ file extensions - -2003-08-12 Hoda Amer - Added class name validation to NewClassWizardPage - Used the new search (indexer) for Code completion in CCompletionProcessor - -2003-08-11 Andrew Niefer - - Added some code to CUIPlugin to access working copies - -2003-08-10 Sean Evoy - Added a new target for building DLLs on Cygwin. - * plugin.xml - - Added a new icon for configurations in the tree view of the build - property page for managed builds. - * icons/full/build16/config-category.gif - * src/org/eclipse/cdt/internal/ui/CPluginImages.java - - Changed the icons used to display tools and categories in the tree view - of the managed build property page. Now the tool uses the tool icon and - the category uses the new category icon. - * build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java - - Changed the list field editor so that it will better fit a page with - space-grabbing widgets in different columns. For example, the default list - field editor puts the list in the left column and allows it to garab all - excess space. Entry fields put the label in the left and the space-grabbing - entry field/combo box in the right. The layout manager then gives both left - and right columns equal space. By wrapping the list field editor in a group - control that spans both columns, the layout manager allocates enough space for - controls in the right-hand column. It also lays out the contents of the list - field editor inside the group control independently of the outer container, so - it looks right too. Also added a double-click event handler so users can edit - list elements. Mondo happy with this! - * build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java - - Re-activated the summary field editor class. It still does not behave quite right, - but it is there. - * build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java - * build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java - - Changed the combo-box field editor to lay itself out in the grid more like the other - field editors. This has not made the widget behave differently in any way, but should - insure that it lay itself out correctly on any page with any combination of - field editors. - * build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java - - Fixed the resize behaviour of the build property page; at least in terms of resizing up - to its constrained size. There is the issue of size-creep (each time you reselect the - category, the property page control resizes up a bit until it hits some limit). But, - this is a better situation than what was there before. - * build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java - -2003-08-08 Bogdan Gheorghe - - Filled out CSearchScopeFactory to translate working sets - into CElements - -2003-08-08 Andrew Niefer - - modified Search result sorting to sort by offset if the label is the same for two items - -2003-08-01 Andrew Niefer - - Modified CSearchResultCollector to reflect changes in BasicSearchResultCollector, - acceptMatch will return false if the match was not accepted because it has already - been seen. - -2003-07-30 Hoda Amer - The New Class Wizard uses search to look for base classes in the workspace. - -2003-07-30 Sean Evoy - * plugin.xml: - Updated the attribute names to reflect changes to the ManagedBuildInfo - extension point schema. - -2003-07-29 Andrew Niefer - - Refactoring Search Result Collecting: - * CSearchResultCollector now extends BasicSearchResultCollector - * CSearchResultLabelProvider moved to org.eclipse.cdt.ui - * CSearchResultLabelProvider modified to reflect changes to IMatch interface - * Deleted the class Match - -2003-07-28 Sean Evoy - In order to meet certain internal guidelines and to test the makefile - generator, the build model replied to some answers with hard-coded information. - This patch moves the information into the build model. - - * plugin.xml: - Added new attributes to Targets to add make command, clean command and - make flag information. I also added a toolchain specification for Solaris, but - it is turned off for now until I test it. - -2003-07-24 Sean Evoy - * plugin.xml: - Added new attributes to tools and changed the value type enum for - libraries options. Also added a new flags option to archiver tool - in the Cygwin static library target specification. - - * build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java - * build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java: - Changed to handle the libraries as a special option type. - -2003-07-24 Hoda Amer - This patch updates the CModelBuilder to use the AST instead of the DOM. - -2003-07-23 Bogdan Gheorghe - Added checkbox to Indexer tab to turn on dependency tree - service - -2003-07-21 Bogdan Gheorghe - Update to CSearchResultLabelProvider to ensure that search labels - show up on subsequent runs. - - * src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java - * src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java -2003-07-18 John Camelon - In the core, I updated ParserFactory.createScanner() to force the user to provide a callback and a ParserMode. - ==> I had to update ComparatorModelBuilder. - -2003-07-17 John Camelon - Partially converted DOM to ISourceElementRequestor (requires refactoring of CModelBuilder & StuctureComparator modules in near future). - -2003-07-17 Victor Mozgin - Added support for di- and trigraph notation of preprocessor directives. - -2003-07-16 Alain Magloire - - Patch from Alex chapiro. - This patch just creares group markers for CView pull-down menu build actions - group. Using them, it is possible to locate new buid action contributions to - correct place. - - * src/org/eclipse/cdt/internal/ui/cview/CView.java - -2003-07-16 Alain Magloire - - Patch from Thomas Fletcher. - Update the MakeView class to match UI standards and to contain a new action - to support editing of an existing make target. - - * src/org/eclipse/cdt/internal/ui/makeview/MakeView.java - -2003-07-14 Andrew Niefer - -modified plugin.xml entry for search's PathNameSorter - -added src/org/eclipse/cdt/internal/ui/search/Match.java which implements IMatch to store - information used by CSearchResultLabelProvider - -Modified CSearchResultCollector and CSearchResultLabelProvider to use Match - -2003-07-11 Bogdan Gheorghe - Added new C/C++ Search menu item. - - Added: - * src/org/eclipse/cdt/internal/ui/search/OpenCSearchPageAction.java - - Modified: - * plugin.properties - * plugin.xml - -2003-07-08 John Camelon - Updated IScanner, clients & implementations to use IScannerInfo. - -2003-07-03 Sean Evoy - Changed property/wizard tab to use the new StandardBuildManager and - the improved IStandardBuildInfo interface to set and retrieve - the include and defined symbol information for a standard make project. - * src/org/eclipse/cdt/ui/wizards/BuildPathInfoBlock.java - -2003-07-04 Victor Mozgin - Fix for PR 39476: Preference listeners for task tags do not work. - Fix for PR 39477: Task tags options dialogs ask for project rebuilds. - -2003-06-27 Andrew Niefer - Changes for C/C++ Search: - Added: - * src/org/eclipse/cdt/internal/ui/search/CElementLabels.java - * src/org/eclipse/cdt/internal/ui/search/CSearchResultLabelProvider.java - * src/org/eclipse/cdt/internal/ui/search/CSearchViewActionGroup.java - * src/org/eclipse/cdt/internal/ui/search/ElementNameSorter.java - * src/org/eclipse/cdt/internal/ui/search/GotoMarkerAction.java - * src/org/eclipse/cdt/internal/ui/search/GroupByKeyComputer.java - * src/org/eclipse/cdt/internal/ui/search/ParentNameSorter.java - * src/org/eclipse/cdt/internal/ui/search/PathNameSorter.java - * icons/full/clcl16/search_sortmatch.gif - * icons/full/obj16/search_decl_obj.gif - * icons/full/obj16/search_ref_obj.gif - Modified: - * src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java - * src/org/eclipse/cdt/internal/ui/search/CSearchPage.java - * src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java - * src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties.java - * plugin.xml - * plugin.properties - -2003-06-26 Sean Evoy - Added a tab to the new standard make project wizard and CNature project - property page. User interacts with two list controls to add include paths - and proprocessor symbols to a standard make project. - * src/org/eclipse/cdt/ui/wizards/BuildPathInfoBlock.java - * src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java - * src/org/eclipse/cdt/internal/ui/preferences/CProjectPropertyPage.java - * src/org/eclipse/cdt/internal/ui/CPluginResources.properties - -2003-06-26 Victor Mozgin - Task tags support in C/C++ comments (initial revision). - -2003-06-25 John Camelon - Create new interface and support for calculating lineNumber/offset mapping. - Updated IASTClassSpecifier for qualified name query. - Began structuring expressions and declarators in Parser for ISourceElementRequestor. - Updated other packages to use new interfaces. - -2003-06-25 Bogdan Gheorghe - Added a new checkbox to the Indexer tab of the C/C++ Project Settings - to allow the new indexer to be turned on or off. - * src/org/eclipse/cdt/ui/wizards/IndexerBlock.java - - Modified the CSearchPage to work with the new CSearchConstants - * src/org/eclipse/cdt/internal/ui/search/CSearchPage.java - -2003-06-24 Thomas Fletcher - - - Proposals will now include additional help information with them - if it is available (same as JDT). This opens the door for being - able to write a Javadoc/Doxygen parser and integrating live, - context specific, help. - - On function completions a hover is now shown above the function - (same as JDT) with the argument information as it is being filled in. - - * src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java - * src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java - * src/org/eclipse/cdt/internal/ui/text/CCompletionProposal.java - * src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java - * src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java - * src/org/eclipse/cdt/internal/ui/text/CWordFinder.java - * src/org/eclipse/cdt/ui/IFunctionSummary.java - * src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java - -2003-06-23 John Camelon - Updated Factory infrastructure, constructors, etc. - Introduced Preprocessor class for transitive closure calc. client. - -2003-06-20 Sean Evoy - Added (again) the icons required for the new managed project wizard and property pages - * icons/full/build16/config-command.gif - * icons/full/build16/config-librarian.gif - * icons/full/build16/config-tool.gif - * icons/full/wizban/newmngc_app.gif - * icons/full/wizban/newmngcc_app.gif - - Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=38665 - * build/org/eclipse/cdt/ui/build/wizards/CProjectPlatformPage.java - - Adjusted the Option settings store and pages to properly handle new option types needed - to implement parser interface for include paths and defined symbols. - * build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java - * build/org/eclipse/cdt/ui/build/properties/BuildToolsSettingsStore.java - -2003-06-18 David Inglis - - fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=39053 - - * src/org/eclipse/cdt/ui/CUIPlugin.java - -2003-06-13 John Camelon - Merged ParserSymbolTable branch back into HEAD. - -2003-06-12 Alain Magloire - - Patch from Thomas Fletcher - Define a specific editing scope for the C/C++ Editor and define the framework for - adding in additional commands. Two commands added initially: comment and - uncomment. Removed some Java nomenclature from some of the C properties. - - * plugin.properties - * plugin.xml - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java - * src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties - -2003-06-12 Alain Magloire - - Patch From Thomas Fletcher, to clean up the working set. - - Removal of the homegrown working set implementation of filters and actions - to use the stock actions available with the Eclipse 2.1 release. - - This patch should remove the need for the following files: - * src/org/eclipse/cdt/internal/ui/cview/NewWorkingSetFilterAction.java: - * src/org/eclipse/cdt/internal/ui/cview/AdjustWorkingSetFilterAction.java - * src/org/eclipse/cdt/internal/ui/cview/CWorkingSetFilter.java - - Change the CView to use the action defines on the platform. - * src/org/eclipse/cdt/internal/ui/cview/CView.java - -2003-06-06 - I have added toolchain definitions for Cygnus and Linux to the plugin.xml file - for the new build model. There are two new wizards for adding a C and C++ project - for use with managed build systems. The files to implement that are: - - * build/org/eclipse/cdt/build/ui/wizards/ConfigurationBlock.java - * build/org/eclipse/cdt/build/ui/wizards/ConfigurationContentProvider.java - * build/org/eclipse/cdt/build/ui/wizards/ConfigurationLabelProvider.java - * build/org/eclipse/cdt/build/ui/wizards/CProjectPlatformPage.java - * build/org/eclipse/cdt/build/ui/wizards/ManagedCCWizard.java - * build/org/eclipse/cdt/build/ui/wizards/ManagedCWizard.java - * build/org/eclipse/cdt/build/ui/wizards/ManagedProjectWizard.java - - There is a new property page specifically for projects with this managed nature. - The code to implement it has been added to: - - * build/org/eclipse/cdt/build/ui/properties/BrowseEntryDialog.java - * build/org/eclipse/cdt/build/ui/properties/BuildOptionComboFieldEditor.java - * build/org/eclipse/cdt/build/ui/properties/BuildOptionListFieldEditor.java - * build/org/eclipse/cdt/build/ui/properties/BuildPropertyPage.java - * build/org/eclipse/cdt/build/ui/properties/BuildToolSettingsPage.java - * build/org/eclipse/cdt/build/ui/properties/BuildToolsSettingsStore.java - * build/org/eclipse/cdt/build/ui/properties/ManageConfigDialog.java - * build/org/eclipse/cdt/build/ui/properties/NewConfigurationDialog.java - * build/org/eclipse/cdt/build/ui/properties/SummaryFieldEditor.java - * build/org/eclipse/cdt/build/ui/properties/ToolListContentProvider.java - * build/org/eclipse/cdt/build/ui/properties/ToolListLabelProvider.java - - New string resources have been added to the plugin.properties file and to the - src/org/eclipse/cdt/internal/ui/CPluginResources.properties file. - - New icons have been added: - * icons/full/build16/config-command.gif - * icons/full/build16/config-librarian.gif - * icons/full/build16/config-tool.gif - * icons/full/ctool16/newmngc_app.gif - * icons/full/ctool16/newmngcc_app.gif - - and the path src/org/eclipse/cdt/internal/ui/CPluginImages.java class - has been modified to manage them. - -2003-06-05 Alain Magloire - - Patch from Christophe Juniet, this patch adds #ifdef guards - when generating a header for a class. - - Note the field NewClassWizardPage.createClass change to ICElement - since the C/C++ consider: - class foo { }; - like a variable instead IVariable instead of a IVariableDeclaration. - - * src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java - * src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.properties. - -2003-05-23 Alain Magloire - - Patch from Victor Mozgin to deal with PR 38405 - The CEditor did not do hilight for macros like - # define foo - - I've patched UI code to add a new rule for handling preprocessor directives, - PreprocessorRule class (extends WordRule). And here I noticed that - CppCodeScanner uses private class CWordRule, while CCodeScanner uses standard - WordRule. They seem to do exactly the same thing, but CWordRule additionally - checks for # sign to be the first character on the line. As now preprocessor - directives are handled by PreprocessorRule class, CWordRule can be removed and - replaced with WordRule; also, there is no need for CWordDetector to pick up # - sign as a valid word start. - - * src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java - * src/org/eclipse/cdt/internal/ui/text/CppCodeScanner.java: removed - * src/org/eclipse/cdt/internal/ui/text/PreprocessorRule.java: New file - * src/org/eclipse/cdt/internal/ui/text/util/CWordDetector.java - -2003-05-23 Mikhail Khodjaiants - PR 38047: Unable to save changes in C/C++ debug editor. - * src/org/eclipse/cdt/ui/IEditorInputDelegate.java: new - This interface is added to provide support for more flexible editor inputs. - - * src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java: - Support of the "IEditorInputDelegate" interface. - -2003-05-30 Hoda Amer - Added the new class wizard on May 27th - Fixed the inclusion problem on May 28th - Fixed the non-cmodel selection problem May 30th. - - -2003-05-06 John Camelon - Further integration of SymbolTable into Parser, some refactoring. - - * src/org/eclipse/cdt/internal/ui/compare/ComparatorModelBuilder.java - moved some imports around. - -2003-04-27 Alain Magloire - - PR 36759, the outline does not update - when the input is reset by the Debugger. The debugger - reuse the same editor with different input. - - * src/org/eclipse/cdt/internal/ui/editor/CContentOutlinet.java (setInput): - New method to reset the input of the viewer. - - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java (setOutlinePageInput): - New method to reset the input of the outliner. - - * src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java (createElementInfo): - Use the getBufferFactory() method it may been overloaded. - -2003-04-26 Alain Magloire - - ClastCastException in CView see PR 36876 - and PR 36743 allow extending of the CView. - - * src/org/eclipse/cdt/internal/ui/cview/CView.java: - (createContentProvider): new Method. - (createViewer): new Method. - (createLabelProvider): new method. - -2003-04-26 Alain Magloire - - Fix NPE in the ComparatorModelBuilder when doing visual diffs - with the new Parser. - - * src/org/eclipse/cdt/internal/ui/compare/ComparatorModelBuilder.java: - Check for null. - -2003-04-21 David Inglis - - Update CEditor to be 2.0/2.1 compliant. - - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java - * src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties - * src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java - * src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java - * src/org/eclipse/cdt/internal/ui/text/CPairMatcher.java - - * src/org/eclipse/cdt/internal/ui/editor/BracketPainter.java (removed) - * src/org/eclipse/cdt/internal/ui/editor/IPainter.java (removed) - * src/org/eclipse/cdt/internal/ui/editor/LinePainter.java (removed) - * src/org/eclipse/cdt/internal/ui/editor/OverviewRuler.java (removed) - * src/org/eclipse/cdt/internal/ui/editor/PaintManager.java (removed) - * src/org/eclipse/cdt/internal/ui/editor/PrintMarginPainter.java (removed) - * src/org/eclipse/cdt/internal/ui/editor/ProblemPainter.java (removed) - * src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java (removed) - * src/org/eclipse/cdt/internal/ui/util/CoreUtility.java (removed) - -2003-04-17 Alain Magloire - - Bug 36584 - - When switching the through the CEditor the range was not - save. - - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java: - setSelection(ICElement), new method - * src/org/eclipse/cdt/internal/util/EditorUtility.java: - revealInEditor use setSelection(ICElement). - -2003-04-16 Alain Magloire - - Bug 36582 - - * src/org/eclipse.cdt.internal/ui/cview/CView.java - linkToEditor() check is we have a valid ITranslationUnit. - The isOpenEditor() has a nasty side effect of calling "objdump" - -2003-04-14 Alain Magloire - - The problem: the old parser can still hangs and bring chaos, this - temporary code(since the new parser does not have yet a callback - mechanism) allow us to use the new parser when doing the visual diffs. - It is key on the preference setting, to enable/disable the old parser. - - * src/org/eclipse/cdt/internal/ui/comparator/CStructureCreator.java: - * src/org/eclipse/cdt/internal/ui/comparator/ComparatorModelbuilder.java: - -2003-04-10 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java: - Cleanup to be more Eclipse-2.1 - * src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java: - Was using the wrong bundle. - * src/org/eclipse/cdt/internal/ui/CPluginImage.java: - New imange for code assist. - * plugin.xml: - added "hpp" in the list of possible source C/C++ file. - -2003-04-08 Alain Magloire - - * src/org/eclipse/cdt/ui/CElementLabelProvider.java: - No need to refresh the container. - -2003-04-08 Alain Magloire - - Fix the drag & drop. - - * src/org/eclipse/cdt/internal/ui/cview/CViewDragAdapter.java: - -2003-04-07 Alain Magloire - - Enable contribution to the outliner ContentProvider, in the future - this will let other modules like the debugger add action like - breakpoint in the outliner view to a IFunction. - - * src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java: - -2003-04-05 Alain Magloire - - Implement the new CollapseAll button to be consistent with the - JDT package explorer. - - * icons/full/clcl16/collapseall.gif: - * icons/full/dlcl16/collapseall.gif: - * icons/full/elcl16/collapseall.gif: - * src/org/eclipse/cdt/internal/ui/CPluginImages.java: - New icon. - - * src/org/eclipse/cdt/internal/ui/cview/CollapseAllAction.java: - * src/org/eclipse/cdt/internal/ui/cview/CView.java: - * src/org/eclipse/cdt/internal/ui/cview/CViewMessages.java: - * src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties: - * src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java: - -2003-04-05 Alain Magloire - - The way the working copy was implemented, the outline could not - work with file outside of the C Model, for example a c file in - a non C project. Also some other extended the CEditor to reuse - the highligth and outliner functions, but since the DocumentProvider - was singleton in CUIPlugin.getDocumentProvider(), the outliner did not - work either. A solution is to take the same path as the JDT and provide - a workingcopy that can be use by other so they can "connect" thre input. - - Part of this patch a small refactory of IWorkingCopyManager so - it can be visible outside. - - * src/org/eclipse/cdt/ui/CUIPlugin.java - * src/org/eclipse/cdt/ui/IWorkingCopyManager.java - * src/org/eclipse/cdt/ui/IWorkingCopyManagerExtension.java - * src/org/eclipse/cdt/internal/ui/editor/CContentOutline.java: - * src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java - * src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java - * src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java - * src/org/eclipse/cdt/internal/ui/text/CReconcilerStrategy.java - -2003-04-04 Alain Magloire - - The TextEditor provides a way to select a range to be edited. - We provide the same functionnality; "Show Source of Selected Element Only" - - * icons/full/clcl16/segment_edit.gif: - * icons/full/dlcl16/segment_edit.gif: - * icons/full/elcl16/segment_edit.gif: - * src/org/eclipse/cdt/internal/ui/CPluginImages.java: - descriptor for segment_edit.gif. - - * src/org/eclipse/cdt/ui/PreferenceConstants.java: - Move the preference constants so they can be visible to other plugins. - * src/org/eclipse/cdt/internal/ui/cview/CView.java: - * src/org/eclipse/cdt/internal/preference/CPlugigPreferencePage.java: - - * src/org/eclipse/cdt/internal/editor/CContentOutlinePage.java: - * src/org/eclipse/cdt/internal/editor/CEditorActionContributor.java: - * src/org/eclipse/cdt/internal/editor/CEditorMessages.properties: - * src/org/eclipse/cdt/internal/editor/CTextEditorActiionConstant.java: - * src/org/eclipse/cdt/internal/editor/ICEditorActionDefinitonsIds.java: - * src/org/eclipse/cdt/internal/editor/TogglePresentationAction.java: - - - - -2003-04-04 Alain Magloire - - The way to register actions change from 2.0 to 2.1 - Action must have an ID. This fixes the editor to - be activate on Ctrl+space. - - * src/org/eclipse/internal/ui/editor/CEditor.java: - * src/org/eclipse/internal/ui/ICEditorActionDefinitionIds.java: - -2003-04-04 Alain Magloire - - Remove on some warnings now that we move to 2.1 - - * src/org/eclipse/internal/ui/dialogs/SelectionStatusDialog.java: - * src/org/eclipse/internal/ui/editor/DocumentAdapter.java: - * src/org/eclipse/internal/ui/preferences/CEditroPreference.java: - * src/org/eclipse/internal/ui/CElementImageProvider.java: - * src/org/eclipse/cdt/ui/CUIPlugin.java - -2003-04-02 Alain Magloire - - Show LibraryReference in the CViewer. - - * src/org/eclipse/internal/ui/cview/CViewSorter.java: - * src/org/eclipse/internal/ui/BaseCElementContentProvider.java: - Call CProject.getLibraryReferences(). - * src/org/eclipse/internal/ui/CElementImagerProvider.java: - * src/org/eclipse/internal/ui/CPluginImages.java: - lib_obj.gif. - -2003-04-02 Alain Magloire - - Bug fix and cleanup in CView - - * src/org/eclipse/internal/ui/cview/CView.java: - Cleanup the linkToEditor(). - * src/org/eclipse/internal/util/UtilEditor.java: - Bug fix. - -2003-04-01 Alain Magloire - - Support to open a child in an IBinary if we know the TranslationUnit. - - * src/org/eclipse/internal/ui/editor/CEditor.java: - setSelection() make the method visible. - * src/org/eclipse/internal/ui/util/EditorUtility.java: - More static method taken from the JDT. - * src/org/eclipse/internal/ui/cview/CView.java: - handleDoubleClick(), for IBinary. - -2003-04-01 Alain Magloire - - Patch from Hoda Amer. - New icons for enumerations, enumerators and typedefs. - Small fix for CElementLabelProvider.getText(). - - * src/org/eclipse/cdt/ui/CElementLabelProvider.java: - * src/org/eclipse/cdt/internal/ui/CElementImageProvider.java: - * src/org/eclipse/cdt/internal/ui/CPlugiImages.java - - * icons/full/obj16/enum_obj.gif: - * icons/full/obj16/enumerator_obj.gif: - * icons/full/obj16/typedef_obj.gif: - -2000-04-01 Alain Magloire - - Patch from Chris Songer. - The IBinaryElement like IBinaryFunction and IBinaryVariable contains - only line number no the offset, deal with when doing the selectin. - - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java: - -2003-03-27 Alain Magloire - - The selection in the CView to CEditor was not done. - We have now a new hierarchy for the binary and Archive: - IBinary - IBinaryModule - IBinaryFunction - IBinaryVariable - IBinaryElement - - * src/org/eclipse/cdt/internal/ui/cview/CView.java - * src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java - * src/org/eclipse/cdt/internal/ui/CElementImageProvider.java - * src/org/eclipse/cdt/ui/CElementContentProvider.java - -2003-03-27 Alain Magloire - - Patch from Thomas Fletcher. - - * src/org/eclipse/cdt/internal/ui/editor/BracketPainter.java: - The brace highlighting doesn't properly use the background - colour when it is drawn. - -2003-03-27 Alain Magloire - - ICElement.getResource() no longer throw an exception. - - * src/org/eclipse/cdt/internal/ui/cview/CViewDragAdapter.java - * src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java - * src/org/eclipse/cdt/internal/ui/uti./EditorUtility.java - -2003-03-27 Alain Magloire - - Some changes in the Core Model to make it closer to JDT, the hierarchy is now: - ICModel - ICProject - ICContainer - ITranslationUnit - IArchive - IBinary - - We now adjust the code. - - src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java - src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java - src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java - src/org/eclipse/cdt/internal/ui/CElementImageProvider.java - src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java - src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java - src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java - src/org/eclipse/cdt/internal/ui/cview/CView.java - src/org/eclipse/cdt/internal/ui/cview/CViewDragAdapter.java - src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java - src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java - src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java - src/org/eclipse/cdt/internal/ui/util/EditorUtility.java - src/org/eclipse/cdt/ui/CElementContentProvider.java - src/org/eclipse/cdt/ui/CElementLabelProvider.java - src/org/eclipse/cdt/ui/CUIPlugin.java - -2003-03-19 Alain Magloire - - Patch From Amer Hoda, to use the Working Copy of ICElement use in - the Core Model. - - * src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java: - * src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java: - * src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java: - * src/org/eclipse/cdt/internal/ui/editor/IWorkingCopyManager.java: - * src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java: - * src/org/eclipse/cdt/internal/ui/CFileWorkingCopy.java: - * src/org/eclipse/cdt/ui/CUIPlugin.java: - -2003-03-13 Alain Magloire - - * src/org/eclipse/cdt/utils/ui/controls/RadioButton.java: - Clean up of warnings. - -2003-03-12 David Inglis - * src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java,v - Removed buffering of build console as it was preventing output from being - visible during long builds. - http://bugs.eclipse.org/bugs/show_bug.cgi?id=32012 - -2003-03-02 Alain Magloire - - * src/org/eclipse/cdt/ui/wizards/BinaryParserBlock.java: - Check in the constructor if the project is null. - -2003-02-26 Alain Magloire - - * src/org/eclipse/cdt/ui/wizards/BinaryParserBlock.java: - Adjust to use the new BinaryParser scheme as described - in cdt-core-home/docs/binaryParser.html. - -2003-02-24 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java: - Reorganized import to remove warnings. - * src/org/eclipse/cdt/ui/CelementLabelProvider.java: Reorganize imports. - -2003-02-24 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java (isOverviewRulerVisible): - Change scope for protected to comply with Eclipse-2.1 - - * src/org/eclipse/cdt/ui/CelementContentProvider.java: Reorganize imports. - -2003-02-20 Alain Magloire - - This patch provides the UI controls and filters to use the working set - concept and apply it to the CView. The UI mimics the behaviour of what is - used by the Java packages view (rather than incorporating it as a part of - the Filters... dialog as was done in the Navigator). I didn't create a - specific C/C++ Working Set type since I figured that for C and C++ - projects which might include other projects it wasn't required. - This can be re-examined at a later date if required. - - * src/org/eclipse/cdt/internal/ui/cview/CView.java: - Listener of the property change for Working sets. - * src/org/eclipse/cdt/internal/ui/cview/AdjustWorkingSetFilterAction.java: - New file. - * src/org/eclipse/cdt/internal/ui/cview/CWorkingSetFilter.java: - New file. - * src/org/eclipse/cdt/internal/ui/cview/NewWorkingSetFilterAction.java: - New file. - -2003-02 -20 David Inglis - - * src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java - Fixed minor label problem. - -2003-02-19 David Inglis - * src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java - * src/org/eclipse/cdt/ui/wizards/conversion/ConvertToStdMakeConversionWizard.java - Due to CDT extensions interface cleanup. - -2003-02-17 Doug Schaefer - - Merged in Sam Robb's source for the build model. The source can be - found in the build source folder. There are new extension point schema - in the schema folder. There are build icons in the icons/full/build16 - folder. As well a number of extension points and extensions have been - added to the plugin.xml file. - -2003-02-17 Judy N. Green - * plugin.xml - * icons/full/ctool16/convert-normal.gif - - Added a new icon for the conversion wizard - -2003-02-13 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java: - Comment out old the reference to the builder. - -2003-02-13 Thomas Fletcher - * src/org/eclipse/cdt/internal/ui/cview/CView.java - * src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java - Cleaned up some text strings. - - * src/org/eclipse/cdt/internal/corext/template/ContextTypeRegistry.java - * src/org/eclipse/cdt/internal/corext/template/default-templates.xml - * src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java - * src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java - Adds a C++ context and moves those templates which are C++ specific to that context - Allows you to use the C++ and C contexts when you are working in C++ code, - but only giving you the C contexts when you are working in C code. - -2003-02-06 David Inglis - * src/org/eclipse/cdt/internal/core/DocumentInputStream.java (Removed) - * src/org/eclipse/cdt/internal/ui/DocumentInputStream.java (Added) - cleanup - moved to ui package - - * src/org/eclipse/cdt/internal/ui/CContentProvider.java (Removed) - * src/org/eclipse/cdt/internal/ui/CElementImageDescriptor.java (Removed) - * src/org/eclipse/cdt/internal/ui/CElementLabelProvider.java (Removed) - * src/org/eclipse/cdt/ui/CElementContentProvider.java (Added) - * src/org/eclipse/cdt/ui/CElementImageDescriptor.java (Added) - * src/org/eclipse/cdt/ui/CElementLabelProvider.java (Added) - * src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java - * src/org/eclipse/cdt/internal/ui/CWorkbenchAdapter.java - * src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java - * src/org/eclipse/cdt/internal/ui/cview/CView.java - * src/org/eclipse/cdt/internal/ui/dialogs/SelectionStatusDialog.java - * src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java - * src/org/eclipse/cdt/internal/ui/editor/CEditorErrorTickUpdater.java - * src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java - cleanup - moved CElementContentProvider/LableProvider/ImageDescrptor out of internal package - to ui so it can be cleanly used by others. - - * src/org/eclipse/cdt/internal/ui/text/eclipse2/CRuleBasedDamagerRepairer.java (Removed) - * src/org/eclipse/cdt/internal/ui/text/eclipse2/CRuleBasedPartitioner.java (Removed) - cleanup - No longer needed. - -2003-02-04 Alain Magloire - - Cleanup of the annoying error generate by the JDT 2.1 compiler - static versus non-static access to fields and methods. - - * src/org/eclipse/cdt/internal/corext/template/Templates.java - * src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java - * src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java - * src/org/eclipse/cdt/internal/ui/CPluginImages.java - * src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java - * src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java - * src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java - * src/org/eclipse/cdt/internal/ui/editor/CEditor.java - * src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java - * src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java - * src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java - * src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java - * src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java - * src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java - * src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java - * src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java - * src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java - * src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java - * src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java - * src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java - * src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java - * src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java - * src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java - * src/org/eclipse/cdt/internal/ui/util/EditorUtility.java - * src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java - * src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java - * src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java - * src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java - * src/org/eclipse/cdt/ui/CUIPlugin.java - * src/org/eclipse/cdt/ui/wizards/CProjectWizard.java - * src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java - * src/org/eclipse/cdt/ui/wizards/TabFolderPage.java - * src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java - * src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java - -2003-02-01 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/cview/CView.java: - Remove CreateFileAction, CreateFolderAction and OpenPerspectiveMenu, - deprecated classes. Instead use NewWizardMenu class. - * src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java: - Make fDocument protected scope. - * src/org/eclipse/cdt/ui/CUIPlugin.java: - Wrong definitions of FILE_WIZARD_ID and FOLDER_WIZARD_ID. - * plugin.properties: - New entries for file and folder wizards. - * plugin.plugin.xml: - New entries for file and folder wizards. - -2003-01-28 Alain Magloire - - With the help of the 2.1 compiler, fix the warnings when accessiong static - fields. - - * src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleView.java: - * src/org/eclipse/cdt/internal/ui/cview/FilerSelectionAction.java: - * src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java: - * src/org/eclipse/cdt/internal/ui/dialogs/AbstractElementListSelection.java: - * src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java: - * src/org/eclipse/cdt/internal/ui/editor/BracketPainter.java: - * src/org/eclipse/cdt/internal/ui/editor/ContentOulinerPager.java: - * src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java: - * src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java: - * src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java: - * src/org/eclipse/cdt/internal/ui/text/CPaintMatcher.java: - * src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java: - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/DialogField.java: - * src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java: - * src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java: - -2003-01-24 Alain Magloire - - * src/org/eclipse/cdt/ui/wizards/SettingsBlock.java (doRung): - Check for program that are quoted. - This patch was base on previous proposed by Alex Chapiro. - -2003-01-21 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java (category): - Use get{Header,Source}Extensions(). - * src/org/eclipse/cdt/internal/ui/editor/SearchForReferences.java (run): - Use getTranslationUnitExtensions(). - -2003-01-10 Alain Magloire - - Bug 28994 - - * src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java (getAdapter): - Use getResource() not getUnderlyingResource(), to return the IResource - Returning the underlyin resource may fool the Label Decorators. - -2003-01-09 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/CElementImageProvider.java (getBaseImageDescriptor): - Provide the same icon for methods. - -2003-01-07 Alain Magloire - - REMIND:More work needs to be done on the ContentAssist preferences - For example the autoactivation can not be a character but has to be - a string since we need: "." and "->" - To be revisited when we the story of the C/C++ Parser is clearer. - - * src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage (createContentAssistPage): - The addFieldText() for autoactivation is not a number. - -2003-01-02 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java (setRange): - Patch form Ed Burnette, email excerpt: - "There was an out of range exception happening when rescans - were done at a non-zero offset because the length being requested was - too large. This should work in 2.0 and 2.1 though I've only tested it on - 2.0.1 so far." - -2003-01-02 Alain Magloire - - * src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java(createAnnotationModel): - Check for IStorageEditorInput and use the getAdapter() to find a resource for the - annotation model. - -2002-12-12 Judy N Green - *src/org/eclipse/cdt/internal/ui/editor/CEditor.java - Fixed Bugzilla bug PR 25176 - The C editor doesn't properly handle the space conversion of tabs properly. - If I put the following in and tab spaces are set to 8 spaces: - - 1234567890123456789 - a - abc a - - Where it should probably line up with the first entry. - -2002-12-12 Judy N Green - *src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotation.java - Added a method that will attempt to highlight the correct instance of - a variable. It will skip instances of the string if they are encased in - String quotes and return the first instance that is not encased in quotes - -2002-12-11 Judy N Green - * src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java - Fix for the backwards display of typed text when the CDT ran within - Eclipse 2.1. - Patch submitted by Ed Burnette. - Tested on M1, 2.1 (20021204 integration build) and 2.0.1 - Bugzilla Bug 24648 - -2002-12-11 Alain Magloire - - Fix PR 27937. NPE in the C Editor preference page. - - * src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java (createBehaviourPage): - Remove listeners and variables for Margins, this will be enable by - only saving the changes in the store values. - -2002-12-06 Alain Magloire - - The hovering uses to the indexer to gather some information, but - it is sometime wrong since the information should be base on the context - say: - structure->printf - Obviously you do not want to know about libc printf() stdio call. - This will take sometime to fix. - - * src/org/eclipse/cdt/internal/ui/editor/DefaultCEditortextHover.java (getHoverInfo): - Beautify the print. - -2002-12-06 David Inglis - - * src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java: - * srcsrc/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java: - * src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java: - * src/org/eclipse/cdt/internal/ui/text/HTML2TextReader.java: New - * src/org/eclipse/cdt/internal/ui/text/HTMLPrinter.java: New - * src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java: New - * src/org/eclipse/cdt/internal/ui/text/LineBreakingReader.java - * src/org/eclipse/cdt/internal/ui/text/SubstitutionTextReader.java: New - - Added support to display balloon messages for lines with multiple markers. - Added support for basic markup within the hover balloons within the CEditor. - -2002-12-04 Alex Chapiro - - I propose to create isValidLocation method in addition to already existing - method isValidName. CProjectWizardPage has to invoke this new method on the - same way as it invokes isValidName. - - * src/org/eclipse/cdt/ui/wizard/CProjectWizard.java (isValidationLocation): - New method to allow a check on the location of the project. - * src/org/eclipse/cdt/ui/wizard/CProjectWizardPage.java (validatePage): - Call isValidationLocation() for the project Location - -2002-12-01 Alain Magloire - - * src/.../internal/ui/editor/OpenOnSelectionAction.java (getText): - Change the label provider for the tag. - * src/.../internal/ui/text/CCompletionProcessor.java(evalProposals): - Document.getChar() is 0 based move back the position. - -2002-11-28 Alain Magloire - - * plugin.xml: Make a targetID for AsmEditor to allow the debug - plugin to contributes breakpoint menus in the ruller. - - * src/.../internal/ui/editor/asm/AsmTextEditor.java (AsmTextEditor): - set the context id. - -2002-11-27 David Inglis - - * plugin.properties: - * plugin.xml: - * src/.../internal/ui/BuildConsoleManager.java: - * src/.../internal/ui/ConsoleEvent.java: - * src/.../internal/ui/buildconsole/BuildConsoleView.java: - * src/.../internal/ui/cview/CView.java: - * src/.../ui/preferences/BuildConsolePreferencePage.java: - * src/.../internal/ui/preferences/CPluginPreferencePage.java: - * src/.../ui/CUIPlugin.java: - * src/.../ui/IBuildConsoleEvent.java: - refactored CPluginPreferencePage into a BuildConsolePreferencePage. - added a configurable cap on the number of lines to keep in the build console. - -2002-11-27 David Inglis - * utils.ui/.../controls/ControlFactory.java: - removed unsed hyperlink stuff since it was leaking Cursors. - -2002-11-27 Alain Magloire - - * src/.../internal/ui/preferences/CProjectPropertyPage.java: - Added BinaryParserBlock part of the tab items. - (performOK): run this method in a runnable to allow cancellation. - * src/.../internal/ui/CContentProvider.java (processDelta): - Catch binary parser changes. - * src/.../ui/wizards/BinaryParserBlock.java: TabItem to change binary parser. - * src/.../ui/wizards/StdMakeProjectWizard.java: TabItem to change binary parser. - -2002-11-25 David Inglis - * src/.../internal/ui/editor/CEditor.java:(extends TextEditor) - * src/.../internal/ui/editor/CEditorActionContributor.java:(extends TextEditorActionContributor) - support line convertion actions and encoding. - -2002-11-22 Alex Chapiro - - * src/.../wizards/CProjectWizard.java: - The problem appears in ConversionWizard that inherits to CProjectWizard. The - first one does not initialize fmainPage which causes NullpointerException. - Actually, ConversionWizard doesn't have this page, so it is unsupported - operation for it. - -2002-11-22 Alain Magloire - - * src/.../internal/ui/BinaryPropertySource.java (getPropertyValue): - Check for core. - * src/.../internal/ui/CElementImageProvider.java (getBaseImageDescriptor): - Check for Core files. - * src/.../internal/ui/CElementLabelProvider.java (getCelementImage): - Removed. - * src/.../internal/ui/CPluginImages.java: - DESC_OBJS_CORE, IMG_OBJS_CORE, new icon for core files. - -2002-11-22 Alex Chapiro - - * src/.../wizards/conversion/ConversionWizard.java(doRun): - doRunPrologue() should not be call from doRun(). - -2002-11-21 David Inglis - * plugin.xml - * plugin.properties - fixed bug #25886 - duplicate menu entries for compare and replace - -2002-11-20 Alain Magloire - - Move the Index property page in the C/C++ project category. - * src/.../internal/ui/preferences/CIndexerManager.java: Removed. - * src/.../internal/ui/preferences/CProjectPropertyPage.java (indexerBlock): - Add the indexer block to the CProjectPropertyPage tab. - * src/.../ui/wizard/IndexerBlock.java: New file implementing - the indexer TabItem. - -2002-11-20 David Inglis - * src/.../internal/ui/cview/CView.java - Added support for label decorators - -2002-11-20 David Inglis - * src/.../internal/ui/BuildConsoleManager.java - Only flush the console when buffer > 512 instead of every line. - Plus do the console update synchronously as a async update can - cause problems if the update happen faster then the drawing. - -2002-11-18 Alain Magloire - - * src/.../internal/ui/editor/CEditor.java (createCSourceViewer): - Check for null pointer, the file maybe an IStorage. - * src/.../internal/ui/cview/CViewSorter.java (category): Expand - the category to include member of a translationUnit. - * src/.../internal/ui/cview/CContentProvider.java (processDelta): - postRefresh() for IBinary and IArchive files also. - * src/.../internal/ui/cview/CElementAdapterFactory.java (getAdapter): - Call getResource() instead of getUnderlyingResource(). - -2002-11-15 Alain Magloire - - * src/.../internal/ui/cview/CView.java (addBookMarkMenu): - Only add bookmark of IFile. - -2002-11-15 Alain Magloire - - * plugin.xml: Typo when doing the Ruler contibution - for Task and bookmarks, it should #CEditorRulerContext. - -2002-11-14 Alain Magloire - - * src/.../internal/ui/cview/CView.java (addBuildMenu): - Only show the "Make" and Build menus for containers. - -2002-11-14 Alain Magloire - - * src/.../internal/ui/buildconsole/BuildConsoleView.java (convertSelectionToProject): - new method. - (selectionChanged): Only reset the document if selected project changed. - -2002-11-13 Judy N. Green - */home/tools/org.eclipse.cdt.ui/plugin.properties - */home/tools/org.eclipse.cdt.ui/plugin.xml - updated labels & wizards to use combined conversion wizard - - *src/org/eclipse/cdt/internal/ui/CPluginResources.properties - updated labels - - *src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java - No longer add builder in run method. it is being added in enough other places - - *src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java - updated reference to call combined conversion page - - *src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java - Moved common c/c== conversion methods up to this shared class - - - Added: - *src/org/eclipse/cdt/ui/wizards/conversion/ConvertToStdMakeConversionWizard.java - *src/org/eclipse/cdt/ui/wizards/conversion/ConvertToStdMakeProjectWizardPage.java - Combined the C/C++ conversion wizards to this class - - Removed: - *src/org/eclipse/cdt/ui/wizards/conversion/ConvertSimpleToCCStdMakeProjectWizardPage.java - *src/org/eclipse/cdt/ui/wizards/conversion/ConvertCtoCCStdMakeProjectWizardPage.java - *src/org/eclipse/cdt/ui/wizards/conversion/ConvertSimpleToCStdMakeProjectWizardPage.java - *src/org/eclipse/cdt/ui/wizards/conversion/CtoCCConversionWizard.java - *src/org/eclipse/cdt/ui/wizards/conversion/SimpleToCCStdMakeConversionWizard.java - - - - - - -2002-11-13 Alain Magloire - - * src/.../internal/ui/editor/ProblemPainter.java (hasProblem): - Check for NPE, dispose may have been called. - -2002-11-13 Alain Magloire - - * src/.../wizards/CProjectWizard.java (isValidName): - New method to give a change to the wizard to check - the validity of a project name. - * src/.../wizard/CProjectWizardPage.java (CProjectWizardPage): - Takes new argument, the CProjectWizard. - (validatePage): calls isValidName() to check if name is valid. - -2002-11-13 David Inglis - - * plugin.properties - * plugin.xml - * src/.../internal/ui/preferences/CIndexerPropertyPage.java - Added new property page on c project to enable/disable the indexing service. - - -2002-11-06 Alain Magloire - - Fix for Bugzilla 25869. - - * src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java (getDefaultPrefixes): - New Method to return the prefix use to comment out code. - -2002-11-06 Tom Tromey - - Fix for Bugzilla 25784. - * src/org/eclipse/cdt/ui/wizards/CProjectWizardPage.java - (validatePage): Allow project name to contain a space. - * src/org/eclipse/cdt/internal/ui/CPluginResources.properties - (CProjectWizardPage.projectContainsSpace): Removed. - -2002-11-06 David Inglis - * src/.../ui/CUIPlugin.java: - fixed NPE. - -2002-11-01 David Inglis - * src/.../internal/ui/CElementLabelProvider.java: - change cpu display string to use isLittleEndian method on IBinary - - -2002-10-31 Judy N. Green - Removed the ReferenceBlock from the Project Properties display. Eclipse - adds a Project Properties entry to the Project Properties. - This was resulting in confusion since the - C/C++ Project --> Project References (filtered on nature == cnature) - - and the - Project References (unfiltered, showing all projects) - - Both listed some files in common, but they were not linked in any way - so the user could get into a very awkward state, when selecting or deselecting - as one view woud over ride the other. - - src/org/eclipse/cdt/internal/ui/preferences/CProjectPropertyPage.java: - - -2002-10-29 David Inglis - - Refactor ui.internal.CPlugin to ui.CUIPlugin with method to get the new - IBuildConsoleManager interface. - New BuildConsoleView which shows console on selected IProject plus tracks console - of active build. - - org.eclipse.cdt.ui/plugin.xml - src/org/eclipse/cdt/internal/corext/template/Templates.java - src/org/eclipse/cdt/internal/corext/template/c/CContext.java - src/org/eclipse/cdt/internal/corext/textmanipulation/TextBuffer.java - src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferEditor.java - src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java - src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java - src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java - src/org/eclipse/cdt/internal/ui/CContentProvider.java - src/org/eclipse/cdt/internal/ui/CElementImageProvider.java - src/org/eclipse/cdt/internal/ui/CElementLabelProvider.java - src/org/eclipse/cdt/internal/ui/CElementProperties.java - src/org/eclipse/cdt/internal/ui/CElementPropertySource.java - src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java - src/org/eclipse/cdt/internal/ui/CPluginImages.java - src/org/eclipse/cdt/internal/ui/CUIStatus.java - src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java - src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java - src/org/eclipse/cdt/internal/ui/ResourceAdapterFactory.java - src/org/eclipse/cdt/internal/ui/StandardCElementLabelProvider.java - src/org/eclipse/cdt/internal/ui/compare/CMergeViewer.java - src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java - src/org/eclipse/cdt/internal/ui/cview/CElementFilters.java - src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java - src/org/eclipse/cdt/internal/ui/cview/CView.java - src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java - src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java - src/org/eclipse/cdt/internal/ui/cview/FiltersContentProvider.java - src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java - src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java - src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java - src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java - src/org/eclipse/cdt/internal/ui/editor/CEditor.java - src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java - src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java - src/org/eclipse/cdt/internal/ui/editor/LexicalSortingAction.java - src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java - src/org/eclipse/cdt/internal/ui/editor/OpenOnSelectionAction.java - src/org/eclipse/cdt/internal/ui/editor/OverviewRuler.java - src/org/eclipse/cdt/internal/ui/editor/SearchForReferencesAction.java - src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java - src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextTools.java - src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java - src/org/eclipse/cdt/internal/ui/preferences/CLaunchingPropertyPage.java - src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java - src/org/eclipse/cdt/internal/ui/preferences/CProjectPropertyPage.java - src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java - src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java - src/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java - src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java - src/org/eclipse/cdt/internal/ui/text/CCompletionProcessor.java - src/org/eclipse/cdt/internal/ui/text/CFormattingStrategy.java - src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java - src/org/eclipse/cdt/internal/ui/text/CTextTools.java - src/org/eclipse/cdt/internal/ui/text/ContentAssistPreference.java - src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java - src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java - src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java - src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java - src/org/eclipse/cdt/internal/ui/util/EditorUtility.java - src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java - src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java - src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java - src/org/eclipse/cdt/ui/wizards/CCProjectWizard.java - src/org/eclipse/cdt/ui/wizards/CProjectWizard.java - src/org/eclipse/cdt/ui/wizards/CProjectWizardPage.java - src/org/eclipse/cdt/ui/wizards/ReferenceBlock.java - src/org/eclipse/cdt/ui/wizards/SettingsBlock.java - src/org/eclipse/cdt/ui/wizards/StdCCWizard.java - src/org/eclipse/cdt/ui/wizards/StdCWizard.java - src/org/eclipse/cdt/ui/wizards/StdMakeProjectWizard.java - src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java - src/org/eclipse/cdt/ui/wizards/conversion/ConvertCtoCCStdMakeProjectWizardPage.java - src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java - src/org/eclipse/cdt/ui/wizards/conversion/ConvertSimpleToCCStdMakeProjectWizardPage.java - src/org/eclipse/cdt/ui/wizards/conversion/ConvertSimpleToCStdMakeProjectWizardPage.java - src/org/eclipse/cdt/ui/wizards/conversion/CtoCCConversionWizard.java - src/org/eclipse/cdt/ui/wizards/conversion/SimpleToCCStdMakeConversionWizard.java - src/org/eclipse/cdt/ui/wizards/conversion/SimpleToCStdMakeConversionWizard.java - - - do to refactor (import changes and CPlugin to CUIPlugin). - - src/org/eclipse/cdt/internal/ui/makeview/MakeAction.java - - no longer use console session attributes here. - - src/org/eclipse/cdt/internal/ui/CPlugin.java - - moved from internal and renamed to CUIPlugin.java - - src/org/eclipse/cdt/internal/ui/BuildConsoleAction.java - src/org/eclipse/cdt/internal/ui/BuildConsoleView.java - src/org/eclipse/cdt/internal/ui/ClearConsoleAction.java - - new Build console - - shows console on selected project. - - shows console of active build. - - src/org/eclipse/cdt/ui/CUIPlugin.java - - added method getBuildManager() - - refactored BuildConsole management into manager class - - src/org/eclipse/cdt/ui/IBuildConsoleEvent.java - src/org/eclipse/cdt/ui/IBuildConsoleListener.java - src/org/eclipse/cdt/ui/IBuildConsoleManager.java - src/org/eclipse/cdt/internal/ui/BuildConsole.java - src/org/eclipse/cdt/internal/ui/CConsole.java - src/org/eclipse/cdt/internal/ui/ConsoleEvent.java - src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java - - new build manager and interfaces for managing and tracking console activity. - - -2002-10-28 David Inglis - - * /src/.../ui/cview/CView.java - Hookup actions to global actions in Projects menu, (build actions and close project). - -2002-10-25 Judy N. Green - Removed a redundant "Eclipse Platform" from the plugin.properties file. - It was resulting in weird looking titles. - - /plugin.properties - - perspective.name=C/C++ Development - Eclipse Platform - changed to - perspective.name=C/C++ Development - - -2002-10-23 Judy N. Green - CView overwrite files dialog text changed - so that it is the same in the CView as in the Navigator - when dragging and dropping files - - src/../internal/ui/CPluginResources.properties - src/../internal/ui/cview/CViewDropAdapter.java - - -2002-10-23 David Inglis - - * src/.../internal/ui/cview/CView.java: - - put "all" target in default MakeAction. - -2002-10-21 Judy N. Green - - Added a selection changed listener to the textViewer - managed by the C Build View (BuildConsoleView.java). - This updates the state read by the tool bar menu items - and now enables the copy action when there is a selection - made in the C-Build console. - - Ctrl + A, now selects all text in the C-Build View - Ctrl + C, now copies the selection to the clipboard - - * src/../internal/ui/BuildConsoleAction.java: - - cleaned up the logic and removed commented - out code in the update() method - * src/../internal/ui/BuildConsoleView.java: - - added a SelectionChangedListener to the contained textViewer - -2002-10-17 Alain Magloire - - Patch from Alex Chapiro. - - * src/.../utils/ui/controls/ControlFactory.java: - - createCombo methods created CCombo objects; all this methods - where changed to create Combo object. Methods createCCombo - were created to keep creation of CCombo cobjects. - - general code cleaning - -2002-10-16 Alain Magloire - By Boosting the level warning of the java compiler, - we catch unused imports or variables. For example - by changing the scope, the compiler no longer has - to provide synthetic methos. - - * src/../internal/corext/textmanipulation/MoveTextEdit.java: - * src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java : - * src/../internal/corext/textmanipulation/TextEditNode.java: - * src/../internal/ui/BuildConsoleView.java: - * src/../internal/ui/CContentProvider.java: - * src/../internal/ui/CPlugin.java: - * src/../internal/ui/cview/CView.java: - * src/../internal/ui/dialogs/AbstractElementListSelectionDialog.java: - * src/../internal/ui/dialogs/MessageLine.java: - * src/../internal/ui/dialogs/SelectionList.java: - * src/../internal/ui/editor/CContentOutlinePage.java: - * src/../internal/ui/editor/CDocumentProvider.java: - * src/../internal/ui/editor/CEditorActionContributor.java: - * src/../internal/ui/editor/CEditorErrorTickUpdater.java - * src/../internal/ui/editor/OverviewRuler.java: - * src/../internal/ui/editor/PaintManager.java: - * src/../internal/ui/editor/ProblemPainter.java: - * src/../internal/ui/editor/asm/AsmCodeScanner.java: - * src/../internal/ui/editor/asm/AsmSourceViewerConfiguration.java: - * src/../internal/ui/editor/asm/AsmTextEditor.java: - * src/../internal/ui/editor/asm/AsmTextTools.java: - * src/../internal/ui/makeview/MakeView.java: - * src/../internal/ui/preferences/CEditorPreferencePage.java: - * src/../internal/ui/preferences/CLaunchingPropertyPage.java: - * src/../internal/ui/preferences/CPluginPreferencePage.java: - * src/../internal/ui/preferences/CProjectPropertyPage.java: - * src/../internal/ui/preferences/ColorEditor.java: - * src/../internal/ui/preferences/EditTemplateDialog.java: - * src/../internal/ui/preferences/OverlayPreferenceStore.java: - * src/../internal/ui/preferences/TemplatePreferencePage.java: - * src/../internal/ui/text/CCodeScanner.java: - * src/../internal/ui/text/CSourceViewerConfiguration.java: - * src/../internal/ui/text/util/CColorManager.java: - * src/../internal/ui/util/ProblemTreeViewer.java: - * src/../internal/ui/wizards/dialogfields/StringDialogField.java: - * src/../ui/wizards/CProjectWizardPage.java: - * src/../ui/wizards/SettingsBlock.java: - * src/../ui/wizards/conversion/ConvertProjectWizardPage.java: - * utils.ui/../utils/ui/controls/RadioButtonsArea.java: - Remove unused imports and change the scope when necessary. - -2002-10-16 Alain Magloire - - By Boosting the level warning of the java compiler, - we catch unused imports or variables. - - * src/../internal/ui/editor/asm/AsmPartitionScanner.java: - * src/../internal/ui/editor/asm/AsmSourceViewerConfiguration.java: - * src/../internal/ui/editor/asm/AsmTextEditor.java: - * src/../internal/ui/BuilderConsoleView.java: - Removed unused imports. - -2002-10-11 Alain Magloire - - * internal/ui/text/CCodeScanner.java: - * internal/ui/text/CppCodeScanner.java: - This updates the C/C++ scanner to include some missing - pre-processor pieces. - From Thomas Fletcher. - -2002-10-11 Alain Magloire - - * CEditorTextHoverDispatcher.java (getCurrentTextHover): - This fixes a null pointer exception received when we hover - over the code in the C/C++ Editor colour preference dialog. - From Thomas Fletcher. - -2002-10-15 David Inglis - * MakeAction.java - Invoke builder as full build so that CBuilder is always invoked. - diff --git a/core/org.eclipse.cdt.ui/about.html b/core/org.eclipse.cdt.ui/about.html deleted file mode 100644 index 8c828de2ada..00000000000 --- a/core/org.eclipse.cdt.ui/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            10th July, 2002

            -

            License

            -

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

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/build.properties b/core/org.eclipse.cdt.ui/build.properties deleted file mode 100644 index 6b55904498a..00000000000 --- a/core/org.eclipse.cdt.ui/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -bin.includes = about.html,\ - plugin.xml,\ - about.html,\ - icons/,\ - plugin.properties,\ - cdtui.jar -source.cdtui.jar = src/,\ - utils.ui/ -src.includes = about.html,\ - plugin.xml,\ - about.html,\ - icons/,\ - plugin.properties -javadoc.packages = org.eclipse.cdt.ui.*,\ - org.eclipse.cdt.ui.wizards.*,\ - org.eclipse.cdt.ui.wizards.conversion.* diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/action-buildconfig.gif b/core/org.eclipse.cdt.ui/icons/full/build16/action-buildconfig.gif deleted file mode 100644 index bb64374a7be..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/action-buildconfig.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/action-deleteconfig.gif b/core/org.eclipse.cdt.ui/icons/full/build16/action-deleteconfig.gif deleted file mode 100644 index a06106af2d8..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/action-deleteconfig.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/action-editconfig.gif b/core/org.eclipse.cdt.ui/icons/full/build16/action-editconfig.gif deleted file mode 100644 index 820079ad6ba..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/action-editconfig.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/action-newconfig.gif b/core/org.eclipse.cdt.ui/icons/full/build16/action-newconfig.gif deleted file mode 100644 index 5b04a5e4610..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/action-newconfig.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/build_configs.gif b/core/org.eclipse.cdt.ui/icons/full/build16/build_configs.gif deleted file mode 100644 index bb64374a7be..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/build_configs.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif deleted file mode 100644 index 690bba071fc..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-compiler.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-compiler.gif deleted file mode 100644 index 20e7baed143..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-compiler.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-debug.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-debug.gif deleted file mode 100644 index 3052a80cd67..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-debug.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif deleted file mode 100644 index f966fc39d9b..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-librarian.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-linker.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-linker.gif deleted file mode 100644 index 91eec0f7dae..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-linker.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-preprocessor.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-preprocessor.gif deleted file mode 100644 index 082e49fbe66..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-preprocessor.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-profile.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-profile.gif deleted file mode 100644 index 45d614829bf..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-profile.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-release.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-release.gif deleted file mode 100644 index b7b23708e09..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-release.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif deleted file mode 100644 index 33981a5dbf1..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/build16/config-tool.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/alphab_sort_co.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/alphab_sort_co.gif deleted file mode 100644 index 6d772441d0d..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/alphab_sort_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/clear_co.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/clear_co.gif deleted file mode 100644 index 255832653fd..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/clear_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/collapseall.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/collapseall.gif deleted file mode 100644 index 0bae56c346e..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/collapseall.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/fields_co.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/fields_co.gif deleted file mode 100644 index e14ce565b4f..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/fields_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/metharg_obj.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/metharg_obj.gif deleted file mode 100644 index f300af6c848..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/metharg_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/open_incl.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/open_incl.gif deleted file mode 100644 index 58b9a012e89..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/open_incl.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/public_co.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/public_co.gif deleted file mode 100644 index 18103b11fc7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/public_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/search_sortmatch.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/search_sortmatch.gif deleted file mode 100644 index 9ed470d02f7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/search_sortmatch.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/segment_edit.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/segment_edit.gif deleted file mode 100644 index be9eb921513..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/segment_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/shift_l_edit.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/shift_l_edit.gif deleted file mode 100644 index 2700d541ecf..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/shift_l_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/shift_r_edit.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/shift_r_edit.gif deleted file mode 100644 index fed137329e7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/shift_r_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/clcl16/static_co.gif b/core/org.eclipse.cdt.ui/icons/full/clcl16/static_co.gif deleted file mode 100644 index 10d08aeff73..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/clcl16/static_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/convert-normal.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/convert-normal.gif deleted file mode 100644 index 80c3f8cbc5c..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/convert-normal.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newc_app.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newc_app.gif deleted file mode 100644 index 6c2d75db2e6..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newc_app.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newc_lib.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newc_lib.gif deleted file mode 100644 index c2f865be4db..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newc_lib.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_app.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_app.gif deleted file mode 100644 index 86d78df150f..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_app.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_lib.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_lib.gif deleted file mode 100644 index aeb778d5b57..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newcc_lib.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newclass_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newclass_wiz.gif deleted file mode 100644 index 901d55d7a33..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newclass_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newcprj_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newcprj_wiz.gif deleted file mode 100644 index 812cf458709..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newcprj_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newfile_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newfile_wiz.gif deleted file mode 100644 index 6baa03787f4..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newfile_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/newfolder_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/newfolder_wiz.gif deleted file mode 100644 index 2b49c1b36aa..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/newfolder_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/next_error_nav.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/next_error_nav.gif deleted file mode 100644 index 775842e89d1..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/next_error_nav.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/prev_error_nav.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/prev_error_nav.gif deleted file mode 100644 index 3b1bb7ca128..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/prev_error_nav.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/prj_obj.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/prj_obj.gif deleted file mode 100644 index 6624c902a16..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/prj_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ctool16/prop_edt.gif b/core/org.eclipse.cdt.ui/icons/full/ctool16/prop_edt.gif deleted file mode 100644 index 9d5a508bc49..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ctool16/prop_edt.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/cview16/buildconsole.gif b/core/org.eclipse.cdt.ui/icons/full/cview16/buildconsole.gif deleted file mode 100644 index 4723724a209..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/cview16/buildconsole.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/cview16/c_pers.gif b/core/org.eclipse.cdt.ui/icons/full/cview16/c_pers.gif deleted file mode 100644 index 86316d592ee..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/cview16/c_pers.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/cview16/cview.gif b/core/org.eclipse.cdt.ui/icons/full/cview16/cview.gif deleted file mode 100644 index 2a76756b1f1..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/cview16/cview.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/alphab_sort_co.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/alphab_sort_co.gif deleted file mode 100644 index 62a8fdb555b..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/alphab_sort_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/clear_co.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/clear_co.gif deleted file mode 100644 index d873c49b8a0..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/clear_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/collapseall.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/collapseall.gif deleted file mode 100644 index 0bae56c346e..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/collapseall.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/fields_co.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/fields_co.gif deleted file mode 100644 index 49bf69723ad..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/fields_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/metharg_obj.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/metharg_obj.gif deleted file mode 100644 index b3597e35192..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/metharg_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/open_incl.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/open_incl.gif deleted file mode 100644 index 9bdd658229f..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/open_incl.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/public_co.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/public_co.gif deleted file mode 100644 index 2733d9c71e6..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/public_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/segment_edit.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/segment_edit.gif deleted file mode 100644 index 6844777924f..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/segment_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_l_edit.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_l_edit.gif deleted file mode 100644 index a93966ed990..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_l_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_r_edit.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_r_edit.gif deleted file mode 100644 index c1254afc730..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/shift_r_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dlcl16/static_co.gif b/core/org.eclipse.cdt.ui/icons/full/dlcl16/static_co.gif deleted file mode 100644 index 7c78e8ce727..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dlcl16/static_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dtool16/newclass_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/dtool16/newclass_wiz.gif deleted file mode 100644 index 859df2976b5..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dtool16/newclass_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dtool16/newcprj_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/dtool16/newcprj_wiz.gif deleted file mode 100644 index 82450711805..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dtool16/newcprj_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dtool16/newfile_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/dtool16/newfile_wiz.gif deleted file mode 100644 index c931715bb32..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dtool16/newfile_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dtool16/next_error_nav.gif b/core/org.eclipse.cdt.ui/icons/full/dtool16/next_error_nav.gif deleted file mode 100644 index 874bf69d422..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dtool16/next_error_nav.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/dtool16/prev_error_nav.gif b/core/org.eclipse.cdt.ui/icons/full/dtool16/prev_error_nav.gif deleted file mode 100644 index 4c323769b99..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/dtool16/prev_error_nav.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/alphab_sort_co.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/alphab_sort_co.gif deleted file mode 100644 index 9d38f6dff8a..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/alphab_sort_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/clear_co.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/clear_co.gif deleted file mode 100644 index 6faf8d66fef..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/clear_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/collapseall.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/collapseall.gif deleted file mode 100644 index 3409b11b330..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/collapseall.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/fields_co.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/fields_co.gif deleted file mode 100644 index ac9f965d0c4..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/fields_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/metharg_obj.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/metharg_obj.gif deleted file mode 100644 index e43f9eecd4f..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/metharg_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/open_incl.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/open_incl.gif deleted file mode 100644 index aec95f8fbcc..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/open_incl.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/public_co.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/public_co.gif deleted file mode 100644 index 662f345ec05..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/public_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/segment_edit.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/segment_edit.gif deleted file mode 100644 index e292fe5ef18..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/segment_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/shift_l_edit.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/shift_l_edit.gif deleted file mode 100644 index fe7b3111b11..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/shift_l_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/shift_r_edit.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/shift_r_edit.gif deleted file mode 100644 index e0f2a56933d..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/shift_r_edit.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/elcl16/static_co.gif b/core/org.eclipse.cdt.ui/icons/full/elcl16/static_co.gif deleted file mode 100644 index 9330990b108..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/elcl16/static_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/etool16/newclass_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/etool16/newclass_wiz.gif deleted file mode 100644 index a34cb30b8d4..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/etool16/newclass_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/etool16/newcprj_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/etool16/newcprj_wiz.gif deleted file mode 100644 index 5f7c6a973f8..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/etool16/newcprj_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/etool16/newfile_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/etool16/newfile_wiz.gif deleted file mode 100644 index f2fe6e1d036..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/etool16/newfile_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/etool16/next_error_nav.gif b/core/org.eclipse.cdt.ui/icons/full/etool16/next_error_nav.gif deleted file mode 100644 index 6a8e019b5ad..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/etool16/next_error_nav.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/etool16/prev_error_nav.gif b/core/org.eclipse.cdt.ui/icons/full/etool16/prev_error_nav.gif deleted file mode 100644 index 2cba4b14ae6..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/etool16/prev_error_nav.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/eview16/buildconsole.gif b/core/org.eclipse.cdt.ui/icons/full/eview16/buildconsole.gif deleted file mode 100644 index 56d14e449eb..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/eview16/buildconsole.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/eview16/c_pers.gif b/core/org.eclipse.cdt.ui/icons/full/eview16/c_pers.gif deleted file mode 100644 index 655cd2f4c21..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/eview16/c_pers.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/ar_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/ar_obj.gif deleted file mode 100644 index f6064b678ef..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/ar_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/bin_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/bin_obj.gif deleted file mode 100644 index b96495c7bb1..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/bin_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint.gif deleted file mode 100644 index 4f92c1bf2c7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_active.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_active.gif deleted file mode 100644 index 5f17a268dec..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_active.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_disabled.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_disabled.gif deleted file mode 100644 index f6fd492d944..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/breakpoint_disabled.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/build_menu.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/build_menu.gif deleted file mode 100644 index 3fc40d6a13a..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/build_menu.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/c_file_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/c_file_obj.gif deleted file mode 100644 index 1bb68c2d649..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/c_file_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/cdeclaration_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/cdeclaration_obj.gif deleted file mode 100644 index d079ebb14fa..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/cdeclaration_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/cfolder_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/cfolder_obj.gif deleted file mode 100644 index 33ce8827e17..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/cfolder_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/class_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/class_obj.gif deleted file mode 100644 index a4a14864987..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/class_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/container_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/container_obj.gif deleted file mode 100644 index 3aa2efae2e0..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/container_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/core_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/core_obj.gif deleted file mode 100644 index d3fe88e9bc2..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/core_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/csearch_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/csearch_obj.gif deleted file mode 100644 index d81390b1c9e..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/csearch_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/define_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/define_obj.gif deleted file mode 100644 index b3ddb5deebc..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/define_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif deleted file mode 100644 index 3ce0d82ebc4..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/enum_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif deleted file mode 100644 index a73f31a81f6..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/enumerator_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/exec_dbg_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/exec_dbg_obj.gif deleted file mode 100644 index 3052a80cd67..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/exec_dbg_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/exec_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/exec_obj.gif deleted file mode 100644 index 8174dade2bb..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/exec_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/field_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/field_obj.gif deleted file mode 100644 index 19d27defb62..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/field_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/field_private_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/field_private_obj.gif deleted file mode 100644 index 0e292426734..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/field_private_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/field_protected_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/field_protected_obj.gif deleted file mode 100644 index 222116b455c..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/field_protected_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/field_public_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/field_public_obj.gif deleted file mode 100644 index 630b286c3bd..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/field_public_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/function_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/function_obj.gif deleted file mode 100644 index 18103b11fc7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/function_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/h_file_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/h_file_obj.gif deleted file mode 100644 index 6095bd540de..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/h_file_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/include_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/include_obj.gif deleted file mode 100644 index 2cc5866a64c..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/include_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/lib_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/lib_obj.gif deleted file mode 100644 index f966fc39d9b..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/lib_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/method_private_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/method_private_obj.gif deleted file mode 100644 index b5b88535179..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/method_private_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/method_protected_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/method_protected_obj.gif deleted file mode 100644 index 2b76d36edf5..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/method_protected_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/method_public_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/method_public_obj.gif deleted file mode 100644 index 18103b11fc7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/method_public_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/search_decl_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/search_decl_obj.gif deleted file mode 100644 index 3eddefd94ea..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/search_decl_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/search_ref_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/search_ref_obj.gif deleted file mode 100644 index 1b0c43bc1ee..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/search_ref_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/search_sortmatch.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/search_sortmatch.gif deleted file mode 100644 index 9ed470d02f7..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/search_sortmatch.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/shlib_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/shlib_obj.gif deleted file mode 100644 index 4e51447b23b..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/shlib_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/struct_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/struct_obj.gif deleted file mode 100644 index cb2869f2488..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/struct_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/template_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/template_obj.gif deleted file mode 100644 index b4d8ea83502..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/template_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif deleted file mode 100644 index 7e3ace3e77b..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/typedef_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/union_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/union_obj.gif deleted file mode 100644 index b8405d54bb4..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/union_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif deleted file mode 100644 index 74a3d222c70..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/var_declaration_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/variable_local_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/variable_local_obj.gif deleted file mode 100644 index 461c4e79feb..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/variable_local_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/obj16/variable_obj.gif b/core/org.eclipse.cdt.ui/icons/full/obj16/variable_obj.gif deleted file mode 100644 index 9fa6383efc9..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/obj16/variable_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif deleted file mode 100644 index ae434bfb4c5..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/c_ovr.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/error_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/error_co.gif deleted file mode 100644 index 8612eaff599..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/error_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif deleted file mode 100644 index 6b6a2a08343..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/static_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/template_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/template_co.gif deleted file mode 100644 index 9505e593ee0..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/template_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif deleted file mode 100644 index 4f4b767665c..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/volatile_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/ovr16/warning_co.gif b/core/org.eclipse.cdt.ui/icons/full/ovr16/warning_co.gif deleted file mode 100644 index 3af228ceac3..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/ovr16/warning_co.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/c_app_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/c_app_wiz.gif deleted file mode 100644 index 60ccf9c7c6a..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/wizban/c_app_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/newclass_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/newclass_wiz.gif deleted file mode 100644 index d3e28433c15..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/wizban/newclass_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/newcprj_wiz.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/newcprj_wiz.gif deleted file mode 100644 index 60ccf9c7c6a..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/wizban/newcprj_wiz.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif deleted file mode 100644 index beefb8ee95d..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/wizban/newmngc_app.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif deleted file mode 100644 index 85e3f72d33c..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/wizban/newmngcc_app.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/icons/full/wizban/prj_obj.gif b/core/org.eclipse.cdt.ui/icons/full/wizban/prj_obj.gif deleted file mode 100644 index 6624c902a16..00000000000 Binary files a/core/org.eclipse.cdt.ui/icons/full/wizban/prj_obj.gif and /dev/null differ diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties deleted file mode 100644 index 98bde042e4a..00000000000 --- a/core/org.eclipse.cdt.ui/plugin.properties +++ /dev/null @@ -1,96 +0,0 @@ -pluginName=C/C++ Development Tools UI -providerName=Eclipse.org - -elementFiltersName=CElement Filters -textHoversName=Text Hovers -editorActionsName=Editor Actions -editorRulerActionsName=Editor Ruler Actions -completionContributorName=Completion Contribution -nature.name=C Nature -perspective.name=C/C++ Development -viewsCategory.name=&C -BuildConsoleView.name=C-Build -CView.name=C/C++ Projects - -# The Wizards -# C -newCWizardsCategory.name=C - -# C++ -newCCWizardsCategory.name=C++ - -#Project Conversion -ConversionWizard.name=Convert a project's nature -ConversionWizard.description=Convert a project's nature - -NewWizards.folder = Folder -NewWizards.folder.description = Create a new folder resource -NewWizards.file = File -NewWizards.file.description = Create a new file resource -NewWizards.class = Class -NewWizards.class.description = Create a new C++ class -OpenNewFileWizardAction.label=&File -OpenNewFileWizardAction.tooltip=Create a file -OpenNewFolderWizardAction.label=&Folder -OpenNewFolderWizardAction.tooltip=Create a folder -OpenClassWizardAction.label=&Class -OpenClassWizardAction.tooltip=Create a new C++ class - -# Editor - -# Scope and Key Commands -scope.cEditor.name=C/C++ Editor -cEditor.description=Editor for C/C++ Source Files - -category.source.name=C/C++ Source -category.source.description= C/C++ Source Actions - -ActionDefinition.comment.name= Comment -ActionDefinition.comment.description= Turn the selected lines into // style comments - -ActionDefinition.uncomment.name= Uncomment -ActionDefinition.uncomment.description= Uncomment the selected // style comment lines - -ActionDefinition.opendecl.name= Open Declaration -ActionDefinition.opendecl.description= Open an editor on the selected element's declaration(s) - -CEditor.name=C Editor -CPluginPreferencePage.name=C/C++ -CPluginEditorPreferencePage.name=C/C++ Editor -CPluginTemplatePreferencePage.name=Code Templates -CPluginBuildConsolePreferencePage.name=Build Console -CProjectPropertyPage.name=C/C++ Project -CLaunchingPropertyPage.executionArguments.name=C Execution Arguments -CApplicationLauncher.label=Executable -CApplicationLauncher.description=Launch a local command -CProblemMarker.name=C Problem - -todoPageName=C/C++ Task Tags -todoTaskPrefName=Task Tags - -Editors.DefaultTextEditor = Default Text Editor -AsmEditor.name = Assembly Editor - -CFolderActionSet.label=C Folder Actions -CFolderActionSet.description=C Folder Action Set - -# Task Action -DeleteTaskAction.label=Delete C/C++ Markers - -# C/C++ Search -CSearchPage.label= C/C++ Search -openCSearchPageAction.label= &C/C++... -ElementNameSorter.label= &Name -ElementNameSorter.tooltip= Sort the view by C Element Name -ParentNameSorter.label= &Parent Name -ParentNameSorter.tooltip= Sort the view by C Element Parent Name -PathNameSorter.label= P&ath -PathNameSorter.tooltip= Sort the view by Resource Path - -# Action sets -CSearchActionSet.label= C/C++ Search -CSearchActionSet.description= Action set containing search related C/C++ actions - -# Menus -searchMenu.label= Se&arch - diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml deleted file mode 100644 index baeca264681..00000000000 --- a/core/org.eclipse.cdt.ui/plugin.xml +++ /dev/null @@ -1,511 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %NewWizards.class.description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextType.java deleted file mode 100644 index 92d9145e30b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextType.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.textmanipulation.MultiTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.NopTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.SimpleTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBuffer; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBufferEditor; -import org.eclipse.cdt.internal.corext.textmanipulation.TextEdit; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import java.util.Vector; -import org.eclipse.core.runtime.CoreException; - - -/** - * A context type is a context factory. - */ -public abstract class ContextType implements ITemplateEditor { - - /** name of the context type */ - private final String fName; - - /** variables used by this content type */ - private final Map fVariables= new HashMap(); - - /** - * Creates a context type with a name. - * - * @param name the name of the context. It has to be unique wrt to other context names. - */ - public ContextType(String name) { - fName= name; - } - - /** - * Returns the name of the context type. - */ - public String getName() { - return fName; - } - - /** - * Adds a template variable to the context type. - */ - public void addVariable(TemplateVariable variable) { - fVariables.put(variable.getName(), variable); - } - - /** - * Removes a template variable from the context type. - */ - public void removeVariable(TemplateVariable variable) { - fVariables.remove(variable.getName()); - } - - /** - * Removes all template variables from the context type. - */ - public void removeAllVariables() { - fVariables.clear(); - } - - /** - * Returns an iterator for the variables known to the context type. - */ - public Iterator variableIterator() { - return fVariables.values().iterator(); - } - - /** - * Creates a template context. - */ - public abstract TemplateContext createContext(); - - /* - * @see ITemplateEditor#edit(TemplateBuffer) - */ - public void edit(TemplateBuffer templateBuffer, TemplateContext context) throws CoreException { - TextBuffer textBuffer= TextBuffer.create(templateBuffer.getString()); - TemplatePosition[] variables= templateBuffer.getVariables(); - - MultiTextEdit positions= variablesToPositions(variables); - MultiTextEdit multiEdit= new MultiTextEdit(); - - // iterate over all variables and try to resolve them - for (int i= 0; i != variables.length; i++) { - TemplatePosition variable= variables[i]; - - if (variable.isResolved()) - continue; - - String name= variable.getName(); - int[] offsets= variable.getOffsets(); - int length= variable.getLength(); - - TemplateVariable evaluator= (TemplateVariable) fVariables.get(name); - String value= (evaluator == null) - ? null - : evaluator.evaluate(context); - - if (value == null) - continue; - - variable.setLength(value.length()); - variable.setResolved(evaluator.isResolved(context)); - - for (int k= 0; k != offsets.length; k++) - multiEdit.add(SimpleTextEdit.createReplace(offsets[k], length, value)); - } - - TextBufferEditor editor= new TextBufferEditor(textBuffer); - editor.add(positions); - editor.add(multiEdit); - editor.performEdits(null); - - positionsToVariables(positions, variables); - - templateBuffer.setContent(textBuffer.getContent(), variables); - } - - private static MultiTextEdit variablesToPositions(TemplatePosition[] variables) { - MultiTextEdit positions= new MultiTextEdit(); - for (int i= 0; i != variables.length; i++) { - int[] offsets= variables[i].getOffsets(); - for (int j= 0; j != offsets.length; j++) - positions.add(new NopTextEdit(offsets[j], 0)); - } - - return positions; - } - - private static void positionsToVariables(MultiTextEdit positions, TemplatePosition[] variables) { - Iterator iterator= positions.iterator(); - - for (int i= 0; i != variables.length; i++) { - TemplatePosition variable= variables[i]; - - int[] offsets= new int[variable.getOffsets().length]; - for (int j= 0; j != offsets.length; j++) - offsets[j]= ((TextEdit) iterator.next()).getTextRange().getOffset(); - - variable.setOffsets(offsets); - } - } - - /** - * Returns the templates associated with this context type. - */ - public Template[] getTemplates() { - Template[] templates= Templates.getInstance().getTemplates(); - - Vector vector= new Vector(); - for (int i= 0; i != templates.length; i++) - if (templates[i].getContextTypeName().equals(fName)) - vector.add(templates[i]); - - return (Template[]) vector.toArray(new Template[vector.size()]); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextTypeRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextTypeRegistry.java deleted file mode 100644 index 7bcbf8526e0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ContextTypeRegistry.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.internal.corext.template.c.CFunctionContextType; -import org.eclipse.cdt.internal.corext.template.c.CGlobalContextType; -import org.eclipse.cdt.internal.corext.template.c.CStructureContextType; -import org.eclipse.cdt.internal.corext.template.c.CppFunctionContextType; -import org.eclipse.cdt.internal.corext.template.c.CppGlobalContextType; -import org.eclipse.cdt.internal.corext.template.c.CppStructureContextType; - - -/** - * A singleton to keep track of all known context types. - */ -public class ContextTypeRegistry { - - /** the singleton */ - private static ContextTypeRegistry fInstance; - - /** all known context types */ - private final Map fContextTypes= new HashMap(); - - /** - * Returns the single instance of this class. - */ - public static ContextTypeRegistry getInstance() { - if (fInstance == null) - fInstance= new ContextTypeRegistry(); - - return fInstance; - } - - /** - * Adds a context type to the registry. - */ - public void add(ContextType contextType) { - fContextTypes.put(contextType.getName(), contextType); - } - - /** - * Removes a context type from the registry. - */ - public void remove(ContextType contextType) { - fContextTypes.remove(contextType.getName()); - } - - /** - * Returns the context type if the name is valid, null otherwise. - */ - public ContextType getContextType(String name) { - return (ContextType) fContextTypes.get(name); - } - - /** - * Returns an iterator over the registered context type names. - */ - public Iterator iterator() { - return fContextTypes.keySet().iterator(); - } - - // XXX bootstrap with C and C++ types - private ContextTypeRegistry() { - add(new CGlobalContextType()); - add(new CStructureContextType()); - add(new CFunctionContextType()); - add(new CppGlobalContextType()); - add(new CppStructureContextType()); - add(new CppFunctionContextType()); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/DocumentTemplateContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/DocumentTemplateContext.java deleted file mode 100644 index c7a5fcb59bb..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/DocumentTemplateContext.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.util.Assert; - - - -/** - * A typical text based document template context. - */ -public abstract class DocumentTemplateContext extends TemplateContext { - - /** The text of the document. */ - private final String fString; - /** The completion position. */ - private final int fCompletionPosition; - - /** - * Creates a document template context. - */ - protected DocumentTemplateContext(ContextType type, String string, int completionPosition) { - super(type); - - Assert.isNotNull(string); - Assert.isTrue(completionPosition >= 0 && completionPosition <= string.length()); - - fString= string; - fCompletionPosition= completionPosition; - } - - /** - * Returns the string of the context. - */ - public String getString() { - return fString; - } - - /** - * Returns the completion position within the string of the context. - */ - public int getCompletionPosition() { - return fCompletionPosition; - } - - /** - * Returns the keyword which triggered template insertion. - */ - public String getKey() { - return fString.substring(getStart(), getEnd()); - } - - /** - * Returns the beginning offset of the keyword. - */ - public int getStart() { - return fCompletionPosition; - } - - /** - * Returns the end offset of the keyword. - */ - public int getEnd() { - return fCompletionPosition; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ITemplateEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ITemplateEditor.java deleted file mode 100644 index 34c64f98145..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/ITemplateEditor.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; - -/** - * A template editor implements an action to edit a template buffer in its context. - */ -public interface ITemplateEditor { - - /** - * Modifies a template buffer. - * - * @param buffer the template buffer - * @param context the template context - * @throws CoreException if the buffer cannot be successfully modified - */ - void edit(TemplateBuffer buffer, TemplateContext context) throws CoreException; - - public class TemplateContextKind { - public static final String C_GLOBAL_CONTEXT_TYPE = "C Global"; - public static final String C_FUNCTION_CONTEXT_TYPE = "C Function"; - public static final String C_STRUCTURE_CONTEXT_TYPE = "C Structure"; - public static final String CPP_GLOBAL_CONTEXT_TYPE = "C++ Global"; - public static final String CPP_FUNCTION_CONTEXT_TYPE = "C++ Function"; - public static final String CPP_STRUCTURE_CONTEXT_TYPE = "C++ Structure"; - - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/SimpleTemplateVariable.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/SimpleTemplateVariable.java deleted file mode 100644 index 2e0ec456df2..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/SimpleTemplateVariable.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * A simple template variable, which always evaluates to a defined string. - */ -public class SimpleTemplateVariable extends TemplateVariable { - - /** The string to which this variable evaluates. */ - private String fEvaluationString; - /** A flag indicating if this variable can be resolved. */ - private boolean fResolved; - - /* - * @see TemplateVariable#TemplateVariable(String, String) - */ - protected SimpleTemplateVariable(String name, String description) { - super(name, description); - } - - /** - * Sets the string to which this variable evaluates. - * - * @param evaluationString the evaluation string, may be null. - */ - public final void setEvaluationString(String evaluationString) { - fEvaluationString= evaluationString; - } - - /* - * @see TemplateVariable#evaluate(TemplateContext) - */ - public String evaluate(TemplateContext context) { - return fEvaluationString; - } - - /** - * Sets the resolved flag. - */ - public final void setResolved(boolean resolved) { - fResolved= resolved; - } - - /* - * @see TemplateVariable#isResolved(TemplateContext) - */ - public boolean isResolved(TemplateContext context) { - return fResolved; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Template.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Template.java deleted file mode 100644 index f44fcd0c456..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Template.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * A template consiting of a name and a pattern. - */ -public class Template { - - /** The name of this template */ - private String fName; - /** A description of this template */ - private String fDescription; - /** The name of the context type of this template */ - private String fContextTypeName; - /** The template pattern. */ - private String fPattern; - /** A flag indicating if the template is active or not. */ - private boolean fEnabled= true; - - /** - * Creates an empty template. - */ - public Template() { - this("", "", "", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - } - - /** - * Creates a copy of a template. - */ - public Template(Template template) { - this(template.getName(), template.getDescription(), template.getContextTypeName(), template.getPattern()); - } - - /** - * Creates a template. - * - * @param name the name of the template. - * @param description the description of the template. - * @param contextTypeName the name of the context type in which the template can be applied. - * @param pattern the template pattern. - */ - public Template(String name, String description, String contextTypeName, String pattern) { - fName= name; - fDescription= description; - fContextTypeName= contextTypeName; - fPattern= pattern; - } - - /* - * @see Object#equals(Object) - */ - public boolean equals(Object object) { - if (!(object instanceof Template)) - return false; - - Template template= (Template) object; - - if (template == this) - return true; - - return - template.fName.equals(fName) && - template.fPattern.equals(fPattern) && - template.fContextTypeName.equals(fContextTypeName); - } - - /* - * @see Object#hashCode() - */ - public int hashCode() { - return fName.hashCode() ^ fPattern.hashCode() ^ fContextTypeName.hashCode(); - } - - /** - * Sets the description of the template. - */ - public void setDescription(String description) { - fDescription= description; - } - - /** - * Returns the description of the template. - */ - public String getDescription() { - return fDescription; - } - - /** - * Sets the name of the context type in which the template can be applied. - */ - public void setContext(String contextTypeName) { - fContextTypeName= contextTypeName; - } - - /** - * Returns the name of the context type in which the template can be applied. - */ - public String getContextTypeName() { - return fContextTypeName; - } - - /** - * Sets the name of the template. - */ - public void setName(String name) { - fName= name; - } - - /** - * Returns the name of the template. - */ - public String getName() { - return fName; - } - - /** - * Sets the pattern of the template. - */ - public void setPattern(String pattern) { - fPattern= pattern; - } - - /** - * Returns the template pattern. - */ - public String getPattern() { - return fPattern; - } - - /** - * Sets the enable state of the template. - */ - public void setEnabled(boolean enable) { - fEnabled= enable; - } - - /** - * Returns true if template is enabled, false otherwise. - */ - public boolean isEnabled() { - return fEnabled; - } - - /** - * Returns true if template matches the prefix and context, - * false otherwise. - */ - public boolean matches(String prefix, String contextTypeName) { - return - fEnabled && - fContextTypeName.equals(contextTypeName) && - (prefix.length() != 0) && - fName.toLowerCase().startsWith(prefix.toLowerCase()); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateBuffer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateBuffer.java deleted file mode 100644 index 1012037c6bc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateBuffer.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.util.Assert; - - -/** - * A template buffer is a container for a string and variables. - */ -public final class TemplateBuffer { - - /** The string of the template buffer */ - private String fString; - /** The variable positions of the template buffer */ - private TemplatePosition[] fVariables; - - /** - * Creates a template buffer. - * - * @param string the string - * @param variables the variable positions - * @throws CoreException for illegal variable positions - */ - public TemplateBuffer(String string, TemplatePosition[] variables) throws CoreException { - setContent(string, variables); - } - - /** - * Sets the content of the template buffer. - * - * @param string the string - * @param variables the variable positions - * @throws CoreException for illegal variable positions - */ - public final void setContent(String string, TemplatePosition[] variables) throws CoreException { - Assert.isNotNull(string); - Assert.isNotNull(variables); - - // XXX assert non-overlapping variable properties - - fString= string; - fVariables= variables; - } - - /** - * Returns the string of the template buffer. - */ - public final String getString() { - return fString; - } - - /** - * Returns the variable positions of the template buffer. - */ - public final TemplatePosition[] getVariables() { - return fVariables; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateContext.java deleted file mode 100644 index 56272046f2b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateContext.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; - -/** - * A template context. A template context is associated with a context type. - */ -public abstract class TemplateContext { - - /** context type of this context */ - private final ContextType fContextType; - - /** - * Creates a template context of a particular context type. - */ - protected TemplateContext(ContextType contextType) { - fContextType= contextType; - } - - /** - * Returns the context type of this context. - */ - public ContextType getContextType() { - return fContextType; - } - - /** - * Evaluates the template and returns a template buffer. - */ - public abstract TemplateBuffer evaluate(Template template) throws CoreException; - - /** - * Tests if the specified template can be evaluated in this context. - */ - public abstract boolean canEvaluate(Template template); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.java deleted file mode 100644 index a484961b86f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class TemplateMessages { - - private static final String RESOURCE_BUNDLE= TemplateMessages.class.getName(); - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private TemplateMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object arg) { - return MessageFormat.format(getString(key), new Object[] { arg }); - } - - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.properties deleted file mode 100644 index 73743c48aea..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateMessages.properties +++ /dev/null @@ -1,106 +0,0 @@ -######################################### -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -######################################### - -# preference page -TemplatePreferencePage.error.import=Failed to import templates. -TemplatePreferencePage.error.export=Failed to export templates. -TemplatePreferencePage.error.read.title=Reading Templates -TemplatePreferencePage.error.write.title=Reading Templates -TemplatePreferencePage.message=&Create, edit or remove templates: -TemplatePreferencePage.title=Templates - -TemplatePreferencePage.new=&New... -TemplatePreferencePage.edit=&Edit... -TemplatePreferencePage.import=&Import... -TemplatePreferencePage.export=E&xport... -TemplatePreferencePage.export.all=Ex&port All... -TemplatePreferencePage.remove=&Remove -TemplatePreferencePage.enable.all=Ena&ble All -TemplatePreferencePage.disable.all=Di&sable All -TemplatePreferencePage.editor=Template - -TemplatePreferencePage.column.name=Name -TemplatePreferencePage.column.context=Context -TemplatePreferencePage.column.description=Description - -TemplatePreferencePage.use.code.formatter=Use Code &Formatter - -TemplatePreferencePage.import.title=Importing Templates -TemplatePreferencePage.import.extension=*.xml - -TemplatePreferencePage.export.title=Exporting {0} Templates -TemplatePreferencePage.export.filename=templates.xml -TemplatePreferencePage.export.extension=*.xml - -TemplatePreferencePage.export.exists.title=Exporting Templates -TemplatePreferencePage.export.message={0} already exists.\nDo you want to replace it? - -TemplatePreferencePage.question.create.new.title=Edit Template -TemplatePreferencePage.question.create.new.message=The name of the template was changed.\nDo you want to create a new template? - -# edit template dialog -EditTemplateDialog.error.noname=Template name must not be empty. -EditTemplateDialog.error.adjacent.variables=Template pattern has adjacent variables. -EditTemplateDialog.title.new=New Template -EditTemplateDialog.title.edit=Edit Template - -EditTemplateDialog.name=&Name: -EditTemplateDialog.description=&Description: -EditTemplateDialog.context=&Context: -EditTemplateDialog.pattern=&Pattern: -EditTemplateDialog.insert.variable=Insert &Variable... - -EditTemplateDialog.undo=&Undo@Ctrl+Z -EditTemplateDialog.cut=Cu&t@Ctrl+X -EditTemplateDialog.copy=&Copy@Ctrl+C -EditTemplateDialog.paste=&Paste@Ctrl+V -EditTemplateDialog.select.all=Select &All@Ctrl+A -EditTemplateDialog.content.assist=Insert &Variable...@Ctrl+Space - -# template variable dialog -TemplateVariableDialog.title=Select a template variable. -TemplateVariableDialog.column.name=Name -TemplateVariableDialog.column.description=Description -TemplateVariableDialog.insert=&Insert - -TemplateVariableProposal.error.title=Error applying template variable proposal -TemplateVariableProcessor.error.title=Error creating template variable proposals - -# template set -TemplateSet.error.read=Error occured while reading templates. -TemplateSet.error.write=Error occured while writing templates. - -# templates -Templates.error.title=Error accessing templates. -Templates.error.read=Error occured while reading templates. -Templates.error.write=Error occured while writing templates. - -# template engine -TemplateEngine.error.title=Could not create template proposals. - -# template proposal -TemplateProposal.delimiter=\ - - -# template evaluator -TemplateEvaluator.error.title=Template Evaluation Error - -# template collector -TemplateCollector.variable.description.file=Filename of compilation unit -TemplateCollector.variable.description.line=Current line number -TemplateCollector.variable.description.date=Current date -TemplateCollector.variable.description.time=Current time -TemplateCollector.variable.description.user=User name -TemplateCollector.variable.description.array=A proposal for an array -TemplateCollector.variable.description.array.type=A proposal for the element type of an array -TemplateCollector.variable.description.array.element=A proposal for the element name of an array -TemplateCollector.variable.description.index=A proposal for an index (int) -TemplateCollector.variable.description.collector=A proposal for a collector (java.util.Collector) -TemplateCollector.variable.description.iterator=A proposal for an iterator (java.util.Iterator) -TemplateCollector.variable.description.return.type=Return type (evaluates to void) -TemplateCollector.variable.description.arguments=Method arguments (evaluates to empty string) - -# template translator -TemplateTranslator.error.incomplete.variable=Template has incomplete variables. -TemplateTranslator.error.invalid.identifier=Template has invalid variable identifiers. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplatePosition.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplatePosition.java deleted file mode 100644 index e760c48f518..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplatePosition.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * - */ -public class TemplatePosition { - - /** The name of the template position */ - private final String fName; - /** The default value of the template position */ - private final String fDefaultValue; - - /** The length of the template positions. */ - private int fLength; - /** The offsets of the template positions. */ - private int[] fOffsets; - /** A flag indicating if the template position has been resolved. */ - private boolean fResolved; - - /** - * Creates a template position. - * - * @param name the name of the template position. - * @param defaultValue the default value of the position. - * @param offsets the array of offsets of the position. - * @param the length of the position. - */ - public TemplatePosition(String name, String defaultValue, int[] offsets, int length) { - fName= name; - fDefaultValue= defaultValue; - fOffsets= offsets; - fLength= length; - fResolved= false; - } - - /** - * Returns the name of the position. - */ - public String getName() { - return fName; - } - - /** - * Returns the default value of the position. - */ - public String getDefaultValue() { - return fDefaultValue; - } - - /** - * Sets the length of the position. - */ - public void setLength(int length) { - fLength= length; - } - - /** - * Returns the length of the position. - */ - public int getLength() { - return fLength; - } - - /** - * Sets the offsets of the position. - */ - public void setOffsets(int[] offsets) { - fOffsets= offsets; - } - - /** - * Returns the offsets of the position. - */ - public int[] getOffsets() { - return fOffsets; - } - - /** - * Sets the resolved flag of the position. - */ - public void setResolved(boolean resolved) { - fResolved= resolved; - } - - /** - * Returns true if the position is resolved, false otherwise. - */ - public boolean isResolved() { - return fResolved; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateSet.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateSet.java deleted file mode 100644 index 94fbff31f63..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateSet.java +++ /dev/null @@ -1,295 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.CStatusConstants; -import org.eclipse.cdt.internal.ui.CUIException; -import org.eclipse.cdt.internal.ui.CUIStatus; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.Serializer; -import org.apache.xml.serialize.SerializerFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; - -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * TemplateSet manages a collection of templates and makes them - * persistent. - */ -public class TemplateSet { - - private static class TemplateComparator implements Comparator { - public int compare(Object arg0, Object arg1) { - if (arg0 == arg1) - return 0; - - if (arg0 == null) - return -1; - - Template template0= (Template) arg0; - Template template1= (Template) arg1; - - return template0.getName().compareTo(template1.getName()); - } - } - - private static final String TEMPLATE_TAG= "template"; //$NON-NLS-1$ - private static final String NAME_ATTRIBUTE= "name"; //$NON-NLS-1$ - private static final String DESCRIPTION_ATTRIBUTE= "description"; //$NON-NLS-1$ - private static final String CONTEXT_ATTRIBUTE= "context"; //$NON-NLS-1$ - private static final String ENABLED_ATTRIBUTE= "enabled"; //$NON-NLS-1$ - - private List fTemplates= new ArrayList(); - private Comparator fTemplateComparator= new TemplateComparator(); - private Template[] fSortedTemplates= new Template[0]; - - /** - * Convenience method for reading templates from a file. - * - * @see addFromStream(InputStream) - */ - public void addFromFile(File file) throws CoreException { - InputStream stream= null; - - try { - stream= new FileInputStream(file); - addFromStream(stream); - - } catch (IOException e) { - throwReadException(e); - - } finally { - try { - if (stream != null) - stream.close(); - } catch (IOException e) {} - } - } - - /** - * Reads templates from a XML stream and adds them to the template set. - */ - public void addFromStream(InputStream stream) throws CoreException { - try { - DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance(); - DocumentBuilder parser= factory.newDocumentBuilder(); - Document document= parser.parse(new InputSource(stream)); - NodeList elements= document.getElementsByTagName(TEMPLATE_TAG); - - int count= elements.getLength(); - for (int i= 0; i != count; i++) { - Node node= elements.item(i); - NamedNodeMap attributes= node.getAttributes(); - - if (attributes == null) - continue; - - String name= getAttributeValue(attributes, NAME_ATTRIBUTE); - String description= getAttributeValue(attributes, DESCRIPTION_ATTRIBUTE); - String context= getAttributeValue(attributes, CONTEXT_ATTRIBUTE); - Node enabledNode= attributes.getNamedItem(ENABLED_ATTRIBUTE); - - if (name == null || description == null || context == null) - throw new SAXException("Missing required attribute"); - - boolean enabled= (enabledNode == null) || (enabledNode.getNodeValue().equals("true")); //$NON-NLS-1$ - - StringBuffer buffer= new StringBuffer(); - NodeList children= node.getChildNodes(); - for (int j= 0; j != children.getLength(); j++) { - String value= children.item(j).getNodeValue(); - if (value != null) - buffer.append(value); - } - String pattern= buffer.toString().trim(); - - Template template= new Template(name, description, context, pattern); - template.setEnabled(enabled); - add(template); - } - - sort(); - - } catch (ParserConfigurationException e) { - throwReadException(e); - } catch (IOException e) { - throwReadException(e); - } catch (SAXException e) { - throwReadException(e); - } - } - - private String getAttributeValue(NamedNodeMap attributes, String name) { - Node node= attributes.getNamedItem(name); - - return node == null - ? null - : node.getNodeValue(); - } - - /** - * Convenience method for saving to a file. - * - * @see saveToStream(OutputStream) - */ - public void saveToFile(File file) throws CoreException { - OutputStream stream= null; - - try { - stream= new FileOutputStream(file); - saveToStream(stream); - - } catch (IOException e) { - throwWriteException(e); - - } finally { - try { - if (stream != null) - stream.close(); - } catch (IOException e) {} - } - } - - /** - * Saves the template set as XML. - */ - public void saveToStream(OutputStream stream) throws CoreException { - try { - DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance(); - DocumentBuilder builder= factory.newDocumentBuilder(); - Document document= builder.newDocument(); - - Node root= document.createElement("templates"); // $NON-NLS-1$ //$NON-NLS-1$ - document.appendChild(root); - - for (int i= 0; i != fTemplates.size(); i++) { - Template template= (Template) fTemplates.get(i); - - Node node= document.createElement("template"); // $NON-NLS-1$ //$NON-NLS-1$ - root.appendChild(node); - - NamedNodeMap attributes= node.getAttributes(); - - Attr name= document.createAttribute(NAME_ATTRIBUTE); - name.setValue(template.getName()); - attributes.setNamedItem(name); - - Attr description= document.createAttribute(DESCRIPTION_ATTRIBUTE); - description.setValue(template.getDescription()); - attributes.setNamedItem(description); - - Attr context= document.createAttribute(CONTEXT_ATTRIBUTE); - context.setValue(template.getContextTypeName()); - attributes.setNamedItem(context); - - Attr enabled= document.createAttribute(ENABLED_ATTRIBUTE); - enabled.setValue(template.isEnabled() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ - attributes.setNamedItem(enabled); - - Text pattern= document.createTextNode(template.getPattern()); - node.appendChild(pattern); - } - - OutputFormat format = new OutputFormat(); - format.setPreserveSpace(true); - Serializer serializer = SerializerFactory.getSerializerFactory("xml").makeSerializer(stream, format); //$NON-NLS-1$ - serializer.asDOMSerializer().serialize(document); - - } catch (ParserConfigurationException e) { - throwWriteException(e); - } catch (IOException e) { - throwWriteException(e); - } - } - - private static void throwReadException(Throwable t) throws CoreException { - IStatus status= new CUIStatus(CStatusConstants.TEMPLATE_IO_EXCEPTION, - TemplateMessages.getString("TemplateSet.error.read"), t); //$NON-NLS-1$ - throw new CUIException(status); - } - - private static void throwWriteException(Throwable t) throws CoreException { - IStatus status= new CUIStatus(CStatusConstants.TEMPLATE_IO_EXCEPTION, - TemplateMessages.getString("TemplateSet.error.write"), t); //$NON-NLS-1$ - throw new CUIException(status); - } - - /** - * Adds a template to the set. - */ - public void add(Template template) { - if (exists(template)) - return; // ignore duplicate - - fTemplates.add(template); - sort(); - } - - private boolean exists(Template template) { - for (Iterator iterator = fTemplates.iterator(); iterator.hasNext();) { - Template anotherTemplate = (Template) iterator.next(); - - if (template.equals(anotherTemplate)) - return true; - } - - return false; - } - - /** - * Removes a template to the set. - */ - public void remove(Template template) { - fTemplates.remove(template); - sort(); - } - - /** - * Empties the set. - */ - public void clear() { - fTemplates.clear(); - sort(); - } - - /** - * Returns all templates. - */ - public Template[] getTemplates() { - return (Template[]) fTemplates.toArray(new Template[fTemplates.size()]); - } - - private void sort() { - fSortedTemplates= (Template[]) fTemplates.toArray(new Template[fTemplates.size()]); - Arrays.sort(fSortedTemplates, fTemplateComparator); - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateTranslator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateTranslator.java deleted file mode 100644 index 1159f94ecdc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateTranslator.java +++ /dev/null @@ -1,215 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.Vector; - -import org.eclipse.core.runtime.CoreException; - -/** - * The template translator translates a string into a template buffer. - * The EBNF grammer of a valid string is as follows: - * - *

            - * template := (text | escape)*.
            - * text := character - dollar.
            - * escape := dollar ('{' identifier '}' | dollar).
            - * dollar := '$'.
            - *

            - */ -public class TemplateTranslator { - - // states - private static final int TEXT= 0; - private static final int ESCAPE= 1; - private static final int IDENTIFIER= 2; - - // tokens - private static final char ESCAPE_CHARACTER= '$'; - private static final char IDENTIFIER_BEGIN= '{'; - private static final char IDENTIFIER_END= '}'; - - /** a buffer for the translation result string */ - private final StringBuffer fBuffer= new StringBuffer(); - /** position offsets of variables */ - private final Vector fOffsets= new Vector(); - /** position lengths of variables */ - private final Vector fLengths= new Vector(); - - /** the current parsing state */ - private int fState; - /** the last translation error */ - private String fErrorMessage; - - /** - * Returns an error message if an error occured for the last translation, null - * otherwise. - */ - public String getErrorMessage() { - return fErrorMessage; - } - - /** - * Translates a template string to TemplateBuffer. null - * is returned if there was an error. getErrorMessage() retrieves the - * associated error message. - * - * @param string the string to translate. - * @return returns the template buffer corresponding to the string, null - * if there was an error. - * @see getErrorMessage() - */ - public TemplateBuffer translate(String string) throws CoreException { - - fBuffer.setLength(0); - fOffsets.clear(); - fLengths.clear(); - fState= TEXT; - fErrorMessage= null; - - if (!parse(string)) - return null; - - switch (fState) { - case TEXT: - break; - - // illegal, but be tolerant - case ESCAPE: - fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.incomplete.variable"); //$NON-NLS-1$ - fBuffer.append(ESCAPE_CHARACTER); - return null; - - // illegal, but be tolerant - case IDENTIFIER: - fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.incomplete.variable"); //$NON-NLS-1$ - fBuffer.append(ESCAPE_CHARACTER); - return null; - } - - int[] offsets= new int[fOffsets.size()]; - int[] lengths= new int[fLengths.size()]; - - for (int i= 0; i < fOffsets.size(); i++) { - offsets[i]= ((Integer) fOffsets.get(i)).intValue(); - lengths[i]= ((Integer) fLengths.get(i)).intValue(); - } - - String translatedString= fBuffer.toString(); - TemplatePosition[] variables= findVariables(translatedString, offsets, lengths); - - return new TemplateBuffer(translatedString, variables); - } - - private static TemplatePosition[] findVariables(String string, int[] offsets, int[] lengths) { - - Map map= new HashMap(); - - for (int i= 0; i != offsets.length; i++) { - int offset= offsets[i]; - int length= lengths[i]; - - String content= string.substring(offset, offset + length); - Vector vector= (Vector) map.get(content); - if (vector == null) { - vector= new Vector(); - map.put(content, vector); - } - vector.add(new Integer(offset)); - } - - TemplatePosition[] variables= new TemplatePosition[map.size()]; - int k= 0; - - Set keys= map.keySet(); - for (Iterator i= keys.iterator(); i.hasNext(); ) { - String name= (String) i.next(); - Vector vector= (Vector) map.get(name); - - int[] offsets_= new int[vector.size()]; - for (int j= 0; j != offsets_.length; j++) - offsets_[j]= ((Integer) vector.get(j)).intValue(); - - variables[k]= new TemplatePosition(name, name, offsets_, name.length()); - k++; - } - - return variables; - } - - /** internal parser */ - private boolean parse(String string) { - - for (int i= 0; i != string.length(); i++) { - char ch= string.charAt(i); - - switch (fState) { - case TEXT: - switch (ch) { - case ESCAPE_CHARACTER: - fState= ESCAPE; - break; - - default: - fBuffer.append(ch); - break; - } - break; - - case ESCAPE: - switch (ch) { - case ESCAPE_CHARACTER: - fBuffer.append(ch); - fState= TEXT; - break; - - case IDENTIFIER_BEGIN: - fOffsets.add(new Integer(fBuffer.length())); - fState= IDENTIFIER; - break; - - default: - // illegal single escape character, but be tolerant - fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.incomplete.variable"); //$NON-NLS-1$ - fBuffer.append(ESCAPE_CHARACTER); - fBuffer.append(ch); - fState= TEXT; - return false; - } - break; - - case IDENTIFIER: - switch (ch) { - case IDENTIFIER_END: - int offset = ((Integer) fOffsets.get(fOffsets.size() - 1)).intValue(); - fLengths.add(new Integer(fBuffer.length() - offset)); - fState= TEXT; - break; - - default: - if (!Character.isUnicodeIdentifierStart((char) ch) && - !Character.isUnicodeIdentifierPart((char) ch)) - { - // illegal identifier character - fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.invalid.identifier"); //$NON-NLS-1$ - return false; - } - - fBuffer.append(ch); - break; - } - break; - } - } - - return true; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateVariable.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateVariable.java deleted file mode 100644 index dd1f650d0e4..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/TemplateVariable.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * A template variable. - */ -public abstract class TemplateVariable { - - /** name of the variable */ - private final String fName; - - /** description of the variable */ - private final String fDescription; - - /** - * Creates an instance of TemplateVariable. - * - * @param name the name of the variable - * @param description the description for the variable - */ - protected TemplateVariable(String name, String description) { - fName= name; - fDescription= description; - } - - /** - * Returns the name of the variable. - */ - public String getName() { - return fName; - } - - /** - * Returns the description for the variable. - */ - public String getDescription() { - return fDescription; - } - - /** - * Tests if this variable can be evaluated. - */ -// public abstract boolean canEvaluate(TemplateContext context); - - /** - * Evaluates this variable - * - * @return the evaluated string, or null if not evaluatable. - */ - public abstract String evaluate(TemplateContext context); - - /** - * Returns whether this variable is resolved. - * By default, the variable is not resolved. - * Clients can overwrite this method to force resolution of the variable. - */ - public boolean isResolved(TemplateContext context) { - return false; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java deleted file mode 100644 index 64056a442aa..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/Templates.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.eclipse.cdt.internal.corext.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.ui.CUIPlugin; - -import java.io.File; -import java.io.InputStream; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; - -import org.eclipse.jface.dialogs.ErrorDialog; - -/** - * Templates gives access to the available templates. - */ -public class Templates extends TemplateSet { - - private static final String DEFAULT_FILE= "default-templates.xml"; //$NON-NLS-1$ - private static final String TEMPLATE_FILE= "templates.xml"; //$NON-NLS-1$ - - /** Singleton. */ - private static Templates fgTemplates; - - /** - * Returns an instance of templates. - */ - public static Templates getInstance() { - if (fgTemplates == null) - fgTemplates= create(); - - return fgTemplates; - } - - private static Templates create() { - Templates templates= new Templates(); - - try { - File templateFile= getTemplateFile(); - if (templateFile.exists()) { - templates.addFromFile(templateFile); - } else { - templates.addFromStream(getDefaultsAsStream()); - templates.saveToFile(templateFile); - } - - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - ErrorDialog.openError(null, - TemplateMessages.getString("Templates.error.title"), //$NON-NLS-1$ - e.getMessage(), e.getStatus()); - - templates.clear(); - } - - return templates; - } - - /** - * Resets the template set. - */ - public void reset() throws CoreException { - clear(); - addFromFile(getTemplateFile()); - } - - /** - * Resets the template set with the default templates. - */ - public void restoreDefaults() throws CoreException { - clear(); - addFromStream(getDefaultsAsStream()); - } - - /** - * Saves the template set. - */ - public void save() throws CoreException { - saveToFile(getTemplateFile()); - } - - private static InputStream getDefaultsAsStream() { - return Templates.class.getResourceAsStream(DEFAULT_FILE); - } - - private static File getTemplateFile() { - IPath path= CUIPlugin.getDefault().getStateLocation(); - path= path.append(TEMPLATE_FILE); - - return path.toFile(); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java deleted file mode 100644 index 8a2b0c2f65c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CContext.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.Template; -import org.eclipse.cdt.internal.corext.template.TemplateBuffer; -import org.eclipse.cdt.internal.corext.template.TemplateTranslator; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBuffer; -import org.eclipse.cdt.internal.corext.textmanipulation.TextUtil; -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.CoreException; - - - -/** - * A context for c/c++ - */ -public class CContext extends CompilationUnitContext { - - /** - * Creates a javadoc template context. - * - * @param type the context type. - * @param string the document string. - * @param completionPosition the completion position within the document. - * @param unit the compilation unit (may be null). - */ - public CContext(ContextType type, String string, int completionPosition, - ICompilationUnit compilationUnit) - { - super(type, string, completionPosition, compilationUnit); - } - - /* - * @see DocumentTemplateContext#getStart() - */ - public int getStart() { - String string= getString(); - int start= getCompletionPosition(); - - while ((start != 0) && Character.isUnicodeIdentifierPart(string.charAt(start - 1))) - start--; - - if ((start != 0) && Character.isUnicodeIdentifierStart(string.charAt(start - 1))) - start--; - - return start; - } - - /** - * Returns the indentation level at the position of code completion. - */ - public int getIndentationLevel() { - String string= getString(); - int start= getStart(); - - try { - TextBuffer textBuffer= TextBuffer.create(string); - String lineContent= textBuffer.getLineContentOfOffset(start); - - return TextUtil.getIndent(lineContent, CUIPlugin.getDefault().getPreferenceStore().getInt(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH)); - - } catch (CoreException e) { - return 0; - } - } - - /* - * @see TemplateContext#canEvaluate(Template templates) - */ - public boolean canEvaluate(Template template) { - return template.matches(getKey(), getContextType().getName()); - } - - /* - * @see TemplateContext#evaluate(Template) - */ - public TemplateBuffer evaluate(Template template) throws CoreException { - if (!canEvaluate(template)) - return null; - - TemplateTranslator translator= new TemplateTranslator(); - TemplateBuffer buffer= translator.translate(template.getPattern()); - - getContextType().edit(buffer, this); - - ITemplateEditor formatter= new CFormatter(); - formatter.edit(buffer, this); - - return buffer; - } - -} - - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java deleted file mode 100644 index dd0629bd4af..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFormatter.java +++ /dev/null @@ -1,197 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateBuffer; -import org.eclipse.cdt.internal.corext.template.TemplateContext; -import org.eclipse.cdt.internal.corext.template.TemplatePosition; -import org.eclipse.cdt.internal.corext.textmanipulation.MultiTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.NopTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.SimpleTextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBuffer; -import org.eclipse.cdt.internal.corext.textmanipulation.TextBufferEditor; -import org.eclipse.cdt.internal.corext.textmanipulation.TextEdit; -import org.eclipse.cdt.internal.corext.textmanipulation.TextRegion; -import org.eclipse.cdt.internal.corext.textmanipulation.TextUtil; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Vector; - -import org.eclipse.core.runtime.CoreException; - - -/** - * A template editor using the Java formatter to format a template buffer. - */ -public class CFormatter implements ITemplateEditor { - - private static final String CURSOR= "cursor"; //$NON-NLS-1$ - private static final String MARKER= "/*${cursor}*/"; //$NON-NLS-1$ - - /* - * @see ITemplateEditor#edit(TemplateBuffer, TemplateContext) - */ - public void edit(TemplateBuffer buffer, TemplateContext context) throws CoreException { - int indentationLevel= ((CContext) context).getIndentationLevel(); - - //if (TemplatePreferencePage.useCodeFormatter()) - // format(buffer, indentationLevel); - //else - indentate(buffer, indentationLevel); - - trimBegin(buffer); - } - - private static int getCaretOffset(TemplatePosition[] variables) { - for (int i= 0; i != variables.length; i++) { - TemplatePosition variable= variables[i]; - - if (variable.getName().equals(CURSOR)) - return variable.getOffsets()[0]; - } - - return -1; - } - - - private static void indentate(TemplateBuffer templateBuffer, int indentationLevel) throws CoreException { - - String string= templateBuffer.getString(); - TemplatePosition[] variables= templateBuffer.getVariables(); - String indentation= TextUtil.createIndentString(indentationLevel); - - MultiTextEdit positions= variablesToPositions(variables); - MultiTextEdit multiEdit= new MultiTextEdit(); - - TextBuffer textBuffer= TextBuffer.create(string); - int lineCount= textBuffer.getNumberOfLines(); - for (int i= 0; i < lineCount; i++) { - TextRegion region= textBuffer.getLineInformation(i); - multiEdit.add(SimpleTextEdit.createInsert(region.getOffset(), indentation)); - } - - string= edit(string, positions, multiEdit); - positionsToVariables(positions, variables); - - templateBuffer.setContent(string, variables); - } - - private static void trimBegin(TemplateBuffer templateBuffer) throws CoreException { - String string= templateBuffer.getString(); - TemplatePosition[] variables= templateBuffer.getVariables(); - - MultiTextEdit positions= variablesToPositions(variables); - - int i= 0; - while ((i != string.length()) && Character.isWhitespace(string.charAt(i))) - i++; - - string= edit(string, positions, SimpleTextEdit.createDelete(0, i)); - positionsToVariables(positions, variables); - - templateBuffer.setContent(string, variables); - } - - private static String edit(String string, MultiTextEdit positions, MultiTextEdit multiEdit) throws CoreException { - TextBuffer textBuffer= TextBuffer.create(string); - TextBufferEditor editor= new TextBufferEditor(textBuffer); - editor.add(positions); - editor.add(multiEdit); - editor.performEdits(null); - - return textBuffer.getContent(); - } - - private static String edit(String string, MultiTextEdit positions, TextEdit singleEdit) throws CoreException { - TextBuffer textBuffer= TextBuffer.create(string); - TextBufferEditor editor= new TextBufferEditor(textBuffer); - editor.add(positions); - editor.add(singleEdit); - editor.performEdits(null); - - return textBuffer.getContent(); - } - - private static int[] variablesToOffsets(TemplatePosition[] variables) { - Vector vector= new Vector(); - for (int i= 0; i != variables.length; i++) { - int[] offsets= variables[i].getOffsets(); - for (int j= 0; j != offsets.length; j++) - vector.add(new Integer(offsets[j])); - } - - int[] offsets= new int[vector.size()]; - for (int i= 0; i != offsets.length; i++) - offsets[i]= ((Integer) vector.get(i)).intValue(); - - Arrays.sort(offsets); - - return offsets; - } - - private static void offsetsToVariables(int[] allOffsets, TemplatePosition[] variables) { - int[] currentIndices= new int[variables.length]; - for (int i= 0; i != currentIndices.length; i++) - currentIndices[i]= 0; - - int[][] offsets= new int[variables.length][]; - for (int i= 0; i != variables.length; i++) - offsets[i]= variables[i].getOffsets(); - - for (int i= 0; i != allOffsets.length; i++) { - - int min= Integer.MAX_VALUE; - int minVariableIndex= -1; - for (int j= 0; j != variables.length; j++) { - int currentIndex= currentIndices[j]; - - // determine minimum - if (currentIndex == offsets[j].length) - continue; - - int offset= offsets[j][currentIndex]; - - if (offset < min) { - min= offset; - minVariableIndex= j; - } - } - - offsets[minVariableIndex][currentIndices[minVariableIndex]]= allOffsets[i]; - currentIndices[minVariableIndex]++; - } - - for (int i= 0; i != variables.length; i++) - variables[i].setOffsets(offsets[i]); - } - - private static MultiTextEdit variablesToPositions(TemplatePosition[] variables) { - MultiTextEdit positions= new MultiTextEdit(); - for (int i= 0; i != variables.length; i++) { - int[] offsets= variables[i].getOffsets(); - for (int j= 0; j != offsets.length; j++) - positions.add(new NopTextEdit(offsets[j], 0)); - } - - return positions; - } - - private static void positionsToVariables(MultiTextEdit positions, TemplatePosition[] variables) { - Iterator iterator= positions.iterator(); - - for (int i= 0; i != variables.length; i++) { - TemplatePosition variable= variables[i]; - - int[] offsets= new int[variable.getOffsets().length]; - for (int j= 0; j != offsets.length; j++) - offsets[j]= ((TextEdit) iterator.next()).getTextRange().getOffset(); - - variable.setOffsets(offsets); - } - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFunctionContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFunctionContextType.java deleted file mode 100644 index 0fa6d755ff6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CFunctionContextType.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Created on 19/12/2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.cdt.internal.corext.template.c; - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateContext; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class CFunctionContextType extends CompilationUnitContextType { - - /** - * @param name - */ - public CFunctionContextType() { - super(ITemplateEditor.TemplateContextKind.C_FUNCTION_CONTEXT_TYPE); - // global - addVariable(new GlobalVariables.Cursor()); - addVariable(new GlobalVariables.Dollar()); - addVariable(new GlobalVariables.Date()); - addVariable(new GlobalVariables.Time()); - addVariable(new GlobalVariables.User()); - - // compilation unit - addVariable(new File()); - /* addVariable(new Method()); - addVariable(new ReturnType()); - addVariable(new Arguments()); - addVariable(new Type()); - addVariable(new Package()); */ - addVariable(new Project()); - // @@@ Need to add some specific C ones - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.corext.template.ContextType#createContext() - */ - public TemplateContext createContext() { - return new CContext(this, fString, fPosition, fCompilationUnit); - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CGlobalContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CGlobalContextType.java deleted file mode 100644 index c6b4f785480..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CGlobalContextType.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateContext; - - -/** - * A context type for javadoc. - */ -public class CGlobalContextType extends CompilationUnitContextType { - - /** - * Creates a C context type. - */ - public CGlobalContextType() { - super(ITemplateEditor.TemplateContextKind.C_GLOBAL_CONTEXT_TYPE); - - // global - addVariable(new GlobalVariables.Cursor()); - addVariable(new GlobalVariables.Dollar()); - addVariable(new GlobalVariables.Date()); - addVariable(new GlobalVariables.Time()); - addVariable(new GlobalVariables.User()); - - // compilation unit - addVariable(new File()); - /* addVariable(new Method()); - addVariable(new ReturnType()); - addVariable(new Arguments()); - addVariable(new Type()); - addVariable(new Package()); */ - addVariable(new Project()); - // @@@ Need to add some specific C ones - } - - /* - * @see ContextType#createContext() - */ - public TemplateContext createContext() { - return new CContext(this, fString, fPosition, fCompilationUnit); - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CStructureContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CStructureContextType.java deleted file mode 100644 index 539e9eb2581..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CStructureContextType.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Created on 19/12/2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.cdt.internal.corext.template.c; - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateContext; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class CStructureContextType extends CompilationUnitContextType { - - /** - * @param name - */ - public CStructureContextType() { - super(ITemplateEditor.TemplateContextKind.C_STRUCTURE_CONTEXT_TYPE); - // global - addVariable(new GlobalVariables.Cursor()); - addVariable(new GlobalVariables.Dollar()); - addVariable(new GlobalVariables.Date()); - addVariable(new GlobalVariables.Time()); - addVariable(new GlobalVariables.User()); - - // compilation unit - addVariable(new File()); - /* addVariable(new Method()); - addVariable(new ReturnType()); - addVariable(new Arguments()); - addVariable(new Type()); - addVariable(new Package()); */ - addVariable(new Project()); - // @@@ Need to add some specific C ones - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.corext.template.ContextType#createContext() - */ - public TemplateContext createContext() { - return new CContext(this, fString, fPosition, fCompilationUnit); - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContext.java deleted file mode 100644 index 37a056eb658..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContext.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.DocumentTemplateContext; - - -/** - * A compilation unit context. - */ -public abstract class CompilationUnitContext extends DocumentTemplateContext { - - /** The compilation unit, may be null. */ - private final ICompilationUnit fCompilationUnit; - - /** - * Creates a compilation unit context. - * - * @param type the context type. - * @param string the document string. - * @param completionPosition the completion position within the document. - * @param compilationUnit the compilation unit (may be null). - */ - protected CompilationUnitContext(ContextType type, String string, int completionPosition, - ICompilationUnit compilationUnit) - { - super(type, string, completionPosition); - fCompilationUnit= compilationUnit; - } - - /** - * Returns the compilation unit if one is associated with this context, null otherwise. - */ - public final ICompilationUnit getCompilationUnit() { - return fCompilationUnit; - } - - /** - * Returns the enclosing element of a particular element type, null - * if no enclosing element of that type exists. - */ - public ICElement findEnclosingElement(int elementType) { - if (fCompilationUnit == null) - return null; - - /* try { - ICElement element= fCompilationUnit.getElementAt(getStart()); - while (element != null && element.getElementType() != elementType) - element= element.getParent(); - - return element; - - } catch (JavaModelException e) { - return null; - } */ - return null; - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContextType.java deleted file mode 100644 index 6b458e7f9a1..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CompilationUnitContextType.java +++ /dev/null @@ -1,180 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.TemplateContext; -import org.eclipse.cdt.internal.corext.template.TemplateVariable; - - -/** - * Compilation unit context type. - */ -public abstract class CompilationUnitContextType extends ContextType { - - /** the document string */ - protected String fString; - - /** the completion position within the document string */ - protected int fPosition; - - /** the associated compilation unit, may be null */ - protected ICompilationUnit fCompilationUnit; - - protected static class ReturnType extends TemplateVariable { - public ReturnType() { - super("return_type", TemplateMessages.getString("JavaContextType.variable.description.return.type")); - } - public String evaluate(TemplateContext context) { - /* IJavaElement element= ((CompilationUnitContext) context).findEnclosingElement(IJavaElement.METHOD); - if (element == null) - return null; - - try { - return Signature.toString(((IMethod) element).getReturnType()); - } catch (JavaModelException e) { - return null; - } */ - return null; - } - public boolean isResolved(TemplateContext context) { - return evaluate(context) != null; - } - } - - protected static class File extends TemplateVariable { - public File() { - super("file", TemplateMessages.getString("JavaContextType.variable.description.file")); - } - public String evaluate(TemplateContext context) { - //ICompilationUnit unit= ((CompilationUnitContext) context).getCompilationUnit(); - - //return (unit == null) ? null : unit.getElementName(); - return null; - } - public boolean isResolved(TemplateContext context) { - return evaluate(context) != null; - } - } - - protected static class EnclosingJavaElement extends TemplateVariable { - protected final int fElementType; - - public EnclosingJavaElement(String name, String description, int elementType) { - super(name, description); - fElementType= elementType; - } - public String evaluate(TemplateContext context) { - /*IJavaElement element= ((CompilationUnitContext) context).findEnclosingElement(fElementType); - return (element == null) ? null : element.getElementName(); */ - return null; - } - public boolean isResolved(TemplateContext context) { - return evaluate(context) != null; - } - } - - protected static class Method extends EnclosingJavaElement { - public Method() { - //super("enclosing_method", TemplateMessages.getString("JavaContextType.variable.description.enclosing.method"), IJavaElement.METHOD); - super("enclosing_method", TemplateMessages.getString("JavaContextType.variable.description.enclosing.method"), 0); - } - } - - protected static class Type extends EnclosingJavaElement { - public Type() { - super("enclosing_type", TemplateMessages.getString("JavaContextType.variable.description.enclosing.type"), 0); - } - } -/* - protected static class SuperClass extends EnclosingJavaElement { - public Type() { - super("super_class", TemplateMessages.getString("JavaContextType.variable.description.type"), IJavaElement.TYPE); - } - } -*/ - protected static class Package extends EnclosingJavaElement { - public Package() { - super("enclosing_package", TemplateMessages.getString("JavaContextType.variable.description.enclosing.package"), 0); - } - } - - protected static class Project extends EnclosingJavaElement { - public Project() { - super("enclosing_project", TemplateMessages.getString("JavaContextType.variable.description.enclosing.project"), 0); - } - } -/* - protected static class Project2 extends TemplateVariable { - public Project2() { - super("project", TemplateMessages.getString("JavaContextType.variable.description.project")); - } - public String evaluate(TemplateContext context) { - ICompilationUnit unit= ((JavaContext) context).getUnit(); - return (unit == null) ? null : unit.getJavaProject().getElementName(); - } - } -*/ - protected static class Arguments extends TemplateVariable { - public Arguments() { - super("enclosing_method_arguments", TemplateMessages.getString("JavaContextType.variable.description.enclosing.method.arguments")); - } - public String evaluate(TemplateContext context) { - /*IJavaElement element= ((CompilationUnitContext) context).findEnclosingElement(IJavaElement.METHOD); - if (element == null) - return null; - - IMethod method= (IMethod) element; - - try { - String[] arguments= method.getParameterNames(); - StringBuffer buffer= new StringBuffer(); - - for (int i= 0; i < arguments.length; i++) { - if (i > 0) - buffer.append(", "); - buffer.append(arguments[i]); - } - - return buffer.toString(); - - } catch (JavaModelException e) { - return null; - } */ - return null; - } - } - -/* - protected static class Line extends TemplateVariable { - public Line() { - super("line", TemplateMessages.getString("CompilationUnitContextType.variable.description.line")); - } - public String evaluate(TemplateContext context) { - return ((JavaTemplateContext) context).guessLineNumber(); - } - } -*/ - - /* - * @see ContextType#ContextType(String) - */ - public CompilationUnitContextType(String name) { - super(name); - } - - /** - * Sets context parameters. Needs to be called before createContext(). - */ - public void setContextParameters(String string, int position, ICompilationUnit compilationUnit) { - fString= string; - fPosition= position; - fCompilationUnit= compilationUnit; - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppFunctionContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppFunctionContextType.java deleted file mode 100644 index 2a717dc0c5f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppFunctionContextType.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Created on 19/12/2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.cdt.internal.corext.template.c; - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateContext; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class CppFunctionContextType extends CompilationUnitContextType { - - public CppFunctionContextType() { - super(ITemplateEditor.TemplateContextKind.CPP_FUNCTION_CONTEXT_TYPE); - // global - addVariable(new GlobalVariables.Cursor()); - addVariable(new GlobalVariables.Dollar()); - addVariable(new GlobalVariables.Date()); - addVariable(new GlobalVariables.Time()); - addVariable(new GlobalVariables.User()); - - // compilation unit - addVariable(new File()); - /* addVariable(new Method()); - addVariable(new ReturnType()); - addVariable(new Arguments()); - addVariable(new Type()); - addVariable(new Package()); */ - addVariable(new Project()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.corext.template.ContextType#createContext() - */ - public TemplateContext createContext() { - return new CContext(this, fString, fPosition, fCompilationUnit); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppGlobalContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppGlobalContextType.java deleted file mode 100644 index 72a75051600..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppGlobalContextType.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateContext; - -/** - * A context type for javadoc. - */ -public class CppGlobalContextType extends CompilationUnitContextType { - - /** - * Creates a C context type. - */ - public CppGlobalContextType() { - super(ITemplateEditor.TemplateContextKind.CPP_GLOBAL_CONTEXT_TYPE); - - // global - addVariable(new GlobalVariables.Cursor()); - addVariable(new GlobalVariables.Dollar()); - addVariable(new GlobalVariables.Date()); - addVariable(new GlobalVariables.Time()); - addVariable(new GlobalVariables.User()); - - // compilation unit - addVariable(new File()); - /* addVariable(new Method()); - addVariable(new ReturnType()); - addVariable(new Arguments()); - addVariable(new Type()); - addVariable(new Package()); */ - addVariable(new Project()); - } - - /* - * @see ContextType#createContext() - */ - public TemplateContext createContext() { - return new CContext(this, fString, fPosition, fCompilationUnit); - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppStructureContextType.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppStructureContextType.java deleted file mode 100644 index 61e3c5d18b7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/CppStructureContextType.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Created on 19/12/2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.cdt.internal.corext.template.c; - -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.TemplateContext; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class CppStructureContextType extends CompilationUnitContextType { - - public CppStructureContextType() { - super(ITemplateEditor.TemplateContextKind.CPP_STRUCTURE_CONTEXT_TYPE); - // global - addVariable(new GlobalVariables.Cursor()); - addVariable(new GlobalVariables.Dollar()); - addVariable(new GlobalVariables.Date()); - addVariable(new GlobalVariables.Time()); - addVariable(new GlobalVariables.User()); - - // compilation unit - addVariable(new File()); - /* addVariable(new Method()); - addVariable(new ReturnType()); - addVariable(new Arguments()); - addVariable(new Type()); - addVariable(new Package()); */ - addVariable(new Project()); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.corext.template.ContextType#createContext() - */ - public TemplateContext createContext() { - return new CContext(this, fString, fPosition, fCompilationUnit); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/GlobalVariables.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/GlobalVariables.java deleted file mode 100644 index 4c276d16ff9..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/GlobalVariables.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.SimpleTemplateVariable; -import org.eclipse.cdt.internal.corext.template.TemplateContext; -import java.text.DateFormat; - - -/** - * Global variables which are available in any context. - */ -public class GlobalVariables { - - /** - * The cursor variable determines the cursor placement after template edition. - */ - static class Cursor extends SimpleTemplateVariable { - public Cursor() { - super("cursor", TemplateMessages.getString("GlobalVariables.variable.description.cursor")); - setEvaluationString(""); - setResolved(true); - } - } - - /** - * The dollar variable inserts an escaped dollar symbol. - */ - static class Dollar extends SimpleTemplateVariable { - public Dollar() { - super("dollar", TemplateMessages.getString("GlobalVariables.variable.description.dollar")); - setEvaluationString("$"); - setResolved(true); - } - } - - /** - * The date variable evaluates to the current date. - */ - static class Date extends SimpleTemplateVariable { - public Date() { - super("date", TemplateMessages.getString("GlobalVariables.variable.description.date")); - setResolved(true); - } - public String evaluate(TemplateContext context) { - return DateFormat.getDateInstance().format(new java.util.Date()); - } - } - - /** - * The time variable evaluates to the current time. - */ - static class Time extends SimpleTemplateVariable { - public Time() { - super("time", TemplateMessages.getString("GlobalVariables.variable.description.time")); - setResolved(true); - } - public String evaluate(TemplateContext context) { - return DateFormat.getTimeInstance().format(new java.util.Date()); - } - } - - /** - * The user variable evaluates to the current user. - */ - static class User extends SimpleTemplateVariable { - public User() { - super("user", TemplateMessages.getString("GlobalVariables.variable.description.user")); - setResolved(true); - } - public String evaluate(TemplateContext context) { - return System.getProperty("user.name"); - } - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ICompilationUnit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ICompilationUnit.java deleted file mode 100644 index 872ed89bb8c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ICompilationUnit.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -public interface ICompilationUnit { - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.java deleted file mode 100644 index 49fdc795f12..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.cdt.internal.corext.template.c; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class TemplateMessages { - - private static final String RESOURCE_BUNDLE= TemplateMessages.class.getName(); - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private TemplateMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object arg) { - return MessageFormat.format(getString(key), new Object[] { arg }); - } - - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.properties deleted file mode 100644 index 6a95267b954..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/TemplateMessages.properties +++ /dev/null @@ -1,29 +0,0 @@ -######################################### -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -######################################### - -GlobalVariables.variable.description.dollar=The dollar symbol -GlobalVariables.variable.description.cursor=The cursor position after editing template variables - -GlobalVariables.variable.description.line=Current line number -GlobalVariables.variable.description.date=Current date -GlobalVariables.variable.description.time=Current time -GlobalVariables.variable.description.user=User name - -JavaDocContextType.variable.description.file=Filename of compilation unit - -JavaContextType.variable.description.file=Filename of compilation unit -JavaContextType.variable.description.array=A proposal for an array -JavaContextType.variable.description.array.type=A proposal for the element type of an array -JavaContextType.variable.description.array.element=A proposal for the element name of an array -JavaContextType.variable.description.index=A proposal for an index (int) -JavaContextType.variable.description.collector=A proposal for a collector (java.util.Collector) -JavaContextType.variable.description.iterator=A proposal for an iterator (java.util.Iterator) -JavaContextType.variable.description.arguments=Method arguments (evaluates to empty string) -JavaContextType.variable.description.enclosing.method=Enclosing method name -JavaContextType.variable.description.enclosing.type=Enclosing type name -JavaContextType.variable.description.enclosing.package=Enclosing package name -JavaContextType.variable.description.enclosing.project=Enclosing project name -JavaContextType.variable.description.enclosing.method.arguments=Argument names of enclosing method -JavaContextType.variable.description.return.type=Enclosing method return type diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/default-templates.xml b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/default-templates.xml deleted file mode 100644 index 5be99d3854b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/default-templates.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/ISourceRange.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/ISourceRange.java deleted file mode 100644 index 73d08927f27..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/ISourceRange.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * A source range defines an element's source coordinates relative to - * its source buffer. - *

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

            - */ -public interface ISourceRange { - -/** - * Returns the number of characters of the source code for this element, - * relative to the source buffer in which this element is contained. - */ -int getLength(); -/** - * Returns the 0-based index of the first character of the source code for this element, - * relative to the source buffer in which this element is contained. - */ -int getOffset(); -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/Messages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/Messages.properties deleted file mode 100644 index 729774b29aa..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/Messages.properties +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -# Copyright (c) 2002 International Business Machines Corp. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v0.5 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v05.html -# -# Contributors: -# IBM Corporation - initial API and implementation -################################################################################ - -TextRange.offset=Offset: -TextRange.length=\ Length: - -TextBuffer.wrongRange=Replace failed due to wrong range [{0},{1}] - -TextBufferFactory.bufferNotManaged=Buffer not managed diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MoveTextEdit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MoveTextEdit.java deleted file mode 100644 index ef6ca13c97d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MoveTextEdit.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.util.Assert; - -/** - * A text edit that moves text inside a text buffer. - */ -public final class MoveTextEdit extends TextEdit { - - /* package */ static class TargetMark extends NopTextEdit { - private MoveTextEdit fMoveTextEdit; - public TargetMark(TextRange range, MoveTextEdit edit) { - super(range); - fMoveTextEdit= edit; - } - /* package */ MoveTextEdit getMoveTextEdit() { - return fMoveTextEdit; - } - public TextEdit perform(TextBuffer buffer) throws CoreException { - fMoveTextEdit.internalPerform(buffer); - return super.perform(buffer); - } - public TextEdit copy() { - Assert.isTrue(false, "This should never happen"); //$NON-NLS-1$ - return super.copy(); - } - } - - private TextRange fTarget; - private TextRange fSource; - private int fPerformCounter; - - /** - * Creates a new MoveTextEdit. The text edit doesn't support - * overlapping moves. So for a MoveTextEdit destination <= offset && - * offset + length - 1 <= destination must be true. - * - * @param offset the offset of the text to be moved - * @param length the text length to be moved - * @param destination the destination offset - */ - public MoveTextEdit(int offset, int length, int destination) { - Assert.isTrue(destination <= offset || offset + length <= destination); - fSource= new TextRange(offset, length); - fTarget= new TextRange(destination); - } - - /** - * Creates a new MoveTextEdit with the given source and target range. - * - * @param source the source - * @param target the target - */ - private MoveTextEdit(TextRange source,TextRange target) { - fSource= source; - fTarget= target; - } - - /** - * Returns the move text edit's source range. This method returns the same range - * as TextEdit#getTextRange() - * - * @return the edit's source range - */ - public TextRange getSourceRange() { - return fSource; - } - - /** - * Returns the move text edit's target range. - * - * @return the edit's target range - */ - public TextRange getTargetRange() { - return fTarget; - } - - /* non Java-doc - * @see TextEdit#getTextRange() - */ - public TextRange getTextRange() { - return fSource; - } - - /* non Java-doc - * @see TextEdit#connect(TextBufferEditor) - */ - public void connect(TextBufferEditor editor) throws CoreException { - editor.add(new TargetMark(fTarget, this)); - } - - /* non Java-doc - * @see TextEdit#perform(TextBuffer) - */ - public TextEdit perform(TextBuffer buffer) throws CoreException { - internalPerform(buffer); - return new MoveTextEdit(fTarget, fSource); - } - - /* non Java-doc - * @see TextEdit#copy() - */ - public TextEdit copy() { - TextRange source= getSourceRange(); - TextRange target= getTargetRange(); - return new MoveTextEdit(source.fOffset, source.fLength, target.fOffset); - } - - //---- Helper method --------------------------------------------------------------------------------- - - protected void internalPerform(TextBuffer buffer) throws CoreException { - Assert.isTrue(fPerformCounter < 2); - if (++fPerformCounter == 2) { - TextRange source= getSourceRange(); - TextRange target= getTargetRange(); - String current= buffer.getContent(source.fOffset, source.fLength); - buffer.replace(source, ""); //$NON-NLS-1$ - buffer.replace(target, current); - } - } - - /* package */ boolean isUpMove() { - return fSource.fOffset < fTarget.fOffset; - } - - /* package */ boolean isDownMove() { - return fSource.fOffset > fTarget.fOffset; - } - - /* package */ TextRange getChildRange() { - int offset= fSource.fOffset; - int length= fSource.fLength; - int destination= fTarget.fOffset; - if (destination <= offset) - return new TextRange(destination, offset + length - destination); - else - return new TextRange(offset, destination - offset); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MultiTextEdit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MultiTextEdit.java deleted file mode 100644 index dd056ff4c8f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/MultiTextEdit.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.internal.utils.Assert; -import org.eclipse.core.runtime.CoreException; - -public class MultiTextEdit { - - private List fChildren; - - /** - * Creates a new composite text edit. - */ - public MultiTextEdit() { - fChildren= new ArrayList(3); - } - - protected MultiTextEdit(List children) throws CoreException { - fChildren= new ArrayList(children.size()); - for (Iterator iter= children.iterator(); iter.hasNext();) { - fChildren.add(((TextEdit)iter.next()).copy()); - } - } - - protected List getChildren() { - return fChildren; - } - - /** - * Adds all TextEdits managed by the given multt text edit. - * - * @param edit the multi text edit to be added. - */ - public void add(MultiTextEdit edit) { - Assert.isNotNull(edit); - fChildren.add(edit); - } - - /** - * Adds a text edit. - * - * @param edit the text edit to be added - */ - public void add(TextEdit edit) { - Assert.isNotNull(edit); - fChildren.add(edit); - } - - /** - * Returns the children managed by this text edit collection. - * - * @return the children of this composite text edit - */ - public Iterator iterator() { - return fChildren.iterator(); - } - - /** - * Connects this text edit to the given TextBufferEditor. - * Note that this method should only be called by a - * TextBufferEditor. - *

            - * This default implementation does nothing. Subclasses may override - * if needed. - * - * @param editor the text buffer editor this text edit has been added to - */ - public void connect(TextBufferEditor editor) throws CoreException { - for (Iterator iter= fChildren.iterator(); iter.hasNext();) { - Object element= iter.next(); - if (element instanceof TextEdit) - editor.add((TextEdit)element); - else - editor.add((MultiTextEdit)element); - } - } - - /** - * Creates and returns a copy of this text edit collection. The copy method should - * be implemented in a way so that the copy can be added to a different - * TextBuffer without causing any harm to the object from which the copy - * has been created. - * - * @return a copy of this object. - */ - public MultiTextEdit copy() throws CoreException { - return new MultiTextEdit(fChildren); - } - - /** - * Returns the TextRange that this text edit is going to - * manipulate. If this method is called before the MultiTextEdit - * has been added to a TextBufferEditor it may return - * null to indicate this situation. - * - * @return the TextRanges this TextEdit is going - * to manipulate - */ - public TextRange getTextRange() { - int size= fChildren.size(); - if (size == 0) - return new TextRange(0,0); - TextRange range= ((TextEdit)fChildren.get(0)).getTextRange(); - int start= range.getOffset(); - int end= range.getInclusiveEnd(); - for (int i= 1; i < size; i++) { - range= ((TextEdit)fChildren.get(i)).getTextRange(); - start= Math.min(start, range.getOffset()); - end= Math.max(end, range.getInclusiveEnd()); - } - return new TextRange(start, end - start + 1); - } - - /** - * Returns the element modified by this text edit. The method - * may return null if the modification isn't related to a - * element or if the content of the modified text buffer doesn't - * follow any syntax. - *

            - * This default implementation returns null - * - * @return the element modified by this text edit - */ - public Object getModifiedElement() { - return null; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/NopTextEdit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/NopTextEdit.java deleted file mode 100644 index 2b8fc3350aa..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/NopTextEdit.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; - -/** - * A text edit that does nothing. A NopTextEdit can be used to track - * positions when executing TextEdits associated with a - * TextBufferEditor. - */ -public class NopTextEdit extends TextEdit { - - private TextRange fTextRange; - - /** - * Creates a new NopTextEdit for the given - * offset and length. - * - * @param offset the starting offset this text edit is "working on" - * @param length the length this text edit is "working on" - */ - public NopTextEdit(int offset, int length) { - this(new TextRange(offset, length)); - } - - /** - * Creates a new NopTextEdit for the given - * range. - * - * @param range the TextRange this text edit is "working on" - */ - public NopTextEdit(TextRange range) { - fTextRange= range; - } - - /* non Java-doc - * @see TextEdit#getTextRange - */ - public TextRange getTextRange() { - return fTextRange; - } - - /* non Java-doc - * @see TextEdit#perform - */ - public TextEdit perform(TextBuffer buffer) throws CoreException { - return new NopTextEdit(fTextRange); - } - - /* non Java-doc - * @see TextEdit#perform - */ - public TextEdit copy() { - return new NopTextEdit(fTextRange.copy()); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SimpleTextEdit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SimpleTextEdit.java deleted file mode 100644 index 21ffb7a6b53..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SimpleTextEdit.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.util.Assert; - - -public abstract class SimpleTextEdit extends TextEdit { - - private TextRange fRange; - private String fText; - - public static SimpleTextEdit createReplace(int offset, int length, String text) { - return new SimpleTextEditImpl(offset, length, text); - } - - public static SimpleTextEdit createInsert(int offset, String text) { - return new SimpleTextEditImpl(offset, 0, text); - } - - public static SimpleTextEdit createDelete(int offset, int length) { - return new SimpleTextEditImpl(offset, length, ""); //$NON-NLS-1$ - } - - private final static class SimpleTextEditImpl extends SimpleTextEdit { - protected SimpleTextEditImpl(TextRange range, String text) { - super(range, text); - } - protected SimpleTextEditImpl(int offset, int length, String text) { - super(offset, length, text); - } - public TextEdit copy() { - return new SimpleTextEditImpl(getTextRange().copy(), getText()); - } - } - - protected SimpleTextEdit() { - this(TextRange.UNDEFINED, ""); //$NON-NLS-1$ - } - - protected SimpleTextEdit(int offset, int length, String text) { - this(new TextRange(offset, length), text); - } - protected SimpleTextEdit(TextRange range, String text) { - Assert.isNotNull(range); - Assert.isNotNull(text); - fRange= range; - fText= text; - } - - /** - * Returns the text edit's text - * - * @return the text edit's text - */ - public String getText() { - return fText; - } - - /** - * Sets the text edit's text - *

            - * This method should only be called from within the - * connect method. - * - * @param text the text edit's text - */ - protected final void setText(String text) { - fText= text; - Assert.isNotNull(fText); - } - - /** - * Sets the text edit's range. - *

            - * This method should only be called from within the - * connect method. - * - * @param range the text edit's range. - */ - protected void setTextRange(TextRange range) { - fRange= range; - Assert.isNotNull(fRange); - } - - /* non Java-doc - * @see TextEdit#getTextRange - */ - public TextRange getTextRange() { - return fRange; - } - - /* non Java-doc - * @see TextEdit#doPerform - */ - public final TextEdit perform(TextBuffer buffer) throws CoreException { - String current= buffer.getContent(fRange.fOffset, fRange.fLength); - buffer.replace(fRange, fText); - return new SimpleTextEditImpl(fRange, current); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SwapTextEdit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SwapTextEdit.java deleted file mode 100644 index 53693786816..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/SwapTextEdit.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * A SwapTextEdit exchanges to text ranges. - */ -public class SwapTextEdit extends MultiTextEdit { - /** - * Create a new SwapTextEdit - * - * @param offset1 the offset of the first text range - * @param length1 the length of the first text range - * @param offset2 the offset of the second text range - * @param length2 the length of the second text range - */ - public SwapTextEdit(int offset1, int length1, int offset2, int length2) { - add(new MoveTextEdit(offset1, length1, offset2)); - add(new MoveTextEdit(offset2, length2, offset1)); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBuffer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBuffer.java deleted file mode 100644 index ac4e0a60f64..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBuffer.java +++ /dev/null @@ -1,451 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultLineTracker; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.text.ILineTracker; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.util.Assert; - -import org.eclipse.cdt.internal.ui.CStatusConstants; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - - -/** - * An implementation of a TextBuffer that is based on ITextSelection - * and IDocument. - */ -public class TextBuffer { - - private static class DocumentRegion extends TextRegion { - IRegion fRegion; - public DocumentRegion(IRegion region) { - fRegion= region; - } - public int getOffset() { - return fRegion.getOffset(); - } - public int getLength() { - return fRegion.getLength(); - } - } - - private IDocument fDocument; - - private static final TextBufferFactory fgFactory= new TextBufferFactory(); - - TextBuffer(IDocument document) { - fDocument= document; - Assert.isNotNull(fDocument); - } - - /** - * Returns the number of characters in this text buffer. - * - * @return the number of characters in this text buffer - */ - public int getLength() { - return fDocument.getLength(); - } - - /** - * Returns the number of lines in this text buffer. - * - * @return the number of lines in this text buffer - */ - public int getNumberOfLines() { - return fDocument.getNumberOfLines(); - } - - /** - * Returns the character at the given offset in this text buffer. - * - * @param offset a text buffer offset - * @return the character at the offset - * @exception IndexOutOfBoundsException if the offset - * argument is negative or not less than the length of this text buffer. - */ - public char getChar(int offset) { - try { - return fDocument.getChar(offset); - } catch (BadLocationException e) { - throw new ArrayIndexOutOfBoundsException(e.getMessage()); - } - } - - /** - * Returns the whole content of the text buffer. - * - * @return the whole content of the text buffer - */ - public String getContent() { - return fDocument.get(); - } - - /** - * Returns length characters starting from the specified position. - * - * @return the characters specified by the given text region. Returns - * null if text range is illegal - */ - public String getContent(int start, int length) { - try { - return fDocument.get(start, length); - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns the preferred line delimiter to be used for this text buffer. - * - * @return the preferred line delimiter - */ - public String getLineDelimiter() { - String lineDelimiter= getLineDelimiter(0); - if (lineDelimiter == null) - lineDelimiter= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - return lineDelimiter; - } - - /** - * Returns the line delimiter used for the given line number. Returns - * null if the line number is out of range. - * - * @return the line delimiter used by the given line number or null - */ - public String getLineDelimiter(int line) { - try { - return fDocument.getLineDelimiter(line); - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns the line for the given line number. If there isn't any line for - * the given line number, null is returned. - * - * @return the line for the given line number or null - */ - public String getLineContent(int line) { - try { - IRegion region= fDocument.getLineInformation(line); - return fDocument.get(region.getOffset(), region.getLength()); - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns the line indent for the given line. If there isn't any line for the - * given line number, -1 is returned. - * - * @return the line indent for the given line number of -1 - */ - public int getLineIndent(int lineNumber, int tabWidth) { - return getIndent(getLineContent(lineNumber), tabWidth); - } - - /** - * Returns a region of the specified line. The region contains the offset and the - * length of the line excluding the line's delimiter. Returns null - * if the line doesn't exist. - * - * @param line the line of interest - * @return a line description or null if the given line doesn't - * exist - */ - public TextRegion getLineInformation(int line) { - try { - return new DocumentRegion(fDocument.getLineInformation(line)); - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns a line region of the specified offset. The region contains the offset and - * the length of the line excluding the line's delimiter. Returns null - * if the line doesn't exist. - * - * @param offset an offset into a line - * @return a line description or null if the given line doesn't - * exist - */ - public TextRegion getLineInformationOfOffset(int offset) { - try { - return new DocumentRegion(fDocument.getLineInformationOfOffset(offset)); - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns the line number that contains the given position. If there isn't any - * line that contains the position, null is returned. The returned - * string is a copy and doesn't contain the line delimiter. - * - * @return the line that contains the given offset or null if line - * doesn't exist - */ - public int getLineOfOffset(int offset) { - try { - return fDocument.getLineOfOffset(offset); - } catch (BadLocationException e) { - return -1; - } - } - - /** - * Returns the line that contains the given position. If there isn't any - * line that contains the position, null is returned. The returned - * string is a copy and doesn't contain the line delimiter. - * - * @return the line that contains the given offset or null if line - * doesn't exist - */ - public String getLineContentOfOffset(int offset) { - try { - IRegion region= fDocument.getLineInformationOfOffset(offset); - return fDocument.get(region.getOffset(), region.getLength()); - } catch (BadLocationException e) { - return null; - } - } - - /** - * Converts the text determined by the region [offset, length] into an array of lines. - * The lines are copies of the original lines and don't contain any line delimiter - * characters. - * - * @return the text converted into an array of strings. Returns null if the - * region lies outside the source. - */ - public String[] convertIntoLines(int offset, int length) { - try { - String text= fDocument.get(offset, length); - ILineTracker tracker= new DefaultLineTracker(); - tracker.set(text); - int size= tracker.getNumberOfLines(); - String result[]= new String[size]; - for (int i= 0; i < size; i++) { - IRegion region= tracker.getLineInformation(i); - result[i]= getContent(offset + region.getOffset(), region.getLength()); - } - return result; - } catch (BadLocationException e) { - return null; - } - } - - /** - * Subsitutes the given text for the specified text position - * - * @param offset the starting offset of the text to be replaced - * @param length the length of the text to be replaced - * @param text the substitution text - * @exception CoreException if the text position [offset, length] is invalid. - */ - public void replace(int offset, int length, String text) throws CoreException { - try { - fDocument.replace(offset, length, text); - } catch (BadLocationException e) { - IStatus s= new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, CStatusConstants.INTERNAL_ERROR, - TextManipulationMessages.getFormattedString( - "TextBuffer.wrongRange", //$NON-NLS-1$ - new Object[] {new Integer(offset), new Integer(length) } ), e); - throw new CoreException(s); - } - } - - public void replace(TextRange range, String text) throws CoreException { - replace(range.fOffset, range.fLength, text); - } - - //---- Special methods used by the TextBufferEditor - - /** - * Releases this text buffer. - */ - /* package */ void release() { - } - - /* package */ void registerUpdater(IDocumentListener listener) { - fDocument.addDocumentListener(listener); - } - - /* package */ void unregisterUpdater(IDocumentListener listener) { - fDocument.removeDocumentListener(listener); - } - - //---- Utility methods - - /** - * Returns the indent for the given line. - * If line is null, -1 is returned. - * - * @param line the line for which the indent is determined - * @return the line indent for the given line number or -1 - */ - public static int getIndent(String line, int tabWidth) { - if (line == null) - return -1; - int indent= 0; - int blanks= 0; - int size= line.length(); - for (int i= 0; i < size; i++) { - switch (line.charAt(i)) { - case '\t': - indent++; - blanks= 0; - continue; - case ' ': - blanks++; - if (blanks == tabWidth) { - indent++; - blanks= 0; - } - continue; - default: - break; - } - break; - } - return indent; - } - - /** - * Returns a copy of the line with the given number of identations - * removed from the beginning. - * If the count is zero, the line is returned. - */ - public static String removeIndent(String line, int indentsToRemove, int tabWidth) { - if (line != null) { - int indent= 0; - int blanks= 0; - int size= line.length(); - for (int i= 0; i < size; i++) { - - if (indent >= indentsToRemove) { - line= line.substring(i); - break; - } - - switch (line.charAt(i)) { - case '\t': - indent++; - blanks= 0; - continue; - case ' ': - blanks++; - if (blanks == tabWidth) { - indent++; - blanks= 0; - } - continue; - default: - break; - } - } - } - return line; - } - - //---- Factory methods ---------------------------------------------------------------- - - /** - * Acquires a text buffer for the given file. If a text buffer for the given - * file already exists, then that one is returned. - * - * @param file the file for which a text buffer is requested - * @return a managed text buffer for the given file - * @exception CoreException if it was not possible to acquire the - * text buffer - */ - public static TextBuffer acquire(IFile file) throws CoreException { - return fgFactory.acquire(file); - } - - /** - * Releases the given text buffer. - * - * @param buffer the text buffer to be released - */ - public static void release(TextBuffer buffer) { - fgFactory.release(buffer); - } - - /** - * Commits the changes made to the given text buffer to the underlying - * storage system. - * - * @param buffer the text buffer containing the changes to be committed. - * @param force if true the text buffer is committed in any case. - * If false the text buffer is ONLY committed if the client - * is the last one that holds a reference to the text buffer. Clients of this - * method must make sure that they don't call this method from within an - * IWorkspaceRunnable. - * @param pm the progress monitor used to report progress if committing is - * necessary - */ - public static void commitChanges(TextBuffer buffer, boolean force, IProgressMonitor pm) throws CoreException { - fgFactory.commitChanges(buffer, force, pm); - } - - /** - * Creates a new TextBuffer for the given file. The returned - * buffer will not be managed. Any subsequent call to create - * with the same file will return a different text buffer. - *

            - * If the file is currently open in a text editor, the editors content is copied into - * the returned TextBuffer. Otherwise the content is read from - * disk. - * - * @param file the file for which a text buffer is to be created - * @return a new unmanaged text buffer - * @exception CoreException if it was not possible to create the text buffer - */ - public static TextBuffer create(IFile file) throws CoreException { - return fgFactory.create(file); - } - - /** - * Creates a new TextBuffer for the string. The returned - * buffer will not be managed. Any subsequent call to create - * with the same string will return a different text buffer. - * - * @param content the text buffer's content - * @return a new unmanaged text buffer - * @exception CoreException if it was not possible to create the text buffer - */ - public static TextBuffer create(String content) throws CoreException { - return fgFactory.create(content); - } - - // Unclear which methods are needed if we get the new save model. If optimal no - // save is needed at all. - - public static void save(TextBuffer buffer, IProgressMonitor pm) throws CoreException { - fgFactory.save(buffer, pm); - } - - public static void aboutToChange(TextBuffer buffer) throws CoreException { - fgFactory.aboutToChange(buffer); - } - - public static void changed(TextBuffer buffer) throws CoreException { - fgFactory.changed(buffer); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferEditor.java deleted file mode 100644 index 2ee24f66208..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferEditor.java +++ /dev/null @@ -1,218 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.util.Assert; - -import org.eclipse.cdt.internal.corext.textmanipulation.TextEditNode.RootNode; -import org.eclipse.cdt.internal.ui.CStatusConstants; -import org.eclipse.cdt.ui.CUIPlugin; -/** - * A TextBufferEditor manages a set of TextEdits and applies - * them as a whole to a TextBuffer. Added TextEdits must - * not overlap. The only exception from this rule are insertion point. There can be more than - * one insert point at the same text position. Clients should use the method - * canPerformEdits to validate if all added text edits follow these rules. - *

            - * Clients can attach more than one TextBufferEditor to a single - * TextBuffer. If so canPerformEdits validates all text edits from - * all text buffer editors working on the same text buffer. - */ -public class TextBufferEditor { - - private TextBuffer fBuffer; - private List fEdits; - private RootNode fRootNode; - private int fNumberOfNodes; - private int fConnectCount; - private int fMode; - - /* package */ static final int UNDEFINED= 0; - /* package */ static final int REDO= 1; - /* package */ static final int UNDO= 2; - - /** - * Creates a new TextBufferEditor for the given - * TextBuffer. - * - * @param the text buffer this editor is working on. - */ - public TextBufferEditor(TextBuffer buffer) { - fBuffer= buffer; - Assert.isNotNull(fBuffer); - fEdits= new ArrayList(); - } - - /** - * Returns the text buffer this editor is working on. - * - * @return the text buffer this editor is working on - */ - public TextBuffer getTextBuffer() { - return fBuffer; - } - - /** - * Adds a TextEdit to this text editor. Adding a TextEdit - * to a TextBufferEditor transfers ownership of the edit to the editor. So - * after a edit has been added to a editor the creator of that edit must not continue - * modifing it. - * - * @param edit the text edit to be added - * @exception CoreException if the text edit can not be added - * to this text buffer editor - */ - public void add(TextEdit edit) throws CoreException { - Assert.isTrue(fMode == UNDEFINED || fMode == REDO); - internalAdd(edit); - fMode= REDO; - } - - /** - * Adds a MultiTextEdit to this text editor. Adding a MultiTextEdit - * to a TextBufferEditor transfers ownership of the edit to the editor. So - * after a edit has been added to a editor the creator of that edit must not continue - * modifing it. - * - * @param edit the multi text edit to be added - * @exception CoreException if the multi text edit can not be added - * to this text buffer editor - */ - public void add(MultiTextEdit edit) throws CoreException { - Assert.isTrue(fMode == UNDEFINED || fMode == REDO); - edit.connect(this); - fMode= REDO; - } - - /** - * Adds a UndoMemento to this text editor. Adding a UndoMemento - * to a TextBufferEditor transfers ownership of the memento to the editor. So - * after a memento has been added to a editor the creator of that memento must not continue - * modifing it. - * - * @param undo the undo memento to be added - * @exception CoreException if the undo memento can not be added - * to this text buffer editor - */ - public void add(UndoMemento undo) throws CoreException { - Assert.isTrue(fMode == UNDEFINED); - List list= undo.fEdits; - // Add them reverse since we are adding undos. - for (int i= list.size() - 1; i >= 0; i--) { - internalAdd((TextEdit)list.get(i)); - } - fMode= undo.fMode; - } - - /** - * Checks if the TextEdit added to this text editor can be executed. - * - * @return true if the edits can be executed. Return false - * otherwise. One major reason why text edits cannot be executed - * is a wrong offset or length value of a TextEdit. - */ - public boolean canPerformEdits() { - if (fRootNode != null) - return true; - fRootNode= buildTree(); - if (fRootNode == null) - return false; - if (fRootNode.validate(fBuffer.getLength())) - return true; - - fRootNode= null; - return false; - } - - /** - * Clears the text buffer editor. - */ - public void clear() { - fRootNode= null; - fMode= UNDEFINED; - fEdits.clear(); - } - - /** - * Executes the text edits added to this text buffer editor and clears all added - * text edits. - * - * @param pm a progress monitor to report progress - * @return an object representing the undo of the executed TextEdits - * @exception CoreException if the edits cannot be executed - */ - public UndoMemento performEdits(IProgressMonitor pm) throws CoreException { - if (pm == null) - pm= new NullProgressMonitor(); - - int size= fEdits.size(); - if (size == 0) - return new UndoMemento(fMode == UNDO ? REDO : UNDO); - - if (fRootNode == null) { - fRootNode= buildTree(); - if (fRootNode == null || !fRootNode.validate(fBuffer.getLength())) { - IStatus s= new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, CStatusConstants.INTERNAL_ERROR, - "RootNode empty", null); - throw new CoreException(s); - } - } - try { - pm.beginTask("", fNumberOfNodes + 10); //$NON-NLS-1$ - UndoMemento undo= null; - if (fMode == REDO) { - undo= fRootNode.performDo(fBuffer, pm); - fRootNode.performedDo(); - } else { - undo= fRootNode.performUndo(fBuffer, pm); - fRootNode.performedUndo(); - } - pm.worked(10); - return undo; - } finally { - pm.done(); - clear(); - } - } - - //---- Helper methods ------------------------------------------------------------ - - private RootNode buildTree() { - TextEditNode[] nodes= new TextEditNode[fEdits.size()]; - for (int i= fEdits.size() - 1; i >= 0; i--) { - nodes[i]= TextEditNode.create((TextEdit)fEdits.get(i)); - } - fNumberOfNodes= nodes.length; - Arrays.sort(nodes, new TextEditNodeComparator()); - RootNode root= new RootNode(fBuffer.getLength()); - for (int i= 0; i < nodes.length; i++) { - root.add(nodes[i]); - } - return root; - } - - private void internalAdd(TextEdit edit) throws CoreException { - edit.index= fEdits.size(); - edit.isSynthetic= fConnectCount > 0; - try { - fConnectCount++; - edit.connect(this); - } finally { - fConnectCount--; - } - fEdits.add(edit); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java deleted file mode 100644 index 1236362e47d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextBufferFactory.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.CStatusConstants; -import org.eclipse.cdt.ui.CUIPlugin; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.util.Assert; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.IDocumentProvider; - - -/* package */ class TextBufferFactory { - - protected IDocumentProvider fDocumentProvider; - private Map fFileValueMap; - private Map fBufferValueMap; - - private static class Value { - TextBuffer buffer; - FileEditorInput input; - IDocument document; - IAnnotationModel annotationModel; - int references; - public Value(TextBuffer b, FileEditorInput i, IDocument d, IAnnotationModel m) { - buffer= b; - input= i; - document= d; - annotationModel= m; - } - } - - public TextBufferFactory() { - // XXX http://dev.eclipse.org/bugs/show_bug.cgi?id=5170 - // Need way to map a file to a document without knowing any kind of document provider. - this(CUIPlugin.getDefault().getDocumentProvider()); - } - - public TextBufferFactory(IDocumentProvider provider) { - fDocumentProvider= provider; - Assert.isNotNull(fDocumentProvider); - fFileValueMap= new HashMap(5); - fBufferValueMap= new HashMap(5); - } - - public TextBuffer acquire(IFile file) throws CoreException { - FileEditorInput input= new FileEditorInput(file); - - Value value= (Value)fFileValueMap.get(input); - if (value != null) { - value.references++; - return value.buffer; - } - - fDocumentProvider.connect(input); - IDocument document= fDocumentProvider.getDocument(input); - IAnnotationModel annotationModel= fDocumentProvider.getAnnotationModel(input); - annotationModel.connect(document); - value= new Value(new TextBuffer(document), input, document, annotationModel); - fFileValueMap.put(input, value); - fBufferValueMap.put(value.buffer, value); - value.references++; - return value.buffer; - } - - public void release(TextBuffer buffer) { - final Value value= (Value)fBufferValueMap.get(buffer); - if (value == null) - return; - - value.references--; - if (value.references == 0) { - buffer.release(); - value.annotationModel.disconnect(value.document); - fDocumentProvider.disconnect(value.input); - fFileValueMap.remove(value.input); - fBufferValueMap.remove(buffer); - } - } - - public void commitChanges(TextBuffer buffer, boolean force, IProgressMonitor pm) throws CoreException { - final Value value= (Value)fBufferValueMap.get(buffer); - if (value == null) - return; - - boolean save= force || fDocumentProvider.mustSaveDocument(value.input); - if (save) { - IWorkspaceRunnable action= new IWorkspaceRunnable() { - public void run(IProgressMonitor pm) throws CoreException { - fDocumentProvider.aboutToChange(value.input); - fDocumentProvider.saveDocument(pm, value.input, value.document, true); - } - }; - try { - ResourcesPlugin.getWorkspace().run(action, pm); - } finally { - fDocumentProvider.changed(value.input); - } - } - } - - public TextBuffer create(IFile file) throws CoreException { - FileEditorInput input= new FileEditorInput(file); - IDocument document= fDocumentProvider.getDocument(input); - if (document != null) { - return new TextBuffer(new Document(document.get())); - } else { - return createFromFile(file); - } - } - - private TextBuffer createFromFile(IFile file) throws CoreException { - IDocument document; - InputStreamReader in= null; - try { - document= new Document(); - in= new InputStreamReader(new BufferedInputStream(file.getContents())); - StringBuffer buffer= new StringBuffer(); - char[] readBuffer= new char[2048]; - int n= in.read(readBuffer); - while (n > 0) { - buffer.append(readBuffer, 0, n); - n= in.read(readBuffer); - } - document.set(buffer.toString()); - return new TextBuffer(document); - } catch (IOException x) { - IStatus s= new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, CStatusConstants.INTERNAL_ERROR, x.getMessage(), x); - throw new CoreException(s); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException x) { - } - } - } - } - - public TextBuffer create(String content) throws CoreException { - return new TextBuffer(new Document(content)); - } - - public void save(TextBuffer buffer, IProgressMonitor pm) throws CoreException { - Value value= (Value)fBufferValueMap.get(buffer); - if (value == null) - throwNotManaged(); - fDocumentProvider.saveDocument(pm, value.input, value.document, true); - } - - public void aboutToChange(TextBuffer buffer) throws CoreException { - Value value= (Value)fBufferValueMap.get(buffer); - if (value == null) - throwNotManaged(); - fDocumentProvider.aboutToChange(value.input); - } - - public void changed(TextBuffer buffer) throws CoreException { - Value value= (Value)fBufferValueMap.get(buffer); - if (value == null) - throwNotManaged(); - fDocumentProvider.changed(value.input); - } - - private void throwNotManaged() throws CoreException { - IStatus s= new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, - CStatusConstants.INTERNAL_ERROR, "TextBufferFactory.bufferNotManaged", null); //$NON-NLS-1$ - throw new CoreException(s); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEdit.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEdit.java deleted file mode 100644 index 18123d16e3b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEdit.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.CoreException; - -/** - * A text edit describes an elementary text manipulation operation. Text edits - * are executed by adding them to a TextBufferEditor and then - * calling perform on the TextBufferEditor. - *

            - * After a TextEdit has been added to a TextBufferEditor - * the method connect is sent to the text edit. A TextEdit - * is allowed to do some adjustments of the text range it is going to manipulate while inside - * the hook connect. - * - * @see TextBufferEditor - */ -public abstract class TextEdit { - - // index that determines the insertion order into a text buffer - /* package */ int index; - /* package */ boolean isSynthetic; - - /** - * Connects this text edit to the given TextBufferEditor. A text edit - * must not keep a reference to the passed text buffer editor. It is guaranteed that - * the buffer passed to perform is equal to the buffer managed by - * the given text buffer editor. But they don't have to be identical. - *

            - * Note that this method should only be called by a - * TextBufferEditor. - *

            - * This default implementation does nothing. Subclasses may override - * if needed. - * - * @param editor the text buffer editor this text edit has been added to - */ - public void connect(TextBufferEditor editor) throws CoreException { - // does nothing - } - - /** - * Returns the TextRange that this text edit is going to - * manipulate. If this method is called before the TextEdit - * has been added to a TextBufferEditor it may return - * null or TextRange.UNDEFINED to indicate this situation. - * - * @return the TextRanges this TextEdit is going - * to manipulate - */ - public abstract TextRange getTextRange(); - - /** - * Performs the text edit. Note that this method should only be called - * by a TextBufferEditor. - * - * @param buffer the actual buffer to manipulate - * @return a text edit that can undo this text edit - */ - public abstract TextEdit perform(TextBuffer buffer) throws CoreException; - - /** - * This method gets called after all TextEdits added to a text buffer - * editor are executed. Implementors of this method can do some clean-up or can - * release allocated resources that are now longer needed. - *

            - * This default implementation does nothing. - */ - public void performed() { - // do nothing - } - - /** - * Creates and returns a copy of this object. The copy method should - * be implemented in a way so that the copy can be added to a different - * TextBufferEditor without causing any harm to the object - * from which the copy has been created. - * - * @return a copy of this object. - */ - public abstract TextEdit copy() throws CoreException; - - /** - * Returns the element modified by this text edit. The method - * may return null if the modification isn't related to a - * element or if the content of the modified text buffer doesn't - * follow any syntax. - *

            - * This default implementation returns null - * - * @return the element modified by this text edit - */ - public Object getModifiedElement() { - return null; - } - - /** @deprecated reimplement getModifiedElement */ - public final Object getModifiedLanguageElement() { - return null; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNode.java deleted file mode 100644 index 0bc1790b132..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNode.java +++ /dev/null @@ -1,496 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.util.Assert; - - -/** - * A helper class to arrange TextEdits into a tree to optimize their - * execution. - */ -/* package */ abstract class TextEditNode { - - /* package */ TextEditNode fParent; - /* package */ List fChildren; - /* package */ TextEdit fEdit; - - /* package */ static class DefaultNode extends TextEditNode { - public DefaultNode(TextEdit edit) { - super(edit); - } - } - - /* package */ static class RootNode extends TextEditNode { - private int fUndoIndex; - public RootNode(int length) { - super(new NopTextEdit(new TextRange(0, length))); - fEdit.isSynthetic= true; - } - public boolean covers(TextEditNode node) { - return true; - } - public UndoMemento performDo(TextBuffer buffer, IProgressMonitor pm) throws CoreException { - DoRangeUpdater updater= new DoRangeUpdater(); - UndoMemento undo= new UndoMemento(TextBufferEditor.UNDO); - try { - buffer.registerUpdater(updater); - performDo(buffer, updater, undo, pm); - } finally { - buffer.unregisterUpdater(updater); - updater.setActiveNode(null); - } - return undo; - } - public UndoMemento performUndo(TextBuffer buffer, IProgressMonitor pm) throws CoreException { - UndoRangeUpdater updater= new UndoRangeUpdater(this); - UndoMemento undo= new UndoMemento(TextBufferEditor.REDO); - try { - buffer.registerUpdater(updater); - performUndo(buffer, updater, undo, pm); - } finally { - buffer.unregisterUpdater(updater); - updater.setActiveNode(null); - } - return undo; - } - - protected void setUndoIndex(int index) { - fUndoIndex= index; - } - - protected int getUndoIndex() { - return fUndoIndex; - } - } - - /* package */ abstract static class AbstractMoveNode extends TextEditNode { - private int state; - - private int fTargetIndex; - private int fSourceIndex; - - private List fAffectedChildren; - - public AbstractMoveNode(TextEdit edit) { - super(edit); - reset(); - } - protected abstract TextRange getSourceRange(); - protected abstract TextRange getTargetRange(); - protected abstract boolean isUpMove(); - protected boolean isDownMove() { - return !isUpMove(); - } - public boolean isMove() { - return true; - } - protected void checkRange(DocumentEvent event) { - TextRange range= getChildRange(); - int eventOffset= event.getOffset(); - int eventLength= event.getLength(); - int eventEnd = eventOffset + eventLength - 1; - // "Edit changes text that lies outside its defined range" - Assert.isTrue(range.fOffset <= eventOffset && eventEnd <= range.getInclusiveEnd()); - } - protected boolean activeNodeChanged(int delta) { - TextRange targetRange= getTargetRange(); - TextRange sourceRange= getSourceRange(); - switch (state) { - case 0: // the move delete - init(); - Assert.isTrue(Math.abs(delta) == sourceRange.fLength); - if (isUpMove()) { - updateOffset(fAffectedChildren, delta); - targetRange.fOffset+= delta; - } - sourceRange.fLength= 0; - state= 1; - break; - case 1: - TextEditNode target= (TextEditNode)fParent.fChildren.get(fTargetIndex); - TextEditNode source= (TextEditNode)fParent.fChildren.get(fSourceIndex); - updateOffset(source.fChildren, targetRange.fOffset - sourceRange.fOffset); - target.fChildren= source.fChildren; - if (target.fChildren != null) { - for (Iterator iter= target.fChildren.iterator(); iter.hasNext();) { - ((TextEditNode)iter.next()).fParent= target; - } - } - source.fChildren= null; - if (isDownMove()) { - updateOffset(fAffectedChildren, delta); - sourceRange.fOffset+= delta; - } - targetRange.fLength= delta; - reset(); - break; - } - return true; - } - private static void updateOffset(List nodes, int delta) { - if (nodes == null) - return; - for (int i= nodes.size() - 1; i >= 0; i--) { - TextEditNode node= (TextEditNode)nodes.get(i); - TextRange range= node.getTextRange(); - range.fOffset+= delta; - updateOffset(node.fChildren, delta); - } - } - private void init() { - TextRange source= getSourceRange(); - TextRange target= getTargetRange(); - List children= fParent.fChildren; - for (int i= children.size() - 1; i >= 0; i--) { - TextEditNode child= (TextEditNode)children.get(i); - TextRange range= child.fEdit.getTextRange(); - if (range == source) - fSourceIndex= i; - else if (range == target) - fTargetIndex= i; - } - int start= Math.min(fTargetIndex, fSourceIndex); - int end= Math.max(fTargetIndex, fSourceIndex); - fAffectedChildren= new ArrayList(3); - for (int i= start + 1; i < end; i++) { - fAffectedChildren.add(children.get(i)); - } - } - private void reset() { - state= 0; - fSourceIndex= -1; - fTargetIndex= -1; - } - } - - /* package */ static class MoveNode extends AbstractMoveNode { - public MoveNode(TextEdit edit) { - super(edit); - } - protected TextRange getChildRange() { - return ((MoveTextEdit)fEdit).getChildRange(); - } - protected TextRange getSourceRange() { - return ((MoveTextEdit)fEdit).getSourceRange(); - } - protected TextRange getTargetRange() { - return ((MoveTextEdit)fEdit).getTargetRange(); - } - protected boolean isUpMove() { - return ((MoveTextEdit)fEdit).isUpMove(); - } - public boolean isMovePartner(TextEditNode other) { - if (!(other instanceof TargetMarkNode)) - return false; - return fEdit == ((MoveTextEdit.TargetMark)other.fEdit).getMoveTextEdit(); - } - public boolean covers(TextEditNode node) { - if (node instanceof TargetMarkNode) { - MoveTextEdit.TargetMark edit= (MoveTextEdit.TargetMark)node.fEdit; - if (edit.getMoveTextEdit() == fEdit) - return false; - } - return getParentRange().covers(node.getChildRange()); - } - } - - /* package */ static class TargetMarkNode extends AbstractMoveNode { - public TargetMarkNode(TextEdit edit) { - super(edit); - } - protected TextRange getChildRange() { - return ((MoveTextEdit.TargetMark)fEdit).getMoveTextEdit().getChildRange(); - } - protected TextRange getSourceRange() { - return ((MoveTextEdit.TargetMark)fEdit).getMoveTextEdit().getSourceRange(); - } - protected TextRange getTargetRange() { - return ((MoveTextEdit.TargetMark)fEdit).getMoveTextEdit().getTargetRange(); - } - protected boolean isUpMove() { - return ((MoveTextEdit.TargetMark)fEdit).getMoveTextEdit().isUpMove(); - } - public boolean isMovePartner(TextEditNode other) { - return ((MoveTextEdit.TargetMark)fEdit).getMoveTextEdit() == other.fEdit; - } - } - - //---- Range updating --------------------------------------------------------------------------- - - private static abstract class RangeUpdater implements IDocumentListener { - protected TextEditNode fActiveNode; - public void documentAboutToBeChanged(DocumentEvent event) { - } - public void setActiveNode(TextEditNode node) { - fActiveNode= node; - } - public void updateParents(int delta) { - TextEditNode node= fActiveNode.fParent; - while (node != null) { - node.childNodeChanged(delta); - node= node.fParent; - } - } - public static int getDelta(DocumentEvent event) { - return (event.getText() == null ? 0 : event.getText().length()) - event.getLength(); - } - } - private static class DoRangeUpdater extends RangeUpdater { - private List fProcessedNodes= new ArrayList(10); - public void setActiveNode(TextEditNode node) { - if (fActiveNode != null) - fProcessedNodes.add(fActiveNode); - super.setActiveNode(node); - } - public void documentChanged(DocumentEvent event) { - fActiveNode.checkRange(event); - int delta= getDelta(event); - if (!fActiveNode.activeNodeChanged(delta)) { - for (Iterator iter= fProcessedNodes.iterator(); iter.hasNext();) { - ((TextEditNode)iter.next()).previousNodeChanged(delta); - } - } - updateParents(delta); - } - } - private static class UndoRangeUpdater extends RangeUpdater { - private RootNode fRootNode; - public UndoRangeUpdater(RootNode root) { - fRootNode= root; - } - public void setActiveNode(TextEditNode node) { - super.setActiveNode(node); - } - public void documentChanged(DocumentEvent event) { - fActiveNode.checkRange(event); - int delta= getDelta(event); - if (!fActiveNode.activeNodeChanged(delta)) { - int start= fRootNode.getUndoIndex() + 1; - List children= fRootNode.fChildren; - int size= children != null ? children.size() : 0; - for (int i= start; i < size; i++) { - updateUndo((TextEditNode)children.get(i), delta); - } - } - updateParents(delta); - } - private void updateUndo(TextEditNode node, int delta) { - node.previousNodeChanged(delta); - List children= node.fChildren; - int size= children != null ? children.size() : 0; - for (int i= 0; i < size; i++) { - updateUndo((TextEditNode)children.get(i), delta); - } - } - } - - //---- Creating instances --------------------------------------------------------------------------- - - static TextEditNode create(TextEdit edit) { - if (edit instanceof MoveTextEdit) - return new MoveNode(edit); - if (edit instanceof MoveTextEdit.TargetMark) - return new TargetMarkNode(edit); - return new DefaultNode(edit); - } - - static RootNode createRoot(int length) { - return new RootNode(length); - } - - protected TextEditNode(TextEdit edit) { - fEdit= edit; - } - - //---- Adding children --------------------------------------------------------------------------- - - protected void add(TextEditNode node) { - if (fChildren == null) { - fChildren= new ArrayList(1); - node.fParent= this; - fChildren.add(node); - return; - } - // Optimize using binary search - for (Iterator iter= fChildren.iterator(); iter.hasNext();) { - TextEditNode child= (TextEditNode)iter.next(); - if (child.covers(node)) { - child.add(node); - return; - } - } - for (int i= 0; i < fChildren.size(); ) { - TextEditNode child= (TextEditNode)fChildren.get(i); - if (node.covers(child)) { - fChildren.remove(i); - node.add(child); - } else { - i++; - } - } - node.fParent= this; - fChildren.add(node); - } - - public boolean covers(TextEditNode node) { - return false; - } - - //---- Accessing -------------------------------------------------------------------------------------- - - protected RootNode getRoot() { - TextEditNode candidate= this; - while(candidate.fParent != null) - candidate= candidate.fParent; - return (RootNode)candidate; - } - - //---- Query interface -------------------------------------------------------------------------------- - - protected boolean isSynthetic() { - return fEdit.isSynthetic; - } - - public boolean isMove() { - return false; - } - - //---- Accessing Ranges ------------------------------------------------------------------------------ - - protected void checkRange(DocumentEvent event) { - TextRange range= getTextRange(); - int eventOffset= event.getOffset(); - int eventLength= event.getLength(); - int eventEnd = eventOffset + eventLength - 1; - // "Edit changes text that lies outside its defined range" - Assert.isTrue(range.fOffset <= eventOffset && eventEnd <= range.getInclusiveEnd()); - } - - protected TextRange getTextRange() { - return fEdit.getTextRange(); - } - - protected TextRange getChildRange() { - return getTextRange(); - } - - protected TextRange getParentRange() { - return getTextRange(); - } - - public boolean validate(int bufferLength) { - if (fChildren == null) - return true; - // Only Moves and Nops can be parents - if (!(fEdit instanceof MoveTextEdit || fEdit instanceof NopTextEdit)) - return false; - TextRange lastRange= null; - for (Iterator iter= fChildren.iterator(); iter.hasNext(); ) { - TextEditNode node= (TextEditNode)iter.next(); - if (!node.validate(bufferLength)) - return false; - TextRange range= node.fEdit.getTextRange(); - if (!range.isValid() || range.fOffset + range.fLength > bufferLength) - return false; - if (lastRange != null && !(range.isInsertionPointAt(lastRange.fOffset) || range.liesBehind(lastRange))) - return false; - lastRange= range; - } - return true; - } - - //---- Updating ---------------------------------------------------------------------------------------- - - protected boolean activeNodeChanged(int delta) { - TextRange range= getTextRange(); - range.fLength+= delta; - // we didn't adjust any processed nodes. - return false; - } - - protected void previousNodeChanged(int delta) { - TextRange range= getTextRange(); - range.fOffset+= delta; - } - - protected void childNodeChanged(int delta) { - getTextRange().fLength+= delta; - } - - //---- Do it --------------------------------------------------------------------------------------------- - - protected void performDo(TextBuffer buffer, RangeUpdater updater, UndoMemento undo, IProgressMonitor pm) throws CoreException { - int size= fChildren != null ? fChildren.size() : 0; - for (int i= size - 1; i >= 0; i--) { - TextEditNode child= (TextEditNode)fChildren.get(i); - child.performDo(buffer, updater, undo, pm); - } - updater.setActiveNode(this); - if (isSynthetic()) - fEdit.perform(buffer); - else - undo.add(fEdit.perform(buffer)); - pm.worked(1); - } - - public void performedDo() { - int size= fChildren != null ? fChildren.size() : 0; - for (int i= size - 1; i >= 0; i--) { - TextEditNode child= (TextEditNode)fChildren.get(i); - child.performedDo(); - } - fEdit.performed(); - } - - //---- Undo it ------------------------------------------------------------------------------------------- - - protected void performUndo(TextBuffer buffer, RangeUpdater updater, UndoMemento undo, IProgressMonitor pm) throws CoreException { - int size= fChildren != null ? fChildren.size() : 0; - for (int i= 0; i < size; i++) { - setUndoIndex(i); - TextEditNode child= (TextEditNode)fChildren.get(i); - child.performUndo(buffer, updater, undo, pm); - } - updater.setActiveNode(this); - if (isSynthetic()) - fEdit.perform(buffer); - else - undo.add(fEdit.perform(buffer)); - pm.worked(1); - } - - protected void setUndoIndex(int index) { - } - - public void performedUndo() { - int size= fChildren != null ? fChildren.size() : 0; - for (int i= 0; i < size; i++) { - TextEditNode child= (TextEditNode)fChildren.get(i); - child.performedUndo(); - } - fEdit.performed(); - } - -// protected void createUndoList(List list) { -// int size= fChildren != null ? fChildren.size() : 0; -// for (int i= 0; i < size; i++) { -// TextEditNode child= (TextEditNode)fChildren.get(i); -// child.createUndoList(list); -// } -// list.add(this); -// } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNodeComparator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNodeComparator.java deleted file mode 100644 index 33e527f5787..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextEditNodeComparator.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Comparator; - -/** - * A special comparator to comapre TextRanges. - */ -class TextEditNodeComparator implements Comparator { - public int compare(Object o1, Object o2) { - TextEditNode node1= (TextEditNode)o1; - TextEditNode node2= (TextEditNode)o2; - TextRange pos1= node1.getTextRange(); - TextRange pos2= node2.getTextRange(); - - int offset1= pos1.fOffset; - int offset2= pos2.fOffset; - if (offset1 < offset2) - return -1; - if (offset1 > offset2) - return 1; - - // same offset - int length1= pos1.fLength; - int length2= pos2.fLength; - - // insertion points come before anything else at the same position. - if (length1 == 0 && length2 != 0) - return -1; - if (length1 != 0 && length2 == 0) - return 1; - - // Longer edits come before shorter edits - if (length1 < length2) - return 1; - if (length1 > length2) - return -1; - - if (node1.fEdit.index < node2.fEdit.index) - return -1; - return 1; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextManipulationMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextManipulationMessages.java deleted file mode 100644 index d39190172bd..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextManipulationMessages.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/******************************************************************************* - * Copyright (c) 2002 International Business Machines Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class TextManipulationMessages { - - private static final String BUNDLE_NAME= "org.eclipse.cdt.internal.corext.textmanipulation.Messages"; //$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME); - - private TextManipulationMessages() { - } - - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - public static String getFormattedString(String key, Object arg) { - return getFormattedString(key, new Object[] { arg }); - } - - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRange.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRange.java deleted file mode 100644 index 6bff924fc3a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRange.java +++ /dev/null @@ -1,196 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.util.Assert; - - - -public final class TextRange { - - /* package */ int fOffset; - /* package */ int fLength; - - public static final TextRange UNDEFINED= new TextRange((TextRange)null); - - /** - * Creates a insert position with the given offset. - * - * @param offset the position offset, must be >= 0 - */ - public TextRange(int offset) { - this(offset, 0); - } - - /** - * Creates a new range with the given offset and length. - * - * @param offset the position offset, must be >= 0 - * @param length the position length, must be >= 0 - */ - public TextRange(int offset, int length) { - fOffset= offset; - Assert.isTrue(fOffset >= 0); - fLength= length; - Assert.isTrue(fLength >= 0); - } - - /** - * Constructor for the undefined text range. - */ - private TextRange(TextRange dummy) { - fOffset= -1; - fLength= -1; - } - - public static TextRange createFromStartAndLength(int start, int length) { - return new TextRange(start, length); - } - - public static TextRange createFromStartAndInclusiveEnd(int start, int end) { - return new TextRange(start, end - start + 1); - } - - public static TextRange createFromStartAndExclusiveEnd(int start, int end) { - return new TextRange(start, end - start); - } - - /** - * Creates a new range from the given source range. - * - * @range the source range denoting offset and length - */ - public TextRange(ISourceRange range) { - this(range.getOffset(), range.getLength()); - } - - /** - * Returns the offset of this range. - * - * @return the length of this range - */ - public int getOffset() { - return fOffset; - } - - /** - * Returns the length of this range. - * - * @return the length of this range - */ - public int getLength() { - return fLength; - } - - /** - * Returns the inclusive end position of this range. That means that the end position - * denotes the last character of this range. - * - * @return the inclusive end position - */ - public int getInclusiveEnd() { - return fOffset + fLength - 1; - } - - /** - * Returns the exclusive end position of this range. That means that the end position - * denotes the first character after this range. - * - * @return the exclusive end position - */ - public int getExclusiveEnd() { - return fOffset + fLength; - } - - /** - * Creates a copy of this TextRange. - * - * @return a copy of this TextRange - */ - public TextRange copy() { - if (isUndefined()) - return this; - return new TextRange(fOffset, fLength); - } - - /** - * Returns true if this text range is the UNDEFINED - * text range. Otherwise false is returned. - */ - public boolean isUndefined() { - return UNDEFINED == this; - } - - /** - * Checks if this TextRange is valid. For valid text range the following - * expression evaluates to true: - *

            -	 * 	getOffset() >= 0 && getLength() >= 0
            -	 * 
            - * - * @return true if this text range is a valid range. Otherwise - * false - */ - public boolean isValid() { - return fOffset >= 0 && fLength >= 0; - } - - /* package */ boolean isInsertionPoint() { - return fLength == 0; - } - - /* package */ boolean equals(TextRange range) { - return fOffset == range.fOffset && fLength == range.fLength; - } - - /* package */ boolean isEqualInsertionPoint(TextRange range) { - return fLength == 0 && range.fLength == 0 && fOffset == range.fOffset; - } - - /* package */ boolean liesBehind(TextRange range) { - return fOffset >= range.fOffset + range.fLength; - } - - /* package */ boolean isInsertionPointAt(int o) { - return fOffset == o && fLength == 0; - } - - /* package */ boolean covers(TextRange other) { - if (fLength == 0) { // an insertion point can't cover anything - return false; - } else if (other.fLength == 0) { - int otherOffset= other.fOffset; - return fOffset < otherOffset && otherOffset < fOffset + fLength; - } else { - int otherOffset= other.fOffset; - return fOffset <= otherOffset && otherOffset + other.fLength <= fOffset + fLength; - } - } - /* non Java-doc - * @see Object#toString() - */ - public String toString() { - StringBuffer buffer= new StringBuffer(); - buffer.append(TextManipulationMessages.getString("TextRange.offset")); //$NON-NLS-1$ - buffer.append(fOffset); - buffer.append(TextManipulationMessages.getString("TextRange.length")); //$NON-NLS-1$ - buffer.append(fLength); - return buffer.toString(); - } - - public boolean equals(Object obj) { - if (! (obj instanceof TextRange)) - return false; - TextRange other= (TextRange)obj; - return fOffset == other.getOffset() && fLength == other.getLength(); - } - - public int hashCode() { - return fOffset ^ fLength; - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRegion.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRegion.java deleted file mode 100644 index b6e06dd88eb..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextRegion.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * A text region describes a certain range in an ITextBuffer. A region is defined by - * its offset into the text buffer and its length. - *

            - * A region is considered a value object. Its offset or length do not change over time.

            - *

            - * NOTE: This class/interface is part of an interim API that is still under development - * and expected to change significantly before reaching stability. It is being made available at - * this early stage to solicit feedback from pioneering adopters on the understanding that any - * code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

            - */ - -// This class avoids contamination of clients with wrong imports. - -public abstract class TextRegion { - - /** - * Returns the offset of the region. - * - * @return the offset of the region - */ - public abstract int getOffset(); - /** - * Returns the length of the region. - * - * @return the length of the region - */ - public abstract int getLength(); - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextUtil.java deleted file mode 100644 index 0cefd11a18f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/TextUtil.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.util.Assert; - - -public class TextUtil { - - /** - * Returns the length of the string desribed by start and - * end. - * - * @param start the start position. The position is inclusive - * @param end the end position. The position is inclusive - * @return the length of the string desribed by start and - * end - */ - public static int getLength(int start, int end) { - return end - start + 1; - } - - /** - * Returns the indent of the given line. - * @param line the text line - * @param tabWidth the width of the '\t' character. - */ - public static int getIndent(String line, int tabWidth) { - int result= 0; - int blanks= 0; - int size= line.length(); - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - switch (c) { - case '\t': - result++; - blanks= 0; - break; - case ' ': - blanks++; - if (blanks == tabWidth) { - result++; - blanks= 0; - } - break; - default: - return result; - } - } - return result; - } - - /** - * Removes the given number of idents from the line and returns a new - * copy of the line. Asserts that the given line has the requested - * number of indents. - */ - public static String removeIndent(int numberOfIndents, String line, int tabWidth) { - if (numberOfIndents <= 0) - return new String(line); - - int start= 0; - int indents= 0; - int blanks= 0; - int size= line.length(); - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - switch (c) { - case '\t': - indents++; - blanks= 0; - break; - case ' ': - blanks++; - if (blanks == tabWidth) { - indents++; - blanks= 0; - } - break; - default: - Assert.isTrue(false, "Line does not have requested number of indents"); //$NON-NLS-1$ - } - if (indents == numberOfIndents) { - start= i + 1; - break; - } - } - if (start == size) - return ""; //$NON-NLS-1$ - else - return line.substring(start); - } - - /** - * Removes any leading indents from the given string. - */ - public static String removeLeadingIndents(String line, int tabWidth) { - int indents= getIndent(line, tabWidth); - return removeIndent(indents, line, tabWidth); - } - - /** - * Creates a string that consists of the given number of tab characters. - */ - public static String createIndentString(int indent) { - StringBuffer result= new StringBuffer(); - for (int i= 0; i < indent; i++) { - result.append('\t'); - } - return result.toString(); - } - - /** - * Removes any leading white spaces from the given string. - * The method returns a new string. - */ - public static String removeLeadingWhiteSpaces(String line) { - int size= line.length(); - int start= 0; - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (c != '\t' && c != ' ') { - start= i; - break; - } - } - return line.substring(start); - } - - /** - * Returns true if the given string consists only of - * white spaces (e.g. space and '\t'). If the string is empty, - * true is returned. - */ - public static boolean containsOnlyWhiteSpaces(String line) { - int size= line.length(); - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (c != '\t' && c != ' ') - return false; - } - return true; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/UndoMemento.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/UndoMemento.java deleted file mode 100644 index 3af1ebf7473..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/textmanipulation/UndoMemento.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.cdt.internal.corext.textmanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -/** - * This class encapsulates the reverse change of a number of TextEdits - * executed on a TextBufferEditor - */ -public final class UndoMemento { - - /* package */ int fMode; - /* package */ List fEdits; - - /* package */ UndoMemento(int mode) { - fMode= mode; - fEdits= new ArrayList(10); - } - - /* package */ void add(TextEdit edit) { - fEdits.add(edit); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java deleted file mode 100644 index 546de621487..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java +++ /dev/null @@ -1,288 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; - -/** - * A base content provider for C elements. It provides access to the - * C element hierarchy without listening to changes in the C model. - * Use this class when you want to present the C elements - * in a modal dialog or wizard. - *

            - * The following C element hierarchy is surfaced by this content provider: - *

            - *

            -C model (ICModel)
            -   C project (ICProject)
            -      C Container(folders) (ICContainer)
            -      Translation unit (ITranslationUnit)
            -      Binary file (IBinary)
            -      Archive file (IArchive)
            -      Non C Resource file (Object)
            -
            - * 
            - */ -public class BaseCElementContentProvider implements ITreeContentProvider { - - protected static final Object[] NO_CHILDREN= new Object[0]; - - protected boolean fProvideMembers= false; - protected boolean fProvideWorkingCopy= false; - - public BaseCElementContentProvider() { - } - - public BaseCElementContentProvider(boolean provideMembers, boolean provideWorkingCopy) { - fProvideMembers= provideMembers; - //fProvideWorkingCopy= provideWorkingCopy; - } - - /** - * Returns whether the members are provided when asking - * for a TU's or ClassFile's children. - */ - public boolean getProvideMembers() { - return fProvideMembers; - } - - /** - * Returns whether the members are provided when asking - * for a TU's or ClassFile's children. - */ - public void setProvideMembers(boolean b) { - fProvideMembers= b; - } - - /** - * Sets whether the members are provided from - * a working copy of a compilation unit - */ - public void setProvideWorkingCopy(boolean b) { - //fProvideWorkingCopy= b; - } - - /** - * Returns whether the members are provided - * from a working copy a compilation unit. - */ - public boolean getProvideWorkingCopy() { - return fProvideWorkingCopy; - } - - /* (non-Cdoc) - * Method declared on IStructuredContentProvider. - */ - public Object[] getElements(Object parent) { - return getChildren(parent); - } - - /* (non-Cdoc) - * Method declared on IContentProvider. - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - /* (non-Cdoc) - * Method declared on IContentProvider. - */ - public void dispose() { - } - - /* (non-Cdoc) - * Method declared on ITreeContentProvider. - */ - public Object[] getChildren(Object element) { - if (element instanceof ICElement) { - ICElement celement = (ICElement)element; - if (celement instanceof ICModel) { - return getCProjects((ICModel)celement); - } else if (celement instanceof ICProject ) { - return getCProjectResources((ICProject)celement); - } else if (celement instanceof ICContainer) { - return getCResources((ICContainer)celement); - } else if (celement.getElementType() == ICElement.C_UNIT) { - if (fProvideMembers) { - return ((IParent)element).getChildren(); - } - } else if (celement instanceof IParent) { - return (Object[])((IParent)celement).getChildren(); - } - } - return getResources(element); - } - - /* (non-Cdoc) - * - * @see ITreeContentProvider - */ - public boolean hasChildren(Object element) { - if (fProvideMembers) { - // assume TUs and binary files are never empty - if (element instanceof IBinary || element instanceof ITranslationUnit || element instanceof IArchive) { - return true; - } - } else { - // don't allow to drill down into a compilation unit or class file - if (element instanceof ITranslationUnit || element instanceof IBinary || element instanceof IArchive) { - return false; - } - } - - if (element instanceof ICProject) { - ICProject cp= (ICProject)element; - if (!cp.getProject().isOpen()) { - return false; - } else { - return true; - } - } - - if (element instanceof ICContainer) { - return true; - } - - if (element instanceof IParent) { - // when we have C children return true, else we fetch all the children - return ((IParent)element).hasChildren(); - } - Object[] children= getChildren(element); - return (children != null) && children.length > 0; - } - - /* (non-Cdoc) - * Method declared on ITreeContentProvider. - */ - public Object getParent(Object element) { - if (!exists(element)) { - return null; - } - return internalGetParent(element); - } - - public Object internalGetParent(Object element) { - if (element instanceof ICElement) { - return ((ICElement)element).getParent(); - } - if (element instanceof IResource) { - IResource parent= ((IResource)element).getParent(); - ICElement cParent= CoreModel.getDefault().create(parent); - if (cParent != null && cParent.exists()) { - return cParent; - } - return parent; - } - return null; - } - - protected Object[] getCProjects(ICModel cModel) { - return cModel.getCProjects(); - } - - protected Object[] getCProjectResources(ICProject cproject) { - Object[] objects = getCResources((ICContainer)cproject); - IArchiveContainer archives = cproject.getArchiveContainer(); - if (archives.hasChildren()) { - objects = concatenate(objects, new Object[] {archives}); - } - IBinaryContainer bins = cproject.getBinaryContainer(); - if (bins.hasChildren()) { - objects = concatenate(objects, new Object[] {bins}); - } - try { - ILibraryReference[] refs = cproject.getLibraryReferences(); - objects = concatenate(objects, refs); - } catch (CModelException e) { - } - return objects; - } - - protected Object[] getCResources(ICContainer container) { - Object[] objects = null; - Object[] children = container.getChildren(); - try { - objects = container.getNonCResources(); - } catch (CModelException e) { - } - if (objects == null) { - return children; - } - return concatenate(children, objects); - } - - private Object[] getResources(Object resource) { - try { - if (resource instanceof IContainer) { - Object[] members= ((IContainer)resource).members(); - List nonCResources= new ArrayList(); - for (int i= 0; i < members.length; i++) { - Object o= members[i]; - nonCResources.add(o); - } - return nonCResources.toArray(); - } - } catch(CoreException e) { - } - return NO_CHILDREN; - } -/* - protected boolean isBuildPathChange(ICElementDelta delta) { - int flags= delta.getFlags(); - return (delta.getKind() == ICElementDelta.CHANGED && - ((flags & ICElementDelta.F_ADDED_TO_CLASSPATH) != 0) || - ((flags & ICElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) || - ((flags & ICElementDelta.F_CLASSPATH_REORDER) != 0)); - } -*/ - - - protected boolean exists(Object element) { - if (element == null) { - return false; - } - if (element instanceof IResource) { - return ((IResource)element).exists(); - } - if (element instanceof ICElement) { - return ((ICElement)element).exists(); - } - return true; - } - - - /** - * Note: This method is for internal use only. Clients should not call this method. - */ - protected static Object[] concatenate(Object[] a1, Object[] a2) { - int a1Len = a1.length; - int a2Len = a2.length; - Object[] res = new Object[a1Len + a2Len]; - System.arraycopy(a1, 0, res, 0, a1Len); - System.arraycopy(a2, 0, res, a1Len, a2Len); - return res; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java deleted file mode 100644 index 770b9ad34ff..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BinaryPropertySource.java +++ /dev/null @@ -1,182 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.viewers.IBasicPropertyConstants; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -public class BinaryPropertySource implements IPropertySource { - - private final static String ELF_CPU= "CElementProperties.elf_cpu"; - private final static String ELF_TEXT= "CElementProperties.elf_text"; - private final static String ELF_DATA= "CElementProperties.elf_data"; - private final static String ELF_BSS= "CElementProperties.elf_bss"; - private final static String ELF_TYPE= "CElementProperties.elf_type"; - private final static String ELF_HAS_DEBUG= "CElementProperties.elf_has_debug"; - private final static String ELF_SONAME= "CElementProperties.elf_soname"; - private final static String ELF_NEEDED= "CElementProperties.elf_needed"; - - private IBinary binary; - - // Property Descriptors - static private IPropertyDescriptor[] fgPropertyDescriptors; - - /** - * Get a PropertyDescriptor that defines the binary properties of an Elf - * @return the PropertyDescriptor - */ - private static IPropertyDescriptor[] getInitialPropertyDescriptor() { - // cpu name - String cpuName= CUIPlugin.getResourceString(ELF_CPU); - PropertyDescriptor cpuDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_CPU, cpuName); - cpuDescriptor.setAlwaysIncompatible(true); - - // elf text - String textName = CUIPlugin.getResourceString(ELF_TEXT); - PropertyDescriptor textDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_TEXT, textName); - textDescriptor.setAlwaysIncompatible(true); - - // elf data - String dataName = CUIPlugin.getResourceString(ELF_DATA); - PropertyDescriptor dataDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_DATA, dataName); - dataDescriptor.setAlwaysIncompatible(true); - - // elf bss - String bssName = CUIPlugin.getResourceString(ELF_BSS); - PropertyDescriptor bssDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_BSS, bssName); - bssDescriptor.setAlwaysIncompatible(true); - - // elf type - String typeName = CUIPlugin.getResourceString(ELF_TYPE); - PropertyDescriptor typeDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_TYPE, typeName); - bssDescriptor.setAlwaysIncompatible(true); - - // elf needed - String neededName = CUIPlugin.getResourceString(ELF_NEEDED); - PropertyDescriptor neededDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_NEEDED, neededName); - bssDescriptor.setAlwaysIncompatible(true); - - // elf soname - String sonameName = CUIPlugin.getResourceString(ELF_SONAME); - PropertyDescriptor sonameDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_SONAME, sonameName); - bssDescriptor.setAlwaysIncompatible(true); - - // elf debug - String debugName = CUIPlugin.getResourceString(ELF_HAS_DEBUG); - PropertyDescriptor debugDescriptor= new PropertyDescriptor(ICElementPropertyConstants.P_ELF_HAS_DEBUG, debugName); - bssDescriptor.setAlwaysIncompatible(true); - - return new IPropertyDescriptor[] { cpuDescriptor, textDescriptor, dataDescriptor, - bssDescriptor, typeDescriptor, sonameDescriptor, debugDescriptor, neededDescriptor }; - } - - public BinaryPropertySource(IBinary bin) { - binary= bin; - } - - /** - * @see IPropertySource#getPropertyDescriptors - */ - public IPropertyDescriptor[] getPropertyDescriptors() { - if (fgPropertyDescriptors == null) - initializeBinaryDescriptors(); - return fgPropertyDescriptors; - } - - /** - * @see IPropertySource#getPropertyValue - */ - public Object getPropertyValue(Object name) { -// if (element != null) { -// Object returnValue = super.getPropertyValue(name); -// -// if(returnValue != null) -// return returnValue; -// } - if (name.equals(IBasicPropertyConstants.P_TEXT)) { - return binary.getElementName(); - } else if (name.equals(ICElementPropertyConstants.P_ELF_CPU)) { - return binary.getCPU(); - } else if (name.equals(ICElementPropertyConstants.P_ELF_TEXT)) { - return Long.toString(binary.getText()); - } else if (name.equals(ICElementPropertyConstants.P_ELF_DATA)) { - return Long.toString(binary.getData()); - } else if (name.equals(ICElementPropertyConstants.P_ELF_BSS)) { - return Long.toString(binary.getBSS()); - } else if (name.equals(ICElementPropertyConstants.P_ELF_SONAME)) { - return binary.getSoname(); - } else if (name.equals(ICElementPropertyConstants.P_ELF_HAS_DEBUG)) { - if (binary.hasDebug()) { - return "true";//$NON-NLS-1$ - } else { - return "false";//$NON-NLS-1$ - } - } else if (name.equals(ICElementPropertyConstants.P_ELF_NEEDED)) { - String[] needed = binary.getNeededSharedLibs(); - String need = ""; - for (int i = 0; i < needed.length; i++) { - need += " " + needed[i]; - } - return need.trim(); - } else if (name.equals(ICElementPropertyConstants.P_ELF_TYPE)) { - if (binary.isObject()) { - return "object"; - } else if (binary.isExecutable()) { - return "executable"; - } else if (binary.isSharedLib()) { - return "shared library"; - } else if (binary.isCore()) { - return "core file"; - } - } - return null; - } - - /** - * Return the Property Descriptors for the file type. - */ - private void initializeBinaryDescriptors() { -// IPropertyDescriptor[] superDescriptors = super.getPropertyDescriptors(); -// int superLength = superDescriptors.length; -// IPropertyDescriptor[] binDescriptors = getInitialPropertyDescriptor(); -// int binLength = binDescriptors.length; -// fgPropertyDescriptors = new IPropertyDescriptor[superLength + binLength]; -// System.arraycopy(superDescriptors, 0, fgPropertyDescriptors, 0, superLength); -// System.arraycopy(binDescriptors, 0, fgPropertyDescriptors, superLength, binLength); - fgPropertyDescriptors = getInitialPropertyDescriptor(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() - */ - public Object getEditableValue() { - return this; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object) - */ - public boolean isPropertySet(Object id) { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) - */ - public void resetPropertyValue(Object id) { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object) - */ - public void setPropertyValue(Object id, Object value) { - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsole.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsole.java deleted file mode 100644 index c6e24b5865e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsole.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.ui; - -import org.eclipse.cdt.core.ConsoleOutputStream; -import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.cdt.ui.*; -import org.eclipse.core.resources.IProject; - -public class BuildConsole implements IConsole { - IProject project; - IBuildConsoleManager fConsoleManager; - - /** - * Constructor for BuildConsole. - */ - public BuildConsole() { - fConsoleManager = CUIPlugin.getDefault().getConsoleManager(); - } - - public void start(IProject project ) { - this.project = project; - fConsoleManager.getConsole(project).start(project); - } - - /** - * @see org.eclipse.cdt.core.resources.IConsole#clear() - */ - public void clear() { - fConsoleManager.getConsole(project).clear(); - } - - /** - * @see org.eclipse.cdt.core.resources.IConsole#getOutputStream() - */ - public ConsoleOutputStream getOutputStream() { - return fConsoleManager.getConsole(project).getOutputStream(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java deleted file mode 100644 index 9dfa0ebafb0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.ui; - -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.cdt.core.ConsoleOutputStream; -import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IBuildConsoleListener; -import org.eclipse.cdt.ui.IBuildConsoleManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.ListenerList; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; - -public class BuildConsoleManager implements IBuildConsoleManager, IResourceChangeListener, IPropertyChangeListener { - private HashMap fConsoleDocumentMap; - ListenerList listeners = new ListenerList(1); - - private class BuildConsoleDocument extends Document { - - private int fMaxLines; - - public BuildConsoleDocument(int nLines) { - super(); - fMaxLines = nLines; - } - - public void setDocumentSize(int nLines) { - fMaxLines = nLines; - nLines = getNumberOfLines(); - if (nLines > fMaxLines) { - try { - int start = getLineOffset(nLines - fMaxLines); - String part = get(start, getLength() - start); - set(part); - } catch (BadLocationException e) { - } - } - } - - public BuildConsoleDocument(String initialContent) { - super(initialContent); - } - - public void replace(int offset, int length, String text) throws BadLocationException { - super.replace(offset, length, text); - int nLines = getNumberOfLines(); - if (nLines > fMaxLines) { - int start = getLineOffset(nLines - fMaxLines); - String part = get(start, getLength() - start); - set(part); - } - } - } - - private class BuildConsole extends ConsoleOutputStream implements IConsole { - protected BuildConsoleDocument fDocument; - - public BuildConsole() { - fDocument = new BuildConsoleDocument(BuildConsolePreferencePage.buildConsoleLines()); - } - - public void setConsoleSize(int nLines) { - fDocument.setDocumentSize(nLines); - } - - public void start(IProject project) { - if (BuildConsolePreferencePage.isClearBuildConsole()) { - clear(); - } - Object[] list = listeners.getListeners(); - if (list.length > 0) { - for (int i = 0; i < list.length; i++) { - IBuildConsoleListener listener = (IBuildConsoleListener) list[i]; - ConsoleEvent event = new ConsoleEvent(BuildConsoleManager.this, project, ConsoleEvent.CONSOLE_START); - listener.consoleChange(event); - } - } - } - - public void clear() { - super.clear(); - Display.getDefault().syncExec(new Runnable() { - public void run() { - fDocument.set(""); - } - }); - } - - public ConsoleOutputStream getOutputStream() { - return this; - } - - public IDocument getDocument() { - return fDocument; - } - - public void flush() throws IOException { - Display.getDefault().syncExec(new Runnable() { - public void run() { - bringConsoleOnTop(); - try { - int len = fDocument.getLength(); - fDocument.replace(len, 0, readBuffer()); - } catch (BadLocationException x) { - } - } - }); - } - - void bringConsoleOnTop() { - IWorkbenchWindow window = CUIPlugin.getDefault().getActiveWorkbenchWindow(); - if (window == null) - return; - IWorkbenchPage page = window.getActivePage(); - if (page != null) { - try { - // show the build console - IViewPart cBuild = page.findView(CUIPlugin.CONSOLE_ID); - if (cBuild == null) { - if (BuildConsolePreferencePage.isAutoOpenConsole()) { - IWorkbenchPart activePart = page.getActivePart(); - cBuild = page.showView(CUIPlugin.CONSOLE_ID); - //restore focus - page.activate(activePart); - } - } - if (cBuild != null && BuildConsolePreferencePage.isConsoleOnTop()) { - page.bringToTop(cBuild); - } - } catch (PartInitException pie) { - } - } - } - - public void close() throws IOException { - flush(); - } - - } - - public BuildConsoleManager() { - fConsoleDocumentMap = new HashMap(); - } - - /** - * Traverses the delta looking for added/removed/changed launch - * configuration files. - * - * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - if (fConsoleDocumentMap == null) { - return; - } - IResource resource = event.getResource(); - if (resource != null && resource.getType() == IResource.PROJECT) { - if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) { - fConsoleDocumentMap.remove(resource); - Object[] list = listeners.getListeners(); - if (list.length > 0) { - for (int i = 0; i < list.length; i++) { - IBuildConsoleListener listener = (IBuildConsoleListener) list[i]; - ConsoleEvent consoleEvent = new ConsoleEvent(this, (IProject) resource, ConsoleEvent.CONSOLE_CLOSE); - listener.consoleChange(consoleEvent); - } - } - } - } - } - - public void shutdown() { - CUIPlugin.getWorkspace().removeResourceChangeListener(this); - CUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); - } - - public void startup() { - CUIPlugin.getWorkspace().addResourceChangeListener(this); - CUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); - } - - private BuildConsole getBuildConsole(IProject project) { - BuildConsole console = (BuildConsole) fConsoleDocumentMap.get(project); - if (console == null) { - console = new BuildConsole(); - fConsoleDocumentMap.put(project, console); - } - return console; - } - - public IConsole getConsole(IProject project) { - return getBuildConsole(project); - } - - public IDocument getConsoleDocument(IProject project) { - return getBuildConsole(project).getDocument(); - } - - public void addConsoleListener(IBuildConsoleListener listener) { - listeners.add(listener); - } - - public void removeConsoleListener(IBuildConsoleListener listener) { - listeners.remove(listener); - } - - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty() == BuildConsolePreferencePage.PREF_BUILDCONSOLE_LINES) { - Collection consoles = fConsoleDocumentMap.values(); - Iterator iter = consoles.iterator(); - while (iter.hasNext()) { - BuildConsole console = (BuildConsole) iter.next(); - console.setConsoleSize(BuildConsolePreferencePage.buildConsoleLines()); - } - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java deleted file mode 100644 index 2c1eaaee17a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CCompletionContributorManager.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.ICCompletionContributor; -import org.eclipse.cdt.ui.IFunctionSummary; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.Platform; - -/** - * Manages external plugins that contribute completion and function - * info through the CCompletionContributor extension point - */ - -public class CCompletionContributorManager { - - static private List fCompletionContributors; - static boolean fContributorsLoaded = false; - public static final String CONTRIBUTION_EXTENSION = "CCompletionContributor"; - static private CCompletionContributorManager fInstance; - - private CCompletionContributorManager() { - // Initialize and scan the extension points - } - - public static CCompletionContributorManager getDefault() { - if (fInstance == null) { - fInstance = new CCompletionContributorManager(); - } - return fInstance; - } - - public IFunctionSummary getFunctionInfo(String name) { - if (!fContributorsLoaded) - loadExtensions(); - - for (int i = 0; i < fCompletionContributors.size(); i++) { - ICCompletionContributor c = (ICCompletionContributor) fCompletionContributors.get(i); - IFunctionSummary f = c.getFunctionInfo(name); - - if (f != null) - return f; - } - return null; - } - - public IFunctionSummary[] getMatchingFunctions(String frag) { - if (!fContributorsLoaded) - loadExtensions(); - IFunctionSummary[] fs = null; - - for (int i = 0; i < fCompletionContributors.size(); i++) { - ICCompletionContributor c = (ICCompletionContributor) fCompletionContributors.get(i); - IFunctionSummary[] f = c.getMatchingFunctions(frag); - if (f != null) { - if (fs != null) { - int length = f.length + fs.length; - IFunctionSummary[] ft = new IFunctionSummary[length]; - int j; - for (j = 0; j < fs.length; j++) - ft[j] = fs[j]; - for (j = 0; j < f.length; j++) - ft[j + fs.length] = f[j]; - fs = ft; - } else { - fs = f; - } - } - - //if(f != null) - //return f; - } - - return fs; - } - - private void loadExtensions() { - fContributorsLoaded = true; - fCompletionContributors = new ArrayList(2); - - // populate list - IExtensionPoint extensionPoint = Platform.getPluginRegistry().getExtensionPoint(CUIPlugin.PLUGIN_ID, "CCompletionContributor"); //$NON-NLS-1$ - if (extensionPoint != null) { - IConfigurationElement[] elements = extensionPoint.getConfigurationElements(); - for (int i = 0; i < elements.length; i++) { - if (elements[i].getName().equals("provider")) { - try { - final ICCompletionContributor c; - // Instantiate the classe - c = (ICCompletionContributor) elements[i].createExecutableExtension("class"); - ISafeRunnable runnable = new ISafeRunnable() { - public void run() throws Exception { - // Initialize - c.initialize(); - // Add to contributor list - fCompletionContributors.add(c); - } - public void handleException(Throwable exception) { - } - }; - Platform.run(runnable); - } catch (CoreException e) { - } - } - } - } - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java deleted file mode 100644 index 40f72b6257e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementAdapterFactory.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.ui.model.IWorkbenchAdapter; -import org.eclipse.ui.views.properties.FilePropertySource; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.ResourcePropertySource; - -/** - * Implements basic UI support for C elements. - */ -public class CElementAdapterFactory implements IAdapterFactory { - - private static Class[] PROPERTIES= new Class[] { - IPropertySource.class, - IResource.class, - IWorkbenchAdapter.class, - IProject.class, - IWorkspaceRoot.class - }; - - private static CWorkbenchAdapter fgCWorkbenchAdapter= new CWorkbenchAdapter(); - - /** - * @see CElementAdapterFactory#getAdapterList - */ - public Class[] getAdapterList() { - return PROPERTIES; - } - - /** - * @see CElementAdapterFactory#getAdapter - */ - public Object getAdapter(Object element, Class key) { - ICElement celem = (ICElement) element; - IResource res = null; - - if (IPropertySource.class.equals(key)) { - if (celem instanceof IBinary) { - return new BinaryPropertySource((IBinary)celem); - } else if (celem.getElementType() == ICElement.C_UNIT) { - IResource file = celem.getResource(); - if (file != null && file instanceof IFile) { - return new FilePropertySource((IFile)file); - } - } else { - res = celem.getResource(); - if (res != null) { - return new ResourcePropertySource(res); - } - } - return new CElementPropertySource(celem); - } else if (IWorkspaceRoot.class.equals(key)) { - res = celem.getUnderlyingResource(); - if (res != null) - return res.getWorkspace().getRoot(); - } else if (IProject.class.equals(key)) { - res = celem.getResource(); - if (res != null) - return res.getProject(); - } else if (IResource.class.equals(key)) { - return celem.getResource(); - } else if (IWorkbenchAdapter.class.equals(key)) { - return fgCWorkbenchAdapter; - } - return null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java deleted file mode 100644 index 3baa5eae23e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementImageProvider.java +++ /dev/null @@ -1,480 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryModule; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IDeclaration; -import org.eclipse.cdt.core.model.IField; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.cdt.core.model.IMethodDeclaration; -import org.eclipse.cdt.core.model.ITemplate; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry; -import org.eclipse.cdt.ui.CElementImageDescriptor; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.model.IWorkbenchAdapter; - - -/** - * Default strategy of the C plugin for the construction of C element icons. - */ -public class CElementImageProvider { - - /** - * Flags for the CImageLabelProvider: - * Generate images with overlays. - */ - public final static int OVERLAY_ICONS= 0x1; - - /** - * Generate small sized images. - */ - public final static int SMALL_ICONS= 0x2; - - /** - * Use the 'light' style for rendering types. - */ - public final static int LIGHT_TYPE_ICONS= 0x4; - - /** - * Show error overrlay. - */ - public final static int OVERLAY_ERROR= 0x8; - - /** - * Show warning overrlay - */ - public final static int OVERLAY_WARNING= 0x10; - - /** - * Show override overrlay. - */ - public final static int OVERLAY_OVERRIDE= 0x20; - - /** - * Show implements overrlay. - */ - public final static int OVERLAY_IMPLEMENTS= 0x40; - - private static final Point SMALL_SIZE= new Point(16, 16); - private static final Point BIG_SIZE= new Point(22, 16); - - private static ImageDescriptor DESC_OBJ_PROJECT_CLOSED; - private static ImageDescriptor DESC_OBJ_PROJECT; - private static ImageDescriptor DESC_OBJ_FOLDER; - { - ISharedImages images= CUIPlugin.getDefault().getWorkbench().getSharedImages(); - DESC_OBJ_PROJECT_CLOSED= images.getImageDescriptor(ISharedImages.IMG_OBJ_PROJECT_CLOSED); - DESC_OBJ_PROJECT= images.getImageDescriptor(ISharedImages.IMG_OBJ_PROJECT); - DESC_OBJ_FOLDER= images.getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER); - } - - private ImageDescriptorRegistry fRegistry; - - public CElementImageProvider() { - fRegistry= CUIPlugin.getImageDescriptorRegistry(); - } - - /** - * Returns the icon for a given element. The icon depends on the element type - * and element properties. If configured, overlay icons are constructed for - * ISourceReferences. - * @param flags Flags as defined by the JavaImageLabelProvider - */ - public Image getImageLabel(Object element, int flags) { - ImageDescriptor descriptor= null; - if (element instanceof ICElement) { - descriptor= getCImageDescriptor((ICElement) element, flags); - } - if (descriptor == null && element instanceof IAdaptable) { - descriptor= getWorkbenchImageDescriptor((IAdaptable) element, flags); - } - if (descriptor != null) { - return fRegistry.get(descriptor); - } - return null; - } - - /** - * - * @param type - * @return - */ - public static ImageDescriptor getImageDescriptor(int type) { - switch (type) { - case ICElement.C_VCONTAINER: - return CPluginImages.DESC_OBJS_CONTAINER; - - case ICElement.C_BINARY: - return CPluginImages.DESC_OBJS_BINARY; - - case ICElement.C_ARCHIVE: - return CPluginImages.DESC_OBJS_ARCHIVE; - - case ICElement.C_UNIT: - return CPluginImages.DESC_OBJS_TUNIT; - - case ICElement.C_CCONTAINER: - return DESC_OBJ_FOLDER; - - case ICElement.C_PROJECT: - return DESC_OBJ_PROJECT; - - case ICElement.C_STRUCT: - case ICElement.C_TEMPLATE_STRUCT: - return CPluginImages.DESC_OBJS_STRUCT; - - case ICElement.C_CLASS: - case ICElement.C_TEMPLATE_CLASS: - return CPluginImages.DESC_OBJS_CLASS; - - case ICElement.C_UNION: - case ICElement.C_TEMPLATE_UNION: - return CPluginImages.DESC_OBJS_UNION; - - case ICElement.C_TYPEDEF: - return CPluginImages.DESC_OBJS_TYPEDEF; - - case ICElement.C_ENUMERATION: - return CPluginImages.DESC_OBJS_ENUMERATION; - - case ICElement.C_ENUMERATOR: - return CPluginImages.DESC_OBJS_ENUMERATOR; - - case ICElement.C_FIELD: - return CPluginImages.DESC_OBJS_PUBLIC_FIELD; - - case ICElement.C_VARIABLE: - case ICElement.C_TEMPLATE_VARIABLE: - return CPluginImages.DESC_OBJS_VARIABLE; - - case ICElement.C_METHOD: - case ICElement.C_METHOD_DECLARATION: - case ICElement.C_TEMPLATE_METHOD: - return CPluginImages.DESC_OBJS_PUBLIC_METHOD; - - case ICElement.C_FUNCTION: - return CPluginImages.DESC_OBJS_FUNCTION; - - case ICElement.C_VARIABLE_DECLARATION: - return CPluginImages.DESC_OBJS_VAR_DECLARARION; - - case ICElement.C_FUNCTION_DECLARATION: - case ICElement.C_TEMPLATE_FUNCTION: - return CPluginImages.DESC_OBJS_DECLARARION; - - case ICElement.C_INCLUDE: - return CPluginImages.DESC_OBJS_INCLUDE; - - case ICElement.C_MACRO: - return CPluginImages.DESC_OBJS_MACRO; - - case ICElement.C_NAMESPACE: - return CPluginImages.DESC_OBJS_CONTAINER; - } - return null; - } - - private boolean showOverlayIcons(int flags) { - return (flags & OVERLAY_ICONS) != 0; - } - -// private boolean useLightIcons(int flags) { -// return (flags & LIGHT_TYPE_ICONS) != 0; -// } - - private boolean useSmallSize(int flags) { - return (flags & SMALL_ICONS) != 0; - } - - /** - * Returns an image descriptor for a C element. The descriptor includes overlays, if specified. - */ - public ImageDescriptor getCImageDescriptor(ICElement element, int flags) { - int adornmentFlags= computeCAdornmentFlags(element, flags); - Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE; - ImageDescriptor desc = getBaseImageDescriptor(element, flags); - if(desc != null) { - return new CElementImageDescriptor(desc, adornmentFlags, size); - } - return null; - } - - /** - * Returns an image descriptor for a IAdaptable. The descriptor includes overlays, if specified (only error ticks apply). - * Returns null if no image could be found. - */ - public ImageDescriptor getWorkbenchImageDescriptor(IAdaptable adaptable, int flags) { - IWorkbenchAdapter wbAdapter= (IWorkbenchAdapter) adaptable.getAdapter(IWorkbenchAdapter.class); - if (wbAdapter == null) { - return null; - } - ImageDescriptor descriptor= wbAdapter.getImageDescriptor(adaptable); - if (descriptor == null) { - return null; - } - int adornmentFlags= computeBasicAdornmentFlags(adaptable, flags); - Point size= useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE; - return new CElementImageDescriptor(descriptor, adornmentFlags, size); - } - - // ---- Computation of base image key ------------------------------------------------- - - /** - * Returns an image descriptor for a C element. This is the base image, no overlays. - */ - public ImageDescriptor getBaseImageDescriptor(ICElement celement, int renderFlags) { - int type = celement.getElementType(); - switch (type) { - case ICElement.C_VCONTAINER: - if (celement instanceof IBinaryModule) { - return CPluginImages.DESC_OBJS_BINARY; - } else if (celement instanceof ILibraryReference) { - return CPluginImages.DESC_OBJS_LIBRARY; - } - return CPluginImages.DESC_OBJS_CONTAINER; - - case ICElement.C_BINARY: { - IBinary bin = (IBinary)celement; - if (bin.isExecutable()) { - if (bin.hasDebug()) - return CPluginImages.DESC_OBJS_CEXEC_DEBUG; - return CPluginImages.DESC_OBJS_CEXEC; - } else if (bin.isSharedLib()) { - return CPluginImages.DESC_OBJS_SHLIB; - } else if (bin.isCore()) { - return CPluginImages.DESC_OBJS_CORE; - } - return CPluginImages.DESC_OBJS_BINARY; - } - - case ICElement.C_ARCHIVE: - return CPluginImages.DESC_OBJS_ARCHIVE; - - case ICElement.C_UNIT: - String ext = celement.getPath().getFileExtension(); - if (ext != null) { - String[] exts = CoreModel.getDefault().getHeaderExtensions(); - for (int i = 0; i < exts.length; i++) { - if (exts[i].equalsIgnoreCase(ext)) { - return CPluginImages.DESC_OBJS_TUNIT_HEADER; - } - } - } - return CPluginImages.DESC_OBJS_TUNIT; - - case ICElement.C_CCONTAINER: - return DESC_OBJ_FOLDER; - - case ICElement.C_PROJECT: - ICProject cp= (ICProject)celement; - if (cp.getProject().isOpen()) { - IProject project= cp.getProject(); - IWorkbenchAdapter adapter= (IWorkbenchAdapter)project.getAdapter(IWorkbenchAdapter.class); - if (adapter != null) { - ImageDescriptor result= adapter.getImageDescriptor(project); - if (result != null) - return result; - } - return DESC_OBJ_PROJECT; - } - return DESC_OBJ_PROJECT_CLOSED; - - case ICElement.C_STRUCT: - case ICElement.C_TEMPLATE_STRUCT: - return getStructImageDescriptor(); - - case ICElement.C_CLASS: - case ICElement.C_TEMPLATE_CLASS: - return getClassImageDescriptor(); - - case ICElement.C_UNION: - case ICElement.C_TEMPLATE_UNION: - return getUnionImageDescriptor(); - - case ICElement.C_TYPEDEF: - return getTypedefImageDescriptor(); - - case ICElement.C_ENUMERATION: - return getEnumerationImageDescriptor(); - - case ICElement.C_ENUMERATOR: - return getEnumeratorImageDescriptor(); - - case ICElement.C_FIELD: - { - IField field = (IField)celement; - ASTAccessVisibility visibility = field.getVisibility(); - return getFieldImageDescriptor(visibility); - } - - case ICElement.C_METHOD: - case ICElement.C_METHOD_DECLARATION: - case ICElement.C_TEMPLATE_METHOD: - { - IMethodDeclaration md= (IMethodDeclaration)celement; - ASTAccessVisibility visibility =md.getVisibility(); - return getMethodImageDescriptor(visibility); - } - - case ICElement.C_VARIABLE: - case ICElement.C_TEMPLATE_VARIABLE: - return getVariableImageDescriptor(); - - case ICElement.C_FUNCTION: - return getFunctionImageDescriptor(); - - case ICElement.C_VARIABLE_DECLARATION: - return getVariableDeclarationImageDescriptor(); - - case ICElement.C_FUNCTION_DECLARATION: - case ICElement.C_TEMPLATE_FUNCTION: - return getFunctionDeclarationImageDescriptor(); - - case ICElement.C_INCLUDE: - return getIncludeImageDescriptor(); - - case ICElement.C_MACRO: - return getMacroImageDescriptor(); - - case ICElement.C_NAMESPACE: - return getNamespaceImageDescriptor(); - - } - return null; - } - - - // ---- Methods to compute the adornments flags --------------------------------- - - private int computeCAdornmentFlags(ICElement element, int renderFlags) { - - int flags= computeBasicAdornmentFlags(element, renderFlags); - - if (showOverlayIcons(renderFlags) && element instanceof IDeclaration) { - IDeclaration decl = (IDeclaration) element; - if(decl.isStatic()){ - flags |= CElementImageDescriptor.STATIC; - } - if(decl.isConst()){ - flags |= CElementImageDescriptor.CONSTANT; - } - if(decl.isVolatile()){ - flags |= CElementImageDescriptor.VOLATILE; - } - if(element instanceof ITemplate){ - flags |= CElementImageDescriptor.TEMPLATE; - } - } - return flags; - } - - private int computeBasicAdornmentFlags(Object element, int renderFlags) { - int flags= 0; - if ((renderFlags & OVERLAY_ERROR) !=0) { - flags |= CElementImageDescriptor.ERROR; - } - if ((renderFlags & OVERLAY_WARNING) !=0) { - flags |= CElementImageDescriptor.WARNING; - } - if ((renderFlags & OVERLAY_OVERRIDE) !=0) { - flags |= CElementImageDescriptor.OVERRIDES; - } - if ((renderFlags & OVERLAY_IMPLEMENTS) !=0) { - flags |= CElementImageDescriptor.IMPLEMENTS; - } - return flags; - } - - public void dispose() { - } - - public static ImageDescriptor getStructImageDescriptor(){ - return CPluginImages.DESC_OBJS_STRUCT; - } - - public static ImageDescriptor getClassImageDescriptor(){ - return CPluginImages.DESC_OBJS_CLASS; - } - - public static ImageDescriptor getUnionImageDescriptor(){ - return CPluginImages.DESC_OBJS_UNION; - } - - public static ImageDescriptor getTypedefImageDescriptor(){ - return CPluginImages.DESC_OBJS_TYPEDEF; - } - - public static ImageDescriptor getEnumerationImageDescriptor(){ - return CPluginImages.DESC_OBJS_ENUMERATION; - } - - public static ImageDescriptor getEnumeratorImageDescriptor(){ - return CPluginImages.DESC_OBJS_ENUMERATOR; - } - - public static ImageDescriptor getFieldImageDescriptor(ASTAccessVisibility visibility) { - if (visibility == ASTAccessVisibility.PUBLIC) - return CPluginImages.DESC_OBJS_PUBLIC_FIELD; - if( visibility == ASTAccessVisibility.PROTECTED) - return CPluginImages.DESC_OBJS_PROTECTED_FIELD; - - return CPluginImages.DESC_OBJS_PRIVATE_FIELD; - } - - public static ImageDescriptor getMethodImageDescriptor(ASTAccessVisibility visibility) { - if( visibility == ASTAccessVisibility.PUBLIC) - return CPluginImages.DESC_OBJS_PUBLIC_METHOD; - if( visibility == ASTAccessVisibility.PROTECTED) - return CPluginImages.DESC_OBJS_PROTECTED_METHOD; - - return CPluginImages.DESC_OBJS_PRIVATE_METHOD; - - } - - public static ImageDescriptor getVariableImageDescriptor(){ - return CPluginImages.DESC_OBJS_VARIABLE; - } - - public static ImageDescriptor getLocalVariableImageDescriptor(){ - return CPluginImages.DESC_OBJS_LOCAL_VARIABLE; - } - - public static ImageDescriptor getFunctionImageDescriptor(){ - return CPluginImages.DESC_OBJS_FUNCTION; - } - - public static ImageDescriptor getVariableDeclarationImageDescriptor(){ - return CPluginImages.DESC_OBJS_VAR_DECLARARION; - } - - public static ImageDescriptor getFunctionDeclarationImageDescriptor(){ - return CPluginImages.DESC_OBJS_DECLARARION; - } - - public static ImageDescriptor getIncludeImageDescriptor(){ - return CPluginImages.DESC_OBJS_INCLUDE; - } - - public static ImageDescriptor getMacroImageDescriptor(){ - return CPluginImages.DESC_OBJS_MACRO; - } - - public static ImageDescriptor getNamespaceImageDescriptor(){ - return CPluginImages.DESC_OBJS_CONTAINER; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementProperties.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementProperties.java deleted file mode 100644 index d49038f6e7a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementProperties.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.viewers.IBasicPropertyConstants; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.ui.*; - -public class CElementProperties implements IPropertySource { - - private final static String LABEL= "CElementProperties.name"; - - private ICElement fCElement; - - // Property Descriptors - static private IPropertyDescriptor[] fgPropertyDescriptors; - - static { - // resource name - String displayName= CUIPlugin.getResourceString(LABEL); - PropertyDescriptor descriptor= new PropertyDescriptor(IBasicPropertyConstants.P_TEXT, displayName); - descriptor.setAlwaysIncompatible(true); - - fgPropertyDescriptors= new IPropertyDescriptor[] { descriptor }; - } - - public CElementProperties(ICElement elem) { - fCElement= elem; - } - - /** - * @see IPropertySource#getPropertyDescriptors - */ - public IPropertyDescriptor[] getPropertyDescriptors() { - return fgPropertyDescriptors; - } - - /** - * @see IPropertySource#getPropertyValue - */ - public Object getPropertyValue(Object name) { - if (name.equals(IBasicPropertyConstants.P_TEXT)) { - return fCElement.getElementName(); - } - return null; - } - - /** - * @see IPropertySource#setPropertyValue - */ - public void setPropertyValue(Object name, Object value) { - } - - /** - * @see IPropertySource#getEditableValue - */ - public Object getEditableValue() { - return null; - } - - /** - * @see IPropertySource#isPropertySet - */ - public boolean isPropertySet(Object property) { - return false; - } - - /** - * @see IPropertySource#resetPropertyValue - */ - public void resetPropertyValue(Object property) { - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementPropertySource.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementPropertySource.java deleted file mode 100644 index d8481647422..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CElementPropertySource.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.viewers.IBasicPropertyConstants; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.ui.*; - -public class CElementPropertySource implements IPropertySource { - - private final static String LABEL= "CElementProperties.name"; - - private ICElement fCElement; - - // Property Descriptors - static private IPropertyDescriptor[] fgPropertyDescriptors; - - static { - // resource name - String displayName= CUIPlugin.getResourceString(LABEL); - PropertyDescriptor descriptor= new PropertyDescriptor(IBasicPropertyConstants.P_TEXT, displayName); - descriptor.setAlwaysIncompatible(true); - - fgPropertyDescriptors= new IPropertyDescriptor[] { descriptor }; - } - - public CElementPropertySource(ICElement elem) { - fCElement= elem; - } - - /** - * @see IPropertySource#getPropertyDescriptors - */ - public IPropertyDescriptor[] getPropertyDescriptors() { - return fgPropertyDescriptors; - } - - /** - * @see IPropertySource#getPropertyValue - */ - public Object getPropertyValue(Object name) { - if (name.equals(IBasicPropertyConstants.P_TEXT)) { - return fCElement.getElementName(); - } - return null; - } - - /** - * @see IPropertySource#setPropertyValue - */ - public void setPropertyValue(Object name, Object value) { - } - - /** - * @see IPropertySource#getEditableValue - */ - public Object getEditableValue() { - return null; - } - - /** - * @see IPropertySource#isPropertySet - */ - public boolean isPropertySet(Object property) { - return false; - } - - /** - * @see IPropertySource#resetPropertyValue - */ - public void resetPropertyValue(Object property) { - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java deleted file mode 100644 index 45f0f6a1d07..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CFileElementWorkingCopy.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.IBufferChangedListener; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.WorkingCopy; -import org.eclipse.cdt.internal.ui.editor.CDocumentProvider; -import org.eclipse.cdt.internal.ui.editor.DocumentAdapter; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultLineTracker; -import org.eclipse.jface.text.IDocument; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.texteditor.IDocumentProvider; - -public class CFileElementWorkingCopy extends WorkingCopy { - - IDocumentProvider fProvider; - IEditorInput input; - IBuffer buffer; - - /** - * Internal IBuffer implementation very simple, must cases will use DocumentAdapter. - * - */ - class Buffer implements IBuffer { - - CFileElementWorkingCopy owner; - - public Buffer(CFileElementWorkingCopy o) { - owner = o; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#addBufferChangedListener(org.eclipse.cdt.core.model.IBufferChangedListener) - */ - public void addBufferChangedListener(IBufferChangedListener listener) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#append(char[]) - */ - public void append(char[] text) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#append(java.lang.String) - */ - public void append(String text) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#close() - */ - public void close() { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getChar(int) - */ - public char getChar(int position) { - IDocument doc = fProvider.getDocument(input); - if (doc != null) { - try { - return doc.getChar(position); - } catch (BadLocationException e) { - } - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getCharacters() - */ - public char[] getCharacters() { - return getContents().toCharArray(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getContents() - */ - public String getContents() { - IDocument doc = fProvider.getDocument(input); - if (doc != null) { - return doc.get(); - } - return new String(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getLength() - */ - public int getLength() { - IDocument doc = fProvider.getDocument(input); - if (doc != null) { - return doc.getLength(); - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getOwner() - */ - public IOpenable getOwner() { - return owner; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getText(int, int) - */ - public String getText(int offset, int length) { - IDocument doc = fProvider.getDocument(input); - if (doc != null) { - try { - return doc.get(offset, length); - } catch (BadLocationException e) { - } - } - return new String(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#getUnderlyingResource() - */ - public IResource getUnderlyingResource() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#hasUnsavedChanges() - */ - public boolean hasUnsavedChanges() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#isClosed() - */ - public boolean isClosed() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#removeBufferChangedListener(org.eclipse.cdt.core.model.IBufferChangedListener) - */ - public void removeBufferChangedListener(IBufferChangedListener listener) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#replace(int, int, char[]) - */ - public void replace(int position, int length, char[] text) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#replace(int, int, java.lang.String) - */ - public void replace(int position, int length, String text) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#save(org.eclipse.core.runtime.IProgressMonitor, boolean) - */ - public void save(IProgressMonitor progress, boolean force) throws CModelException { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#setContents(char[]) - */ - public void setContents(char[] contents) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IBuffer#setContents(java.lang.String) - */ - public void setContents(String contents) { - } - - } - - /** - * Creates a working copy of this element - */ - public CFileElementWorkingCopy(IStorageEditorInput StoreInput, IDocumentProvider provider) throws CoreException { - super(null, new Path(StoreInput.getName()), null); - input = StoreInput; - fProvider = provider; - IStorage storage = StoreInput.getStorage(); - super.setLocation(storage.getFullPath()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.model.IOpenable#getBuffer() - */ - public IBuffer getBuffer() throws CModelException { - if (buffer == null) { - if (fProvider instanceof CDocumentProvider) { - buffer = new DocumentAdapter(this, fProvider.getDocument(input), new DefaultLineTracker(), (CDocumentProvider)fProvider, input); - } else { - buffer = new Buffer(this); - } - } - return buffer; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#getOriginalElement() - */ - public ITranslationUnit getOriginalElement() { - return this; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java deleted file mode 100644 index af1b061d565..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPerspectiveFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.ui.*; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.ui.IFolderLayout; -import org.eclipse.ui.IPageLayout; -import org.eclipse.ui.IPerspectiveFactory; - -public class CPerspectiveFactory implements IPerspectiveFactory { - - /** - * Constructs a new Default layout engine. - */ - public CPerspectiveFactory() { - super(); - } - - /** - * @see IPerspectiveFactory#createInitialLayout - */ - public void createInitialLayout(IPageLayout layout) { - String editorArea = layout.getEditorArea(); - - IFolderLayout folder1= layout.createFolder("topLeft", IPageLayout.LEFT, (float)0.25, editorArea); - folder1.addView(IPageLayout.ID_RES_NAV); - folder1.addPlaceholder(IPageLayout.ID_BOOKMARKS); - folder1.addView(CUIPlugin.CVIEW_ID); - - IFolderLayout folder2= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); - folder2.addView(IPageLayout.ID_TASK_LIST); - folder2.addView(CUIPlugin.CONSOLE_ID); - folder2.addView(IPageLayout.ID_PROP_SHEET); - - IFolderLayout folder3= layout.createFolder("topRight", IPageLayout.RIGHT,(float)0.75, editorArea); - folder3.addView(IPageLayout.ID_OUTLINE); - - layout.addActionSet(CUIPlugin.SEARCH_ACTION_SET_ID); - layout.addActionSet(CUIPlugin.FOLDER_ACTION_SET_ID); - - // views - build console - layout.addShowViewShortcut(CUIPlugin.CONSOLE_ID); - - // views - searching - layout.addShowViewShortcut(SearchUI.SEARCH_RESULT_VIEW_ID); - - // views - standard workbench - layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); - layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); - layout.addShowViewShortcut(CUIPlugin.CVIEW_ID); - layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); - layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); - - // link - things we should do - layout.addShowInPart(CUIPlugin.CVIEW_ID); - layout.addShowInPart(IPageLayout.ID_RES_NAV); - - // new actions - C project creation wizard - layout.addNewWizardShortcut(CUIPlugin.CLASS_WIZARD_ID); - layout.addNewWizardShortcut(CUIPlugin.FILE_WIZARD_ID); - layout.addNewWizardShortcut(CUIPlugin.FOLDER_WIZARD_ID); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java deleted file mode 100644 index d3e69156033..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.cdt.ui.*; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; - -/** - * Bundle of all images used by the C plugin. - */ -public class CPluginImages { - - // The plugin registry - private static ImageRegistry imageRegistry = new ImageRegistry(); - - // Subdirectory (under the package containing this class) where 16 color images are - private static URL fgIconBaseURL; - static { - try { - fgIconBaseURL= new URL(CUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); - } catch (MalformedURLException e) { - CUIPlugin.getDefault().log(e); - } - } - private static final String NAME_PREFIX= CUIPlugin.PLUGIN_ID + '.'; - private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length(); - private static final String T= "full/"; - - public static final String T_OBJ= T + "obj16/"; - public static final String T_WIZBAN= T + "wizban/"; - public static final String T_LCL= "lcl16/"; - public static final String T_TOOL= "tool16/"; - public static final String T_VIEW= "view16/"; - public static final String T_OVR= T + "ovr16/"; - - public static final String IMG_OBJS_TEMPLATE= NAME_PREFIX + "template_obj.gif"; - public static final String IMG_OBJS_VARIABLE= NAME_PREFIX + "variable_obj.gif"; - public static final String IMG_OBJS_LOCAL_VARIABLE= NAME_PREFIX + "variable_local_obj.gif"; - public static final String IMG_OBJS_CLASS= NAME_PREFIX + "class_obj.gif"; - public static final String IMG_OBJS_STRUCT= NAME_PREFIX + "struct_obj.gif"; - public static final String IMG_OBJS_UNION= NAME_PREFIX + "union_obj.gif"; - public static final String IMG_OBJS_TYPEDEF= NAME_PREFIX + "typedef_obj.gif"; - public static final String IMG_OBJS_ENUMERATION= NAME_PREFIX + "enum_obj.gif"; - public static final String IMG_OBJS_ENUMERATOR= NAME_PREFIX + "enumerator_obj.gif"; - public static final String IMG_OBJS_FUNCTION= NAME_PREFIX + "function_obj.gif"; - public static final String IMG_OBJS_PUBLIC_METHOD= NAME_PREFIX + "method_public_obj.gif"; - public static final String IMG_OBJS_PROTECTED_METHOD= NAME_PREFIX + "method_protected_obj.gif"; - public static final String IMG_OBJS_PRIVATE_METHOD= NAME_PREFIX + "method_private_obj.gif"; - public static final String IMG_OBJS_PUBLIC_FIELD= NAME_PREFIX + "field_public_obj.gif"; - public static final String IMG_OBJS_PROTECTED_FIELD= NAME_PREFIX + "field_protected_obj.gif"; - public static final String IMG_OBJS_PRIVATE_FIELD= NAME_PREFIX + "field_private_obj.gif"; - public static final String IMG_OBJS_DECLARATION= NAME_PREFIX + "cdeclaration_obj.gif"; - public static final String IMG_OBJS_VAR_DECLARATION= NAME_PREFIX + "var_declaration_obj.gif"; - public static final String IMG_OBJS_INCLUDE= NAME_PREFIX + "include_obj.gif"; - public static final String IMG_OBJS_MACRO= NAME_PREFIX + "define_obj.gif"; - public static final String IMG_OBJS_TUNIT= NAME_PREFIX + "c_file_obj.gif"; - public static final String IMG_OBJS_TUNIT_HEADER= NAME_PREFIX + "h_file_obj.gif"; - public static final String IMG_OBJS_ARCHIVE= NAME_PREFIX + "ar_obj.gif"; - public static final String IMG_OBJS_BINARY= NAME_PREFIX + "bin_obj.gif"; - public static final String IMG_OBJS_SHLIB= NAME_PREFIX + "shlib_obj.gif"; - public static final String IMG_OBJS_CEXEC= NAME_PREFIX + "exec_obj.gif"; - public static final String IMG_OBJS_CEXEC_DEBUG= NAME_PREFIX + "exec_dbg_obj.gif"; - public static final String IMG_OBJS_CORE= NAME_PREFIX + "core_obj.gif"; - public static final String IMG_OBJS_CONTAINER= NAME_PREFIX + "container_obj.gif"; - public static final String IMG_OBJS_LIBRARY= NAME_PREFIX + "lib_obj.gif"; - - // Breakpoint images - public static final String IMG_OBJS_BREAKPOINT = NAME_PREFIX + "breakpoint.gif"; - public static final String IMG_OBJS_BREAKPOINT_DISABLED = NAME_PREFIX + "breakpoint_disabled.gif"; - public static final String IMG_OBJS_BREAKPOINT_ACTIVE = NAME_PREFIX + "breakpoint_active.gif"; - - public static final ImageDescriptor DESC_OBJS_VARIABLE= createManaged(T_OBJ, IMG_OBJS_VARIABLE); - public static final ImageDescriptor DESC_OBJS_LOCAL_VARIABLE= createManaged(T_OBJ, IMG_OBJS_LOCAL_VARIABLE); - public static final ImageDescriptor DESC_OBJS_CLASS= createManaged(T_OBJ, IMG_OBJS_CLASS); - public static final ImageDescriptor DESC_OBJS_STRUCT= createManaged(T_OBJ, IMG_OBJS_STRUCT); - public static final ImageDescriptor DESC_OBJS_UNION= createManaged(T_OBJ, IMG_OBJS_UNION); - public static final ImageDescriptor DESC_OBJS_TYPEDEF= createManaged(T_OBJ, IMG_OBJS_TYPEDEF); - public static final ImageDescriptor DESC_OBJS_ENUMERATION= createManaged(T_OBJ, IMG_OBJS_ENUMERATION); - public static final ImageDescriptor DESC_OBJS_ENUMERATOR= createManaged(T_OBJ, IMG_OBJS_ENUMERATOR); - public static final ImageDescriptor DESC_OBJS_FUNCTION= createManaged(T_OBJ, IMG_OBJS_FUNCTION); - public static final ImageDescriptor DESC_OBJS_PUBLIC_METHOD= createManaged(T_OBJ, IMG_OBJS_PUBLIC_METHOD); - public static final ImageDescriptor DESC_OBJS_PROTECTED_METHOD= createManaged(T_OBJ, IMG_OBJS_PROTECTED_METHOD); - public static final ImageDescriptor DESC_OBJS_PRIVATE_METHOD= createManaged(T_OBJ, IMG_OBJS_PRIVATE_METHOD); - public static final ImageDescriptor DESC_OBJS_PUBLIC_FIELD= createManaged(T_OBJ, IMG_OBJS_PUBLIC_FIELD); - public static final ImageDescriptor DESC_OBJS_PROTECTED_FIELD= createManaged(T_OBJ, IMG_OBJS_PROTECTED_FIELD); - public static final ImageDescriptor DESC_OBJS_PRIVATE_FIELD= createManaged(T_OBJ, IMG_OBJS_PRIVATE_FIELD); - public static final ImageDescriptor DESC_OBJS_DECLARARION= createManaged(T_OBJ, IMG_OBJS_DECLARATION); - public static final ImageDescriptor DESC_OBJS_VAR_DECLARARION= createManaged(T_OBJ, IMG_OBJS_VAR_DECLARATION); - public static final ImageDescriptor DESC_OBJS_INCLUDE= createManaged(T_OBJ, IMG_OBJS_INCLUDE); - public static final ImageDescriptor DESC_OBJS_MACRO= createManaged(T_OBJ, IMG_OBJS_MACRO); - public static final ImageDescriptor DESC_OBJS_TUNIT= createManaged(T_OBJ, IMG_OBJS_TUNIT); - public static final ImageDescriptor DESC_OBJS_TUNIT_HEADER= createManaged(T_OBJ, IMG_OBJS_TUNIT_HEADER); - public static final ImageDescriptor DESC_OBJS_ARCHIVE= createManaged(T_OBJ, IMG_OBJS_ARCHIVE); - public static final ImageDescriptor DESC_OBJS_BINARY= createManaged(T_OBJ, IMG_OBJS_BINARY); - public static final ImageDescriptor DESC_OBJS_SHLIB= createManaged(T_OBJ, IMG_OBJS_SHLIB); - public static final ImageDescriptor DESC_OBJS_CEXEC= createManaged(T_OBJ, IMG_OBJS_CEXEC); - public static final ImageDescriptor DESC_OBJS_CEXEC_DEBUG= createManaged(T_OBJ, IMG_OBJS_CEXEC_DEBUG); - public static final ImageDescriptor DESC_OBJS_CORE= createManaged(T_OBJ, IMG_OBJS_CORE); - public static final ImageDescriptor DESC_OBJS_CONTAINER= createManaged(T_OBJ, IMG_OBJS_CONTAINER); - public static final ImageDescriptor DESC_OBJS_LIBRARY= createManaged(T_OBJ, IMG_OBJS_LIBRARY); - - // Breakpoint image descriptors - public static final ImageDescriptor DESC_OBJS_BREAKPOINT = createManaged( T_OBJ, IMG_OBJS_BREAKPOINT ); - public static final ImageDescriptor DESC_OBJS_BREAKPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_BREAKPOINT_DISABLED ); - public static final ImageDescriptor DESC_OBJS_BREAKPOINT_ACTIVE = createManaged( T_OBJ, IMG_OBJS_BREAKPOINT_ACTIVE ); - - public static final String IMG_MENU_SHIFT_RIGHT= NAME_PREFIX + "shift_r_edit.gif"; - public static final String IMG_MENU_SHIFT_LEFT= NAME_PREFIX + "shift_l_edit.gif"; - public static final String IMG_MENU_OPEN_INCLUDE= NAME_PREFIX + "open_incl.gif"; - public static final String IMG_MENU_SEGMENT_EDIT= NAME_PREFIX + "segment_edit.gif"; - public static final String IMG_MENU_CODE_ASSIST= NAME_PREFIX + "metharg_obj.gif"; - public static final String IMG_MENU_COLLAPSE_ALL= NAME_PREFIX + "collapseall.gif"; - public static final String IMG_CLEAR_CONSOLE= NAME_PREFIX + "clear_co.gif"; - public static final String IMG_ALPHA_SORTING= NAME_PREFIX + "alphab_sort_co.gif"; - public static final String IMG_TOOL_GOTO_PREV_ERROR= NAME_PREFIX + "prev_error_nav.gif"; - public static final String IMG_TOOL_GOTO_NEXT_ERROR= NAME_PREFIX + "next_error_nav.gif"; - public static final String IMG_EDIT_PROPERTIES= NAME_PREFIX + "prop_edt.gif"; - - public static final String IMG_ACTION_SHOW_FIELDS= NAME_PREFIX + "fields_co.gif"; - public static final String IMG_ACTION_SHOW_PUBLIC= NAME_PREFIX + "public_co.gif"; - public static final String IMG_ACTION_SHOW_STATIC= NAME_PREFIX + "static_co.gif"; - - public static final ImageDescriptor DESC_OBJS_TEMPLATE= createManaged(T_OBJ, IMG_OBJS_TEMPLATE); - - public static final ImageDescriptor DESC_OVR_STATIC= create(T_OVR, "static_co.gif"); - public static final ImageDescriptor DESC_OVR_CONSTANT= create(T_OVR, "c_ovr.gif"); - public static final ImageDescriptor DESC_OVR_VOLATILE= create(T_OVR, "volatile_co.gif"); - public static final ImageDescriptor DESC_OVR_TEMPLATE= create(T_OVR, "template_co.gif"); - - public static final ImageDescriptor DESC_OVR_WARNING= create(T_OVR, "warning_co.gif"); - public static final ImageDescriptor DESC_OVR_ERROR= create(T_OVR, "error_co.gif"); - - public static final ImageDescriptor DESC_WIZABAN_NEW_PROJ= create(T_WIZBAN, "newcprj_wiz.gif"); - public static final ImageDescriptor DESC_WIZBAN_NEWCLASS= create(T_WIZBAN, "newclass_wiz.gif"); - public static final ImageDescriptor DESC_WIZABAN_C_APP= create(T_WIZBAN, "c_app_wiz.gif"); - public static final String IMG_OBJS_PROJECT = NAME_PREFIX + "prj_obj.gif"; - public static final ImageDescriptor DESC_PROJECT= createManaged(T_WIZBAN, IMG_OBJS_PROJECT); - - public static final ImageDescriptor DESC_TOOL_NEWCLASS= create(T_TOOL, "newclass_wiz.gif"); //$NON-NLS-1$ - - // For the build image - public static final String IMG_OBJS_BUILD= NAME_PREFIX + "build_menu.gif"; - public static final ImageDescriptor DESC_BUILD_MENU = createManaged(T_OBJ, IMG_OBJS_BUILD); - - //for search - public static final String IMG_OBJS_SEARCH_REF = NAME_PREFIX + "search_ref_obj.gif"; - public static final String IMG_OBJS_SEARCH_DECL = NAME_PREFIX + "search_decl_obj.gif"; - public static final String IMG_OBJS_CSEARCH = NAME_PREFIX + "csearch_obj.gif"; - - public static final ImageDescriptor DESC_OBJS_SEARCH_DECL = createManaged(T_OBJ, IMG_OBJS_SEARCH_DECL); - public static final ImageDescriptor DESC_OBJS_SEARCH_REF = createManaged(T_OBJ, IMG_OBJS_SEARCH_REF); - public static final ImageDescriptor DESC_OBJS_CSEARCH = createManaged(T_OBJ, IMG_OBJS_CSEARCH); - - public static void initialize() { - //createManaged(registry, T_OBJ, IMG_OBJS_TUNIT); - //createManaged(registry, T_OBJ, IMG_OBJS_FIELD); - //createManaged(registry, T_OBJ, IMG_OBJS_CLASS); - //createManaged(registry, T_OBJ, IMG_OBJS_STRUCT); - //createManaged(registry, T_OBJ, IMG_OBJS_UNION); - //createManaged(registry, T_OBJ, IMG_OBJS_FUNCTION); - //createManaged(registry, T_OBJ, IMG_OBJS_INCLUDE); - //createManaged(registry, T_OBJ, IMG_OBJS_DEFINE); - - //createManaged(registry, T_OBJ, IMG_OBJS_ARCHIVE); - //createManaged(registry, T_OBJ, IMG_OBJS_SHLIB); - //createManaged(registry, T_OBJ, IMG_OBJS_BINARY); - //createManaged(registry, T_OBJ, IMG_OBJS_CEXEC); - //createManaged(registry, T_OBJ, IMG_OBJS_CEXEC_DEBUG); - //createManaged(registry, T_OBJ, IMG_OBJS_CONTAINER); - - //createManaged(registry, T_OBJ, IMG_OBJS_TEMPLATE); - } - - private static ImageDescriptor createManaged(String prefix, String name) { - return createManaged(imageRegistry, prefix, name); - } - - private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) { - ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH))); - registry.put(name, result); - return result; - } - - public static Image get(String key) { - return imageRegistry.get(key); - } - - private static ImageDescriptor create(String prefix, String name) { - return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); - } - - private static URL makeIconFileURL(String prefix, String name) { - StringBuffer buffer= new StringBuffer(prefix); - buffer.append(name); - try { - return new URL(fgIconBaseURL, buffer.toString()); - } catch (MalformedURLException e) { - CUIPlugin.getDefault().log(e); - return null; - } - } - - /** - * Sets all available image descriptors for the given action. - */ - public static void setImageDescriptors(IAction action, String type, String relPath) { - relPath= relPath.substring(NAME_PREFIX_LENGTH); - action.setDisabledImageDescriptor(create(T + "d" + type, relPath)); - action.setHoverImageDescriptor(create(T + "c" + type, relPath)); - action.setImageDescriptor(create(T + "e" + type, relPath)); - } - - /** - * Helper method to access the image registry from the JavaPlugin class. - */ - static ImageRegistry getImageRegistry() { - return imageRegistry; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties deleted file mode 100644 index 02e22e4484a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties +++ /dev/null @@ -1,332 +0,0 @@ -######################################### -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -######################################### - -# ------- CView ----------------- -CView.make_edit_action =Project properties - -# ------- Preference Page ------- - -#CBasePreferencePage.description=The build command is an executable program which will be used by the builder\nto build your C project. If the build command is not on the current system\nenvironment path, you have to enter an absolute path name.\nThe command given here will be filled in new C projects by default.\nTo change the builder for a specific project, use the project's property page. -CBasePreferencePage.description=The build command is an executable program which will be used by the builder\nto build your C/C++ project. If the build command is not on the current system\nenvironment path, you have to enter an absolute path name.\nThe command given here will be filled in new C/C++ projects by default. -CBasePreferencePage.buildLocation.label=Default build command: -CBasePreferencePage.clearConsole.label=Always clear C-Build view before building -CBasePreferencePage.autoOpenConsole.label=Open C-Build view when building -CBasePreferencePage.consoleOnTop.label=Bring C-Build view to top when building (if present) -CBasePreferencePage.buildConsole.errorMessage=Value must be an integer between 10 and 2147483647 -CBasePreferencePage.linkToEditor.label=Link view selection to active editor -CBasePreferencePage.CUChildren.label=Show file members in Project View -CBasePreferencePage.OutlineView.structuralParseMode.label=Use Structural-Parse mode to build the CModel - -CBasePreferencePage.editorFont.label=C Editor font: -CBasePreferencePage.consoleFont.label=C-Build view font: - -CBasePreferencePage.bracketHighlightBox.label=Highlight matching brackets with box -CBasePreferencePage.bracketHighlightClr.label=Highlight matching brackets with color -CBasePreferencePage.bracketColour.label=Bracket highlighting color - -OpenProjectWizardAction.title=New Project -OpenNewFileWizardAction.title=New File -OpenNewFolderWizardAction.title=New Folder -OpenClassWizardAction.title=New Class - -# ------- Project/Prefernces/Wizards COnfiguration blocks ------- - -ErrorParserBlock.label=Error Parsers -ErrorParserBlock.desc=Set the error parser for this project - -BinaryParserBlock.label=Binary Parser -BinaryParserBlock.desc=Set required binary parser for this project - -IndexerBlock.label=Indexer -IndexerBlock.desc=Project Indexer option - -ReferenceBlock.label= Projects -ReferenceBlock.desc= Referenced C/C++ Projects - -# ------- NewProjectCreationPluginPage------- - -CProjectWizardPage.nameLabel=Name: -CProjectWizardPage.useDefaultLabel=Use Default Location -CProjectWizardPage.locationLabel=Location: -CProjectWizardPage.browseLabel=Browse... -CProjectWizardPage.projectNameEmpty=Project name must be specified. -CProjectWizardPage.defaultLocationError=Location path can not overlap with default location. -CProjectWizardPage.projectExistsMessage=Project already exists. -CProjectWizardPage.directoryLabel=Select the project contents directory. -CProjectWizardPage.locationError=Invalid path location. - -# ------- ProjectConfigurationBlock------- - -ProjectConfigurationBlock.buildCmdText.label=The build command is an executable program which will be used by the builder to build your C project. If the build command is not on the current system environment path, you have to enter an absolute path name. If the build command is make then it will use the makefile which is located in the project folder -ProjectConfigurationBlock.buildArgsText.label=Build can be either incremental or full. You can specify different build arguments\nfor the two kinds. -ProjectConfigurationBlock.buildArgText.label=Additional build arguments - -ProjectConfigurationBlock.buildLocation.label=Build command: -ProjectConfigurationBlock.buildLocation.button=Browse... -ProjectConfigurationBlock.fullBuildArguments.label=Full Build Arguments: -ProjectConfigurationBlock.incrBuildArguments.label=Incremental Build Arguments: -ProjectConfigurationBlock.error.InvalidBuildCommand=Invalid build command - -# --- The new wizards ---- -# FIXME: Remove the properties above when satisfy with wizards. - -SettingsBlock.label=Build Settings -SettingsBlock.keepOnGoing=Keep Going On Error -SettingsBlock.stopOnError=Stop On Error -SettingsBlock.makeOption.label=Build Command -SettingsBlock.makeOption.use_default=Use Default -SettingsBlock.makeOption.build_cmd=Build Command: - -#Strings for the platform selection tab -PlatformBlock.label.platform=Platform: -PlatformBlock.tip.platform=Select the platform you wish to deploy on -PlatformBlock.label.configs=Configurations: - -# String constants for the build configuration tab -ConfigurationBlock.label=Build Information -ConfigurationBlock.type=Project Type -ConfigurationBlock.type.app=Application -ConfigurationBlock.type.shared=Shared Library/DLL -ConfigurationBlock.type.static=Static Library -ConfigurationBlock.build.label=Build Settings -ConfigurationBlock.build.continue=Continue On Error -ConfigurationBlock.build.stop=Stop On Error - -# String constants for the build include path and preprocessor symbols -BuildPathInfoBlock.label=Paths and Symbols -BuildPathInfoBlock.paths=Include paths: -BuildPathInfoBlock.symbols=Defined symbols: -BuildPathInfoBlock.browse.path=New Include Path -BuildPathInfoBlock.browse.path.label=Path: -BuildPathInfoBlock.browse.symbol=New Defined Symbol -BuildPathInfoBlock.browse.symbol.label=Symbol: - -StdMakeProjectWizard.op_error=Standard Make Error -StdMakeProjectWizard.title=Standard Make Project -StdMakeProjectWizard.description=Create a new Standard Make project. -StdMakeProjectWizardSettings.title=Standard Make Settings -StdMakeProjectWizardSettings.description=Define the Standard Make build settings. - -StdCWizard.title=Standard Make C Project -StdCWizard.description=Create a new Standard Make C project. -StdCWizardSettings.title=Standard Make C Settings -StdCWizardSettings.description=Define the Standard Make C build settings. - -StdCCWizard.title=Standard Make C++ Project -StdCCWizard.description=Create a new Standard Make C++ Project. -StdCCWizardSettings.title=Standard Make C++ Settings -StdCCWizardSettings.description=Define the Standard Make C++ build settings. - -MngMakeProjectWizard.op_error=Managed Make Error -MngMakeProjectWizard.title=Managed Make Project -MngMakeProjectWizard.description=Create a new Managed Make project. -MngMakeProjectWizardSettings.title=Managed Make Settings -MngMakeProjectWizardSettings.description=Define the Managed Make build settings. - -MngCWizard.title=Managed Make C Project -MngCWizard.description=Create a new Managed Make C project. -MngCWizardSettings.title=Managed Make C Settings -MngCWizardSettings.description=Define the Managed Make C build settings. - -MngCCWizard.title=Managed Make C++ Project -MngCCWizard.description=Create a new Managed Make C++ Project. -MngCCWizardSettings.title=Managed Make C++ Settings -MngCCWizardSettings.description=Define the Managed Make C++ build settings. - -NewClassWizard.title=New C++ Class -NewClassWizard.description=Create a new C++ Class. -NewClassWizard.page.title=C++ Class - -CProjectWizard.op_error.title=Error Creating Project -CProjectWizard.op_error.message=Project cannot be created -CProjectWizard.op_description=C Project Wizard -CProjectWizard.windowTitle=New Project -CProjectWizard.description=C Project Wizard -CProjectWizard.title=C Project Wizard -CProjectWizardPage=C Wizard Page - -# Defaults from ConvertProjectWizardPage -ConversionWizard.windowTitle=Convert C/C++ Projects -ConversionWizard.description=Select project(s) for conversion -ConversionWizard.title=Add a C++ Nature to project(s) -ConversionWizard.projectlist=Candidates for conversion - -# Convert to C/C++ -StdMakeConversionWizard.windowTitle=Convert Projects to C or C++ -StdMakeConversionWizard.description=Select project(s) for conversion -StdMakeConversionWizard.title=Add a C or C++ Nature to selected project(s) - -TabFolderPage=Tab Folder Page -TabFolderPage.title=Project -TabFolderPage.desc=Project Settings - -# ------- CProjectPropertyPage------- - -CProjectPropertyPage.nocproject=Not a C builder -CProjectPropertyPage.closedproject=C information is not available for a closed project - -# ------- Building ------- - -CBuilder.build_error=Could not execute builder "{0}" configured in the project property page. - -# ------- Properties------- - -CElementProperties.name=name -CElementProperties.elf_cpu=cpu -CElementProperties.elf_text=text -CElementProperties.elf_data=data -CElementProperties.elf_bss=bss -CElementProperties.elf_type=type -CElementProperties.elf_soname=soname -CElementProperties.elf_has_debug=debug -CElementProperties.elf_needed=needed - -# ------- Compare ------- - -CMergeViewer.title=C Compare Viewer -CStructureCreator.name=C Compare - -# ------- Editor ------------ - -Editor.Undo.label=Undo@Ctrl+Z -Editor.Undo.tooltip=Undo -Editor.Undo.image= -Editor.Undo.description=Undo - -Editor.Redo.label=Redo@Ctrl+Y -Editor.Redo.tooltip=Redo -Editor.Redo.image= -Editor.Redo.description=Redo - -Editor.Cut.label=Cut@Ctrl+X -Editor.Cut.tooltip=Cut -Editor.Cut.image= -Editor.Cut.description=Cut - -Editor.Copy.label=&Copy@Ctrl+C -Editor.Copy.tooltip=Copy -Editor.Copy.image= -Editor.Copy.description=Copy - -Editor.Paste.label=Paste@Ctrl+V -Editor.Paste.tooltip=Paste -Editor.Paste.image= -Editor.Paste.description=Paste - -Editor.Delete.label=Delete@Delete -Editor.Delete.tooltip=Delete -Editor.Delete.image= -Editor.Delete.description=Delete - -Editor.SelectAll.label=Select &All@Ctrl+A -Editor.SelectAll.tooltip=Select All -Editor.SelectAll.image= -Editor.SelectAll.description=Select All - -Editor.ShiftRight.label=Sh&ift Right@Ctrl+I -Editor.ShiftRight.tooltip=Shift Right -Editor.ShiftRight.image= -Editor.ShiftRight.description=Shift the selected text to the right - -Editor.ShiftLeft.label=S&hift Left@Ctrl+Shift+I -Editor.ShiftLeft.tooltip=Shift Left -Editor.ShiftLeft.image= -Editor.ShiftLeft.description=Shift the selected text to the left - -Editor.FindReplace.label=Find/Replace...@Ctrl+F -Editor.FindReplace.tooltip=Find/Replace -Editor.FindReplace.image= -Editor.FindReplace.description=Find/Replace - -Editor.AddBookmark.label=Boo&kmark... -Editor.AddBookmark.tooltip=Bookmark -Editor.AddBookmark.image= -Editor.AddBookmark.description=Add Bookmark -Editor.AddBookmark.dialog.title=Add Bookmark -Editor.AddBookmark.dialog.message=Enter Bookmark name - -Editor.AddTask.label=&Task... -Editor.AddTask.tooltip=Task -Editor.AddTask.image= -Editor.AddTask.description=Add Task - -Editor.Save.label=Save@Ctrl+S -Editor.Save.tooltip=Save -Editor.Save.image= -Editor.Save.description=Save - -Editor.Revert.label=Re&vert -Editor.Revert.tooltip=Revert -Editor.Revert.image= -Editor.Revert.description=Revert - -Editor.GotoLine.label=&Go to Line...@Ctrl+L -Editor.GotoLine.tooltip=Go to a Line -Editor.GotoLine.image= -Editor.GotoLine.description=Go to a line -Editor.GotoLine.dialog.title=Go to Line -Editor.GotoLine.dialog.message=Enter line number: -Editor.GotoLine.dialog.invalid_input=Invalid line number -Editor.GotoLine.dialog.invalid_range=Line number out of range - -Editor.NextError.label= Go To Next Error -Editor.PreviousError.label=Go To Previous Error -Editor.NextError.tooltip= Jump to next error marker -Editor.PreviousError.tooltip=Jump to previous error marker - - -Editor.error.no_provider=Text editor does not have a document provider -Editor.error.save.title=Save Problems -Editor.error.save.message=Internal error: -Editor.error.revert.title=Problems While Reverting to Saved State -Editor.error.revert.message=Internal error: -Editor.error.no_input=Unable to read text editor input -Editor.error.invalid_input=Invalid text editor input - -CEditorPreferencePage.description= C Editor Preferences - -# ------- OpenIncludeDeclarationAction------------ - -OpenIncludeAction.label=&Open -OpenIncludeAction.tooltip=Open the Selected Include in the Editor -OpenIncludeAction.description=Open the selected include in the editor -OpenIncludeAction.dialog.title=Open Include -OpenIncludeAction.dialog.message=Select the file to open - -# ------- FileSearchAction --------------- -FileSearchAction.label=Workspace -FileSearchAction.tooltip=Performs a text based file search for element in workspace -FileSearchAction.description=Performs a text based file search for element in workspace - -# ------- FileSearchActionInWorkingSet --------------- -FileSearchActionInWorkingSet.label=Working Set... -FileSearchActionInWorkingSet.tooltip=Performs a text based file search for element in the selected working set -FileSearchActionInWorkingSet.description=Performs a text based file search for element in the selected working set - - -# ------- SearchDialogAction --------------- -SearchDialogAction.label=C/C++ Search... -SearchDialogAction.tooltip=Opens C/C++ Search Dialog -SearchDialogAction.description=Opens C/C++ Search Dialog - - -# ------- LexicalSortingAction------------ - -LexicalSortingAction.label=Sort -LexicalSortingAction.description=Sorts the elements in the outliner -LexicalSortingAction.tooltip=Sort -LexicalSortingAction.tooltip.on=Do Not Sort -LexicalSortingAction.tooltip.off=Sort - -# ------- ClearOutputAction------------ -ClearOutputAction.label=Clea&r Console -ClearOutputAction.tooltip=Clear Console - -# ------- New menu items to overwrite superclass ---------- -CreateFileAction.text = &File -CreateFolderAction.text = F&older - -# ------- Drag and Drop Message Text ----------- -CViewDragNDrop.txt = already exists. Would you like to overwrite it? diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CStatusConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CStatusConstants.java deleted file mode 100644 index f333bb96704..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CStatusConstants.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Defines status codes relevant to the C UI plug-in. When a - * Core exception is thrown, it contain a status object describing - * the cause of the exception. The status objects originating from the - * C UI plug-in use the codes defined in this interface. - */ -public class CStatusConstants { - - // Prevent instantiation - private CStatusConstants() { - } - - /** Status code describing an internal error */ - public static final int INTERNAL_ERROR= 1; - - /** - * Status constant indicating that an exception occured on - * storing or loading templates. - */ - public static final int TEMPLATE_IO_EXCEPTION = 2; - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIException.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIException.java deleted file mode 100644 index 0c2462b1a26..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIException.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; - -/** - * An exception to wrap a status. This is necessary to use the core's IRunnableWithProgress - * support - */ - -public class CUIException extends CoreException { - - public CUIException(IStatus status) { - super(status); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.java deleted file mode 100644 index e2342b05d81..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class CUIMessages { - - private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.CUIMessages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private CUIMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - public static String getFormattedString(String key, String arg) { - return getFormattedString(key, new String[] { arg }); - } - - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(getString(key), args); - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties deleted file mode 100644 index 998d356f7ef..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIMessages.properties +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################### -# Copyright (c) 2002,2003 Rational Software Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v0.5 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v05.html -# -# Contributors: -# Rational Software - Initial API and implementation -############################################################################### - -Drag.move.problem.title=Drag and Drop Problem -Drag.move.problem.message={0} is read only. Do you still wish to delete it? -ExceptionDialog.seeErrorLogMessage=See error log for more details. - -################ -# Content Assist -################ -CEditor.contentassist.noCompletions=No completions available. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIStatus.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIStatus.java deleted file mode 100644 index 925ba70b115..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CUIStatus.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.ui.*; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Convenience class for error exceptions thrown inside JavaUI plugin. - */ -public class CUIStatus extends Status { - - public CUIStatus(int code, String message, Throwable throwable) { - super(IStatus.ERROR, CUIPlugin.getPluginId(), code, message, throwable); - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CWorkbenchAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CWorkbenchAdapter.java deleted file mode 100644 index 54f588df243..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CWorkbenchAdapter.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.model.IWorkbenchAdapter; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.ui.CElementLabelProvider; - -/** - * An imlementation of the IWorkbenchAdapter for CElements. - */ -public class CWorkbenchAdapter implements IWorkbenchAdapter { - - private static final Object[] fgEmptyArray = new Object[0]; - private CElementImageProvider fImageProvider; - private CElementLabelProvider fLabelProvider; - - public CWorkbenchAdapter() { - fImageProvider = new CElementImageProvider(); - fLabelProvider = new CElementLabelProvider(); - } - - /** - * @see IWorkbenchAdapter#getChildren - */ - public Object[] getChildren(Object o) { - if (o instanceof IParent) { - Object[] members = ((IParent) o).getChildren(); - if (members != null) { - return members; - } - } - return fgEmptyArray; - } - - /** - * @see IWorkbenchAdapter#getImageDescriptor - */ - public ImageDescriptor getImageDescriptor(Object element) { - if (element instanceof ICElement) { - return fImageProvider.getCImageDescriptor( - (ICElement) element, - CElementImageProvider.OVERLAY_ICONS | CElementImageProvider.SMALL_ICONS); - } - return null; - } - - /** - * @see IWorkbenchAdapter#getLabel - */ - public String getLabel(Object o) { - if (o instanceof ICElement) { - return fLabelProvider.getText((ICElement) o); - } - return null; - } - - /** - * @see IWorkbenchAdapter#getParent - */ - public Object getParent(Object o) { - if (o instanceof ICElement) { - return ((ICElement) o).getParent(); - } - return null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ConsoleEvent.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ConsoleEvent.java deleted file mode 100644 index 14ab2d7b580..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ConsoleEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */package org.eclipse.cdt.internal.ui; - -import java.util.EventObject; - -import org.eclipse.cdt.ui.IBuildConsoleEvent; -import org.eclipse.core.resources.IProject; - -public class ConsoleEvent extends EventObject implements IBuildConsoleEvent { - private IProject fProject; - private int fType; - - public ConsoleEvent(Object source, IProject project, int type) { - super(source); - fProject = project; - fType = type; - } - - public IProject getProject() { - return fProject; - } - - public int getType() { - return fType; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/DocumentInputStream.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/DocumentInputStream.java deleted file mode 100644 index 14f4535d216..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/DocumentInputStream.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; - /** - * Input stream which reads from a document - */ -public class DocumentInputStream extends InputStream { - - private IDocument fDocument; - private int fCurrPos; - - public DocumentInputStream(IDocument document) { - fDocument= document; - fCurrPos= 0; - } - - public IDocument getDocument() { - return fDocument; - } - - /** - * @see InputStream#read - */ - public int read() throws IOException { - try { - if (fCurrPos < fDocument.getLength()) { - return fDocument.getChar(fCurrPos++); - } - } catch (BadLocationException e) { - } - return -1; - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java deleted file mode 100644 index 82245afa976..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ErrorTickAdornmentProvider.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModelMarker; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.Annotation; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.ui.texteditor.MarkerAnnotation; -import org.eclipse.ui.texteditor.MarkerUtilities; - -public class ErrorTickAdornmentProvider implements IAdornmentProvider { - - private static final int ERRORTICK_WARNING= CElementImageProvider.OVERLAY_WARNING; - private static final int ERRORTICK_ERROR= CElementImageProvider.OVERLAY_ERROR; - - /* - * @see IAdornmentProvider#computeAdornmentFlags(Object, int) - */ - public int computeAdornmentFlags(Object obj) { - try { - if (obj instanceof ICElement) { - ICElement element= (ICElement) obj; - if (!element.exists()) { - // @@@ Not relevant right now... - //return 0; - } - - int type= element.getElementType(); - switch (type) { - case ICElement.C_PROJECT: - case ICElement.C_CCONTAINER: - return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_INFINITE, null); - case ICElement.C_UNIT: - return getErrorTicksFromMarkers(element.getResource(), IResource.DEPTH_ONE, null); - case ICElement.C_FUNCTION: - case ICElement.C_CLASS: - case ICElement.C_UNION: - case ICElement.C_STRUCT: - case ICElement.C_VARIABLE: - case ICElement.C_METHOD: - ITranslationUnit tu= (ITranslationUnit) ((ISourceReference)element).getTranslationUnit(); - if (tu != null && tu.exists()) { - // I assume that only source elements in compilation unit can have markers - ISourceRange range= ((ISourceReference)element).getSourceRange(); - return getErrorTicksFromMarkers(tu.getResource(), IResource.DEPTH_ONE, range); - } - default: - } - } else if (obj instanceof IResource) { - return getErrorTicksFromMarkers((IResource) obj, IResource.DEPTH_INFINITE, null); - } - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - } - return 0; - } - - /* - * @see IAdornmentProvider#dispose() - */ - public void dispose() { - } - - private int getErrorTicksFromMarkers(IResource res, int depth, ISourceRange range) throws CoreException { - // Trying to call findMarkers() on non existing resources will throw an exception - // findMarkers() --> CoreException - if this method fails. - // Reasons include: - // This resource does not exist. - // This resource is a project that is not open. - if (res == null || !res.exists()) { // for elements in archives - return 0; - } - int info= 0; - - IMarker[] markers= res.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, depth); - if (markers != null) { - for (int i= 0; i < markers.length && (info != ERRORTICK_ERROR); i++) { - IMarker curr= markers[i]; - if (range == null || isMarkerInRange(curr, range)) { - int priority= curr.getAttribute(IMarker.SEVERITY, -1); - if (priority == IMarker.SEVERITY_WARNING) { - info= ERRORTICK_WARNING; - } else if (priority == IMarker.SEVERITY_ERROR) { - info= ERRORTICK_ERROR; - } - } - } - } - return info; - } - - private boolean isMarkerInRange(IMarker marker, ISourceRange range) throws CoreException { - if (marker.isSubtypeOf(IMarker.TEXT)) { - int pos= marker.getAttribute(IMarker.CHAR_START, -1); - int offset= range.getStartPos(); - if(pos == -1) { - int line= MarkerUtilities.getLineNumber(marker); - if (line >= 0) { - return (line >= range.getStartLine() && line <= range.getEndLine()); - } - - } - return (offset <= pos && offset + range.getLength() > pos); - } - return false; - } - - - private IMarker isAnnotationInRange(IAnnotationModel model, Annotation annot, ISourceRange range) throws CoreException { - if (annot instanceof MarkerAnnotation) { - IMarker marker= ((MarkerAnnotation)annot).getMarker(); - if (marker.exists() && marker.isSubtypeOf(ICModelMarker.C_MODEL_PROBLEM_MARKER)) { - Position pos= model.getPosition(annot); - if (pos.overlapsWith(range.getStartPos(), range.getLength())) { - return marker; - } - } - } - - return null; - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IAdornmentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IAdornmentProvider.java deleted file mode 100644 index 782e77836f6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IAdornmentProvider.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * @since 1.0 - */ -public interface IAdornmentProvider { - - /** - * Computes the adornment flags for the given element. - * Flags defined in JavaElementImageProvider. - */ - int computeAdornmentFlags(Object element); - - - /** - * Called when the parent label provider is disposed - */ - void dispose(); - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICElementPropertyConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICElementPropertyConstants.java deleted file mode 100644 index 093bd15e59a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICElementPropertyConstants.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/** - * This interface documents the property constants used by the ICElement - * property source. - */ - -public interface ICElementPropertyConstants { - /** - * The ICElement property key for elf cpu. - */ - public static final String P_ELF_CPU = "elf_cpu"; - - /** - * The ICElement property key for elf text. - */ - public static final String P_ELF_TEXT = "text"; - - /** - * The ICElement property key for elf data. - */ - public static final String P_ELF_DATA = "data"; - - /** - * The ICElement property key for elf bss. - */ - public static final String P_ELF_BSS = "bss"; - - /** - * The ICElement property key for elf bss. - */ - public static final String P_ELF_HAS_DEBUG = "debug"; - - /** - * The ICElement property key for elf soname. - */ - public static final String P_ELF_SONAME = "soname"; - - /** - * The ICElement property key for elf type. - */ - public static final String P_ELF_TYPE = "type"; - - /** - * The ICElement property key for elf type. - */ - public static final String P_ELF_NEEDED = "needed"; - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java deleted file mode 100644 index 1a8cb51ce10..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ICHelpContextIds.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -import org.eclipse.cdt.ui.CUIPlugin; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Help context ids for the c ui. - *

            - * This interface contains constants only; it is not intended to be implemented - * or extended. - *

            - * - */ -public interface ICHelpContextIds { - public static final String PREFIX= CUIPlugin.PLUGIN_ID + "."; - - // Wizard pages - public static final String NEW_CPROJECT_WIZARD_PAGE= PREFIX + "new_cproject_wizard_page_context"; - public static final String NEW_LAUNCH_WIZARD_PAGE= PREFIX + "new_launch_wizard_page_context"; - public static final String NEW_CLASS_WIZARD_PAGE= PREFIX + "new_class_wizard_page_context"; - public static final String OPEN_CLASS_WIZARD_ACTION= PREFIX + "open_class_wizard_action"; - - // Actions - public static final String FILTER_PUBLIC_ACTION= PREFIX + "filter_public_action"; - public static final String FILTER_FIELDS_ACTION= PREFIX + "filter_fields_action"; - public static final String FILTER_STATIC_ACTION= PREFIX + "filter_static_action"; - - // Preference/property pages - public static final String C_PREF_PAGE= PREFIX + "new_c_pref_page_context"; - public static final String C_EDITOR_PREF_PAGE= PREFIX + "new_c_editor_pref_page_context"; - public static final String C_EDITOR_ANNOTATIONS_PREF_PAGE= PREFIX + "new_c_editor_annotations_pref_page_context"; - public static final String C_EDITOR_COLORS_PREF_PAGE= PREFIX + "new_c_editor_colors_pref_page_context"; - public static final String C_EDITOR_CONTENT_ASSIST_PREF_PAGE= PREFIX + "new_c_editor_content_assist_pref_page_context"; - public static final String TEMPLATE_PREFERENCE_PAGE= PREFIX + "new_c_templates_pref_page_context"; - public static final String LAUNCH_PROPERTY_PAGE= PREFIX + "new_launch_property_page_context"; - public static final String PROJECT_PROPERTY_PAGE= PREFIX + "new_project_property_page_context"; - - public static final String PROJ_CONF_BLOCK= PREFIX + "new_proj_conf_block_context"; - - public static final String TODO_TASK_INPUT_DIALOG= PREFIX + "todo_task_input_dialog_context"; //$NON-NLS-1$ - public static final String TODO_TASK_PROPERTY_PAGE= PREFIX + "tasktags_property_page_context"; //$NON-NLS-1$ - public static final String TODO_TASK_PREFERENCE_PAGE= PREFIX + "tasktags_preference_page_context"; //$NON-NLS-1$ - - public static final String BINARY_PARSER_PAGE= PREFIX + "cdt_binary_parser_page"; //$NON-NLS-1$ - public static final String ERROR_PARSERS_PAGE= PREFIX + "cdt_error_parsers_page"; //$NON-NLS-1$ - - // Console view - public static final String CLEAR_CONSOLE_ACTION= PREFIX + "clear_console_action_context"; - public static final String CLEAR_CONSOLE_VIEW= PREFIX + "clear_console_view_context"; - - public static final String TOGGLE_PRESENTATION_ACTION= PREFIX + "toggle_presentation_action_context"; //$NON-NLS-1$ - public static final String TOGGLE_TEXTHOVER_ACTION= PREFIX + "toggle_texthover_action_context"; //$NON-NLS-1$ - - public static final String COLLAPSE_ALL_ACTION= PREFIX + "collapse_all_action"; //$NON-NLS-1$ - - public static final String C_SEARCH_PAGE= PREFIX + "c_search_page"; //$NON-NLS-1$ -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IContextMenuConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IContextMenuConstants.java deleted file mode 100644 index 1651004a28b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/IContextMenuConstants.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.ui.IWorkbenchActionConstants; - -/** - * Constants for menu groups used in context menus for C views and editors. - *

            - * This interface declares constants only; it is not intended to be implemented. - *

            - */ -public interface IContextMenuConstants { - - - /** - * Pop-up menu: name of group for goto actions (value "group.open"). - *

            - * Examples for open actions are: - *

              - *
            • Go Into
            • - *
            • Go To
            • - *
            - *

            - */ - public static final String GROUP_GOTO= "group.goto"; //$NON-NLS-1$ - /** - * Pop-up menu: name of group for open actions (value "group.open"). - *

            - * Examples for open actions are: - *

              - *
            • Open To
            • - *
            • Open With
            • - *
            - *

            - */ - public static final String GROUP_OPEN= "group.open"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for show actions (value "group.show"). - *

            - * Examples for show actions are: - *

              - *
            • Show in Navigator
            • - *
            • Show in Type Hierarchy
            • - *
            - *

            - */ - public static final String GROUP_SHOW= "group.show"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for new actions (value "group.new"). - *

            - * Examples for new actions are: - *

              - *
            • Create new class
            • - *
            • Create new interface
            • - *
            - *

            - */ - public static final String GROUP_NEW= "group.new"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for build actions (value "group.build"). - */ - public static final String GROUP_BUILD= "group.build"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for reorganize actions (value "group.reorganize"). - */ - public static final String GROUP_REORGANIZE= IWorkbenchActionConstants.GROUP_REORGANIZE; - - /** - * Pop-up menu: name of group for code generation or refactoring actions ( - * value "group.generate"). - */ - public static final String GROUP_GENERATE= "group.generate"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for search actions (value "group.search"). - */ - public static final String GROUP_SEARCH= "group.search"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for additional actions (value "group.additions"). - */ - public static final String GROUP_ADDITIONS= "additions"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for viewer setup actions (value "group.viewerSetup"). - */ - public static final String GROUP_VIEWER_SETUP= "group.viewerSetup"; //$NON-NLS-1$ - - /** - * Pop-up menu: name of group for properties actions (value "group.properties"). - */ - public static final String GROUP_PROPERTIES= "group.properties"; //$NON-NLS-1$ -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ResourceAdapterFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ResourceAdapterFactory.java deleted file mode 100644 index d69bd81578e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/ResourceAdapterFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.IAdapterFactory; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.CoreModel; - -public class ResourceAdapterFactory implements IAdapterFactory { - - private static Class[] PROPERTIES= new Class[] { - ICElement.class - }; - - //private static CElementFactory celementFactory= new CElementFactory(); - private static CoreModel celementFactory= CoreModel.getDefault(); - - /** - * @see IAdapterFactory#getAdapterList - */ - public Class[] getAdapterList() { - return PROPERTIES; - } - - /** - * @see IAdapterFactory#getAdapter - */ - public Object getAdapter(Object element, Class key) { - if (ICElement.class.equals(key)) { - //try { - if (element instanceof IFile) { - return celementFactory.create((IFile)element); - } else if (element instanceof IFolder) { - return celementFactory.create((IFolder)element); - } else if (element instanceof IProject) { - return celementFactory.create((IProject)element); - } else if (element instanceof IWorkspaceRoot) { - return celementFactory.create((IWorkspaceRoot)element); - } else if (element instanceof IResource) { - return celementFactory.create((IResource)element); - } - //} catch (CoreException e) { - // CUIPlugin.getDefault().getLog().log(e.getStatus()); - //} - } - return null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/StandardCElementLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/StandardCElementLabelProvider.java deleted file mode 100644 index c756f0a8915..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/StandardCElementLabelProvider.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.eclipse.cdt.internal.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.ui.*; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * CElementLabelProvider that respects settings from the Appearance preference page. - * Triggers a viewer update when a preference changes. - */ -public class StandardCElementLabelProvider extends CElementLabelProvider implements IPropertyChangeListener { - - public final static int DEFAULT_TEXTFLAGS= 0; //CElementLabels.ROOT_VARIABLE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_APP_RETURNTYPE; - public final static int DEFAULT_IMAGEFLAGS= CElementImageProvider.OVERLAY_ICONS; - - private int fTextFlagMask; - private int fImageFlagMask; - - /** - * Constructor for StandardCElementLabelProvider. - * @see CElementLabelProvider#CElementLabelProvider - */ - public StandardCElementLabelProvider(int textFlags, int imageFlags, IAdornmentProvider[] adormentProviders) { - super(textFlags, imageFlags, adormentProviders); - initMasks(); - CUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); - } - - /** - * Creates a StandardCElementLabelProvider with DEFAULT_TEXTFLAGS, DEFAULT_IMAGEFLAGS - * and the ErrorTickAdornmentProvider. - */ - public StandardCElementLabelProvider() { - this(DEFAULT_TEXTFLAGS, DEFAULT_IMAGEFLAGS, new IAdornmentProvider[] { new ErrorTickAdornmentProvider() }); - } - - private void initMasks() { - fTextFlagMask= -1; - /* if (!AppearancePreferencePage.showMethodReturnType()) { - fTextFlagMask ^= JavaElementLabels.M_APP_RETURNTYPE; - } - if (!AppearancePreferencePage.isCompressingPkgNameInPackagesView()) { - fTextFlagMask ^= JavaElementLabels.P_COMPRESSED; - } */ - - fImageFlagMask= -1; - } - - /* - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent event) { - //String property= event.getProperty(); - /* if (property.equals(AppearancePreferencePage.PREF_METHOD_RETURNTYPE) - || property.equals(AppearancePreferencePage.PREF_OVERRIDE_INDICATOR) - || property.equals(AppearancePreferencePage.PREF_PKG_NAME_PATTERN_FOR_PKG_VIEW)) { - initMasks(); - LabelProviderChangedEvent lpEvent= new LabelProviderChangedEvent(this, null); // refresh all - fireLabelProviderChanged(lpEvent); - } */ - } - - /* - * @see IBaseLabelProvider#dispose() - */ - public void dispose() { - CUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); - super.dispose(); - } - - /* - * @see JavaUILabelProvider#getImageFlags() - */ - public int getImageFlags() { - return super.getImageFlags() & fImageFlagMask; - } - - /* - * @see JavaUILabelProvider#getTextFlags() - */ - public int getTextFlags() { - return super.getTextFlags() & fTextFlagMask; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java deleted file mode 100644 index c4d4c179a09..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.actions; - - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * Class that gives access to the action messages resource bundle. - */ -public class ActionMessages { - - private static final String BUNDLE_NAME= "org.eclipse.cdt.internal.ui.actions.ActionMessages"; //$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME); - - private ActionMessages() { - // no instance - } - - /** - * Returns the resource string associated with the given key in the resource bundle. If there isn't - * any value under the given key, the key is returned. - * - * @param key the resource key - * @return the string - */ - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - /** - * Returns the formatted resource string associated with the given key in the resource bundle. - * MessageFormat is used to format the message. If there isn't any value - * under the given key, the key is returned. - * - * @param key the resource key - * @param arg the message argument - * @return the string - */ - public static String getFormattedString(String key, Object arg) { - return getFormattedString(key, new Object[] { arg }); - } - - /** - * Returns the formatted resource string associated with the given key in the resource bundle. - * MessageFormat is used to format the message. If there isn't any value - * under the given key, the key is returned. - * - * @param key the resource key - * @param args the message arguments - * @return the string - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties deleted file mode 100644 index e3f3b5b4559..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties +++ /dev/null @@ -1,274 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -OpenWithMenu.label=Open Wit&h -RefactorMenu.label=Refac&tor -SourceMenu.label=&Source -NavigateMenu.label=&Navigate - -BuildAction.label=&Build Project -RebuildAction.label=Rebuild Pro&ject - -SelectionConverter.codeResolveOrInput_failed=Couldn't convert text selection into a Java element -SelectionConverter.codeResolve_failed=Couldn't convert text selection into a Java element - -OpenAction.label=&Open -OpenAction.tooltip=Open an editor on the selected element -OpenAction.description=Open an editor on the selected element -OpenAction.declaration.label=&Open Declaration -OpenAction.select_element=&Select or enter the element to open: - -OpenAction.error.title=Open -OpenAction.error.message=Cannot open default editor. -OpenAction.error.messageArgs=Cannot open default editor on {0}. {1} -OpenAction.error.messageProblems=Problems Opening Editor -OpenAction.error.messageBadSelection=Current text selection doesn't resolve to a Java element - -OpenSuperImplementationAction.label=Open S&uper Implementation -OpenSuperImplementationAction.tooltip=Open the Implementation in the Super Type -OpenSuperImplementationAction.description=Open the Implementation in the Super Type -OpenSuperImplementationAction.error.title=Open Super Implementation -OpenSuperImplementationAction.error.message=Opening failed. Check log for details. -OpenSuperImplementationAction.not_applicable=Operation not applicable to current text selection. Please position the cursor inside a method. -OpenSuperImplementationAction.no_super_implementation=Super implementation for method ''{0}'' does not exist. - -OpenTypeHierarchyAction.label=Open Type Hie&rarchy -OpenTypeHierarchyAction.tooltip=Open a type hierarchy on the selected element -OpenTypeHierarchyAction.description=Open a type hierarchy on the selected element -OpenTypeHierarchyAction.dialog.title=Open Type Hierarchy -OpenTypeHierarchyAction.messages.title=Can\'t create type hierarchy -OpenTypeHierarchyAction.messages.no_java_element=No Java element selected. -OpenTypeHierarchyAction.messages.no_java_resources=Selected package fragment doesn\'t contain any Java resource. -OpenTypeHierarchyAction.messages.no_types=Selected compilation unit doesn\'t contain a type. -OpenTypeHierarchyAction.messages.no_valid_java_element=No valid Java element selected. - -ShowInPackageViewAction.label=Show in Pac&kage Explorer -ShowInPackageViewAction.description=Show the selected element in Package Explorer -ShowInPackageViewAction.tooltip=Show in Package Explorer -ShowInPackageViewAction.select_name=&Select or enter the element to reveal: -ShowInPackageViewAction.dialog.title=Show In Package Explorer -ShowInPackageViewAction.error.message=Internal error. Please see log for details. -ShowInPackageViewAction.not_found=Cannot reveal the selected element in Package Explorer. The element may be filtered out. - -ShowInNavigatorView.label=Show in &Navigator View -ShowInNavigatorView.dialog.title=Show in Navigator View -ShowInNavigatorView.dialog.message=Select the element to be opened in the navigator view: -ShowInNavigatorView.error.activation_failed=Unable to activate Resource Navigator -ShowInNavigatorView.error.conversion_failed=Unable to convert Java element into a resource - -OverrideMethodsAction.label=O&verride/Implement Methods... -OverrideMethodsAction.description=Override or Implement Methods from super types. -OverrideMethodsAction.tooltip=Override/Implement Methods - -OverrideMethodsAction.error.title=Override/Implement Methods -OverrideMethodsAction.error.nothing_found=No methods to override found for this type. -OverrideMethodsAction.error.type_removed_in_editor=Input type has been removed in editor. -OverrideMethodsAction.not_applicable=Operation not applicable to current text selection. Please position the cursor inside a type. - -AddGetterSetterAction.label=Gene&rate Getter and Setter... -AddGetterSetterAction.description=Generate Getter and Setter methods for type's fields -AddGetterSetterAction.tooltip=Generate Getter and Setter methods for the Type's Fields - -AddGetterSetterAction.error.title=Generate Getter and Setter -AddGetterSetterAction.error.actionfailed=Generating Getter and Setter Failed. -AddGetterSetterAction.error.fieldNotExisting=The field ''{0}'' has been removed in the editor. -AddGetterSetterAction.not_applicable=Operation not applicable to current text selection. A field has to be selected or a type that declares fields. -AddGetterSetterAction.read_only=The compilation unit in which the field ''{0}'' is declared is read only. - -AddGetterSetterAction.QueryDialog.title=Generate Getter and Setter -AddGetterSetterAction.SkipSetterForFinalDialog.message=Field ''{0}'' is final.\nOK to skip creation of the setter method? -AddGetterSetterAction.SkipExistingDialog.message=Method ''{0}'' already exists.\nSkip creation? -AddGetterSetterAction.SkipExistingDialog.skip.label=&Skip -AddGetterSetterAction.SkipExistingDialog.replace.label=&Replace -AddGetterSetterAction.SkipExistingDialog.skipAll.label=Skip &All - -AddGetterSetterAction.dialog.title=&Select getters and setters to create: -AddGetterSetterAction.one_selected=1 method selected. -AddGetterSetterAction.methods_selected={0} methods selected. -AddGettSetterAction.typeContainsNoFields.message=The type contains no fields or all fields have getters/setters already. - - -AddUnimplementedConstructorsAction.label=Add &Constructors from Superclass -AddUnimplementedConstructorsAction.description=Evaluate and add constructors from superclass -AddUnimplementedConstructorsAction.tooltip=Add Constructors from Superclass - -AddUnimplementedConstructorsAction.error.title=Add Constructors from Superclass -AddUnimplementedConstructorsAction.error.nothing_found=No unimplemented constructors found. -AddUnimplementedConstructorsAction.error.type_removed_in_editor=Input type has been removed in editor. -AddUnimplementedConstructorsAction.not_applicable=Operation not applicable to current text selection. Please position the cursor inside a type. - -AddJavaDocStubAction.label=Add &Javadoc Comment -AddJavaDocStubAction.description=Add a Javadoc comment stub to the member element -AddJavaDocStubAction.tooltip=Add a Javadoc comment stub to the member element - -AddJavaDocStubsAction.error.dialogTitle=Add Javadoc Comment -AddJavaDocStubsAction.error.noWorkingCopy=Could not find working copy. -AddJavaDocStubsAction.error.memberNotExisting=Member has been removed in editor. -AddJavaDocStubsAction.error.actionFailed=Error while adding Javadoc comment -AddJavaDocStubsAction.not_applicable=Operation not applicable to current text selection. Please position the cursor inside a type or method. - -ExternalizeStringsAction.label= &Externalize Strings... -ExternalizeStringsAction.dialog.title= Externalize Strings -ExternalizeStringsAction.dialog.message=Couldn't open Externalize String Wizard - -FindStringsToExternalizeAction.label= &Find Strings to Externalize... -FindStringsToExternalizeAction.dialog.title= Find Strings to Externalize -FindStringsToExternalizeAction.error.message=Unexpected Exception. See log. -FindStringsToExternalizeAction.foundStrings= {0} in {1} -FindStringsToExternalizeAction.noStrings= No strings to externalize were found. -FindStringsToExternalizeAction.not_externalized= {0} ¬ externalized string(s) found. -FindStringsToExternalizeAction.button.label= &Externalize... -FindStringsToExternalizeAction.find_strings=Finding not externalized strings... - -OpenExternalJavadocAction.label=Open E&xternal Javadoc -OpenExternalJavadocAction.description=Opens the Javadoc of the selected element in an external browser -OpenExternalJavadocAction.tooltip=Opens the Javadoc of the selected element in an external browser -OpenExternalJavadocAction.help_not_available=Help support not available -OpenExternalJavadocAction.select_element=&Select or enter the element to open: -OpenExternalJavadocAction.libraries.no_location=The documentation location for ''{0}'' has not been configured. For elements from libraries specify the Javadoc location URL on the property page of the parent JAR (''{1}'') -OpenExternalJavadocAction.source.no_location=The documentation location for ''{0}'' has not been configured. For elements from source specify the Javadoc location URL on the property page of the parent project (''{1}'') -OpenExternalJavadocAction.no_entry=The documentation does not contain an entry for ''{0}''.\n(File ''{1}'' does not exist.) -OpenExternalJavadocAction.opening_failed=Opening Javadoc failed. See log for details -OpenExternalJavadocAction.dialog.title=Open External Javadoc -OpenExternalJavadocAction.code_resolve_failed=Couldn't convert text selection into a Java element - -SelfEncapsulateFieldAction.label=Encap&sulate Field... -SelfEncapsulateFieldAction.dialog.title=Encapsulate Field -SelfEncapsulateFieldAction.dialog.unavailable=Operation unavailable on the current selection. Select a field. -SelfEncapsulateFieldAction.dialog.cannot_perform=Cannot perform refactoring. See log for more details. -SelfEncapsulateFieldAction.dialog.field_doesnot_exit=Editor buffer does not contain field {0}. - -OrganizeImportsAction.label=Or&ganize Imports -OrganizeImportsAction.tooltip=Evaluate All Required Imports and Replace the Current Imports -OrganizeImportsAction.description=Evaluate all required imports and replace the current imports - -OrganizeImportsAction.multi.op.description=Organizing imports... -OrganizeImportsAction.multi.error.parse={0}: Compilation unit has parse errors. No changes applied. -OrganizeImportsAction.multi.error.readonly={0}: Compilation unit is read-only. No changes applied. -OrganizeImportsAction.multi.error.unresolvable={0}: Compilation unit contains ambiguous references. User interaction required. -OrganizeImportsAction.multi.error.unexpected={0}: Unexpected error. See log for details. -OrganizeImportsAction.multi.error.notoncp={0}: Compilation unit not on build path. No changes applied. - -OrganizeImportsAction.selectiondialog.title=Organize Imports -OrganizeImportsAction.selectiondialog.message=&Choose type to import: - -OrganizeImportsAction.error.title=Organize Imports -OrganizeImportsAction.error.message=Unexpected error in organize imports. See log for details. - -OrganizeImportsAction.single.error.parse=Compilation unit has parse errors: ''{0}''. No changes applied. - -OrganizeImportsAction.summary_added={0} import(s) added. -OrganizeImportsAction.summary_removed={0} import(s) removed. - -OrganizeImportsAction.multi.status.title=Organize Imports -OrganizeImportsAction.multi.status.description=Problems while organizing imports on some compilation units. See 'Details' for more information. - -SortMembersAction.label=Sort &Members -SortMembersAction.tooltip=Sorts all Members using the Member Order Preference -SortMembersAction.description=Sorts all members using the member order preference - -SortMembersAction.error.title=Sort Members -SortMembersAction.not_applicable=Operation not applicable to current text editor. -SortMembersAction.containsmarkers=Markers like bookmarks, breakpoints or user defined tasks in a reordered member will be lost. Ok to continue? - -OpenBrowserUtil.help_not_available=Help support not available - -MemberFilterActionGroup.hide_fields.label=Hide Fiel&ds -MemberFilterActionGroup.hide_fields.tooltip=Hide Fields -MemberFilterActionGroup.hide_fields.description=Toggles the visibility of fields - -MemberFilterActionGroup.hide_static.label=Hide &Static Members -MemberFilterActionGroup.hide_static.tooltip=Hide Static Members -MemberFilterActionGroup.hide_static.description=Toggles the visibility of static members - -MemberFilterActionGroup.hide_nonpublic.label=Hide Non-&Public Members -MemberFilterActionGroup.hide_nonpublic.tooltip=Hide Non-Public Members -MemberFilterActionGroup.hide_nonpublic.description=Toggles the visibility of non-public members - -NewWizardsActionGroup.new=Ne&w - -OpenProjectAction.dialog.title=Open Project -OpenProjectAction.dialog.message=Select project(s) to be opened -OpenProjectAction.error.message=Problems while opening projects -OpenProjectAction.no_java_nature.one=The following project doesn't have a Java nature and is therefore not present in the Package Explorer: -OpenProjectAction.no_java_nature.multiple=The following projects don't have a Java nature and are therefore not present in the Package Explorer: - - -OpenJavaPerspectiveAction.dialog.title=Open Java Perspective -OpenJavaPerspectiveAction.error.open_failed=Couldn\'t open Java perspective - -OpenJavaBrowsingPerspectiveAction.dialog.title=Open Java Browsing Perspective -OpenJavaBrowsingPerspectiveAction.error.open_failed=Couldn\'t open Java browsing perspective - -OpenTypeInHierarchyAction.label=Open Type in Hierarchy... -OpenTypeInHierarchyAction.description=Open a type in a type hierarchy - -OpenTypeInHierarchyAction.tooltip=Open a type in a type hierarchy -OpenTypeInHierarchyAction.dialogMessage=&Choose a type (? = any character, * = any string): -OpenTypeInHierarchyAction.dialogTitle=Open Type in Hierarchy - -RefreshAction.label= Re&fresh -RefreshAction.toolTip= Refresh -RefreshAction.progressMessage= Refreshing... -RefreshAction.error.title= Refresh Problems -RefreshAction.error.message= Problems occurred refreshing the selected resources. -RefreshAction.locationDeleted.title= Project location has been deleted -RefreshAction.locationDeleted.message= The location for project {0} ({1}) has been deleted.\n Delete {0} from the workspace? - -ModifyParameterAction.problem.title=Refactoring -ModifyParameterAction.problem.message=Operation not possible. - -PullUpAction.problem.title=Refactoring -PullUpAction.problem.message=Operation not possible. - -OverrideMethodQuery.groupMethodsByTypes=Group methods by &types -OverrideMethodQuery.dialog.title=Override/Implement Methods -OverrideMethodQuery.dialog.description=&Select methods to override or implement: -OverrideMethodQuery.selectioninfo.one={0} method selected. -OverrideMethodQuery.selectioninfo.more={0} methods selected. - -ActionUtil.notOnBuildPath.title=Operation Cannot be Performed -ActionUtil.notOnBuildPath.message=The resource is not on the build path of a Java project. -ActionUtil.not_possible=Operation Not Possible -ActionUtil.no_linked=This operation is unavailable on linked packages and package fragment roots. - -SelectAllAction.label= Select A&ll -SelectAllAction.tooltip= Select All - -AddToClasspathAction.label=Add to &Build Path -AddToClasspathAction.toolTip=Add JAR to the Java build path -AddToClasspathAction.progressMessage=Adding to build path... -AddToClasspathAction.error.title=Add to Build Path -AddToClasspathAction.error.message=Problems occurred while adding to the build path. - -RemoveFromClasspathAction.Remove=Remove from &Build Path -RemoveFromClasspathAction.tooltip=Remove package fragment root from the Java build path -RemoveFromClasspathAction.Removing=Removing from build path... -RemoveFromClasspathAction.exception_dialog_title=Remove From Build Path -RemoveFromClasspathAction.Problems_occurred=Problems occurred while removing from the build path. - -AddDelegateMethodsAction.error.title=Generate Delegate Methods -AddDelegateMethodsAction.error.actionfailed=Generating delegate methods failed. - -AddDelegateMethodsAction.label=Generate Delegate &Methods... -AddDelegateMethodsAction.description=Adds delegate methods for a type's fields -AddDelegateMethodsAction.tooltip=Adds Delegates Methods for a Type's Fields - -AddDelegateMethodsAction.not_applicable=Operation not applicable to current text selection. Please select a field or a type that declares some fields. - -AddDelegateMethodsAction.duplicate_methods=Duplicate method(s) selected - -AddDelegateMethodsAction.title=Delegate Methods Generation -AddDelegateMethodsAction.message=Select &methods to create delegates for: - -AddDelegateMethodsAction.monitor.message=Creating {0} methods... -AddDelegateMethodsAction.selectioninfo.one={0} method selected. -AddDelegateMethodsAction.selectioninfo.more={0} methods selected. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/WorkbenchRunnableAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/WorkbenchRunnableAdapter.java deleted file mode 100644 index 2b9b4e7b3d9..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/WorkbenchRunnableAdapter.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.actions; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; - -import org.eclipse.jface.operation.IRunnableWithProgress; - -import org.eclipse.cdt.core.model.CoreModel; - -/** - * An IRunnableWithProgress that adapts and IWorkspaceRunnable - * so that is can be executed inside IRunnableContext. OperationCanceledException - * thrown by the apapted runnabled are cought and rethrown as a InterruptedException. - */ - -public class WorkbenchRunnableAdapter implements IRunnableWithProgress { - - private IWorkspaceRunnable fWorkspaceRunnable; - - public WorkbenchRunnableAdapter(IWorkspaceRunnable runnable) { - fWorkspaceRunnable= runnable; - } - - /* - * @see IRunnableWithProgress#run(IProgressMonitor) - */ - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - try { - CoreModel.run(fWorkspaceRunnable, monitor); - } catch (OperationCanceledException e) { - throw new InterruptedException(e.getMessage()); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleAction.java deleted file mode 100644 index fa792acda60..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleAction.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.cdt.internal.ui.buildconsole; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.util.ResourceBundle; - - -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.TextViewer; - - -import org.eclipse.ui.texteditor.TextEditorAction; - - -public class BuildConsoleAction extends TextEditorAction { - - - private int fOperationCode= -1; - private ITextOperationTarget fOperationTarget; - - - public BuildConsoleAction(ResourceBundle bundle, String prefix, TextViewer viewer, int operationCode) { - super(bundle, prefix, null); - fOperationCode= operationCode; - fOperationTarget= viewer.getTextOperationTarget(); - update(); - } - /** - * @see Action - */ - public void run() { - if (fOperationCode != -1 && fOperationTarget != null) { - fOperationTarget.doOperation(fOperationCode); - } - } - /** - * @see TextEditorAction - */ - public void update() { - - boolean wasEnabled= isEnabled(); - boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); - - if (wasEnabled != isEnabled) { - setEnabled(isEnabled); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleView.java deleted file mode 100644 index 8966f84f2f6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleView.java +++ /dev/null @@ -1,313 +0,0 @@ -package org.eclipse.cdt.internal.ui.buildconsole; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ResourceBundle; - -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IBuildConsoleEvent; -import org.eclipse.cdt.ui.IBuildConsoleListener; -import org.eclipse.cdt.ui.IBuildConsoleManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextListener; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.TextEvent; -import org.eclipse.jface.text.TextViewer; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.ui.texteditor.TextEditorAction; - -/** - -/** - * Console view for the desktop. Registered using XML. - */ -public class BuildConsoleView extends ViewPart implements ISelectionListener, IBuildConsoleListener { - private IProject selProject; - private Font fFont; - private IPropertyChangeListener fPropertyChangeListener; - protected TextViewer fTextViewer; - IBuildConsoleManager fConsoleManager; - ClearConsoleAction fClearOutputAction; - TextEditorAction fCopyAction; - TextEditorAction fSelectAllAction; - String origTitle; - - public BuildConsoleView() { - super(); - fFont = null; - fPropertyChangeListener = new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - if (fTextViewer != null && event.getProperty().equals(BuildConsolePreferencePage.PREF_CONSOLE_FONT)) { - initializeWidgetFont(fTextViewer.getTextWidget()); - } - } - }; - IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); - store.addPropertyChangeListener(fPropertyChangeListener); - fConsoleManager = CUIPlugin.getDefault().getConsoleManager(); - } - - private void initializeActions() { - ResourceBundle bundle = CUIPlugin.getResourceBundle(); - - IActionBars actionBars = getViewSite().getActionBars(); - fClearOutputAction = new ClearConsoleAction(this); - fCopyAction = new BuildConsoleAction(bundle, "Editor.Copy.", fTextViewer, ITextOperationTarget.COPY); - fSelectAllAction = new BuildConsoleAction(bundle, "Editor.SelectAll.", fTextViewer, ITextOperationTarget.SELECT_ALL); - - actionBars.setGlobalActionHandler(ITextEditorActionConstants.COPY, fCopyAction); - actionBars.setGlobalActionHandler(ITextEditorActionConstants.SELECT_ALL, fSelectAllAction); - - fTextViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - // ensures that the copyAction updates is doability when the selections tate changes - fCopyAction.update(); - } - }); - } - - /** - * @see ViewPart#createPartControl - */ - public void createPartControl(Composite parent) { - fTextViewer = new TextViewer(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.WRAP | SWT.MULTI); - fTextViewer.addTextListener(new ITextListener() { - public void textChanged(TextEvent event) { - revealEndOfDocument(); - } - }); - fTextViewer.setEditable(false); - origTitle = getTitle(); - initializeWidgetFont(fTextViewer.getTextWidget()); - - initializeActions(); - initializeContextMenu(fTextViewer.getControl()); - initializeToolBar(); - - WorkbenchHelp.setHelp(fTextViewer.getControl(), ICHelpContextIds.CLEAR_CONSOLE_VIEW); - - setProject(getSite().getPage().getSelection()); - setDocument(); - setTitle(); - getSite().getPage().addSelectionListener(this); - fConsoleManager.addConsoleListener(this); - } - - protected void setProject(ISelection selection) { - selProject = convertSelectionToProject(selection); - } - - protected void setProject(IProject project) { - selProject = project; - } - - protected IProject getProject() { - return selProject; - } - - protected IDocument setDocument() { - IProject project = getProject(); - if (project != null) { - fTextViewer.setDocument(fConsoleManager.getConsoleDocument(project)); - } - return null; - } - - protected void setTitle() { - String title = origTitle; - IProject project = getProject(); - if (project != null) { - title += " [" + project.getName() + "]"; - } - setTitle(title); - } - - protected void initializeWidgetFont(StyledText styledText) { - IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); - String prefKey = BuildConsolePreferencePage.PREF_CONSOLE_FONT; - FontData data = null; - if (store.contains(prefKey) && !store.isDefault(prefKey)) { - data = PreferenceConverter.getFontData(store, prefKey); - } else { - data = PreferenceConverter.getDefaultFontData(store, prefKey); - } - if (data != null) { - Font font = new Font(styledText.getDisplay(), data); - styledText.setFont(font); - - if (fFont != null) - fFont.dispose(); - - fFont = font; - } else { - // if all the preferences failed - styledText.setFont(JFaceResources.getTextFont()); - } - } - - /** - * @see IWorkbenchPart#setFocus() - */ - public void setFocus() { - fTextViewer.getControl().setFocus(); - } - - /** - * Initializes the context menu - */ - protected void initializeContextMenu(Control parent) { - MenuManager menuMgr = new MenuManager("#PopupMenu"); - menuMgr.setRemoveAllWhenShown(true); - menuMgr.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager manager) { - fillContextMenu(manager); - } - }); - Menu menu = menuMgr.createContextMenu(parent); - parent.setMenu(menu); - } - - /** - * Adds the text manipulation actions to the ConsoleViewer - */ - protected void fillContextMenu(IMenuManager menu) { - fCopyAction.update(); - menu.add(fCopyAction); - menu.add(fSelectAllAction); - menu.add(new Separator()); - menu.add(fClearOutputAction); - } - - /** - * Configures the toolBar. - */ - private void initializeToolBar() { - IActionBars actionBars = getViewSite().getActionBars(); - actionBars.getToolBarManager().add(fClearOutputAction); - actionBars.updateActionBars(); - } - /** - * Reveals (makes visible) the end of the current document - */ - protected void revealEndOfDocument() { - IDocument doc = fTextViewer.getDocument(); - int docLength = doc.getLength(); - if (docLength > 0) { - fTextViewer.revealRange(docLength - 1, 1); - StyledText widget = fTextViewer.getTextWidget(); - widget.setCaretOffset(docLength); - widget.showSelection(); - } - } - /** - * @see WorkbenchPart#dispose() - */ - public void dispose() { - super.dispose(); - if (fPropertyChangeListener != null) { - IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); - store.removePropertyChangeListener(fPropertyChangeListener); - fPropertyChangeListener = null; - } - if (fFont != null) { - fFont.dispose(); - fFont = null; - } - getSite().getPage().removeSelectionListener(this); - fConsoleManager.removeConsoleListener(this); - } - - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - IProject newProject = convertSelectionToProject(selection); - IProject oldProject = getProject(); - if (oldProject == null || (newProject != null && !newProject.equals(oldProject))) { - setProject(newProject); - setDocument(); - setTitle(); - } - } - - public void consoleChange(IBuildConsoleEvent event) { - if (event.getType() == IBuildConsoleEvent.CONSOLE_START || event.getType() == IBuildConsoleEvent.CONSOLE_CLOSE) { - Display display = fTextViewer.getControl().getDisplay(); - selProject = event.getProject(); - if (event.getType() == IBuildConsoleEvent.CONSOLE_CLOSE && selProject != event.getProject()) { - return; - } - display.asyncExec(new Runnable() { - public void run() { - setDocument(); - setTitle(); - } - }); - } - } - - IProject convertSelectionToProject(ISelection selection) { - IProject project = null; - if (selection == null || !(selection instanceof IStructuredSelection)) { - return project; - } - IStructuredSelection ssel = (IStructuredSelection) selection; - Object element = ssel.getFirstElement(); - if (element instanceof IAdaptable) { - IAdaptable input = (IAdaptable) element; - if (input != null) { - IResource resource = null; - if (input instanceof IResource) { - resource = (IResource) input; - } else { - resource = (IResource) input.getAdapter(IResource.class); - } - if (resource != null) { - project = resource.getProject(); - } - } - } - return project; - } - - /** - * Clears the console - */ - void clear() { - if (selProject != null) { - fConsoleManager.getConsole(selProject).clear(); - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ClearConsoleAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ClearConsoleAction.java deleted file mode 100644 index eb533fa7509..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/ClearConsoleAction.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.cdt.internal.ui.buildconsole; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.action.Action; - -import org.eclipse.ui.help.WorkbenchHelp; - - -/** - * Clears the output of the selected launches - */ -public class ClearConsoleAction extends Action { - - - private BuildConsoleView fConsoleView; - - - public ClearConsoleAction(BuildConsoleView view) { - super(CUIPlugin.getResourceString("ClearOutputAction.label")); - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_CLEAR_CONSOLE); - fConsoleView= view; - setToolTipText(CUIPlugin.getResourceString("ClearOutputAction.tooltip")); - WorkbenchHelp.setHelp(this, ICHelpContextIds.CLEAR_CONSOLE_ACTION); - } - - /** - * @see Action - */ - public void run() { - fConsoleView.clear(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/AddIncludeOperation.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/AddIncludeOperation.java deleted file mode 100644 index bc46fea7f6f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/AddIncludeOperation.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.eclipse.cdt.internal.ui.codemanipulation; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IInclude; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.internal.ui.CFileElementWorkingCopy; -import org.eclipse.cdt.internal.ui.editor.CContentOutlinePage; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.editor.CEditorMessages; -import org.eclipse.cdt.ui.IRequiredInclude; -import java.util.ArrayList; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.texteditor.ITextEditor; - - -/** - * Add includes to a translation unit. - * The input is an array of full qualified type names. No elimination of unnecessary - * includes is not done. Dublicates are eliminated. - * If the translation unit is open in an editor, be sure to pass over its working copy. - */ -public class AddIncludeOperation extends WorkspaceModifyOperation { - - private CFileElementWorkingCopy fTranslationUnit; - private IRequiredInclude[] fIncludes; - private boolean fDoSave; - private ITextEditor fEditor; - - private IInclude[] fAddedIncludes; - - /** - * Generate import statements for the passed java elements - * Elements must be of type IType (-> single import) or IPackageFragment - * (on-demand-import). Other JavaElements are ignored - */ - public AddIncludeOperation(ITextEditor ed, CFileElementWorkingCopy tu, IRequiredInclude[] includes, boolean save) { - super(); - fEditor = ed; - fIncludes= includes; - fTranslationUnit= tu; - fAddedIncludes= null; - fDoSave= save; - } - - public void execute(IProgressMonitor monitor) throws CoreException { - try { - ArrayList toAdd = new ArrayList(); - - if (monitor == null) { - monitor= new NullProgressMonitor(); - } - - monitor.beginTask(CEditorMessages.getString("AddIncludesOperation.description"), 2); //$NON-NLS-1$ - - ICElement root; - // Look in content outline - if(fEditor instanceof CEditor) { - CContentOutlinePage outline = ((CEditor)fEditor).getOutlinePage(); - root = outline.getRoot(); - } else { - root = fTranslationUnit; - } - if (root != null && root instanceof IParent && ((IParent)root).hasChildren()) { - //// Get children of tu - // Build list of include statement - //fTranslationUnit.update(); - //if(fTranslationUnit.hasChildren()) { - ICElement lastInclude = null; - ICElement[] elements = ((IParent)root).getChildren(); - - for(int j = 0; j < fIncludes.length; j++) { - //System.out.println("Comparing to " + fIncludes[j].getIncludeName()); - toAdd.add(fIncludes[j]); - } - - for(int i = 0; i < elements.length; i++) { - if(elements[i].getElementType() == ICElement.C_INCLUDE) { - lastInclude = elements[i]; - //System.out.println("Element " + elements[i].getElementName() + "sys " + ((IInclude)elements[i]).isStandard()); - for(int j = 0; j < toAdd.size(); j++) { - //System.out.println("Comparing to " + ((IRequiredInclude)toAdd.get(j)).getIncludeName()); - if(elements[i].getElementName().equals(((IRequiredInclude)toAdd.get(j)).getIncludeName())) { - toAdd.remove(j); - } - } - } - } - - if(toAdd.size() > 0) { - // So we have our list. Now insert. - StringBuffer insert = new StringBuffer(""); - for(int j = 0; j < toAdd.size(); j++) { - insert.append("#include <" + ((IRequiredInclude)toAdd.get(j)).getIncludeName() + ">\n"); - } - int pos; - - if(lastInclude != null) { - ISourceRange range = ((IInclude)lastInclude).getSourceRange(); - pos = range.getStartPos() + range.getLength(); - } else { - pos = 0; - } - - IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); - try { - // Now find the next newline and insert after that - if(pos > 0) { - while(document.getChar(pos) != '\n') pos++; - if(document.getChar(pos) == '\r') pos++; - pos++; - } - document.replace(pos, 0, insert.toString()); - } catch (BadLocationException e) {} - } - - } - - - /*for (int i= 0; i < nImports; i++) { - IJavaElement imp= fIncludes[i]; - if (imp instanceof IType) { - IType type= (IType)imp; - String packageName= type.getPackageFragment().getElementName(); - impStructure.addImport(packageName, type.getElementName()); - } else if (imp instanceof IPackageFragment) { - String packageName= ((IPackageFragment)imp).getElementName(); - impStructure.addImport(packageName, "*"); //$NON-NLS-1$ - } - } */ - monitor.worked(1); - //fAddedImports= impStructure.create(fDoSave, null); - monitor.worked(1); - } finally { - monitor.done(); - } - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/StubUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/StubUtility.java deleted file mode 100644 index 52497dcce96..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/codemanipulation/StubUtility.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.codemanipulation; - -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.runtime.CoreException; - -public class StubUtility { - - /** - * @see org.eclipse.jdt.ui.CodeGeneration#getTypeComment(ICompilationUnit, String, String) - */ - public static String getHeaderFileContent(ITranslationUnit cu, String typeComment, String typeContent, String lineDelimiter) throws CoreException { - return ""; - } - /** - * @see org.eclipse.jdt.ui.CodeGeneration#getTypeComment(ICompilationUnit, String, String) - */ - public static String getBodyFileContent(ITranslationUnit cu, String typeComment, String typeContent, String lineDelimiter) throws CoreException { - return ""; - } - /* - * @see org.eclipse.jdt.ui.CodeGeneration#getTypeComment(ICompilationUnit, String, String) - */ - public static String getClassComment(ITranslationUnit cu, String typeQualifiedName, String lineDelim) throws CoreException { - return ""; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CContentViewerCreator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CContentViewerCreator.java deleted file mode 100644 index bcaa258415f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CContentViewerCreator.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.internal.ui.compare; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; - - -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.IViewerCreator; - - -import org.eclipse.jface.viewers.Viewer; - - -/** - * Required when creating a CMergeViewer from the plugin.xml file. - */ -public class CContentViewerCreator implements IViewerCreator { - - public Viewer createViewer(Composite parent, CompareConfiguration mp) { - return new CMergeViewer(parent, SWT.NULL, mp); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CMergeViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CMergeViewer.java deleted file mode 100644 index 9e052265eb7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CMergeViewer.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.cdt.internal.ui.compare; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.ui.CUIPlugin; - - -import org.eclipse.swt.widgets.Composite; - -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.contentmergeviewer.ITokenComparator; -import org.eclipse.compare.contentmergeviewer.TextMergeViewer; -import org.eclipse.compare.internal.TokenComparator; - - -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.TextViewer; -import org.eclipse.jface.text.source.SourceViewer; - -public class CMergeViewer extends TextMergeViewer { - - private static final String TITLE= "CMergeViewer.title"; - - - public CMergeViewer(Composite parent, int styles, CompareConfiguration mp) { - super(parent, styles, mp); - } - - public String getTitle() { - return CUIPlugin.getResourceString(TITLE); - } - - - protected ITokenComparator createTokenComparator(String s) { - return new TokenComparator(s); - } - - protected IDocumentPartitioner getDocumentPartitioner() { - return CUIPlugin.getDefault().getTextTools().createDocumentPartitioner(); - } - - protected void configureTextViewer(TextViewer textViewer) { - if (textViewer instanceof SourceViewer) { - CTextTools tools= CUIPlugin.getDefault().getTextTools(); - ((SourceViewer)textViewer).configure(new CSourceViewerConfiguration(tools, null)); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CNode.java deleted file mode 100644 index a3d523d5d68..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CNode.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.eclipse.cdt.internal.ui.compare; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.CElementImageProvider; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.compare.ITypedElement; -import org.eclipse.compare.structuremergeviewer.DocumentRangeNode; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.text.IDocument; -import org.eclipse.swt.graphics.Image; -/** - * - */ - -class CNode extends DocumentRangeNode implements ITypedElement { - - private CNode fParent; - - public CNode(CNode parent, int type, String id, IDocument doc, int start, int length) { - super(type, id, doc, start, length); - fParent= parent; - if (parent != null) { - parent.addChild(this); - } - } - - public CNode(CNode parent, int type, String id, int start, int length) { - this(parent, type, id, parent.getDocument(), start, length); - } - - /** - * @see ITypedInput#getName - */ - public String getName() { - return getId(); - } - - /** - * @see ITypedInput#getType - */ - public String getType() { - return "c2"; //$NON-NLS-1$ - } - - /** - * @see ITypedInput#getImage - */ - public Image getImage() { - ImageDescriptor descriptor = CElementImageProvider.getImageDescriptor(getTypeCode()); - return CUIPlugin.getImageDescriptorRegistry().get(descriptor); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CParseTreeBuilder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CParseTreeBuilder.java deleted file mode 100644 index 6c8f545f54d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CParseTreeBuilder.java +++ /dev/null @@ -1,310 +0,0 @@ -package org.eclipse.cdt.internal.ui.compare; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Stack; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.jface.text.IDocument; - -/** - * - */ -public class CParseTreeBuilder extends SourceElementRequestorAdapter { - - private Stack fStack = new Stack(); - private IDocument fDocument; - - /** - * Syntax Error. - */ - public class ParseError extends Error { - } - - public CParseTreeBuilder(CNode root, IDocument doc) { - fDocument = doc; - fStack.clear(); - fStack.push(root); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void enterClassSpecifier(IASTClassSpecifier classSpecification) { - String name = classSpecification.getName(); - int start = classSpecification.getStartingOffset(); - if (classSpecification.getClassKind().equals(ASTClassKind.CLASS)) { - push(ICElement.C_CLASS, name, start); - } else if (classSpecification.getClassKind().equals(ASTClassKind.STRUCT)) { - push(ICElement.C_STRUCT, name, start); - } else if (classSpecification.getClassKind().equals(ASTClassKind.UNION)) { - push(ICElement.C_UNION, name, start); - } else if (classSpecification.getClassKind().equals(ASTClassKind.ENUM)) { - push(ICElement.C_ENUMERATION, name, start); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) { - push(ICElement.C_UNIT, "Translation Unit", 0); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void enterFunctionBody(IASTFunction function) { - push(ICElement.C_FUNCTION, function.getName(), function.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) { - push(ICElement.C_INCLUDE, inclusion.getName(), inclusion.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) { - push(ICElement.C_STORAGE_EXTERN, linkageSpec.getLinkageString(), linkageSpec.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void enterMethodBody(IASTMethod method) { - push(ICElement.C_METHOD, method.getName(), method.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - push(ICElement.C_NAMESPACE, namespaceDefinition.getName(), namespaceDefinition.getStartingOffset());; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) { - push(ICElement.C_TEMPLATE_VARIABLE, "export", declaration.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation) { - push(ICElement.C_TEMPLATE_VARIABLE, "template instanciation", instantiation.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void enterTemplateSpecialization(IASTTemplateSpecialization specialization) { - push(ICElement.C_TEMPLATE_VARIABLE, "template specialization", specialization.getStartingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void exitClassSpecifier(IASTClassSpecifier classSpecification) { - pop(classSpecification.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void exitCompilationUnit(IASTCompilationUnit translationUnit) { - pop(fDocument.getLength()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void exitFunctionBody(IASTFunction function) { - pop(function.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion(IASTInclusion inclusion) { - pop(inclusion.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec) { - pop(linkageSpec.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void exitMethodBody(IASTMethod method) { - pop(method.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - pop(namespaceDefinition.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void exitTemplateDeclaration(IASTTemplateDeclaration declaration) { - pop(declaration.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation) { - pop(instantiation.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) { - pop(specialization.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier) - */ - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) { - push(ICElement.C_ENUMERATION, enumeration.getName(), enumeration.getStartingOffset()); - pop(enumeration.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void acceptFunctionDeclaration(IASTFunction function) { - push(ICElement.C_FUNCTION_DECLARATION, function.getName(), function.getStartingOffset()); - pop(function.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro) - */ - public void acceptMacro(IASTMacro macro) { - push(ICElement.C_MACRO, macro.getName(), macro.getStartingOffset()); - pop(macro.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void acceptMethodDeclaration(IASTMethod method) { - push(ICElement.C_METHOD_DECLARATION, method.getName(), method.getStartingOffset()); - pop(method.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem) - */ - public boolean acceptProblem(IProblem problem) { - int problemId = problem.getID(); - if (problem.isError() && ((problemId & IProblem.SYNTAX_RELATED) != 0)) { - throw new ParseError(); - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefDeclaration(org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration) - */ - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) { - push(ICElement.C_TYPEDEF, typedef.getName(), typedef.getStartingOffset()); - pop(typedef.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration) - */ - public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration) { - push(ICElement.C_USING, usageDeclaration.usingTypeName(), usageDeclaration.getStartingOffset()); - pop(usageDeclaration.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective) - */ - public void acceptUsingDirective(IASTUsingDirective usageDirective) { - push(ICElement.C_USING, usageDirective.getNamespaceName(), usageDirective.getStartingOffset()); - pop(usageDirective.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable) - */ - public void acceptVariable(IASTVariable variable) { - push(ICElement.C_VARIABLE, variable.getName(), variable.getStartingOffset()); - pop(variable.getEndingOffset()); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField) - */ - public void acceptField(IASTField field) { - push(ICElement.C_FIELD, field.getName(), field.getStartingOffset()); - pop(field.getEndingOffset()); - } - - private CNode getCurrentContainer() { - return (CNode) fStack.peek(); - } - - /** - * Adds a new JavaNode with the given type and name to the current container. - */ - private void push(int type, String name, int declarationStart) { - fStack.push(new CNode(getCurrentContainer(), type, name, declarationStart, 0)); - } - - /** - * Closes the current Java node by setting its end position - * and pops it off the stack. - */ - private void pop(int declarationEnd) { - CNode current = getCurrentContainer(); - if (current.getTypeCode() == ICElement.C_UNIT) { - current.setAppendPosition(declarationEnd + 1); - } else { - current.setAppendPosition(declarationEnd); - } - current.setLength(declarationEnd - current.getRange().getOffset() + 1); - fStack.pop(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java deleted file mode 100644 index 549a997ec34..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java +++ /dev/null @@ -1,173 +0,0 @@ -package org.eclipse.cdt.internal.ui.compare; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.parser.ParserUtil; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.compare.IEditableContent; -import org.eclipse.compare.IStreamContentAccessor; -import org.eclipse.compare.structuremergeviewer.Differencer; -import org.eclipse.compare.structuremergeviewer.IDiffContainer; -import org.eclipse.compare.structuremergeviewer.IStructureComparator; -import org.eclipse.compare.structuremergeviewer.IStructureCreator; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -/** - * - */ -public class CStructureCreator implements IStructureCreator { - - private static final String NAME = "CStructureCreator.name"; - - public CStructureCreator() { - } - - /** - * @see IStructureCreator#getTitle - */ - public String getName() { - return CUIPlugin.getResourceString(NAME); - } - - /** - * @see IStructureCreator#getStructure - */ - public IStructureComparator getStructure(Object input) { - - String s = null; - if (input instanceof IStreamContentAccessor) { - try { - s = readString(((IStreamContentAccessor) input).getContents()); - } catch (CoreException ex) { - } - } - - if (s == null) { - s = new String(); - } - Document doc = new Document(s); - - CNode root = new CNode(null, ICElement.C_UNIT, "root", doc, 0, 0); - - ISourceElementRequestor builder = new CParseTreeBuilder(root, doc); - try { - //Using the CPP parser (was implicit before, now its explicit). If there - //are bugs while parsing C files, we might want to create a separate Structure - //compare for c files, but we'll never be completely right about .h files - IScanner scanner = - ParserFactory.createScanner(new StringReader(s), "code", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, builder,ParserUtil.getParserLogService()); - IParser parser = ParserFactory.createParser(scanner, builder, ParserMode.QUICK_PARSE, ParserLanguage.CPP, ParserUtil.getParserLogService() ); - parser.parse(); - } catch (Exception e) { - // What to do when error ? - // The CParseTreeBuilder will throw CParseTreeBuilder.ParseError - // for acceptProblem. - - //TODO : New : ParserFactoryException gets thrown by ParserFactory primitives - } - - return root; - } - - /** - * @see IStructureCreator#canSave - */ - public boolean canSave() { - return true; - } - - /** - * @see IStructureCreator#locate - */ - public IStructureComparator locate(Object path, Object source) { - return null; - } - - /** - * @see IStructureCreator#canRewriteTree - */ - public boolean canRewriteTree() { - return false; - } - - /** - * @see IStructureCreator#rewriteTree - */ - public void rewriteTree(Differencer differencer, IDiffContainer root) { - } - - /** - * @see IStructureCreator#save - */ - public void save(IStructureComparator structure, Object input) { - if (input instanceof IEditableContent && structure instanceof CNode) { - IDocument doc = ((CNode) structure).getDocument(); - IEditableContent bca = (IEditableContent) input; - String c = doc.get(); - bca.setContent(c.getBytes()); - } - } - - /** - * @see IStructureCreator#getContents - */ - public String getContents(Object node, boolean ignoreWhitespace) { - if (node instanceof IStreamContentAccessor) { - IStreamContentAccessor sca = (IStreamContentAccessor) node; - try { - return readString(sca.getContents()); - } catch (CoreException ex) { - } - } - return null; - } - - /** - * Returns null if an error occurred. - */ - private static String readString(InputStream is) { - if (is == null) - return null; - BufferedReader reader = null; - try { - StringBuffer buffer = new StringBuffer(); - char[] part = new char[2048]; - int read = 0; - reader = new BufferedReader(new InputStreamReader(is)); - - while ((read = reader.read(part)) != -1) - buffer.append(part, 0, read); - - return buffer.toString(); - - } catch (IOException ex) { - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException ex) { - } - } - } - return null; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java deleted file mode 100644 index cf2836c9dba..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/SourceElementRequestorAdapter.java +++ /dev/null @@ -1,334 +0,0 @@ -/******************************************************************************* - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QnX Software Systems - initial implementation base on code from rational/IBM - ******************************************************************************/ - -package org.eclipse.cdt.internal.ui.compare; - -import org.eclipse.cdt.core.parser.DefaultProblemHandler; -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ISourceElementRequestor; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ast.IASTASMDefinition; -import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTClassReference; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFieldReference; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTFunctionReference; -import org.eclipse.cdt.core.parser.ast.IASTInclusion; -import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTMethodReference; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference; -import org.eclipse.cdt.core.parser.ast.IASTParameterReference; -import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation; -import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization; -import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTTypedefReference; -import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTUsingDirective; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTVariableReference; - -/** - * - */ -public class SourceElementRequestorAdapter implements ISourceElementRequestor { - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration) - */ - public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptASMDefinition(org.eclipse.cdt.core.parser.ast.IASTASMDefinition) - */ - public void acceptASMDefinition(IASTASMDefinition asmDefinition) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassReference) - */ - public void acceptClassReference(IASTClassReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier) - */ - public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumerationReference(IASTEnumerationReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier) - */ - public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField) - */ - public void acceptField(IASTField field) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference) - */ - public void acceptFieldReference(IASTFieldReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void acceptFunctionDeclaration(IASTFunction function) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference) - */ - public void acceptFunctionReference(IASTFunctionReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro) - */ - public void acceptMacro(IASTMacro macro) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void acceptMethodDeclaration(IASTMethod method) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference) - */ - public void acceptMethodReference(IASTMethodReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference) - */ - public void acceptNamespaceReference(IASTNamespaceReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem) - */ - public boolean acceptProblem(IProblem problem) { - return DefaultProblemHandler.ruleOnProblem( problem, ParserMode.QUICK_PARSE ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefDeclaration(org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration) - */ - public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference) - */ - public void acceptTypedefReference(IASTTypedefReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration) - */ - public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective) - */ - public void acceptUsingDirective(IASTUsingDirective usageDirective) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable) - */ - public void acceptVariable(IASTVariable variable) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference) - */ - public void acceptVariableReference(IASTVariableReference reference) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void enterClassSpecifier(IASTClassSpecifier classSpecification) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void enterCompilationUnit(IASTCompilationUnit compilationUnit) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void enterFunctionBody(IASTFunction function) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void enterInclusion(IASTInclusion inclusion) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void enterMethodBody(IASTMethod method) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void enterTemplateDeclaration(IASTTemplateDeclaration declaration) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void enterTemplateSpecialization(IASTTemplateSpecialization specialization) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier) - */ - public void exitClassSpecifier(IASTClassSpecifier classSpecification) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit) - */ - public void exitCompilationUnit(IASTCompilationUnit compilationUnit) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction) - */ - public void exitFunctionBody(IASTFunction function) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion) - */ - public void exitInclusion(IASTInclusion inclusion) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification) - */ - public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod) - */ - public void exitMethodBody(IASTMethod method) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition) - */ - public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) - */ - public void exitTemplateDeclaration(IASTTemplateDeclaration declaration) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation) - */ - public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization) - */ - public void exitTemplateSpecialization(IASTTemplateSpecialization specialization) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void enterCodeBlock(IASTCodeScope scope) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope) - */ - public void exitCodeBlock(IASTCodeScope scope) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumeratorReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference) - */ - public void acceptEnumeratorReference(IASTEnumeratorReference reference) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference) - */ - public void acceptParameterReference(IASTParameterReference reference) - { - // TODO Auto-generated method stub - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CElementFilters.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CElementFilters.java deleted file mode 100644 index d3470f85dea..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CElementFilters.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; - -import org.eclipse.cdt.internal.ui.util.StringMatcher; -import org.eclipse.cdt.ui.CUIPlugin; - -/** - * The FiltersContent provides the elements for use by the list dialog - * for selecting the patterns to apply. - */ -public class CElementFilters { - static List definedFilters = null; - static List defaultFilters = null; - static StringMatcher [] matchers = null; - static String FILTERS_TAG= "CElementFilters"; //$NON-NLS-1$ - static String COMMA_SEPARATOR = ","; //$NON-NLS-1$ - - /** - * Returns the filters which are enabled by default. - * - * @return a list of strings - */ - public static List getDefaultFilters() { - if (defaultFilters == null) { - readFilters(); - } - return defaultFilters; - } - - /** - * Returns the filters currently defined for the workbench. - */ - public static List getDefinedFilters() { - if (definedFilters == null) { - // Overide the default by the user preference - CUIPlugin plugin = CUIPlugin.getDefault(); - String storedPatterns= plugin.getPluginPreferences().getString(FILTERS_TAG); - - if (storedPatterns.length() > 0) { - StringTokenizer entries = new StringTokenizer(storedPatterns, COMMA_SEPARATOR); - definedFilters = new ArrayList(); - - while (entries.hasMoreElements()) { - String nextToken = entries.nextToken(); - definedFilters.add(nextToken); - } - } else { - readFilters(); - } - } - return definedFilters; - } - - public static StringMatcher [] getMatchers() { - if (matchers == null) { - List list = getDefinedFilters(); - matchers = new StringMatcher[list.size()]; - for (int i = 0; i < matchers.length; i++) { - matchers[i] = new StringMatcher((String)(list.get(i)), true, false); - } - } - return matchers; - } - - /** - * Define new Patterns for the Duration of the session. - */ - public static void setPatterns(String[] newPatterns) { - //System.out.println ("SetPatterns call"); - matchers = new StringMatcher[newPatterns.length]; - for (int i = 0; i < newPatterns.length; i++) { - //System.out.println ("Patterns " + newPatterns[i]); - matchers[i] = new StringMatcher(newPatterns[i], true, false); - } - //CElementFactory.getDefault().refreshDeadBranchParents(); - } - - - public static boolean match(String name) { - StringMatcher [] m = getMatchers(); - if (m == null) - return false; - //System.out.println ("Pattern " + name); - for (int i = 0; i < m.length; i++) { - if (m[i].match(name)) { - //System.out.println ("Match " + name); - return true; - } - } - return false; - } - - private CElementFilters() { - } - /** - * Reads the filters currently defined for the workbench. - */ - static void readFilters() { - definedFilters = new ArrayList(); - defaultFilters = new ArrayList(); - CUIPlugin plugin = CUIPlugin.getDefault(); - if (plugin != null) { - IExtensionPoint extension = plugin.getDescriptor().getExtensionPoint(FILTERS_TAG); - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - for(int i = 0; i < extensions.length; i++){ - IConfigurationElement [] configElements = extensions[i].getConfigurationElements(); - for(int j = 0; j < configElements.length; j++){ - String pattern = configElements[j].getAttribute("pattern"); //$NON-NLS-1$ - if (pattern != null) - definedFilters.add(pattern); - String selected = configElements[j].getAttribute("selected"); //$NON-NLS-1$ - if (selected != null && selected.equalsIgnoreCase("true")) //$NON-NLS-1$ - defaultFilters.add(pattern); - } - } - } - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CLibFilter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CLibFilter.java deleted file mode 100644 index 64c471e9c3c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CLibFilter.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; - -import org.eclipse.cdt.core.model.ILibraryReference; - -public class CLibFilter extends ViewerFilter { - private boolean showlib = true; - - public boolean getShowLibraries() { - return showlib; - } - - /* (non-Javadoc) - * Method declared on ViewerFilter. - */ - public boolean select(Viewer viewer, Object parentElement, Object element) { - if (element instanceof ILibraryReference) { - return showlib; - } - return true; - } - - public void setShowLibraries (boolean show) { - showlib = show; - } - - /** - * Creates a new library filter. - */ - public CLibFilter() { - super(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java deleted file mode 100644 index 019e2bfb1b0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CPatternFilter.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.List; -import java.util.Vector; -import java.util.StringTokenizer; - -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; - -import org.eclipse.cdt.internal.ui.util.StringMatcher; -import org.eclipse.cdt.ui.CUIPlugin; - -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICProject; - -public class CPatternFilter extends ViewerFilter { - private String[] patterns; - private StringMatcher[] matchers; - - static String COMMA_SEPARATOR = ","; //$NON-NLS-1$ - static String FILTERS_TAG= "CElementFilters"; //$NON-NLS-1$ - - private void initializeFromPreferences() { - CUIPlugin plugin= CUIPlugin.getDefault(); - String storedPatterns= plugin.getPreferenceStore().getString(FILTERS_TAG); - - if (storedPatterns.length() == 0) { - List defaultFilters= FiltersContentProvider.getDefaultFilters(); - String[] patterns= new String[defaultFilters.size()]; - defaultFilters.toArray(patterns); - setPatterns(patterns); - return; - } - - //Get the strings separated by a comma and filter them from the currently - //defined ones - - List definedFilters = FiltersContentProvider.getDefinedFilters(); - - StringTokenizer entries = new StringTokenizer(storedPatterns, COMMA_SEPARATOR); - Vector patterns = new Vector(); - - while (entries.hasMoreElements()) { - String nextToken = entries.nextToken(); - if (definedFilters.indexOf(nextToken) > -1) - patterns.addElement(nextToken); - } - - //Convert to an array of Strings - String[] patternArray = new String[patterns.size()]; - patterns.toArray(patternArray); - setPatterns(patternArray); - } - - /** - * Gets the patterns for the receiver. Returns the cached values if there - * are any - if not look it up. - */ - public String[] getPatterns() { - if (patterns == null) { - initializeFromPreferences(); - } - return patterns; - } - - /** - * Sets the patterns to filter out for the receiver. - */ - public void setPatterns(String[] newPatterns) { - - patterns = newPatterns; - matchers = new StringMatcher[newPatterns.length]; - for (int i = 0; i < newPatterns.length; i++) { - //Reset the matchers to prevent constructor overhead - matchers[i] = new StringMatcher(newPatterns[i], true, false); - } - } - - - /** - * Return the currently configured StringMatchers. If there aren't any look - * them up. - */ - private StringMatcher[] getMatchers() { - if (matchers == null) - initializeFromPreferences(); - return matchers; - } - - /* (non-Javadoc) - * Method declared on ViewerFilter. - */ - public boolean select(Viewer viewer, Object parentElement, Object element) { - IResource resource = null; - if (element instanceof IResource) { - resource = (IResource) element; - } else if (element instanceof IAdaptable) { - IAdaptable adaptable = (IAdaptable) element; - resource = (IResource) adaptable.getAdapter(IResource.class); - } - - // Only apply the rule for Projects and folders. - if (parentElement instanceof ICProject - || parentElement instanceof ICContainer) { - if (resource != null) { - String name = resource.getName(); - StringMatcher[] testMatchers = getMatchers(); - for (int i = 0; i < testMatchers.length; i++) { - if (testMatchers[i].match(name)) - return false; - } - } - } - return true; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java deleted file mode 100644 index 77cefef89a8..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java +++ /dev/null @@ -1,1373 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.IBinaryModule; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.CProject; -import org.eclipse.cdt.internal.core.model.TranslationUnit; -import org.eclipse.cdt.internal.ui.IContextMenuConstants; -import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider; -import org.eclipse.cdt.internal.ui.drag.DelegatingDragAdapter; -import org.eclipse.cdt.internal.ui.drag.FileTransferDragAdapter; -import org.eclipse.cdt.internal.ui.drag.LocalSelectionTransferDragAdapter; -import org.eclipse.cdt.internal.ui.drag.ResourceTransferDragAdapter; -import org.eclipse.cdt.internal.ui.drag.TransferDragSourceListener; -import org.eclipse.cdt.internal.ui.editor.FileSearchAction; -import org.eclipse.cdt.internal.ui.editor.FileSearchActionInWorkingSet; -import org.eclipse.cdt.internal.ui.editor.OpenIncludeAction; -import org.eclipse.cdt.internal.ui.editor.SearchDialogAction; -import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage; -import org.eclipse.cdt.internal.ui.util.EditorUtility; -import org.eclipse.cdt.internal.ui.util.ProblemTreeViewer; -import org.eclipse.cdt.ui.CElementContentProvider; -import org.eclipse.cdt.ui.CLocalSelectionTransfer; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.PreferenceConstants; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.GroupMarker; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.DecoratingLabelProvider; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ILabelDecorator; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITreeViewerListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeExpansionEvent; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IViewSite; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.IWorkingSetManager; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ResourceWorkingSetFilter; -import org.eclipse.ui.actions.AddBookmarkAction; -import org.eclipse.ui.actions.BuildAction; -import org.eclipse.ui.actions.CloseResourceAction; -import org.eclipse.ui.actions.CopyResourceAction; -import org.eclipse.ui.actions.DeleteResourceAction; -import org.eclipse.ui.actions.MoveResourceAction; -import org.eclipse.ui.actions.NewWizardMenu; -import org.eclipse.ui.actions.OpenFileAction; -import org.eclipse.ui.actions.OpenInNewWindowAction; -import org.eclipse.ui.actions.OpenResourceAction; -import org.eclipse.ui.actions.OpenSystemEditorAction; -import org.eclipse.ui.actions.OpenWithMenu; -import org.eclipse.ui.actions.RefreshAction; -import org.eclipse.ui.actions.RenameResourceAction; -import org.eclipse.ui.actions.WorkingSetFilterActionGroup; -import org.eclipse.ui.dialogs.PropertyDialogAction; -import org.eclipse.ui.part.ISetSelectionTarget; -import org.eclipse.ui.part.IShowInTarget; -import org.eclipse.ui.part.PluginTransfer; -import org.eclipse.ui.part.ResourceTransfer; -import org.eclipse.ui.part.ShowInContext; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.ui.views.framelist.BackAction; -import org.eclipse.ui.views.framelist.ForwardAction; -import org.eclipse.ui.views.framelist.FrameList; -import org.eclipse.ui.views.framelist.GoIntoAction; -import org.eclipse.ui.views.framelist.UpAction; -import org.eclipse.ui.views.navigator.LocalSelectionTransfer; - - - - -public class CView extends ViewPart implements IMenuListener, ISetSelectionTarget, - IPropertyChangeListener, IShowInTarget { - - ProblemTreeViewer viewer; - IMemento memento; - - // Actions for Menu context. - AddBookmarkAction addBookmarkAction; - CopyResourceAction copyResourceAction; - DeleteResourceAction deleteResourceAction; - OpenFileAction openFileAction; - OpenSystemEditorAction openSystemEditorAction; - PropertyDialogAction propertyDialogAction; - RefreshAction refreshAction; - RenameResourceAction renameResourceAction; - MoveResourceAction moveResourceAction; - - CloseResourceAction closeProjectAction; - OpenResourceAction openProjectAction; - BuildAction buildAction; - BuildAction rebuildAction; - - // CElement action - OpenIncludeAction openIncludeAction; - - BackAction backAction; - ForwardAction forwardAction; - GoIntoAction goIntoAction; - UpAction upAction; - WorkingSetFilterActionGroup wsFilterActionGroup; - - FrameList frameList; - CViewFrameSource frameSource; - - CPatternFilter patternFilter = new CPatternFilter (); - FilterSelectionAction patternFilterAction; - - CLibFilter clibFilter = new CLibFilter (); - ShowLibrariesAction clibFilterAction; - - ResourceWorkingSetFilter workingSetFilter = new ResourceWorkingSetFilter(); - - ActionContributionItem adjustWorkingSetContributions [] = new ActionContributionItem[5]; - - // Collapsing - CollapseAllAction collapseAllAction; - - //Search - FileSearchAction fFileSearchAction; - FileSearchActionInWorkingSet fFileSearchActionInWorkingSet; - SearchDialogAction fSearchDialogAction; - - // Persistance tags. - static final String TAG_SELECTION= "selection"; //$NON-NLS-1$ - static final String TAG_EXPANDED= "expanded"; //$NON-NLS-1$ - static final String TAG_ELEMENT= "element"; //$NON-NLS-1$ - static final String TAG_PATH= "path"; //$NON-NLS-1$ - static final String TAG_VERTICAL_POSITION= "verticalPosition"; //$NON-NLS-1$ - static final String TAG_HORIZONTAL_POSITION= "horizontalPosition"; //$NON-NLS-1$ - static final String TAG_FILTERS = "filters"; //$NON-NLS-1$ - static final String TAG_FILTER = "filter"; //$NON-NLS-1$ - static final String TAG_SHOWLIBRARIES = "showLibraries"; //$NON-NLS-1$ - static final String TAG_WORKINGSET = "workingSet"; //$NON-NLS-1$ - - //Menu tags - final String WORKING_GROUP_MARKER = "workingSetGroup"; - final String WORKING_GROUP_MARKER_END = "end-workingSetGroup"; - - // Menu tags for the build - final String BUILD_GROUP_MARKER = "buildGroup"; - final String BUILD_GROUP_MARKER_END = "end-buildGroup"; - - private IPartListener partListener = new IPartListener() { - public void partActivated(IWorkbenchPart part) { - if (part instanceof IEditorPart) { - editorActivated((IEditorPart) part); - } - } - public void partBroughtToTop(IWorkbenchPart part) {} - public void partClosed(IWorkbenchPart part) {} - public void partDeactivated(IWorkbenchPart part) {} - public void partOpened(IWorkbenchPart part) {} - }; - - private IPropertyChangeListener workingSetListener = new IPropertyChangeListener() { - private void doViewerUpdate() { - viewer.getControl().setRedraw(false); - viewer.refresh(); - viewer.getControl().setRedraw(true); - } - - public void propertyChange(PropertyChangeEvent ev) { - String prop = ev.getProperty(); - if(prop == null) { - return; - } - - if(prop.equals(WorkingSetFilterActionGroup.CHANGE_WORKING_SET)) { - workingSetFilter.setWorkingSet((IWorkingSet)ev.getNewValue()); - doViewerUpdate(); - } else if(prop.equals(IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE)){ - if(ev.getOldValue() instanceof IWorkingSet && workingSetFilter.getWorkingSet() != null) { - if(workingSetFilter.getWorkingSet().equals(ev.getOldValue())) { - doViewerUpdate(); - } - } - } else if(prop.equals(IWorkingSetManager.CHANGE_WORKING_SET_REMOVE)) { - if(ev.getOldValue() instanceof IWorkingSet && workingSetFilter.getWorkingSet() != null) { - if(workingSetFilter.getWorkingSet().equals(ev.getOldValue())) { - workingSetFilter.setWorkingSet(null); - doViewerUpdate(); - } - } - } - } - }; - - public CView() { - super(); - } - - /** - * @see IWorkbenchPart#setFocus() - */ - public void setFocus() { - viewer.getTree().setFocus(); - //composite.setFocus (); - } - - /** - * Reveal and select the passed element selection in self's visual component - * @see ISetSelectionTarget#selectReveal() - */ - public void selectReveal(ISelection selection) { - IStructuredSelection ssel = convertSelectionToCElement(selection); - if (!ssel.isEmpty()) { - getResourceViewer().setSelection(ssel, true); - } - } - - private ITreeViewerListener expansionListener= new ITreeViewerListener() { - public void treeCollapsed(TreeExpansionEvent event) { - } - - public void treeExpanded(TreeExpansionEvent event) { - final Object element= event.getElement(); - if (element instanceof IParent) { - //viewer.refresh (element); - Control ctrl= viewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) { - ctrl.getDisplay().asyncExec(new Runnable() { - public void run() { - Control ctrl= viewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) { - viewer.expandToLevel(element, 1); - } - } - }); - } - } - } - }; - - /** - * Handles double clicks in viewer. - * Opens editor if file double-clicked. - */ - protected void handleDoubleClick(DoubleClickEvent event) { - IStructuredSelection s = (IStructuredSelection)event.getSelection(); - IAdaptable element = (IAdaptable)s.getFirstElement(); - IEditorPart part = null; - //System.out.println ("Double click on " + element); - - try { - part = EditorUtility.openInEditor(element); - if (part != null) { - IWorkbenchPage page = getSite().getPage(); - page.bringToTop(part); - if (element instanceof ISourceReference) { - EditorUtility.revealInEditor(part, (ICElement)element); - } - } - } catch (Exception e) { - } - if (part == null && viewer.isExpandable(element)) { - viewer.setExpandedState(element, !viewer.getExpandedState(element)); - } - } - - /** - * Handles key events in viewer. - */ - void handleKeyPressed(KeyEvent event) { - if (event.character == SWT.DEL - && event.stateMask == 0 && deleteResourceAction.isEnabled()) { - IStructuredSelection isel = deleteResourceAction.getStructuredSelection(); - Object[] array = isel.toArray(); - for (int i = 0; i < array.length; i++){ - if (array[i] instanceof IBinaryContainer - || array[i] instanceof IArchiveContainer) { - return; - } - } - deleteResourceAction.run(); - } - } - - - /* (non-Javadoc) - * Method declared on IViewPart. - */ - public void init(IViewSite site,IMemento memento) throws PartInitException { - super.init(site,memento); - this.memento = memento; - } - - void initFrameList() { - frameSource = new CViewFrameSource(this); - frameList = new FrameList(frameSource); - frameSource.connectTo(frameList); - } - - /** - * Answer the property defined by key. - */ - public Object getAdapter(Class key) { - if (key.equals(ISelectionProvider.class)) - return viewer; - return super.getAdapter(key); - } - - - /** - * Adds drag and drop support to the navigator. - */ - void initDragAndDrop() { - int ops = DND.DROP_COPY | DND.DROP_MOVE; - - Transfer[] dragTransfers = - new Transfer[] { - ResourceTransfer.getInstance(), - FileTransfer.getInstance(), - CLocalSelectionTransfer.getInstance(), - PluginTransfer.getInstance()}; - - TransferDragSourceListener[] dragListeners = - new TransferDragSourceListener[] { - new ResourceTransferDragAdapter(viewer), - new LocalSelectionTransferDragAdapter(viewer), - new FileTransferDragAdapter(viewer)}; - - viewer.addDragSupport(ops, dragTransfers, new DelegatingDragAdapter(viewer, dragListeners)); - - Transfer[] dropTransfers = - new Transfer[] { - ResourceTransfer.getInstance(), - FileTransfer.getInstance(), - LocalSelectionTransfer.getInstance(), - PluginTransfer.getInstance()}; - - viewer.addDropSupport(ops, dropTransfers, new CViewDropAdapter(viewer)); - - } - - /** - * Initializes the default preferences - */ - public static void initDefaults(IPreferenceStore store) { - store.setDefault(TAG_SHOWLIBRARIES, true); - } - - void initFilterFromPreferences() { - CUIPlugin plugin = CUIPlugin.getDefault(); - boolean show = plugin.getPreferenceStore().getBoolean(TAG_SHOWLIBRARIES); - getLibraryFilter().setShowLibraries(show); - } - - /** - * Create the KeyListener for doing the refresh on the viewer. - */ - void initRefreshKey() { - viewer.getControl().addKeyListener(new KeyAdapter() { - public void keyReleased(KeyEvent event) { - if (event.keyCode == SWT.F5) { - refreshAction.selectionChanged( - (IStructuredSelection)viewer.getSelection()); - if (refreshAction.isEnabled()) - refreshAction.run(); - } - } - }); - } - - /** - * Handles selection changed in viewer. - * Updates global actions. - * Links to editor (if option enabled) - */ - void handleSelectionChanged(SelectionChangedEvent event) { - IStructuredSelection sel = (IStructuredSelection) event.getSelection(); - updateStatusLine(sel); - updateActions(sel); - updateGlobalActions(sel); - goIntoAction.update(); - linkToEditor(sel); - } - - - /** - * @see ContentOutlinePage#createControl - */ - public void createPartControl (Composite parent) { - - viewer = createViewer(parent); - viewer.setUseHashlookup (true); - CElementContentProvider provider = createContentProvider(); - viewer.setContentProvider(provider); - setLabelDecorator(PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()); - CUIPlugin.getDefault().getProblemMarkerManager().addListener(viewer); - CUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); - - // FIXME: Add Drag and Drop support. - initFrameList(); - initRefreshKey(); - updateTitle(); - initDragAndDrop(); - viewer.addFilter(patternFilter); - viewer.addFilter(workingSetFilter); - //viewer.addFilter(clibFilter); - viewer.setSorter(new CViewSorter ()); - // FIXME: Add different Sorting. - if(memento != null) - restoreFilters(); - else - initFilterFromPreferences(); - - viewer.setInput (CoreModel.getDefault().getCModel()); - - MenuManager menuMgr= new MenuManager("#PopupMenu"); //$NON-NLS-1$ - menuMgr.setRemoveAllWhenShown(true); - menuMgr.addMenuListener(this); - - Control control = viewer.getControl(); - Menu menu = menuMgr.createContextMenu(viewer.getTree ()); - control.setMenu (menu); - - // Make the Actions for the Context Menu - makeActions(); - - //Add the property changes after all of the UI work has been done. - IWorkingSetManager wsmanager = getViewSite().getWorkbenchWindow().getWorkbench().getWorkingSetManager(); - wsmanager.addPropertyChangeListener(workingSetListener); - - viewer.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent event) { - handleDoubleClick(event); - } - }); - - viewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - handleSelectionChanged(event); - } - }); - - viewer.getControl().addKeyListener(new KeyAdapter() { - public void keyPressed(KeyEvent e) { - handleKeyPressed(e); - } - }); - - viewer.addTreeListener(expansionListener); - - getSite().registerContextMenu(menuMgr, viewer); - getSite().setSelectionProvider(viewer); - getSite().getPage().addPartListener(partListener); - - if (memento != null) - restoreState (memento); - memento = null; - - fillActionBars(); - - } - - protected ProblemTreeViewer createViewer(Composite parent) { - return new ProblemTreeViewer (parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - } - - protected CElementContentProvider createContentProvider() { - boolean showCUChildren= CPluginPreferencePage.showCompilationUnitChildren(); - return new CElementContentProvider(showCUChildren, true); - } - - protected StandardCElementLabelProvider createLabelProvider () { - return new StandardCElementLabelProvider(); - } - - /* (non-Javadoc) - * Method declared on IWorkbenchPart. - */ - public void dispose() { - getSite().getPage().removePartListener(partListener); - CUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); - if (viewer != null) { - viewer.removeTreeListener(expansionListener); - CUIPlugin.getDefault().getProblemMarkerManager().removeListener(viewer); - } - IWorkspace workspace = CUIPlugin.getWorkspace(); - workspace.removeResourceChangeListener(closeProjectAction); - workspace.removeResourceChangeListener(openProjectAction); - - IWorkingSetManager wsmanager = getViewSite().getWorkbenchWindow().getWorkbench().getWorkingSetManager(); - wsmanager.removePropertyChangeListener(workingSetListener); - - super.dispose(); - } - - /** - * An editor has been activated. Set the selection in this navigator - * to be the editor's input, if linking is enabled. - */ - void editorActivated(IEditorPart editor) { - if (!CPluginPreferencePage.isLinkToEditor()) { - return; - } - - IEditorInput input = editor.getEditorInput(); - if (input instanceof IFileEditorInput) { - CoreModel factory = CoreModel.getDefault(); - IFileEditorInput fileInput = (IFileEditorInput) input; - IFile file = fileInput.getFile(); - ICElement celement = factory.create(file); - if (celement != null) { - ISelection newSelection = new StructuredSelection(celement); - if (!viewer.getSelection().equals(newSelection)) { - viewer.setSelection(newSelection); - } - } - } - } - - CLibFilter getLibraryFilter () { - return clibFilter; - } - - /** - * Returns the pattern filter for this view. - * @return the pattern filter - */ - CPatternFilter getPatternFilter() { - return patternFilter; - } - -// /** -// * Returns the working set filter for this view. -// * @return the working set filter -// */ -// CWorkingSetFilter getWorkingSetFilter() { -// return workingSetFilter; -// } - - TreeViewer getViewer () { - return viewer; - } - - /** - * Create self's action objects - */ - void makeActions() { - Shell shell = getViewSite().getShell(); - - openIncludeAction = new OpenIncludeAction (viewer); - openFileAction = new OpenFileAction(getSite().getPage()); - openSystemEditorAction = new OpenSystemEditorAction(getSite().getPage()); - refreshAction = new RefreshAction(shell); - buildAction = new BuildAction(shell, IncrementalProjectBuilder.INCREMENTAL_BUILD); - rebuildAction = new BuildAction(shell, IncrementalProjectBuilder.FULL_BUILD); - moveResourceAction = new MoveResourceAction (shell); - copyResourceAction = new CopyResourceAction(shell); - renameResourceAction = new RenameResourceAction(shell, viewer.getTree()); - deleteResourceAction = new DeleteResourceAction(shell); - - IWorkspace workspace = CUIPlugin.getWorkspace(); - - openProjectAction = new OpenResourceAction(shell); - workspace.addResourceChangeListener(openProjectAction, IResourceChangeEvent.POST_CHANGE); - closeProjectAction = new CloseResourceAction(shell); - workspace.addResourceChangeListener(closeProjectAction, IResourceChangeEvent.POST_CHANGE); - - //sortByNameAction = new SortViewAction(this, false); - //sortByTypeAction = new SortViewAction(this, true); - patternFilterAction = new FilterSelectionAction(shell, this, "Filters..."); - clibFilterAction = new ShowLibrariesAction(shell, this, "Show Referenced Libs"); - - wsFilterActionGroup = new WorkingSetFilterActionGroup(getViewSite().getShell(), workingSetListener); - - goIntoAction = new GoIntoAction(frameList); - backAction = new BackAction(frameList); - forwardAction = new ForwardAction(frameList); - upAction = new UpAction(frameList); - - addBookmarkAction = new AddBookmarkAction(shell); - //propertyDialogAction = new PropertyDialogAction(shell, viewer); - propertyDialogAction = new PropertyDialogAction(shell, - new ISelectionProvider () { - public void addSelectionChangedListener(ISelectionChangedListener listener) { - viewer.addSelectionChangedListener (listener); - } - public ISelection getSelection() { - return convertSelection (viewer.getSelection ()); - } - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - viewer.removeSelectionChangedListener (listener); - } - public void setSelection(ISelection selection) { - viewer.setSelection (selection); - } - }); - - IActionBars actionBars = getViewSite().getActionBars(); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE, deleteResourceAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.BOOKMARK, addBookmarkAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.REFRESH, refreshAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.BUILD_PROJECT, buildAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.REBUILD_PROJECT, rebuildAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.OPEN_PROJECT, openProjectAction); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.CLOSE_PROJECT, closeProjectAction); - - collapseAllAction = new CollapseAllAction(this); - - fFileSearchAction = new FileSearchAction(viewer); - fFileSearchActionInWorkingSet = new FileSearchActionInWorkingSet(viewer); - fSearchDialogAction = new SearchDialogAction(viewer, this.getViewSite().getWorkbenchWindow()); - } - - /** - * Updates all actions with the given selection. - * Necessary when popping up a menu, because some of the enablement criteria - * may have changed, even if the selection in the viewer hasn't. - * E.g. A project was opened or closed. - */ - void updateActions(IStructuredSelection selection) { - copyResourceAction.selectionChanged(selection); - refreshAction.selectionChanged(selection); - moveResourceAction.selectionChanged(selection); - openFileAction.selectionChanged(selection); - openSystemEditorAction.selectionChanged(selection); - propertyDialogAction.selectionChanged(selection); - renameResourceAction.selectionChanged(selection); - //sortByTypeAction.selectionChanged(selection); - //sortByNameAction.selectionChanged(selection); - } - - /** - * Updates the global actions with the given selection. - * Be sure to invoke after actions objects have updated, since can* methods delegate to action objects. - */ - void updateGlobalActions(IStructuredSelection selection) { - deleteResourceAction.selectionChanged(selection); - addBookmarkAction.selectionChanged(selection); - - // Ensure Copy global action targets correct action, - // either copyProjectAction or copyResourceAction, - // depending on selection. - copyResourceAction.selectionChanged(selection); - IActionBars actionBars = getViewSite().getActionBars(); - actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, copyResourceAction); - actionBars.updateActionBars(); - renameResourceAction.selectionChanged(selection); - - refreshAction.selectionChanged(selection); - buildAction.selectionChanged(selection); - rebuildAction.selectionChanged(selection); - openProjectAction.selectionChanged(selection); - closeProjectAction.selectionChanged(selection); - - } - - - //---- Action handling ---------------------------------------------------------- - - IStructuredSelection convertSelection(ISelection s) { - List converted = new ArrayList(); - if (s instanceof StructuredSelection) { - Object[] elements= ((StructuredSelection)s).toArray(); - for (int i= 0; i < elements.length; i++) { - Object e = elements[i]; - if (e instanceof IAdaptable) { - IResource r = (IResource)((IAdaptable)e).getAdapter(IResource.class); - if (r != null) - converted.add(r); - } - } - } - return new StructuredSelection(converted.toArray()); - } - - IStructuredSelection convertSelectionToCElement(ISelection s) { - List converted = new ArrayList(); - if (s instanceof StructuredSelection) { - Object[] elements= ((StructuredSelection)s).toArray(); - for (int i= 0; i < elements.length; i++) { - Object e = elements[i]; - if (e instanceof IAdaptable) { - ICElement c = (ICElement)((IAdaptable)e).getAdapter(ICElement.class); - if (c != null) - converted.add(c); - } - } - } - return new StructuredSelection(converted.toArray()); - } - - /** - * Called when the context menu is about to open. - * Override to add your own context dependent menu contributions. - */ - public void menuAboutToShow(IMenuManager menu) { - IStructuredSelection selection= (IStructuredSelection) viewer.getSelection(); - if (selection.isEmpty()) { - new NewWizardMenu(menu, getSite().getWorkbenchWindow(), false); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));//$NON-NLS-1$ - return; - } - - updateActions (convertSelection(selection)); - //updateActions (selection); - addNewMenu(menu, selection); - menu.add(new Separator()); - addOpenMenu(menu, selection); - menu.add(new Separator()); - addBuildMenu(menu, selection); - menu.add(new Separator ()); - addRefreshMenu (menu, selection); - menu.add(new Separator()); - addIOMenu(menu, selection); - menu.add(new Separator()); - addBookMarkMenu (menu, selection); - menu.add(new Separator()); - addSearchMenu(menu, selection); - //menu.add(new Separator()); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));//$NON-NLS-1$ - addPropertyMenu(menu, selection); - } - - void addNewMenu (IMenuManager menu, IStructuredSelection selection) { - - - MenuManager newMenu = new MenuManager("New"); - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - - newMenu.add(goIntoAction); - - new NewWizardMenu(newMenu, getSite().getWorkbenchWindow(), false); - - menu.add(newMenu); - - if (resource == null) - return; - - menu.add (new Separator ()); - if (selection.size() == 1 && resource instanceof IContainer) { - menu.add(goIntoAction); - } - - MenuManager gotoMenu = new MenuManager("GoTo"); - menu.add(gotoMenu); - if (viewer.isExpandable(element)) { - gotoMenu.add(backAction); - gotoMenu.add(forwardAction); - gotoMenu.add(upAction); - } - - } - - void addOpenMenu(IMenuManager menu, IStructuredSelection selection) { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - if (resource == null) - return; - - // Create a menu flyout. - //MenuManager submenu= new MenuManager("Open With"); //$NON-NLS-1$ - //submenu.add(new OpenWithMenu(getSite().getPage(), (IFile) resource)); - //menu.add(submenu); - if (resource instanceof IFile) - menu.add(openFileAction); - - fillOpenWithMenu(menu, selection); - fillOpenToMenu(menu, selection); - } - - - void addBuildMenu(IMenuManager menu, IStructuredSelection selection) { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - if (resource == null) { - return; - } - - menu.add(new GroupMarker(BUILD_GROUP_MARKER)); - if (resource instanceof IProject && hasBuilder((IProject) resource)) { - buildAction.selectionChanged(selection); - menu.add(buildAction); - rebuildAction.selectionChanged(selection); - menu.add(rebuildAction); - } - - menu.add(new GroupMarker(BUILD_GROUP_MARKER_END)); - } - - boolean hasBuilder(IProject project) { - try { - ICommand[] commands = project.getDescription().getBuildSpec(); - if (commands.length > 0) - return true; - } - catch (CoreException e) { - // Cannot determine if project has builders. Project is closed - // or does not exist. Fall through to return false. - } - return false; - } - - - void addRefreshMenu (IMenuManager menu, IStructuredSelection selection) { - menu.add(refreshAction); - } - - void addIOMenu (IMenuManager menu, IStructuredSelection selection) { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - if (resource == null) - return; - - menu.add(new Separator ()); - - if (resource instanceof IProject) { - menu.add(closeProjectAction); - } - - if (resource instanceof IFile || resource instanceof IFolder) { - menu.add(copyResourceAction); - menu.add(moveResourceAction); - } - - if (!(element instanceof IArchiveContainer || element instanceof IBinaryContainer)) { - menu.add(renameResourceAction); - menu.add(deleteResourceAction); - } - - } - - void addBookMarkMenu (IMenuManager menu, IStructuredSelection selection) { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - if (resource == null) - return; - if (resource instanceof IFile) { - menu.add(addBookmarkAction); - } - } - - void addPropertyMenu (IMenuManager menu, IStructuredSelection selection) { - propertyDialogAction.selectionChanged(convertSelection(selection)); - if (propertyDialogAction.isApplicableForSelection()) { - menu.add(propertyDialogAction); - } - } - - - /** - * Add "open with" actions to the context sensitive menu. - * @param menu the context sensitive menu - * @param selection the current selection in the project explorer - */ - void fillOpenWithMenu(IMenuManager menu, IStructuredSelection selection) { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - if (resource == null) - return; - - // If one file is selected get it. - // Otherwise, do not show the "open with" menu. - if (selection.size() != 1) - return; - - if (!(resource instanceof IFile)) - return; - - // Create a menu flyout. - MenuManager submenu = new MenuManager("Open With"); //$NON-NLS-1$ - submenu.add(new OpenWithMenu(getSite().getPage(), (IFile) resource)); - - // Add the submenu. - menu.add(submenu); - } - - /** - * Add "open to" actions to the context sensitive menu. - * @param menu the context sensitive menu - * @param selection the current selection in the project explorer - */ - void fillOpenToMenu(IMenuManager menu, IStructuredSelection selection) - { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - IResource resource = (IResource)element.getAdapter(IResource.class); - if (resource == null) - return; - - // If one file is selected get it. - // Otherwise, do not show the "open with" menu. - if (selection.size() != 1) - return; - - if (!(resource instanceof IContainer)) - return; - - menu.add(new OpenInNewWindowAction(getSite().getWorkbenchWindow(), resource)); - } - - - /** - * Returns the tool tip text for the given element. - */ - String getToolTipText(Object element) { - if (element instanceof IResource) { - IPath path = ((IResource) element).getFullPath(); - if (path.isRoot()) { - return "CVIEW"; //$NON-NLS-1$ - } else { - return path.makeRelative().toString(); - } - } else { - return ((ILabelProvider) viewer.getLabelProvider()).getText(element); - } - } - - /** - * Returns the message to show in the status line. - * - * @param selection the current selection - * @return the status line message - */ - String getStatusLineMessage(IStructuredSelection selection) { - if (selection.size() == 1) { - Object o = selection.getFirstElement(); - if (o instanceof IResource) { - return ((IResource) o).getFullPath().makeRelative().toString(); - } else if (o instanceof ICElement) { - ICElement celement = (ICElement)o; - IResource res = (IResource)celement.getAdapter(IResource.class); - if (res != null) { - return res.getFullPath().toString(); - } else if (celement.getElementType() == ICElement.C_VCONTAINER) { - if (celement instanceof IBinaryContainer) { - ICProject cproj = celement.getCProject(); - if (cproj != null) { - return cproj.getPath() + " - binaries"; - } - } else if (celement instanceof IArchiveContainer) { - ICProject cproj = celement.getCProject(); - if (cproj != null) { - return cproj.getPath() + " - archives"; - } - } else if (celement instanceof IBinaryModule) { - IBinary bin = ((IBinaryModule)celement).getBinary(); - return bin.getPath() + ":" + celement.getElementName(); - } - } else if (celement.getElementType() > ICElement.C_UNIT) { - return celement.getPath().toString() + " - [" + celement.getElementName() +"]"; - } - return celement.getElementName(); - } else { - return "ItemSelected"; //$NON-NLS-1$ - } - } - if (selection.size() > 1) { - return "StatusLine"; - } - return "";//$NON-NLS-1$ - } - - void updateTitle () { - Object input= getViewer().getInput(); - String viewName= getConfigurationElement().getAttribute("name"); //$NON-NLS-1$ - if (input == null || (input instanceof ICModel)) { - setTitle(viewName); - setTitleToolTip(""); //$NON-NLS-1$ - } else { - ILabelProvider labelProvider = (ILabelProvider) getViewer().getLabelProvider(); - String inputText= labelProvider.getText(input); - setTitle(inputText); - setTitleToolTip(getToolTipText(input)); - } - } - - /** - * Returns the tree viewer which shows the resource hierarchy. - */ - TreeViewer getResourceViewer() { - return viewer; - } - - /** - * Updates the message shown in the status line. - * - * @param selection the current selection - */ - void updateStatusLine(IStructuredSelection selection) { - String msg = getStatusLineMessage(selection); - getViewSite().getActionBars().getStatusLineManager().setMessage(msg); - } - - - void fillActionBars() { - IActionBars actionBars= getViewSite().getActionBars(); - IToolBarManager toolBar = actionBars.getToolBarManager(); - toolBar.add(backAction); - toolBar.add(forwardAction); - toolBar.add(upAction); - toolBar.add(new Separator()); - toolBar.add(collapseAllAction); - actionBars.updateActionBars(); - - wsFilterActionGroup.fillActionBars(actionBars); - - IMenuManager menu = actionBars.getMenuManager(); - - //menu.add (clibFilterAction); - menu.add (patternFilterAction); - } - - /** - * Sets the decorator for the package explorer. - * - * @param decorator a label decorator or null for no decorations. - */ - public void setLabelDecorator(ILabelDecorator decorator) { - ILabelProvider cProvider= createLabelProvider(); - if (decorator == null) { - viewer.setLabelProvider(cProvider); - } else { - viewer.setLabelProvider(new DecoratingLabelProvider(cProvider, decorator)); - } - } - - public void propertyChange(PropertyChangeEvent event) { - if (viewer == null) - return; - - boolean refreshViewer= false; - - if (event.getProperty() == PreferenceConstants.PREF_SHOW_CU_CHILDREN) { - boolean showCUChildren= CPluginPreferencePage.showCompilationUnitChildren(); - ((CElementContentProvider)viewer.getContentProvider()).setProvideMembers(showCUChildren); - refreshViewer= true; - } - - if (refreshViewer) - viewer.refresh(); - } - - /** - * Links to editor (if option enabled) - */ - void linkToEditor(IStructuredSelection selection) { - if (!CPluginPreferencePage.isLinkToEditor()) { - return; - } - // ignore selection changes if the package explorer is not the active part. - // In this case the selection change isn't triggered by a user. - if (!isActivePart()) - return; - Object obj= selection.getFirstElement(); - - if (selection.size() == 1) { - if (obj instanceof ISourceReference) { - ITranslationUnit tu = ((ISourceReference)obj).getTranslationUnit(); - if (tu != null) { - IEditorPart part= EditorUtility.isOpenInEditor(obj); - if (part != null) { - IWorkbenchPage page= getSite().getPage(); - page.bringToTop(part); - if (obj instanceof ICElement) { - EditorUtility.revealInEditor(part, (ICElement) obj); - } - } - } - } - } - - } - - private boolean isActivePart() { - return this == getSite().getPage().getActivePart(); - } - - /* (non-Javadoc) - * @see IViewPartInputProvider#getViewPartInput() - */ - public Object getViewPartInput() { - if (viewer != null) { - return viewer.getInput(); - } - return null; - } - - public void collapseAll() { - viewer.getControl().setRedraw(false); - viewer.collapseToLevel(getViewPartInput(), TreeViewer.ALL_LEVELS); - viewer.getControl().setRedraw(true); - } - - void restoreFilters() { - // restore pattern filters - IMemento filtersMem = memento.getChild(TAG_FILTERS); - if (filtersMem != null) { - IMemento children[]= filtersMem.getChildren(TAG_FILTER); - String filters[]= new String[children.length]; - for (int i = 0; i < children.length; i++) { - filters[i]= children[i].getString(TAG_ELEMENT); - } - getPatternFilter().setPatterns(filters); - } else { - getPatternFilter().setPatterns(new String[0]); - } - - //restore library - String show = memento.getString(TAG_SHOWLIBRARIES); - if (show != null) { - getLibraryFilter().setShowLibraries(show.equals("true")); //$NON-NLS-1$ - } - else - initFilterFromPreferences(); - } - - void restoreState(IMemento memento) { - //Restore the working set before we re-build the tree - String wsname = memento.getString(TAG_WORKINGSET); - if(wsname != null) { - IWorkingSetManager wsmanager = getViewSite().getWorkbenchWindow().getWorkbench().getWorkingSetManager(); - IWorkingSet set = wsmanager.getWorkingSet(wsname); - wsFilterActionGroup.setWorkingSet(set); - } else { - wsFilterActionGroup.setWorkingSet(null); - } - - //ICelement container = CElementFactory.getDefault().getRoot(); - CoreModel factory = CoreModel.getDefault(); - IMemento childMem = memento.getChild(TAG_EXPANDED); - if(childMem != null) { - ArrayList elements = new ArrayList(); - IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT); - for (int i = 0; i < elementMem.length; i++){ - String p = elementMem[i].getString(TAG_PATH); - if (p != null) { - IPath path = new Path(p); - ICElement element = factory.create(path); - if (element != null) { - elements.add(element); - } - } - } - viewer.setExpandedElements(elements.toArray()); - } - childMem = memento.getChild(TAG_SELECTION); - if(childMem != null) { - ArrayList list = new ArrayList(); - IMemento[] elementMem = childMem.getChildren(TAG_ELEMENT); - for (int i = 0; i < elementMem.length; i++){ - String p = elementMem[i].getString(TAG_PATH); - if (p != null) { - IPath path = new Path(p); - ICElement element = factory.create(path); - if (element != null) { - list.add(element); - } - } - } - viewer.setSelection(new StructuredSelection(list)); - } - - Tree tree = viewer.getTree(); - //save vertical position - ScrollBar bar = tree.getVerticalBar(); - if (bar != null) { - try { - String posStr = memento.getString(TAG_VERTICAL_POSITION); - int position; - position = new Integer(posStr).intValue(); - bar.setSelection(position); - position = new Integer(posStr).intValue(); - bar.setSelection(position); - } catch (NumberFormatException e){} - } - bar = tree.getHorizontalBar(); - if (bar != null) { - try { - String posStr = memento.getString(TAG_HORIZONTAL_POSITION); - int position; - position = new Integer(posStr).intValue(); - bar.setSelection(position); - } catch (NumberFormatException e){} - } - } - - public void saveState(IMemento memento) { - if (viewer == null) { - if (this.memento != null) { //Keep the old state; - memento.putMemento(this.memento); - } - return; - } - - //save expanded elements - Tree tree = viewer.getTree(); - Object expandedElements[] = viewer.getExpandedElements(); - if (expandedElements.length > 0) { - IMemento expandedMem = memento.createChild(TAG_EXPANDED); - for (int i = 0; i < expandedElements.length; i++) { - Object o = expandedElements[i]; - // Do not save expanded binary files are libraries. - if (o instanceof IParent - && ! (o instanceof IArchiveContainer || o instanceof IBinaryContainer - || o instanceof IBinary || o instanceof IArchive)) { - IMemento elementMem = expandedMem.createChild(TAG_ELEMENT); - ICElement e = (ICElement)o; - IResource res = e.getResource(); - if (res != null) { - elementMem.putString(TAG_PATH, res.getLocation().toOSString()); - } - } - } - } - - //save selection - Object elements[] = ((IStructuredSelection)viewer.getSelection()).toArray(); - if(elements.length > 0) { - IMemento selectionMem = memento.createChild(TAG_SELECTION); - for (int i = 0; i < elements.length; i++) { - if (elements[i] instanceof ICElement) { - ICElement e = (ICElement)elements[i]; - IResource r = e.getResource(); - if (r != null) { - IMemento elementMem = selectionMem.createChild(TAG_ELEMENT); - elementMem.putString(TAG_PATH,r.getLocation().toString()); - } - } - } - } - - //save vertical position - ScrollBar bar = tree.getVerticalBar(); - int position = bar != null ? bar.getSelection():0; - memento.putString(TAG_VERTICAL_POSITION,String.valueOf(position)); - //save horizontal position - bar = tree.getHorizontalBar(); - position = bar != null ? bar.getSelection():0; - memento.putString(TAG_HORIZONTAL_POSITION,String.valueOf(position)); - - //save filters - String filters[] = getPatternFilter().getPatterns(); - if(filters.length > 0) { - IMemento filtersMem = memento.createChild(TAG_FILTERS); - for (int i = 0; i < filters.length; i++){ - IMemento child = filtersMem.createChild(TAG_FILTER); - child.putString(TAG_ELEMENT,filters[i]); - } - } - - //save library filter - boolean showLibraries= getLibraryFilter().getShowLibraries(); - String show= "true"; //$NON-NLS-1$ - if (!showLibraries) - show= "false"; //$NON-NLS-1$ - memento.putString(TAG_SHOWLIBRARIES, show); - - //Save the working set away - if(workingSetFilter.getWorkingSet() != null) { - String wsname = workingSetFilter.getWorkingSet().getName(); - if(wsname != null) { - memento.putString(TAG_WORKINGSET, wsname); - } - } - } - - void addSearchMenu(IMenuManager menu, IStructuredSelection selection) { - IAdaptable element = (IAdaptable)selection.getFirstElement(); - - if (element instanceof TranslationUnit || - element instanceof CProject) - return; - - MenuManager search = new MenuManager("Search", IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$ - - if (SearchDialogAction.canActionBeAdded(selection)){ - search.add(fSearchDialogAction); - } - - if (FileSearchAction.canActionBeAdded(selection)) { - MenuManager fileSearch = new MenuManager("File Search"); - fileSearch.add(fFileSearchAction); - fileSearch.add(fFileSearchActionInWorkingSet); - search.add(fileSearch); - } - - menu.add(search); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext) - */ - public boolean show(ShowInContext context) { - //@@@ Do something with the selection later? - //ISelection selection = context.getSelection(); - try { - IEditorInput input = (IEditorInput)context.getInput(); - if(input != null) { - IResource res = (IResource)input.getAdapter(IResource.class); - if(res != null) { - selectReveal(new StructuredSelection(res)); - } - } - } catch(Exception ex) { - /* Ignore */ - } - return false; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java deleted file mode 100644 index acdef8208f7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java +++ /dev/null @@ -1,446 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.DropTargetEvent; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.TransferData; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.CopyFilesAndFoldersOperation; -import org.eclipse.ui.actions.MoveFilesAndFoldersOperation; -import org.eclipse.ui.actions.ReadOnlyStateChecker; -import org.eclipse.ui.dialogs.IOverwriteQuery; -import org.eclipse.ui.part.PluginDropAdapter; -import org.eclipse.ui.part.ResourceTransfer; -import org.eclipse.ui.views.navigator.LocalSelectionTransfer; -; - -/** - * Implements drop behaviour for drag and drop operations - * that land on the resource navigator. - */ -class CViewDropAdapter extends PluginDropAdapter implements IOverwriteQuery { - - /** - * A flag indicating that the drop has been cancelled by the user. - */ - protected boolean isCanceled = false; - /** - * A flag indicating that overwrites should always occur. - */ - protected boolean alwaysOverwrite = false; - - /** - * The last valid operation. - */ - private int lastValidOperation = DND.DROP_NONE; - - /* - * @see org.eclipse.swt.dnd.DropTargetListener#dragEnter(org.eclipse.swt.dnd.DropTargetEvent) - */ - public void dragEnter(DropTargetEvent event) { - if (FileTransfer.getInstance().isSupportedType(event.currentDataType) && - event.detail == DND.DROP_DEFAULT) { - // default to copy when dragging from outside Eclipse. Fixes bug 16308. - event.detail = DND.DROP_COPY; - } - super.dragEnter(event); - } - - /** - * Returns an error status with the given info. - */ - protected IStatus error(String message, Throwable exception) { - return new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, exception); - } - - /** - * Returns an error status with the given info. - */ - protected IStatus error(String message) { - return error(message, null); - } - - /** - * Returns an error status, indicating why the given source - * could not be copied or moved. - */ - protected IStatus error(IResource source, String message) { - if (getCurrentOperation() == DND.DROP_COPY) { - return error("Can Not Copy", null); //$NON-NLS-1$ - } else { - return error("Can Not Move", null); //$NON-NLS-1$ - } - } - - /** - * Returns the actual target of the drop, given the resource - * under the mouse. If the mouse target is a file, then the drop actually - * occurs in its parent. If the drop location is before or after the - * mouse target, the target is also the parent. - */ - protected IContainer getActualTarget(IResource mouseTarget) { - /* if cursor is before or after mouseTarget, set target to parent */ - if (getCurrentLocation() == LOCATION_BEFORE || getCurrentLocation() == LOCATION_AFTER) { - return mouseTarget.getParent(); - } - /* if cursor is on a file, return the parent */ - if (mouseTarget.getType() == IResource.FILE) { - return mouseTarget.getParent(); - } - /* otherwise the mouseTarget is the real target */ - return (IContainer)mouseTarget; - } - - /** - * Returns the display - */ - protected Display getDisplay() { - return getViewer().getControl().getDisplay(); - } - - /** - * Returns the shell - */ - protected Shell getShell() { - return getViewer().getControl().getShell(); - } - - /** - * Returns an error status with the given info. - */ - protected IStatus info(String message) { - return new Status(IStatus.INFO, PlatformUI.PLUGIN_ID, 0, message, null); - } - - /** - * CViewDropAction constructor comment. - */ - public CViewDropAdapter(StructuredViewer viewer) { - super(viewer); - } - - /** - * Adds the given status to the list of problems. Discards - * OK statuses. If the status is a multi-status, only its children - * are added. - */ - protected void mergeStatus(MultiStatus status, IStatus toMerge) { - if (!toMerge.isOK()) { - status.merge(toMerge); - } - } - - /** - * Creates a status object from the given list of problems. - */ - protected IStatus multiStatus(List problems, String message) { - IStatus[] children = new IStatus[problems.size()]; - problems.toArray(children); - if (children.length == 1) { - return children[0]; - } else { - return new MultiStatus(PlatformUI.PLUGIN_ID, 0, children, message, null); - } - } - - /** - * Returns an status indicating success. - */ - protected IStatus ok() { - return new Status(Status.OK, PlatformUI.PLUGIN_ID, 0, "Ok", null); //$NON-NLS-1$ - } - - /** - * Opens an error dialog if necessary. Takes care of - * complex rules necessary for making the error dialog look nice. - */ - protected void openError(IStatus status) { - if (status == null) - return; - - String genericTitle = "Error"; //$NON-NLS-1$ - int codes = IStatus.ERROR | IStatus.WARNING; - - //simple case: one error, not a multistatus - if (!status.isMultiStatus()) { - ErrorDialog.openError(getShell(), genericTitle, null, status, codes); - return; - } - - //one error, single child of multistatus - IStatus[] children = status.getChildren(); - if (children.length == 1) { - ErrorDialog.openError(getShell(), status.getMessage(), null, children[0], codes); - return; - } - //several problems - ErrorDialog.openError(getShell(), genericTitle, null, status, codes); - } - - /** - * Returns the resource selection from the LocalSelectionTransfer. - * - * @return the resource selection from the LocalSelectionTransfer - */ - private static final int typeMask = IResource.FOLDER | IResource.FILE; - - private IResource[] getSelectedResources() { - ISelection selection = LocalSelectionTransfer.getInstance().getSelection(); - List resources = new ArrayList(); - - // Sanity checks - if (selection == null || !(selection instanceof IStructuredSelection) || selection.isEmpty()) { - return null; - } - - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - - // loop through list and look for matching items - for (Iterator enum = structuredSelection.iterator(); enum.hasNext();) { - Object object = enum.next(); - IResource resource = null; - - if (object instanceof IResource) { - resource = (IResource) object; - } else if (object instanceof IAdaptable) { - resource = (IResource) ((IAdaptable) object).getAdapter(IResource.class); - } - if (resource != null && (resource.getType() & typeMask) != 0) { - resources.add(resource); - } - } - - IResource[] result = new IResource[resources.size()]; - resources.toArray(result); - - return result; - } - - /** - * Invoked when an action occurs. - * Argument context is the Window which contains the UI from which this action was fired. - * This default implementation prints the name of this class and its label. - * @see IAction#run - */ - public boolean performDrop(final Object data) { - isCanceled = false; - alwaysOverwrite = false; - if (getCurrentTarget() == null || data == null) { - return false; - } - boolean result = false; - IStatus status = null; - IResource[] resources = null; - TransferData currentTransfer = getCurrentTransfer(); - if (LocalSelectionTransfer.getInstance().isSupportedType(currentTransfer)) { - resources = getSelectedResources(); - } else if (ResourceTransfer.getInstance().isSupportedType(currentTransfer)) { - resources = (IResource[]) data; - } else if (FileTransfer.getInstance().isSupportedType(currentTransfer)) { - status = performFileDrop(data); - result = status.isOK(); - } else { - result = super.performDrop(data); - } - if (resources != null) { - if (getCurrentOperation() == DND.DROP_COPY) { - status = performResourceCopy(getShell(), resources); - } else { - status = performResourceMove(resources); - } - } - openError(status); - return result; - } - - /** - * Performs a drop using the FileTransfer transfer type. - */ - private IStatus performFileDrop(Object data) { - MultiStatus problems = new MultiStatus(PlatformUI.PLUGIN_ID, 0, "ProblemI mporting", null); //$NON-NLS-1$ - mergeStatus(problems, validateTarget(getCurrentTarget(), getCurrentTransfer())); - - Object obj = getCurrentTarget(); - IResource res = null; - if (obj instanceof IAdaptable) { - res = (IResource)((IAdaptable) obj).getAdapter(IResource.class); - } - final IContainer target = getActualTarget(res); - final String[] names = (String[]) data; - // Run the import operation asynchronously. - // Otherwise the drag source (e.g., Windows Explorer) will be blocked - // while the operation executes. Fixes bug 16478. - Display.getCurrent().asyncExec(new Runnable() { - public void run() { - getShell().forceActive(); - CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(getShell()); - operation.copyFiles(names, target); - } - }); - return problems; - } - - /** - * Performs a resource copy - */ - private IStatus performResourceCopy(Shell shell, IResource[] sources) { - MultiStatus problems = new MultiStatus(PlatformUI.PLUGIN_ID, 1, "Problems Moving", null); //$NON-NLS-1$ - mergeStatus(problems, validateTarget(getCurrentTarget(), getCurrentTransfer())); - - Object obj = getCurrentTarget(); - IResource res = null; - if (obj instanceof IAdaptable) { - res = (IResource)((IAdaptable) obj).getAdapter(IResource.class); - } - IContainer target = getActualTarget(res); - CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(shell); - operation.copyResources(sources, target); - - return problems; - } - - /** - * Performs a resource move - */ - private IStatus performResourceMove(IResource[] sources) { - MultiStatus problems = new MultiStatus(PlatformUI.PLUGIN_ID, 1, "Problems Moving", null); //$NON-NLS-1$ - mergeStatus(problems, validateTarget(getCurrentTarget(), getCurrentTransfer())); - - Object obj = getCurrentTarget(); - IResource res = null; - if (obj instanceof IAdaptable) { - res = (IResource)((IAdaptable) obj).getAdapter(IResource.class); - } - IContainer target = getActualTarget(res); - ReadOnlyStateChecker checker = new ReadOnlyStateChecker( - getShell(), - "Move Resource Action", //$NON-NLS-1$ - "Move Resource Action");//$NON-NLS-1$ - sources = checker.checkReadOnlyResources(sources); - MoveFilesAndFoldersOperation operation = new MoveFilesAndFoldersOperation(getShell()); - operation.copyResources(sources, target); - - return problems; - } - - /* (non-Javadoc) - * Method declared on IOverWriteQuery - */ - public String queryOverwrite(String pathString) { - final String returnCode[] = {CANCEL}; - final String msg = pathString + " " + CUIPlugin.getResourceString("CViewDragNDrop.txt") ; //$NON-NLS-1$ - final String[] options = {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL}; - getDisplay().syncExec(new Runnable() { - public void run() { - MessageDialog dialog = new MessageDialog(getShell(), "Question", null, msg, MessageDialog.QUESTION, options, 0); //$NON-NLS-1$ - dialog.open(); - int returnVal = dialog.getReturnCode(); - String[] returnCodes = {YES, NO, ALL, CANCEL}; - returnCode[0] = returnVal < 0 ? CANCEL : returnCodes[returnVal]; - } - }); - return returnCode[0]; - } - - /** - * This method is used to notify the action that some aspect of - * the drop operation has changed. - */ - public boolean validateDrop(Object target, int dragOperation, TransferData transferType) { - if (dragOperation != DND.DROP_NONE) { - lastValidOperation = dragOperation; - } - if (FileTransfer.getInstance().isSupportedType(transferType) && - lastValidOperation != DND.DROP_COPY) { - // only allow copying when dragging from outside Eclipse - return false; - } - - if (super.validateDrop(target, dragOperation, transferType)) { - return true; - } - return validateTarget(target, transferType).isOK(); - } - - /** - * Ensures that the drop target meets certain criteria - */ - private IStatus validateTarget(Object target, TransferData transferType) { - if (target instanceof IAdaptable) { - IResource r = (IResource)((IAdaptable) target).getAdapter(IResource.class); - if (r == null) - return info("Target Must Be Resource"); //$NON-NLS-1$ - target = r; - } - - if (!(target instanceof IResource)) { - return info("Target Must Be Resource"); //$NON-NLS-1$ - } - IResource resource = (IResource) target; - if (!resource.isAccessible()) { - return error("Can Not Drop Into Closed Project"); //$NON-NLS-1$ - } - IContainer destination = getActualTarget(resource); - if (destination.getType() == IResource.ROOT) { - return error("Resources Can Not Be Siblings"); //$NON-NLS-1$ - } - String message = null; - // drag within Eclipse? - if (LocalSelectionTransfer.getInstance().isSupportedType(transferType)) { - IResource[] selectedResources = getSelectedResources(); - - if (selectedResources == null) - message = "Drop Operation Error Other"; //$NON-NLS-1$ - else { - CopyFilesAndFoldersOperation operation; - if (lastValidOperation == DND.DROP_COPY) { - operation = new CopyFilesAndFoldersOperation(getShell()); - } - else { - operation = new MoveFilesAndFoldersOperation(getShell()); - } - message = operation.validateDestination(destination, selectedResources); - } - } // file import? - else if (FileTransfer.getInstance().isSupportedType(transferType)) { - String[] sourceNames = (String[]) FileTransfer.getInstance().nativeToJava(transferType); - if (sourceNames == null) { - // source names will be null on Linux. Use empty names to do destination validation. - // Fixes bug 29778 - sourceNames = new String[0]; - } - CopyFilesAndFoldersOperation copyOperation = new CopyFilesAndFoldersOperation(getShell()); - message = copyOperation.validateImportDestination(destination, sourceNames); - } - if (message != null) { - return error(message); - } - return ok(); - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewFrameSource.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewFrameSource.java deleted file mode 100644 index 9502681bae5..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewFrameSource.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.ui.views.framelist.TreeFrame; -import org.eclipse.ui.views.framelist.TreeViewerFrameSource; - -public class CViewFrameSource extends TreeViewerFrameSource { - private CView cview; - - protected TreeFrame createFrame(Object input) { - TreeFrame frame = super.createFrame(input); - frame.setToolTipText(cview.getToolTipText(input)); - return frame; - } - /** - * Also updates the title of the packages explorer - */ - protected void frameChanged(TreeFrame frame) { - super.frameChanged(frame); - cview.updateTitle(); - } - public CViewFrameSource(CView cview) { - super(cview.getResourceViewer()); - this.cview = cview; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.java deleted file mode 100644 index 50daaf74795..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.cview; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class CViewMessages { - - private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.cview.CViewMessages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private CViewMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - } - - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object arg) { - String format= null; - try { - format= fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - if (arg == null) - arg= ""; //$NON-NLS-1$ - return MessageFormat.format(format, new Object[] { arg }); - } - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(fgResourceBundle.getString(key), args); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties deleted file mode 100644 index 14f45cd2779..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewMessages.properties +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - - -CollapseAllAction.label=Collapse All -CollapseAllAction.tooltip=Collapse All -CollapseAllAction.description=Collapse All - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java deleted file mode 100644 index a2cd0d0ca63..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewSorter.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IFunction; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.IInclude; -import org.eclipse.cdt.core.model.ILibraryReference; -import org.eclipse.cdt.core.model.IMacro; -import org.eclipse.cdt.core.model.IMethod; -import org.eclipse.cdt.core.model.IMethodDeclaration; -import org.eclipse.cdt.core.model.INamespace; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.IUsing; -import org.eclipse.cdt.core.model.IVariable; -import org.eclipse.cdt.core.model.IVariableDeclaration; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.viewers.ContentViewer; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * A sorter to sort the file and the folders in the C viewer in the following order: - * 1st Project - * 2nd BinaryContainer - * 3nd ArchiveContainer - * 4 Folder - * 5 C File - * 6 the reset - */ -public class CViewSorter extends ViewerSorter { - - private static final int CMODEL = 0; - private static final int PROJECT = 10; - private static final int RESOURCE = 200; - - public int category (Object element) { - if (element instanceof ICModel) { - return CMODEL; - } else if (element instanceof ICProject) { - return PROJECT; - } else if (element instanceof IBinaryContainer) { - return 20; - } else if (element instanceof IArchiveContainer) { - return 30; - } else if (element instanceof ICContainer) { - return 40; - } else if (element instanceof ITranslationUnit) { - IResource res = null; - res = ((ITranslationUnit)element).getUnderlyingResource(); - if (res != null) { - String ext = res.getFileExtension(); - if (ext != null) { - String[] headers = CoreModel.getDefault().getHeaderExtensions(); - for (int i = 0; i < headers.length; i++) { - if (ext.equals(headers[i])) { - return 42; - } - } - String[] sources = CoreModel.getDefault().getSourceExtensions(); - for (int i = 0; i < sources.length; i++) { - if (ext.equals(sources[i])) { - return 47; - } - } - return 48; - } - return 49; - } - return 50; - } else if (element instanceof IInclude) { - return 60; - } else if (element instanceof IMacro) { - return 70; - } else if (element instanceof INamespace) { - return 80; - } else if (element instanceof IUsing) { - return 90; - } else if (element instanceof IFunctionDeclaration && ! (element instanceof IFunction)) { - return 100; - } else if (element instanceof IMethodDeclaration && !(element instanceof IMethod)) { - return 110; - } else if (element instanceof IVariableDeclaration) { - return 120; - } else if (element instanceof IVariable) { - String name = ((ICElement)element).getElementName(); - if (name.startsWith("__")) { - return 122; - } - if (name.charAt(0) == '_') { - return 124; - } - return 130; - } else if (element instanceof IFunction) { - String name = ((ICElement)element).getElementName(); - if (name.startsWith("__")) { - return 132; - } - if (name.charAt(0) == '_') { - return 134; - } - return 140; - } else if (element instanceof IArchive) { - return 150; - } else if (element instanceof IBinary) { - return 160; - } else if (element instanceof ILibraryReference) { - return 170; - } else if (element instanceof ICElement) { - String name = ((ICElement)element).getElementName(); - if (name.startsWith("__")) { - return 172; - } - if (name.charAt(0) == '_') { - return 174; - } - return 180; - } - return RESOURCE; - } - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) - */ - public int compare(Viewer viewer, Object e1, Object e2) { - int cat1 = category(e1); - int cat2 = category(e2); - - if (cat1 != cat2) - return cat1 - cat2; - - // cat1 == cat2 - - if (cat1 == PROJECT) { - IWorkbenchAdapter a1= (IWorkbenchAdapter)((IAdaptable)e1).getAdapter(IWorkbenchAdapter.class); - IWorkbenchAdapter a2= (IWorkbenchAdapter)((IAdaptable)e2).getAdapter(IWorkbenchAdapter.class); - return getCollator().compare(a1.getLabel(e1), a2.getLabel(e2)); - } - - // non - c resources are sorted using the label from the viewers label provider - if (cat1 == RESOURCE) { - return compareWithLabelProvider(viewer, e1, e2); - } - - String name1; - String name2; - - if (e1 instanceof ICElement) { - name1 = ((ICElement)e1).getElementName(); - } else { - name1 = e1.toString(); - } - if (e2 instanceof ICElement) { - name2 = ((ICElement)e2).getElementName(); - } else { - name2 = e2.toString(); - } - return getCollator().compare(name1, name2); - } - - private int compareWithLabelProvider(Viewer viewer, Object e1, Object e2) { - if (viewer == null || !(viewer instanceof ContentViewer)) { - IBaseLabelProvider prov = ((ContentViewer) viewer).getLabelProvider(); - if (prov instanceof ILabelProvider) { - ILabelProvider lprov= (ILabelProvider) prov; - String name1 = lprov.getText(e1); - String name2 = lprov.getText(e2); - if (name1 != null && name2 != null) { - return getCollator().compare(name1, name2); - } - } - } - return 0; // can't compare - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CollapseAllAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CollapseAllAction.java deleted file mode 100644 index d5581950851..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CollapseAllAction.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.cview; - -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.jface.action.Action; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * Collapse all nodes. - */ -class CollapseAllAction extends Action { - - private CView cview; - - CollapseAllAction(CView part) { - super(CViewMessages.getString("CollapseAllAction.label")); //$NON-NLS-1$ - setDescription(CViewMessages.getString("CollapseAllAction.description")); //$NON-NLS-1$ - setToolTipText(CViewMessages.getString("CollapseAllAction.tooltip")); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_COLLAPSE_ALL); - cview = part; - WorkbenchHelp.setHelp(this, ICHelpContextIds.COLLAPSE_ALL_ACTION); - } - - public void run() { - cview.collapseAll(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/DefaultAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/DefaultAction.java deleted file mode 100644 index ff7099d249e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/DefaultAction.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.jface.action.Action; -import org.eclipse.swt.SWT; - -public class DefaultAction extends Action { - - Shell shell; - - DefaultAction (Shell shell, String s) { - super (s); - this.shell = shell; - } - - public void run() { - MessageBox errorMsg = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK); - errorMsg.setText("WIP"); - errorMsg.setMessage ("Work In Progress"); - errorMsg.open(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java deleted file mode 100644 index 51f77ec9e03..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FilterSelectionAction.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.StringWriter; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.SelectionProviderAction; -import org.eclipse.ui.dialogs.ListSelectionDialog; - -import org.eclipse.cdt.ui.CUIPlugin; -//import org.eclipse.cdt.core.model.CElementFilters; - -/** - * The FilterAction is the class that adds the filter views to a PackagesView. - */ -class FilterSelectionAction extends SelectionProviderAction { - - - private CView cview; - private Shell shell; - - /** - * Create a new filter action - * @param shell the shell that will be used for the list selection - * @param packages the PackagesExplorerPart - * @param label the label for the action - */ - public FilterSelectionAction(Shell shell, CView cview, String label) { - super(cview.getViewer(), label); - setToolTipText("Filter Selection Action"); - setEnabled(true); - this.shell= shell; - this.cview= cview; - } - - /** - * Implementation of method defined on IAction. - */ - public void run() { - CPatternFilter filter= cview.getPatternFilter(); - FiltersContentProvider contentProvider= new FiltersContentProvider(filter); - - ListSelectionDialog dialog = - new ListSelectionDialog( - shell, - cview.getViewer(), - contentProvider, - new LabelProvider(), - "Select the filters to apply (matching files will be hidden):"); - - dialog.setInitialSelections(contentProvider.getInitialSelections()); - dialog.setTitle("C/C++ File Filters"); - dialog.open(); - if (dialog.getReturnCode() == Window.OK) { - Object[] results= dialog.getResult(); - String[] selectedPatterns= new String[results.length]; - System.arraycopy(results, 0, selectedPatterns, 0, results.length); - filter.setPatterns(selectedPatterns); - CElementFilters.setPatterns(selectedPatterns); - saveInPreferences(selectedPatterns); - TreeViewer viewer= cview.getViewer(); - viewer.getControl().setRedraw(false); - viewer.refresh(); - viewer.getControl().setRedraw(true); - } - } - /** - * Save the supplied patterns in the preferences for the UIPlugin. - * They are saved in the format patern,pattern,. - */ - private void saveInPreferences(String[] patterns) { - CUIPlugin plugin= CUIPlugin.getDefault(); - StringWriter writer= new StringWriter(); - - for (int i = 0; i < patterns.length; i++) { - writer.write(patterns[i]); - writer.write(CPatternFilter.COMMA_SEPARATOR); - } - - plugin.getPreferenceStore().setValue( - CPatternFilter.FILTERS_TAG, writer.toString()); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FiltersContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FiltersContentProvider.java deleted file mode 100644 index e765844cfd9..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/FiltersContentProvider.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; - -import org.eclipse.cdt.ui.CUIPlugin; - -/** - * The FiltersContentProvider provides the elements for use by the list dialog - * for selecting the patterns to apply. - */ -class FiltersContentProvider implements IStructuredContentProvider { - private static List fgDefinedFilters; - private static List fgDefaultFilters; - - private CPatternFilter filter; - - /** - * Disposes of this content provider. - * This is called by the viewer when it is disposed. - */ - public void dispose() {} - /** - * Returns the filters which are enabled by default. - * - * @return a list of strings - */ - public static List getDefaultFilters() { - if (fgDefaultFilters == null) { - readFilters(); - } - return fgDefaultFilters; - } - /** - * Returns the filters currently defined for the workbench. - */ - public static List getDefinedFilters() { - if (fgDefinedFilters == null) { - readFilters(); - } - return fgDefinedFilters; - } - /* (non-Jaadoc) - * Method declared in IStructuredContentProvider. - */ - public Object[] getElements(Object inputElement) { - return getDefinedFilters().toArray(); - } - /** - * Return the initially selected values - * @return java.lang.String[] - */ - public String[] getInitialSelections() { - return filter.getPatterns(); - } - /* (non-Javadoc) - * Method declared on IContentProvider. - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - /** - * Create a FiltersContentProvider using the selections from the suppliec - * resource filter. - */ - public FiltersContentProvider(CPatternFilter filter) { - this.filter= filter; - } - /** - * Reads the filters currently defined for the workbench. - */ - private static void readFilters() { - fgDefinedFilters = new ArrayList(); - fgDefaultFilters = new ArrayList(); - CUIPlugin plugin = CUIPlugin.getDefault(); - if (plugin != null) { - IExtensionPoint extension = plugin.getDescriptor().getExtensionPoint(CPatternFilter.FILTERS_TAG); - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - for(int i = 0; i < extensions.length; i++){ - IConfigurationElement [] configElements = extensions[i].getConfigurationElements(); - for(int j = 0; j < configElements.length; j++){ - String pattern = configElements[j].getAttribute("pattern"); //$NON-NLS-1$ - if (pattern != null) - fgDefinedFilters.add(pattern); - String selected = configElements[j].getAttribute("selected"); //$NON-NLS-1$ - if (selected != null && selected.equalsIgnoreCase("true")) //$NON-NLS-1$ - fgDefaultFilters.add(pattern); - } - } - } - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java deleted file mode 100644 index 30b115c3d20..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/ShowLibrariesAction.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.cdt.internal.ui.cview; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.SelectionProviderAction; - -import org.eclipse.cdt.ui.CUIPlugin; - -/** - * The ShowLibrariesAction is the class that adds the filter views to a PackagesView. - */ -class ShowLibrariesAction extends SelectionProviderAction { - - private CView cview; - private Shell shell; - - /** - * Create a new filter action - * @param shell the shell that will be used for the list selection - * @param packages the PackagesExplorerPart - * @param label the label for the action - */ - public ShowLibrariesAction(Shell shell, CView cview, String label) { - super(cview.getViewer(), label); - this.cview = cview; - CLibFilter filter = cview.getLibraryFilter(); - setChecked(filter.getShowLibraries()); - updateToolTipText(); - setEnabled(true); - this.shell= shell; - } - - /** - * Implementation of method defined on IAction. - */ - public void run() { - CLibFilter filter = cview.getLibraryFilter(); - filter.setShowLibraries(isChecked()); - updateToolTipText(); - saveInPreferences(); - - cview.getViewer().getControl().setRedraw(false); - cview.getViewer().refresh(); - cview.getViewer().getControl().setRedraw(true); - } - - /** - * Save the supplied patterns in the preferences for the UIPlugin. - * They are saved in the format patern,pattern,. - */ - private void saveInPreferences() { - CUIPlugin plugin = CUIPlugin.getDefault(); - Boolean b = new Boolean (cview.getLibraryFilter().getShowLibraries()); - - plugin.getPreferenceStore().putValue(CView.TAG_SHOWLIBRARIES, b.toString()); - } - - private void updateToolTipText() { - CLibFilter filter = cview.getLibraryFilter(); - if (filter.getShowLibraries()) - setToolTipText("Hide Referenced Libs"); - else - setToolTipText("Show Referenced Libs"); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java deleted file mode 100644 index bf7a17a9866..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/AbstractElementListSelectionDialog.java +++ /dev/null @@ -1,277 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.jface.viewers.ILabelProvider; - -/** - * A class to select one or more elements out of an indexed property - */ -public abstract class AbstractElementListSelectionDialog extends SelectionStatusDialog { - - private ILabelProvider fRenderer; - private boolean fIgnoreCase; - private boolean fIsMultipleSelection; - - private SelectionList fSelectionList; - private Label fMessage; - private ISelectionValidator fValidator; - - private String fMessageText; - private String fEmptyListMessage; - private String fNothingSelectedMessage; - - private StatusInfo fCurrStatus; - - /* - * @private - */ - protected void access$superOpen() { - super.open(); - } - /* - * @private - * @see Dialog#cancelPressed - */ - protected void cancelPressed() { - setResult(null); - super.cancelPressed(); - } - protected Point computeInitialSize() { - return new Point(convertWidthInCharsToPixels(60), convertHeightInCharsToPixels(18)); - } - /* - * @private - * @see Window#createDialogArea(Composite) - */ - protected Control createDialogArea(Composite parent) { - Composite contents= (Composite)super.createDialogArea(parent); - - fMessage= createMessage(contents); - - int flags= fIsMultipleSelection ? SWT.MULTI : SWT.SINGLE; - fSelectionList= new SelectionList(contents, flags | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, - fRenderer, fIgnoreCase); - - fSelectionList.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - handleDoubleClick(); - } - public void widgetSelected(SelectionEvent e) { - verifyCurrentSelection(); - } - }); - - GridData spec= new GridData(); - Point initialSize= computeInitialSize(); - spec.widthHint= initialSize.x; - spec.heightHint= initialSize.y; - spec.grabExcessVerticalSpace= true; - spec.grabExcessHorizontalSpace= true; - spec.horizontalAlignment= GridData.FILL; - spec.verticalAlignment= GridData.FILL; - fSelectionList.setLayoutData(spec); - - return contents; - } - /** - * Creates the message text widget and sets layout data. - */ - protected Label createMessage(Composite parent) { - Label text= new Label(parent, SWT.NULL); - text.setText(fMessageText); - GridData spec= new GridData(); - spec.grabExcessVerticalSpace= false; - spec.grabExcessHorizontalSpace= true; - spec.horizontalAlignment= GridData.FILL; - spec.verticalAlignment= GridData.BEGINNING; - text.setLayoutData(spec); - return text; - } - /* - * @private - * @see Window#create(Shell) - */ - public void create() { - super.create(); - if (isEmptyList()) { - fMessage.setEnabled(false); - fSelectionList.setEnabled(false); - } else { - verifyCurrentSelection(); - fSelectionList.selectFilterText(); - fSelectionList.setFocus(); - } - } - /** - * Returns the currently used filter text. - */ - protected String getFilter() { - return fSelectionList.getFilter(); - } - /** - * Returns the selection indices. - */ - protected int[] getSelectionIndices() { - return fSelectionList.getSelectionIndices(); - } - /** - * Returns the widget selection. Returns empty list when the widget is not - * usable. - */ - protected List getWidgetSelection() { - if (fSelectionList == null || fSelectionList.isDisposed()) - return new ArrayList(0); - return fSelectionList.getSelection(); - } - /** - * An element as been selected in the list by double clicking on it. - * Emulate a OK button pressed to close the dialog. - */ - protected abstract void handleDoubleClick(); - /** - * Checks whether the list of elements is empty or not. - */ - protected boolean isEmptyList() { - if (fSelectionList == null) - return true; - return fSelectionList.isEmptyList(); - } - /** - * Constructs a list selection dialog. - * @param renderer The label renderer used - * @param ignoreCase Decides if the match string ignores lower/upppr case - * @param multipleSelection Allow multiple selection - */ - protected AbstractElementListSelectionDialog(Shell parent, String title, Image image, ILabelProvider renderer, boolean ignoreCase, boolean multipleSelection) { - super(parent); - setTitle(title); - setImage(image); - fRenderer= renderer; - fIgnoreCase= ignoreCase; - fIsMultipleSelection= multipleSelection; - - fMessageText= ""; //$NON-NLS-1$ - - fCurrStatus= new StatusInfo(); - - fValidator= null; - fEmptyListMessage= ""; //$NON-NLS-1$ - fNothingSelectedMessage= ""; //$NON-NLS-1$ - } - /** - * Constructs a list selection dialog. - * @param renderer The label renderer used - * @param ignoreCase Decides if the match string ignores lower/upppr case - * @param multipleSelection Allow multiple selection - */ - protected AbstractElementListSelectionDialog(Shell parent, ILabelProvider renderer, boolean ignoreCase, boolean multipleSelection) { - this(parent, "", null, renderer, ignoreCase, multipleSelection); //$NON-NLS-1$ - } - /* - * @private - */ - public int open() { - BusyIndicator.showWhile(null, new Runnable() { - public void run() { - access$superOpen(); - } - }); - return getReturnCode() ; - } - /** - * Refilters the current list according to the filter entered into the - * text edit field. - */ - protected void refilter() { - fSelectionList.filter(true); - } - /** - * If a empty-list message is set, a error message is shown - * Must be set before widget creation - */ - public void setEmptyListMessage(String message) { - fEmptyListMessage= message; - } - /** - * Sets the filter text to the given value. - */ - protected void setFilter(String text, boolean refilter) { - fSelectionList.setFilter(text, refilter); - } - /** - * Sets the message to be shown above the match text field. - * Must be set before widget creation - */ - public void setMessage(String message) { - fMessageText= message; - } - /** - * If the selection is empty, this message is shown - */ - public void setNothingSelectedMessage(String message) { - fNothingSelectedMessage= message; - } - /** - * Selects the elements in the list determined by the given - * selection indices. - */ - protected void setSelection(int[] selection) { - fSelectionList.setSelection(selection); - } - /** - * Initializes the selection list widget with the given list of - * elements. - */ - protected void setSelectionListElements(List elements, boolean refilter) { - fSelectionList.setElements(elements, refilter); - } - /** - * A validator can be set to check if the current selection - * is valid - */ - public void setValidator(ISelectionValidator validator) { - fValidator= validator; - } - /** - * Verifies the current selection and updates the status line - * accordingly. - */ - protected boolean verifyCurrentSelection() { - List sel= getWidgetSelection(); - int length= sel.size(); - if (length > 0) { - if (fValidator != null) { - fValidator.isValid(sel.toArray(), fCurrStatus); - } else { - fCurrStatus.setOK(); - } - } else { - if (isEmptyList()) { - fCurrStatus.setError(fEmptyListMessage); - } else { - fCurrStatus.setError(fNothingSelectedMessage); - } - } - updateStatus(fCurrStatus); - return fCurrStatus.isOK(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ElementListSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ElementListSelectionDialog.java deleted file mode 100644 index 830e08ba5e6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ElementListSelectionDialog.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.ILabelProvider; - -/** - * A class to select one or more elements out of an indexed property - */ -public class ElementListSelectionDialog extends AbstractElementListSelectionDialog { - - private List fElements; - - /* - * @private - */ - protected void computeResult() { - setResult(getWidgetSelection()); - } - /* - * @private - */ - protected Control createDialogArea(Composite parent) { - Control result= super.createDialogArea(parent); - - setSelectionListElements(fElements, false); - //a little trick to make the window come up faster - String initialFilter= null; - if (getPrimaryInitialSelection() instanceof String) - initialFilter= (String)getPrimaryInitialSelection(); - if (initialFilter != null) - setFilter(initialFilter, true); - else - refilter(); - - return result; - } - public Object getSelectedElement() { - return getPrimaryResult(); - } - public Object[] getSelectedElements() { - return getResult(); - } - /* - * @private - */ - protected void handleDoubleClick() { - if (verifyCurrentSelection()) { - buttonPressed(IDialogConstants.OK_ID); - } - } - /** - * Constructs a list selection dialog. - * @param renderer The label renderer used - * @param ignoreCase Decides if the match string ignores lower/upper case - * @param multipleSelection Allow multiple selection - */ - public ElementListSelectionDialog(Shell parent, String title, Image image, ILabelProvider renderer, boolean ignoreCase, boolean multipleSelection) { - super (parent, title, image, renderer, ignoreCase, multipleSelection); - } - /** - * Constructs a list selection dialog. - * @param renderer The label renderer used - * @param ignoreCase Decides if the match string ignores lower/upppr case - * @param multipleSelection Allow multiple selection - */ - public ElementListSelectionDialog(Shell parent, ILabelProvider renderer, boolean ignoreCase, boolean multipleSelection) { - this(parent, "", null, renderer, ignoreCase, multipleSelection); //$NON-NLS-1$ - } - public int open(Object[] elements) { - return open(Arrays.asList(elements)); - } - public int open(Object[] elements, String initialSelection) { - return open(Arrays.asList(elements), initialSelection); - } - /** - * Open the dialog. - * @param elements The elements to show in the list - * @return Returns OK or CANCEL - */ - public int open(List elements) { - setElements(elements); - return open(); - } - /** - * Open the dialog. - * @param elements The elements to show in the list - * @param initialSelection The initial content of the match text box. - * @return Returns OK or CANCEL - */ - public int open(List elements, String initialSelection) { - setElements(elements); - setInitialSelection(initialSelection); - return open(); - } - /** - * Sets the elements presented by this dialog. - */ - public void setElements(List elements) { - fElements= elements; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ISelectionValidator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ISelectionValidator.java deleted file mode 100644 index cf1849fa205..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/ISelectionValidator.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -public interface ISelectionValidator { - void isValid(Object[] selection, StatusInfo res); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/IStatusChangeListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/IStatusChangeListener.java deleted file mode 100644 index f8b0d90cd55..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/IStatusChangeListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.IStatus; - -public interface IStatusChangeListener { - - /** - * Called to annonce that the given status has changed - */ - void statusChanged(IStatus status); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/MessageLine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/MessageLine.java deleted file mode 100644 index 9adc3fb1d60..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/MessageLine.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Composite; - -/** - * A message line. It distinguishs between "normal" messages and errors. - * Setting an error message hides a currently displayed message until - * clearErrorMessage is called. - */ -public class MessageLine extends CLabel { - - private String fMessageText; - private String fErrorText; - - private Color fDefaultColor; - private RGB fErrorRGB; - protected Color fErrorColor; - - private static RGB fgErrorRGB= new RGB(200, 0, 0); - - /** - * Clears the currently displayed error message and redisplayes - * the message which was active before the error message was set. - */ - public void clearErrorMessage() { - setErrorMessage(null); - } - /** - * Clears the currently displayed message. - */ - public void clearMessage() { - setMessage(null); - } - /** - * Get the currently displayed error text. - * @return The error message. If no error message is displayed null is returned. - */ - public String getErrorMessage() { - return fErrorText; - } - /** - * Get the currently displayed message. - * @return The message. If no message is displayed null is returned. - */ - public String getMessage() { - return fMessageText; - } - /** - * Creates a new message line as a child of the parent and with the given SWT stylebits. - * Error message will be shown with in the given rgb color. - */ - public MessageLine(Composite parent, int style, RGB errorRGB) { - super(parent, style); - fDefaultColor= getForeground(); - fErrorRGB= errorRGB; - } - /** - * Creates a new message line as a child of the parent and with the given SWT stylebits. - * Error message will be shown with in the rgb color 200,0,0. - */ - public MessageLine(Composite parent, int style) { - super(parent, style); - fDefaultColor= getForeground(); - fErrorRGB= fgErrorRGB; - } - /** - * Creates a new message line as a child of the given parent. - * Error message will be shown with in the rgb color 200,0,0. - */ - public MessageLine(Composite parent) { - this(parent, SWT.LEFT); - } - /** - * Sets the default error color used by all message lines. - * Note: a call to this method only affects newly created MessageLines not existing ones. - */ - public static void setErrorColor(RGB color) { - fgErrorRGB= color; - } - /** - * Display the given error message. A currently displayed message - * is saved and will be redisplayed when the error message is cleared. - */ - public void setErrorMessage(String message) { - fErrorText= message; - - if (message == null) { - setMessage(fMessageText); - } else { - if (fErrorColor == null) { - fErrorColor= new Color(getDisplay(), fErrorRGB); - addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - fErrorColor.dispose(); - } - }); - } - setForeground(fErrorColor); - setText(message); - } - } - /** - * Set the message text. If the message line currently displays an error, - * the message is stored and will be shown after a call to clearErrorMessage - */ - public void setMessage(String message) { - fMessageText= message; - if (message == null) - message= ""; //$NON-NLS-1$ - if (fErrorText == null) { - setForeground(fDefaultColor); - setText(message); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java deleted file mode 100644 index b1318f67f99..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionList.java +++ /dev/null @@ -1,250 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; - -import org.eclipse.jface.viewers.ILabelProvider; - -import org.eclipse.cdt.internal.ui.util.StringMatcher; -import org.eclipse.cdt.internal.ui.util.TwoArrayQuickSort; - -/** - * A selection widget that consists of a list and a text entry field. The list - * of elements presented are limited to the pattern entered into the text entry - * field. - */ -public class SelectionList extends Composite { - - // State - private Object[] fElements; - protected ILabelProvider fRenderer; - private boolean fIgnoreCase; - - // Implementation details - private String[] fRenderedStrings; - private int[] fFilteredElements; - private String fRememberedMatchText; - - // SWT widgets - private Table fList; - private Text fText; - - /** - * Adds a selection change listener to this widget. - */ - public void addSelectionListener(SelectionListener listener) { - fList.addSelectionListener(listener); - } - private void createList(int style) { - fList= new Table(this, style); - fList.setLayoutData(new GridData(GridData.FILL_BOTH)); - fList.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - fRenderer.dispose(); - } - }); - } - private void createText() { - fText= new Text(this, SWT.BORDER); - GridData spec= new GridData(); - spec.grabExcessVerticalSpace= false; - spec.grabExcessHorizontalSpace= true; - spec.horizontalAlignment= GridData.FILL; - spec.verticalAlignment= GridData.BEGINNING; - fText.setLayoutData(spec); - Listener l= new Listener() { - public void handleEvent(Event evt) { - filter(false); - } - }; - fText.addListener(SWT.Modify, l); - } - /** - * Filters the list of elements according to the pattern entered - * into the text entry field. - */ - public void filter(boolean forceUpdate) { - int k= 0; - String text= fText.getText(); - if (!forceUpdate && text.equals(fRememberedMatchText)) - return; - fRememberedMatchText= text; - StringMatcher matcher= new StringMatcher(text+"*", fIgnoreCase, false); //$NON-NLS-1$ - for (int i= 0; i < fElements.length; i++) { - if (matcher.match(fRenderedStrings[i])) { - fFilteredElements[k]= i; - k++; - } - } - fFilteredElements[k]= -1; - updateListWidget(fFilteredElements, k); - } - /** - * Returns the currently used filter text. - */ - public String getFilter() { - return fText.getText(); - } - /** - * Returns the selection indices. - */ - public int[] getSelectionIndices() { - return fList.getSelectionIndices(); - } - /** - * Returns a list of selected elements. Note that the type of the elements - * returned in the list are the same as the ones passed to the selection list - * via setElements. The list doesn't contain the rendered strings. - */ - public List getSelection() { - if (fList == null || fList.isDisposed() || fList.getSelectionCount() == 0) - return new ArrayList(0); - int[] listSelection= fList.getSelectionIndices(); - List selected= new ArrayList(listSelection.length); - for (int i= 0; i < listSelection.length; i++) { - selected.add(fElements[fFilteredElements[listSelection[i]]]); - } - return selected; - } - /** - * Returns true when the list of elements is empty. - */ - public boolean isEmptyList() { - return fElements == null || fElements.length == 0; - } - /** - * Creates new instance of the widget. - */ - public SelectionList(Composite parent, int style, ILabelProvider renderer, boolean ignoreCase) { - super(parent, SWT.NONE); - fRenderer= renderer; - fIgnoreCase= ignoreCase; - GridLayout layout= new GridLayout(); - layout.marginHeight= 0; layout.marginWidth= 0; - //XXX: 1G9V58A: ITPUI:WIN2000 - Dialog.convert* methods should be static - setLayout(layout); - createText(); - createList(style); - } - /** - * Removes a selection change listener to this widget. - */ - public void removeSelectionListener(SelectionListener listener) { - fList.removeSelectionListener(listener); - } - private String[] renderStrings() { - String[] strings= new String[fElements.length]; - for (int i= 0; i < strings.length; i++) { - strings[i]= fRenderer.getText(fElements[i]); - } - TwoArrayQuickSort.sort(strings, fElements, fIgnoreCase); - return strings; - } - /** - * Select the pattern text. - */ - public void selectFilterText() { - fText.selectAll(); - } - /** - * Sets the list of elements presented in the widget. - */ - public void setElements(List elements, boolean refilter) { - // We copy the list since we sort it. - if (elements == null) - fElements= new Object[0]; - else - fElements= elements.toArray(); - fFilteredElements= new int[fElements.length+1]; - fRenderedStrings= renderStrings(); - if (refilter) - filter(true); - } - /* - * Non Java-doc - */ - public void setEnabled(boolean enable) { - super.setEnabled(enable); - fText.setEnabled(enable); - fList.setEnabled(enable); - } - /** - * Sets the filter pattern. Current only prefix filter pattern are supported. - */ - public void setFilter(String pattern, boolean refilter) { - fText.setText(pattern); - if (refilter) - filter(true); - } - /* - * Non Java-doc - */ - public boolean setFocus() { - return fText.setFocus(); - } - /* - * Non Java-doc - */ - public void setFont(Font font) { - super.setFont(font); - fText.setFont(font); - fList.setFont(font); - } - /** - * Selects the elements in the list determined by the given - * selection indices. - */ - protected void setSelection(int[] selection) { - fList.setSelection(selection); - } - private void updateListWidget(int[] indices, int size) { - if (fList == null || fList.isDisposed()) - return; - fList.setRedraw(false); - int itemCount= fList.getItemCount(); - if (size < itemCount) { - fList.remove(0, itemCount-size-1); - } - - TableItem[] items= fList.getItems(); - for (int i= 0; i < size; i++) { - TableItem ti= null; - if (i < itemCount) { - ti= items[i]; - } else { - ti= new TableItem(fList, i); - } - ti.setText(fRenderedStrings[indices[i]]); - Image img= fRenderer.getImage(fElements[indices[i]]); - if (img != null) - ti.setImage(img); - } - if (fList.getItemCount() > 0) { - fList.setSelection(0); - } - - fList.setRedraw(true); - Event event= new Event(); - fList.notifyListeners(SWT.Selection, event); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionStatusDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionStatusDialog.java deleted file mode 100644 index 69c8cdd11d6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/SelectionStatusDialog.java +++ /dev/null @@ -1,187 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.ui.dialogs.SelectionDialog; - -import org.eclipse.core.runtime.IStatus; - -/** - * An abstract base class for dialogs with a status bar and ok/cancel buttons. - * The status message must be passed over as StatusInfo object and can be - * an error, warning or ok. The OK button is enabled / disabled depending - * on the status. - */ -public abstract class SelectionStatusDialog extends SelectionDialog { - - private MessageLine fStatusLine; - private IStatus fLastStatus; - private Image fImage; - private boolean fInitialSelectionSet; - private boolean fStatusLineAboveButtons= false; - - - /** - * Compute the result and return it. - */ - protected abstract void computeResult(); - /* (non-Javadoc) - * Method declared in Window. - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (fImage != null) - shell.setImage(fImage); - } - /* (non-Javadoc) - * Method declared in Dialog. - */ - protected Control createButtonBar(Composite parent) { - Composite composite= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - if (fStatusLineAboveButtons) { - layout.verticalSpacing= 0; - } else { - layout.numColumns= 2; - } - layout.marginHeight= 0; layout.marginWidth= 0; - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fStatusLine= new MessageLine(composite); - fStatusLine.setAlignment(SWT.LEFT); - fStatusLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fStatusLine.setMessage(""); //$NON-NLS-1$ - - super.createButtonBar(composite); - return composite; - } - /* (non-Javadoc) - * Method declared in Dialog. - */ - public void create() { - super.create(); - if (fLastStatus != null) { - updateStatus(fLastStatus); - } - } - /** - * Returns the first element of the initial selection or null - * if there isn't any initial selection. - * @return the first element of the initial selection. - */ - protected Object getPrimaryInitialSelection() { - List result= getInitialElementSelections(); - if (result == null || result.size() == 0) - return null; - return result.get(0); - } - /** - * Returns the first element from the list of results. Returns null - * if no element has been selected. - * - * @return the first result element if one exists. Otherwise null is - * returned. - */ - public Object getPrimaryResult() { - Object[] result= getResult(); - if (result == null || result.length == 0) - return null; - return result[0]; - } - public SelectionStatusDialog(Shell parent) { - super(parent); - fInitialSelectionSet= false; - } - /* (non-Javadoc) - * Method declared in Dialog. - */ - protected void okPressed() { - computeResult(); - super.okPressed(); - } - /** - * Sets the image for this dialog. - * - * @param image the dialog's image - */ - public void setImage(Image image) { - fImage= image; - } - protected void setInitialSelection(int position, Object element) { - List l= getInitialElementSelections(); - l.set(position, element); - fInitialSelectionSet= true; - } - /** - * Sets the initial selection to the given element. - */ - public void setInitialSelection(Object element) { - // Allow clients to use set their own initial selection(s) - if (fInitialSelectionSet && element != null && element.equals("A")) //$NON-NLS-1$ - return; - - if (element != null) { - setInitialSelections(new Object[] { element }); - } else { - setInitialSelections(new Object[0]); - } - } - public void setInitialSelections(Object[] selectedElements) { - super.setInitialSelections(selectedElements); - fInitialSelectionSet= true; - } - /** - * Sets a result element at the given position. - */ - protected void setResult(int position, Object element) { - Object[] result= getResult(); - result[position]= element; - setResult(Arrays.asList(result)); - } - /** - * Controls whether status line appears to the left of the buttons (default) - * or above them. - * - * @param aboveButtons if true status line is placed above buttons; if - * false to the right - */ - public void setStatusLineAboveButtons(boolean aboveButtons) { - fStatusLineAboveButtons= aboveButtons; - } - /** - * Update the status of the ok button to reflect the given status. Subclasses - * may override this method to update additional buttons. - */ - protected void updateButtonsEnableState(IStatus status) { - Button okButton= getOkButton(); - if (okButton != null && !okButton.isDisposed()) - okButton.setEnabled(!status.matches(IStatus.ERROR)); - } - /** - * Update the dialog's status line to reflect the given status. It is safe to call - * this method before the dialog has been opened. - */ - protected void updateStatus(IStatus status) { - fLastStatus= status; - if (fStatusLine != null && !fStatusLine.isDisposed()) { - updateButtonsEnableState(status); - StatusTool.applyToStatusLine(fStatusLine, status); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusDialog.java deleted file mode 100644 index 7064e0caaab..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusDialog.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; - -import org.eclipse.core.runtime.IStatus; - -/** - * An abstract base class for dialogs with a status bar and ok/cancel buttons. - * The status message must be passed over as StatusInfo object and can be - * an error, warning or ok. The OK button is enabled or disabled depending - * on the status. - */ -public abstract class StatusDialog extends Dialog { - - private Button fOkButton; - private MessageLine fStatusLine; - private IStatus fLastStatus; - private String fTitle; - private Image fImage; - - private boolean fStatusLineAboveButtons; - - /** - * Creates an instane of a status dialog. - */ - public StatusDialog(Shell parent) { - super(parent); - fStatusLineAboveButtons= false; - } - - /** - * Specifies whether status line appears to the left of the buttons (default) - * or above them. - * - * @param aboveButtons if true status line is placed above buttons; if - * false to the right - */ - public void setStatusLineAboveButtons(boolean aboveButtons) { - fStatusLineAboveButtons= aboveButtons; - } - - /** - * Update the dialog's status line to reflect the given status. - * It is save to call this method before the dialog has been opened. - */ - protected void updateStatus(IStatus status) { - fLastStatus= status; - if (fStatusLine != null && !fStatusLine.isDisposed()) { - updateButtonsEnableState(status); - fStatusLine.setErrorMessage(status.getMessage()); - } - } - - /** - * Returns the last status. - */ - public IStatus getStatus() { - return fLastStatus; - } - - /** - * Updates the status of the ok button to reflect the given status. - * Subclasses may override this method to update additional buttons. - * @param status the status. - */ - protected void updateButtonsEnableState(IStatus status) { - if (fOkButton != null && !fOkButton.isDisposed()) - fOkButton.setEnabled(!status.matches(IStatus.ERROR)); - } - - /* - * @see Window#create(Shell) - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (fTitle != null) - shell.setText(fTitle); - } - - /* - * @see Window#create() - */ - public void create() { - super.create(); - if (fLastStatus != null) { - // policy: dialogs are not allowed to come up with an error message - if (fLastStatus.matches(IStatus.ERROR)) { - StatusInfo status= new StatusInfo(); - status.setError(""); //$NON-NLS-1$ - fLastStatus= status; - } - updateStatus(fLastStatus); - } - } - - /* - * @see Dialog#createButtonsForButtonBar(Composite) - */ - protected void createButtonsForButtonBar(Composite parent) { - fOkButton= createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - } - - /* - * @see Dialog#createButtonBar(Composite) - */ - protected Control createButtonBar(Composite parent) { - Composite composite= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - layout.numColumns= 1; - layout.marginHeight= 0; - layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - fStatusLine= new MessageLine(composite); - fStatusLine.setAlignment(SWT.LEFT); - fStatusLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fStatusLine.setErrorMessage(null); //$NON-NLS-1$ - - super.createButtonBar(composite); - return composite; - } - - /** - * Sets the title for this dialog. - * @param title the title. - */ - public void setTitle(String title) { - fTitle= title != null ? title : ""; //$NON-NLS-1$ - Shell shell= getShell(); - if ((shell != null) && !shell.isDisposed()) - shell.setText(fTitle); - } - - /** - * Sets the image for this dialog. - * @param image the image. - */ - public void setImage(Image image) { - fImage= image; - Shell shell= getShell(); - if ((shell != null) && !shell.isDisposed()) - shell.setImage(fImage); - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusInfo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusInfo.java deleted file mode 100644 index 8e531198b71..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusInfo.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.cdt.core.CCorePlugin; - -/** - * A settable IStatus - * Can be an error, warning, info or ok. For error, info and warning states, - * a message describes the problem - */ -public class StatusInfo implements IStatus { - - private String fStatusMessage; - private int fSeverity; - - /** - * @see IStatus#getChildren() - */ - public IStatus[] getChildren() { - return new IStatus[0]; - } - /** - * @see IStatus#getCode() - */ - public int getCode() { - return fSeverity; - } - /** - * @see IStatus#getException() - */ - public Throwable getException() { - return null; - } - /** - * @see IStatus#getMessage - */ - public String getMessage() { - return fStatusMessage; - } - /** - * @see IStatus#getPlugin() - */ - public String getPlugin() { - return CCorePlugin.PLUGIN_ID; - } - /** - * @see IStatus#getSeverity() - */ - public int getSeverity() { - return fSeverity; - } - public boolean isError() { - return fSeverity == IStatus.ERROR; - } - public boolean isInfo() { - return fSeverity == IStatus.INFO; - } - /** - * @see IStatus#isMultiStatus() - */ - public boolean isMultiStatus() { - return false; - } - public boolean isOK() { - return fSeverity == IStatus.OK; - } - public boolean isWarning() { - return fSeverity == IStatus.WARNING; - } - /** - * @see IStatus#matches(int) - */ - public boolean matches(int severityMask) { - return (fSeverity & severityMask) != 0; - } - public void setError(String errorMessage) { - fStatusMessage= errorMessage; - fSeverity= IStatus.ERROR; - } - public void setInfo(String infoMessage) { - fStatusMessage= infoMessage; - fSeverity= IStatus.INFO; - } - public void setOK() { - fStatusMessage= null; - fSeverity= IStatus.OK; - } - public void setWarning(String warningMessage) { - fStatusMessage= warningMessage; - fSeverity= IStatus.WARNING; - } - public StatusInfo() { - fStatusMessage= null; - fSeverity= OK; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusTool.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusTool.java deleted file mode 100644 index 89471bedd91..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusTool.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.cdt.internal.ui.dialogs; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.jface.dialogs.DialogPage; - -public class StatusTool { - - /** - * Applies the status to the status line of a dialog page - */ - public static void applyToStatusLine(MessageLine messageLine, IStatus status) { - String[] messages= getErrorMessages(status); - messageLine.setErrorMessage(messages[0]); - messageLine.setMessage(messages[1]); - } - /** - * Applies the status to the status line of a dialog page - */ - public static void applyToStatusLine(DialogPage page, IStatus status) { - String[] messages= getErrorMessages(status); - page.setErrorMessage(messages[0]); - page.setMessage(messages[1]); - } - /** - * Returns error-message / warning-message for a status - */ - public static String[] getErrorMessages(IStatus status) { - String message= status.getMessage(); - if (status.matches(IStatus.ERROR) && !"".equals(message)) { //$NON-NLS-1$ - return new String[] { message, null }; - } else if (status.matches(IStatus.WARNING | IStatus.INFO)) { - return new String[] { null, message }; - } else { - return new String[] { null, null }; - } - } - /** - * Compare two IStatus. The more severe is returned: - * An error is more severe than a warning, and a warning is more severe - * than ok. - */ - public static IStatus getMoreSevere(IStatus s1, IStatus s2) { - if (s1.getSeverity() > s2.getSeverity()) { - return s1; - } else { - return s2; - } - } - /** - * Finds the most severe status from a array of status - * An error is more severe than a warning, and a warning is more severe - * than ok. - */ - public static IStatus getMostSevere(IStatus[] status) { - IStatus max= null; - for (int i= 0; i < status.length; i++) { - IStatus curr= status[i]; - if (curr.matches(IStatus.ERROR)) { - return curr; - } - if (max == null || curr.getSeverity() > max.getSeverity()) { - max= curr; - } - } - return max; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusUtil.java deleted file mode 100644 index b1e959d5c1d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/StatusUtil.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.ui.dialogs; - -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.jface.dialogs.DialogPage; - -/** - * A utility class to work with IStatus. - */ -public class StatusUtil { - - /** - * Compares two instances of IStatus. The more severe is returned: - * An error is more severe than a warning, and a warning is more severe - * than ok. If the two stati have the same severity, the second is returned. - */ - public static IStatus getMoreSevere(IStatus s1, IStatus s2) { - if (s1.getSeverity() > s2.getSeverity()) { - return s1; - } else { - return s2; - } - } - - /** - * Finds the most severe status from a array of stati. - * An error is more severe than a warning, and a warning is more severe - * than ok. - */ - public static IStatus getMostSevere(IStatus[] status) { - IStatus max= null; - for (int i= 0; i < status.length; i++) { - IStatus curr= status[i]; - if (curr.matches(IStatus.ERROR)) { - return curr; - } - if (max == null || curr.getSeverity() > max.getSeverity()) { - max= curr; - } - } - return max; - } - - /** - * Applies the status to the status line of a dialog page. - */ - public static void applyToStatusLine(DialogPage page, IStatus status) { - String message= status.getMessage(); - switch (status.getSeverity()) { - case IStatus.OK: - page.setMessage(message, DialogPage.NONE); - page.setErrorMessage(null); - break; - case IStatus.WARNING: - page.setMessage(message, DialogPage.WARNING); - page.setErrorMessage(null); - break; - case IStatus.INFO: - page.setMessage(message, DialogPage.INFORMATION); - page.setErrorMessage(null); - break; - default: - if (message.length() == 0) { - message= null; - } - page.setMessage(null); - page.setErrorMessage(message); - break; - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/DelegatingDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/DelegatingDragAdapter.java deleted file mode 100644 index 42fd8686d85..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/DelegatingDragAdapter.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.drag; - -import java.util.Arrays; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.swt.dnd.DragSource; -import org.eclipse.swt.dnd.DragSourceEvent; -import org.eclipse.swt.dnd.DragSourceListener; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.dnd.TransferData; -import org.eclipse.swt.widgets.Control; - -/** - * A delegating drag adapter negotiates between a set of TransferDragSourceListeners - * On dragStart the adapter determines the listener to be used for any further - * drag* callbacks. - */ -public class DelegatingDragAdapter implements DragSourceListener { - private final ISelectionProvider provider; - private final TransferDragSourceListener[] listeners; - private final boolean[] actives; - private TransferDragSourceListener selected; - - public DelegatingDragAdapter( - ISelectionProvider provider, - TransferDragSourceListener[] listeners) { - super(); - Assert.isNotNull(provider); - Assert.isNotNull(listeners); - this.provider = provider; - this.listeners = listeners; - this.actives = new boolean[listeners.length]; - this.selected = null; - } - - /* non Java-doc - * @see DragSourceListener - */ - public void dragStart(DragSourceEvent event) { - selected = null; - - if (provider.getSelection().isEmpty()) { - event.doit = false; - return; - } - - // Workaround for 1GEUS9V - final DragSource dragSource = (DragSource) event.widget; - final Control control = dragSource.getControl(); - - if (control != control.getDisplay().getFocusControl()) { - event.doit = false; - return; - } - - final Object saveData = event.data; - final boolean saveDoit = event.doit; - final int listenerCount = listeners.length; - - int transferCount = 0; - - for (int i = 0; i < listenerCount; ++i) { - TransferDragSourceListener listener = listeners[i]; - - event.data = saveData; - event.doit = saveDoit; - - listener.dragStart(event); - - if (actives[i] = event.doit) - ++transferCount; - } - - event.data = saveData; - - if (event.doit = (transferCount != 0)) { - Transfer[] transferArray = new Transfer[transferCount]; - - for (int i = listenerCount; --i >= 0;) - if (actives[i]) - transferArray[--transferCount] = listeners[i].getTransfer(); - - dragSource.setTransfer(transferArray); - } - } - - /* non Java-doc - * @see DragSourceListener - */ - public void dragSetData(DragSourceEvent event) { - selected = getListener(event.dataType); - - if (selected != null) - selected.dragSetData(event); - } - - /* non Java-doc - * @see DragSourceListener - */ - public void dragFinished(DragSourceEvent event) { - try { - // If the user presses Escape then we get a dragFinished - // without getting a dragSetData before. - if (selected == null) - selected = getListener(event.dataType); - - if (selected != null) - selected.dragFinished(event); - } finally { - Arrays.fill(actives, false); - selected = null; - } - } - - private TransferDragSourceListener getListener(TransferData type) { - if (type != null) { - for (int i = 0; i < actives.length; ++i) { - if (actives[i]) { - TransferDragSourceListener listener = listeners[i]; - - if (listener.getTransfer().isSupportedType(type)) - return listener; - } - } - } - - return null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/FileTransferDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/FileTransferDragAdapter.java deleted file mode 100644 index 83c559bcc65..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/FileTransferDragAdapter.java +++ /dev/null @@ -1,186 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.drag; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.cdt.internal.ui.CUIMessages; -import org.eclipse.cdt.internal.ui.util.ExceptionHandler; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.DragSourceEvent; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -public class FileTransferDragAdapter implements TransferDragSourceListener { - private final ISelectionProvider provider; - - public FileTransferDragAdapter(ISelectionProvider provider) { - super(); - this.provider = provider; - Assert.isNotNull(provider); - } - - public Transfer getTransfer() { - return FileTransfer.getInstance(); - } - - public void dragStart(DragSourceEvent event) { - event.doit = !getResources().isEmpty(); - } - - public void dragSetData(DragSourceEvent event) { - String[] locations = getResourceLocations(getResources()); - - event.data = locations.length != 0 ? locations : null; - } - - public void dragFinished(DragSourceEvent event) { - if (event.doit) { - if (event.detail == DND.DROP_MOVE) { - // Never delete resources when dragging outside Eclipse. - // See: http://bugs.eclipse.org/bugs/show_bug.cgi?id=30543 - } else if (event.detail == DND.DROP_NONE || event.detail == DND.DROP_TARGET_MOVE) { - runOperation(new RefreshOperation(getResources()), true, false); - } - } - } - - private static class RefreshOperation extends WorkspaceModifyOperation { - private final Set roots; - - public RefreshOperation(List resources) { - super(); - - roots = new HashSet(resources.size()); - - for (Iterator iterator = resources.iterator(); iterator.hasNext();) { - IResource resource = (IResource) iterator.next(); - IResource parent = resource.getParent(); - - roots.add(parent != null ? parent : resource); - } - } - - public void execute(IProgressMonitor monitor) throws CoreException { - try { - monitor.beginTask(CUIMessages.getString("DragAdapter.refreshing"), roots.size()); //$NON-NLS-1$ - MultiStatus status = new MultiStatus(CUIPlugin.getPluginId(), IStatus.OK, CUIMessages.getString("DragAdapter.problem"), null); //$NON-NLS-1$ - - for (Iterator iterator = roots.iterator(); iterator.hasNext();) { - IResource resource = (IResource) iterator.next(); - - try { - resource.refreshLocal( - IResource.DEPTH_ONE, - new SubProgressMonitor(monitor, 1)); - } catch (CoreException e) { - status.add(e.getStatus()); - } - } - - if (!status.isOK()) - throw new CoreException(status); - } finally { - monitor.done(); - } - } - } - - private List getResources() { - List result = Collections.EMPTY_LIST; - ISelection selection = provider.getSelection(); - - if (selection instanceof IStructuredSelection) { - IStructuredSelection structured = (IStructuredSelection) selection; - - result = new ArrayList(structured.size()); - - for (Iterator iterator = structured.iterator(); iterator.hasNext();) { - Object object = iterator.next(); - IResource resource = null; - - if (object instanceof IResource) - resource = (IResource) object; - else if (object instanceof IAdaptable) - resource = (IResource) ((IAdaptable) object).getAdapter(IResource.class); - - if (resource != null) - result.add(resource); - } - } - - return result; - } - - private static String[] getResourceLocations(List resources) { - final int count = resources.size(); - final List locations = new ArrayList(count); - - for (Iterator iterator = resources.iterator(); iterator.hasNext();) { - IResource resource = (IResource) iterator.next(); - IPath location = resource.getLocation(); - - if (location != null) - locations.add(location.toOSString()); - } - - String[] result = new String[locations.size()]; - - locations.toArray(result); - - return result; - } - - private static void runOperation( - IRunnableWithProgress operation, - boolean fork, - boolean cancelable) { - try { - IWorkbench workbench = CUIPlugin.getDefault().getWorkbench(); - IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); - Shell parent = window.getShell(); - - new ProgressMonitorDialog(parent).run(fork, cancelable, operation); - } catch (InterruptedException e) { - // Do nothing. Operation has been canceled by user. - } catch (InvocationTargetException e) { - String message = CUIMessages.getString("Problem while moving or copying files."); //$NON-NLS-1$ - String title = CUIMessages.getString("Drag & Drop"); //$NON-NLS-1$ - - ExceptionHandler.handle(e, title, message); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/LocalSelectionTransferDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/LocalSelectionTransferDragAdapter.java deleted file mode 100644 index ebaadff9067..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/LocalSelectionTransferDragAdapter.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.drag; - -import org.eclipse.cdt.ui.CLocalSelectionTransfer; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.swt.dnd.DragSourceEvent; -import org.eclipse.swt.dnd.Transfer; - -public class LocalSelectionTransferDragAdapter implements TransferDragSourceListener { - private final ISelectionProvider provider; - private final CLocalSelectionTransfer transfer; - - public LocalSelectionTransferDragAdapter(ISelectionProvider provider) { - super(); - this.provider = provider; - this.transfer = CLocalSelectionTransfer.getInstance(); - Assert.isNotNull(provider); - Assert.isNotNull(transfer); - } - - /* (non-Javadoc) - * @see DragSourceListener#dragStart - */ - public void dragStart(DragSourceEvent event) { - transfer.setSelection(provider.getSelection()); - - event.doit = true; - } - - /* (non-Javadoc) - * @see DragSourceListener#dragSetData - */ - public void dragSetData(DragSourceEvent event) { - event.data = transfer.isSupportedType(event.dataType) ? transfer.getSelection() : null; - } - - /* (non-Javadoc) - * @see DragSourceListener#dragFinished - */ - public void dragFinished(DragSourceEvent event) { - transfer.setSelection(null); - } - - /* (non-Javadoc) - * @see TransferDragSourceListener#getTransfer - */ - public Transfer getTransfer() { - return transfer; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/ResourceTransferDragAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/ResourceTransferDragAdapter.java deleted file mode 100644 index a1a95d710f6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/ResourceTransferDragAdapter.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.drag; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.internal.ui.CUIMessages; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.DragSource; -import org.eclipse.swt.dnd.DragSourceEvent; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.actions.ReadOnlyStateChecker; -import org.eclipse.ui.part.ResourceTransfer; - -/** - * A drag adapter that transfers the current selection as - * IResource. Only those elements in the selection are part - * of the transfer which can be converted into an IResource - * . - */ -public class ResourceTransferDragAdapter implements TransferDragSourceListener { - private final ISelectionProvider provider; - - /** - * Creates a new ResourceTransferDragAdapter for the given selection provider. - * - * @param provider the selection provider to access the viewer's selection - */ - public ResourceTransferDragAdapter(ISelectionProvider provider) { - super(); - this.provider = provider; - Assert.isNotNull(provider); - } - - public Transfer getTransfer() { - return ResourceTransfer.getInstance(); - } - - public void dragStart(DragSourceEvent event) { - event.doit = false; - - ISelection selection = provider.getSelection(); - - if (selection instanceof IStructuredSelection) { - IStructuredSelection structured = (IStructuredSelection) selection; - - for (Iterator iterator = structured.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - - if (element instanceof IAdaptable) { - IAdaptable adaptable = (IAdaptable) element; - IResource resource = (IResource) adaptable.getAdapter(IResource.class); - - if (resource == null) { - event.doit = false; - break; - } - - // this will stick unless a later part of the - // selection isn't adaptable into a resource - event.doit = true; - } - } - } - } - - public void dragSetData(DragSourceEvent event) { - event.data = getSelectedResources(); - } - - public void dragFinished(DragSourceEvent event) { - if (event.doit && event.detail == DND.DROP_MOVE) { - IResource[] resources = getSelectedResources(); - - if (resources.length == 0) - return; - - DragSource dragSource = (DragSource) event.widget; - Control control = dragSource.getControl(); - Shell shell = control.getShell(); - String title = CUIMessages.getString("Drag.move.problem.title"); //$NON-NLS-1$ - String message = CUIMessages.getString("Drag.move.problem.message"); //$NON-NLS-1$ - - ReadOnlyStateChecker checker = new ReadOnlyStateChecker(shell, title, message); - - resources = checker.checkReadOnlyResources(resources); - - // delete the old elements - for (int i = 0; i < resources.length; ++i) { - try { - resources[i].delete(IResource.KEEP_HISTORY | IResource.FORCE, null); - } catch (CoreException e) { - e.printStackTrace(); - } - } - } - } - - private IResource[] getSelectedResources() { - List resources = Collections.EMPTY_LIST; - ISelection selection = provider.getSelection(); - - if (selection instanceof IStructuredSelection) { - IStructuredSelection structured = (IStructuredSelection) selection; - - resources = new ArrayList(structured.size()); - - for (Iterator iterator = structured.iterator(); iterator.hasNext();) { - Object element = iterator.next(); - - if (element instanceof IAdaptable) { - IAdaptable adaptable = (IAdaptable) element; - IResource resource = (IResource) adaptable.getAdapter(IResource.class); - - if (resource != null) - resources.add(resource); - } - } - } - - IResource[] result = new IResource[resources.size()]; - resources.toArray(result); - - return result; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/TransferDragSourceListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/TransferDragSourceListener.java deleted file mode 100644 index 0c21d10c152..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/drag/TransferDragSourceListener.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.drag; - -import org.eclipse.swt.dnd.DragSourceListener; -import org.eclipse.swt.dnd.Transfer; - -/** - * A special drag source listener which is typed with a TransferData. - */ -public interface TransferDragSourceListener extends DragSourceListener { - /** - * Returns the transfer used by this drag source. - */ - public Transfer getTransfer(); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java deleted file mode 100644 index c676d46c052..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java +++ /dev/null @@ -1,190 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.CCompletionContributorManager; -import org.eclipse.cdt.internal.ui.CFileElementWorkingCopy; -import org.eclipse.cdt.internal.ui.codemanipulation.AddIncludeOperation; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IFunctionSummary; -import org.eclipse.cdt.ui.IRequiredInclude; -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; - -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.IUpdate; - - -public class AddIncludeOnSelectionAction extends Action implements IUpdate { - - private ITextEditor fEditor; - - - public AddIncludeOnSelectionAction() { - this(null); - } - public AddIncludeOnSelectionAction(ITextEditor editor) { - super(CEditorMessages.getString("AddIncludeOnSelection.label")); //$NON-NLS-1$ - setToolTipText(CEditorMessages.getString("AddIncludeOnSelection.tooltip")); //$NON-NLS-1$ - setDescription(CEditorMessages.getString("AddIncludeOnSelection.description")); //$NON-NLS-1$ - - fEditor= editor; - //WorkbenchHelp.setHelp(this, new Object[] { IJavaHelpContextIds.ADD_IMPORT_ON_SELECTION_ACTION }); - } - private void addInclude(IRequiredInclude[] inc, CFileElementWorkingCopy tu) { - AddIncludeOperation op= new AddIncludeOperation(fEditor, tu, inc, false); - try { - ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); - dialog.run(false, true, op); - } catch (InvocationTargetException e) { - e.printStackTrace(); - MessageDialog.openError(getShell(), CEditorMessages.getString("AddIncludeOnSelection.error.message1"), e.getTargetException().getMessage()); //$NON-NLS-1$ - } catch (InterruptedException e) { - // Do nothing. Operation has been canceled. - } - } - - private CFileElementWorkingCopy getTranslationUnit () { - CFileElementWorkingCopy unit = null; - if(fEditor != null) { - IEditorInput editorInput= (IEditorInput)fEditor.getEditorInput(); - IDocumentProvider provider= fEditor.getDocumentProvider(); - try { - if (editorInput instanceof IFileEditorInput) - unit = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider); - else if (editorInput instanceof IStorageEditorInput) - unit = new CFileElementWorkingCopy((IStorageEditorInput)editorInput, provider); - else - throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null)); - - } catch (CoreException e) { - CUIPlugin.getDefault().log(e.getStatus()); - } - } - return unit; - } - - protected Shell getShell() { - return fEditor.getSite().getShell(); - } - - private int getNameStart(IDocument doc, int pos) throws BadLocationException { - if (pos > 0 && doc.getChar(pos - 1) == '.') { - pos--; - while (pos > 0) { - char ch= doc.getChar(pos - 1); - if (!Character.isJavaIdentifierPart(ch) && ch != '.') { - return pos; - } - pos--; - } - } - return pos; - } - -/* private void removeQualification(IDocument doc, int nameStart, IType type) throws BadLocationException { - String packName= type.getPackageFragment().getElementName(); - int packLen= packName.length(); - if (packLen > 0) { - for (int k= 0; k < packLen; k++) { - if (doc.getChar(nameStart + k) != packName.charAt(k)) { - return; - } - } - doc.replace(nameStart, packLen + 1, ""); //$NON-NLS-1$ - } - } */ - /** - * @see IAction#actionPerformed - */ - public void run() { - - CFileElementWorkingCopy tu= getTranslationUnit(); - if (tu != null) { - ISelection s= fEditor.getSelectionProvider().getSelection(); - IDocument doc= fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput()); - if (!s.isEmpty() && doc != null) { - ITextSelection selection= (ITextSelection) s; - try { - int selStart= selection.getOffset(); - int nameStart= getNameStart(doc, selStart); - int len= selStart - nameStart + selection.getLength(); - - String name= doc.get(nameStart, len).trim(); - - //IType[] types= StubUtility.findAllTypes(typeName, cu.getJavaProject(), null); - //IType chosen= selectResult(types, packName, getShell()); - IFunctionSummary fs = CCompletionContributorManager.getDefault().getFunctionInfo(name); - if(fs != null) { - IRequiredInclude[] ri = fs.getIncludes(); - if(ri != null && ri.length > 0) { - addInclude(ri, tu); - return; - } - } - } catch (BadLocationException e) { - MessageDialog.openError(getShell(), CEditorMessages.getString("AddIncludeOnSelection.error.message3"), CEditorMessages.getString("AddIncludeOnSelection.error.message4") + e.getMessage()); //$NON-NLS-2$ //$NON-NLS-1$ - } - } - } - getShell().getDisplay().beep(); - } -/* private IType selectResult(IType[] results, String packName, Shell shell) { - int nResults= results.length; - - if (nResults == 0) { - return null; - } else if (nResults == 1) { - return results[0]; - } - - if (packName.length() != 0) { - for (int i= 0; i < results.length; i++) { - IType curr= (IType) results[i]; - if (packName.equals(curr.getPackageFragment().getElementName())) { - return curr; - } - } - } - - JavaPlugin plugin= JavaPlugin.getDefault(); - - int flags= (JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_CONTAINER_QUALIFICATION); - ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(flags), true, false); - dialog.setTitle(JavaEditorMessages.getString("AddImportOnSelection.dialog.title")); //$NON-NLS-1$ - dialog.setMessage(JavaEditorMessages.getString("AddImportOnSelection.dialog.message")); //$NON-NLS-1$ - if (dialog.open(results) == dialog.OK) { - return (IType) dialog.getSelectedElement(); - } - return null; - } */ - public void setContentEditor(ITextEditor editor) { - fEditor= editor; - } - public void update() { - ISelection selection= fEditor.getSelectionProvider().getSelection(); - setEnabled(!selection.isEmpty()); - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java deleted file mode 100644 index dc315dfac11..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java +++ /dev/null @@ -1,333 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.core.model.WorkingCopy; -import org.eclipse.cdt.internal.ui.CFileElementWorkingCopy; -import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider; -import org.eclipse.cdt.internal.ui.util.ProblemTreeViewer; -import org.eclipse.cdt.ui.CElementContentProvider; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IWorkingCopyManager; -import org.eclipse.cdt.ui.actions.MemberFilterActionGroup; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.util.ListenerList; -import org.eclipse.jface.viewers.AbstractTreeViewer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.part.IPageSite; -import org.eclipse.ui.part.Page; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; - -public class CContentOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener { - private CEditor fEditor; - //private WorkingCopy fInput; - private IWorkingCopy fInput; - private ProblemTreeViewer treeViewer; - private ListenerList selectionChangedListeners = new ListenerList(); - private TogglePresentationAction fTogglePresentation; - private String fContextMenuId; - - private OpenIncludeAction fOpenIncludeAction; - private FileSearchAction fFileSearchAction; - private FileSearchActionInWorkingSet fFileSearchActionInWorkingSet; - private SearchDialogAction fSearchDialogAction; - - private MemberFilterActionGroup fMemberFilterActionGroup; - - public CContentOutlinePage(CEditor editor) { - this("#TranslationUnitOutlinerContext", editor); - } - - public CContentOutlinePage(String contextMenuID, CEditor editor) { - super(); - fEditor= editor; - fInput= null; - fContextMenuId = contextMenuID; - - fTogglePresentation= new TogglePresentationAction(); - fTogglePresentation.setEditor(editor); - - fOpenIncludeAction= new OpenIncludeAction(this); - fFileSearchAction= new FileSearchAction(this); - fFileSearchActionInWorkingSet = new FileSearchActionInWorkingSet(this); - fSearchDialogAction = new SearchDialogAction(this, editor); - } - - public ICElement getRoot() { - return fInput; - } - - /** - * Called by the editor to signal that the content has updated. - */ - public void contentUpdated() { - if (fInput != null) { - try { - //fInput.update(); - fInput.reconcile(); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e.getStatus()); - fInput= null; - return; - } - - final TreeViewer treeViewer= getTreeViewer(); - if (treeViewer != null && !treeViewer.getControl().isDisposed()) { - treeViewer.getControl().getDisplay().asyncExec(new Runnable() { - public void run() { - if (!treeViewer.getControl().isDisposed()) { - ISelection sel= treeViewer.getSelection(); - treeViewer.getControl().setRedraw(false); - treeViewer.refresh(); - treeViewer.setSelection(updateSelection(sel)); - treeViewer.getControl().setRedraw(true); - } - } - }); - } - } - } - - protected ISelection updateSelection(ISelection sel) { - ArrayList newSelection= new ArrayList(); - if (sel instanceof IStructuredSelection) { - Iterator iter= ((IStructuredSelection)sel).iterator(); - for (;iter.hasNext();) { - //ICElement elem= fInput.findEqualMember((ICElement)iter.next()); - ICElement elem = (ICElement)iter.next(); - if (elem != null) { - newSelection.add(elem); - } - } - } - return new StructuredSelection(newSelection); - } - - /** - * called to create the context menu of the outline - */ - protected void contextMenuAboutToShow(IMenuManager menu) { - if (OpenIncludeAction.canActionBeAdded(getSelection())) { - menu.add(fOpenIncludeAction); - } - - if (SearchDialogAction.canActionBeAdded(getSelection())) { - menu.add(fSearchDialogAction); - } - - if (FileSearchAction.canActionBeAdded(getSelection())) { - MenuManager fileSearch = new MenuManager("File Search"); - fileSearch.add(fFileSearchAction); - fileSearch.add(fFileSearchActionInWorkingSet); - menu.add(fileSearch); - } - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));//$NON-NLS-1$ - } - - /** - * @see ContentOutlinePage#createControl - */ - public void createControl(Composite parent) { - treeViewer = new ProblemTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - treeViewer.addSelectionChangedListener(this); - - //treeViewer.setContentProvider(new CModelContentProvider()); - treeViewer.setContentProvider(new CElementContentProvider(true, true)); - treeViewer.setLabelProvider(new StandardCElementLabelProvider()); - treeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS); - treeViewer.addSelectionChangedListener(this); - - CUIPlugin.getDefault().getProblemMarkerManager().addListener(treeViewer); - - MenuManager manager= new MenuManager(fContextMenuId); - manager.setRemoveAllWhenShown(true); - manager.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager manager) { - contextMenuAboutToShow(manager); - } - }); - Control control= treeViewer.getControl(); - Menu menu= manager.createContextMenu(control); - control.setMenu(menu); - - // register global actions - IPageSite site= getSite(); - site.registerContextMenu(fContextMenuId, manager, treeViewer); - site.setSelectionProvider(treeViewer); - IActionBars bars= site.getActionBars(); - bars.setGlobalActionHandler(ICEditorActionDefinitionIds.TOGGLE_PRESENTATION, fTogglePresentation); - - registerToolbarActions(); - - IEditorInput editorInput= (IEditorInput)fEditor.getEditorInput(); - IDocumentProvider provider= fEditor.getDocumentProvider(); - try { - if (editorInput instanceof IFileEditorInput){ - IWorkingCopyManager wcManager = CUIPlugin.getDefault().getWorkingCopyManager(); - fInput = (WorkingCopy)wcManager.getWorkingCopy(editorInput); - if (fInput == null) { - // XXX This should never happen. Put an assert. - fInput = new CFileElementWorkingCopy((IFileEditorInput)editorInput, provider); - } - } else if (editorInput instanceof IStorageEditorInput){ - // CHECKPOINT: do we create a CFileElementWorkingCopy or just a working copy for the IStorageEditorInput? - // If it is an IStorage it means that there is no underlying IFile. - fInput = new CFileElementWorkingCopy((IStorageEditorInput)editorInput, provider); - } else { - throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, "no Editor Input", null)); - } - treeViewer.setInput(fInput); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e.getStatus()); - fInput= null; - } - } - - public void dispose() { - CUIPlugin.getDefault().getProblemMarkerManager().removeListener(treeViewer); - if (fMemberFilterActionGroup != null) { - fMemberFilterActionGroup.dispose(); - fMemberFilterActionGroup= null; - } - super.dispose(); - } - - /** - * @see IPage#setActionBars(IActionBars) - */ - public void setActionBars(IActionBars actionBars) { - IToolBarManager toolBarManager= actionBars.getToolBarManager(); - - LexicalSortingAction action= new LexicalSortingAction(getTreeViewer()); - toolBarManager.add(action); - } - - /* (non-Javadoc) - * Method declared on ISelectionProvider. - */ - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * Fires a selection changed event. - * - * @param selction the new selection - */ - protected void fireSelectionChanged(ISelection selection) { - // create an event - SelectionChangedEvent event = new SelectionChangedEvent(this, selection); - - // fire the event - Object[] listeners = selectionChangedListeners.getListeners(); - for (int i = 0; i < listeners.length; ++i) { - ((ISelectionChangedListener) listeners[i]).selectionChanged(event); - } - } - /* (non-Javadoc) - * Method declared on IPage (and Page). - */ - public Control getControl() { - if (treeViewer == null) - return null; - return treeViewer.getControl(); - } - /* (non-Javadoc) - * Method declared on ISelectionProvider. - */ - public ISelection getSelection() { - if (treeViewer == null) - return StructuredSelection.EMPTY; - return treeViewer.getSelection(); - } - /** - * Returns this page's tree viewer. - * - * @return this page's tree viewer, or null if - * createControl has not been called yet - */ - protected TreeViewer getTreeViewer() { - return treeViewer; - } - /* (non-Javadoc) - * Method declared on ISelectionProvider. - */ - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - /* (non-Javadoc) - * Method declared on ISelectionChangeListener. - * Gives notification that the tree selection has changed. - */ - public void selectionChanged(SelectionChangedEvent event) { - fireSelectionChanged(event.getSelection()); - } - /** - * Sets focus to a part in the page. - */ - public void setFocus() { - treeViewer.getControl().setFocus(); - } - /* (non-Javadoc) - * Method declared on ISelectionProvider. - */ - public void setSelection(ISelection selection) { - if (treeViewer != null) - treeViewer.setSelection(selection); - } - - /** - * @param unit - */ - public void setInput(IWorkingCopy unit) { - fInput = unit; - if (treeViewer != null) { - treeViewer.setInput (fInput); - } - contentUpdated(); - } - - private void registerToolbarActions() { - - IToolBarManager toolBarManager= getSite().getActionBars().getToolBarManager(); - if (toolBarManager != null) { - //toolBarManager.add(new ClassOnlyAction()); - //toolBarManager.add(new LexicalSortingAction()); - - fMemberFilterActionGroup= new MemberFilterActionGroup(treeViewer, "COutlineViewer"); //$NON-NLS-1$ - fMemberFilterActionGroup.contributeToToolBar(toolBarManager); - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java deleted file mode 100644 index 836cb443677..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java +++ /dev/null @@ -1,425 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.IBufferFactory; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.ui.CStatusConstants; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IEditorInputDelegate; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.text.AbstractDocument; -import org.eclipse.jface.text.DefaultLineTracker; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.GapTextStore; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.editors.text.FileDocumentProvider; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; - -public class CDocumentProvider extends FileDocumentProvider { - - /** - * Bundle of all required informations to allow working copy management. - */ - protected class CDocument extends AbstractDocument { - - /** - * Creates a new empty document. - */ - public CDocument() { - super(); - setTextStore(new GapTextStore(50, 300)); - setLineTracker(new DefaultLineTracker()); - completeInitialization(); - } - - /** - * Creates a new document with the given initial content. - * - * @param initialContent the document's initial content - */ - public CDocument(String initialContent) { - super(); - setTextStore(new GapTextStore(50, 300)); - setLineTracker(new DefaultLineTracker()); - getStore().set(initialContent); - getTracker().set(initialContent); - completeInitialization(); - } - }; - - /** - * Bundle of all required informations to allow working copy management. - */ - protected class TranslationUnitFileInfo extends FileInfo { - - IWorkingCopy fCopy; - - TranslationUnitFileInfo(IDocument document, IAnnotationModel model, FileSynchronizer fileSynchronizer, IWorkingCopy copy) { - super(document, model, fileSynchronizer); - fCopy= copy; - } - - void setModificationStamp(long timeStamp) { - fModificationStamp= timeStamp; - } - }; - /** - * Creates IBuffers based on documents. - */ - protected class BufferFactory implements IBufferFactory { - - private IDocument internalGetDocument(IFileEditorInput input) throws CoreException { - IDocument document= getDocument(input); - if (document != null) - return document; - return CDocumentProvider.this.createDocument(input); - } - - public IBuffer createBuffer(IOpenable owner) { - if (owner instanceof IWorkingCopy) { - - IWorkingCopy unit= (IWorkingCopy) owner; - ITranslationUnit original= (ITranslationUnit) unit.getOriginalElement(); - IResource resource= original.getResource(); - if (resource instanceof IFile) { - IFileEditorInput providerKey= new FileEditorInput((IFile) resource); - - IDocument document= null; - IStatus status= null; - - try { - document= internalGetDocument(providerKey); - } catch (CoreException x) { - status= x.getStatus(); - document= new Document(); - initializeDocument(document); - } - - DocumentAdapter adapter= new DocumentAdapter(unit, document, new DefaultLineTracker(), CDocumentProvider.this, providerKey); - adapter.setStatus(status); - return adapter; - } - - } - return DocumentAdapter.NULL; - } - }; - - - /** The buffer factory */ - private IBufferFactory fBufferFactory= new BufferFactory(); - /** Indicates whether the save has been initialized by this provider */ - private boolean fIsAboutToSave= false; - - /** - * @see AbstractDocumentProvider#createDocument(Object) - */ - protected IDocument createDocument(Object element) throws CoreException { - IDocument document = null; - IStorage storage = null; - - if (element instanceof IEditorInputDelegate) { - if (((IEditorInputDelegate) element).getDelegate() != null) - return createDocument(((IEditorInputDelegate) element).getDelegate()); - else - storage = ((IEditorInputDelegate) element).getStorage(); - } - - if (element instanceof IStorageEditorInput) - storage= ((IStorageEditorInput) element).getStorage(); - - if ( storage != null ) { - document = new CDocument(); - setDocumentContent(document, storage.getContents(), getDefaultEncoding()); - } - - //IDocument document= super.createDocument(element); - initializeDocument(document); - return document; - } - - /* - * @see AbstractDocumentProvider#createAnnotationModel(Object) - */ - protected IAnnotationModel createAnnotationModel(Object element) throws CoreException { - if ( element instanceof IEditorInputDelegate && ((IEditorInputDelegate)element).getDelegate() != null ) - return createAnnotationModel( ((IEditorInputDelegate)element).getDelegate() ); - if (element instanceof IFileEditorInput) { - IFileEditorInput input= (IFileEditorInput) element; - return new CMarkerAnnotationModel(input.getFile()); - } else if (element instanceof IStorageEditorInput) { - // Fall back on the adapter. - IStorageEditorInput input = (IStorageEditorInput) element; - IResource res = (IResource)input.getAdapter(IResource.class); - if (res != null && res.exists()) { - return new CMarkerAnnotationModel(res); - } - } - - return super.createAnnotationModel(element); - } - - /* - * @see AbstractDocumentProvider#createElementInfo(Object) - */ - protected ElementInfo createElementInfo(Object element) throws CoreException { - if ( !(element instanceof IFileEditorInput)) - return super.createElementInfo(element); - - IFileEditorInput input= (IFileEditorInput) element; - ITranslationUnit original= createTranslationUnit(input.getFile()); - if (original != null) { - - try { - - try { - refreshFile(input.getFile()); - } catch (CoreException x) { - handleCoreException(x, CEditorMessages.getString("TranslationUnitDocumentProvider.error.createElementInfo")); //$NON-NLS-1$ - } - - IAnnotationModel m= createAnnotationModel(input); - IBufferFactory factory = getBufferFactory(); - IWorkingCopy c= (IWorkingCopy) original.getSharedWorkingCopy(getProgressMonitor(), factory); - - DocumentAdapter a= null; - try { - a= (DocumentAdapter) c.getBuffer(); - } catch (ClassCastException x) { - IStatus status= new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, CStatusConstants.TEMPLATE_IO_EXCEPTION, "Shared working copy has wrong buffer", x); //$NON-NLS-1$ - throw new CoreException(status); - } - - FileSynchronizer f= new FileSynchronizer(input); - f.install(); - - TranslationUnitFileInfo info= new TranslationUnitFileInfo(a.getDocument(), m, f, c); - info.setModificationStamp(computeModificationStamp(input.getFile())); - info.fStatus= a.getStatus(); - info.fEncoding= getPersistedEncoding(input); - - return info; - - } catch (CModelException x) { - throw new CoreException(x.getStatus()); - } - } else { - return super.createElementInfo(element); - } - } - /* - * Creates a translation unit using the core model - */ - protected ITranslationUnit createTranslationUnit(IFile file) { - Object element= CoreModel.getDefault().create(file); - if (element instanceof ITranslationUnit) - return (ITranslationUnit) element; - return null; - } - /* - * @see AbstractDocumentProvider#disposeElementInfo(Object, ElementInfo) - */ - protected void disposeElementInfo(Object element, ElementInfo info) { - - if (info instanceof TranslationUnitFileInfo) { - TranslationUnitFileInfo cuInfo= (TranslationUnitFileInfo) info; - cuInfo.fCopy.destroy(); - } - - super.disposeElementInfo(element, info); - } - - /* - * @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument, boolean) - */ - protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException { - - ElementInfo elementInfo= getElementInfo(element); - if (elementInfo instanceof TranslationUnitFileInfo) { - TranslationUnitFileInfo info= (TranslationUnitFileInfo) elementInfo; - - // update structure, assumes lock on info.fCopy - info.fCopy.reconcile(); - - ITranslationUnit original= (ITranslationUnit) info.fCopy.getOriginalElement(); - IResource resource= original.getResource(); - - if (resource == null) { - // underlying resource has been deleted, just recreate file, ignore the rest - super.doSaveDocument(monitor, element, document, overwrite); - return; - } - - if (resource != null && !overwrite) - checkSynchronizationState(info.fModificationStamp, resource); - -// if (fSavePolicy != null) -// fSavePolicy.preSave(info.fCopy); - - // inform about the upcoming content change - fireElementStateChanging(element); - try { - fIsAboutToSave= true; - // commit working copy - info.fCopy.commit(overwrite, monitor); - } catch (CoreException x) { - // inform about the failure - fireElementStateChangeFailed(element); - throw x; - } catch (RuntimeException x) { - // inform about the failure - fireElementStateChangeFailed(element); - throw x; - } finally { - fIsAboutToSave= false; - } - - // If here, the dirty state of the editor will change to "not dirty". - // Thus, the state changing flag will be reset. - - AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel; - model.updateMarkers(info.fDocument); - - if (resource != null) - info.setModificationStamp(computeModificationStamp(resource)); - -// if (fSavePolicy != null) { -// ICompilationUnit unit= fSavePolicy.postSave(original); -// if (unit != null) { -// IResource r= unit.getResource(); -// IMarker[] markers= r.findMarkers(IMarker.MARKER, true, IResource.DEPTH_ZERO); -// if (markers != null && markers.length > 0) { -// for (int i= 0; i < markers.length; i++) -// model.updateMarker(markers[i], info.fDocument, null); -// } -// } -// } - - - } else { - super.doSaveDocument(monitor, element, document, overwrite); - } - } - - /** - * Gets the BufferFactory. - */ - public IBufferFactory getBufferFactory() { - return fBufferFactory; - } - - /** - * Returns the underlying resource for the given element. - * - * @param the element - * @return the underlying resource of the given element - */ - public IResource getUnderlyingResource(Object element) { - if (element instanceof IFileEditorInput) { - IFileEditorInput input= (IFileEditorInput) element; - return input.getFile(); - } - return null; - } - - public IWorkingCopy getWorkingCopy(IEditorInput element) { - - ElementInfo elementInfo= getElementInfo(element); - if (elementInfo instanceof TranslationUnitFileInfo) { - TranslationUnitFileInfo info= (TranslationUnitFileInfo) elementInfo; - return info.fCopy; - } - return null; - } - - protected void initializeDocument(IDocument document) { - if (document != null) { - IDocumentPartitioner partitioner= CUIPlugin.getDefault().getTextTools().createDocumentPartitioner(); - partitioner.connect(document); - document.setDocumentPartitioner(partitioner); - } - } - /** - * Saves the content of the given document to the given element. - * This is only performed when this provider initiated the save. - * - * @param monitor the progress monitor - * @param element the element to which to save - * @param document the document to save - * @param overwrite true if the save should be enforced - */ - public void saveDocumentContent(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException { - - if (!fIsAboutToSave) - return; - - if (element instanceof IFileEditorInput) { - IFileEditorInput input= (IFileEditorInput) element; - try { - String encoding= getEncoding(element); - if (encoding == null) - encoding= ResourcesPlugin.getEncoding(); - InputStream stream= new ByteArrayInputStream(document.get().getBytes(encoding)); - IFile file= input.getFile(); - file.setContents(stream, overwrite, true, monitor); - } catch (IOException x) { - IStatus s= new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, IStatus.OK, x.getMessage(), x); - throw new CoreException(s); - } - } - } - - /** - * - */ - public void shutdown() { - // TODO Auto-generated method stub - } - - /** - * @param input - * @return - */ - public boolean isConnected(IEditorInput input) { - return getElementInfo(input) != null; - } - - /** - * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#getStatus(Object) - */ - public IStatus getStatus(Object element) { - if (element instanceof IEditorInputDelegate) { - if (((IEditorInputDelegate) element).getDelegate() != null) - return super.getStatus(((IEditorInputDelegate) element).getDelegate()); - else - return new Status(IStatus.INFO,CUIPlugin.getPluginId(),0,"",null); - } - return super.getStatus(element); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java deleted file mode 100644 index 1fd849d4944..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ /dev/null @@ -1,941 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.ui.IContextMenuConstants; -import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools; -import org.eclipse.cdt.internal.ui.text.CPairMatcher; -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IWorkingCopyManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DocumentCommand; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.text.ITextViewerExtension; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.jface.text.contentassist.IContentAssistant; -import org.eclipse.jface.text.source.Annotation; -import org.eclipse.jface.text.source.IAnnotationAccess; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.IOverviewRuler; -import org.eclipse.jface.text.source.ISharedTextColors; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.IVerticalRuler; -import org.eclipse.jface.text.source.OverviewRuler; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.text.source.SourceViewerConfiguration; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorActionBarContributor; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IPartService; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.editors.text.TextEditor; -import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; -import org.eclipse.ui.editors.text.TextFileDocumentProvider; -import org.eclipse.ui.part.EditorActionBarContributor; -import org.eclipse.ui.part.IShowInSource; -import org.eclipse.ui.part.ShowInContext; -import org.eclipse.ui.texteditor.AnnotationPreference; -import org.eclipse.ui.texteditor.ContentAssistAction; -import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; -import org.eclipse.ui.texteditor.DefaultRangeIndicator; -import org.eclipse.ui.texteditor.ExtendedTextEditorPreferenceConstants; -import org.eclipse.ui.texteditor.IEditorStatusLine; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.ui.texteditor.MarkerAnnotation; -import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; -import org.eclipse.ui.texteditor.MarkerUtilities; -import org.eclipse.ui.texteditor.SourceViewerDecorationSupport; -import org.eclipse.ui.texteditor.TextOperationAction; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.tasklist.TaskList; - - -/** - * C specific text editor. - */ -public class CEditor extends TextEditor implements ISelectionChangedListener, IShowInSource { - - /** The outline page */ - protected CContentOutlinePage fOutlinePage; - - private FileSearchAction fFileSearchAction; - - private FileSearchActionInWorkingSet fFileSearchActionInWorkingSet; - - private SearchDialogAction fSearchDialogAction; - - protected ISelectionChangedListener fStatusLineClearer; - - /** The property change listener */ - private PropertyChangeListener fPropertyChangeListener = new PropertyChangeListener(); - - protected final static char[] BRACKETS = { '{', '}', '(', ')', '[', ']' }; - - protected CPairMatcher fBracketMatcher = new CPairMatcher(BRACKETS); - - /** The editor's tab converter */ - private TabConverter fTabConverter; - - private MarkerAnnotationPreferences fAnnotationPreferences; - - /** Listener to annotation model changes that updates the error tick in the tab image */ - private CEditorErrorTickUpdater fCEditorErrorTickUpdater; - - /* Preference key for matching brackets */ - public final static String MATCHING_BRACKETS = "matchingBrackets"; - /* Preference key for matching brackets color */ - public final static String MATCHING_BRACKETS_COLOR = "matchingBracketsColor"; - /** Preference key for inserting spaces rather than tabs */ - public final static String SPACES_FOR_TABS = "spacesForTabs"; - /** Preference key for linked position color */ - public final static String LINKED_POSITION_COLOR = "linkedPositionColor"; //$NON-NLS-1$ - - /** Preference key for compiler task tags */ - private final static String TRANSLATION_TASK_TAGS= CCorePlugin.TRANSLATION_TASK_TAGS; - - private class PropertyChangeListener implements org.eclipse.core.runtime.Preferences.IPropertyChangeListener, org.eclipse.jface.util.IPropertyChangeListener { - /* - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) { - handlePreferencePropertyChanged(event); - } - public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event) { - handlePreferencePropertyChanged(new org.eclipse.jface.util.PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue())); - } - }; - - /** - * Default constructor. - */ - public CEditor() { - super(); - fAnnotationPreferences = new MarkerAnnotationPreferences(); - CTextTools textTools = CUIPlugin.getDefault().getTextTools(); - setSourceViewerConfiguration(new CSourceViewerConfiguration(textTools, this)); - setDocumentProvider(CUIPlugin.getDefault().getDocumentProvider()); - setRangeIndicator(new DefaultRangeIndicator()); - setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); - - setEditorContextMenuId("#CEditorContext"); //$NON-NLS-1$ - setRulerContextMenuId("#CEditorRulerContext"); //$NON-NLS-1$ - setOutlinerContextMenuId("#CEditorOutlinerContext"); //$NON-NLS-1$ - - fCEditorErrorTickUpdater = new CEditorErrorTickUpdater(this); - } - - /** - * @see AbstractTextEditor#doSetInput(IEditorInput) - */ - protected void doSetInput(IEditorInput input) throws CoreException { - // If the file is not a Storage or an IFile use a different - // DocumentProvider. TODO: Rewrite CDocuemtnProviver to handle this. - if (!(input instanceof IStorageEditorInput || input instanceof IFileEditorInput)) { - setDocumentProvider(new TextFileDocumentProvider(null)); - } - super.doSetInput(input); - fCEditorErrorTickUpdater.setAnnotationModel(getDocumentProvider().getAnnotationModel(input)); - setOutlinePageInput(fOutlinePage, input); - } - - /** - * Update the title image - */ - public void updatedTitleImage(Image image) { - setTitleImage(image); - } - - /** - * Gets the current input - */ - public IFile getInputFile() { - //IFileEditorInput editorInput = (IFileEditorInput)getEditorInput(); - IEditorInput editorInput = (IEditorInput) getEditorInput(); - if (editorInput != null) { - if ((editorInput instanceof IFileEditorInput)) { - return ((IFileEditorInput) editorInput).getFile(); - } - } - return null; - } - - public boolean isSaveAsAllowed() { - return true; - } - /** - * Gets the outline page of the c-editor - */ - public CContentOutlinePage getOutlinePage() { - if (fOutlinePage == null) { - fOutlinePage = new CContentOutlinePage(this); - fOutlinePage.addSelectionChangedListener(this); - } - return fOutlinePage; - } - - /** - * @see AbstractTextEditor#getAdapter(Class) - */ - public Object getAdapter(Class required) { - if (IContentOutlinePage.class.equals(required)) { - return getOutlinePage(); - } - return super.getAdapter(required); - } - /** - * Handles a property change event describing a change - * of the editor's preference store and updates the preference - * related editor properties. - * - * @param event the property change event - */ - protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { - AdaptedSourceViewer asv = (AdaptedSourceViewer) getSourceViewer(); - - try { - if (asv != null) { - - String property = event.getProperty(); - - if (CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH.equals(property)) { - SourceViewerConfiguration configuration = getSourceViewerConfiguration(); - String[] types = configuration.getConfiguredContentTypes(asv); - for (int i = 0; i < types.length; i++) - asv.setIndentPrefixes(configuration.getIndentPrefixes(asv, types[i]), types[i]); - - if (fTabConverter != null) - fTabConverter.setNumberOfSpacesPerTab( - getPreferenceStore().getInt(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH)); - - Object value = event.getNewValue(); - - if (value instanceof Integer) { - asv.getTextWidget().setTabs(((Integer) value).intValue()); - - } else if (value instanceof String) { - asv.getTextWidget().setTabs(Integer.parseInt((String) value)); - } - } - - if (SPACES_FOR_TABS.equals(property)) { - if (isTabConversionEnabled()) - startTabConversion(); - else - stopTabConversion(); - return; - } - - IContentAssistant c= asv.getContentAssistant(); - if (c instanceof ContentAssistant) - ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event); - - } - } finally { - super.handlePreferenceStoreChanged(event); - } - } - - /** - * @see ISelectionChangedListener#selectionChanged - */ - public void selectionChanged(SelectionChangedEvent event) { - ISelection sel = event.getSelection(); - if (sel instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) sel; - Object obj = selection.getFirstElement(); - if (obj instanceof ISourceReference) { - try { - ISourceRange range = ((ISourceReference) obj).getSourceRange(); - if (range != null) { - setSelection(range, !isActivePart()); - } - } catch (CModelException e) { - } - } - } - } - - public void setSelection(ICElement element) { - - if (element == null || element instanceof ITranslationUnit) { - /* - * If the element is an ITranslationUnit this unit is either the input - * of this editor or not being displayed. In both cases, nothing should - * happened. - */ - return; - } - if (element instanceof ISourceReference) { - ISourceReference reference = (ISourceReference) element; - // set hightlight range - setSelection(reference, true); - // set outliner selection - //if (fOutlinePage != null) { - // fOutlinePage.removeSelectionChangedListener(fSelectionChangedListener); - // fOutlinePage.select(reference); - // fOutlinePage.addSelectionChangedListener(fSelectionChangedListener); - //} - } - } - - public void setSelection(ISourceReference element, boolean moveCursor) { - if (element != null) { - try { - setSelection(element.getSourceRange(), moveCursor); - } catch (CModelException e) { - } - } - } - - /** - * Sets the current editor selection to the source range. Optionally - * sets the current editor position. - * - * @param element the source range to be shown in the editor, can be null. - * @param moveCursor if true the editor is scrolled to show the range. - */ - public void setSelection(ISourceRange element, boolean moveCursor) { - - if (element == null) { - return; - } - - try { - IRegion alternateRegion = null; - int start = element.getStartPos(); - int length = element.getLength(); - - // Sanity check sometimes the parser may throw wrong numbers. - if (start < 0 || length < 0) { - start = 0; - length = 0; - } - - // 0 length and start and non-zero start line says we know - // the line for some reason, but not the offset. - if (length == 0 && start == 0 && element.getStartLine() > 0) { - // We have the information in term of lines, we can work it out. - // Binary elements return the first executable statement so we have to substract -1 - start = getDocumentProvider().getDocument(getEditorInput()).getLineOffset(element.getStartLine() - 1); - if (element.getEndLine() > 0) { - length = getDocumentProvider().getDocument(getEditorInput()).getLineOffset(element.getEndLine()) - start; - } else { - length = start; - } - // create an alternate region for the keyword highlight. - alternateRegion = getDocumentProvider().getDocument(getEditorInput()).getLineInformation(element.getStartLine() - 1); - if (start == length || length < 0) { - if (alternateRegion != null) { - start = alternateRegion.getOffset(); - length = alternateRegion.getLength(); - } - } - } - setHighlightRange(start, length, moveCursor); - - if (moveCursor) { - start = element.getIdStartPos(); - length = element.getIdLength(); - if (start == 0 && length == 0 && alternateRegion != null) { - start = alternateRegion.getOffset(); - length = alternateRegion.getLength(); - } - if (start > -1 && getSourceViewer() != null) { - getSourceViewer().revealRange(start, length); - getSourceViewer().setSelectedRange(start, length); - } - updateStatusField(CTextEditorActionConstants.STATUS_CURSOR_POS); - } - return; - } catch (IllegalArgumentException x) { - } catch (BadLocationException e) { - } - - if (moveCursor) - resetHighlightRange(); - } - - private boolean isActivePart() { - IWorkbenchWindow window = getSite().getWorkbenchWindow(); - IPartService service = window.getPartService(); - return (this == service.getActivePart()); - } - - public void dispose() { - - if (fCEditorErrorTickUpdater != null) { - fCEditorErrorTickUpdater.setAnnotationModel(null); - fCEditorErrorTickUpdater = null; - } - if (fBracketMatcher != null) { - fBracketMatcher.dispose(); - fBracketMatcher = null; - } - if (fPropertyChangeListener != null) { - Preferences preferences = CCorePlugin.getDefault().getPluginPreferences(); - preferences.removePropertyChangeListener(fPropertyChangeListener); - IPreferenceStore preferenceStore = getPreferenceStore(); - preferenceStore.removePropertyChangeListener(fPropertyChangeListener); - } - super.dispose(); - } - - protected void createActions() { - super.createActions(); - - // Default text editing menu items - - IAction action = new TextOperationAction(CEditorMessages.getResourceBundle(), "Comment.", this, ITextOperationTarget.PREFIX); //$NON-NLS-1$ - action.setActionDefinitionId(ICEditorActionDefinitionIds.COMMENT); - setAction("Comment", action); //$NON-NLS-1$ - markAsStateDependentAction("Comment", true); //$NON-NLS-1$ - - action = new TextOperationAction(CEditorMessages.getResourceBundle(), "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); //$NON-NLS-1$ - action.setActionDefinitionId(ICEditorActionDefinitionIds.UNCOMMENT); - setAction("Uncomment", action); //$NON-NLS-1$ - markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$ - - action = new TextOperationAction(CEditorMessages.getResourceBundle(), "Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$ - action.setActionDefinitionId(ICEditorActionDefinitionIds.FORMAT); - setAction("Format", action); //$NON-NLS-1$ - markAsStateDependentAction("Format", true); //$NON-NLS-1$ - - action = new ContentAssistAction(CEditorMessages.getResourceBundle(), "ContentAssistProposal.", this); //$NON-NLS-1$ - action.setActionDefinitionId(ICEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - setAction("ContentAssistProposal", action); - markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$ - - action = new TextOperationAction(CEditorMessages.getResourceBundle(), "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION); //$NON-NLS-1$ - action.setActionDefinitionId(ICEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION); - setAction("ContentAssistTip", action); - - setAction("AddIncludeOnSelection", new AddIncludeOnSelectionAction(this)); //$NON-NLS-1$ - - action = new OpenDeclarationsAction(this); - action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL); - setAction("OpenDeclarations", action); - - fFileSearchAction = new FileSearchAction(getSelectionProvider()); - - fFileSearchActionInWorkingSet = new FileSearchActionInWorkingSet(getSelectionProvider()); - - fSearchDialogAction = new SearchDialogAction(getSelectionProvider(), this); - } - - public void editorContextMenuAboutToShow(IMenuManager menu) { - super.editorContextMenuAboutToShow(menu); - - addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_REORGANIZE); - addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_GENERATE); - addGroup(menu, ITextEditorActionConstants.GROUP_EDIT, IContextMenuConstants.GROUP_NEW); - - // Code formatting menu items -- only show in C perspective - addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); //$NON-NLS-1$ - addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Uncomment"); //$NON-NLS-1$ - // @@@ disabled for now until we get it to do something... - //addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Format"); //$NON-NLS-1$ - - MenuManager search = new MenuManager("Search", IContextMenuConstants.GROUP_SEARCH); //$NON-NLS-1$ - menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, search); - - if (SearchDialogAction.canActionBeAdded(getSelectionProvider().getSelection())){ - search.add(fSearchDialogAction); - } - - if (FileSearchAction.canActionBeAdded(getSelectionProvider().getSelection())) { - MenuManager fileSearch = new MenuManager("File Search"); - fileSearch.add(fFileSearchAction); - fileSearch.add(fFileSearchActionInWorkingSet); - search.add(fileSearch); - } - - addAction(menu, IContextMenuConstants.GROUP_GENERATE, "ContentAssistProposal"); //$NON-NLS-1$ - addAction(menu, IContextMenuConstants.GROUP_GENERATE, "AddIncludeOnSelection"); //$NON-NLS-1$ - addAction(menu, IContextMenuConstants.GROUP_GENERATE, "OpenDeclarations"); //$NON-NLS-1$ - } - - public void setOutlinePageInput(CContentOutlinePage page, IEditorInput input) { - if (page != null) { - IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); - page.setInput((IWorkingCopy)manager.getWorkingCopy(input)); - } - } - - /** - * The AbstractTextEditor implementation of this - * IWorkbenchPart method creates the vertical ruler and - * source viewer. Subclasses may extend. - * - * We attach our own mouseDown listener on the menu bar, - * and our own listener for cursor/key/selection events to update cursor position in - * status bar. - */ - public void createPartControl(Composite parent) { - super.createPartControl(parent); - ISelectionChangedListener sListener = new ISelectionChangedListener() { - private Runnable fRunnable = new Runnable() { - public void run() { - updateStatusField(CTextEditorActionConstants.STATUS_CURSOR_POS); - } - }; - - private Display fDisplay; - - public void selectionChanged(SelectionChangedEvent event) { - if (fDisplay == null) - fDisplay = getSite().getShell().getDisplay(); - fDisplay.asyncExec(fRunnable); - } - }; - getSelectionProvider().addSelectionChangedListener(sListener); - - if (isTabConversionEnabled()) - startTabConversion(); - - IPreferenceStore preferenceStore = getPreferenceStore(); - preferenceStore.addPropertyChangeListener(fPropertyChangeListener); - - Preferences preferences = CCorePlugin.getDefault().getPluginPreferences(); - preferences.addPropertyChangeListener(fPropertyChangeListener); - } - - private IMarker getNextError(int offset, boolean forward) { - - IMarker nextError = null; - - IDocument document = getDocumentProvider().getDocument(getEditorInput()); - int endOfDocument = document.getLength(); - int distance = 0; - - IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput()); - Iterator e = model.getAnnotationIterator(); - while (e.hasNext()) { - Annotation a = (Annotation) e.next(); - if (a instanceof CMarkerAnnotation) { - MarkerAnnotation ma = (MarkerAnnotation) a; - IMarker marker = ma.getMarker(); - - if (MarkerUtilities.isMarkerType(marker, IMarker.PROBLEM)) { - Position p = model.getPosition(a); - if (!p.includes(offset)) { - - int currentDistance = 0; - - if (forward) { - currentDistance = p.getOffset() - offset; - if (currentDistance < 0) - currentDistance = endOfDocument - offset + p.getOffset(); - } else { - currentDistance = offset - p.getOffset(); - if (currentDistance < 0) - currentDistance = offset + endOfDocument - p.getOffset(); - } - - if (nextError == null || (currentDistance < distance && currentDistance != 0)) { - distance = currentDistance; - if (distance == 0) - distance = endOfDocument; - nextError = marker; - } - } - } - } - } - return nextError; - } - - public void gotoError(boolean forward) { - - ISelectionProvider provider = getSelectionProvider(); - - if (fStatusLineClearer != null) { - provider.removeSelectionChangedListener(fStatusLineClearer); - fStatusLineClearer = null; - } - - ITextSelection s = (ITextSelection) provider.getSelection(); - IMarker nextError = getNextError(s.getOffset(), forward); - - if (nextError != null) { - - gotoMarker(nextError); - - IWorkbenchPage page = getSite().getPage(); - - IViewPart view = view = page.findView("org.eclipse.ui.views.TaskList"); //$NON-NLS-1$ - if (view instanceof TaskList) { - StructuredSelection ss = new StructuredSelection(nextError); - ((TaskList) view).setSelection(ss, true); - } - - getStatusLineManager().setErrorMessage(nextError.getAttribute(IMarker.MESSAGE, "")); //$NON-NLS-1$ - fStatusLineClearer = new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - getSelectionProvider().removeSelectionChangedListener(fStatusLineClearer); - fStatusLineClearer = null; - getStatusLineManager().setErrorMessage(""); //$NON-NLS-1$ - } - }; - provider.addSelectionChangedListener(fStatusLineClearer); - - } else { - - getStatusLineManager().setErrorMessage(""); //$NON-NLS-1$ - - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.IShowInSource#getShowInContext() - * - * This is required by the IShowInSource interface for the "ShowIn" - * navigation menu generalized in Eclipse. - */ - public ShowInContext getShowInContext() { - return new ShowInContext( getEditorInput(), null ); - } - - /* - * Get the dektop's StatusLineManager - */ - protected IStatusLineManager getStatusLineManager() { - IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor(); - if (contributor instanceof EditorActionBarContributor) { - return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager(); - } - return null; - } - - private void startTabConversion() { - if (fTabConverter == null) { - fTabConverter = new TabConverter(); - fTabConverter.setNumberOfSpacesPerTab(getPreferenceStore().getInt(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH)); - AdaptedSourceViewer asv = (AdaptedSourceViewer) getSourceViewer(); - asv.addTextConverter(fTabConverter); - } - } - - private void stopTabConversion() { - if (fTabConverter != null) { - AdaptedSourceViewer asv = (AdaptedSourceViewer) getSourceViewer(); - asv.removeTextConverter(fTabConverter); - fTabConverter = null; - } - } - - private boolean isTabConversionEnabled() { - IPreferenceStore store = getPreferenceStore(); - return store.getBoolean(SPACES_FOR_TABS); - } - - interface ITextConverter { - void customizeDocumentCommand(IDocument document, DocumentCommand command); - }; - - static class TabConverter implements ITextConverter { - - private String fTabString = ""; - private int tabRatio = 0; - - public void setNumberOfSpacesPerTab(int ratio) { - tabRatio = ratio; - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < ratio; i++) - buffer.append(' '); - fTabString = buffer.toString(); - } - - public void customizeDocumentCommand(IDocument document, DocumentCommand command) { - String text = command.text; - StringBuffer buffer = new StringBuffer(); - final String TAB = "\t"; - // create tokens including the tabs - StringTokenizer tokens = new StringTokenizer(text, TAB, true); - - int charCount = 0; - try { - // get offset of insertion less start of line - // buffer to determine how many characters - // are already on this line and adjust tabs accordingly - charCount = command.offset - (document.getLineInformationOfOffset(command.offset).getOffset()); - } catch (Exception ex) { - - } - - String nextToken = null; - int spaces = 0; - while (tokens.hasMoreTokens()) { - nextToken = tokens.nextToken(); - if (TAB.equals(nextToken)) { - spaces = tabRatio - (charCount % tabRatio); - - for (int i = 0; i < spaces; i++) { - buffer.append(' '); - } - - charCount += spaces; - } else { - buffer.append(nextToken); - charCount += nextToken.length(); - } - } - command.text = buffer.toString(); - } - }; - - /* Source code language to display */ - public final static String LANGUAGE_CPP = "CEditor.language.cpp"; - public final static String LANGUAGE_C = "CEditor.language.c"; - - /** - * Adapted source viewer for CEditor - */ - - public class AdaptedSourceViewer extends SourceViewer implements ITextViewerExtension { - - private List fTextConverters; - private String fDisplayLanguage; - - public AdaptedSourceViewer( - Composite parent, - IVerticalRuler ruler, - int styles, - IOverviewRuler fOverviewRuler, - boolean isOverviewRulerShowing, - String language) { - super(parent, ruler, fOverviewRuler, isOverviewRulerShowing, styles); - fDisplayLanguage = language; - } - public IContentAssistant getContentAssistant() { - return fContentAssistant; - } - - /* - * @see ITextOperationTarget#doOperation(int) - */ - public void doOperation(int operation) { - - if (getTextWidget() == null) { - return; - } - switch (operation) { - case CONTENTASSIST_PROPOSALS: - String msg= fContentAssistant.showPossibleCompletions(); - setStatusLineErrorMessage(msg); - return; - } - super.doOperation(operation); - } - - public void insertTextConverter(ITextConverter textConverter, int index) { - throw new UnsupportedOperationException(); - } - - public void addTextConverter(ITextConverter textConverter) { - if (fTextConverters == null) { - fTextConverters = new ArrayList(1); - fTextConverters.add(textConverter); - } else if (!fTextConverters.contains(textConverter)) - fTextConverters.add(textConverter); - } - - public void removeTextConverter(ITextConverter textConverter) { - if (fTextConverters != null) { - fTextConverters.remove(textConverter); - if (fTextConverters.size() == 0) - fTextConverters = null; - } - } - - /* - * @see TextViewer#customizeDocumentCommand(DocumentCommand) - */ - protected void customizeDocumentCommand(DocumentCommand command) { - super.customizeDocumentCommand(command); - if (fTextConverters != null) { - for (Iterator e = fTextConverters.iterator(); e.hasNext();) - ((ITextConverter) e.next()).customizeDocumentCommand(getDocument(), command); - } - } - - public void setDisplayLanguage(String language) { - fDisplayLanguage = language; - } - - public String getDisplayLanguage() { - return fDisplayLanguage; - } - }; - - /* - * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int) - */ - protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { - // Figure out if this is a C or C++ source file - String filename = getEditorInput().getName(); - boolean c_file = filename.endsWith(".c"); - - if (!c_file && filename.endsWith(".h")) { - // ensure that this .h file is part of a C project & not a CPP project - - IFile file = getInputFile(); - if (file != null) { - IProject project = file.getProject(); - c_file = !CoreModel.getDefault().hasCCNature(project); - } - } - fAnnotationAccess = createAnnotationAccess(); - ISharedTextColors sharedColors = CUIPlugin.getDefault().getSharedTextColors(); - - fOverviewRuler = new OverviewRuler(fAnnotationAccess, VERTICAL_RULER_WIDTH, sharedColors); - Iterator e = fAnnotationPreferences.getAnnotationPreferences().iterator(); - while (e.hasNext()) { - AnnotationPreference preference = (AnnotationPreference) e.next(); - if (preference.contributesToHeader()) - fOverviewRuler.addHeaderAnnotationType(preference.getAnnotationType()); - } - - ISourceViewer sourceViewer = - new AdaptedSourceViewer( - parent, - ruler, - styles, - fOverviewRuler, - isOverviewRulerVisible(), - c_file ? LANGUAGE_C : LANGUAGE_CPP); - fSourceViewerDecorationSupport = - new SourceViewerDecorationSupport(sourceViewer, fOverviewRuler, fAnnotationAccess, sharedColors); - configureSourceViewerDecorationSupport(); - return sourceViewer; - } - - /** - * Creates the annotation access for this editor. - * @return the created annotation access - */ - protected IAnnotationAccess createAnnotationAccess() { - return new DefaultMarkerAnnotationAccess(fAnnotationPreferences); - } - - protected void configureSourceViewerDecorationSupport() { - Iterator e = fAnnotationPreferences.getAnnotationPreferences().iterator(); - while (e.hasNext()) - fSourceViewerDecorationSupport.setAnnotationPreference((AnnotationPreference) e.next()); - fSourceViewerDecorationSupport.setAnnotationPainterPreferenceKeys( - DefaultMarkerAnnotationAccess.UNKNOWN, - TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR, - TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION, - TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER, - 0); - - fSourceViewerDecorationSupport.setCharacterPairMatcher(fBracketMatcher); - fSourceViewerDecorationSupport.setMatchingCharacterPainterPreferenceKeys(MATCHING_BRACKETS, MATCHING_BRACKETS_COLOR); - - fSourceViewerDecorationSupport.setCursorLinePainterPreferenceKeys( - ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, - ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR); - fSourceViewerDecorationSupport.setMarginPainterPreferenceKeys( - ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, - ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, - ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN); - fSourceViewerDecorationSupport.setSymbolicFontName(getFontPropertyPreferenceKey()); - } - - /** Outliner context menu Id */ - protected String fOutlinerContextMenuId; - - /** - * Sets the outliner's context menu ID. - */ - protected void setOutlinerContextMenuId(String menuId) { - fOutlinerContextMenuId = menuId; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.editors.text.TextEditor#initializeKeyBindingScopes() - */ - protected void initializeKeyBindingScopes() { - setKeyBindingScopes(new String [] { "org.eclipse.cdt.ui.cEditorScope" } ); - } - - /* (non-Javadoc) - * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent) - */ - protected boolean affectsTextPresentation(PropertyChangeEvent event) { - CTextTools textTools = CUIPlugin.getDefault().getTextTools(); - AsmTextTools asmTools = CUIPlugin.getDefault().getAsmTextTools(); - return textTools.affectsBehavior(event) || asmTools.affectsBehavior(event); - } - - /** - * Handles a property change event describing a change - * of the C core's preferences and updates the preference - * related editor properties. - * - * @param event the property change event - */ - protected void handlePreferencePropertyChanged(org.eclipse.jface.util.PropertyChangeEvent event) { - if (TRANSLATION_TASK_TAGS.equals(event.getProperty())) { - ISourceViewer sourceViewer= getSourceViewer(); - if (sourceViewer != null && affectsTextPresentation(event)) - sourceViewer.invalidateTextPresentation(); - } - } - - /** - * Sets the given message as error message to this editor's status line. - * - * @param msg message to be set - */ - protected void setStatusLineErrorMessage(String msg) { - IEditorStatusLine statusLine= (IEditorStatusLine) getAdapter(IEditorStatusLine.class); - if (statusLine != null) - statusLine.setMessage(true, msg, null); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java deleted file mode 100644 index c3b611aa599..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ResourceBundle; - -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.IContextMenuConstants; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.editors.text.TextEditorActionContributor; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.RetargetTextEditorAction; -import org.eclipse.ui.texteditor.TextEditorAction; - -public class CEditorActionContributor extends TextEditorActionContributor { - - protected static class SelectionAction extends TextEditorAction implements ISelectionChangedListener { - - protected int fOperationCode; - protected ITextOperationTarget fOperationTarget= null; - - - public SelectionAction(String prefix, int operation) { - super(CEditorMessages.getResourceBundle(), prefix, null); - fOperationCode= operation; - setEnabled(false); - } - - /** - * @see TextEditorAction#setEditor(ITextEditor) - */ - public void setEditor(ITextEditor editor) { - if (getTextEditor() != null) { - ISelectionProvider p= getTextEditor().getSelectionProvider(); - if (p != null) p.removeSelectionChangedListener(this); - } - - super.setEditor(editor); - - if (editor != null) { - ISelectionProvider p= editor.getSelectionProvider(); - if (p != null) p.addSelectionChangedListener(this); - fOperationTarget= (ITextOperationTarget) editor.getAdapter(ITextOperationTarget.class); - } else { - fOperationTarget= null; - } - - selectionChanged(null); - } - - /** - * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent) - */ - public void selectionChanged(SelectionChangedEvent event) { - boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); - setEnabled(isEnabled); - } - - /** - * @see Action#run() - */ - public void run() { - if (fOperationCode != -1 && fOperationTarget != null) - fOperationTarget.doOperation(fOperationCode); - } - }; - - protected CEditor fCEditor; - protected RetargetTextEditorAction fContentAssist; - protected RetargetTextEditorAction fAddInclude; - protected RetargetTextEditorAction fOpenOnSelection; - protected SelectionAction fShiftLeft; - protected SelectionAction fShiftRight; - private TogglePresentationAction fTogglePresentation; - //private ToggleTextHoverAction fToggleTextHover; - private GotoErrorAction fPreviousError; - private GotoErrorAction fNextError; - - - public CEditorActionContributor() { - super(); - - ResourceBundle bundle = CEditorMessages.getResourceBundle(); - - fShiftRight= new SelectionAction("ShiftRight.", ITextOperationTarget.SHIFT_RIGHT); - fShiftRight.setActionDefinitionId(ICEditorActionDefinitionIds.SHIFT_RIGHT); - CPluginImages.setImageDescriptors(fShiftRight, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SHIFT_RIGHT); - - fShiftLeft= new SelectionAction("ShiftLeft.", ITextOperationTarget.SHIFT_LEFT); - fShiftLeft.setActionDefinitionId(ICEditorActionDefinitionIds.SHIFT_LEFT); - CPluginImages.setImageDescriptors(fShiftLeft, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SHIFT_LEFT); - - fContentAssist = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); - fContentAssist.setActionDefinitionId(ICEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - CPluginImages.setImageDescriptors(fContentAssist, CPluginImages.T_TOOL, CPluginImages.IMG_MENU_COLLAPSE_ALL); - - fAddInclude = new RetargetTextEditorAction(bundle, "AddIncludeOnSelection."); - fAddInclude.setActionDefinitionId(ICEditorActionDefinitionIds.ADD_INCLUDE); - - fOpenOnSelection = new RetargetTextEditorAction(bundle, "OpenOnSelection."); - - // actions that are "contributed" to editors, they are considered belonging to the active editor - fTogglePresentation= new TogglePresentationAction(); - fTogglePresentation.setActionDefinitionId(ICEditorActionDefinitionIds.TOGGLE_PRESENTATION); - - //fToggleTextHover= new ToggleTextHoverAction(); - - fPreviousError= new GotoErrorAction("PreviousError.", false); //$NON-NLS-1$ - fPreviousError.setActionDefinitionId("org.eclipse.ui.navigate.previous"); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(fPreviousError, CPluginImages.T_TOOL, CPluginImages.IMG_TOOL_GOTO_PREV_ERROR); - - fNextError= new GotoErrorAction("NextError.", true); //$NON-NLS-1$ - fNextError.setActionDefinitionId("org.eclipse.ui.navigate.next"); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(fNextError, CPluginImages.T_TOOL, CPluginImages.IMG_TOOL_GOTO_NEXT_ERROR); - } - - - - /** - * @see IActionBarContributor#contributeToMenu(MenuManager) - */ - public void contributeToMenu(IMenuManager menu) { - - super.contributeToMenu(menu); - - /* - * Hook in the code assist - */ - - IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); - if (editMenu != null) { - editMenu.add(fShiftRight); - editMenu.add(fShiftLeft); - - editMenu.add(new Separator(IContextMenuConstants.GROUP_OPEN)); - editMenu.add(fNextError); - editMenu.add(fPreviousError); - - editMenu.add(new Separator(IContextMenuConstants.GROUP_GENERATE)); - editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fContentAssist); - editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fAddInclude); - editMenu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, fOpenOnSelection); - } - } - - /** - * @see EditorActionBarContributor#contributeToToolBar(IToolBarManager) - */ - public void contributeToToolBar(IToolBarManager tbm) { - super.contributeToToolBar(tbm); - tbm.add(new Separator()); - tbm.add(fTogglePresentation); - //tbm.add(fToggleTextHover); - tbm.add(fNextError); - tbm.add(fPreviousError); - } - - /** - * @see IEditorActionBarContributor#setActiveEditor(IEditorPart) - */ - public void setActiveEditor(IEditorPart part) { - - super.setActiveEditor(part); - - ITextEditor textEditor= null; - if (part instanceof ITextEditor) - textEditor= (ITextEditor) part; - - fShiftRight.setEditor(textEditor); - fShiftLeft.setEditor(textEditor); - fNextError.setEditor(textEditor); - fPreviousError.setEditor(textEditor); - fTogglePresentation.setEditor(textEditor); - - //caAction.setEditor(textEditor); - //caAction.update(); - fContentAssist.setAction(getAction(textEditor, "ContentAssistProposal")); //$NON-NLS-1$ - fAddInclude.setAction(getAction(textEditor, "AddIncludeOnSelection")); //$NON-NLS-1$ - fOpenOnSelection.setAction(getAction(textEditor, "OpenOnSelection")); //$NON-NLS-1$ - } - - /* - * @see EditorActionBarContributor#contributeToStatusLine(IStatusLineManager) - * - * More code here only until we move to 2.0... - */ - public void contributeeToStatusLine(IStatusLineManager statusLineManager) { - super.contributeToStatusLine(statusLineManager); - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorErrorTickUpdater.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorErrorTickUpdater.java deleted file mode 100644 index 55ee1a7614a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorErrorTickUpdater.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.CElementImageProvider; -import org.eclipse.cdt.ui.CElementLabelProvider; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.IAnnotationModelListener; -import org.eclipse.jface.util.Assert; - -import org.eclipse.ui.IEditorInput; - -/** - * The JavaEditorErrorTickUpdater will register as a AnnotationModelListener - * on the annotation model of a Java Editor and update the title images when the annotation - * model changed. - */ -public class CEditorErrorTickUpdater implements IAnnotationModelListener { - - protected CEditor fCEditor; - private IAnnotationModel fAnnotationModel; - private CElementLabelProvider fLabelProvider; - - public CEditorErrorTickUpdater(CEditor editor) { - fCEditor= editor; - Assert.isNotNull(editor); - } - - /** - * Defines the annotation model to listen to. To be called when the - * annotation model changes. - * @param model The new annotation model or null - * to uninstall. - */ - public void setAnnotationModel(IAnnotationModel model) { - if (fAnnotationModel != null) { - fAnnotationModel.removeAnnotationModelListener(this); - } - - if (model != null) { - if (fLabelProvider == null) { - fLabelProvider= new CElementLabelProvider(0, CElementImageProvider.SMALL_ICONS, CElementLabelProvider.getAdornmentProviders(true, null)); - } - fAnnotationModel=model; - fAnnotationModel.addAnnotationModelListener(this); - modelChanged(fAnnotationModel); - } else { - if (fLabelProvider != null) { - fLabelProvider.dispose(); - } - fLabelProvider= null; - fAnnotationModel= null; - } - } - - /* - * @see IAnnotationModelListener#modelChanged(IAnnotationModel) - */ - public void modelChanged(IAnnotationModel model) { - Image titleImage= fCEditor.getTitleImage(); - if (titleImage == null) { - return; - } - IEditorInput input= fCEditor.getEditorInput(); - if (input != null) { // might run async, tests needed - ICElement celement= (ICElement) input.getAdapter(ICElement.class); - if (fLabelProvider != null && celement != null) { - Image newImage= fLabelProvider.getImage(celement); - if (titleImage != newImage) { - updatedTitleImage(newImage); - } - } - } - } - - private void updatedTitleImage(final Image newImage) { - Shell shell= fCEditor.getEditorSite().getShell(); - if (shell != null && !shell.isDisposed()) { - shell.getDisplay().syncExec(new Runnable() { - public void run() { - fCEditor.updatedTitleImage(newImage); - } - }); - } - } - -} - - - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java deleted file mode 100644 index 4d858decf7a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - - -public class CEditorMessages -{ - private static final String RESOURCE_BUNDLE = "org.eclipse.cdt.internal.ui.editor.CEditorMessages"; - - - private static ResourceBundle fgResourceBundle = ResourceBundle.getBundle( RESOURCE_BUNDLE ); - - - private CEditorMessages() - { - } - - - public static ResourceBundle getResourceBundle() - { - return fgResourceBundle; - } - - public static String getString( String key ) - { - try - { - return fgResourceBundle.getString( key ); - } - catch( MissingResourceException e ) - { - return "!" + key + "!"; - } - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties deleted file mode 100644 index fbf2bed9683..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties +++ /dev/null @@ -1,136 +0,0 @@ -######################################### -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -######################################### - -AddIncludeOnSelection.description=Add include statement on selection -AddIncludeOnSelection.dialog.message=&Choose element to generate an include statement for: -AddIncludeOnSelection.dialog.title=Add Include -AddIncludeOnSelection.error.message1=Adding include statements failed -AddIncludeOnSelection.error.message2=Error -AddIncludeOnSelection.error.message3=Error -AddIncludeOnSelection.error.message4=BadLocationException: -AddIncludeOnSelection.label=Add I&nclude@Ctrl+Shift+N -AddIncludeOnSelection.tooltip=Add Include Statement on Selection - -ClassFileEditor.error.invalid_input_message=Invalid input for Class File Editor - -ClassFileMarkerAnnotationModel.error.isAcceptable=ClassFileMarkerAnnotationModel.isAcceptable -ClassFileMarkerAnnotationModel.error.isAffected=ClassFileMarkerAnnotationModel.isAffected -ClassFileMarkerAnnotationModel.error.resourceChanged=ClassFileMarkerAnnotationModel.resourceChanged - -CEditor.error.saving.message=Save could not be completed. {0} -CEditor.error.saving.title=Problems During Save As... - -CEditorPreferencePage.description= C Editor Preferences - -DeleteISourceManipulations.description=Delete the selected element in the editor -DeleteISourceManipulations.error.deleting.message1=Cannot delete element: -DeleteISourceManipulations.error.deleting.title1=Problems while deleting element -DeleteISourceManipulations.label=&Delete -DeleteISourceManipulations.tooltip=Delete the selected element in the editor - -EditorDisplay.description=Display -EditorDisplay.label=D&isplay -EditorDisplay.tooltip=Display -EditorDisplay.error.title1=Cannot open Display viewer - -JavaOutlinePage.ContextMenu.refactoring.label=&Refactor -JavaOutlinePage.HideFields.description.checked=Shows Fields -JavaOutlinePage.HideFields.description.unchecked=Hides Fields -JavaOutlinePage.HideFields.label=Hide Fields -JavaOutlinePage.HideFields.tooltip.checked=Show Fields -JavaOutlinePage.HideFields.tooltip.unchecked=Hide Fields -JavaOutlinePage.HideNonePublicMembers.description.checked=Shows non-public members -JavaOutlinePage.HideNonePublicMembers.description.unchecked=Hides non-public members -JavaOutlinePage.HideNonePublicMembers.label=Show Public Members Only -JavaOutlinePage.HideNonePublicMembers.tooltip.checked=Show Non-Public Members -JavaOutlinePage.HideNonePublicMembers.tooltip.unchecked=Hide Non-Public Members -JavaOutlinePage.HideStaticMembers.description.checked=Shows static members -JavaOutlinePage.HideStaticMembers.description.unchecked=Hides static members -JavaOutlinePage.HideStaticMembers.label=Hide Static Members -JavaOutlinePage.HideStaticMembers.tooltip.checked=Show Static Members -JavaOutlinePage.HideStaticMembers.tooltip.unchecked=Hide Static Members -JavaOutlinePage.Sort.description.checked=Disable Sorting -JavaOutlinePage.Sort.description.unchecked=Enable Sorting -JavaOutlinePage.Sort.label=Sort -JavaOutlinePage.Sort.tooltip.checked=Do Not Sort -JavaOutlinePage.Sort.tooltip.unchecked=Sort -JavaOutlinePage.error.ChildrenProvider.getChildren.message1=JavaOutlinePage.ChildrenProvider.getChildren -JavaOutlinePage.error.ChildrenProvider.hasChildren.message1=JavaOutlinePage.ChildrenProvider.hasChildren - -OpenHierarchy.description=Show the type hierarchy of the selected element -OpenHierarchy.dialog.message=&Select the type to open: -OpenHierarchy.dialog.title=Open Type Hierarchy -OpenHierarchy.label=Open Type &Hierarchy@F4 -OpenHierarchy.tooltip=Show the type hierarchy of the selected element - -OpenDeclarations.description=Open an editor on the selected element's declaration(s) -OpenDeclarations.dialog.message=&Select or enter the element to open: -OpenDeclarations.dialog.title=Open Declarations -OpenDeclarations.label=&Open Declarations@F3 -OpenDeclarations.tooltip=Open an editor on the selected element's declaration(s) - -OrganizeImports.description=Evaluate all required imports and replace the current imports -OrganizeImports.error.message2=Syntax errors in compilation unit prevent correct evaluation\nof type references. Fix errors first. -OrganizeImports.error.title1=Organize Imports -OrganizeImports.error.title2=Organize Imports -OrganizeImports.label=Or&ganize Imports@Ctrl+Shift+O -OrganizeImports.ok_label=OK -OrganizeImports.tooltip=Evaluate All Required Imports and Replace the Current Imports - -RunToLine.description=Run to line -RunToLine.error.message1=Unable to process run to line request. -RunToLine.error.title1=Run to Line -RunToLine.label=R&un to Line -RunToLine.tooltip=Run to line - -TogglePresentation.label=Show Source of Selected Element Only -TogglePresentation.tooltip=Show Source of Selected Element Only - -ToggleTextHover.label=Show Text Hover -ToggleTextHover.tooltip=Show Text Hover - -NextError.label=Ne&xt Problem -NextError.tooltip=Go to Next Problem -NextError.description=Go to next problem - -PreviousError.label=Previo&us Problem -PreviousError.tooltip=Go to Previous Problem -PreviousError.description=Go to previous problem - -ContentAssistProposal.label=Co&ntent Assist@Ctrl+Space -ContentAssistProposal.tooltip=Content Assist -ContentAssistProposal.description=Content Assist - -RunToLine.label=R&un to Line -RunToLine.description=Run to line -RunToLine.error.title1=Run To Line -RunToLine.error.message1=Unable to process run to line request. - -Comment.label=&Comment -Comment.tooltip=Comment the Selected Lines -Comment.description=Turn the selected lines into C // style comments - -Uncomment.label=Uncommen&t -Uncomment.tooltip=Uncomment the Selected C // comment Lines -Uncomment.description=Uncomment the selected C // comment lines - -Format.label=F&ormat -Format.tooltip=Format the Selected Text -Format.description=Format the selected text - -ShiftRight.label=Sh&ift Right@Ctrl+I -ShiftRight.tooltip=Shift Right -ShiftRight.description=Shift the selected text to the right - -ShiftLeft.label=S&hift Left@Ctrl+Shift+I -ShiftLeft.tooltip=Shift Left -ShiftLeft.description=Shift the selected text to the left - -CompilationUnitDocumentProvider.error.createElementInfo=CompilationUnitDocumentProvider.createElementInfo -CompilationUnitDocumentProvider.out_of_sync.message=Compilation unit buffer and document are out of sync - -JavaEditor.Inspect.description=Inspect the result of evaluating the selected text -JavaEditor.Inspect.label=I&nspect -JavaEditor.Inspect.tooltip=Inspect the Result of Evaluating the Selected Text diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorTextHoverDispatcher.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorTextHoverDispatcher.java deleted file mode 100644 index 9007d928e9e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorTextHoverDispatcher.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.HashMap; - -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; - -public class CEditorTextHoverDispatcher implements ITextHover -{ - private IEditorPart fEditor = null; - private HashMap fTextHovers = null; - private DefaultCEditorTextHover fDefaultTextHover = null; - - /** - * Constructor for CEditorTextHover - */ - public CEditorTextHoverDispatcher( IEditorPart editor, HashMap textHovers ) - { - fEditor = editor; - fTextHovers = textHovers; - fDefaultTextHover = new DefaultCEditorTextHover( editor ); - } - - /** - * @see ITextHover#getHoverInfo(ITextViewer, IRegion) - */ - public String getHoverInfo( ITextViewer textViewer, IRegion region ) - { - return getCurrentTextHover().getHoverInfo( textViewer, region ); - } - - /** - * @see ITextHover#getHoverRegion(ITextViewer, int) - */ - public IRegion getHoverRegion( ITextViewer textViewer, int offset ) - { - return getCurrentTextHover().getHoverRegion( textViewer, offset ); - } - - private ITextHover getCurrentTextHover() - { - IWorkbenchPage page; - if(fEditor != null && fEditor.getSite() != null && - (page = fEditor.getSite().getPage()) != null) { - Object textHover = fTextHovers.get( page.getPerspective().getId() ); - if ( textHover != null && textHover instanceof ITextHover ) - return (ITextHover)textHover; - } - return fDefaultTextHover; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotation.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotation.java deleted file mode 100644 index 1cf2df4f909..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotation.java +++ /dev/null @@ -1,263 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.ui.texteditor.MarkerAnnotation; -import org.eclipse.ui.texteditor.MarkerUtilities; - -import org.eclipse.cdt.core.model.ICModelMarker; - - -public class CMarkerAnnotation extends MarkerAnnotation implements IProblemAnnotation { - - private boolean fIsProblemMarker; - private IDocument fDocument; - private int error_start = -1; - private int error_length = 0; - private IDebugModelPresentation fPresentation; - - public CMarkerAnnotation(IMarker marker, IDocument document) { - super(marker); - fDocument = document; - if (MarkerUtilities.isMarkerType(getMarker(), ICModelMarker.C_MODEL_PROBLEM_MARKER)) { - fIsProblemMarker = true; - try { - String var = (String) getMarker().getAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE); - if(var != null && fDocument != null) { - int line = getMarker().getAttribute(IMarker.LOCATION, -1) - 1; - if(line >= 0) { - int position = fDocument.getLineOffset(line); - String text = fDocument.get(position, fDocument.getLineLength(line)); - int start = 0, end, pos; - pos = 0; - while(start != -1) { - start = getStart(text, var, pos); - if(start >= 0) { - if(Character.isJavaIdentifierStart(text.charAt(start + var.length())) == false) { - break; - } - } - pos += var.length(); - } - //start = text.indexOf(var); - if(start >= 0) { - end = start + var.length(); - // We cannot just update the marker attributes as the workspace resource tree is locked - Map map = marker.getAttributes(); - MarkerUtilities.setCharStart(map, position+start); - MarkerUtilities.setCharEnd(map, position+end); - error_start = position+start; - error_length = end-start; - - //getMarker().setAttribute(IMarker.CHAR_START, position+start); - //getMarker().setAttribute(IMarker.CHAR_END, position+end); - } - } - } - } catch (CoreException e) { - } catch (BadLocationException e) { - } - } - } - /** - * Ensures that we return a value that is not encased in a String - */ - private int getStart(String text, String var, int pos){ - - // determine if there are more than one instance of var in this text - int count = 0; - int currentPosition = pos; - while(currentPosition != -1){ - currentPosition = text.indexOf(var, currentPosition); - if (currentPosition != -1){ - // found one! - count++; - currentPosition += var.length(); - } - } - // only one occurrence return its index - if (count == 1){ - return text.indexOf(var, pos); - } - - // otherwise we need to find the first one not inside of quotes - int indexOfStringStart = pos; - - final String QUOTE = "\""; - indexOfStringStart = text.indexOf(QUOTE, indexOfStringStart); - int newPosition = -1; - currentPosition = pos; // reinitialize currentPosition - - if (indexOfStringStart == -1) { - // No Strings ... return the first occurrence of var - newPosition = text.indexOf(var, currentPosition); - } else { - // we have Strings - StringTokenizer tokens = new StringTokenizer(text.substring(currentPosition), QUOTE, true); - String nextToken = null; - int quoteCount = 0; - int potentialStart = -1; - boolean found = false; - - while (tokens.hasMoreTokens() && !found){ - nextToken = tokens.nextToken(); - if(QUOTE.equals(nextToken)){ - quoteCount++; - } else { - if ((quoteCount % 2) == 0){ - // no open quotes .. we can check this token - potentialStart = nextToken.indexOf(var, 0); - if (potentialStart != -1){ - found = true; - currentPosition += potentialStart; - newPosition = currentPosition; - break; - } - }// else ... we have an open quote and must - // throw away this non-quote token - } - currentPosition += nextToken.length(); - } - } - - return newPosition; - } - - /** - * Initializes the annotation's icon representation and its drawing layer - * based upon the properties of the underlying marker. - */ - protected void initialize() { - try { - IMarker marker= getMarker(); - - if (MarkerUtilities.isMarkerType(marker, SearchUI.SEARCH_MARKER)) { - setLayer(2); - setImage(SearchUI.getSearchMarkerImage()); - fIsProblemMarker= false; - return; - } - else if (MarkerUtilities.isMarkerType(marker, IBreakpoint.LINE_BREAKPOINT_MARKER)) { - if (fPresentation == null) - fPresentation= DebugUITools.newDebugModelPresentation(); - - setLayer(4); - setImage(fPresentation.getImage(marker)); - - fIsProblemMarker= false; - return; - } else if (MarkerUtilities.isMarkerType(getMarker(), ICModelMarker.C_MODEL_PROBLEM_MARKER)) { - fIsProblemMarker = true; - String var = (String) marker.getAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE); - if(var != null && fDocument != null) { - int line = marker.getAttribute(IMarker.LOCATION, -1); - if(line >= 0 && line == -1) { - try { - int position = fDocument.getLineOffset(line); - System.out.println("offset " + position); - String text = fDocument.get(position, fDocument.getLineLength(line)); - System.out.println("text:" + text); - } catch (BadLocationException e) {} - } - } - } else { - if(marker.isSubtypeOf(ICModelMarker.C_MODEL_PROBLEM_MARKER)) { //|| getMarker().isSubtypeOf(IMarker.SEVERITY_WARNING)) { - fIsProblemMarker= true; - } else if (marker.isSubtypeOf(IMarker.TASK) || marker.isSubtypeOf(ICModelMarker.TASK_MARKER)) { - fIsProblemMarker= false; - } else - fIsProblemMarker = true; - } - - } catch (CoreException e) { - } - - super.initialize(); - } - - /** - * @see IProblemAnnotation#getMessage() - */ - public String getMessage() { - if (fIsProblemMarker) - return getMarker().getAttribute(IMarker.MESSAGE, ""); - return ""; - } - - /** - * @see IProblemAnnotation#isError() - */ - public boolean isError() { - if (fIsProblemMarker) { - int markerSeverity= getMarker().getAttribute(IMarker.SEVERITY, -1); - return (markerSeverity == IMarker.SEVERITY_ERROR); - } - return false; - } - - /** - * @see IProblemAnnotation#isWarning() - */ - public boolean isWarning() { - if (fIsProblemMarker) { - int markerSeverity= getMarker().getAttribute(IMarker.SEVERITY, -1); - return (markerSeverity == IMarker.SEVERITY_WARNING); - } - return false; - } - - /** - * @see IProblemAnnotation#isTemporaryProblem() - */ - public boolean isTemporaryProblem() { - return false; - } - - /** - * @see IProblemAnnotation#getArguments() - */ - public String[] getArguments() { - String [] s = {"problem", "here"}; - //if (fIsProblemMarker) - // return Util.getProblemArgumentsFromMarker(getMarker().getAttribute(CCorePlugin.C_PROBLEMMARKER)); - return s; - //returnm null; - } - - /** - * @see IProblemAnnotation#getId() - */ - public int getId() { - if (fIsProblemMarker) - return getMarker().getAttribute(ICModelMarker.C_MODEL_PROBLEM_MARKER, -1); - return 0; - } - - /** - * @see IProblemAnnotation#isProblem() - */ - public boolean isProblem() { - return fIsProblemMarker; - } - - public int getErrorStart() { - return error_start; - } - public int getErrorLength() { - return error_length; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java deleted file mode 100644 index 90f780e1c78..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.Annotation; -import org.eclipse.ui.texteditor.MarkerAnnotation; -import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel; - -public class CMarkerAnnotationModel extends ResourceMarkerAnnotationModel { - - /** - * Constructor for CMarkerAnnotationModel - */ - public CMarkerAnnotationModel(IResource resource) { - super(resource); - } - - /** - * @see AbstractMarkerAnnotationModel#createMarkerAnnotation(IMarker) - */ - protected MarkerAnnotation createMarkerAnnotation(IMarker marker) { - return new CMarkerAnnotation(marker, fDocument); - } - /** - * @see AbstractMarkerAnnotationModel#modifyMarkerAnnotation(IMarker) - */ - protected void modifyMarkerAnnotation(IMarker marker) { - MarkerAnnotation a= getMarkerAnnotation(marker); - if (a == null) { - // It might not have been good enough before, but now it - // is, try adding this marker into the model again. - addMarkerAnnotation(marker); - } - super.modifyMarkerAnnotation(marker); - } - - - /** - * Adds the given annotation to this model. Associates the - * annotation with the given position. If requested, all annotation - * model listeners are informed about this model change. If the annotation - * is already managed by this model nothing happens. - * - * @param annotation the annotation to add - * @param position the associate position - * @param fireModelChange indicates whether to notify all model listeners - */ - protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged){ - if (!fAnnotations.containsKey(annotation)) { - - // @@@ This is an unfortunate hack because we cannot override addAnnotationMarker() and if we - // update a marker position, there's no way to update the annotation - if(annotation instanceof CMarkerAnnotation) { - int start = ((CMarkerAnnotation)annotation).getErrorStart(); - if(start != -1 && start != position.getOffset()) { - position.setOffset(start); - position.setLength(((CMarkerAnnotation)annotation).getErrorLength()); - } - } - fAnnotations.put(annotation, position); - try { - addPosition(fDocument, position); - } catch (Exception e) { - } - - if (fireModelChanged) - fireModelChanged(); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CTextEditorActionConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CTextEditorActionConstants.java deleted file mode 100644 index a19106d2852..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CTextEditorActionConstants.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.ui.IWorkbenchActionConstants; - - -public interface CTextEditorActionConstants extends IWorkbenchActionConstants { - /** - * Status category "input position". - */ - static final String STATUS_CURSOR_POS= "CursorPosition"; - - - /** - * Status category "input mode". - */ - static final String STATUS_INPUT_MODE= "InputMode"; - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java deleted file mode 100644 index 02f79870b98..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DefaultCEditorTextHover.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.CCompletionContributorManager; -import org.eclipse.cdt.internal.ui.text.CWordFinder; -import org.eclipse.cdt.internal.ui.text.HTMLPrinter; -import org.eclipse.cdt.ui.IFunctionSummary; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.Region; -import org.eclipse.swt.graphics.Point; -import org.eclipse.ui.IEditorPart; - -public class DefaultCEditorTextHover implements ITextHover -{ - protected IEditorPart fEditor; - - /** - * Constructor for DefaultCEditorTextHover - */ - public DefaultCEditorTextHover( IEditorPart editor ) - { - fEditor = editor; - } - - /** - * @see ITextHover#getHoverInfo(ITextViewer, IRegion) - */ - public String getHoverInfo( ITextViewer viewer, IRegion region ) - { - String expression = null; - - if(fEditor == null) - return null; - try - { - expression = viewer.getDocument().get( region.getOffset(), region.getLength() ); - expression = expression.trim(); - if ( expression.length() == 0 ) - return null; - - StringBuffer buffer = new StringBuffer(); - - // We are just doing some C, call the Help to get info - - IFunctionSummary fs = CCompletionContributorManager.getDefault().getFunctionInfo(expression); - if(fs != null) { - buffer.append("Name: "); - buffer.append(HTMLPrinter.convertToHTMLContent(fs.getName())); - buffer.append("
            Protoype: "); - buffer.append(HTMLPrinter.convertToHTMLContent(fs.getPrototype().getPrototypeString(false))); - if(fs.getDescription() != null) { - buffer.append("
            Description:
            "); - //Don't convert this description since it could already be formatted - buffer.append(fs.getDescription()); - } -// int i; -// for(i = 0; i < buffer.length(); i++) { -// if(buffer.charAt(i) == '\\') { -// if((i + 1 < buffer.length()) && buffer.charAt(i+1) == 'n') { -// buffer.replace(i, i + 2, "
            "); -// } -// } -// } - } -// else { -// // Query the C model -// IndexModel model = IndexModel.getDefault(); -// IEditorInput input = fEditor.getEditorInput(); -// if(input instanceof IFileEditorInput) { -// IProject project = ((IFileEditorInput)input).getFile().getProject(); -// -// // Bail out quickly, if the project was deleted. -// if (!project.exists()) -// throw new CoreException(new Status(0, "", 0, "", null)); -// -// IProject[] refs = project.getReferencedProjects(); -// -// ITagEntry[] tags= model.query(project, expression, false, true); -// -// if(tags == null || tags.length == 0) { -// for ( int j= 0; j < refs.length; j++ ) { -// if (!refs[j].exists()) -// continue; -// tags= model.query(refs[j], expression, false, true); -// if(tags != null && tags.length > 0) -// break; -// } -// } -// -// if(tags != null && tags.length > 0) { -// ITagEntry selectedTag = selectTag(tags); -// // Show only the first element -// buffer.append(" " + TagFlags.value(selectedTag.getKind()) + " " + HTMLPrinter.convertToHTMLContent(expression) + -// " - " + selectedTag.getIFile().getFullPath().toString() + "[" + selectedTag.getLineNumber()+"]" ); -// // Now add the pattern -// buffer.append("

            " + HTMLPrinter.convertToHTMLContent(selectedTag.getPattern())); -// } -// } -// } - if (buffer.length() > 0) { - HTMLPrinter.insertPageProlog(buffer, 0); - HTMLPrinter.addPageEpilog(buffer); - return buffer.toString(); - } - } catch(Exception ex) { - /* Ignore */ - } - - return null; - } - - /** - * @see ITextHover#getHoverRegion(ITextViewer, int) - */ - public IRegion getHoverRegion( ITextViewer viewer, int offset ) - { - Point selectedRange = viewer.getSelectedRange(); - if ( selectedRange.x >= 0 && - selectedRange.y > 0 && - offset >= selectedRange.x && - offset <= selectedRange.x + selectedRange.y ) - return new Region( selectedRange.x, selectedRange.y ); - if ( viewer != null ) - return CWordFinder.findWord( viewer.getDocument(), offset ); - return null; - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java deleted file mode 100644 index 2080cc5f831..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java +++ /dev/null @@ -1,486 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - Initial API and implementation -***********************************************************************/ - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.model.BufferChangedEvent; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBuffer; -import org.eclipse.cdt.core.model.IBufferChangedListener; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.text.ILineTracker; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.widgets.Display; - - -/** - * Adapts IDocument to IBuffer. Uses the - * same algorithm as the text widget to determine the buffer's line delimiter. - * All text inserted into the buffer is converted to this line delimiter. - * This class is public for test purposes only. - * - * This class is similar to the JDT DocumentAdapter class. - */ -public class DocumentAdapter implements IBuffer, IDocumentListener { - - /** - * Internal implementation of a NULL instanceof IBuffer. - */ - static private class NullBuffer implements IBuffer { - - public void addBufferChangedListener(IBufferChangedListener listener) {} - - public void append(char[] text) {} - - public void append(String text) {} - - public void close() {} - - public char getChar(int position) { - return 0; - } - - public char[] getCharacters() { - return null; - } - - public String getContents() { - return null; - } - - public int getLength() { - return 0; - } - - public IOpenable getOwner() { - return null; - } - - public String getText(int offset, int length) { - return null; - } - - public IResource getUnderlyingResource() { - return null; - } - - public boolean hasUnsavedChanges() { - return false; - } - - public boolean isClosed() { - return false; - } - - public boolean isReadOnly() { - return true; - } - - public void removeBufferChangedListener(IBufferChangedListener listener) {} - - public void replace(int position, int length, char[] text) {} - - public void replace(int position, int length, String text) {} - - public void save(IProgressMonitor progress, boolean force) throws CModelException {} - - public void setContents(char[] contents) {} - - public void setContents(String contents) {} - }; - - - /** NULL implementing IBuffer */ - public final static IBuffer NULL= new NullBuffer(); - /* - * @see IBuffer#addBufferChangedListener(IBufferChangedListener) - */ - public void addBufferChangedListener(IBufferChangedListener listener) { - Assert.isNotNull(listener); - if (!fBufferListeners.contains(listener)) - fBufferListeners.add(listener); - } - /** - * Executes a document set content call in the ui thread. - */ - protected class DocumentSetCommand implements Runnable { - - private String fContents; - - public void run() { - fDocument.set(fContents); - } - - public void set(String contents) { - fContents= contents; - Display.getDefault().syncExec(this); - } - }; - /** - * Executes a document replace call in the ui thread. - */ - protected class DocumentReplaceCommand implements Runnable { - - private int fOffset; - private int fLength; - private String fText; - - public void run() { - try { - fDocument.replace(fOffset, fLength, fText); - } catch (BadLocationException x) { - // ignore - } - } - - public void replace(int offset, int length, String text) { - fOffset= offset; - fLength= length; - fText= text; - Display.getDefault().syncExec(this); - } - }; - - private IOpenable fOwner; - IDocument fDocument; - private DocumentSetCommand fSetCmd= new DocumentSetCommand(); - private DocumentReplaceCommand fReplaceCmd= new DocumentReplaceCommand(); - - private Object fProviderKey; - private CDocumentProvider fProvider; - private String fLineDelimiter; - private ILineTracker fLineTracker; - - private List fBufferListeners= new ArrayList(3); - - private IStatus fStatus; - - - public DocumentAdapter(IOpenable owner, IDocument document, ILineTracker lineTracker, CDocumentProvider provider, Object providerKey) { - - Assert.isNotNull(document); - Assert.isNotNull(lineTracker); - - fOwner= owner; - fDocument= document; - fLineTracker= lineTracker; - fProvider= provider; - fProviderKey= providerKey; - - fDocument.addPrenotifiedDocumentListener(this); - - } - /** - * Sets the status of this document adapter. - */ - public void setStatus(IStatus status) { - fStatus= status; - } - - /** - * Returns the status of this document adapter. - */ - public IStatus getStatus() { - return fStatus; - } - - /** - * Returns the adapted document. - * - * @return the adapted document - */ - public IDocument getDocument() { - return fDocument; - } - /** - * Returns the line delimiter of this buffer. As a document has a set of - * valid line delimiters, this set must be reduced to size 1. - */ - protected String getLineDelimiter() { - - if (fLineDelimiter == null) { - - try { - fLineDelimiter= fDocument.getLineDelimiter(0); - } catch (BadLocationException x) { - } - - if (fLineDelimiter == null) { - /* - * Follow up fix for: 1GF5UU0: ITPJUI:WIN2000 - "Organize Imports" in java editor inserts lines in wrong format - * The line delimiter must always be a legal document line delimiter. - */ - String sysLineDelimiter= System.getProperty("line.separator"); //$NON-NLS-1$ - String[] delimiters= fDocument.getLegalLineDelimiters(); - Assert.isTrue(delimiters.length > 0); - for (int i= 0; i < delimiters.length; i++) { - if (delimiters[i].equals(sysLineDelimiter)) { - fLineDelimiter= sysLineDelimiter; - break; - } - } - - if (fLineDelimiter == null) { - // system line delimiter is not a legal document line delimiter - fLineDelimiter= delimiters[0]; - } - } - } - - return fLineDelimiter; - } - - /** - * Converts the given string to the line delimiter of this buffer. - * This method is public for test purposes only. - */ - public String normalize(String text) { - fLineTracker.set(text); - - int lines= fLineTracker.getNumberOfLines(); - if (lines <= 1) - return text; - - StringBuffer buffer= new StringBuffer(text); - - try { - IRegion previous= fLineTracker.getLineInformation(0); - for (int i= 1; i < lines; i++) { - int lastLineEnd= previous.getOffset() + previous.getLength(); - int lineStart= fLineTracker.getLineInformation(i).getOffset(); - fLineTracker.replace(lastLineEnd, lineStart - lastLineEnd, getLineDelimiter()); - buffer.replace(lastLineEnd, lineStart, getLineDelimiter()); - previous= fLineTracker.getLineInformation(i); - } - - // last line - String delimiter= fLineTracker.getLineDelimiter(lines -1); - if (delimiter != null && delimiter.length() > 0) - buffer.replace(previous.getOffset() + previous.getLength(), buffer.length(), getLineDelimiter()); - - return buffer.toString(); - } catch (BadLocationException x) { - } - - return text; - } - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#append(char) - */ - public void append(char[] text) { - append(new String(text)); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#append(java.lang.String) - */ - public void append(String text) { - fReplaceCmd.replace(fDocument.getLength(), 0, normalize(text)); - } - - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#close() - */ - public void close() { - if (isClosed()) - return; - - IDocument d= fDocument; - fDocument= null; - d.removePrenotifiedDocumentListener(this); - - fireBufferChanged(new BufferChangedEvent(this, 0, 0, null)); - fBufferListeners.clear(); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getChar(int) - */ - public char getChar(int position) { - try { - return fDocument.getChar(position); - } catch (BadLocationException x) { - throw new ArrayIndexOutOfBoundsException(); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getCharacters() - */ - public char[] getCharacters() { - String content= getContents(); - return content == null ? null : content.toCharArray(); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getContents() - */ - public String getContents() { - return fDocument.get(); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getLength() - */ - public int getLength() { - return fDocument.getLength(); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getOwner() - */ - public IOpenable getOwner() { - return (IOpenable) fOwner; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getText(int, int) - */ - public String getText(int offset, int length) { - try { - return fDocument.get(offset, length); - } catch (BadLocationException x) { - throw new ArrayIndexOutOfBoundsException(); - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#getUnderlyingResource() - */ - public IResource getUnderlyingResource() { - //return null; - return fProvider != null ? fProvider.getUnderlyingResource(fProviderKey) : null; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#hasUnsavedChanges() - */ - public boolean hasUnsavedChanges() { - //return false; - return fProvider != null ? fProvider.canSaveDocument(fProviderKey) : false; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#isClosed() - */ - public boolean isClosed() { - return fDocument == null; - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#isReadOnly() - */ - public boolean isReadOnly() { - //return false; - IResource resource= getUnderlyingResource(); - return resource == null ? true : resource.isReadOnly(); - } - - /* - * @see IBuffer#removeBufferChangedListener(IBufferChangedListener) - */ - public void removeBufferChangedListener(IBufferChangedListener listener) { - Assert.isNotNull(listener); - fBufferListeners.remove(listener); - } - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#replace(int, int, char) - */ - public void replace(int position, int length, char[] text) { - replace(position, length, new String(text)); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#replace(int, int, java.lang.String) - */ - public void replace(int position, int length, String text) { - fReplaceCmd.replace(position, length, normalize(text)); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#save(org.eclipse.core.runtime.IProgressMonitor, boolean) - */ - public void save(IProgressMonitor progress, boolean force) throws CModelException { - if (fProvider != null) { - try { - fProvider.saveDocumentContent(progress, fProviderKey, fDocument, force); - } catch (CoreException e) { - throw new CModelException(e); - } - } - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#setContents(char) - */ - public void setContents(char[] contents) { - setContents(new String(contents)); - } - - /** - * @see org.eclipse.cdt.internal.core.model.IBuffer#setContents(java.lang.String) - */ - public void setContents(String contents) { - int oldLength= fDocument.getLength(); - - if (contents == null) { - - if (oldLength != 0) - fSetCmd.set(""); //$NON-NLS-1$ - - } else { - - // set only if different - String newContents= normalize(contents); - int newLength= newContents.length(); - - if (oldLength != newLength || !newContents.equals(fDocument.get())) - fSetCmd.set(newContents); - } - } - /* - * @see IDocumentListener#documentAboutToBeChanged(DocumentEvent) - */ - public void documentAboutToBeChanged(DocumentEvent event) { - // there is nothing to do here - } - - /* - * @see IDocumentListener#documentChanged(DocumentEvent) - */ - public void documentChanged(DocumentEvent event) { - fireBufferChanged(new BufferChangedEvent(this, event.getOffset(), event.getLength(), event.getText())); - } - - private void fireBufferChanged(BufferChangedEvent event) { - if (fBufferListeners != null && fBufferListeners.size() > 0) { - Iterator e= new ArrayList(fBufferListeners).iterator(); - while (e.hasNext()) - ((IBufferChangedListener) e.next()).bufferChanged(event); - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchAction.java deleted file mode 100644 index 3182c305dd7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchAction.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.ui.CUIPlugin; - -import java.lang.reflect.InvocationTargetException; -import java.util.List; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -//import org.eclipse.search.internal.core.text.TextSearchEngine; -import org.eclipse.search.internal.core.text.TextSearchScope; -import org.eclipse.search.internal.ui.text.TextSearchOperation; -import org.eclipse.search.internal.ui.text.TextSearchResultCollector; -import org.eclipse.search.internal.ui.util.ExceptionHandler; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.PlatformUI; - - - -public class FileSearchAction extends Action { - - - private static final String PREFIX= "FileSearchAction."; - - private ISelectionProvider fSelectionProvider; - - public FileSearchAction(ISelectionProvider provider) { - super(CUIPlugin.getResourceString(PREFIX + "label")); - setDescription(CUIPlugin.getResourceString(PREFIX + "description")); - setToolTipText(CUIPlugin.getResourceString(PREFIX + "tooltip")); - - if(provider instanceof CContentOutlinePage) { - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_OPEN_INCLUDE); - //setText("Search for References"); // $NON-NLS - } - - fSelectionProvider= provider; - } - - public void run() { - String search_name; - - ISelection selection= fSelectionProvider.getSelection(); - if(selection instanceof ITextSelection) { - search_name = ((ITextSelection)selection).getText(); - if(search_name.length() == 0) return; - } else { - ICElement element= getElement(selection); - if (element == null) { - return; - } - search_name = element.getElementName(); - } - - // @@@ we rely on the internal functions of the Search plugin, since - // none of these are actually exported. This is probably going to change - // with 2.0. - TextSearchResultCollector col = new TextSearchResultCollector(); - try { - //TextSearchPage - //ProgressMonitor monitor = new ProgressMonitor(); - //col.setProgressMonitor(monitor) - SearchUI.activateSearchResultView(); - //col.aboutToStart(); - - // We now have the element, start a search on the string - //TextSearchEngine engine = new TextSearchEngine(); - TextSearchScope scope= TextSearchScope.newWorkspaceScope(); - // Add the extensions from the C editor definition for now - // FIXME: For C/C++ not all files rely on extension to be C++ for - String[] cexts = CoreModel.getDefault().getTranslationUnitExtensions(); - for (int i = 0; i < cexts.length; i++) { - scope.addExtension("*." + cexts[i]); - } -// scope.addExtension("*.c"); -// scope.addExtension("*.h"); -// scope.addExtension("*.cc"); -// scope.addExtension("*.hh"); - - TextSearchOperation op= new TextSearchOperation( - CUIPlugin.getWorkspace(), - search_name, - "", - scope, - col); - - - //engine.search(CUIPlugin.getWorkspace(), element.getName(), - // null, scope, col); - IRunnableContext context= null; - //context= getContainer().getRunnableContext(); - - Shell shell= new Shell(); // getShell(); - if (context == null) - context= new ProgressMonitorDialog(shell); - - - try { - context.run(true, true, op); - } catch (InvocationTargetException ex) { - ExceptionHandler.handle(ex, "Error","Error"); //$NON-NLS-2$ //$NON-NLS-1$ - } catch (InterruptedException e) { - } - } catch (Exception e) {} - - } - - - private static ICElement getElement(ISelection sel) { - if (!sel.isEmpty() && sel instanceof IStructuredSelection) { - List list= ((IStructuredSelection)sel).toList(); - if (list.size() == 1) { - Object element= list.get(0); - if (element instanceof ICElement) { - return (ICElement)element; - } - } - } - return null; - } - - public static boolean canActionBeAdded(ISelection selection) { - if(selection instanceof ITextSelection) { - return (((ITextSelection)selection).getLength() > 0); - } else { - return getElement(selection) != null; - } - } - - - public static String getEditorID(String name) { - IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); - if (registry != null) { - IEditorDescriptor descriptor = registry.getDefaultEditor(name); - if (descriptor != null) { - return descriptor.getId(); - } else { - return registry.getDefaultEditor().getId(); - } - } - return null; - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchActionInWorkingSet.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchActionInWorkingSet.java deleted file mode 100644 index 523171c6824..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/FileSearchActionInWorkingSet.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Created on Sep 9, 2003 - */ -package org.eclipse.cdt.internal.ui.editor; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.search.CSearchScopeFactory; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.search.internal.core.SearchScope; -import org.eclipse.search.internal.ui.text.TextSearchOperation; -import org.eclipse.search.internal.ui.text.TextSearchResultCollector; -import org.eclipse.search.internal.ui.util.ExceptionHandler; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.PlatformUI; - -/** - * @author bgheorgh - */ -public class FileSearchActionInWorkingSet extends Action { - - - private static final String PREFIX= "FileSearchActionInWorkingSet."; - - private ISelectionProvider fSelectionProvider; - - public FileSearchActionInWorkingSet(ISelectionProvider provider) { - super(CUIPlugin.getResourceString(PREFIX + "label")); - setDescription(CUIPlugin.getResourceString(PREFIX + "description")); - setToolTipText(CUIPlugin.getResourceString(PREFIX + "tooltip")); - - if(provider instanceof CContentOutlinePage) { - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_OPEN_INCLUDE); - } - - fSelectionProvider= provider; - } - - public void run() { - String search_name; - - ISelection selection= fSelectionProvider.getSelection(); - if(selection instanceof ITextSelection) { - search_name = ((ITextSelection)selection).getText(); - if(search_name.length() == 0) return; - } else { - ICElement element= getElement(selection); - if (element == null) { - return; - } - search_name = element.getElementName(); - } - - // @@@ we rely on the internal functions of the Search plugin, since - // none of these are actually exported. This is probably going to change - // with 2.0. - TextSearchResultCollector col = new TextSearchResultCollector(); - try { - SearchUI.activateSearchResultView(); - - IWorkingSet[] workingSets= CSearchScopeFactory.getInstance().queryWorkingSets(); - ArrayList resourceList = new ArrayList(); - for (int i=0; i 0); - } else { - return getElement(selection) != null; - } - } - - - public static String getEditorID(String name) { - IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); - if (registry != null) { - IEditorDescriptor descriptor = registry.getDefaultEditor(name); - if (descriptor != null) { - return descriptor.getId(); - } else { - return registry.getDefaultEditor().getId(); - } - } - return null; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java deleted file mode 100644 index cfc086874ae..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/GotoErrorAction.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.TextEditorAction; - - -public class GotoErrorAction extends TextEditorAction { - - - private boolean fForward; - - - public GotoErrorAction(String prefix, boolean forward) { - super(CEditorMessages.getResourceBundle(), prefix, null); - fForward= forward; - } - /** - * @see Action#run() - */ - public void run() { - CEditor e= (CEditor) getTextEditor(); - e.gotoError(fForward); - } - /** - * @see TextEditorAction#setEditor(ITextEditor) - */ - public void setEditor(ITextEditor editor) { - if (editor instanceof CEditor) - super.setEditor(editor); - } - /** - * @see TextEditorAction#update() - */ - public void update() { - setEnabled(true); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefinitionIds.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefinitionIds.java deleted file mode 100644 index b5352ec1b1c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefinitionIds.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -package org.eclipse.cdt.internal.ui.editor; - -import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; - -/** - * Defines the definition IDs for the C editor actions. - * - *

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

            . - * - * @since 2.1 - */ -public interface ICEditorActionDefinitionIds extends ITextEditorActionDefinitionIds { - - /** - * Action definition ID of the source -> comment action - * (value "org.eclipse.cdt.ui.edit.text.c.comment"). - */ - public static final String COMMENT = "org.eclipse.cdt.ui.edit.text.c.comment"; //$NON-NLS-1$ - - /** - * Action definition ID of the source -> uncomment action - * (value "org.eclipse.cdt.ui.edit.text.c.uncomment"). - */ - public static final String UNCOMMENT = "org.eclipse.cdt.ui.edit.text.c.uncomment"; //$NON-NLS-1$ - - /** - * Action definition ID of the source -> format action - * (value "org.eclipse.cdt.ui.edit.text.c.format"). - */ - public static final String FORMAT = "org.eclipse.cdt.ui.edit.text.c.format"; //$NON-NLS-1$ - - /** - * Action definition ID of the source -> add include action - * (value "org.eclipse.cdt.ui.edit.text.c.add.include"). - */ - public static final String ADD_INCLUDE= "org.eclipse.cdt.ui.edit.text.c.add.include"; //$NON-NLS-1$ - - /** - * Action definition ID of the toggle presentation toolbar button action - * (value "org.eclipse.cdt.ui.edit.text.java.toggle.presentation"). - */ - public static final String TOGGLE_PRESENTATION= "org.eclipse.cdt.ui.edit.text.c.toggle.presentation"; //$NON-NLS-1$ - /** - * Action definition ID of the open declaration action - * (value "org.eclipse.cdt.ui.edit.text.java.toggle.presentation"). - */ - public static final String OPEN_DECL= "org.eclipse.cdt.ui.edit.opendecl"; //$NON-NLS-1$ - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IPositionManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IPositionManager.java deleted file mode 100644 index bc495ee970a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IPositionManager.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.Position; - - -public interface IPositionManager { - - void addManagedPosition(Position position); - - void removeManagedPosition(Position position); -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IProblemAnnotation.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IProblemAnnotation.java deleted file mode 100644 index 6a0fe829215..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/IProblemAnnotation.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -/** - * Interface of annotations representing problems. - */ -public interface IProblemAnnotation { - - String getMessage(); - - int getId(); - - String[] getArguments(); - - boolean isTemporaryProblem(); - - boolean isWarning(); - - boolean isError(); - - boolean isProblem(); -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/LexicalSortingAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/LexicalSortingAction.java deleted file mode 100644 index b3d416ea79c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/LexicalSortingAction.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.ViewerSorter; - - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.ui.CUIPlugin; - - -public class LexicalSortingAction extends Action { - - private static final String ACTION_NAME= "LexicalSortingAction"; - private static final String DIALOG_STORE_KEY= ACTION_NAME + ".sort"; - - private LexicalCSorter fSorter; - private TreeViewer fTreeViewer; - - public LexicalSortingAction(TreeViewer treeViewer) { - super(CUIPlugin.getResourceString(ACTION_NAME + ".label")); - - setDescription(CUIPlugin.getResourceString(ACTION_NAME + ".description")); - setToolTipText(CUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); - - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_ALPHA_SORTING); - - fTreeViewer= treeViewer; - fSorter= new LexicalCSorter(); - - boolean checked= CUIPlugin.getDefault().getDialogSettings().getBoolean(DIALOG_STORE_KEY); - valueChanged(checked, false); - } - - public void run() { - valueChanged(isChecked(), true); - } - - private void valueChanged(boolean on, boolean store) { - setChecked(on); - fTreeViewer.setSorter(on ? fSorter : null); - - String key= ACTION_NAME + ".tooltip" + (on ? ".on" : ".off"); - setToolTipText(CUIPlugin.getResourceString(key)); - - if (store) { - CUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on); - } - } - - private class LexicalCSorter extends ViewerSorter { - public boolean isSorterProperty(Object element, Object property) { - return true; - } - - public int category(Object obj) { - if (obj instanceof ICElement) { - ICElement elem= (ICElement)obj; - switch (elem.getElementType()) { - case ICElement.C_MACRO: return 1; - case ICElement.C_INCLUDE: return 2; - - case ICElement.C_CLASS: return 3; - case ICElement.C_STRUCT: return 4; - case ICElement.C_UNION: return 5; - - case ICElement.C_FIELD: return 6; - case ICElement.C_FUNCTION: return 7; - } - - } - return 0; - } - }; - -}; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenDeclarationsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenDeclarationsAction.java deleted file mode 100644 index 8bf7f8a9d8c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenDeclarationsAction.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.search.BasicSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.search.matching.OrPattern; -import org.eclipse.cdt.internal.ui.dialogs.ElementListSelectionDialog; -import org.eclipse.cdt.internal.ui.util.EditorUtility; -import org.eclipse.cdt.ui.CSearchResultLabelProvider; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IWorkingCopyManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.texteditor.IDocumentProvider; - -/** - * This action opens a java CEditor on the element represented by text selection of - * the connected java source viewer. - * - * Use action from package org.eclipse.jdt.ui.actions - */ -public class OpenDeclarationsAction extends Action { - - private String fDialogTitle; - private String fDialogMessage; - protected CEditor fEditor; - BasicSearchResultCollector resultCollector = null; - SearchEngine searchEngine = null; - - /** - * Creates a new action with the given label and image. - */ - protected OpenDeclarationsAction() { - super(); - - setText(CEditorMessages.getString("OpenDeclarations.label")); //$NON-NLS-1$ - setToolTipText(CEditorMessages.getString("OpenDeclarations.tooltip")); //$NON-NLS-1$ - setDescription(CEditorMessages.getString("OpenDeclarations.description")); //$NON-NLS-1$ - setDialogTitle(CEditorMessages.getString("OpenDeclarations.dialog.title")); //$NON-NLS-1$ - setDialogMessage(CEditorMessages.getString("OpenDeclarations.dialog.message")); //$NON-NLS-1$ - - searchEngine = new SearchEngine(); - resultCollector = new BasicSearchResultCollector(); - } - - /** - * Creates a new action with the given image. - */ - public OpenDeclarationsAction(ImageDescriptor image) { - this(); - setImageDescriptor(image); - } - - /** - * Creates a new action with the given editor - */ - public OpenDeclarationsAction(CEditor editor) { - this(); - fEditor = editor; - } - - protected void setDialogTitle(String title) { - fDialogTitle= title; - } - - protected void setDialogMessage(String message) { - fDialogMessage= message; - } - - public void setContentEditor(CEditor editor) { - fEditor= editor; - } - - /** - * @see IAction#actionPerformed - */ - public void run() { - - IWorkingCopyManager fManager = CUIPlugin.getDefault().getWorkingCopyManager(); - ITranslationUnit unit = fManager.getWorkingCopy(fEditor.getEditorInput()); - - if (fEditor.getSelectionProvider() != null) { - ITextSelection selection= (ITextSelection) fEditor.getSelectionProvider().getSelection(); - try { - ArrayList elementsFound = new ArrayList(); - String sel = selection.getText(); - if (sel.equals("")) - { - int selStart = selection.getOffset(); - - IDocumentProvider prov = fEditor.getDocumentProvider(); - IDocument doc = prov.getDocument(fEditor.getEditorInput()); - sel = getSelection(doc, selStart); - } - - IFile file = fEditor.getInputFile(); - if(file == null) - return; - IProject project = file.getProject(); - if(project == null) - return; - - ICElement[] projectScopeElement = new ICElement[1]; - projectScopeElement[0] = unit.getCProject();//(ICElement)currentScope.getCProject(); - ICSearchScope scope = SearchEngine.createCSearchScope(projectScopeElement, true); - OrPattern orPattern = new OrPattern(); - // search for global variables, functions, classes, structs, unions, enums and macros - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.VAR, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.FUNCTION, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.METHOD, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.TYPE, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.ENUM, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.FIELD, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.NAMESPACE, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.MACRO, ICSearchConstants.DECLARATIONS, true )); - orPattern.addPattern(SearchEngine.createSearchPattern( sel, ICSearchConstants.TYPEDEF, ICSearchConstants.DECLARATIONS, true )); - searchEngine.search(CUIPlugin.getWorkspace(), orPattern, scope, resultCollector, true); - elementsFound.addAll(resultCollector.getSearchResults()); - - if (elementsFound.isEmpty() == false) { - IMatch selected= selectCElement(elementsFound, getShell(), fDialogTitle, fDialogMessage); - if (selected != null) { - open(selected); - return; - } - } - } catch (Exception x) { - CUIPlugin.getDefault().log(x); - } - } - - getShell().getDisplay().beep(); - } - - protected Shell getShell() { - return fEditor.getSite().getShell(); - } - - - - /** - * Opens the editor on the given element and subsequently selects it. - */ - protected void open(IMatch element) throws CModelException, PartInitException { - IEditorPart part= EditorUtility.openInEditor(element.getResource()); - //int line = element.getStartOffset(); - //if(line > 0) line--; - if(part instanceof CEditor) { - CEditor ed = (CEditor)part; - - try { - IDocument document= ed.getDocumentProvider().getDocument(ed.getEditorInput()); - //if(line > 3) { - // ed.selectAndReveal(document.getLineOffset(line - 3), 0); - //} - ed.selectAndReveal(element.getStartOffset() /*document.getLineOffset(line)*/, 0); - } catch (Exception e) {} - } - } - - /** - * Shows a dialog for resolving an ambigous C element. - * Utility method that can be called by subclassers. - */ - protected IMatch selectCElement(List elements, Shell shell, String title, String message) { - - int nResults= elements.size(); - - if (nResults == 0) - return null; - - if (nResults == 1) - return (IMatch) elements.get(0); - - - ElementListSelectionDialog dialog= new ElementListSelectionDialog(shell, new CSearchResultLabelProvider(), false, false); - dialog.setTitle(title); - dialog.setMessage(message); - dialog.setElements(elements); - - if (dialog.open() == Window.OK) { - Object[] selection= dialog.getResult(); - if (selection != null && selection.length > 0) { - nResults= selection.length; - for (int i= 0; i < nResults; i++) { - Object current= selection[i]; - if (current instanceof IMatch) - return (IMatch) current; - } - } - } - return null; - } - - - public String getSelection(IDocument doc, int fPos){ - int pos= fPos; - char c; - int fStartPos =0, fEndPos=0; - String selectedWord=null; - - try{ - while (pos >= 0) { - c= doc.getChar(pos); - if (!Character.isJavaIdentifierPart(c)) - break; - --pos; - } - fStartPos= pos + 1; - - pos= fPos; - int length= doc.getLength(); - while (pos < length) { - c= doc.getChar(pos); - if (!Character.isJavaIdentifierPart(c)) - break; - ++pos; - } - fEndPos= pos; - selectedWord = doc.get(fStartPos, (fEndPos - fStartPos)); - } - catch(BadLocationException e){ - } - - return selectedWord; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java deleted file mode 100644 index c4dd2af9d3d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java +++ /dev/null @@ -1,212 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.dialogs.ElementListSelectionDialog; -import org.eclipse.cdt.internal.ui.util.EditorUtility; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.window.Window; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.PlatformUI; - - -public class OpenIncludeAction extends Action { - - - private static final String PREFIX= "OpenIncludeAction."; - - private static final String DIALOG_TITLE= PREFIX + "dialog.title"; - private static final String DIALOG_MESSAGE= PREFIX + "dialog.message"; - - private ISelectionProvider fSelectionProvider; - - - public OpenIncludeAction(ISelectionProvider provider) { - super(CUIPlugin.getResourceString(PREFIX + "label")); - setDescription(CUIPlugin.getResourceString(PREFIX + "description")); - setToolTipText(CUIPlugin.getResourceString(PREFIX + "tooltip")); - - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_OPEN_INCLUDE); - - fSelectionProvider= provider; - } - - public void run() { - ICElement include= getIncludeStatement(fSelectionProvider.getSelection()); - if (include == null) { - return; - } - - try { - IResource res = include.getUnderlyingResource(); - ArrayList filesFound= new ArrayList(4); - if (res != null) { - IProject proj = res.getProject(); - String includeName = include.getElementName(); - // Search in the scannerInfo information - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj); - if (provider != null) { - IScannerInfo info = provider.getScannerInformation(res); - // XXXX this should fall back to project by itself - if (info == null) { - info = provider.getScannerInformation(proj); - } - if (info != null) { - String[] includePaths = info.getIncludePaths(); - findFile(includePaths, includeName, filesFound); - } - if (filesFound.size() == 0) { - // Fall back and search the project - findFile(proj, new Path(includeName), filesFound); - } - } - } - IPath fileToOpen; - int nElementsFound= filesFound.size(); - if (nElementsFound == 0) { - fileToOpen= null; - } else if (nElementsFound == 1) { - fileToOpen= (IPath) filesFound.get(0); - } else { - fileToOpen= chooseFile(filesFound); - } - - if (fileToOpen != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(fileToOpen); - if (file != null) { - EditorUtility.openInEditor(file); - } else { - FileStorage storage = new FileStorage(null, fileToOpen); - EditorUtility.openInEditor(storage); - } - } - } catch (CModelException e) { - CUIPlugin.getDefault().log(e.getStatus()); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e.getStatus()); - } - } - - private void findFile(String[] includePaths, String name, ArrayList list) throws CoreException { - for (int i = 0; i < includePaths.length; i++) { - IPath path = new Path(includePaths[i] + "/" + name); - File file = path.toFile(); - if (file.exists()) { - list.add(path); - } - } - } - - /** - * Recuse in the project. - * @param parent - * @param name - * @param list - * @throws CoreException - */ - private void findFile(IContainer parent, final IPath name, final ArrayList list) throws CoreException { - parent.accept(new IResourceProxyVisitor() { - - public boolean visit(IResourceProxy proxy) throws CoreException { - if (proxy.getType() == IResource.FILE && proxy.getName().equalsIgnoreCase(name.lastSegment())) { - list.add(proxy.requestResource().getLocation()); - return false; - } - return true; - } - }, 0); - } - - - private IPath chooseFile(ArrayList filesFound) { - ILabelProvider renderer= new LabelProvider() { - public String getText(Object element) { - if (element instanceof IPath) { - IPath file= (IPath)element; - return file.lastSegment() + " - " + file.toString(); - } - return super.getText(element); - } - }; - - ElementListSelectionDialog dialog= new ElementListSelectionDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), renderer, false, false); - dialog.setTitle(CUIPlugin.getResourceString(DIALOG_TITLE)); - dialog.setMessage(CUIPlugin.getResourceString(DIALOG_MESSAGE)); - dialog.setElements(filesFound); - - if (dialog.open() == Window.OK) { - return (IPath) dialog.getSelectedElement(); - } - return null; - } - - - private static ICElement getIncludeStatement(ISelection sel) { - if (!sel.isEmpty() && sel instanceof IStructuredSelection) { - List list= ((IStructuredSelection)sel).toList(); - if (list.size() == 1) { - Object element= list.get(0); - if (element instanceof ICElement && ((ICElement)element).getElementType() == ICElement.C_INCLUDE) { - return (ICElement)element; - } - } - } - return null; - } - - public static boolean canActionBeAdded(ISelection selection) { - ICElement include = getIncludeStatement(selection); - if (include != null) { - IResource res = include.getUnderlyingResource(); - if (res != null) { - return true; - } - } - return false; - } - - - public static String getEditorID(String name) { - IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); - if (registry != null) { - IEditorDescriptor descriptor = registry.getDefaultEditor(name); - if (descriptor != null) { - return descriptor.getId(); - } else { - return registry.getDefaultEditor().getId(); - } - } - return null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ProblemAnnotationIterator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ProblemAnnotationIterator.java deleted file mode 100644 index 1f9642a6ac0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ProblemAnnotationIterator.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Iterator; -import org.eclipse.jface.text.source.IAnnotationModel; - - -/** - * Filters problems based on their types. - */ -public class ProblemAnnotationIterator implements Iterator { - - private Iterator fIterator; - private IProblemAnnotation fNext; - - public ProblemAnnotationIterator(IAnnotationModel model) { - fIterator= model.getAnnotationIterator(); - skip(); - } - - private void skip() { - while (fIterator.hasNext()) { - Object next= fIterator.next(); - if (next instanceof IProblemAnnotation) { - fNext= (IProblemAnnotation) next; - return; - } - } - fNext= null; - } - - /* - * @see Iterator#hasNext() - */ - public boolean hasNext() { - return fNext != null; - } - - /* - * @see Iterator#next() - */ - public Object next() { - try { - return fNext; - } finally { - skip(); - } - } - - /* - * @see Iterator#remove() - */ - public void remove() { - throw new UnsupportedOperationException(); - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SearchDialogAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SearchDialogAction.java deleted file mode 100644 index 215199e9d54..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SearchDialogAction.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Created on Aug 12, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.ui.editor; - -import java.util.List; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * @author bgheorgh - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class SearchDialogAction extends Action { - private static final String PREFIX= "SearchDialogAction."; - private static final String C_SEARCH_PAGE_ID= "org.eclipse.cdt.ui.CSearchPage"; - - private ISelectionProvider fSelectionProvider; - private ITextEditor fEditor; - private IWorkbenchWindow fWorkbenchWindow; - - public SearchDialogAction(ISelectionProvider provider, CEditor editor) { - super(CUIPlugin.getResourceString(PREFIX + "label")); - setDescription(CUIPlugin.getResourceString(PREFIX + "description")); - setToolTipText(CUIPlugin.getResourceString(PREFIX + "tooltip")); - - if(provider instanceof CContentOutlinePage) { - setImageDescriptor( CPluginImages.DESC_OBJS_CSEARCH ); - } - - fSelectionProvider= provider; - fEditor = editor; - } - - public SearchDialogAction(ISelectionProvider provider, IWorkbenchWindow window) { - - super(CUIPlugin.getResourceString(PREFIX + "label")); - setDescription(CUIPlugin.getResourceString(PREFIX + "description")); - setToolTipText(CUIPlugin.getResourceString(PREFIX + "tooltip")); - - if(provider instanceof CContentOutlinePage) { - setImageDescriptor( CPluginImages.DESC_OBJS_CSEARCH ); - } - - fSelectionProvider= provider; - fWorkbenchWindow = window; - } - - public void run() { - String search_name; - - ISelection selection= fSelectionProvider.getSelection(); - if(selection instanceof ITextSelection) { - search_name = ((ITextSelection)selection).getText(); - if(search_name.length() == 0) return; - } else { - ICElement element= getElement(selection); - if (element == null) { - return; - } - search_name = element.getElementName(); - } - - if (fEditor != null){ - SearchUI.openSearchDialog(fEditor.getEditorSite().getWorkbenchWindow(),C_SEARCH_PAGE_ID); - } - else if (fWorkbenchWindow != null){ - SearchUI.openSearchDialog(fWorkbenchWindow,C_SEARCH_PAGE_ID); - } -// // @@@ we rely on the internal functions of the Search plugin, since -// // none of these are actually exported. This is probably going to change -// // with 2.0. -// TextSearchResultCollector col = new TextSearchResultCollector(); -// try { -// //TextSearchPage -// //ProgressMonitor monitor = new ProgressMonitor(); -// //col.setProgressMonitor(monitor) -// SearchUI.activateSearchResultView(); -// //col.aboutToStart(); -// -// // We now have the element, start a search on the string -// //TextSearchEngine engine = new TextSearchEngine(); -// TextSearchScope scope= TextSearchScope.newWorkspaceScope(); -// // Add the extensions from the C editor definition for now -// // FIXME: For C/C++ not all files rely on extension to be C++ for -// String[] cexts = CoreModel.getDefault().getTranslationUnitExtensions(); -// for (int i = 0; i < cexts.length; i++) { -// scope.addExtension("*." + cexts[i]); -// } -//// scope.addExtension("*.c"); -//// scope.addExtension("*.h"); -//// scope.addExtension("*.cc"); -//// scope.addExtension("*.hh"); -// -// TextSearchOperation op= new TextSearchOperation( -// CUIPlugin.getWorkspace(), -// search_name, -// "", -// scope, -// col); -// -// -// //engine.search(CUIPlugin.getWorkspace(), element.getName(), -// // null, scope, col); -// IRunnableContext context= null; -// //context= getContainer().getRunnableContext(); -// -// Shell shell= new Shell(); // getShell(); -// if (context == null) -// context= new ProgressMonitorDialog(shell); -// -// -// try { -// context.run(true, true, op); -// } catch (InvocationTargetException ex) { -// ExceptionHandler.handle(ex, "Error","Error"); //$NON-NLS-2$ //$NON-NLS-1$ -// } catch (InterruptedException e) { -// } -// } catch (Exception e) {} -// - } - - - private static ICElement getElement(ISelection sel) { - if (!sel.isEmpty() && sel instanceof IStructuredSelection) { - List list= ((IStructuredSelection)sel).toList(); - if (list.size() == 1) { - Object element= list.get(0); - if (element instanceof ICElement) { - return (ICElement)element; - } - } - } - return null; - } - - public static boolean canActionBeAdded(ISelection selection) { - if(selection instanceof ITextSelection) { - return (((ITextSelection)selection).getLength() > 0); - } else { - return getElement(selection) != null; - } - } - - - public static String getEditorID(String name) { - IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); - if (registry != null) { - IEditorDescriptor descriptor = registry.getDefaultEditor(name); - if (descriptor != null) { - return descriptor.getId(); - } else { - //getDefaultEditor is deprecated, The system external editor is the default editor - return IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID; - - } - } - return null; - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java deleted file mode 100644 index 6a1925a5b2a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.ui.editor; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.jface.text.source.ISharedTextColors; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -/* - * @see org.eclipse.jface.text.source.ISharedTextColors - * @since 2.1 - */ -public class SharedTextColors implements ISharedTextColors { - - /** The display table. */ - private Map fDisplayTable; - - /** Creates an returns a shared color manager. */ - public SharedTextColors() { - super(); - } - - /* - * @see ISharedTextColors#getColor(RGB) - */ - public Color getColor(RGB rgb) { - if (rgb == null) - return null; - - if (fDisplayTable == null) - fDisplayTable= new HashMap(2); - - Display display= Display.getCurrent(); - - Map colorTable= (Map) fDisplayTable.get(display); - if (colorTable == null) { - colorTable= new HashMap(10); - fDisplayTable.put(display, colorTable); - } - - Color color= (Color) colorTable.get(rgb); - if (color == null) { - color= new Color(display, rgb); - colorTable.put(rgb, color); - } - - return color; - } - - /* - * @see ISharedTextColors#dispose() - */ - public void dispose() { - if (fDisplayTable != null) { - Iterator j= fDisplayTable.values().iterator(); - while (j.hasNext()) { - Iterator i= ((Map) j.next()).values().iterator(); - while (i.hasNext()) - ((Color) i.next()).dispose(); - } - } - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/TogglePresentationAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/TogglePresentationAction.java deleted file mode 100644 index 352d3e923ce..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/TogglePresentationAction.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.editor; - - - -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.PreferenceConstants; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.TextEditorAction; - - -/** - * A toolbar action which toggles the presentation model of the - * connected text editor. The editor shows either the highlight range - * only or always the whole document. - */ -public class TogglePresentationAction extends TextEditorAction implements IPropertyChangeListener { - - private IPreferenceStore fStore; - - /** - * Constructs and updates the action. - */ - public TogglePresentationAction() { - super(CEditorMessages.getResourceBundle(), "TogglePresentation.", null); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_SEGMENT_EDIT); - setToolTipText(CEditorMessages.getString("TogglePresentation.tooltip")); //$NON-NLS-1$ - setActionDefinitionId(ICEditorActionDefinitionIds.TOGGLE_PRESENTATION); - WorkbenchHelp.setHelp(this, ICHelpContextIds.TOGGLE_PRESENTATION_ACTION); - update(); - } - - /* - * @see IAction#actionPerformed - */ - public void run() { - - ITextEditor editor= getTextEditor(); - if (editor == null) - return; - - IRegion remembered= editor.getHighlightRange(); - editor.resetHighlightRange(); - - boolean showAll= !editor.showsHighlightRangeOnly(); - setChecked(showAll); - - editor.showHighlightRangeOnly(showAll); - if (remembered != null) - editor.setHighlightRange(remembered.getOffset(), remembered.getLength(), true); - - fStore.removePropertyChangeListener(this); - fStore.setValue(PreferenceConstants.EDITOR_SHOW_SEGMENTS, showAll); - fStore.addPropertyChangeListener(this); - } - - /* - * @see TextEditorAction#update - */ - public void update() { - ITextEditor editor= getTextEditor(); - boolean checked= (editor != null && editor.showsHighlightRangeOnly()); - setChecked(checked); - setEnabled(editor != null); - } - - /* - * @see TextEditorAction#setEditor(ITextEditor) - */ - public void setEditor(ITextEditor editor) { - - super.setEditor(editor); - - if (editor != null) { - - if (fStore == null) { - fStore= CUIPlugin.getDefault().getPreferenceStore(); - fStore.addPropertyChangeListener(this); - } - synchronizeWithPreference(editor); - - } else if (fStore != null) { - fStore.removePropertyChangeListener(this); - fStore= null; - } - - update(); - } - - /** - * Synchronizes the appearance of the editor with what the preference store tells him. - */ - private void synchronizeWithPreference(ITextEditor editor) { - - if (editor == null) - return; - - boolean showSegments= fStore.getBoolean(PreferenceConstants.EDITOR_SHOW_SEGMENTS); - setChecked(showSegments); - - if (editor.showsHighlightRangeOnly() != showSegments) { - IRegion remembered= editor.getHighlightRange(); - editor.resetHighlightRange(); - editor.showHighlightRangeOnly(showSegments); - if (remembered != null) - editor.setHighlightRange(remembered.getOffset(), remembered.getLength(), true); - } - } - - /* - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty().equals(PreferenceConstants.EDITOR_SHOW_SEGMENTS)) - synchronizeWithPreference(getTextEditor()); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java deleted file mode 100644 index 177b1687b36..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/WorkingCopyManager.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.internal.ui.editor; - - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.ui.IWorkingCopyManager; -import org.eclipse.cdt.ui.IWorkingCopyManagerExtension; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.Assert; -import org.eclipse.ui.IEditorInput; - - -/** - * This working copy manager works together with a given compilation unit document provider and - * additionally offers to "overwrite" the working copy provided by this document provider. - */ -public class WorkingCopyManager implements IWorkingCopyManager, IWorkingCopyManagerExtension { - - private CDocumentProvider fDocumentProvider; - private Map fMap; - private boolean fIsShuttingDown; - - /** - * Creates a new working copy manager that co-operates with the given - * compilation unit document provider. - * - * @param provider the provider - */ - public WorkingCopyManager(CDocumentProvider provider) { - Assert.isNotNull(provider); - fDocumentProvider= provider; - } - - /* - * @see org.eclipse.cdt.ui.IWorkingCopyManager#connect(org.eclipse.ui.IEditorInput) - */ - public void connect(IEditorInput input) throws CoreException { - fDocumentProvider.connect(input); - } - - /* - * @see org.eclipse.cdt.ui.IWorkingCopyManager#disconnect(org.eclipse.ui.IEditorInput) - */ - public void disconnect(IEditorInput input) { - fDocumentProvider.disconnect(input); - } - - /* - * @see org.eclipse.cdt.ui.IWorkingCopyManager#shutdown() - */ - public void shutdown() { - if (!fIsShuttingDown) { - fIsShuttingDown= true; - try { - if (fMap != null) { - fMap.clear(); - fMap= null; - } - fDocumentProvider.shutdown(); - } finally { - fIsShuttingDown= false; - } - } - } - - /* - * @see org.eclipse.cdt.ui.IWorkingCopyManager#getWorkingCopy(org.eclipse.ui.IEditorInput) - */ - public IWorkingCopy getWorkingCopy(IEditorInput input) { - IWorkingCopy unit= fMap == null ? null : (IWorkingCopy) fMap.get(input); - return unit != null ? unit : fDocumentProvider.getWorkingCopy(input); - } - - /* - * @see org.eclipse.cdt.internal.ui.editor.IWorkingCopyManagerExtension#setWorkingCopy(org.eclipse.ui.IEditorInput, org.eclipse.cdt.core.model.ITranslationUnit) - */ - public void setWorkingCopy(IEditorInput input, IWorkingCopy workingCopy) { - if (fDocumentProvider.isConnected(input)) { - if (fMap == null) - fMap= new HashMap(); - fMap.put(input, workingCopy); - } - } - - /* - * @see org.eclipse.cdt.internal.ui.editor.IWorkingCopyManagerExtension#removeWorkingCopy(org.eclipse.ui.IEditorInput) - */ - public void removeWorkingCopy(IEditorInput input) { - fMap.remove(input); - if (fMap.isEmpty()) - fMap= null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java deleted file mode 100644 index 24525b976cf..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmCodeScanner.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor.asm; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.internal.ui.text.AbstractCScanner; -import org.eclipse.cdt.internal.ui.text.ICColorConstants; -import org.eclipse.cdt.internal.ui.text.IColorManager; -import org.eclipse.cdt.internal.ui.text.util.CWhitespaceDetector; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.EndOfLineRule; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.SingleLineRule; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WhitespaceRule; -import org.eclipse.jface.text.rules.WordPatternRule; -import org.eclipse.jface.text.rules.WordRule; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * A C code scanner. - */ -public final class AsmCodeScanner extends AbstractCScanner { - - private static String[] fgKeywords= { - ".set", ".section", - ".global",".file", - ".extern", ".macro", ".endm", - ".if", ".ifdef", ".ifndef", ".else", ".endif", - ".include", ".globl", - ".text",".data", ".rodata", ".common", ".debug", ".ctor", ".dtor", - ".ascii", ".asciz", ".byte", ".long", ".size", ".align", ".type" - }; - - - private static String[] fgTypes= { "char", "double", "float", "int", "long", "short", "signed", "unsigned", "void"}; - - private static String[] fgTokenProperties= { - ICColorConstants.C_KEYWORD, - ICColorConstants.C_TYPE, - ICColorConstants.C_STRING, - ICColorConstants.C_SINGLE_LINE_COMMENT, - ICColorConstants.C_DEFAULT - }; - - /** - * Creates a C code scanner - */ - public AsmCodeScanner(IColorManager manager, IPreferenceStore store) { - super(manager, store); - initialize(); - } - - /* - * @see AbstractCScanner#getTokenProperties() - */ - protected String[] getTokenProperties() { - return fgTokenProperties; - } - - /* - * @see AbstractCScanner#createRules() - */ - protected List createRules() { - - List rules= new ArrayList(); - - // Add rule for strings - Token token= getToken(ICColorConstants.C_SINGLE_LINE_COMMENT); - - // Add rule for single line comments. - rules.add(new EndOfLineRule("#", token)); - - token= getToken(ICColorConstants.C_STRING); - // Add rule for strings and character constants. - rules.add(new SingleLineRule("'", "'", token, '\\')); - //rules.add(new SingleLineRule("\"", "\"", token, '\\')); - - Token other= getToken(ICColorConstants.C_DEFAULT); - - // Add generic whitespace rule. - rules.add(new WhitespaceRule(new CWhitespaceDetector())); - - // Add word rule for labels - WordRule labelRule = new WordRule(new AsmWordDetector(false), other) { - private StringBuffer fBuffer= new StringBuffer(); - /* - * @see IRule#evaluate - */ - public IToken evaluate(ICharacterScanner scanner) { - int c= scanner.read(); - if (fDetector.isWordStart((char) c)) { - if (fColumn == UNDEFINED || (fColumn == scanner.getColumn() - 1)) { - - fBuffer.setLength(0); - do { - fBuffer.append((char) c); - c= scanner.read(); - } while (fDetector.isWordPart((char) c)); - if(c != ':') { - unreadBuffer(scanner); - return fDefaultToken; - } else { - fBuffer.append((char) c); - IToken token= (IToken) fWords.get(":"); - if (token != null) - return token; - } - - return fDefaultToken; - } - } - - scanner.unread(); - return Token.UNDEFINED; - } - /** - * Adds a word and the token to be returned if it is detected. - * - * @param word the word this rule will search for, may not be null - * @param token the token to be returned if the word has been found, may not be null - */ - public void addWord(String word, IToken token) { - - fWords.put(word, token); - } - /** - * Returns the characters in the buffer to the scanner. - * - * @param scanner the scanner to be used - */ - protected void unreadBuffer(ICharacterScanner scanner) { - for (int i= fBuffer.length() - 1; i >= 0; i--) - scanner.unread(); - } - }; - - token= getToken(ICColorConstants.C_TYPE); - labelRule.addWord(":", token); - //wordRule.setColumnConstraint(0); - rules.add(labelRule); - - // Add word rule for keywords and types - WordRule wordRule= new WordRule(new AsmWordDetector('.'), other); - for (int i=0; iTextEditor implementation of this - * IEditorPart method returns true. - */ - public boolean isSaveAsAllowed() { - return true; - } - /** - * The TextEditor implementation of this - * AbstractTextEditor method asks the user for the workspace path - * of a file resource and saves the document there. - */ - protected void performSaveAs(IProgressMonitor progressMonitor) { - /* - * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. - * Changed Behavior to make sure that if called inside a regular save (because - * of deletion of input element) there is a way to report back to the caller. - */ - - Shell shell= getSite().getShell(); - - SaveAsDialog dialog= new SaveAsDialog(shell); - dialog.open(); - IPath path= dialog.getResult(); - - if (path == null) { - if (progressMonitor != null) - progressMonitor.setCanceled(true); - return; - } - - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IFile file= workspace.getRoot().getFile(path); - final IEditorInput newInput= new FileEditorInput(file); - - WorkspaceModifyOperation op= new WorkspaceModifyOperation() { - public void execute(final IProgressMonitor monitor) throws CoreException { - /* - * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there - * Changed false to true. - */ - getDocumentProvider().saveDocument(monitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true); - } - }; - - boolean success= false; - try { - - getDocumentProvider().aboutToChange(newInput); - new ProgressMonitorDialog(shell).run(false, true, op); - success= true; - - } catch (InterruptedException x) { - } catch (InvocationTargetException x) { - // Shared with C editor - String title= CEditorMessages.getString("CEditor.error.saving.title"); //$NON-NLS-1$ - String msg= MessageFormat.format(CEditorMessages.getString("CEditor.error.saving.message"), new Object[] { x.getTargetException().getMessage() }); //$NON-NLS-1$ - MessageDialog.openError(shell, title, msg); - } finally { - getDocumentProvider().changed(newInput); - if (success) - setInput(newInput); - } - - if (progressMonitor != null) - progressMonitor.setCanceled(!success); - } - - /* - * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent) - * Pulled in from 2.0 - */ - protected boolean affectsTextPresentation(PropertyChangeEvent event) { - // String p= event.getProperty(); - - boolean affects= false; - AsmTextTools textTools= CUIPlugin.getDefault().getAsmTextTools(); - affects |= textTools.affectsBehavior(event); - - return affects ? affects : super.affectsTextPresentation(event); - } - - /* - * @see AbstractTextEditor#createActions() - * @since 2.0 - */ - protected void createActions() { - super.createActions(); - - } - - - - /* - * @see AbstractTextEditor#editorContextMenuAboutToShow(IMenuManager) - * @since 2.0 - */ - protected void editorContextMenuAboutToShow(IMenuManager menu) { - super.editorContextMenuAboutToShow(menu); - addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.SHIFT_RIGHT); - addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.SHIFT_LEFT); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextTools.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextTools.java deleted file mode 100644 index 4f020ccfa07..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextTools.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor.asm; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.text.ICColorConstants; -import org.eclipse.cdt.internal.ui.text.CCommentScanner; -import org.eclipse.cdt.internal.ui.text.SingleTokenCScanner; -import org.eclipse.cdt.internal.ui.text.util.CColorManager; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.rules.DefaultPartitioner; -import org.eclipse.jface.text.rules.IPartitionTokenScanner; -import org.eclipse.jface.text.rules.RuleBasedScanner; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * This type shares all scanners and the color manager between - * its clients. - */ -public class AsmTextTools { - - private class PreferenceListener implements IPropertyChangeListener, Preferences.IPropertyChangeListener { - public void propertyChange(PropertyChangeEvent event) { - adaptToPreferenceChange(event); - } - public void propertyChange(Preferences.PropertyChangeEvent event) { - adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue())); - } - }; - - /** The color manager -- use the same as for C code */ - private CColorManager fColorManager; - /** The Asm source code scanner */ - private AsmCodeScanner fCodeScanner; - /** The Asm partitions scanner */ - private AsmPartitionScanner fPartitionScanner; - /** The ASM multiline comment scanner */ - private CCommentScanner fMultilineCommentScanner; - /** The ASM singleline comment scanner */ - private CCommentScanner fSinglelineCommentScanner; - /** The ASM string scanner */ - private SingleTokenCScanner fStringScanner; - - - /** The preference store */ - private IPreferenceStore fPreferenceStore; - /** The core preference store */ - private Preferences fCorePreferenceStore; - /** The preference change listener */ - private PreferenceListener fPreferenceListener= new PreferenceListener(); - - - /** - * Creates a new Asm text tools collection and eagerly creates - * and initializes all members of this collection. - */ - public AsmTextTools(IPreferenceStore store) { - this(store, null); - } - - /** - * Creates a new Asm text tools collection and eagerly creates - * and initializes all members of this collection. - */ - public AsmTextTools(IPreferenceStore store, Preferences coreStore) { - if(store == null) { - store = CUIPlugin.getDefault().getPreferenceStore(); - } - - fPreferenceStore = store; - store.addPropertyChangeListener(fPreferenceListener); - - fCorePreferenceStore= coreStore; - if (fCorePreferenceStore != null) { - fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener); - } - - fColorManager= new CColorManager(); - fCodeScanner= new AsmCodeScanner(fColorManager, store); - fPartitionScanner= new AsmPartitionScanner(); - - fMultilineCommentScanner= new CCommentScanner(fColorManager, store, coreStore, ICColorConstants.C_MULTI_LINE_COMMENT); - fSinglelineCommentScanner= new CCommentScanner(fColorManager, store, coreStore, ICColorConstants.C_SINGLE_LINE_COMMENT); - fStringScanner= new SingleTokenCScanner(fColorManager, store, ICColorConstants.C_STRING); - } - - /** - * Creates a new Asm text tools collection and eagerly creates - * and initializes all members of this collection. - */ - public AsmTextTools() { - this((IPreferenceStore)null); - } - /** - * Disposes all members of this tools collection. - */ - public void dispose() { - - fCodeScanner= null; - fPartitionScanner= null; - - fMultilineCommentScanner= null; - fSinglelineCommentScanner= null; - fStringScanner= null; - - if (fColorManager != null) { - fColorManager.dispose(); - fColorManager= null; - } - - if (fPreferenceStore != null) { - fPreferenceStore.removePropertyChangeListener(fPreferenceListener); - fPreferenceStore= null; - - if (fCorePreferenceStore != null) { - fCorePreferenceStore.removePropertyChangeListener(fPreferenceListener); - fCorePreferenceStore= null; - } - - fPreferenceListener= null; - } - } - - /** - * Gets the color manager. - */ - public CColorManager getColorManager() { - return fColorManager; - } - - /** - * Gets the code scanner used. - */ - public RuleBasedScanner getCodeScanner() { - return fCodeScanner; - } - - /** - * Gets the partition scanner used. - */ - public IPartitionTokenScanner getPartitionScanner() { - return fPartitionScanner; - } - - /** - * Gets the document provider used. - */ - public IDocumentPartitioner createDocumentPartitioner() { - - String[] types= new String[] { - AsmPartitionScanner.ASM_MULTILINE_COMMENT, - AsmPartitionScanner.ASM_SINGLE_LINE_COMMENT, - AsmPartitionScanner.ASM_STRING - }; - - //return new RuleBasedPartitioner(getPartitionScanner(), types); - return new DefaultPartitioner(getPartitionScanner(), types); - } - - /** - * Returns a scanner which is configured to scan Java multiline comments. - * - * @return a Java multiline comment scanner - */ - public RuleBasedScanner getMultilineCommentScanner() { - return fMultilineCommentScanner; - } - - /** - * Returns a scanner which is configured to scan Java singleline comments. - * - * @return a Java singleline comment scanner - */ - public RuleBasedScanner getSinglelineCommentScanner() { - return fSinglelineCommentScanner; - } - - /** - * Returns a scanner which is configured to scan Java strings. - * - * @return a Java string scanner - */ - public RuleBasedScanner getStringScanner() { - return fStringScanner; - } - - - /** - * Determines whether the preference change encoded by the given event - * changes the behavior of one its contained components. - * - * @param event the event to be investigated - * @return true if event causes a behavioral change - */ - public boolean affectsBehavior(PropertyChangeEvent event) { - return fCodeScanner.affectsBehavior(event) || - fMultilineCommentScanner.affectsBehavior(event) || - fSinglelineCommentScanner.affectsBehavior(event) || - fStringScanner.affectsBehavior(event); - } - - /** - * Adapts the behavior of the contained components to the change - * encoded in the given event. - * - * @param event the event to whch to adapt - */ - protected void adaptToPreferenceChange(PropertyChangeEvent event) { - if (fCodeScanner.affectsBehavior(event)) - fCodeScanner.adaptToPreferenceChange(event); - if (fMultilineCommentScanner.affectsBehavior(event)) - fMultilineCommentScanner.adaptToPreferenceChange(event); - if (fSinglelineCommentScanner.affectsBehavior(event)) - fSinglelineCommentScanner.adaptToPreferenceChange(event); - if (fStringScanner.affectsBehavior(event)) - fStringScanner.adaptToPreferenceChange(event); - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmWordDetector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmWordDetector.java deleted file mode 100644 index 5410d00951b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmWordDetector.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.cdt.internal.ui.editor.asm; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.rules.IWordDetector; - - -/** - * A C aware word detector. - */ -public class AsmWordDetector implements IWordDetector { - private char fPrefix = 0; - private char fExtra = 0; - private boolean fStrictStart = true; - - public AsmWordDetector() { - } - - public AsmWordDetector(boolean strict) { - fStrictStart = strict; - } - - public AsmWordDetector(char extra) { - fExtra = extra; - } - - public AsmWordDetector(char prefix, char extra) { - fPrefix = prefix; - fExtra = extra; - } - /** - * @see IWordDetector#isWordIdentifierStart - */ - public boolean isWordStart(char c) { - if(fPrefix != 0) { - return (fPrefix == c); - } - if(fStrictStart) { - return (Character.isJavaIdentifierStart(c) || (c == fExtra)); - } else { - return (Character.isJavaIdentifierPart(c) || (c == fExtra)); - } - } - - /** - * @see IWordDetector#isWordIdentifierPart - */ - public boolean isWordPart(char c) { - return Character.isJavaIdentifierPart(c); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/BuildConsolePreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/BuildConsolePreferencePage.java deleted file mode 100644 index 767bb2d03c0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/BuildConsolePreferencePage.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.internal.ui.preferences; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.FontFieldEditor; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -public class BuildConsolePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - public static final String PREF_CONSOLE_FONT = "consoleFont"; - private static final String PREF_CLEAR_CONSOLE = "clearConsole"; - private static final String PREF_CONSOLE_ON_TOP = "consoleOnTop"; - private static final String PREF_AUTO_OPEN_CONSOLE = "autoOpenConsole"; - public static final String PREF_BUILDCONSOLE_LINES = "buildConsoleLines"; - public static final String PREF_BUILDCONSOLE_LINES_ERROR = "CBasePreferencePage.buildConsole.errorMessage"; //$NON-NLS-1$ - - private static final String CLEAR_CONSOLE_LABEL= "CBasePreferencePage.clearConsole.label"; - private static final String CONSOLE_ON_TOP_LABEL= "CBasePreferencePage.consoleOnTop.label"; - private static final String AUTO_OPEN_CONSOLE_LABEL= "CBasePreferencePage.autoOpenConsole.label"; - private static final String CONSOLE_FONT_LABEL= "CBasePreferencePage.consoleFont.label"; - - public BuildConsolePreferencePage() { - super(GRID); - setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); - } - - protected void createFieldEditors() { - Composite parent = getFieldEditorParent(); - BooleanFieldEditor clearConsole = - new BooleanFieldEditor(PREF_CLEAR_CONSOLE, CUIPlugin.getResourceString(CLEAR_CONSOLE_LABEL), parent); - addField(clearConsole); - - BooleanFieldEditor autoOpenConsole = - new BooleanFieldEditor(PREF_AUTO_OPEN_CONSOLE, CUIPlugin.getResourceString(AUTO_OPEN_CONSOLE_LABEL), parent); - addField(autoOpenConsole); - BooleanFieldEditor consoleOnTop = - new BooleanFieldEditor(PREF_CONSOLE_ON_TOP, CUIPlugin.getResourceString(CONSOLE_ON_TOP_LABEL), parent); - addField(consoleOnTop); - - IntegerFieldEditor buildCount = new IntegerFieldEditor( PREF_BUILDCONSOLE_LINES, "&Build console lines: ", parent ); - buildCount.setErrorMessage(CUIPlugin.getResourceString(PREF_BUILDCONSOLE_LINES_ERROR)); - buildCount.setValidRange( 10, Integer.MAX_VALUE ); - addField( buildCount ); - - addField(new FontFieldEditor(PREF_CONSOLE_FONT, CUIPlugin.getResourceString(CONSOLE_FONT_LABEL), parent)); - } - - /** - * Returns the current preference setting if the build console should - * be cleared before each build. - */ - public static boolean isClearBuildConsole() { - return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PREF_CLEAR_CONSOLE); - } - public static boolean isAutoOpenConsole() { - return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PREF_AUTO_OPEN_CONSOLE); - } - - public static boolean isConsoleOnTop() { - return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PREF_CONSOLE_ON_TOP); - } - - public static int buildConsoleLines() { - return CUIPlugin.getDefault().getPreferenceStore().getInt(PREF_BUILDCONSOLE_LINES); - } - - public void init(IWorkbench workbench) { - } - - public static void initDefaults(IPreferenceStore prefs) { - prefs.setDefault(PREF_CLEAR_CONSOLE, true); - prefs.setDefault(PREF_AUTO_OPEN_CONSOLE, false); - prefs.setDefault(PREF_CONSOLE_ON_TOP, true); - prefs.setDefault(PREF_BUILDCONSOLE_LINES, 500); - Font font = JFaceResources.getTextFont(); - if (font != null) { - FontData[] data = font.getFontData(); - if (data != null && data.length > 0) { - PreferenceConverter.setDefault(prefs, PREF_CONSOLE_FONT, data[0]); - } - } - - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java deleted file mode 100644 index bea282691c3..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CEditorPreferencePage.java +++ /dev/null @@ -1,1227 +0,0 @@ -package org.eclipse.cdt.internal.ui.preferences; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.dialogs.StatusUtil; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.internal.ui.text.ICColorConstants; -import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.PreferenceConstants; -import org.eclipse.cdt.utils.ui.controls.TabFolderLayout; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.AnnotationPreference; -import org.eclipse.ui.texteditor.ExtendedTextEditorPreferenceConstants; -import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; -import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor; - -/* - * The page for setting the editor options. - */ -public class CEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - - protected final String[][] fListModel = new String[][] { { "Multi-line comment", ICColorConstants.C_MULTI_LINE_COMMENT }, { - "Single-line comment", ICColorConstants.C_SINGLE_LINE_COMMENT }, { - "Keywords", ICColorConstants.C_KEYWORD }, { - "Built-in types", ICColorConstants.C_TYPE }, { - "Strings", ICColorConstants.C_STRING }, { - "Others", ICColorConstants.C_DEFAULT }, { - PreferencesMessages.getString("CEditorPreferencePage.cCommentTaskTags"), PreferenceConstants.EDITOR_TASK_TAG_COLOR } - }; - - protected final String[][] fAppearanceColorListModel = new String[][] { { "Line number color", ExtendedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR }, //$NON-NLS-1$ - { - "Matching bracket color", CEditor.MATCHING_BRACKETS_COLOR }, //$NON-NLS-1$ - { - "Current line highlight color", ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR }, //$NON-NLS-1$ - { - "Print margin color", ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR }, //$NON-NLS-1$ - { - "Linked position color", CEditor.LINKED_POSITION_COLOR }, //$NON-NLS-1$ - }; - - protected OverlayPreferenceStore fOverlayStore; - private CTextTools fCTextTools; - - protected Map fColorButtons = new HashMap(); - private SelectionListener fColorButtonListener = new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - ColorEditor editor = (ColorEditor) e.widget.getData(); - PreferenceConverter.setValue(fOverlayStore, (String) fColorButtons.get(editor), editor.getColorValue()); - } - }; - - protected Map fCheckBoxes = new HashMap(); - private SelectionListener fCheckBoxListener = new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - Button button = (Button) e.widget; - fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection()); - } - }; - - protected Map fTextFields = new HashMap(); - private ModifyListener fTextFieldListener = new ModifyListener() { - public void modifyText(ModifyEvent e) { - Text text = (Text) e.widget; - fOverlayStore.setValue((String) fTextFields.get(text), text.getText()); - } - }; - - private WorkbenchChainedTextFontFieldEditor fFontEditor; - protected List fList; - protected ColorEditor fForegroundColorEditor; - protected ColorEditor fBackgroundColorEditor; - private Button fBackgroundDefaultRadioButton; - protected Button fBackgroundCustomRadioButton; - protected Button fBackgroundColorButton; - protected Button fBoldCheckBox; - protected SourceViewer fPreviewViewer; - - protected List fAppearanceColorList; - protected ColorEditor fAppearanceForegroundColorEditor; - - private final String[][] fAnnotationColorListModel; - private ColorEditor fAnnotationForegroundColorEditor; - private List fAnnotationList; - private Button fShowInOverviewRulerCheckBox; - private Button fShowInTextCheckBox; - - public CEditorPreferencePage() { - setDescription(CUIPlugin.getResourceString("CEditorPreferencePage.description")); - setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); - MarkerAnnotationPreferences preferences = new MarkerAnnotationPreferences(); - fAnnotationColorListModel = createAnnotationTypeListModel(preferences); - fOverlayStore = createOverlayStore(preferences); - } - - private OverlayPreferenceStore createOverlayStore(MarkerAnnotationPreferences preferences) { - ArrayList overlayKeys = new ArrayList(); - Iterator e = preferences.getAnnotationPreferences().iterator(); - while (e.hasNext()) { - AnnotationPreference info = (AnnotationPreference) e.next(); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey())); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey())); - overlayKeys.add( - new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey())); - } - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_FOREGROUND)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.PREFERENCE_COLOR_BACKGROUND)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_MULTI_LINE_COMMENT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_MULTI_LINE_COMMENT + "_bold")); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_SINGLE_LINE_COMMENT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_SINGLE_LINE_COMMENT + "_bold")); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_KEYWORD)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_KEYWORD + "_bold")); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_TYPE)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_TYPE + "_bold")); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_STRING)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_STRING + "_bold")); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ICColorConstants.C_DEFAULT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ICColorConstants.C_DEFAULT + "_bold")); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.MATCHING_BRACKETS_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CEditor.MATCHING_BRACKETS)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, CEditor.SPACES_FOR_TABS)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, CEditor.LINKED_POSITION_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ExtendedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ExtendedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ExtendedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, ContentAssistPreference.AUTOACTIVATION_DELAY)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.AUTOINSERT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PROPOSALS_BACKGROUND)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PROPOSALS_FOREGROUND)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PARAMETERS_BACKGROUND)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PARAMETERS_FOREGROUND)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOT)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.SHOW_DOCUMENTED_PROPOSALS)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.ORDER_PROPOSALS)); - //overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.CASE_SENSITIVITY)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.ADD_INCLUDE)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.CURRENT_FILE_SEARCH_SCOPE)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.PROJECT_SEARCH_SCOPE)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, ContentAssistPreference.PROJECT_AND_DEPENDENCY_SEARCH_SCOPE)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_TASK_TAG_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_TAG_BOLD)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_TASK_INDICATION_COLOR)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION)); - overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER)); - - OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; - overlayKeys.toArray(keys); - return new OverlayPreferenceStore(getPreferenceStore(), keys); - } - - public static void initDefaults(IPreferenceStore store) { - - Color color; - Display display = Display.getDefault(); - - MarkerAnnotationPreferences preferences = new MarkerAnnotationPreferences(); - Iterator e = preferences.getAnnotationPreferences().iterator(); - while (e.hasNext()) { - AnnotationPreference info = (AnnotationPreference) e.next(); - store.setDefault(info.getTextPreferenceKey(), info.getTextPreferenceValue()); - store.setDefault(info.getOverviewRulerPreferenceKey(), info.getOverviewRulerPreferenceValue()); - PreferenceConverter.setDefault(store, info.getColorPreferenceKey(), info.getColorPreferenceValue()); - } - store.setDefault(CEditor.MATCHING_BRACKETS, true); - color = display.getSystemColor(SWT.COLOR_GRAY); - PreferenceConverter.setDefault(store, CEditor.MATCHING_BRACKETS_COLOR, color.getRGB()); - - store.setDefault(ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, true); - PreferenceConverter.setDefault(store, ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR, new RGB(225, 235, 224)); - - store.setDefault(ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, true); - store.setDefault(ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 80); - PreferenceConverter.setDefault(store, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, new RGB(176, 180, 185)); - - WorkbenchChainedTextFontFieldEditor.startPropagate(store, JFaceResources.TEXT_FONT); - - color = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); - PreferenceConverter.setDefault(store, CEditor.PREFERENCE_COLOR_FOREGROUND, color.getRGB()); - store.setDefault(CEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true); - - color = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); - PreferenceConverter.setDefault(store, CEditor.PREFERENCE_COLOR_BACKGROUND, color.getRGB()); - store.setDefault(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, false); - - store.setDefault(CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 4); - - store.setDefault(CEditor.SPACES_FOR_TABS, false); - - PreferenceConverter.setDefault(store, ICColorConstants.C_MULTI_LINE_COMMENT, new RGB(63, 127, 95)); - store.setDefault(ICColorConstants.C_MULTI_LINE_COMMENT + "_bold", false); - - PreferenceConverter.setDefault(store, ICColorConstants.C_SINGLE_LINE_COMMENT, new RGB(63, 125, 95)); - store.setDefault(ICColorConstants.C_SINGLE_LINE_COMMENT + "_bold", false); - - PreferenceConverter.setDefault(store, ICColorConstants.C_KEYWORD, new RGB(127, 0, 85)); - store.setDefault(ICColorConstants.C_KEYWORD + "_bold", true); - - PreferenceConverter.setDefault(store, ICColorConstants.C_TYPE, new RGB(127, 0, 85)); - store.setDefault(ICColorConstants.C_TYPE + "_bold", true); - - PreferenceConverter.setDefault(store, ICColorConstants.C_STRING, new RGB(42, 0, 255)); - store.setDefault(ICColorConstants.C_STRING + "_bold", false); - - PreferenceConverter.setDefault(store, ICColorConstants.C_DEFAULT, new RGB(0, 0, 0)); - store.setDefault(ICColorConstants.C_DEFAULT + "_bold", false); - - PreferenceConverter.setDefault(store, CEditor.LINKED_POSITION_COLOR, new RGB(0, 200, 100)); - - store.setDefault(ExtendedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, false); - PreferenceConverter.setDefault(store, ExtendedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, new RGB(0, 0, 0)); - - store.setDefault(ExtendedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER, true); - - store.setDefault(ContentAssistPreference.CURRENT_FILE_SEARCH_SCOPE, true); - store.setDefault(ContentAssistPreference.PROJECT_SEARCH_SCOPE, false); - store.setDefault(ContentAssistPreference.PROJECT_AND_DEPENDENCY_SEARCH_SCOPE, false); - - store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOT, true); - store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW, true); - store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON, true); - store.setDefault(ContentAssistPreference.AUTOACTIVATION_DELAY, 500); - - store.setDefault(ContentAssistPreference.AUTOINSERT, true); - PreferenceConverter.setDefault(store, ContentAssistPreference.PROPOSALS_BACKGROUND, new RGB(254, 241, 233)); - PreferenceConverter.setDefault(store, ContentAssistPreference.PROPOSALS_FOREGROUND, new RGB(0, 0, 0)); - PreferenceConverter.setDefault(store, ContentAssistPreference.PARAMETERS_BACKGROUND, new RGB(254, 241, 233)); - PreferenceConverter.setDefault(store, ContentAssistPreference.PARAMETERS_FOREGROUND, new RGB(0, 0, 0)); - //store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_C, ".,"); - //store.setDefault(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_JAVADOC, "@"); - //store.setDefault(ContentAssistPreference.SHOW_VISIBLE_PROPOSALS, true); - //store.setDefault(ContentAssistPreference.CASE_SENSITIVITY, false); - store.setDefault(ContentAssistPreference.ORDER_PROPOSALS, false); - store.setDefault(ContentAssistPreference.ADD_INCLUDE, true); - - } - - /* - * @see IWorkbenchPreferencePage#init() - */ - public void init(IWorkbench workbench) { - } - - /* - * @see PreferencePage#createControl(Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - } - - protected void handleListSelection() { - int i = fList.getSelectionIndex(); - String key = fListModel[i][1]; - RGB rgb = PreferenceConverter.getColor(fOverlayStore, key); - fForegroundColorEditor.setColorValue(rgb); - fBoldCheckBox.setSelection(fOverlayStore.getBoolean(key + "_bold")); - } - - private Control createAnnotationsPage(Composite parent) { - Composite composite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - composite.setLayout(layout); - - Label label = new Label(composite, SWT.LEFT); - label.setText("Annotation Presentation Options"); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - Composite editorComposite = new Composite(composite, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginWidth = 0; - editorComposite.setLayout(layout); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); - gd.horizontalSpan = 2; - editorComposite.setLayoutData(gd); - - fAnnotationList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER); - gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL); - gd.heightHint = convertHeightInCharsToPixels(8); - fAnnotationList.setLayoutData(gd); - - Composite optionsComposite = new Composite(editorComposite, SWT.NONE); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 2; - optionsComposite.setLayout(layout); - optionsComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - fShowInTextCheckBox = new Button(optionsComposite, SWT.CHECK); - fShowInTextCheckBox.setText("Show In Text"); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - gd.horizontalSpan = 2; - fShowInTextCheckBox.setLayoutData(gd); - - fShowInOverviewRulerCheckBox = new Button(optionsComposite, SWT.CHECK); - fShowInOverviewRulerCheckBox.setText("Show In Overview Ruler"); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - gd.horizontalSpan = 2; - fShowInOverviewRulerCheckBox.setLayoutData(gd); - - label = new Label(optionsComposite, SWT.LEFT); - label.setText("Annotations Color"); - gd = new GridData(); - gd.horizontalAlignment = GridData.BEGINNING; - label.setLayoutData(gd); - - fAnnotationForegroundColorEditor = new ColorEditor(optionsComposite); - Button foregroundColorButton = fAnnotationForegroundColorEditor.getButton(); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - foregroundColorButton.setLayoutData(gd); - - fAnnotationList.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - handleAnnotationListSelection(); - } - }); - - fShowInTextCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - int i = fAnnotationList.getSelectionIndex(); - String key = fAnnotationColorListModel[i][2]; - fOverlayStore.setValue(key, fShowInTextCheckBox.getSelection()); - } - }); - - fShowInOverviewRulerCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - int i = fAnnotationList.getSelectionIndex(); - String key = fAnnotationColorListModel[i][3]; - fOverlayStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection()); - } - }); - - foregroundColorButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - - public void widgetSelected(SelectionEvent e) { - int i = fAnnotationList.getSelectionIndex(); - String key = fAnnotationColorListModel[i][1]; - PreferenceConverter.setValue(fOverlayStore, key, fAnnotationForegroundColorEditor.getColorValue()); - } - }); - - WorkbenchHelp.setHelp(composite, ICHelpContextIds.C_EDITOR_ANNOTATIONS_PREF_PAGE); - return composite; - } - - private void handleAnnotationListSelection() { - int i = fAnnotationList.getSelectionIndex(); - - String key = fAnnotationColorListModel[i][1]; - RGB rgb = PreferenceConverter.getColor(fOverlayStore, key); - fAnnotationForegroundColorEditor.setColorValue(rgb); - - key = fAnnotationColorListModel[i][2]; - fShowInTextCheckBox.setSelection(fOverlayStore.getBoolean(key)); - - key = fAnnotationColorListModel[i][3]; - fShowInOverviewRulerCheckBox.setSelection(fOverlayStore.getBoolean(key)); - } - - private String[][] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) { - ArrayList listModelItems = new ArrayList(); - Iterator e = preferences.getAnnotationPreferences().iterator(); - while (e.hasNext()) { - AnnotationPreference info = (AnnotationPreference) e.next(); - listModelItems.add( - new String[] { - info.getPreferenceLabel(), - info.getColorPreferenceKey(), - info.getTextPreferenceKey(), - info.getOverviewRulerPreferenceKey()}); - } - String[][] items = new String[listModelItems.size()][]; - listModelItems.toArray(items); - return items; - } - - private Control createColorPage(Composite parent) { - - Composite colorComposite = new Composite(parent, SWT.NULL); - colorComposite.setLayout(new GridLayout()); - - Composite backgroundComposite = new Composite(colorComposite, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 2; - backgroundComposite.setLayout(layout); - - Label label = new Label(backgroundComposite, SWT.NULL); - label.setText("Bac&kground Color:"); - GridData gd = new GridData(); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - SelectionListener backgroundSelectionListener = new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - boolean custom = fBackgroundCustomRadioButton.getSelection(); - fBackgroundColorButton.setEnabled(custom); - fOverlayStore.setValue(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, !custom); - } - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - fBackgroundDefaultRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT); - fBackgroundDefaultRadioButton.setText("S&ystem Default"); - gd = new GridData(); - gd.horizontalSpan = 2; - fBackgroundDefaultRadioButton.setLayoutData(gd); - fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener); - - fBackgroundCustomRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT); - fBackgroundCustomRadioButton.setText("C&ustom"); - fBackgroundCustomRadioButton.addSelectionListener(backgroundSelectionListener); - - fBackgroundColorEditor = new ColorEditor(backgroundComposite); - fBackgroundColorButton = fBackgroundColorEditor.getButton(); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - fBackgroundColorButton.setLayoutData(gd); - - label = new Label(colorComposite, SWT.LEFT); - label.setText("Fo®round:"); - label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Composite editorComposite = new Composite(colorComposite, SWT.NULL); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginWidth = 0; - editorComposite.setLayout(layout); - gd = new GridData(GridData.FILL_BOTH); - editorComposite.setLayoutData(gd); - - fList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL); - gd = new GridData(GridData.FILL_BOTH); - gd.heightHint = convertHeightInCharsToPixels(5); - fList.setLayoutData(gd); - - Composite stylesComposite = new Composite(editorComposite, SWT.NULL); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 2; - stylesComposite.setLayout(layout); - stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - label = new Label(stylesComposite, SWT.LEFT); - label.setText("C&olor:"); - gd = new GridData(); - gd.horizontalAlignment = GridData.BEGINNING; - label.setLayoutData(gd); - - fForegroundColorEditor = new ColorEditor(stylesComposite); - Button foregroundColorButton = fForegroundColorEditor.getButton(); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - foregroundColorButton.setLayoutData(gd); - - label = new Label(stylesComposite, SWT.LEFT); - label.setText("&Bold:"); - gd = new GridData(); - gd.horizontalAlignment = GridData.BEGINNING; - label.setLayoutData(gd); - - fBoldCheckBox = new Button(stylesComposite, SWT.CHECK); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - fBoldCheckBox.setLayoutData(gd); - - label = new Label(colorComposite, SWT.LEFT); - label.setText("Preview:"); - label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Control previewer = createPreviewer(colorComposite); - gd = new GridData(GridData.FILL_BOTH); - gd.widthHint = convertWidthInCharsToPixels(80); - gd.heightHint = convertHeightInCharsToPixels(15); - previewer.setLayoutData(gd); - - fList.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - public void widgetSelected(SelectionEvent e) { - handleListSelection(); - } - }); - - foregroundColorButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - public void widgetSelected(SelectionEvent e) { - int i = fList.getSelectionIndex(); - String key = fListModel[i][1]; - - PreferenceConverter.setValue(fOverlayStore, key, fForegroundColorEditor.getColorValue()); - } - }); - - fBackgroundColorButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - public void widgetSelected(SelectionEvent e) { - PreferenceConverter.setValue( - fOverlayStore, - CEditor.PREFERENCE_COLOR_BACKGROUND, - fBackgroundColorEditor.getColorValue()); - } - }); - - fBoldCheckBox.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - public void widgetSelected(SelectionEvent e) { - int i = fList.getSelectionIndex(); - String key = fListModel[i][1]; - fOverlayStore.setValue(key + "_bold", fBoldCheckBox.getSelection()); - } - }); - - WorkbenchHelp.setHelp(colorComposite, ICHelpContextIds.C_EDITOR_COLORS_PREF_PAGE); - return colorComposite; - } - - private Control createPreviewer(Composite parent) { - - fCTextTools = new CTextTools(fOverlayStore); - - fPreviewViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL); - fPreviewViewer.configure(new CSourceViewerConfiguration(fCTextTools, null)); - fPreviewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)); - fPreviewViewer.setEditable(false); - - initializeViewerColors(fPreviewViewer); - - String content = loadPreviewContentFromFile("ColorSettingPreviewCode.txt"); - IDocument document = new Document(content); - IDocumentPartitioner partitioner = fCTextTools.createDocumentPartitioner(); - partitioner.connect(document); - document.setDocumentPartitioner(partitioner); - - fPreviewViewer.setDocument(document); - - fOverlayStore.addPropertyChangeListener(new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - String p = event.getProperty(); - if (p.equals(CEditor.PREFERENCE_COLOR_BACKGROUND) - || p.equals(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) { - initializeViewerColors(fPreviewViewer); - } - - fPreviewViewer.getDocument().set(fPreviewViewer.getDocument().get()); - //fPreviewViewer.refresh(); - } - }); - - return fPreviewViewer.getControl(); - } - - private Color fBackgroundColor; - - /** - * Initializes the given viewer's colors. - * - * @param viewer the viewer to be initialized - */ - protected void initializeViewerColors(ISourceViewer viewer) { - - IPreferenceStore store = fOverlayStore; - if (store != null) { - - StyledText styledText = viewer.getTextWidget(); - - // ---------- background color ---------------------- - Color color = - store.getBoolean(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) - ? null - : createColor(store, CEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); - styledText.setBackground(color); - - if (fBackgroundColor != null) - fBackgroundColor.dispose(); - - fBackgroundColor = color; - } - } - - /** - * Creates a color from the information stored in the given preference store. - * Returns null if there is no such information available. - */ - private Color createColor(IPreferenceStore store, String key, Display display) { - - RGB rgb = null; - - if (store.contains(key)) { - - if (store.isDefault(key)) - rgb = PreferenceConverter.getDefaultColor(store, key); - else - rgb = PreferenceConverter.getColor(store, key); - - if (rgb != null) - return new Color(display, rgb); - } - - return null; - } - - // sets enabled flag for a control and all its sub-tree - protected static void setEnabled(Control control, boolean enable) { - control.setEnabled(enable); - if (control instanceof Composite) { - Composite composite = (Composite) control; - Control[] children = composite.getChildren(); - for (int i = 0; i < children.length; i++) - setEnabled(children[i], enable); - } - } - - private ArrayList fNumberFields = new ArrayList(); - private ModifyListener fNumberFieldListener = new ModifyListener() { - public void modifyText(ModifyEvent e) { - numberFieldChanged((Text) e.widget); - } - }; - - private Button fBracketHighlightButton; - private Button fLineHighlightButton; - - protected void handleAppearanceColorListSelection() { - int i = fAppearanceColorList.getSelectionIndex(); - String key = fAppearanceColorListModel[i][1]; - RGB rgb = PreferenceConverter.getColor(fOverlayStore, key); - fAppearanceForegroundColorEditor.setColorValue(rgb); - } - private Control createBehaviorPage(Composite parent) { - - Composite behaviorComposite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - behaviorComposite.setLayout(layout); - - String label = "Text &font:"; - addTextFontEditor(behaviorComposite, label, JFaceResources.TEXT_FONT); - - label = "Displayed &tab width:"; - addTextField(behaviorComposite, label, CSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 2, 0, true); - - label = "Print margin col&umn:"; - addTextField(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 4, 0, true); - - label = "Insert &space for tabs"; - addCheckBox(behaviorComposite, label, CEditor.SPACES_FOR_TABS, 0); - - label = "Highlight &matching brackets"; - fBracketHighlightButton = addCheckBox(behaviorComposite, label, CEditor.MATCHING_BRACKETS, 0); - - label = "Show line numbers"; //$NON-NLS-1$ - addCheckBox(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0); - - label = "Highlight ¤t line"; - fLineHighlightButton = addCheckBox(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, 0); - - label = "Show overview ruler"; //$NON-NLS-1$ - addCheckBox(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER, 0); - - label = "Show print &margin"; - addCheckBox(behaviorComposite, label, ExtendedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, 0); - - Label l = new Label(behaviorComposite, SWT.LEFT); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - gd.heightHint = convertHeightInCharsToPixels(1) / 2; - l.setLayoutData(gd); - - l = new Label(behaviorComposite, SWT.LEFT); - l.setText("Appearance color options"); //$NON-NLS-1$ - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - l.setLayoutData(gd); - - Composite editorComposite = new Composite(behaviorComposite, SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginWidth = 0; - editorComposite.setLayout(layout); - gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); - gd.horizontalSpan = 2; - editorComposite.setLayoutData(gd); - - fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER); - gd = new GridData(GridData.FILL_BOTH); - gd.heightHint = convertHeightInCharsToPixels(5); - fAppearanceColorList.setLayoutData(gd); - - Composite stylesComposite = new Composite(editorComposite, SWT.NONE); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 2; - stylesComposite.setLayout(layout); - stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - l = new Label(stylesComposite, SWT.LEFT); - l.setText("Color:"); //$NON-NLS-1$ - gd = new GridData(); - gd.horizontalAlignment = GridData.BEGINNING; - l.setLayoutData(gd); - - fAppearanceForegroundColorEditor = new ColorEditor(stylesComposite); - Button foregroundColorButton = fAppearanceForegroundColorEditor.getButton(); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.BEGINNING; - foregroundColorButton.setLayoutData(gd); - - fAppearanceColorList.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - public void widgetSelected(SelectionEvent e) { - handleAppearanceColorListSelection(); - } - }); - foregroundColorButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - public void widgetSelected(SelectionEvent e) { - int i = fAppearanceColorList.getSelectionIndex(); - String key = fAppearanceColorListModel[i][1]; - - PreferenceConverter.setValue(fOverlayStore, key, fAppearanceForegroundColorEditor.getColorValue()); - } - }); - - WorkbenchHelp.setHelp(behaviorComposite, ICHelpContextIds.C_EDITOR_PREF_PAGE); - return behaviorComposite; - } - - private Control createContentAssistPage(Composite parent) { - - Composite contentAssistComposite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - contentAssistComposite.setLayout(layout); - - //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - // The following three radio buttons are grouped together - String label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.searchGroupTitle"); - Group searchGroup = addGroupBox(contentAssistComposite, label, 2); - - label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.searchGroupCurrentFileOption"); - addRadioButton(searchGroup, label, ContentAssistPreference.CURRENT_FILE_SEARCH_SCOPE, 0); - - label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.searchGroupCurrentProjectOption"); - addRadioButton(searchGroup, label, ContentAssistPreference.PROJECT_SEARCH_SCOPE, 0); - - label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.searchGroupCurrentProjectAndDependenciesOption"); - addRadioButton(searchGroup, label, ContentAssistPreference.PROJECT_AND_DEPENDENCY_SEARCH_SCOPE, 0); - //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - - - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.insertSingleProposalAutomatically"); - addCheckBox(contentAssistComposite, label, ContentAssistPreference.AUTOINSERT, 0); - - label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.showProposalsInAlphabeticalOrder"); - addCheckBox(contentAssistComposite, label, ContentAssistPreference.ORDER_PROPOSALS, 0); - - //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - // The following items are grouped for Auto Activation - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.autoActivationGroupTitle"); - Group enableGroup = addGroupBox(contentAssistComposite, label, 2); - - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.autoActivationEnableDot"); - addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOT, 0); - - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.autoActivationEnableArrow"); - addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW, 0); - - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.autoActivationEnableDoubleColon"); - addCheckBox(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON, 0); - - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.autoActivationDelay"); - addTextField(enableGroup, label, ContentAssistPreference.AUTOACTIVATION_DELAY, 4, 0, true); - - //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& - - label = PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.completionProposalBackgroundColor"); - addColorButton(contentAssistComposite, label, ContentAssistPreference.PROPOSALS_BACKGROUND, 0); - - label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.completionProposalForegroundColor"); - addColorButton(contentAssistComposite, label, ContentAssistPreference.PROPOSALS_FOREGROUND, 0); - -// label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.parameterBackgroundColor"); -// addColorButton(contentAssistComposite, label, ContentAssistPreference.PARAMETERS_BACKGROUND, 0); -// -// label= PreferencesMessages.getString("CEditorPreferencePage.ContentAssistPage.parameterForegroundColor"); -// addColorButton(contentAssistComposite, label, ContentAssistPreference.PARAMETERS_FOREGROUND, 0); - - WorkbenchHelp.setHelp(contentAssistComposite, ICHelpContextIds.C_EDITOR_CONTENT_ASSIST_PREF_PAGE); - - return contentAssistComposite; - } - - /* - * @see PreferencePage#createContents(Composite) - */ - protected Control createContents(Composite parent) { - - fOverlayStore.load(); - fOverlayStore.start(); - - TabFolder folder = new TabFolder(parent, SWT.NONE); - folder.setLayout(new TabFolderLayout()); - folder.setLayoutData(new GridData(GridData.FILL_BOTH)); - - TabItem item = new TabItem(folder, SWT.NONE); - item.setText(PreferencesMessages.getString("CEditorPreferencePage.generalTabTitle")); - item.setImage(CPluginImages.get(CPluginImages.IMG_OBJS_TUNIT)); - item.setControl(createBehaviorPage(folder)); - - item = new TabItem(folder, SWT.NONE); - item.setImage(CPluginImages.get(CPluginImages.IMG_OBJS_TUNIT)); - item.setText(PreferencesMessages.getString("CEditorPreferencePage.annotationTabTitle")); - item.setControl(createAnnotationsPage(folder)); - - item = new TabItem(folder, SWT.NONE); - item.setText(PreferencesMessages.getString("CEditorPreferencePage.colorsTabTitle")); - item.setImage(CPluginImages.get(CPluginImages.IMG_OBJS_TUNIT)); - item.setControl(createColorPage(folder)); - - item = new TabItem(folder, SWT.NONE); - item.setText(PreferencesMessages.getString("CEditorPreferencePage.contentAssistTabTitle")); - item.setImage(CPluginImages.get(CPluginImages.IMG_OBJS_TUNIT)); - item.setControl(createContentAssistPage(folder)); - - initialize(); - - return folder; - } - - private void initialize() { - - fFontEditor.setPreferenceStore(getPreferenceStore()); - fFontEditor.setPreferencePage(this); - fFontEditor.load(); - - initializeFields(); - - for (int i = 0; i < fListModel.length; i++) - fList.add(fListModel[i][0]); - fList.getDisplay().asyncExec(new Runnable() { - public void run() { - fList.select(0); - handleListSelection(); - } - }); - - for (int i = 0; i < fAppearanceColorListModel.length; i++) - fAppearanceColorList.add(fAppearanceColorListModel[i][0]); - fAppearanceColorList.getDisplay().asyncExec(new Runnable() { - public void run() { - fAppearanceColorList.select(0); - handleAppearanceColorListSelection(); - } - }); - - for (int i = 0; i < fAnnotationColorListModel.length; i++) - fAnnotationList.add(fAnnotationColorListModel[i][0]); - fAnnotationList.getDisplay().asyncExec(new Runnable() { - public void run() { - if (fAnnotationList != null && !fAnnotationList.isDisposed()) { - fAnnotationList.select(0); - handleAnnotationListSelection(); - } - } - }); - } - - private void initializeFields() { - - Iterator e = fColorButtons.keySet().iterator(); - while (e.hasNext()) { - ColorEditor c = (ColorEditor) e.next(); - String key = (String) fColorButtons.get(c); - RGB rgb = PreferenceConverter.getColor(fOverlayStore, key); - c.setColorValue(rgb); - } - - e = fCheckBoxes.keySet().iterator(); - while (e.hasNext()) { - Button b = (Button) e.next(); - String key = (String) fCheckBoxes.get(b); - b.setSelection(fOverlayStore.getBoolean(key)); - } - - e = fTextFields.keySet().iterator(); - while (e.hasNext()) { - Text t = (Text) e.next(); - String key = (String) fTextFields.get(t); - t.setText(fOverlayStore.getString(key)); - } - - RGB rgb = PreferenceConverter.getColor(fOverlayStore, CEditor.PREFERENCE_COLOR_BACKGROUND); - fBackgroundColorEditor.setColorValue(rgb); - - boolean default_ = fOverlayStore.getBoolean(CEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT); - fBackgroundDefaultRadioButton.setSelection(default_); - fBackgroundCustomRadioButton.setSelection(!default_); - fBackgroundColorButton.setEnabled(!default_); - - //updateAutoactivationControls(); - } - - /* - * @see PreferencePage#performOk() - */ - public boolean performOk() { - fFontEditor.store(); - fOverlayStore.propagate(); - return true; - } - - /* - * @see PreferencePage#performDefaults() - */ - protected void performDefaults() { - - fFontEditor.loadDefault(); - - fOverlayStore.loadDefaults(); - initializeFields(); - handleListSelection(); - handleAppearanceColorListSelection(); - - super.performDefaults(); - - fPreviewViewer.invalidateTextPresentation(); - } - - /* - * @see DialogPage#dispose() - */ - public void dispose() { - - if (fCTextTools != null) { - fCTextTools = null; - } - - fFontEditor.setPreferencePage(null); - fFontEditor.setPreferenceStore(null); - - if (fOverlayStore != null) { - fOverlayStore.stop(); - fOverlayStore = null; - } - - super.dispose(); - } - - private Control addColorButton(Composite parent, String label, String key, int indentation) { - - Composite composite = new Composite(parent, SWT.NONE); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - composite.setLayoutData(gd); - - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = 0; - layout.marginHeight = 0; - composite.setLayout(layout); - - Label labelControl = new Label(composite, SWT.NONE); - labelControl.setText(label); - - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalIndent = indentation; - labelControl.setLayoutData(gd); - - ColorEditor editor = new ColorEditor(composite); - Button button = editor.getButton(); - button.setData(editor); - - gd = new GridData(); - gd.horizontalAlignment = GridData.END; - button.setLayoutData(gd); - button.addSelectionListener(fColorButtonListener); - - fColorButtons.put(editor, key); - - return composite; - } - - private Group addGroupBox(Composite parent, String label, int nColumns ){ - Group group = new Group(parent, SWT.NONE); - group.setText(label); - GridLayout layout = new GridLayout(); - layout.numColumns = nColumns; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - return group; - } - - private Button addCheckBox(Composite parent, String label, String key, int indentation) { - Button checkBox = new Button(parent, SWT.CHECK); - checkBox.setText(label); - - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalIndent = indentation; - gd.horizontalSpan = 2; - checkBox.setLayoutData(gd); - checkBox.addSelectionListener(fCheckBoxListener); - - fCheckBoxes.put(checkBox, key); - - return checkBox; - } - - private Button addRadioButton(Composite parent, String label, String key, int indentation) { - Button radioButton = new Button(parent, SWT.RADIO); - radioButton.setText(label); - - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalIndent = indentation; - gd.horizontalSpan = 2; - radioButton.setLayoutData(gd); - radioButton.addSelectionListener(fCheckBoxListener); - - fCheckBoxes.put(radioButton, key); - - return radioButton; - } - - private Control addTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) { - - Label labelControl = new Label(composite, SWT.NONE); - labelControl.setText(label); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); - gd.horizontalIndent = indentation; - labelControl.setLayoutData(gd); - - Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE); - gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); - gd.widthHint = convertWidthInCharsToPixels(textLimit + 1); - textControl.setLayoutData(gd); - textControl.setTextLimit(textLimit); - fTextFields.put(textControl, key); - if (isNumber) { - fNumberFields.add(textControl); - textControl.addModifyListener(fNumberFieldListener); - } else { - textControl.addModifyListener(fTextFieldListener); - } - - return textControl; - } - - private void addTextFontEditor(Composite parent, String label, String key) { - - Composite editorComposite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.numColumns = 3; - editorComposite.setLayout(layout); - fFontEditor = new WorkbenchChainedTextFontFieldEditor(key, label, editorComposite); - fFontEditor.setChangeButtonText("C&hange..."); - - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - editorComposite.setLayoutData(gd); - } - - private String loadPreviewContentFromFile(String filename) { - String line; - String separator = System.getProperty("line.separator"); //$NON-NLS-1$ - StringBuffer buffer = new StringBuffer(512); - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename))); - while ((line = reader.readLine()) != null) { - buffer.append(line); - buffer.append(separator); - } - } catch (IOException io) { - CUIPlugin.getDefault().log(io); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - } - } - } - return buffer.toString(); - } - - protected void numberFieldChanged(Text textControl) { - String number = textControl.getText(); - IStatus status = validatePositiveNumber(number); - if (!status.matches(IStatus.ERROR)) - fOverlayStore.setValue((String) fTextFields.get(textControl), number); - updateStatus(status); - } - - private IStatus validatePositiveNumber(String number) { - StatusInfo status = new StatusInfo(); - if (number.length() == 0) { - status.setError(PreferencesMessages.getString("CEditorPreferencePage.empty_input")); //$NON-NLS-1$ - } else { - try { - int value = Integer.parseInt(number); - if (value < 0) - status.setError(PreferencesMessages.getString("CEditorPreferencePage.invalid_input")); //$NON-NLS-1$ - } catch (NumberFormatException e) { - status.setError(PreferencesMessages.getString("CEditorPreferencePage.invalid_input")); //$NON-NLS-1$ - } - } - return status; - } - - private void updateStatus(IStatus status) { - if (!status.matches(IStatus.ERROR)) { - for (int i = 0; i < fNumberFields.size(); i++) { - Text text = (Text) fNumberFields.get(i); - IStatus s = validatePositiveNumber(text.getText()); - status = StatusUtil.getMoreSevere(s, status); - } - } - setValid(!status.matches(IStatus.ERROR)); - StatusUtil.applyToStatusLine(this, status); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java deleted file mode 100644 index b53b8997501..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.eclipse.cdt.internal.ui.preferences; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.PreferenceConstants; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * The page for setting c plugin preferences. - */ -public class CPluginPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - - private static final String LINK_TO_EDITOR_LABEL= "CBasePreferencePage.linkToEditor.label"; - private static final String SHOW_CU_CHILDREN_LABEL= "CBasePreferencePage.CUChildren.label"; - private static final String USE_STRUCTURAL_PARSE_MODE_LABEL= "CBasePreferencePage.OutlineView.structuralParseMode.label"; - - public CPluginPreferencePage() { - super(GRID); - setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); - } - - /** - * @see PreferencePage#createControl(Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - WorkbenchHelp.setHelp(getControl(), ICHelpContextIds.C_PREF_PAGE); - } - - /** - * @see FieldEditorPreferencePage#createControl(Composite) - */ - protected void createFieldEditors() { - Composite parent= getFieldEditorParent(); - - BooleanFieldEditor linkEditor= new BooleanFieldEditor(PreferenceConstants.PREF_LINK_TO_EDITOR, CUIPlugin.getResourceString(LINK_TO_EDITOR_LABEL), parent); - addField(linkEditor); - - BooleanFieldEditor showCUChildrenEditor= new BooleanFieldEditor(PreferenceConstants.PREF_SHOW_CU_CHILDREN, CUIPlugin.getResourceString(SHOW_CU_CHILDREN_LABEL), parent); - addField(showCUChildrenEditor); - - BooleanFieldEditor useStructuralParseMode= new BooleanFieldEditor(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, CUIPlugin.getResourceString(USE_STRUCTURAL_PARSE_MODE_LABEL), parent); - addField(useStructuralParseMode); - } - - - public static boolean isLinkToEditor() { - return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.PREF_LINK_TO_EDITOR); - } - - public static boolean showCompilationUnitChildren() { - return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.PREF_SHOW_CU_CHILDREN); - } - - public static boolean useStructuralParseMode() { - return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE); - } - - /** - * @see IWorkbenchPreferencePage#init - */ - public void init(IWorkbench workbench) { - CUIPlugin.getDefault().getPreferenceStore().setValue(CCorePlugin.PREF_USE_STRUCTURAL_PARSE_MODE, CCorePlugin.getDefault().useStructuralParseMode()); - } - - /** - * Initializes the default values of this page in the preference bundle. - */ - public static void initDefaults(IPreferenceStore prefs) { - prefs.setDefault(PreferenceConstants.PREF_LINK_TO_EDITOR, true); - prefs.setDefault(PreferenceConstants.PREF_SHOW_CU_CHILDREN, true); - prefs.setDefault(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, CCorePlugin.getDefault().useStructuralParseMode()); - prefs.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - if (!super.performOk()) - return false; - // tell the Core Plugin about this preference - CCorePlugin.getDefault().setStructuralParseMode(useStructuralParseMode()); - return true; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorEditor.java deleted file mode 100644 index c10fe8c8956..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorEditor.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.eclipse.cdt.internal.ui.preferences; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.ColorDialog; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.jface.resource.JFaceResources; - -/** - * A "button" of a certain color determined by the color picker. - */ -public class ColorEditor { - - private Point fExtent; - protected Image fImage; - protected RGB fColorValue; - protected Color fColor; - protected Button fButton; - - public ColorEditor(Composite parent) { - - fButton= new Button(parent, SWT.PUSH); - fExtent= computeImageSize(parent); - fImage= new Image(parent.getDisplay(), fExtent.x, fExtent.y); - - GC gc= new GC(fImage); - gc.setBackground(fButton.getBackground()); - gc.fillRectangle(0, 0, fExtent.x, fExtent.y); - gc.dispose(); - - fButton.setImage(fImage); - fButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - ColorDialog colorDialog= new ColorDialog(fButton.getShell()); - colorDialog.setRGB(fColorValue); - RGB newColor = colorDialog.open(); - if (newColor != null) { - fColorValue= newColor; - updateColorImage(); - } - } - }); - - fButton.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - if (fImage != null) { - fImage.dispose(); - fImage= null; - } - if (fColor != null) { - fColor.dispose(); - fColor= null; - } - } - }); - } - - public RGB getColorValue() { - return fColorValue; - } - - public void setColorValue(RGB rgb) { - fColorValue= rgb; - updateColorImage(); - } - - public Button getButton() { - return fButton; - } - - protected void updateColorImage() { - - Display display= fButton.getDisplay(); - - GC gc= new GC(fImage); - gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK)); - gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4); - - if (fColor != null) - fColor.dispose(); - - fColor= new Color(display, fColorValue); - gc.setBackground(fColor); - gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5); - gc.dispose(); - - fButton.setImage(fImage); - } - - protected Point computeImageSize(Control window) { - GC gc= new GC(window); - Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); - gc.setFont(f); - int height= gc.getFontMetrics().getHeight(); - gc.dispose(); - Point p= new Point(height * 3 - 6, height); - return p; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorSettingPreviewCode.txt b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorSettingPreviewCode.txt deleted file mode 100644 index 1a7e359c3dc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/ColorSettingPreviewCode.txt +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This is sample C code - */ -#include -unsigned static myfunc(int a, char b,) { - /* This comment may span multiple lines. */ - int integer= 0; - // This comment may span only this line - if(integer == 0) printf("zero"); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java deleted file mode 100644 index 8bd10c88d78..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/EditTemplateDialog.java +++ /dev/null @@ -1,540 +0,0 @@ -package org.eclipse.cdt.internal.ui.preferences; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.ContextTypeRegistry; -import org.eclipse.cdt.internal.corext.template.Template; -import org.eclipse.cdt.internal.corext.template.TemplateMessages; -import org.eclipse.cdt.internal.corext.template.TemplateTranslator; -import org.eclipse.cdt.internal.ui.IContextMenuConstants; -import org.eclipse.cdt.internal.ui.dialogs.StatusDialog; -import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference; -import org.eclipse.cdt.internal.ui.text.template.TemplateVariableProcessor; -import org.eclipse.cdt.internal.ui.util.SWTUtil; -import org.eclipse.cdt.ui.CUIPlugin; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.custom.VerifyKeyListener; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.GroupMarker; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextListener; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.ITextViewerExtension; -import org.eclipse.jface.text.TextEvent; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContentAssistant; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; - -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.ui.texteditor.IUpdate; - - -/** - * Dialog to edit a template. - */ -public class EditTemplateDialog extends StatusDialog { - - private static class SimpleCSourceViewerConfiguration extends CSourceViewerConfiguration { - - private final IContentAssistProcessor fProcessor; - - SimpleCSourceViewerConfiguration(CTextTools tools, CEditor editor, IContentAssistProcessor processor) { - super(tools, editor); - fProcessor= processor; - } - - /* - * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer) - */ - public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { - - IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore(); - - ContentAssistant assistant= new ContentAssistant(); - assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE); - - //assistant.enableAutoInsert(store.getBoolean(ContentAssistPreference.AUTOINSERT)); - boolean enabled = (store.getBoolean(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOT) - || store.getBoolean(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_ARROW) - || store.getBoolean(ContentAssistPreference.AUTOACTIVATION_TRIGGERS_DOUBLECOLON) - ); - assistant.enableAutoActivation(enabled); - - assistant.setAutoActivationDelay(store.getInt(ContentAssistPreference.AUTOACTIVATION_DELAY)); - assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY); - assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); - //assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); - - Display display= sourceViewer.getTextWidget().getDisplay(); - - Color background= createColor(store, ContentAssistPreference.PROPOSALS_BACKGROUND, display); - assistant.setContextInformationPopupBackground(background); - assistant.setContextSelectorBackground(background); - assistant.setProposalSelectorBackground(background); - - Color foreground= createColor(store, ContentAssistPreference.PROPOSALS_FOREGROUND, display); - assistant.setContextInformationPopupForeground(foreground); - assistant.setContextSelectorForeground(foreground); - assistant.setProposalSelectorForeground(foreground); - - return assistant; - } - - /** - * Creates a color from the information stored in the given preference store. - * Returns null if there is no such information available. - */ - private Color createColor(IPreferenceStore store, String key, Display display) { - - RGB rgb= null; - - if (store.contains(key)) { - - if (store.isDefault(key)) - rgb= PreferenceConverter.getDefaultColor(store, key); - else - rgb= PreferenceConverter.getColor(store, key); - - if (rgb != null) - return new Color(display, rgb); - } - - return null; - } - } - - private static class TextViewerAction extends Action implements IUpdate { - - private int fOperationCode= -1; - private ITextOperationTarget fOperationTarget; - - public TextViewerAction(ITextViewer viewer, int operationCode) { - fOperationCode= operationCode; - fOperationTarget= viewer.getTextOperationTarget(); - update(); - } - - /** - * Updates the enabled state of the action. - * Fires a property change if the enabled state changes. - * - * @see Action#firePropertyChange(String, Object, Object) - */ - public void update() { - - boolean wasEnabled= isEnabled(); - boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); - setEnabled(isEnabled); - - if (wasEnabled != isEnabled) { - firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE); - } - } - - /** - * @see Action#run() - */ - public void run() { - if (fOperationCode != -1 && fOperationTarget != null) { - fOperationTarget.doOperation(fOperationCode); - } - } - } - - private final Template fTemplate; - - protected Text fNameText; - private Text fDescriptionText; - protected Combo fContextCombo; - protected SourceViewer fPatternEditor; - private Button fInsertVariableButton; - - protected TemplateTranslator fTranslator= new TemplateTranslator(); - protected boolean fSuppressError= true; // #4354 - private Map fGlobalActions= new HashMap(10); - private List fSelectionActions = new ArrayList(3); - private Vector fContextTypes= new Vector(); - - protected final TemplateVariableProcessor fProcessor= new TemplateVariableProcessor(); - - public EditTemplateDialog(Shell parent, Template template, boolean edit) { - super(parent); - - setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE); - - String title= edit - ? TemplateMessages.getString("EditTemplateDialog.title.edit") //$NON-NLS-1$ - : TemplateMessages.getString("EditTemplateDialog.title.new"); //$NON-NLS-1$ - setTitle(title); - - fTemplate= template; - - ContextTypeRegistry registry= ContextTypeRegistry.getInstance(); - for (Iterator iterator= registry.iterator(); iterator.hasNext(); ) - fContextTypes.add(iterator.next()); - - if (fContextTypes.size() > 0) - fProcessor.setContextType(ContextTypeRegistry.getInstance().getContextType((String) fContextTypes.get(0))); - } - - /* - * @see Dialog#createDialogArea(Composite) - */ - protected Control createDialogArea(Composite ancestor) { - Composite parent= new Composite(ancestor, SWT.NONE); - GridLayout layout= new GridLayout(); - layout.numColumns= 2; - parent.setLayout(layout); - parent.setLayoutData(new GridData(GridData.FILL_BOTH)); - - createLabel(parent, TemplateMessages.getString("EditTemplateDialog.name")); //$NON-NLS-1$ - - Composite composite= new Composite(parent, SWT.NONE); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - layout= new GridLayout(); - layout.numColumns= 3; - layout.marginWidth= 0; - layout.marginHeight= 0; - composite.setLayout(layout); - - fNameText= createText(composite); - fNameText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (fSuppressError && (fNameText.getText().trim().length() != 0)) - fSuppressError= false; - - updateButtons(); - } - }); - - createLabel(composite, TemplateMessages.getString("EditTemplateDialog.context")); //$NON-NLS-1$ - fContextCombo= new Combo(composite, SWT.READ_ONLY); - - for (Iterator iterator= fContextTypes.iterator(); iterator.hasNext(); ) - fContextCombo.add((String) iterator.next()); - - fContextCombo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - String name= fContextCombo.getText(); - fProcessor.setContextType(ContextTypeRegistry.getInstance().getContextType(name)); - } - }); - - createLabel(parent, TemplateMessages.getString("EditTemplateDialog.description")); //$NON-NLS-1$ - fDescriptionText= createText(parent); - - composite= new Composite(parent, SWT.NONE); - composite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - layout= new GridLayout(); - layout.marginWidth= 0; - layout.marginHeight= 0; - composite.setLayout(layout); - - createLabel(composite, TemplateMessages.getString("EditTemplateDialog.pattern")); //$NON-NLS-1$ - fPatternEditor= createEditor(parent); - - Label filler= new Label(composite, SWT.NONE); - filler.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - - fInsertVariableButton= new Button(composite, SWT.NONE); - fInsertVariableButton.setLayoutData(getButtonGridData(fInsertVariableButton)); - fInsertVariableButton.setText(TemplateMessages.getString("EditTemplateDialog.insert.variable")); //$NON-NLS-1$ - fInsertVariableButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - fPatternEditor.getTextWidget().setFocus(); - fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); - } - - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - fNameText.setText(fTemplate.getName()); - fDescriptionText.setText(fTemplate.getDescription()); - fContextCombo.select(getIndex(fTemplate.getContextTypeName())); - - initializeActions(); - - return composite; - } - - private static GridData getButtonGridData(Button button) { - GridData data= new GridData(GridData.FILL_HORIZONTAL); - data.heightHint= SWTUtil.getButtonHeigthHint(button); - - return data; - } - - private static Label createLabel(Composite parent, String name) { - Label label= new Label(parent, SWT.NULL); - label.setText(name); - label.setLayoutData(new GridData()); - - return label; - } - - private static Text createText(Composite parent) { - Text text= new Text(parent, SWT.BORDER); - text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - return text; - } - - private SourceViewer createEditor(Composite parent) { - SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - CTextTools tools= CUIPlugin.getDefault().getTextTools(); - viewer.configure(new SimpleCSourceViewerConfiguration(tools, null, fProcessor)); - viewer.setEditable(true); - viewer.setDocument(new Document(fTemplate.getPattern())); - - Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT); - viewer.getTextWidget().setFont(font); - - Control control= viewer.getControl(); - GridData data= new GridData(GridData.FILL_BOTH); - data.widthHint= convertWidthInCharsToPixels(60); - data.heightHint= convertHeightInCharsToPixels(5); - control.setLayoutData(data); - - viewer.addTextListener(new ITextListener() { - public void textChanged(TextEvent event) { - try { - fTranslator.translate(event.getDocumentEvent().getDocument().get()); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - // XXX dialog - } - - updateUndoAction(); - updateButtons(); - } - }); - - viewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updateSelectionDependentActions(); - } - }); - - if (viewer instanceof ITextViewerExtension) { - ((ITextViewerExtension) viewer).prependVerifyKeyListener(new VerifyKeyListener() { - public void verifyKey(VerifyEvent event) { - handleVerifyKeyPressed(event); - } - }); - } else { - viewer.getTextWidget().addKeyListener(new KeyListener() { - public void keyPressed(KeyEvent e) { - handleKeyPressed(e); - } - - public void keyReleased(KeyEvent e) {} - }); - } - - return viewer; - } - - protected void handleKeyPressed(KeyEvent event) { - if (event.stateMask != SWT.CTRL) - return; - - switch (event.character) { - case ' ': - fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); - break; - - // CTRL-Z - case (int) 'z' - (int) 'a' + 1: - fPatternEditor.doOperation(ITextOperationTarget.UNDO); - break; - } - } - - protected void handleVerifyKeyPressed(VerifyEvent event) { - if (!event.doit) - return; - - if (event.stateMask != SWT.CTRL) - return; - - switch (event.character) { - case ' ': - fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); - event.doit= false; - break; - - // CTRL-Z - case (int) 'z' - (int) 'a' + 1: - fPatternEditor.doOperation(ITextOperationTarget.UNDO); - event.doit= false; - break; - } - } - - private void initializeActions() { - TextViewerAction action= new TextViewerAction(fPatternEditor, ITextOperationTarget.UNDO); - action.setText(TemplateMessages.getString("EditTemplateDialog.undo")); //$NON-NLS-1$ - fGlobalActions.put(ITextEditorActionConstants.UNDO, action); - - action= new TextViewerAction(fPatternEditor, ITextOperationTarget.CUT); - action.setText(TemplateMessages.getString("EditTemplateDialog.cut")); //$NON-NLS-1$ - fGlobalActions.put(ITextEditorActionConstants.CUT, action); - - action= new TextViewerAction(fPatternEditor, ITextOperationTarget.COPY); - action.setText(TemplateMessages.getString("EditTemplateDialog.copy")); //$NON-NLS-1$ - fGlobalActions.put(ITextEditorActionConstants.COPY, action); - - action= new TextViewerAction(fPatternEditor, ITextOperationTarget.PASTE); - action.setText(TemplateMessages.getString("EditTemplateDialog.paste")); //$NON-NLS-1$ - fGlobalActions.put(ITextEditorActionConstants.PASTE, action); - - action= new TextViewerAction(fPatternEditor, ITextOperationTarget.SELECT_ALL); - action.setText(TemplateMessages.getString("EditTemplateDialog.select.all")); //$NON-NLS-1$ - fGlobalActions.put(ITextEditorActionConstants.SELECT_ALL, action); - - action= new TextViewerAction(fPatternEditor, ISourceViewer.CONTENTASSIST_PROPOSALS); - action.setText(TemplateMessages.getString("EditTemplateDialog.content.assist")); //$NON-NLS-1$ - fGlobalActions.put("ContentAssistProposal", action); //$NON-NLS-1$ - - fSelectionActions.add(ITextEditorActionConstants.CUT); - fSelectionActions.add(ITextEditorActionConstants.COPY); - fSelectionActions.add(ITextEditorActionConstants.PASTE); - - // create context menu - MenuManager manager= new MenuManager(null, null); - manager.setRemoveAllWhenShown(true); - manager.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager mgr) { - fillContextMenu(mgr); - } - }); - - StyledText text= fPatternEditor.getTextWidget(); - Menu menu= manager.createContextMenu(text); - text.setMenu(menu); - } - - protected void fillContextMenu(IMenuManager menu) { - menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_UNDO)); - menu.appendToGroup(ITextEditorActionConstants.GROUP_UNDO, (IAction) fGlobalActions.get(ITextEditorActionConstants.UNDO)); - - menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT)); - menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.CUT)); - menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.COPY)); - menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.PASTE)); - menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, (IAction) fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL)); - - menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE)); - menu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, (IAction) fGlobalActions.get("ContentAssistProposal")); //$NON-NLS-1$ - } - - protected void updateSelectionDependentActions() { - Iterator iterator= fSelectionActions.iterator(); - while (iterator.hasNext()) - updateAction((String)iterator.next()); - } - - protected void updateUndoAction() { - IAction action= (IAction) fGlobalActions.get(ITextEditorActionConstants.UNDO); - if (action instanceof IUpdate) - ((IUpdate) action).update(); - } - - protected void updateAction(String actionId) { - IAction action= (IAction) fGlobalActions.get(actionId); - if (action instanceof IUpdate) - ((IUpdate) action).update(); - } - - private int getIndex(String context) { - ContextTypeRegistry registry= ContextTypeRegistry.getInstance(); - registry.getContextType(context); - - if (context == null) - return -1; - - return fContextTypes.indexOf(context); - } - - protected void okPressed() { - fTemplate.setName(fNameText.getText()); - fTemplate.setDescription(fDescriptionText.getText()); - fTemplate.setContext(fContextCombo.getText()); - fTemplate.setPattern(fPatternEditor.getTextWidget().getText()); - - super.okPressed(); - } - - protected void updateButtons() { - boolean valid= fNameText.getText().trim().length() != 0; - - StatusInfo status= new StatusInfo(); - - if (!valid) { - if (fSuppressError) - status.setError(""); //$NON-NLS-1$ - else - status.setError(TemplateMessages.getString("EditTemplateDialog.error.noname")); //$NON-NLS-1$ - } else if (fTranslator.getErrorMessage() != null) { - status.setError(fTranslator.getErrorMessage()); - } - - updateStatus(status); - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java deleted file mode 100644 index 633c9130a2b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OptionsConfigurationBlock.java +++ /dev/null @@ -1,477 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.preferences; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Widget; - -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; - -import org.eclipse.ui.IEditorInput; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ITranslationUnit; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.internal.ui.util.ExceptionHandler; -import org.eclipse.cdt.internal.ui.util.EditorUtility; -import org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener; - -/** - */ -public abstract class OptionsConfigurationBlock { - - protected static class ControlData { - private String fKey; - private String[] fValues; - - public ControlData(String key, String[] values) { - fKey= key; - fValues= values; - } - - public String getKey() { - return fKey; - } - - public String getValue(boolean selection) { - int index= selection ? 0 : 1; - return fValues[index]; - } - - public String getValue(int index) { - return fValues[index]; - } - - public int getSelection(String value) { - for (int i= 0; i < fValues.length; i++) { - if (value.equals(fValues[i])) { - return i; - } - } - throw new IllegalArgumentException(); - } - } - - - protected Map fWorkingValues; - - protected ArrayList fCheckBoxes; - protected ArrayList fComboBoxes; - protected ArrayList fTextBoxes; - - private SelectionListener fSelectionListener; - private ModifyListener fTextModifyListener; - - protected IStatusChangeListener fContext; - protected ICProject fProject; // project or null - - private Shell fShell; - - public OptionsConfigurationBlock(IStatusChangeListener context, ICProject project) { - fContext= context; - fProject= project; - - fWorkingValues= getOptions(true); - - fCheckBoxes= new ArrayList(); - fComboBoxes= new ArrayList(); - fTextBoxes= new ArrayList(2); - } - - protected abstract String[] getAllKeys(); - - protected Map getOptions(boolean inheritCCoreOptions) { - if (fProject != null) { - return fProject.getOptions(inheritCCoreOptions); - } else { - return CCorePlugin.getOptions(); - } - } - - protected Map getDefaultOptions() { - return CCorePlugin.getDefaultOptions(); - } - - public final boolean hasProjectSpecificOptions() { - if (fProject != null) { - Map settings= fProject.getOptions(false); - String[] allKeys= getAllKeys(); - for (int i= 0; i < allKeys.length; i++) { - if (settings.get(allKeys[i]) != null) { - return true; - } - } - } - return false; - } - - protected final void setOptions(Map map) { - if (fProject != null) { - fProject.setOptions(map); - } else { - CCorePlugin.setOptions((HashMap) map); - } - } - - protected Shell getShell() { - return fShell; - } - - protected void setShell(Shell shell) { - fShell= shell; - } - - protected abstract Control createContents(Composite parent); - - protected void addCheckBox(Composite parent, String label, String key, String[] values, int indent) { - ControlData data= new ControlData(key, values); - - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= 2; - gd.horizontalIndent= indent; - - Button checkBox= new Button(parent, SWT.CHECK); - checkBox.setText(label); - checkBox.setData(data); - checkBox.setLayoutData(gd); - checkBox.addSelectionListener(getSelectionListener()); - - String currValue= (String)fWorkingValues.get(key); - checkBox.setSelection(data.getSelection(currValue) == 0); - - fCheckBoxes.add(checkBox); - } - - protected void addComboBox(Composite parent, String label, String key, String[] values, String[] valueLabels, int indent) { - ControlData data= new ControlData(key, values); - - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); - gd.horizontalIndent= indent; - - Label labelControl= new Label(parent, SWT.LEFT | SWT.WRAP); - labelControl.setText(label); - labelControl.setLayoutData(gd); - - Combo comboBox= new Combo(parent, SWT.READ_ONLY); - comboBox.setItems(valueLabels); - comboBox.setData(data); - comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - comboBox.addSelectionListener(getSelectionListener()); - - String currValue= (String)fWorkingValues.get(key); - comboBox.select(data.getSelection(currValue)); - - fComboBoxes.add(comboBox); - } - - protected Text addTextField(Composite parent, String label, String key, int indent, int widthHint) { - Label labelControl= new Label(parent, SWT.NONE); - labelControl.setText(label); - labelControl.setLayoutData(new GridData()); - - Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE); - textBox.setData(key); - textBox.setLayoutData(new GridData()); - - String currValue= (String) fWorkingValues.get(key); - textBox.setText(currValue); - textBox.addModifyListener(getTextModifyListener()); - - GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - if (widthHint != 0) { - data.widthHint= widthHint; - } - data.horizontalIndent= indent; - textBox.setLayoutData(data); - - fTextBoxes.add(textBox); - return textBox; - } - - protected SelectionListener getSelectionListener() { - if (fSelectionListener == null) { - fSelectionListener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) {} - - public void widgetSelected(SelectionEvent e) { - controlChanged(e.widget); - } - }; - } - return fSelectionListener; - } - - protected ModifyListener getTextModifyListener() { - if (fTextModifyListener == null) { - fTextModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - textChanged((Text) e.widget); - } - }; - } - return fTextModifyListener; - } - - protected void controlChanged(Widget widget) { - ControlData data= (ControlData) widget.getData(); - String newValue= null; - if (widget instanceof Button) { - newValue= data.getValue(((Button)widget).getSelection()); - } else if (widget instanceof Combo) { - newValue= data.getValue(((Combo)widget).getSelectionIndex()); - } else { - return; - } - fWorkingValues.put(data.getKey(), newValue); - - validateSettings(data.getKey(), newValue); - } - - protected void textChanged(Text textControl) { - String key= (String) textControl.getData(); - String number= textControl.getText(); - fWorkingValues.put(key, number); - validateSettings(key, number); - } - - protected boolean checkValue(String key, String value) { - return value.equals(fWorkingValues.get(key)); - } - - /* (non-javadoc) - * Update fields and validate. - * @param changedKey Key that changed, or null, if all changed. - */ - protected abstract void validateSettings(String changedKey, String newValue); - - - protected String[] getTokens(String text, String separator) { - StringTokenizer tok= new StringTokenizer(text, separator); //$NON-NLS-1$ - int nTokens= tok.countTokens(); - String[] res= new String[nTokens]; - for (int i= 0; i < res.length; i++) { - res[i]= tok.nextToken().trim(); - } - return res; - } - - - public boolean performOk(boolean enabled) { - String[] allKeys= getAllKeys(); - Map actualOptions= getOptions(false); - - // preserve other options - boolean hasChanges= false; - for (int i= 0; i < allKeys.length; i++) { - String key= allKeys[i]; - String oldVal= (String) actualOptions.get(key); - String val= null; - if (enabled) { - val= (String) fWorkingValues.get(key); - if (!val.equals(oldVal)) { - hasChanges= true; - actualOptions.put(key, val); - } - } else { - if (oldVal != null) { - actualOptions.remove(key); - hasChanges= true; - } - } - } - - - if (hasChanges) { - boolean doReParse = false; - String[] strings = getFullReParseDialogStrings(fProject == null); - if (strings != null) { - MessageDialog dialog = new MessageDialog(getShell(), strings[0], null, strings[1], MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2); - int res= dialog.open(); - if (res == 0) { - doReParse = true; - } else if (res != 1) { - return false; // cancel pressed - } - } - setOptions(actualOptions); - if (doReParse) { - doFullReParse(); - } - } - return true; - } - - protected abstract String[] getFullBuildDialogStrings(boolean workspaceSettings); - protected abstract String[] getFullReParseDialogStrings(boolean workspaceSettings); - - protected void doFullBuild() { - ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); - try { - dialog.run(true, true, new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException { - monitor.beginTask("", 1); //$NON-NLS-1$ - try { - if (fProject != null) { - monitor.setTaskName(PreferencesMessages.getFormattedString("OptionsConfigurationBlock.buildproject.taskname", fProject.getElementName())); //$NON-NLS-1$ - fProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, new SubProgressMonitor(monitor,1)); - } else { - monitor.setTaskName(PreferencesMessages.getString("OptionsConfigurationBlock.buildall.taskname")); //$NON-NLS-1$ - CUIPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new SubProgressMonitor(monitor,1)); - } - } catch (CoreException e) { - throw new InvocationTargetException(e); - } finally { - monitor.done(); - } - } - }); - } catch (InterruptedException e) { - // cancelled by user - } catch (InvocationTargetException e) { - String title= PreferencesMessages.getString("OptionsConfigurationBlock.builderror.title"); //$NON-NLS-1$ - String message= PreferencesMessages.getString("OptionsConfigurationBlock.builderror.message"); //$NON-NLS-1$ - ExceptionHandler.handle(e, getShell(), title, message); - } - } - - protected void doFullReParse() { - ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); - try { - dialog.run(true, true, new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException { - monitor.beginTask("", 1); //$NON-NLS-1$ - - if (fProject != null) { - monitor.setTaskName(PreferencesMessages.getFormattedString("OptionsConfigurationBlock.parseproject.taskname", fProject.getElementName())); //$NON-NLS-1$ - reParseHierarchy(fProject.getResource(), monitor); - } else { - monitor.setTaskName(PreferencesMessages.getString("OptionsConfigurationBlock.parseall.taskname")); //$NON-NLS-1$ - reParseHierarchy(CUIPlugin.getWorkspace().getRoot(), monitor); - } - - monitor.done(); - } - }); - } catch (InterruptedException e) { - // cancelled by user - } catch (InvocationTargetException e) { - String title= PreferencesMessages.getString("OptionsConfigurationBlock.parseerror.title"); //$NON-NLS-1$ - String message= PreferencesMessages.getString("OptionsConfigurationBlock.parseerror.message"); //$NON-NLS-1$ - ExceptionHandler.handle(e, getShell(), title, message); - } - } - - protected void reParseHierarchy(IResource root, final IProgressMonitor monitor) { - try { - root.accept( - new IResourceProxyVisitor() { - public boolean visit(IResourceProxy proxy) { - switch(proxy.getType()) { - case IResource.FILE : - IFile file = (IFile)proxy.requestResource(); - CoreModel cModel = CCorePlugin.getDefault().getCoreModel(); - - if (cModel.isTranslationUnit(file)) { - ITranslationUnit translationUnit = (ITranslationUnit)cModel.create(file); - - try { - IEditorInput input = EditorUtility.getEditorInput(file); - if (input != null) { - ITranslationUnit workingCopy = CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(input); - if (workingCopy != null) { - // We have a copy in an editor - use it - translationUnit = workingCopy; - } - } - - translationUnit.makeConsistent(monitor, true /*forced*/); - } catch (CModelException e) { - } - } - - return false; // Do not look into file's structure - } - - return true; - } - } - , IResource.NONE); - } catch (CoreException e) { - } - } - - public void performDefaults() { - fWorkingValues= getDefaultOptions(); - updateControls(); - validateSettings(null, null); - } - - protected void updateControls() { - // update the UI - for (int i= fCheckBoxes.size() - 1; i >= 0; i--) { - Button curr= (Button) fCheckBoxes.get(i); - ControlData data= (ControlData) curr.getData(); - - String currValue= (String) fWorkingValues.get(data.getKey()); - curr.setSelection(data.getSelection(currValue) == 0); - } - for (int i= fComboBoxes.size() - 1; i >= 0; i--) { - Combo curr= (Combo) fComboBoxes.get(i); - ControlData data= (ControlData) curr.getData(); - - String currValue= (String) fWorkingValues.get(data.getKey()); - curr.select(data.getSelection(currValue)); - } - for (int i= fTextBoxes.size() - 1; i >= 0; i--) { - Text curr= (Text) fTextBoxes.get(i); - String key= (String) curr.getData(); - - String currValue= (String) fWorkingValues.get(key); - curr.setText(currValue); - } - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OverlayPreferenceStore.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OverlayPreferenceStore.java deleted file mode 100644 index 093c549d997..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/OverlayPreferenceStore.java +++ /dev/null @@ -1,447 +0,0 @@ -package org.eclipse.cdt.internal.ui.preferences; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceStore; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - -/** - * An overlaying preference store. - */ -public class OverlayPreferenceStore implements IPreferenceStore { - - - public static final class TypeDescriptor { - protected TypeDescriptor() { - } - }; - - public static final TypeDescriptor BOOLEAN= new TypeDescriptor(); - public static final TypeDescriptor DOUBLE= new TypeDescriptor(); - public static final TypeDescriptor FLOAT= new TypeDescriptor(); - public static final TypeDescriptor INT= new TypeDescriptor(); - public static final TypeDescriptor LONG= new TypeDescriptor(); - public static final TypeDescriptor STRING= new TypeDescriptor(); - - public static class OverlayKey { - - TypeDescriptor fDescriptor; - String fKey; - - public OverlayKey(TypeDescriptor descriptor, String key) { - fDescriptor= descriptor; - fKey= key; - } - }; - - private class PropertyListener implements IPropertyChangeListener { - - /* - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent event) { - OverlayKey key= findOverlayKey(event.getProperty()); - if (key != null) - propagateProperty(fParent, key, fStore); - } - }; - - - protected IPreferenceStore fParent; - protected IPreferenceStore fStore; - private OverlayKey[] fOverlayKeys; - - private PropertyListener fPropertyListener; - - - public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey[] overlayKeys) { - fParent= parent; - fOverlayKeys= overlayKeys; - fStore= new PreferenceStore(); - } - - protected OverlayKey findOverlayKey(String key) { - for (int i= 0; i < fOverlayKeys.length; i++) { - if (fOverlayKeys[i].fKey.equals(key)) - return fOverlayKeys[i]; - } - return null; - } - - private boolean covers(String key) { - return (findOverlayKey(key) != null); - } - - protected void propagateProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target) { - - if (orgin.isDefault(key.fKey)) { - if (!target.isDefault(key.fKey)) - target.setToDefault(key.fKey); - return; - } - - TypeDescriptor d= key.fDescriptor; - if (BOOLEAN == d) { - - boolean originValue= orgin.getBoolean(key.fKey); - boolean targetValue= target.getBoolean(key.fKey); - if (targetValue != originValue) - target.setValue(key.fKey, originValue); - - } else if (DOUBLE == d) { - - double originValue= orgin.getDouble(key.fKey); - double targetValue= target.getDouble(key.fKey); - if (targetValue != originValue) - target.setValue(key.fKey, originValue); - - } else if (FLOAT == d) { - - float originValue= orgin.getFloat(key.fKey); - float targetValue= target.getFloat(key.fKey); - if (targetValue != originValue) - target.setValue(key.fKey, originValue); - - } else if (INT == d) { - - int originValue= orgin.getInt(key.fKey); - int targetValue= target.getInt(key.fKey); - if (targetValue != originValue) - target.setValue(key.fKey, originValue); - - } else if (LONG == d) { - - long originValue= orgin.getLong(key.fKey); - long targetValue= target.getLong(key.fKey); - if (targetValue != originValue) - target.setValue(key.fKey, originValue); - - } else if (STRING == d) { - - String originValue= orgin.getString(key.fKey); - String targetValue= target.getString(key.fKey); - if (targetValue != null && originValue != null && !targetValue.equals(originValue)) - target.setValue(key.fKey, originValue); - - } - } - - public void propagate() { - for (int i= 0; i < fOverlayKeys.length; i++) - propagateProperty(fStore, fOverlayKeys[i], fParent); - } - - private void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target, boolean forceInitialization) { - TypeDescriptor d= key.fDescriptor; - if (BOOLEAN == d) { - - if (forceInitialization) - target.setValue(key.fKey, true); - target.setValue(key.fKey, orgin.getBoolean(key.fKey)); - target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey)); - - } else if (DOUBLE == d) { - - if (forceInitialization) - target.setValue(key.fKey, 1.0D); - target.setValue(key.fKey, orgin.getDouble(key.fKey)); - target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey)); - - } else if (FLOAT == d) { - - if (forceInitialization) - target.setValue(key.fKey, 1.0F); - target.setValue(key.fKey, orgin.getFloat(key.fKey)); - target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey)); - - } else if (INT == d) { - - if (forceInitialization) - target.setValue(key.fKey, 1); - target.setValue(key.fKey, orgin.getInt(key.fKey)); - target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey)); - - } else if (LONG == d) { - - if (forceInitialization) - target.setValue(key.fKey, 1L); - target.setValue(key.fKey, orgin.getLong(key.fKey)); - target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey)); - - } else if (STRING == d) { - - if (forceInitialization) - target.setValue(key.fKey, "1"); - target.setValue(key.fKey, orgin.getString(key.fKey)); - target.setDefault(key.fKey, orgin.getDefaultString(key.fKey)); - - } - } - - public void load() { - for (int i= 0; i < fOverlayKeys.length; i++) - loadProperty(fParent, fOverlayKeys[i], fStore, true); - } - - public void loadDefaults() { - for (int i= 0; i < fOverlayKeys.length; i++) - setToDefault(fOverlayKeys[i].fKey); - } - - public void start() { - if (fPropertyListener == null) { - fPropertyListener= new PropertyListener(); - fParent.addPropertyChangeListener(fPropertyListener); - } - } - - public void stop() { - if (fPropertyListener != null) { - fParent.removePropertyChangeListener(fPropertyListener); - fPropertyListener= null; - } - } - - /* - * @see IPreferenceStore#addPropertyChangeListener(IPropertyChangeListener) - */ - public void addPropertyChangeListener(IPropertyChangeListener listener) { - fStore.addPropertyChangeListener(listener); - } - - /* - * @see IPreferenceStore#removePropertyChangeListener(IPropertyChangeListener) - */ - public void removePropertyChangeListener(IPropertyChangeListener listener) { - fStore.removePropertyChangeListener(listener); - } - - /* - * @see IPreferenceStore#firePropertyChangeEvent(String, Object, Object) - */ - public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { - fStore.firePropertyChangeEvent(name, oldValue, newValue); - } - - /* - * @see IPreferenceStore#contains(String) - */ - public boolean contains(String name) { - return fStore.contains(name); - } - - /* - * @see IPreferenceStore#getBoolean(String) - */ - public boolean getBoolean(String name) { - return fStore.getBoolean(name); - } - - /* - * @see IPreferenceStore#getDefaultBoolean(String) - */ - public boolean getDefaultBoolean(String name) { - return fStore.getDefaultBoolean(name); - } - - /* - * @see IPreferenceStore#getDefaultDouble(String) - */ - public double getDefaultDouble(String name) { - return fStore.getDefaultDouble(name); - } - - /* - * @see IPreferenceStore#getDefaultFloat(String) - */ - public float getDefaultFloat(String name) { - return fStore.getDefaultFloat(name); - } - - /* - * @see IPreferenceStore#getDefaultInt(String) - */ - public int getDefaultInt(String name) { - return fStore.getDefaultInt(name); - } - - /* - * @see IPreferenceStore#getDefaultLong(String) - */ - public long getDefaultLong(String name) { - return fStore.getDefaultLong(name); - } - - /* - * @see IPreferenceStore#getDefaultString(String) - */ - public String getDefaultString(String name) { - return fStore.getDefaultString(name); - } - - /* - * @see IPreferenceStore#getDouble(String) - */ - public double getDouble(String name) { - return fStore.getDouble(name); - } - - /* - * @see IPreferenceStore#getFloat(String) - */ - public float getFloat(String name) { - return fStore.getFloat(name); - } - - /* - * @see IPreferenceStore#getInt(String) - */ - public int getInt(String name) { - return fStore.getInt(name); - } - - /* - * @see IPreferenceStore#getLong(String) - */ - public long getLong(String name) { - return fStore.getLong(name); - } - - /* - * @see IPreferenceStore#getString(String) - */ - public String getString(String name) { - return fStore.getString(name); - } - - /* - * @see IPreferenceStore#isDefault(String) - */ - public boolean isDefault(String name) { - return fStore.isDefault(name); - } - - /* - * @see IPreferenceStore#needsSaving() - */ - public boolean needsSaving() { - return fStore.needsSaving(); - } - - /* - * @see IPreferenceStore#putValue(String, String) - */ - public void putValue(String name, String value) { - if (covers(name)) - fStore.putValue(name, value); - } - - /* - * @see IPreferenceStore#setDefault(String, double) - */ - public void setDefault(String name, double value) { - if (covers(name)) - fStore.setDefault(name, value); - } - - /* - * @see IPreferenceStore#setDefault(String, float) - */ - public void setDefault(String name, float value) { - if (covers(name)) - fStore.setDefault(name, value); - } - - /* - * @see IPreferenceStore#setDefault(String, int) - */ - public void setDefault(String name, int value) { - if (covers(name)) - fStore.setDefault(name, value); - } - - /* - * @see IPreferenceStore#setDefault(String, long) - */ - public void setDefault(String name, long value) { - if (covers(name)) - fStore.setDefault(name, value); - } - - /* - * @see IPreferenceStore#setDefault(String, String) - */ - public void setDefault(String name, String value) { - if (covers(name)) - fStore.setDefault(name, value); - } - - /* - * @see IPreferenceStore#setDefault(String, boolean) - */ - public void setDefault(String name, boolean value) { - if (covers(name)) - fStore.setDefault(name, value); - } - - /* - * @see IPreferenceStore#setToDefault(String) - */ - public void setToDefault(String name) { - fStore.setToDefault(name); - } - - /* - * @see IPreferenceStore#setValue(String, double) - */ - public void setValue(String name, double value) { - if (covers(name)) - fStore.setValue(name, value); - } - - /* - * @see IPreferenceStore#setValue(String, float) - */ - public void setValue(String name, float value) { - if (covers(name)) - fStore.setValue(name, value); - } - - /* - * @see IPreferenceStore#setValue(String, int) - */ - public void setValue(String name, int value) { - if (covers(name)) - fStore.setValue(name, value); - } - - /* - * @see IPreferenceStore#setValue(String, long) - */ - public void setValue(String name, long value) { - if (covers(name)) - fStore.setValue(name, value); - } - - /* - * @see IPreferenceStore#setValue(String, String) - */ - public void setValue(String name, String value) { - if (covers(name)) - fStore.setValue(name, value); - } - - /* - * @see IPreferenceStore#setValue(String, boolean) - */ - public void setValue(String name, boolean value) { - if (covers(name)) - fStore.setValue(name, value); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java deleted file mode 100644 index 5910c5af1c6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.preferences; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class PreferencesMessages { - - private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.preferences.PreferencesMessages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private PreferencesMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - public static String getFormattedString(String key, String arg) { - return getFormattedString(key, new String[] { arg }); - } - - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(getString(key), args); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties deleted file mode 100644 index 646204593c4..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties +++ /dev/null @@ -1,86 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -OptionsConfigurationBlock.builderror.title=Preference Changes -OptionsConfigurationBlock.builderror.message=Problem while building. Check log for details. - -OptionsConfigurationBlock.buildall.taskname=Build all... -OptionsConfigurationBlock.buildproject.taskname=Build project ''{0}''... - - -OptionsConfigurationBlock.parseerror.title=Preference Changes -OptionsConfigurationBlock.parseerror.message=Problem while parsing. Check log for details. - -OptionsConfigurationBlock.parseall.taskname=Parse all... -OptionsConfigurationBlock.parseproject.taskname=Parse project ''{0}''... - - -TodoTaskPreferencePage.title=Task Tags - -TodoTaskPropertyPage.useworkspacesettings.label=Use &workspace settings -TodoTaskPropertyPage.useworkspacesettings.change=&Configure Workspace Settings... -TodoTaskPropertyPage.useprojectsettings.label=Use pr&oject settings - -TodoTaskConfigurationBlock.markers.tasks.high.priority=High -TodoTaskConfigurationBlock.markers.tasks.normal.priority=Normal -TodoTaskConfigurationBlock.markers.tasks.low.priority=Low -TodoTaskConfigurationBlock.markers.tasks.label=&Strings indicating tasks in Java comments: -TodoTaskConfigurationBlock.markers.tasks.add.button=Ne&w... -TodoTaskConfigurationBlock.markers.tasks.remove.button=Remo&ve -TodoTaskConfigurationBlock.markers.tasks.edit.button=Edi&t... -TodoTaskConfigurationBlock.markers.tasks.name.column=Tag -TodoTaskConfigurationBlock.markers.tasks.priority.column=Priority - -TodoTaskConfigurationBlock.needsbuild.title=Task Tags Settings Changed -TodoTaskConfigurationBlock.needsfullbuild.message=The task tags settings have changed. A full rebuild is required to make changes effective. Do the full build now? -TodoTaskConfigurationBlock.needsprojectbuild.message=The task tags settings have changed. A rebuild of the project is required to make changes effective. Do the project build now? - -TodoTaskConfigurationBlock.needsparse.title=Task Tags Settings Changed -TodoTaskConfigurationBlock.needsfullparse.message=The task tags settings have changed. A full re-parse is required to make changes effective. Do the full re-parse now? -TodoTaskConfigurationBlock.needsprojectparse.message=The task tags settings have changed. Re-parsing of the project is required to make changes effective. Do the project re-parse now? - -TodoTaskInputDialog.new.title=New Task Tag -TodoTaskInputDialog.edit.title=Edit Task Tag -TodoTaskInputDialog.name.label=T&ag: -TodoTaskInputDialog.priority.label=&Priority: -TodoTaskInputDialog.priority.high=High -TodoTaskInputDialog.priority.normal=Normal -TodoTaskInputDialog.priority.low=Low -TodoTaskInputDialog.error.enterName=Enter task tag name. -TodoTaskInputDialog.error.comma=Name cannot contain a comma. -TodoTaskInputDialog.error.entryExists=Entry with the same name already exists. -TodoTaskInputDialog.error.noSpace=Name can not start or end with a whitespace. - -CEditorPreferencePage.cCommentTaskTags=Task Tags - -CEditorPreferencePage.generalTabTitle=&General -CEditorPreferencePage.annotationTabTitle= &Annotations -CEditorPreferencePage.colorsTabTitle=&Colors -CEditorPreferencePage.contentAssistTabTitle=Content A&ssist - -CEditorPreferencePage.invalid_input=Invalid input. -CEditorPreferencePage.empty_input=Empty input - -CEditorPreferencePage.ContentAssistPage.searchGroupTitle=Search scope for completion proposals: -CEditorPreferencePage.ContentAssistPage.searchGroupCurrentFileOption=&Search current file and included files -CEditorPreferencePage.ContentAssistPage.searchGroupCurrentProjectOption=Search current &project -CEditorPreferencePage.ContentAssistPage.searchGroupCurrentProjectAndDependenciesOption=Search current project and &dependent projects -CEditorPreferencePage.ContentAssistPage.insertSingleProposalAutomatically=Insert single &proposals automatically -CEditorPreferencePage.ContentAssistPage.showOnlyProposalsWithCorrectVisibility=Show only proposals visible in the invocation conte&xt -CEditorPreferencePage.ContentAssistPage.showProposalsInAlphabeticalOrder=Present proposals in a&lphabetical order -CEditorPreferencePage.ContentAssistPage.autoActivationGroupTitle=Auto activation: -CEditorPreferencePage.ContentAssistPage.autoActivationEnableDot=Enable . as trigger -CEditorPreferencePage.ContentAssistPage.autoActivationEnableArrow=Enable -> as trigger -CEditorPreferencePage.ContentAssistPage.autoActivationDelay=dela&y (in milli seconds) -CEditorPreferencePage.ContentAssistPage.completionProposalBackgroundColor=&Background for completion proposals: -CEditorPreferencePage.ContentAssistPage.completionProposalForegroundColor=&Foreground for completion proposals: -CEditorPreferencePage.ContentAssistPage.parameterBackgroundColor=Bac&kground for method parameters: -CEditorPreferencePage.ContentAssistPage.parameterForegroundColor=Fo®round for method parameters: \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java deleted file mode 100644 index 6edbbb0587b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TemplatePreferencePage.java +++ /dev/null @@ -1,591 +0,0 @@ -package org.eclipse.cdt.internal.ui.preferences; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.ContextTypeRegistry; -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.corext.template.Template; -import org.eclipse.cdt.internal.corext.template.TemplateMessages; -import org.eclipse.cdt.internal.corext.template.TemplateSet; -import org.eclipse.cdt.internal.corext.template.Templates; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.text.CSourceViewerConfiguration; -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.internal.ui.text.template.TemplateContentProvider; -import org.eclipse.cdt.internal.ui.text.template.TemplateLabelProvider; -import org.eclipse.cdt.internal.ui.util.SWTUtil; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - - -public class TemplatePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - - // preference store keys - private static final String PREF_FORMAT_TEMPLATES= CUIPlugin.PLUGIN_ID + ".template.format"; //$NON-NLS-1$ - - private Templates fTemplates; - - private CheckboxTableViewer fTableViewer; - private Button fAddButton; - private Button fEditButton; - private Button fImportButton; - private Button fExportButton; - private Button fExportAllButton; - private Button fRemoveButton; - private Button fEnableAllButton; - private Button fDisableAllButton; - - private SourceViewer fPatternViewer; - //private Button fFormatButton; - - public TemplatePreferencePage() { - super(); - - setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); - setDescription(TemplateMessages.getString("TemplatePreferencePage.message")); //$NON-NLS-1$ - - fTemplates= Templates.getInstance(); - } - - /** - * @see PreferencePage#createContents(Composite) - */ - protected Control createContents(Composite ancestor) { - Composite parent= new Composite(ancestor, SWT.NONE); - GridLayout layout= new GridLayout(); - layout.numColumns= 2; - layout.marginHeight= 0; - layout.marginWidth= 0; - parent.setLayout(layout); - - Table table= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION); - - GridData data= new GridData(GridData.FILL_BOTH); - data.widthHint= convertWidthInCharsToPixels(80); - data.heightHint= convertHeightInCharsToPixels(10); - table.setLayoutData(data); - - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableLayout tableLayout= new TableLayout(); - table.setLayout(tableLayout); - - TableColumn column1= new TableColumn(table, SWT.NONE); - column1.setText(TemplateMessages.getString("TemplatePreferencePage.column.name")); //$NON-NLS-1$ - - TableColumn column2= new TableColumn(table, SWT.NONE); - column2.setText(TemplateMessages.getString("TemplatePreferencePage.column.context")); //$NON-NLS-1$ - - TableColumn column3= new TableColumn(table, SWT.NONE); - column3.setText(TemplateMessages.getString("TemplatePreferencePage.column.description")); //$NON-NLS-1$ - - tableLayout.addColumnData(new ColumnWeightData(30)); - tableLayout.addColumnData(new ColumnWeightData(20)); - tableLayout.addColumnData(new ColumnWeightData(70)); - - fTableViewer= new CheckboxTableViewer(table); - fTableViewer.setLabelProvider(new TemplateLabelProvider()); - fTableViewer.setContentProvider(new TemplateContentProvider()); - - fTableViewer.setSorter(new ViewerSorter() { - public int compare(Viewer viewer, Object object1, Object object2) { - if ((object1 instanceof Template) && (object2 instanceof Template)) { - Template left= (Template) object1; - Template right= (Template) object2; - int result= left.getName().compareToIgnoreCase(right.getName()); - if (result != 0) - return result; - return left.getDescription().compareToIgnoreCase(right.getDescription()); - } - return super.compare(viewer, object1, object2); - } - - public boolean isSorterProperty(Object element, String property) { - return true; - } - }); - - fTableViewer.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent e) { - edit(); - } - }); - - fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - selectionChanged1(); - } - }); - - fTableViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent event) { - Template template= (Template) event.getElement(); - template.setEnabled(event.getChecked()); - } - }); - - Composite buttons= new Composite(parent, SWT.NULL); - buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); - layout= new GridLayout(); - layout.marginHeight= 0; - layout.marginWidth= 0; - buttons.setLayout(layout); - - fAddButton= new Button(buttons, SWT.PUSH); - fAddButton.setLayoutData(getButtonGridData(fAddButton)); - fAddButton.setText(TemplateMessages.getString("TemplatePreferencePage.new")); //$NON-NLS-1$ - fAddButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - add(); - } - }); - - fEditButton= new Button(buttons, SWT.PUSH); - fEditButton.setLayoutData(getButtonGridData(fEditButton)); - fEditButton.setText(TemplateMessages.getString("TemplatePreferencePage.edit")); //$NON-NLS-1$ - fEditButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - edit(); - } - }); - - fRemoveButton= new Button(buttons, SWT.PUSH); - fRemoveButton.setLayoutData(getButtonGridData(fRemoveButton)); - fRemoveButton.setText(TemplateMessages.getString("TemplatePreferencePage.remove")); //$NON-NLS-1$ - fRemoveButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - remove(); - } - }); - - createSpacer(buttons); - - fImportButton= new Button(buttons, SWT.PUSH); - fImportButton.setLayoutData(getButtonGridData(fImportButton)); - fImportButton.setText(TemplateMessages.getString("TemplatePreferencePage.import")); //$NON-NLS-1$ - fImportButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - import_(); - } - }); - - fExportButton= new Button(buttons, SWT.PUSH); - fExportButton.setLayoutData(getButtonGridData(fExportButton)); - fExportButton.setText(TemplateMessages.getString("TemplatePreferencePage.export")); //$NON-NLS-1$ - fExportButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - export(); - } - }); - - fExportAllButton= new Button(buttons, SWT.PUSH); - fExportAllButton.setLayoutData(getButtonGridData(fExportAllButton)); - fExportAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.export.all")); //$NON-NLS-1$ - fExportAllButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - exportAll(); - } - }); - - createSpacer(buttons); - - fEnableAllButton= new Button(buttons, SWT.PUSH); - fEnableAllButton.setLayoutData(getButtonGridData(fEnableAllButton)); - fEnableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.enable.all")); //$NON-NLS-1$ - fEnableAllButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - enableAll(true); - } - }); - - fDisableAllButton= new Button(buttons, SWT.PUSH); - fDisableAllButton.setLayoutData(getButtonGridData(fDisableAllButton)); - fDisableAllButton.setText(TemplateMessages.getString("TemplatePreferencePage.disable.all")); //$NON-NLS-1$ - fDisableAllButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - enableAll(false); - } - }); - - fPatternViewer= createViewer(parent); - - createSpacer(parent); - - //fFormatButton= new Button(parent, SWT.CHECK); - //fFormatButton.setText(TemplateMessages.getString("TemplatePreferencePage.use.code.formatter")); //$NON-NLS-1$ - - fTableViewer.setInput(fTemplates); - fTableViewer.setAllChecked(false); - fTableViewer.setCheckedElements(getEnabledTemplates()); - - //IPreferenceStore prefs= CUIPlugin.getDefault().getPreferenceStore(); - //fFormatButton.setSelection(prefs.getBoolean(PREF_FORMAT_TEMPLATES)); - - updateButtons(); - - WorkbenchHelp.setHelp(parent, ICHelpContextIds.TEMPLATE_PREFERENCE_PAGE); - - return parent; - } - - private Template[] getEnabledTemplates() { - Template[] templates= fTemplates.getTemplates(); - - List list= new ArrayList(templates.length); - - for (int i= 0; i != templates.length; i++) - if (templates[i].isEnabled()) - list.add(templates[i]); - - return (Template[]) list.toArray(new Template[list.size()]); - } - - private SourceViewer createViewer(Composite parent) { - Label label= new Label(parent, SWT.NONE); - label.setText("Preview:"); - GridData data= new GridData(); - data.horizontalSpan= 2; - label.setLayoutData(data); - - SourceViewer viewer= new SourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - CTextTools tools= CUIPlugin.getDefault().getTextTools(); - viewer.configure(new CSourceViewerConfiguration(tools, null)); - viewer.setEditable(false); - viewer.setDocument(new Document()); - viewer.getTextWidget().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); - - Font font= JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT); - viewer.getTextWidget().setFont(font); - - Control control= viewer.getControl(); - data= new GridData(GridData.FILL_BOTH); - data.heightHint= convertHeightInCharsToPixels(5); - control.setLayoutData(data); - - return viewer; - } - - public void createSpacer(Composite parent) { - Label spacer= new Label(parent, SWT.NONE); - GridData data= new GridData(); - data.horizontalAlignment= GridData.FILL; - data.verticalAlignment= GridData.BEGINNING; - data.heightHint= 4; - spacer.setLayoutData(data); - } - - private static GridData getButtonGridData(Button button) { - GridData data= new GridData(GridData.FILL_HORIZONTAL); - data.widthHint= SWTUtil.getButtonWidthHint(button); - data.heightHint= SWTUtil.getButtonHeigthHint(button); - - return data; - } - - protected void selectionChanged1() { - IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); - - if (selection.size() == 1) { - Template template= (Template) selection.getFirstElement(); - fPatternViewer.getTextWidget().setText(template.getPattern()); - } else { - fPatternViewer.getTextWidget().setText(""); //$NON-NLS-1$ - } - - updateButtons(); - } - - private void updateButtons() { - int selectionCount= ((IStructuredSelection) fTableViewer.getSelection()).size(); - int itemCount= fTableViewer.getTable().getItemCount(); - - fEditButton.setEnabled(selectionCount == 1); - fExportButton.setEnabled(selectionCount > 0); - fRemoveButton.setEnabled(selectionCount > 0 && selectionCount <= itemCount); - fEnableAllButton.setEnabled(itemCount > 0); - fDisableAllButton.setEnabled(itemCount > 0); - } - - protected void add() { - - Template template= new Template(); - - ContextTypeRegistry registry=ContextTypeRegistry.getInstance(); - ContextType type= registry.getContextType(ITemplateEditor.TemplateContextKind.C_GLOBAL_CONTEXT_TYPE); - - String contextTypeName; - if (type != null) - contextTypeName= type.getName(); - else { - Iterator iterator= registry.iterator(); - contextTypeName= (String) iterator.next(); - } - template.setContext(contextTypeName); //$NON-NLS-1$ - - EditTemplateDialog dialog= new EditTemplateDialog(getShell(), template, false); - if (dialog.open() == Window.OK) { - fTemplates.add(template); - fTableViewer.refresh(); - fTableViewer.setChecked(template, template.isEnabled()); - fTableViewer.setSelection(new StructuredSelection(template)); - } - } - - protected void edit() { - IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); - - Object[] objects= selection.toArray(); - if ((objects == null) || (objects.length != 1)) - return; - - Template template= (Template) selection.getFirstElement(); - edit(template); - } - - private void edit(Template template) { - Template newTemplate= new Template(template); - EditTemplateDialog dialog= new EditTemplateDialog(getShell(), newTemplate, true); - if (dialog.open() == Window.OK) { - - if (!newTemplate.getName().equals(template.getName()) && - MessageDialog.openQuestion(getShell(), - TemplateMessages.getString("TemplatePreferencePage.question.create.new.title"), - TemplateMessages.getString("TemplatePreferencePage.question.create.new.message"))) - { - template= newTemplate; - fTemplates.add(template); - fTableViewer.refresh(); - } else { - template.setName(newTemplate.getName()); - template.setDescription(newTemplate.getDescription()); - template.setContext(newTemplate.getContextTypeName()); - template.setPattern(newTemplate.getPattern()); - fTableViewer.refresh(template); - } - fTableViewer.setChecked(template, template.isEnabled()); - fTableViewer.setSelection(new StructuredSelection(template)); - } - } - - protected void import_() { - FileDialog dialog= new FileDialog(getShell()); - dialog.setText(TemplateMessages.getString("TemplatePreferencePage.import.title")); //$NON-NLS-1$ - dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.import.extension")}); //$NON-NLS-1$ - String path= dialog.open(); - - if (path == null) - return; - - try { - fTemplates.addFromFile(new File(path)); - - fTableViewer.refresh(); - fTableViewer.setAllChecked(false); - fTableViewer.setCheckedElements(getEnabledTemplates()); - - } catch (CoreException e) { - openReadErrorDialog(e); - } - } - - protected void exportAll() { - export(fTemplates); - } - - protected void export() { - IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); - Object[] templates= selection.toArray(); - - TemplateSet templateSet= new TemplateSet(); - for (int i= 0; i != templates.length; i++) - templateSet.add((Template) templates[i]); - - export(templateSet); - } - - private void export(TemplateSet templateSet) { - FileDialog dialog= new FileDialog(getShell(), SWT.SAVE); - dialog.setText(TemplateMessages.getFormattedString("TemplatePreferencePage.export.title", new Integer(templateSet.getTemplates().length))); //$NON-NLS-1$ - dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.export.extension")}); //$NON-NLS-1$ - dialog.setFileName(TemplateMessages.getString("TemplatePreferencePage.export.filename")); //$NON-NLS-1$ - String path= dialog.open(); - - if (path == null) - return; - - File file= new File(path); - - if (!file.exists() || confirmOverwrite(file)) { - try { - templateSet.saveToFile(file); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - openWriteErrorDialog(e); - } - } - } - - private boolean confirmOverwrite(File file) { - return MessageDialog.openQuestion(getShell(), - TemplateMessages.getString("TemplatePreferencePage.export.exists.title"), - TemplateMessages.getFormattedString("TemplatePreferencePage.export.exists.message", file.getAbsolutePath())); - } - - protected void remove() { - IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection(); - - Iterator elements= selection.iterator(); - while (elements.hasNext()) { - Template template= (Template) elements.next(); - fTemplates.remove(template); - } - - fTableViewer.refresh(); - } - - protected void enableAll(boolean enable) { - Template[] templates= fTemplates.getTemplates(); - for (int i= 0; i != templates.length; i++) - templates[i].setEnabled(enable); - - fTableViewer.setAllChecked(enable); - } - - /* - * @see IWorkbenchPreferencePage#init(IWorkbench) - */ - public void init(IWorkbench workbench) {} - - /* - * @see Control#setVisible(boolean) - */ - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) - setTitle(TemplateMessages.getString("TemplatePreferencePage.title")); //$NON-NLS-1$ - } - - /* - * @see PreferencePage#performDefaults() - */ - protected void performDefaults() { - //IPreferenceStore prefs= CUIPlugin.getDefault().getPreferenceStore(); - //fFormatButton.setSelection(prefs.getDefaultBoolean(PREF_FORMAT_TEMPLATES)); - - try { - fTemplates.restoreDefaults(); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - openReadErrorDialog(e); - } - - // refresh - fTableViewer.refresh(); - fTableViewer.setAllChecked(false); - fTableViewer.setCheckedElements(getEnabledTemplates()); - } - - /* - * @see PreferencePage#performOk() - */ - public boolean performOk() { - //IPreferenceStore prefs= CUIPlugin.getDefault().getPreferenceStore(); - //prefs.setValue(PREF_FORMAT_TEMPLATES, fFormatButton.getSelection()); - - try { - fTemplates.save(); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - openWriteErrorDialog(e); - } - - return super.performOk(); - } - - /* - * @see PreferencePage#performCancel() - */ - public boolean performCancel() { - try { - fTemplates.reset(); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - openReadErrorDialog(e); - } - - return super.performCancel(); - } - - /** - * Initializes the default values of this page in the preference bundle. - * Will be called on startup of the JavaPlugin - */ - public static void initDefaults(IPreferenceStore prefs) { - prefs.setDefault(PREF_FORMAT_TEMPLATES, true); - } - - public static boolean useCodeFormatter() { - IPreferenceStore prefs= CUIPlugin.getDefault().getPreferenceStore(); - return prefs.getBoolean(PREF_FORMAT_TEMPLATES); - } - - private void openReadErrorDialog(CoreException e) { - ErrorDialog.openError(getShell(), - TemplateMessages.getString("TemplatePreferencePage.error.read.title"), //$NON-NLS-1$ - null, e.getStatus()); - } - - private void openWriteErrorDialog(CoreException e) { - ErrorDialog.openError(getShell(), - TemplateMessages.getString("TemplatePreferencePage.error.write.title"), //$NON-NLS-1$ - null, e.getStatus()); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java deleted file mode 100644 index 81ca19108ee..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskConfigurationBlock.java +++ /dev/null @@ -1,305 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.preferences; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Table; - -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.ICProject; - -import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.util.PixelConverter; -import org.eclipse.cdt.internal.ui.util.SWTUtil; -import org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IListAdapter; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField; - -/** - */ -public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock { - - private static final String PREF_TRANSLATION_TASK_TAGS= CCorePlugin.TRANSLATION_TASK_TAGS; - private static final String PREF_TRANSLATION_TASK_PRIORITIES= CCorePlugin.TRANSLATION_TASK_PRIORITIES; - - private static final String PRIORITY_HIGH= CCorePlugin.TRANSLATION_TASK_PRIORITY_HIGH; - private static final String PRIORITY_NORMAL= CCorePlugin.TRANSLATION_TASK_PRIORITY_NORMAL; - private static final String PRIORITY_LOW= CCorePlugin.TRANSLATION_TASK_PRIORITY_LOW; - - public static class TodoTask { - public String name; - public String priority; - } - - private static class TodoTaskLabelProvider extends LabelProvider implements ITableLabelProvider { - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) - */ - public Image getImage(Object element) { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) - */ - public String getText(Object element) { - return getColumnText(element, 0); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) - */ - public Image getColumnImage(Object element, int columnIndex) { - return null; - } - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) - */ - public String getColumnText(Object element, int columnIndex) { - TodoTask task= (TodoTask) element; - if (columnIndex == 0) { - return task.name; - } else { - if (PRIORITY_HIGH.equals(task.priority)) { - return PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.high.priority"); //$NON-NLS-1$ - } else if (PRIORITY_NORMAL.equals(task.priority)) { - return PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.normal.priority"); //$NON-NLS-1$ - } else if (PRIORITY_LOW.equals(task.priority)) { - return PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.low.priority"); //$NON-NLS-1$ - } - return ""; //$NON-NLS-1$ - } - } - - } - - private PixelConverter fPixelConverter; - - private IStatus fTaskTagsStatus; - private ListDialogField fTodoTasksList; - - public TodoTaskConfigurationBlock(IStatusChangeListener context, ICProject project) { - super(context, project); - - TaskTagAdapter adapter= new TaskTagAdapter(); - String[] buttons= new String[] { - /* 0 */ PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.add.button"), //$NON-NLS-1$ - /* 1 */ PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.remove.button"), //$NON-NLS-1$ - null, - /* 3 */ PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.edit.button"), //$NON-NLS-1$ - }; - fTodoTasksList= new ListDialogField(adapter, buttons, new TodoTaskLabelProvider()); - fTodoTasksList.setDialogFieldListener(adapter); - fTodoTasksList.setLabelText(PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.label")); //$NON-NLS-1$ - fTodoTasksList.setRemoveButtonIndex(1); - - String[] columnsHeaders= new String[] { - PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.name.column"), //$NON-NLS-1$ - PreferencesMessages.getString("TodoTaskConfigurationBlock.markers.tasks.priority.column"), //$NON-NLS-1$ - }; - - fTodoTasksList.setTableColumns(new ListDialogField.ColumnsDescription(columnsHeaders, true)); - unpackTodoTasks(); - if (fTodoTasksList.getSize() > 0) { - fTodoTasksList.selectFirstElement(); - } else { - fTodoTasksList.enableButton(3, false); - } - - fTaskTagsStatus= new StatusInfo(); - } - - protected final String[] getAllKeys() { - return new String[] { - PREF_TRANSLATION_TASK_TAGS, PREF_TRANSLATION_TASK_PRIORITIES - }; - } - - public class TaskTagAdapter implements IListAdapter, IDialogFieldListener { - - private boolean canEdit(ListDialogField field) { - return field.getSelectedElements().size() == 1; - } - - public void customButtonPressed(ListDialogField field, int index) { - doTodoButtonPressed(index); - } - - public void selectionChanged(ListDialogField field) { - field.enableButton(3, canEdit(field)); - } - - public void doubleClicked(ListDialogField field) { - if (canEdit(field)) { - doTodoButtonPressed(3); - } - } - - public void dialogFieldChanged(DialogField field) { - validateSettings(PREF_TRANSLATION_TASK_TAGS, null); - } - - } - - protected Control createContents(Composite parent) { - fPixelConverter= new PixelConverter(parent); - setShell(parent.getShell()); - - Composite markersComposite= createMarkersTabContent(parent); - - validateSettings(null, null); - - return markersComposite; - } - - private Composite createMarkersTabContent(Composite folder) { - - GridLayout layout= new GridLayout(); - layout.marginHeight= 0; - layout.marginWidth= 0; - layout.numColumns= 2; - - Composite markersComposite= new Composite(folder, SWT.NULL); - markersComposite.setLayout(layout); - - fTodoTasksList.doFillIntoGrid(markersComposite, 3); - LayoutUtil.setHorizontalSpan(fTodoTasksList.getLabelControl(null), 2); - - Table table= fTodoTasksList.getTableViewer().getTable(); - GridData data= (GridData)fTodoTasksList.getListControl(null).getLayoutData(); - data.grabExcessHorizontalSpace= true; - data.verticalAlignment= 0; - data.heightHint= SWTUtil.getTableHeightHint(table, 6); - - return markersComposite; - } - - protected void validateSettings(String changedKey, String newValue) { - if (changedKey != null) { - if (PREF_TRANSLATION_TASK_TAGS.equals(changedKey)) { - fTaskTagsStatus= validateTaskTags(); - } else { - return; - } - } else { - fTaskTagsStatus= validateTaskTags(); - } - IStatus status= fTaskTagsStatus; //StatusUtil.getMostSevere(new IStatus[] { fTaskTagsStatus }); - fContext.statusChanged(status); - } - - private IStatus validateTaskTags() { - return new StatusInfo(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.ui.preferences.OptionsConfigurationBlock#performOk(boolean) - */ - public boolean performOk(boolean enabled) { - packTodoTasks(); - return super.performOk(enabled); - } - - - protected String[] getFullBuildDialogStrings(boolean workspaceSettings) { - String title= PreferencesMessages.getString("TodoTaskConfigurationBlock.needsbuild.title"); //$NON-NLS-1$ - String message; - if (fProject == null) { - message= PreferencesMessages.getString("TodoTaskConfigurationBlock.needsfullbuild.message"); //$NON-NLS-1$ - } else { - message= PreferencesMessages.getString("TodoTaskConfigurationBlock.needsprojectbuild.message"); //$NON-NLS-1$ - } - return new String[] { title, message }; - } - - protected String[] getFullReParseDialogStrings(boolean workspaceSettings) { - String title= PreferencesMessages.getString("TodoTaskConfigurationBlock.needsparse.title"); //$NON-NLS-1$ - String message; - if (fProject == null) { - message= PreferencesMessages.getString("TodoTaskConfigurationBlock.needsfullparse.message"); //$NON-NLS-1$ - } else { - message= PreferencesMessages.getString("TodoTaskConfigurationBlock.needsprojectparse.message"); //$NON-NLS-1$ - } - return new String[] { title, message }; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.ui.preferences.OptionsConfigurationBlock#updateControls() - */ - protected void updateControls() { - unpackTodoTasks(); - } - - private void unpackTodoTasks() { - String currTags= (String) fWorkingValues.get(PREF_TRANSLATION_TASK_TAGS); - String currPrios= (String) fWorkingValues.get(PREF_TRANSLATION_TASK_PRIORITIES); - String[] tags= getTokens(currTags, ","); //$NON-NLS-1$ - String[] prios= getTokens(currPrios, ","); //$NON-NLS-1$ - ArrayList elements= new ArrayList(tags.length); - for (int i= 0; i < tags.length; i++) { - TodoTask task= new TodoTask(); - task.name= tags[i].trim(); - task.priority= (i < prios.length) ? prios[i] : PRIORITY_NORMAL; - elements.add(task); - } - fTodoTasksList.setElements(elements); - } - - private void packTodoTasks() { - StringBuffer tags= new StringBuffer(); - StringBuffer prios= new StringBuffer(); - List list= fTodoTasksList.getElements(); - for (int i= 0; i < list.size(); i++) { - if (i > 0) { - tags.append(','); - prios.append(','); - } - TodoTask elem= (TodoTask) list.get(i); - tags.append(elem.name); - prios.append(elem.priority); - } - fWorkingValues.put(PREF_TRANSLATION_TASK_TAGS, tags.toString()); - fWorkingValues.put(PREF_TRANSLATION_TASK_PRIORITIES, prios.toString()); - } - - private void doTodoButtonPressed(int index) { - TodoTask edited= null; - if (index != 0) { - edited= (TodoTask) fTodoTasksList.getSelectedElements().get(0); - } - - TodoTaskInputDialog dialog= new TodoTaskInputDialog(getShell(), edited, fTodoTasksList.getElements()); - if (dialog.open() == TodoTaskInputDialog.OK) { - if (edited != null) { - fTodoTasksList.replaceElement(edited, dialog.getResult()); - } else { - fTodoTasksList.addElement(dialog.getResult()); - } - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java deleted file mode 100644 index ee630116f17..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskInputDialog.java +++ /dev/null @@ -1,162 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.preferences; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.ui.help.WorkbenchHelp; - -import org.eclipse.cdt.core.CCorePlugin; - -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.dialogs.StatusDialog; -import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.preferences.TodoTaskConfigurationBlock.TodoTask; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.ComboDialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField; - -/** - * Dialog to enter a na new task tag - */ -public class TodoTaskInputDialog extends StatusDialog { - - private class CompilerTodoTaskInputAdapter implements IDialogFieldListener { - public void dialogFieldChanged(DialogField field) { - doValidation(); - } - } - - private StringDialogField fNameDialogField; - private ComboDialogField fPriorityDialogField; - - private List fExistingNames; - - public TodoTaskInputDialog(Shell parent, TodoTask task, List existingEntries) { - super(parent); - - fExistingNames= new ArrayList(existingEntries.size()); - for (int i= 0; i < existingEntries.size(); i++) { - TodoTask curr= (TodoTask) existingEntries.get(i); - if (!curr.equals(task)) { - fExistingNames.add(curr.name); - } - } - - if (task == null) { - setTitle(PreferencesMessages.getString("TodoTaskInputDialog.new.title")); //$NON-NLS-1$ - } else { - setTitle(PreferencesMessages.getString("TodoTaskInputDialog.edit.title")); //$NON-NLS-1$ - } - - CompilerTodoTaskInputAdapter adapter= new CompilerTodoTaskInputAdapter(); - - fNameDialogField= new StringDialogField(); - fNameDialogField.setLabelText(PreferencesMessages.getString("TodoTaskInputDialog.name.label")); //$NON-NLS-1$ - fNameDialogField.setDialogFieldListener(adapter); - - fNameDialogField.setText((task != null) ? task.name : ""); //$NON-NLS-1$ - - String[] items= new String[] { - PreferencesMessages.getString("TodoTaskInputDialog.priority.high"), //$NON-NLS-1$ - PreferencesMessages.getString("TodoTaskInputDialog.priority.normal"), //$NON-NLS-1$ - PreferencesMessages.getString("TodoTaskInputDialog.priority.low") //$NON-NLS-1$ - }; - - fPriorityDialogField= new ComboDialogField(SWT.READ_ONLY); - fPriorityDialogField.setLabelText(PreferencesMessages.getString("TodoTaskInputDialog.priority.label")); //$NON-NLS-1$ - fPriorityDialogField.setItems(items); - if (task != null) { - if (CCorePlugin.TRANSLATION_TASK_PRIORITY_HIGH.equals(task.priority)) { - fPriorityDialogField.selectItem(0); - } else if (CCorePlugin.TRANSLATION_TASK_PRIORITY_NORMAL.equals(task.priority)) { - fPriorityDialogField.selectItem(1); - } else { - fPriorityDialogField.selectItem(2); - } - } else { - fPriorityDialogField.selectItem(1); - } - } - - public TodoTask getResult() { - TodoTask task= new TodoTask(); - task.name= fNameDialogField.getText().trim(); - switch (fPriorityDialogField.getSelectionIndex()) { - case 0 : - task.priority= CCorePlugin.TRANSLATION_TASK_PRIORITY_HIGH; - break; - case 1 : - task.priority= CCorePlugin.TRANSLATION_TASK_PRIORITY_NORMAL; - break; - default : - task.priority= CCorePlugin.TRANSLATION_TASK_PRIORITY_LOW; - break; - } - return task; - } - - protected Control createDialogArea(Composite parent) { - Composite composite= (Composite) super.createDialogArea(parent); - - Composite inner= new Composite(composite, SWT.NONE); - GridLayout layout= new GridLayout(); - layout.marginHeight= 0; - layout.marginWidth= 0; - layout.numColumns= 2; - inner.setLayout(layout); - - fNameDialogField.doFillIntoGrid(inner, 2); - fPriorityDialogField.doFillIntoGrid(inner, 2); - - LayoutUtil.setHorizontalGrabbing(fNameDialogField.getTextControl(null)); - LayoutUtil.setWidthHint(fNameDialogField.getTextControl(null), convertWidthInCharsToPixels(45)); - - fNameDialogField.postSetFocusOnDialogField(parent.getDisplay()); - - applyDialogFont(composite); - return composite; - } - - private void doValidation() { - StatusInfo status= new StatusInfo(); - String newText= fNameDialogField.getText(); - if (newText.length() == 0) { - status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.enterName")); //$NON-NLS-1$ - } else { - if (newText.indexOf(',') != -1) { - status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.comma")); //$NON-NLS-1$ - } else if (fExistingNames.contains(newText)) { - status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.entryExists")); //$NON-NLS-1$ - } else if (Character.isWhitespace(newText.charAt(0)) || Character.isWhitespace(newText.charAt(newText.length() - 1))) { - status.setError(PreferencesMessages.getString("TodoTaskInputDialog.error.noSpace")); //$NON-NLS-1$ - } - } - updateStatus(status); - } - - /* - * @see org.eclipse.jface.window.Window#configureShell(Shell) - */ - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - WorkbenchHelp.setHelp(newShell, ICHelpContextIds.TODO_TASK_INPUT_DIALOG); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPreferencePage.java deleted file mode 100644 index 61a03d9d461..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPreferencePage.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.preferences; - -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.preference.PreferencePage; - -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.internal.ui.dialogs.StatusUtil; -import org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener; - -/* - * The page to configure the compiler options. - */ -public class TodoTaskPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IStatusChangeListener { - - public static final String ID= "org.eclipse.cdt.ui.propertyPages.TodoTaskPropertyPage"; //$NON-NLS-1$ - - private TodoTaskConfigurationBlock fConfigurationBlock; - - public TodoTaskPreferencePage() { - setPreferenceStore(CUIPlugin.getDefault().getPreferenceStore()); - //setDescription(PreferencesMessages.getString("TodoTaskPreferencePage.description")); //$NON-NLS-1$ - - // only used when page is shown programatically - setTitle(PreferencesMessages.getString("TodoTaskPreferencePage.title")); //$NON-NLS-1$ - - fConfigurationBlock= new TodoTaskConfigurationBlock(this, null); - } - - /* - * @see IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init(IWorkbench workbench) { - } - - /* - * @see PreferencePage#createControl(Composite) - */ - public void createControl(Composite parent) { - // added for 1GEUGE6: ITPJUI:WIN2000 - Help is the same on all preference pages - super.createControl(parent); - WorkbenchHelp.setHelp(getControl(), ICHelpContextIds.TODO_TASK_PREFERENCE_PAGE); - } - - /* - * @see PreferencePage#createContents(Composite) - */ - protected Control createContents(Composite parent) { - Control result= fConfigurationBlock.createContents(parent); - Dialog.applyDialogFont(result); - return result; - } - - /* - * @see IPreferencePage#performOk() - */ - public boolean performOk() { - if (!fConfigurationBlock.performOk(true)) { - return false; - } - return super.performOk(); - } - - /* - * @see PreferencePage#performDefaults() - */ - protected void performDefaults() { - fConfigurationBlock.performDefaults(); - super.performDefaults(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener#statusChanged(org.eclipse.core.runtime.IStatus) - */ - public void statusChanged(IStatus status) { - setValid(!status.matches(IStatus.ERROR)); - StatusUtil.applyToStatusLine(this, status); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPropertyPage.java deleted file mode 100644 index f7a87a8fc2a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/TodoTaskPropertyPage.java +++ /dev/null @@ -1,219 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.preferences; - -import org.eclipse.core.runtime.IStatus; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -import org.eclipse.jface.dialogs.ControlEnableState; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.preference.IPreferenceNode; -import org.eclipse.jface.preference.IPreferencePage; -import org.eclipse.jface.preference.PreferenceDialog; -import org.eclipse.jface.preference.PreferenceManager; -import org.eclipse.jface.preference.PreferenceNode; - -import org.eclipse.ui.dialogs.PropertyPage; -import org.eclipse.ui.help.WorkbenchHelp; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; - -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.dialogs.StatusUtil; -import org.eclipse.cdt.internal.ui.wizards.IStatusChangeListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField; - -/** - * Property page used to configure project specific task tags settings - */ -public class TodoTaskPropertyPage extends PropertyPage { - - private TodoTaskConfigurationBlock fConfigurationBlock; - private Control fConfigurationBlockControl; - private ControlEnableState fBlockEnableState; - private SelectionButtonDialogField fUseWorkspaceSettings; - private SelectionButtonDialogField fChangeWorkspaceSettings; - private SelectionButtonDialogField fUseProjectSettings; - private IStatus fBlockStatus; - - - public TodoTaskPropertyPage() { - fBlockStatus= new StatusInfo(); - fBlockEnableState= null; - - IDialogFieldListener listener= new IDialogFieldListener() { - public void dialogFieldChanged(DialogField field) { - doDialogFieldChanged(field); - } - }; - - fUseWorkspaceSettings= new SelectionButtonDialogField(SWT.RADIO); - fUseWorkspaceSettings.setDialogFieldListener(listener); - fUseWorkspaceSettings.setLabelText(PreferencesMessages.getString("TodoTaskPropertyPage.useworkspacesettings.label")); //$NON-NLS-1$ - - fChangeWorkspaceSettings= new SelectionButtonDialogField(SWT.PUSH); - fChangeWorkspaceSettings.setLabelText(PreferencesMessages.getString("TodoTaskPropertyPage.useworkspacesettings.change")); //$NON-NLS-1$ - fChangeWorkspaceSettings.setDialogFieldListener(listener); - - fUseWorkspaceSettings.attachDialogField(fChangeWorkspaceSettings); - - fUseProjectSettings= new SelectionButtonDialogField(SWT.RADIO); - fUseProjectSettings.setDialogFieldListener(listener); - fUseProjectSettings.setLabelText(PreferencesMessages.getString("TodoTaskPropertyPage.useprojectsettings.label")); //$NON-NLS-1$ - } - - /* - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - WorkbenchHelp.setHelp(getControl(), ICHelpContextIds.TODO_TASK_PROPERTY_PAGE); - } - - /* - * @see org.eclipse.jface.preference.IPreferencePage#createContents(Composite) - */ - protected Control createContents(Composite parent) { - IStatusChangeListener listener= new IStatusChangeListener() { - public void statusChanged(IStatus status) { - fBlockStatus= status; - doStatusChanged(); - } - }; - fConfigurationBlock= new TodoTaskConfigurationBlock(listener, getProject()); - - Composite composite= new Composite(parent, SWT.NONE); - GridLayout layout= new GridLayout(); - layout.marginHeight= 0; - layout.marginWidth= 0; - layout.numColumns= 1; - composite.setLayout(layout); - - fUseWorkspaceSettings.doFillIntoGrid(composite, 1); - LayoutUtil.setHorizontalGrabbing(fUseWorkspaceSettings.getSelectionButton(null)); - - fChangeWorkspaceSettings.doFillIntoGrid(composite, 1); - GridData data= (GridData) fChangeWorkspaceSettings.getSelectionButton(null).getLayoutData(); - data.horizontalIndent= convertWidthInCharsToPixels(3); - data.horizontalAlignment= GridData.BEGINNING; - - fUseProjectSettings.doFillIntoGrid(composite, 1); - - data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL ); - data.horizontalSpan= 1; - data.horizontalIndent= convertWidthInCharsToPixels(2); - - fConfigurationBlockControl= fConfigurationBlock.createContents(composite); - fConfigurationBlockControl.setLayoutData(data); - - boolean useProjectSettings= fConfigurationBlock.hasProjectSpecificOptions(); - - fUseProjectSettings.setSelection(useProjectSettings); - fUseWorkspaceSettings.setSelection(!useProjectSettings); - - updateEnableState(); - Dialog.applyDialogFont(composite); - return composite; - } - - private boolean useProjectSettings() { - return fUseProjectSettings.isSelected(); - } - - private void doDialogFieldChanged(DialogField field) { - if (field == fChangeWorkspaceSettings) { - TodoTaskPreferencePage page= new TodoTaskPreferencePage(); - showPreferencePage(TodoTaskPreferencePage.ID, page); - } else { - updateEnableState(); - doStatusChanged(); - } - } - /** - * Method statusChanged. - */ - private void doStatusChanged() { - updateStatus(useProjectSettings() ? fBlockStatus : new StatusInfo()); - } - - /** - * Method getProject. - */ - private ICProject getProject() { - return (ICProject) getElement().getAdapter(ICElement.class); - } - - private void updateEnableState() { - if (useProjectSettings()) { - if (fBlockEnableState != null) { - fBlockEnableState.restore(); - fBlockEnableState= null; - } - } else { - if (fBlockEnableState == null) { - fBlockEnableState= ControlEnableState.disable(fConfigurationBlockControl); - } - } - } - - /* - * @see org.eclipse.jface.preference.IPreferencePage#performDefaults() - */ - protected void performDefaults() { - if (useProjectSettings()) { - fUseProjectSettings.setSelection(false); - fUseWorkspaceSettings.setSelection(true); - fConfigurationBlock.performDefaults(); - } - super.performDefaults(); - } - - /* - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - return fConfigurationBlock.performOk(useProjectSettings()); - } - - private void updateStatus(IStatus status) { - setValid(!status.matches(IStatus.ERROR)); - StatusUtil.applyToStatusLine(this, status); - } - - private boolean showPreferencePage(String id, IPreferencePage page) { - final IPreferenceNode targetNode = new PreferenceNode(id, page); - - PreferenceManager manager = new PreferenceManager(); - manager.addToRoot(targetNode); - final PreferenceDialog dialog = new PreferenceDialog(getShell(), manager); - final boolean [] result = new boolean[] { false }; - BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() { - public void run() { - dialog.create(); - dialog.setMessage(targetNode.getLabelText()); - result[0]= (dialog.open() == PreferenceDialog.OK); - } - }); - return result[0]; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CElementLabels.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CElementLabels.java deleted file mode 100644 index d9b4137ad13..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CElementLabels.java +++ /dev/null @@ -1,362 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 24, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IMethod; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CElementLabels { - - /** - * Method names contain parameter types. - * e.g. foo(int) - */ - public final static int M_PARAMETER_TYPES= 1 << 0; - - /** - * Method names contain parameter names. - * e.g. foo(index) - */ - public final static int M_PARAMETER_NAMES= 1 << 1; - - /** - * Method names contain thrown exceptions. - * e.g. foo throw( IOException ) - */ - public final static int M_EXCEPTIONS= 1 << 2; - - /** - * Method names contain return type (appended) - * e.g. foo : int - */ - public final static int M_APP_RETURNTYPE= 1 << 3; - - /** - * Method names contain return type (appended) - * e.g. int foo - */ - public final static int M_PRE_RETURNTYPE= 1 << 4; - - /** - * Method names are fully qualified. - * e.g. java.util.Vector.size - */ - public final static int M_FULLY_QUALIFIED= 1 << 5; - - /** - * Method names are post qualified. - * e.g. size - java.util.Vector - */ - public final static int M_POST_QUALIFIED= 1 << 6; - - /** - * Initializer names are fully qualified. - * e.g. java.util.Vector.{ ... } - */ - public final static int I_FULLY_QUALIFIED= 1 << 7; - - /** - * Type names are post qualified. - * e.g. { ... } - java.util.Map - */ - public final static int I_POST_QUALIFIED= 1 << 8; - - /** - * Field names contain the declared type (appended) - * e.g. int fHello - */ - public final static int F_APP_TYPE_SIGNATURE= 1 << 9; - - /** - * Field names contain the declared type (prepended) - * e.g. fHello : int - */ - public final static int F_PRE_TYPE_SIGNATURE= 1 << 10; - - /** - * Fields names are fully qualified. - * e.g. java.lang.System.out - */ - public final static int F_FULLY_QUALIFIED= 1 << 11; - - /** - * Fields names are post qualified. - * e.g. out - java.lang.System - */ - public final static int F_POST_QUALIFIED= 1 << 12; - - /** - * Type names are fully qualified. - * e.g. java.util.Map.MapEntry - */ - public final static int T_FULLY_QUALIFIED= 1 << 13; - - /** - * Type names are type container qualified. - * e.g. Map.MapEntry - */ - public final static int T_CONTAINER_QUALIFIED= 1 << 14; - - /** - * Type names are post qualified. - * e.g. MapEntry - java.util.Map - */ - public final static int T_POST_QUALIFIED= 1 << 15; - - /** - * Declarations (import container / declarartion, package declarartion) are qualified. - * e.g. java.util.Vector.class/import container - */ - public final static int D_QUALIFIED= 1 << 16; - - /** - * Declarations (import container / declarartion, package declarartion) are post qualified. - * e.g. import container - java.util.Vector.class - */ - public final static int D_POST_QUALIFIED= 1 << 17; - - /** - * Class file names are fully qualified. - * e.g. java.util.Vector.class - */ - public final static int CF_QUALIFIED= 1 << 18; - - /** - * Class file names are post qualified. - * e.g. Vector.class - java.util - */ - public final static int CF_POST_QUALIFIED= 1 << 19; - - /** - * Compilation unit names are fully qualified. - * e.g. java.util.Vector.java - */ - public final static int CU_QUALIFIED= 1 << 20; - - /** - * Compilation unit names are post qualified. - * e.g. Vector.java - java.util - */ - public final static int CU_POST_QUALIFIED= 1 << 21; - - /** - * Package names are qualified. - * e.g. MyProject/src/java.util - */ - public final static int P_QUALIFIED= 1 << 22; - - /** - * Package names are post qualified. - * e.g. java.util - MyProject/src - */ - public final static int P_POST_QUALIFIED= 1 << 23; - - /** - * Package Fragment Roots contain variable name if from a variable. - * e.g. JRE_LIB - c:\java\lib\rt.jar - */ - public final static int ROOT_VARIABLE= 1 << 24; - - /** - * Package Fragment Roots contain the project name if not an archive (prepended). - * e.g. MyProject/src - */ - public final static int ROOT_QUALIFIED= 1 << 25; - - /** - * Package Fragment Roots contain the project name if not an archive (appended). - * e.g. src - MyProject - */ - public final static int ROOT_POST_QUALIFIED= 1 << 26; - - /** - * Add root path to all elements except Package Fragment Roots and Java projects. - * e.g. java.lang.Vector - c:\java\lib\rt.jar - * Option only applies to getElementLabel - */ - public final static int APPEND_ROOT_PATH= 1 << 27; - - /** - * Add root path to all elements except Package Fragment Roots and Java projects. - * e.g. java.lang.Vector - c:\java\lib\rt.jar - * Option only applies to getElementLabel - */ - public final static int PREPEND_ROOT_PATH= 1 << 28; - - /** - * Package names are compressed. - * e.g. o*.e*.search - */ - public final static int P_COMPRESSED= 1 << 29; - - /** - * Post qualify referenced package fragement roots. For example - * jdt.jar - org.eclipse.jdt.ui if the jar is referenced - * from another project. - */ - public final static int REFERENCED_ROOT_POST_QUALIFIED= 1 << 30; - - /** - * Qualify all elements - */ - public final static int ALL_FULLY_QUALIFIED= F_FULLY_QUALIFIED | M_FULLY_QUALIFIED | I_FULLY_QUALIFIED | T_FULLY_QUALIFIED | D_QUALIFIED | CF_QUALIFIED | CU_QUALIFIED | P_QUALIFIED | ROOT_QUALIFIED; - - /** - * Post qualify all elements - */ - public final static int ALL_POST_QUALIFIED= F_POST_QUALIFIED | M_POST_QUALIFIED | I_POST_QUALIFIED | T_POST_QUALIFIED | D_POST_QUALIFIED | CF_POST_QUALIFIED | CU_POST_QUALIFIED | P_POST_QUALIFIED | ROOT_POST_QUALIFIED; - - /** - * Default options (M_PARAMETER_TYPES enabled) - */ - public final static int ALL_DEFAULT= M_PARAMETER_TYPES; - - /** - * Default qualify options (All except Root and Package) - */ - public final static int DEFAULT_QUALIFIED= F_FULLY_QUALIFIED | M_FULLY_QUALIFIED | I_FULLY_QUALIFIED | T_FULLY_QUALIFIED | D_QUALIFIED | CF_QUALIFIED | CU_QUALIFIED; - - /** - * Default post qualify options (All except Root and Package) - */ - public final static int DEFAULT_POST_QUALIFIED= F_POST_QUALIFIED | M_POST_QUALIFIED | I_POST_QUALIFIED | T_POST_QUALIFIED | D_POST_QUALIFIED | CF_POST_QUALIFIED | CU_POST_QUALIFIED; - - - public final static String CONCAT_STRING= CSearchMessages.getString("CElementLabels.concat_string"); // " - "; //$NON-NLS-1$ - public final static String COMMA_STRING = CSearchMessages.getString("CElementLabels.comma_string"); // ", "; //$NON-NLS-1$ - public final static String DECL_STRING = CSearchMessages.getString("CElementLabels.declseparator_string"); // " "; // use for return type //$NON-NLS-1$ - - public static String getTextLabel(Object obj, int flags) { - if (obj instanceof ICElement) { - return getElementLabel((ICElement) obj, flags); - } else if (obj instanceof IAdaptable) { - IWorkbenchAdapter wbadapter= (IWorkbenchAdapter) ((IAdaptable)obj).getAdapter(IWorkbenchAdapter.class); - if (wbadapter != null) { - return wbadapter.getLabel(obj); - } - } - return ""; //$NON-NLS-1$ - } - - public static String getElementLabel(ICElement element, int flags) { - StringBuffer buf= new StringBuffer(60); - getElementLabel(element, flags, buf); - return buf.toString(); - } - - public static void getElementLabel(ICElement element, int flags, StringBuffer buf) { - int type= element.getElementType(); - - switch( type ){ - case ICElement.C_METHOD : - getMethodLabel( (IMethod) element, flags, buf ); - break; - case ICElement.C_CLASS: - case ICElement.C_STRUCT: - case ICElement.C_UNION: - case ICElement.C_ENUMERATION: - // getTypeLabel( (IType) element, flags, buf ); - } - } - - public static void getMethodLabel( IMethod method, int flags, StringBuffer buf ) { - //return type - if( getFlag( flags, M_PRE_RETURNTYPE ) && method.exists() && !method.isConstructor() ) { - buf.append( method.getReturnType() ); - buf.append( ' ' ); - } - - //qualification - if( getFlag( flags, M_FULLY_QUALIFIED ) ){ - getTypeLabel( method.getParent(), T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf ); - buf.append( "::" ); - } - - buf.append( method.getElementName() ); - - //parameters - if( getFlag( flags, M_PARAMETER_TYPES | M_PARAMETER_NAMES ) ) { - buf.append('('); - - String[] types = getFlag(flags, M_PARAMETER_TYPES) ? method.getParameterTypes() : null; - String[] names = null;//(getFlag(flags, M_PARAMETER_NAMES) && method.exists()) ? method.getParameterNames() : null; - - int nParams = ( types != null ) ? types.length : names.length; - - for (int i= 0; i < nParams; i++) { - if (i > 0) { - buf.append( COMMA_STRING ); //$NON-NLS-1$ - } - - if (types != null) { - buf.append( types[i] ); - } - - if (names != null) { - if (types != null) { - buf.append(' '); - } - buf.append( names[i] ); - } - } - buf.append(')'); - } - - //exceptions - if( getFlag( flags, M_EXCEPTIONS ) && method.exists() ){ - String [] types = method.getExceptions(); - if (types.length > 0) { - buf.append(" throw( "); //$NON-NLS-1$ - for (int i= 0; i < types.length; i++) { - if (i > 0) { - buf.append(COMMA_STRING); - } - buf.append( types[i] ); - } - buf.append( " )" ); - } - } - - if( getFlag( flags, M_APP_RETURNTYPE ) && method.exists() && !method.isConstructor()) { - buf.append( DECL_STRING ); - buf.append( method.getReturnType() ); - } - - // post qualification - if( getFlag(flags, M_POST_QUALIFIED)) { - buf.append( CONCAT_STRING ); - getTypeLabel( method.getParent(), T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf ); - } - } - - public static void getTypeLabel(ICElement type, int flags, StringBuffer buf) { - if( !(type instanceof IStructure) ){ - return; - } - } - - - private static boolean getFlag(int flags, int flag) { - return (flags & flag) != 0; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.java deleted file mode 100644 index 7d0ead2bf6a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 11, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchMessages { - private static final String RESOURCE_BUNDLE= CSearchMessages.class.getName(); - - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private CSearchMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - } - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object[] args) { - String format= null; - try { - format= fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - return MessageFormat.format(format, args); - } - - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object arg) { - String format= null; - try { - format= fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - if (arg == null) - arg= ""; //$NON-NLS-1$ - return MessageFormat.format(format, new Object[] { arg }); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties deleted file mode 100644 index 55a28c8b7d6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties +++ /dev/null @@ -1,172 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -group.search=S&earch -group.declarations= Dec&larations -group.references= Re&ferences -group.readReferences= &Read Access -group.writeReferences= &Write Access -group.implementors= &Implementors - -Search.Error.search.title=Search Error -Search.Error.search.message=An error occurred during the search operation - -Search.Error.javaElementAccess.title=Search Error -Search.Error.javaElementAccess.message=An error occurred while accessing a Java element - -Search.Error.markerAttributeAccess.title=Search Error -Search.Error.markerAttributeAccess.message=An error occurred while accessing a marker attribute - -Search.Error.createJavaElement.title=Search Error -Search.Error.createJavaElement.message=An error occurred while creating a Java element - -Search.Error.openEditor.title=Search Error -Search.Error.openEditor.message=Could not open the editor - -Search.Error.codeResolve= Code resolve error - -Search.Error.setDescription.title=Search Error -Search.Error.setDescription.message=Cannot save workspace description - -SearchElementSelectionDialog.title=Search -SearchElementSelectionDialog.message=Select the element to search for. - -CSearchResultCollector.match= 1 match -CSearchResultCollector.matches= {0} matches -CSearchResultCollector.done= Search done: {0}. -CSearchResultCollector.searching= Searching... - -Search.potentialMatchDialog.title.foundPotentialMatch= Search: Found 1 Inexact Match -Search.potentialMatchDialog.title.foundPotentialMatches= Search: Found {0} Inexact Matches -Search.potentialMatchDialog.message= Inexact matches were found and will be displayed with a different\nforeground color. This can be configured on the Search preference page. - -CSearchPage.searchFor.label= Search For -CSearchPage.searchFor.type= &Type -CSearchPage.searchFor.namespace= Names&pace -CSearchPage.searchFor.method= &Method -CSearchPage.searchFor.function= F&unction -CSearchPage.searchFor.field= &Field -CSearchPage.searchFor.variable= &Variable -CSearchPage.searchFor.class= &Class -CSearchPage.searchFor.struct= &Struct -CSearchPage.searchFor.union= U&nion -CSearchPage.searchFor.enum= &Enumeration -CSearchPage.searchFor.any= An&y Element -CSearchPage.searchFor.classStruct= &Class / Struct - -CSearchPage.limitTo.label= Limit To -CSearchPage.limitTo.declarations= Dec&larations -CSearchPage.limitTo.definitions= &Definitions -CSearchPage.limitTo.references= &References -CSearchPage.limitTo.allOccurrences= All &Occurrences - -CSearchPage.expression.label= Se&arch string (* = any string, ? = any character): -CSearchPage.expression.caseSensitive= Case sens&itive - -# Concatenate two working set names e.g. "Source, Lib" -SearchUtil.workingSetConcatenation= {0}, {1} - -Search.FindDeclarationAction.label= &Workspace -Search.FindDeclarationAction.tooltip= Search for Declarations of the Selected Element in the Workspace - -Search.FindDeclarationsInWorkingSetAction.label= Working &Set... -Search.FindDeclarationsInWorkingSetAction.tooltip= Search for Declarations of the Selected Element in a Working Set - -Search.FindHierarchyDeclarationsAction.label= &Hierarchy -Search.FindHierarchyDeclarationsAction.tooltip= Search for Declarations of the Selected Element in its Hierarchy - -Search.FindImplementorsAction.label= &Workspace -Search.FindImplementorsAction.tooltip= Search for Implementors of the Selected Interface - -Search.FindImplementorsInWorkingSetAction.label= Working &Set... -Search.FindImplementorsInWorkingSetAction.tooltip= Search for Implementors of the Selected Interface in a Working Set - -Search.FindReferencesAction.label= &Workspace -Search.FindReferencesAction.tooltip= Search for References to the Selected Element in the Workspace - -Search.FindReferencesAction.BinPrimConstWarnDialog.title= Search for References to a Binary Constant -Search.FindReferencesAction.BinPrimConstWarnDialog.message= Matches to this constant will only be discovered in source files and binary files where the constant value is not inlined. - -Search.FindReferencesInWorkingSetAction.label= Working &Set... -Search.FindReferencesInWorkingSetAction.tooltip= Search for References to the Selected Element in a Working Set - -Search.FindHierarchyReferencesAction.label= &Hierarchy -Search.FindHierarchyReferencesAction.tooltip= Search for References of the Selected Element in its Hierarchy - -Search.FindReadReferencesAction.label= &Workspace -Search.FindReadReferencesAction.tooltip= Search for Read References to the Selected Element in the Workspace - -Search.FindReadReferencesInWorkingSetAction.label= Working &Set... -Search.FindReadReferencesInWorkingSetAction.tooltip= Search for Read References to the Selected Element in a Working Set - -Search.FindReadReferencesInHierarchyAction.label= &Hierarchy -Search.FindReadReferencesInHierarchyAction.tooltip= Search for Read References of the Selected Element in its Hierarchy - -Search.FindWriteReferencesAction.label= &Workspace -Search.FindWriteReferencesAction.tooltip= Search for Write References to the Selected Element in the Workspace - -Search.FindWriteReferencesInWorkingSetAction.label= Working &Set... -Search.FindWriteReferencesInWorkingSetAction.tooltip= Search for Write References to the Selected Element in a Working Set - -Search.FindWriteReferencesInHierarchyAction.label= &Hierarchy -Search.FindWriteReferencesInHierarchyAction.tooltip= Search for Write References of the Selected Element in its Hierarchy - -Search.FindOccurrencesInFile.label= Occurre&nces in File -Search.FindOccurrencesInFile.tooltip= Find occurrences of selected element in the editor - -FindOccurrencesEngine.noSource.text= No source available. To perform this operation you need to attach source. -FindOccurrencesEngine.noJavaElement.text= Cannot search for the current selection. Please select a valid Java element name. -FindOccurrencesEngine.cannotParse.text= Cannot analyze the compilation unit or class file. - - -JavaSearchOperation.default_package=(default package) - -# The first argument will be replaced by the pattern and the second by the scope -CSearchOperation.singularDeclarationsPostfix={0} - 1 Declaration in {1} -CSearchOperation.singularReferencesPostfix={0} - 1 Reference in {1} -CSearchOperation.singularReadReferencesPostfix={0} - 1 Read Reference in {1} -CSearchOperation.singularWriteReferencesPostfix={0} - 1 Write Reference in {1} -CSearchOperation.singularImplementorsPostfix={0} - 1 Implementor in {1} -CSearchOperation.singularOccurrencesPostfix={0} - 1 Occurrence in {1} - -# The first argument will be replaced by the pattern, the second by the count and the last by the scope -CSearchOperation.pluralDeclarationsPostfix={0} - {1} Declarations in {2} -CSearchOperation.pluralReferencesPostfix={0} - {1} References in {2} -CSearchOperation.pluralReadReferencesPostfix={0} - {1} Read References in {2} -CSearchOperation.pluralWriteReferencesPostfix={0} - {1} Write References in {2} -CSearchOperation.pluralImplementorsPostfix={0} - {1} Implementors in {2} -CSearchOperation.pluralOccurrencesPostfix={0} - {1} Occurrences in {2} - - -# The first argument will be replaced by the element name and the second one by the file name -JavaSearchInFile.singularPostfix={0} - 1 Occurrence in {1} -# The first argument will be replaced by the element name, the second by the count and the last by the file name -JavaSearchInFile.pluralPostfix={0} - {1} Occurrences in {2} - -JavaElementAction.typeSelectionDialog.title=Search -JavaElementAction.typeSelectionDialog.message=&Select the type to search: -JavaElementAction.error.open.message=An exception occurred while opening the type. - -JavaElementAction.operationUnavailable.title= Operation Unavailable -JavaElementAction.operationUnavailable.generic= The operation is unavailable on the current selection. Please select a valid Java element name. -JavaElementAction.operationUnavailable.field= The operation is unavailable on the current selection. Please select the name of a field. -JavaElementAction.operationUnavailable.interface= The operation is unavailable on the current selection. Please select the name of an interface. - -CSearchResultLabelProvider.potentialMatch= \ (inexact) - -WorkspaceScope= Workspace -WorkingSetScope= Working Set - {0} -SelectionScope= Selection -HierarchyScope= Hierarchy - {0} - -CElementLabels.concat_string=\ -\ -CElementLabels.comma_string=,\ -CElementLabels.declseparator_string=\ :\ \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java deleted file mode 100644 index 79f62ccf2b1..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchOperation.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 11, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import java.lang.reflect.InvocationTargetException; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.search.matching.OrPattern; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchOperation implements IRunnableWithProgress,ICSearchConstants{ - public CSearchOperation(IWorkspace workspace, String pattern, boolean caseSensitive, List searchFor, LimitTo limitTo, ICSearchScope scope, String scopeDescription, CSearchResultCollector collector) { - this( workspace, limitTo, scope, scopeDescription, collector ); - _stringPattern = pattern; - _caseSensitive = caseSensitive; - _searchFor = searchFor; - } - - public CSearchOperation(IWorkspace workspace, LimitTo limitTo, ICSearchScope scope, String scopeDescription, CSearchResultCollector collector ){ - _workspace = workspace; - _limitTo = limitTo; - _scope = scope; - _scopeDescription = scopeDescription; - _collector = collector; - _collector.setOperation( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.actions.WorkspaceModifyOperation#execute(org.eclipse.core.runtime.IProgressMonitor) - */ - public void run(IProgressMonitor monitor)throws InvocationTargetException - { - _collector.setProgressMonitor( monitor ); - - SearchEngine engine = new SearchEngine( CUIPlugin.getSharedWorkingCopies() ); - - ICSearchPattern pattern = null; - if( _searchFor.size() > 1 ){ - OrPattern orPattern = new OrPattern(); - for (Iterator iter = _searchFor.iterator(); iter.hasNext();) { - SearchFor element = (SearchFor)iter.next(); - orPattern.addPattern( SearchEngine.createSearchPattern( _stringPattern, element, _limitTo, _caseSensitive ) ); - } - - pattern = orPattern; - - } else { - Iterator iter = _searchFor.iterator(); - pattern = SearchEngine.createSearchPattern( _stringPattern, (SearchFor)iter.next(), _limitTo, _caseSensitive ); - } - - engine.search( _workspace, pattern, _scope, _collector, false ); - - - } - - /** - * @return - */ - public String getSingularLabel() { - String desc = null; - - //if( _elementPattern != null ){ - // desc = _elementPattern.getElementName(); - //} else { - desc = _stringPattern; - //} - - String [] args = new String [] { desc, _scopeDescription }; - - if( _limitTo == DECLARATIONS ){ - return CSearchMessages.getFormattedString( "CSearchOperation.singularDeclarationsPostfix", args ); //$NON_NLS-1$ - } else if( _limitTo == REFERENCES ){ - return CSearchMessages.getFormattedString( "CSearchOperation.singularReferencesPostfix", args ); //$NON_NLS-1$ - } else { - return CSearchMessages.getFormattedString( "CSearchOperation.singularOccurrencesPostfix", args ); //$NON_NLS-1$ - } - } - - /** - * @return - */ - public String getPluralLabelPattern() { - String desc = null; - - // if( _elementPattern != null ){ - // desc = _elementPattern.getElementName(); - // } else { - desc = _stringPattern; - // } - - String [] args = new String [] { desc, "{0}", _scopeDescription }; - if( _limitTo == DECLARATIONS ){ - return CSearchMessages.getFormattedString( "CSearchOperation.pluralDeclarationsPostfix", args ); //$NON_NLS-1$ - } else if ( _limitTo == REFERENCES ){ - return CSearchMessages.getFormattedString( "CSearchOperation.pluralReferencesPostfix", args ); //$NON_NLS-1$ - } else { - return CSearchMessages.getFormattedString( "CSearchOperation.pluralOccurrencesPostfix", args ); //$NON_NLS-1$ - } - } - - /** - * @return - */ - public ImageDescriptor getImageDescriptor() { - if( _limitTo == ICSearchConstants.DECLARATIONS ){ - return CPluginImages.DESC_OBJS_SEARCH_DECL; - } else { - return CPluginImages.DESC_OBJS_SEARCH_REF; - } - } - - private CSearchResultCollector _collector; - private IWorkspace _workspace; - //private ICElement _elementPattern; - private ICSearchScope _scope; - private String _stringPattern; - private String _scopeDescription; - private boolean _caseSensitive; - private LimitTo _limitTo; - private List _searchFor; - - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java deleted file mode 100644 index 8340503eec7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java +++ /dev/null @@ -1,671 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 10, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.DialogPage; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.search.internal.ui.util.RowLayouter; -import org.eclipse.search.ui.ISearchPage; -import org.eclipse.search.ui.ISearchPageContainer; -import org.eclipse.search.ui.ISearchResultViewEntry; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.model.IWorkbenchAdapter; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchPage extends DialogPage implements ISearchPage, ICSearchConstants { - - public static final String EXTENSION_POINT_ID= "org.eclipse.cdt.ui.CSearchPage"; //$NON-NLS-1$ - - public boolean performAction() { - SearchUI.activateSearchResultView(); - - SearchPatternData data = getPatternData(); - IWorkspace workspace = CUIPlugin.getWorkspace(); - - ICSearchScope scope = null; - String scopeDescription = ""; //$NON-NLS-1$ - - switch( getContainer().getSelectedScope() ) { - case ISearchPageContainer.SELECTION_SCOPE: - if( fStructuredSelection != null && fStructuredSelection.iterator().hasNext() ){ - scopeDescription = CSearchMessages.getString("SelectionScope"); //$NON-NLS-1$ - scope = CSearchScopeFactory.getInstance().createCSearchScope(fStructuredSelection); - break; - } - /* else fall through to workspace scope */ - case ISearchPageContainer.WORKSPACE_SCOPE: - scopeDescription = CSearchMessages.getString("WorkspaceScope"); //$NON-NLS-1$ - scope = SearchEngine.createWorkspaceScope(); - break; - case ISearchPageContainer.WORKING_SET_SCOPE: - IWorkingSet[] workingSets= getContainer().getSelectedWorkingSets(); - // should not happen - just to be sure - if (workingSets == null || workingSets.length < 1) - return false; - scopeDescription = CSearchMessages.getFormattedString("WorkingSetScope", CSearchUtil.toString(workingSets)); //$NON-NLS-1$ - scope= CSearchScopeFactory.getInstance().createCSearchScope(getContainer().getSelectedWorkingSets()); - CSearchUtil.updateLRUWorkingSets(getContainer().getSelectedWorkingSets()); - } - - data.cElement= null; - - CSearchResultCollector collector= new CSearchResultCollector(); - - List searching = null; - - if( data.searchFor.contains( UNKNOWN_SEARCH_FOR ) ){ - //UNKNOWN_SEARCH_FOR means search for anything, make a list with everything - searching = new LinkedList(); - for( int i = 0; i < fSearchFor.length - 1; i++ ){ - searching.add( fSearchForValues[ i ] ); - } - - //include those items not represented in the UI - searching.add( MACRO ); - searching.add( TYPEDEF ); - } else { - searching = data.searchFor; - } - - CSearchOperation op = new CSearchOperation(workspace, data.pattern, data.isCaseSensitive, searching, data.limitTo, scope, scopeDescription, collector); - - - try { - getContainer().getRunnableContext().run(true, true, op); - } catch (InvocationTargetException ex) { - Shell shell = getControl().getShell(); - //ExceptionHandler.handle(ex, shell, CSearchMessages.getString("Search.Error.search.title"), CSearchMessages.getString("Search.Error.search.message")); //$NON-NLS-2$ //$NON-NLS-1$ - return false; - } catch (InterruptedException ex) { - return false; - } - return true; - } - - public void createControl(Composite parent) { - initializeDialogUnits( parent ); - readConfiguration(); - - GridData gd; - Composite result = new Composite( parent, SWT.NONE ); - GridLayout layout = new GridLayout( 2, false ); - layout.horizontalSpacing = 10; - result.setLayout( layout ); - result.setLayoutData( new GridData(GridData.FILL_HORIZONTAL) ); - - RowLayouter layouter = new RowLayouter( layout.numColumns ); - gd = new GridData(); - gd.horizontalAlignment = GridData.FILL; - gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_FILL; - - layouter.setDefaultGridData( gd, 0 ); - layouter.setDefaultGridData( gd, 1 ); - layouter.setDefaultSpan(); - - layouter.perform( createExpression(result) ); - layouter.perform( createSearchFor(result), createLimitTo(result), -1 ); - - SelectionAdapter cElementInitializer = new SelectionAdapter() { - public void widgetSelected( SelectionEvent event ) { - if( getSearchFor() == fInitialData.searchFor ) - fCElement= fInitialData.cElement; - else - fCElement= null; - handleAllElements( event ); - setLimitTo( getSearchFor() ); - updateCaseSensitiveCheckbox(); - } - }; - - for( int i = 0; i < fSearchFor.length; i++ ){ - fSearchFor[ i ].addSelectionListener( cElementInitializer ); - } - - setControl( result ); - - Dialog.applyDialogFont( result ); - WorkbenchHelp.setHelp(result, ICHelpContextIds.C_SEARCH_PAGE); - } - - private Control createExpression( Composite parent ) { - Composite result = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(2, false); - result.setLayout(layout); - GridData gd = new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ); - gd.horizontalSpan = 2; - gd.horizontalIndent = 0; - result.setLayoutData( gd ); - - // Pattern text + info - Label label = new Label( result, SWT.LEFT ); - label.setText( CSearchMessages.getString( "CSearchPage.expression.label" ) ); //$NON-NLS-1$ - gd = new GridData( GridData.BEGINNING ); - gd.horizontalSpan = 2; - label.setLayoutData( gd ); - - // Pattern combo - fPattern = new Combo( result, SWT.SINGLE | SWT.BORDER ); - fPattern.addSelectionListener( new SelectionAdapter() { - public void widgetSelected( SelectionEvent e ) { - handlePatternSelected(); - } - }); - - fPattern.addModifyListener( new ModifyListener() { - public void modifyText( ModifyEvent e ) { - getContainer().setPerformActionEnabled( getPattern().length() > 0 ); - updateCaseSensitiveCheckbox(); - } - }); - - gd = new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ); - gd.horizontalIndent = -gd.horizontalIndent; - fPattern.setLayoutData( gd ); - - - // Ignore case checkbox - fCaseSensitive= new Button(result, SWT.CHECK); - fCaseSensitive.setText(CSearchMessages.getString("CSearchPage.expression.caseSensitive")); //$NON-NLS-1$ - gd= new GridData(); - fCaseSensitive.setLayoutData(gd); - fCaseSensitive.addSelectionListener( new SelectionAdapter() { - public void widgetSelected( SelectionEvent e ) { - fIsCaseSensitive= fCaseSensitive.getSelection(); - writeConfiguration(); - } - }); - - return result; - } - - private void handleAllElements( SelectionEvent event ){ - Button allElements = fSearchFor[ fSearchFor.length - 1 ]; - if( event.widget == allElements ){ - for( int i = 0; i < fSearchFor.length - 1; i++ ) - fSearchFor[i].setEnabled( ! allElements.getSelection() ); - } - } - - private void handlePatternSelected() { - if( fPattern.getSelectionIndex() < 0 ) - return; - - int index = fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex(); - fInitialData = (SearchPatternData) fgPreviousSearchPatterns.get( index ); - - updateSelections(); - - if( fInitialData.workingSets != null ) - getContainer().setSelectedWorkingSets( fInitialData.workingSets ); - else - getContainer().setSelectedScope( fInitialData.scope ); - } - - private String getPattern() { - return fPattern.getText(); - } - - private Control createLimitTo( Composite parent ) { - Group result = new Group(parent, SWT.NONE); - result.setText( CSearchMessages.getString("CSearchPage.limitTo.label") ); //$NON-NLS-1$ - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - result.setLayout( layout ); - - fLimitTo = new Button[fLimitToText.length]; - for( int i = 0; i < fLimitToText.length; i++ ){ - Button button = new Button(result, SWT.RADIO); - button.setText( fLimitToText[i] ); - fLimitTo[i] = button; - } - - // Fill with dummy radio buttons - Button filler= new Button(result, SWT.RADIO); - filler.setVisible(false); - filler= new Button(result, SWT.RADIO); - filler.setVisible(false); - - return result; - } - - private LimitTo getLimitTo() { - for (int i= 0; i < fLimitTo.length; i++) { - if (fLimitTo[i].getSelection()) - return fLimitToValues[ i ]; - } - return null; - } - - private void setLimitTo( List searchFor ) { - HashSet set = new HashSet(); - - set.add( DECLARATIONS ); - set.add( REFERENCES ); - set.add( ALL_OCCURRENCES ); - - for (Iterator iter = searchFor.iterator(); iter.hasNext();) { - SearchFor element = (SearchFor) iter.next(); - if( element == FUNCTION || element == METHOD || element == VAR || - element == FIELD || element == NAMESPACE || element == UNKNOWN_SEARCH_FOR ){ - set.add( DEFINITIONS ); - break; - } - } - - for( int i = 0; i < fLimitTo.length; i++ ) - fLimitTo[ i ].setEnabled( set.contains( fLimitToValues[ i ] ) ); - } - - private Control createSearchFor(Composite parent) { - Group result= new Group(parent, SWT.NONE); - result.setText(CSearchMessages.getString("CSearchPage.searchFor.label")); //$NON-NLS-1$ - GridLayout layout= new GridLayout(); - layout.numColumns= 3; - result.setLayout(layout); - - fSearchFor= new Button[fSearchForText.length]; - for (int i= 0; i < fSearchForText.length; i++) { - Button button= new Button(result, SWT.CHECK); - button.setText(fSearchForText[i]); - fSearchFor[i]= button; - } - - return result; - } - - private List getSearchFor() { - List search = new LinkedList( ); - -// boolean all = fSearchFor[ fSearchFor.length - 1 ].getSelection(); - - for (int i= 0; i < fSearchFor.length; i++) { - if( fSearchFor[i].getSelection() /*|| all */) - search.add( fSearchForValues[i] ); - } - - return search; - } - - public void setContainer(ISearchPageContainer container) { - fContainer = container; - } - - private ISearchPageContainer getContainer() { - return fContainer; - } - - - private IDialogSettings getDialogSettings() { - IDialogSettings settings = CUIPlugin.getDefault().getDialogSettings(); - fDialogSettings = settings.getSection( PAGE_NAME ); - if( fDialogSettings == null ) - fDialogSettings = settings.addNewSection( PAGE_NAME ); - - return fDialogSettings; - } - - private void readConfiguration() { - IDialogSettings s = getDialogSettings(); - fIsCaseSensitive = s.getBoolean( STORE_CASE_SENSITIVE ); - } - - private void writeConfiguration() { - IDialogSettings s = getDialogSettings(); - s.put( STORE_CASE_SENSITIVE, fIsCaseSensitive ); - } - - public void setVisible(boolean visible) { - if (visible && fPattern != null) { - if (fFirstTime) { - fFirstTime= false; - // Set item and text here to prevent page from resizing - fPattern.setItems(getPreviousSearchPatterns()); - initSelections(); - } - fPattern.setFocus(); - getContainer().setPerformActionEnabled(fPattern.getText().length() > 0); - } - super.setVisible(visible); - } - - private void updateCaseSensitiveCheckbox() { - if (fInitialData != null && getPattern().equals(fInitialData.pattern) && fCElement != null) { - fCaseSensitive.setEnabled(false); - fCaseSensitive.setSelection(true); - } - else { - fCaseSensitive.setEnabled(true); - fCaseSensitive.setSelection(fIsCaseSensitive); - } - } - - private void initSelections() { - fStructuredSelection = asStructuredSelection(); - fInitialData = tryStructuredSelection( fStructuredSelection ); - updateSelections(); - } - - private void updateSelections(){ - if (fInitialData == null) - fInitialData = trySimpleTextSelection( getContainer().getSelection() ); - if (fInitialData == null) - fInitialData = getDefaultInitValues(); - - fCElement = fInitialData.cElement; - fIsCaseSensitive = fInitialData.isCaseSensitive; - fCaseSensitive.setSelection( fInitialData.isCaseSensitive ); - fCaseSensitive.setEnabled( fInitialData.cElement == null ); - - HashSet set = new HashSet( fInitialData.searchFor ); - - boolean enabled = ! set.contains( fSearchForValues[ fSearchFor.length - 1 ] ); - - for (int i = 0; i < fSearchFor.length; i++){ - fSearchFor[i].setSelection( set.contains( fSearchForValues[i] ) ); - fSearchFor[i].setEnabled( enabled ); - } - - if( !enabled ) - fSearchFor[ fSearchFor.length - 1 ].setEnabled( true ); - - setLimitTo( fInitialData.searchFor ); - - for (int i = 0; i < fLimitTo.length; i++) - fLimitTo[i].setSelection( fLimitToValues[i] == fInitialData.limitTo ); - - fPattern.setText( fInitialData.pattern ); - } - - private SearchPatternData tryStructuredSelection( IStructuredSelection selection ) { - if( selection == null || selection.size() > 1 ) - return null; - - Object o = selection.getFirstElement(); - if( o instanceof ICElement ) { - return determineInitValuesFrom( (ICElement)o ); - } else if( o instanceof ISearchResultViewEntry ) { - ICElement element = CSearchUtil.getCElement( ((ISearchResultViewEntry)o).getSelectedMarker() ); - return determineInitValuesFrom( element ); - //} else if( o instanceof LogicalPackage ) { - // LogicalPackage lp = (LogicalPackage)o; - // return new SearchPatternData( PACKAGE, REFERENCES, fIsCaseSensitive, lp.getElementName(), null ); - } else if( o instanceof IAdaptable ) { - ICElement element = (ICElement)((IAdaptable)o).getAdapter( ICElement.class ); - if( element != null ) { - return determineInitValuesFrom( element ); - } else { - IWorkbenchAdapter adapter= (IWorkbenchAdapter)((IAdaptable)o).getAdapter( IWorkbenchAdapter.class ); - if( adapter != null ){ - List searchFor = new LinkedList(); - searchFor.add( UNKNOWN_SEARCH_FOR ); - return new SearchPatternData( searchFor, DECLARATIONS, fIsCaseSensitive, adapter.getLabel(o), null ); - } - } - } - return null; - } - - /** - * try to initialize the Search pattern data based on the current text selection. - * @param selection - * @return - */ - private SearchPatternData trySimpleTextSelection(ISelection selection) { - SearchPatternData result= null; - if (selection instanceof ITextSelection) { - BufferedReader reader= new BufferedReader(new StringReader(((ITextSelection)selection).getText())); - String text; - try { - text= reader.readLine(); - if (text == null) - text= ""; //$NON-NLS-1$ - } catch (IOException ex) { - text= ""; //$NON-NLS-1$ - } - - List searchFor = new LinkedList(); - searchFor.add( UNKNOWN_SEARCH_FOR ); - result= new SearchPatternData( searchFor, DECLARATIONS, fIsCaseSensitive, text, null); - } - return result; - } - - private SearchPatternData getDefaultInitValues() { - List searchFor = new LinkedList(); - searchFor.add( CLASS_STRUCT ); - return new SearchPatternData( searchFor, DECLARATIONS, fIsCaseSensitive, "", null); //$NON-NLS-1$ - } - - private String[] getPreviousSearchPatterns() { - // Search results are not persistent - int patternCount= fgPreviousSearchPatterns.size(); - String [] patterns= new String[patternCount]; - for (int i= 0; i < patternCount; i++) - patterns[i]= ((SearchPatternData) fgPreviousSearchPatterns.get(patternCount - 1 - i)).pattern; - return patterns; - } - - private IStructuredSelection asStructuredSelection() { - IWorkbenchWindow wbWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (wbWindow != null) { - IWorkbenchPage page= wbWindow.getActivePage(); - if (page != null) { - IWorkbenchPart part= page.getActivePart(); - if (part != null){ - ISelectionProvider provider = part.getSite().getSelectionProvider(); - if( provider != null ){ - ISelection selection = provider.getSelection(); - if( selection instanceof IStructuredSelection ){ - return (IStructuredSelection)selection; - } - } - } - } - } - return StructuredSelection.EMPTY; - } - - private SearchPatternData determineInitValuesFrom( ICElement element ) { - if( element == null ) - return null; - - List searchFor = new LinkedList(); - - //outliune view will confuse methods with functions, so if the - //name contains a "::", treat it as a method - String pattern = element.getElementName(); - boolean forceMethod = ( pattern.indexOf("::") != -1 ); - - switch ( element.getElementType() ){ - case ICElement.C_TEMPLATE_FUNCTION: /*fall through to function */ - case ICElement.C_FUNCTION_DECLARATION: /*fall through to function */ - case ICElement.C_FUNCTION: if( forceMethod ) searchFor.add( METHOD ); - else searchFor.add( FUNCTION ); - break; - - case ICElement.C_VARIABLE: searchFor.add( VAR ); break; - - case ICElement.C_TEMPLATE_CLASS:/* fall through to CLASS */ - case ICElement.C_STRUCT: /* fall through to CLASS */ - case ICElement.C_CLASS: searchFor.add( CLASS_STRUCT ); break; - - case ICElement.C_UNION: searchFor.add( UNION ); break; - - case ICElement.C_ENUMERATOR: /* fall through to FIELD */ - case ICElement.C_FIELD: searchFor.add( FIELD ); break; - - case ICElement.C_TEMPLATE_METHOD : /*fall through to METHOD */ - case ICElement.C_METHOD_DECLARATION : /*fall through to METHOD */ - case ICElement.C_METHOD: searchFor.add( METHOD ); break; - - case ICElement.C_NAMESPACE: searchFor.add( NAMESPACE ); break; - - case ICElement.C_ENUMERATION: searchFor.add( ENUM ); break; - - default: searchFor.add( UNKNOWN_SEARCH_FOR ); break; - } - - LimitTo limitTo = ALL_OCCURRENCES; - - return new SearchPatternData( searchFor, limitTo, true, pattern, element ); - } - - private SearchPatternData getPatternData() { - String pattern= getPattern(); - SearchPatternData match= null; - int i= 0; - int size= fgPreviousSearchPatterns.size(); - while (match == null && i < size) { - match= (SearchPatternData) fgPreviousSearchPatterns.get(i); - i++; - if (!pattern.equals(match.pattern)) - match= null; - }; - if (match == null) { - match= new SearchPatternData( - getSearchFor(), - getLimitTo(), - pattern, - fCaseSensitive.getSelection(), - fCElement, - getContainer().getSelectedScope(), - getContainer().getSelectedWorkingSets()); - fgPreviousSearchPatterns.add(match); - } - else { - match.searchFor= getSearchFor(); - match.limitTo= getLimitTo(); - match.isCaseSensitive= fCaseSensitive.getSelection(); - match.cElement= fCElement; - match.scope= getContainer().getSelectedScope(); - match.workingSets= getContainer().getSelectedWorkingSets(); - }; - return match; - } - - private static class SearchPatternData { - List searchFor; - LimitTo limitTo; - String pattern; - boolean isCaseSensitive; - ICElement cElement; - int scope; - IWorkingSet[] workingSets; - - public SearchPatternData(List s, LimitTo l, boolean i, String p, ICElement element) { - this(s, l, p, i, element, ISearchPageContainer.WORKSPACE_SCOPE, null); - } - - public SearchPatternData(List s, LimitTo l, String p, boolean i, ICElement element, int scope, IWorkingSet[] workingSets) { - searchFor= s; - limitTo= l; - pattern= p; - isCaseSensitive= i; - cElement= element; - this.scope = scope; - this.workingSets = workingSets; - } - } - - //Dialog store id constants - private final static String PAGE_NAME= "CSearchPage"; //$NON-NLS-1$ - private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; //$NON-NLS-1$ - - private static List fgPreviousSearchPatterns = new ArrayList(20); - - private Button[] fSearchFor; - private SearchFor[] fSearchForValues = { CLASS_STRUCT, FUNCTION, VAR, UNION, METHOD, FIELD, ENUM, NAMESPACE, UNKNOWN_SEARCH_FOR }; - - private String[] fSearchForText= { - CSearchMessages.getString("CSearchPage.searchFor.classStruct"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.function"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.variable"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.union"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.method"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.field"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.enum"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.namespace"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.searchFor.any") }; //$NON-NLS-1$ - - - private Button[] fLimitTo; - private LimitTo[] fLimitToValues = { DECLARATIONS, DEFINITIONS, REFERENCES, ALL_OCCURRENCES }; - private String[] fLimitToText= { - CSearchMessages.getString("CSearchPage.limitTo.declarations"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.limitTo.definitions"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.limitTo.references"), //$NON-NLS-1$ - CSearchMessages.getString("CSearchPage.limitTo.allOccurrences") }; //$NON-NLS-1$ - //CSearchMessages.getString("CSearchPage.limitTo.readReferences"), //$NON-NLS-1$ - //CSearchMessages.getString("CSearchPage.limitTo.writeReferences")}; //$NON-NLS-1$ - - private SearchPatternData fInitialData; - private IStructuredSelection fStructuredSelection; - private ICElement fCElement; - private boolean fFirstTime= true; - private IDialogSettings fDialogSettings; - private boolean fIsCaseSensitive; - - private Combo fPattern; - private ISearchPageContainer fContainer; - private Button fCaseSensitive; -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java deleted file mode 100644 index 60bfb127698..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchResultCollector.java +++ /dev/null @@ -1,161 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 11, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import java.text.MessageFormat; -import java.util.HashMap; - -import org.eclipse.cdt.core.search.BasicSearchMatch; -import org.eclipse.cdt.core.search.BasicSearchResultCollector; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.ui.*; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.search.ui.IGroupByKeyComputer; -import org.eclipse.search.ui.ISearchResultView; -import org.eclipse.search.ui.SearchUI; - - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchResultCollector extends BasicSearchResultCollector{ - - public static final String IMATCH = "IMatchObject"; - - /** - * - */ - public CSearchResultCollector() { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.search.ICSearchResultCollector#aboutToStart() - */ - public void aboutToStart() { - super.aboutToStart(); - - _matchCount = 0; - - _view = SearchUI.getSearchResultView(); - - - CSearchResultLabelProvider labelProvider = new CSearchResultLabelProvider(); - labelProvider.setOrder( CSearchResultLabelProvider.SHOW_PATH ); - - _computer = new GroupByKeyComputer(); - - if( _view != null ){ - _view.searchStarted( - null,//new ActionGroupFactory(), - _operation.getSingularLabel(), - _operation.getPluralLabelPattern(), - _operation.getImageDescriptor(), - CSearchPage.EXTENSION_POINT_ID, - labelProvider, - new GotoMarkerAction(), - _computer, - _operation - ); - } - - if( getProgressMonitor() != null && !getProgressMonitor().isCanceled() ){ - getProgressMonitor().subTask( SEARCHING ); - } - } - - public boolean acceptMatch( IMatch match ) throws CoreException - { - BasicSearchMatch searchMatch = (BasicSearchMatch) match; - - if( !super.acceptMatch( match ) ) - return false; - - if( searchMatch.resource == null ) - return false; - - IMarker marker = searchMatch.resource.createMarker( SearchUI.SEARCH_MARKER ); - - HashMap markerAttributes = new HashMap( 2 ); - - //we can hang any other info we want off the marker - markerAttributes.put( IMarker.CHAR_START, new Integer( Math.max( searchMatch.startOffset, 0 ) ) ); - markerAttributes.put( IMarker.CHAR_END, new Integer( Math.max( searchMatch.endOffset, 0 ) ) ); - markerAttributes.put( IMATCH, searchMatch ); - - marker.setAttributes( markerAttributes ); - - if( _view != null ){ - _view.addMatch( searchMatch.name, _computer.computeGroupByKey( marker ), searchMatch.resource, marker ); - } - - _matchCount++; - - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.search.ICSearchResultCollector#done() - */ - public void done() { - if( !getProgressMonitor().isCanceled() ){ - String matchesString; - if( _matchCount == 1 ){ - matchesString = MATCH; - } else { - matchesString = MessageFormat.format( MATCHES, new Integer[]{ new Integer(_matchCount) } ); - } - - getProgressMonitor().setTaskName( MessageFormat.format( DONE, new String[]{ matchesString } ) ); - } - - if( _view != null ){ - _view.searchFinished(); - } - - _view = null; - _monitor = null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.search.ICSearchResultCollector#getProgressMonitor() - */ - public IProgressMonitor getProgressMonitor() { - return _monitor; - } - - public void setProgressMonitor(IProgressMonitor monitor) { - this._monitor = monitor; - } - - public void setOperation( CSearchOperation operation ) { - _operation = operation; - } - - private static final String SEARCHING = CSearchMessages.getString("CSearchResultCollector.searching"); //$NON-NLS-1$ - private static final String MATCH = CSearchMessages.getString("CSearchResultCollector.match"); //$NON-NLS-1$ - private static final String MATCHES = CSearchMessages.getString("CSearchResultCollector.matches"); //$NON-NLS-1$ - private static final String DONE = CSearchMessages.getString("CSearchResultCollector.done"); //$NON-NLS-1$ - - private IProgressMonitor _monitor; - private CSearchOperation _operation; - private ISearchResultView _view; - private IGroupByKeyComputer _computer; - private int _matchCount; -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchScopeFactory.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchScopeFactory.java deleted file mode 100644 index 892c6ca24ff..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchScopeFactory.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 12, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchScopeFactory { - private static CSearchScopeFactory fgInstance; - private static ICSearchScope EMPTY_SCOPE= SearchEngine.createCSearchScope(new ICElement[]{}); - /** - * - */ - public CSearchScopeFactory() { - super(); - } - - public static CSearchScopeFactory getInstance() { - if (fgInstance == null) - fgInstance = new CSearchScopeFactory(); - return fgInstance; - } - /** - * @param sets - * @return - */ - public ICSearchScope createCSearchScope(IWorkingSet[] sets) { - if (sets == null || sets.length < 1) - return EMPTY_SCOPE; - - Set cElements= new HashSet(sets.length * 10); - for (int i= 0; i < sets.length; i++) - addCElements(cElements, sets[i]); - return createCSearchScope(cElements); - } - /** - * @param cElements - * @return - */ - private ICSearchScope createCSearchScope(Set cElements) { - return SearchEngine.createCSearchScope((ICElement[])cElements.toArray(new ICElement[cElements.size()])); - } - /** - * @param cElements - * @param set - */ - private void addCElements(Set cElements, IWorkingSet set) { - if (set == null) - return; - - IAdaptable[] elements= set.getElements(); - for (int i= 0; i < elements.length; i++) { - if (elements[i] instanceof ICElement) - addCElements(cElements, (ICElement)elements[i]); - else - addCElements(cElements, elements[i]); - } - } - /** - * @param cElements - * @param adaptable - */ - private void addCElements(Set cElements, IAdaptable resource) { - ICElement cElement= (ICElement)resource.getAdapter(ICElement.class); - if (cElement == null) - // not an ICElement resource - return; - - addCElements(cElements, cElement); - } - /** - * @param cElements - * @param element - */ - private void addCElements(Set cElements, ICElement element) { - cElements.add(element); - } - - /** - * @param fStructuredSelection - * @return - */ - public ICSearchScope createCSearchScope(IStructuredSelection fStructuredSelection) { - Set cElements = new HashSet( fStructuredSelection.size() ); - - Iterator iter = fStructuredSelection.iterator(); - while( iter.hasNext() ){ - addCElements( cElements, (IAdaptable)iter.next() ); - } - - return createCSearchScope( cElements ); - } - - - public IWorkingSet[] queryWorkingSets() { - Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell(); - if (shell == null) - return null; - IWorkingSetSelectionDialog dialog= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true); - if (dialog.open() == Window.OK) { - IWorkingSet[] workingSets= dialog.getSelection(); - if (workingSets.length > 0) - return workingSets; - } - return null; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java deleted file mode 100644 index 4d866b61527..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchUtil.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 12, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.resources.IMarker; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkingSet; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchUtil { - - /** - * - */ - public CSearchUtil() { - super(); - // TODO Auto-generated constructor stub - } - - /** - * @param sets - */ - public static void updateLRUWorkingSets(IWorkingSet[] sets) { - // TODO Auto-generated method stub - - } - - /** - * @param object - * @param shell - */ - public static void warnIfBinaryConstant( ICElement element, Shell shell) { - // TODO Auto-generated method stub - - } - - /** - * @param workingSets - * @return - */ - public static Object toString(IWorkingSet[] workingSets) { - if( workingSets != null & workingSets.length > 0 ){ - String string = new String(); - for( int i = 0; i < workingSets.length; i++ ){ - if( i > 0 ) - string += ", "; //$NON-NLS-1$ - string += workingSets[i].getName(); - } - - return string; - } - - return null; - } - - /** - * @param marker - * @return - */ - public static ICElement getCElement(IMarker marker) { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchViewActionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchViewActionGroup.java deleted file mode 100644 index c6083e4dc49..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchViewActionGroup.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 18, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.search.ui.ISearchResultView; -import org.eclipse.ui.actions.ActionGroup; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchViewActionGroup extends ActionGroup { - - /** - * @param part - */ - public CSearchViewActionGroup(ISearchResultView part) { - - // TODO Auto-generated constructor stub - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ElementNameSorter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ElementNameSorter.java deleted file mode 100644 index 2e8bbae4b75..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ElementNameSorter.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 24, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.ui.CSearchResultLabelProvider; -import org.eclipse.core.resources.IMarker; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.search.ui.ISearchResultView; -import org.eclipse.search.ui.ISearchResultViewEntry; -import org.eclipse.search.ui.SearchUI; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ElementNameSorter extends ViewerSorter { - - public int compare( Viewer viewer, Object e1, Object e2 ){ - String name1 = null, name2 = null; - - ISearchResultViewEntry entry1 = null; - ISearchResultViewEntry entry2 = null; - - if (e1 instanceof ISearchResultViewEntry){ - name1 = _labelProvider.getText(e1); - entry1 = (ISearchResultViewEntry)e1; - } - - if (e2 instanceof ISearchResultViewEntry){ - name2 = _labelProvider.getText(e2); - entry2 = (ISearchResultViewEntry)e2; - } - - if (name1 == null) - name1= ""; //$NON-NLS-1$ - - if (name2 == null) - name2= ""; //$NON-NLS-1$ - - int compare = getCollator().compare( name1, name2 ); - - if( compare == 0 ){ - int startPos1 = -1; - int startPos2 = -1; - IMarker marker1 = entry1.getSelectedMarker(); - IMarker marker2 = entry2.getSelectedMarker(); - - if (marker1 != null) - startPos1 = marker1.getAttribute( IMarker.CHAR_START, -1 ); - if (marker2 != null) - startPos2 = marker2.getAttribute( IMarker.CHAR_START, -1 ); - - compare = startPos1 - startPos2; - } - - return compare; - } - - public boolean isSorterProperty( Object element, String property ){ - return true; - } - - public void sort( Viewer viewer, Object[] elements ) { - // Set label provider to show "element - path" - ISearchResultView view = SearchUI.getSearchResultView(); - if (view == null) - return; - - _labelProvider = view.getLabelProvider(); - - if( _labelProvider instanceof CSearchResultLabelProvider ) { - ((CSearchResultLabelProvider)_labelProvider).setOrder( CSearchResultLabelProvider.SHOW_ELEMENT_CONTAINER ); - super.sort( viewer, elements ); - } - } - - private ILabelProvider _labelProvider; -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GotoMarkerAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GotoMarkerAction.java deleted file mode 100644 index c32010233d6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GotoMarkerAction.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 18, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.ui.util.EditorUtility; -import org.eclipse.cdt.internal.ui.util.SelectionUtil; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.Action; -import org.eclipse.search.ui.ISearchResultView; -import org.eclipse.search.ui.ISearchResultViewEntry; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.ide.IDE; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class GotoMarkerAction extends Action { - - public GotoMarkerAction(){ - - } - - public void run() { - ISearchResultView view = SearchUI.getSearchResultView(); - Object element = SelectionUtil.getSingleElement( view.getSelection() ); - if( element instanceof ISearchResultViewEntry ) { - ISearchResultViewEntry entry = (ISearchResultViewEntry) element; - show( entry.getSelectedMarker() ); - } - } - - private void show( IMarker marker ){ - IResource resource = marker.getResource(); - if( resource == null || !resource.exists() ){ - return; - } - - IWorkbenchPage page = CUIPlugin.getActivePage(); - ICElement element = CSearchUtil.getCElement( marker ); - - if( SearchUI.reuseEditor() ){ - showWithReuse( marker, resource, element, page ); - } else { - showWithoutReuse( marker, element, page ); - } - } - - private void showWithoutReuse( IMarker marker, ICElement element, IWorkbenchPage page ){ - IEditorPart editor = null; - try{ - Object objectToOpen = ( element != null ) ? (Object) element : (Object) marker.getResource(); - editor = EditorUtility.openInEditor( objectToOpen, false ); - } catch ( CoreException e ) { - //boo - } - if( editor != null ){ - IDE.gotoMarker(editor, marker); - } - } - - private void showWithReuse( IMarker marker, IResource resource, ICElement element, IWorkbenchPage page ) { - if( !(resource instanceof IFile) ){ - return; - } - - IEditorPart editor = EditorUtility.isOpenInEditor( element ); - if( editor != null ){ - page.bringToTop( editor ); - } else { - - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GroupByKeyComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GroupByKeyComputer.java deleted file mode 100644 index b1b43cfd20b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/GroupByKeyComputer.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 18, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.search.ui.IGroupByKeyComputer; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class GroupByKeyComputer implements IGroupByKeyComputer { - - /* (non-Javadoc) - * @see org.eclipse.search.ui.IGroupByKeyComputer#computeGroupByKey(org.eclipse.core.resources.IMarker) - */ - - public Object computeGroupByKey(IMarker marker) { - if( marker == null ){ - return null; - } - - IMatch match = null; - - try { - match = (IMatch) marker.getAttribute(CSearchResultCollector.IMATCH); - } catch (CoreException e) { - } - - return match.getParentName() + "::" + match.getName() + " - " + match.getLocation(); } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OpenCSearchPageAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OpenCSearchPageAction.java deleted file mode 100644 index c99ff3ccbad..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OpenCSearchPageAction.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Created on Jul 11, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.search.ui.SearchUI; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -/** - * @author bgheorgh - */ -public class OpenCSearchPageAction implements IWorkbenchWindowActionDelegate { - - private static final String C_SEARCH_PAGE_ID= "org.eclipse.cdt.ui.CSearchPage"; - - private IWorkbenchWindow fWindow; - - public OpenCSearchPageAction() { - super(); - // TODO Auto-generated constructor stub - } - - public void init(IWorkbenchWindow window) { - fWindow= window; - } - - public void run(IAction action) { - if (fWindow == null || fWindow.getActivePage() == null) { - beep(); - return; - } - SearchUI.openSearchDialog(fWindow, C_SEARCH_PAGE_ID); - } - - public void selectionChanged(IAction action, ISelection selection) { - // do nothing since the action isn't selection dependent. - } - - public void dispose() { - fWindow= null; - } - - protected void beep() { - Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell(); - if (shell != null && shell.getDisplay() != null) - shell.getDisplay().beep(); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ParentNameSorter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ParentNameSorter.java deleted file mode 100644 index 2b8000e70dc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/ParentNameSorter.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 24, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.ui.CSearchResultLabelProvider; -import org.eclipse.core.resources.IMarker; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.search.ui.ISearchResultView; -import org.eclipse.search.ui.ISearchResultViewEntry; -import org.eclipse.search.ui.SearchUI; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class ParentNameSorter extends ViewerSorter { - - public int compare(Viewer viewer, Object e1, Object e2) { - String name1= null; - String name2= null; - - ISearchResultViewEntry entry1 = null; - ISearchResultViewEntry entry2 = null; - - if (e1 instanceof ISearchResultViewEntry){ - name1 = _labelProvider.getText(e1); - entry1 = (ISearchResultViewEntry)e1; - } - - if (e2 instanceof ISearchResultViewEntry){ - name2 = _labelProvider.getText(e2); - entry2 = (ISearchResultViewEntry)e2; - } - - if (name1 == null) - name1= ""; //$NON-NLS-1$ - - if (name2 == null) - name2= ""; //$NON-NLS-1$ - - int compare = getCollator().compare( name1, name2 ); - - if( compare == 0 ){ - int startPos1 = -1; - int startPos2 = -1; - IMarker marker1 = entry1.getSelectedMarker(); - IMarker marker2 = entry2.getSelectedMarker(); - - if (marker1 != null) - startPos1 = marker1.getAttribute( IMarker.CHAR_START, -1 ); - if (marker2 != null) - startPos2 = marker2.getAttribute( IMarker.CHAR_START, -1 ); - - compare = startPos1 - startPos2; - } - - return compare; - } - - /* - * Overrides method from ViewerSorter - */ - public boolean isSorterProperty(Object element, String property) { - return true; - } - - /* - * Overrides method from ViewerSorter - */ - public void sort(Viewer viewer, Object[] elements) { - // Set label provider to show "path - resource" - ISearchResultView view = SearchUI.getSearchResultView(); - if (view == null) - return; - - _labelProvider = view.getLabelProvider(); - - if( _labelProvider instanceof CSearchResultLabelProvider ) - ((CSearchResultLabelProvider)_labelProvider).setOrder( CSearchResultLabelProvider.SHOW_CONTAINER_ELEMENT ); - - super.sort( viewer, elements ); - } - - private ILabelProvider _labelProvider; -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PathNameSorter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PathNameSorter.java deleted file mode 100644 index ea55a52dc75..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PathNameSorter.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 24, 2003 - */ -package org.eclipse.cdt.internal.ui.search; - -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.ui.CSearchResultLabelProvider; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.search.ui.ISearchResultView; -import org.eclipse.search.ui.ISearchResultViewEntry; -import org.eclipse.search.ui.SearchUI; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class PathNameSorter extends ViewerSorter { - - /* - * Overrides method from ViewerSorter - */ - public int compare(Viewer viewer, Object e1, Object e2) { - String name1 = null; - String name2 = null; - ISearchResultViewEntry entry1 = null; - ISearchResultViewEntry entry2 = null; - IMatch match1 = null; - IMatch match2 = null; - - if( e1 instanceof ISearchResultViewEntry ) { - entry1 = (ISearchResultViewEntry)e1; - try { - match1 = (IMatch)entry1.getSelectedMarker().getAttribute( CSearchResultCollector.IMATCH ); - } catch (CoreException e) { - } - name1 = match1.getLocation().toString(); - } - if( e2 instanceof ISearchResultViewEntry ) { - entry2 = (ISearchResultViewEntry)e2; - try { - match2 = (IMatch)entry2.getSelectedMarker().getAttribute( CSearchResultCollector.IMATCH ); - } catch (CoreException e) { - } - //name2 = _labelProvider.getText( e2 ); - name2 = match2.getLocation().toString(); - } - - if( name1 == null ) - name1 = ""; //$NON-NLS-1$ - - if( name2 == null ) - name2 = ""; //$NON-NLS-1$ - - int compare = getCollator().compare( name1, name2 ); - - if( compare == 0 ){ - int startPos1 = -1; - int startPos2 = -1; - - if (match1 != null) - startPos1 = match1.getStartOffset(); - if (match2 != null) - startPos2 = match2.getStartOffset(); - - compare = startPos1 - startPos2; - } - - return compare; - } - - /* - * Overrides method from ViewerSorter - */ - public boolean isSorterProperty(Object element, String property) { - return true; - } - - /* - * Overrides method from ViewerSorter - */ - public void sort( Viewer viewer, Object[] elements ) { - // Set label provider to show "path - resource" - ISearchResultView view = SearchUI.getSearchResultView(); - if( view == null ) - return; - - _labelProvider = view.getLabelProvider(); - if( _labelProvider instanceof CSearchResultLabelProvider ) - ((CSearchResultLabelProvider)_labelProvider).setOrder( CSearchResultLabelProvider.SHOW_PATH ); - super.sort( viewer, elements ); - } - - private ILabelProvider _labelProvider; -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractCScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractCScanner.java deleted file mode 100644 index b00c070511b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractCScanner.java +++ /dev/null @@ -1,219 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.RGB; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.StringConverter; -import org.eclipse.jface.text.TextAttribute; -import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * Initialized with a color manager and a preference store, its subclasses are - * only responsible for providing a list of preference keys based on which tokens - * are generated and to use this tokens to define the rules controlling this scanner. - */ -public abstract class AbstractCScanner extends BufferedRuleBasedScanner { - - - private IColorManager fColorManager; - private IPreferenceStore fPreferenceStore; - - private Map fTokenMap= new HashMap(); - private String[] fPropertyNamesColor; - private String[] fPropertyNamesStyle; - - private IToken fDefaultToken; - - - /** - * Returns the list of preference keys which define the tokens - * used in the rules of this scanner. - */ - abstract protected String[] getTokenProperties(); - - /** - * Creates the list of rules controlling this scanner. - */ - abstract protected List createRules(); - - - /** - * Creates an abstract Java scanner. - */ - public AbstractCScanner(IColorManager manager, IPreferenceStore store) { - super(); - fColorManager= manager; - fPreferenceStore= store; - } - - /** - * Creates an abstract Java scanner. - */ - public AbstractCScanner(IColorManager manager, IPreferenceStore store, int bufsize) { - super(bufsize); - fColorManager= manager; - fPreferenceStore= store; - } - /** - * Must be called after the constructor has been called. - */ - public final void initialize() { - - fPropertyNamesColor= getTokenProperties(); - int length= fPropertyNamesColor.length; - fPropertyNamesStyle= new String[length]; - for (int i= 0; i < length; i++) { - fPropertyNamesStyle[i]= fPropertyNamesColor[i] + "_bold"; //$NON-NLS-1$ - addToken(fPropertyNamesColor[i], fPropertyNamesStyle[i]); - } - - initializeRules(); - } - - private void addToken(String colorKey, String styleKey) { - RGB rgb= PreferenceConverter.getColor(fPreferenceStore, colorKey); - if (fColorManager instanceof IColorManagerExtension) { - IColorManagerExtension ext= (IColorManagerExtension) fColorManager; - ext.unbindColor(colorKey); - ext.bindColor(colorKey, rgb); - } - - boolean bold= fPreferenceStore.getBoolean(styleKey); - fTokenMap.put(colorKey, new Token(new TextAttribute(fColorManager.getColor(colorKey), null, bold ? SWT.BOLD : SWT.NORMAL))); - } - - protected Token getToken(String key) { - return (Token) fTokenMap.get(key); - } - - private void initializeRules() { - List rules= createRules(); - if (rules != null) { - IRule[] result= new IRule[rules.size()]; - rules.toArray(result); - setRules(result); - } - } - - private int indexOf(String property) { - if (property != null) { - int length= fPropertyNamesColor.length; - for (int i= 0; i < length; i++) { - if (property.equals(fPropertyNamesColor[i]) || property.equals(fPropertyNamesStyle[i])) - return i; - } - } - return -1; - } - - public boolean affectsBehavior(PropertyChangeEvent event) { - return indexOf(event.getProperty()) >= 0; - } - - public void adaptToPreferenceChange(PropertyChangeEvent event) { - String p= event.getProperty(); - int index= indexOf(p); - Token token = getToken(fPropertyNamesColor[index]); - if (fPropertyNamesColor[index].equals(p)) - adaptToColorChange(token, event); - else - adaptToStyleChange(token, event); - } - - private void adaptToColorChange(Token token, PropertyChangeEvent event) { - RGB rgb= null; - - Object value= event.getNewValue(); - if (value instanceof RGB) - rgb= (RGB) value; - else if (value instanceof String) { - rgb= StringConverter.asRGB((String) value); - } - - if (rgb != null) { - - String property= event.getProperty(); - - if (fColorManager instanceof IColorManagerExtension) { - IColorManagerExtension ext= (IColorManagerExtension) fColorManager; - ext.unbindColor(property); - ext.bindColor(property, rgb); - } - - Object data= token.getData(); - if (data instanceof TextAttribute) { - TextAttribute oldAttr= (TextAttribute) data; - token.setData(new TextAttribute(fColorManager.getColor(property), oldAttr.getBackground(), oldAttr.getStyle())); - } - } - } - - private void adaptToStyleChange(Token token, PropertyChangeEvent event) { - boolean bold= false; - Object value= event.getNewValue(); - if (value instanceof Boolean) - bold= ((Boolean) value).booleanValue(); - else if (value instanceof String) { - String s= (String) value; - if (IPreferenceStore.TRUE.equals(s)) - bold= true; - else if (IPreferenceStore.FALSE.equals(s)) - bold= false; - } - - Object data= token.getData(); - if (data instanceof TextAttribute) { - TextAttribute oldAttr= (TextAttribute) data; - boolean isBold= (oldAttr.getStyle() == SWT.BOLD); - if (isBold != bold) - token.setData(new TextAttribute(oldAttr.getForeground(), oldAttr.getBackground(), bold ? SWT.BOLD : SWT.NORMAL)); - } - } - - /** - * Returns the next token in the document. - * - * @return the next token in the document - */ - public IToken nextToken() { - - IToken token; - - while (true) { - - fTokenOffset= fOffset; - fColumn= UNDEFINED; - - for (int i= 0; i < fRules.length; i++) { - token= (fRules[i].evaluate(this)); - if (!token.isUndefined()) - return token; - } - if (read() == EOF) - return Token.EOF; - else - return fDefaultToken; - } - } - - public void setDefaultReturnToken(IToken token) { - fDefaultToken = token; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java deleted file mode 100644 index cfcd123c2a3..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.util.Assert; - -/** - * A buffered document scanner. The buffer always contains a section - * of a fixed size of the document to be scanned. - */ -public final class BufferedDocumentScanner implements ICharacterScanner { - - /** The document being scanned. */ - private IDocument fDocument; - /** The offset of the document range to scan. */ - private int fRangeOffset; - /** The length of the document range to scan. */ - private int fRangeLength; - /** The delimiters of the document. */ - private char[][] fDelimiters; - - /** The buffer. */ - private final char[] fBuffer; - /** The offset of the buffer within the document. */ - private int fBufferOffset; - /** The valid length of the buffer for access. */ - private int fBufferLength; - /** The offset of the scanner within the buffer. */ - private int fOffset; - - /** - * Creates a new buffered document scanner. - * The buffer size is set to the given number of characters. - * - * @param size the buffer size - */ - public BufferedDocumentScanner(int size) { - Assert.isTrue(size >= 1); - fBuffer= new char[size]; - } - - /** - * Fills the buffer with the contents of the document starting at the given offset. - * - * @param offset the document offset at which the buffer starts - */ - private final void updateBuffer(int offset) { - - // Clamp at start of the file document range - if (offset < 0) - offset = 0; - - fBufferOffset= offset; - fBufferLength= fBuffer.length; - - // assert(offset >= fRangeOffset && offset < fRangeOffset + fRangeLength); - - if (fBufferOffset + fBufferLength > fRangeOffset + fRangeLength) - fBufferLength= fRangeOffset + fRangeLength - fBufferOffset; - - try { - final String content= fDocument.get(fBufferOffset, fBufferLength); - content.getChars(0, fBufferLength, fBuffer, 0); - - } catch (BadLocationException e) { - } - } - - /** - * Configures the scanner by providing access to the document range over which to scan. - * - * @param document the document to scan - * @param offset the offset of the document range to scan - * @param length the length of the document range to scan - */ - public final void setRange(IDocument document, int offset, int length) { - - fDocument= document; - fRangeOffset= offset; - fRangeLength= length; - - // Clamp at end of the real document - if (fRangeLength + fRangeOffset > fDocument.getLength()) - fRangeLength = fDocument.getLength() - fRangeOffset; - - String[] delimiters= document.getLegalLineDelimiters(); - fDelimiters= new char[delimiters.length][]; - for (int i= 0; i < delimiters.length; i++) - fDelimiters[i]= delimiters[i].toCharArray(); - - updateBuffer(offset); - fOffset= 0; - } - - /* - * @see ICharacterScanner#read() - */ - public final int read() { - - if (fOffset >= fBufferLength) { - if (fBufferOffset + fBufferLength >= fRangeOffset + fRangeLength) - return EOF; - else { - updateBuffer(fBufferOffset + fBufferLength); - fOffset= 0; - } - } - - return fBuffer[fOffset++]; - } - - /* - * @see ICharacterScanner#unread - */ - public final void unread() { - - if (fOffset <= 0) { - if (fBufferOffset <= fRangeOffset) { - // error: BOF - } else { - updateBuffer(fBufferOffset - fBuffer.length); - fOffset = fBuffer.length - 1; // should always be a valid place - } - } else { - --fOffset; - } - } - - /* - * @see ICharacterScanner#getColumn() - */ - public final int getColumn() { - - try { - final int offset= fBufferOffset + fOffset; - final int line= fDocument.getLineOfOffset(offset); - final int start= fDocument.getLineOffset(line); - - return offset - start; - - } catch (BadLocationException e) { - } - - return -1; - } - - /* - * @see ICharacterScanner#getLegalLineDelimiters() - */ - public final char[][] getLegalLineDelimiters() { - return fDelimiters; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java deleted file mode 100644 index 3f52ee21437..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAnnotationHover.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.IAnnotationHover; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.texteditor.MarkerAnnotation; - -public class CAnnotationHover implements IAnnotationHover { - - /** - * Returns the distance to the ruler line. - */ - protected int compareRulerLine(Position position, IDocument document, int line) { - - if (position.getOffset() > -1 && position.getLength() > -1) { - try { - int markerLine= document.getLineOfOffset(position.getOffset()); - if (line == markerLine) - return 1; - if (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength())) - return 2; - } catch (BadLocationException x) { - } - } - - return 0; - } - - /** - * Selects a set of markers from the two lists. By default, it just returns - * the set of exact matches. - */ - protected List select(List exactMatch, List including) { - return exactMatch; - } - - /** - * Returns one marker which includes the ruler's line of activity. - */ - protected List getMarkersForLine(ISourceViewer viewer, int line) { - - IDocument document= viewer.getDocument(); - IAnnotationModel model= viewer.getAnnotationModel(); - - if (model == null) - return null; - - List exact= new ArrayList(); - List including= new ArrayList(); - - Iterator e= model.getAnnotationIterator(); - while (e.hasNext()) { - Object o= e.next(); - if (o instanceof MarkerAnnotation) { - MarkerAnnotation a= (MarkerAnnotation) o; - switch (compareRulerLine(model.getPosition(a), document, line)) { - case 1: - exact.add(a.getMarker()); - break; - case 2: - including.add(a.getMarker()); - break; - } - } - } - - return select(exact, including); - } - - /* - * @see IVerticalRulerHover#getHoverInfo(ISourceViewer, int) - */ - public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { - List markers= getMarkersForLine(sourceViewer, lineNumber); - if (markers != null) { - - if (markers.size() == 1) { - - // optimization - IMarker marker= (IMarker) markers.get(0); - String message= marker.getAttribute(IMarker.MESSAGE, (String) null); - if (message != null && message.trim().length() > 0) - return formatSingleMessage(message); - - } else { - - List messages= new ArrayList(); - - Iterator e= markers.iterator(); - while (e.hasNext()) { - IMarker marker= (IMarker) e.next(); - String message= marker.getAttribute(IMarker.MESSAGE, (String) null); - if (message != null && message.trim().length() > 0) - messages.add(message.trim()); - } - - if (messages.size() == 1) - return formatSingleMessage((String) messages.get(0)); - - if (messages.size() > 1) - return formatMultipleMessages(messages); - } - } - - return null; - } - - - private int getHoverWidth(Display display) { - Rectangle displayBounds= display.getBounds(); - int hoverWidth= displayBounds.width - (display.getCursorLocation().x - displayBounds.x); - hoverWidth-= 12; // XXX: Add some space to the border, Revisit - if (hoverWidth < 200) { - hoverWidth= 200; - } - return hoverWidth; - } - - /* - * Formats a message as HTML text. - */ - private String formatSingleMessage(String message) { - StringBuffer buffer= new StringBuffer(); - HTMLPrinter.addPageProlog(buffer); - HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message)); - HTMLPrinter.addPageEpilog(buffer); - return buffer.toString(); - } - - /* - * Formats several message as HTML text. - */ - private String formatMultipleMessages(List messages) { - StringBuffer buffer= new StringBuffer(); - HTMLPrinter.addPageProlog(buffer); - HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent("Multiple markers at this line")); - - HTMLPrinter.startBulletList(buffer); - Iterator e= messages.iterator(); - while (e.hasNext()) - HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String) e.next())); - HTMLPrinter.endBulletList(buffer); - - HTMLPrinter.addPageEpilog(buffer); - return buffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java deleted file mode 100644 index 0c18f9800f8..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java +++ /dev/null @@ -1,225 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultAutoIndentStrategy; -import org.eclipse.jface.text.DocumentCommand; -import org.eclipse.jface.text.IDocument; - - -import org.eclipse.cdt.ui.CUIPlugin; - -/** - * Auto indent strategy sensitive to brackets. - */ -public class CAutoIndentStrategy extends DefaultAutoIndentStrategy { - - - public CAutoIndentStrategy() { - } - - // evaluate the line with the opening bracket that matches the closing bracket on the given line - protected int findMatchingOpenBracket(IDocument d, int line, int end, int closingBracketIncrease) throws BadLocationException { - - - int start= d.getLineOffset(line); - int brackcount= getBracketCount(d, start, end, false) - closingBracketIncrease; - - - // sum up the brackets counts of each line (closing brackets count negative, - // opening positive) until we find a line the brings the count to zero - while (brackcount < 0) { - line--; - if (line < 0) { - return -1; - } - start= d.getLineOffset(line); - end= start + d.getLineLength(line) - 1; - brackcount += getBracketCount(d, start, end, false); - } - return line; - } - - - private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException { - int bracketcount= 0; - while (start < end) { - char curr= d.getChar(start); - start++; - switch (curr) { - case '/' : - if (start < end) { - char next= d.getChar(start); - if (next == '*') { - // a comment starts, advance to the comment end - start= getCommentEnd(d, start + 1, end); - } else if (next == '/') { - // '//'-comment: nothing to do anymore on this line - start= end; - } - } - break; - case '*' : - if (start < end) { - char next= d.getChar(start); - if (next == '/') { - // we have been in a comment: forget what we read before - bracketcount= 0; - start++; - } - } - break; - case '{' : - bracketcount++; - ignoreCloseBrackets= false; - break; - case '}' : - if (!ignoreCloseBrackets) { - bracketcount--; - } - break; - case '"' : - case '\'' : - start= getStringEnd(d, start, end, curr); - break; - default : - } - } - return bracketcount; - } - - // ----------- bracket counting ------------------------------------------------------ - - - private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException { - while (pos < end) { - char curr= d.getChar(pos); - pos++; - if (curr == '*') { - if (pos < end && d.getChar(pos) == '/') { - return pos + 1; - } - } - } - return end; - } - - protected String getIndentOfLine(IDocument d, int line) throws BadLocationException { - if (line > -1) { - int start= d.getLineOffset(line); - int end= start + d.getLineLength(line) - 1; - int whiteend= findEndOfWhiteSpace(d, start, end); - return d.get(start, whiteend - start); - } else { - return ""; - } - } - - private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException { - while (pos < end) { - char curr= d.getChar(pos); - pos++; - if (curr == '\\') { - // ignore escaped characters - pos++; - } else if (curr == ch) { - return pos; - } - } - return end; - } - - protected void smartInsertAfterBracket(IDocument d, DocumentCommand c) { - if (c.offset == -1 || d.getLength() == 0) - return; - - try { - int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset); - int line= d.getLineOfOffset(p); - int start= d.getLineOffset(line); - int whiteend= findEndOfWhiteSpace(d, start, c.offset); - - - // shift only when line does not contain any text up to the closing bracket - if (whiteend == c.offset) { - // evaluate the line with the opening bracket that matches out closing bracket - int indLine= findMatchingOpenBracket(d, line, c.offset, 1); - if (indLine != -1 && indLine != line) { - // take the indent of the found line - StringBuffer replaceText= new StringBuffer(getIndentOfLine(d, indLine)); - // add the rest of the current line including the just added close bracket - replaceText.append(d.get(whiteend, c.offset - whiteend)); - replaceText.append(c.text); - // modify document command - c.length= c.offset - start; - c.offset= start; - c.text= replaceText.toString(); - } - } - } catch (BadLocationException excp) { - CUIPlugin.getDefault().log(excp); - } - } - - protected void smartIndentAfterNewLine(IDocument d, DocumentCommand c) { - int docLength= d.getLength(); - if (c.offset == -1 || docLength == 0) - return; - - try { - int p= (c.offset == docLength ? c.offset - 1 : c.offset); - int line= d.getLineOfOffset(p); - - - StringBuffer buf= new StringBuffer(c.text); - if (c.offset < docLength && d.getChar(c.offset) == '}') { - int indLine= findMatchingOpenBracket(d, line, c.offset, 0); - if (indLine == -1) { - indLine= line; - } - buf.append(getIndentOfLine(d, indLine)); - } else { - int start= d.getLineOffset(line); - int whiteend= findEndOfWhiteSpace(d, start, c.offset); - buf.append(d.get(start, whiteend - start)); - if (getBracketCount(d, start, c.offset, true) > 0) { - buf.append('\t'); - } - } - c.text= buf.toString(); - - - } catch (BadLocationException excp) { - CUIPlugin.getDefault().log(excp); - } - } - - /** - * Returns whether the text ends with one of the given search strings. - */ - private boolean endsWithDelimiter(IDocument d, String txt) { - String[] delimiters= d.getLegalLineDelimiters(); - - for (int i= 0; i < delimiters.length; i++) { - if (txt.endsWith(delimiters[i])) - return true; - } - return false; - } - - - /** - * @see IAutoIndentStrategy#customizeDocumentCommand - */ - public void customizeDocumentCommand(IDocument d, DocumentCommand c) { - if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) - smartIndentAfterNewLine(d, c); - else if ("}".equals(c.text)) { - smartInsertAfterBracket(d, c); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeReader.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeReader.java deleted file mode 100644 index 13de07bfd48..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeReader.java +++ /dev/null @@ -1,230 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; - -/** - * Reads from a document either forwards or backwards. May be configured to - * skip comments and strings. - */ -public class CCodeReader extends SingleCharReader { - - /** The EOF character */ - public static final int EOF= -1; - - private boolean fSkipComments= false; - private boolean fSkipStrings= false; - private boolean fForward= false; - - private IDocument fDocument; - private int fOffset; - - private int fEnd= -1; - private int fCachedLineNumber= -1; - private int fCachedLineOffset= -1; - - - public CCodeReader() { - } - - /** - * Returns the offset of the last read character. Should only be called after read has been called. - */ - public int getOffset() { - return fForward ? fOffset -1 : fOffset; - } - - public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException { - fDocument= document; - fOffset= offset; - fSkipComments= skipComments; - fSkipStrings= skipStrings; - - fForward= true; - fEnd= Math.min(fDocument.getLength(), fOffset + length); - } - - public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException { - fDocument= document; - fOffset= offset; - fSkipComments= skipComments; - fSkipStrings= skipStrings; - - fForward= false; - try { - fCachedLineNumber= fDocument.getLineOfOffset(fOffset); - } catch (BadLocationException x) { - throw new IOException(x.getMessage()); - } - } - - /* - * @see Reader#close() - */ - public void close() throws IOException { - fDocument= null; - } - - /* - * @see SingleCharReader#read() - */ - public int read() throws IOException { - try { - return fForward ? readForwards() : readBackwards(); - } catch (BadLocationException x) { - throw new IOException(x.getMessage()); - } - } - - private void gotoCommentEnd() throws BadLocationException { - while (fOffset < fEnd) { - char current= fDocument.getChar(fOffset++); - if (current == '*') { - if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') { - ++ fOffset; - return; - } - } - } - } - - private void gotoStringEnd(char delimiter) throws BadLocationException { - while (fOffset < fEnd) { - char current= fDocument.getChar(fOffset++); - if (current == '\\') { - // ignore escaped characters - ++ fOffset; - } else if (current == delimiter) { - return; - } - } - } - - private void gotoLineEnd() throws BadLocationException { - int line= fDocument.getLineOfOffset(fOffset); - fOffset= fDocument.getLineOffset(line + 1); - } - - private int readForwards() throws BadLocationException { - while (fOffset < fEnd) { - char current= fDocument.getChar(fOffset++); - - switch (current) { - case '/': - - if (fSkipComments && fOffset < fEnd) { - char next= fDocument.getChar(fOffset); - if (next == '*') { - // a comment starts, advance to the comment end - ++ fOffset; - gotoCommentEnd(); - continue; - } else if (next == '/') { - // '//'-comment starts, advance to the line end - gotoLineEnd(); - continue; - } - } - - return current; - - case '"': - case '\'': - - if (fSkipStrings) { - gotoStringEnd(current); - continue; - } - - return current; - } - - return current; - } - - return EOF; - } - - private void handleSingleLineComment() throws BadLocationException { - int line= fDocument.getLineOfOffset(fOffset); - if (line < fCachedLineNumber) { - fCachedLineNumber= line; - fCachedLineOffset= fDocument.getLineOffset(line); - int offset= fOffset; - while (fCachedLineOffset < offset) { - char current= fDocument.getChar(offset--); - if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') { - fOffset= offset; - return; - } - } - } - } - - private void gotoCommentStart() throws BadLocationException { - while (0 < fOffset) { - char current= fDocument.getChar(fOffset--); - if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/') - return; - } - } - - private void gotoStringStart(char delimiter) throws BadLocationException { - while (0 < fOffset) { - char current= fDocument.getChar(fOffset); - if (current == delimiter) { - if ( !(0 <= fOffset && fDocument.getChar(fOffset -1) == '\\')) - return; - } - -- fOffset; - } - } - - private int readBackwards() throws BadLocationException { - - while (0 < fOffset) { - -- fOffset; - - handleSingleLineComment(); - - char current= fDocument.getChar(fOffset); - switch (current) { - case '/': - - if (fSkipComments && fOffset > 1) { - char next= fDocument.getChar(fOffset - 1); - if (next == '*') { - // a comment ends, advance to the comment start - fOffset -= 2; - gotoCommentStart(); - continue; - } - } - - return current; - - case '"': - case '\'': - - if (fSkipStrings) { - -- fOffset; - gotoStringStart(current); - continue; - } - - return current; - } - - return current; - } - - return EOF; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java deleted file mode 100644 index 6159a8d6153..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCodeScanner.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.internal.ui.text.util.CWordDetector; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.SingleLineRule; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WordRule; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * A C code scanner. - */ -public final class CCodeScanner extends AbstractCScanner { - - - private static String[] fgKeywords= { - "asm", "auto", - "break", - "case", - "const", "continue", - "default", "do", - "else", "enum", "extern", - "for", - "goto", - "if", "inline", - "register", "return", "restrict", - "sizeof", "static", "struct", "switch", - "typedef", - "union", - "volatile", - "while", "_Pragma" - }; - - - private static String[] fgTypes= { "char", "double", "float", "int", "long", "short", "signed", "unsigned", "void", "_Bool", "_Complex", "_Imaginary"}; - private static String[] fgConstants= { "NULL", "__DATE__", "__LINE__", "__TIME__", "__FILE__", "__STDC__"}; - private static String[] fgPreprocessor= { "#define", "#undef", "#include", "#error", "#warning", "#pragma", "#ifdef", "#ifndef", "#if", "#else", "#elif", "#endif", "#line"}; - - - private static String[] fgTokenProperties= { - ICColorConstants.C_KEYWORD, - ICColorConstants.C_TYPE, - ICColorConstants.C_STRING, - ICColorConstants.C_DEFAULT - }; - - - /** - * Creates a C code scanner - */ - public CCodeScanner(IColorManager manager, IPreferenceStore store) { - super(manager, store); - initialize(); - } - - /* - * @see AbstractCScanner#getTokenProperties() - */ - protected String[] getTokenProperties() { - return fgTokenProperties; - } - - /* - * @see AbstractCScanner#createRules() - */ - protected List createRules() { - - List rules= new ArrayList(); - - // Add rule for strings - Token token= getToken(ICColorConstants.C_STRING); - // Add rule for strings and character constants. - rules.add(new SingleLineRule("'", "'", token, '\\')); - - - // Add generic whitespace rule. - //rules.add(new WhitespaceRule(new CWhitespaceDetector())); - - - // Add word rule for keywords, types, and constants. - token= getToken(ICColorConstants.C_DEFAULT); - WordRule wordRule= new WordRule(new CWordDetector(), token); - - token= getToken(ICColorConstants.C_KEYWORD); - for (int i=0; i= start) { // 1GEYL1R: ITPJUI:ALL - java doc edit smartness not work for class comments - // append to input - buf.append(d.get(start, end - start)); - if (end < c.offset) { - if (d.getChar(end) == '/') { - // javadoc started on this line - buf.append(" * "); //$NON-NLS-1$ - } else if (d.getChar(end) == '*') { - buf.append("* "); //$NON-NLS-1$ - } - } - } - - - c.text= buf.toString(); - - } catch (BadLocationException excp) { - // stop work - } - } - - protected void jdocIndentForCommentEnd(IDocument d, DocumentCommand c) { - if (c.offset < 2 || d.getLength() == 0) { - return; - } - try { - if ("* ".equals(d.get(c.offset - 2, 2))) { //$NON-NLS-1$ - // modify document command - c.length++; - c.offset--; - } - } catch (BadLocationException excp) { - // stop work - } - } - - /* - * @see IAutoIndentStrategy#customizeDocumentCommand - */ - public void customizeDocumentCommand(IDocument d, DocumentCommand c) { - if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) - jdocIndentAfterNewLine(d, c); - else if ("/".equals(c.text)) { //$NON-NLS-1$ - jdocIndentForCommentEnd(d, c); - } - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentScanner.java deleted file mode 100644 index e8c9f852c05..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CCommentScanner.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.text; - - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.core.runtime.Preferences; -import org.eclipse.cdt.core.CCorePlugin; - -import org.eclipse.cdt.internal.ui.text.IColorManager; -import org.eclipse.cdt.internal.ui.text.ICColorConstants; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WordRule; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * CCommentScanner.java - */ -public class CCommentScanner extends AbstractCScanner -{ - private static class TaskTagDetector implements IWordDetector { - - public boolean isWordStart(char c) { - return Character.isLetter(c); - } - - public boolean isWordPart(char c) { - return Character.isLetter(c); - } - }; - - private class TaskTagRule extends WordRule { - - private IToken fToken; - - public TaskTagRule(IToken token) { - super(new TaskTagDetector(), Token.UNDEFINED); - fToken= token; - } - - public void clearTaskTags() { - fWords.clear(); - } - - public void addTaskTags(String value) { - String[] tasks= split(value, ","); //$NON-NLS-1$ - for (int i= 0; i < tasks.length; i++) { - if (tasks[i].length() > 0) { - addWord(tasks[i], fToken); - } - } - } - - private String[] split(String value, String delimiters) { - StringTokenizer tokenizer= new StringTokenizer(value, delimiters); - int size= tokenizer.countTokens(); - String[] tokens= new String[size]; - int i= 0; - while (i < size) - tokens[i++]= tokenizer.nextToken(); - return tokens; - } - } - - private static final String TRANSLATION_TASK_TAGS= CCorePlugin.TRANSLATION_TASK_TAGS; - protected static final String TASK_TAG= ICColorConstants.TASK_TAG; - - private TaskTagRule fTaskTagRule; - private Preferences fCorePreferenceStore; - private String fDefaultTokenProperty; - private String[] fTokenProperties; - - public CCommentScanner(IColorManager manager, IPreferenceStore store, Preferences coreStore, String defaultTokenProperty) { - this(manager, store, coreStore, defaultTokenProperty, new String[] { defaultTokenProperty, TASK_TAG }); - } - - public CCommentScanner(IColorManager manager, IPreferenceStore store, Preferences coreStore, String defaultTokenProperty, String[] tokenProperties) { - super(manager, store); - - fCorePreferenceStore= coreStore; - fDefaultTokenProperty= defaultTokenProperty; - fTokenProperties= tokenProperties; - - initialize(); - } - - /* - * @see AbstractCScanner#createRules() - */ - protected List createRules() { - List list= new ArrayList(); - - if (fCorePreferenceStore != null) { - // Add rule for Task Tags. - fTaskTagRule= new TaskTagRule(getToken(TASK_TAG)); - String tasks= fCorePreferenceStore.getString(TRANSLATION_TASK_TAGS); - fTaskTagRule.addTaskTags(tasks); - list.add(fTaskTagRule); - } - - setDefaultReturnToken(getToken(fDefaultTokenProperty)); - - return list; - } - - /* - * @see org.eclipse.cdt.internal.ui.text.AbstractJavaScanner#affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent) - */ - public boolean affectsBehavior(PropertyChangeEvent event) { - return event.getProperty().equals(TRANSLATION_TASK_TAGS) || super.affectsBehavior(event); - } - - /* - * @see org.eclipse.cdt.internal.ui.text.AbstractJavaScanner#adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent) - */ - public void adaptToPreferenceChange(PropertyChangeEvent event) { - if (fTaskTagRule != null && event.getProperty().equals(TRANSLATION_TASK_TAGS)) { - Object value= event.getNewValue(); - - if (value instanceof String) { - fTaskTagRule.clearTaskTags(); - fTaskTagRule.addTaskTags((String) value); - } - - } else if (super.affectsBehavior(event)) { - super.adaptToPreferenceChange(event); - } - } - - /* - * @see org.eclipse.cdt.internal.ui.text.AbstractJavaScanner#getTokenProperties() - */ - protected String[] getTokenProperties() { - return fTokenProperties; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CDoubleClickSelector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CDoubleClickSelector.java deleted file mode 100644 index 0ea6dd1075d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CDoubleClickSelector.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextDoubleClickStrategy; -import org.eclipse.jface.text.ITextViewer; - -/** - * Double click strategy aware of C identifier syntax rules. - */ -public class CDoubleClickSelector implements ITextDoubleClickStrategy { - - protected ITextViewer fText; - protected int fPos; - protected int fStartPos; - protected int fEndPos; - - - protected static char[] fgBrackets= {'{', '}', '(', ')', '[', ']', '"', '"'}; - - public CDoubleClickSelector() { - super(); - } - - - /** - * @see ITextDoubleClickStrategy#doubleClicked - */ - public void doubleClicked(ITextViewer text) { - fPos= text.getSelectedRange().x; - - - if (fPos < 0) - return; - - - fText= text; - - - if (!selectBracketBlock()) - selectWord(); - } - - - protected boolean matchBracketsAt() { - char prevChar, nextChar; - - - int i; - int bracketIndex1= fgBrackets.length; - int bracketIndex2= fgBrackets.length; - - - fStartPos= -1; - fEndPos= -1; - - // get the chars preceding and following the start position - try { - IDocument doc= fText.getDocument(); - - - prevChar= doc.getChar(fPos - 1); - nextChar= doc.getChar(fPos); - - - // is the char either an open or close bracket? - for (i= 0; i < fgBrackets.length; i= i + 2) { - if (prevChar == fgBrackets[i]) { - fStartPos= fPos - 1; - bracketIndex1= i; - } - } - for (i= 1; i < fgBrackets.length; i= i + 2) { - if (nextChar == fgBrackets[i]) { - fEndPos= fPos; - bracketIndex2= i; - } - } - - - if (fStartPos > -1 && bracketIndex1 < bracketIndex2) { - fEndPos= searchForClosingBracket(fStartPos, prevChar, fgBrackets[bracketIndex1 + 1], doc); - if (fEndPos > -1) - return true; - else - fStartPos= -1; - } else if (fEndPos > -1) { - fStartPos= searchForOpenBracket(fEndPos, fgBrackets[bracketIndex2 - 1], nextChar, doc); - if (fStartPos > -1) - return true; - else - fEndPos= -1; - } - } catch (BadLocationException x) { - } - - - return false; - } - - - protected boolean matchWord() { - IDocument doc= fText.getDocument(); - try { - int pos= fPos; - char c; - - - while (pos >= 0) { - c= doc.getChar(pos); - if (!Character.isJavaIdentifierPart(c)) - break; - --pos; - } - fStartPos= pos; - - - pos= fPos; - int length= doc.getLength(); - - - while (pos < length) { - c= doc.getChar(pos); - if (!Character.isJavaIdentifierPart(c)) - break; - ++pos; - } - fEndPos= pos; - - - return true; - - - } catch (BadLocationException x) { - } - return false; - } - - - protected int searchForClosingBracket(int startPos, char openBracket, char closeBracket, IDocument doc) throws BadLocationException { - int stack= 1; - int closePos= startPos + 1; - int length= doc.getLength(); - char nextChar; - - - while (closePos < length && stack > 0) { - nextChar= doc.getChar(closePos); - if (nextChar == openBracket && nextChar != closeBracket) - stack++; - else if (nextChar == closeBracket) - stack--; - closePos++; - } - - - if (stack == 0) - return closePos - 1; - else - return -1; - } - - - protected int searchForOpenBracket(int startPos, char openBracket, char closeBracket, IDocument doc) throws BadLocationException { - int stack= 1; - int openPos= startPos - 1; - char nextChar; - - while (openPos >= 0 && stack > 0) { - nextChar= doc.getChar(openPos); - if (nextChar == closeBracket && nextChar != openBracket) - stack++; - else if (nextChar == openBracket) - stack--; - openPos--; - } - - - if (stack == 0) - return openPos + 1; - else - return -1; - } - - - protected boolean selectBracketBlock() { - if (matchBracketsAt()) { - if (fStartPos == fEndPos) - fText.setSelectedRange(fStartPos, 0); - else - fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1); - - - return true; - } - return false; - } - - - protected void selectWord() { - if (matchWord()) { - if (fStartPos == fEndPos) - fText.setSelectedRange(fStartPos, 0); - else - fText.setSelectedRange(fStartPos + 1, fEndPos - fStartPos - 1); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CFormattingStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CFormattingStrategy.java deleted file mode 100644 index 531826dc8e3..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CFormattingStrategy.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.formatter.IFormattingStrategy; -import org.eclipse.jface.text.source.ISourceViewer; - - -import org.eclipse.cdt.internal.formatter.CCodeFormatter; - - -public class CFormattingStrategy implements IFormattingStrategy { - - - private String fInitialIndentation; - private ISourceViewer fViewer; - - - public CFormattingStrategy(ISourceViewer viewer) { - fViewer = viewer; - } - /** - * @see IFormattingStrategy#format(String, boolean, String, int[]) - */ - public String format(String content, boolean isLineStart, String indentation, int[] positions) { - //ConfigurableOption[] options= CUIPlugin.getDefault().getCodeFormatterOptions(); - CCodeFormatter formatter= new CCodeFormatter(/* null options */); - - //IDocument doc= fViewer.getDocument(); - //String lineDelimiter= getLineDelimiterFor(doc); - //formatter.options.setLineSeparator(lineDelimiter); - - - //formatter.setPositionsToMap(positions); - return formatter.formatSourceString(content); - } - /** - * @see IFormattingStrategy#formatterStarts(String) - */ - public void formatterStarts(String initialIndentation) { - fInitialIndentation= initialIndentation; - } - /** - * @see IFormattingStrategy#formatterStops() - */ - public void formatterStops() { - } - - /** - * Embodies the policy which line delimiter to use when inserting into - * a document - */ - private static String getLineDelimiterFor(IDocument doc) { - String lineDelim= null; - try { - lineDelim= doc.getLineDelimiter(0); - } catch (BadLocationException e) { - } - if (lineDelim == null) { - String systemDelimiter= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - String[] lineDelims= doc.getLegalLineDelimiters(); - for (int i= 0; i < lineDelims.length; i++) { - if (lineDelims[i].equals(systemDelimiter)) { - lineDelim= systemDelimiter; - break; - } - } - if (lineDelim == null) { - lineDelim= lineDelims.length > 0 ? lineDelims[0] : systemDelimiter; - } - } - return lineDelim; - } - - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPairMatcher.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPairMatcher.java deleted file mode 100644 index 6f7dfc80381..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPairMatcher.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.text.source.ICharacterPairMatcher; - -/** - * Helper class for match pairs of characters. - */ -public class CPairMatcher implements ICharacterPairMatcher { - - protected char[] fPairs; - protected IDocument fDocument; - protected int fOffset; - - protected int fStartPos; - protected int fEndPos; - protected int fAnchor; - - protected CCodeReader fReader = new CCodeReader(); - - public CPairMatcher(char[] pairs) { - fPairs = pairs; - } - - public IRegion match(IDocument document, int offset) { - - fOffset = offset; - - if (fOffset < 0) - return null; - - fDocument = document; - - if (matchPairsAt() && fStartPos != fEndPos) - return new Region(fStartPos, fEndPos - fStartPos + 1); - - return null; - } - - public int getAnchor() { - return fAnchor; - } - - /* - * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear() - */ - public void clear() { - if (fReader != null) { - try { - fReader.close(); - } catch (IOException x) { - // ignore - } - } - } - - public void dispose() { - clear(); - fDocument = null; - fReader = null; - } - protected boolean matchPairsAt() { - - int i; - int pairIndex1= fPairs.length; - int pairIndex2= fPairs.length; - - fStartPos= -1; - fEndPos= -1; - - // get the chars preceding and following the start position - try { - - char prevChar= fDocument.getChar(Math.max(fOffset - 1, 0)); -// modified behavior for http://dev.eclipse.org/bugs/show_bug.cgi?id=16879 -// char nextChar= fDocument.getChar(fOffset); - - // search for opening peer character next to the activation point - for (i= 0; i < fPairs.length; i= i + 2) { -// if (nextChar == fPairs[i]) { -// fStartPos= fOffset; -// pairIndex1= i; -// } else - if (prevChar == fPairs[i]) { - fStartPos= fOffset - 1; - pairIndex1= i; - } - } - - // search for closing peer character next to the activation point - for (i= 1; i < fPairs.length; i= i + 2) { - if (prevChar == fPairs[i]) { - fEndPos= fOffset - 1; - pairIndex2= i; - } -// else if (nextChar == fPairs[i]) { -// fEndPos= fOffset; -// pairIndex2= i; -// } - } - - if (fEndPos > -1) { - fAnchor= RIGHT; - fStartPos= searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument); - if (fStartPos > -1) - return true; - else - fEndPos= -1; - } else if (fStartPos > -1) { - fAnchor= LEFT; - fEndPos= searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument); - if (fEndPos > -1) - return true; - else - fStartPos= -1; - } - - } catch (BadLocationException x) { - } catch (IOException x) { - } - - return false; - } - - - -// protected boolean matchPairsAt() { -// -// int i; -// int pairIndex1 = fPairs.length; -// int pairIndex2 = fPairs.length; -// -// fStartPos = -1; -// fEndPos = -1; -// -// // get the chars preceding and following the start position -// try { -// -// /* -// A quick hack to get around the fact that we can't bracket -// match on the very first element of a document. We make the -// character to match a null character which is unlikely to match. -// */ -// char prevChar = (fOffset > 0) ? fDocument.getChar(fOffset - 1) : '\0'; -// char nextChar = fDocument.getChar(fOffset); -// -// // search for opening peer character next to the activation point -// for (i = 0; i < fPairs.length; i = i + 2) { -// if (nextChar == fPairs[i]) { -// fStartPos = fOffset; -// pairIndex1 = i; -// } else if (prevChar == fPairs[i]) { -// fStartPos = fOffset - 1; -// pairIndex1 = i; -// } -// } -// -// // search for closing peer character next to the activation point -// for (i = 1; i < fPairs.length; i = i + 2) { -// if (prevChar == fPairs[i]) { -// fEndPos = fOffset - 1; -// pairIndex2 = i; -// } else if (nextChar == fPairs[i]) { -// fEndPos = fOffset; -// pairIndex2 = i; -// } -// } -// -// if (fEndPos > -1) { -// fAnchor = RIGHT; -// fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument); -// if (fStartPos > -1) -// return true; -// else -// fEndPos = -1; -// } else if (fStartPos > -1) { -// fAnchor = LEFT; -// fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument); -// if (fEndPos > -1) -// return true; -// else -// fStartPos = -1; -// } -// -// } catch (BadLocationException x) { -// } catch (IOException x) { -// } -// -// return false; -// } - - protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException { - - fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true); - - int stack = 1; - int c = fReader.read(); - while (c != CCodeReader.EOF) { - if (c == openingPeer && c != closingPeer) - stack++; - else if (c == closingPeer) - stack--; - - if (stack == 0) - return fReader.getOffset(); - - c = fReader.read(); - } - - return -1; - } - - protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException { - - fReader.configureBackwardReader(document, offset, true, true); - - int stack = 1; - int c = fReader.read(); - while (c != CCodeReader.EOF) { - if (c == closingPeer && c != openingPeer) - stack++; - else if (c == openingPeer) - stack--; - - if (stack == 0) - return fReader.getOffset(); - - c = fReader.read(); - } - - return -1; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java deleted file mode 100644 index 71dd825e4b7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CParameterListValidator.java +++ /dev/null @@ -1,220 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyleRange; - -import org.eclipse.jface.text.Assert; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.TextPresentation; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.text.contentassist.IContextInformationPresenter; -import org.eclipse.jface.text.contentassist.IContextInformationValidator; - -/** - * This class provides the function parameter parsing for the C/C++ Editor hover - * It is based heavily on the Java class JavaParameterListValidator - * - * @author thomasf - * - */ -public class CParameterListValidator implements IContextInformationValidator, IContextInformationPresenter { - private int fPosition; - private ITextViewer fViewer; - private IContextInformation fInformation; - - private int fCurrentParameter; - - public CParameterListValidator() { - } - - /** - * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int) - * @see IContextInformationPresenter#install(IContextInformation, ITextViewer, int) - */ - public void install(IContextInformation info, ITextViewer viewer, int documentPosition) { - - fPosition= documentPosition; - fViewer= viewer; - fInformation= info; - - fCurrentParameter= -1; - } - - private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException { - while (pos < end) { - char curr= d.getChar(pos); - pos++; - if (curr == '*') { - if (pos < end && d.getChar(pos) == '/') { - return pos + 1; - } - } - } - return end; - } - - private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException { - while (pos < end) { - char curr= d.getChar(pos); - pos++; - if (curr == '\\') { - // ignore escaped characters - pos++; - } else if (curr == ch) { - return pos; - } - } - return end; - } - - private int getCharCount(IDocument document, int start, int end, - char increment, char decrement, boolean considerNesting) throws BadLocationException { - - Assert.isTrue((increment != 0 || decrement != 0) && increment != decrement); - - int nestingLevel= 0; - int charCount= 0; - while (start < end) { - char curr= document.getChar(start++); - switch (curr) { - case '/': - if (start < end) { - char next= document.getChar(start); - if (next == '*') { - // a comment starts, advance to the comment end - start= getCommentEnd(document, start + 1, end); - } else if (next == '/') { - // '//'-comment: nothing to do anymore on this line - start= end; - } - } - break; - case '*': - if (start < end) { - char next= document.getChar(start); - if (next == '/') { - // we have been in a comment: forget what we read before - charCount= 0; - ++ start; - } - } - break; - case '"': - case '\'': - start= getStringEnd(document, start, end, curr); - break; - default: - - if (considerNesting) { - - if ('(' == curr) - ++ nestingLevel; - else if (')' == curr) - -- nestingLevel; - - if (nestingLevel != 0) - break; - } - - if (increment != 0) { - if (curr == increment) - ++ charCount; - } - - if (decrement != 0) { - if (curr == decrement) - -- charCount; - } - } - } - - return charCount; - } - - /** - * @see IContextInformationValidator#isContextInformationValid(int) - */ - public boolean isContextInformationValid(int position) { - - try { - if (position < fPosition) - return false; - - IDocument document= fViewer.getDocument(); - IRegion line= document.getLineInformationOfOffset(fPosition); - - if (position > line.getOffset() + line.getLength()) - return false; - - return (getCharCount(document, fPosition, position, '(', ')', false) >= 0); - - } catch (BadLocationException x) { - return false; - } - } - - /** - * @see IContextInformationPresenter#updatePresentation(int, TextPresentation) - */ - public boolean updatePresentation(int position, TextPresentation presentation) { - - int currentParameter= -1; - - try { - currentParameter= getCharCount(fViewer.getDocument(), fPosition, position, ',', (char) 0, true); - } catch (BadLocationException x) { - return false; - } - - if (fCurrentParameter != -1) { - if (currentParameter == fCurrentParameter) - return false; - } - - presentation.clear(); - fCurrentParameter= currentParameter; - - //Don't presume what has been done to the string, rather use as is - String s= fInformation.getInformationDisplayString(); - - //@@@ This is obviously going to have problems with functions such - //int myfunction(int (*function_argument)(void * extra, int param), void * extra) - //int myfunction(/*A comment, indeed */int a); - int start= 0; - int occurrences= 0; - while (occurrences < fCurrentParameter) { - int found= s.indexOf(',', start); - if (found == -1) - break; - start= found + 1; - ++ occurrences; - } - - if (occurrences < fCurrentParameter) { - presentation.addStyleRange(new StyleRange(0, s.length(), null, null, SWT.NORMAL)); - return true; - } - - if (start == -1) - start= 0; - - int end= s.indexOf(',', start); - if (end == -1) - end= s.length(); - - if (start > 0) - presentation.addStyleRange(new StyleRange(0, start, null, null, SWT.NORMAL)); - - if (end > start) - presentation.addStyleRange(new StyleRange(start, end - start, null, null, SWT.BOLD)); - - if (end < s.length()) - presentation.addStyleRange(new StyleRange(end, s.length() - end, null, null, SWT.NORMAL)); - - return true; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java deleted file mode 100644 index 2dc995fe0b5..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CPartitionScanner.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.rules.EndOfLineRule; -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IPredicateRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.MultiLineRule; -import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; -import org.eclipse.jface.text.rules.SingleLineRule; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WordRule; - - -/** - * This scanner recognizes comments - */ -public class CPartitionScanner extends RuleBasedPartitionScanner { - - - private final static String SKIP= "__skip"; - - - public final static String C_MULTILINE_COMMENT= "c_multi_line_comment"; - public final static String C_SINGLE_LINE_COMMENT= "c_single_line_comment"; - public final static String C_STRING= "c_string"; - - - /** - * Detector for empty comments. - */ - static class EmptyCommentDetector implements IWordDetector { - - /* - * @see IWordDetector#isWordStart - */ - public boolean isWordStart(char c) { - return (c == '/'); - } - - /* - * @see IWordDetector#isWordPart - */ - public boolean isWordPart(char c) { - return (c == '*' || c == '/'); - } - }; - - /** - * Word rule for empty comments. - */ - static class EmptyCommentRule extends WordRule implements IPredicateRule { - - private IToken fSuccessToken; - /** - * Constructor for EmptyCommentRule. - * @param defaultToken - */ - public EmptyCommentRule(IToken successToken) { - super(new EmptyCommentDetector()); - fSuccessToken= successToken; - addWord("/**/", fSuccessToken); //$NON-NLS-1$ - } - - /* - * @see IPredicateRule#evaluate(ICharacterScanner, boolean) - */ - public IToken evaluate(ICharacterScanner scanner, boolean resume) { - return evaluate(scanner); - } - - /* - * @see IPredicateRule#getSuccessToken() - */ - public IToken getSuccessToken() { - return fSuccessToken; - } - }; - - /** - * Creates the partitioner and sets up the appropriate rules. - */ - public CPartitionScanner() { - super(); - - IToken comment= new Token(C_MULTILINE_COMMENT); - IToken single_comment= new Token(C_SINGLE_LINE_COMMENT); - IToken string= new Token(C_STRING); - IToken skip= new Token(SKIP); - - - - List rules= new ArrayList(); - - - // Minimize the number of rules, since we have duplicate rules - // in the CCodeScanner... - - - // Add rule for single line comments. - rules.add(new EndOfLineRule("//", single_comment)); - - - // Add rule for strings and character constants. - rules.add(new SingleLineRule("\"", "\"", string, '\\')); - rules.add(new SingleLineRule("'", "'", skip, '\\')); - - // Add special case word rule. - EmptyCommentRule wordRule= new EmptyCommentRule(comment); - rules.add(wordRule); - - - // Add rules for multi-line comments. - rules.add(new MultiLineRule("/*", "*/", comment)); - - IPredicateRule[] result= new IPredicateRule[rules.size()]; - rules.toArray(result); - setPredicateRules(result); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java deleted file mode 100644 index 0f2db79926d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.ui.editor.CContentOutlinePage; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.IWorkingCopyManager; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.reconciler.DirtyRegion; -import org.eclipse.jface.text.reconciler.IReconcilingStrategy; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; - - -public class CReconcilingStrategy implements IReconcilingStrategy { - - - private CContentOutlinePage fOutliner; - private ITextEditor fEditor; - private IWorkingCopyManager fManager; - private IDocumentProvider fDocumentProvider; - private IProgressMonitor fProgressMonitor; - - - public CReconcilingStrategy(CEditor editor) { - fOutliner= editor.getOutlinePage(); - fEditor= editor; - fManager= CUIPlugin.getDefault().getWorkingCopyManager(); - fDocumentProvider= CUIPlugin.getDefault().getDocumentProvider(); - } - - /** - * @see IReconcilingStrategy#reconcile(document) - */ - public void setDocument(IDocument document) { - } - - - /* - * @see IReconcilingStrategyExtension#setProgressMonitor(IProgressMonitor) - */ - public void setProgressMonitor(IProgressMonitor monitor) { - fProgressMonitor= monitor; - } - - /** - * @see IReconcilingStrategy#reconcile(region) - */ - public void reconcile(IRegion region) { - reconcile(); - } - - - /** - * @see IReconcilingStrategy#reconcile(dirtyRegion, region) - */ - public void reconcile(DirtyRegion dirtyRegion, IRegion region) { - reconcile(); - } - - private void reconcile() { - boolean doUpdate = false; - try { - ITranslationUnit tu = fManager.getWorkingCopy(fEditor.getEditorInput()); - if (tu != null && tu.isWorkingCopy()) { - IWorkingCopy workingCopy = (IWorkingCopy)tu; - // reconcile - synchronized (workingCopy) { - doUpdate = workingCopy.reconcile(true, fProgressMonitor); - } - } - if(doUpdate){ - fOutliner.contentUpdated(); - } - } catch(CModelException e) { - - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java deleted file mode 100644 index d14712aec04..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java +++ /dev/null @@ -1,393 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.Vector; - -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.editor.CEditorTextHoverDispatcher; -import org.eclipse.cdt.internal.ui.text.contentassist.*; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.ICDTConstants; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.DefaultInformationControl; -import org.eclipse.jface.text.IAutoIndentStrategy; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IInformationControl; -import org.eclipse.jface.text.IInformationControlCreator; -import org.eclipse.jface.text.ITextDoubleClickStrategy; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContentAssistant; -import org.eclipse.jface.text.formatter.ContentFormatter; -import org.eclipse.jface.text.formatter.IContentFormatter; -import org.eclipse.jface.text.formatter.IFormattingStrategy; -import org.eclipse.jface.text.information.IInformationPresenter; -import org.eclipse.jface.text.presentation.IPresentationReconciler; -import org.eclipse.jface.text.presentation.PresentationReconciler; -import org.eclipse.jface.text.reconciler.IReconciler; -import org.eclipse.jface.text.reconciler.Reconciler; -import org.eclipse.jface.text.rules.DefaultDamagerRepairer; -import org.eclipse.jface.text.rules.DefaultPartitioner; -import org.eclipse.jface.text.rules.RuleBasedScanner; -import org.eclipse.jface.text.source.IAnnotationHover; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.SourceViewerConfiguration; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.texteditor.ITextEditor; - - - -/** - * Configuration for an SourceViewer which shows C code. - */ -public class CSourceViewerConfiguration extends SourceViewerConfiguration { - - /** Key used to look up display tab width */ - public final static String PREFERENCE_TAB_WIDTH= "org.eclipse.cdt.editor.tab.width"; //$NON-NLS-1$ - /** Key used to look up code formatter tab size */ - private final static String CODE_FORMATTER_TAB_SIZE= "org.eclipse.cdt.formatter.tabulation.size"; //$NON-NLS-1$ - /** Key used to look up code formatter tab character */ - private final static String CODE_FORMATTER_TAB_CHAR= "org.eclipse.cdt.formatter.tabulation.char"; //$NON-NLS-1$ - - private CTextTools fTextTools; - private CEditor fEditor; - - /** - * Creates a new C source viewer configuration for viewers in the given editor using - * the given C tools collection. - * - * @param tools the C text tools collection to be used - * @param editor the editor in which the configured viewer will reside - */ - public CSourceViewerConfiguration(CTextTools tools, CEditor editor) { - fTextTools= tools; - fEditor= editor; - } - - /** - * Returns the C multiline comment scanner for this configuration. - * - * @return the C multiline comment scanner - */ - protected RuleBasedScanner getMultilineCommentScanner() { - return fTextTools.getMultilineCommentScanner(); - } - - /** - * Returns the C singleline comment scanner for this configuration. - * - * @return the C singleline comment scanner - */ - protected RuleBasedScanner getSinglelineCommentScanner() { - return fTextTools.getSinglelineCommentScanner(); - } - - /** - * Returns the C string scanner for this configuration. - * - * @return the C string scanner - */ - protected RuleBasedScanner getStringScanner() { - return fTextTools.getStringScanner(); - } - - /** - * Returns the color manager for this configuration. - * - * @return the color manager - */ - protected IColorManager getColorManager() { - return fTextTools.getColorManager(); - } - - /** - * Returns the editor in which the configured viewer(s) will reside. - * - * @return the enclosing editor - */ - protected ITextEditor getEditor() { - return fEditor; - } - - /** - * @see ISourceViewerConfiguration#getPresentationReconciler(ISourceViewer) - */ - public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { - - PresentationReconciler reconciler= new PresentationReconciler(); - - RuleBasedScanner scanner; - - if(sourceViewer instanceof CEditor.AdaptedSourceViewer) { - String language = ((CEditor.AdaptedSourceViewer)sourceViewer).getDisplayLanguage(); - if(language != null && language.equals(CEditor.LANGUAGE_CPP)) { - scanner= fTextTools.getCppCodeScanner(); - } else { - scanner= fTextTools.getCCodeScanner(); - } - } else { - scanner= fTextTools.getCCodeScanner(); - } - - DefaultDamagerRepairer dr= new DefaultDamagerRepairer(scanner); - - reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - - //TextAttribute attr = new TextAttribute(manager.getColor(ICColorConstants.C_DEFAULT)); - - dr= new DefaultDamagerRepairer(getSinglelineCommentScanner()); - reconciler.setDamager(dr, CPartitionScanner.C_SINGLE_LINE_COMMENT); - reconciler.setRepairer(dr, CPartitionScanner.C_SINGLE_LINE_COMMENT); - - dr= new DefaultDamagerRepairer(getStringScanner()); - reconciler.setDamager(dr, CPartitionScanner.C_STRING); - reconciler.setRepairer(dr, CPartitionScanner.C_STRING); - - dr= new DefaultDamagerRepairer(getMultilineCommentScanner()); - reconciler.setDamager(dr, CPartitionScanner.C_MULTILINE_COMMENT); - reconciler.setRepairer(dr, CPartitionScanner.C_MULTILINE_COMMENT); - - return reconciler; - } - - - /** - * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer) - */ - public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { - if(getEditor() == null) { - return null; - } - - ContentAssistant assistant = new ContentAssistant(); - - IContentAssistProcessor processor = new CCompletionProcessor(getEditor()); - assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); - - //Will this work as a replacement for the configuration lines below? - ContentAssistPreference.configure(assistant, getPreferenceStore()); - - assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY); - assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE); - assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); - - return assistant; - } - - - /** - * @see SourceViewerConfiguration#getReconciler(ISourceViewer) - */ - public IReconciler getReconciler(ISourceViewer sourceViewer) { - if (fEditor != null && fEditor.isEditable()) { - Reconciler reconciler= new Reconciler(); - reconciler.setDelay(1000); - reconciler.setIsIncrementalReconciler(false); - reconciler.setReconcilingStrategy(new CReconcilingStrategy(fEditor), IDocument.DEFAULT_CONTENT_TYPE); - return reconciler; - } - return null; - } - - - /** - * @see SourceViewerConfiguration#getAutoIndentStrategy(ISourceViewer, String) - */ - public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) { - if(CPartitionScanner.C_MULTILINE_COMMENT.equals(contentType)) - return new CCommentAutoIndentStrategy(); - return new CAutoIndentStrategy(); - } - - - /** - * @see SourceViewerConfiguration#getDoubleClickStrategy(ISourceViewer, String) - */ - public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { - return new CDoubleClickSelector(); - } - - /** - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDefaultPrefixes(ISourceViewer, String) - */ - public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { - return new String[] { "//", "" }; - } - - /** - * @see SourceViewerConfiguration#getDefaultPrefix(ISourceViewer, String) - */ - public String getDefaultPrefix(ISourceViewer sourceViewer, String contentType) { - if(IDocument.DEFAULT_CONTENT_TYPE.equals(contentType)) - return "//"; - if(CPartitionScanner.C_SINGLE_LINE_COMMENT.equals(contentType)) - return "//"; - if(CPartitionScanner.C_MULTILINE_COMMENT.equals(contentType)) - return "//"; - return null; - } - - - /* - * @see SourceViewerConfiguration#getIndentPrefixes(ISourceViewer, String) - */ - public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) { - - Vector vector= new Vector(); - - // prefix[0] is either '\t' or ' ' x tabWidth, depending on useSpaces - int tabWidth= getPreferenceStore().getInt(PREFERENCE_TAB_WIDTH); - boolean useSpaces= getPreferenceStore().getBoolean(CEditor.SPACES_FOR_TABS); //$NON-NLS-1$ - - for (int i= 0; i <= tabWidth; i++) { - StringBuffer prefix= new StringBuffer(); - - if (useSpaces) { - for (int j= 0; j + i < tabWidth; j++) - prefix.append(' '); - - if (i != 0) - prefix.append('\t'); - } else { - for (int j= 0; j < i; j++) - prefix.append(' '); - - if (i != tabWidth) - prefix.append('\t'); - } - - vector.add(prefix.toString()); - } - - vector.add(""); //$NON-NLS-1$ - - return (String[]) vector.toArray(new String[vector.size()]); - } - - - /** - * @see SourceViewerConfiguration#getTabWidth(ISourceViewer) - */ - public int getTabWidth(ISourceViewer sourceViewer) { - return getPreferenceStore().getInt(PREFERENCE_TAB_WIDTH); - } - - - /** - * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer) - */ - public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { - return new CAnnotationHover(); - } - - - /** - * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String) - */ - public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { - HashMap textHovers = new HashMap( 3 ); - IPluginRegistry pluginRegistry = Platform.getPluginRegistry(); - IExtensionPoint point = pluginRegistry.getExtensionPoint( CUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(), - ICDTConstants.EP_TEXT_HOVERS ); - if ( point != null ) - { - IExtension[] extensions = point.getExtensions(); - for ( int i = 0; i < extensions.length; i++ ) - { - IExtension currentExtension = extensions[i]; - IConfigurationElement[] configElements = currentExtension.getConfigurationElements(); - for ( int j = 0; j < configElements.length; j++ ) - { - IConfigurationElement config = configElements[j]; - if ( config.getName().equals( ICDTConstants.TAG_TEXT_HOVER ) ) - { - processTextHoverElement( textHovers, config ); - } - } - } - } - - return new CEditorTextHoverDispatcher( fEditor, textHovers ); - } - - private void processTextHoverElement( HashMap textHovers, IConfigurationElement element ) { - String perspId = element.getAttribute( ICDTConstants.ATT_PERSPECTIVE ); - ITextHover textHover = null; - try { - textHover = (ITextHover)element.createExecutableExtension( ICDTConstants.ATT_CLASS ); - } catch (CoreException e) { - } - if ( perspId != null ) { - textHovers.put( perspId, textHover ); - } - } - - /** - * @see SourceViewerConfiguration#getConfiguredContentTypes(ISourceViewer) - */ - public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { - return new String[] { IDocument.DEFAULT_CONTENT_TYPE, - CPartitionScanner.C_MULTILINE_COMMENT, - CPartitionScanner.C_SINGLE_LINE_COMMENT, - CPartitionScanner.C_STRING }; - } - - /** - * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) - */ - public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { - String[] types= new String[] { - DefaultPartitioner.CONTENT_TYPES_CATEGORY - }; - - ContentFormatter formatter= new ContentFormatter(); - IFormattingStrategy strategy= new CFormattingStrategy(sourceViewer); - - formatter.setFormattingStrategy(strategy, IDocument.DEFAULT_CONTENT_TYPE); - formatter.enablePartitionAwareFormatting(false); - formatter.setPartitionManagingPositionCategories(types); - - return formatter; - } - - protected IPreferenceStore getPreferenceStore() { - return CUIPlugin.getDefault().getPreferenceStore(); - } - - /* - * @see SourceViewerConfiguration#getHoverControlCreator(ISourceViewer) - * @since 2.0 - */ - public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { - return getInformationControlCreator(sourceViewer, true); - } - - - public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer, final boolean cutDown) { - return new IInformationControlCreator() { - public IInformationControl createInformationControl(Shell parent) { - int style = cutDown ? SWT.NONE : (SWT.V_SCROLL | SWT.H_SCROLL); - return new DefaultInformationControl(parent, style, new HTMLTextPresenter(cutDown)); - // return new HoverBrowserControl(parent); - } - }; - } - - public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) { - return super.getInformationPresenter(sourceViewer); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java deleted file mode 100644 index e6fe8426818..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CTextTools.java +++ /dev/null @@ -1,240 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.text.util.CColorManager; -import org.eclipse.cdt.ui.CUIPlugin; - -import org.eclipse.core.runtime.Preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.rules.DefaultPartitioner; -import org.eclipse.jface.text.rules.IPartitionTokenScanner; -import org.eclipse.jface.text.rules.RuleBasedScanner; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * This type shares all scanners and the color manager between - * its clients. - */ -public class CTextTools { - - private class PreferenceListener implements IPropertyChangeListener, Preferences.IPropertyChangeListener { - public void propertyChange(PropertyChangeEvent event) { - adaptToPreferenceChange(event); - } - public void propertyChange(Preferences.PropertyChangeEvent event) { - adaptToPreferenceChange(new PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue())); - } - }; - - /** The color manager */ - private CColorManager fColorManager; - /** The C source code scanner */ - private CCodeScanner fCodeScanner; - /** The C++ source code scanner */ - private CppCodeScanner fCppCodeScanner; - /** The C partitions scanner */ - private FastCPartitionScanner fPartitionScanner; - /** The Java multiline comment scanner */ - private CCommentScanner fMultilineCommentScanner; - /** The Java singleline comment scanner */ - private CCommentScanner fSinglelineCommentScanner; - /** The Java string scanner */ - private SingleTokenCScanner fStringScanner; - - /** The preference store */ - private IPreferenceStore fPreferenceStore; - /** The core preference store */ - private Preferences fCorePreferenceStore; - /** The preference change listener */ - private PreferenceListener fPreferenceListener= new PreferenceListener(); - - - /** - * Creates a new C text tools collection and eagerly creates - * and initializes all members of this collection. - */ - public CTextTools(IPreferenceStore store) { - this(store, null); - } - - /** - * Creates a new C text tools collection and eagerly creates - * and initializes all members of this collection. - */ - public CTextTools(IPreferenceStore store, Preferences coreStore) { - if(store == null) { - store = CUIPlugin.getDefault().getPreferenceStore(); - } - fPreferenceStore = store; - fPreferenceStore.addPropertyChangeListener(fPreferenceListener); - - fCorePreferenceStore= coreStore; - if (fCorePreferenceStore != null) { - fCorePreferenceStore.addPropertyChangeListener(fPreferenceListener); - } - - fColorManager= new CColorManager(); - fCodeScanner= new CCodeScanner(fColorManager, store); - fCppCodeScanner= new CppCodeScanner(fColorManager, store); - fPartitionScanner= new FastCPartitionScanner(); - - fMultilineCommentScanner= new CCommentScanner(fColorManager, store, coreStore, ICColorConstants.C_MULTI_LINE_COMMENT); - fSinglelineCommentScanner= new CCommentScanner(fColorManager, store, coreStore, ICColorConstants.C_SINGLE_LINE_COMMENT); - fStringScanner= new SingleTokenCScanner(fColorManager, store, ICColorConstants.C_STRING); - } - - /** - * Creates a new C text tools collection and eagerly creates - * and initializes all members of this collection. - */ - public CTextTools() { - this((IPreferenceStore)null); - } - - /** - * Disposes all members of this tools collection. - */ - public void dispose() { - - fCodeScanner= null; - fPartitionScanner= null; - - - fMultilineCommentScanner= null; - fSinglelineCommentScanner= null; - fStringScanner= null; - - if (fColorManager != null) { - fColorManager.dispose(); - fColorManager= null; - } - - if (fPreferenceStore != null) { - fPreferenceStore.removePropertyChangeListener(fPreferenceListener); - fPreferenceStore= null; - - if (fCorePreferenceStore != null) { - fCorePreferenceStore.removePropertyChangeListener(fPreferenceListener); - fCorePreferenceStore= null; - } - - fPreferenceListener= null; - } - } - - /** - * Gets the color manager. - */ - public CColorManager getColorManager() { - return fColorManager; - } - - /** - * Gets the code scanner used. - */ - public RuleBasedScanner getCCodeScanner() { - return fCodeScanner; - } - - /** - * Gets the code scanner used. - */ - public RuleBasedScanner getCppCodeScanner() { - return fCppCodeScanner; - } - - /** - * Returns a scanner which is configured to scan - * C-specific partitions, which are multi-line comments, - * and regular C source code. - * - * @return a C partition scanner - */ - public IPartitionTokenScanner getPartitionScanner() { - return fPartitionScanner; - } - - /** - * Gets the document provider used. - */ - public IDocumentPartitioner createDocumentPartitioner() { - - String[] types= new String[] { - CPartitionScanner.C_MULTILINE_COMMENT, - CPartitionScanner.C_SINGLE_LINE_COMMENT, - CPartitionScanner.C_STRING - }; - - return new DefaultPartitioner(getPartitionScanner(), types); - } - - /** - * Returns a scanner which is configured to scan C multiline comments. - * - * @return a C multiline comment scanner - */ - public RuleBasedScanner getMultilineCommentScanner() { - return fMultilineCommentScanner; - } - - /** - * Returns a scanner which is configured to scan C singleline comments. - * - * @return a C singleline comment scanner - */ - public RuleBasedScanner getSinglelineCommentScanner() { - return fSinglelineCommentScanner; - } - - /** - * Returns a scanner which is configured to scan Java strings. - * - * @return a Java string scanner - */ - public RuleBasedScanner getStringScanner() { - return fStringScanner; - } - - - /** - * Determines whether the preference change encoded by the given event - * changes the behavior of one its contained components. - * - * @param event the event to be investigated - * @return true if event causes a behavioral change - */ - public boolean affectsBehavior(PropertyChangeEvent event) { - return fCodeScanner.affectsBehavior(event) || - fCppCodeScanner.affectsBehavior(event) || - fMultilineCommentScanner.affectsBehavior(event) || - fSinglelineCommentScanner.affectsBehavior(event) || - fStringScanner.affectsBehavior(event); - } - - /** - * Adapts the behavior of the contained components to the change - * encoded in the given event. - * - * @param event the event to whch to adapt - */ - protected void adaptToPreferenceChange(PropertyChangeEvent event) { - if (fCodeScanner.affectsBehavior(event)) - fCodeScanner.adaptToPreferenceChange(event); - if (fCppCodeScanner.affectsBehavior(event)) - fCppCodeScanner.adaptToPreferenceChange(event); - if (fMultilineCommentScanner.affectsBehavior(event)) - fMultilineCommentScanner.adaptToPreferenceChange(event); - if (fSinglelineCommentScanner.affectsBehavior(event)) - fSinglelineCommentScanner.adaptToPreferenceChange(event); - if (fStringScanner.affectsBehavior(event)) - fStringScanner.adaptToPreferenceChange(event); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CWordFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CWordFinder.java deleted file mode 100644 index 010cd6f6c6b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CWordFinder.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Region; - -/** - * This is a helper class for the text editor to be able to determine, - * given a particular offset in a document, various candidates segments - * for things like context help, proposals and hovering. - */ -public class CWordFinder -{ - /** - * This method determines for a given offset into a given document - * what the region is which defines the current word. A word is - * defined as the set of non "C" identifiers. So assuming that ! - * indicated the current cursor postion: - * !afunction(int a, int b) --> word = length 0 - * afunc!tion(int a, int b) --> word = afunction - * afunction!(int a, int b) --> word = afunction - * afunction(!int a, int b) --> word = length 0 - * afunction(int a,! int b) --> word = length 0 - * afunction(!) --> word = length 0 - * @param document The document to be examined - * @param offset The offset into the document where a word should - * be idendified. - * @return The region defining the current word, which may be a - * region of length 0 if the offset is not in a word, or null if - * there is an error accessing the docment data. - */ - public static IRegion findWord( IDocument document, int offset ) - { - int start = -1; - int end = -1; - - try - { - int pos = offset; - char c; - - while( pos >= 0 ) - { - c = document.getChar( pos ); - if ( !Character.isJavaIdentifierPart( c ) ) - break; - --pos; - } - - start = pos; - - pos = offset; - int length = document.getLength(); - - while( pos < length ) - { - c = document.getChar( pos ); - if ( !Character.isJavaIdentifierPart( c ) ) - break; - ++pos; - } - - end = pos; - - } - catch( BadLocationException x ) - { - } - - if ( start > -1 && end > -1 ) - { - if ( start == offset && end == offset ) - return new Region( offset, 0 ); - else if ( start == offset ) - return new Region( start, end - start ); - else - return new Region( start + 1, end - start - 1 ); - } - - return null; - } - - /** - * This method will determine the region for the name of the function - * within which the current offset is contained. - * @param document The document to be examined - * @param offset The offset into the document where a word should - * be idendified. - * @return The region defining the current word, which may be a - * region of length 0 if the offset is not in a function, or null if - * there is an error accessing the docment data. - */ - public static IRegion findFunction( IDocument document, int offset ) - { - int leftbracket = -1; - int leftbracketcount = 0; - int rightbracket = -1; - int rightbracketcount = 0; - int functionstart = -1; - int functionend = -1; - - - try - { - int length = document.getLength(); - int pos; - char c; - - //Find most relevant right bracket from our position - pos = offset; - rightbracketcount = leftbracketcount = 0; - while(pos < length) { - c = document.getChar( pos ); - - if( c == ')') { - rightbracketcount++; - if(rightbracketcount >= leftbracketcount) { - rightbracket = pos; - break; - } - } - - if(c == '(') { - leftbracketcount++; - } - - if(c == ';') { - break; - } - - pos++; - } - - if ( rightbracket == -1 ) { - return new Region(offset, 0); - } - - //Now backtrack our way from the rightbracket to the left - pos = rightbracket; - rightbracketcount = leftbracketcount = 0; - while(pos >= 0) { - c = document.getChar( pos ); - - if( c == ')') { - rightbracketcount++; - } - - if(c == '(') { - leftbracketcount++; - if(leftbracketcount >= rightbracketcount) { - leftbracket = pos; - break; - } - } - - if(c == ';') { - break; - } - - pos--; - } - - if ( leftbracket == -1 ) { - return new Region(offset, 0); - } - - //Now work our way to the function name - pos = leftbracket - 1; - while(pos >= 0) { - c = document.getChar( pos ); - if(functionend == -1 && c == ' ' ) { - pos--; - continue; - } - - if(!Character.isJavaIdentifierPart(c)) { - break; - } - - functionstart = pos; - if(functionend == -1) { - functionend = pos; - } - - pos--; - } - } catch( BadLocationException x ) { - /* Ignore */ - } - - if (functionstart > -1 && functionend > -1) { - return new Region(functionstart, functionend - functionstart + 1); - } - - return null; - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CppCodeScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CppCodeScanner.java deleted file mode 100644 index 5fc2ccd3a8b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CppCodeScanner.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.text.util.CWordDetector; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.SingleLineRule; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WordRule; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * A C code scanner. - */ -public final class CppCodeScanner extends AbstractCScanner { - - private static String[] fgKeywords= { - "and", "and_eq", "asm", "auto", - "bitand", "bitor", "break", - "case", "catch", "class", "compl", "const", "const_cast", "continue", - "default", "delete", "do", "dynamic_cast", - "else", "enum", "explicit", "export", "extern", - "false", "final", "finally", "for", "friend", - "goto", - "if", "inline", - "mutable", - "namespace", "new", "not", "not_eq", - "operator", "or", "or_eq", - "private", "protected", "public", - "redeclared", "register", "reinterpret_cast", "return", "restrict", - "sizeof", "static", "static_cast", "struct", "switch", - "template", "this", "throw", "true", "try", "typedef", "typeid", "typename", - "union", "using", - "virtual", "volatile", - "while", - "xor", "xor_eq" - - }; - - - private static String[] fgTypes= { "bool", "char", "double", "float", "int", "long", "short", "signed", "unsigned", "void", "wchar_t", "_Bool", "_Complex", "_Imaginary"}; - private static String[] fgConstants= { "false", "NULL", "true", "__DATE__", "__LINE__", "__TIME__", "__FILE__", "__STDC__"}; - private static String[] fgPreprocessor= { "#define", "#undef", "#include", "#error", "#warning", "#pragma", "#ifdef", "#ifndef", "#line", "#undef", "#if", "#else", "#elif", "#endif"}; - - - private static String[] fgTokenProperties= { - ICColorConstants.C_KEYWORD, - ICColorConstants.C_TYPE, - ICColorConstants.C_STRING, - ICColorConstants.C_DEFAULT - }; - - - /** - * Creates a C++ code scanner - */ - public CppCodeScanner(IColorManager manager, IPreferenceStore store) { - super(manager, store); - initialize(); - } - - /* - * @see AbstractCScanner#getTokenProperties() - */ - protected String[] getTokenProperties() { - return fgTokenProperties; - } - - /* - * @see AbstractCScanner#createRules() - */ - protected List createRules() { - - List rules= new ArrayList(); - - // Add rule for strings - Token token= getToken(ICColorConstants.C_STRING); - // Add rule for strings and character constants. - rules.add(new SingleLineRule("'", "'", token, '\\')); - - - - // Add generic whitespace rule. - //rules.add(new WhitespaceRule(new CWhitespaceDetector())); - - - // Add word rule for keywords, types, and constants. - token= getToken(ICColorConstants.C_DEFAULT); - WordRule wordRule= new WordRule(new CWordDetector(), token); - - token= getToken(ICColorConstants.C_KEYWORD); - for (int i=0; i 0) { - fLast= NONE; // ignore last - return preFix(fState, CCODE, NONE, 0); - - } else { - fLast= NONE; - fPrefixLength= 0; - return Token.EOF; - } - - case '\r': - // emulate CPartitionScanner - if (!fgEmulate && fLast != CARRIAGE_RETURN) { - fLast= CARRIAGE_RETURN; - fTokenLength++; - continue; - - } else { - - switch (fState) { - case SINGLE_LINE_COMMENT: - case CHARACTER: - case STRING: - if (fTokenLength > 0) { - IToken token= fTokens[fState]; - - // emulate CPartitionScanner - if (fgEmulate) { - fTokenLength++; - fLast= NONE; - fPrefixLength= 0; - } else { - fLast= CARRIAGE_RETURN; - fPrefixLength= 1; - } - - fState= CCODE; - return token; - - } else { - consume(); - continue; - } - - default: - consume(); - continue; - } - } - - case '\n': - switch (fState) { - case SINGLE_LINE_COMMENT: - case CHARACTER: - case STRING: - // assert(fTokenLength > 0); - return postFix(fState); - - default: - consume(); - continue; - } - - default: - if (!fgEmulate && fLast == CARRIAGE_RETURN) { - switch (fState) { - case SINGLE_LINE_COMMENT: - case CHARACTER: - case STRING: - - int last; - int newState; - switch (ch) { - case '/': - last= SLASH; - newState= CCODE; - break; - - case '*': - last= STAR; - newState= CCODE; - break; - - case '\'': - last= NONE; - newState= CHARACTER; - break; - - case '"': - last= NONE; - newState= STRING; - break; - - case '\r': - last= CARRIAGE_RETURN; - newState= CCODE; - break; - - case '\\': - last= BACKSLASH; - newState= CCODE; - break; - - default: - last= NONE; - newState= CCODE; - break; - } - - fLast= NONE; // ignore fLast - return preFix(fState, newState, last, 1); - - default: - break; - } - } - } - - // states - switch (fState) { - case CCODE: - switch (ch) { - case '/': - if (fLast == SLASH) { - if (fTokenLength - getLastLength(fLast) > 0) { - return preFix(CCODE, SINGLE_LINE_COMMENT, NONE, 2); - } else { - preFix(CCODE, SINGLE_LINE_COMMENT, NONE, 2); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - } else { - fTokenLength++; - fLast= SLASH; - break; - } - - case '*': - if (fLast == SLASH) { - if (fTokenLength - getLastLength(fLast) > 0) - return preFix(CCODE, MULTI_LINE_COMMENT, SLASH_STAR, 2); - else { - preFix(CCODE, MULTI_LINE_COMMENT, SLASH_STAR, 2); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - } else { - consume(); - break; - } - - case '\'': - fLast= NONE; // ignore fLast - if (fTokenLength > 0) - return preFix(CCODE, CHARACTER, NONE, 1); - else { - preFix(CCODE, CHARACTER, NONE, 1); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - case '"': - fLast= NONE; // ignore fLast - if (fTokenLength > 0) - return preFix(CCODE, STRING, NONE, 1); - else { - preFix(CCODE, STRING, NONE, 1); - fTokenOffset += fTokenLength; - fTokenLength= fPrefixLength; - break; - } - - default: - consume(); - break; - } - break; - - case SINGLE_LINE_COMMENT: - consume(); - break; - - case MULTI_LINE_COMMENT: - switch (ch) { - case '*': - fTokenLength++; - fLast= STAR; - break; - - case '/': - if (fLast == STAR) { - return postFix(MULTI_LINE_COMMENT); - } else { - consume(); - break; - } - - default: - consume(); - break; - } - break; - - case STRING: - switch (ch) { - case '\\': - fLast= (fLast == BACKSLASH) ? NONE : BACKSLASH; - fTokenLength++; - break; - - case '\"': - if (fLast != BACKSLASH) { - return postFix(STRING); - - } else { - consume(); - break; - } - - default: - consume(); - break; - } - break; - - case CHARACTER: - switch (ch) { - case '\\': - fLast= (fLast == BACKSLASH) ? NONE : BACKSLASH; - fTokenLength++; - break; - - case '\'': - if (fLast != BACKSLASH) { - return postFix(CHARACTER); - - } else { - consume(); - break; - } - - default: - consume(); - break; - } - break; - } - } - } - - private static final int getLastLength(int last) { - switch (last) { - default: - return -1; - - case NONE: - return 0; - - case CARRIAGE_RETURN: - case BACKSLASH: - case SLASH: - case STAR: - return 1; - - case SLASH_STAR: - return 2; - - } - } - - private final void consume() { - fTokenLength++; - fLast= NONE; - } - - private final IToken postFix(int state) { - fTokenLength++; - fLast= NONE; - fState= CCODE; - fPrefixLength= 0; - return fTokens[state]; - } - - private final IToken preFix(int state, int newState, int last, int prefixLength) { - // emulate CPartitionScanner - if (fgEmulate && state == CCODE && (fTokenLength - getLastLength(fLast) > 0)) { - fTokenLength -= getLastLength(fLast); - fCOffset= fTokenOffset; - fCLength= fTokenLength; - fTokenLength= 1; - fState= newState; - fPrefixLength= prefixLength; - fLast= last; - return fTokens[state]; - - } else { - fTokenLength -= getLastLength(fLast); - fLast= last; - fPrefixLength= prefixLength; - IToken token= fTokens[state]; - fState= newState; - return token; - } - } - - private static int getState(String contentType) { - - if (contentType == null) - return CCODE; - - else if (contentType.equals(C_SINGLE_LINE_COMMENT)) - return SINGLE_LINE_COMMENT; - - else if (contentType.equals(C_MULTI_LINE_COMMENT)) - return MULTI_LINE_COMMENT; - - else if (contentType.equals(C_STRING)) - return STRING; - - else if (contentType.equals(SKIP)) - return CHARACTER; - - else - return CCODE; - } - - /* - * @see IPartitionTokenScanner#setPartialRange(IDocument, int, int, String, int) - */ - public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) { - - fScanner.setRange(document, offset, length); - fTokenOffset= partitionOffset; - fTokenLength= 0; - fPrefixLength= offset - partitionOffset; - fLast= NONE; - - if (offset == partitionOffset) { - // restart at beginning of partition - fState= CCODE; - } else { - fState= getState(contentType); - } - - // emulate CPartitionScanner - if (fgEmulate) { - fCOffset= -1; - fCLength= 0; - } - } - - /* - * @see ITokenScanner#setRange(IDocument, int, int) - */ - public void setRange(IDocument document, int offset, int length) { - - fScanner.setRange(document, offset, length); - fTokenOffset= offset; - fTokenLength= 0; - fPrefixLength= 0; - fLast= NONE; - fState= CCODE; - - // emulate CPartitionScanner - if (fgEmulate) { - fCOffset= -1; - fCLength= 0; - } - } - - /* - * @see ITokenScanner#getTokenLength() - */ - public int getTokenLength() { - return fTokenLength; - } - - /* - * @see ITokenScanner#getTokenOffset() - */ - public int getTokenOffset() { - return fTokenOffset; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTML2TextReader.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTML2TextReader.java deleted file mode 100644 index 1d8bfc62c6f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTML2TextReader.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.io.IOException; -import java.io.PushbackReader; -import java.io.Reader; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.eclipse.jface.text.TextPresentation; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyleRange; - - -/** - * Reads the text contents from a reader of HTML contents and translates - * the tags or cut them out. - */ -public class HTML2TextReader extends SubstitutionTextReader { - - - private static final String LINE_DELIM= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - private static final Map fgEntityLookup; - private static final Set fgTags; - - static { - - fgTags= new HashSet(); - fgTags.add("b"); //$NON-NLS-1$ - fgTags.add("br"); //$NON-NLS-1$ - fgTags.add("h5"); //$NON-NLS-1$ - fgTags.add("p"); //$NON-NLS-1$ - fgTags.add("dl"); //$NON-NLS-1$ - fgTags.add("dt"); //$NON-NLS-1$ - fgTags.add("dd"); //$NON-NLS-1$ - fgTags.add("li"); //$NON-NLS-1$ - fgTags.add("ul"); //$NON-NLS-1$ - - fgEntityLookup= new HashMap(7); - fgEntityLookup.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$ - fgEntityLookup.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$ - fgEntityLookup.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$ - fgEntityLookup.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$ - fgEntityLookup.put("circ", "^"); //$NON-NLS-1$ //$NON-NLS-2$ - fgEntityLookup.put("tilde", "~"); //$NON-NLS-2$ //$NON-NLS-1$ - fgEntityLookup.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - } - - private int fCounter= 0; - private TextPresentation fTextPresentation; - private int fBold= 0; - private int fStartOffset= -1; - private boolean fInParagraph= false; - - /** - * Transforms the html text from the reader to formatted text. - * @param presentation If not null, formattings will be applied to - * the presentation. - */ - public HTML2TextReader(Reader reader, TextPresentation presentation) { - super(new PushbackReader(reader)); - fTextPresentation= presentation; - } - - public int read() throws IOException { - int c= super.read(); - if (c != -1) - ++ fCounter; - return c; - } - - protected void startBold() { - if (fBold == 0) - fStartOffset= fCounter; - ++ fBold; - } - - protected void stopBold() { - -- fBold; - if (fBold == 0) { - if (fTextPresentation != null) { - fTextPresentation.addStyleRange(new StyleRange(fStartOffset, fCounter - fStartOffset, null, null, SWT.BOLD)); - } - fStartOffset= -1; - } - } - - /** - * @see SubstitutionTextReader#computeSubstitution(char) - */ - protected String computeSubstitution(int c) throws IOException { - if (c == '<') - return processHTMLTag(); - else if (c == '&') - return processEntity(); - - return null; - } - - private String html2Text(String html) { - - String tag= html; - if ('/' == tag.charAt(0)) - tag= tag.substring(1); - - if (!fgTags.contains(tag)) - return ""; //$NON-NLS-1$ - - if ("b".equals(html)) { //$NON-NLS-1$ - startBold(); - return ""; //$NON-NLS-1$ - } - - if ("h5".equals(html) || "dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$ - startBold(); - return ""; //$NON-NLS-1$ - } - - if ("dl".equals(html)) //$NON-NLS-1$ - return LINE_DELIM; - - if ("dd".equals(html)) //$NON-NLS-1$ - return "\t"; //$NON-NLS-1$ - - if ("li".equals(html)) //$NON-NLS-1$ - return LINE_DELIM + "\t" + "-"; - - if ("/b".equals(html)) { //$NON-NLS-1$ - stopBold(); - return ""; //$NON-NLS-1$ - } - - if ("p".equals(html)) { //$NON-NLS-1$ - fInParagraph= true; - return LINE_DELIM; - } - - if ("br".equals(html)) //$NON-NLS-1$ - return LINE_DELIM; - - if ("/p".equals(html)) { //$NON-NLS-1$ - boolean inParagraph= fInParagraph; - fInParagraph= false; - return inParagraph ? "" : LINE_DELIM; //$NON-NLS-1$ - } - - if ("/h5".equals(html) || "/dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$ - stopBold(); - return LINE_DELIM; - } - - if ("/dd".equals(html)) //$NON-NLS-1$ - return LINE_DELIM; - - return ""; //$NON-NLS-1$ - } - - /* - * A '<' has been read. Process a html tag - */ - private String processHTMLTag() throws IOException { - - StringBuffer buf= new StringBuffer(); - int ch; - do { - - ch= nextChar(); - - while (ch != -1 && ch != '>') { - buf.append(Character.toLowerCase((char) ch)); - ch= nextChar(); - if (ch == '"'){ - buf.append(Character.toLowerCase((char) ch)); - ch= nextChar(); - while (ch != -1 && ch != '"'){ - buf.append(Character.toLowerCase((char) ch)); - ch= nextChar(); - } - } - if (ch == '<'){ - unread(ch); - return '<' + buf.toString(); - } - } - - if (ch == -1) - return null; - - int tagLen= buf.length(); - // needs special treatment for comments - if ((tagLen >= 3 && "!--".equals(buf.substring(0, 3))) //$NON-NLS-1$ - && !(tagLen >= 5 && "--!".equals(buf.substring(tagLen - 3)))) { //$NON-NLS-1$ - // unfinished comment - buf.append(ch); - } else { - break; - } - } while (true); - - return html2Text(buf.toString()); - } - - private void unread(int ch) throws IOException { - ((PushbackReader) getReader()).unread(ch); - } - - protected String entity2Text(String symbol) { - if (symbol.length() > 1 && symbol.charAt(0) == '#') { - int ch; - try { - if (symbol.charAt(1) == 'x') { - ch= Integer.parseInt(symbol.substring(2), 16); - } else { - ch= Integer.parseInt(symbol.substring(1), 10); - } - return "" + (char)ch; //$NON-NLS-1$ - } catch (NumberFormatException e) { - } - } else { - String str= (String) fgEntityLookup.get(symbol); - if (str != null) { - return str; - } - } - return "&" + symbol; // not found //$NON-NLS-1$ - } - - /* - * A '&' has been read. Process a entity - */ - private String processEntity() throws IOException { - StringBuffer buf= new StringBuffer(); - int ch= nextChar(); - while (Character.isLetterOrDigit((char)ch) || ch == '#') { - buf.append((char) ch); - ch= nextChar(); - } - - if (ch == ';') - return entity2Text(buf.toString()); - - buf.insert(0, '&'); - if (ch != -1) - buf.append((char) ch); - return buf.toString(); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLPrinter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLPrinter.java deleted file mode 100644 index 70748b21002..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLPrinter.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.io.Reader; - - -/** - * Provides a set of convenience methods for creating HTML pages. - */ -public class HTMLPrinter { - - private HTMLPrinter() { - } - - private static String replace(String text, char c, String s) { - - int previous= 0; - int current= text.indexOf(c, previous); - - if (current == -1) - return text; - - StringBuffer buffer= new StringBuffer(); - while (current > -1) { - buffer.append(text.substring(previous, current)); - buffer.append(s); - previous= current + 1; - current= text.indexOf(c, previous); - } - buffer.append(text.substring(previous)); - - return buffer.toString(); - } - - public static String convertToHTMLContent(String content) { - content= replace(content, '<', "<"); //$NON-NLS-1$ - return replace(content, '>', ">"); //$NON-NLS-1$ - } - - public static String read(Reader rd) { - - StringBuffer buffer= new StringBuffer(); - char[] readBuffer= new char[2048]; - - try { - int n= rd.read(readBuffer); - while (n > 0) { - buffer.append(readBuffer, 0, n); - n= rd.read(readBuffer); - } - return buffer.toString(); - } catch (IOException x) { - } - - return null; - } - - public static void insertPageProlog(StringBuffer buffer, int position) { - buffer.insert(position, ""); //$NON-NLS-1$ - } - - public static void addPageProlog(StringBuffer buffer) { - insertPageProlog(buffer, buffer.length()); - } - - public static void addPageEpilog(StringBuffer buffer) { - buffer.append(""); //$NON-NLS-1$ - } - - public static void startBulletList(StringBuffer buffer) { - buffer.append("
              "); //$NON-NLS-1$ - } - - public static void endBulletList(StringBuffer buffer) { - buffer.append("
            "); //$NON-NLS-1$ - } - - public static void addBullet(StringBuffer buffer, String bullet) { - if (bullet != null) { - buffer.append("
          • "); //$NON-NLS-1$ - buffer.append(bullet); - buffer.append("
          • "); //$NON-NLS-1$ - } - } - - public static void addSmallHeader(StringBuffer buffer, String header) { - if (header != null) { - buffer.append("
            "); //$NON-NLS-1$ - buffer.append(header); - buffer.append("
            "); //$NON-NLS-1$ - } - } - - public static void addParagraph(StringBuffer buffer, String paragraph) { - if (paragraph != null) { - buffer.append("

            "); //$NON-NLS-1$ - buffer.append(paragraph); - } - } - - public static void addParagraph(StringBuffer buffer, Reader paragraphReader) { - if (paragraphReader != null) - addParagraph(buffer, read(paragraphReader)); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java deleted file mode 100644 index 8f8bcf35ede..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/HTMLTextPresenter.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; - -import java.util.Iterator; -import org.eclipse.swt.custom.StyleRange; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.text.DefaultInformationControl; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.text.TextPresentation; - - -public class HTMLTextPresenter implements DefaultInformationControl.IInformationPresenter { - - private static final String LINE_DELIM= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - - private int fCounter; - private boolean fEnforceUpperLineLimit; - - public HTMLTextPresenter(boolean enforceUpperLineLimit) { - super(); - fEnforceUpperLineLimit= enforceUpperLineLimit; - } - - public HTMLTextPresenter() { - this(true); - } - - protected Reader createReader(String hoverInfo, TextPresentation presentation) { - return new HTML2TextReader(new StringReader(hoverInfo), presentation); - } - - protected void adaptTextPresentation(TextPresentation presentation, int offset, int insertLength) { - - int yoursStart= offset; - int yoursEnd= offset + insertLength -1; - yoursEnd= Math.max(yoursStart, yoursEnd); - - Iterator e= presentation.getAllStyleRangeIterator(); - while (e.hasNext()) { - - StyleRange range= (StyleRange) e.next(); - - int myStart= range.start; - int myEnd= range.start + range.length -1; - myEnd= Math.max(myStart, myEnd); - - if (myEnd < yoursStart) - continue; - - if (myStart < yoursStart) - range.length += insertLength; - else - range.start += insertLength; - } - } - - private void append(StringBuffer buffer, String string, TextPresentation presentation) { - - int length= string.length(); - buffer.append(string); - - if (presentation != null) - adaptTextPresentation(presentation, fCounter, length); - - fCounter += length; - } - - private String getIndent(String line) { - int length= line.length(); - - int i= 0; - while (i < length && Character.isWhitespace(line.charAt(i))) ++i; - - return (i == length ? line : line.substring(0, i)) + " "; //$NON-NLS-1$ - } - - /* - * @see IHoverInformationPresenter#updatePresentation(Display display, String, TextPresentation, int, int) - */ - public String updatePresentation(Display display, String hoverInfo, TextPresentation presentation, int maxWidth, int maxHeight) { - - if (hoverInfo == null) - return null; - - GC gc= new GC(display); - try { - - StringBuffer buffer= new StringBuffer(); - int maxNumberOfLines= Math.round(maxHeight / gc.getFontMetrics().getHeight()); - - fCounter= 0; - LineBreakingReader reader= new LineBreakingReader(createReader(hoverInfo, presentation), gc, maxWidth); - - boolean lastLineFormatted= false; - String lastLineIndent= null; - - String line=reader.readLine(); - boolean lineFormatted= reader.isFormattedLine(); - boolean firstLineProcessed= false; - - while (line != null) { - - if (fEnforceUpperLineLimit && maxNumberOfLines <= 0) - break; - - if (firstLineProcessed) { - if (!lastLineFormatted) - append(buffer, LINE_DELIM, null); - else { - append(buffer, LINE_DELIM, presentation); - if (lastLineIndent != null) - append(buffer, lastLineIndent, presentation); - } - } - - append(buffer, line, null); - firstLineProcessed= true; - - lastLineFormatted= lineFormatted; - if (!lineFormatted) - lastLineIndent= null; - else if (lastLineIndent == null) - lastLineIndent= getIndent(line); - - line= reader.readLine(); - lineFormatted= reader.isFormattedLine(); - - maxNumberOfLines--; - } - - if (line != null) { - append(buffer, LINE_DELIM, lineFormatted ? presentation : null); - append(buffer, (""), presentation); - } - - return trim(buffer, presentation); - - } catch (IOException e) { - - CUIPlugin.getDefault().log(e); - return null; - - } finally { - gc.dispose(); - } - } - - private String trim(StringBuffer buffer, TextPresentation presentation) { - - int length= buffer.length(); - - int end= length -1; - while (end >= 0 && Character.isWhitespace(buffer.charAt(end))) - -- end; - - if (end == -1) - return ""; //$NON-NLS-1$ - - if (end < length -1) - buffer.delete(end + 1, length); - else - end= length; - - int start= 0; - while (start < end && Character.isWhitespace(buffer.charAt(start))) - ++ start; - - buffer.delete(0, start); - presentation.setResultWindow(new Region(start, buffer.length())); - return buffer.toString(); - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICColorConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICColorConstants.java deleted file mode 100644 index 729c1f33b3b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/ICColorConstants.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -/* - * Color constants that we use for the preferences - */ - -public interface ICColorConstants { - /* The prefix all color constants start with */ - String PREFIX= "c_"; //$NON-NLS-1$ - - /* The color key for multi-line comments in C code. */ - String C_MULTI_LINE_COMMENT= "c_multi_line_comment"; //$NON-NLS-1$ - /* The color key for single-line comments in C code. */ - String C_SINGLE_LINE_COMMENT= "c_single_line_comment"; //$NON-NLS-1$ - /* The color key for keywords in C code. */ - String C_KEYWORD= "c_keyword"; //$NON-NLS-1$ - /* The color key for builtin types in C code. */ - String C_TYPE= "c_type"; //$NON-NLS-1$ - /* The color key for string and character literals in C code. */ - String C_STRING= "c_string"; //$NON-NLS-1$ - /* The color key for everthing in C code for which no other color is specified. */ - String C_DEFAULT= "c_default"; //$NON-NLS-1$ - - /** - * The color key for task tags in C comments - * (value "c_comment_task_tag"). - */ - String TASK_TAG= "c_comment_task_tag"; //$NON-NLS-1$ -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManager.java deleted file mode 100644 index 18e13141ebc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManager.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; - - -/** - * Manages SWT color objects for given color keys and - * given RGB objects. Until the dispose - * method is called, the same color object is returned for - * equal keys and equal RGB values. - *

            - * This interface may be implemented by clients. - *

            - * - * @see IJavaColorConstants - */ -public interface IColorManager { - - /** - * Returns a color object for the given key. The color objects - * are remembered internally; the same color object is returned - * for equal keys. - * - * @param key the color key - * @return the color object for the given key - */ - Color getColor(String key); - - /** - * Returns the color object for the value represented by the given - * RGB object. - * - * @param rgb the rgb color specification - * @return the color object for the given rgb value - */ - Color getColor(RGB rgb); - - /** - * Disposes all color objects remembered by this color manager. - */ - void dispose(); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManagerExtension.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManagerExtension.java deleted file mode 100644 index 2f81ca0286c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/IColorManagerExtension.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.graphics.RGB; - - -/** - * For internal use only. Not API.

            - * A color manager extension is for extending - * IColorManager instances with new functionality. - */ -public interface IColorManagerExtension { - - /** - * Remembers the given color specification under the given key. - * - * @param key the color key - * @param rgb the color specification - * @exception UnsupportedOperationException if there is already a - * color specification remembered under the given key - */ - void bindColor(String key, RGB rgb); - - - /** - * Forgets the color specification remembered under the given key. - * @param key the color key - */ - void unbindColor(String key); -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/LineBreakingReader.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/LineBreakingReader.java deleted file mode 100644 index ab2683af5cf..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/LineBreakingReader.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.Reader; - -import java.text.BreakIterator; -import org.eclipse.swt.graphics.GC; - -/* - * Not a real reader. Could change if requested - */ -public class LineBreakingReader { - - private BufferedReader fReader; - private GC fGC; - private int fMaxWidth; - - private String fLine; - private int fOffset; - - private BreakIterator fLineBreakIterator; - private int findNextBreakOffset(int currOffset) { - int currWidth= 0; - int nextOffset= fLineBreakIterator.following(currOffset); - while (nextOffset != BreakIterator.DONE) { - String word= fLine.substring(currOffset, nextOffset); - int wordWidth= fGC.textExtent(word).x; - int nextWidth= wordWidth + currWidth; - if (nextWidth > fMaxWidth) { - if (currWidth > 0) { - return currOffset; - } else { - return nextOffset; - } - } - currWidth= nextWidth; - currOffset= nextOffset; - nextOffset= fLineBreakIterator.next(); - } - return nextOffset; - } - private int findWordBegin(int idx) { - while (idx < fLine.length() && Character.isWhitespace(fLine.charAt(idx))) { - idx++; - } - return idx; - } - /** - * Creates a reader that breaks an input text to fit in a given width. - * @param reader Reader of the input text - * @param gc The graphic context that defines the currently used font sizes - * @param maxLineWidth The max width (pixes) where the text has to fit in - */ - public LineBreakingReader(Reader reader, GC gc, int maxLineWidth) { - fReader= new BufferedReader(reader); - fGC= gc; - fMaxWidth= maxLineWidth; - fOffset= 0; - fLine= null; - fLineBreakIterator= BreakIterator.getLineInstance(); - } - - public boolean isFormattedLine() { - return fLine != null; - } - - /** - * Reads the next line. The lengths of the line will not exceed the gived maximum - * width. - */ - public String readLine() throws IOException { - if (fLine == null) { - String line= fReader.readLine(); - if (line == null) { - return null; - } - - int lineLen= fGC.textExtent(line).x; - if (lineLen < fMaxWidth) { - return line; - } - fLine= line; - fLineBreakIterator.setText(line); - fOffset= 0; - } - int breakOffset= findNextBreakOffset(fOffset); - String res; - if (breakOffset != BreakIterator.DONE) { - res= fLine.substring(fOffset, breakOffset); - fOffset= findWordBegin(breakOffset); - if (fOffset == fLine.length()) { - fLine= null; - } - } else { - res= fLine.substring(fOffset); - fLine= null; - } - return res; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/PreprocessorRule.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/PreprocessorRule.java deleted file mode 100644 index 39839c9ba6e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/PreprocessorRule.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -import org.eclipse.jface.text.rules.ICharacterScanner; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.WordRule; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.Token; - -/** - * Implementation of IRule for C/C++ preprocessor scanning. - * It is capable of detecting a pattern which begins with 0 or more whitespaces - * at the beginning of the string, then '#' sign, then 0 or more whitespaces - * again, and then directive itself. - */ -public class PreprocessorRule extends WordRule implements IRule { - - private StringBuffer fBuffer = new StringBuffer(); - - /** - * Creates a rule which, with the help of a word detector, will return the token - * associated with the detected word. If no token has been associated, the scanner - * will be rolled back and an undefined token will be returned in order to allow - * any subsequent rules to analyze the characters. - * - * @param detector the word detector to be used by this rule, may not be null - * - * @see #addWord - */ - public PreprocessorRule(IWordDetector detector) { - this(detector, Token.UNDEFINED); - } - - /** - * Creates a rule which, with the help of an word detector, will return the token - * associated with the detected word. If no token has been associated, the - * specified default token will be returned. - * - * @param detector the word detector to be used by this rule, may not be null - * @param defaultToken the default token to be returned on success - * if nothing else is specified, may not be null - * - * @see #addWord - */ - public PreprocessorRule(IWordDetector detector, IToken defaultToken) { - super(detector, defaultToken); - } - - /* - * @see IRule#evaluate - */ - public IToken evaluate(ICharacterScanner scanner) { - int c; - int nCharsToRollback = 0; - boolean hashSignDetected = false; - - if (scanner.getColumn() > 0) - return Token.UNDEFINED; - - do { - c = scanner.read(); - nCharsToRollback++; - } while (Character.isWhitespace((char) c)); - - - // Di- and trigraph support - if (c == '#') { - hashSignDetected = true; - } else if (c == '%') { - c = scanner.read(); - nCharsToRollback++; - if (c == ':') { - hashSignDetected = true; - } - } else if (c == '?') { - c = scanner.read(); - nCharsToRollback++; - if (c == '?') { - c = scanner.read(); - nCharsToRollback++; - if (c == '=') { - hashSignDetected = true; - } - } - } - - if (hashSignDetected) { - - do { - c = scanner.read(); - } while (Character.isWhitespace((char) c)); - - fBuffer.setLength(0); - - do { - fBuffer.append((char) c); - c = scanner.read(); - } while (Character.isJavaIdentifierPart((char) c)); - - scanner.unread(); - - IToken token = (IToken) fWords.get("#" + fBuffer.toString()); - if (token != null) - return token; - - return fDefaultToken; - - } else { // Doesn't start with '#', roll back scanner - - for (int i = 0; i < nCharsToRollback; i++) { - scanner.unread(); - } - } - - return Token.UNDEFINED; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleCharReader.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleCharReader.java deleted file mode 100644 index 4979ce16232..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleCharReader.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.IOException; -import java.io.Reader; - - -public abstract class SingleCharReader extends Reader { - - /** - * @see Reader#read(char) - */ - public abstract int read() throws IOException; - - - /** - * @see Reader#read(char[],int,int) - */ - public int read(char cbuf[], int off, int len) throws IOException { - int end= off + len; - for (int i= off; i < end; i++) { - int ch= read(); - if (ch == -1) { - if (i == off) { - return -1; - } else { - return i - off; - } - } - cbuf[i]= (char)ch; - } - return len; - } - - /** - * @see Reader#ready() - */ - public boolean ready() throws IOException { - return true; - } - - /** - * Gets the content as a String - */ - public String getString() throws IOException { - StringBuffer buf= new StringBuffer(); - int ch; - while ((ch= read()) != -1) { - buf.append((char)ch); - } - return buf.toString(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleTokenCScanner.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleTokenCScanner.java deleted file mode 100644 index b5144a30e88..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SingleTokenCScanner.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.List; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.Token; - - -/** - * - */ -public final class SingleTokenCScanner extends AbstractCScanner{ - - protected IToken fDefaultReturnToken; - private String[] fProperty; - - public SingleTokenCScanner(IColorManager manager, IPreferenceStore store, String property) { - super(manager, store, 20); - fProperty= new String[] { property }; - initialize(); - } - - /* - * @see AbstractCScanner#getTokenProperties() - */ - protected String[] getTokenProperties() { - return fProperty; - } - - /* - * @see AbstractCScanner#createRules() - */ - protected List createRules() { - fDefaultReturnToken= getToken(fProperty[0]); - setDefaultReturnToken(fDefaultReturnToken); - return null; - } - - /** - * setRange -- sets the range to be scanned - */ - - private int position, end; - private int size; - public void setRange(IDocument document, int offset, int length) { - - super.setRange(document, offset, length); - position = offset; - size = length; - end = offset + length; - } - /** - * Returns the next token in the document. - * - * @return the next token in the document - */ - public IToken nextToken() { - - fTokenOffset = position; - - if(position < end) { - size = end - position; - position = end; - return fDefaultReturnToken; - } else { - return Token.EOF; - } - } - - public int getTokenLength() { - return size; - } - - //public int getTokenOffset() { - // return position; - //} - /* while (true) { - - fTokenOffset= fOffset; - fColumn= UNDEFINED; - - if (fRules != null) { - for (int i= 0; i < fRules.length; i++) { - token= (fRules[i].evaluate(this)); - if (!token.isUndefined()) - return token; - } - } - - if (read() == EOF) - return Token.EOF; - else - return fDefaultReturnToken; - } - } */ - -} - - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SubstitutionTextReader.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SubstitutionTextReader.java deleted file mode 100644 index 178482a458f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/SubstitutionTextReader.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.eclipse.cdt.internal.ui.text; - - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.io.IOException; -import java.io.Reader; - - -/** - * Reads the text contents from a reader and computes for each character - * a potential substitution. The substitution may eat more characters than - * only the one passed into the computation routine. - */ -public abstract class SubstitutionTextReader extends SingleCharReader { - - protected static final String LINE_DELIM= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ - - private Reader fReader; - private boolean fWasWhiteSpace; - private int fCharAfterWhiteSpace; - - private boolean fReadFromBuffer; - private StringBuffer fBuffer; - private int fIndex; - - - protected SubstitutionTextReader(Reader reader) { - fReader= reader; - fBuffer= new StringBuffer(); - fIndex= 0; - fReadFromBuffer= false; - fCharAfterWhiteSpace= -1; - fWasWhiteSpace= true; - } - - /** - * Implement to compute the substitution for the given character and - * if necessary subsequent characters. Use nextChar - * to read subsequent characters. - */ - protected abstract String computeSubstitution(int c) throws IOException; - - /** - * Returns the internal reader. - */ - protected Reader getReader() { - return fReader; - } - - /** - * Returns the next character. - */ - protected int nextChar() throws IOException { - fReadFromBuffer= (fBuffer.length() > 0); - if (fReadFromBuffer) { - char ch= fBuffer.charAt(fIndex++); - if (fIndex >= fBuffer.length()) { - fBuffer.setLength(0); - fIndex= 0; - } - return ch; - } else { - int ch= fCharAfterWhiteSpace; - if (ch == -1) { - ch= fReader.read(); - } - if (Character.isWhitespace((char)ch)) { - do { - ch= fReader.read(); - } while (Character.isWhitespace((char)ch)); - if (ch != -1) { - fCharAfterWhiteSpace= ch; - return ' '; - } - } else { - fCharAfterWhiteSpace= -1; - } - return ch; - } - } - - /** - * @see Reader#read() - */ - public int read() throws IOException { - int c; - do { - - c= nextChar(); - while (!fReadFromBuffer) { - String s= computeSubstitution(c); - if (s == null) - break; - if (s.length() > 0) - fBuffer.insert(0, s); - c= nextChar(); - } - - } while (fWasWhiteSpace && (c == ' ')); - - fWasWhiteSpace= (c == ' ' || c == '\r' || c == '\n'); - return c; - } - - /** - * @see Reader#ready() - */ - public boolean ready() throws IOException { - return fReader.ready(); - } - - /** - * @see Reader#close() - */ - public void close() throws IOException { - fReader.close(); - } - - /** - * @see Reader#reset() - */ - public void reset() throws IOException { - fReader.reset(); - fWasWhiteSpace= true; - fCharAfterWhiteSpace= -1; - fBuffer.setLength(0); - fIndex= 0; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java deleted file mode 100644 index 6741f5f636d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java +++ /dev/null @@ -1,673 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.contentassist; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.search.BasicSearchMatch; -import org.eclipse.cdt.core.search.BasicSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.core.search.matching.OrPattern; -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.ContextTypeRegistry; -import org.eclipse.cdt.internal.corext.template.ITemplateEditor; -import org.eclipse.cdt.internal.ui.CCompletionContributorManager; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.CUIMessages; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.text.CParameterListValidator; -import org.eclipse.cdt.internal.ui.text.template.TemplateEngine; -import org.eclipse.cdt.ui.CSearchResultLabelProvider; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.FunctionPrototypeSummary; -import org.eclipse.cdt.ui.IFunctionSummary; -import org.eclipse.cdt.ui.IWorkingCopyManager; -import org.eclipse.cdt.ui.text.ICCompletionProposal; -import org.eclipse.core.resources.IFile; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.ContextInformation; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.text.contentassist.IContextInformationExtension; -import org.eclipse.jface.text.contentassist.IContextInformationValidator; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IEditorPart; - -/** - * C completion processor. - */ -public class CCompletionProcessor implements IContentAssistProcessor { - - private static class ContextInformationWrapper implements IContextInformation, IContextInformationExtension { - - private final IContextInformation fContextInformation; - private int fPosition; - - public ContextInformationWrapper(IContextInformation contextInformation) { - fContextInformation= contextInformation; - } - - /* - * @see IContextInformation#getContextDisplayString() - */ - public String getContextDisplayString() { - return fContextInformation.getContextDisplayString(); - } - - /* - * @see IContextInformation#getImage() - */ - public Image getImage() { - return fContextInformation.getImage(); - } - - /* - * @see IContextInformation#getInformationDisplayString() - */ - public String getInformationDisplayString() { - return fContextInformation.getInformationDisplayString(); - } - - /* - * @see IContextInformationExtension#getContextInformationPosition() - */ - public int getContextInformationPosition() { - return fPosition; - } - - public void setContextInformationPosition(int position) { - fPosition= position; - } - } - - - private CEditor fEditor; - private char[] fProposalAutoActivationSet; - private CCompletionProposalComparator fComparator; - private IContextInformationValidator fValidator; - - private TemplateEngine[] fGlobalContextTemplateEngine; - private TemplateEngine[] fFunctionContextTemplateEngine; - private TemplateEngine[] fStructureContextTemplateEngine; - - private boolean fRestrictToMatchingCase; - private boolean fAllowAddIncludes; - - private BasicSearchResultCollector searchResultCollector = null; - private ResultCollector resultCollector = null; - private CompletionEngine completionEngine = null; - - private SearchEngine searchEngine = null; - private CSearchResultLabelProvider labelProvider = null; - - private int fCurrentOffset = 0; - private IWorkingCopy fCurrentSourceUnit = null; - private int fNumberOfComputedResults= 0; - private ITextViewer fTextViewer; - - public CCompletionProcessor(IEditorPart editor) { - fEditor = (CEditor) editor; - - // Needed for search - labelProvider = new CSearchResultLabelProvider(); - searchResultCollector = new BasicSearchResultCollector (); - resultCollector = new ResultCollector(); - completionEngine = new CompletionEngine(resultCollector); - searchEngine = new SearchEngine(); - setupTemplateEngine(); - - fRestrictToMatchingCase = false; - fAllowAddIncludes = true; - - fComparator = new CCompletionProposalComparator(); - } - - private boolean isCppContext(){ - String filename = null; - if (fEditor != null && fEditor.getEditorInput() != null) { - filename = fEditor.getEditorInput().getName(); - } - if (filename == null) { - return true; - } else if (filename.endsWith(".c")) { - //Straight C files are always C - return false; - } else if ( - filename.endsWith(".cpp") - || filename.endsWith(".cc") - || filename.endsWith(".cxx") - || filename.endsWith(".C") - || filename.endsWith(".hxx")) { - return true; - } else { - //Defer to the nature of the project - IFile file = fEditor.getInputFile(); - if (file != null && CoreModel.getDefault().hasCCNature(file.getProject())) { - return true; - } else { - return false; - } - } - } - - private void setupTemplateEngine(){ - //Determine if this is a C or a C++ file for the context completion + //This is _totally_ ugly and likely belongs in the main editor class. - String globalContextNames[] = new String[2]; - String functionContextNames[] = new String[2]; - String structureContextNames[] = new String[2]; - ArrayList globalTemplateList = new ArrayList(2); - ArrayList functionTemplateList = new ArrayList(2); - ArrayList structureTemplateList = new ArrayList(2); - if(isCppContext()){ - // CPP context - globalContextNames[0] = ITemplateEditor.TemplateContextKind.CPP_GLOBAL_CONTEXT_TYPE; //$NON-NLS-1$ - globalContextNames[1] = ITemplateEditor.TemplateContextKind.C_GLOBAL_CONTEXT_TYPE; //$NON-NLS-1$ - functionContextNames[0] = ITemplateEditor.TemplateContextKind.CPP_FUNCTION_CONTEXT_TYPE; //$NON-NLS-1$ - functionContextNames[1] = ITemplateEditor.TemplateContextKind.C_FUNCTION_CONTEXT_TYPE; //$NON-NLS-1$ - structureContextNames[0] = ITemplateEditor.TemplateContextKind.CPP_STRUCTURE_CONTEXT_TYPE; //$NON-NLS-1$ - structureContextNames[1] = ITemplateEditor.TemplateContextKind.C_STRUCTURE_CONTEXT_TYPE; //$NON-NLS-1$ - }else { - // C context - globalContextNames[0] = ITemplateEditor.TemplateContextKind.C_GLOBAL_CONTEXT_TYPE; //$NON-NLS-1$ - structureContextNames[0] = ITemplateEditor.TemplateContextKind.C_STRUCTURE_CONTEXT_TYPE; //$NON-NLS-1$ - functionContextNames[0] = ITemplateEditor.TemplateContextKind.C_FUNCTION_CONTEXT_TYPE; //$NON-NLS-1$ - } - ContextType contextType; - for (int i = 0; i < globalContextNames.length; i++) { - contextType = ContextTypeRegistry.getInstance().getContextType(globalContextNames[i]); - if (contextType != null) { - globalTemplateList.add(new TemplateEngine(contextType)); - } - } - for (int i = 0; i < functionContextNames.length; i++) { - contextType = ContextTypeRegistry.getInstance().getContextType(functionContextNames[i]); - if (contextType != null) { - functionTemplateList.add(new TemplateEngine(contextType)); - } - } - for (int i = 0; i < structureContextNames.length; i++) { - contextType = ContextTypeRegistry.getInstance().getContextType(structureContextNames[i]); - if (contextType != null) { - structureTemplateList.add(new TemplateEngine(contextType)); - } - } - fGlobalContextTemplateEngine = (TemplateEngine[]) globalTemplateList.toArray(new TemplateEngine[globalTemplateList.size()]); - fFunctionContextTemplateEngine = (TemplateEngine[]) functionTemplateList.toArray(new TemplateEngine[functionTemplateList.size()]); - fStructureContextTemplateEngine = (TemplateEngine[]) structureTemplateList.toArray(new TemplateEngine[structureTemplateList.size()]); - } - /** - * Tells this processor to order the proposals alphabetically. - * - * @param order true if proposals should be ordered. - */ - public void orderProposalsAlphabetically(boolean order) { - fComparator.setOrderAlphabetically(order); - } - - /** - * @see IContentAssistProcessor#getErrorMessage() - */ - public String getErrorMessage() { - if (fNumberOfComputedResults == 0) { - String errorMsg= resultCollector.getErrorMessage(); - if (errorMsg == null || errorMsg.trim().length() == 0) - errorMsg= CUIMessages.getString("CEditor.contentassist.noCompletions"); //$NON-NLS-1$ - return errorMsg; - } - - return resultCollector.getErrorMessage(); - } - - /** - * @see IContentAssistProcessor#getContextInformationValidator() - */ - public IContextInformationValidator getContextInformationValidator() { - if(fValidator == null) { - fValidator = new CParameterListValidator(); - } - return fValidator; - } - - /** - * @see IContentAssistProcessor#getContextInformationAutoActivationCharacters() - */ - public char[] getContextInformationAutoActivationCharacters() { - return null; - } - - /** - * @see IContentAssistProcessor#computeContextInformation(ITextViewer, int) - */ - public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { - List result= addContextInformations(viewer, offset); - return (IContextInformation[]) result.toArray(new IContextInformation[result.size()]); - } - - private List addContextInformations(ITextViewer viewer, int offset) { - ICompletionProposal[] proposals= internalComputeCompletionProposals(viewer, offset); - - List result= new ArrayList(); - for (int i= 0; i < proposals.length; i++) { - IContextInformation contextInformation= proposals[i].getContextInformation(); - if (contextInformation != null) { - ContextInformationWrapper wrapper= new ContextInformationWrapper(contextInformation); - wrapper.setContextInformationPosition(offset); - result.add(wrapper); - } - } - return result; - } - - /** - * @see IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() - */ - public char[] getCompletionProposalAutoActivationCharacters() { - return fProposalAutoActivationSet; - } - - /** - * Sets this processor's set of characters triggering the activation of the - * completion proposal computation. - * - * @param activationSet the activation set - */ - public void setCompletionProposalAutoActivationCharacters(char[] activationSet) { - fProposalAutoActivationSet = activationSet; - } - - /** - * Tells this processor to restrict is proposals to those - * starting with matching cases. - * - * @param restrict true if proposals should be restricted - */ - public void restrictProposalsToMatchingCases(boolean restrict) { - // not yet supported - } - - /** - * Tells this processor to add include statement for proposals that have - * a fully qualified type name - * - * @param restrict true if import can be added - */ - public void allowAddingIncludes(boolean allowAddingIncludes) { - fAllowAddIncludes = allowAddingIncludes; - } - - /** - * @see IContentAssistProcessor#computeCompletionProposals(ITextViewer, int) - */ - public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { - return internalComputeCompletionProposals(viewer, offset); - } - - private ICompletionProposal[] internalComputeCompletionProposals(ITextViewer viewer, int offset) { - IWorkingCopyManager fManager = CUIPlugin.getDefault().getWorkingCopyManager(); - IWorkingCopy unit = fManager.getWorkingCopy(fEditor.getEditorInput()); - - IDocument document = viewer.getDocument(); - - ICCompletionProposal[] results = null; - - try { -// if (document != null) { -// -// int offset = documentOffset; -// int length = 0; -// -// Point selection = viewer.getSelectedRange(); -// if (selection.y > 0) { -// offset = selection.x; -// length = selection.y; -// } - - results = evalProposals(document, offset, unit, viewer); -// } - } catch (Exception e) { - CUIPlugin.getDefault().log(e); - } - - fNumberOfComputedResults= (results == null ? 0 : results.length); - - if (results == null) - results = new ICCompletionProposal[0]; - - /* - * Order here and not in result collector to make sure that the order - * applies to all proposals and not just those of the compilation unit. - */ - order(results); - return results; - } - /** - * Order the given proposals. - */ - private ICCompletionProposal[] order(ICCompletionProposal[] proposals) { - if(proposals != null) - Arrays.sort(proposals, fComparator); - return proposals; - } - - /** - * Evaluate the actual proposals for C - */ - public ICCompletionProposal[] evalProposals(IDocument document, int documentOffset, IWorkingCopy unit, ITextViewer viewer) { - // setup the global variables - fCurrentOffset = documentOffset; - fCurrentSourceUnit = unit; - fTextViewer = viewer; - - ArrayList completions = new ArrayList(); - - if (fCurrentSourceUnit == null) - return null; - - // clear the completion list at the result collector - resultCollector.reset(viewer); - - IASTCompletionNode completionNode = addProposalsFromModel(completions); - addProposalsFromSearch(completionNode, completions); - addProposalsFromCompletionContributors(completionNode, completions); - addProposalsFromTemplates(viewer, completionNode, completions); - - return order ( (ICCompletionProposal[]) completions.toArray(new ICCompletionProposal[0]) ); - } - - private void addProposalsFromTemplates(ITextViewer viewer, IASTCompletionNode completionNode, List completions){ - if(completionNode == null) - return; - - if(viewer == null) - return; - - IASTCompletionNode.CompletionKind kind = completionNode.getCompletionKind(); - - if(kind == IASTCompletionNode.CompletionKind.VARIABLE_TYPE) - addProposalsFromTemplateEngine(viewer, fGlobalContextTemplateEngine, completions); - if(kind == IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE) - addProposalsFromTemplateEngine(viewer, fFunctionContextTemplateEngine, completions); - if(kind == IASTCompletionNode.CompletionKind.FIELD_TYPE) - addProposalsFromTemplateEngine(viewer, fStructureContextTemplateEngine, completions); - } - - private void addProposalsFromTemplateEngine(ITextViewer viewer, TemplateEngine[] fTemplateEngine, List completions){ - for (int i = 0; i < fTemplateEngine.length; i++) { - if (fTemplateEngine[i] == null) { - continue; - } - try { - fTemplateEngine[i].reset(); - fTemplateEngine[i].complete(viewer, fCurrentOffset, null); - } catch (Exception x) { - CUIPlugin.getDefault().log(x); - } - - completions.addAll(fTemplateEngine[i].getResults()); - } - - } - private void addProposalsFromCompletionContributors(IASTCompletionNode completionNode, List completions) { - if(completionNode == null) - return; - String prefix = completionNode.getCompletionPrefix(); - int offset = fCurrentOffset - prefix.length(); - int length = prefix.length(); - - // calling functions should happen only within the context of a code body - if(completionNode.getCompletionContext() != IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE) - return; - - IFunctionSummary[] summary; - - summary = CCompletionContributorManager.getDefault().getMatchingFunctions(prefix); - if(summary == null) { - return; - } - - for (int i = 0; i < summary.length; i++) { - String fname = summary[i].getName() + "()"; - String fdesc = summary[i].getDescription(); - IFunctionSummary.IFunctionPrototypeSummary fproto = summary[i].getPrototype(); - String fargs = fproto.getArguments(); - - CCompletionProposal proposal; - proposal = new CCompletionProposal(fname, - offset, - length, - CPluginImages.get(CPluginImages.IMG_OBJS_FUNCTION), - fproto.getPrototypeString(true), - 2, - fTextViewer); - - if(fdesc != null) { - proposal.setAdditionalProposalInfo(fdesc); - } - - if(fargs != null && fargs.length() > 0) { - proposal.setContextInformation(new ContextInformation(fname, fargs)); - } - - completions.add(proposal); - } - } - - private FunctionPrototypeSummary getPrototype (BasicSearchMatch match) { - switch(match.getElementType()){ - case ICElement.C_FUNCTION: - case ICElement.C_FUNCTION_DECLARATION: - case ICElement.C_METHOD: - case ICElement.C_METHOD_DECLARATION: - { - return (new FunctionPrototypeSummary ( match.getReturnType() + " " + match.getName() )); - } - default: - return null; - } - } - - - private IASTCompletionNode addProposalsFromModel(List completions){ - //invoke the completion engine - IASTCompletionNode completionNode = completionEngine.complete(fCurrentSourceUnit, fCurrentOffset); - return completionNode; - } - - private void addProposalsFromSearch (IASTCompletionNode completionNode, List completions) { - if(completionNode == null) - return; - String prefix = completionNode.getCompletionPrefix(); - int offset = fCurrentOffset - prefix.length(); - int length = prefix.length(); - - String searchPrefix = prefix + "*"; - - // figure out the search scope - IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); - boolean fileScope = store.getBoolean(ContentAssistPreference.CURRENT_FILE_SEARCH_SCOPE); - boolean projectScope = store.getBoolean(ContentAssistPreference.PROJECT_SEARCH_SCOPE); - boolean projectScopeAndDependency = store.getBoolean(ContentAssistPreference.PROJECT_AND_DEPENDENCY_SEARCH_SCOPE); - ICSearchScope scope = null; - - if (((projectScope) || (projectScopeAndDependency)) - && ( (completionNode.getCompletionKind() == IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE) - || (completionNode.getCompletionKind() == IASTCompletionNode.CompletionKind.VARIABLE_TYPE) - || (completionNode.getCompletionKind() == IASTCompletionNode.CompletionKind.FIELD_TYPE) ) - && (prefix.length() > 0)){ - List elementsFound = new LinkedList(); - - ICElement[] projectScopeElement = new ICElement[1]; - projectScopeElement[0] = (ICElement)fCurrentSourceUnit.getCProject(); - scope = SearchEngine.createCSearchScope(projectScopeElement, projectScopeAndDependency); - - // search for global variables, functions, classes, structs, unions, enums, macros, and namespaces - OrPattern orPattern = new OrPattern(); - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.TYPE, ICSearchConstants.DECLARATIONS, false )); - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.ENUM, ICSearchConstants.DECLARATIONS, false )); - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.MACRO, ICSearchConstants.DECLARATIONS, false )); - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.NAMESPACE, ICSearchConstants.DEFINITIONS, false )); - - if( (completionNode.getCompletionKind() == IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE)){ - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.VAR, ICSearchConstants.DECLARATIONS, false )); - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.FUNCTION, ICSearchConstants.DEFINITIONS, false )); - orPattern.addPattern(SearchEngine.createSearchPattern( - searchPrefix, ICSearchConstants.FUNCTION, ICSearchConstants.DECLARATIONS, false )); - } - searchEngine.search(CUIPlugin.getWorkspace(), orPattern, scope, searchResultCollector, true); - elementsFound.addAll(searchResultCollector.getSearchResults()); - - sendResultsToCollector(elementsFound.iterator(), offset, length, prefix ); - } - - completions.addAll(resultCollector.getCompletions()); - - } - - private void sendResultsToCollector(Iterator results , int completionStart, int completionLength, String prefix){ - while (results.hasNext()){ - ASTAccessVisibility visibility; - - BasicSearchMatch match = (BasicSearchMatch)results.next(); - int type = match.getElementType(); - int relevance = completionEngine.computeRelevance(type, prefix, match.getName()); - switch (type){ - case ICElement.C_FIELD: - switch (match.getVisibility()){ - case ICElement.CPP_PUBLIC: - visibility = ASTAccessVisibility.PUBLIC; - break; - case ICElement.CPP_PROTECTED: - visibility = ASTAccessVisibility.PROTECTED; - break; - default: - visibility = ASTAccessVisibility.PRIVATE; - break; - }; - resultCollector.acceptField( - match.getName(), - match.getReturnType(), - visibility, - completionStart, - completionLength, - relevance); - break; - - case ICElement.C_VARIABLE: - case ICElement.C_VARIABLE_DECLARATION: - resultCollector.acceptVariable( - match.getName(), - match.getReturnType(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_METHOD: - case ICElement.C_METHOD_DECLARATION: - switch (match.getVisibility()){ - case ICElement.CPP_PUBLIC: - visibility = ASTAccessVisibility.PUBLIC; - break; - case ICElement.CPP_PROTECTED: - visibility = ASTAccessVisibility.PROTECTED; - break; - default: - visibility = ASTAccessVisibility.PRIVATE; - break; - }; - resultCollector.acceptMethod( - match.getName(), - null, - match.getReturnType(), - visibility, - completionStart, - completionLength, - relevance); - break; - case ICElement.C_FUNCTION: - case ICElement.C_FUNCTION_DECLARATION: - resultCollector.acceptFunction( - match.getName(), - null, - match.getReturnType(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_CLASS: - resultCollector.acceptClass( - match.getName(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_STRUCT: - resultCollector.acceptStruct( - match.getName(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_UNION: - resultCollector.acceptUnion( - match.getName(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_NAMESPACE: - resultCollector.acceptNamespace( - match.getName(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_MACRO: - resultCollector.acceptMacro( - match.getName(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_ENUMERATION: - resultCollector.acceptEnumeration( - match.getName(), - completionStart, - completionLength, - relevance); - break; - case ICElement.C_ENUMERATOR: - resultCollector.acceptEnumerator( - match.getName(), - completionStart, - completionLength, - relevance); - break; - default : - break; - } // end switch - } // end while - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java deleted file mode 100644 index 77e3d466a71..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java +++ /dev/null @@ -1,468 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.contentassist; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.text.link.LinkedPositionManager; -import org.eclipse.cdt.internal.ui.text.link.LinkedPositionUI; -import org.eclipse.cdt.internal.ui.text.link.LinkedPositionUI.ExitFlags; -import org.eclipse.cdt.ui.text.ICCompletionProposal; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.ICompletionProposalExtension; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; - -public class CCompletionProposal implements ICCompletionProposal, ICompletionProposalExtension { - private String fDisplayString; - private String fReplacementString; - private String fAdditionalInfoString; - private int fReplacementOffset; - private int fReplacementLength; - private int fCursorPosition; - private Image fImage; - private IContextInformation fContextInformation; - private int fContextInformationPosition; - //private IImportDeclaration fImportDeclaration; - private char[] fTriggerCharacters; - protected ITextViewer fTextViewer; - - private int fRelevance; - - /** - * Creates a new completion proposal. All fields are initialized based on the provided information. - * - * @param replacementString the actual string to be inserted into the document - * @param replacementOffset the offset of the text to be replaced - * @param replacementLength the length of the text to be replaced - * @param image the image to display for this proposal - * @param displayString the string to be displayed for the proposal - * If set to null, the replacement string will be taken as display string. - */ - public CCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image, String displayString, int relevance, ITextViewer viewer) { - Assert.isNotNull(replacementString); - Assert.isTrue(replacementOffset >= 0); - Assert.isTrue(replacementLength >= 0); - - fReplacementString= replacementString; - fReplacementOffset= replacementOffset; - fReplacementLength= replacementLength; - fImage= image; - fDisplayString= displayString != null ? displayString : replacementString; - fRelevance= relevance; - fTextViewer= viewer; - - //@@@ Is this the best way to do this, likely it isn't - if(replacementString.indexOf("()") == -1) { //Not replacing with a function - fCursorPosition = replacementString.length(); - } else if(displayString.indexOf("()") == -1) { //Assume that there are arguments between () - fCursorPosition = replacementString.length() - 1; - } else { - fCursorPosition = replacementString.length(); - } - - fAdditionalInfoString = null; - fContextInformation= null; - fContextInformationPosition= -1; - //fIncludeDeclaration= null; - fTriggerCharacters= null; - } - - /** - * Sets the context information. - * @param contentInformation The context information associated with this proposal - */ - public void setContextInformation(IContextInformation contextInformation) { - fContextInformation= contextInformation; - fContextInformationPosition= (fContextInformation != null ? fCursorPosition : -1); - } - - /** - * Sets the import declaration to import when applied. - * @param importDeclaration Optional import declaration to be added. Can be null. The underlying compilation unit - * is assumed to be compatible with the document passed in apply. - * - public void setIncludeDeclaration(IImportDeclaration importDeclaration) { - fIncludeDeclaration= importDeclaration; - } */ - - /** - * Sets the trigger characters. - * @param triggerCharacters The set of characters which can trigger the application of this completion proposal - */ - public void setTriggerCharacters(char[] triggerCharacters) { - fTriggerCharacters= triggerCharacters; - } - - /** - * Sets the cursor position relative to the insertion offset. By default this is the length of the completion string - * (Cursor positioned after the completion) - * @param cursorPosition The cursorPosition to set - */ - public void setCursorPosition(int cursorPosition) { - Assert.isTrue(cursorPosition >= 0); - fCursorPosition= cursorPosition; - fContextInformationPosition= (fContextInformation != null ? fCursorPosition : -1); - } - -/* protected void addInclude(IRequiredInclude[] inc, CFileElementWorkingCopy tu) { - AddIncludeOperation op= new AddIncludeOperation(fEditor, tu, inc, false); - try { - ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); - dialog.run(false, true, op); - } catch (InvocationTargetException e) { - e.printStackTrace(); - MessageDialog.openError(getShell(), CEditorMessages.getString("AddIncludeOnSelection.error.message1"), e.getTargetException().getMessage()); //$NON-NLS-1$ - } catch (InterruptedException e) { - // Do nothing. Operation has been canceled. - } - } */ - - protected void applyIncludes(IDocument document) { - //AddIncludeOperation(ITextEditor ed, CFileElementWorkingCopy tu, IRequiredInclude[] includes, boolean save) { - - //if (fIncludeDeclaration == null) { - return; - //} - - /* ICompilationUnit cu= (ICompilationUnit) JavaModelUtil.findElementOfKind(fImportDeclaration, IJavaElement.COMPILATION_UNIT); - if (cu != null) { - try { - IType[] types= cu.getTypes(); - if (types.length == 0 || types[0].getSourceRange().getOffset() > fReplacementOffset) { - // do not add import for code assist on import statements - return; - } - - String[] prefOrder= ImportOrganizePreferencePage.getImportOrderPreference(); - int threshold= ImportOrganizePreferencePage.getImportNumberThreshold(); - ImportsStructure impStructure= new ImportsStructure(cu, prefOrder, threshold, true); - - impStructure.addImport(fImportDeclaration.getElementName()); - // will modify the document as the CU works on the document - impStructure.create(false, null); - - } catch (CoreException e) { - JavaPlugin.log(e); - } - } */ - } - - /* - * @see ICompletionProposal#apply - */ - public void apply(IDocument document) { - apply(document, (char) 0, fReplacementOffset + fReplacementLength); - } - - /* - * In this case we need to apply the completion proposal intelligently. - * This means that if we are applying it to a function, we don't wipe - * out the internal arguments, and if the proposal is a function, and it - * already is bracketed, then don't put those brackets in. - * - * @see ICompletionProposalExtension#apply(IDocument, char, int) - */ - public void apply(IDocument document, char trigger, int offset) { - int functionBracketIndex; - boolean isBeforeBracket; - String replacementStringCopy = fReplacementString; - fReplacementLength = offset - fReplacementOffset; - //If just providing context information, then don't move the cursor -// if(offset != (fReplacementOffset + fReplacementLength)) { -// fCursorPosition = offset - fReplacementOffset; -// } - - try { - functionBracketIndex = fReplacementString.indexOf("()"); - isBeforeBracket = document.getChar(fReplacementOffset + fReplacementLength) == '('; - - //Strip the brackets off the function if inserting right before brackets - if(functionBracketIndex != -1 && isBeforeBracket) { - replacementStringCopy = fReplacementString.substring(0, functionBracketIndex); - } - } catch(Exception ex) { - /* Ignore */ - } - - try { - String string; - if (trigger == (char) 0) { - string= fReplacementString; - replace(document, fReplacementOffset, fReplacementLength, replacementStringCopy); - } else { - StringBuffer buffer= new StringBuffer(replacementStringCopy); - - // fix for PR #5533. Assumes that no eating takes place. - if ((fCursorPosition > 0 && fCursorPosition <= buffer.length() && buffer.charAt(fCursorPosition - 1) != trigger)) { - buffer.insert(fCursorPosition, trigger); - ++fCursorPosition; - } - - string= buffer.toString(); - replace(document, fReplacementOffset, fReplacementLength, string); - } - - if (fTextViewer != null && string != null) { - int index= string.indexOf("()"); //$NON-NLS-1$ - if (index != -1 && index + 1 == fCursorPosition) { - //IPreferenceStore preferenceStore= JavaPlugin.getDefault().getPreferenceStore(); - //if (preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACKETS)) { - int newOffset= fReplacementOffset + fCursorPosition; - - LinkedPositionManager manager= new LinkedPositionManager(document); - manager.addPosition(newOffset, 0); - - LinkedPositionUI editor= new LinkedPositionUI(fTextViewer, manager); - editor.setExitPolicy(new ExitPolicy(')')); - editor.setFinalCaretOffset(newOffset + 1); - editor.enter(); - //} - } - } - - /* - * The replacement length is used to calculate the new cursor position, - * so after we update the includes adjust the replacement offset. - * NOTE: This won't work if the include is added after the offset, - * such as might be the case with #include completions. - */ - int oldLen= document.getLength(); - applyIncludes(document); - fReplacementOffset += document.getLength() - oldLen; - - } catch (BadLocationException x) { - // ignore - } - } - - // #6410 - File unchanged but dirtied by code assist - private void replace(IDocument document, int offset, int length, String string) throws BadLocationException { - if (!document.get(offset, length).equals(string)) - document.replace(offset, length, string); - } - - /* - * @see ICompletionProposal#getSelection - */ - public Point getSelection(IDocument document) { - return new Point(fReplacementOffset + fCursorPosition, 0); - } - - /* - * @see ICompletionProposal#getContextInformation() - */ - public IContextInformation getContextInformation() { - return fContextInformation; - } - - /* - * @see ICompletionProposal#getImage() - */ - public Image getImage() { - return fImage; - } - - /* - * @see ICompletionProposal#getDisplayString() - */ - public String getDisplayString() { - return fDisplayString; - } - - /** - * Set the additional information which will be shown when this - * proposal is selected in the popup list. - * @param infoString - */ - public void setAdditionalProposalInfo(String infoString) { - fAdditionalInfoString = infoString; - } - - /* - * @see ICompletionProposal#getAdditionalProposalInfo() - */ - public String getAdditionalProposalInfo() { - return fAdditionalInfoString; - } - - /* - * @see ICompletionProposalExtension#getTriggerCharacters() - */ - public char[] getTriggerCharacters() { - return fTriggerCharacters; - } - - /* - * @see ICompletionProposalExtension#getContextInformationPosition() - */ - public int getContextInformationPosition() { - return fReplacementOffset + fContextInformationPosition; - } - - /* - * @see ICompletionProposalExtension#isValidFor(IDocument, int) - */ - public boolean isValidFor(IDocument document, int offset) { - if (offset < fReplacementOffset) - return false; - - int replacementLength= fReplacementString == null ? 0 : fReplacementString.length(); - if (offset > fReplacementOffset + replacementLength) - return false; - - try { - int length= offset - fReplacementOffset; - String start= document.get(fReplacementOffset, length); - return fReplacementString.substring(0, length).equalsIgnoreCase(start); - } catch (BadLocationException x) { - } - - return false; - } - - /** - * Gets the replacement offset. - * @return Returns a int - */ - public int getReplacementOffset() { - return fReplacementOffset; - } - - /** - * Sets the replacement offset. - * @param replacementOffset The replacement offset to set - */ - public void setReplacementOffset(int replacementOffset) { - Assert.isTrue(replacementOffset >= 0); - fReplacementOffset= replacementOffset; - } - - /** - * Gets the replacement length. - * @return Returns a int - */ - public int getReplacementLength() { - return fReplacementLength; - } - - /** - * Sets the replacement length. - * @param replacementLength The replacementLength to set - */ - public void setReplacementLength(int replacementLength) { - Assert.isTrue(replacementLength >= 0); - fReplacementLength= replacementLength; - } - - /** - * Gets the replacement string. - * @return Returns a String - */ - public String getReplacementString() { - return fReplacementString; - } - - /** - * Sets the replacement string. - * @param replacementString The replacement string to set - */ - public void setReplacementString(String replacementString) { - fReplacementString= replacementString; - } - - /** - * Sets the image. - * @param image The image to set - */ - public void setImage(Image image) { - fImage= image; - } - - /** - * Gets the proposal's relevance. - * @return Returns a int - */ - public int getRelevance() { - return fRelevance; - } - - /** - * Sets the proposal's relevance. - * @param relevance The relevance to set - */ - public void setRelevance(int relevance) { - fRelevance= relevance; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return fDisplayString.hashCode() - + fReplacementString.hashCode() - + ((fAdditionalInfoString == null) ? 0 : fAdditionalInfoString.hashCode()); - } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if(!(other instanceof CCompletionProposal)) - return false; - if(!(fDisplayString.equals(((CCompletionProposal)other).fDisplayString))) - return false; - if(!(fReplacementString.equals(((CCompletionProposal)other).fReplacementString))) - return false; - if((fAdditionalInfoString != null) && (((CCompletionProposal)other).fAdditionalInfoString != null) && (!(fAdditionalInfoString.equals(((CCompletionProposal)other).fAdditionalInfoString)))) - return false; - - return true; - } - - private static class ExitPolicy implements LinkedPositionUI.ExitPolicy { - - final char fExitCharacter; - - public ExitPolicy(char exitCharacter) { - fExitCharacter= exitCharacter; - } - - /* - * @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitPolicy#doExit(org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager, org.eclipse.swt.events.VerifyEvent, int, int) - */ - public ExitFlags doExit(LinkedPositionManager manager, VerifyEvent event, int offset, int length) { - - if (event.character == fExitCharacter) { - if (manager.anyPositionIncludes(offset, length)) - return new ExitFlags(LinkedPositionUI.COMMIT| LinkedPositionUI.UPDATE_CARET, false); - else - return new ExitFlags(LinkedPositionUI.COMMIT, true); - } - - switch (event.character) { - case '\b': - if (manager.getFirstPosition().length == 0) - return new ExitFlags(0, true); - else - return null; - - case '\n': - case '\r': - case ';': - return new ExitFlags(LinkedPositionUI.COMMIT, true); - - default: - return null; - } - } - - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposalComparator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposalComparator.java deleted file mode 100644 index fc316b47308..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposalComparator.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.contentassist; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.Comparator; - -import org.eclipse.cdt.ui.text.*; - -public class CCompletionProposalComparator implements Comparator { - - private boolean fOrderAlphabetically; - - /** - * Constructor for CompletionProposalComparator. - */ - public CCompletionProposalComparator() { - fOrderAlphabetically= false; - } - - public void setOrderAlphabetically(boolean orderAlphabetically) { - fOrderAlphabetically= orderAlphabetically; - } - - /* (non-Javadoc) - * @see Comparator#compare(Object, Object) - */ - public int compare(Object o1, Object o2) { - ICCompletionProposal c1= (ICCompletionProposal) o1; - ICCompletionProposal c2= (ICCompletionProposal) o2; - if (!fOrderAlphabetically) { - int relevanceDif= c2.getRelevance() - c1.getRelevance(); - if (relevanceDif != 0) { - return relevanceDif; - } - } - return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString()); - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java deleted file mode 100644 index 329af0dadeb..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java +++ /dev/null @@ -1,844 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.ui.text.contentassist; - -import java.io.CharArrayReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.parser.IParser; -import org.eclipse.cdt.core.parser.IScanner; -import org.eclipse.cdt.core.parser.IScannerInfo; -import org.eclipse.cdt.core.parser.IScannerInfoProvider; -import org.eclipse.cdt.core.parser.ParserFactory; -import org.eclipse.cdt.core.parser.ParserFactoryException; -import org.eclipse.cdt.core.parser.ParserLanguage; -import org.eclipse.cdt.core.parser.ParserMode; -import org.eclipse.cdt.core.parser.ParserNotImplementedException; -import org.eclipse.cdt.core.parser.ParserUtil; -import org.eclipse.cdt.core.parser.ScannerInfo; -import org.eclipse.cdt.core.parser.ast.ASTClassKind; -import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTCodeScope; -import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; -import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier; -import org.eclipse.cdt.core.parser.ast.IASTEnumerator; -import org.eclipse.cdt.core.parser.ast.IASTField; -import org.eclipse.cdt.core.parser.ast.IASTFunction; -import org.eclipse.cdt.core.parser.ast.IASTMacro; -import org.eclipse.cdt.core.parser.ast.IASTMethod; -import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition; -import org.eclipse.cdt.core.parser.ast.IASTNode; -import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.parser.ast.IASTScope; -import org.eclipse.cdt.core.parser.ast.IASTVariable; -import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind; -import org.eclipse.cdt.core.parser.ast.IASTNode.LookupResult; -import org.eclipse.cdt.internal.core.CharOperation; -import org.eclipse.cdt.internal.core.model.IDebugLogConstants; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.core.model.Util; -import org.eclipse.cdt.internal.core.parser.util.ASTUtil; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jface.preference.IPreferenceStore; - -/** - * @author hamer - * - * This class is the entry point for code completions. - * It contains a public API used to call ContentAssist on a given working copy - * and a given completion offset. - * - */ -public class CompletionEngine implements RelevanceConstants{ - ICompletionRequestor requestor; - int completionStart = 0; - int completionLength = 0; - IPreferenceStore store = CUIPlugin.getDefault().getPreferenceStore(); - // keywords types - public static final int BASIC_TYPES_KEYWORDS = 0; - private static final String basicTypesKeywords[] = { - "namespace", - "class", - "struct", - "union", - "enum", - "bool", - "char", - "wchar_t", - "int", - "float", - "double", - "void", - "template", - }; - private static final String exceptionKeyword = "..."; - // scope relevance element counters - private int numFields = 0; - private int numVariables = 0; - private int numLocalVariables = 0; - private int numMethods = 0; - private int numFunctions = 0; - private int numClasses = 0; - private int numStructs = 0; - private int numUnions = 0; - private int numEnumerations = 0; - private int numEnumerators = 0; - private int numNamespaces = 0; - private int numMacros = 0; - - public CompletionEngine(ICompletionRequestor completionRequestor){ - requestor = completionRequestor; - } - - private int computeCaseMatchingRelevance(String prefix, String proposalName){ - if (CharOperation.prefixEquals(prefix.toCharArray(), proposalName.toCharArray(), true /* do not ignore case */)) { - if(CharOperation.equals(prefix.toCharArray(), proposalName.toCharArray(), true /* do not ignore case */)) { - return CASE_MATCH_RELEVANCE + EXACT_NAME_MATCH_RELEVANCE; - } else { - return CASE_MATCH_RELEVANCE; - } - } - else { - return 0; - } - } - private int computeTypeRelevance(int type){ - switch (type){ - case ICElement.C_VARIABLE_LOCAL: - return LOCAL_VARIABLE_TYPE_RELEVANCE; - case ICElement.C_FIELD: - return FIELD_TYPE_RELEVANCE; - case ICElement.C_VARIABLE: - case ICElement.C_VARIABLE_DECLARATION: - return VARIABLE_TYPE_RELEVANCE; - case ICElement.C_METHOD: - case ICElement.C_METHOD_DECLARATION: - return METHOD_TYPE_RELEVANCE; - case ICElement.C_FUNCTION: - case ICElement.C_FUNCTION_DECLARATION: - return FUNCTION_TYPE_RELEVANCE; - case ICElement.C_CLASS: - return CLASS_TYPE_RELEVANCE; - case ICElement.C_STRUCT: - return STRUCT_TYPE_RELEVANCE; - case ICElement.C_UNION: - return UNION_TYPE_RELEVANCE; - case ICElement.C_NAMESPACE: - return NAMESPACE_TYPE_RELEVANCE; - case ICElement.C_MACRO: - return MACRO_TYPE_RELEVANCE; - case ICElement.C_ENUMERATION: - return ENUMERATION_TYPE_RELEVANCE; - case ICElement.C_ENUMERATOR: - return ENUMERATOR_TYPE_RELEVANCE; - default : - return DEFAULT_TYPE_RELEVANCE; - } - } - public int computeRelevance(int elementType, String prefix, String proposalName){ - // compute the relevance according to the elemnent type - int relevance = computeTypeRelevance(elementType); - // compute the relevance according to the case sensitivity - relevance += computeCaseMatchingRelevance(prefix, proposalName); - return relevance; - } - private IASTCompletionNode parse(IWorkingCopy sourceUnit, int completionOffset){ - ContentAssistElementRequestor requestor = new ContentAssistElementRequestor(); - // Get resource info - IResource currentResource = sourceUnit.getResource(); - IPath realPath = currentResource.getLocation(); - IProject project = currentResource.getProject(); - Reader reader = new CharArrayReader( sourceUnit.getContents() ); - - //Get the scanner info - IScannerInfo scanInfo = new ScannerInfo(); - IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(project); - if (provider != null){ - IScannerInfo buildScanInfo = provider.getScannerInformation(project); - if( buildScanInfo != null ) - scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths()); - } - - //C or CPP? - ParserLanguage language = CoreModel.getDefault().hasCCNature(project) ? ParserLanguage.CPP : ParserLanguage.C; - - IParser parser = null; - try - { - IScanner scanner = ParserFactory.createScanner( reader, realPath.toOSString(), scanInfo, ParserMode.CONTEXTUAL_PARSE, language, requestor, ParserUtil.getParserLogService() ); - parser = ParserFactory.createParser( scanner, requestor, ParserMode.CONTEXTUAL_PARSE, language, ParserUtil.getParserLogService() ); - } - catch( ParserFactoryException pfe ) - { - - } - if(parser != null){ - IASTCompletionNode result = null; - try { - result = parser.parse(completionOffset); - } catch (ParserNotImplementedException e) { - } - return result; - } else { - return null; - } - } - - private void addNodeToCompletions(IASTNode node, String prefix, int totalNumberOfResults){ - if(node instanceof IASTField){ - numFields++; - IASTField field = (IASTField)node; - int relevance = computeRelevance(ICElement.C_FIELD, prefix, field.getName()); - relevance += totalNumberOfResults - numFields; - - requestor.acceptField(field.getName(), - ASTUtil.getType(field.getAbstractDeclaration()), - field.getVisiblity(), completionStart, completionLength, relevance); - } - else if (node instanceof IASTParameterDeclaration){ - numLocalVariables++; - IASTParameterDeclaration param = (IASTParameterDeclaration) node; - int relevance = computeRelevance(ICElement.C_VARIABLE_LOCAL, prefix, param.getName()); - relevance += totalNumberOfResults - numLocalVariables; - - requestor.acceptLocalVariable(param.getName(), - ASTUtil.getType(param), - completionStart, completionLength, relevance); - } - else if(node instanceof IASTVariable){ - IASTVariable variable = (IASTVariable)node; - // get the container to check if it is a local variable - IASTNode container = variable.getOwnerScope(); - if(container instanceof IASTCodeScope){ - numLocalVariables++; - int relevance = computeRelevance(ICElement.C_VARIABLE_LOCAL, prefix, variable.getName()); - relevance += totalNumberOfResults - numLocalVariables; - - requestor.acceptLocalVariable(variable.getName(), - ASTUtil.getType(variable.getAbstractDeclaration()), - completionStart, completionLength, relevance); - }else { - numVariables++; - int relevance = computeRelevance(ICElement.C_VARIABLE, prefix, variable.getName()); - relevance += totalNumberOfResults - numVariables; - - requestor.acceptVariable(variable.getName(), - ASTUtil.getType(variable.getAbstractDeclaration()), - completionStart, completionLength, relevance); - } - } - else if(node instanceof IASTMethod) { - numMethods++; - IASTMethod method = (IASTMethod)node; - int relevance = computeRelevance(ICElement.C_METHOD, prefix, method.getName()); - relevance += totalNumberOfResults - numMethods; - - String parameterString = ASTUtil.getParametersString(ASTUtil.getFunctionParameterTypes(method)); - requestor.acceptMethod(method.getName(), - parameterString, - ASTUtil.getType(method.getReturnType()), - method.getVisiblity(), completionStart, completionLength, relevance); - } - else if(node instanceof IASTFunction){ - numFunctions++; - IASTFunction function = (IASTFunction)node; - int relevance = computeRelevance(ICElement.C_FUNCTION, prefix, function.getName()); - relevance += totalNumberOfResults - numFunctions; - - String parameterString = ASTUtil.getParametersString(ASTUtil.getFunctionParameterTypes(function)); - requestor.acceptFunction(function.getName(), - parameterString, - ASTUtil.getType(function.getReturnType()), - completionStart, completionLength, relevance); - } - else if(node instanceof IASTClassSpecifier){ - IASTClassSpecifier classSpecifier = (IASTClassSpecifier)node; - ASTClassKind classkind = classSpecifier.getClassKind(); - if(classkind == ASTClassKind.CLASS){ - numClasses++; - int relevance = computeRelevance(ICElement.C_CLASS, prefix, classSpecifier.getName()); - relevance += totalNumberOfResults - numClasses; - - requestor.acceptClass(classSpecifier.getName(), - completionStart, completionLength, relevance); - } - if(classkind == ASTClassKind.STRUCT){ - numStructs++; - int relevance = computeRelevance(ICElement.C_STRUCT, prefix, classSpecifier.getName()); - relevance += totalNumberOfResults - numStructs; - - requestor.acceptStruct(classSpecifier.getName(), - completionStart, completionLength, relevance); - } - if(classkind == ASTClassKind.UNION){ - numUnions++; - int relevance = computeRelevance(ICElement.C_UNION, prefix, classSpecifier.getName()); - relevance += totalNumberOfResults - numUnions; - - requestor.acceptUnion(classSpecifier.getName(), - completionStart, completionLength, relevance); - } - } - else if(node instanceof IASTMacro){ - numMacros++; - IASTMacro macro = (IASTMacro)node; - int relevance = computeRelevance(ICElement.C_MACRO, prefix, macro.getName()); - relevance += totalNumberOfResults - numMacros; - - requestor.acceptMacro(macro.getName(), completionStart, completionLength, relevance); - } - else if(node instanceof IASTNamespaceDefinition){ - numNamespaces++; - IASTNamespaceDefinition namespace = (IASTNamespaceDefinition)node; - int relevance = computeRelevance(ICElement.C_NAMESPACE, prefix, namespace.getName()); - relevance += totalNumberOfResults - numNamespaces; - - requestor.acceptNamespace(namespace.getName(), completionStart, completionLength, relevance); - } - else if(node instanceof IASTEnumerationSpecifier){ - numEnumerations++; - IASTEnumerationSpecifier enumeration = (IASTEnumerationSpecifier)node; - int relevance = computeRelevance(ICElement.C_ENUMERATION, prefix, enumeration.getName()); - relevance += totalNumberOfResults - numEnumerations; - - requestor.acceptEnumeration(enumeration.getName(), completionStart, completionLength, relevance); - } - else if(node instanceof IASTEnumerator){ - numEnumerators++; - IASTEnumerator enumerator = (IASTEnumerator)node; - int relevance = computeRelevance(ICElement.C_ENUMERATOR, prefix, enumerator.getName()); - relevance += totalNumberOfResults - numEnumerators; - - requestor.acceptEnumerator(enumerator.getName(), completionStart, completionLength, relevance); - } - } - - private void addKeywordToCompletions (String keyword){ - int relevance = KEYWORD_TYPE_RELEVANCE; - requestor.acceptKeyword(keyword, completionStart, completionLength, relevance); - } - - private void addKeywordsToCompletions(Iterator keywords){ - while (keywords.hasNext()){ - String keyword = (String) keywords.next(); - addKeywordToCompletions(keyword); - } - } - - private void resetElementNumbers(){ - numFields = 0; - numVariables = 0; - numLocalVariables = 0; - numMethods = 0; - numFunctions = 0; - numClasses = 0; - numStructs = 0; - numUnions = 0; - numEnumerations = 0; - numEnumerators = 0; - numNamespaces = 0; - numMacros = 0; - } - private void addToCompletions (LookupResult result){ - if(result == null) - return; - Iterator nodes = result.getNodes(); - int numberOfElements = result.getResultsSize(); - resetElementNumbers(); - while (nodes.hasNext()){ - IASTNode node = (IASTNode) nodes.next(); - addNodeToCompletions(node, result.getPrefix(), numberOfElements); - } - return ; - } - - private List lookupKeyword(String prefix, int lookupType){ - List result = new ArrayList(); - switch (lookupType){ - case BASIC_TYPES_KEYWORDS: - for(int i = 0; i 0 ) { - // 2. Lookup all types that could be used here - LookupResult result; - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[2]; - kinds[0] = IASTNode.LookupKind.STRUCTURES; - kinds[1] = IASTNode.LookupKind.ENUMERATIONS; - result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } else // prefix is empty, we can not look for everything - { - - } - } - - private void completionOnFieldType(IASTCompletionNode completionNode){ - // 1. basic completion on all types - completionOnTypeReference(completionNode); - // 2. Get the search scope node - IASTScope searchNode = completionNode.getCompletionScope(); - // TODO - // 3. provide a template for constructor/ destructor - // 4. lookup methods - // we are at a field declaration place, the user could be trying to override a function. - // We have to lookup functions that could be overridden here. -// LookupResult result; -// IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; -// kinds[0] = IASTNode.LookupKind.METHODS; -// result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); -// addToCompletions(result); - - } - private void completionOnVariableType(IASTCompletionNode completionNode){ - // 1. basic completion on all types - completionOnTypeReference(completionNode); - } - private void completionOnSingleNameReference(IASTCompletionNode completionNode){ - // 1. Get the search scope node - // the search node is the code scope inwhich completion is requested - IASTScope searchNode = completionNode.getCompletionScope(); - // if prefix is not empty - if (completionNode.getCompletionPrefix().length() > 0){ - // here we have to look for anything that could be referenced within this scope - // 1. lookup local variables, global variables, functions, methods, structures, enums, macros, and namespaces - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[7]; - kinds[0] = IASTNode.LookupKind.LOCAL_VARIABLES; - kinds[1] = IASTNode.LookupKind.FIELDS; - kinds[2] = IASTNode.LookupKind.VARIABLES; - kinds[3] = IASTNode.LookupKind.STRUCTURES; - kinds[4] = IASTNode.LookupKind.ENUMERATIONS; - kinds[5] = IASTNode.LookupKind.METHODS; - kinds[6] = IASTNode.LookupKind.FUNCTIONS; - LookupResult result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } else // prefix is empty - { - // instead of only fields and methods - // kinds[0] = IASTNode.LookupKind.THIS - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[3]; - kinds[0] = IASTNode.LookupKind.LOCAL_VARIABLES; - kinds[1] = IASTNode.LookupKind.FIELDS; - kinds[2] = IASTNode.LookupKind.METHODS; - LookupResult result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } - } - - private void completionOnClassReference(IASTCompletionNode completionNode){ - // 1. Get the search scope node - IASTScope searchNode = completionNode.getCompletionScope(); - // only look for classes - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.CLASSES; - LookupResult result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } - private void completionOnNamespaceReference(IASTCompletionNode completionNode){ - // 1. Get the search scope node - IASTScope searchNode = completionNode.getCompletionScope(); - // only look for namespaces - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.NAMESPACES; - LookupResult result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } - private void completionOnExceptionReference(IASTCompletionNode completionNode){ - // here we have to look for all types - completionOnTypeReference(completionNode); - // plus if the prefix is empty, add "..." to the proposals - if(completionNode.getCompletionPrefix().length() == 0){ - addKeywordToCompletions(exceptionKeyword); - } - } - private void completionOnMacroReference(IASTCompletionNode completionNode){ - // 1. Get the search scope node - IASTScope searchNode = completionNode.getCompletionScope(); - // only look for macros - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.MACROS; - LookupResult result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } - private void completionOnFunctionReference(IASTCompletionNode completionNode){ - // TODO: complete the lookups - } - private void completionOnConstructorReference(IASTCompletionNode completionNode){ - // 1. Get the search scope node - IASTScope searchNode = completionNode.getCompletionScope(); - // only lookup constructors - IASTNode.LookupKind[] kinds = new IASTNode.LookupKind[1]; - kinds[0] = IASTNode.LookupKind.CONSTRUCTORS; - LookupResult result = lookup(searchNode, completionNode.getCompletionPrefix(), kinds, completionNode.getCompletionContext()); - addToCompletions(result); - } - private void completionOnKeyword(IASTCompletionNode completionNode){ - // lookup every type of keywords - // 1. basic types keword list - List result = lookupKeyword(completionNode.getCompletionPrefix(), BASIC_TYPES_KEYWORDS); - addKeywordsToCompletions(result.iterator()); - } - - public IASTCompletionNode complete(IWorkingCopy sourceUnit, int completionOffset) { - - // 1- Parse the translation unit - IASTCompletionNode completionNode = parse(sourceUnit, completionOffset); - - log(""); - - if (completionNode == null){ - log("Null Completion Node Error"); - return null; - } - - logNode("Scope = " , completionNode.getCompletionScope()); - logNode("Context = " , completionNode.getCompletionContext()); - logKind("Kind = ", completionNode.getCompletionKind().getEnumValue()); - - // set the completionStart and the completionLength - completionStart = completionOffset - completionNode.getCompletionPrefix().length(); - completionLength = completionNode.getCompletionPrefix().length(); - CompletionKind kind = completionNode.getCompletionKind(); - - // 2- Check the return value - if(kind == IASTCompletionNode.CompletionKind.MEMBER_REFERENCE){ - // completionOnMemberReference - completionOnMemberReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.SCOPED_REFERENCE){ - // completionOnMemberReference - completionOnScopedReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.FIELD_TYPE){ - // CompletionOnFieldType - completionOnFieldType(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.VARIABLE_TYPE) { - // CompletionOnVariableType - completionOnVariableType(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.ARGUMENT_TYPE){ - // CompletionOnArgumentType - completionOnTypeReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE){ - // CompletionOnSingleNameReference - completionOnSingleNameReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.TYPE_REFERENCE){ - // CompletionOnStructureReference - completionOnTypeReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.CLASS_REFERENCE){ - // CompletionOnClassReference - completionOnClassReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.NAMESPACE_REFERENCE){ - // completionOnNamespaceReference - completionOnNamespaceReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.EXCEPTION_REFERENCE){ - // CompletionOnExceptionReference - completionOnExceptionReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.MACRO_REFERENCE){ - // CompletionOnMacroReference - completionOnMacroReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.FUNCTION_REFERENCE){ - // completionOnFunctionReference - completionOnFunctionReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.CONSTRUCTOR_REFERENCE){ - // completionOnConstructorReference - completionOnConstructorReference(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.KEYWORD){ - // CompletionOnKeyword - completionOnKeyword(completionNode); - } - else if(kind == IASTCompletionNode.CompletionKind.STATEMENT_START ) - { - completionOnStatementStart(completionNode); - } - - addKeywordsToCompletions( completionNode.getKeywords()); - return completionNode; - - } - private void logKind(String message, int kindEnum){ - if (! CCorePlugin.getDefault().isDebugging() && Util.isActive(IDebugLogConstants.CONTENTASSIST) ) - return; - - String kindStr = ""; - switch (kindEnum){ - case 0: - kindStr = "MEMBER_REFERENCE"; - break; - - case 1: - kindStr = "SCOPED_REFERENCE"; - break; - - case 2: - kindStr = "FIELD_TYPE"; - break; - - case 3: - kindStr = "VARIABLE_TYPE"; - break; - - case 4: - kindStr = "ARGUMENT_TYPE"; - break; - - case 5: - kindStr = "SINGLE_NAME_REFERENCE"; - break; - - case 6: - kindStr = "TYPE_REFERENCE"; - break; - - case 7: - kindStr = "CLASS_REFERENCE"; - break; - - case 8: - kindStr = "NAMESPACE_REFERENCE"; - break; - - case 9: - kindStr = "EXCEPTION_REFERENCE"; - break; - - case 10: - kindStr = "MACRO_REFERENCE"; - break; - - case 11: - kindStr = "FUNCTION_REFERENCE"; - break; - - case 12: - kindStr = "CONSTRUCTOR_REFERENCE"; - break; - - case 13: - kindStr = "KEYWORD"; - break; - - case 14: - kindStr = "PREPROCESSOR_DIRECTIVE"; - break; - - case 15: - kindStr = "USER_SPECIFIED_NAME"; - break; - - case 16: - kindStr = "STATEMENT_START"; - break; - - case 200: - kindStr = "NO_SUCH_KIND"; - break; - } - log (message + kindStr); - } - private void logNode(String message, IASTNode node){ - if (! CCorePlugin.getDefault().isDebugging() && Util.isActive(IDebugLogConstants.CONTENTASSIST)) - return; - - if(node == null){ - log(message + "null"); - return; - } - if(node instanceof IASTMethod){ - String name = "Method: "; - name += ((IASTMethod)node).getName(); - log(message + name); - return; - } - if(node instanceof IASTFunction){ - String name = "Function: "; - name += ((IASTFunction)node).getName(); - log(message + name); - return; - } - if(node instanceof IASTClassSpecifier){ - String name = "Class: "; - name += ((IASTClassSpecifier)node).getName(); - log(message + name); - return; - } - if(node instanceof IASTCompilationUnit){ - String name = "Global"; - log(message + name); - return; - } - - log(message + node.toString()); - return; - - } - private void logLookups(LookupKind[] kinds){ - if (! CCorePlugin.getDefault().isDebugging() && Util.isActive(IDebugLogConstants.CONTENTASSIST)) - return; - - StringBuffer kindName = new StringBuffer("Looking For "); - for(int i = 0; iPreferences>Java>Code Generation>Code and Comments - */ -public class CompletionRequestorAdaptor implements ICompletionRequestor { - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptField(java.lang.String, java.lang.String) - */ - public void acceptField(String name, String returnType, ASTAccessVisibility visibility, int completionStart, int completionLength, int relevance) { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptClass(java.lang.String) - */ - public void acceptClass(String name, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptEnumeration(java.lang.String) - */ - public void acceptEnumeration(String name, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptFunction(java.lang.String, java.lang.String, java.lang.String) - */ - public void acceptFunction( - String name, - String parameterString, - String returnType, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptMacro(java.lang.String) - */ - public void acceptMacro(String name, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptMethod(java.lang.String, java.lang.String, java.lang.String) - */ - public void acceptMethod( - String name, - String parameterString, - String returnType, ASTAccessVisibility visibility, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptStruct(java.lang.String) - */ - public void acceptStruct(String name, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptUnion(java.lang.String) - */ - public void acceptUnion(String name, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptVariable(java.lang.String, java.lang.String) - */ - public void acceptVariable(String name, String returnType, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptLocalVariable(java.lang.String, java.lang.String) - */ - public void acceptLocalVariable(String name, String returnType, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptNamespace(java.lang.String) - */ - public void acceptNamespace(String name, int completionStart, int completionLength, int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptEnumerator(java.lang.String, int, int, int) - */ - public void acceptEnumerator( - String name, - int completionStart, - int completionLength, - int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptKeyword(java.lang.String, int, int, int) - */ - public void acceptKeyword( - String name, - int completionStart, - int completionLength, - int relevance) { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptError(org.eclipse.cdt.core.parser.IProblem) - */ - public void acceptError(IProblem error) { - // TODO Auto-generated method stub - - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistElementRequestor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistElementRequestor.java deleted file mode 100644 index 6196bbb6220..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistElementRequestor.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Created on Nov 19, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.cdt.internal.ui.text.contentassist; - -import org.eclipse.cdt.core.parser.NullSourceElementRequestor; - -/** - * @author hamer - * - * This class is the source element requestor used by the completion engine. - */ -public class ContentAssistElementRequestor extends NullSourceElementRequestor { - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistPreference.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistPreference.java deleted file mode 100644 index a7fcaab501a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistPreference.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.contentassist; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; - -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.internal.ui.text.IColorManager; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.util.PropertyChangeEvent; - - - -public class ContentAssistPreference { - - /** Preference key for content assist auto activation */ - //public final static String AUTOACTIVATION= "content_assist_autoactivation"; - /** Preference key for content assist auto activation delay */ - public final static String AUTOACTIVATION_DELAY= "content_assist_autoactivation_delay"; - /** Preference key for content assist proposal color */ - public final static String PROPOSALS_FOREGROUND= "content_assist_proposals_foreground"; - /** Preference key for content assist proposal color */ - public final static String PROPOSALS_BACKGROUND= "content_assist_proposals_background"; - /** Preference key for content assist parameters color */ - public final static String PARAMETERS_FOREGROUND= "content_assist_parameters_foreground"; - /** Preference key for content assist parameters color */ - public final static String PARAMETERS_BACKGROUND= "content_assist_parameters_background"; - /** Preference key for content assist auto insert */ - public final static String AUTOINSERT= "content_assist_autoinsert"; - - /** Preference key for C/CPP content assist auto activation triggers */ - public final static String AUTOACTIVATION_TRIGGERS_DOT= "content_assist_autoactivation_trigger_dot"; - public final static String AUTOACTIVATION_TRIGGERS_ARROW= "content_assist_autoactivation_trigger_arrow"; - public final static String AUTOACTIVATION_TRIGGERS_DOUBLECOLON= "content_assist_autoactivation_trigger_doublecolon"; - - /** Preference key for visibility of proposals */ - public final static String SHOW_DOCUMENTED_PROPOSALS= "content_assist_show_visible_proposals"; - /** Preference key for alphabetic ordering of proposals */ - public final static String ORDER_PROPOSALS= "content_assist_order_proposals"; - /** Preference key for case sensitivity of propsals */ - //public final static String CASE_SENSITIVITY= "content_assist_case_sensitivity"; - /** Preference key for adding imports on code assist */ - public final static String ADD_INCLUDE= "content_assist_add_import"; - /** Preference key for completion search scope */ - public final static String CURRENT_FILE_SEARCH_SCOPE= "content_assist_current_file_search_scope"; - /** Preference key for completion search scope */ - public final static String PROJECT_SEARCH_SCOPE= "content_assist_project_search_scope"; - /** Preference key for completion search scope */ - public final static String PROJECT_AND_DEPENDENCY_SEARCH_SCOPE= "content_assist_project_and_dependency_search_scope"; - - private static Color getColor(IPreferenceStore store, String key, IColorManager manager) { - RGB rgb= PreferenceConverter.getColor(store, key); - return manager.getColor(rgb); - } - - private static Color getColor(IPreferenceStore store, String key) { - CTextTools textTools= CUIPlugin.getDefault().getTextTools(); - return getColor(store, key, textTools.getColorManager()); - } - - private static CCompletionProcessor getCProcessor(ContentAssistant assistant) { - IContentAssistProcessor p= assistant.getContentAssistProcessor(IDocument.DEFAULT_CONTENT_TYPE); - if (p instanceof CCompletionProcessor) - return (CCompletionProcessor) p; - return null; - } - - private static void configureCProcessor(ContentAssistant assistant, IPreferenceStore store) { - CCompletionProcessor jcp= getCProcessor(assistant); - if (jcp == null) - return; - - String triggers = ""; - boolean useDotAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_DOT); - if(useDotAsTrigger) - triggers = "."; - boolean useArrowAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_ARROW); - if(useArrowAsTrigger) - triggers += ">"; - boolean useDoubleColonAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON); - if(useDoubleColonAsTrigger) - triggers += ":"; - jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); - - boolean enabled= store.getBoolean(SHOW_DOCUMENTED_PROPOSALS); - //jcp.restrictProposalsToVisibility(enabled); - - //enabled= store.getBoolean(CASE_SENSITIVITY); - //jcp.restrictProposalsToMatchingCases(enabled); - - enabled= store.getBoolean(ORDER_PROPOSALS); - jcp.orderProposalsAlphabetically(enabled); - - enabled= store.getBoolean(ADD_INCLUDE); - jcp.allowAddingIncludes(enabled); - } - - - /** - * Configure the given content assistant from the given store. - */ - public static void configure(ContentAssistant assistant, IPreferenceStore store) { - - CTextTools textTools= CUIPlugin.getDefault().getTextTools(); - IColorManager manager= textTools.getColorManager(); - - boolean enabledDot= store.getBoolean(AUTOACTIVATION_TRIGGERS_DOT); - boolean enabledArrow= store.getBoolean(AUTOACTIVATION_TRIGGERS_ARROW); - boolean enabledDoubleColon= store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON); - boolean enabled = ((enabledDot) || ( enabledArrow ) || (enabledDoubleColon )); - assistant.enableAutoActivation(enabled); - - int delay= store.getInt(AUTOACTIVATION_DELAY); - assistant.setAutoActivationDelay(delay); - - Color c1= getColor(store, PROPOSALS_FOREGROUND, manager); - assistant.setProposalSelectorForeground(c1); - - Color c2= getColor(store, PROPOSALS_BACKGROUND, manager); - assistant.setProposalSelectorBackground(c2); - - Color c3= getColor(store, PARAMETERS_FOREGROUND, manager); - assistant.setContextInformationPopupForeground(c3); - assistant.setContextSelectorForeground(c3); - - Color c4= getColor(store, PARAMETERS_BACKGROUND, manager); - assistant.setContextInformationPopupBackground(c4); - assistant.setContextSelectorBackground(c4); - - enabled= store.getBoolean(AUTOINSERT); - assistant.enableAutoInsert(enabled); - - configureCProcessor(assistant, store); - } - - - private static void changeCProcessor(ContentAssistant assistant, IPreferenceStore store, String key) { - CCompletionProcessor jcp= getCProcessor(assistant); - if (jcp == null) - return; - - if (AUTOACTIVATION_TRIGGERS_DOT.equals(key)) { - boolean useDotAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_DOT); - if (useDotAsTrigger){ - String triggers= "."; - jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); - } - } else if (AUTOACTIVATION_TRIGGERS_ARROW.equals(key)) { - boolean useArrowAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_ARROW); - if (useArrowAsTrigger){ - String triggers= ">"; - jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); - } - } else if (AUTOACTIVATION_TRIGGERS_DOUBLECOLON.equals(key)) { - boolean useDoubleColonAsTrigger = store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON); - if (useDoubleColonAsTrigger){ - String triggers= ":"; - jcp.setCompletionProposalAutoActivationCharacters(triggers.toCharArray()); - } - } else if (SHOW_DOCUMENTED_PROPOSALS.equals(key)) { - //boolean enabled= store.getBoolean(SHOW_DOCUMENTED_PROPOSALS); - //jcp.restrictProposalsToVisibility(enabled); - } - //else if (CASE_SENSITIVITY.equals(key)) { - // boolean enabled= store.getBoolean(CASE_SENSITIVITY); - // jcp.restrictProposalsToMatchingCases(enabled); - // } - else if (ORDER_PROPOSALS.equals(key)) { - boolean enable= store.getBoolean(ORDER_PROPOSALS); - jcp.orderProposalsAlphabetically(enable); - } else if (ADD_INCLUDE.equals(key)) { - boolean enabled= store.getBoolean(ADD_INCLUDE); - jcp.allowAddingIncludes(enabled); - } - } - - /** - * Changes the configuration of the given content assistant according to the given property - * change event and the given preference store. - */ - public static void changeConfiguration(ContentAssistant assistant, IPreferenceStore store, PropertyChangeEvent event) { - - String p= event.getProperty(); - - if ((AUTOACTIVATION_TRIGGERS_DOT.equals(p)) - || (AUTOACTIVATION_TRIGGERS_ARROW.equals(p)) - || (AUTOACTIVATION_TRIGGERS_DOUBLECOLON.equals(p))){ - boolean enabledDot= store.getBoolean(AUTOACTIVATION_TRIGGERS_DOT); - boolean enabledArrow= store.getBoolean(AUTOACTIVATION_TRIGGERS_ARROW); - boolean enabledDoubleColon= store.getBoolean(AUTOACTIVATION_TRIGGERS_DOUBLECOLON); - boolean enabled = ((enabledDot) || ( enabledArrow ) || (enabledDoubleColon )); - assistant.enableAutoActivation(enabled); - } else if (AUTOACTIVATION_DELAY.equals(p)) { - int delay= store.getInt(AUTOACTIVATION_DELAY); - assistant.setAutoActivationDelay(delay); - } else if (PROPOSALS_FOREGROUND.equals(p)) { - Color c= getColor(store, PROPOSALS_FOREGROUND); - assistant.setProposalSelectorForeground(c); - } else if (PROPOSALS_BACKGROUND.equals(p)) { - Color c= getColor(store, PROPOSALS_BACKGROUND); - assistant.setProposalSelectorBackground(c); - } else if (PARAMETERS_FOREGROUND.equals(p)) { - Color c= getColor(store, PARAMETERS_FOREGROUND); - assistant.setContextInformationPopupForeground(c); - assistant.setContextSelectorForeground(c); - } else if (PARAMETERS_BACKGROUND.equals(p)) { - Color c= getColor(store, PARAMETERS_BACKGROUND); - assistant.setContextInformationPopupBackground(c); - assistant.setContextSelectorBackground(c); - } else if (AUTOINSERT.equals(p)) { - boolean enabled= store.getBoolean(AUTOINSERT); - assistant.enableAutoInsert(enabled); - } - - changeCProcessor(assistant, store, p); - } -} - - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ICompletionRequestor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ICompletionRequestor.java deleted file mode 100644 index 7d71ed94f4e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ICompletionRequestor.java +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.ui.text.contentassist; - -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; - -/** - * @author hamer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public interface ICompletionRequestor { - void acceptField(String name, String returnType, ASTAccessVisibility visibility, int completionStart, int completionLength, int relevance); - void acceptVariable(String name, String returnType, int completionStart, int completionLength, int relevance); - void acceptLocalVariable(String name, String returnType, int completionStart, int completionLength, int relevance); - void acceptMethod(String name, String parameterString, String returnType, ASTAccessVisibility visibility, int completionStart, int completionLength, int relevance); - void acceptFunction(String name, String parameterString, String returnType, int completionStart, int completionLength, int relevance); - void acceptClass(String name, int completionStart, int completionLength, int relevance); - void acceptStruct(String name, int completionStart, int completionLength, int relevance); - void acceptUnion(String name, int completionStart, int completionLength, int relevance); - void acceptNamespace(String name, int completionStart, int completionLength, int relevance); - void acceptMacro(String name, int completionStart, int completionLength, int relevance); - void acceptEnumeration(String name, int completionStart, int completionLength, int relevance); - void acceptEnumerator(String name, int completionStart, int completionLength, int relevance); - void acceptKeyword(String name, int completionStart, int completionLength, int relevance); - void acceptError(IProblem error); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/RelevanceConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/RelevanceConstants.java deleted file mode 100644 index 48058d3e089..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/RelevanceConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.ui.text.contentassist; - -/** - * @author hamer - * - */ -public interface RelevanceConstants { - final int CASE_MATCH_RELEVANCE = 150; - final int EXACT_NAME_MATCH_RELEVANCE = 40; - - final int LOCAL_VARIABLE_TYPE_RELEVANCE = 130; - final int FIELD_TYPE_RELEVANCE = 120; - final int VARIABLE_TYPE_RELEVANCE = 110; - final int METHOD_TYPE_RELEVANCE = 100; - final int FUNCTION_TYPE_RELEVANCE = 90; - final int CLASS_TYPE_RELEVANCE = 80; - final int STRUCT_TYPE_RELEVANCE = 70; - final int UNION_TYPE_RELEVANCE = 60; - final int NAMESPACE_TYPE_RELEVANCE = 50; - final int MACRO_TYPE_RELEVANCE = 40; - final int ENUMERATION_TYPE_RELEVANCE = 30; - final int ENUMERATOR_TYPE_RELEVANCE = 20; - final int KEYWORD_TYPE_RELEVANCE = 10; - final int DEFAULT_TYPE_RELEVANCE = 0; -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ResultCollector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ResultCollector.java deleted file mode 100644 index 5641cf8de0a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ResultCollector.java +++ /dev/null @@ -1,495 +0,0 @@ -/********************************************************************** - * Copyright (c) 2002,2003 Rational Software Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Rational Software - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.internal.ui.text.contentassist; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.cdt.core.parser.IProblem; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.internal.ui.CElementImageProvider; -import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.FunctionPrototypeSummary; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.ContextInformation; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.swt.graphics.Image; - -/** - * @author hamer - * - * The Result Collector class receives information from the completion engine - * as a completion requestor. It might also receive information from others - * such as the results of a search operation to generate completion proposals. - * - */ -public class ResultCollector extends CompletionRequestorAdaptor { - private Set completions = new HashSet(); - private ImageDescriptorRegistry registry = CUIPlugin.getImageDescriptorRegistry(); - private IProblem fLastProblem; - private ITextViewer fTextViewer; - - public ResultCollector(){ - completions.clear(); - fTextViewer = null; - } - - /** - * @return the completion list - */ - public Set getCompletions() { - return completions; - } - public void reset(ITextViewer viewer) { - completions.clear(); - fTextViewer = viewer; - fLastProblem = null; - } - /* - * Create a proposal - */ - public ICompletionProposal createProposal(String replaceString, String displayString, String infoString, String arguments, Image image, int offset, int length, int relevance){ - CCompletionProposal proposal; - - proposal = new CCompletionProposal( - replaceString, // Replacement string - offset, - length, - image, - displayString, // Display string - relevance, - fTextViewer); - - if(arguments != null && arguments.length() > 0) { - proposal.setContextInformation(new ContextInformation(replaceString, arguments)); - } - - // The info string could be populated with documentation info. - // For now, it has the name and the parent's name if available. - if((infoString != null)&& (!displayString.equals(infoString))) - proposal.setAdditionalProposalInfo(infoString); - - return proposal; - } - - /* - * (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptField(java.lang.String, java.lang.String, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, int, int, int) - */ - public void acceptField(String name, String returnType, ASTAccessVisibility visibility, - int completionStart, int completionLength, int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - if(returnType != null) - displayString+= " : " + returnType; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getFieldImageDescriptor(visibility); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptClass(java.lang.String, int, int, int) - */ - public void acceptClass( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getClassImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptFunction(java.lang.String, java.lang.String, java.lang.String, int, int, int) - */ - public void acceptFunction( - String name, - String parameterString, - String returnType, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - String arguments = ""; - - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - String functionPrototype = returnType + " " + name; - if(parameterString != null){ - if ((parameterString.indexOf("(") == -1) && (parameterString.indexOf(")") == -1)) - { - functionPrototype += "(" + parameterString + ")"; - } - else { - functionPrototype += parameterString; - } - } - - FunctionPrototypeSummary fproto = new FunctionPrototypeSummary(functionPrototype); - if(fproto != null) { - replaceString = fproto.getName() + "()"; - displayString = fproto.getPrototypeString(true); - infoString.append(displayString); - arguments = fproto.getArguments(); - } - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getFunctionImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - arguments, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptLocalVariable(java.lang.String, java.lang.String, int, int, int) - */ - public void acceptLocalVariable( - String name, - String returnType, - int completionStart, - int completionLength, - int relevance) { - - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - if(returnType != null) - displayString+= " : " + returnType; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getLocalVariableImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptMacro(java.lang.String, int, int, int) - */ - public void acceptMacro( - String name, - int completionStart, - int completionLength, - int relevance) { - - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getMacroImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptMethod(java.lang.String, java.lang.String, java.lang.String, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility, int, int, int) - */ - public void acceptMethod( - String name, - String parameterString, - String returnType, - ASTAccessVisibility visibility, - int completionStart, - int completionLength, - int relevance) { - - String replaceString = ""; - String displayString = ""; - String arguments = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - String functionPrototype = returnType + " " + name; - if(parameterString != null){ - if ((parameterString.indexOf("(") == -1) && (parameterString.indexOf(")") == -1)) - { - functionPrototype += "(" + parameterString + ")"; - } - else { - functionPrototype += parameterString; - } - } - - FunctionPrototypeSummary fproto = new FunctionPrototypeSummary(functionPrototype); - if(fproto != null) { - replaceString = fproto.getName() + "()"; - displayString = fproto.getPrototypeString(true); - infoString.append(displayString); - arguments = fproto.getArguments(); - } - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getMethodImageDescriptor(visibility); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - arguments, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptNamespace(java.lang.String, int, int, int) - */ - public void acceptNamespace( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getNamespaceImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptStruct(java.lang.String, int, int, int) - */ - public void acceptStruct( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getStructImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptUnion(java.lang.String, int, int, int) - */ - public void acceptUnion( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getUnionImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptVariable(java.lang.String, java.lang.String, int, int, int) - */ - public void acceptVariable( - String name, - String returnType, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - if(returnType != null) - displayString+= " : " + returnType; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getVariableImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptEnumeration(java.lang.String, int, int, int) - */ - public void acceptEnumeration( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getEnumerationImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptEnumerator(java.lang.String, int, int, int) - */ - public void acceptEnumerator( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // get the image - ImageDescriptor imageDescriptor = CElementImageProvider.getEnumeratorImageDescriptor(); - image = registry.get( imageDescriptor ); - - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptKeyword(java.lang.String, int, int, int) - */ - public void acceptKeyword( - String name, - int completionStart, - int completionLength, - int relevance) { - String replaceString = ""; - String displayString = ""; - Image image = null; - StringBuffer infoString = new StringBuffer(); - - // fill the replace, display and info strings - replaceString = name; - displayString = name; - - // no image for keywords - // create proposal and add it to completions list - ICompletionProposal proposal = createProposal(replaceString, displayString, infoString.toString(), - null, image, completionStart, completionLength, relevance); - completions.add(proposal); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.core.ICompletionRequestor#acceptError(org.eclipse.cdt.core.parser.IProblem) - */ - public void acceptError(IProblem error) { - fLastProblem = error; - } - - public String getErrorMessage() { - if (fLastProblem != null) - return fLastProblem.getMessage(); - return ""; //$NON-NLS-1$ - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionListener.java deleted file mode 100644 index 12e3bb8de5b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionListener.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.link; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.Position; - -/** - * A listener for highlight change notification and exititing linked mode. - */ -public interface LinkedPositionListener { - - /** - * Notifies that the linked mode has been left. On success, all changes - * are kept, otherwise all changes made to the linked positions are restored - * to the state before entering linked mode. - */ - void exit(boolean success); - - /** - * Notifies the changed linked position. The listener is asked - * to reposition the caret at the given offset. - * - * @param position the linked position which initiated the change. - * @param caretOffset the caret offset relative to the position. - */ - void setCurrentPosition(Position position, int caretOffset); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java deleted file mode 100644 index 21666b6199a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionManager.java +++ /dev/null @@ -1,449 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.link; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.ui.CUIPlugin; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.BadPositionCategoryException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentExtension; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.text.IPositionUpdater; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.TypedPosition; -import org.eclipse.jface.util.Assert; - - -/** - * This class manages linked positions in a document. Positions are linked - * by type names. If positions have the same type name, they are considered - * as linked. - * - * The manager remains active on a document until any of the following actions - * occurs: - * - *

              - *
            • A document change is performed which would invalidate any of the - * above constraints.
            • - * - *
            • The method uninstall() is called.
            • - * - *
            • Another instance of LinkedPositionManager tries to - * gain control of the same document. - *
            - */ -public class LinkedPositionManager implements IDocumentListener, IPositionUpdater { - - private static class PositionComparator implements Comparator { - /* - * @see Comparator#compare(Object, Object) - */ - public int compare(Object object0, Object object1) { - Position position0= (Position) object0; - Position position1= (Position) object1; - - return position0.getOffset() - position1.getOffset(); - } - } - - private class Replace implements IDocumentExtension.IReplace { - - private Position fReplacePosition; - private int fReplaceDeltaOffset; - private int fReplaceLength; - private String fReplaceText; - - public Replace(Position position, int deltaOffset, int length, String text) { - fReplacePosition= position; - fReplaceDeltaOffset= deltaOffset; - fReplaceLength= length; - fReplaceText= text; - } - - public void perform(IDocument document, IDocumentListener owner) { - document.removeDocumentListener(owner); - try { - document.replace(fReplacePosition.getOffset() + fReplaceDeltaOffset, fReplaceLength, fReplaceText); - } catch (BadLocationException e) { - CUIPlugin.getDefault().log(e); - // TBD - } - document.addDocumentListener(owner); - } - } - - private static final String LINKED_POSITION= "LinkedPositionManager.linked.position"; //$NON-NLS-1$ - private static final Comparator fgPositionComparator= new PositionComparator(); - private static final Map fgActiveManagers= new HashMap(); - - private IDocument fDocument; - - private LinkedPositionListener fListener; - - /** - * Creates a LinkedPositionManager for a IDocument. - * - * @param document the document to use with linked positions. - */ - public LinkedPositionManager(IDocument document) { - Assert.isNotNull(document); - - fDocument= document; - install(); - } - - /** - * Sets a listener to notify changes of current linked position. - */ - public void setLinkedPositionListener(LinkedPositionListener listener) { - fListener= listener; - } - - /** - * Adds a linked position to the manager. - * There are the following constraints for linked positions: - * - *
              - *
            • Any two positions have spacing of at least one character. - * This implies that two positions must not overlap.
            • - * - *
            • The string at any position must not contain line delimiters.
            • - *
            - * - * @param offset the offset of the position. - * @param length the length of the position. - */ - public void addPosition(int offset, int length) throws BadLocationException { - Position[] positions= getPositions(fDocument); - - if (positions != null) { - for (int i = 0; i < positions.length; i++) - if (collides(positions[i], offset, length)) - throw new BadLocationException(LinkedPositionMessages.getString(("LinkedPositionManager.error.position.collision"))); //$NON-NLS-1$ - } - - String type= fDocument.get(offset, length); - - if (containsLineDelimiters(type)) - throw new BadLocationException(LinkedPositionMessages.getString(("LinkedPositionManager.error.contains.line.delimiters"))); //$NON-NLS-1$ - - try { - fDocument.addPosition(LINKED_POSITION, new TypedPosition(offset, length, type)); - } catch (BadPositionCategoryException e) { - CUIPlugin.getDefault().log(e); - Assert.isTrue(false); - } - } - - /** - * Tests if a manager is already active for a document. - */ - public static boolean hasActiveManager(IDocument document) { - return fgActiveManagers.get(document) != null; - } - - private void install() { - LinkedPositionManager manager= (LinkedPositionManager) fgActiveManagers.get(fDocument); - if (manager != null) - manager.leave(true); - - fgActiveManagers.put(fDocument, this); - - fDocument.addPositionCategory(LINKED_POSITION); - fDocument.addPositionUpdater(this); - fDocument.addDocumentListener(this); - } - - /** - * Leaves the linked mode. If unsuccessful, the linked positions - * are restored to the values at the time they were added. - */ - public void uninstall(boolean success) { - fDocument.removeDocumentListener(this); - - try { - Position[] positions= getPositions(fDocument); - if ((!success) && (positions != null)) { - // restore - for (int i= 0; i != positions.length; i++) { - TypedPosition position= (TypedPosition) positions[i]; - fDocument.replace(position.getOffset(), position.getLength(), position.getType()); - } - } - - fDocument.removePositionCategory(LINKED_POSITION); - - } catch (BadLocationException e) { - CUIPlugin.getDefault().log(e); - Assert.isTrue(false); - - } catch (BadPositionCategoryException e) { - CUIPlugin.getDefault().log(e); - Assert.isTrue(false); - - } finally { - fDocument.removePositionUpdater(this); - fgActiveManagers.remove(fDocument); - } - } - - /** - * Returns the first linked position. - * - * @return returns null if no linked position exist. - */ - public Position getFirstPosition() { - return getNextPosition(-1); - } - - /** - * Returns the next linked position with an offset greater than offset. - * If another position with the same type and offset lower than offset - * exists, the position is skipped. - * - * @return returns null if no linked position exist. - */ - public Position getNextPosition(int offset) { - Position[] positions= getPositions(fDocument); - return findNextPosition(positions, offset); - } - - private static Position findNextPosition(Position[] positions, int offset) { - // skip already visited types - for (int i= 0; i != positions.length; i++) { - if (positions[i].getOffset() > offset) { - String type= ((TypedPosition) positions[i]).getType(); - int j; - for (j = 0; j != i; j++) - if (((TypedPosition) positions[j]).getType().equals(type)) - break; - - if (j == i) - return positions[i]; - } - } - - return null; - } - - /** - * Returns the position with the greatest offset smaller than offset. - * - * @return returns null if no linked position exist. - */ - public Position getPreviousPosition(int offset) { - Position[] positions= getPositions(fDocument); - if (positions == null) - return null; - - Position lastPosition= null; - Position position= getFirstPosition(); - - while ((position != null) && (position.getOffset() < offset)) { - lastPosition= position; - position= findNextPosition(positions, position.getOffset()); - } - - return lastPosition; - } - - private static Position[] getPositions(IDocument document) { - try { - Position[] positions= document.getPositions(LINKED_POSITION); - Arrays.sort(positions, fgPositionComparator); - return positions; - - } catch (BadPositionCategoryException e) { - CUIPlugin.getDefault().log(e); - Assert.isTrue(false); - } - - return null; - } - - public static boolean includes(Position position, int offset, int length) { - return - (offset >= position.getOffset()) && - (offset + length <= position.getOffset() + position.getLength()); - } - - public static boolean excludes(Position position, int offset, int length) { - return - (offset + length <= position.getOffset()) || - (position.getOffset() + position.getLength() <= offset); - } - - /* - * Collides if spacing if positions intersect each other or are adjacent. - */ - private static boolean collides(Position position, int offset, int length) { - return - (offset <= position.getOffset() + position.getLength()) && - (position.getOffset() <= offset + length); - } - - private void leave(boolean success) { - uninstall(success); - - if (fListener != null) - fListener.exit(success); - } - - /* - * @see IDocumentListener#documentAboutToBeChanged(DocumentEvent) - */ - public void documentAboutToBeChanged(DocumentEvent event) { - IDocument document= event.getDocument(); - - Position[] positions= getPositions(document); - Position position= findCurrentEditablePosition(positions, event.getOffset()); - - // modification outside editable position - if (position == null) { - position= findCurrentPosition(positions, event.getOffset()); - - // modification outside any position - if (position == null) { - // check for destruction of constraints (spacing of at least 1) - if ((event.getText().length() == 0) && - (findCurrentPosition(positions, event.getOffset()) != null) && - (findCurrentPosition(positions, event.getOffset() + event.getLength()) != null)) - { - leave(true); - } - - // modification intersects non-editable position - } else { - leave(true); - } - - // modification intersects editable position - } else { - // modificaction inside editable position - if (includes(position, event.getOffset(), event.getLength())) { - if (containsLineDelimiters(event.getText())) - leave(true); - - // modificaction exceeds editable position - } else { - leave(true); - } - } - } - - /* - * @see IDocumentListener#documentChanged(DocumentEvent) - */ - public void documentChanged(DocumentEvent event) { - IDocument document= event.getDocument(); - - Position[] positions= getPositions(document); - TypedPosition currentPosition= (TypedPosition) findCurrentEditablePosition(positions, event.getOffset()); - - // ignore document changes (assume it won't invalidate constraints) - if (currentPosition == null) - return; - - int deltaOffset= event.getOffset() - currentPosition.getOffset(); - - if (fListener != null) - fListener.setCurrentPosition(currentPosition, deltaOffset + event.getText().length()); - - for (int i= 0; i != positions.length; i++) { - TypedPosition p= (TypedPosition) positions[i]; - - if (p.getType().equals(currentPosition.getType()) && !p.equals(currentPosition)) { - Replace replace= new Replace(p, deltaOffset, event.getLength(), event.getText()); - ((IDocumentExtension) document).registerPostNotificationReplace(this, replace); - } - } - } - - /* - * @see IPositionUpdater#update(DocumentEvent) - */ - public void update(DocumentEvent event) { - int deltaLength= event.getText().length() - event.getLength(); - - Position[] positions= getPositions(event.getDocument()); - TypedPosition currentPosition= (TypedPosition) findCurrentPosition(positions, event.getOffset()); - - // document change outside positions - if (currentPosition == null) { - - for (int i= 0; i != positions.length; i++) { - TypedPosition position= (TypedPosition) positions[i]; - int offset= position.getOffset(); - - if (offset >= event.getOffset()) - position.setOffset(offset + deltaLength); - } - - // document change within a position - } else { - int length= currentPosition.getLength(); - - for (int i= 0; i != positions.length; i++) { - TypedPosition position= (TypedPosition) positions[i]; - int offset= position.getOffset(); - - if (position.equals(currentPosition)) { - position.setLength(length + deltaLength); - } else if (offset > currentPosition.getOffset()) { - position.setOffset(offset + deltaLength); - } - } - } - } - - private static Position findCurrentPosition(Position[] positions, int offset) { - for (int i= 0; i != positions.length; i++) - if (includes(positions[i], offset, 0)) - return positions[i]; - - return null; - } - - private static Position findCurrentEditablePosition(Position[] positions, int offset) { - Position position= positions[0]; - - while ((position != null) && !includes(position, offset, 0)) - position= findNextPosition(positions, position.getOffset()); - - return position; - } - - private boolean containsLineDelimiters(String string) { - String[] delimiters= fDocument.getLegalLineDelimiters(); - - for (int i= 0; i != delimiters.length; i++) - if (string.indexOf(delimiters[i]) != -1) - return true; - - return false; - } - - /** - * Test if ok to modify through UI. - */ - public boolean anyPositionIncludes(int offset, int length) { - Position[] positions= getPositions(fDocument); - - Position position= findCurrentEditablePosition(positions, offset); - if (position == null) - return false; - - return includes(position, offset, length); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.java deleted file mode 100644 index 67439db4171..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.link; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class LinkedPositionMessages { - - private static final String RESOURCE_BUNDLE= LinkedPositionMessages.class.getName(); - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private LinkedPositionMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object arg) { - return MessageFormat.format(getString(key), new Object[] { arg }); - } - - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.properties deleted file mode 100644 index 267939d0cfc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionMessages.properties +++ /dev/null @@ -1,9 +0,0 @@ -######################################### -# (c) Copyright IBM Corp. 2000, 2001. -# All Rights Reserved. -######################################### - -LinkedPositionUI.error.title=Error in LinkedPositionError - -LinkedPositionManager.error.contains.line.delimiters=String contains line delimiters. -LinkedPositionManager.error.position.collision=Linked position collides with another linked position. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java deleted file mode 100644 index a3a64c68f8e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/link/LinkedPositionUI.java +++ /dev/null @@ -1,547 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.link; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.custom.VerifyKeyListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.events.VerifyListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.BadPositionCategoryException; -import org.eclipse.jface.text.DefaultPositionUpdater; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IPositionUpdater; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextInputListener; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.ITextViewerExtension; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; - - -/** - * A user interface for LinkedPositionManager, using ITextViewer. - */ -public class LinkedPositionUI implements LinkedPositionListener, - ITextInputListener, ModifyListener, VerifyListener, VerifyKeyListener, PaintListener, IPropertyChangeListener { - - /** - * A listener for notification when the user cancelled the edit operation. - */ - public interface ExitListener { - void exit(boolean accept); - } - - // leave flags - private static final int UNINSTALL= 1; // uninstall linked position manager - public static final int COMMIT= 2; // commit changes - private static final int DOCUMENT_CHANGED= 4; // document has changed - public static final int UPDATE_CARET= 8; // update caret - - private static final String CARET_POSITION= "LinkedPositionUI.caret.position"; - private static final IPositionUpdater fgUpdater= new DefaultPositionUpdater(CARET_POSITION); - private static final IPreferenceStore fgStore= CUIPlugin.getDefault().getPreferenceStore(); - - private final ITextViewer fViewer; - private final LinkedPositionManager fManager; - private Color fFrameColor; - - private int fFinalCaretOffset= -1; // no final caret offset - - private Position fFramePosition; - private int fCaretOffset; - - private ExitPolicy fExitPolicy; - private ExitListener fExitListener; - - /** - * Creates a user interface for LinkedPositionManager. - * - * @param viewer the text viewer. - * @param manager the LinkedPositionManager managing a IDocument of the ITextViewer. - */ - public LinkedPositionUI(ITextViewer viewer, LinkedPositionManager manager) { - Assert.isNotNull(viewer); - Assert.isNotNull(manager); - - fViewer= viewer; - fManager= manager; - - fManager.setLinkedPositionListener(this); - - initializeHighlightColor(viewer); - } - - /** - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty().equals(CEditor.LINKED_POSITION_COLOR)) { - initializeHighlightColor(fViewer); - redrawRegion(); - } - } - - private void initializeHighlightColor(ITextViewer viewer) { - - if (fFrameColor != null) - fFrameColor.dispose(); - - StyledText text= viewer.getTextWidget(); - if (text != null) { - Display display= text.getDisplay(); - fFrameColor= createColor(fgStore, CEditor.LINKED_POSITION_COLOR, display); - } - } - - /** - * Creates a color from the information stored in the given preference store. - * Returns null if there is no such information available. - */ - private Color createColor(IPreferenceStore store, String key, Display display) { - - RGB rgb= null; - - if (store.contains(key)) { - - if (store.isDefault(key)) - rgb= PreferenceConverter.getDefaultColor(store, key); - else - rgb= PreferenceConverter.getColor(store, key); - - if (rgb != null) - return new Color(display, rgb); - } - - return null; - } - - /** - * Sets the final position of the caret when the linked mode is exited - * successfully by leaving the last linked position using TAB. - */ - public void setFinalCaretOffset(int offset) { - fFinalCaretOffset= offset; - } - - /** - * Sets a CancelListener which is notified if the linked mode - * is exited unsuccessfully by hitting ESC. - */ - public void setCancelListener(ExitListener listener) { - fExitListener= listener; - } - - /* - * @see LinkedPositionManager.LinkedPositionListener#setCurrentPositions(Position, int) - */ - public void setCurrentPosition(Position position, int caretOffset) { - if (!fFramePosition.equals(position)) { - redrawRegion(); - fFramePosition= position; - } - - fCaretOffset= caretOffset; - } - /** - * Sets an ExitPolicy which decides when and how - * the linked mode is exited. - */ - public void setExitPolicy(ExitPolicy policy) { - fExitPolicy= policy; - } - /** - * Enters the linked mode. The linked mode can be left by calling - * exit. - * - * @see exit(boolean) - */ - public void enter() { - // track final caret - IDocument document= fViewer.getDocument(); - document.addPositionCategory(CARET_POSITION); - document.addPositionUpdater(fgUpdater); - try { - if (fFinalCaretOffset != -1) - document.addPosition(CARET_POSITION, new Position(fFinalCaretOffset)); - } catch (BadLocationException e) { - openErrorDialog(fViewer.getTextWidget().getShell(), e); - - } catch (BadPositionCategoryException e) { - CUIPlugin.getDefault().log(e); - Assert.isTrue(false); - } - - fViewer.addTextInputListener(this); - - ITextViewerExtension extension= (ITextViewerExtension) fViewer; - extension.prependVerifyKeyListener(this); - - StyledText text= fViewer.getTextWidget(); - text.addVerifyListener(this); - text.addModifyListener(this); - text.addPaintListener(this); - text.showSelection(); - - fFramePosition= fManager.getFirstPosition(); - if (fFramePosition == null) - leave(UNINSTALL | COMMIT | UPDATE_CARET); - - fgStore.addPropertyChangeListener(this); - } - - /** - * @see LinkedPositionManager.LinkedPositionListener#exit(boolean) - */ - public void exit(boolean success) { - // no UNINSTALL since manager has already uninstalled itself - leave((success ? COMMIT : 0) | UPDATE_CARET); - } - - /** - * Returns the cursor selection, after having entered the linked mode. - * enter() must be called prior to a call to this method. - */ - public IRegion getSelectedRegion() { - if (fFramePosition == null) - return new Region(fFinalCaretOffset, 0); - else - return new Region(fFramePosition.getOffset(), fFramePosition.getLength()); - } - - private void leave(int flags) { - if ((flags & UNINSTALL) != 0) - fManager.uninstall((flags & COMMIT) != 0); - - fgStore.removePropertyChangeListener(this); - - if (fFrameColor != null) { - fFrameColor.dispose(); - fFrameColor= null; - } - - StyledText text= fViewer.getTextWidget(); - text.removePaintListener(this); - text.removeModifyListener(this); - text.removeVerifyListener(this); - - ITextViewerExtension extension= (ITextViewerExtension) fViewer; - extension.removeVerifyKeyListener(this); - - fViewer.removeTextInputListener(this); - - try { - IRegion region= fViewer.getVisibleRegion(); - IDocument document= fViewer.getDocument(); - - if (((flags & COMMIT) != 0) && - ((flags & DOCUMENT_CHANGED) == 0) && - ((flags & UPDATE_CARET) != 0)) - { - Position[] positions= document.getPositions(CARET_POSITION); - - if ((positions != null) && (positions.length != 0)) { - int offset= positions[0].getOffset() - region.getOffset(); - if ((offset >= 0) && (offset <= region.getLength())) - text.setSelection(offset, offset); - } - } - - document.removePositionUpdater(fgUpdater); - document.removePositionCategory(CARET_POSITION); - - if (fExitListener != null) - fExitListener.exit( - ((flags & COMMIT) != 0) || - ((flags & DOCUMENT_CHANGED) != 0)); - - } catch (BadPositionCategoryException e) { - CUIPlugin.getDefault().log(e); - Assert.isTrue(false); - } - - if ((flags & DOCUMENT_CHANGED) == 0) - text.redraw(); - } - - private void next() { - redrawRegion(); - - fFramePosition= fManager.getNextPosition(fFramePosition.getOffset()); - if (fFramePosition == null) { - leave(UNINSTALL | COMMIT | UPDATE_CARET); - } else { - selectRegion(); - redrawRegion(); - } - } - - private void previous() { - redrawRegion(); - - Position position= fManager.getPreviousPosition(fFramePosition.getOffset()); - if (position == null) { - fViewer.getTextWidget().getDisplay().beep(); - } else { - fFramePosition= position; - selectRegion(); - redrawRegion(); - } - } - - /* - * @see VerifyKeyListener#verifyKey(VerifyEvent) - */ - public void verifyKey(VerifyEvent event) { - if (!event.doit ) - return; - - Point selection= fViewer.getSelectedRange(); - int offset= selection.x; - int length= selection.y; - - ExitFlags exitFlags= fExitPolicy == null ? null : fExitPolicy.doExit(fManager, event, offset, length); - if (exitFlags != null) { - leave(UNINSTALL | exitFlags.flags); - event.doit= exitFlags.doit; - return; - } - - switch (event.character) { - // [SHIFT-]TAB = hop between edit boxes - case 0x09: - { - selection= fViewer.getTextWidget().getSelection(); - IRegion region= fViewer.getVisibleRegion(); - offset= selection.x + region.getOffset(); - length= selection.y - selection.x; - - // if tab was treated as a document change, would it exceed variable range? - if (!LinkedPositionManager.includes(fFramePosition, offset, length)) { - leave(UNINSTALL | COMMIT | UPDATE_CARET); - return; - } - } - - if (event.stateMask == SWT.SHIFT) - previous(); - else - next(); - - event.doit= false; - break; - - // ENTER - case 0x0D: - leave(UNINSTALL | COMMIT | UPDATE_CARET); - event.doit= false; - break; - - // ESC - case 0x1B: - leave(UNINSTALL | COMMIT); - event.doit= false; - break; - - case ';': - leave(UNINSTALL | COMMIT); - event.doit= true; - break; - - } - } - - /* - * @see VerifyListener#verifyText(VerifyEvent) - */ - public void verifyText(VerifyEvent event) { - if (!event.doit) - return; - - IRegion region= fViewer.getVisibleRegion(); - - int offset= event.start + region.getOffset(); - int length= event.end - event.start; - - // allow changes only within linked positions when coming through UI - if (!fManager.anyPositionIncludes(offset, length)) - leave(UNINSTALL | COMMIT); - } - - /* - * @see PaintListener#paintControl(PaintEvent) - */ - public void paintControl(PaintEvent event) { - if (fFramePosition == null) - return; - - IRegion region= fViewer.getVisibleRegion(); - - // #6824 - if (!includes(region, fFramePosition)) { - leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED); - return; - } - - int offset= fFramePosition.getOffset() - region.getOffset(); - int length= fFramePosition.getLength(); - - StyledText text= fViewer.getTextWidget(); - - // support for bidi - Point minLocation= getMinimumLocation(text, offset, length); - Point maxLocation= getMaximumLocation(text, offset, length); - - int x1= minLocation.x; - int x2= minLocation.x + maxLocation.x - minLocation.x - 1; - int y= minLocation.y + text.getLineHeight() - 1; - - GC gc= event.gc; - gc.setForeground(fFrameColor); - gc.drawLine(x1, y, x2, y); - } - - private static Point getMinimumLocation(StyledText text, int offset, int length) { - Point minLocation= new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); - - for (int i= 0; i <= length; i++) { - Point location= text.getLocationAtOffset(offset + i); - - if (location.x < minLocation.x) - minLocation.x= location.x; - if (location.y < minLocation.y) - minLocation.y= location.y; - } - - return minLocation; - } - - private static Point getMaximumLocation(StyledText text, int offset, int length) { - Point maxLocation= new Point(Integer.MIN_VALUE, Integer.MIN_VALUE); - - for (int i= 0; i <= length; i++) { - Point location= text.getLocationAtOffset(offset + i); - - if (location.x > maxLocation.x) - maxLocation.x= location.x; - if (location.y > maxLocation.y) - maxLocation.y= location.y; - } - - return maxLocation; - } - - private void redrawRegion() { - IRegion region= fViewer.getVisibleRegion(); - - if (!includes(region, fFramePosition)) { - leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED); - return; - } - - int offset= fFramePosition.getOffset() - region.getOffset(); - int length= fFramePosition.getLength(); - - fViewer.getTextWidget().redrawRange(offset, length, true); - } - - private void selectRegion() { - IRegion region= fViewer.getVisibleRegion(); - - if (!includes(region, fFramePosition)) { - leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED); - return; - } - - int start= fFramePosition.getOffset() - region.getOffset(); - int end= fFramePosition.getLength() + start; - - fViewer.getTextWidget().setSelection(start, end); - } - - private void updateCaret() { - IRegion region= fViewer.getVisibleRegion(); - - if (!includes(region, fFramePosition)) { - leave(UNINSTALL | COMMIT | DOCUMENT_CHANGED); - return; - } - - int offset= fFramePosition.getOffset() + fCaretOffset - region.getOffset(); - - if ((offset >= 0) && (offset <= region.getLength())) - fViewer.getTextWidget().setCaretOffset(offset); - } - - /* - * @see ModifyListener#modifyText(ModifyEvent) - */ - public void modifyText(ModifyEvent e) { - // reposition caret after StyledText - redrawRegion(); - updateCaret(); - } - - private static void openErrorDialog(Shell shell, Exception e) { - MessageDialog.openError(shell, LinkedPositionMessages.getString("LinkedPositionUI.error.title"), e.getMessage()); //$NON-NLS-1$ - } - - /* - * @see ITextInputListener#inputDocumentAboutToBeChanged(IDocument, IDocument) - */ - public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { - // 5326: leave linked mode on document change - int flags= UNINSTALL | COMMIT | (oldInput.equals(newInput) ? 0 : DOCUMENT_CHANGED); - leave(flags); - } - - /* - * @see ITextInputListener#inputDocumentChanged(IDocument, IDocument) - */ - public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { - } - - private static boolean includes(IRegion region, Position position) { - return - position.getOffset() >= region.getOffset() && - position.getOffset() + position.getLength() <= region.getOffset() + region.getLength(); - } - - - public static class ExitFlags { - public int flags; - public boolean doit; - public ExitFlags(int flags, boolean doit) { - this.flags= flags; - this.doit= doit; - } - } - - public interface ExitPolicy { - ExitFlags doExit(LinkedPositionManager manager, VerifyEvent event, int offset, int length); - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateContentProvider.java deleted file mode 100644 index 0440dce8286..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateContentProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.TemplateSet; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; - - -public class TemplateContentProvider implements IStructuredContentProvider { - - private TemplateSet fTemplateSet; - - /** - * @see IStructuredContentProvider#getElements(Object) - */ - public Object[] getElements(Object input) { - return fTemplateSet.getTemplates(); - } - - /** - * @see IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - fTemplateSet= (TemplateSet) newInput; - } - - /** - * @see IContentProvider#dispose() - */ - public void dispose() { - fTemplateSet= null; - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java deleted file mode 100644 index b447c42929b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateEngine.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.Template; -import org.eclipse.cdt.internal.corext.template.Templates; -import org.eclipse.cdt.internal.corext.template.c.CompilationUnitContext; -import org.eclipse.cdt.internal.corext.template.c.CompilationUnitContextType; -import org.eclipse.cdt.internal.corext.template.c.ICompilationUnit; -import org.eclipse.cdt.internal.ui.text.link.LinkedPositionManager; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ITableLabelProvider; - -public class TemplateEngine { - - private ContextType fContextType; - private ITableLabelProvider fLabelProvider= new TemplateLabelProvider(); - - private ArrayList fProposals= new ArrayList(); - - /** - * Creates the template engine for a particular context type. - * See TemplateContext for supported context types. - */ - public TemplateEngine(ContextType contextType) { - Assert.isNotNull(contextType); - fContextType= contextType; - } - - /** - * Empties the collector. - * - * @param viewer the text viewer - * @param unit the compilation unit (may be null) - */ - public void reset() { - fProposals.clear(); - } - - /** - * Returns the array of matching templates. - */ - public List getResults() { - // return (ICCompletionProposal[]) fProposals.toArray(new ICCompletionProposal[fProposals.size()]); - return fProposals; - } - - /** - * Inspects the context of the compilation unit around completionPosition - * and feeds the collector with proposals. - * @param viewer the text viewer - * @param completionPosition the context position in the document of the text viewer - * @param compilationUnit the compilation unit (may be null) - */ - public void complete(ITextViewer viewer, int completionPosition, ICompilationUnit compilationUnit) - //throws JavaModelException - { - IDocument document= viewer.getDocument(); - - // prohibit recursion - if (LinkedPositionManager.hasActiveManager(document)) - return; - - if (!(fContextType instanceof CompilationUnitContextType)) - return; - - ((CompilationUnitContextType) fContextType).setContextParameters(document.get(), completionPosition, compilationUnit); - CompilationUnitContext context= (CompilationUnitContext) fContextType.createContext(); - int start= context.getStart(); - int end= context.getEnd(); - IRegion region= new Region(start, end - start); - - Template[] templates= Templates.getInstance().getTemplates(); - for (int i= 0; i != templates.length; i++) - if (context.canEvaluate(templates[i])) - fProposals.add(new TemplateProposal(templates[i], context, region, viewer, fLabelProvider.getColumnImage(templates[i], 0))); - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateLabelProvider.java deleted file mode 100644 index a6860e7f59a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateLabelProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.graphics.Image; - -import org.eclipse.cdt.internal.corext.template.Template; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.ITableLabelProvider; - - -public class TemplateLabelProvider implements ITableLabelProvider { - - /* - * @see ITableLabelProvider#getColumnImage(Object, int) - */ - public Image getColumnImage(Object element, int columnIndex) { - if (columnIndex != 0) - return null; - - return CPluginImages.get(CPluginImages.IMG_OBJS_TEMPLATE); - } - - /* - * @see ITableLabelProvider#getColumnText(Object, int) - */ - public String getColumnText(Object element, int columnIndex) { - Template template = (Template) element; - - switch (columnIndex) { - case 0: - return template.getName(); - case 1: - return template.getContextTypeName(); - case 2: - return template.getDescription(); - default: - return null; - } - } - - /* - * @see IBaseLabelProvider#addListener(ILabelProviderListener) - */ - public void addListener(ILabelProviderListener listener) { - } - - /* - * @see IBaseLabelProvider#dispose() - */ - public void dispose() { - } - - /* - * @see IBaseLabelProvider#isLabelProperty(Object, String) - */ - public boolean isLabelProperty(Object element, String property) { - return false; - } - - /* - * @see IBaseLabelProvider#removeListener(ILabelProviderListener) - */ - public void removeListener(ILabelProviderListener listener) { - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java deleted file mode 100644 index a1174b132cd..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateProposal.java +++ /dev/null @@ -1,225 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.corext.template.Template; -import org.eclipse.cdt.internal.corext.template.TemplateBuffer; -import org.eclipse.cdt.internal.corext.template.TemplateContext; -import org.eclipse.cdt.internal.corext.template.TemplateMessages; -import org.eclipse.cdt.internal.corext.template.TemplatePosition; -import org.eclipse.cdt.internal.ui.text.link.LinkedPositionManager; -import org.eclipse.cdt.internal.ui.text.link.LinkedPositionUI; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.text.ICCompletionProposal; -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.util.Assert; - -/** - * A template proposal. - */ -public class TemplateProposal implements ICCompletionProposal { - - private final Template fTemplate; - private final TemplateContext fContext; - private final ITextViewer fViewer; - private final Image fImage; - private final IRegion fRegion; - - private TemplateBuffer fTemplateBuffer; - private String fOldText; - private IRegion fSelectedRegion; // initialized by apply() - - /** - * Creates a template proposal with a template and its context. - * @param template the template - * @param context the context in which the template was requested. - * @param image the icon of the proposal. - */ - public TemplateProposal(Template template, TemplateContext context, IRegion region, ITextViewer viewer, Image image) { - Assert.isNotNull(template); - Assert.isNotNull(context); - Assert.isNotNull(region); - Assert.isNotNull(viewer); - - fTemplate= template; - fContext= context; - fViewer= viewer; - fImage= image; - fRegion= region; - } - - /** - * @see ICompletionProposal#apply(IDocument) - */ - public void apply(IDocument document) { - try { - if (fTemplateBuffer == null) - fTemplateBuffer= fContext.evaluate(fTemplate); - - int start= fRegion.getOffset(); - int end= fRegion.getOffset() + fRegion.getLength(); - - // insert template string - String templateString= fTemplateBuffer.getString(); - document.replace(start, end - start, templateString); - - // translate positions - LinkedPositionManager manager= new LinkedPositionManager(document); - TemplatePosition[] variables= fTemplateBuffer.getVariables(); - for (int i= 0; i != variables.length; i++) { - TemplatePosition variable= variables[i]; - - if (variable.isResolved()) - continue; - - int[] offsets= variable.getOffsets(); - int length= variable.getLength(); - - for (int j= 0; j != offsets.length; j++) - manager.addPosition(offsets[j] + start, length); - } - - LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager); - editor.setFinalCaretOffset(getCaretOffset(fTemplateBuffer) + start); - editor.enter(); - - fSelectedRegion= editor.getSelectedRegion(); - - } catch (BadLocationException e) { - CUIPlugin.getDefault().log(e); - openErrorDialog(e); - - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - openErrorDialog(e); - } - } - - private static int getCaretOffset(TemplateBuffer buffer) { - TemplatePosition[] variables= buffer.getVariables(); - for (int i= 0; i != variables.length; i++) { - TemplatePosition variable= variables[i]; - - if (variable.getName().equals("cursor")) - return variable.getOffsets()[0]; - } - - return buffer.getString().length(); - } - - /** - * @see ICompletionProposal#getSelection(IDocument) - */ - public Point getSelection(IDocument document) { - return new Point(fSelectedRegion.getOffset(), fSelectedRegion.getLength()); - } - - /** - * @see ICompletionProposal#getAdditionalProposalInfo() - */ - public String getAdditionalProposalInfo() { - try { - if (fTemplateBuffer == null) - fTemplateBuffer= fContext.evaluate(fTemplate); - - return textToHTML(fTemplateBuffer.getString()); - - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - openErrorDialog(e); - - return null; - } - } - - /** - * @see ICompletionProposal#getDisplayString() - */ - public String getDisplayString() { - return fTemplate.getName() + TemplateMessages.getString("TemplateProposal.delimiter") + fTemplate.getDescription(); // $NON-NLS-1$ //$NON-NLS-1$ - } - - /** - * @see ICompletionProposal#getImage() - */ - public Image getImage() { - return fImage; - } - - /** - * @see ICompletionProposal#getContextInformation() - */ - public IContextInformation getContextInformation() { - return null; - } - - private static String textToHTML(String string) { - StringBuffer buffer= new StringBuffer(string.length()); - buffer.append("
            "); //$NON-NLS-1$
            -	
            -		for (int i= 0; i != string.length(); i++) {
            -			char ch= string.charAt(i);
            -			
            -			switch (ch) {
            -				case '&':
            -					buffer.append("&"); //$NON-NLS-1$
            -					break;
            -					
            -				case '<':
            -					buffer.append("<"); //$NON-NLS-1$
            -					break;
            -
            -				case '>':
            -					buffer.append(">"); //$NON-NLS-1$
            -					break;
            -
            -				case '\t':
            -					buffer.append("    "); //$NON-NLS-1$
            -					break;
            -
            -				case '\n':
            -					buffer.append("
            "); //$NON-NLS-1$ - break; - - default: - buffer.append(ch); - break; - } - } - - buffer.append("
            "); //$NON-NLS-1$ - return buffer.toString(); - } - - private void openErrorDialog(BadLocationException e) { - Shell shell= fViewer.getTextWidget().getShell(); - MessageDialog.openError(shell, TemplateMessages.getString("TemplateEvaluator.error.title"), e.getMessage()); //$NON-NLS-1$ - } - - private void openErrorDialog(CoreException e) { - Shell shell= fViewer.getTextWidget().getShell(); - MessageDialog.openError(shell, TemplateMessages.getString("TemplateEvaluator.error.title"), e.getMessage()); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see IJavaCompletionProposal#getRelevance() - */ - public int getRelevance() { - return 9; - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java deleted file mode 100644 index e583dcd8fd8..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProcessor.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.template; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import org.eclipse.cdt.internal.corext.template.ContextType; -import org.eclipse.cdt.internal.corext.template.TemplateVariable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.text.contentassist.IContextInformationValidator; - - -public class TemplateVariableProcessor implements IContentAssistProcessor { - - private static Comparator fgTemplateVariableProposalComparator= new Comparator() { - public int compare(Object arg0, Object arg1) { - TemplateVariableProposal proposal0= (TemplateVariableProposal) arg0; - TemplateVariableProposal proposal1= (TemplateVariableProposal) arg1; - - return proposal0.getDisplayString().compareTo(proposal1.getDisplayString()); - } - - public boolean equals(Object arg0) { - return false; - } - }; - - - /** the context type */ - private ContextType fContextType; - - /** - * Sets the context type. - */ - public void setContextType(ContextType contextType) { - fContextType= contextType; - } - - /* - * @see IContentAssistProcessor#computeCompletionProposals(ITextViewer, int) - */ - public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) { - - if (fContextType == null) - return null; - - List proposals= new ArrayList(); - - String text= viewer.getDocument().get(); - int start= getStart(text, documentOffset); - int end= documentOffset; - - String string= text.substring(start, end); - String prefix= (string.length() >= 2) - ? string.substring(2) - : null; - - int offset= start; - int length= end - start; - - for (Iterator iterator= fContextType.variableIterator(); iterator.hasNext(); ) { - TemplateVariable variable= (TemplateVariable) iterator.next(); - - if (prefix == null || variable.getName().startsWith(prefix)) - proposals.add(new TemplateVariableProposal(variable, offset, length, viewer)); - } - - Collections.sort(proposals, fgTemplateVariableProposalComparator); - return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]); - } - - /* Guesses the start position of the completion */ - private int getStart(String string, int end) { - int start= end; - - if (start >= 1 && string.charAt(start - 1) == '$') - return start - 1; - - while ((start != 0) && Character.isUnicodeIdentifierPart(string.charAt(start - 1))) - start--; - - if (start >= 2 && string.charAt(start - 1) == '{' && string.charAt(start - 2) == '$') - return start - 2; - - return end; - } - - /* - * @see IContentAssistProcessor#computeContextInformation(ITextViewer, int) - */ - public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) { - return null; - } - - /* - * @see IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() - */ - public char[] getCompletionProposalAutoActivationCharacters() { - return new char[] {'$'}; - } - - /* - * @see IContentAssistProcessor#getContextInformationAutoActivationCharacters() - */ - public char[] getContextInformationAutoActivationCharacters() { - return null; - } - - /* - * @see IContentAssistProcessor#getErrorMessage() - */ - public String getErrorMessage() { - return null; - } - - /* - * @see IContentAssistProcessor#getContextInformationValidator() - */ - public IContextInformationValidator getContextInformationValidator() { - return null; - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java deleted file mode 100644 index 6cde736a8d4..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/template/TemplateVariableProposal.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.template; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.cdt.internal.corext.template.TemplateMessages; -import org.eclipse.cdt.internal.corext.template.TemplateVariable; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.jface.text.contentassist.IContextInformation; - - -/** - * A proposal for insertion of template variables. - */ -public class TemplateVariableProposal implements ICompletionProposal { - - private TemplateVariable fVariable; - private int fOffset; - private int fLength; - private ITextViewer fViewer; - - private Point fSelection; - - /** - * Creates a template variable proposal. - * - * @param variable the template variable - * @param offset the offset to replace - * @param length the length to replace - * @param viewer the viewer - */ - public TemplateVariableProposal(TemplateVariable variable, int offset, int length, ITextViewer viewer) { - fVariable= variable; - fOffset= offset; - fLength= length; - fViewer= viewer; - } - - /* - * @see ICompletionProposal#apply(IDocument) - */ - public void apply(IDocument document) { - - try { - String variable= fVariable.getName().equals("dollar") ? "$$" : "${" + fVariable.getName() + '}'; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - document.replace(fOffset, fLength, variable); - fSelection= new Point(fOffset + variable.length(), 0); - - } catch (BadLocationException e) { - CUIPlugin.getDefault().log(e); - - Shell shell= fViewer.getTextWidget().getShell(); - MessageDialog.openError(shell, TemplateMessages.getString("TemplateVariableProposal.error.title"), e.getMessage()); //$NON-NLS-1$ - } - } - - /* - * @see ICompletionProposal#getSelection(IDocument) - */ - public Point getSelection(IDocument document) { - return fSelection; - } - - /* - * @see ICompletionProposal#getAdditionalProposalInfo() - */ - public String getAdditionalProposalInfo() { - return null; - } - - /* - * @see ICompletionProposal#getDisplayString() - */ - public String getDisplayString() { - return fVariable.getName() + " - " + fVariable.getDescription(); //$NON-NLS-1$ - } - - /* - * @see ICompletionProposal#getImage() - */ - public Image getImage() { - return null; - } - - /* - * @see ICompletionProposal#getContextInformation() - */ - public IContextInformation getContextInformation() { - return null; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CColorManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CColorManager.java deleted file mode 100644 index eef5f1f03b9..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CColorManager.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.internal.ui.text.IColorManager; -import org.eclipse.cdt.internal.ui.text.IColorManagerExtension; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -/** - * Java color manager. - */ -public class CColorManager implements IColorManager, IColorManagerExtension { - - protected Map fKeyTable= new HashMap(10); - protected Map fDisplayTable= new HashMap(2); - - - public CColorManager() { - } - - protected void dispose(Display display) { - Map colorTable= (Map) fDisplayTable.get(display); - if (colorTable != null) { - Iterator e= colorTable.values().iterator(); - while (e.hasNext()) - ((Color) e.next()).dispose(); - } - } - - /* - * @see IColorManager#getColor(RGB) - */ - public Color getColor(RGB rgb) { - - if (rgb == null) - return null; - - final Display display= Display.getCurrent(); - Map colorTable= (Map) fDisplayTable.get(display); - if (colorTable == null) { - colorTable= new HashMap(10); - fDisplayTable.put(display, colorTable); - display.disposeExec(new Runnable() { - public void run() { - dispose(display); - } - }); - } - - Color color= (Color) colorTable.get(rgb); - if (color == null) { - color= new Color(Display.getCurrent(), rgb); - colorTable.put(rgb, color); - } - - return color; - } - - /* - * @see IColorManager#dispose - */ - public void dispose() { - // nothing to dispose - } - - /* - * @see IColorManager#getColor(String) - */ - public Color getColor(String key) { - - if (key == null) - return null; - - RGB rgb= (RGB) fKeyTable.get(key); - return getColor(rgb); - } - - /* - * @see IColorManagerExtension#bindColor(String, RGB) - */ - public void bindColor(String key, RGB rgb) { - Object value= fKeyTable.get(key); - if (value != null) - throw new UnsupportedOperationException(); - - fKeyTable.put(key, rgb); - } - - /* - * @see IColorManagerExtension#unbindColor(String) - */ - public void unbindColor(String key) { - fKeyTable.remove(key); - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWhitespaceDetector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWhitespaceDetector.java deleted file mode 100644 index 99aff354b02..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWhitespaceDetector.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.rules.IWhitespaceDetector; - - -/** - * A C aware white space detector. - */ -public class CWhitespaceDetector implements IWhitespaceDetector { - - /** - * @see IWhitespaceDetector#isWhitespace - */ - public boolean isWhitespace(char c) { - return Character.isWhitespace(c); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWordDetector.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWordDetector.java deleted file mode 100644 index ee79266e6ea..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/util/CWordDetector.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.cdt.internal.ui.text.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.text.rules.IWordDetector; - - -/** - * A C aware word detector. - */ -public class CWordDetector implements IWordDetector { - - /** - * @see IWordDetector#isWordIdentifierStart - */ - public boolean isWordStart(char c) { - return Character.isJavaIdentifierStart(c); - } - - /** - * @see IWordDetector#isWordIdentifierPart - */ - public boolean isWordPart(char c) { - return Character.isJavaIdentifierPart(c); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java deleted file mode 100644 index 558e5c3a2ba..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/DeleteTaskAction.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.actions.ActionDelegate; - -import org.eclipse.cdt.core.model.ICModelMarker; - -public class DeleteTaskAction extends ActionDelegate implements IObjectActionDelegate -{ - private IStructuredSelection selection; - - /** - * @see ActionDelegate#run(IAction) - */ - public void run(IAction action) { - // Add your code here to perform the action - if (selection != null) { - if (selection.isEmpty()) { - return; - } - try { - List list = ((IStructuredSelection) selection).toList(); - List listMarkers = new ArrayList(); - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - IMarker marker = (IMarker)iterator.next(); - if (marker.isSubtypeOf(ICModelMarker.C_MODEL_PROBLEM_MARKER) - || marker.isSubtypeOf(ICModelMarker.C_MODEL_MARKER_VARIABLE)) { - listMarkers.add(marker); - } - } - // Bail out early - if (listMarkers.isEmpty()) { - return; - } - IMarker[] markers = new IMarker[listMarkers.size()]; - listMarkers.toArray(markers); - // be sure to only invoke one workspace operation - ResourcesPlugin.getWorkspace().deleteMarkers(markers); - selection = null; - } catch (CoreException e) { - } - } - } - - /** - * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - } - - public void selectionChanged(IAction action, ISelection selection) { - boolean enable = false; - if (selection instanceof IStructuredSelection) { - Object object = ((IStructuredSelection) selection).getFirstElement(); - if (object instanceof IMarker) { - try { - IMarker marker = (IMarker) object; - if (marker.isSubtypeOf(ICModelMarker.C_MODEL_PROBLEM_MARKER) - || marker.isSubtypeOf(ICModelMarker.C_MODEL_MARKER_VARIABLE)) { - enable = true; - } - this.selection = (IStructuredSelection)selection; - action.setEnabled(enable); - } catch (CoreException e) { - } - } - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java deleted file mode 100644 index 7110fb5ffa3..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/EditorUtility.java +++ /dev/null @@ -1,330 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.utils.spawner.ProcessFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.IPath; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.ITextEditor; - -public class EditorUtility { - - private EditorUtility () { - } - - /** - * Tests if a cu is currently shown in an editor - * @return the IEditorPart if shown, null if element is not open in an editor - */ - public static IEditorPart isOpenInEditor(Object inputElement) { - IEditorInput input = null; - - try { - input = getEditorInput(inputElement); - } catch (CModelException x) { - //CUIPlugin.log(x.getStatus()); - } - - if (input != null) { - IWorkbenchPage p= CUIPlugin.getActivePage(); - if (p != null) { - return p.findEditor(input); - } - } - - return null; - } - - - /** - * Opens a Java editor for an element such as IJavaElement, IFile, or IStorage. - * The editor is activated by default. - * @return the IEditorPart or null if wrong element type or opening failed - */ - public static IEditorPart openInEditor(Object inputElement) throws CModelException, PartInitException { - return openInEditor(inputElement, true); - } - - /** - * Opens a Java editor for an element (IJavaElement, IFile, IStorage...) - * @return the IEditorPart or null if wrong element type or opening failed - */ - public static IEditorPart openInEditor(Object inputElement, boolean activate) throws CModelException, PartInitException { - - if (inputElement instanceof IFile) { - return openInEditor((IFile) inputElement, activate); - } - - IEditorInput input = getEditorInput(inputElement); - if (input instanceof IFileEditorInput) { - IFileEditorInput fileInput= (IFileEditorInput) input; - return openInEditor(fileInput.getFile(), activate); - } - - if (input != null) { - return openInEditor(input, getEditorID(input, inputElement), activate); - } - - return null; - } - - /** - * Selects a C Element in an editor - */ - public static void revealInEditor(IEditorPart part, ICElement element) { - if (element != null && part instanceof CEditor) { - ((CEditor) part).setSelection(element); - } - } - - private static IEditorPart openInEditor(IFile file, boolean activate) throws PartInitException { - if (file != null) { - IWorkbenchPage p= CUIPlugin.getActivePage(); - if (p != null) { - IEditorPart editorPart = IDE.openEditor(p, file, activate); - initializeHighlightRange(editorPart); - return editorPart; - } - } - return null; - } - - private static IEditorPart openInEditor(IEditorInput input, String editorID, boolean activate) throws PartInitException { - if (input != null) { - IWorkbenchPage p= CUIPlugin.getActivePage(); - if (p != null) { - IEditorPart editorPart= p.openEditor(input, editorID, activate); - initializeHighlightRange(editorPart); - return editorPart; - } - } - return null; - } - - private static void initializeHighlightRange(IEditorPart editorPart) { - if (editorPart instanceof ITextEditor) { - //TogglePresentationAction toggleAction= new TogglePresentationAction(); - // Initialize editor - //toggleAction.setEditor((ITextEditor)editorPart); - // Reset action - //toggleAction.setEditor(null); - } - } - - private static IEditorInput getEditorInput(ICElement element) throws CModelException { - while (element != null) { - if (element instanceof IWorkingCopy && ((IWorkingCopy) element).isWorkingCopy()) - element= ((IWorkingCopy) element).getOriginalElement(); - - if (element instanceof ISourceReference) { - ITranslationUnit tu = ((ISourceReference)element).getTranslationUnit(); - if (tu != null) { - element = tu; - } - } - - if (element instanceof ITranslationUnit) { - ITranslationUnit unit= (ITranslationUnit) element; - IResource resource= unit.getResource(); - if (resource instanceof IFile) - return new FileEditorInput((IFile) resource); - } - - if (element instanceof IBinary) { - //return new InternalClassFileEditorInput((IBinary) element); - return new ExternalEditorInput(getStorage((IBinary)element)); - } - - element= element.getParent(); - } - - return null; - } - - public static IEditorInput getEditorInput(Object input) throws CModelException { - if (input instanceof ICElement) { - return getEditorInput((ICElement) input); - } - - if (input instanceof IFile) { - return new FileEditorInput((IFile) input); - } - - if (input instanceof IStorage) { - //return new JarEntryEditorInput((IStorage)input); - return new ExternalEditorInput((IStorage)input); - } - return null; - } - - - /** - * If the current active editor edits a c element return it, else - * return null - */ - public static ICElement getActiveEditorCInput() { - IWorkbenchPage page= CUIPlugin.getActivePage(); - if (page != null) { - IEditorPart part= page.getActiveEditor(); - if (part != null) { - IEditorInput editorInput= part.getEditorInput(); - if (editorInput != null) { - return (ICElement)editorInput.getAdapter(ICElement.class); - } - } - } - return null; - } - - /** - * Gets the working copy of an compilation unit opened in an editor - * @param part the editor part - * @param cu the original compilation unit (or another working copy) - * @return the working copy of the compilation unit, or null if not found - */ -// public static ITranslationUnit getWorkingCopy(ITranslationUnit cu) { -// if (cu == null) -// return null; -// if (cu.isWorkingCopy()) -// return cu; -// -// return (ITranslationUnit)cu.findSharedWorkingCopy(CUIPlugin.getBufferFactory()); -// } - - - /** - * Returns the translation unit for the given c element. - * @param element the c element whose compilation unit is searched for - * @return the compilation unit of the given java element - */ - private static ITranslationUnit getTranslationUnit(ICElement element) { - - if (element == null) - return null; - - int type= element.getElementType(); - if (ICElement.C_UNIT == type) { - return (ITranslationUnit) element; - } - if (ICElement.C_BINARY == type) { - return null; - } - if (element instanceof ISourceReference) { - return ((ISourceReference) element).getTranslationUnit(); - } - return getTranslationUnit(element.getParent()); - } - - -// public static IEditorPart openInEditor (IFile file) throws PartInitException { -// IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); -// if (window != null) { -// IWorkbenchPage p= window.getActivePage(); -// if (p != null) { -// return p.openEditor(file); -// } -// } -// return null; -// } -// -// -// public static IEditorPart openInEditor (IPath path) throws PartInitException { -// IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path); -// if (f == null) { -// IStorage s = new FileStorage(path); -// return openInEditor(s, path.lastSegment()); -// } -// return openInEditor(f); -// } -// -// public static IEditorPart openInEditor (IStorage store, String name) throws PartInitException { -// IEditorInput ei = new ExternalEditorInput(store); -// IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); -// if (window != null) { -// IWorkbenchPage p = window.getActivePage(); -// if (p != null) { -// return p.openEditor(ei, getEditorID(name)); -// } -// } -// return null; -// } -// - - public static String getEditorID(String name) { - IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); - if (registry != null) { - IEditorDescriptor descriptor = registry.getDefaultEditor(name); - if (descriptor != null) { - return descriptor.getId(); - } else { - return registry.getDefaultEditor().getId(); - } - } - return null; - } - - public static String getEditorID(IEditorInput input, Object inputObject) { - return getEditorID(input.getName()); - } - - public static IStorage getStorage(IBinary bin) { - IStorage store = null; - Process objdump = null; - IPath path; - IResource file = null; - file = bin.getResource(); - if (file == null) - return store; - path = file.getLocation(); - try { - String[] args = new String[] {"objdump", "-CxS", path.toOSString()}; - objdump = ProcessFactory.getFactory().exec(args); - StringBuffer buffer = new StringBuffer(); - BufferedReader stdout = - new BufferedReader(new InputStreamReader(objdump.getInputStream())); - char[] buf = new char[128]; - while (stdout.read(buf, 0, buf.length) != -1) { - buffer.append(buf); - } - store = new FileStorage(new ByteArrayInputStream(buffer.toString().getBytes()), path); - } catch (SecurityException e) { - } catch (IndexOutOfBoundsException e) { - } catch (NullPointerException e) { - } catch (IOException e) { - } finally { - if (objdump != null) { - objdump.destroy(); - } - } - return store; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExceptionHandler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExceptionHandler.java deleted file mode 100644 index 11dfbd084e4..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExceptionHandler.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.util; - - -import java.io.StringWriter; -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.swt.widgets.Shell; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.internal.ui.CStatusConstants; -import org.eclipse.cdt.internal.ui.CUIMessages; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; - -/** - * The default exception handler shows an error dialog when one of its handle methods - * is called. If the passed exception is a CoreException an error dialog - * pops up showing the exception's status information. For a InvocationTargetException - * a normal message dialog pops up showing the exception's message. Additionally the exception - * is written to the platform log. - */ -public class ExceptionHandler { - - private static ExceptionHandler fgInstance= new ExceptionHandler(); - - /** - * Logs the given exception using the platform's logging mechanism. The exception is - * logged as an error with the error code JavaStatusConstants.INTERNAL_ERROR. - */ - public static void log(Throwable t, String message) { - CUIPlugin.getDefault().log(new Status(IStatus.ERROR, CUIPlugin.getPluginId(), - CStatusConstants.INTERNAL_ERROR, message, t)); - } - - /** - * Handles the given CoreException. The workbench shell is used as a parent - * for the dialog window. - * - * @param e the CoreException to be handled - * @param title the dialog window's window title - * @param message message to be displayed by the dialog window - */ - public static void handle(CoreException e, String title, String message) { - handle(e, CUIPlugin.getDefault().getActiveWorkbenchShell(), title, message); - } - - /** - * Handles the given CoreException. - * - * @param e the CoreException to be handled - * @param parent the dialog window's parent shell - * @param title the dialog window's window title - * @param message message to be displayed by the dialog window - */ - public static void handle(CoreException e, Shell parent, String title, String message) { - fgInstance.perform(e, parent, title, message); - } - - /** - * Handles the given InvocationTargetException. The workbench shell is used - * as a parent for the dialog window. - * - * @param e the InvocationTargetException to be handled - * @param title the dialog window's window title - * @param message message to be displayed by the dialog window - */ - public static void handle(InvocationTargetException e, String title, String message) { - handle(e, CUIPlugin.getDefault().getActiveWorkbenchShell(), title, message); - } - - /** - * Handles the given InvocationTargetException. - * - * @param e the InvocationTargetException to be handled - * @param parent the dialog window's parent shell - * @param title the dialog window's window title - * @param message message to be displayed by the dialog window - */ - public static void handle(InvocationTargetException e, Shell parent, String title, String message) { - fgInstance.perform(e, parent, title, message); - } - - //---- Hooks for subclasses to control exception handling ------------------------------------ - - protected void perform(CoreException e, Shell shell, String title, String message) { - CUIPlugin.getDefault().log(e); - IStatus status= e.getStatus(); - if (status != null) { - ErrorDialog.openError(shell, title, message, status); - } else { - displayMessageDialog(e, e.getMessage(), shell, title, message); - } - } - - protected void perform(InvocationTargetException e, Shell shell, String title, String message) { - Throwable target= e.getTargetException(); - if (target instanceof CoreException) { - perform((CoreException)target, shell, title, message); - } else { - CUIPlugin.getDefault().log(e); - if (e.getMessage() != null && e.getMessage().length() > 0) { - displayMessageDialog(e, e.getMessage(), shell, title, message); - } else { - displayMessageDialog(e, target.getMessage(), shell, title, message); - } - } - } - - //---- Helper methods ----------------------------------------------------------------------- - - private void displayMessageDialog(Throwable t, String exceptionMessage, Shell shell, String title, String message) { - StringWriter msg= new StringWriter(); - if (message != null) { - msg.write(message); - msg.write("\n\n"); //$NON-NLS-1$ - } - if (exceptionMessage == null || exceptionMessage.length() == 0) - msg.write(CUIMessages.getString("ExceptionDialog.seeErrorLogMessage")); //$NON-NLS-1$ - else - msg.write(exceptionMessage); - MessageDialog.openError(shell, title, msg.toString()); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java deleted file mode 100644 index 34ba1e29312..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ExternalEditorInput.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.jface.resource.ImageDescriptor; - -import org.eclipse.core.resources.IStorage; - -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.IPersistableElement; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.PlatformUI; - - -/** - * An EditorInput for a JarEntryFile. - */ -public class ExternalEditorInput implements IStorageEditorInput { - - IStorage externalFile; - - /* - */ - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!(obj instanceof ExternalEditorInput)) - return false; - ExternalEditorInput other = (ExternalEditorInput)obj; - return externalFile.equals(other.externalFile); - } - - /* - * @see IEditorInput#exists() - */ - public boolean exists() { - // External file ca not be deleted - return true; - } - - /* - * @see IAdaptable#getAdapter(Class) - */ - public Object getAdapter(Class adapter) { - return null; - } - - /* - * @see IEditorInput#getContentType() - */ - public String getContentType() { - return externalFile.getFullPath().getFileExtension(); - } - - /* - * @see IEditorInput#getFullPath() - */ - public String getFullPath() { - return externalFile.getFullPath().toString(); - } - - /* - * @see IEditorInput#getImageDescriptor() - */ - public ImageDescriptor getImageDescriptor() { - IEditorRegistry registry= PlatformUI.getWorkbench().getEditorRegistry(); - return registry.getImageDescriptor(externalFile.getFullPath().getFileExtension()); - } - - /* - * @see IEditorInput#getName() - */ - public String getName() { - return externalFile.getName(); - } - - /* - * @see IEditorInput#getPersistable() - */ - public IPersistableElement getPersistable() { - return null; - } - - /* - * see IStorageEditorInput#getStorage() - */ - public IStorage getStorage() { - return externalFile; - } - - /* - * @see IEditorInput#getToolTipText() - */ - public String getToolTipText() { - return externalFile.getFullPath().toString(); - } - - public ExternalEditorInput(IStorage exFile) { - externalFile = exFile; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/IProblemChangedListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/IProblemChangedListener.java deleted file mode 100644 index 354e19e9c19..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/IProblemChangedListener.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Set; - -/** - * Can be added to a ProblemMarkerManager to get notified about error - * marker changes. Used to update error ticks. - */ -public interface IProblemChangedListener { - - /** - * @param changedElements A set of type IPath that - * describe the resources that had an error marker change. - */ - void problemsChanged(Set changedElements); -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java deleted file mode 100644 index 5d65893821d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ImageDescriptorRegistry.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.Assert; - -/** - * A registry that maps ImageDescriptors to Image. - */ -public class ImageDescriptorRegistry { - - private HashMap fRegistry= new HashMap(10); - private Display fDisplay; - - /** - * Creates a new image descriptor registry for the current or default display, - * respectively. - */ - public ImageDescriptorRegistry() { - this(SWTUtil.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 diaplay the display the images managed by this registry are allocated for - */ - public ImageDescriptorRegistry(Display display) { - fDisplay= display; - Assert.isNotNull(fDisplay); - hookDisplay(); - } - - /** - * Returns the image assiciated with the given image descriptor. - * - * @param descriptor the image descriptor for which the registry manages an image - * @return the image associated with the image descriptor or null - * if the image descriptor can't create the requested image. - */ - public Image get(ImageDescriptor descriptor) { - if (descriptor == null) - descriptor= ImageDescriptor.getMissingImageDescriptor(); - - Image result= (Image)fRegistry.get(descriptor); - if (result != null) - return result; - - Assert.isTrue(fDisplay == SWTUtil.getStandardDisplay(), "Allocating image for wrong display."); //$NON-NLS-1$ - result= descriptor.createImage(); - if (result != null) - fRegistry.put(descriptor, result); - return result; - } - - /** - * Disposes all images managed by this registry. - */ - public void dispose() { - for (Iterator iter= fRegistry.values().iterator(); iter.hasNext(); ) { - Image image= (Image)iter.next(); - image.dispose(); - } - fRegistry.clear(); - } - - private void hookDisplay() { - fDisplay.disposeExec(new Runnable() { - public void run() { - dispose(); - } - }); - } -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/PixelConverter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/PixelConverter.java deleted file mode 100644 index 194ea8ff918..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/PixelConverter.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.util; - -import org.eclipse.swt.graphics.FontMetrics; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.widgets.Control; - -import org.eclipse.jface.dialogs.Dialog; - -public class PixelConverter { - - private FontMetrics fFontMetrics; - - public PixelConverter(Control control) { - GC gc = new GC(control); - gc.setFont(control.getFont()); - fFontMetrics= gc.getFontMetrics(); - gc.dispose(); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int) - */ - public int convertHeightInCharsToPixels(int chars) { - return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int) - */ - public int convertHorizontalDLUsToPixels(int dlus) { - return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int) - */ - public int convertVerticalDLUsToPixels(int dlus) { - return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int) - */ - public int convertWidthInCharsToPixels(int chars) { - return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemItemMapper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemItemMapper.java deleted file mode 100644 index 94e70d7c92f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemItemMapper.java +++ /dev/null @@ -1,195 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICElement; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Stack; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Item; - -import org.eclipse.jface.viewers.ILabelProvider; - - -/** - * Helper class for updating error markers. - * Items are mapped to paths of their underlying resources. - * Method problemsChanged updates all items that are affected from the changed - * elements. - */ -public class ProblemItemMapper { - - private static final int NUMBER_LIST_REUSE= 10; - - // map from path to item - private HashMap fPathToItem; - private Stack fReuseLists; - - public ProblemItemMapper() { - fPathToItem= new HashMap(); - fReuseLists= new Stack(); - } - - /** - * Updates the icons of all mapped elements containing to the changed elements. - * Must be called from the UI thread. - */ - public void problemsChanged(Collection changedPaths, ILabelProvider lprovider) { - // iterate over the smaller set/map - if (changedPaths.size() <= fPathToItem.size()) { - iterateChanges(changedPaths, lprovider); - } else { - iterateItems(changedPaths, lprovider); - } - } - - private void iterateChanges(Collection changedPaths, ILabelProvider lprovider) { - Iterator elements= changedPaths.iterator(); - while (elements.hasNext()) { - IPath curr= (IPath) elements.next(); - Object obj= fPathToItem.get(curr); - if (obj == null) { - // not mapped - } else if (obj instanceof Item) { - refreshIcon(lprovider, (Item)obj); - } else { // List of Items - List list= (List) obj; - for (int i= 0; i < list.size(); i++) { - refreshIcon(lprovider, (Item) list.get(i)); - } - } - } - } - - private void iterateItems(Collection changedPaths, ILabelProvider lprovider) { - Iterator keys= fPathToItem.keySet().iterator(); - while (keys.hasNext()) { - IPath curr= (IPath) keys.next(); - if (changedPaths.contains(curr)) { - Object obj= fPathToItem.get(curr); - if (obj instanceof Item) { - refreshIcon(lprovider, (Item)obj); - } else { // List of Items - List list= (List) obj; - for (int i= 0; i < list.size(); i++) { - refreshIcon(lprovider, (Item) list.get(i)); - } - } - } - } - } - - private void refreshIcon(ILabelProvider lprovider, Item item) { - if (!item.isDisposed()) { // defensive code - Object data= item.getData(); - if (data instanceof ICElement && !((ICElement)data).exists()) { - // @@@ not yet return; - } - Image old= item.getImage(); - Image image= lprovider.getImage(data); - if (image != null && image != old) { - item.setImage(image); - } - } - } - - /** - * Adds a new item to the map. - * @param element Element to map - * @param item The item used for the element - */ - public void addToMap(Object element, Item item) { - IPath path= getCorrespondingPath(element); - if (path != null) { - Object existingMapping= fPathToItem.get(path); - if (existingMapping == null) { - fPathToItem.put(path, item); - } else if (existingMapping instanceof Item) { - if (existingMapping != item) { - List list= newList(); - list.add(existingMapping); - list.add(item); - fPathToItem.put(path, list); - } - } else { // List - List list= (List)existingMapping; - if (!list.contains(item)) { - list.add(item); - } - } - } - } - - /** - * Removes an element from the map. - */ - public void removeFromMap(Object element, Item item) { - IPath path= getCorrespondingPath(element); - if (path != null) { - Object existingMapping= fPathToItem.get(path); - if (existingMapping == null) { - return; - } else if (existingMapping instanceof Item) { - fPathToItem.remove(path); - } else { // List - List list= (List) existingMapping; - list.remove(item); - if (list.isEmpty()) { - fPathToItem.remove(list); - releaseList(list); - } - } - } - } - - private List newList() { - if (!fReuseLists.isEmpty()) { - return (List) fReuseLists.pop(); - } - return new ArrayList(2); - } - - private void releaseList(List list) { - if (fReuseLists.size() < NUMBER_LIST_REUSE) { - fReuseLists.push(list); - } - } - - /** - * Clears the map. - */ - public void clearMap() { - fPathToItem.clear(); - } - - /** - * Method that decides which elements can have error markers - * Returns null if an element can not have error markers. - */ - private static IPath getCorrespondingPath(Object element) { - if (element instanceof ICElement) { - ICElement elem= (ICElement) element; - //if (!elem.isReadOnly()) { // only modifieable elements can get error ticks - return elem.getPath(); - //} - //return null; - } else if (element instanceof IResource) { - return ((IResource)element).getFullPath(); - } - return null; - } - -} - - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java deleted file mode 100644 index 2f94b8a662c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemMarkerManager.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.ICModelMarker; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.ui.CUIPlugin; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; - -import org.eclipse.jface.util.ListenerList; - - -/** - * Listens to resource deltas and filters for marker changes of type IMarker.PROBLEM - * Viewers showing error ticks should register as listener to - * this type. - */ -public class ProblemMarkerManager implements IResourceChangeListener { - - /** - * Visitors used to filter the element delta changes - */ - private static class ProjectErrorVisitor implements IResourceDeltaVisitor { - - private HashSet fChangedElements; - - public ProjectErrorVisitor(HashSet changedElements) { - fChangedElements= changedElements; - } - - public boolean visit(IResourceDelta delta) throws CoreException { - IResource res= delta.getResource(); - if (res instanceof IProject && delta.getKind() == IResourceDelta.CHANGED) { - try { - IProject project= (IProject) res; - if (!project.isAccessible() || !project.hasNature(CProjectNature.C_NATURE_ID)) { - // only track open C projects - return false; - } - } catch (CoreException e) { - CUIPlugin.getDefault().log(e.getStatus()); - return false; - } - } - checkInvalidate(delta, res.getFullPath()); - return true; - } - - private void checkInvalidate(IResourceDelta delta, IPath path) { - int kind= delta.getKind(); - if (kind == IResourceDelta.REMOVED || kind == IResourceDelta.ADDED || (kind == IResourceDelta.CHANGED && isErrorDelta(delta))) { - // invalidate the path and all parent paths - while (!path.isEmpty() && !path.isRoot() && !fChangedElements.contains(path)) { - fChangedElements.add(path); - path= path.removeLastSegments(1); - } - } - } - - private boolean isErrorDelta(IResourceDelta delta) { - if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { - IMarkerDelta[] markerDeltas= delta.getMarkerDeltas(); - for (int i= 0; i < markerDeltas.length; i++) { - if (markerDeltas[i].isSubtypeOf(ICModelMarker.C_MODEL_PROBLEM_MARKER)) { - int kind= markerDeltas[i].getKind(); - if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) - return true; - int severity= markerDeltas[i].getAttribute(IMarker.SEVERITY, -1); - int newSeverity= markerDeltas[i].getMarker().getAttribute(IMarker.SEVERITY, -1); - if (newSeverity != severity) - return true; - } - } - } - return false; - } - } - - private ListenerList fListeners; - - - public ProblemMarkerManager() { - fListeners= new ListenerList(5); - } - - /* - * @see IResourceChangeListener#resourceChanged - */ - public void resourceChanged(IResourceChangeEvent event) { - HashSet changedElements= new HashSet(); - - try { - IResourceDelta delta= event.getDelta(); - if (delta != null) - delta.accept(new ProjectErrorVisitor(changedElements)); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e.getStatus()); - } - - if (changedElements.size() > 0) { - fireChanges(changedElements); - } - } - - /** - * Adds a listener for problem marker changes. - */ - public void addListener(IProblemChangedListener listener) { - if (fListeners.isEmpty()) { - CUIPlugin.getWorkspace().addResourceChangeListener(this); - } - fListeners.add(listener); - } - - /** - * Removes a IProblemChangedListener. - */ - public void removeListener(IProblemChangedListener listener) { - fListeners.remove(listener); - if (fListeners.isEmpty()) { - CUIPlugin.getWorkspace().removeResourceChangeListener(this); - } - } - - private void fireChanges(Set changes) { - Object[] listeners= fListeners.getListeners(); - for (int i= 0; i < listeners.length; i++) { - IProblemChangedListener curr= (IProblemChangedListener) listeners[i]; - curr.problemsChanged(changes); - } - } - } - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java deleted file mode 100644 index 6dec74276b1..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/ProblemTreeViewer.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2002. - * All Rights Reserved. - */ - -import java.util.Set; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.Widget; - -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.LabelProviderChangedEvent; -import org.eclipse.jface.viewers.TreeViewer; - - -/** - * Extends a TreeViewer to allow more performance when showing error ticks. - * A ProblemItemMapper is contained that maps all items in - * the tree to underlying resource - */ -public class ProblemTreeViewer extends TreeViewer implements IProblemChangedListener { - - protected ProblemItemMapper fProblemItemMapper; - - /* - * @see TreeViewer#TreeViewer(Composite) - */ - public ProblemTreeViewer(Composite parent) { - super(parent); - initMapper(); - } - - /* - * @see TreeViewer#TreeViewer(Composite, int) - */ - public ProblemTreeViewer(Composite parent, int style) { - super(parent, style); - initMapper(); - } - - /* - * @see TreeViewer#TreeViewer(Tree) - */ - public ProblemTreeViewer(Tree tree) { - super(tree); - initMapper(); - } - - private void initMapper() { - fProblemItemMapper= new ProblemItemMapper(); - } - - - /* - * @see IProblemChangedListener#problemsChanged - */ - public void problemsChanged(final Set changed) { - Control control= getControl(); - if (control != null && !control.isDisposed()) { - control.getDisplay().asyncExec(new Runnable() { - public void run() { - fProblemItemMapper.problemsChanged(changed, (ILabelProvider)getLabelProvider()); - } - }); - } - } - - /* - * @see StructuredViewer#mapElement(Object, Widget) - */ - protected void mapElement(Object element, Widget item) { - super.mapElement(element, item); - if (item instanceof Item) { - fProblemItemMapper.addToMap(element, (Item) item); - } - } - - /* - * @see StructuredViewer#unmapElement(Object, Widget) - */ - protected void unmapElement(Object element, Widget item) { - if (item instanceof Item) { - fProblemItemMapper.removeFromMap(element, (Item) item); - } - super.unmapElement(element); - } - - /* - * @see ContentViewer#handleLabelProviderChanged(LabelProviderChangedEvent) - */ - protected void handleLabelProviderChanged(LabelProviderChangedEvent event) { - Object source= event.getElement(); - if (source == null) { - super.handleLabelProviderChanged(event); - return; - } - - /* - // map the event to the Java elements if possible - // this does not handle the ambiguity of default packages - Object[] mapped= new Object[source.length]; - for (int i= 0; i < source.length; i++) { - Object o= source[i]; - // needs to handle the case of: - // default package - // package fragment root on project - if (o instanceof IResource) { - IResource r= (IResource)o; - IJavaElement element= JavaCore.create(r); - if (element != null) - mapped[i]= element; - else - mapped[i]= o; - } else { - mapped[i]= o; - } - } - super.handleLabelProviderChanged(new LabelProviderChangedEvent((IBaseLabelProvider)event.getSource(), mapped)); */ - super.handleLabelProviderChanged(event); - return; - } - - /** - * @see StructuredViewer#handleInvalidSelection(ISelection, ISelection) - */ - protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) { - super.handleInvalidSelection(invalidSelection, newSelection); - } - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SWTUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SWTUtil.java deleted file mode 100644 index 7de94146a04..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SWTUtil.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.util; - - -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.DragSource; -import org.eclipse.swt.dnd.DropTarget; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Caret; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.Widget; - -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.Assert; - -/** - * Utility class to simplify access to some SWT resources. - */ -public class SWTUtil { - - /** - * Returns the standard display to be used. The method first checks, if - * the thread calling this method has an associated disaply. If so, this - * display is returned. Otherwise the method returns the default display. - */ - public static Display getStandardDisplay() { - Display display; - display= Display.getCurrent(); - if (display == null) - display= Display.getDefault(); - return display; - } - - /** - * Returns the shell for the given widget. If the widget doesn't represent - * a SWT object that manage a shell, null is returned. - * - * @return the shell for the given widget - */ - public static Shell getShell(Widget widget) { - if (widget instanceof Control) - return ((Control)widget).getShell(); - if (widget instanceof Caret) - return ((Caret)widget).getParent().getShell(); - if (widget instanceof DragSource) - return ((DragSource)widget).getControl().getShell(); - if (widget instanceof DropTarget) - return ((DropTarget)widget).getControl().getShell(); - if (widget instanceof Menu) - return ((Menu)widget).getParent().getShell(); - if (widget instanceof ScrollBar) - return ((ScrollBar)widget).getParent().getShell(); - - return null; - } - - - /** - * Returns a width hint for a button control. - */ - public static int getButtonWidthHint(Button button) { - if (button.getFont().equals(JFaceResources.getDefaultFont())) - button.setFont(JFaceResources.getDialogFont()); - PixelConverter converter= new PixelConverter(button); - int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); - return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); - } - - /** - * Returns a height hint for a button control. - */ - public static int getButtonHeigthHint(Button button) { - if (button.getFont().equals(JFaceResources.getDefaultFont())) - button.setFont(JFaceResources.getDialogFont()); - PixelConverter converter= new PixelConverter(button); - return converter.convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT); - } - - - /** - * Sets width and height hint for the button control. - * Note: This is a NOP if the button's layout data is not - * an instance of GridData. - * - * @param the button for which to set the dimension hint - */ - public static void setButtonDimensionHint(Button button) { - Assert.isNotNull(button); - Object gd= button.getLayoutData(); - if (gd instanceof GridData) { - ((GridData)gd).heightHint= getButtonHeigthHint(button); - ((GridData)gd).widthHint= getButtonWidthHint(button); - } - } - - public static int getTableHeightHint(Table table, int rows) { - if (table.getFont().equals(JFaceResources.getDefaultFont())) - table.setFont(JFaceResources.getDialogFont()); - int result= table.getItemHeight() * rows + table.getHeaderHeight(); - if (table.getLinesVisible()) - result+= table.getGridLineWidth() * (rows - 1); - return result; - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java deleted file mode 100644 index e788f300278..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; - -/** - * Provides utilities for checking the validity of selections. - *

            - * This class provides static methods only; it is not intended to be instantiated - * or subclassed. - *

            - */ - -public class SelectionUtil { - - /** - * Returns the first element of the given selection. - * Returns null if the selection is empty or if - * the given selection is not of type IStructuredSelection. - * - * @param selection the selection - * @return the selected elements - * - */ - public static Object getFirstElement (ISelection selection) { - if (!(selection instanceof IStructuredSelection)) { - return null; - } - return ((IStructuredSelection)selection).getFirstElement (); - } - - public static Object getSingleElement (ISelection s) { - if (!(s instanceof IStructuredSelection)) - return null; - IStructuredSelection selection= (IStructuredSelection)s; - if (selection.size () != 1) - return null; - return selection.getFirstElement (); - } - - /** - * Returns the elements of the given selection. - * Returns an empty array if the selection is empty or if - * the given selection is not of type IStructuredSelection. - * - * @param selection the selection - * @return the selected elements - * - */ - - public static Object[] toArray(ISelection selection) { - if (!(selection instanceof IStructuredSelection)) { - return new Object[0]; - } - return ((IStructuredSelection)selection).toArray(); - } - - public static List toList(ISelection selection) { - if (selection instanceof IStructuredSelection) { - return ((IStructuredSelection)selection).toList(); - } - return null; - } - - /** - * Returns whether the types of the resources in the given selection are among - * the specified resource types. - * - * @param selection the selection - * @param resourceMask resource mask formed by bitwise OR of resource type - * constants (defined on IResource) - * @return true if all selected elements are resources of the right - * type, and false if at least one element is either a resource - * of some other type or a non-resource - * @see IResource#getType - */ - public static boolean allResourcesAreOfType(IStructuredSelection selection, int resourceMask) { - Iterator resources = selection.iterator(); - while (resources.hasNext()) { - Object next = resources.next(); - if (!(next instanceof IResource)) - return false; - if (!resourceIsType((IResource)next, resourceMask)) - return false; - } - return true; - } - - /** - * Returns whether the type of the given resource is among the specified - * resource types. - * - * @param resource the resource - * @param resourceMask resource mask formed by bitwise OR of resource type - * constants (defined on IResource) - * @return true if the resources has a matching type, and - * false otherwise - * @see IResource#getType - */ - public static boolean resourceIsType(IResource resource, int resourceMask) { - return ((resource != null) && ((resource.getType() & resourceMask) != 0)); - } - - /* (non-Javadoc) - * Private constructor to block instantiation. - */ - private SelectionUtil(){ - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java deleted file mode 100644 index 6dfa5c748e8..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java +++ /dev/null @@ -1,390 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Vector; - -public class StringMatcher { - protected String fPattern; - protected int fLength; // pattern length - protected boolean fIgnoreWildCards; - protected boolean fIgnoreCase; - protected boolean fHasLeadingStar; - protected boolean fHasTrailingStar; - protected String fSegments[]; //the given pattern is split into * separated segments - - /* boundary value beyond which we don't need to search in the text */ - protected int fBound= 0; - - protected static final char fSingleWildCard= '\u0000'; - - public static class Position { - int start; //inclusive - int end; //exclusive - public Position(int start, int end) { - this.start= start; - this.end= end; - } - public int getStart() { - return start; - } - public int getEnd() { - return end; - } - } - - /** - * Find the first occurrence of the pattern between startend(exclusive). - * @param text, the String object to search in - * @param start, the starting index of the search range, inclusive - * @param end, the ending index of the search range, exclusive - * @return an StringMatcher.Position object that keeps the starting - * (inclusive) and ending positions (exclusive) of the first occurrence of the - * pattern in the specified range of the text; return null if not found or subtext - * is empty (start==end). A pair of zeros is returned if pattern is empty string - * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc" - * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned - */ - - public StringMatcher.Position find(String text, int start, int end) { - if (fPattern == null || text == null) - throw new IllegalArgumentException(); - - int tlen= text.length(); - if (start < 0) - start= 0; - if (end > tlen) - end= tlen; - if (end < 0 || start >= end) - return null; - if (fLength == 0) - return new Position(start, start); - if (fIgnoreWildCards) { - int x= posIn(text, start, end); - if (x < 0) - return null; - return new Position(x, x + fLength); - } - - int segCount= fSegments.length; - if (segCount == 0) //pattern contains only '*'(s) - return new Position(start, end); - - int curPos= start; - int matchStart= -1; - for (int i= 0; i < segCount && curPos < end; ++i) { - String current= fSegments[i]; - int nextMatch= regExpPosIn(text, curPos, end, current); - if (nextMatch < 0) - return null; - if (i == 0) - matchStart= nextMatch; - curPos= nextMatch + current.length(); - } - return new Position(matchStart, curPos); - } - /** - * StringMatcher constructor takes in a String object that is a simple - * pattern which may contain *  for 0 and many characters and - * ?  for exactly one character. Also takes as parameter a boolean object - * specifying if case should be ignored - * @deprecated Use StringMatcher(pattern, ignoreCase, ignoreWildCards). - */ - public StringMatcher(String aPattern, boolean ignoreCase) { - this(aPattern, ignoreCase, false); - } - /** - * StringMatcher constructor takes in a String object that is a simple - * pattern which may contain *  for 0 and many characters and - * ?  for exactly one character. - * - * Literal '*' and '?' characters must be escaped in the pattern - * e.g., "\*" means literal "*", etc. - * - * Escaping any other character (including the escape character itself), - * just results in that character in the pattern. - * e.g., "\a" means "a" and "\\" means "\" - * - * If invoking the StringMatcher with string literals in Java, don't forget - * escape characters are represented by "\\". - * - * @param aPattern the pattern to match text against - * @param ignoreCase if true, case is ignored - * @param ignoreWildCards if true, wild cards and their escape sequences are ignored - * (everything is taken literally). - */ - public StringMatcher(String aPattern, boolean ignoreCase, boolean ignoreWildCards) { - fIgnoreCase= ignoreCase; - fIgnoreWildCards= ignoreWildCards; - fLength= aPattern.length(); - - /* convert case */ - if (fIgnoreCase) { - fPattern= aPattern.toUpperCase(); - } else { - fPattern= aPattern; - } - - if (fIgnoreWildCards) { - parseNoWildCards(); - } else { - parseWildCards(); - } - } - /** - * Given the starting (inclusive) and the ending (exclusive) poisitions in the - * text, determine if the given substring matches with aPattern - * @return true if the specified portion of the text matches the pattern - * @param String text, a String object that contains the substring to match - * @param int start marks the starting position (inclusive) of the substring - * @param int end marks the ending index (exclusive) of the substring - */ - public boolean match(String text, int start, int end) { - if (null == fPattern || null == text) - throw new IllegalArgumentException(); - - if (start > end) - return false; - - if (fIgnoreWildCards) - return fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); - int segCount= fSegments.length; - if (segCount == 0) //pattern contains only '*'(s) or empty pattern - return true; - if (start == end) - return fLength == 0; - if (fLength == 0) - return start == end; - - int tlen= text.length(); - if (start < 0) - start= 0; - if (end > tlen) - end= tlen; - - int tCurPos= start; - int bound= end - fBound; - if (bound < 0) - return false; - int i= 0; - String current= fSegments[i]; - int segLength= current.length(); - - /* process first segment */ - if (!fHasLeadingStar) { - if (!regExpRegionMatches(text, start, current, 0, segLength)) { - return false; - } else { - ++i; - tCurPos= tCurPos + segLength; - } - } - - /* process middle segments */ - for (; i < segCount && tCurPos <= bound; ++i) { - current= fSegments[i]; - int currentMatch; - int k= current.indexOf(fSingleWildCard); - if (k < 0) { - currentMatch= textPosIn(text, tCurPos, end, current); - if (currentMatch < 0) - return false; - } else { - currentMatch= regExpPosIn(text, tCurPos, end, current); - if (currentMatch < 0) - return false; - } - tCurPos= currentMatch + current.length(); - } - - /* process final segment */ - if (!fHasTrailingStar && tCurPos != end) { - int clen= current.length(); - return regExpRegionMatches(text, end - clen, current, 0, clen); - } - return i == segCount; - } - /** - * match the given text with the pattern - * @return true if matched eitherwise false - * @param text, a String object - */ - public boolean match(String text) { - return match(text, 0, text.length()); - } - /** - * This method parses the given pattern into segments seperated by wildcard '*' characters. - * Since wildcards are not being used in this case, the pattern consists of a single segment. - */ - private void parseNoWildCards() { - fSegments= new String[1]; - fSegments[0]= fPattern; - fBound= fLength; - } - /** - * This method parses the given pattern into segments seperated by wildcard '*' characters. - * @param p, a String object that is a simple regular expression with *  and/or ?  - */ - private void parseWildCards() { - if (fPattern.startsWith("*")) //$NON-NLS-1$ - fHasLeadingStar= true; - if (fPattern.endsWith("*")) { //$NON-NLS-1$ - /* make sure it's not an escaped wildcard */ - if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') { - fHasTrailingStar= true; - } - } - - Vector temp= new Vector(); - - int pos= 0; - StringBuffer buf= new StringBuffer(); - while (pos < fLength) { - char c= fPattern.charAt(pos++); - switch (c) { - case '\\' : - if (pos >= fLength) { - buf.append(c); - } else { - char next= fPattern.charAt(pos++); - /* if it's an escape sequence */ - if (next == '*' || next == '?' || next == '\\') { - buf.append(next); - } else { - /* not an escape sequence, just insert literally */ - buf.append(c); - buf.append(next); - } - } - break; - case '*' : - if (buf.length() > 0) { - /* new segment */ - temp.addElement(buf.toString()); - fBound += buf.length(); - buf.setLength(0); - } - break; - case '?' : - /* append special character representing single match wildcard */ - buf.append(fSingleWildCard); - break; - default : - buf.append(c); - } - } - - /* add last buffer to segment list */ - if (buf.length() > 0) { - temp.addElement(buf.toString()); - fBound += buf.length(); - } - - fSegments= new String[temp.size()]; - temp.copyInto(fSegments); - } - /** - * @param text, a string which contains no wildcard - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int posIn(String text, int start, int end) { //no wild card in pattern - int max= end - fLength; - - if (!fIgnoreCase) { - int i= text.indexOf(fPattern, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i= start; i <= max; ++i) { - if (text.regionMatches(true, i, fPattern, 0, fLength)) - return i; - } - - return -1; - } - /** - * @param text, a simple regular expression that may only contain '?'(s) - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @param p, a simple regular expression that may contains '?' - * @param caseIgnored, wether the pattern is not casesensitive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int regExpPosIn(String text, int start, int end, String p) { - int plen= p.length(); - - int max= end - plen; - for (int i= start; i <= max; ++i) { - if (regExpRegionMatches(text, i, p, 0, plen)) - return i; - } - return -1; - } - /** - * - * @return boolean - * @param text, a String to match - * @param start, int that indicates the starting index of match, inclusive - * @param end int that indicates the ending index of match, exclusive - * @param p, String, String, a simple regular expression that may contain '?' - * @param ignoreCase, boolean indicating wether code>p is case sensitive - */ - protected boolean regExpRegionMatches(String text, int tStart, String p, int pStart, int plen) { - while (plen-- > 0) { - char tchar= text.charAt(tStart++); - char pchar= p.charAt(pStart++); - - /* process wild cards */ - if (!fIgnoreWildCards) { - /* skip single wild cards */ - if (pchar == fSingleWildCard) { - continue; - } - } - if (pchar == tchar) - continue; - if (fIgnoreCase) { - char tc= Character.toUpperCase(tchar); - if (tc == pchar) - continue; - } - return false; - } - return true; - } - /** - * @param text, the string to match - * @param start, the starting index in the text for search, inclusive - * @param end, the stopping point of search, exclusive - * @param code>p, a string that has no wildcard - * @param ignoreCase, boolean indicating wether code>p is case sensitive - * @return the starting index in the text of the pattern , or -1 if not found - */ - protected int textPosIn(String text, int start, int end, String p) { - - int plen= p.length(); - int max= end - plen; - - if (!fIgnoreCase) { - int i= text.indexOf(p, start); - if (i == -1 || i > max) - return -1; - return i; - } - - for (int i= 0; i <= max; ++i) { - if (text.regionMatches(true, i, p, 0, plen)) - return i; - } - - return -1; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/Strings.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/Strings.java deleted file mode 100644 index eccf9c8865f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/Strings.java +++ /dev/null @@ -1,375 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.util; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultLineTracker; -import org.eclipse.jface.text.ILineTracker; -import org.eclipse.jface.text.IRegion; - -/** - * Helper class to provide String manipulation functions not available in standard JDK. - */ -public class Strings { - - /** - * Indent char is a space char but not a line delimiters. - * == Character.isWhitespace(ch) && ch != '\n' && ch != '\r' - */ - public static boolean isIndentChar(char ch) { - return Character.isWhitespace(ch) && !isLineDelimiterChar(ch); - } - - /** - * tests if a char is lower case. Fix for 26529 - */ - public static boolean isLowerCase(char ch) { - return Character.toLowerCase(ch) == ch; - } - - /** - * Line delimiter chars are '\n' and '\r'. - */ - public static boolean isLineDelimiterChar(char ch) { - return ch == '\n' || ch == '\r'; - } - - public static String removeNewLine(String message) { - StringBuffer result= new StringBuffer(); - int current= 0; - int index= message.indexOf('\n', 0); - while (index != -1) { - result.append(message.substring(current, index)); - if (current < index && index != 0) - result.append(' '); - current= index + 1; - index= message.indexOf('\n', current); - } - result.append(message.substring(current)); - return result.toString(); - } - - /** - * Converts the given string into an array of lines. The lines - * don't contain any line delimiter characters. - * - * @return the string converted into an array of strings. Returns - * null if the input string can't be converted in an array of lines. - */ - public static String[] convertIntoLines(String input) { - try { - ILineTracker tracker= new DefaultLineTracker(); - tracker.set(input); - int size= tracker.getNumberOfLines(); - String result[]= new String[size]; - for (int i= 0; i < size; i++) { - IRegion region= tracker.getLineInformation(i); - int offset= region.getOffset(); - result[i]= input.substring(offset, offset + region.getLength()); - } - return result; - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns true if the given string only consists of - * white spaces according to Java. If the string is empty, true - * is returned. - * - * @return true if the string only consists of white - * spaces; otherwise false is returned - * - * @see java.lang.Character#isWhitespace(char) - */ - public static boolean containsOnlyWhitespaces(String s) { - int size= s.length(); - for (int i= 0; i < size; i++) { - if (!Character.isWhitespace(s.charAt(i))) - return false; - } - return true; - } - - /** - * Removes leading tabs and spaces from the given string. If the string - * doesn't contain any leading tabs or spaces then the string itself is - * returned. - */ - public static String trimLeadingTabsAndSpaces(String line) { - int size= line.length(); - int start= size; - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (!isIndentChar(c)) { - start= i; - break; - } - } - if (start == 0) - return line; - else if (start == size) - return ""; //$NON-NLS-1$ - else - return line.substring(start); - } - - public static String trimTrailingTabsAndSpaces(String line) { - int size= line.length(); - int end= size; - for (int i= size - 1; i >= 0; i--) { - char c= line.charAt(i); - if (isIndentChar(c)) { - end= i; - } else { - break; - } - } - if (end == size) - return line; - else if (end == 0) - return ""; //$NON-NLS-1$ - else - return line.substring(0, end); - } - - /** - * Returns the indent of the given string. - * - * @param line the text line - * @param tabWidth the width of the '\t' character. - */ - public static int computeIndent(String line, int tabWidth) { - int result= 0; - int blanks= 0; - int size= line.length(); - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (c == '\t') { - result++; - blanks= 0; - } else if (isIndentChar(c)) { - blanks++; - if (blanks == tabWidth) { - result++; - blanks= 0; - } - } else { - return result; - } - } - return result; - } - - /** - * Removes the given number of idents from the line. Asserts that the given line - * has the requested number of indents. If indentsToRemove <= 0 - * the line is returned. - */ - public static String trimIndent(String line, int indentsToRemove, int tabWidth) { - if (line == null || indentsToRemove <= 0) - return line; - - int start= 0; - int indents= 0; - int blanks= 0; - int size= line.length(); - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (c == '\t') { - indents++; - blanks= 0; - } else if (isIndentChar(c)) { - blanks++; - if (blanks == tabWidth) { - indents++; - blanks= 0; - } - } else { - // Assert.isTrue(false, "Line does not have requested number of indents"); //$NON-NLS-1$ - start= i + 1; - break; - } - if (indents == indentsToRemove) { - start= i + 1; - break; - } - } - if (start == size) - return ""; //$NON-NLS-1$ - else - return line.substring(start); - } - - /** - * Removes all leading indents from the given line. If the line doesn't contain - * any indents the line itself is returned. - */ - public static String trimIndents(String s, int tabWidth) { - int indent= computeIndent(s, tabWidth); - if (indent == 0) - return s; - return trimIndent(s, indent, tabWidth); - } - - /** - * Removes the common number of indents from all lines. If a line - * only consists out of white space it is ignored. - */ - public static void trimIndentation(String[] lines, int tabWidth) { - trimIndentation(lines, tabWidth, true); - } - - /** - * Removes the common number of indents from all lines. If a line - * only consists out of white space it is ignored. If - * considerFirstLine is false the first line will be ignored. - */ - public static void trimIndentation(String[] lines, int tabWidth, boolean considerFirstLine) { - String[] toDo= new String[lines.length]; - // find indentation common to all lines - int minIndent= Integer.MAX_VALUE; // very large - for (int i= considerFirstLine ? 0 : 1; i < lines.length; i++) { - String line= lines[i]; - if (containsOnlyWhitespaces(line)) - continue; - toDo[i]= line; - int indent= computeIndent(line, tabWidth); - if (indent < minIndent) { - minIndent= indent; - } - } - - if (minIndent > 0) { - // remove this indent from all lines - for (int i= considerFirstLine ? 0 : 1; i < toDo.length; i++) { - String s= toDo[i]; - if (s != null) - lines[i]= trimIndent(s, minIndent, tabWidth); - else { - String line= lines[i]; - int indent= computeIndent(line, tabWidth); - if (indent > minIndent) - lines[i]= trimIndent(line, minIndent, tabWidth); - else - lines[i]= trimLeadingTabsAndSpaces(line); - } - } - } - } - - public static String getIndentString(String line, int tabWidth) { - int size= line.length(); - int end= 0; - int blanks= 0; - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (c == '\t') { - end= i + 1; - blanks= 0; - } else if (isIndentChar(c)) { - blanks++; - if (blanks == tabWidth) { - end= i + 1; - blanks= 0; - } - } else { - break; - } - } - if (end == 0) - return ""; //$NON-NLS-1$ - else if (end == size) - return line; - else - return line.substring(0, end); - } - - public static String[] removeTrailingEmptyLines(String[] sourceLines) { - int lastNonEmpty= findLastNonEmptyLineIndex(sourceLines); - String[] result= new String[lastNonEmpty + 1]; - for (int i= 0; i < result.length; i++) { - result[i]= sourceLines[i]; - } - return result; - } - - private static int findLastNonEmptyLineIndex(String[] sourceLines) { - for (int i= sourceLines.length - 1; i >= 0; i--) { - if (! sourceLines[i].trim().equals(""))//$NON-NLS-1$ - return i; - } - return -1; - } - - /** - * Change the indent of, possible muti-line, code range. The current indent is removed, a new indent added. - * The first line of the code will not be changed. (It is considered to have no indent as it might start in - * the middle of a line) - */ - public static String changeIndent(String code, int codeIndentLevel, int tabWidth, String newIndent, String lineDelim) { - try { - ILineTracker tracker= new DefaultLineTracker(); - tracker.set(code); - int nLines= tracker.getNumberOfLines(); - if (nLines == 1) { - return code; - } - - StringBuffer buf= new StringBuffer(); - - for (int i= 0; i < nLines; i++) { - IRegion region= tracker.getLineInformation(i); - int start= region.getOffset(); - int end= start + region.getLength(); - String line= code.substring(start, end); - - if (i == 0) { // no indent for first line (contained in the formatted string) - buf.append(line); - } else { // no new line after last line - buf.append(lineDelim); - buf.append(newIndent); - buf.append(trimIndent(line, codeIndentLevel, tabWidth)); - } - } - return buf.toString(); - } catch (BadLocationException e) { - // can not happen - return code; - } - } - - /** - * Concatenate the given strings into one strings using the passed line delimiter as a - * delimiter. No delimiter is added to the last line. - */ - public static String concatenate(String[] lines, String delimiter) { - StringBuffer buffer= new StringBuffer(); - for (int i= 0; i < lines.length; i++) { - if (i > 0) - buffer.append(delimiter); - buffer.append(lines[i]); - } - return buffer.toString(); - } - - public static boolean equals(String s, char[] c) { - if (s.length() != c.length) - return false; - - for (int i = c.length; --i >= 0;) - if (s.charAt(i) != c[i]) - return false; - return true; - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java deleted file mode 100644 index 7d5cad85ae4..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.util; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ColumnLayoutData; -import org.eclipse.jface.viewers.ColumnPixelData; -import org.eclipse.jface.viewers.ColumnWeightData; - -/** - * A special composite to layout columns inside a table. The composite is needed since we have - * to layout the columns "before" the actual table gets layouted. Hence we can't use a normal - * layout manager. - */ -public class TableLayoutComposite extends Composite { - - private List columns= new ArrayList(); - - /** - * Creates a new TableLayoutComposite. - */ - public TableLayoutComposite(Composite parent, int style) { - super(parent, style); - addControlListener(new ControlAdapter() { - public void controlResized(ControlEvent e) { - Rectangle area= getClientArea(); - Table table= (Table)getChildren()[0]; - Point preferredSize= computeTableSize(table); - int width= area.width - 2 * table.getBorderWidth(); - if (preferredSize.y > area.height) { - // Subtract the scrollbar width from the total column width - // if a vertical scrollbar will be required - Point vBarSize = table.getVerticalBar().getSize(); - width -= vBarSize.x; - } - layoutTable(table, width, area, table.getSize().x < area.width); - } - }); - } - - /** - * Adds a new column of data to this table layout. - * - * @param data the column layout data - */ - public void addColumnData(ColumnLayoutData data) { - columns.add(data); - } - - //---- Helpers ------------------------------------------------------------------------------------- - - private Point computeTableSize(Table table) { - Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT); - - int width= 0; - int size= columns.size(); - for (int i= 0; i < size; ++i) { - ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i); - if (layoutData instanceof ColumnPixelData) { - ColumnPixelData col= (ColumnPixelData) layoutData; - width += col.width; - } else if (layoutData instanceof ColumnWeightData) { - ColumnWeightData col= (ColumnWeightData) layoutData; - width += col.minimumWidth; - } else { - Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$ - } - } - if (width > result.x) - result.x= width; - return result; - } - - private void layoutTable(Table table, int width, Rectangle area, boolean increase) { - // XXX: Layout is being called with an invalid value the first time - // it is being called on Linux. This method resets the - // Layout to null so we make sure we run it only when - // the value is OK. - if (width <= 1) - return; - - TableColumn[] tableColumns= table.getColumns(); - int size= Math.min(columns.size(), tableColumns.length); - int[] widths= new int[size]; - int fixedWidth= 0; - int numberOfWeightColumns= 0; - int totalWeight= 0; - - // First calc space occupied by fixed columns - for (int i= 0; i < size; i++) { - ColumnLayoutData col= (ColumnLayoutData) columns.get(i); - if (col instanceof ColumnPixelData) { - int pixels= ((ColumnPixelData) col).width; - widths[i]= pixels; - fixedWidth += pixels; - } else if (col instanceof ColumnWeightData) { - ColumnWeightData cw= (ColumnWeightData) col; - numberOfWeightColumns++; - // first time, use the weight specified by the column data, otherwise use the actual width as the weight - // int weight = firstTime ? cw.weight : tableColumns[i].getWidth(); - int weight= cw.weight; - totalWeight += weight; - } else { - Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$ - } - } - - // Do we have columns that have a weight - if (numberOfWeightColumns > 0) { - // Now distribute the rest to the columns with weight. - int rest= width - fixedWidth; - int totalDistributed= 0; - for (int i= 0; i < size; ++i) { - ColumnLayoutData col= (ColumnLayoutData) columns.get(i); - if (col instanceof ColumnWeightData) { - ColumnWeightData cw= (ColumnWeightData) col; - // calculate weight as above - // int weight = firstTime ? cw.weight : tableColumns[i].getWidth(); - int weight= cw.weight; - int pixels= totalWeight == 0 ? 0 : weight * rest / totalWeight; - if (pixels < cw.minimumWidth) - pixels= cw.minimumWidth; - totalDistributed += pixels; - widths[i]= pixels; - } - } - - // Distribute any remaining pixels to columns with weight. - int diff= rest - totalDistributed; - for (int i= 0; diff > 0; ++i) { - if (i == size) - i= 0; - ColumnLayoutData col= (ColumnLayoutData) columns.get(i); - if (col instanceof ColumnWeightData) { - ++widths[i]; - --diff; - } - } - } - - if (increase) { - table.setSize(area.width, area.height); - } - for (int i= 0; i < size; i++) { - tableColumns[i].setWidth(widths[i]); - } - if (!increase) { - table.setSize(area.width, area.height); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TwoArrayQuickSort.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TwoArrayQuickSort.java deleted file mode 100644 index 5ae29f2f8a1..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TwoArrayQuickSort.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.cdt.internal.ui.util; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.util.Assert; - - -/** - * Quick sort to sort two arrays in parallel. - */ -public class TwoArrayQuickSort { - - private static void internalSort(String[] keys, Object[] values, int left, int right, boolean ignoreCase) { - - int original_left= left; - int original_right= right; - - String mid= keys[(left + right) / 2]; - do { - while (smaller(keys[left], mid, ignoreCase)) { - left++; - } - while (smaller(mid, keys[right], ignoreCase)) { - right--; - } - if (left <= right) { - String tmp= keys[left]; - keys[left]= keys[right]; - keys[right]= tmp; - - Object tmp2= values[left]; - values[left]= values[right]; - values[right]= tmp2; - - left++; - right--; - } - } while (left <= right); - - if (original_left < right) { - internalSort(keys , values, original_left, right, ignoreCase); - } - if (left < original_right) { - internalSort(keys, values, left, original_right, ignoreCase); - } - } - private static boolean smaller(String left, String right, boolean ignoreCase) { - if (ignoreCase) - return left.compareToIgnoreCase(right) < 0; - else - return left.compareTo(right) < 0; - } - /** - * Sorts keys and values in parallel. - */ - public static void sort(String[] keys, Object[] values, boolean ignoreCase) { - if (keys != null && values != null) { - Assert.isTrue(keys.length == values.length); - if (keys.length > 1) - internalSort(keys, values, 0, keys.length - 1, ignoreCase); - } else { - if (keys != null || values != null) - Assert.isTrue(false, "Either keys or values in null"); //$NON-NLS-1$ - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilter.java deleted file mode 100644 index b92122dbd83..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilter.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.viewsupport; - -import org.eclipse.cdt.core.model.IDeclaration; -import org.eclipse.cdt.core.model.IField; -import org.eclipse.cdt.core.model.IMember; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; - - -/** - * Filter for the methods viewer. - * Changing a filter property does not trigger a refiltering of the viewer - */ - -public class MemberFilter extends ViewerFilter{ - - public static final int FILTER_NONPUBLIC= 1; - public static final int FILTER_STATIC= 2; - public static final int FILTER_FIELDS= 4; - - private int fFilterProperties; - - /** - * Modifies filter and add a property to filter for - */ - public final void addFilter(int filter) { - fFilterProperties |= filter; - } - /** - * Modifies filter and remove a property to filter for - */ - public final void removeFilter(int filter) { - fFilterProperties &= (-1 ^ filter); - } - /** - * Tests if a property is filtered - */ - public final boolean hasFilter(int filter) { - return (fFilterProperties & filter) != 0; - } - - /* - * @see ViewerFilter@isFilterProperty - */ - public boolean isFilterProperty(Object element, Object property) { - return false; - } - /* - * @see ViewerFilter@select - */ - public boolean select(Viewer viewer, Object parentElement, Object element) { - if(element instanceof IDeclaration){ - IDeclaration declaration = (IDeclaration) element; - if (hasFilter(FILTER_STATIC) && (declaration.isStatic()) ) { - return false; - } - if (element instanceof IMember) { - IMember member= (IMember)element; - if (hasFilter(FILTER_NONPUBLIC) && (member.getVisibility() != ASTAccessVisibility.PUBLIC)) { - return false; - } - - if (hasFilter(FILTER_FIELDS) && element instanceof IField) { - return false; - } - } - } - return true; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilterAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilterAction.java deleted file mode 100644 index 5291c560b14..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/MemberFilterAction.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.viewsupport; - -import org.eclipse.jface.action.Action; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.cdt.ui.actions.MemberFilterActionGroup;; - -/** - * Action used to enable / disable method filter properties - */ - -public class MemberFilterAction extends Action { - - private int fFilterProperty; - private MemberFilterActionGroup fFilterActionGroup; - - public MemberFilterAction(MemberFilterActionGroup actionGroup, String title, int property, String contextHelpId, boolean initValue) { - super(title); - fFilterActionGroup= actionGroup; - fFilterProperty= property; - - WorkbenchHelp.setHelp(this, contextHelpId); - - setChecked(initValue); - } - - /** - * Returns this action's filter property. - */ - public int getFilterProperty() { - return fFilterProperty; - } - - /* - * @see Action#actionPerformed - */ - public void run() { - fFilterActionGroup.setMemberFilter(fFilterProperty, isChecked()); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/IStatusChangeListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/IStatusChangeListener.java deleted file mode 100644 index 8f0f417e5e8..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/IStatusChangeListener.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards; - -import org.eclipse.core.runtime.IStatus; - -public interface IStatusChangeListener { - - /** - * Notifies this listener that the given status has changed. - * - * @param status the new status - */ - void statusChanged(IStatus status); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.java deleted file mode 100644 index 23916c92190..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards; - - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - - -public class NewWizardMessages { - - private static final String RESOURCE_BUNDLE= NewWizardMessages.class.getName(); - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); - - private NewWizardMessages() { - } - - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - /** - * Gets a string from the resource bundle and formats it with the argument - * - * @param key the string used to get the bundle value, must not be null - */ - public static String getFormattedString(String key, Object arg) { - return MessageFormat.format(getString(key), new Object[] { arg }); - } - - /** - * Gets a string from the resource bundle and formats it with arguments - */ - public static String getFormattedString(String key, Object[] args) { - return MessageFormat.format(getString(key), args); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.properties deleted file mode 100644 index ad39e78b7a7..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/NewWizardMessages.properties +++ /dev/null @@ -1,595 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -# ------- AbstractOpenWizardAction ------- - -AbstractOpenWizardAction.noproject.title=New -AbstractOpenWizardAction.noproject.message=A project needs to be created first.\nOpen the 'New Project' wizard'? - -AbstractOpenWizardAction.createerror.title=Open Wizard -AbstractOpenWizardAction.createerror.message=The wizard could not be opened. See log for details. - -# ------- NewElementWizard ------- - -NewElementWizard.op_error.title=New -NewElementWizard.op_error.message=Creation of element failed. - -NewElementWizard.typecomment.deprecated.title=Type Creation -NewElementWizard.typecomment.deprecated.message=You can configure the default layout of newly created files and types on the 'code generation' preference page. This was previously implemented on the template page in the templates 'filecomment' and 'typecomment'. -# ------- NewContainerWizardPage ------- - -NewContainerWizardPage.container.label=Source Fol&der: -NewContainerWizardPage.container.button=Br&owse... - -NewContainerWizardPage.error.EnterContainerName=Folder name is empty. -NewContainerWizardPage.error.ContainerIsBinary=''{0}'' is a JAR archive. -NewContainerWizardPage.error.ContainerDoesNotExist=Folder ''{0}'' does not exist. -NewContainerWizardPage.error.NotAFolder=''{0}'' must be a project or folder. -NewContainerWizardPage.error.ProjectClosed=Project ''{0}'' must be accessible. - -NewContainerWizardPage.warning.NotAJavaProject=Folder is not a Java project. -NewContainerWizardPage.warning.NotInAJavaProject=Folder is not in a Java project. -NewContainerWizardPage.warning.NotOnClassPath=Folder is not on the Java build class path. - -NewContainerWizardPage.ChooseSourceContainerDialog.title=Folder Selection -NewContainerWizardPage.ChooseSourceContainerDialog.description=&Choose a folder: - -# ------- NewPackageWizardPage ------- - -NewPackageCreationWizard.title=New Java Package - -NewPackageWizardPage.package.label=&Name: - - -NewPackageWizardPage.error.InvalidPackageName=Invalid package name. {0} -NewPackageWizardPage.error.IsOutputFolder=Name conflict with output folder. - -NewPackageWizardPage.error.PackageExists=Package already exists. -NewPackageWizardPage.error.EnterName=Enter a package name. -NewPackageWizardPage.warning.PackageNotShown=Package already exists. Note: Views might filter empty parent packages. -NewPackageWizardPage.warning.DiscouragedPackageName=Discouraged package name. {0} - -NewPackageWizardPage.title=Java Package -NewPackageWizardPage.description=Create a Java package. -NewPackageWizardPage.info=Creates folders corresponding to packages. -# ------- NewTypeWizardPage ------- - -NewTypeWizardPage.package.label=Pac&kage: -NewTypeWizardPage.package.button=Bro&wse... - -NewTypeWizardPage.enclosing.selection.label=Enclosing t&ype: -NewTypeWizardPage.enclosing.button=Bro&wse... - -NewTypeWizardPage.error.InvalidPackageName=Package name is not valid. {0} -NewTypeWizardPage.error.ClashOutputLocation=Package clashes with project output folder. -NewTypeWizardPage.warning.DiscouragedPackageName=This package name is discouraged. {0} - -NewTypeWizardPage.default=(default) - -NewTypeWizardPage.ChoosePackageDialog.title=Package Selection -NewTypeWizardPage.ChoosePackageDialog.description=&Choose a folder: -NewTypeWizardPage.ChoosePackageDialog.empty=Cannot find packages to select. - -NewTypeWizardPage.ChooseEnclosingTypeDialog.title=Enclosing Type Selection -NewTypeWizardPage.ChooseEnclosingTypeDialog.description=&Choose a type to which the new class will be added: - -NewTypeWizardPage.error.EnclosingTypeEnterName=Name of enclosing type must be entered. -NewTypeWizardPage.error.EnclosingTypeNotExists=Enclosing type does not exist. -NewTypeWizardPage.error.EnclosingNotInCU=Enclosing type is binary. -NewTypeWizardPage.error.EnclosingNotEditable=Enclosing type is not editable. -NewTypeWizardPage.warning.EnclosingNotInSourceFolder=Enclosing type is not in specified source folder. - -NewTypeWizardPage.typename.label=Na&me: - -NewTypeWizardPage.superclass.label=&Superclass: -NewTypeWizardPage.superclass.button=Brows&e... - -NewTypeWizardPage.interfaces.class.label=&Interfaces: -NewTypeWizardPage.interfaces.ifc.label=Extended &interfaces: -NewTypeWizardPage.interfaces.add=&Add... -NewTypeWizardPage.interfaces.remove=&Remove - -NewTypeWizardPage.modifiers.acc.label=Modifiers: -NewTypeWizardPage.modifiers.public=&public -NewTypeWizardPage.modifiers.private=pri&vate -NewTypeWizardPage.modifiers.protected=pro&tected -NewTypeWizardPage.modifiers.default=defa&ult -NewTypeWizardPage.modifiers.abstract=abs&tract -NewTypeWizardPage.modifiers.final=fina&l -NewTypeWizardPage.modifiers.static=stati&c - -NewTypeWizardPage.error.EnterTypeName=Type name is empty. -NewTypeWizardPage.error.TypeNameExists=Type already exists. -NewTypeWizardPage.error.InvalidTypeName=Type name is not valid. {0} -NewTypeWizardPage.error.QualifiedName=Type name must not be qualified. -NewTypeWizardPage.warning.TypeNameDiscouraged=Type name is discouraged. {0} - -NewTypeWizardPage.error.InvalidSuperClassName=Superclass name is not valid. -NewTypeWizardPage.warning.SuperClassNotExists=Warning: Superclass does not exist in current project. -NewTypeWizardPage.warning.SuperClassIsFinal=Warning: Superclass ''{0}'' is final. -NewTypeWizardPage.warning.SuperClassIsNotVisible=Warning: Superclass ''{0}'' is not visible. -NewTypeWizardPage.warning.SuperClassIsNotClass=Warning: Superclass ''{0}'' is an interface. - -NewTypeWizardPage.warning.InterfaceIsNotVisible=Extended interface ''{0}'' is not visible. -NewTypeWizardPage.warning.InterfaceNotExists=Extended interface ''{0}'' does not exist in current project. -NewTypeWizardPage.warning.InterfaceIsNotInterface=Extended interface ''{0}'' is not an interface. - -NewTypeWizardPage.error.ModifiersFinalAndAbstract=Class cannot be both final and abstract - -NewTypeWizardPage.SuperClassDialog.title=Superclass Selection -NewTypeWizardPage.SuperClassDialog.message=&Choose a type: - -NewTypeWizardPage.InterfacesDialog.class.title= Implemented Interfaces Selection -NewTypeWizardPage.InterfacesDialog.interface.title= Extended Interfaces Selection -NewTypeWizardPage.InterfacesDialog.message=&Choose interfaces: - -NewTypeWizardPage.operationdesc=Creating type.... - -# -----------NewClassWizardPage ------------- -NewClassWizardPage.classname.label=&Name: - -NewClassWizardPage.baseclass.label=&Base class: -NewClassWizardPage.baseclass.button=Brows&e... -NewClassWizardPage.baseclass.access.public=&public -NewClassWizardPage.baseclass.access.protected=pro&tected -NewClassWizardPage.baseclass.access.private=pri&vate -NewClassWizardPage.baseclass.access.access=&default -NewClassWizardPage.baseclass.access.label=Access: - -NewClassWizardPage.constdest.virtualdestructor=&Virtual Destructor -NewClassWizardPage.constdest.inline=&Inline -NewClassWizardPage.constdest.includeguard=Include &Guard - -NewClassWizardPage.files.header=Header File: -NewClassWizardPage.files.body=Body File: -NewClassWizardPage.files.linkFileButton=Link to file - -NewClassWizardPage.error.EnterClassName=Class name is empty. -NewClassWizardPage.error.ClassNameExists=Class already exists. -NewClassWizardPage.error.InvalidClassName=Class name is not valid. {0} -NewClassWizardPage.error.QualifiedName=Class name must not be qualified. -NewClassWizardPage.warning.ClassNameDiscouraged=Class name is discouraged. {0} - -NewClassWizardPage.error.InvalidBaseClassName=Base class name is not valid. -NewClassWizardPage.warning.BaseClassNotExists=Warning: Base class does not exist in current project. - -NewClassWizardPage.operations.getProjectClasses=Looking for classes in project - -NewClassWizardPage.error.NotAvailableForNonCppProjects= The wizard is not available for non C++ projects. -# ------- BaseClassSelectionDialog ----- - -BaseClassSelectionDialog.title=Classes in this project -BaseClassSelectionDialog.message=Select a base class: - -# ------- NewClassWizardPage ------- - -NewClassCreationWizard.title=New Java Class - -NewClassWizardPage.title=Java Class -NewClassWizardPage.description=Create a new Java class. - -NewClassWizardPage.methods.label=Which method stubs would you like to create? -NewClassWizardPage.methods.main=public static void main(Strin&g[] args) -NewClassWizardPage.methods.constructors=&Constructors from superclass -NewClassWizardPage.methods.inherited=In&herited abstract methods - - -# ------- NewInterfaceWizardPage ------- - -NewInterfaceCreationWizard.title=New Java Interface - -NewInterfaceWizardPage.title=Java Interface -NewInterfaceWizardPage.description=Create a new Java interface. - -# ------- JavaCapabilityWizard ------- - -JavaCapabilityWizard.title=Configure Java Capability -JavaCapabilityWizard.op_error.title=Error Configure Java Capability -JavaCapabilityWizard.op_error.message=An error occurred while configuring the Java project - -# ------- JavaCapabilityConfigurationPage ------- - -JavaCapabilityConfigurationPage.title=Java Settings -JavaCapabilityConfigurationPage.description=Define the Java build settings. -JavaCapabilityConfigurationPage.op_desc_java=Configuring Java project... - - -# ------- NewProjectCreationWizard ------- - -NewProjectCreationWizard.title=New Java Project -NewProjectCreationWizard.op_error.title=Error Creating Java Project -NewProjectCreationWizard.op_error_create.message=An error occurred while creating the Java project -NewProjectCreationWizard.MainPage.title=Java Project -NewProjectCreationWizard.MainPage.description=Create a new Java project. - -NewProjectCreationWizardPage.op_error.title=Error Creating Java Project -NewProjectCreationWizardPage.op_error_remove.message=An error occurred while removing a temporary project -NewProjectCreationWizardPage.EarlyCreationOperation.desc=Creating project and examining existing resources... -NewProjectCreationWizardPage.EarlyCreationOperation.error.title=New Java Project -NewProjectCreationWizardPage.EarlyCreationOperation.error.desc=An error occurred while creating project. Check log for details. -NewProjectCreationWizardPage.createproject.desc=Creating project... -NewProjectCreationWizardPage.removeproject.desc=Removing project... - -# ------- NewJavaProjectWizardPage------- - -NewJavaProjectWizardPage.title=Java Settings -NewJavaProjectWizardPage.description=Define the Java build settings. - -NewJavaProjectWizardPage.op_desc=Creating Java project... - - -# ------- NewSourceFolderWizardPage------- - -NewSourceFolderCreationWizard.title=New Source Folder - -NewSourceFolderWizardPage.title=Source folder -NewSourceFolderWizardPage.description=Add a new source folder - -NewSourceFolderWizardPage.root.label=Fol&der name: -NewSourceFolderWizardPage.root.button=Br&owse... - -NewSourceFolderWizardPage.project.label=Project &name: -NewSourceFolderWizardPage.project.button=Bro&wse... - -NewSourceFolderWizardPage.exclude.label=&Update exclusion filters in other source folders to solve nesting. - -NewSourceFolderWizardPage.ChooseExistingRootDialog.title=Existing Folder Selection -NewSourceFolderWizardPage.ChooseExistingRootDialog.description=&Choose folder as source folder: - -NewSourceFolderWizardPage.ChooseProjectDialog.title=Project Selection -NewSourceFolderWizardPage.ChooseProjectDialog.description=&Choose project for the new source folder: - -NewSourceFolderWizardPage.error.EnterRootName=Root name must be entered. -NewSourceFolderWizardPage.error.InvalidRootName=Invalid folder name. {0} -NewSourceFolderWizardPage.error.NotAFolder=Not a folder. -NewSourceFolderWizardPage.error.AlreadyExisting=Already a source folder. - -NewSourceFolderWizardPage.error.EnterProjectName=Project name must be entered. -NewSourceFolderWizardPage.error.InvalidProjectPath=Invalid project path. -NewSourceFolderWizardPage.error.NotAJavaProject=Project is not a Java project. -NewSourceFolderWizardPage.error.ProjectNotExists=Project does not exist. - -NewSourceFolderWizardPage.warning.ReplaceSFandOL=To avoid overlapping, the existing project source folder entry will be replaced and the output folder set to ''{0}''. -NewSourceFolderWizardPage.warning.ReplaceOL=An exclusion pattern will be added to the project source folder entry and the output folder will be set to ''{0}''. -NewSourceFolderWizardPage.warning.ReplaceSF=To avoid overlapping, the existing project source folder entry will be replaced. -NewSourceFolderWizardPage.warning.AddedExclusions=Exclusion patterns of {0} source folder(s) updated to solve nesting. - -# ------- NewSnippetFileWizardPage------- - -NewSnippetFileCreationWizard.title=New Scrapbook Page - -NewSnippetFileWizardPage.title=Create Java Scrapbook Page - -NewSnippetFileWizardPage.error.AlreadyExists=A resource with the specified path already exists. -NewSnippetFileWizardPage.error.OnlyInJavaProject=The scrapbook page can only be created in a Java project. - -NewSnippetFileWizardPage.open_error.message=Error in NewScrapbookPage - -# ------- BuildPathsBlock ------- - -BuildPathsBlock.tab.source=&Source -BuildPathsBlock.tab.projects=&Projects -BuildPathsBlock.tab.libraries=&Libraries -BuildPathsBlock.tab.order=&Order and Export - -BuildPathsBlock.classpath.label=Build &class path order and exported entries:\n(Exported entries are contributed to dependent projects) - -BuildPathsBlock.classpath.up.button=&Up -BuildPathsBlock.classpath.down.button=&Down -BuildPathsBlock.classpath.checkall.button=Select &All -BuildPathsBlock.classpath.uncheckall.button=D&eselect All - -BuildPathsBlock.buildpath.label=Defaul&t output folder: -BuildPathsBlock.buildpath.button=Bro&wse... - -BuildPathsBlock.error.InvalidBuildPath=Invalid build output folder: ''{0}'' -BuildPathsBlock.error.EnterBuildPath=Build output folder must be entered. - -BuildPathsBlock.warning.EntryMissing=Build path entry is missing: {0} -BuildPathsBlock.warning.EntriesMissing={0} build path entries are missing. - -BuildPathsBlock.operationdesc_project=Creating project... -BuildPathsBlock.operationdesc_java=Setting build paths... - -BuildPathsBlock.ChooseOutputFolderDialog.title=Folder Selection -BuildPathsBlock.ChooseOutputFolderDialog.description=&Choose the folder for the build output: - -BuildPathsBlock.RemoveBinariesDialog.title=Setting Build Paths -BuildPathsBlock.RemoveBinariesDialog.description=The output folder has changed. OK to remove all generated resources from the old location ''{0}''? - -# ------- CPListLabelProvider ------- - -CPListLabelProvider.new=(new) -CPListLabelProvider.classcontainer=(class folder) -CPListLabelProvider.twopart={0} - {1} -CPListLabelProvider.willbecreated=(will be created) - - -# ------- SourceContainerWorkbookPage------- - -SourceContainerWorkbookPage.folders.label=Source folders on build pat&h: -SourceContainerWorkbookPage.folders.remove.button=&Remove -SourceContainerWorkbookPage.folders.add.button=&Add Folder... -SourceContainerWorkbookPage.folders.edit.button=&Edit... - -SourceContainerWorkbookPage.folders.check=Allow output folders for sour&ce folders. - -SourceContainerWorkbookPage.ExistingSourceFolderDialog.new.title=Source Folder Selection -SourceContainerWorkbookPage.ExistingSourceFolderDialog.new.description=&Choose source folders to be added to the build path: - -SourceContainerWorkbookPage.ExistingSourceFolderDialog.edit.title=Source Folder Selection -SourceContainerWorkbookPage.ExistingSourceFolderDialog.edit.description=&Select the source folder: - -SourceContainerWorkbookPage.NewSourceFolderDialog.new.title=New Source Folder -SourceContainerWorkbookPage.NewSourceFolderDialog.edit.title=Edit Source Folder - -SourceContainerWorkbookPage.NewSourceFolderDialog.description=&Enter a path relative to ''{0}'': - -SourceContainerWorkbookPage.ChangeOutputLocationDialog.title=Source Folder Added -SourceContainerWorkbookPage.ChangeOutputLocationDialog.project_and_output.message=Do you want to remove the project as source folder and update build output folder to ''{0}''? -SourceContainerWorkbookPage.ChangeOutputLocationDialog.project.message=Do you want to remove the project as source folder? - -SourceContainerWorkbookPage.exclusion_added.title=Source Folder Added -SourceContainerWorkbookPage.exclusion_added.message=Exclusion filters have been added to nesting folders. - -# ------- ProjectsWorkbookPage------- - -ProjectsWorkbookPage.projects.label=&Required projects on the build path: -ProjectsWorkbookPage.projects.checkall.button=Select &All -ProjectsWorkbookPage.projects.uncheckall.button=&Deselect All - -# ------- LibrariesWorkbookPage------- - -LibrariesWorkbookPage.libraries.label=JARs &and class folders on the build path: -LibrariesWorkbookPage.libraries.remove.button=&Remove - -LibrariesWorkbookPage.libraries.addjar.button=Add &JARs... -LibrariesWorkbookPage.libraries.addextjar.button=Add E&xternal JARs... -LibrariesWorkbookPage.libraries.addvariable.button=Add &Variable... -LibrariesWorkbookPage.libraries.addlibrary.button=Add Li&brary... -LibrariesWorkbookPage.libraries.addclassfolder.button=Add Class &Folder... - - -LibrariesWorkbookPage.libraries.edit.button=&Edit... - -LibrariesWorkbookPage.ExistingClassFolderDialog.new.title=Class Folder Selection -LibrariesWorkbookPage.ExistingClassFolderDialog.new.description=&Choose class folders to be added to the build path: - -LibrariesWorkbookPage.ExistingClassFolderDialog.edit.title=Edit Class Folder -LibrariesWorkbookPage.ExistingClassFolderDialog.edit.description=&Select the class folder: - -LibrariesWorkbookPage.NewClassFolderDialog.new.title=New Class Folder -LibrariesWorkbookPage.NewClassFolderDialog.edit.title=Edit Class Folder - -LibrariesWorkbookPage.NewClassFolderDialog.description=&Enter a path relative to ''{0}'': - -LibrariesWorkbookPage.JARArchiveDialog.new.title=JAR Selection -LibrariesWorkbookPage.JARArchiveDialog.new.description=&Choose jar archives to be added to the build path: - -LibrariesWorkbookPage.JARArchiveDialog.edit.title=Edit JAR -LibrariesWorkbookPage.JARArchiveDialog.edit.description=&Select the jar archive: - -LibrariesWorkbookPage.ContainerDialog.new.title=Add Library -LibrariesWorkbookPage.ContainerDialog.edit.title=Edit Library - -LibrariesWorkbookPage.VariableSelectionDialog.new.title=New Variable Classpath Entry -LibrariesWorkbookPage.VariableSelectionDialog.edit.title=Edit Variable Entry - -LibrariesWorkbookPage.ExtJARArchiveDialog.new.title=JAR Selection - -LibrariesWorkbookPage.ExtJARArchiveDialog.edit.title=Edit JAR - -LibrariesWorkbookPage.SourceAttachmentDialog.title=Source For ''{0}'' -LibrariesWorkbookPage.JavadocPropertyDialog.title=Javadoc For ''{0}'' - -LibrariesWorkbookPage.AdvancedDialog.title=Add Classpath Entry -LibrariesWorkbookPage.AdvancedDialog.description=Select the entry to add to the classpath: -LibrariesWorkbookPage.AdvancedDialog.createfolder=Create &New Class Folder -LibrariesWorkbookPage.AdvancedDialog.addfolder=Add &Existing Class Folder -LibrariesWorkbookPage.AdvancedDialog.addcontainer=Add &Container: - -# ------- NewContainerDialog------- - -NewContainerDialog.error.invalidpath=Invalid folder path: ''{0}'' -NewContainerDialog.error.enterpath=Folder name must be entered -NewContainerDialog.error.pathexists=This folder is already in the list or it is an output folder. -# ------- NewSourceFolderDialog------- - -NewSourceFolderDialog.error.invalidpath=Invalid folder path: ''{0}'' -NewSourceFolderDialog.error.enterpath=Folder name must be entered. -NewSourceFolderDialog.error.pathexists=The folder is already in the list. - -# ------- SourceAttachmentBlock------- - -SourceAttachmentBlock.message=Select the location (folder, JAR or zip) containing the source for ''{0}'': -SourceAttachmentBlock.filename.description=Source attachments for variable entries are defined by variable paths. The first segment of such a path describes a variable name, the rest is an optional path extension. - -SourceAttachmentBlock.filename.label=Lo&cation path: -SourceAttachmentBlock.filename.externalfile.button=External &File... -SourceAttachmentBlock.filename.externalfolder.button=External F&older... -SourceAttachmentBlock.filename.internal.button=&Workspace... - -SourceAttachmentBlock.filename.varlabel=Lo&cation variable path: -SourceAttachmentBlock.filename.variable.button=&Variable... -SourceAttachmentBlock.filename.external.varbutton=&Extension.... - -SourceAttachmentBlock.filename.error.notvalid=The archive path is not a valid path. -SourceAttachmentBlock.filename.error.filenotexists=The path ''{0}'' does not exist. -SourceAttachmentBlock.filename.error.varnotexists=Variable in the location path does not exist. -SourceAttachmentBlock.filename.error.deviceinpath=Location must be described a variable path. -SourceAttachmentBlock.filename.warning.varempty=Location variable path is empty. - -SourceAttachmentBlock.intjardialog.title=Source Location Selection -SourceAttachmentBlock.intjardialog.message=&Select folder or JAR/zip archive containing the source: - -SourceAttachmentBlock.extvardialog.title=Variable Extension Selection -SourceAttachmentBlock.extvardialog.description=Select source location: - -SourceAttachmentBlock.extjardialog.text=JAR/ZIP File Selection -SourceAttachmentBlock.extfolderdialog.text=Folder Selection - -SourceAttachmentBlock.putoncpdialog.title=Setting Source Attachment -SourceAttachmentBlock.putoncpdialog.message=Source can only be attached to libraries on the build path.\nDo you want to add the library to the build path? - -SourceAttachmentDialog.title=Source Attachment Configuration -SourceAttachmentDialog.error.title=Error Attaching Source -SourceAttachmentDialog.error.message=An error occurred while associating the source. - -# ------- EditVariableEntryDialog ------- - -EditVariableEntryDialog.filename.varlabel=Edit classpath variable entry: -EditVariableEntryDialog.filename.variable.button=&Variable... -EditVariableEntryDialog.filename.external.varbutton=&Extension.... - -EditVariableEntryDialog.extvardialog.title=Variable Extension Selection -EditVariableEntryDialog.extvardialog.description=Select JAR archive: - -EditVariableEntryDialog.filename.error.notvalid=The archive path is not a valid path. -EditVariableEntryDialog.filename.error.filenotexists=The path ''{0}'' does not point to an existing archive. -EditVariableEntryDialog.filename.error.varnotexists=Variable in the archive path does not exist. -EditVariableEntryDialog.filename.error.deviceinpath=The archive has to be described by a variable path. -EditVariableEntryDialog.filename.warning.varempty=Archive variable path is empty. -EditVariableEntryDialog.filename.error.alreadyexists=Classpath entry already exists. - - -# ------- VariableBlock------- - -VariableBlock.vars.label=Defined &classpath variables: -VariableBlock.vars.add.button=Ne&w... -VariableBlock.vars.edit.button=&Edit... -VariableBlock.vars.remove.button=&Remove -VariableBlock.operation_desc=Setting classpath variables... - -VariableBlock.operation_errror.title=Classpath Variables -VariableBlock.operation_errror.message=Problem while setting classpath variable. See log for details. - -VariableBlock.needsbuild.title=Classpath Variables Changed -VariableBlock.needsbuild.message=The classpath variables have changed. A full rebuild is recommended to make changes effective. Do the full build now? - -VariablePathDialogField.variabledialog.title=Variable Selection - -CPVariableElementLabelProvider.reserved=(reserved) -CPVariableElementLabelProvider.empty=(empty) - -# ------- VariableCreationDialog------- - -VariableCreationDialog.titlenew=New Variable Entry -VariableCreationDialog.titleedit=Edit Variable Entry - -VariableCreationDialog.name.label=&Name: -VariableCreationDialog.path.label=&Path: -VariableCreationDialog.path.file.button=&File... -VariableCreationDialog.path.dir.button=F&older... - -VariableCreationDialog.error.entername=Variable name must be entered. -VariableCreationDialog.error.invalidname=Invalid name: ''{0}''. -VariableCreationDialog.error.nameexists=Variable name already exists. -VariableCreationDialog.error.invalidpath=The path is invalid. - -VariableCreationDialog.warning.pathnotexists=Path does not exist. - - -VariableCreationDialog.extjardialog.text=JAR Selection -VariableCreationDialog.extdirdialog.text=Folder Selection -VariableCreationDialog.extdirdialog.message=&Specify folder to be represented by the variable: - -# ------- NewVariableEntryDialog ------- -NewVariableEntryDialog.vars.extend=E&xtend... -NewVariableEntryDialog.vars.config=&Edit... - -NewVariableEntryDialog.vars.label=Select &variables to add to build path: - -NewVariableEntryDialog.ExtensionDialog.title=Variable Extension -NewVariableEntryDialog.ExtensionDialog.description=Choose extensions to ''{0}''. - -NewVariableEntryDialog.info.isfolder=Variable points to a folder: Click 'extend' to choose an archive inside the folder. -NewVariableEntryDialog.info.noselection=Select variable(s) to add to the classpath. -NewVariableEntryDialog.info.selected={0} variables selected. - -# ------- OutputLocationDialog ------- - -OutputLocationDialog.title=Source Folder Output Location - -OutputLocationDialog.usedefault.label=Project's default output folder. -OutputLocationDialog.usespecific.label=Specific output folder (path relative to ''{0}''). -OutputLocationDialog.location.button=Bro&wse... - -OutputLocationDialog.error.existingisfile=Location is an existing file -OutputLocationDialog.error.invalidpath=Invalid path: {0} - -OutputLocationDialog.ChooseOutputFolder.title=Folder Selection -OutputLocationDialog.ChooseOutputFolder.description=&Choose the folder for the build output: - -# ------- ExclusionPatternDialog ------- - -ExclusionPatternDialog.title=Source Folder Exclusion Patterns - -ExclusionPatternDialog.pattern.label=E&xclusion patterns for ''{0}'': -ExclusionPatternDialog.pattern.add=A&dd... -ExclusionPatternDialog.pattern.add.multiple=Add &Multiple... -ExclusionPatternDialog.pattern.remove=&Remove -ExclusionPatternDialog.pattern.edit=&Edit... - -ExclusionPatternDialog.ChooseExclusionPattern.title=Exclusion Pattern Selection -ExclusionPatternDialog.ChooseExclusionPattern.description=&Choose folders or files to exclude: - -# ------- ExclusionPatternEntryDialog ------- - -ExclusionPatternEntryDialog.add.title=Add Exclusion Pattern -ExclusionPatternEntryDialog.edit.title=Edit Exclusion Pattern -ExclusionPatternEntryDialog.description=Enter a pattern for excluding files from the source folder. Allowed wildcards are '*', '?' and '**'. Examples: 'java/util/A*.java', 'java/util/', '**/Test*'. - -ExclusionPatternEntryDialog.pattern.label=E&xclusion pattern (Path relative to ''{0}''): -ExclusionPatternEntryDialog.pattern.button=Bro&wse... - -ExclusionPatternEntryDialog.error.empty=Enter a pattern. -ExclusionPatternEntryDialog.error.notrelative=Pattern must be a relative path. -ExclusionPatternEntryDialog.error.exists=Pattern already exists. - -ExclusionPatternEntryDialog.ChooseExclusionPattern.title=Exclusion Pattern Selection -ExclusionPatternEntryDialog.ChooseExclusionPattern.description=&Choose a folder or file to exclude: - -# ------- ClasspathContainerDefaultPage------- - -ClasspathContainerDefaultPage.title=Classpath Container -ClasspathContainerDefaultPage.description=Select classpath container path. First segment is the container type. - -ClasspathContainerDefaultPage.path.label=&Classpath container path: - -ClasspathContainerDefaultPage.path.error.enterpath=Enter path. -ClasspathContainerDefaultPage.path.error.invalidpath=Invalid path. -ClasspathContainerDefaultPage.path.error.needssegment=Path needs at least one segment. -ClasspathContainerDefaultPage.path.error.alreadyexists=Entry already exists. - -# ------- ClasspathContainerSelectionPage------- - -ClasspathContainerSelectionPage.title=Add Library -ClasspathContainerSelectionPage.description=Select the library type to add. - -# ------- ClasspathContainerWizard------- - -ClasspathContainerWizard.pagecreationerror.title= Library Wizard -ClasspathContainerWizard.pagecreationerror.message=Wizard page creation failed. Check log for details. - - -FolderSelectionDialog.button=Create New Folder... -CPListLabelProvider.none=(None) -CPListLabelProvider.source_attachment.label=Source attachment: -CPListLabelProvider.source_attachment_root.label=Source attachment root: -CPListLabelProvider.javadoc_location.label=Javadoc location: -CPListLabelProvider.output_folder.label=Output folder: -CPListLabelProvider.default_output_folder.label=(Default output folder) -CPListLabelProvider.exclusion_filter.label=Exclusion filter: -CPListLabelProvider.exclusion_filter_separator=; -CPListLabelProvider.unknown_element.label=unknown element -NewSourceFolderDialog.useproject.button=&Project as source folder -NewSourceFolderDialog.usefolder.button=&Folder as source folder -NewSourceFolderDialog.sourcefolder.label=&Source folder name: diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java deleted file mode 100644 index 5b80966105a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFileWizardAction.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.WizardDialog; - -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard; - -import org.eclipse.cdt.ui.CUIPlugin; - -public class OpenNewFileWizardAction extends Action implements IWorkbenchWindowActionDelegate { - - - public void run() { - BasicNewFileResourceWizard wizard= new BasicNewFileResourceWizard(); - wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection()); - wizard.setNeedsProgressMonitor(true); - WizardDialog dialog= - new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard); - dialog.create(); - dialog.getShell().setText( - CUIPlugin.getResourceString("OpenNewFileWizardAction.title")); //$NON-NLS-1$ - dialog.open(); - } - - - protected IStructuredSelection getCurrentSelection() { - IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); - if (window != null) { - ISelection selection= window.getSelectionService().getSelection(); - if (selection instanceof IStructuredSelection) { - return (IStructuredSelection) selection; - } - } - return StructuredSelection.EMPTY; - } - /** - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action) { - run(); - } - /** - * @see IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose() { - } - /** - * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init(IWorkbenchWindow window) { - } - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java deleted file mode 100644 index 8cb6dcbaa60..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/OpenNewFolderWizardAction.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.wizards.newresource.BasicNewFolderResourceWizard; - -import org.eclipse.cdt.ui.CUIPlugin; - -public class OpenNewFolderWizardAction extends Action implements IWorkbenchWindowActionDelegate { - - public void run() { - BasicNewFolderResourceWizard wizard= new BasicNewFolderResourceWizard(); - wizard.init(CUIPlugin.getDefault().getWorkbench(), getCurrentSelection()); - wizard.setNeedsProgressMonitor(true); - WizardDialog dialog= - new WizardDialog(CUIPlugin.getDefault().getActiveWorkbenchShell(), wizard); - dialog.create(); - dialog.getShell().setText( - CUIPlugin.getResourceString("OpenNewFolderWizardAction.title")); //$NON-NLS-1$ - dialog.open(); - } - - protected IStructuredSelection getCurrentSelection() { - IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); - if (window != null) { - ISelection selection= window.getSelectionService().getSelection(); - if (selection instanceof IStructuredSelection) { - return (IStructuredSelection) selection; - } - } - return StructuredSelection.EMPTY; - } - /** - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action) { - run(); - } - /** - * @see IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose() { - } - /** - * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init(IWorkbenchWindow window) { - } - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java deleted file mode 100644 index f87c6135539..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/CheckedListDialogField.java +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Table; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TableViewer; - -/** - * A list with checkboxes and a button bar. Typical buttons are 'Check All' and 'Uncheck All'. - * List model is independend of widget creation. - * DialogFields controls are: Label, List and Composite containing buttons. - */ -public class CheckedListDialogField extends ListDialogField { - - private int fCheckAllButtonIndex; - private int fUncheckAllButtonIndex; - - private List fCheckElements; - - public CheckedListDialogField(IListAdapter adapter, String[] customButtonLabels, ILabelProvider lprovider) { - super(adapter, customButtonLabels, lprovider); - fCheckElements= new ArrayList(); - - fCheckAllButtonIndex= -1; - fUncheckAllButtonIndex= -1; - } - - /** - * Sets the index of the 'check' button in the button label array passed in the constructor. - * The behaviour of the button marked as the check button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setCheckAllButtonIndex(int checkButtonIndex) { - Assert.isTrue(checkButtonIndex < fButtonLabels.length); - fCheckAllButtonIndex= checkButtonIndex; - } - - /** - * Sets the index of the 'uncheck' button in the button label array passed in the constructor. - * The behaviour of the button marked as the uncheck button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setUncheckAllButtonIndex(int uncheckButtonIndex) { - Assert.isTrue(uncheckButtonIndex < fButtonLabels.length); - fUncheckAllButtonIndex= uncheckButtonIndex; - } - - - /* - * @see ListDialogField#createTableViewer - */ - protected TableViewer createTableViewer(Composite parent) { - Table table= new Table(parent, SWT.CHECK + getListStyle()); - CheckboxTableViewer tableViewer= new CheckboxTableViewer(table); - tableViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent e) { - doCheckStateChanged(e); - } - }); - return tableViewer; - } - - - /* - * @see ListDialogField#getListControl - */ - public Control getListControl(Composite parent) { - Control control= super.getListControl(parent); - if (parent != null) { - ((CheckboxTableViewer)fTable).setCheckedElements(fCheckElements.toArray()); - } - return control; - } - - /* - * @see DialogField#dialogFieldChanged - * Hooks in to get element changes to update check model. - */ - public void dialogFieldChanged() { - for (int i= fCheckElements.size() -1; i >= 0; i--) { - if (!fElements.contains(fCheckElements.get(i))) { - fCheckElements.remove(i); - } - } - super.dialogFieldChanged(); - } - - private void checkStateChanged() { - //call super and do not update check model - super.dialogFieldChanged(); - } - - /** - * Gets the checked elements. - */ - public List getCheckedElements() { - return new ArrayList(fCheckElements); - } - - /** - * Returns true if the element is checked. - */ - public boolean isChecked(Object obj) { - return fCheckElements.contains(obj); - } - - /** - * Sets the checked elements. - */ - public void setCheckedElements(List list) { - fCheckElements= new ArrayList(list); - if (fTable != null) { - ((CheckboxTableViewer)fTable).setCheckedElements(list.toArray()); - } - checkStateChanged(); - } - - /** - * Sets the checked state of an element. - */ - public void setChecked(Object object, boolean state) { - setCheckedWithoutUpdate(object, state); - checkStateChanged(); - } - - /** - * Sets the checked state of an element. No dialog changed listener is informed. - */ - public void setCheckedWithoutUpdate(Object object, boolean state) { - if (!fCheckElements.contains(object)) { - fCheckElements.add(object); - } - if (fTable != null) { - ((CheckboxTableViewer)fTable).setChecked(object, state); - } - } - - /** - * Sets the check state of all elements - */ - public void checkAll(boolean state) { - if (state) { - fCheckElements= getElements(); - } else { - fCheckElements.clear(); - } - if (fTable != null) { - ((CheckboxTableViewer)fTable).setAllChecked(state); - } - checkStateChanged(); - } - - - protected void doCheckStateChanged(CheckStateChangedEvent e) { - if (e.getChecked()) { - fCheckElements.add(e.getElement()); - } else { - fCheckElements.remove(e.getElement()); - } - checkStateChanged(); - } - - // ------ enable / disable management - - /* - * @see ListDialogField#getManagedButtonState - */ - protected boolean getManagedButtonState(ISelection sel, int index) { - if (index == fCheckAllButtonIndex) { - return !fElements.isEmpty(); - } else if (index == fUncheckAllButtonIndex) { - return !fElements.isEmpty(); - } - return super.getManagedButtonState(sel, index); - } - - /* - * @see ListDialogField#extraButtonPressed - */ - protected boolean managedButtonPressed(int index) { - if (index == fCheckAllButtonIndex) { - checkAll(true); - } else if (index == fUncheckAllButtonIndex) { - checkAll(false); - } else { - return super.managedButtonPressed(index); - } - return true; - } - - - - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ComboDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ComboDialogField.java deleted file mode 100644 index 6b2d6333f1a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ComboDialogField.java +++ /dev/null @@ -1,225 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field containing a label and a combo control. - */ -public class ComboDialogField extends DialogField { - - private String fText; - private int fSelectionIndex; - private String[] fItems; - private Combo fComboControl; - private ModifyListener fModifyListener; - private int fFlags; - - public ComboDialogField(int flags) { - super(); - fText= ""; //$NON-NLS-1$ - fItems= new String[0]; - fFlags= flags; - fSelectionIndex= -1; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Combo combo= getComboControl(parent); - combo.setLayoutData(gridDataForCombo(nColumns - 1)); - - return new Control[] { label, combo }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 2; - } - - protected static GridData gridDataForCombo(int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - return gd; - } - - // ------- focus methods - - /* - * @see DialogField#setFocus - */ - public boolean setFocus() { - if (isOkToUse(fComboControl)) { - fComboControl.setFocus(); - } - return true; - } - - // ------- ui creation - - /** - * Creates or returns the created combo control. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Combo getComboControl(Composite parent) { - if (fComboControl == null) { - assertCompositeNotNull(parent); - fModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - doModifyText(e); - } - }; - SelectionListener selectionListener= new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - doSelectionChanged(e); - } - - public void widgetDefaultSelected(SelectionEvent e) { }; - }; - - fComboControl= new Combo(parent, fFlags); - // moved up due to 1GEUNW2 - fComboControl.setItems(fItems); - if (fSelectionIndex != -1) { - fComboControl.select(fSelectionIndex); - } else { - fComboControl.setText(fText); - } - fComboControl.setFont(parent.getFont()); - fComboControl.addModifyListener(fModifyListener); - fComboControl.addSelectionListener(selectionListener); - fComboControl.setEnabled(isEnabled()); - } - return fComboControl; - } - - protected void doModifyText(ModifyEvent e) { - if (isOkToUse(fComboControl)) { - fText= fComboControl.getText(); - fSelectionIndex= fComboControl.getSelectionIndex(); - } - dialogFieldChanged(); - } - - protected void doSelectionChanged(SelectionEvent e) { - if (isOkToUse(fComboControl)) { - fItems= fComboControl.getItems(); - fText= fComboControl.getText(); - fSelectionIndex= fComboControl.getSelectionIndex(); - } - dialogFieldChanged(); - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fComboControl)) { - fComboControl.setEnabled(isEnabled()); - } - } - - // ------ text access - - /** - * Gets the combo items. - */ - public String[] getItems() { - return fItems; - } - - /** - * Sets the combo items. Triggers a dialog-changed event. - */ - public void setItems(String[] items) { - fItems= items; - if (isOkToUse(fComboControl)) { - fComboControl.setItems(items); - } - dialogFieldChanged(); - } - - /** - * Gets the text. - */ - public String getText() { - return fText; - } - - /** - * Sets the text. Triggers a dialog-changed event. - */ - public void setText(String text) { - fText= text; - if (isOkToUse(fComboControl)) { - fComboControl.setText(text); - } else { - dialogFieldChanged(); - } - } - - /** - * Selects an item. - */ - public void selectItem(int index) { - if (isOkToUse(fComboControl)) { - fComboControl.select(index); - } else { - if (index >= 0 && index < fItems.length) { - fText= fItems[index]; - fSelectionIndex= index; - } - } - dialogFieldChanged(); - } - - public int getSelectionIndex() { - return fSelectionIndex; - } - - - /** - * Sets the text without triggering a dialog-changed event. - */ - public void setTextWithoutUpdate(String text) { - fText= text; - if (isOkToUse(fComboControl)) { - fComboControl.removeModifyListener(fModifyListener); - fComboControl.setText(text); - fComboControl.addModifyListener(fModifyListener); - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/DialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/DialogField.java deleted file mode 100644 index 02b0a9dc978..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/DialogField.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; - -public class DialogField { - - private Label fLabel; - protected String fLabelText; - - private IDialogFieldListener fDialogFieldListener; - - private boolean fEnabled; - - public DialogField() { - fEnabled= true; - fLabel= null; - fLabelText= ""; //$NON-NLS-1$ - } - - /** - * Sets the label of the dialog field. - */ - public void setLabelText(String labeltext) { - fLabelText= labeltext; - } - - // ------ change listener - - /** - * Defines the listener for this dialog field. - */ - public final void setDialogFieldListener(IDialogFieldListener listener) { - fDialogFieldListener= listener; - } - - /** - * Programatical invocation of a dialog field change. - */ - public void dialogFieldChanged() { - if (fDialogFieldListener != null) { - fDialogFieldListener.dialogFieldChanged(this); - } - } - - // ------- focus management - - /** - * Tries to set the focus to the dialog field. - * Returns true if the dialog field can take focus. - * To be reimplemented by dialog field implementors. - */ - public boolean setFocus() { - return false; - } - - /** - * Posts setFocus to the display event queue. - */ - public void postSetFocusOnDialogField(Display display) { - if (display != null) { - display.asyncExec( - new Runnable() { - public void run() { - setFocus(); - } - } - ); - } - } - - // ------- layout helpers - - /** - * Creates all controls of the dialog field and fills it to a composite. - * The composite is assumed to have MGridLayout as - * layout. - * The dialog field will adjust its controls' spans to the number of columns given. - * To be reimplemented by dialog field implementors. - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(nColumns)); - - return new Control[] { label }; - } - - /** - * Returns the number of columns of the dialog field. - * To be reimplemented by dialog field implementors. - */ - public int getNumberOfControls() { - return 1; - } - - protected static GridData gridDataForLabel(int span) { - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= span; - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created label widget. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Label getLabelControl(Composite parent) { - if (fLabel == null) { - assertCompositeNotNull(parent); - - fLabel= new Label(parent, SWT.LEFT | SWT.WRAP); - fLabel.setFont(parent.getFont()); - fLabel.setEnabled(fEnabled); - if (fLabelText != null && !"".equals(fLabelText)) { //$NON-NLS-1$ - fLabel.setText(fLabelText); - } else { - // XXX: to avoid a 16 pixel wide empty label - revisit - fLabel.setText("."); //$NON-NLS-1$ - fLabel.setVisible(false); - } - } - return fLabel; - } - - /** - * Creates a spacer control. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent) { - return createEmptySpace(parent, 1); - } - - /** - * Creates a spacer control with the given span. - * The composite is assumed to have MGridLayout as - * layout. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent, int span) { - Label label= new Label(parent, SWT.LEFT); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.BEGINNING; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.horizontalIndent= 0; - gd.widthHint= 0; - gd.heightHint= 0; - label.setLayoutData(gd); - return label; - } - - /** - * Tests is the control is not null and not disposed. - */ - protected final boolean isOkToUse(Control control) { - return (control != null) && !(control.isDisposed()); - } - - // --------- enable / disable management - - /** - * Sets the enable state of the dialog field. - */ - public final void setEnabled(boolean enabled) { - if (enabled != fEnabled) { - fEnabled= enabled; - updateEnableState(); - } - } - - /** - * Called when the enable state changed. - * To be extended by dialog field implementors. - */ - protected void updateEnableState() { - if (fLabel != null) { - fLabel.setEnabled(fEnabled); - } - } - - /** - * Gets the enable state of the dialog field. - */ - public final boolean isEnabled() { - return fEnabled; - } - - protected final void assertCompositeNotNull(Composite comp) { - Assert.isNotNull(comp, "uncreated control requested with composite null"); //$NON-NLS-1$ - } - - protected final void assertEnoughColumns(int nColumns) { - Assert.isTrue(nColumns >= getNumberOfControls(), "given number of columns is too small"); //$NON-NLS-1$ - } - - - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IDialogFieldListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IDialogFieldListener.java deleted file mode 100644 index 65ef15bc79f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IDialogFieldListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -public interface IDialogFieldListener { - - void dialogFieldChanged(DialogField field); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IListAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IListAdapter.java deleted file mode 100644 index 50c50d8ea53..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IListAdapter.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -/** - * Change listener used by ListDialogField and CheckedListDialogField - */ -public interface IListAdapter { - - /** - * A button from the button bar has been pressed. - */ - void customButtonPressed(ListDialogField field, int index); - - /** - * The selection of the list has changed. - */ - void selectionChanged(ListDialogField field); - - /** - * En entry in the list has been double clicked - */ - void doubleClicked(ListDialogField field); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IStringButtonAdapter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IStringButtonAdapter.java deleted file mode 100644 index 0f59e6736e1..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/IStringButtonAdapter.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -public interface IStringButtonAdapter { - - void changeControlPressed(DialogField field); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LayoutUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LayoutUtil.java deleted file mode 100644 index cfb7cd8c9a9..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LayoutUtil.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -public class LayoutUtil { - - /** - * Calculates the number of columns needed by field editors - */ - public static int getNumberOfColumns(DialogField[] editors) { - int nCulumns= 0; - for (int i= 0; i < editors.length; i++) { - nCulumns= Math.max(editors[i].getNumberOfControls(), nCulumns); - } - return nCulumns; - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop) { - doDefaultLayout(parent, editors, labelOnTop, 0, 0, 0, 0); - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - * @param minWidth The minimal width of the composite - * @param minHeight The minimal height of the composite - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int minWidth, int minHeight) { - doDefaultLayout(parent, editors, labelOnTop, minWidth, minHeight, 0, 0); - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - * @param minWidth The minimal width of the composite - * @param minHeight The minimal height of the composite - * @param marginWidth The margin width to be used by the composite - * @param marginHeight The margin height to be used by the composite - * @deprecated - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int minWidth, int minHeight, int marginWidth, int marginHeight) { - int nCulumns= getNumberOfColumns(editors); - Control[][] controls= new Control[editors.length][]; - for (int i= 0; i < editors.length; i++) { - controls[i]= editors[i].doFillIntoGrid(parent, nCulumns); - } - if (labelOnTop) { - nCulumns--; - modifyLabelSpans(controls, nCulumns); - } - GridLayout layout= new GridLayout(); - if (marginWidth != SWT.DEFAULT) { - layout.marginWidth= marginWidth; - } - if (marginHeight != SWT.DEFAULT) { - layout.marginHeight= marginHeight; - } - layout.numColumns= nCulumns; - parent.setLayout(layout); - } - - private static void modifyLabelSpans(Control[][] controls, int nCulumns) { - for (int i= 0; i < controls.length; i++) { - setHorizontalSpan(controls[i][0], nCulumns); - } - } - - /** - * Sets the span of a control. Assumes that GridData is used. - */ - public static void setHorizontalSpan(Control control, int span) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).horizontalSpan= span; - } else if (span != 1) { - GridData gd= new GridData(); - gd.horizontalSpan= span; - control.setLayoutData(gd); - } - } - - /** - * Sets the width hint of a control. Assumes that GridData is used. - */ - public static void setWidthHint(Control control, int widthHint) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).widthHint= widthHint; - } - } - - /** - * Sets the heigthHint hint of a control. Assumes that GridData is used. - */ - public static void setHeigthHint(Control control, int heigthHint) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).heightHint= heigthHint; - } - } - - /** - * Sets the horizontal indent of a control. Assumes that GridData is used. - */ - public static void setHorizontalIndent(Control control, int horizontalIndent) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).horizontalIndent= horizontalIndent; - } - } - - /** - * Sets the horizontal indent of a control. Assumes that GridData is used. - */ - public static void setHorizontalGrabbing(Control control) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).grabExcessHorizontalSpace= true; - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java deleted file mode 100644 index 15146e86cef..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/LinkToFileGroup.java +++ /dev/null @@ -1,392 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import java.io.File; - -import org.eclipse.cdt.internal.ui.wizards.NewWizardMessages; -import org.eclipse.core.resources.IPathVariableManager; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.internal.WorkbenchMessages; -import org.eclipse.ui.internal.WorkbenchPlugin; -import org.eclipse.ui.internal.ide.dialogs.PathVariableSelectionDialog; - -/** - */ -public class LinkToFileGroup extends StringButtonDialogField { - private String fText; - protected Listener listener; - private String initialLinkTarget; - private int type; - protected boolean createLink = false; - - // used to compute layout sizes - //private FontMetrics fontMetrics; - - // widgets - //private Composite groupComposite; - protected Text linkTargetField; - protected Button linkButton; - protected Button browseButton; - protected Button variablesButton; - private Label resolvedPathLabelText; - private Label resolvedPathLabelData; - - public LinkToFileGroup(IStringButtonAdapter adapter, Listener listener) { - super(adapter); - this.listener = listener; - this.type = IResource.FILE; - } - - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - //initializeDialogUnits(parent); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - - getLinkCheckButtonControl(parent); - - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(1)); - - Button browseButton = getBrowseButtonControl(parent); - browseButton.setLayoutData(gridDataForButton(browseButton, 1)); - - Button variablesButton = getVariablesButtonControl(parent); - variablesButton.setLayoutData(gridDataForButton(variablesButton, 1)); - - DialogField.createEmptySpace(parent); - - resolvedPathLabelText = new Label(parent, SWT.SINGLE); - resolvedPathLabelText.setText(WorkbenchMessages.getString("CreateLinkedResourceGroup.resolvedPathLabel")); //$NON-NLS-1$ - resolvedPathLabelText.setVisible(true); - - resolvedPathLabelData = new Label(parent, SWT.SINGLE); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = 3; - resolvedPathLabelData.setLayoutData(data); - resolvedPathLabelData.setVisible(true); - - return null; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 5; - } - - public Button getLinkCheckButtonControl(Composite parent){ - if(linkButton == null){ - linkButton = new Button(parent, SWT.CHECK); - linkButton.setText(NewWizardMessages.getString("NewClassWizardPage.files.linkFileButton")); //$NON-NLS-1$ - linkButton.setSelection(createLink); - linkButton.setFont(parent.getFont()); - SelectionListener selectionListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - createLink = linkButton.getSelection(); - browseButton.setEnabled(createLink); - variablesButton.setEnabled(createLink); - linkTargetField.setEnabled(createLink); - if (listener != null) - listener.handleEvent(new Event()); - } - }; - linkButton.addSelectionListener(selectionListener); - } - return linkButton; - } - - public String getText() { - return linkTargetField.getText(); - } - - public void setText(String text) { - fText= text; - if (isOkToUse(linkTargetField)) { - linkTargetField.setText(text); - } else { - dialogFieldChanged(); - } - } - - public Text getTextControl(Composite parent){ - if(linkTargetField == null){ - assertCompositeNotNull(parent); - linkTargetField = new Text(parent, SWT.BORDER); - linkTargetField.setFont(parent.getFont()); - linkTargetField.setEnabled(createLink); - linkTargetField.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - resolveVariable(); - if (listener != null) - listener.handleEvent(new Event()); - } - }); - if (initialLinkTarget != null) - linkTargetField.setText(initialLinkTarget); - } - return linkTargetField; - } - - public static GridData gridDataForText(int span){ - GridData data = new GridData(); - data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - data.horizontalAlignment= GridData.FILL; - data.grabExcessHorizontalSpace= false; - data.horizontalSpan= span; - return data; - } - - public Button getBrowseButtonControl(Composite parent){ - // browse button - if(browseButton == null){ - assertCompositeNotNull(parent); - browseButton = new Button(parent, SWT.PUSH); - //setButtonLayoutData(browseButton); - browseButton.setFont(parent.getFont()); - browseButton.setText(WorkbenchMessages.getString("CreateLinkedResourceGroup.browseButton")); //$NON-NLS-1$ - browseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - handleLinkTargetBrowseButtonPressed(); - } - }); - browseButton.setEnabled(createLink); - } - return browseButton; - } - - public Button getVariablesButtonControl(Composite parent){ - // variables button - if(variablesButton == null){ - assertCompositeNotNull(parent); - variablesButton = new Button(parent, SWT.PUSH); - //setButtonLayoutData(variablesButton); - variablesButton.setFont(parent.getFont()); - variablesButton.setText(WorkbenchMessages.getString("CreateLinkedResourceGroup.variablesButton")); //$NON-NLS-1$ - variablesButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - handleVariablesButtonPressed(); - } - }); - variablesButton.setEnabled(createLink); - } - return variablesButton; - } - /** - * Returns a new status object with the given severity and message. - * - * @return a new status object with the given severity and message. - */ - private IStatus createStatus(int severity, String message) { - return new Status( - severity, - WorkbenchPlugin.getDefault().getDescriptor().getUniqueIdentifier(), - severity, - message, - null); - } - /** - * Returns the link target location entered by the user. - * - * @return the link target location entered by the user. null if the user - * chose not to create a link. - */ - public String getLinkTarget() { - if (createLink && linkTargetField != null && linkTargetField.isDisposed() == false) - return linkTargetField.getText(); - - return null; - } - - public String getResolvedPath() { - if (createLink && resolvedPathLabelData != null && resolvedPathLabelData.isDisposed() == false) - return resolvedPathLabelData.getText(); - - return null; - } - - /** - * Opens a file or directory browser depending on the link type. - */ - protected void handleLinkTargetBrowseButtonPressed() { - String linkTargetName = linkTargetField.getText(); - File file = null; - String selection = null; - - if ("".equals(linkTargetName) == false) { //$NON-NLS-1$ - file = new File(linkTargetName); - if (file.exists() == false) - file = null; - } - if (type == IResource.FILE) { - FileDialog dialog = new FileDialog(linkTargetField.getShell()); - if (file != null) { - if (file.isFile()) - dialog.setFileName(linkTargetName); - else - dialog.setFilterPath(linkTargetName); - } - selection = dialog.open(); - } - else { - DirectoryDialog dialog = new DirectoryDialog(linkTargetField.getShell()); - if (file != null) { - if (file.isFile()) - linkTargetName = file.getParent(); - if (linkTargetName != null) - dialog.setFilterPath(linkTargetName); - } - dialog.setMessage(WorkbenchMessages.getString("CreateLinkedResourceGroup.targetSelectionLabel")); //$NON-NLS-1$ - selection = dialog.open(); - } - if (selection != null) - linkTargetField.setText(selection); - } - /** - * Opens a path variable selection dialog - */ - protected void handleVariablesButtonPressed() { - int variableTypes = IResource.FOLDER; - - // allow selecting file and folder variables when creating a - // linked file - if (type == IResource.FILE) - variableTypes |= IResource.FILE; - - PathVariableSelectionDialog dialog = - new PathVariableSelectionDialog(linkTargetField.getShell(), variableTypes); - if (dialog.open() == IDialogConstants.OK_ID) { - String[] variableNames = (String[]) dialog.getResult(); - if (variableNames != null && variableNames.length == 1) - linkTargetField.setText(variableNames[0]); - } - } - /** - * Tries to resolve the value entered in the link target field as - * a variable, if the value is a relative path. - * Displays the resolved value if the entered value is a variable. - */ - protected void resolveVariable() { - if(!linkTargetField.isEnabled()) - return; - - IPathVariableManager pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); - IPath path = new Path(linkTargetField.getText()); - IPath resolvedPath = pathVariableManager.resolvePath(path); - - /* (path.equals(resolvedPath)) { - resolvedPathLabelText.setVisible(false); - resolvedPathLabelData.setVisible(false); - } else { - resolvedPathLabelText.setVisible(true); - resolvedPathLabelData.setVisible(true); - } - */ - resolvedPathLabelData.setText(resolvedPath.toOSString()); - } - /** - * Sets the value of the link target field - * - * @param target the value of the link target field - */ - public void setLinkTarget(String target) { - initialLinkTarget = target; - if (linkTargetField != null && linkTargetField.isDisposed() == false) - linkTargetField.setText(target); - } - /** - * Validates the type of the given file against the link type specified - * in the constructor. - * - * @param linkTargetFile file to validate - * @return IStatus indicating the validation result. IStatus.OK if the - * given file is valid. - */ - private IStatus validateFileType(File linkTargetFile) { - if (type == IResource.FILE && linkTargetFile.isFile() == false) { - return createStatus( - IStatus.ERROR, - WorkbenchMessages.getString("CreateLinkedResourceGroup.linkTargetNotFile")); //$NON-NLS-1$ - } else if (type == IResource.FOLDER && linkTargetFile.isDirectory() == false) { - return createStatus( - IStatus.ERROR, - WorkbenchMessages.getString("CreateLinkedResourceGroup.linkTargetNotFolder")); //$NON-NLS-1$ - } - return createStatus(IStatus.OK, ""); //$NON-NLS-1$ - } - /** - * Validates this page's controls. - * - * @return IStatus indicating the validation result. IStatus.OK if the - * specified link target is valid given the linkHandle. - */ - public IStatus validateLinkLocation(IResource linkHandle) { - if (linkTargetField == null || linkTargetField.isDisposed()) - return createStatus(IStatus.OK, ""); //$NON-NLS-1$ - - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - String linkTargetName = linkTargetField.getText(); - IPath path = new Path(linkTargetName); - - if (createLink == false) - return createStatus(IStatus.OK, ""); //$NON-NLS-1$ - - IStatus locationStatus = workspace.validateLinkLocation(linkHandle, path); - if (locationStatus.getSeverity() == IStatus.ERROR) - return locationStatus; - - // use the resolved link target name - linkTargetName = resolvedPathLabelData.getText(); - path = new Path(linkTargetName); - File linkTargetFile = new Path(linkTargetName).toFile(); - if (linkTargetFile.exists()) { - IStatus fileTypeStatus = validateFileType(linkTargetFile); - if (fileTypeStatus.isOK() == false) - return fileTypeStatus; - } else if (locationStatus.getSeverity() == IStatus.OK) { - // locationStatus takes precedence over missing location warning. - return createStatus( - IStatus.WARNING, - WorkbenchMessages.getString("CreateLinkedResourceGroup.linkTargetNonExistent")); //$NON-NLS-1$ - } - return locationStatus; - } - - public boolean linkCreated (){ - return createLink; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java deleted file mode 100644 index db326ad9ff3..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/ListDialogField.java +++ /dev/null @@ -1,894 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ColumnLayoutData; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; - -import org.eclipse.cdt.internal.ui.util.PixelConverter; -import org.eclipse.cdt.internal.ui.util.SWTUtil; -import org.eclipse.cdt.internal.ui.util.TableLayoutComposite; - -/** - * A list with a button bar. - * Typical buttons are 'Add', 'Remove', 'Up' and 'Down'. - * List model is independend of widget creation. - * DialogFields controls are: Label, List and Composite containing buttons. - */ -public class ListDialogField extends DialogField { - - public static class ColumnsDescription { - protected ColumnLayoutData[] columns; - protected String[] headers; - protected boolean drawLines; - - public ColumnsDescription(ColumnLayoutData[] columns, String[] headers, boolean drawLines) { - this.columns= columns; - this.headers= headers; - this.drawLines= drawLines; - } - - public ColumnsDescription(String[] headers, boolean drawLines) { - this(createColumnWeightData(headers.length), headers, drawLines); - } - - public ColumnsDescription(int nColumns, boolean drawLines) { - this(createColumnWeightData(nColumns), null, drawLines); - } - - private static ColumnLayoutData[] createColumnWeightData(int nColumns) { - ColumnLayoutData[] data= new ColumnLayoutData[nColumns]; - for (int i= 0; i < nColumns; i++) { - data[i]= new ColumnWeightData(1); - } - return data; - } - } - - protected TableViewer fTable; - protected ILabelProvider fLabelProvider; - protected ListViewerAdapter fListViewerAdapter; - protected List fElements; - protected ViewerSorter fViewerSorter; - - protected String[] fButtonLabels; - private Button[] fButtonControls; - - private boolean[] fButtonsEnabled; - - private int fRemoveButtonIndex; - private int fUpButtonIndex; - private int fDownButtonIndex; - - private Label fLastSeparator; - - protected Control fTableControl; - private Composite fButtonsControl; - private ISelection fSelectionWhenEnabled; - - private IListAdapter fListAdapter; - - private Object fParentElement; - - protected ColumnsDescription fTableColumns; - - - /** - * Creates the ListDialogField. - * @param adapter A listener for button invocation, selection changes. Can - * be null. - * @param buttonLabels The labels of all buttons: null is a valid array entry and - * marks a separator. - * @param lprovider The label provider to render the table entries - */ - public ListDialogField(IListAdapter adapter, String[] buttonLabels, ILabelProvider lprovider) { - super(); - fListAdapter= adapter; - - fLabelProvider= lprovider; - fListViewerAdapter= new ListViewerAdapter(); - fParentElement= this; - - fElements= new ArrayList(10); - - fButtonLabels= buttonLabels; - if (fButtonLabels != null) { - int nButtons= fButtonLabels.length; - fButtonsEnabled= new boolean[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtonsEnabled[i]= true; - } - } - - fTable= null; - fTableControl= null; - fButtonsControl= null; - fTableColumns= null; - - fRemoveButtonIndex= -1; - fUpButtonIndex= -1; - fDownButtonIndex= -1; - } - - /** - * Sets the index of the 'remove' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'remove' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setRemoveButtonIndex(int removeButtonIndex) { - Assert.isTrue(removeButtonIndex < fButtonLabels.length); - fRemoveButtonIndex= removeButtonIndex; - } - - /** - * Sets the index of the 'up' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'up' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setUpButtonIndex(int upButtonIndex) { - Assert.isTrue(upButtonIndex < fButtonLabels.length); - fUpButtonIndex= upButtonIndex; - } - - /** - * Sets the index of the 'down' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'down' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setDownButtonIndex(int downButtonIndex) { - Assert.isTrue(downButtonIndex < fButtonLabels.length); - fDownButtonIndex= downButtonIndex; - } - - /** - * Sets the viewerSorter. - * @param viewerSorter The viewerSorter to set - */ - public void setViewerSorter(ViewerSorter viewerSorter) { - fViewerSorter= viewerSorter; - } - - public void setTableColumns(ColumnsDescription column) { - fTableColumns= column; - } - - - - // ------ adapter communication - - private void buttonPressed(int index) { - if (!managedButtonPressed(index) && fListAdapter != null) { - fListAdapter.customButtonPressed(this, index); - } - } - - /** - * Checks if the button pressed is handled internally - * @return Returns true if button has been handled. - */ - protected boolean managedButtonPressed(int index) { - if (index == fRemoveButtonIndex) { - remove(); - } else if (index == fUpButtonIndex) { - up(); - } else if (index == fDownButtonIndex) { - down(); - } else { - return false; - } - return true; - } - - - // ------ layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - PixelConverter converter= new PixelConverter(parent); - - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - GridData gd= gridDataForLabel(1); - gd.verticalAlignment= GridData.BEGINNING; - label.setLayoutData(gd); - - Control list= getListControl(parent); - gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.verticalAlignment= GridData.FILL; - gd.grabExcessVerticalSpace= true; - gd.horizontalSpan= nColumns - 2; - gd.widthHint= converter.convertWidthInCharsToPixels(50); - gd.heightHint= converter.convertHeightInCharsToPixels(6); - - list.setLayoutData(gd); - - Composite buttons= getButtonBox(parent); - gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.verticalAlignment= GridData.FILL; - gd.grabExcessVerticalSpace= true; - gd.horizontalSpan= 1; - buttons.setLayoutData(gd); - - return new Control[] { label, list, buttons }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 3; - } - - /** - * Sets the minimal width of the buttons. Must be called after widget creation. - */ - public void setButtonsMinWidth(int minWidth) { - if (fLastSeparator != null) { - ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; - } - } - - - // ------ ui creation - - /** - * Returns the list control. When called the first time, the control will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Control getListControl(Composite parent) { - if (fTableControl == null) { - assertCompositeNotNull(parent); - - if (fTableColumns == null) { - fTable= createTableViewer(parent); - Table tableControl= fTable.getTable(); - - fTableControl= tableControl; - tableControl.setLayout(new TableLayout()); - } else { - TableLayoutComposite composite= new TableLayoutComposite(parent, SWT.NONE); - fTableControl= composite; - - fTable= createTableViewer(composite); - Table tableControl= fTable.getTable(); - - tableControl.setHeaderVisible(fTableColumns.headers != null); - tableControl.setLinesVisible(fTableColumns.drawLines); - ColumnLayoutData[] columns= fTableColumns.columns; - for (int i= 0; i < columns.length; i++) { - composite.addColumnData(columns[i]); - TableColumn column= new TableColumn(tableControl, SWT.NONE); - //tableLayout.addColumnData(columns[i]); - if (fTableColumns.headers != null) { - column.setText(fTableColumns.headers[i]); - } - } - } - - fTable.getTable().addKeyListener(new KeyAdapter() { - public void keyPressed(KeyEvent e) { - handleKeyPressed(e); - } - }); - - //fTableControl.setLayout(tableLayout); - - fTable.setContentProvider(fListViewerAdapter); - fTable.setLabelProvider(fLabelProvider); - fTable.addSelectionChangedListener(fListViewerAdapter); - fTable.addDoubleClickListener(fListViewerAdapter); - - fTable.setInput(fParentElement); - - if (fViewerSorter != null) { - fTable.setSorter(fViewerSorter); - } - - fTableControl.setEnabled(isEnabled()); - if (fSelectionWhenEnabled != null) { - postSetSelection(fSelectionWhenEnabled); - } - } - return fTableControl; - } - - /** - * Returns the internally used table viewer. - */ - public TableViewer getTableViewer() { - return fTable; - } - - /* - * Subclasses may override to specify a different style. - */ - protected int getListStyle(){ - int style= SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL ; - if (fTableColumns != null) { - style |= SWT.FULL_SELECTION; - } - return style; - } - - protected TableViewer createTableViewer(Composite parent) { - Table table= new Table(parent, getListStyle()); - return new TableViewer(table); - } - - protected Button createButton(Composite parent, String label, SelectionListener listener) { - Button button= new Button(parent, SWT.PUSH); - button.setText(label); - button.addSelectionListener(listener); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= true; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - - button.setLayoutData(gd); - return button; - } - - private Label createSeparator(Composite parent) { - Label separator= new Label(parent, SWT.NONE); - separator.setVisible(false); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint= 4; - separator.setLayoutData(gd); - return separator; - } - - /** - * Returns the composite containing the buttons. When called the first time, the control - * will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Composite getButtonBox(Composite parent) { - if (fButtonsControl == null) { - assertCompositeNotNull(parent); - - SelectionListener listener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doButtonSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doButtonSelected(e); - } - }; - - Composite contents= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - layout.marginWidth= 0; - layout.marginHeight= 0; - contents.setLayout(layout); - - if (fButtonLabels != null) { - fButtonControls= new Button[fButtonLabels.length]; - for (int i= 0; i < fButtonLabels.length; i++) { - String currLabel= fButtonLabels[i]; - if (currLabel != null) { - fButtonControls[i]= createButton(contents, currLabel, listener); - fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]); - } else { - fButtonControls[i]= null; - createSeparator(contents); - } - } - } - - fLastSeparator= createSeparator(contents); - - updateButtonState(); - fButtonsControl= contents; - } - - return fButtonsControl; - } - - protected void doButtonSelected(SelectionEvent e) { - if (fButtonControls != null) { - for (int i= 0; i < fButtonControls.length; i++) { - if (e.widget == fButtonControls[i]) { - buttonPressed(i); - return; - } - } - } - } - - /** - * Handles key events in the table viewer. Specifically - * when the delete key is pressed. - */ - protected void handleKeyPressed(KeyEvent event) { - if (event.character == SWT.DEL && event.stateMask == 0) { - if (fRemoveButtonIndex != -1 && isButtonEnabled(fTable.getSelection(), fRemoveButtonIndex)) { - managedButtonPressed(fRemoveButtonIndex); - } - } - } - - // ------ enable / disable management - - /* - * @see DialogField#dialogFieldChanged - */ - public void dialogFieldChanged() { - super.dialogFieldChanged(); - updateButtonState(); - } - - /* - * Updates the enable state of the all buttons - */ - protected void updateButtonState() { - if (fButtonControls != null) { - ISelection sel= fTable.getSelection(); - for (int i= 0; i < fButtonControls.length; i++) { - Button button= fButtonControls[i]; - if (isOkToUse(button)) { - button.setEnabled(isButtonEnabled(sel, i)); - } - } - } - } - - protected boolean getManagedButtonState(ISelection sel, int index) { - if (index == fRemoveButtonIndex) { - return !sel.isEmpty(); - } else if (index == fUpButtonIndex) { - return !sel.isEmpty() && canMoveUp(); - } else if (index == fDownButtonIndex) { - return !sel.isEmpty() && canMoveDown(); - } - return true; - } - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - - boolean enabled= isEnabled(); - if (isOkToUse(fTableControl)) { - if (!enabled) { - fSelectionWhenEnabled= fTable.getSelection(); - selectElements(null); - } else { - selectElements(fSelectionWhenEnabled); - fSelectionWhenEnabled= null; - } - fTableControl.setEnabled(enabled); - } - updateButtonState(); - } - - /** - * Sets a button enabled or disabled. - */ - public void enableButton(int index, boolean enable) { - if (fButtonsEnabled != null && index < fButtonsEnabled.length) { - fButtonsEnabled[index]= enable; - updateButtonState(); - } - } - - private boolean isButtonEnabled(ISelection sel, int index) { - boolean extraState= getManagedButtonState(sel, index); - return isEnabled() && extraState && fButtonsEnabled[index]; - } - - - // ------ model access - - /** - * Sets the elements shown in the list. - */ - public void setElements(List elements) { - fElements= new ArrayList(elements); - if (fTable != null) { - fTable.refresh(); - } - dialogFieldChanged(); - } - - /** - * Gets the elements shown in the list. - * The list returned is a copy, so it can be modified by the user. - */ - public List getElements() { - return new ArrayList(fElements); - } - - /** - * Gets the elements shown at the given index. - */ - public Object getElement(int index) { - return fElements.get(index); - } - - /** - * Gets the index of an element in the list or -1 if element is not in list. - */ - public int getIndexOfElement(Object elem) { - return fElements.indexOf(elem); - } - - /** - * Replace an element. - */ - public void replaceElement(Object oldElement, Object newElement) throws IllegalArgumentException { - int idx= fElements.indexOf(oldElement); - if (idx != -1) { - fElements.set(idx, newElement); - if (fTable != null) { - List selected= getSelectedElements(); - if (selected.remove(oldElement)) { - selected.add(newElement); - } - fTable.refresh(); - selectElements(new StructuredSelection(selected)); - } - dialogFieldChanged(); - } else { - throw new IllegalArgumentException(); - } - } - - /** - * Adds an element at the end of the list. - */ - public void addElement(Object element) { - if (fElements.contains(element)) { - return; - } - fElements.add(element); - if (fTable != null) { - fTable.add(element); - } - dialogFieldChanged(); - } - - /** - * Adds elements at the end of the list. - */ - public void addElements(List elements) { - int nElements= elements.size(); - - if (nElements > 0) { - // filter duplicated - ArrayList elementsToAdd= new ArrayList(nElements); - - for (int i= 0; i < nElements; i++) { - Object elem= elements.get(i); - if (!fElements.contains(elem)) { - elementsToAdd.add(elem); - } - } - fElements.addAll(elementsToAdd); - if (fTable != null) { - fTable.add(elementsToAdd.toArray()); - } - dialogFieldChanged(); - } - } - - /** - * Adds an element at a position. - */ - public void insertElementAt(Object element, int index) { - if (fElements.contains(element)) { - return; - } - fElements.add(index, element); - if (fTable != null) { - fTable.add(element); - } - - dialogFieldChanged(); - } - - - /** - * Adds an element at a position. - */ - public void removeAllElements() { - if (fElements.size() > 0) { - fElements.clear(); - if (fTable != null) { - fTable.refresh(); - } - dialogFieldChanged(); - } - } - - /** - * Removes an element from the list. - */ - public void removeElement(Object element) throws IllegalArgumentException { - if (fElements.remove(element)) { - if (fTable != null) { - fTable.remove(element); - } - dialogFieldChanged(); - } else { - throw new IllegalArgumentException(); - } - } - - /** - * Removes elements from the list. - */ - public void removeElements(List elements) { - if (elements.size() > 0) { - fElements.removeAll(elements); - if (fTable != null) { - fTable.remove(elements.toArray()); - } - dialogFieldChanged(); - } - } - - /** - * Gets the number of elements - */ - public int getSize() { - return fElements.size(); - } - - - public void selectElements(ISelection selection) { - fSelectionWhenEnabled= selection; - if (fTable != null) { - fTable.setSelection(selection, true); - } - } - - public void selectFirstElement() { - Object element= null; - if (fViewerSorter != null) { - Object[] arr= fElements.toArray(); - fViewerSorter.sort(fTable, arr); - if (arr.length > 0) { - element= arr[0]; - } - } else { - if (fElements.size() > 0) { - element= fElements.get(0); - } - } - if (element != null) { - selectElements(new StructuredSelection(element)); - } - } - - - public void postSetSelection(final ISelection selection) { - if (isOkToUse(fTableControl)) { - Display d= fTableControl.getDisplay(); - d.asyncExec(new Runnable() { - public void run() { - if (isOkToUse(fTableControl)) { - selectElements(selection); - } - } - }); - } - } - - /** - * Refreshes the table. - */ - public void refresh() { - if (fTable != null) { - fTable.refresh(); - } - } - - // ------- list maintenance - - private List moveUp(List elements, List move) { - int nElements= elements.size(); - List res= new ArrayList(nElements); - Object floating= null; - for (int i= 0; i < nElements; i++) { - Object curr= elements.get(i); - if (move.contains(curr)) { - res.add(curr); - } else { - if (floating != null) { - res.add(floating); - } - floating= curr; - } - } - if (floating != null) { - res.add(floating); - } - return res; - } - - private void moveUp(List toMoveUp) { - if (toMoveUp.size() > 0) { - setElements(moveUp(fElements, toMoveUp)); - fTable.reveal(toMoveUp.get(0)); - } - } - - private void moveDown(List toMoveDown) { - if (toMoveDown.size() > 0) { - setElements(reverse(moveUp(reverse(fElements), toMoveDown))); - fTable.reveal(toMoveDown.get(toMoveDown.size() - 1)); - } - } - - private List reverse(List p) { - List reverse= new ArrayList(p.size()); - for (int i= p.size()-1; i >= 0; i--) { - reverse.add(p.get(i)); - } - return reverse; - } - - - private void remove() { - removeElements(getSelectedElements()); - } - - private void up() { - moveUp(getSelectedElements()); - } - - private void down() { - moveDown(getSelectedElements()); - } - - private boolean canMoveUp() { - if (isOkToUse(fTableControl)) { - int[] indc= fTable.getTable().getSelectionIndices(); - for (int i= 0; i < indc.length; i++) { - if (indc[i] != i) { - return true; - } - } - } - return false; - } - - private boolean canMoveDown() { - if (isOkToUse(fTableControl)) { - int[] indc= fTable.getTable().getSelectionIndices(); - int k= fElements.size() - 1; - for (int i= indc.length - 1; i >= 0 ; i--, k--) { - if (indc[i] != k) { - return true; - } - } - } - return false; - } - - /** - * Returns the selected elements. - */ - public List getSelectedElements() { - List result= new ArrayList(); - if (fTable != null) { - ISelection selection= fTable.getSelection(); - if (selection instanceof IStructuredSelection) { - Iterator iter= ((IStructuredSelection)selection).iterator(); - while (iter.hasNext()) { - result.add(iter.next()); - } - } - } - return result; - } - - // ------- ListViewerAdapter - - private class ListViewerAdapter implements IStructuredContentProvider, ISelectionChangedListener, IDoubleClickListener { - - // ------- ITableContentProvider Interface ------------ - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // will never happen - } - - public boolean isDeleted(Object element) { - return false; - } - - public void dispose() { - } - - public Object[] getElements(Object obj) { - return fElements.toArray(); - } - - // ------- ISelectionChangedListener Interface ------------ - - public void selectionChanged(SelectionChangedEvent event) { - doListSelected(event); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent) - */ - public void doubleClick(DoubleClickEvent event) { - doDoubleClick(event); - } - - } - - - protected void doListSelected(SelectionChangedEvent event) { - updateButtonState(); - if (fListAdapter != null) { - fListAdapter.selectionChanged(this); - } - } - - protected void doDoubleClick(DoubleClickEvent event) { - if (fListAdapter != null) { - fListAdapter.doubleClicked(this); - } - } - - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java deleted file mode 100644 index a69f1fb3330..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogField.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -import org.eclipse.cdt.internal.ui.util.SWTUtil; - -/** - * Dialog Field containing a single button such as a radio or checkbox button. - */ -public class SelectionButtonDialogField extends DialogField { - - private Button fButton; - private boolean fIsSelected; - private DialogField[] fAttachedDialogFields; - private int fButtonStyle; - - /** - * Creates a selection button. - * Allowed button styles: SWT.RADIO, SWT.CHECK, SWT.TOGGLE, SWT.PUSH - */ - public SelectionButtonDialogField(int buttonStyle) { - super(); - fIsSelected= false; - fAttachedDialogFields= null; - fButtonStyle= buttonStyle; - } - - /** - * Attaches a field to the selection state of the selection button. - * The attached field will be disabled if the selection button is not selected. - */ - public void attachDialogField(DialogField dialogField) { - attachDialogFields(new DialogField[] { dialogField }); - } - - /** - * Attaches fields to the selection state of the selection button. - * The attached fields will be disabled if the selection button is not selected. - */ - public void attachDialogFields(DialogField[] dialogFields) { - fAttachedDialogFields= dialogFields; - for (int i= 0; i < dialogFields.length; i++) { - dialogFields[i].setEnabled(fIsSelected); - } - } - - /** - * Returns true is teh gived field is attached to the selection button. - */ - public boolean isAttached(DialogField editor) { - if (fAttachedDialogFields != null) { - for (int i=0; i < fAttachedDialogFields.length; i++) { - if (fAttachedDialogFields[i] == editor) { - return true; - } - } - } - return false; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Button button= getSelectionButton(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns; - gd.horizontalAlignment= GridData.FILL; - if (fButtonStyle == SWT.PUSH) { - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - } - - button.setLayoutData(gd); - - return new Control[] { button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 1; - } - - // ------- ui creation - - /** - * Returns the selection button widget. When called the first time, the widget will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Button getSelectionButton(Composite group) { - if (fButton == null) { - assertCompositeNotNull(group); - - fButton= new Button(group, fButtonStyle); - fButton.setFont(group.getFont()); - fButton.setText(fLabelText); - fButton.setEnabled(isEnabled()); - fButton.setSelection(fIsSelected); - fButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doWidgetSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doWidgetSelected(e); - } - }); - } - return fButton; - } - - protected void doWidgetSelected(SelectionEvent e) { - if (isOkToUse(fButton)) { - changeValue(fButton.getSelection()); - } - } - - private void changeValue(boolean newState) { - if (fIsSelected != newState) { - fIsSelected= newState; - if (fAttachedDialogFields != null) { - boolean focusSet= false; - for (int i= 0; i < fAttachedDialogFields.length; i++) { - fAttachedDialogFields[i].setEnabled(fIsSelected); - if (fIsSelected && !focusSet) { - focusSet= fAttachedDialogFields[i].setFocus(); - } - } - } - dialogFieldChanged(); - } else if (fButtonStyle == SWT.PUSH) { - dialogFieldChanged(); - } - } - - // ------ model access - - /** - * Returns the selection state of the button. - */ - public boolean isSelected() { - return fIsSelected; - } - - /** - * Sets the selection state of the button. - */ - public void setSelection(boolean selected) { - changeValue(selected); - if (isOkToUse(fButton)) { - fButton.setSelection(selected); - } - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fButton)) { - fButton.setEnabled(isEnabled()); - } - } - - - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java deleted file mode 100644 index 396c52d589e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/SelectionButtonDialogFieldGroup.java +++ /dev/null @@ -1,256 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; - -import org.eclipse.jface.util.Assert; - -/** - * Dialog field describing a group with buttons (Checkboxes, radio buttons..) - */ -public class SelectionButtonDialogFieldGroup extends DialogField { - - private Composite fButtonComposite; - - private Button[] fButtons; - private String[] fButtonNames; - private boolean[] fButtonsSelected; - private boolean[] fButtonsEnabled; - - private int fGroupBorderStyle; - private int fGroupNumberOfColumns; - private int fButtonsStyle; - - /** - * Creates a group without border. - */ - public SelectionButtonDialogFieldGroup(int buttonsStyle, String[] buttonNames, int nColumns) { - this(buttonsStyle, buttonNames, nColumns, SWT.NONE); - } - - - /** - * Creates a group with border (label in border). - * Accepted button styles are: SWT.RADIO, SWT.CHECK, SWT.TOGGLE - * For border styles see Group - */ - public SelectionButtonDialogFieldGroup(int buttonsStyle, String[] buttonNames, int nColumns, int borderStyle) { - super(); - - Assert.isTrue(buttonsStyle == SWT.RADIO || buttonsStyle == SWT.CHECK || buttonsStyle == SWT.TOGGLE); - fButtonNames= buttonNames; - - int nButtons= buttonNames.length; - fButtonsSelected= new boolean[nButtons]; - fButtonsEnabled= new boolean[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtonsSelected[i]= false; - fButtonsEnabled[i]= true; - } - if (fButtonsStyle == SWT.RADIO) { - fButtonsSelected[0]= true; - } - - fGroupBorderStyle= borderStyle; - fGroupNumberOfColumns= (nColumns <= 0) ? nButtons : nColumns; - - fButtonsStyle= buttonsStyle; - - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - if (fGroupBorderStyle == SWT.NONE) { - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - - Composite buttonsgroup= getSelectionButtonsGroup(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns - 1; - buttonsgroup.setLayoutData(gd); - - return new Control[] { label, buttonsgroup }; - } else { - Composite buttonsgroup= getSelectionButtonsGroup(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns; - buttonsgroup.setLayoutData(gd); - - return new Control[] { buttonsgroup }; - } - } - - /* - * @see DialogField#doFillIntoGrid - */ - public int getNumberOfControls() { - return (fGroupBorderStyle == SWT.NONE) ? 2 : 1; - } - - // ------- ui creation - - private Button createSelectionButton(int index, Composite group, SelectionListener listener) { - Button button= new Button(group, fButtonsStyle | SWT.LEFT); - button.setFont(group.getFont()); - button.setText(fButtonNames[index]); - button.setEnabled(isEnabled() && fButtonsEnabled[index]); - button.setSelection(fButtonsSelected[index]); - button.addSelectionListener(listener); - button.setLayoutData(new GridData()); - return button; - } - - /** - * Returns the group widget. When called the first time, the widget will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Composite getSelectionButtonsGroup(Composite parent) { - if (fButtonComposite == null) { - assertCompositeNotNull(parent); - - GridLayout layout= new GridLayout(); - layout.makeColumnsEqualWidth= true; - layout.numColumns= fGroupNumberOfColumns; - - if (fGroupBorderStyle != SWT.NONE) { - Group group= new Group(parent, fGroupBorderStyle); - if (fLabelText != null && fLabelText.length() > 0) { - group.setText(fLabelText); - } - fButtonComposite= group; - } else { - fButtonComposite= new Composite(parent, SWT.NULL); - layout.marginHeight= 0; - layout.marginWidth= 0; - } - - fButtonComposite.setLayout(layout); - - SelectionListener listener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doWidgetSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doWidgetSelected(e); - } - }; - int nButtons= fButtonNames.length; - fButtons= new Button[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtons[i]= createSelectionButton(i, fButtonComposite, listener); - } - int nRows= nButtons / fGroupNumberOfColumns; - int nFillElements= nRows * fGroupNumberOfColumns - nButtons; - for (int i= 0; i < nFillElements; i++) { - createEmptySpace(fButtonComposite); - } - } - return fButtonComposite; - } - - /** - * Returns a button from the group or null if not yet created. - */ - public Button getSelectionButton(int index) { - if (index >= 0 && index < fButtons.length) { - return fButtons[index]; - } - return null; - } - - protected void doWidgetSelected(SelectionEvent e) { - Button button= (Button)e.widget; - for (int i= 0; i < fButtons.length; i++) { - if (fButtons[i] == button) { - fButtonsSelected[i]= button.getSelection(); - dialogFieldChanged(); - return; - } - } - } - - // ------ model access - - /** - * Returns the selection state of a button contained in the group. - * @param The index of the button - */ - public boolean isSelected(int index) { - if (index >= 0 && index < fButtonsSelected.length) { - return fButtonsSelected[index]; - } - return false; - } - - /** - * Sets the selection state of a button contained in the group. - */ - public void setSelection(int index, boolean selected) { - if (index >= 0 && index < fButtonsSelected.length) { - if (fButtonsSelected[index] != selected) { - fButtonsSelected[index]= selected; - if (fButtons != null) { - Button button= fButtons[index]; - if (isOkToUse(button)) { - button.setSelection(selected); - } - } - } - } - } - - // ------ enable / disable management - - protected void updateEnableState() { - super.updateEnableState(); - if (fButtons != null) { - boolean enabled= isEnabled(); - for (int i= 0; i < fButtons.length; i++) { - Button button= fButtons[i]; - if (isOkToUse(button)) { - button.setEnabled(enabled && fButtonsEnabled[i]); - } - } - } - } - - /** - * Sets the enable state of a button contained in the group. - */ - public void enableSelectionButton(int index, boolean enable) { - if (index >= 0 && index < fButtonsEnabled.length) { - fButtonsEnabled[index]= enable; - if (fButtons != null) { - Button button= fButtons[index]; - if (isOkToUse(button)) { - button.setEnabled(isEnabled() && enable); - } - } - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/Separator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/Separator.java deleted file mode 100644 index 462e2f9fcf3..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/Separator.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -import org.eclipse.swt.layout.GridData; - -/** - * Dialog field describing a separator. - */ -public class Separator extends DialogField { - - private Label fSeparator; - private int fStyle; - - public Separator() { - this(SWT.NONE); - } - - /** - * @param style of the separator. See Label for possible - * styles. - */ - public Separator(int style) { - super(); - fStyle= style; - } - - // ------- layout helpers - - /** - * Creates the separator and fills it in a MGridLayout. - * @param height The heigth of the separator - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns, int height) { - assertEnoughColumns(nColumns); - - Control separator= getSeparator(parent); - separator.setLayoutData(gridDataForSeperator(nColumns, height)); - - return new Control[] { separator }; - } - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - return doFillIntoGrid(parent, nColumns, 4); - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 1; - } - - protected static GridData gridDataForSeperator(int span, int height) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint= height; - gd.horizontalSpan= span; - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created separator. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Control getSeparator(Composite parent) { - if (fSeparator == null) { - assertCompositeNotNull(parent); - fSeparator= new Label(parent, fStyle); - } - return fSeparator; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java deleted file mode 100644 index ce9d78e02dc..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringButtonDialogField.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import org.eclipse.cdt.internal.ui.util.SWTUtil; - -/** - * Dialog field containing a label, text control and a button control. - */ -public class StringButtonDialogField extends StringDialogField { - - private Button fBrowseButton; - private String fBrowseButtonLabel; - private IStringButtonAdapter fStringButtonAdapter; - - private boolean fButtonEnabled; - - public StringButtonDialogField(IStringButtonAdapter adapter) { - super(); - fStringButtonAdapter= adapter; - fBrowseButtonLabel= "!Browse...!"; //$NON-NLS-1$ - fButtonEnabled= true; - } - - /** - * Sets the label of the button. - */ - public void setButtonLabel(String label) { - fBrowseButtonLabel= label; - } - - // ------ adapter communication - - /** - * Programmatical pressing of the button - */ - public void changeControlPressed() { - fStringButtonAdapter.changeControlPressed(this); - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 2)); - Button button= getChangeControl(parent); - button.setLayoutData(gridDataForButton(button, 1)); - - return new Control[] { label, text, button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 3; - } - - protected static GridData gridDataForButton(Button button, int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created buttom widget. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Button getChangeControl(Composite parent) { - if (fBrowseButton == null) { - assertCompositeNotNull(parent); - - fBrowseButton= new Button(parent, SWT.PUSH); - fBrowseButton.setText(fBrowseButtonLabel); - fBrowseButton.setEnabled(isEnabled() && fButtonEnabled); - fBrowseButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - changeControlPressed(); - } - public void widgetSelected(SelectionEvent e) { - changeControlPressed(); - } - }); - - } - return fBrowseButton; - } - - // ------ enable / disable management - - /** - * Sets the enable state of the button. - */ - public void enableButton(boolean enable) { - if (isOkToUse(fBrowseButton)) { - fBrowseButton.setEnabled(isEnabled() && enable); - } - fButtonEnabled= enable; - } - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fBrowseButton)) { - fBrowseButton.setEnabled(isEnabled() && fButtonEnabled); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java deleted file mode 100644 index 2bc15ba7a4d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/StringDialogField.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.dialogfields; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - - -public class StringDialogField extends DialogField { - - private String fText; - private Text fTextControl; - private ModifyListener fModifyListener; - - public StringDialogField() { - super(); - fText= ""; //$NON-NLS-1$ - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 1)); - - return new Control[] { label, text }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 2; - } - - protected static GridData gridDataForText(int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - return gd; - } - - // ------- focus methods - - /* - * @see DialogField#setFocus - */ - public boolean setFocus() { - if (isOkToUse(fTextControl)) { - fTextControl.setFocus(); - fTextControl.setSelection(0, fTextControl.getText().length()); - } - return true; - } - - // ------- ui creation - - /** - * Creates or returns the created text control. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Text getTextControl(Composite parent) { - if (fTextControl == null) { - assertCompositeNotNull(parent); - fModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - doModifyText(e); - } - }; - - fTextControl= new Text(parent, SWT.SINGLE | SWT.BORDER); - // moved up due to 1GEUNW2 - fTextControl.setText(fText); - fTextControl.setFont(parent.getFont()); - fTextControl.addModifyListener(fModifyListener); - - fTextControl.setEnabled(isEnabled()); - } - return fTextControl; - } - - protected void doModifyText(ModifyEvent e) { - if (isOkToUse(fTextControl)) { - fText= fTextControl.getText(); - } - dialogFieldChanged(); - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fTextControl)) { - fTextControl.setEnabled(isEnabled()); - } - } - - // ------ text access - - /** - * Gets the text. Can not be null - */ - public String getText() { - return fText; - } - - /** - * Sets the text. Triggers a dialog-changed event. - */ - public void setText(String text) { - fText= text; - if (isOkToUse(fTextControl)) { - fTextControl.setText(text); - } else { - dialogFieldChanged(); - } - } - - /** - * Sets the text without triggering a dialog-changed event. - */ - public void setTextWithoutUpdate(String text) { - fText= text; - if (isOkToUse(fTextControl)) { - fTextControl.removeModifyListener(fModifyListener); - fTextControl.setText(text); - fTextControl.addModifyListener(fModifyListener); - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridData.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridData.java deleted file mode 100644 index 7d8254c884f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridData.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.swt; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; - -public final class MGridData { - /** - * verticalAlignment specifies how controls will be positioned - * vertically within a cell. - * - * The default value is CENTER. - * - * Possible values are: - * - * BEGINNING: Position the control at the top of the cell - * CENTER: Position the control in the vertical center of the cell - * END: Position the control at the bottom of the cell - * FILL: Resize the control to fill the cell vertically - */ - public int verticalAlignment= CENTER; - /** - * horizontalAlignment specifies how controls will be positioned - * horizontally within a cell. - * - * The default value is BEGINNING. - * - * Possible values are: - * - * BEGINNING: Position the control at the left of the cell - * CENTER: Position the control in the horizontal center of the cell - * END: Position the control at the right of the cell - * FILL: Resize the control to fill the cell horizontally - */ - public int horizontalAlignment= BEGINNING; - /** - * widthHint specifies a minimum width for the column. A value of - * SWT.DEFAULT indicates that no minimum width is specified. - * - * The default value is SWT.DEFAULT. - */ - public int widthHint= SWT.DEFAULT; - /** - * heightHint specifies a minimum height for the row. A value of - * SWT.DEFAULT indicates that no minimum height is specified. - * - * The default value is SWT.DEFAULT. - */ - public int heightHint= SWT.DEFAULT; - /** - * horizontalIndent specifies the number of pixels of indentation - * that will be placed along the left side of the cell. - * - * The default value is 0. - */ - public int horizontalIndent= 0; - /** - * horizontalSpan specifies the number of column cells that the control - * will take up. - * - * The default value is 1. - */ - public int horizontalSpan= 1; - /** - * verticalSpan specifies the number of row cells that the control - * will take up. - * - * The default value is 1. - */ - public int verticalSpan= 1; - /** - * grabExcessHorizontalSpace specifies whether the cell will be made - * wide enough to fit the remaining horizontal space. - * - * The default value is false. - */ - public boolean grabExcessHorizontalSpace= false; - /** - * grabExcessVerticalSpace specifies whether the cell will be made - * tall enough to fit the remaining vertical space. - * - * The default value is false. - */ - public boolean grabExcessVerticalSpace= false; - - - // --------- added to original GridData -------- - - /** - * if a span is defined that is also grabing, this defines the column that - * will grab the space - * - * The default value is -1, which will result in the default behavior - * (=last culumn) - */ - public int grabColumn= -1; - - /** - * If a span is defined that is also grabing, this defines the row that - * will grab - * - * The default value is -1, which will result in the default behavior - * (=last row) - */ - public int grabRow= -1; - - // Alignment constants. - public static final int BEGINNING= 1; - public static final int CENTER= 2; - public static final int END= 3; - public static final int FILL= 4; - - // Style constants - public static final int VERTICAL_ALIGN_BEGINNING= 1 << 1; - public static final int VERTICAL_ALIGN_CENTER= 1 << 2; - public static final int VERTICAL_ALIGN_END= 1 << 3; - public static final int VERTICAL_ALIGN_FILL= 1 << 4; - public static final int HORIZONTAL_ALIGN_BEGINNING= 1 << 5; - public static final int HORIZONTAL_ALIGN_CENTER= 1 << 6; - public static final int HORIZONTAL_ALIGN_END= 1 << 7; - public static final int HORIZONTAL_ALIGN_FILL= 1 << 8; - public static final int GRAB_HORIZONTAL= 1 << 9; - public static final int GRAB_VERTICAL= 1 << 10; - - // Private - int childIndex; - boolean isItemData= true; - boolean isItemData() { - return isItemData; - } - boolean isSpacerData() { - return !isItemData; - } - public MGridData(int style) { - super(); - - if ((style & VERTICAL_ALIGN_BEGINNING) != 0) - verticalAlignment= BEGINNING; - if ((style & VERTICAL_ALIGN_CENTER) != 0) - verticalAlignment= CENTER; - if ((style & VERTICAL_ALIGN_FILL) != 0) - verticalAlignment= FILL; - if ((style & VERTICAL_ALIGN_END) != 0) - verticalAlignment= END; - - if ((style & HORIZONTAL_ALIGN_BEGINNING) != 0) - horizontalAlignment= BEGINNING; - if ((style & HORIZONTAL_ALIGN_CENTER) != 0) - horizontalAlignment= CENTER; - if ((style & HORIZONTAL_ALIGN_FILL) != 0) - horizontalAlignment= FILL; - if ((style & HORIZONTAL_ALIGN_END) != 0) - horizontalAlignment= END; - - if ((style & GRAB_HORIZONTAL) != 0) - grabExcessHorizontalSpace= true; - else - grabExcessHorizontalSpace= false; - if ((style & GRAB_VERTICAL) != 0) - grabExcessVerticalSpace= true; - else - grabExcessVerticalSpace= false; - - } - public MGridData() { - super(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java deleted file mode 100644 index 190cf77a5f0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/swt/MGridLayout.java +++ /dev/null @@ -1,682 +0,0 @@ -package org.eclipse.cdt.internal.ui.wizards.swt; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Layout; - -public final class MGridLayout extends Layout { - /** - * marginWidth specifies the number of pixels of horizontal margin - * that will be placed along the left and right edges of the layout. - * - * The default value is 5. - */ - public int marginWidth= 5; - /** - * marginHeight specifies the number of pixels of vertical margin - * that will be placed along the top and bottom edges of the layout. - * - * The default value is 5. - */ - public int marginHeight= 5; - /** - * numColumns specifies the number of cell columns in the layout. - * - * The default value is 1. - */ - public int numColumns= 1; - /** - * makeColumnsEqualWidth specifies whether all columns in the layout - * will be forced to have the same width. - * - * The default value is false. - */ - public boolean makeColumnsEqualWidth= false; - /** - * horizontalSpacing specifies the number of pixels between the right - * edge of one cell and the left edge of its neighbouring cell to - * the right. - * - * The default value is 5. - */ - public int horizontalSpacing= 5; - /** - * verticalSpacing specifies the number of pixels between the bottom - * edge of one cell and the top edge of its neighbouring cell underneath. - * - * The default value is 5. - */ - public int verticalSpacing= 5; - - - // --------- added to original GridLayout -------- - - /** - * minimumWidth specifies a minimum width of this layout - * If SWT.DEFAULT is set, no minimum width is forced - * - * The default value is SWT.DEFAULT. - */ - public int minimumWidth= SWT.DEFAULT; - /** - * minimumHeight specifies a minimum height of this layout - * If SWT.DEFAULT is set, no minimum height is forced - * - * The default value is SWT.DEFAULT. - */ - public int minimumHeight= SWT.DEFAULT; - - /** - * id specifies an identifier string for this layout. - */ - public String id; - - // Private variables. Cached values used to cut down on grid calculations. - boolean initialLayout= true; - Vector grid= new Vector(); - int[] pixelColumnWidths; - int[] pixelRowHeights; - int[] expandableColumns; - int[] expandableRows; - void adjustGridDimensions(Composite composite, boolean flushCache) { - // Ensure that widgets that span more than one row or column have enough space. - for (int row= 0; row < grid.size(); row++) { - for (int column= 0; column < numColumns; column++) { - MGridData spec= ((MGridData[]) grid.elementAt(row))[column]; - if (spec.isItemData()) { - // Widgets spanning columns. - if (spec.horizontalSpan > 1) { - Control child= composite.getChildren()[spec.childIndex]; - Point extent= child.computeSize(spec.widthHint, spec.heightHint, flushCache); - - // Calculate the size of the widget's spanned columns. - int lastSpanIndex= column + spec.horizontalSpan; - int spannedSize= 0; - for (int c= column; c < lastSpanIndex; c++) { - spannedSize= spannedSize + pixelColumnWidths[c] + horizontalSpacing; - } - spannedSize= spannedSize - horizontalSpacing; - - // If the spanned columns are not large enough to display the widget, adjust the column - // sizes to account for the extra space that is needed. - if (extent.x + spec.horizontalIndent > spannedSize) { - int extraSpaceNeeded= extent.x + spec.horizontalIndent - spannedSize; - int lastColumn= column + spec.horizontalSpan - 1; - int colWidth; - if (makeColumnsEqualWidth) { - // Evenly distribute the extra space amongst all of the columns. - int columnExtra= extraSpaceNeeded / numColumns; - int columnRemainder= extraSpaceNeeded % numColumns; - for (int i= 0; i < pixelColumnWidths.length; i++) { - colWidth= pixelColumnWidths[i] + columnExtra; - pixelColumnWidths[i]= colWidth; - } - colWidth= pixelColumnWidths[lastColumn] + columnRemainder; - pixelColumnWidths[lastColumn]= colWidth; - } else { - Vector localExpandableColumns= new Vector(); - for (int i= column; i < lastColumn; i++) { - for (int j= 0; j < expandableColumns.length; j++) { - if (expandableColumns[j] == i) { - localExpandableColumns.addElement(new Integer(i)); - } - } - } - if (localExpandableColumns.size() > 0) { - // If any of the widget's columns grab excess space, allocate the space amongst those columns. - int columnExtra= extraSpaceNeeded / localExpandableColumns.size(); - int columnRemainder= extraSpaceNeeded % localExpandableColumns.size(); - for (int i= 0; i < localExpandableColumns.size(); i++) { - int expandableCol= ((Integer) localExpandableColumns.elementAt(i)).intValue(); - colWidth= pixelColumnWidths[expandableCol] + columnExtra; - pixelColumnWidths[expandableCol]= colWidth; - } - colWidth= pixelColumnWidths[lastColumn] + columnRemainder; - pixelColumnWidths[lastColumn]= colWidth; - } else { - // Add the extra space to the widget's last column if none of its columns grab excess space. - colWidth= pixelColumnWidths[lastColumn] + extraSpaceNeeded; - pixelColumnWidths[lastColumn]= colWidth; - } - } - } - } - - // Widgets spanning rows. - if (spec.verticalSpan > 1) { - Control child= composite.getChildren()[spec.childIndex]; - Point extent= child.computeSize(spec.widthHint, spec.heightHint, flushCache); - - // Calculate the size of the widget's spanned rows. - int lastSpanIndex= row + spec.verticalSpan; - int spannedSize= 0; - for (int r= row; r < lastSpanIndex; r++) { - spannedSize= spannedSize + pixelRowHeights[r] + verticalSpacing; - } - spannedSize= spannedSize - verticalSpacing; - // If the spanned rows are not large enough to display the widget, adjust the row - // sizes to account for the extra space that is needed. - if (extent.y > spannedSize) { - int extraSpaceNeeded= extent.y - spannedSize; - int lastRow= row + spec.verticalSpan - 1; - int rowHeight; - Vector localExpandableRows= new Vector(); - for (int i= row; i < lastRow; i++) { - for (int j= 0; j < expandableRows.length; j++) { - if (expandableRows[j] == i) { - localExpandableRows.addElement(new Integer(i)); - } - } - } - if (localExpandableRows.size() > 0) { - // If any of the widget's rows grab excess space, allocate the space amongst those rows. - int rowExtra= extraSpaceNeeded / localExpandableRows.size(); - int rowRemainder= extraSpaceNeeded % localExpandableRows.size(); - for (int i= 0; i < localExpandableRows.size(); i++) { - int expandableRow= ((Integer) localExpandableRows.elementAt(i)).intValue(); - rowHeight= pixelRowHeights[expandableRow] + rowExtra; - pixelRowHeights[expandableRow]= rowHeight; - } - rowHeight= pixelRowHeights[lastRow] + rowRemainder; - pixelRowHeights[lastRow]= rowHeight; - } else { - // Add the extra space to the widget's last row if no rows grab excess space. - rowHeight= pixelRowHeights[lastRow] + extraSpaceNeeded; - pixelRowHeights[lastRow]= rowHeight; - } - } - } - } - } - } - } - void calculateGridDimensions(Composite composite, boolean flushCache) { - int maxWidth, childWidth, maxHeight, childHeight; - - // - Control[] children= composite.getChildren(); - Point[] childSizes= new Point[children.length]; - pixelColumnWidths= new int[numColumns]; - pixelRowHeights= new int[grid.size()]; - - // Loop through the grid by column to get the width that each column needs to be. - // Each column will be as wide as its widest widget. - for (int column= 0; column < numColumns; column++) { - maxWidth= 0; - for (int row= 0; row < grid.size(); row++) { - MGridData spec= ((MGridData[]) grid.elementAt(row))[column]; - if (spec.isItemData()) { - Control child= children[spec.childIndex]; - childSizes[spec.childIndex]= child.computeSize(spec.widthHint, spec.heightHint, flushCache); - childWidth= childSizes[spec.childIndex].x + spec.horizontalIndent; - if (spec.horizontalSpan == 1) { - maxWidth= Math.max(maxWidth, childWidth); - } - } - } - // Cache the values for later use. - pixelColumnWidths[column]= maxWidth; - } - - // - if (makeColumnsEqualWidth) { - maxWidth= 0; - // Find the largest column size that is necessary and make each column that size. - for (int i= 0; i < numColumns; i++) { - maxWidth= Math.max(maxWidth, pixelColumnWidths[i]); - } - for (int i= 0; i < numColumns; i++) { - pixelColumnWidths[i]= maxWidth; - } - } - - // Loop through the grid by row to get the height that each row needs to be. - // Each row will be as high as its tallest widget. - for (int row= 0; row < grid.size(); row++) { - maxHeight= 0; - for (int column= 0; column < numColumns; column++) { - MGridData spec= ((MGridData[]) grid.elementAt(row))[column]; - if (spec.isItemData()) { - childHeight= childSizes[spec.childIndex].y; - if (spec.verticalSpan == 1) { - maxHeight= Math.max(maxHeight, childHeight); - } - } - } - // Cache the values for later use. - pixelRowHeights[row]= maxHeight; - } - } - void computeExpandableCells() { - // If a widget grabs excess horizontal space, the last column that the widget spans - // will be expandable. Similarly, if a widget grabs excess vertical space, the - // last row that the widget spans will be expandable. - Hashtable growColumns= new Hashtable(); - Hashtable growRows= new Hashtable(); - for (int col= 0; col < numColumns; col++) { - for (int row= 0; row < grid.size(); row++) { - MGridData spec= ((MGridData[]) grid.elementAt(row))[col]; - if (spec.grabExcessHorizontalSpace) { - if (spec.grabColumn >= 0 && spec.grabColumn < spec.horizontalSpan) { - growColumns.put(new Integer(col + spec.grabColumn), new Object()); - } else { - growColumns.put(new Integer(col + spec.horizontalSpan - 1), new Object()); - } - } - if (spec.grabExcessVerticalSpace) { - if (spec.grabRow >= 0 && spec.grabRow < spec.verticalSpan) { - growRows.put(new Integer(row + spec.grabRow), new Object()); - } else { - growRows.put(new Integer(row + spec.verticalSpan - 1), new Object()); - } - } - } - } - - // Cache the values. These values are used later during children layout. - int i= 0; - Enumeration enum= growColumns.keys(); - expandableColumns= new int[growColumns.size()]; - while (enum.hasMoreElements()) { - expandableColumns[i]= ((Integer) enum.nextElement()).intValue(); - i= i + 1; - } - i= 0; - enum= growRows.keys(); - expandableRows= new int[growRows.size()]; - while (enum.hasMoreElements()) { - expandableRows[i]= ((Integer) enum.nextElement()).intValue(); - i= i + 1; - } - } - Point computeLayoutSize(Composite composite, int wHint, int hHint, boolean flushCache) { - int totalMarginHeight, totalMarginWidth; - int totalWidth, totalHeight; - int cols, rows; - - // Initialize the grid and other cached information that help with the grid layout. - if (grid.size() == 0) { - createGrid(composite); - calculateGridDimensions(composite, flushCache); - computeExpandableCells(); - adjustGridDimensions(composite, flushCache); - } - - // - cols= numColumns; - rows= grid.size(); - totalMarginHeight= marginHeight + composite.getBorderWidth(); - totalMarginWidth= marginWidth + composite.getBorderWidth(); - - // The total width is the margin plus border width plus space between each column, - // plus the width of each column. - totalWidth= (totalMarginWidth * 2) + ((cols - 1) * horizontalSpacing); - - //Add up the width of each column. - for (int i= 0; i < pixelColumnWidths.length; i++) { - totalWidth= totalWidth + pixelColumnWidths[i]; - } - - // The total height is the margin plus border height, plus space between each row, - // plus the height of the tallest child in each row. - totalHeight= (totalMarginHeight * 2) + ((rows - 1) * verticalSpacing); - - //Add up the height of each row. - for (int i= 0; i < pixelRowHeights.length; i++) { - totalHeight= totalHeight + pixelRowHeights[i]; - } - - if (wHint != SWT.DEFAULT) { - totalWidth= wHint; - }; - if (hHint != SWT.DEFAULT) { - totalHeight= hHint; - }; - // The preferred extent is the width and height that will accomodate the grid's widgets. - return new Point(totalWidth, totalHeight); - } - protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { - - if (composite.getChildren().length == 0) - return new Point(0, 0); - - // Make sure that all of the composite children have a layout spec. Do this by - // using the initialLayout flag. - if (flushCache) - initialLayout= true; - if (initialLayout) { - initializeLayoutData(composite); - initialLayout= false; - } - - if (flushCache) { - // Cause the grid and its related information to be calculated - // again. - grid.removeAllElements(); - } - - Point size= computeLayoutSize(composite, wHint, hHint, flushCache); - if (minimumWidth != SWT.DEFAULT && size.x < minimumWidth) { - size.x= minimumWidth; - } - if (minimumHeight != SWT.DEFAULT && size.y < minimumHeight) { - size.y= minimumHeight; - } - return size; - } - void createGrid(Composite composite) { - int row, column, rowFill, columnFill; - Control[] children; - MGridData spacerSpec; - - // - children= composite.getChildren(); - - // - grid.addElement(emptyRow()); - row= 0; - column= 0; - - // Loop through the children and place their associated layout specs in the - // grid. Placement occurs left to right, top to bottom (i.e., by row). - for (int i= 0; i < children.length; i++) { - // Find the first available spot in the grid. - Control child= children[i]; - MGridData spec= (MGridData) child.getLayoutData(); - while (((MGridData[]) grid.elementAt(row))[column] != null) { - column= column + 1; - if (column >= numColumns) { - row= row + 1; - column= 0; - if (row >= grid.size()) { - grid.addElement(emptyRow()); - } - } - } - // See if the place will support the widget's horizontal span. If not, go to the - // next row. - if (column + spec.horizontalSpan - 1 >= numColumns) { - grid.addElement(emptyRow()); - row= row + 1; - column= 0; - } - - // The vertical span for the item will be at least 1. If it is > 1, - // add other rows to the grid. - for (int j= 2; j <= spec.verticalSpan; j++) { - if (row + j > grid.size()) { - grid.addElement(emptyRow()); - } - } - - // Store the layout spec. Also cache the childIndex. NOTE: That we assume the children of a - // composite are maintained in the order in which they are created and added to the composite. - ((MGridData[]) grid.elementAt(row))[column]= spec; - spec.childIndex= i; - - // Put spacers in the grid to account for the item's vertical and horizontal - // span. - rowFill= spec.verticalSpan - 1; - columnFill= spec.horizontalSpan - 1; - for (int r= 1; r <= rowFill; r++) { - for (int c= 0; c < spec.horizontalSpan; c++) { - spacerSpec= new MGridData(); - spacerSpec.isItemData= false; - ((MGridData[]) grid.elementAt(row + r))[column + c]= spacerSpec; - } - } - for (int c= 1; c <= columnFill; c++) { - for (int r= 0; r < spec.verticalSpan; r++) { - spacerSpec= new MGridData(); - spacerSpec.isItemData= false; - ((MGridData[]) grid.elementAt(row + r))[column + c]= spacerSpec; - } - } - column= column + spec.horizontalSpan - 1; - } - - // Fill out empty grid cells with spacers. - for (int k= column + 1; k < numColumns; k++) { - spacerSpec= new MGridData(); - spacerSpec.isItemData= false; - ((MGridData[]) grid.elementAt(row))[k]= spacerSpec; - } - for (int k= row + 1; k < grid.size(); k++) { - spacerSpec= new MGridData(); - spacerSpec.isItemData= false; - ((MGridData[]) grid.elementAt(k))[column]= spacerSpec; - } - } - MGridData[] emptyRow() { - MGridData[] row= new MGridData[numColumns]; - for (int i= 0; i < numColumns; i++) { - row[i]= null; - } - return row; - } - void initializeLayoutData(Composite composite) { - Control[] children= composite.getChildren(); - for (int i= 0; i < children.length; i++) { - Control child= children[i]; - if (child.getLayoutData() == null) { - child.setLayoutData(new MGridData()); - } - } - } - protected void layout(Composite composite, boolean flushCache) { - //System.out.println("start layout " + id); - //new Error (). printStackTrace(); - int[] columnWidths; - int[] rowHeights; - int rowSize, rowY, columnX; - int compositeWidth, compositeHeight; - int excessHorizontal, excessVertical; - Control[] children; - if (flushCache) { - // Cause the grid and its related information to be calculated - // again. - grid.removeAllElements(); - } - children= composite.getChildren(); - if (children.length == 0) - return; - - // - Point extent= computeLayoutSize(composite, SWT.DEFAULT, SWT.DEFAULT, flushCache); - columnWidths= new int[numColumns]; - for (int i= 0; i < pixelColumnWidths.length; i++) { - columnWidths[i]= pixelColumnWidths[i]; - } - rowHeights= new int[grid.size()]; - for (int i= 0; i < pixelRowHeights.length; i++) { - rowHeights[i]= pixelRowHeights[i]; - } - int columnWidth= 0; - rowSize= Math.max(1, grid.size()); - - // - compositeWidth= extent.x; - compositeHeight= extent.y; - - // Calculate whether or not there is any extra space or not enough space due to a resize - // operation. Then allocate/deallocate the space to columns and rows that are expandable. - // If a widget grabs excess space, its last column or row will be expandable. - excessHorizontal= composite.getClientArea().width - compositeWidth; - excessVertical= composite.getClientArea().height - compositeHeight; - - // Allocate/deallocate horizontal space. - if (expandableColumns.length != 0) { - int excess, remainder, last; - int colWidth; - excess= excessHorizontal / expandableColumns.length; - remainder= excessHorizontal % expandableColumns.length; - last= 0; - for (int i= 0; i < expandableColumns.length; i++) { - int expandableCol= expandableColumns[i]; - colWidth= columnWidths[expandableCol]; - colWidth= colWidth + excess; - columnWidths[expandableCol]= colWidth; - last= Math.max(last, expandableCol); - } - colWidth= columnWidths[last]; - colWidth= colWidth + remainder; - columnWidths[last]= colWidth; - } - - // Go through all specs in each expandable column and get the maximum specified - // widthHint. Use this as the minimumWidth for the column. - for (int i= 0; i < expandableColumns.length; i++) { - int expandableCol= expandableColumns[i]; - int colWidth= columnWidths[expandableCol]; - int minWidth= 0; - for (int j= 0; j < grid.size(); j++) { - MGridData[] row= (MGridData[]) grid.elementAt(j); - MGridData spec= row[expandableCol]; - minWidth= Math.max(minWidth, spec.widthHint); - } - columnWidths[expandableCol]= Math.max(colWidth, minWidth); - } - // Allocate/deallocate vertical space. - if (expandableRows.length != 0) { - int excess, remainder, last; - int rowHeight; - excess= excessVertical / expandableRows.length; - remainder= excessVertical % expandableRows.length; - last= 0; - for (int i= 0; i < expandableRows.length; i++) { - int expandableRow= expandableRows[i]; - rowHeight= rowHeights[expandableRow]; - rowHeight= rowHeight + excess; - rowHeights[expandableRow]= rowHeight; - last= Math.max(last, expandableRow); - } - rowHeight= rowHeights[last]; - rowHeight= rowHeight + remainder; - rowHeights[last]= rowHeight; - } - // Go through all specs in each expandable row and get the maximum specified - // heightHint. Use this as the minimumHeight for the row. - for (int i= 0; i < expandableRows.length; i++) { - int expandableRow= expandableRows[i]; - int rowHeight= rowHeights[expandableRow]; - int minHeight= 0; - MGridData[] row= (MGridData[]) grid.elementAt(expandableRow); - for (int j= 0; j < numColumns; j++) { - MGridData spec= row[j]; - minHeight= Math.max(minHeight, spec.heightHint); - } - rowHeights[expandableRow]= Math.max(rowHeight, minHeight); - } - - // Get the starting x and y. - columnX= marginWidth + composite.getBorderWidth() + composite.getClientArea().x; - rowY= marginHeight + composite.getBorderWidth() + composite.getClientArea().y; - - // Layout the widget left to right, top to bottom. - for (int r= 0; r < rowSize; r++) { - int rowHeight= rowHeights[r]; - MGridData[] row= (MGridData[]) grid.elementAt(r); - - // - for (int c= 0; c < row.length; c++) { - int spannedWidth= 0, spannedHeight= 0; - int hAlign= 0, vAlign= 0; - int widgetX= 0, widgetY= 0; - int widgetW= 0, widgetH= 0; - - // - MGridData spec= (MGridData) row[c]; - if (makeColumnsEqualWidth) { - columnWidth= composite.getBounds().width - ((marginWidth + composite.getBorderWidth()) * 2) - ((numColumns - 1) * horizontalSpacing); - columnWidth= columnWidth / numColumns; - for (int i= 0; i < columnWidths.length; i++) { - columnWidths[i]= columnWidth; - } - } else { - columnWidth= columnWidths[c]; - } - - // - spannedWidth= columnWidth; - for (int k= 1; k < spec.horizontalSpan; k++) { - if ((c + k) <= numColumns) { - if (!makeColumnsEqualWidth) { - columnWidth= columnWidths[c + k]; - } - spannedWidth= spannedWidth + columnWidth + horizontalSpacing; - } - } - - // - spannedHeight= rowHeight; - for (int k= 1; k < spec.verticalSpan; k++) { - if ((r + k) <= grid.size()) { - spannedHeight= spannedHeight + rowHeights[r + k] + verticalSpacing; - } - } - - // - if (spec.isItemData()) { - Control child= children[spec.childIndex]; - Point childExtent= child.computeSize(spec.widthHint, spec.heightHint, flushCache); - hAlign= spec.horizontalAlignment; - widgetX= columnX; - - // Calculate the x and width values for the widget. - if (hAlign == MGridData.CENTER) { - widgetX= widgetX + (spannedWidth / 2) - (childExtent.x / 2); - } else if (hAlign == MGridData.END) { - widgetX= widgetX + spannedWidth - childExtent.x - spec.horizontalIndent; - } else { - widgetX= widgetX + spec.horizontalIndent; - } - if (hAlign == MGridData.FILL) { - widgetW= spannedWidth - spec.horizontalIndent; - widgetX= columnX + spec.horizontalIndent; - } else { - widgetW= childExtent.x; - } - - // Calculate the y and height values for the widget. - vAlign= spec.verticalAlignment; - widgetY= rowY; - if (vAlign == MGridData.CENTER) { - widgetY= widgetY + (spannedHeight / 2) - (childExtent.y / 2); - } else if (vAlign == MGridData.END) { - widgetY= widgetY + spannedHeight - childExtent.y; - } else { - //widgetY= widgetY; - } - if (vAlign == MGridData.FILL) { - widgetH= spannedHeight; - widgetY= rowY; - } else { - widgetH= childExtent.y; - } - // Place the widget. - child.setBounds(widgetX, widgetY, widgetW, widgetH); - } - // Update the starting x value. - columnX= columnX + columnWidths[c] + horizontalSpacing; - } - // Update the starting y value and since we're starting a new row, reset the starting x value. - rowY= rowY + rowHeights[r] + verticalSpacing; - columnX= marginWidth + composite.getBorderWidth() + composite.getClientArea().x; - } - //System.out.println("end layout " + id); - } - public MGridLayout() { - super(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java deleted file mode 100644 index f1f342cdc37..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementContentProvider.java +++ /dev/null @@ -1,342 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ElementChangedEvent; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICElementDelta; -import org.eclipse.cdt.core.model.ICModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IElementChangedListener; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.core.model.ArchiveContainer; -import org.eclipse.cdt.internal.core.model.BinaryContainer; -import org.eclipse.cdt.internal.ui.BaseCElementContentProvider; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.widgets.Control; - -public class CElementContentProvider extends BaseCElementContentProvider implements ITreeContentProvider, IElementChangedListener { - - protected StructuredViewer fViewer; - protected Object fInput; - - /* (non-Cdoc) - * Method declared on IContentProvider. - */ - public void dispose() { - super.dispose(); - CoreModel.getDefault().removeElementChangedListener(this); - } - - /* (non-Cdoc) - * Method declared on IContentProvider. - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - - super.inputChanged(viewer, oldInput, newInput); - - fViewer = (StructuredViewer)viewer; - - if (oldInput == null && newInput != null) { - if (newInput instanceof ICModel) - CoreModel.getDefault().addElementChangedListener(this); - } else if (oldInput != null && newInput == null) { - CoreModel.getDefault().removeElementChangedListener(this); - } - fInput= newInput; - } - - /** - * Creates a new content provider for C elements. - */ - public CElementContentProvider() { - } - - /** - * Creates a new content provider for C elements. - */ - public CElementContentProvider(boolean provideMembers, boolean provideWorkingCopy) { - super(provideMembers, provideWorkingCopy); - } - - /* (non-Cdoc) - * Method declared on IElementChangedListener. - */ - public void elementChanged(final ElementChangedEvent event) { - try { - processDelta(event.getDelta()); - } catch(CModelException e) { - CUIPlugin.getDefault().log(e); - e.printStackTrace(); - } - } - - /** - * Processes a delta recursively. When more than two children are affected the - * tree is fully refreshed starting at this node. The delta is processed in the - * current thread but the viewer updates are posted to the UI thread. - */ - protected void processDelta(ICElementDelta delta) throws CModelException { - int kind= delta.getKind(); - int flags= delta.getFlags(); - ICElement element= delta.getElement(); - - //System.out.println("Processing " + element); - // handle open and closing of a solution or project - if (((flags & ICElementDelta.F_CLOSED) != 0) - || ((flags & ICElementDelta.F_OPENED) != 0)) { - postRefresh(element); - } - - if (kind == ICElementDelta.REMOVED) { - Object parent = internalGetParent(element); - postRemove(element); - if (updateContainer(element)) { - postRefresh(parent); - } - } - - if (kind == ICElementDelta.ADDED) { - Object parent= internalGetParent(element); - postAdd(parent, element); - if (updateContainer(element)) { - postRefresh(parent); - } - } - - if (kind == ICElementDelta.CHANGED) { - if ((flags & ICElementDelta.F_BINARY_PARSER_CHANGED) != 0) { - // throw the towel and do a full refresh of the affected C project. - postRefresh(element.getCProject()); - return; - } else if (element instanceof ITranslationUnit || - element instanceof IBinary || element instanceof IArchive) { - postRefresh(element); - return; - } else if (element instanceof ArchiveContainer || element instanceof BinaryContainer) { - postContainerRefresh((IParent) element, element.getCProject()); - } - - } - - if (delta.getResourceDeltas() != null) { - IResourceDelta[] rd= delta.getResourceDeltas(); - for (int i= 0; i < rd.length; i++) { - processResourceDelta(rd[i], element); - } - } - - ICElementDelta[] affectedChildren= delta.getAffectedChildren(); - for (int i= 0; i < affectedChildren.length; i++) { - processDelta(affectedChildren[i]); - } - - // Make sure that containers are updated. - //if (element instanceof ICModel) { - // updateContainer((ICModel)element); - //} - } - - /* - * Process resource deltas - */ - private void processResourceDelta(IResourceDelta delta, Object parent) { - int status= delta.getKind(); - IResource resource= delta.getResource(); - // filter out changes affecting the output folder - if (resource == null) { - return; - } - - // this could be optimized by handling all the added children in the parent - if ((status & IResourceDelta.REMOVED) != 0) { -// if (!(parent instanceof ICContainer)) { -// // refresh one level above to deal with empty package filtering properly -// postRefresh(internalGetParent(parent)); -// } else { -// postRemove(resource); -// } - postRemove(resource); - } - if ((status & IResourceDelta.ADDED) != 0) { -// if (!(parent instanceof ICContainer)) { -// // refresh one level above to deal with empty package filtering properly -// postRefresh(internalGetParent(parent)); -// } else { -// postAdd(parent, resource); -// } - postAdd(parent, resource); - } - IResourceDelta[] affectedChildren= delta.getAffectedChildren(); - - if (affectedChildren.length > 1) { - // more than one child changed, refresh from here downwards - postRefresh(resource); - return; - } - - for (int i= 0; i < affectedChildren.length; i++) { - processResourceDelta(affectedChildren[i], resource); - } - } - - -// private void updateContainer(ICModel root) { -// postRunnable(new Runnable() { -// public void run () { -// Control ctrl= fViewer.getControl(); -// if (ctrl != null && !ctrl.isDisposed()) { -// IStructuredSelection s = (IStructuredSelection)fViewer.getSelection(); -// if (s.isEmpty()) -// return; -// Object element = s.getFirstElement(); -// if (element instanceof ICProject) { -// updateContainer((ICProject)element); -// } -// } -// } -// }); -// } - -// protected boolean updateContainer(ICProject cproject) { -// IParent binContainer = cproject.getBinaryContainer(); -// IParent libContainer = cproject.getArchiveContainer(); -// if (binContainer != null) { -// postContainerRefresh(binContainer, cproject); -// } -// if (libContainer != null) { -// postContainerRefresh(libContainer, cproject); -// } -// return false; -// } - - private boolean updateContainer(ICElement cfile) { - IParent container = null; - ICProject cproject = null; - if (cfile instanceof IBinary) { - IBinary bin = (IBinary)cfile; - if (bin.isExecutable() || bin.isSharedLib()) { - cproject = bin.getCProject(); - container = cproject.getBinaryContainer(); - } - } else if (cfile instanceof IArchive) { - cproject = cfile.getCProject(); - container = cproject.getArchiveContainer(); - } - if (container != null) { - postContainerRefresh(container, cproject); - return true; - } - return false; - } - - private void postContainerRefresh(final IParent container, final ICProject cproject) { - //System.out.println("UI Container:" + cproject + " " + container); - postRunnable(new Runnable() { - public void run () { - Control ctrl= fViewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) { - if (container.hasChildren()) { - if (fViewer.testFindItem(container) != null) { - fViewer.refresh(container); - } else { - fViewer.refresh(cproject); - } - } else { - fViewer.refresh(cproject); - } - } - } - }); - } - - private void postRefresh(final Object root) { - //System.out.println("UI refresh:" + root); - postRunnable(new Runnable() { - public void run() { - // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window. - Control ctrl= fViewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) - fViewer.refresh(root); - } - }); - } - - private void postAdd(final Object parent, final Object element) { - //System.out.println("UI add:" + parent + " " + element); - postRunnable(new Runnable() { - public void run() { - // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window. - Control ctrl= fViewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) -// fViewer.add(parent, element); - fViewer.refresh(parent); - } - }); - } - - private void postRemove(final Object element) { - //System.out.println("UI remove:" + element); - postRunnable(new Runnable() { - public void run() { - // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window. - Control ctrl= fViewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) -// fViewer.remove(element); - fViewer.refresh(internalGetParent(element)); - } - }); - } - - private void postRunnable(final Runnable r) { - Control ctrl= fViewer.getControl(); - if (ctrl != null && !ctrl.isDisposed()) - ctrl.getDisplay().asyncExec(r); - } - - /** - * The workbench has changed. Process the delta and issue updates to the viewer, - * inside the UI thread. - * - * @see IResourceChangeListener#resourceChanged - */ - //public void resourceChanged(final IResourceChangeEvent event) { - // final IResourceDelta delta = event.getDelta(); - // Control ctrl = viewer.getControl(); - // if (ctrl != null && !ctrl.isDisposed()) { - // ctrl.getDisplay().syncExec(new Runnable() { - // public void run() { - // processDelta(delta); - // } - // }); - // } - //} - - - /** - * Returns the implementation of IWorkbenchAdapter for the given - * object. Returns null if the adapter is not defined or the - * object is not adaptable. - */ - protected ICElement getAdapter(Object o) { - if (!(o instanceof IAdaptable)) { - return null; - } - return (ICElement)((IAdaptable)o).getAdapter(ICElement.class); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java deleted file mode 100644 index 00aea4fa944..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; - -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.jface.resource.CompositeImageDescriptor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.Assert; - - -/** - * A JavaImageDescriptor consists of a base image and several adornments. The adornments - * are computed according to the flags either passed during creation or set via the method - * setAdornments. - *

            - * It is guaranteed that objects that conform to this interface are also instances of type - * ImageDescriptor - *

            - * Note: This class/interface is part of an interim API that is still under development - * and expected to change before reaching stability. - *

            - * - * @since 2.0 - */ -public class CElementImageDescriptor extends CompositeImageDescriptor { - - /** Flag to render the abstract adornment */ - public final static int TEMPLATE= 0x001; - - /** Flag to render the const adornment */ - public final static int CONSTANT= 0x002; - - /** Flag to render the volatile adornment */ - public final static int VOLATILE= 0x004; - - /** Flag to render the static adornment */ - public final static int STATIC= 0x008; - - /** Flag to render the runnable adornment */ - public final static int RUNNABLE= 0x010; - - /** Flag to render the waring adornment */ - public final static int WARNING= 0x020; - - /** Flag to render the error adornment */ - public final static int ERROR= 0x040; - - /** Flag to render the 'override' adornment */ - public final static int OVERRIDES= 0x080; - - /** Flag to render the 'implements' adornment */ - public final static int IMPLEMENTS= 0x100; - - private ImageDescriptor fBaseImage; - private int fFlags; - private Point fSize; - - /** - * Create a new JavaElementImageDescriptor. - * - * @param baseImage an image descriptor used as the base image - * @param flags flags indicating which adornments are to be rendered. See setAdornments - * for valid values. - * @param size the size of the resulting image - * @see #setAdornments(int) - */ - public CElementImageDescriptor(ImageDescriptor baseImage, int flags, Point size) { - fBaseImage= baseImage; - Assert.isNotNull(fBaseImage); - fFlags= flags; - Assert.isTrue(fFlags >= 0); - fSize= size; - Assert.isNotNull(fSize); - } - - /** - * Sets the descriptors adornments. Valid values are: ABSTRACT, FINAL, - * SYNCHRONIZED,
            STATIC, RUNNABLE, WARNING, - * ERROR, OVERRIDDEN, or any combination of those. - * - * @param adornments the image descritpors adornments - */ - public void setAdornments(int adornments) { - Assert.isTrue(adornments >= 0); - fFlags= adornments; - } - - /** - * Returns the current adornments. - * - * @return the current adornments - */ - public int getAdronments() { - return fFlags; - } - - /** - * Sets the size of the image created by calling createImage(). - * - * @param size the size of the image returned from calling createImage() - */ - public void setImageSize(Point size) { - Assert.isNotNull(size); - Assert.isTrue(size.x >= 0 && size.y >= 0); - fSize= size; - } - - /** - * Returns the size of the image created by calling createImage(). - * - * @return the size of the image created by calling createImage - */ - public Point getImageSize() { - return new Point(fSize.x, fSize.y); - } - - /* (non-Javadoc) - * Method declared in CompositeImageDescriptor - */ - protected Point getSize() { - return fSize; - } - - /* (non-Javadoc) - * Method declared on Object. - */ - public boolean equals(Object object) { - if (!CElementImageDescriptor.class.equals(object.getClass())) - return false; - - CElementImageDescriptor other= (CElementImageDescriptor)object; - return (fBaseImage.equals(other.fBaseImage) && fFlags == other.fFlags && fSize.equals(other.fSize)); - } - - /* (non-Javadoc) - * Method declared on Object. - */ - public int hashCode() { - return fBaseImage.hashCode() | fFlags | fSize.hashCode(); - } - - /* (non-Javadoc) - * Method declared in CompositeImageDescriptor - */ - protected void drawCompositeImage(int width, int height) { - ImageData bg; - if ((bg= fBaseImage.getImageData()) == null) - bg= DEFAULT_IMAGE_DATA; - - drawImage(bg, 0, 0); - drawTopRight(); - drawBottomRight(); - drawBottomLeft(); - } - - private void drawTopRight() { - int x= getSize().x; - ImageData data= null; - if ((fFlags & VOLATILE) != 0) { - data= CPluginImages.DESC_OVR_VOLATILE.getImageData(); - x-= data.width; - drawImage(data, x, 0); - } - if ((fFlags & CONSTANT) != 0) { - data= CPluginImages.DESC_OVR_CONSTANT.getImageData(); - x-= data.width; - drawImage(data, x, 0); - } - if ((fFlags & STATIC) != 0) { - data= CPluginImages.DESC_OVR_STATIC.getImageData(); - x-= data.width; - drawImage(data, x, 0); - } - if ((fFlags & TEMPLATE) != 0) { - data= CPluginImages.DESC_OVR_TEMPLATE.getImageData(); - x-= data.width; - drawImage(data, x, 0); - } - } - - private void drawBottomRight() { - //Point size= getSize(); - //int x= size.x; - //ImageData data= null; - /*if ((fFlags & SYNCHRONIZED) != 0) { - data= CPluginImages.DESC_OVR_SYNCH.getImageData(); - x-= data.width; - drawImage(data, x, size.y - data.height); - } - if ((fFlags & RUNNABLE) != 0) { - data= CPluginImages.DESC_OVR_RUN.getImageData(); - x-= data.width; - drawImage(data, x, size.y - data.height); - } - if ((fFlags & OVERRIDES) != 0) { - data= CPluginImages.DESC_OVR_OVERRIDES.getImageData(); - x-= data.width; - drawImage(data, x, size.y - data.height); - } - if ((fFlags & IMPLEMENTS) != 0) { - data= CPluginImages.DESC_OVR_IMPLEMENTS.getImageData(); - x-= data.width; - drawImage(data, x, size.y - data.height); - } */ - } - - private void drawBottomLeft() { - Point size= getSize(); - int x= 0; - ImageData data= null; - if ((fFlags & ERROR) != 0) { - data= CPluginImages.DESC_OVR_ERROR.getImageData(); - drawImage(data, x, size.y - data.height); - x+= data.width; - } - if ((fFlags & WARNING) != 0) { - data= CPluginImages.DESC_OVR_WARNING.getImageData(); - drawImage(data, x, size.y - data.height); - x+= data.width; - } - } -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java deleted file mode 100644 index 5e56f690a23..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java +++ /dev/null @@ -1,222 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.INamespace; -import org.eclipse.cdt.core.model.ITemplate; -import org.eclipse.cdt.core.model.ITypeDef; -import org.eclipse.cdt.core.model.IVariableDeclaration; -import org.eclipse.cdt.internal.ui.CElementImageProvider; -import org.eclipse.cdt.internal.ui.ErrorTickAdornmentProvider; -import org.eclipse.cdt.internal.ui.IAdornmentProvider; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * The label provider for the c model elements. - */ -public class CElementLabelProvider extends LabelProvider { - - private ImageRegistry fImageRegistry; - private WorkbenchLabelProvider fWorkbenchLabelProvider; - - private CElementImageProvider fImageLabelProvider; - - private IAdornmentProvider[] fAdornmentProviders; - - private int fImageFlags; - private int fTextFlags; - - public CElementLabelProvider() { - this(0 /* CElementLabels.M_PARAMETER_TYPES */, CElementImageProvider.OVERLAY_ICONS, null); - } - - /** - * @param textFlags Flags defined in JavaElementLabels. - * @param imageFlags Flags defined in JavaElementImageProvider. - */ - public CElementLabelProvider(int textFlags, int imageFlags, IAdornmentProvider[] adormentProviders) { - fImageRegistry= CUIPlugin.getDefault().getImageRegistry(); - fWorkbenchLabelProvider= new WorkbenchLabelProvider(); - - fImageLabelProvider= new CElementImageProvider(); - fAdornmentProviders= adormentProviders; - - fImageFlags= imageFlags; - fTextFlags= textFlags; - } - - /** - * @see ILabelProvider#getText - */ - public String getText(Object element) { - if (element instanceof ICElement) { - ICElement celem= (ICElement)element; - - StringBuffer name = new StringBuffer(); - switch(celem.getElementType()){ - case ICElement.C_FIELD: - case ICElement.C_VARIABLE: - case ICElement.C_VARIABLE_DECLARATION: - IVariableDeclaration vDecl = (IVariableDeclaration) celem; - name.append(vDecl.getElementName()); - if((vDecl.getTypeName() != null) &&(vDecl.getTypeName().length() > 0)){ - name.append(" : "); - name.append(vDecl.getTypeName()); - } - break; - case ICElement.C_FUNCTION: - case ICElement.C_FUNCTION_DECLARATION: - case ICElement.C_METHOD: - case ICElement.C_METHOD_DECLARATION: - IFunctionDeclaration fDecl = (IFunctionDeclaration) celem; - name.append(fDecl.getSignature()); - if((fDecl.getReturnType() != null) &&(fDecl.getReturnType().length() > 0)){ - name.append(" : "); - name.append(fDecl.getReturnType()); - } - break; - case ICElement.C_STRUCT: - case ICElement.C_UNION: - case ICElement.C_ENUMERATION: - if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){ - name.append(celem.getElementName()); - } else if (celem instanceof IVariableDeclaration) { - IVariableDeclaration varDecl = (IVariableDeclaration) celem; - name.append(varDecl.getTypeName()); - } - break; - case ICElement.C_TYPEDEF: - ITypeDef tDecl = (ITypeDef) celem; - name.append(tDecl.getElementName()); - if((tDecl.getTypeName() != null) &&(tDecl.getTypeName().length() > 0)){ - name.append(" : "); - name.append(tDecl.getTypeName()); - } - break; - case ICElement.C_NAMESPACE: - if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){ - name.append(celem.getElementName()); - } else if (celem instanceof INamespace) { - INamespace nDecl = (INamespace) celem; - name.append(nDecl.getTypeName()); - } - break; - case ICElement.C_TEMPLATE_CLASS: - case ICElement.C_TEMPLATE_FUNCTION: - case ICElement.C_TEMPLATE_METHOD: - case ICElement.C_TEMPLATE_STRUCT: - case ICElement.C_TEMPLATE_UNION: - case ICElement.C_TEMPLATE_VARIABLE: - ITemplate template = (ITemplate) celem; - String signature = template.getTemplateSignature(); - name.append(signature); - break; - default: - name.append(celem.getElementName()); - break; - } - - if (celem instanceof IBinary) { - IBinary bin = (IBinary)celem; - name.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); - } - return name.toString(); - } - return fWorkbenchLabelProvider.getText(element); - } - - /** - * @see ILabelProvider#getImage - */ - public Image getImage(Object element) { - int imageFlags= getImageFlags(); - if (fAdornmentProviders != null) { - for (int i= 0; i < fAdornmentProviders.length; i++) { - imageFlags |= fAdornmentProviders[i].computeAdornmentFlags(element); - } - } - - if(element instanceof ICElement) { - Image result= fImageLabelProvider.getImageLabel(element, imageFlags); - if (result != null) { - return result; - } - } - return fWorkbenchLabelProvider.getImage(element); - } - - /** - * @see IBaseLabelProvider#dispose() - */ - public void dispose() { - if (fAdornmentProviders != null) { - for (int i= 0; i < fAdornmentProviders.length; i++) { - fAdornmentProviders[i].dispose(); - } - } - if (fWorkbenchLabelProvider != null) { - fWorkbenchLabelProvider.dispose(); - fWorkbenchLabelProvider= null; - } - fImageRegistry= null; - if(fImageLabelProvider != null) { - fImageLabelProvider.dispose(); - } - } - - /** - * Sets the textFlags. - * @param textFlags The textFlags to set - */ - public void setTextFlags(int textFlags) { - fTextFlags= textFlags; - } - - /** - * Sets the imageFlags - * @param imageFlags The imageFlags to set - */ - public void setImageFlags(int imageFlags) { - fImageFlags= imageFlags; - } - - /** - * Gets the image flags. - * Can be overwriten by super classes. - * @return Returns a int - */ - public int getImageFlags() { - return fImageFlags; - } - - /** - * Gets the text flags. Can be overwriten by super classes. - * @return Returns a int - */ - public int getTextFlags() { - return fTextFlags; - } - - public static IAdornmentProvider[] getAdornmentProviders(boolean errortick, IAdornmentProvider extra) { - if (errortick) { - if (extra == null) { - return new IAdornmentProvider[] { new ErrorTickAdornmentProvider() }; - } else { - return new IAdornmentProvider[] { new ErrorTickAdornmentProvider(), extra }; - } - } - if (extra != null) { - return new IAdornmentProvider[] { extra }; - } - return null; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CLocalSelectionTransfer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CLocalSelectionTransfer.java deleted file mode 100644 index 8c63a76d712..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CLocalSelectionTransfer.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.eclipse.cdt.ui; - -import java.util.Arrays; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.dnd.ByteArrayTransfer; -import org.eclipse.swt.dnd.TransferData; - -/** - * @author kcampbell - */ -public class CLocalSelectionTransfer extends ByteArrayTransfer { - private static final CLocalSelectionTransfer INSTANCE = new CLocalSelectionTransfer(); - - private final String typeName; - private final int typeId; - private ISelection selection; - - private CLocalSelectionTransfer() { - super(); - // Try to ensure that different Eclipse applications use different "types" of CLocalSelectionTransfer - typeName = "cdt-local-selection-transfer-format" + System.currentTimeMillis(); //$NON-NLS-1$; - typeId = registerType(typeName); - selection = null; - } - - /** - * Returns the singleton. - */ - public static CLocalSelectionTransfer getInstance() { - return INSTANCE; - } - - /** - * Sets the transfer data for local use. - */ - public void setSelection(ISelection selection) { - this.selection = selection; - } - - /** - * Returns the local transfer data. - */ - public ISelection getSelection() { - return selection; - } - - public void javaToNative(Object object, TransferData transferData) { - // No encoding needed since this is a hardcoded string read and written in the same process. - // See nativeToJava below - super.javaToNative(typeName.getBytes(), transferData); - } - - public Object nativeToJava(TransferData transferData) { - Object result = super.nativeToJava(transferData); - - // No decoding needed: see javaToNative above. - Assert.isTrue(result instanceof byte[] && Arrays.equals(typeName.getBytes(), (byte[]) result)); - - return selection; - } - - /** - * The type id used to identify this transfer. - */ - protected int[] getTypeIds() { - return new int[] { typeId }; - } - - protected String[] getTypeNames() { - return new String[] { typeName }; - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java deleted file mode 100644 index 7ec82a06d64..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corp. - Rational Software - initial implementation - ******************************************************************************/ -/* - * Created on Jun 18, 2003 - */ -package org.eclipse.cdt.ui; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.search.IMatch; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.search.CSearchMessages; -import org.eclipse.cdt.internal.ui.search.CSearchResultCollector; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.search.ui.ISearchResultViewEntry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; - -/** - * @author aniefer - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class CSearchResultLabelProvider extends LabelProvider { - - public static final int SHOW_NAME_ONLY = 0; - public static final int SHOW_ELEMENT_CONTAINER = 1; - public static final int SHOW_CONTAINER_ELEMENT = 2; - public static final int SHOW_PATH = 3;//default - - public static final String POTENTIAL_MATCH = CSearchMessages.getString("CSearchResultLabelProvider.potentialMatch"); //$NON-NLS-1$ - - public CSearchResultLabelProvider(){ - _sortOrder = SHOW_PATH; - } - - public Image getImage( Object element ) { - IMatch match = null; - - if( element instanceof ISearchResultViewEntry ){ - ISearchResultViewEntry viewEntry = (ISearchResultViewEntry)element; - IMarker marker = viewEntry.getSelectedMarker(); - try { - match = (IMatch) marker.getAttribute( CSearchResultCollector.IMATCH ); - } catch (CoreException e) { - return null; - } - } else if ( element instanceof IMatch ){ - match = (IMatch) element; - } - - if( match == null ) - return null; - - ImageDescriptor imageDescriptor = null; - - switch( match.getElementType() ){ - case ICElement.C_CLASS: imageDescriptor = CPluginImages.DESC_OBJS_CLASS; break; - case ICElement.C_STRUCT: imageDescriptor = CPluginImages.DESC_OBJS_STRUCT; break; - case ICElement.C_UNION: imageDescriptor = CPluginImages.DESC_OBJS_UNION; break; - case ICElement.C_NAMESPACE: imageDescriptor = CPluginImages.DESC_OBJS_CONTAINER; break; - case ICElement.C_ENUMERATION: imageDescriptor = CPluginImages.DESC_OBJS_ENUMERATION; break; - case ICElement.C_MACRO: imageDescriptor = CPluginImages.DESC_OBJS_MACRO; break; - case ICElement.C_FUNCTION: imageDescriptor = CPluginImages.DESC_OBJS_FUNCTION; break; - case ICElement.C_VARIABLE: imageDescriptor = CPluginImages.DESC_OBJS_VARIABLE; break; - case ICElement.C_ENUMERATOR: imageDescriptor = CPluginImages.DESC_OBJS_ENUMERATOR; break; - case ICElement.C_TYPEDEF: imageDescriptor = CPluginImages.DESC_OBJS_TYPEDEF; break; - case ICElement.C_FIELD: - { - switch( match.getVisibility() ){ - case ICElement.CPP_PUBLIC: imageDescriptor = CPluginImages.DESC_OBJS_PUBLIC_FIELD; break; - case ICElement.CPP_PRIVATE: imageDescriptor = CPluginImages.DESC_OBJS_PRIVATE_FIELD; break; - default: imageDescriptor = CPluginImages.DESC_OBJS_PROTECTED_FIELD; break; - } - break; - } - case ICElement.C_METHOD: - { - switch( match.getVisibility() ){ - case ICElement.CPP_PUBLIC: imageDescriptor = CPluginImages.DESC_OBJS_PUBLIC_METHOD; break; - case ICElement.CPP_PRIVATE: imageDescriptor = CPluginImages.DESC_OBJS_PRIVATE_METHOD; break; - default: imageDescriptor = CPluginImages.DESC_OBJS_PROTECTED_METHOD; break; - } - break; - } - } - - int flags = 0; - if( match.isStatic() ) flags |= CElementImageDescriptor.STATIC; - if( match.isConst() ) flags |= CElementImageDescriptor.CONSTANT; - if( match.isVolatile() ) flags |= CElementImageDescriptor.VOLATILE; - - imageDescriptor = new CElementImageDescriptor( imageDescriptor, flags, SMALL_SIZE ); - - Image image = CUIPlugin.getImageDescriptorRegistry().get( imageDescriptor ); - - return image; - } - - public String getText( Object element ) { - IMatch match = null; - - if( element instanceof ISearchResultViewEntry ){ - ISearchResultViewEntry viewEntry = (ISearchResultViewEntry) element; - - IMarker marker = viewEntry.getSelectedMarker(); - - try { - match = (IMatch) marker.getAttribute(CSearchResultCollector.IMATCH); - } catch (CoreException e) { - return ""; - } - } else if( element instanceof IMatch ){ - match = (IMatch) element; - } - - if( match == null ) - return ""; - - IResource resource = match.getResource(); - - String result = ""; - String path = (resource != null ) ? resource.getFullPath().toString() : ""; - - switch( getOrder() ){ - case SHOW_NAME_ONLY: - result = match.getName(); - case SHOW_ELEMENT_CONTAINER: - if( !match.getParentName().equals("") ) - result = match.getName() + " - " + match.getParentName() + " ( " + path + " )"; - else - result = match.getName() + " ( " + path + " )"; - - break; - case SHOW_PATH: - result = path + " - " + match.getParentName()+ "::" + match.getName(); - break; - case SHOW_CONTAINER_ELEMENT: - result = match.getParentName() + "::" + match.getName() + " ( " + path + " )"; - break; - } - - return result; - } - - public int getOrder(){ - return _sortOrder; - } - public void setOrder(int orderFlag) { - _sortOrder = orderFlag; - } - - private int _sortOrder; - private int _textFlags; - private int _imageFlags; - - private static final Point SMALL_SIZE= new Point(16, 16); - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java deleted file mode 100644 index 2cff9c6084d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java +++ /dev/null @@ -1,384 +0,0 @@ -package org.eclipse.cdt.ui; - -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - * IBM Corp. - Rational Software -***********************************************************************/ - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.internal.core.model.IBufferFactory; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.ui.BuildConsoleManager; -import org.eclipse.cdt.internal.ui.CElementAdapterFactory; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.ResourceAdapterFactory; -import org.eclipse.cdt.internal.ui.cview.CView; -import org.eclipse.cdt.internal.ui.editor.CDocumentProvider; -import org.eclipse.cdt.internal.ui.editor.SharedTextColors; -import org.eclipse.cdt.internal.ui.editor.WorkingCopyManager; -import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools; -import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage; -import org.eclipse.cdt.internal.ui.preferences.CEditorPreferencePage; -import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage; -import org.eclipse.cdt.internal.ui.text.CTextTools; -import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry; -import org.eclipse.cdt.internal.ui.util.ProblemMarkerManager; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdapterManager; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.text.source.ISharedTextColors; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -public class CUIPlugin extends AbstractUIPlugin { - - private ISharedTextColors fSharedTextColors; - - public static final String PLUGIN_ID = "org.eclipse.cdt.ui"; - public static final String PLUGIN_CORE_ID = "org.eclipse.cdt.core"; - public static final String EDITOR_ID = PLUGIN_ID + ".editor.CEditor"; - public static final String CONSOLE_ID = PLUGIN_ID + ".BuildConsoleView"; - public static final String CVIEW_ID = PLUGIN_ID + ".CView"; - public static final String C_PROBLEMMARKER = PLUGIN_CORE_ID + ".problem"; - - public static final String C_PROJECT_WIZARD_ID = PLUGIN_ID + ".wizards.StdCWizard"; - public static final String CPP_PROJECT_WIZARD_ID = PLUGIN_ID + ".wizards.StdCCWizard"; - - public static final String FILE_WIZARD_ID = "org.eclipse.ui.wizards.new.file"; - public static final String FOLDER_WIZARD_ID = "org.eclipse.ui.wizards.new.folder"; - public static final String CLASS_WIZARD_ID = "org.eclipse.cdt.ui.wizards.NewClassWizard"; - public static final String SEARCH_ACTION_SET_ID = PLUGIN_ID + ".SearchActionSet"; - public static final String FOLDER_ACTION_SET_ID = PLUGIN_ID + ".CFolderActionSet"; - public static final String BUILDER_ID = PLUGIN_CORE_ID + ".cbuilder"; - - private static CUIPlugin fgCPlugin; - private static ResourceBundle fgResourceBundle; - private ImageDescriptorRegistry fImageDescriptorRegistry; - - static String SEPARATOR = System.getProperty("file.separator"); - - // -------- static methods -------- - - static { - try { - fgResourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.internal.ui.CPluginResources"); - } - catch (MissingResourceException x) { - fgResourceBundle = null; - } - } - - public static IBufferFactory getBufferFactory() { - CDocumentProvider provider= CUIPlugin.getDefault().getDocumentProvider(); - if (provider != null) - return provider.getBufferFactory(); - return null; - } - - public static IWorkingCopy[] getSharedWorkingCopies() { - return CCorePlugin.getSharedWorkingCopies(getBufferFactory()); - } - - public static String getResourceString(String key) { - try { - return fgResourceBundle.getString(key); - } - catch (MissingResourceException e) { - return "!" + key + "!"; - } - catch (NullPointerException e) { - return "#" + key + "#"; - } - } - - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - public static String getFormattedString(String key, String arg) { - return MessageFormat.format(getResourceString(key), new String[] { arg }); - } - - public static String getFormattedString(String key, String[] args) { - return MessageFormat.format(getResourceString(key), args); - } - - public static ResourceBundle getResourceBundle() { - return fgResourceBundle; - } - - public IWorkbenchWindow getActiveWorkbenchWindow() { - return getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - /** - * @return - */ - public static IWorkbenchPage getActivePage() { - IWorkbenchWindow window = getDefault().getActiveWorkbenchWindow(); - if (window != null) { - return window.getActivePage(); - } - return null; - } - - public Shell getActiveWorkbenchShell() { - return getActiveWorkbenchWindow().getShell(); - } - - public static CUIPlugin getDefault() { - return fgCPlugin; - } - - public void log(Throwable e) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); - } - - public void log(IStatus status) { - getLog().log(status); - } - - /** - * Utility method with conventions - */ - public static void errorDialog(Shell shell, String title, String message, IStatus s) { - getDefault().log(s); - // if the 'message' resource string and the IStatus' message are the same, - // don't show both in the dialog - if (s != null && message.equals(s.getMessage())) { - message = null; - } - ErrorDialog.openError(shell, title, message, s); - } - - /** - * Utility method with conventions - */ - public static void errorDialog(Shell shell, String title, String message, Throwable t) { - getDefault().log(t); - IStatus status; - if (t instanceof CoreException) { - status = ((CoreException) t).getStatus(); - // if the 'message' resource string and the IStatus' message are the same, - // don't show both in the dialog - if (status != null && message.equals(status.getMessage())) { - message = null; - } - } else { - status = new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, -1, "Internal Error: ", t); //$NON-NLS-1$ - } - ErrorDialog.openError(shell, title, message, status); - } - - // ------ CUIPlugin - - private CoreModel fCoreModel; - private CDocumentProvider fDocumentProvider; - private WorkingCopyManager fWorkingCopyManager; - private CTextTools fTextTools; - private AsmTextTools fAsmTextTools; - private ProblemMarkerManager fProblemMarkerManager; - private BuildConsoleManager fBuildConsoleManager; - private ResourceAdapterFactory fResourceAdapterFactory; - private CElementAdapterFactory fCElementAdapterFactory; - - - public CUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - fgCPlugin = this; - fDocumentProvider = null; - fTextTools = null; - } - - /** - * Returns the used document provider - */ - public synchronized CDocumentProvider getDocumentProvider() { - if (fDocumentProvider == null) { - fDocumentProvider = new CDocumentProvider(); - } - return fDocumentProvider; - } - - /** - * Returns the working copy manager - * @return IWorkingCopyManager - */ - public synchronized IWorkingCopyManager getWorkingCopyManager() { - if (fWorkingCopyManager == null) { - CDocumentProvider provider = getDocumentProvider(); - fWorkingCopyManager = new WorkingCopyManager(provider); - } - return fWorkingCopyManager; - } - - /** - * Returns the shared text tools - */ - public CTextTools getTextTools() { - if (fTextTools == null) - fTextTools = new CTextTools(getPreferenceStore(), CCorePlugin.getDefault().getPluginPreferences()); - return fTextTools; - } - - /** - * Returns the shared assembly text tools - */ - public AsmTextTools getAsmTextTools() { - if (fAsmTextTools == null) - fAsmTextTools = new AsmTextTools(getPreferenceStore(), CCorePlugin.getDefault().getPluginPreferences()); - return fAsmTextTools; - } - - public IBuildConsoleManager getConsoleManager() { - if ( fBuildConsoleManager == null ) { - fBuildConsoleManager = new BuildConsoleManager(); - fBuildConsoleManager.startup(); - } - return fBuildConsoleManager; - } - - /** - * @see Plugin#shutdown - */ - public void shutdown() throws CoreException { - if (fTextTools != null) { - fTextTools.dispose(); - } - if (fImageDescriptorRegistry != null) - fImageDescriptorRegistry.dispose(); - if ( fBuildConsoleManager != null ) { - fBuildConsoleManager.shutdown(); - fBuildConsoleManager = null; - } - - unregisterAdapters(); - - super.shutdown(); - - if (fWorkingCopyManager != null) { - fWorkingCopyManager.shutdown(); - fWorkingCopyManager= null; - } - - if (fDocumentProvider != null) { - fDocumentProvider.shutdown(); - fDocumentProvider= null; - } - } - - private void runUI(Runnable run) { - Display display; - display = Display.getCurrent(); - if (display == null) { - display = Display.getDefault(); - display.asyncExec(run); - } - else { - run.run(); - } - } - - /** - * @see Plugin#startup - */ - public void startup() throws CoreException { - super.startup(); - - runUI(new Runnable() { - public void run() { - registerAdapters(); - CPluginImages.initialize(); - } - }); - } - - /** - * @see AbstractUIPlugin#initializeDefaultPreferences - */ - protected void initializeDefaultPreferences(final IPreferenceStore store) { - super.initializeDefaultPreferences(store); - PreferenceConstants.initializeDefaultValues(store); - - runUI(new Runnable() { - public void run() { - CPluginPreferencePage.initDefaults(store); - CEditorPreferencePage.initDefaults(store); - CView.initDefaults(store); - BuildConsolePreferencePage.initDefaults(store); - } - }); - } - - public CoreModel getCoreModel() { - return fCoreModel; - } - - public static String getPluginId() { - return PLUGIN_ID; - } - - public static ImageDescriptorRegistry getImageDescriptorRegistry() { - return getDefault().internalGetImageDescriptorRegistry(); - } - - private ImageDescriptorRegistry internalGetImageDescriptorRegistry() { - if (fImageDescriptorRegistry == null) - fImageDescriptorRegistry = new ImageDescriptorRegistry(); - return fImageDescriptorRegistry; - } - - /** - * Returns the problem marker manager - */ - public ProblemMarkerManager getProblemMarkerManager() { - if (fProblemMarkerManager == null) - fProblemMarkerManager = new ProblemMarkerManager(); - return fProblemMarkerManager; - } - - protected void registerAdapters() { - fResourceAdapterFactory = new ResourceAdapterFactory(); - fCElementAdapterFactory = new CElementAdapterFactory(); - - IAdapterManager manager = Platform.getAdapterManager(); - manager.registerAdapters(fResourceAdapterFactory, IResource.class); - manager.registerAdapters(fCElementAdapterFactory, ICElement.class); - } - - private void unregisterAdapters() { - IAdapterManager manager = Platform.getAdapterManager(); - manager.unregisterAdapters(fResourceAdapterFactory); - manager.unregisterAdapters(fCElementAdapterFactory); - } - - public ISharedTextColors getSharedTextColors() { - if (fSharedTextColors == null) - fSharedTextColors= new SharedTextColors(); - return fSharedTextColors; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CodeGeneration.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CodeGeneration.java deleted file mode 100644 index 07c0fdddc1c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CodeGeneration.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.ui; - -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.ui.codemanipulation.StubUtility; -import org.eclipse.core.runtime.CoreException; - -/** - * Class that offers access to the templates contained in the 'code generation' preference page. - * - * @since 2.1 - */ -public class CodeGeneration { - - private CodeGeneration() { - } - - /** - * Returns the content for a new compilation unit using the 'new Java file' code template. - * @param cu The compilation to create the source for. The compilation unit does not need to exist. - * @param typeComment The comment for the type to created. Used when the code template contains a ${typecomment} variable. Can be null if - * no comment should be added. - * @param typeContent The code of the type, including type declaration and body. - * @param lineDelimiter The line delimiter to be used. - * @return Returns the new content or null if the template is undefined or empty. - * @throws CoreException - */ - public static String getHeaderFileContent(ITranslationUnit tu, String typeComment, String typeContent, String lineDelimiter) throws CoreException { - return StubUtility.getHeaderFileContent(tu, typeComment, typeContent, lineDelimiter); - } - - /** - * Returns the content for a new compilation unit using the 'new Java file' code template. - * @param cu The compilation to create the source for. The compilation unit does not need to exist. - * @param typeComment The comment for the type to created. Used when the code template contains a ${typecomment} variable. Can be null if - * no comment should be added. - * @param typeContent The code of the type, including type declaration and body. - * @param lineDelimiter The line delimiter to be used. - * @return Returns the new content or null if the template is undefined or empty. - * @throws CoreException - */ - public static String getBodyFileContent(ITranslationUnit tu, String typeComment, String typeContent, String lineDelimiter) throws CoreException { - return StubUtility.getBodyFileContent(tu, typeComment, typeContent, lineDelimiter); - } - - /** - * Returns the content for a new type comment using the 'typecomment' code template. The returned content is unformatted and is not indented. - * @param cu The compilation where the type is contained. The compilation unit does not need to exist. - * @param typeQualifiedName The name of the type to which the comment is added. For inner types the name must be qualified and include the outer - * types names (dot separated). See {@link org.eclipse.jdt.core.IType#getTypeQualifiedName(char)}. - * @param lineDelimiter The line delimiter to be used. - * @return Returns the new content or null if the code template is undefined or empty. The returned content is unformatted and is not indented. - * @throws CoreException - */ - public static String getClassComment(ITranslationUnit tu, String typeQualifiedName, String lineDelimiter) throws CoreException { - return StubUtility.getClassComment(tu, typeQualifiedName, lineDelimiter); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java deleted file mode 100644 index 42ac40b4a30..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/FunctionPrototypeSummary.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.eclipse.cdt.ui; - -/** - * This class is a helper class which takes care of implementing some of the - * function prototype parsing and stripping. - */ -public class FunctionPrototypeSummary implements IFunctionSummary.IFunctionPrototypeSummary { - String fname; - String freturn; - String farguments; - - /** - * Create a function prototype summary based on a prototype string. - * @param The string describing the prototype which is properly - * formed with following format -- returntype function(arguments) - * The following formats will be converted as follows: - * function(arguments) --> void function(arguments) - * returntype function --> returntype function() - * function --> void function() - */ - public FunctionPrototypeSummary(String proto) { - int leftbracket = proto.indexOf('('); - int rightbracket = proto.lastIndexOf(')'); - - //If there are brackets missing, then assume void parameters - if(leftbracket == -1 || rightbracket == -1) { - if(leftbracket != -1) { - proto = proto.substring(leftbracket) + ")"; - } else if(rightbracket != -1) { - proto = proto.substring(rightbracket - 1) + "()"; - } else { - proto = proto + "()"; - } - - leftbracket = proto.indexOf('('); - rightbracket = proto.lastIndexOf(')'); - } - - farguments = proto.substring(leftbracket + 1, rightbracket); - - // fix for bug #44359 - if(farguments.equals("void")) - farguments = ""; - - int nameend = leftbracket - 1; - while(proto.charAt(nameend) == ' ') { - nameend--; - } - - int namestart = nameend; - while(namestart > 0 && proto.charAt(namestart) != ' ') { - namestart--; - } - - fname = proto.substring(namestart, nameend + 1).trim(); - - if(namestart == 0) { - //@@@ Should this be int instead? - freturn = "void"; - } else { - freturn = proto.substring(0, namestart).trim(); - } - } - - public String getName() { - return fname; - } - - public String getReturnType() { - return freturn; - } - - public String getArguments() { - return farguments; - } - - public String getPrototypeString(boolean namefirst) { - StringBuffer buffer = new StringBuffer(); - if(!namefirst) { - buffer.append(getReturnType()); - buffer.append(" "); - } - buffer.append(getName()); - buffer.append("("); - if(getArguments() != null) { - buffer.append(getArguments()); - } - buffer.append(")"); - if(namefirst) { - buffer.append(" "); - buffer.append(getReturnType()); - } - return buffer.toString(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleEvent.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleEvent.java deleted file mode 100644 index b889084fea2..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleEvent.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.cdt.ui; -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.core.resources.IProject; - -public interface IBuildConsoleEvent { - final static int CONSOLE_START = 1; - final static int CONSOLE_CLOSE = 2; - - IProject getProject(); - int getType(); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleListener.java deleted file mode 100644 index 2f47f7cb0fb..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleListener.java +++ /dev/null @@ -1,8 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */package org.eclipse.cdt.ui; - -public interface IBuildConsoleListener { - void consoleChange(IBuildConsoleEvent event); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleManager.java deleted file mode 100644 index e853e6fd539..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IBuildConsoleManager.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.ui; - -import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.text.IDocument; - -public interface IBuildConsoleManager { - IConsole getConsole(IProject project); - IDocument getConsoleDocument(IProject project); - void addConsoleListener(IBuildConsoleListener listener); - void removeConsoleListener(IBuildConsoleListener listener); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICCompletionContributor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICCompletionContributor.java deleted file mode 100644 index 00ff6c1365e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICCompletionContributor.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -public interface ICCompletionContributor { - - /** - * Initialize the completion contributor class - */ - void initialize(); - - /** - * get the matching function of a given name - */ - IFunctionSummary getFunctionInfo(String name); - - /** - * Get array of matching functions starting with this prefix - */ - IFunctionSummary[] getMatchingFunctions(String prefix); -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICDTConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICDTConstants.java deleted file mode 100644 index d48aa6d2167..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/ICDTConstants.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -public interface ICDTConstants -{ - // CDT Extension Points - public static final String EP_TEXT_HOVERS = "textHovers"; - - // Persistance tags. - public static final String TAG_TEXT_HOVER = "textHover"; - - // Atributes - public static final String ATT_CLASS = "class"; - public static final String ATT_ID = "id"; - public static final String ATT_NAME = "name"; - public static final String ATT_PERSPECTIVE = "perspective"; -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IEditorInputDelegate.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IEditorInputDelegate.java deleted file mode 100644 index afbf58bd680..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IEditorInputDelegate.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.ui; - -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.ui.IEditorInput; - -/** - * This interface allows to create flexible editor inputs. - * - * @since May 21, 2003 - */ -public interface IEditorInputDelegate extends IEditorInput { - /** - * Returns the editor input delegate for this editor input. - * - * @return editor input delegate - */ - IEditorInput getDelegate(); - - /** - * Returns the storage associated with this editor input. - * - * @return stirage associated with this editor input - * @throws CoreException on failure. Reasons include: - */ - IStorage getStorage() throws CoreException; -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IFunctionSummary.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IFunctionSummary.java deleted file mode 100644 index 403860cd5d0..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IFunctionSummary.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -public interface IFunctionSummary { - - public interface IFunctionPrototypeSummary { - /** - * Get the name of the function. This should be the - * same as for IFunctionSummary. - * ie "int main(int argc, char **argv)" --> "main" - * @return The name of the function without any additional - * information. - */ - public String getName(); - - /** - * Get the return type of the function. - * ie "int main(int argc, char **argv)" --> "int" - * @return A string containing the return type of the - * function. - */ - public String getReturnType(); - - /** - * Get the arguments of the function. - * ie "int main(int argc, char **argv)" --> "int argc, char **argv" - * @return A string containing the arguments of the - * function, or null if the function has no arguments. - */ - public String getArguments(); - - /** - * Get a nice user defined string. The format of - * which depends on the variable namefirst - * namefirst == true: main(int argc, char **argv) int - * namefirst == false: int main(int argc, char **argv); - * @return - */ - public String getPrototypeString(boolean namefirst); - } - - /** - * Gets the name of the function. This is the simple - * name without any additional return or argument information. - * The function "int main(int argc, char **argv)" would - * return "main" - * @return The name of the function without any additional - * information - */ - public String getName(); - - /** - * Get the full namespace qualifier for this function - * (generally C++ only) - * @return The string of the fully qualified namespace for - * this function, or null if the namespace is not known. - */ - public String getNamespace(); - - /** - * Gets the description of the function. This string can be - * either text or HTML coded and is displayed as part of the - * hover help and as the context proposal information. - * @return A description for this function, or null if no - * description is available. - */ - public String getDescription(); - - /** - * Gets the prototype description for this function. - * @return The IFunctionPrototypeSummary describing the - * prototype for this function - */ - public IFunctionPrototypeSummary getPrototype(); - - /** - * Get headers required by this function - * @return A list of IRequiredInclude definitions, or null if no - * include definitions are available. - */ - public IRequiredInclude[] getIncludes(); -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IRequiredInclude.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IRequiredInclude.java deleted file mode 100644 index d360c55f0f5..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IRequiredInclude.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.cdt.ui; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -public interface IRequiredInclude { - - /** - * Returns the name that has been imported. - * For an on-demand import, this includes the trailing ".*". - * For example, for the statement "import java.util.*", - * this returns "java.util.*". - * For the statement "import java.util.Hashtable", - * this returns "java.util.Hashtable". - */ - String getIncludeName(); - - /** - * Returns whether the include is to search on "standard places" like /usr/include first . - * An include is standard if it starts with "\<". - */ - boolean isStandard(); -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManager.java deleted file mode 100644 index 0a35abf764e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManager.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.ui; - -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.ui.IEditorInput; - -/** - * Interface for accessing working copies of ITranslationUnit - * objects. The original translation unit is only given indirectly by means - * of an IEditorInput. The life cycle is as follows: - *
              - *
            • connect creates and remembers a working copy of the - * translation unit which is encoded in the given editor input
            • - *
            • getWorkingCopy returns the working copy remembered on - * connect
            • - *
            • disconnect destroys the working copy remembered on - * connect
            • - *
            - *

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

            - * - * @see JavaUI#getWorkingCopyManager - */ -public interface IWorkingCopyManager { - - /** - * Connects the given editor input to this manager. After calling - * this method, a working copy will be available for the translation unit encoded - * in the given editor input (does nothing if there is no encoded translation unit). - * - * @param input the editor input - * @exception CoreException if the working copy cannot be created for the - * translation unit - */ - void connect(IEditorInput input) throws CoreException; - - /** - * Disconnects the given editor input from this manager. After calling - * this method, a working copy for the translation unit encoded - * in the given editor input will no longer be available. Does nothing if there - * is no encoded translation unit, or if there is no remembered working copy for - * the translation unit. - * - * @param input the editor input - */ - void disconnect(IEditorInput input); - - /** - * Returns the working copy remembered for the translation unit encoded in the - * given editor input. - * - * @param input the editor input - * @return the working copy of the translation unit, or null if the - * input does not encode an editor input, or if there is no remembered working - * copy for this translation unit - */ - IWorkingCopy getWorkingCopy(IEditorInput input); - - /** - * Shuts down this working copy manager. All working copies still remembered - * by this manager are destroyed. - */ - void shutdown(); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManagerExtension.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManagerExtension.java deleted file mode 100644 index 8527868024d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/IWorkingCopyManagerExtension.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.ui; - -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.ui.IEditorInput; - -/** - * Extension interface for IWorkingCopyManager. - * @since 2.1 - */ -public interface IWorkingCopyManagerExtension { - - /** - * Sets the given working copy for the given editor input. If the given editor input - * is not connected to this working copy manager, this call has no effect.

            - * This working copy manager does not assume the ownership of this working copy, i.e., - * the given working copy is not automatically be freed when this manager is shut down. - * - * @param input the editor input - * @param workingCopy the working copy - */ - void setWorkingCopy(IEditorInput input, IWorkingCopy workingCopy); - - /** - * Removes the working copy set for the given editor input. If there is no - * working copy set for this input or this input is not connected to this - * working copy manager, this call has no effect. - * - * @param input the editor input - */ - void removeWorkingCopy(IEditorInput input); -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java deleted file mode 100644 index e826827a712..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.ui; - -import org.eclipse.swt.graphics.RGB; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; - -import org.eclipse.cdt.internal.ui.text.ICColorConstants; - -/** - * Preference constants used in the CDT-UI preference store. Clients should only read the - * CDT-UI preference store using these values. Clients are not allowed to modify the - * preference store programmatically. - * - * @since 2.0 - */ - -public class PreferenceConstants { - - private PreferenceConstants() { - } - - /** - * Preference key suffix for bold text style preference keys. - */ - public static final String EDITOR_BOLD_SUFFIX= "_bold"; //$NON-NLS-1$ - - /** - * A named preference that controls if comment stubs will be added - * automatically to newly created types and methods. - *

            - * Value is of type Boolean. - *

            - * @since 2.1 - */ - public static final String CODEGEN_ADD_COMMENTS= "org.eclipse.cdt.ui.javadoc"; //$NON-NLS-1$ - - /** - * A named preference that controls whether the cview's selection is linked to the active editor. - *

            - * Value is of type Boolean. - *

            - */ - public static final String PREF_LINK_TO_EDITOR= "org.eclipse.cdt.ui.editor.linkToEditor"; //$NON-NLS-1$ - - /** - * A named preference that speficies whether children of a translation unit are shown in the package explorer. - *

            - * Value is of type Boolean. - *

            - */ - public static final String PREF_SHOW_CU_CHILDREN= "org.eclipse.cdt.ui.editor.CUChildren"; //$NON-NLS-1$ - - /** - * A named preference that speficies whether to use the parser's structural mode to build the CModel. - *

            - * Value is of type Boolean. - *

            - */ - public static final String PREF_USE_STRUCTURAL_PARSE_MODE= "org.eclipse.cdt.ui.editor.UseStructuralMode"; //$NON-NLS-1$ - - /** - * A named preference that controls if segmented view (show selected element only) is turned on or off. - *

            - * Value is of type Boolean. - *

            - */ - public static final String EDITOR_SHOW_SEGMENTS= "org.eclipse.cdt.ui.editor.showSegments"; //$NON-NLS-1$ - - /** - * A named preference that holds the color used to render task tags. - *

            - * Value is of type String. A RGB color value encoded as a string - * using class PreferenceConverter - *

            - * - * @see org.eclipse.jface.resource.StringConverter - * @see org.eclipse.jface.preference.PreferenceConverter - */ - public final static String EDITOR_TASK_TAG_COLOR= ICColorConstants.TASK_TAG; - - /** - * A named preference that controls whether task tags are rendered in bold. - *

            - * Value is of type Boolean. - *

            - */ - public final static String EDITOR_TASK_TAG_BOLD= ICColorConstants.TASK_TAG + EDITOR_BOLD_SUFFIX; - - /** - * A named preference that controls whether the editor shows task indicators in text (squiggly lines). - *

            - * Value is of type Boolean. - *

            - */ - public final static String EDITOR_TASK_INDICATION= "taskIndication"; //$NON-NLS-1$ - - /** - * A named preference that holds the color used to render task indicators. - *

            - * Value is of type String. A RGB color value encoded as a string - * using class PreferenceConverter - *

            - * - * @see #EDITOR_TASK_INDICATION - * @see org.eclipse.jface.resource.StringConverter - * @see org.eclipse.jface.preference.PreferenceConverter - */ - public final static String EDITOR_TASK_INDICATION_COLOR= "taskIndicationColor"; //$NON-NLS-1$ - - /** - * A named preference that controls whether the overview ruler shows task - * indicators. - *

            - * Value is of type Boolean. - *

            - * @since 2.1 - */ - public final static String EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER= "taskIndicationInOverviewRuler"; //$NON-NLS-1$ - - /** - * Returns the JDT-UI preference store. - * - * @return the JDT-UI preference store - */ - public static IPreferenceStore getPreferenceStore() { - return CUIPlugin.getDefault().getPreferenceStore(); - } - - /** - * Initializes the given preference store with the default values. - * - * @param store the preference store to be initialized - */ - public static void initializeDefaultValues(IPreferenceStore store) { - store.setDefault(PreferenceConstants.EDITOR_TASK_INDICATION, false); - PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_TASK_INDICATION_COLOR, new RGB(0, 128, 255)); - store.setDefault(PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER, true); - - PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_TASK_TAG_COLOR, new RGB(127, 159, 191)); - store.setDefault(PreferenceConstants.EDITOR_TASK_TAG_BOLD, true); - } -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/AbstractOpenWizardAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/AbstractOpenWizardAction.java deleted file mode 100644 index f59cc15fde6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/AbstractOpenWizardAction.java +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.ui.actions; - -import java.util.Iterator; - -import org.eclipse.cdt.internal.ui.util.ExceptionHandler; -import org.eclipse.cdt.internal.ui.util.PixelConverter; -import org.eclipse.cdt.internal.ui.wizards.NewWizardMessages; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.IWorkbenchWizard; -import org.eclipse.ui.actions.NewProjectAction; - -public abstract class AbstractOpenWizardAction extends Action implements IWorkbenchWindowActionDelegate { - - private Class[] fActivatedOnTypes; - private boolean fAcceptEmptySelection; - private boolean fNoChecking; - - /** - * Creates a AbstractOpenWizardAction. - * @param label The label of the action - * @param acceptEmptySelection Specifies if the action allows an empty selection - */ - public AbstractOpenWizardAction(String label, boolean acceptEmptySelection) { - this(label, null, acceptEmptySelection); - } - - /** - * Creates a AbstractOpenWizardAction. - * @param label The label of the action - * @param activatedOnTypes The action is only enabled when all objects in the selection - * are of the given types. null will allow all types. - * @param acceptEmptySelection Specifies if the action allows an empty selection - */ - public AbstractOpenWizardAction(String label, Class[] activatedOnTypes, boolean acceptEmptySelection) { - super(label); - fActivatedOnTypes= activatedOnTypes; - fAcceptEmptySelection= acceptEmptySelection; - fNoChecking= false; - } - - /** - * Creates a AbstractOpenWizardAction with no restrictions on types, and does allow - * an empty selection. - */ - protected AbstractOpenWizardAction() { - fActivatedOnTypes= null; - fAcceptEmptySelection= true; - fNoChecking= true; - } - - protected IWorkbench getWorkbench() { - return CUIPlugin.getDefault().getWorkbench(); - } - - private boolean isOfAcceptedType(Object obj) { - if (fActivatedOnTypes != null) { - for (int i= 0; i < fActivatedOnTypes.length; i++) { - if (fActivatedOnTypes[i].isInstance(obj)) { - return true; - } - } - return false; - } - return true; - } - - - private boolean isEnabled(IStructuredSelection selection) { - Iterator iter= selection.iterator(); - while (iter.hasNext()) { - Object obj= iter.next(); - if (!isOfAcceptedType(obj) || !shouldAcceptElement(obj)) { - return false; - } - } - return true; - } - - /** - * Can be overridden to add more checks. - * obj is guaranteed to be instance of one of the accepted types - */ - protected boolean shouldAcceptElement(Object obj) { - return true; - } - - /** - * Creates the specific wizard. - * (to be implemented by a subclass) - */ - abstract protected Wizard createWizard() throws CoreException; - - - protected IStructuredSelection getCurrentSelection() { - IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); - if (window != null) { - ISelection selection= window.getSelectionService().getSelection(); - if (selection instanceof IStructuredSelection) { - return (IStructuredSelection) selection; - } - - } - return null; - } - - /** - * The user has invoked this action. - */ - public void run() { -/* if (!fNoChecking && !canActionBeAdded()) { - return; - } - if (!checkWorkspaceNotEmpty()) { - return; - } -*/ Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell(); - try { - Wizard wizard= createWizard(); - if (wizard instanceof IWorkbenchWizard) { - ((IWorkbenchWizard)wizard).init(getWorkbench(), getCurrentSelection()); - } - - WizardDialog dialog= new WizardDialog(shell, wizard); - PixelConverter converter= new PixelConverter(CUIPlugin.getDefault().getActiveWorkbenchShell()); - - dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20)); - dialog.create(); - dialog.open(); - } catch (CoreException e) { - String title= NewWizardMessages.getString("AbstractOpenWizardAction.createerror.title"); //$NON-NLS-1$ - String message= NewWizardMessages.getString("AbstractOpenWizardAction.createerror.message"); //$NON-NLS-1$ - ExceptionHandler.handle(e, shell, title, message); - } - } - - /** - * Tests if the action can be run on the current selection. - */ - public boolean canActionBeAdded() { - IStructuredSelection selection= getCurrentSelection(); - if (selection == null || selection.isEmpty()) { - return fAcceptEmptySelection; - } - return isEnabled(selection); - } - - /* - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action) { - run(); - } - - /* - * @see IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose() { - } - - /* - * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init(IWorkbenchWindow window) { - } - - /* - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - // selection taken from selectionprovider - } - - protected boolean checkWorkspaceNotEmpty() { - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - if (workspace.getRoot().getProjects().length == 0) { - Shell shell= CUIPlugin.getDefault().getActiveWorkbenchShell(); - String title= NewWizardMessages.getString("AbstractOpenWizardAction.noproject.title"); //$NON-NLS-1$ - String message= NewWizardMessages.getString("AbstractOpenWizardAction.noproject.message"); //$NON-NLS-1$ - if (MessageDialog.openQuestion(shell, title, message)) { - IWorkbenchWindow window= CUIPlugin.getDefault().getActiveWorkbenchWindow(); - (new NewProjectAction(window)).run(); - return workspace.getRoot().getProjects().length != 0; - } - return false; - } - return true; - } - - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java deleted file mode 100644 index cbf3e2ca029..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/MemberFilterActionGroup.java +++ /dev/null @@ -1,267 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.ui.actions; - -/** - * Action Group that contributes filter buttons for a view parts showing - * methods and fields. Contributed filters are: hide fields, hide static - * members and hide non-public members. - *

            - * The action group installs a filter on a structured viewer. The filter is connected - * to the actions installed in the view part's toolbar menu and is updated when the - * state of the buttons changes. - *

            - */ -import org.eclipse.cdt.internal.ui.viewsupport.MemberFilter; -import org.eclipse.cdt.internal.ui.viewsupport.MemberFilterAction; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.internal.ui.actions.ActionMessages; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.actions.ActionGroup; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.CPluginImages; - -public class MemberFilterActionGroup extends ActionGroup { - public static final int FILTER_NONPUBLIC= MemberFilter.FILTER_NONPUBLIC; - public static final int FILTER_STATIC= MemberFilter.FILTER_STATIC; - public static final int FILTER_FIELDS= MemberFilter.FILTER_FIELDS; - - private static final String TAG_HIDEFIELDS= "hidefields"; //$NON-NLS-1$ - private static final String TAG_HIDESTATIC= "hidestatic"; //$NON-NLS-1$ - private static final String TAG_HIDENONPUBLIC= "hidenonpublic"; //$NON-NLS-1$ - - private MemberFilterAction[] fFilterActions; - private MemberFilter fFilter; - - private StructuredViewer fViewer; - private String fViewerId; - private boolean fInViewMenu; - - - /** - * Creates a new MemberFilterActionGroup. - * - * @param viewer the viewer to be filtered - * @param viewerId a unique id of the viewer. Used as a key to to store - * the last used filter settings in the preference store - */ - public MemberFilterActionGroup(StructuredViewer viewer, String viewerId) { - this(viewer, viewerId, false); - } - - /** - * Creates a new MemberFilterActionGroup. - * - * @param viewer the viewer to be filtered - * @param viewerId a unique id of the viewer. Used as a key to to store - * the last used filter settings in the preference store - * @param inViewMenu if true the actions are added to the view - * menu. If false they are added to the toobar. - * - * @since 2.1 - */ - public MemberFilterActionGroup(StructuredViewer viewer, String viewerId, boolean inViewMenu) { - fViewer= viewer; - fViewerId= viewerId; - fInViewMenu= inViewMenu; - - // get initial values - IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore(); - boolean doHideFields= store.getBoolean(getPreferenceKey(FILTER_FIELDS)); - boolean doHideStatic= store.getBoolean(getPreferenceKey(FILTER_STATIC)); - boolean doHidePublic= store.getBoolean(getPreferenceKey(FILTER_NONPUBLIC)); - - fFilter= new MemberFilter(); - if (doHideFields) - fFilter.addFilter(FILTER_FIELDS); - if (doHideStatic) - fFilter.addFilter(FILTER_STATIC); - if (doHidePublic) - fFilter.addFilter(FILTER_NONPUBLIC); - - // fields - String title= ActionMessages.getString("MemberFilterActionGroup.hide_fields.label"); //$NON-NLS-1$ - String helpContext= ICHelpContextIds.FILTER_FIELDS_ACTION; - MemberFilterAction hideFields= new MemberFilterAction(this, title, FILTER_FIELDS, helpContext, doHideFields); - hideFields.setDescription(ActionMessages.getString("MemberFilterActionGroup.hide_fields.description")); //$NON-NLS-1$ - hideFields.setToolTipText(ActionMessages.getString("MemberFilterActionGroup.hide_fields.tooltip")); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(hideFields, CPluginImages.T_LCL, CPluginImages.IMG_ACTION_SHOW_FIELDS); //$NON-NLS-1$ - - // static - title= ActionMessages.getString("MemberFilterActionGroup.hide_static.label"); //$NON-NLS-1$ - helpContext= ICHelpContextIds.FILTER_STATIC_ACTION; - MemberFilterAction hideStatic= new MemberFilterAction(this, title, FILTER_STATIC, helpContext, doHideStatic); - hideStatic.setDescription(ActionMessages.getString("MemberFilterActionGroup.hide_static.description")); //$NON-NLS-1$ - hideStatic.setToolTipText(ActionMessages.getString("MemberFilterActionGroup.hide_static.tooltip")); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(hideStatic, CPluginImages.T_LCL, CPluginImages.IMG_ACTION_SHOW_STATIC); //$NON-NLS-1$ - - // non-public - title= ActionMessages.getString("MemberFilterActionGroup.hide_nonpublic.label"); //$NON-NLS-1$ - helpContext= ICHelpContextIds.FILTER_PUBLIC_ACTION; - MemberFilterAction hideNonPublic= new MemberFilterAction(this, title, FILTER_NONPUBLIC, helpContext, doHidePublic); - hideNonPublic.setDescription(ActionMessages.getString("MemberFilterActionGroup.hide_nonpublic.description")); //$NON-NLS-1$ - hideNonPublic.setToolTipText(ActionMessages.getString("MemberFilterActionGroup.hide_nonpublic.tooltip")); //$NON-NLS-1$ - CPluginImages.setImageDescriptors(hideNonPublic, CPluginImages.T_LCL, CPluginImages.IMG_ACTION_SHOW_PUBLIC); //$NON-NLS-1$ - - // order corresponds to order in toolbar - fFilterActions= new MemberFilterAction[] { hideFields, hideStatic, hideNonPublic }; - - fViewer.addFilter(fFilter); - } - - private String getPreferenceKey(int filterProperty) { - return "MemberFilterActionGroup." + fViewerId + '.' + String.valueOf(filterProperty); //$NON-NLS-1$ - } - - /** - * Sets the member filters. - * - * @param filterProperty the filter to be manipulated. Valid values are FILTER_FIELDS, - * FILTER_PUBLIC, and FILTER_PRIVATE as defined by this action - * group - * @param set if true the given filter is installed. If false the - * given filter is removed - * . - */ - public void setMemberFilter(int filterProperty, boolean set) { - setMemberFilters(new int[] {filterProperty}, new boolean[] {set}, true); - } - - private void setMemberFilters(int[] propertyKeys, boolean[] propertyValues, boolean refresh) { - if (propertyKeys.length == 0) - return; - Assert.isTrue(propertyKeys.length == propertyValues.length); - - for (int i= 0; i < propertyKeys.length; i++) { - int filterProperty= propertyKeys[i]; - boolean set= propertyValues[i]; - if (set) { - fFilter.addFilter(filterProperty); - } else { - fFilter.removeFilter(filterProperty); - } - IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore(); - - for (int j= 0; j < fFilterActions.length; j++) { - int currProperty= fFilterActions[j].getFilterProperty(); - if (currProperty == filterProperty) { - fFilterActions[j].setChecked(set); - } - store.setValue(getPreferenceKey(currProperty), hasMemberFilter(currProperty)); - } - } - if (refresh) { - fViewer.getControl().setRedraw(false); - BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() { - public void run() { - fViewer.refresh(); - } - }); - fViewer.getControl().setRedraw(true); - } - } - - /** - * Returns true if the given filter is installed. - * - * @param filterProperty the filter to be tested. Valid values are FILTER_FIELDS, - * FILTER_PUBLIC, and FILTER_PRIVATE as defined by this action - * group - */ - public boolean hasMemberFilter(int filterProperty) { - return fFilter.hasFilter(filterProperty); - } - - /** - * Saves the state of the filter actions in a memento. - * - * @param memento the memento to which the state is saved - */ - public void saveState(IMemento memento) { - memento.putString(TAG_HIDEFIELDS, String.valueOf(hasMemberFilter(FILTER_FIELDS))); - memento.putString(TAG_HIDESTATIC, String.valueOf(hasMemberFilter(FILTER_STATIC))); - memento.putString(TAG_HIDENONPUBLIC, String.valueOf(hasMemberFilter(FILTER_NONPUBLIC))); - } - - /** - * Restores the state of the filter actions from a memento. - *

            - * Note: This method does not refresh the viewer. - *

            - * @param memento the memento from which the state is restored - */ - public void restoreState(IMemento memento) { - setMemberFilters( - new int[] {FILTER_FIELDS, FILTER_STATIC, FILTER_NONPUBLIC}, - new boolean[] { - Boolean.valueOf(memento.getString(TAG_HIDEFIELDS)).booleanValue(), - Boolean.valueOf(memento.getString(TAG_HIDESTATIC)).booleanValue(), - Boolean.valueOf(memento.getString(TAG_HIDENONPUBLIC)).booleanValue() - }, false); - } - - /* (non-Javadoc) - * @see ActionGroup#fillActionBars(IActionBars) - */ - public void fillActionBars(IActionBars actionBars) { - contributeToToolBar(actionBars.getToolBarManager()); - }; - - /** - * Adds the filter actions to the given tool bar - * - * @param tbm the tool bar to which the actions are added - */ - public void contributeToToolBar(IToolBarManager tbm) { - if (fInViewMenu) - return; - tbm.add(fFilterActions[0]); // fields - tbm.add(fFilterActions[1]); // static - tbm.add(fFilterActions[2]); // public - } - - /** - * Adds the filter actions to the given menu manager. - * - * @param menu the menu manager to which the actions are added - * @since 2.1 - */ - public void contributeToViewMenu(IMenuManager menu) { - if (!fInViewMenu) - return; - final String filters= "filters"; //$NON-NLS-1$ - if (menu.find(filters) != null) { - menu.prependToGroup(filters, fFilterActions[0]); // fields - menu.prependToGroup(filters, fFilterActions[1]); // static - menu.prependToGroup(filters, fFilterActions[2]); // public - } else { - menu.add(fFilterActions[0]); // fields - menu.add(fFilterActions[1]); // static - menu.add(fFilterActions[2]); // public - } - } - - /* (non-Javadoc) - * @see ActionGroup#dispose() - */ - public void dispose() { - super.dispose(); - } - - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/OpenClassWizardAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/OpenClassWizardAction.java deleted file mode 100644 index 0acff18e787..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/OpenClassWizardAction.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.cdt.ui.actions; - -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.wizards.NewClassWizard; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * TODO: Provide description for "OpenClassWizardAction". - * @see IWorkbenchWindowActionDelegate - */ -public class OpenClassWizardAction extends AbstractOpenWizardAction implements IWorkbenchWindowActionDelegate { - public OpenClassWizardAction() { - WorkbenchHelp.setHelp(this, ICHelpContextIds.OPEN_CLASS_WIZARD_ACTION); - } - - public OpenClassWizardAction(String label, Class[] acceptedTypes) { - super(label, acceptedTypes, false); - WorkbenchHelp.setHelp(this, ICHelpContextIds.OPEN_CLASS_WIZARD_ACTION); - } - - protected Wizard createWizard() { - return new NewClassWizard(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java deleted file mode 100644 index d15080549eb..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java +++ /dev/null @@ -1,159 +0,0 @@ -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.ui.dialogs; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -public abstract class AbstractBinaryParserPage extends AbstractCOptionPage { - - protected ICOptionPage fCurrentBinaryParserPage; - protected Map fParserPageMap = null; - - // Composite parent provided by the block. - protected Composite fCompositeParent; - - public AbstractBinaryParserPage() { - super(); - } - - public AbstractBinaryParserPage(String title) { - super(title); - } - - public AbstractBinaryParserPage(String title, ImageDescriptor image) { - super(title, image); - } - - protected Composite getCompositeParent() { - return fCompositeParent; - } - - protected void setCompositeParent(Composite parent) { - fCompositeParent = parent; - } - - /** - * Save the current Binary parser page. - */ - protected void setCurrentBinaryParserPage(ICOptionPage current) { - fCurrentBinaryParserPage = current; - } - - /** - * Get the current Binary parser page. - */ - protected ICOptionPage getCurrentBinaryParserPage() { - return fCurrentBinaryParserPage; - } - - /** - * Notification that the user changed the selection of the Binary Parser. - */ - protected void handleBinaryParserChanged() { - loadDynamicBinaryParserArea(); - } - - /** - * Show the contributed piece of UI that was registered for the Binary parser id. - */ - protected void loadDynamicBinaryParserArea() { - // Dispose of any current child widgets in the tab holder area - Control[] children = getCompositeParent().getChildren(); - for (int i = 0; i < children.length; i++) { - children[i].dispose(); - } - - // Retrieve the dynamic UI for the current parser - String parserID = getCurrentBinaryParserID(); - ICOptionPage page = getBinaryParserPage(parserID); - if (page != null) { - Composite parent = getCompositeParent(); - page.setContainer(getContainer()); - page.createControl(parent); - page.getControl().setVisible(true); - parent.layout(true); - } - setCurrentBinaryParserPage(page); - } - - public void setContainer(ICOptionContainer container) { - super.setContainer(container); - initializeParserPageMap(); - ICOptionPage page = getCurrentBinaryParserPage(); - if (page != null) - page.setContainer(container); - } - - public ICOptionPage getBinaryParserPage(String parserID) { - if (fParserPageMap == null) { - initializeParserPageMap(); - } - IConfigurationElement configElement = (IConfigurationElement) fParserPageMap.get(parserID); - ICOptionPage page = null; - if (configElement != null) { - try { - page = (ICOptionPage) configElement.createExecutableExtension("class"); //$NON-NLS-1$ - } catch (CoreException ce) { - //ce.printStackTrace(); - } - } - return page; - } - - protected void initializeParserPageMap() { - fParserPageMap = new HashMap(5); - - IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor(); - IExtensionPoint extensionPoint = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$ - IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); - for (int i = 0; i < infos.length; i++) { - String id = infos[i].getAttribute("parserID"); //$NON-NLS-1$ - fParserPageMap.put(id, infos[i]); - } - } - - abstract protected String getCurrentBinaryParserID(); - - abstract public void createControl(Composite parent); - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(org.eclipse.core.runtime.IProgressMonitor) - */ - public void performApply(IProgressMonitor monitor) throws CoreException { - ICOptionPage page = getCurrentBinaryParserPage(); - if (page != null) { - page.performApply(monitor); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults() - */ - public void performDefaults() { - ICOptionPage page = getCurrentBinaryParserPage(); - if (page != null) { - page.performDefaults(); - } - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractCOptionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractCOptionPage.java deleted file mode 100644 index 0fd4dc35a9a..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractCOptionPage.java +++ /dev/null @@ -1,59 +0,0 @@ -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.ui.dialogs; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.DialogPage; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.widgets.Composite; - -public abstract class AbstractCOptionPage extends DialogPage implements ICOptionPage { - - private boolean bIsValid = true; - private ICOptionContainer fContainer; - - - public AbstractCOptionPage() { - super(); - } - - public AbstractCOptionPage(String title) { - super(title); - } - - public AbstractCOptionPage(String title, ImageDescriptor image) { - super(title, image); - } - - public void setContainer(ICOptionContainer container) { - fContainer = container; - } - - protected ICOptionContainer getContainer() { - return fContainer; - } - - protected void setValid(boolean isValid) { - bIsValid = isValid; - } - - public boolean isValid() { - return bIsValid; - } - - public abstract void performApply(IProgressMonitor monitor) throws CoreException; - - public abstract void performDefaults(); - - public abstract void createControl(Composite parent); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java deleted file mode 100644 index db8fbcc4772..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractErrorParserBlock.java +++ /dev/null @@ -1,241 +0,0 @@ -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.ui.dialogs; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ErrorParserManager; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.CheckedListDialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.help.WorkbenchHelp; - -public abstract class AbstractErrorParserBlock extends AbstractCOptionPage { - - private static final String PREFIX = "ErrorParserBlock"; // $NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; // $NON-NLS-1$ - private static final String DESC = PREFIX + ".desc"; // $NON-NLS-1$ - - private static String[] EMPTY = new String[0]; - private Preferences fPrefs; - protected HashMap mapParsers = new HashMap(); - private CheckedListDialogField fErrorParserList; - protected boolean listDirty = false; - - class FieldListenerAdapter implements IDialogFieldListener { - - /* (non-Javadoc) - * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField) - */ - public void dialogFieldChanged(DialogField field) { - listDirty = true; - } - - } - - public AbstractErrorParserBlock(Preferences prefs) { - super(CUIPlugin.getResourceString(LABEL)); - setDescription(CUIPlugin.getResourceString(DESC)); - fPrefs = prefs; - } - - public Image getImage() { - return null; - } - - /** - * Returns a label provider for the error parsers - * - * @return the content provider - */ - protected ILabelProvider getLabelProvider() { - return new LabelProvider() { - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) - */ - public String getText(Object element) { - String name = (String)mapParsers.get(element.toString()); - return name != null ? name : ""; - } - }; - } - - protected FieldListenerAdapter getFieldListenerAdapter() { - return new FieldListenerAdapter(); - } - - protected String[] getErrorParserIDs(Preferences prefs) { - String parserIDs = prefs.getString(ErrorParserManager.PREF_ERROR_PARSER); - String[] empty = new String[0]; - if (parserIDs != null && parserIDs.length() > 0) { - StringTokenizer tok = new StringTokenizer(parserIDs, ";"); - List list = new ArrayList(tok.countTokens()); - while (tok.hasMoreElements()) { - list.add(tok.nextToken()); - } - return (String[]) list.toArray(empty); - } - return empty; - } - - /** - * To be implemented, abstract method. - * @param project - * @param list - */ - protected abstract String[] getErrorParserIDs(IProject project); - - /** - * To be implemented. abstract method. - * @param project - * @param parsers - */ - protected abstract void saveErrorParsers(IProject project, String[] parserIDs) throws CoreException; - - protected void saveErrorParsers(Preferences prefs, String[] parserIDs) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < parserIDs.length; i++) { - buf.append(parserIDs[i]).append(';'); - } - prefs.setValue(ErrorParserManager.PREF_ERROR_PARSER, buf.toString()); - } - - protected void initMapParsers() { - mapParsers.clear(); - IExtensionPoint point = CCorePlugin.getDefault().getDescriptor().getExtensionPoint(CCorePlugin.ERROR_PARSER_SIMPLE_ID); - if (point != null) { - IExtension[] exts = point.getExtensions(); - for (int i = 0; i < exts.length; i++) { - mapParsers.put(exts[i].getUniqueIdentifier(), exts[i].getLabel()); - } - } - } - - protected void initializeValues() { - initMapParsers(); - - String[] parserIDs; - IProject project = getContainer().getProject(); - if (project == null) { - // From a Preference. - parserIDs =getErrorParserIDs(fPrefs); - } else { - // From the Project. - parserIDs = getErrorParserIDs(project); - } - - List checkedList = Arrays.asList(parserIDs); - fErrorParserList.setElements(checkedList); - fErrorParserList.setCheckedElements(checkedList); - - Iterator items = mapParsers.keySet().iterator(); - while( items.hasNext()) { - String item = (String)items.next(); - boolean found = false; - for (int i = 0; i < parserIDs.length; i++) { - if (item.equals(parserIDs[i])) { - found = true; - break; - } - } - if (!found) { - fErrorParserList.addElement(item); - } - } - } - - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - setControl(composite); - - WorkbenchHelp.setHelp(getControl(), ICHelpContextIds.ERROR_PARSERS_PAGE); - - String[] buttonLabels = new String[] { - /* 0 */ - "Up", //$NON-NLS-1$ - /* 1 */ - "Down", //$NON-NLS-1$ - /* 2 */ - null, - /* 3 */ - "Select All", //$NON-NLS-1$ - /* 4 */ - "Unselect All" //$NON-NLS-1$ - }; - - fErrorParserList = new CheckedListDialogField(null, buttonLabels, getLabelProvider()); - fErrorParserList.setDialogFieldListener(getFieldListenerAdapter()); - fErrorParserList.setLabelText("Error Parsers"); //$NON-NLS-1$ - fErrorParserList.setUpButtonIndex(0); - fErrorParserList.setDownButtonIndex(1); - fErrorParserList.setCheckAllButtonIndex(3); - fErrorParserList.setUncheckAllButtonIndex(4); - - LayoutUtil.doDefaultLayout(composite, new DialogField[] { fErrorParserList }, true); - LayoutUtil.setHorizontalGrabbing(fErrorParserList.getListControl(null)); - - initializeValues(); - } - - public void performApply(IProgressMonitor monitor) throws CoreException { - if (listDirty) { - IProject project = getContainer().getProject(); - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Setting Error Parsers...", 1); - List elements = fErrorParserList.getElements(); - int count = elements.size(); - List list = new ArrayList(count); - for (int i = 0; i < count; i++) { - Object obj = elements.get(i); - if (fErrorParserList.isChecked(obj)) { - list.add(obj); - } - } - - String[] parserIDs = (String[])list.toArray(EMPTY); - - if (project == null) { - saveErrorParsers(fPrefs, parserIDs); - } else { - saveErrorParsers(project, parserIDs); - } - monitor.worked(1); - monitor.done(); - } - } - - public void performDefaults() { - initializeValues(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java deleted file mode 100644 index 8c2a508f70e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java +++ /dev/null @@ -1,205 +0,0 @@ -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.ui.dialogs; - -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.help.WorkbenchHelp; - -public class BinaryParserBlock extends AbstractBinaryParserPage { - - private static final String PREFIX = "BinaryParserBlock"; // $NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; // $NON-NLS-1$ - private static final String DESC = PREFIX + ".desc"; // $NON-NLS-1$ - - private static String[][] radios; - protected Combo comboBox; - private HashMap idMap = new HashMap(); - private String initial; - private Preferences fPrefs; - - public BinaryParserBlock(Preferences prefs) { - super(CUIPlugin.getResourceString(LABEL)); - setDescription(CUIPlugin.getResourceString(DESC)); - fPrefs = prefs; - } - - public void createControl(Composite parent) { - Composite control = ControlFactory.createComposite(parent, 2); - ((GridLayout) control.getLayout()).makeColumnsEqualWidth = false; - ((GridLayout) control.getLayout()).marginWidth = 5; - setControl(control); - - WorkbenchHelp.setHelp(getControl(), ICHelpContextIds.BINARY_PARSER_PAGE); - - ControlFactory.createEmptySpace(control, 2); - - Label label = ControlFactory.createLabel(control, "Binary Parser:"); - label.setLayoutData(new GridData()); - comboBox = new Combo(control, SWT.DROP_DOWN | SWT.READ_ONLY); - GridData gd = new GridData(GridData.GRAB_HORIZONTAL); - gd.grabExcessHorizontalSpace = true; - comboBox.setLayoutData(gd); - comboBox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - getContainer().updateContainer(); - handleBinaryParserChanged(); - } - }); - Iterator items = idMap.keySet().iterator(); - while (items.hasNext()) { - comboBox.add((String) items.next()); - } - - if (initial != null) { - comboBox.setText(initial); - } - - // Add the Parser UI contribution. - Group parserGroup = new Group(control, SWT.SHADOW_ETCHED_IN); - parserGroup.setText("Binary Parser Options"); - GridLayout tabHolderLayout = new GridLayout(); - tabHolderLayout.marginHeight = 0; - tabHolderLayout.marginWidth = 0; - tabHolderLayout.numColumns = 1; - parserGroup.setLayout(tabHolderLayout); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 2; - parserGroup.setLayoutData(gd); - // Must set the composite parent to super class. - setCompositeParent(parserGroup); - // fire a change event, to quick start. - handleBinaryParserChanged(); - - } - - public void performApply(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Setting Binary Parser...", 2); - String selected = comboBox.getText(); - if (selected != null) { - if (initial == null || !selected.equals(initial)) { - if (getContainer().getProject() != null) { - ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(getContainer().getProject()); - desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID); - desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, (String) idMap.get(selected)); - } else { - fPrefs.setValue(CCorePlugin.PREF_BINARY_PARSER, (String) idMap.get(selected)); - } - initial = selected; - } - } - monitor.worked(1); - // Give a chance to the contributions to save. - // We have to do it last to make sure the parser id is save - // in .cdtproject - super.performApply(new SubProgressMonitor(monitor, 1)); - - // Reset the binary parser the paths may have change. - if (getContainer().getProject() != null) - CCorePlugin.getDefault().getCoreModel().resetBinaryParser(getContainer().getProject()); - - monitor.done(); - } - - public void setContainer(ICOptionContainer container) { - super.setContainer(container); - - IExtensionPoint point = CCorePlugin.getDefault().getDescriptor().getExtensionPoint(CCorePlugin.BINARY_PARSER_SIMPLE_ID); - if (point != null) { - IExtension[] exts = point.getExtensions(); - radios = new String[exts.length][2]; - for (int i = 0; i < exts.length; i++) { - idMap.put(exts[i].getLabel(), exts[i].getUniqueIdentifier()); - } - } - if (getContainer().getProject() != null) { - try { - ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(getContainer().getProject()); - ICExtensionReference[] ref = desc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - if (ref.length > 0) { - IExtension ext = point.getExtension(ref[0].getID()); - if (ext != null) { - initial = ext.getLabel(); - } - } - - } catch (CoreException e) { - } - } - if (initial == null) { - String id = fPrefs.getString(CCorePlugin.PREF_BINARY_PARSER); - if (id == null || id.length() == 0) { - initial = point.getExtension(CCorePlugin.DEFAULT_BINARY_PARSER_UNIQ_ID).getLabel(); - } else { - IExtension ext = point.getExtension(id); - if (ext != null) { - initial = ext.getLabel(); - } - - } - } - - } - - public void performDefaults() { - IExtensionPoint point = CCorePlugin.getDefault().getDescriptor().getExtensionPoint(CCorePlugin.BINARY_PARSER_SIMPLE_ID); - String id; - if (getContainer().getProject() != null) { - id = fPrefs.getString(CCorePlugin.PREF_BINARY_PARSER); - } else { - id = fPrefs.getDefaultString(CCorePlugin.PREF_BINARY_PARSER); - } - String selected; - if (id == null || id.length() == 0) { - selected = point.getExtension(CCorePlugin.DEFAULT_BINARY_PARSER_UNIQ_ID).getLabel(); - } else { - selected = point.getExtension(id).getLabel(); - } - comboBox.setText(selected); - // Give a change to the UI contributors to react. - // But do it last after the comboBox is set. - handleBinaryParserChanged(); - super.performDefaults(); - getContainer().updateContainer(); - } - - protected String getCurrentBinaryParserID() { - String selected = comboBox.getText(); - return (String) idMap.get(selected); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParserPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParserPage.java deleted file mode 100644 index 49919847e5d..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/CygwinPEBinaryParserPage.java +++ /dev/null @@ -1,263 +0,0 @@ -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.ui.dialogs; - -import java.io.File; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - */ -public class CygwinPEBinaryParserPage extends AbstractCOptionPage { - - public final static String PREF_ADDR2LINE_PATH = CUIPlugin.PLUGIN_ID + ".addr2line"; //$NON-NLS-1$ - public final static String PREF_CPPFILT_PATH = CUIPlugin.PLUGIN_ID + ".cppfilt"; //$NON-NLS-1$ - public final static String PREF_CYGPATH_PATH = CUIPlugin.PLUGIN_ID + ".cygpath"; //$NON-NLS-1$ - - protected Text fAddr2LineCommandText; - protected Text fCPPFiltCommandText; - protected Text fCygPathCommandText; - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(org.eclipse.core.runtime.IProgressMonitor) - */ - public void performApply(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - String addr2line = fAddr2LineCommandText.getText().trim(); - String cppfilt = fCPPFiltCommandText.getText().trim(); - String cygpath = fCygPathCommandText.getText().trim(); - - monitor.beginTask("Saving Attributes", 1); - IProject proj = getContainer().getProject(); - if (proj != null) { - ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj); - ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - if (cext.length == 0) { - // The value was not save yet and we need to save it now - // to apply the changes. Search the extension for our own ID - IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor(); - IExtensionPoint point = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$ - IConfigurationElement[] infos = point.getConfigurationElements(); - for (int i = 0; i < infos.length; i++) { - String id = infos[i].getAttribute("parserID"); //$NON-NLS-1$ - String clazz = infos[i].getAttribute("class"); //$NON-NLS-1$ - String ego = getClass().getName(); - if (clazz != null && clazz.equals(ego)) { - cdesc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID); - cdesc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, id); - } - } - // Try again. - cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - } - if (cext.length > 0) { - String orig = cext[0].getExtensionData("addr2line"); - if (orig == null || !orig.equals(addr2line)) { - cext[0].setExtensionData("addr2line", addr2line); - } - orig = cext[0].getExtensionData("c++filt"); - if (orig == null || !orig.equals(cppfilt)) { - cext[0].setExtensionData("c++filt", cppfilt); - } - orig = cext[0].getExtensionData("cygpath"); - if (orig == null || !orig.equals(cygpath)) { - cext[0].setExtensionData("cygpath", cygpath); - } - } - } else { - Preferences store = getContainer().getPreferences(); - if (store != null) { - store.setValue(PREF_ADDR2LINE_PATH, addr2line); - store.setValue(PREF_CPPFILT_PATH, cppfilt); - store.setValue(PREF_CYGPATH_PATH, cygpath); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults() - */ - public void performDefaults() { - String addr2line = null; - String cppfilt = null; - String cygpath = null; - IProject proj = getContainer().getProject(); - if (proj != null) { - try { - ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj); - ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - if (cext.length > 0) { - addr2line = cext[0].getExtensionData("addr2line"); //$NON-NLS-1$; - cppfilt = cext[0].getExtensionData("c++filt"); //$NON-NLS-1$; - cygpath = cext[0].getExtensionData("cygpath"); //$NON-NLS-1$; - } - } catch (CoreException e) { - } - } else { - Preferences store = getContainer().getPreferences(); - if (store != null) { - addr2line = store.getString(PREF_ADDR2LINE_PATH); - cppfilt = store.getString(PREF_CPPFILT_PATH); - cygpath = store.getString(PREF_CYGPATH_PATH); - } - } - fAddr2LineCommandText.setText((addr2line == null || addr2line.length() == 0) ? "addr2line" : addr2line); //$NON-NLS-1$; - fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); //$NON-NLS-1$; - fCygPathCommandText.setText((cygpath == null || cygpath.length() == 0) ? "cygpath" : cppfilt); //$NON-NLS-1$; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Composite comp = ControlFactory.createCompositeEx(parent, 2, GridData.FILL_HORIZONTAL); - ((GridLayout) comp.getLayout()).makeColumnsEqualWidth = false; - - Label label = ControlFactory.createLabel(comp, "addr2line Command:"); - GridData gd = new GridData(); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - fAddr2LineCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER); - fAddr2LineCommandText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - //updateLaunchConfigurationDialog(); - } - }); - - Button button = ControlFactory.createPushButton(comp, "&Browse..."); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleAddr2LineButtonSelected(); - //updateLaunchConfigurationDialog(); - } - - private void handleAddr2LineButtonSelected() { - FileDialog dialog = new FileDialog(getShell(), SWT.NONE); - dialog.setText("addr2line Command"); - String command = fAddr2LineCommandText.getText().trim(); - int lastSeparatorIndex = command.lastIndexOf(File.separator); - if (lastSeparatorIndex != -1) { - dialog.setFilterPath(command.substring(0, lastSeparatorIndex)); - } - String res = dialog.open(); - if (res == null) { - return; - } - fAddr2LineCommandText.setText(res); - } - }); - - label = ControlFactory.createLabel(comp, "c++filt Command:"); - gd = new GridData(); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - fCPPFiltCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fCPPFiltCommandText.setLayoutData(gd); - fCPPFiltCommandText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - //updateLaunchConfigurationDialog(); - } - }); - button = ControlFactory.createPushButton(comp, "&Browse..."); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleCPPFiltButtonSelected(); - //updateLaunchConfigurationDialog(); - } - - private void handleCPPFiltButtonSelected() { - FileDialog dialog = new FileDialog(getShell(), SWT.NONE); - dialog.setText("c++filt Command"); - String command = fCPPFiltCommandText.getText().trim(); - int lastSeparatorIndex = command.lastIndexOf(File.separator); - if (lastSeparatorIndex != -1) { - dialog.setFilterPath(command.substring(0, lastSeparatorIndex)); - } - String res = dialog.open(); - if (res == null) { - return; - } - fCPPFiltCommandText.setText(res); - } - }); - - label = ControlFactory.createLabel(comp, "cygpath Command:"); - gd = new GridData(); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - fCygPathCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fCygPathCommandText.setLayoutData(gd); - fCygPathCommandText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - //updateLaunchConfigurationDialog(); - } - }); - button = ControlFactory.createPushButton(comp, "&Browse..."); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleCygPathButtonSelected(); - //updateLaunchConfigurationDialog(); - } - - private void handleCygPathButtonSelected() { - FileDialog dialog = new FileDialog(getShell(), SWT.NONE); - dialog.setText("cygpath Command"); - String command = fCygPathCommandText.getText().trim(); - int lastSeparatorIndex = command.lastIndexOf(File.separator); - if (lastSeparatorIndex != -1) { - dialog.setFilterPath(command.substring(0, lastSeparatorIndex)); - } - String res = dialog.open(); - if (res == null) { - return; - } - fCygPathCommandText.setText(res); - } - }); - - setControl(comp); - performDefaults(); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java deleted file mode 100644 index 1d33158e98b..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java +++ /dev/null @@ -1,215 +0,0 @@ -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -package org.eclipse.cdt.ui.dialogs; - -import java.io.File; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.ICExtensionReference; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - */ -public class GNUElfBinaryParserPage extends AbstractCOptionPage { - - public final static String PREF_ADDR2LINE_PATH = CUIPlugin.PLUGIN_ID + ".addr2line"; //$NON-NLS-1$ - public final static String PREF_CPPFILT_PATH = CUIPlugin.PLUGIN_ID + ".cppfilt"; //$NON-NLS-1$ - - protected Text fAddr2LineCommandText; - protected Text fCPPFiltCommandText; - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performApply(org.eclipse.core.runtime.IProgressMonitor) - */ - public void performApply(IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - String addr2line = fAddr2LineCommandText.getText().trim(); - String cppfilt = fCPPFiltCommandText.getText().trim(); - - monitor.beginTask("Saving Attributes", 1); - IProject proj = getContainer().getProject(); - if (proj != null) { - ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj); - ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - if (cext.length == 0) { - // The value was not save yet and we need to save it now - // to apply the changes. Search the extension for our own ID - IPluginDescriptor descriptor = CUIPlugin.getDefault().getDescriptor(); - IExtensionPoint point = descriptor.getExtensionPoint("BinaryParserPage"); //$NON-NLS-1$ - IConfigurationElement[] infos = point.getConfigurationElements(); - for (int i = 0; i < infos.length; i++) { - String id = infos[i].getAttribute("parserID"); //$NON-NLS-1$ - String clazz = infos[i].getAttribute("class"); //$NON-NLS-1$ - String ego = getClass().getName(); - if (clazz != null && clazz.equals(ego)) { - cdesc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID); - cdesc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, id); - } - } - // Try again. - cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - } - if (cext.length > 0) { - String orig = cext[0].getExtensionData("addr2line"); - if (orig == null || !orig.equals(addr2line)) { - cext[0].setExtensionData("addr2line", addr2line); - } - orig = cext[0].getExtensionData("c++filt"); - if (orig == null || !orig.equals(cppfilt)) { - cext[0].setExtensionData("c++filt", cppfilt); - } - } - } else { - Preferences store = getContainer().getPreferences(); - if (store != null) { - store.setValue(PREF_ADDR2LINE_PATH, addr2line); - store.setValue(PREF_CPPFILT_PATH, cppfilt); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionPage#performDefaults() - */ - public void performDefaults() { - String addr2line = null; - String cppfilt = null; - IProject proj = getContainer().getProject(); - if (proj != null) { - try { - ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj); - ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID); - if (cext.length > 0) { - addr2line = cext[0].getExtensionData("addr2line"); - cppfilt = cext[0].getExtensionData("c++filt"); - } - } catch (CoreException e) { - } - } else { - Preferences store = getContainer().getPreferences(); - if (store != null) { - addr2line = store.getString(PREF_ADDR2LINE_PATH); - cppfilt = store.getString(PREF_CPPFILT_PATH); - } - } - fAddr2LineCommandText.setText((addr2line == null || addr2line.length() == 0) ? "addr2line" : addr2line); - fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Composite comp = ControlFactory.createCompositeEx(parent, 2, GridData.FILL_HORIZONTAL); - ((GridLayout) comp.getLayout()).makeColumnsEqualWidth = false; - - Label label = ControlFactory.createLabel(comp, "addr2line Command:"); - GridData gd = new GridData(); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - fAddr2LineCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER); - fAddr2LineCommandText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - //updateLaunchConfigurationDialog(); - } - }); - - Button button = ControlFactory.createPushButton(comp, "&Browse..."); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleAddr2LineButtonSelected(); - //updateLaunchConfigurationDialog(); - } - - private void handleAddr2LineButtonSelected() { - FileDialog dialog = new FileDialog(getShell(), SWT.NONE); - dialog.setText("addr2line Command"); - String command = fAddr2LineCommandText.getText().trim(); - int lastSeparatorIndex = command.lastIndexOf(File.separator); - if (lastSeparatorIndex != -1) { - dialog.setFilterPath(command.substring(0, lastSeparatorIndex)); - } - String res = dialog.open(); - if (res == null) { - return; - } - fAddr2LineCommandText.setText(res); - } - }); - - label = ControlFactory.createLabel(comp, "c++filt Command:"); - gd = new GridData(); - gd.horizontalSpan = 2; - label.setLayoutData(gd); - - fCPPFiltCommandText = ControlFactory.createTextField(comp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fCPPFiltCommandText.setLayoutData(gd); - fCPPFiltCommandText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - //updateLaunchConfigurationDialog(); - } - }); - button = ControlFactory.createPushButton(comp, "&Browse..."); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleCPPFiltButtonSelected(); - //updateLaunchConfigurationDialog(); - } - - private void handleCPPFiltButtonSelected() { - FileDialog dialog = new FileDialog(getShell(), SWT.NONE); - dialog.setText("c++filt Command"); - String command = fCPPFiltCommandText.getText().trim(); - int lastSeparatorIndex = command.lastIndexOf(File.separator); - if (lastSeparatorIndex != -1) { - dialog.setFilterPath(command.substring(0, lastSeparatorIndex)); - } - String res = dialog.open(); - if (res == null) { - return; - } - fCPPFiltCommandText.setText(res); - } - }); - - setControl(comp); - performDefaults(); - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java deleted file mode 100644 index d785a25a662..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.cdt.ui.dialogs; - -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Preferences; - -public interface ICOptionContainer { - - void updateContainer(); - - IProject getProject(); - - /** - * Returns the preference store. - * - * @return the preference store, or null if none - */ - public Preferences getPreferences(); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionPage.java deleted file mode 100644 index e8e642e1553..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionPage.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.cdt.ui.dialogs; -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.IDialogPage; - -public interface ICOptionPage extends IDialogPage { - - public void setContainer(ICOptionContainer container); - - public boolean isValid(); - - public void performApply(IProgressMonitor monitor) throws CoreException; - - public void performDefaults(); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java deleted file mode 100644 index b6ccb9c0819..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ReferenceBlock.java +++ /dev/null @@ -1,177 +0,0 @@ -package org.eclipse.cdt.ui.dialogs; -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -public class ReferenceBlock extends AbstractCOptionPage { - - private static final String PREFIX = "ReferenceBlock"; // $NON-NLS-1$ - private static final String LABEL = PREFIX + ".label"; // $NON-NLS-1$ - private static final String DESC = PREFIX + ".desc"; // $NON-NLS-1$ - - private CheckboxTableViewer referenceProjectsViewer; - - private static final int PROJECT_LIST_MULTIPLIER = 10; - - public ReferenceBlock() { - super(CUIPlugin.getResourceString(LABEL)); - setDescription(CUIPlugin.getResourceString(DESC)); - } - - public Image getImage() { - return CPluginImages.get(CPluginImages.IMG_OBJS_PROJECT); - } - - /** - * Returns a content provider for the reference project - * viewer. It will return all projects in the workspace. - * - * @return the content provider - */ - protected IStructuredContentProvider getContentProvider() { - return new WorkbenchContentProvider() { - public Object[] getChildren(Object element) { - if (!(element instanceof IWorkspace)) - return new Object[0]; - ArrayList aList = new ArrayList(15); - final IProject[] projects = ((IWorkspace)element).getRoot().getProjects(); - for (int i = 0; i < projects.length; i++) { - if (CoreModel.getDefault().hasCNature(projects[i])) { - // Do not show the actual project being look at - if ((getContainer().getProject() != null) && getContainer().getProject().equals(projects[i])) { - continue; - } - aList.add(projects[i]); - } - } - return aList.toArray(); - } - }; - } - - protected void initializeValues () { - if (getContainer().getProject() != null) { - try { - IProject[] referenced = getContainer().getProject().getReferencedProjects(); - referenceProjectsViewer.setCheckedElements(referenced); - } catch (CoreException e) { - } - } - } - - /** - * Returns the referenced projects selected by the user. - * - * @return the referenced projects - */ - public IProject[] getReferencedProjects() { - Object[] elements = referenceProjectsViewer.getCheckedElements(); - IProject[] projects = new IProject[elements.length]; - System.arraycopy(elements, 0, projects, 0, elements.length); - return projects; - } - - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout()); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label label = new Label(composite, SWT.LEFT); - label.setText(CUIPlugin.getResourceString(DESC)); - GridData lbldata = new GridData(GridData.FILL_HORIZONTAL); - lbldata.horizontalSpan = 1; - label.setLayoutData(lbldata); - - - referenceProjectsViewer = - CheckboxTableViewer.newCheckList(composite, SWT.TOP | SWT.BORDER); - GridData data = new GridData(GridData.FILL_BOTH); - data.grabExcessHorizontalSpace = true; - data.heightHint = - getDefaultFontHeight( - referenceProjectsViewer.getTable(), - PROJECT_LIST_MULTIPLIER); - - //Only set a height hint if it will not result in a cut off dialog - referenceProjectsViewer.getTable().setLayoutData(data); - - referenceProjectsViewer.setLabelProvider(new WorkbenchLabelProvider()); - referenceProjectsViewer.setContentProvider(getContentProvider()); - referenceProjectsViewer.setInput(ResourcesPlugin.getWorkspace()); - - initializeValues(); - setControl(composite); - } - - /** - * Get the defualt widget height for the supplied control. - * @return int - * @param control - the control being queried about fonts - * @param lines - the number of lines to be shown on the table. - */ - private static int getDefaultFontHeight(Control control, int lines) { - FontData[] viewerFontData = control.getFont().getFontData(); - int fontHeight = 10; - - //If we have no font data use our guess - if (viewerFontData.length > 0) - fontHeight = viewerFontData[0].getHeight(); - return lines * fontHeight; - - } - - public void performApply(IProgressMonitor monitor) throws CoreException { - IProject[] refProjects = getReferencedProjects(); - if (refProjects != null) { - IProject project = getContainer().getProject(); - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Reference Projects", 1); - try { - IProjectDescription description = project.getDescription(); - description.setReferencedProjects(refProjects); - project.setDescription(description, new SubProgressMonitor(monitor, 1)); - } catch (CoreException e) { - } - } - - } - - public void performDefaults() { - initializeValues(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java deleted file mode 100644 index 5ac31cc4013..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/TabFolderOptionBlock.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.eclipse.cdt.ui.dialogs; -/*********************************************************************** - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.utils.ui.controls.TabFolderLayout; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; - -public abstract class TabFolderOptionBlock { - protected boolean initializingTabs = true; - private Composite composite; - private boolean bShowMessageArea; - private String fErrorMessage; - private boolean bIsValid = true; - - private Label messageLabel; - private ArrayList pages; - protected ICOptionContainer fParent; - private ICOptionPage fCurrentPage; - - private TabFolder fFolder; - - public TabFolderOptionBlock(ICOptionContainer parent, boolean showMessageArea) { - fParent = parent; - bShowMessageArea = showMessageArea; - } - - public TabFolderOptionBlock(ICOptionContainer parent) { - this(parent, true); - } - - protected void addOptionPage(ICOptionPage page) { - if (pages == null) { - pages = new ArrayList(); - } - if (!pages.contains(page)) { - pages.add(page); - } - } - - protected List getOptionPages() { - return pages; - } - - public Control createContents(Composite parent) { - - composite = new Composite(parent, SWT.NONE); - composite.setLayout(new GridLayout(1, false)); - - if (bShowMessageArea) { - messageLabel = new Label(composite, SWT.LEFT); - messageLabel.setFont(composite.getFont()); - messageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label separator = new Label(composite, SWT.HORIZONTAL); - separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - } - - createFolder(composite); - - addTabs(); - setCurrentPage((ICOptionPage) pages.get(0)); - initializingTabs = false; - String desc = ((ICOptionPage) pages.get(0)).getDescription(); - if (desc != null) { - messageLabel.setText(desc); - } - return composite; - } - - protected void createFolder(Composite parent) { - fFolder = new TabFolder(parent, SWT.NONE); - fFolder.setLayoutData(new GridData(GridData.FILL_BOTH)); - fFolder.setLayout(new TabFolderLayout()); - - fFolder.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (!initializingTabs) { - setCurrentPage((ICOptionPage) ((TabItem) e.item).getData()); - fParent.updateContainer(); - } - } - }); - } - - protected void addTab(ICOptionPage tab) { - TabItem item = new TabItem(fFolder, SWT.NONE); - item.setText(tab.getTitle()); - Image img = tab.getImage(); - if (img != null) - item.setImage(img); - item.setData(tab); - tab.setContainer(fParent); - tab.createControl(item.getParent()); - item.setControl(tab.getControl()); - addOptionPage(tab); - } - - abstract protected void addTabs(); - - public boolean performApply(IProgressMonitor monitor) { - if (initializingTabs) - return false; - Iterator iter = pages.iterator(); - while (iter.hasNext()) { - ICOptionPage tab = (ICOptionPage) iter.next(); - try { - tab.performApply(new NullProgressMonitor()); - } catch (CoreException e) { - CUIPlugin.errorDialog(composite.getShell(), "Error", "Error setting options", e); - return false; - } - } - return true; - } - - /** - * @see DialogPage#setVisible(boolean) - */ - public void setVisible(boolean visible) { - if (initializingTabs) - return; - if (fCurrentPage != null) { - fCurrentPage.setVisible(visible); - } - update(); - } - - public void update() { - if (initializingTabs) - return; - boolean ok = true; - Iterator iter = pages.iterator(); - while (iter.hasNext()) { - ICOptionPage tab = (ICOptionPage) iter.next(); - ok = tab.isValid(); - if (!ok) { - setErrorMessage(tab.getErrorMessage()); - break; - } - } - if (ok) { - setErrorMessage(null); - ICOptionPage tab = getCurrentPage(); - if (bShowMessageArea && tab.getDescription() != null) - messageLabel.setText(tab.getDescription()); - } - setValid(ok); - } - - private void setValid(boolean ok) { - bIsValid = ok; - } - - private void setErrorMessage(String message) { - fErrorMessage = message; - } - - public String getErrorMessage() { - return fErrorMessage; - } - - public boolean isValid() { - return bIsValid; - } - - public void performDefaults() { - if (initializingTabs) - return; - getCurrentPage().performDefaults(); - } - - public ICOptionPage getCurrentPage() { - return fCurrentPage; - } - - public void setCurrentPage(ICOptionPage page) { - //Make the new page visible - ICOptionPage oldPage = fCurrentPage; - fCurrentPage = page; - fCurrentPage.setVisible(true); - if (oldPage != null) - oldPage.setVisible(false); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICCompletionProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICCompletionProposal.java deleted file mode 100644 index 01bb51f67ee..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ICCompletionProposal.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.cdt.ui.text; - -/******************************************************************************* - * Copyright (c) 2000, 2002 International Business Machines Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ - - -import org.eclipse.jface.text.contentassist.ICompletionProposal; - -/** - * CompletionProposal with a relevance value. - * The relevance value is used to sort the completion proposals. Proposals with higher relevance - * should be listed before proposals with lower relevance. - */ -public interface ICCompletionProposal extends ICompletionProposal { - - /** - * Returns the relevance of the proposal. - */ - int getRelevance(); - -} - diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCCProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCCProjectWizard.java deleted file mode 100644 index 4aa1e31f87e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCCProjectWizard.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.eclipse.cdt.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - - -/** - * C Project wizard that creates a new project resource in - */ -public abstract class NewCCProjectWizard extends NewCProjectWizard { - - public NewCCProjectWizard() { - super(); - setDialogSettings(CUIPlugin.getDefault().getDialogSettings()); - } - - public NewCCProjectWizard(String title, String description) { - super(); - setDialogSettings(CUIPlugin.getDefault().getDialogSettings()); - } - - - protected void doRun(IProgressMonitor monitor) throws CoreException { - super.doRun(monitor); - // Add C++ Nature to the newly created project. - if (newProject != null){ - CCorePlugin.getDefault().convertProjectFromCtoCC(newProject, monitor); - } - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizard.java deleted file mode 100644 index 9632001d92f..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizard.java +++ /dev/null @@ -1,305 +0,0 @@ -package org.eclipse.cdt.ui.wizards; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExecutableExtension; -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.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; -import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard; - - -/** - * C Project wizard that creates a new project resource in - * a location of the user's choice. - */ -public abstract class NewCProjectWizard extends BasicNewResourceWizard implements IExecutableExtension { - - private static final String OP_ERROR= "CProjectWizard.op_error"; //$NON-NLS-1$ - private static final String OP_DESC= "CProjectWizard.op_description"; //$NON-NLS-1$ - - private static final String PREFIX= "CProjectWizard"; //$NON-NLS-1$ - private static final String WZ_TITLE= "CProjectWizard.title"; //$NON-NLS-1$ - private static final String WZ_DESC= "CProjectWizard.description"; //$NON-NLS-1$ - - private static final String WINDOW_TITLE = "CProjectWizard.windowTitle"; //$NON-NLS-1$ - - - private String wz_title; - private String wz_desc; - private String op_error; - - protected IConfigurationElement fConfigElement; - protected NewCProjectWizardPage fMainPage; - protected IProject newProject; - - List tabItemsList = new ArrayList(); - - public NewCProjectWizard() { - this(CUIPlugin.getResourceString(WZ_TITLE), CUIPlugin.getResourceString(WZ_DESC), - CUIPlugin.getResourceString(OP_ERROR)); - } - - public NewCProjectWizard(String title, String description) { - this(title, description, CUIPlugin.getResourceString(OP_ERROR)); - } - - public NewCProjectWizard(String title, String description, String error) { - super(); - setDialogSettings(CUIPlugin.getDefault().getDialogSettings()); - setNeedsProgressMonitor(true); - wz_title = title; - wz_desc = description; - op_error = error; - } - - /** - * @see Wizard#createPages - */ - public void addPages() { - fMainPage= new NewCProjectWizardPage(CUIPlugin.getResourceString(PREFIX)); - fMainPage.setTitle(wz_title); - fMainPage.setDescription(wz_desc); - addPage(fMainPage); - } - - protected abstract void doRunPrologue(IProgressMonitor monitor); - - protected abstract void doRunEpilogue(IProgressMonitor monitor); - - protected IStatus isValidName(String name) { - return new Status(IStatus.OK, CUIPlugin.PLUGIN_ID, 0, "", null); - } - - /** - * Method isValidLocation. - * @param projectFieldContents - * @return IStatus - */ - protected IStatus isValidLocation(String projectFieldContents) { - return new Status(IStatus.OK, CUIPlugin.PLUGIN_ID, 0, "", null); - } - - /** - * Gets the project location path from the main page - * Overwrite this method if you do not have a main page - */ - protected IPath getLocationPath() throws UnsupportedOperationException { - if (null == fMainPage) - throw new UnsupportedOperationException(); - return fMainPage.getLocationPath(); - } - - /** - * Gets the project handle from the main page. - * Overwrite this method if you do not have a main page - */ - - protected IProject getProjectHandle() throws UnsupportedOperationException { - if (null == fMainPage) - throw new UnsupportedOperationException(); - return fMainPage.getProjectHandle(); - } - - /** - * Returns the C project handle corresponding to the project defined in - * in the main page. - * - * @returns the C project - */ - public IProject getNewProject() { - return newProject; - } - - protected IResource getSelectedResource() { - return getNewProject(); - } - - /** - * @see Wizard#performFinish - */ - public boolean performFinish() { - if (!invokeRunnable(getRunnable())) { - return false; - } - BasicNewProjectResourceWizard.updatePerspective(fConfigElement); - IResource resource = getSelectedResource(); - selectAndReveal(resource); - if (resource != null && resource.getType() == IResource.FILE) { - IFile file = (IFile)resource; - // Open editor on new file. - IWorkbenchWindow dw = getWorkbench().getActiveWorkbenchWindow(); - if (dw != null) { - try { - IWorkbenchPage page = dw.getActivePage(); - if (page != null) - IDE.openEditor(page, file, true); - } catch (PartInitException e) { - MessageDialog.openError(dw.getShell(), - CUIPlugin.getResourceString(OP_ERROR), e.getMessage()); - } - } - } - return true; - } - - /** - * Stores the configuration element for the wizard. The config element will be used - * in performFinish to set the result perspective. - * - * @see IExecutableExtension#setInitializationData - */ - public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) { - fConfigElement= cfig; - } - - /* - * Reimplemented method from superclass - */ - protected void initializeDefaultPageImageDescriptor() { - setDefaultPageImageDescriptor(CPluginImages.DESC_WIZABAN_NEW_PROJ); - } - - /* (non-Javadoc) - * Method declared on IWorkbenchWizard. - */ - public void init(IWorkbench workbench, IStructuredSelection currentSelection) { - super.init(workbench, currentSelection); - setWindowTitle(CUIPlugin.getResourceString(WINDOW_TITLE)); - } - - public IRunnableWithProgress getRunnable() { - return new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - if (monitor == null) { - monitor= new NullProgressMonitor(); - } - monitor.beginTask(CUIPlugin.getResourceString(OP_DESC), 3); - - doRunPrologue(new SubProgressMonitor(monitor, 1)); - try { - doRun(new SubProgressMonitor(monitor, 1)); - } - catch (CoreException e) { - throw new InvocationTargetException(e); - } - doRunEpilogue(new SubProgressMonitor(monitor, 1)); - - monitor.done(); - } - }; - } - - /** - * Utility method: call a runnable in a WorkbenchModifyDelegatingOperation - */ - protected boolean invokeRunnable(IRunnableWithProgress runnable) { - IRunnableWithProgress op= new WorkspaceModifyDelegatingOperation(runnable); - try { - getContainer().run(false, true, op); - } catch (InvocationTargetException e) { - Shell shell= getShell(); - String title= CUIPlugin.getResourceString(OP_ERROR + ".title"); //$NON-NLS-1$ - String message= CUIPlugin.getResourceString(OP_ERROR + ".message"); //$NON-NLS-1$ - - Throwable th= e.getTargetException(); - CUIPlugin.errorDialog(shell, title, message, th); - try { - getProjectHandle().delete(false, false, null); - } catch (CoreException ignore) { - } catch (UnsupportedOperationException ignore) { - } - return false; - } catch (InterruptedException e) { - return false; - } - return true; - } - - protected void doRun(IProgressMonitor monitor) throws CoreException { - createNewProject(monitor); - } - - /** - * Creates a new project resource with the selected name. - *

            - * In normal usage, this method is invoked after the user has pressed Finish on - * the wizard; the enablement of the Finish button implies that all controls - * on the pages currently contain valid values. - *

            - *

            - * Note that this wizard caches the new project once it has been successfully - * created; subsequent invocations of this method will answer the same - * project resource without attempting to create it again. - *

            - * - * @return the created project resource, or null if the project - * was not created - */ - protected IProject createNewProject(IProgressMonitor monitor) throws CoreException { - - if (newProject != null) - return newProject; - - // get a project handle - IProject newProjectHandle = null; - try { - newProjectHandle = getProjectHandle(); - } catch (UnsupportedOperationException e) { - throw new CoreException(new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, 0, e.getMessage(), null)); - } - - // get a project descriptor - IPath defaultPath = Platform.getLocation(); - IPath newPath = getLocationPath(); - if (defaultPath.equals(newPath)) - newPath = null; - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName()); - description.setLocation(newPath); - - newProject = CCorePlugin.getDefault().createCProject(description, newProjectHandle, monitor, getProjectID()); - return newProject; - } - - - /** - * Method getID. - * @return String - */ - public abstract String getProjectID(); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java deleted file mode 100644 index f904fd37268..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Created on 7-Aug-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.ui.wizards; - -import org.eclipse.cdt.ui.dialogs.ICOptionContainer; -import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.widgets.Composite; - -public abstract class NewCProjectWizardOptionPage extends WizardPage implements ICOptionContainer { - - private TabFolderOptionBlock fOptionBlock; - private IPreferenceStore preferenceStore; - - public NewCProjectWizardOptionPage(String pageName) { - this(pageName, null, null); - } - - public NewCProjectWizardOptionPage(String pageName, String title, ImageDescriptor titleImage) { - super(pageName, title, titleImage); - } - - protected abstract TabFolderOptionBlock createOptionBlock(); - - public void createControl(Composite parent) { - fOptionBlock = createOptionBlock(); - setControl(fOptionBlock.createContents(parent)); - } - - public void setVisible(boolean visible) { - super.setVisible(visible); - fOptionBlock.setVisible(visible); - updateContainer(); - } - - public void updateContainer() { - fOptionBlock.update(); - setPageComplete(fOptionBlock.isValid()); - setErrorMessage(fOptionBlock.getErrorMessage()); - } - - public void performApply(IProgressMonitor monitor) { - fOptionBlock.performApply(monitor); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreferenceStore() - */ - public abstract Preferences getPreferences(); - - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject() - */ - public abstract IProject getProject(); - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardPage.java deleted file mode 100644 index bbcb466427c..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardPage.java +++ /dev/null @@ -1,350 +0,0 @@ -package org.eclipse.cdt.ui.wizards; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.File; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.internal.IHelpContextIds; - -/** - * Standard main page for a wizard that is creates a project resource. - *

            - * This page may be used by clients as-is; it may be also be subclassed to suit. - *

            - *

            - * Example useage: - *

            - * mainPage = new CProjectWizardPage("basicCProjectPage");
            - * mainPage.setTitle("Project");
            - * mainPage.setDescription("Create a new project resource.");
            - * 
            - *

            - */ -public class NewCProjectWizardPage extends WizardPage { - - protected boolean useDefaults = true; - - // initial value stores - private String initialProjectFieldValue; - private IPath initialLocationFieldValue; - - // widgets - private Text projectNameField; - protected Text locationPathField; - protected Label locationLabel; - protected Button browseButton; - - private Listener nameModifyListener = new Listener() { - public void handleEvent(Event e) { - setLocationForSelection(); - setPageComplete(validatePage()); - } - }; - - private Listener locationModifyListener = new Listener() { - public void handleEvent(Event e) { - setPageComplete(validatePage()); - } - }; - - // constants - private static final int SIZING_TEXT_FIELD_WIDTH = 250; - - /** (non-Javadoc) - * Method declared on IDialogPage. - */ - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NULL); - - WorkbenchHelp.setHelp(composite, IHelpContextIds.NEW_PROJECT_WIZARD_PAGE); - - composite.setLayout(new GridLayout()); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - createProjectNameGroup(composite); - createProjectLocationGroup(composite); - projectNameField.setFocus(); - validatePage(); - // Show description on opening - setErrorMessage(null); - setMessage(null); - setControl(composite); - } - - /** - * Creates the project location specification controls. - * - * @param parent the parent composite - */ - private final void createProjectLocationGroup(Composite parent) { - - // project specification group - Composite projectGroup = new Composite(parent,SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 3; - projectGroup.setLayout(layout); - projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - final Button useDefaultsButton = new Button(projectGroup, SWT.CHECK | SWT.RIGHT); - useDefaultsButton.setText(CUIPlugin.getResourceString("CProjectWizardPage.useDefaultLabel")); //$NON-NLS-1$ - useDefaultsButton.setSelection(this.useDefaults); - - GridData buttonData = new GridData(); - buttonData.horizontalSpan = 3; - useDefaultsButton.setLayoutData(buttonData); - - createUserSpecifiedProjectLocationGroup(projectGroup,!this.useDefaults); - - SelectionListener listener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - useDefaults = useDefaultsButton.getSelection(); - browseButton.setEnabled(!useDefaults); - locationPathField.setEnabled(!useDefaults); - locationLabel.setEnabled(!useDefaults); - setLocationForSelection(); - if (!useDefaults) - locationPathField.setText(""); //$NON-NLS-1$ - } - }; - useDefaultsButton.addSelectionListener(listener); - } - - /** - * Creates the project name specification controls. - * - * @param parent the parent composite - */ - private final void createProjectNameGroup(Composite parent) { - // project specification group - Composite projectGroup = new Composite(parent,SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - projectGroup.setLayout(layout); - projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - // new project label - Label projectLabel = new Label(projectGroup,SWT.NONE); - projectLabel.setText(CUIPlugin.getResourceString("CProjectWizardPage.nameLabel")); //$NON-NLS-1$ - - // new project name entry field - projectNameField = new Text(projectGroup, SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = SIZING_TEXT_FIELD_WIDTH; - projectNameField.setLayoutData(data); - - // Set the initial value first before listener - // to avoid handling an event during the creation. - if (initialProjectFieldValue != null) - projectNameField.setText(initialProjectFieldValue); - projectNameField.addListener(SWT.Modify, nameModifyListener); - projectNameField.setVisible(true); - } - - /** - * Creates the project location specification controls. - * - * @param projectGroup the parent composite - * @param boolean - the initial enabled state of the widgets created - */ - private void createUserSpecifiedProjectLocationGroup(Composite projectGroup, boolean enabled) { - - // location label - locationLabel = new Label(projectGroup,SWT.NONE); - locationLabel.setText(CUIPlugin.getResourceString("CProjectWizardPage.locationLabel")); //$NON-NLS-1$ - locationLabel.setEnabled(enabled); - - // project location entry field - locationPathField = new Text(projectGroup, SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = SIZING_TEXT_FIELD_WIDTH; - locationPathField.setLayoutData(data); - locationPathField.setEnabled(enabled); - - // browse button - browseButton = new Button(projectGroup, SWT.PUSH); - browseButton.setText(CUIPlugin.getResourceString("CProjectWizardPage.browseLabel")); //$NON-NLS-1$ - browseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - handleLocationBrowseButtonPressed(); - } - }); - - browseButton.setEnabled(enabled); - - // Set the initial value first before listener - // to avoid handling an event during the creation. - if (initialLocationFieldValue != null) - locationPathField.setText(initialLocationFieldValue.toOSString()); - locationPathField.addListener(SWT.Modify, locationModifyListener); - } - - /** - * Returns the current project location path as entered by - * the user, or its anticipated initial value. - * - * @return the project location path, its anticipated initial value, or null - * if no project location path is known - */ - public IPath getLocationPath() { - if (useDefaults) - return initialLocationFieldValue; - - return new Path(locationPathField.getText()); - } - - /** - * Creates a project resource handle for the current project name field value. - *

            - * This method does not create the project resource; this is the responsibility - * of IProject::create invoked by the new project resource wizard. - *

            - * - * @return the new project resource handle - */ - public IProject getProjectHandle() { - return ResourcesPlugin.getWorkspace().getRoot().getProject(getProjectName()); - } - - /** - * Returns the current project name as entered by the user, or its anticipated - * initial value. - * - * @return the project name, its anticipated initial value, or null - * if no project name is known - */ - public String getProjectName() { - if (projectNameField == null) - return initialProjectFieldValue; - - return projectNameField.getText(); - } - - /** - * Open an appropriate directory browser - */ - protected void handleLocationBrowseButtonPressed() { - DirectoryDialog dialog = new DirectoryDialog(locationPathField.getShell()); - dialog.setMessage(CUIPlugin.getResourceString("CProjectWizardPage.directoryLabel")); //$NON-NLS-1$ - - String dirName = locationPathField.getText(); - if (!dirName.equals("")) {//$NON-NLS-1$ - File path = new File(dirName); - if (path.exists()) - dialog.setFilterPath(dirName); - } - - String selectedDirectory = dialog.open(); - if (selectedDirectory != null) - locationPathField.setText(selectedDirectory); - } - - /** - * Creates a new project creation wizard page. - * - * @param pageName the name of this page - */ - public NewCProjectWizardPage(String pageName) { - super(pageName); - setPageComplete(false); - this.initialLocationFieldValue = Platform.getLocation(); - } - - /** - * Set the location to the default location if we are set to useDefaults. - */ - protected void setLocationForSelection() { - if (useDefaults) { - IPath defaultPath = Platform.getLocation().append(projectNameField.getText()); - locationPathField.setText(defaultPath.toOSString()); - } - } - - /** - * Returns whether this page's controls currently all contain valid - * values. - * - * @return true if all controls are valid, and - * false if at least one is invalid - */ - protected boolean validatePage() { - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - - String projectFieldContents = projectNameField.getText(); - if (projectFieldContents.equals("")) { //$NON-NLS-1$ - setErrorMessage(null); - setMessage(CUIPlugin.getResourceString("CProjectWizardPage.projectNameEmpty")); //$NON-NLS-1$ - return false; - } - - // Give a chance to the wizard to do its own validation - IStatus validName = ((NewCProjectWizard)getWizard()).isValidName(projectFieldContents); - if (!validName.isOK()) { - setErrorMessage(validName.getMessage()); - return false; - } - - IStatus nameStatus = - workspace.validateName(projectFieldContents, IResource.PROJECT); - if (!nameStatus.isOK()) { - setErrorMessage(nameStatus.getMessage()); - return false; - } - - String locationFieldContents = locationPathField.getText(); - - if (!locationFieldContents.equals("")) {//$NON-NLS-1$ - // Give a chance to the wizard to do its own validation - IStatus validLocation = ((NewCProjectWizard)getWizard()).isValidLocation(projectFieldContents); - if (!validLocation.isOK()) { - setErrorMessage(validLocation.getMessage()); - return false; - } - - IPath path = new Path("");//$NON-NLS-1$ - if (!path.isValidPath(locationFieldContents)) { - setErrorMessage(CUIPlugin.getResourceString("CProjectWizardPage.locationError")); //$NON-NLS-1$ - return false; - } - if (!useDefaults && Platform.getLocation().isPrefixOf(new Path(locationFieldContents))) { - setErrorMessage(CUIPlugin.getResourceString("CProjectWizardPage.defaultLocationError")); //$NON-NLS-1$ - return false; - } - } - - if (getProjectHandle().exists()) { - setErrorMessage(CUIPlugin.getResourceString("CProjectWizardPage.projectExistsMessage")); //$NON-NLS-1$ - return false; - } - - setErrorMessage(null); - setMessage(null); - return true; - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizard.java deleted file mode 100644 index 1647096b2bb..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizard.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.eclipse.cdt.ui.wizards; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.ui.CPluginImages; -import org.eclipse.cdt.internal.ui.actions.WorkbenchRunnableAdapter; -import org.eclipse.cdt.internal.ui.util.ExceptionHandler; -import org.eclipse.cdt.internal.ui.wizards.NewWizardMessages; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard; - -/** - * description for "NewClassWizard". - * @see Wizard - */ -public class NewClassWizard extends BasicNewResourceWizard implements INewWizard { - private NewClassWizardPage fPage; - private String wz_title; - - private static final String WZ_TITLE = "NewClassWizard.title"; - private static final String WZ_DESC = "NewClassWizard.description"; - private static final String PAGE_TITLE = "NewClassWizard.page.title"; - - /** - * "NewClassWizard" constructor. - */ - public NewClassWizard() { - this(CUIPlugin.getResourceString(WZ_TITLE)); - - } - - public NewClassWizard(String title) { - super(); - wz_title = title; - setDefaultPageImageDescriptor(CPluginImages.DESC_WIZBAN_NEWCLASS); - setWindowTitle(wz_title); //$NON-NLS-1$ - setNeedsProgressMonitor(true); - } - - protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { - if(fPage.createClass(monitor)){ - ITranslationUnit headerTU= fPage.getCreatedClassHeaderFile(); - ITranslationUnit bodyTU= fPage.getCreatedClassBodyFile(); - if (headerTU != null) { - IResource resource= headerTU.getResource(); - selectAndReveal(resource); - openResource((IFile) resource); - } - if (bodyTU != null) { - IResource resource= bodyTU.getResource(); - selectAndReveal(resource); - openResource((IFile) resource); - } - } - } - /** - * @see Wizard#performFinish - */ - public boolean performFinish() { - if(!fPage.selectionIsCpp()) - return true; - IWorkspaceRunnable op= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException { - try { - finishPage(monitor); - } catch (InterruptedException e) { - throw new OperationCanceledException(e.getMessage()); - } - } - }; - try { - getContainer().run(false, true, new WorkbenchRunnableAdapter(op)); - } catch (InvocationTargetException e) { - handleFinishException(getShell(), e); - return false; - } catch (InterruptedException e) { - return false; - } - return true; - } - public void addPages() { - super.addPages(); - fPage= new NewClassWizardPage(getSelection()); - addPage(fPage); - fPage.setTitle(CUIPlugin.getResourceString(PAGE_TITLE)); - fPage.setDescription(CUIPlugin.getResourceString(WZ_DESC)); - fPage.init(); - } - - protected void handleFinishException(Shell shell, InvocationTargetException e) { - String title= NewWizardMessages.getString("NewElementWizard.op_error.title"); //$NON-NLS-1$ - String message= NewWizardMessages.getString("NewElementWizard.op_error.message"); //$NON-NLS-1$ - ExceptionHandler.handle(e, shell, title, message); - } - - protected void openResource(final IFile resource) { - final IWorkbenchPage activePage= CUIPlugin.getActivePage(); - if (activePage != null) { - final Display display= getShell().getDisplay(); - if (display != null) { - display.asyncExec(new Runnable() { - public void run() { - try { - IDE.openEditor(activePage, resource, true); - } catch (PartInitException e) { - CUIPlugin.getDefault().log(e); - } - } - }); - } - } - } - - public ICElement getCreatedClassElement(){ - return fPage.getCreatedClassElement(); - } -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java deleted file mode 100644 index f04fae96b43..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java +++ /dev/null @@ -1,1045 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001 Rational Software Corp. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html - * - * Contributors: - * Rational Software - initial implementation - ******************************************************************************/ -package org.eclipse.cdt.ui.wizards; - - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; -import java.text.MessageFormat; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.cdt.core.CConventions; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IOpenable; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.IStructure; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.search.BasicSearchMatch; -import org.eclipse.cdt.core.search.BasicSearchResultCollector; -import org.eclipse.cdt.core.search.ICSearchConstants; -import org.eclipse.cdt.core.search.ICSearchPattern; -import org.eclipse.cdt.core.search.ICSearchScope; -import org.eclipse.cdt.core.search.SearchEngine; -import org.eclipse.cdt.internal.core.model.IWorkingCopy; -import org.eclipse.cdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.cdt.internal.ui.dialogs.StatusUtil; -import org.eclipse.cdt.internal.ui.wizards.NewWizardMessages; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IListAdapter; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.IStringButtonAdapter; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.LayoutUtil; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.LinkToFileGroup; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.Separator; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField; -import org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField; -import org.eclipse.cdt.ui.CSearchResultLabelProvider; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.CodeGeneration; -import org.eclipse.cdt.ui.PreferenceConstants; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IWorkspaceRoot; -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.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.ContainerGenerator; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import org.eclipse.ui.internal.WorkbenchMessages; -import org.eclipse.ui.internal.WorkbenchPlugin; - -/** - * Wizard page to create a new class. - *

            - * Note: This class is not intended to be subclassed. To implement a different kind of - * a new class wizard page, extend NewTypeWizardPage. - *

            - * - */ - -public class NewClassWizardPage extends WizardPage implements Listener { - // the page name - private final static String PAGE_NAME= "NewClassWizardPage"; - private final String HEADER_EXT = ".h"; - private final String BODY_EXT = ".cpp"; - - // the current resource selection - private IStructuredSelection currentSelection; - // cache of C Model current selection - private ICElement eSelection = null; - - // cache of newly-created files - private ITranslationUnit parentHeaderTU = null; - private ITranslationUnit parentBodyTU = null; - // the created class element - private /*IStructure*/ ICElement createdClass = null; - - private List elementsOfTypeClassInProject = null; - - // Controls - private StringDialogField fClassNameDialogField; - private StringButtonDialogField fBaseClassDialogField; - private SelectionButtonDialogFieldGroup fAccessButtons; - private SelectionButtonDialogFieldGroup fConstDestButtons; - private LinkToFileGroup linkedResourceGroupForHeader; - private LinkToFileGroup linkedResourceGroupForBody; - - private final int PUBLIC_INDEX= 0, PROTECTED_INDEX= 1, PRIVATE_INDEX= 2, DEFAULT_INDEX= 3; - - private IStatus fCurrStatus; - protected IStatus fClassNameStatus; - protected IStatus fBaseClassStatus; - - private boolean hasCppNature = false; - - BasicSearchResultCollector resultCollector; - SearchEngine searchEngine; - - // -------------------- Initialization ------------------ - public NewClassWizardPage(IStructuredSelection selection) { - super(PAGE_NAME); - currentSelection = selection; - hasCppNature = isSelectionCPP(currentSelection); - if(hasCppNature){ - initializePageControls(); - } - } - - protected void initializePageControls(){ - TypeFieldsAdapter adapter= new TypeFieldsAdapter(); - - fClassNameDialogField= new StringDialogField(); - fClassNameDialogField.setDialogFieldListener(adapter); - fClassNameDialogField.setLabelText(NewWizardMessages.getString("NewClassWizardPage.classname.label")); - - fBaseClassDialogField= new StringButtonDialogField(adapter); - fBaseClassDialogField.setDialogFieldListener(adapter); - fBaseClassDialogField.setLabelText(NewWizardMessages.getString("NewClassWizardPage.baseclass.label")); - fBaseClassDialogField.setButtonLabel(NewWizardMessages.getString("NewClassWizardPage.baseclass.button")); - - String[] buttonNames1= new String[] { - /* 0 == PUBLIC_INDEX */ NewWizardMessages.getString("NewClassWizardPage.baseclass.access.public"), - /* 1 == PROTECTED_INDEX */ NewWizardMessages.getString("NewClassWizardPage.baseclass.access.protected"), - /* 2 == PRIVATE_INDEX */ NewWizardMessages.getString("NewClassWizardPage.baseclass.access.private"), - /* 3 == DEFAULT_INDEX */ NewWizardMessages.getString("NewClassWizardPage.baseclass.access.access") - }; - fAccessButtons= new SelectionButtonDialogFieldGroup(SWT.RADIO, buttonNames1, 4); - fAccessButtons.setDialogFieldListener(adapter); - fAccessButtons.setLabelText(NewWizardMessages.getString("NewClassWizardPage.baseclass.access.label")); - fAccessButtons.setSelection(0, true); - - String[] buttonNames2= new String[] { - /* 0 == INLINE_INDEX */ NewWizardMessages.getString("NewClassWizardPage.constdest.inline"), - /* 1 == VIRTUAL_DEST_INDEX */ NewWizardMessages.getString("NewClassWizardPage.constdest.virtualdestructor"), - /* 2 == INCLUDE_GUARD_INDEX */ NewWizardMessages.getString("NewClassWizardPage.constdest.includeguard"), - }; - - fConstDestButtons= new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames2, 3); - fConstDestButtons.setDialogFieldListener(adapter); - - linkedResourceGroupForHeader = new LinkToFileGroup(adapter, this); - linkedResourceGroupForHeader.setLabelText(NewWizardMessages.getString("NewClassWizardPage.files.header")); - linkedResourceGroupForBody = new LinkToFileGroup(adapter, this); - linkedResourceGroupForBody.setLabelText(NewWizardMessages.getString("NewClassWizardPage.files.body")); - - fClassNameStatus= new StatusInfo(); - fBaseClassStatus= new StatusInfo(); - - resultCollector = new BasicSearchResultCollector (); - searchEngine = new SearchEngine(); - } - - public void init() { - if(hasCppNature){ - fAccessButtons.setEnabled(false); - setPageComplete(false); - eSelection = getSelectionCElement(currentSelection); - }else { - StatusInfo status = new StatusInfo(); - status.setError(NewWizardMessages.getString("NewClassWizardPage.error.NotAvailableForNonCppProjects")); //$NON-NLS-1$ - updateStatus(status); - } - } - - // ----------------- Creating Controls -------------------- - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - if(!hasCppNature) - { - setControl(new Composite(parent, SWT.NULL)); - return; - } - - int nColumns= 5; - - initializeDialogUnits(parent); - // top level group - Composite composite = new Composite(parent, SWT.NULL); - composite.setLayout(new GridLayout(nColumns, false)); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - composite.setFont(parent.getFont()); - //WorkbenchHelp.setHelp(composite, IHelpContextIds.NEW_FILE_WIZARD_PAGE); - - createClassNameControls(composite, nColumns); - createBaseClassControls(composite, nColumns); - createModifierControls(composite, nColumns); - createSeparator(composite, nColumns); - createFilesControls(composite, nColumns); - - composite.layout(); - - setErrorMessage(null); - setMessage(null); - setControl(composite); - - } - - protected void createClassNameControls(Composite composite, int nColumns) { - fClassNameDialogField.doFillIntoGrid(composite, nColumns - 1); - DialogField.createEmptySpace(composite); - LayoutUtil.setWidthHint(fClassNameDialogField.getTextControl(null), getMaxFieldWidth()); - } - - protected void createBaseClassControls(Composite composite, int nColumns) { - fBaseClassDialogField.doFillIntoGrid(composite, nColumns); - LayoutUtil.setWidthHint(fBaseClassDialogField.getTextControl(null), getMaxFieldWidth()); - createAccessControls(composite, nColumns); - } - - protected void createAccessControls(Composite composite, int nColumns){ - LayoutUtil.setHorizontalSpan(fAccessButtons.getLabelControl(composite), 1); - - Control control= fAccessButtons.getSelectionButtonsGroup(composite); - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= nColumns - 2; - control.setLayoutData(gd); - - DialogField.createEmptySpace(composite); - - } - - protected void createModifierControls(Composite composite, int nColumns) { - LayoutUtil.setHorizontalSpan(fConstDestButtons.getLabelControl(composite), 1); - - Control control= fConstDestButtons.getSelectionButtonsGroup(composite); - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= nColumns - 1; - control.setLayoutData(gd); - - DialogField.createEmptySpace(composite); - } - - - protected void createFilesControls(Composite composite, int nColumns){ - linkedResourceGroupForHeader.doFillIntoGrid(composite, nColumns); - linkedResourceGroupForBody.doFillIntoGrid(composite, nColumns); - } - - /** - * Creates a separator line. Expects a GridLayout with at least 1 column. - * - * @param composite the parent composite - * @param nColumns number of columns to span - */ - protected void createSeparator(Composite composite, int nColumns) { - (new Separator(SWT.SEPARATOR | SWT.HORIZONTAL)).doFillIntoGrid(composite, nColumns, convertHeightInCharsToPixels(1)); - } - /** - * Returns the recommended maximum width for text fields (in pixels). This - * method requires that createContent has been called before this method is - * call. Subclasses may override to change the maximum width for text - * fields. - * - * @return the recommended maximum width for text fields. - */ - protected int getMaxFieldWidth() { - return convertWidthInCharsToPixels(40); - } - - // --------------------- listeners -------------------------- - - /* (non-Javadoc) - * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event) - */ - public void handleEvent(Event event) { - - } - - private class TypeFieldsAdapter implements IStringButtonAdapter, IDialogFieldListener, IListAdapter { - - // -------- IStringButtonAdapter - public void changeControlPressed(DialogField field) { - classPageChangeControlPressed(field); - } - - // -------- IListAdapter - public void customButtonPressed(ListDialogField field, int index) { - classPageCustomButtonPressed(field, index); - } - - public void selectionChanged(ListDialogField field) {} - - // -------- IDialogFieldListener - public void dialogFieldChanged(DialogField field) { - classPageDialogFieldChanged(field); - } - - public void doubleClicked(ListDialogField field) { - } - } - - private void classPageChangeControlPressed(DialogField field) { - if (field == fBaseClassDialogField) { - BasicSearchMatch element= (BasicSearchMatch)chooseBaseClass(); - if (element != null) { - fBaseClassDialogField.setText(element.getName()); - } - } - } - - private void classPageCustomButtonPressed(DialogField field, int index) { - } - - /* - * A field on the type has changed. The fields' status and all dependend - * status are updated. - */ - private void classPageDialogFieldChanged(DialogField field) { - if(field == fClassNameDialogField){ - String text = fClassNameDialogField.getText(); - if(!linkedResourceGroupForHeader.linkCreated()){ - if (text.length() > 0) { - linkedResourceGroupForHeader.setText(text + HEADER_EXT); - } else { - linkedResourceGroupForHeader.setText(text); - } - } - if(!linkedResourceGroupForBody.linkCreated()){ - if (text.length() > 0) { - linkedResourceGroupForBody.setText(text + BODY_EXT); - } else{ - linkedResourceGroupForBody.setText(text); - } - } - fClassNameStatus = classNameChanged(); - } - - if(field == fBaseClassDialogField){ - if(fBaseClassDialogField.getText().length() >= 0) - { - fAccessButtons.setEnabled(true); - fBaseClassStatus = baseClassNameChanged(); - } - else{ - fAccessButtons.setEnabled(false); - } - } - doStatusUpdate(); - } - - // --------------- Helper methods for creating controls ----- - public boolean selectionIsCpp(){ - return hasCppNature; - } - - private boolean isSelectionCPP(IStructuredSelection sel){ - IProject project = null; - ICElement element = getSelectionCElement(sel); - if (element == null){ - IResource resource = getSelectionResourceElement(sel); - project = resource.getProject(); - }else { - project = element.getCProject().getProject(); - } - if (project != null) - return CoreModel.getDefault().hasCCNature(project); - else - return false; - } - - private ICElement getSelectionCElement(IStructuredSelection sel) { - if (!sel.isEmpty() && sel instanceof IStructuredSelection) { - List list= ((IStructuredSelection)sel).toList(); - if (list.size() == 1) { - Object element= list.get(0); - if (element instanceof ICElement) { - return (ICElement)element; - } - } - } - return null; - } - - private IResource getSelectionResourceElement(IStructuredSelection sel) { - if (!sel.isEmpty() && sel instanceof IStructuredSelection) { - List list= ((IStructuredSelection)sel).toList(); - if (list.size() == 1) { - Object element= list.get(0); - if (element instanceof IResource) { - if(element instanceof IFile){ - IFile file = (IFile)element; - return (IResource) file.getParent(); - }else { - return (IResource)element; - } - } - } - } - return null; - } - - private void getChildrenOfTypeClass(IParent parent, List elementsFound, IProgressMonitor monitor, int worked){ - ICElement[] elements = parent.getChildren(); - monitor.worked( worked ); - - for (int i = 0; i< elements.length; i++){ - ICElement element = (ICElement)elements[i]; - if(element.getElementType() == ICElement.C_CLASS){ - elementsFound.add(element); - } - if(element instanceof IParent){ - getChildrenOfTypeClass((IParent)element, elementsFound, monitor, worked+1); - } - } - } - - private void searchForClasses(ICProject cProject, List elementsFound, IProgressMonitor monitor, int worked){ - ICSearchPattern pattern = SearchEngine.createSearchPattern( "*", ICSearchConstants.CLASS, ICSearchConstants.DECLARATIONS, false ); - ICElement[] elements = new ICElement[1]; - elements[0] = cProject; - ICSearchScope scope = SearchEngine.createCSearchScope(elements, true); - - searchEngine.search(CUIPlugin.getWorkspace(), pattern, scope, resultCollector, false); - elementsFound.addAll(resultCollector.getSearchResults()); - } - - private List getClassElementsInProject(){ - return elementsOfTypeClassInProject; - } - - private List findClassElementsInProject(){ - if(eSelection == null){ - return new LinkedList(); - } - - if( elementsOfTypeClassInProject != null ){ - return elementsOfTypeClassInProject; - } - - elementsOfTypeClassInProject = new LinkedList(); - IRunnableWithProgress runnable= new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - if (monitor == null) { - monitor= new NullProgressMonitor(); - } - monitor.beginTask(NewWizardMessages.getString("NewClassWizardPage.operations.getProjectClasses"), 5); //$NON-NLS-1$ - try{ - ICProject cProject = eSelection.getCProject(); - searchForClasses(cProject, elementsOfTypeClassInProject, monitor, 1); - //getChildrenOfTypeClass((IParent)cProject, elementsOfTypeClassInProject, monitor, 1); - monitor.worked(5); - } finally{ - monitor.done(); - } - } - }; - - try { - getWizard().getContainer().run(false, true, runnable); - } catch (InvocationTargetException e) { - } catch (InterruptedException e) { - } - finally { - } - return elementsOfTypeClassInProject; - } - - protected Object chooseBaseClass(){ - // find the available classes in this project - List elementsFound = findClassElementsInProject(); - - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new CSearchResultLabelProvider()); - dialog.setTitle(NewWizardMessages.getString("BaseClassSelectionDialog.title")); //$NON-NLS-1$ - dialog.setMessage(NewWizardMessages.getString("BaseClassSelectionDialog.message")); //$NON-NLS-1$ - dialog.setElements(elementsFound.toArray()); - dialog.setFilter("*"); - - if (dialog.open() == ElementListSelectionDialog.OK) { - Object element= dialog.getFirstResult(); - return element; - } - return null; - } - - // ------------- getter methods for dialog controls ------------- - public String getNewClassName(){ - return fClassNameDialogField.getText(); - } - - public String getBaseClassName(){ - return fBaseClassDialogField.getText(); - } - - public boolean isIncludeGuard(){ - return fConstDestButtons.isSelected(2); - } - - public boolean isVirtualDestructor(){ - return fConstDestButtons.isSelected(1); - } - - public boolean isInline(){ - return fConstDestButtons.isSelected(0); - } - - public String getAccess(){ - if(fAccessButtons.isSelected(0)) - return "public"; - else if(fAccessButtons.isSelected(1)) - return "protected"; - else if(fAccessButtons.isSelected(2)) - return "private"; - else return ""; - } - - public ITranslationUnit getCreatedClassHeaderFile(){ - return parentHeaderTU; - } - - public ITranslationUnit getCreatedClassBodyFile(){ - return parentBodyTU; - } - - public /*IStructure*/ ICElement getCreatedClassElement(){ - return createdClass; - } - - public IStructure getBaseClassElement(){ - - return null; - } - // -------------- Create a new Class ---------------------- - - public boolean createClass(IProgressMonitor monitor){ - if (monitor == null) { - monitor= new NullProgressMonitor(); - } - monitor.beginTask(NewWizardMessages.getString("NewTypeWizardPage.operationdesc"), 10); //$NON-NLS-1$ - try{ - - String lineDelimiter= null; - lineDelimiter= System.getProperty("line.separator", "\n"); - - parentHeaderTU = createTranslationUnit(linkedResourceGroupForHeader); - parentBodyTU = createTranslationUnit(linkedResourceGroupForBody); - monitor.worked(1); - - if(parentHeaderTU != null){ - String header = constructHeaderFileContent(lineDelimiter); - IWorkingCopy headerWC = parentHeaderTU.getSharedWorkingCopy(null, CUIPlugin.getDefault().getDocumentProvider().getBufferFactory()); - headerWC.getBuffer().append(header); - synchronized(headerWC) { - headerWC.reconcile(); - headerWC.commit(true, monitor); - } - //createdClass= (IStructure)headerWC.getElement(getNewClassName()); - createdClass= headerWC.getElement(getNewClassName()); - } - if(parentBodyTU != null){ - String body = constructBodyFileContent(lineDelimiter); - IWorkingCopy bodyWC = parentBodyTU.getSharedWorkingCopy(null, CUIPlugin.getDefault().getDocumentProvider().getBufferFactory()); - bodyWC.getBuffer().append(body); - synchronized(bodyWC){ - bodyWC.reconcile(); - bodyWC.commit(true, monitor); - } - } - - return true; - }catch(CModelException e){ - MessageDialog.openError(getContainer().getShell(), WorkbenchMessages.getString("WizardNewFileCreationPage.internalErrorTitle"), WorkbenchMessages.format("WizardNewFileCreationPage.internalErrorMessage", new Object[] {e.getMessage()})); //$NON-NLS-2$ //$NON-NLS-1$ - return false; - }finally{ - monitor.done(); - } - - } - - protected ITranslationUnit createTranslationUnit(LinkToFileGroup linkedGroup){ - ITranslationUnit createdUnit = null; - IFile createdFile = null; - createdFile= createNewFile(linkedGroup); - // turn the file into a translation unit - if(createdFile != null){ - Object element= CoreModel.getDefault().create(createdFile); - if (element instanceof ITranslationUnit) - createdUnit = (ITranslationUnit) element; - } - - return createdUnit; - } - - protected IFile createNewFile(LinkToFileGroup linkedGroup) { - final IPath newFilePath = getContainerFullPath(linkedGroup); - final IFile newFileHandle = createFileHandle(newFilePath); - - if(newFileHandle.exists()){ - return newFileHandle; - } - - // create the new file and cache it if successful - final boolean linkedFile = linkedGroup.linkCreated(); - final IPath containerPath = getContainerPath(linkedGroup); - final InputStream initialContents = getInitialContents(); - - WorkspaceModifyOperation op = new WorkspaceModifyOperation() { - protected void execute(IProgressMonitor monitor) throws CoreException, - InterruptedException - { - try { - monitor.beginTask(WorkbenchMessages.getString("WizardNewFileCreationPage.progress"), 2000); //$NON-NLS-1$ - if(!(containerExists(containerPath))){ - ContainerGenerator generator = new ContainerGenerator(containerPath); - generator.generateContainer(new SubProgressMonitor(monitor, 1000)); - } - createFile(newFileHandle,initialContents, newFilePath, linkedFile, new SubProgressMonitor(monitor, 1000)); - } finally { - monitor.done(); - } - } - }; - - try { - getContainer().run(false, true, op); - } catch (InterruptedException e) { - return null; - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof CoreException) { - ErrorDialog.openError( - getContainer().getShell(), // Was Utilities.getFocusShell() - WorkbenchMessages.getString("WizardNewFileCreationPage.errorTitle"), //$NON-NLS-1$ - null, // no special message - ((CoreException) e.getTargetException()).getStatus()); - } - else { - // CoreExceptions are handled above, but unexpected runtime exceptions and errors may still occur. - WorkbenchPlugin.log(MessageFormat.format("Exception in {0}.getNewFile(): {1}", new Object[] {getClass().getName(), e.getTargetException()}));//$NON-NLS-1$ - MessageDialog.openError(getContainer().getShell(), WorkbenchMessages.getString("WizardNewFileCreationPage.internalErrorTitle"), WorkbenchMessages.format("WizardNewFileCreationPage.internalErrorMessage", new Object[] {e.getTargetException().getMessage()})); //$NON-NLS-2$ //$NON-NLS-1$ - } - return null; - } - - return newFileHandle; - } - protected IFile createFileHandle(IPath filePath) { - IFile newFile = null; - IWorkspaceRoot root= CUIPlugin.getWorkspace().getRoot(); - newFile = root.getFileForLocation(filePath); - if(newFile == null) - newFile = root.getFile(filePath); - - return newFile; - } - - protected void createFile(IFile fileHandle, InputStream contents, IPath targetPath, boolean linkedFile, IProgressMonitor monitor) throws CoreException { - if (contents == null) - contents = new ByteArrayInputStream(new byte[0]); - - try { - fileHandle.create(contents, false, monitor); - } - catch (CoreException e) { - // If the file already existed locally, just refresh to get contents - int code = e.getStatus().getCode(); - if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) - fileHandle.refreshLocal(IResource.DEPTH_ZERO, null); - else - throw e; - } - - if (monitor.isCanceled()) - throw new OperationCanceledException(); - } - - // -------------Helper methods for creating the class ------- - protected IPath getSelectionPath(){ - if(eSelection == null){ - IResource resourceSelection = getSelectionResourceElement(currentSelection); - if(resourceSelection != null){ - return resourceSelection.getLocation().makeAbsolute(); - } - else - return null; - } - // if it is a file, return the parent path - if(eSelection instanceof ITranslationUnit) - return (eSelection.getParent().getPath()); - // if it is a root, project, or folder, return its path - if(eSelection instanceof IOpenable){ - return (eSelection.getPath()); - }else { - // if it is an element in a file, return its openable parent's path - ICElement current = eSelection.getParent(); - while (current != null){ - if ((current instanceof IOpenable) && !(current instanceof ITranslationUnit)){ - return current.getPath(); - } - current = current.getParent(); - } - return null; - } - } - - /* - * returns the path without the file name - */ - protected IPath getContainerPath(LinkToFileGroup linkedGroup) { - if(linkedGroup.linkCreated()){ - String pathName = linkedGroup.getResolvedPath(); - if((pathName == null) || (pathName.length() <1)) - return null; - IPath containerPath = new Path (pathName); - return containerPath.removeLastSegments(1).removeTrailingSeparator().makeAbsolute(); - }else { - return (getSelectionPath()); - } - } - - /* - * returns the path including the file name - */ - protected IPath getContainerFullPath(LinkToFileGroup linkedGroup) { - if(linkedGroup.linkCreated()){ - String pathName = linkedGroup.getResolvedPath(); - if (pathName == null || pathName.length() < 1) - return null; - else - //The user may not have made this absolute so do it for them - return (new Path(pathName)).makeAbsolute(); - } else { - String pathName = linkedGroup.getText(); - IPath containerPath = getSelectionPath(); - containerPath.addTrailingSeparator(); - return ((containerPath.append(pathName)).makeAbsolute()); - } - } - - protected boolean containerExists(IPath containerPath) { - IContainer container = null; - IWorkspaceRoot root= CUIPlugin.getWorkspace().getRoot(); - container = root.getContainerForLocation(containerPath); - if(container == null) - return false; - - return true; - } - - protected InputStream getInitialContents() { - return null; - } - - protected String getClassComment(ITranslationUnit parentTU) { - if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEGEN_ADD_COMMENTS)) { - try { - StringBuffer className= new StringBuffer(); - className.append(getNewClassName()); - String comment= CodeGeneration.getClassComment(parentTU, className.toString(), String.valueOf('\n')); - if (comment != null && isValidComment(comment)) { - return comment; - } - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - } - } - return null; - } - - // ------------ Constructing File Contents ----------------- - protected String constructHeaderFileContent(String lineDelimiter){ - StringBuffer text = new StringBuffer(); - boolean extendingBase = false; - String baseClassName = getBaseClassName(); - String baseClassFileName = ""; - if((baseClassName != null) && (baseClassName.length() > 0)) - { - extendingBase = true; - List classElements = findClassElementsInProject(); - BasicSearchMatch baseClass = (BasicSearchMatch)findInList(baseClassName, null, classElements); - -// if(baseClass != null){ -// IPath baseClassFileLocation = baseClass.getLocation(); -// IPath newFilePath = getContainerFullPath(linkedResourceGroupForHeader); -// baseClassFileName = baseClassName + HEADER_EXT; -// } else { - baseClassFileName = baseClassName + HEADER_EXT; -// } - } - - if(isIncludeGuard()){ - text.append("#ifndef "); - text.append(getNewClassName().toUpperCase()); - text.append("_H"); - text.append(lineDelimiter); - text.append("#define "); - text.append(getNewClassName().toUpperCase()); - text.append("_H"); - text.append(lineDelimiter); - text.append(lineDelimiter); - } - - if(extendingBase){ - text.append("#include \""); - text.append(baseClassFileName); - text.append('\"'); - text.append(lineDelimiter); - text.append(lineDelimiter); - } - text.append("class "); - text.append(getNewClassName()); - if(extendingBase){ - text.append(" : "); - text.append(getAccess()); - text.append(" "); - text.append(baseClassName); - } - text.append("{"); - text.append(lineDelimiter); - - text.append("public:"); - text.append(lineDelimiter); - text.append(lineDelimiter); - - // constructor - text.append('\t'); - text.append(getNewClassName()); - text.append("()"); - if(isInline()){ - text.append(" {}"); - text.append(lineDelimiter); - }else { - text.append(";"); - text.append(lineDelimiter); - } - - // destructor - text.append('\t'); - if(isVirtualDestructor()){ - text.append("virtual "); - } - text.append("~"); - text.append(getNewClassName()); - text.append("()"); - if(isInline()){ - text.append(" {}"); - text.append(lineDelimiter); - }else { - text.append(";"); - text.append(lineDelimiter); - } - text.append("};"); - text.append(lineDelimiter); - - if(isIncludeGuard()){ - text.append(lineDelimiter); - text.append("#endif // "); - text.append(getNewClassName().toUpperCase()); - text.append("_H"); - text.append(lineDelimiter); - } - - return text.toString(); - } - - protected String constructBodyFileContent(String lineDelimiter){ - StringBuffer text = new StringBuffer(); - text.append("#include \""); - text.append(getCreatedClassHeaderFile().getElementName()); - text.append("\""); - text.append(lineDelimiter); - text.append(lineDelimiter); - - if(isInline()) - return text.toString(); - - // constructor - text.append(getNewClassName()); - text.append("::"); - text.append(getNewClassName()); - text.append("()"); - text.append(lineDelimiter); - text.append("{}"); - text.append(lineDelimiter); - - // destructor - text.append(getNewClassName()); - text.append("::~"); - text.append(getNewClassName()); - text.append("()"); - text.append(lineDelimiter); - text.append("{}"); - text.append(lineDelimiter); - return text.toString(); - } - - - // ------ validation -------- - protected void doStatusUpdate() { - // status of all used components - IStatus[] status= new IStatus[] { - fClassNameStatus, - fBaseClassStatus, - }; - - // the mode severe status will be displayed and the ok button enabled/disabled. - updateStatus(status); - } - - protected void updateStatus(IStatus[] status) { - updateStatus(StatusUtil.getMostSevere(status)); - } - - protected void updateStatus(IStatus status) { - fCurrStatus= status; - setPageComplete(!status.matches(IStatus.ERROR)); - StatusUtil.applyToStatusLine(this, status); - } - - protected boolean isValidComment(String template) { - return true; - } - - // status validation - /** - * Hook method that gets called when the class name has changed. The method validates the - * class name and returns the status of the validation. - *

            - * Subclasses may extend this method to perform their own validation. - *

            - * - * @return the status of the validation - */ - protected IStatus classNameChanged() { - StatusInfo status= new StatusInfo(); - String className= getNewClassName(); - // must not be empty - if (className.length() == 0) { - status.setError(NewWizardMessages.getString("NewClassWizardPage.error.EnterClassName")); //$NON-NLS-1$ - return status; - } - if (className.indexOf("::") != -1) { - status.setError(NewWizardMessages.getString("NewClassWizardPage.error.QualifiedName")); //$NON-NLS-1$ - return status; - } - IStatus val= CConventions.validateClassName(className); - if (val.getSeverity() == IStatus.ERROR) { - status.setError(NewWizardMessages.getFormattedString("NewClassWizardPage.error.InvalidClassName", val.getMessage())); //$NON-NLS-1$ - return status; - } else if (val.getSeverity() == IStatus.WARNING) { - status.setWarning(NewWizardMessages.getFormattedString("NewClassWizardPage.warning.ClassNameDiscouraged", val.getMessage())); //$NON-NLS-1$ - // continue checking - } - - // must not exist - List elementsFound = findClassElementsInProject(); - if(foundInList(getNewClassName(), getContainerPath(linkedResourceGroupForHeader), elementsFound)){ - status.setWarning(NewWizardMessages.getString("NewClassWizardPage.error.ClassNameExists")); //$NON-NLS-1$ - } - return status; - } - /** - * Hook method that gets called when the superclass name has changed. The method - * validates the superclass name and returns the status of the validation. - *

            - * Subclasses may extend this method to perform their own validation. - *

            - * - * @return the status of the validation - */ - protected IStatus baseClassNameChanged() { - String baseClassName = getBaseClassName(); - StatusInfo status= new StatusInfo(); - if (baseClassName.length() == 0) { - // accept the empty field (stands for java.lang.Object) - return status; - } - - // class name must follow the C/CPP convensions - IStatus val= CConventions.validateClassName(baseClassName); - if (val.getSeverity() == IStatus.ERROR) { - status.setError(NewWizardMessages.getString("NewClassWizardPage.error.InvalidBaseClassName")); //$NON-NLS-1$ - return status; - } - - // if class does not exist, give warning - List elementsFound = findClassElementsInProject(); - if(!foundInList(baseClassName, null, elementsFound)){ - status.setWarning(NewWizardMessages.getString("NewClassWizardPage.warning.BaseClassNotExists")); //$NON-NLS-1$ - } - return status; - } - - private Object findInList(String name, IPath path, List elements){ - Iterator i = elements.iterator(); - while (i.hasNext()){ - BasicSearchMatch element = (BasicSearchMatch)i.next(); - if(path != null){ - // check both the name and the path - if ((name.equals(element.getName())) && (path.makeAbsolute().equals(element.getLocation()))) - return element; - } else { - // we don't care about the path - if (name.equals(element.getName())) - return element; - } - } - return null; - } - - private boolean foundInList(String name, IPath path, List elements){ - if(findInList(name, path, elements) != null) - return true; - else - return false; - } - -} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java deleted file mode 100644 index 22a28a993e6..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConversionWizard.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.eclipse.cdt.ui.wizards.conversion; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.wizards.NewCProjectWizard; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IWorkbench; - -/** - * ConversionWizard This wizard provides a method by which the user can - * change the nature of their projects. This class cannot be implemented. It - * is meant to be subclassed, with the subclasses providing the new labels, - * and pages. - * - * @author Judy N. Green - * @since Aug 8, 2002 - * @see CtoCCConversionWizard#addPages - */ -public abstract class ConversionWizard - extends NewCProjectWizard { - - // Titles and descriptions may be overwritten by subclasses through the accessor methods. - private static final String WZ_TITLE = "ConversionWizard.title"; //$NON-NLS-1$ - private static final String WZ_DESC = "ConversionWizard.description"; //$NON-NLS-1$ - private static final String PREFIX = "ConversionWizard"; //$NON-NLS-1$ - - // Window Title should be overwritten by subclasses - private static final String WINDOW_TITLE = "ConversionWizard.windowTitle"; //$NON-NLS-1$ - - // the wizards main page containing the list of projects that the user may select for conversion. - protected ConvertProjectWizardPage mainPage; - - /** - * Conversion Wizard constructor - */ - public ConversionWizard() { - this(getWindowTitleResource(), getWzDescriptionResource()); - } - - /** - * Conversion Wizard constructor - * - * @param title - * @param desc - */ - public ConversionWizard(String title, String desc) { - super(title, desc); - } - - /* (non-Javadoc) - * Method declared on IWorkbenchWizard. - */ - public void init(IWorkbench workbench, IStructuredSelection currentSelection) { - super.init(workbench, currentSelection); - setWindowTitle(getWindowTitleResource()); - } - - /** - * Method getWindowTitleResource, allows Wizard Title label value to be - * changed by subclasses - * - * @return String - */ - protected static String getWindowTitleResource() { - - return CUIPlugin.getResourceString(WINDOW_TITLE); - } - - /** - * Method getWzDescriptionResource, allows Wizard description label value - * to be changed by subclasses - * - * @return String - */ - protected static String getWzDescriptionResource() { - - return CUIPlugin.getResourceString(WZ_DESC); - } - - /** - * Method getWzTitleResource, allows Wizard description label value - * to be changed by subclasses - * - * @return String - */ - protected static String getWzTitleResource() { - - return CUIPlugin.getResourceString(WZ_TITLE); - } - - /** - * Method getPrefix, allows prefix value to be changed by subclasses - * - * @return String - */ - protected static String getPrefix() { - - return PREFIX; - } - - /** - * Method doRun calls the doRunPrologue and mainPage's doRun method and the - * doRunEpliogue. Subclasses may overwrite to add further actions - * - * @see org.eclipse.cdt.ui.wizards.CProjectWizard#doRun(IProgressMonitor) - */ - protected void doRun(IProgressMonitor monitor) throws CoreException { - try{ - mainPage.doRun(monitor, getProjectID()); - } catch (CoreException ce){ - CCorePlugin.log(ce); - throw ce; - } finally{ - doRunEpilogue(monitor); - monitor.isCanceled(); - } - } - /** - * Return the type of project that it is being converted to - * The default if a make project - */ - public abstract String getProjectID(); - - /** - * Method addPages allows subclasses to add as many pages as they need. Overwrite - * to create at least one conversion specific page.

            - * - * i.e.
            - *

             
            -     *   mainPage = new ConvertToStdMakeProjectWizardPage(getPrefix());
            -     *   addPage(mainPage);
            -     *
            - * - * @see Wizard#createPages - */ - public abstract void addPages(); - - /** - * Required by superclass but with no implementation here - * - * @param monitor - */ - protected void doRunPrologue(IProgressMonitor monitor) {} - - /** - * Required by superclass but with no implementation here - * - * @param monitor - */ - protected void doRunEpilogue(IProgressMonitor monitor) {} -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java deleted file mode 100644 index 1d9e42c395e..00000000000 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/conversion/ConvertProjectWizardPage.java +++ /dev/null @@ -1,522 +0,0 @@ -package org.eclipse.cdt.ui.wizards.conversion; - - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -import java.util.Vector; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.internal.ui.util.SWTUtil; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Table; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - - -/** - *

            - * ConvertProjectWizardPage Standard main page for a wizard that converts a - * project's nature.
            This class provides the UI components and populates - * the table with all projects that meet the criteria specified by - * subclasses in the method isCandidate(IProject). This class does the - * conversion through the method convertProjects([]Object), which is also - * defined by all subclasses.
            Subclasses provide the methods that - * determine what files are displayed and what action is performed on them as - * well as the labels for the Wizard.

            - * - * Note: Only Projects that are open will be considered for conversion. - * - * - * @author Judy N. Green - * @since Aug 6, 2002

            - */ -public abstract class ConvertProjectWizardPage - extends WizardPage { - - public static final String KEY_TITLE = "ConvertionWizard.title"; - public static final String KEY_CONVERTING = "ConvertionWizard.converting"; - private static final String PROJECT_LIST = "ConversionWizard.projectlist"; - - protected boolean convertToC = false; - protected boolean convertToCC = true; - protected Button cRadioButton; - protected Button ccRadioButton; - - // The Main widget containing the table and its list of condidate open projects - protected CheckboxTableViewer tableViewer; - - protected Button selectAllButton; - protected Button deselectAllButton; - - // We only need to calculate this once per instantiation of this wizard - protected Object[] listItems = null; - - /** - * Constructor for ConvertProjectWizardPage. - * - * @param pageName - */ - public ConvertProjectWizardPage(String pageName) { - super(pageName); - setTitle(getWzTitleResource()); - setDescription(getWzDescriptionResource()); - } - - // get methods to allow values to be changed by subclasses - protected abstract String getWzTitleResource(); - - protected abstract String getWzDescriptionResource(); - - /** - * Returns the elements that the user has checked - * - * @return Object[] - */ - protected Object[] getCheckedElements() { - - return tableViewer.getCheckedElements(); - } - - /** - * Creates the main wizard page. - * - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite) - */ - public void createControl(Composite parent) { - - Composite container = new Composite(parent, SWT.NONE); - - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - container.setLayout(layout); - setControl(createAvailableProjectsGroup(container)); - addToMainPage(container); - // will default to false until a selection is made - setPageComplete(validatePage()); - } - - /** - * Method addToMainPage allows subclasses to add - * elements to the main page. - * - */ - protected void addToMainPage(Composite container){ - - // Add convert to C or C/C++ buttons - Composite area = ControlFactory.createGroup(container, "Convert to C or C++", 2); - - - SelectionListener cListener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - convertToC = cRadioButton.getSelection(); - convertToCC = ccRadioButton.getSelection(); - validatePage(); - } - }; - cRadioButton = ControlFactory.createRadioButton(area, - "C Project", - "C ", - cListener); - cRadioButton.setSelection(convertToC); - ccRadioButton = ControlFactory.createRadioButton(area, - "C++ Project", - "C++", - cListener); - ccRadioButton.setSelection(convertToCC); - - area.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - cRadioButton = null; - ccRadioButton = null; - } - }); - } - - /** - * Creates a list of projects that can be selected by the user. - * - * @param parent the parent composite - * @return Composite - */ - private final Composite createAvailableProjectsGroup(Composite parent) { - - // Add a label - Label label = new Label(parent, SWT.LEFT); - label.setText(CUIPlugin.getResourceString(PROJECT_LIST)); - - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginHeight = 5; - layout.marginWidth = 5; - layout.numColumns = 2; - container.setLayout(layout); - GridData data = new GridData(GridData.FILL_BOTH); - container.setLayoutData(data); - - // create the table - Table table = new Table(container, - SWT.CHECK | SWT.BORDER | SWT.MULTI | - SWT.SINGLE | SWT.H_SCROLL | - SWT.V_SCROLL); - data = new GridData(GridData.FILL_BOTH); - table.setLayoutData(data); - table.setHeaderVisible(true); - table.setLinesVisible(false); - - TableLayout tableLayout = new TableLayout(); - table.setHeaderVisible(false); - table.setLayout(tableLayout); - - // add a table viewer - tableViewer = new CheckboxTableViewer(table); - tableViewer.setLabelProvider(new ProjectLabelProvider()); - tableViewer.setContentProvider(new ProjectContentProvider()); - - // set initial input - tableViewer.setInput(getElements()); - - // define and assign sorter - tableViewer.setSorter(new ViewerSorter() { - public int compare(Viewer viewer, Object object1, Object object2) { - - if ((object1 instanceof IProject) && (object2 instanceof IProject)) { - IProject left = (IProject)object1; - IProject right = (IProject)object2; - int result = left.getName().compareToIgnoreCase(right.getName()); - - if (result != 0) { - return result; - } - return left.getName().compareToIgnoreCase(right.getName()); - } - return super.compare(viewer, object1, object2); - } - - public boolean isSorterProperty(Object element, String property) { - return true; - } - }); - tableViewer.setAllChecked(false); - tableViewer.refresh(); - - tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - // will default to false until a selection is made - setPageComplete(validatePage()); - updateSelectionButtons(); - } - }); - // Add button panel - - Composite buttons= new Composite(container, SWT.NULL); - buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); - layout= new GridLayout(); - layout.marginHeight= 0; - layout.marginWidth= 0; - layout.verticalSpacing = 8; - buttons.setLayout(layout); - - - selectAllButton= new Button(buttons, SWT.PUSH); - selectAllButton.setLayoutData(getButtonGridData(selectAllButton)); - selectAllButton.setText("Select All"); //$NON-NLS-1$ - selectAllButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - ConvertProjectWizardPage.this.tableViewer.setAllChecked(true); - // update the pageComplete status - setPageComplete(true); - updateSelectionButtons(); - } - }); - - deselectAllButton= new Button(buttons, SWT.PUSH); - deselectAllButton.setLayoutData(getButtonGridData(deselectAllButton)); - deselectAllButton.setText("Deselect All"); //$NON-NLS-1$ - deselectAllButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - ConvertProjectWizardPage.this.tableViewer.setAllChecked(false); - // update the pageComplete status - setPageComplete(false); - updateSelectionButtons(); - } - }); - - // enable or disable selection buttons - Object[] elements = getElements(); - boolean enableSelectionButtons = (elements != null) && (elements.length > 0); - - selectAllButton.setEnabled(enableSelectionButtons); - // we've called setAllChecked(false) earlier - deselectAllButton.setEnabled(false); - - return parent; - } - - /* - * Method updateSelectionButtons, enables/disables buttons - * dependent on what is selected - */ - - protected void updateSelectionButtons() { - - // update select and deselect buttons as required - Object[] checkedObjects = getCheckedElements(); - int totalItems = tableViewer.getTable().getItemCount(); - boolean allSelected = checkedObjects.length == totalItems; - boolean noneSelected = checkedObjects.length == 0; - selectAllButton.setEnabled(!allSelected); - deselectAllButton.setEnabled(!noneSelected); - } - /* - * Method getButtonGridData creates - * and returns a GridData for the given button - * - * @GridData - */ - private static GridData getButtonGridData(Button button) { - GridData data= new GridData(GridData.FILL_HORIZONTAL); - data.widthHint= SWTUtil.getButtonWidthHint(button); - data.heightHint= SWTUtil.getButtonHeigthHint(button); - - return data; - } - - /** - * Returns whether this page's controls currently all contain valid values. - * - * @return true if the user has selected at least one - * candidate project. - */ - protected boolean validatePage() { - - Object[] selection = getCheckedElements(); - - return ((selection != null) && (selection.length > 0)); - } - - /** - * Provides the contents for the list using the enclosing class's method - * getElements(); - */ - public class ProjectContentProvider - implements IStructuredContentProvider { - public Object[] getElements(Object parent) { - return listItems; - } - - public void dispose() {} - - public void inputChanged(Viewer viewer, Object oldInput, - Object newInput) {} - } - - /** - * Provides labels for the listed items. In this case it returns each - * project's name - */ - public class ProjectLabelProvider - extends LabelProvider - implements ITableLabelProvider { - public String getColumnText(Object obj, int index) { - - if (index == 0) { - - return ((IProject)obj).getName(); - } - - return ""; - } - - public Image getColumnImage(Object obj, int index) { - - return PlatformUI.getWorkbench().getSharedImages().getImage( - ISharedImages.IMG_OBJ_PROJECT); - } - } - - /** - * Returns a list of open projects that are determined to be candidates - * through the method isCandidate().
            - * - * Note: Only Projects that are open will be considered for conversion. - * - * @return Object[] which may be null - */ - protected Object[] getElements() { - - IWorkspace workspace = CUIPlugin.getWorkspace(); - IProject[] projects = workspace.getRoot().getProjects(); - Vector candidates = new Vector(projects.length); - IProject next = null; - - // ensure we only present open, valid candidates to the user - for (int i = 0; i < projects.length; i++) { - next = (IProject)projects[i]; - - if ((next != null) - && next.isOpen() - && isCandidate(next)) { - candidates.addElement(next); - } - - next = null; - } - - // convert to an array for return - Object[] candidateArray = null; - - if (candidates.size() > 0) { - candidateArray = new Object[candidates.size()]; - candidates.copyInto(candidateArray); - } - // update the global variable that will - // be returned by the ProjectContentProvider - listItems = candidateArray; - - return candidateArray; - } - - /** - * doRun can be overwritten in subclasses to change behaviour, but this is - * generally not required. It is called from the corresponding Conversion - * Wizard - * - * @param monitor - * @param projectID - * @exception CoreException - */ - public void doRun(IProgressMonitor monitor, String projectID) throws CoreException { - - Object[] selection = getCheckedElements(); - int totalSelected = selection.length; - - if ((selection != null) && (totalSelected > 0)) { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask(CUIPlugin.getResourceString(KEY_TITLE), 1); - convertProjects(selection, monitor, projectID); - } - } - - /** - * convertProjects calls the convertProject() method on each project - * passed to it. - * - * @param selected - * @param monitor - * @param projectID - * @throws CoreException - */ - private void convertProjects(Object[] selected, IProgressMonitor monitor, String projectID) - throws CoreException { - monitor.beginTask(CUIPlugin.getResourceString(KEY_CONVERTING), - selected.length); - - for (int i = 0; i < selected.length; i++) { - - IProject project = (IProject)selected[i]; - convertProject(project, monitor, projectID); - monitor.worked(1); - } - } - - /** - * Method finish we always finish successfully :) - * - * @return boolean - */ - public boolean finish() { - - return true; - } - - /** - * Must be overwritten in subclasses to change behaviour Determines which - * projects will be displayed in the list - * - * @param project - * @return boolean - */ - public abstract boolean isCandidate(IProject project); - - /** - * convertProject must be overwritten in subclasses to change behaviour - * - * @param project - * @param monitor - * @param projectID - * @throws CoreException - */ - public void convertProject(IProject project, - IProgressMonitor monitor, - String projectID) - throws CoreException{ - // Add the correct nature - if (convertToC) { - if (!project.hasNature(CProjectNature.C_NATURE_ID)){ - addCNature(project, monitor, true); - } else { - if (project.hasNature(CCProjectNature.CC_NATURE_ID)){ - // remove the C++ nature - CCProjectNature.removeCCNature(project, monitor); - } - } - } else { - if (convertToCC && !project.hasNature(CCProjectNature.CC_NATURE_ID)) { - addCCNature(project, monitor, true); - } - } - } - protected void addCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException{ - if ( getWizard() instanceof ConversionWizard) { - CCorePlugin.getDefault().convertProjectToC(project, monitor, ((ConversionWizard)getWizard()).getProjectID()); - } - } - - protected void addCCNature(IProject project, IProgressMonitor monitor, boolean addMakeBuilder) throws CoreException{ - if ( getWizard() instanceof ConversionWizard) { - if (project.hasNature(CProjectNature.C_NATURE_ID)) { - CCorePlugin.getDefault().convertProjectFromCtoCC(project, monitor); - } else { - CCorePlugin.getDefault().convertProjectToCC(project, monitor, ((ConversionWizard)getWizard()).getProjectID()); - } - } - } - -} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/ControlFactory.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/ControlFactory.java deleted file mode 100644 index 9432c6458e6..00000000000 --- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/ControlFactory.java +++ /dev/null @@ -1,658 +0,0 @@ -package org.eclipse.cdt.utils.ui.controls; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import java.util.StringTokenizer; - -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CCombo; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; - -public class ControlFactory { - - public static Control setParentColors(Control control) { - Composite parent = control.getParent(); - control.setBackground(parent.getBackground()); - control.setForeground(parent.getForeground()); - return control; - } - - /** - * Creates composite control and sets the default layout data. - * - * @param parent the parent of the new composite - * @param numColumns the number of columns for the new composite - * @return the newly-created coposite - */ - public static Composite createComposite(Composite parent, int numColumns) { - return createCompositeEx(parent, numColumns, GridData.FILL_HORIZONTAL); - } - - /** - * Creates composite control and sets the specified layout data. - * - * @param parent the parent of the new composite - * @param numColumns the number of columns for the new composite - * @param layoutMode - GridData modes that should be applied to this control - * @return the newly-created coposite - */ - public static Composite createCompositeEx(Composite parent, int numColumns, int layoutMode) { - Composite composite = new Composite(parent, SWT.NULL); - - composite.setLayout(new GridLayout(numColumns, true)); - composite.setLayoutData(new GridData(layoutMode)); - return composite; - } - - /** - * Creates thick separator. - * - * @param parent the parent of the new composite - * @param color the separator color - * @return preferedThickness - the prefered thickness of separator (or 2 if SWT.DEFAULT) - */ - public static Composite createCompositeSeparator(Composite parent, Color color, int preferedHeight) { - Composite separator = createComposite(parent, 1); - GridData gd = (GridData)separator.getLayoutData(); - gd.heightHint = ((SWT.DEFAULT == preferedHeight) ? 2 : preferedHeight); - separator.setLayoutData(gd); - separator.setBackground(color); - return separator; - } - - /** - * Creates thick separator. - * - * @param parent the parent of the new composite - * @param color the separator color - * @return preferedThickness - the prefered thickness of separator (or 2 if SWT.DEFAULT) - */ - public static Label createSeparator(Composite parent, int nCols) { - Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalSpan = nCols; - separator.setLayoutData(data); - return separator; - } - /** - * Creates a spacer control. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent) { - return createEmptySpace(parent, 1); - } - /** - * Creates a spacer control with the given span. - * The composite is assumed to have MGridLayout as - * layout. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent, int span) { - Label label= new Label(parent, SWT.LEFT); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.BEGINNING; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.horizontalIndent= 0; - gd.widthHint= 0; - gd.heightHint= 0; - label.setLayoutData(gd); - return label; - } - - /** - * Creates an new label (basic method) - * - * - * @param parent parent object - * @param text the label text - * @param widthHint - recommended widget width - * @param heightHint - recommended widget height - * @param style - control style - * @return the new label - */ - public static Label createLabel(Composite parent, String text, int widthHint, int heightHint, int style) { - - Label label = new Label(parent, style); - label.setText(text); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 1; - gd.widthHint = widthHint; - gd.heightHint = heightHint; - label.setLayoutData(gd); - return label; - } - - /** - * Utility method that creates a label instance - * and sets the default layout data. - * - * @param parent the parent for the new label - * @param text the text for the new label - * @return the new label - */ - public static Label createLabel(Composite parent, String text) { - return createLabel(parent, text, SWT.DEFAULT, SWT.DEFAULT, SWT.LEFT); - } - - /** - * Utility method that creates a label instance - * and sets the default layout data and sets the - * font attributes to be SWT.BOLD. - * - * @param parent the parent for the new label - * @param text the text for the new label - * @return the new label - */ - public static Label createBoldLabel(Composite parent, String text) { - Label label = createLabel( parent, text ); - FontData[] fd = label.getFont().getFontData(); - fd[0].setStyle( SWT.BOLD ); - Font font = new Font( Display.getCurrent(), fd[0] ); - label.setFont( font ); - return label; - } - - - /** - * Creates an new Wrapped label - * - * - * @param parent parent object - * @param text the label text - * @param widthHint - recommended widget width - * @param heightHint - recommended widget height - * @return the new label - */ - public static Label createWrappedLabel(Composite parent, String text, int widthHint, int heightHint) { - return createLabel(parent, text, widthHint, heightHint, SWT.LEFT | SWT.WRAP); - } - - - /** - * Creates an new checkbox instance and sets the default - * layout data. - * - * @param group the composite in which to create the checkbox - * @param label the string to set into the checkbox - * @return the new checkbox - */ - public static Button createCheckBox(Composite group, String label) { - Button button = new Button(group, SWT.CHECK | SWT.LEFT); - button.setText(label); - GridData data = new GridData(); - button.setLayoutData(data); - button.setBackground(group.getBackground()); - button.setForeground(group.getForeground()); - return button; - } - - /** - * Creates an new checkbox instance and sets the default - * layout data. - * - * @param group the composite in which to create the checkbox - * @param label the string to set into the checkbox - * @return the new checkbox - */ - public static Button createCheckBoxEx(Composite group, String label, int style) { - Button button = new Button(group, SWT.CHECK | style); - button.setText(label); - GridData data = new GridData(); - button.setLayoutData(data); - button.setBackground(group.getBackground()); - button.setForeground(group.getForeground()); - return button; - } - - /** - * Creates an new radiobutton instance and sets the default - * layout data. - * - * @param group the composite in which to create the radiobutton - * @param label the string to set into the radiobutton - * @param value the string to identify radiobutton - * @return the new checkbox - */ - public static Button createRadioButton(Composite group, String label, String value, SelectionListener listener) { - Button button = new Button(group, SWT.RADIO | SWT.LEFT); - button.setText(label); - button.setData((null == value) ? label : value); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.horizontalAlignment = GridData.FILL; - data.verticalAlignment = GridData.BEGINNING; - button.setLayoutData(data); - if(null != listener) - button.addSelectionListener(listener); - return button; - } - - /** - * Utility method that creates a push button instance - * and sets the default layout data. - * - * @param parent the parent for the new button - * @param label the label for the new button - * @return the newly-created button - */ - public static Button createPushButton(Composite parent, String label) { - Button button = new Button(parent, SWT.PUSH); - button.setText(label); -// button.addSelectionListener(this); - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - button.setLayoutData(data); - return button; - } - - - /** - * Create a text field specific for this application - * - * @param parent the parent of the new text field - * @return the new text field - */ - public static Text createTextField(Composite parent) { - return createTextField(parent, SWT.SINGLE | SWT.BORDER); - } - - public static Text createTextField(Composite parent, int style) { - Text text = new Text(parent, style); - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - data.verticalAlignment = GridData.CENTER; - data.grabExcessVerticalSpace = false; - text.setLayoutData(data); - - return text; - } - - /** - * Create a group box - * - * @param parent the parent of the new control - * @param label the group box label - * @param nColumns - number of layout columns - * @return the new group box - */ - public static Group createGroup(Composite parent, String label, int nColumns) { - Group group = new Group(parent, SWT.NONE); - group.setText(label); - GridLayout layout = new GridLayout(); - layout.numColumns = nColumns; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - return group; - } - - - /** - * Create a List box - * - * @param parent the parent of the new control - * @param label the group box label - * @param nColumns - number of layout columns - * @return the new group box - */ - public static List createList(Composite parent, String strdata, String selData) { - List list = new List(parent, SWT.SINGLE); - GridData data = new GridData(); - list.setLayoutData(data); - StringTokenizer st = new StringTokenizer(strdata, ","); //$NON-NLS-1$ - while(st.hasMoreTokens()) - list.add(st.nextToken()); - if(selData == null) { - if(list.getItemCount() > 0) - list.select(0); - } - else - selectList(list, selData); - return list; - } - - public static void selectList(List list, String selData) { - int n_sel = list.indexOf(selData); - if(0 > n_sel) - n_sel = 0; - list.select(n_sel); - } - - - - - /** - * Create this group's list viewer. - */ - public static TableViewer createTableViewer(Composite parent, String[] opt_list, - int width, int height, int style) { - TableViewer listViewer = new TableViewer(parent, SWT.BORDER | style); - GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); - data.widthHint = width; - data.heightHint = height; - listViewer.getTable().setLayoutData(data); - if(null != opt_list) - listViewer.add(opt_list); - return listViewer; - } - - - /** - * Create this group's list viewer. - */ - public static TableViewer createTableViewer(Composite parent, - int width, int height, int style, String[] columns, int[] colWidths) { - TableViewer listViewer = createTableViewer(parent, null, width, height, style); - - Table table= listViewer.getTable(); - - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableLayout tableLayout= new TableLayout(); -/* - TableColumn column= table.getColumn(0); - column.setText(columns[0]); - tableLayout.addColumnData(new ColumnWeightData(colWidths[0], false)); -*/ - TableColumn column; - for(int i = 0; i < columns.length; ++i) { - column= new TableColumn(table, SWT.NULL); - column.setText(columns[i]); - tableLayout.addColumnData(new ColumnWeightData(colWidths[i], true)); - - } - - table.setLayout(tableLayout); - - return listViewer; - } - - public static void deactivateCellEditor(TableViewer viewer) { - if(null == viewer) - return; - CellEditor[] es = viewer.getCellEditors(); - TableItem[] items = viewer.getTable().getSelection(); - if(items.length >= 0) { - for(int i = 0; i < es.length; ++i) { - CellEditor e = es[i]; - if(e.isActivated()) { - if(e.isValueValid()) { - Object[] properties = viewer.getColumnProperties(); - Object value = e.getValue(); - viewer.cancelEditing(); - viewer.getCellModifier().modify(items[0],(String)properties[i], value); - } else - viewer.cancelEditing(); - break; - } - } - } - } - - /** - * Create this group's list viewer. - */ - public static CheckboxTableViewer createListViewer(Composite parent, String[] opt_list, - int width, int height, int style) { - - Table table = new Table(parent, SWT.BORDER | SWT.CHECK); - CheckboxTableViewer listViewer = new CheckboxTableViewer(table); - GridData data = new GridData(style); - data.widthHint = width; - data.heightHint = height; - listViewer.getTable().setLayoutData(data); - if(null != opt_list) - listViewer.add(opt_list); -// listViewer.setLabelProvider(listLabelProvider); -// listViewer.addCheckStateListener(this); - return listViewer; - } - - - - public static CheckboxTableViewer createListViewer(Composite parent, - int width, int height, int style, String[] columns, int[] colWidths) { - CheckboxTableViewer listViewer = createListViewer(parent, null, - width, height, style); - - Table table= listViewer.getTable(); - - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableLayout tableLayout= new TableLayout(); - table.setLayout(tableLayout); - - TableColumn column= table.getColumn(0); - column.setText(columns[0]); - tableLayout.addColumnData(new ColumnWeightData(colWidths[0], false)); - - for(int i = 1; i < columns.length; ++i) { - column= new TableColumn(table, SWT.NULL); - column.setText(columns[i]); - tableLayout.addColumnData(new ColumnWeightData(colWidths[i], false)); - - } - - return listViewer; - } - - - /** - * Create a selection combo - * - * @param parent the parent of the new text field - * @param string of comma separated tokens to fill selection list - * @return the new combo - */ - public static CCombo createSelectCCombo(Composite parent, String strdata, String selData) { - return createSelectCCombo(parent, strdata, selData, - SWT.READ_ONLY | SWT.BORDER); - } - - public static CCombo createSelectCCombo(Composite parent, String strdata, String selData, int style) { - CCombo combo = new CCombo(parent, style); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - combo.setLayoutData(data); - StringTokenizer st = new StringTokenizer(strdata, ","); //$NON-NLS-1$ - while(st.hasMoreTokens()) - combo.add(st.nextToken()); - if(selData == null || selData.length() == 0) { - if(combo.getItemCount() > 0) - combo.select(0); - } - else - selectCCombo(combo, selData); - return combo; - } - - - /** - * Create a selection combo - * - * @param parent the parent of the new text field - * @param array of elements + selected element - * @return the new combo - */ - public static CCombo createSelectCCombo(Composite parent, String[] strdata, String selData) { - return createSelectCCombo(parent, strdata, selData, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); - } - - public static CCombo createSelectCCombo(Composite parent, String[] strdata, String selData, int style) { - CCombo combo = new CCombo(parent, style); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - combo.setLayoutData(data); - for(int i = 0; i < strdata.length; ++i) { - combo.add(strdata[i]); - } - if(selData == null) - combo.select(0); - else - selectCCombo(combo, selData); - return combo; - } - - public static void selectCCombo(CCombo combo, String selData) { - int n_sel = combo.indexOf(selData); - if(0 > n_sel) - n_sel = 0; - combo.select(n_sel); - } - - - - - - - - - - - /** - * Create a selection combo - * - * @param parent the parent of the new text field - * @param string of comma separated tokens to fill selection list - * @return the new combo - */ - public static Combo createSelectCombo(Composite parent, String strdata, String selData) { - return createSelectCombo(parent, strdata, selData, - SWT.READ_ONLY | SWT.BORDER); - } - - public static Combo createSelectCombo(Composite parent, String strdata, String selData, int style) { - Combo combo = new Combo(parent, style); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - combo.setLayoutData(data); - StringTokenizer st = new StringTokenizer(strdata, ","); //$NON-NLS-1$ - while(st.hasMoreTokens()) - combo.add(st.nextToken()); - if(selData == null || selData.length() == 0) { - if(combo.getItemCount() > 0) - combo.select(0); - } - else - selectCombo(combo, selData); - return combo; - } - - - /** - * Create a selection combo - * - * @param parent the parent of the new text field - * @param array of elements + selected element - * @return the new combo - */ - public static Combo createSelectCombo(Composite parent, String[] strdata, String selData) { - return createSelectCombo(parent, strdata, selData, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); - } - - public static Combo createSelectCombo(Composite parent, String[] strdata, String selData, int style) { - Combo combo = new Combo(parent, style); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - combo.setLayoutData(data); - for(int i = 0; i < strdata.length; ++i) { - combo.add(strdata[i]); - } - if(selData == null) - combo.select(0); - else - selectCombo(combo, selData); - return combo; - } - - public static void selectCombo(Combo combo, String selData) { - int n_sel = combo.indexOf(selData); - if(0 > n_sel) { - if( ( combo.getStyle() & SWT.READ_ONLY ) == 0 ) { - combo.setText( selData ); - return; - } - n_sel = 0; - } - combo.select(n_sel); - } - - - - - - - - - - - - /** - * Create a dialog shell, child to the top level workbench shell. - * - * @return The new Shell useable for a dialog. - * - */ - public static Shell createDialogShell() { - Shell parent = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow() - .getShell(); - return new Shell( parent, SWT.DIALOG_TRIM ); - } - - - - public static Composite insertSpace(Composite parent, int nSpan, int height) { - Composite space = ControlFactory.createCompositeSeparator(parent, parent.getBackground(), - (SWT.DEFAULT != height ? height : 5)); - ((GridData)space.getLayoutData()).horizontalSpan = nSpan; - return space; - } - - public static MessageBox createDialog( String title, String message, int style ) { - MessageBox box = new MessageBox( createDialogShell(), style | SWT.APPLICATION_MODAL ); - box.setText( title ); - box.setMessage( message ); - return box; - } - - public static MessageBox createYesNoDialog( String title, String message ) { - return createDialog( title, message, SWT.YES | SWT.NO | SWT.ICON_QUESTION ); - } - - public static MessageBox createOkDialog( String title, String message ) { - return createDialog( title, message, SWT.OK | SWT.ICON_INFORMATION ); - } - - public static MessageBox createOkCancelDialog( String title, String message ) { - return createDialog( title, message, SWT.OK | SWT.CANCEL | SWT.ICON_INFORMATION ); - } - -} diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java deleted file mode 100644 index e54ea0d9d6b..00000000000 --- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/RadioButtonsArea.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.eclipse.cdt.utils.ui.controls; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -/** - * A field editor for an enumeration type preference. - * The choices are presented as a list of radio buttons. - */ -public class RadioButtonsArea extends Composite { - - /** - * List of radio button entries of the form [label,value]. - */ - private String[][] labelsAndValues; - - /** - * Number of columns into which to arrange the radio buttons. - */ - private int numColumns; - - /** - * Indent used for the first column of the radion button matrix. - */ - //private int indent = 0; - - /** - * The current value, or null if none. - */ - protected String value = null; - - private SelectionListener listener; - - private ArrayList externalListeners = new ArrayList(); - - private Composite area = null; - /** - * The radio buttons, or null if none - * (before creation and after disposal). - */ - protected Button[] radioButtons; - - - public RadioButtonsArea(Composite parent, String labelText, int numColumns, String[][] labelAndValues) { - super(parent, SWT.NULL); - Assert.isTrue(checkArray(labelAndValues)); - this.labelsAndValues = labelAndValues; - this.numColumns = numColumns; - createControl(parent, labelText); - } - - public void setEnabled(boolean enabled) { - for( int i = 0; i < radioButtons.length; i++ ) { - radioButtons[i].setEnabled(enabled); - } - } - - /** - * Checks whether given String[][] is of "type" - * String[][2]. - * - * @return true if it is ok, and false otherwise - */ - private boolean checkArray(String[][] table) { - if (table == null) - return false; - for (int i = 0; i < table.length; i++) { - String[] array = table[i]; - if (array == null || array.length != 2) - return false; - } - return true; - } - - protected void fireSelectionEvent(SelectionEvent event) { - for(Iterator i = externalListeners.iterator(); i.hasNext(); ) { - SelectionListener s = (SelectionListener)i.next(); - s.widgetSelected(event); - } - } - - /** - * Create control area - * - * @return nothing - */ - protected void createControl(Composite parent, String labelText) { - GridLayout gl = new GridLayout(); - this.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - gl.marginWidth = 0; - gl.horizontalSpacing = 0; - this.setLayout(gl); - - if(null != labelText) { // Create group box - area = ControlFactory.createGroup(this, labelText, numColumns); - } else { - area = this; - } - - radioButtons = new Button[labelsAndValues.length]; - listener = new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - value = (String) (event.widget.getData()); - fireSelectionEvent(event); // Infor any external listener - } - }; - - for (int i = 0; i < labelsAndValues.length; i++) { - radioButtons[i] = ControlFactory.createRadioButton(area, - labelsAndValues[i][0], - labelsAndValues[i][1], - listener); - } - - area.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent event) { - radioButtons = null; - } - }); - - } - - /** - * Sets the indent used for the first column of the radion button matrix. - * - * @param indent the indent (in pixels) - */ - public void setIndent(int indent) { - if(null == area) - return; - if (indent < 0) - indent = 0; - for(int i = 0; i < radioButtons.length; ++i) { - ((GridData)(radioButtons[i].getLayoutData())).horizontalIndent = indent; - } - } - - /** - * Select the radio button that conforms to the given value. - * - * @param selectedValue the selected value - */ - public void setSelectValue(String selectedValue) { - this.value = selectedValue; - if (radioButtons == null) - return; - - if (this.value != null) { - boolean found = false; - for (int i = 0; i < radioButtons.length; i++) { - Button radio = radioButtons[i]; - boolean selection = false; - if (((String) radio.getData()).equals(this.value)) { - selection = true; - found = true; - } - radio.setSelection(selection); - } - if (found) - return; - } - - // We weren't able to find the value. So we select the first - // radio button as a default. - if (radioButtons.length > 0) { - radioButtons[0].setSelection(true); - this.value = (String) radioButtons[0].getData(); - } - return; - } - - public void setSelectedButton(int index) { - Button b; - - if((index < 0) || (index >= radioButtons.length)) - return; - - for(int i = 0; i < radioButtons.length; ++i) { - b = radioButtons[i]; - boolean selected = b.getSelection(); - if(i == index) { - if(selected) - return; - } else { - if(selected) - b.setSelection(false); - } - } - - b = radioButtons[index]; - b.setSelection(true); - } - - public String getSelectedValue() { - return value; - } - - public int getSeletedIndex() { - if (radioButtons == null) - return -1; - - if (value != null) { - for (int i = 0; i < radioButtons.length; i++) { - if (((String) radioButtons[i].getData()).equals(this.value)) - return i; - } - } - - return -1; - } - - public void addSelectionListener(SelectionListener s) { - if(externalListeners.contains(s)) - return; - externalListeners.add(s); - } -} diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/TabFolderLayout.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/TabFolderLayout.java deleted file mode 100644 index e4790ced191..00000000000 --- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/TabFolderLayout.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.eclipse.cdt.utils.ui.controls; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Layout; - -public class TabFolderLayout extends Layout { - - protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) { - if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) - return new Point(wHint, hHint); - - Control [] children = composite.getChildren (); - int count = children.length; - int maxWidth = 0, maxHeight = 0; - for (int i=0; i - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.core/.cvsignore b/debug/org.eclipse.cdt.debug.core/.cvsignore deleted file mode 100644 index 693869726de..00000000000 --- a/debug/org.eclipse.cdt.debug.core/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -doc diff --git a/debug/org.eclipse.cdt.debug.core/.project b/debug/org.eclipse.cdt.debug.core/.project deleted file mode 100644 index a0751078e2e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.eclipse.cdt.debug.core - - - org.eclipse.cdt.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog deleted file mode 100644 index 47b9f129166..00000000000 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ /dev/null @@ -1,1689 +0,0 @@ -2003-12-23 Mikhail Khodjaiants - Fix for bug 49294: Source file doesn't change when switching between stack frames. - Do not use the breakpoint's markers for source lookup. - * CSourceManager.java - -2003-12-08 Mikhail Khodjaiants - Reset the 'terminating' flag if 'terminate' fails. - * CDebugTarget.java - -2003-11-26 Mikhail Khodjaiants - Extracted the main part of the 'breakpointAdded' method into a separate method to avoid - double checking. - * CDebugTarget.java - -2003-11-26 Mikhail Khodjaiants - Cleanup. - * CDebugModel.java - * CDebugUtils.java - * CRegisterManager.java - * CSharedLibraryManager.java - * CSignalManager.java - * CUpdateManager.java - * CDebugTarget.java - * CThread.java - * CVariable.java - -2003-11-10 Mikhail Khodjaiants - Ensure that all breakpoint creation and modification operations are running in the UI thread. - * CBreakpointManager.java - -2003-11-10 Mikhail Khodjaiants - Added synchronization to some of the 'CBreakpoint' methods. - * CBreakpoint.java - -2003-11-07 Mikhail Khodjaiants - Fix for PR 46358: NPE in the "setCurrentThread" method of "CDebugTarget". - 'setCurrentThread': check if the old current thread is not null. - * CDebugTarget.java - -2003-11-07 Mikhail Khodjaiants - Use the corresponding methods of 'ICBreakpoint' to set breakpoint properties. - * CBreakpointManager.java - -2003-11-07 Mikhail Khodjaiants - Fix for PR 46303: Exception when selecting Debug... menu. - Check if the string passed to the 'getCommonSourceLocationsFromMemento' method is not empty. - * SourceUtils.java - -2003-11-05 Mikhail Khodjaiants - 'getCDIBreakpointFile' returns wrong file for address breakpoints. - * CBreakpointManager.java - -2003-11-05 Mikhail Khodjaiants - Changed the handling of the breakpoint created event to reflect the CDI changes for deferred - breakpoints support. - * CBreakpointManager.java - * CSharedLibraryManager.java - * CDebugTarget.java - -2003-11-05 Mikhail Khodjaiants - Moved all breakpoint-related functionality to the new class - 'CBreakpointManager'. - * CBreakpointManager.java - -2003-11-05 Mikhail Khodjaiants - The argument type of the 'getBreakpointAddress' method of 'ICBreakpointManager' is changed from - 'ICBreakpoint' to 'ICBreakpointManager'. - * ICBreakpointMaanger.java - -2003-10-30 Mikhail Khodjaiants - * CSourceManager.java: implements adapters for 'ISourceMode' and 'IPersistableSourceLocator'. - -2003-10-30 Mikhail Khodjaiants - Fix for PR 45818 doesn't solve the problem. Fall back to the previous version. - * CDebugElement.java - -2003-10-30 Mikhail Khodjaiants - Fix for PR 45818: NPE when closing the workbench. - * CDebugElement.java - -2003-10-29 Mikhail Khodjaiants - * CProjectSourceLocation.java: check if the searched element name is not null or empty. - -2003-10-29 Mikhail Khodjaiants - Added the 'dispose' method to 'ICSourceLocation'. - * ICSourceLocation.java - * CDirectorySourceLocation.java - * CProjectSourceLocation.java: made 'dispose' public. - -2003-10-29 Mikhail Khodjaiants - * CProjectSourceLocation.java: added 'toString' method. - -2003-10-28 Mikhail Khodjaiants - Search only in the parent folders if the given file path is absolute. - Return a list only if the number of resulting files is > 1. - * CDirectorySourceLocation.java - -2003-10-27 Mikhail Khodjaiants - Renamed 'SourceLocationFactory' to 'SourceLookupFactory'. - Added the 'createSourceLocator' method to 'SourceLookupFactory'. - * SourceLookupFactory.java - * CSourceLocator.java - -2003-10-27 Mikhail Khodjaiants - Changed the 'getAdapter' method of 'CSourceManager' to return the adapter of - the 'ICSourceLocator' class. - * CSourceManager.java - -2003-10-26 Mikhail Khodjaiants - Fix for PR 45534: gdb/MI error in retrieving a register can lead to an empty register pane. - * CRegister.java - * CRegisterGroup.java - -2003-10-23 Mikhail Khodjaiants - Core support of the new workbench preferences: 'Source Locations' and 'Search - For Duplicate Source Files'. - * CDebugCorePlugin.java - * ICDebugConstants.java - * SourceUtils.java: new - -2003-10-20 Mikhail Khodjaiants - Core support of the "Search subfolders" option for directory source locations. - * IDirectorySourceLocation.java - * SourceLocationFactory.java - * CDirectorySourceLocation.java - -2003-10-20 Mikhail Khodjaiants - Do not interrupt the initialization of all additional source locations - if the initialization of one fails. - * CSourceLocator.java - -2003-10-17 Alain Magloire - - ICDIBreakpointManager new method - setLocationBreakpoint(...., deferred); - The new boolean "deferred" indicate if yes or not the breakpoint - should be on the deferred list if the setting fails. - - * ICDIBreakpointManager.java - -2003-10-17 Mikhail Khodjaiants - Core support of the 'Search for duplicate source files' option. - * ICSourceLocation.java - * ICSourceLocator.java - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceLocator.java - * CSourceManager.java - -2003-10-17 Mikhail Khodjaiants - If the target is suspended by a line breakpoint the source manager tries to retrieve - the file resource from the breakpoint marker. - * CSourceManager.java - * CDebugTarget.java - -2003-10-15 Mikhail Khodjaiants - Improving the source search algorithms. - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceLocator.java - -2003-10-14 Mikhail Khodjaiants - Improved the source search algorithm. - * CProjectSourceLocation.java - -2003-10-13 Mikhail Khodjaiants - Fix for bug 43372: changed the source lookup procedures to avoid the usage of 'getCanonicalPath'. - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - -2003-10-07 Mikhail Khodjaiants - All methods of 'IRuntimeOptions' should throw CDI exceptions in case of failure. - * ICDIRuntimeOptions.java - -2003-10-06 Mikhail Khodjaiants - Added the "isArgument" method to ICVariable. This method is used to distinguish - the arguments in the Variables View. - * ICVariable.java - * CVariable.java - -2003-09-30 Mikhail Khodjaiants - Use the new 'equals' method of ICDIVaraiableObject to compare variables. - * CVariable.java - -2003-09-30 Alain Magloire - - ICDIVariableObject been updated with a new method. - * CVariable.java - * ICDIVariable.java - -2003-09-29 Mikhail Khodjaiants - Fix for PR 43856: Format doesn't work for wchar_t. - * CValue.java - -2003-09-23 Mikhail Khodjaiants - Changed the 'hasStackFrames' method of the 'CThread' class to return true regardless if - the thread contains stack frames or not. This method is only used by UI to update the thread label. - * CThread.java - -2003-09-17 Mikhail Khodjaiants - Temporary fix for PR 39061: Attach source does not work for applications compiled in CygWin. - * CDirectorySourceLocation.java - -2003-09-16 Mikhail Khodjaiants - Fix for PR 38468: Error in files location. - Use the 'getCanonicalPath' method of the 'File' class to obtain the file name. - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceLocator.java - -2003-09-15 Mikhail Khodjaiants - Fix for PR 43101: Breakpoint exception when source doesn't exist. - The 'fireBreakpointChanged' method of 'BreakpointManager' is used to notify - the UI components that a breakpoint is added. This is a part of new implementation - to support deffered breakpoints. For new breakpoints the 'delta' argument is null. - Check if delta is not null to avoid this problem. - * CDebugTarget.java - -2003-09-11 Mikhail Khodjaiants - Detail Pane values for casted variables. - * CVariable.java: the qualified name should be chached in the InternalVariable instance - * CArrayPartition.java: added new field to store the chached value of the qualified name - -2003-10-11 Mikhail Khodjaiants - Moving the shared library search paths block to mi UI. - * ICDTLaunchConfigurationConstants.java: moved the 'ATTR_DEBUGGER_SOLIB_PATH' attribute to mi. - -2003-09-10 Mikhail Khodjaiants - If breakpoint is a line breakpoint check if source locator contains this file - instead of container project. - * CDebugTarget.java - -2003-09-10 Mikhail Khodjaiants - Fix for PR 42790: Memory view is not cleared when target is terminated. - * CFormattedMemoryBlock.java: fire 'terminate' event when block is disposing. - * CMemoryManager.java: implementation of 'dispose'. - -2003-09-09 Mikhail Khodjaiants - Fix for PR 39680: Gash in error message for memory view. - * CDebugModel.java - -2003-09-09 Mikhail Khodjaiants - Final fix for PR 39484: Move 'getType' method from ICDIVariable to ICDIVaraibleObject. - * CArrayPartition.java - * CVariable.java - -2003-09-09 Mikhail Khodjaiants - Regrouping the launch configuration constants. - * ICDTLaunchConfigurationConstants.java - -2003-09-09 Mikhail Khodjaiants - Removed the internal handling of the 'stop-on-shared-library-events' option - - will be moved to the mi. - Try to set the deferred breakpoints only when: - - a shared library is loaded - - the symbols of shared library are loaded - * CSharedLibararyManager.java - * CDebugTarget.java - * CThread.java - -2003-09-09 Mikhail Khodjaiants - Added the 'getSharedLibraryPaths' and 'setSharedLibraryPaths' methods - to the 'ICDISharedLibraryManager' interface. - * ICDISharedLibraryManager.java - -2003-08-29 Mikhail Khodjaiants - Implementation of deferred breakpoints. - * CDebugTarget.java - * CThread.java - -2003-08-29 Mikhail Khodjaiants - Moving shared library features from mi to CDI. - Added new launch configuration constants to ICDTLaunchConfigurationConstants. - -2003-08-29 Mikhail Khodjaiants - Moving shared library features from mi to CDI. - Added new methods to ICDISharedLibraryManager: - - isAutoLoadSymbols - - isStopOnSolibEvents - - setAutoLoadSymbols - - setStopOnSolibEvents - - supportsAutoLoadSymbols - - supportsStopOnSolibEvents - * ICDISharedLibraryManager.java - -2003-08-21 Mikhail Khodjaiants - Removed the 'isAccessSpecifier' method from CVaraiable. - * CArrayPartitionValue.java - * CValue.java - * CVariable.java - -2003-08-21 Mikhail Khodjaiants - Use the names of array's elements returned by CDI. - * CVariable.java - -2003-08-20 Mikhail Khodjaiants - Unable to terminate post mortem debugging session. - Extended the 'CDebugTarget' class to overload the 'terminate' and 'canTerminate' methods. - * CDebugModel.java - * CCoreFileDebugTarget.java: new - -2003-08-19 Mikhail Khodjaiants - Create ICDIVariableObject for each array partition to compute a detail panel's value. - * CArrayPartition.java - * CVariable.java - -2003-08-18 Alain Magloire - - ICDISharedLibraryEvent.java: - New file, to notify a breakpoint from a shared lib event. - -2003-08-13 Mikhail Khodjaiants - * ICDIVariableManager.java: removed the 'type' parameter from the 'getVariableObjectAsArray' method - * ICastToArray.java: removed the 'type' parameter from the 'castToArray' method - * CVariable.java: changed the implementation of the 'ICastToArray' interface - -2003-08-13 Mikhail Khodjaiants - * ICDIVariable.java: removed the 'isEditable' method - * ICDIVariableObject.java: added the 'isEditable', 'getQualifiedName' and 'sizeof' methods - * ICDIArrayValue.java: added the 'getVariables(int start, int length)' method - * ICType.java: added the 'isReference' method - * ICValue.java: added the 'dispose' method - * CArrayPartition.java - * CArrayPartitionValue.java - * CGlobalVariable.java - * CType.java - * CValue.java - * CValueFactory.java - * CVariable.java - Create 'var-objects' only for the requested array partitions. - -2003-08-07 Alain Magloire - - * ICDIVariableManager.java: - Remove the unused method getVariableObject(ICDIStackframe, String) - and getArgumentObject(ICDIStackframe, String). - Rename getVariableObject(String, String, String) to - getGlobalVariableObject. - - * CDebugModel.java: Refactoring of ICDIVariableManager. - -2003-08-06 Mikhail Khodjaiants - Added the implementation of the 'getType' and 'getTypeName' methods of the 'CVaraible:ErrorVariable' class. - * CVariable.java - -2003-08-06 Mikhail Khodjaiants - Uncommented the 'sizeof' method of 'ICDIVariableObject'. - * ICDIVariableObject.java - * CVariable.java - -2003-08-06 Alain Magloire - - Move some of the methods in ICDIVariableObject. - - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariable.java - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableObject.java - -2003-08-05 Mikhail Khodjaiants - Use the 'getReferencedProject' method to obtain all referenced projects. - * CDebugUtils.java - -2003-08-05 Mikhail Khodjaiants - Invalidate error variables when the session is resumed. - * CVariable.java - -2003-07-30 Mikhail Khodjaiants - Moved the 'getReferencedProject' method to 'CDebugUtils'. Added the cycle checking. - * CDebugUtils.java - * CSourceLocator.java - -2003-07-28 Mikhail Khodjaiants - Minimize the number of the "evaluate expression" requests when changing the value of the floating point types. - * CDebugUtils.java - -2003-07-28 Mikhail Khodjaiants - Refactoring: moved the 'isNaN', 'isPositiveInfinity' and 'isNegativeInfinity' to the 'CDebugUtils' class. - * ICValue.java - * CValue.java - * CDebugUtils.java - -2003-07-28 Mikhail Khodjaiants - Refactoring: moved the 'CDebugUtils' class to the 'org.eclipse.cdt.debug.core' package - - the methods of this class are mostly used in UI plugins. - * CDebugUtils.java - * CDebugModel.java - * DisassemblyStorage.java - * CAddressBreakpoint.java - * CDebugTarget.java - * CFormattedMemoryBlock.java - * CDebugElement.java - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceLocator.java - -2003-07-28 Mikhail Khodjaiants - Cleanup. Removed the unused 'getNumberOfChildren' method from the 'CValue' class. - * CValue.java - -2003-07-28 Mikhail Khodjaiants - Cleanup. Removed the 'reset' and 'getQualifiedName' methods from the 'ICVaraible' interface. - * ICVariable.java - * CVariable.java - -2003-07-24 Mikhail Khodjaiants - Fix for PR 40696. If the project contains the reference to a project that is - deleted from the workspace the source locator tries to get the location of deleted project. - * CProjectSourceLocation.java - -2003-07-22 Mikhail Khodjaiants - Create a special type of ICDIVariable (ErrorVariable) if request to gdb fails. - * CVariable.java - * CValue.java - -2003-07-22 Mikhail Khodjaiants - Use the 'getReferencedProjects' method of 'CSourceLocator' to obtain the list of referenced projects. - Use the correct tag for additional source locations. - * CSourceLocator.java - -2003-07-17 Mikhail Khodjaiants - Fix for PR 39936: GDB hits modified conditional breakpoints when condition not satisfied. - This is a work around for GDB PR MI/1289. - * CDebugTarget.java - -2003-07-17 Mikhail Khodjaiants - Automatically update the list of source locations when the list of the referenced - projects is modified. - * ICSourceLocator.java: added new method - 'getProject' - * IProjectSourceLocation.java: added new method - 'isGeneric' - * SourceLocationFactory.java: new class factory for source locations. - * CSourceLocator.java - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceManager.java - * CDebugTarget.java - -2003-06-30 Mikhail Khodjaiants - Fix for PR 39372: Breakpoints don't get activated when symbols are loaded. - -2003-06-30 Mikhail Khodjaiants - Fix for PR 39100: CDT/Debug core is asking value 16 times. - * CValue.java - -2003-06-30 Mikhail Khodjaiants - Fix for PR 39087: Cache the MI answer once we know if the variable is writable. - * CVariable.java - -2003-06-24 Mikhail Khodjaiants - All local var_objects are destroyed when a thread other than current is selected. - CVariable has to be invalidated if a "destroyed" event has been received. - * CVariable.java - -2003-06-23 Mikhail Khodjaiants - Fix for ClassCastException in CStackFrame. - * CStackFrame.java - -2003-06-20 Mikhail Khodjaiants - Variable bookkeeping (phase 0.1). - * ICDTLaunchConfigurationConstants.java: add a new attribute - ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING. - * ICVariable.java: added the 'canEnableDisable', 'isEnabled' and 'setEnabled' methods - * CArrayPartition.java - * CExpression.java - * CModificationVariable.java - * CRegister.java - * CStackFrame.java - * CVariable.java - -2003-06-18 Mikhail Khodjaiants - Incorrect casting in the 'setChanged' method of CVariable. - * CVariable.java - -2003-06-11 Mikhail Khodjaiants - The unused 'getUnderlyingValueString' method has been removed from ICValue and CValue. - The methods 'setChanged' and 'getUnderlyingValue' are only for internal usage and - have been removed from ICValue. - * ICValue.java - * CArrayPartitionValue.java - * CValueFactory.java - * CValue.java - * CVariable.java - -2003-06-10 Mikhail Khodjaiants - Refactoring: moved the type and value related methods from ICVariable to ICType and ICValue. - * ICType.java: new - * ICVariable.java - * ICValue.java - * CArrayPartitionValue.java - * CType.java - * CValue.java - * CVariable.java - -2003-06-09 Mikhail Khodjaiants - Added default format preferences for variables, registers and expressions. - * CExpression.java - * CRegister.java - * CVariable.java - -2003-06-09 Mikhail Khodjaiants - Renamed the 'refresh' method of ICVariable to 'reset'. Added new method - - 'reset' to CValue instead of using the 'setChanged' method. - * ICVariable.java - * CValue.java - * CVariable.java - -2003-06-06 Mikhail Khodjaiants - Mark as changed parent variables. - * CVariable.java - -2003-06-06 Mikhail Khodjaiants - Refresh only the state of variable when handling a change event. - * CVariable.java - -2003-06-06 Mikhail Khodjaiants - Correct presentation of the full names of variables that contain pointers. - * CVariable.java - -2003-06-06 Mikhail Khodjaiants - Changed the implementation of the'getName' method of CVariable to return - the actual names of array members. - * CArrayPartition.java - * CArrayPartitionValue.java - * CVariable.java - -2003-06-05 Mikhail Khodjaiants - Core support of infinite values of the floating point types. - * ICVariable.java - * CVariable.java - -2003-06-05 Mikhail Khodjaiants - Renamed the 'computeDetail' method of the 'ICValue' interface to 'evaluateAsExpression'. - * ICValue.java - * CArrayPartitionValue.java - * CValue.java - -2003-06-05 Mikhail Khodjaiants - Removed the redundant methods from the 'ICDIFloatingPointValue' interface. - * ICDIFloatingPointValue.java - * CValue.java - * CVariable.java - -2003-06-04 Mikhail Khodjaiants - Implementing the core support of the detail panel. - * ICValue.java - * ICVariable.java - * CArrayPartitionValue.java - * CValue.java - * CVariable.java - -2003-06-04 Mikhail Khodjaiants - Added the processing of reference values. - * CValue.java - -2003-06-04 Mikhail Khodjaiants - Implementing the core support of UI features for types and internal formating - (instead of using the format features provided by gdb). - * src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointValue.java - * src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java - * src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIPointerValue.java: removed - * src/org/eclipse/cdt/debug/core/model/ICVariable.java - * src/org/eclipse/cdt/debug/internal/core/model/CVariable.java - * src/org/eclipse/cdt/debug/core/model/CValue.java - -2003-05-29 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralValue.java: - public long longValue() throws CDIException; - public int intValue() throws CDIException; - public short shortValue() throws CDIException; - public int byteValue() throws CDIException; - -2003-05-29 Mikhail Khodjaiants - Added new methods to ICVariable to vizualize arrays and structures based - on the new CDI types. - * ICVariable.java - * CVariable.java - -2003-05-27 Mikhail Khodjaiants - Check if the location of breakpoint is eligible for the target - when setting, removing or changing the propeties. - * CDebugTarget.java - -2003-03-23 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIVariable.java: - (getType): New method. - -2003-05-26 Mikhail Khodjaiants - First draft of the tracepoints in the CDI. - * ICDITraceManager.java - * ICDITraceSnapshot.java - * ICDITracepoint.java - -2003-05-23 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIType.java: extends - ICDIObject. - -2003-05-23 Alain Magloire - - First draft of the implementing the types, org.eclipse.cdt.debug.core.cdi.model.type.* - in the CDI interface. - -2003-05-14 Mikhail Khodjaiants - Created preference for the maximum number of disassembly instructions. - * CDebugTarget.java - * ICDebugConstants.java - * DisassemblyManager.java - -2003-05-12 Mikhail Khodjaiants - Moved the generation of expressions for global variables to the mi plugin. - * CDebugTarget.java - * CExpression.java - * CDebugModel.java - -2003-05-12 Mikhail Khodjaiants - When generating disassembly instructions by file name and line number check - if the frame address is in the address range of the instruction set. - If the instruction set doesn't contain the frame address generate a new instruction set - based on the frame address. - * DisassemblyManager.java - -2003-05-08 Mikhail Khodjaiants - In the "terminate" event handler of the session manager check the targets that - belong to the current session. - * SessionManager.java - -2003-05-07 Mikhail Khodjaiants - Set the error status if the debug target is suspended because of an error. - * CDebugTarget.java - -2003-05-06 Mikhail Khodjaiants - Check if the underlying debugger supports expression evaluation in the "canEvaluate" method. - * CDebugTarget.java - -2003-05-06 Mikhail Khodjaiants - Added tooltips to breakpoints and watchpoints. - * CAddressBreakpoint.java - * CBreakpoint.java - * CFunctionBreakpoint.java - * CLineBreakpoint.java - * CWatchpoint.java - -2003-05-05 Mikhail Khodjaiants - Added a status functionality to the CDebugElement class. - This allows to reflect the problems occured in the element in UI. - * ICDebugElementErrorStatus.java: new - * CDebugElement.java: implementation - * CThread.java - * CDebugTarget.java - -2003-05-05 Mikhail Khodjaiants - New method in ICBreakpoint - "isConditional". - * ICBreakpoint.java - * CBreakpoint.java - -2003-05-02 Mikhail Khodjaiants - Notify the Launch view about stack changes when handling the 'Resumed' event. - * CThread.java - -2003-05-01 Mikhail Khodjaiants - Implementation of termination policy. - * ICDIConfiguration.java: new "terminateSessionOnExit" method added. - * SessionManager.java: terminates the launch when all targets are terminated or disconnected. - * CDebugCorePlugin.java: provides an access to the current session managers. - * CDebugTarget.java - -2003-04-25 Mikhail Khodjaiants - Fix for bug 36909 - * DisassemblyManager.java: check if the address of a stack frame is not 0; - -2003-04-23 Mikhail Khodjaiants - Check for null pointer in 'isCharacter' and 'isCharPointer'. - * CValue.java - -2003-04-23 Mikhail Khodjaiants - Throw DebugException when getSignals() fails. - * CSignalManager.java - -2003-04-23 Mikhail Khodjaiants - Additional checks for the situation when the stack depth is not 0 and - the frame array is empty. - * CThread.java - -2003-04-22 Mikhail Khodjaiants - Disconnect: terminate should be called from the disconnect event handler. - * CDebugTarget.java - -2003-04-21 Mikhail Khodjaiants - Disconnnect: target should be disconnected before terminate the session - because of race condition. - * CDebugTarget.java - -2003-04-21 Mikhail Khodjaiants - Unnecessary error logging (bug 36682). - * CValue.java - -2003-04-21 Mikhail Khodjaiants - Temporary fix for character values. - * CValue.java - -2003-04-20 Alain Magloire - - * CValue.java: - Was throwing a IndexOutOfBoundException. - -2003-04-17 Mikhail Khodjaiants - Check if the underlying cdi variable is not null before accessing it. - * CVariable.java - -2003-04-16 Mikhail Khodjaiants - Quick fix for variable values. - * CValue.java - -2003-04-14 Alain Magloire - - StringBuffer.indexOf() is 1.4.x only - - * CDebugUtils.java - -2003-04-11 Mikhail Khodjaiants - Core support of function and method breakpoints. - * CDebugModel.java - * ICFunctionBreakpoint.java - * CDebugUtils.java - * CFunctionBreakpoint.java - * CDebugTarget.java - -2003-04-09 Mikhail Khodjaiants - Core support of function breakpoints. - * CDebugModel.java - * ICFunctionBreakpoint.java - * CDebugTarget.java - -2003-04-07 Mikhail Khodjaiants - Changed the message text in the 'getStackDepth' method. - * CThread.java - -2003-04-07 Mikhail Khodjaiants - Changed the message generated in the 'targetRequestFailed' methods of CDebugElement. - * CDebugElement.java - -2003-04-07 Mikhail Khodjaiants - Replaced 'toString()' by 'getMessage()' for CDI exceptions. - * CSharedLibraryManager.java - * CUpdateManager.java - * CDebugTarget.java - * CStackFrame.java - * CThread.java - * CVariable.java - -2003-04-01 Mikhail Khodjaiants - Moved the 'Auto-Refresh' preferences from CDebugUIPlugin to use it for initialization of update managers. - * ICDebugConstants.java - * CRegisterManager.java - * CSharedLibraryManager.java - -2003-04-01 Mikhail Khodjaiants - Removed the 'fDebugTarget' field from CSharedLibraryManager. - * CSharedLibraryManager.java - -2003-03-31 Mikhail Khodjaiants - The new abstract class ('CUpdateManager') is added to provide a basic implementation of ICUpdateManager. - CSignalManager, CSharedLibraryManager and CRegisterManager extend this class. - * ICRegisterManager.java: new - * CRegisterManager.java: new - * CSharedLibraryManager.java - * CSignalManager.java - * CUpdateManager.java: new - * CDebugTarget.java - * CRegisterGroup.java - -2003-03-28 Mikhail Khodjaiants - Use the 'exists' method of the 'IFile' interface instead of using 'toFile().exists()' for 'IPath'. - * CDirectorySourceLocation.java - * CSourceLocator.java - -2003-03-28 Mikhail Khodjaiants - Do not log the exceptions thrown by the breakpoint setting methods. - * CDebugTarget.java - -2003-03-28 Mikhail Khodjaiants - Added default format preference constants for variables, expressions and registers. - * ICDebugConstants.java - -2003-03-28 Mikhail Khodjaiants - Core support of the 'Run To C/C++ Line' and 'Resume At C/C++ Line' actions for external files. - * IJumpToLine.java - * IRunToLine.java - * CDebugTarget.java - * CThread.java - -2003-03-27 Mikhail Khodjaiants - Applied patch from Chris Songer: Assembly View Fixups - * ICDIInstruction.java - * DisassemblyStorage.java - -2003-03027 Alain Magloire - - Adjust the code refactor in the CoreModel for IBinary - * CDebugTarget.java - -2003-03-18 Mikhail Khodjaiants - Removed the gdb-specific variable parsing. - * ICValue.java - * CArrayPartition.java - * CArrayPartitionValue.java - * CModificationVariable.java - * CStackFrame.java - * CValue.java - * CVariable.java - * CArrayEntryVariable.java: removed - * CLocalVariable.java: removed - -2003-03-17 Mikhail Khodjaiants - Replace range by start index and length in 'Display As Array' action. - * ICDIVariableManager.java - * ICastToArray.java - * CVariable.java - -2003-03-14 Mikhail Khodjaiants - Added the 'isEditable' and 'hasChildren' methods to the 'ICVariable' interface. - * ICVariable.java - * CVariable.java - * CModificationVariable.java - -2003-03-14 Mikhail Khodjaiants - Cross-referencing projects cause the debugger to go into a stack overflow exception. - Make sure that there is only one source location for each referenced project. - * CSourceLocator.java - -2003-03-13 Alain Magloire - - No longer throw exceptions. - * src/org/eclipse/cdt/internal/core/model/CFormattedMemoryBlock.java - * src/org/eclipse/cdt/internal/core/model/CVariable.java - -2003-03-13 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java: - Also extends ICDIVariableObject. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgument.java: - Also extends ICDIArgumentObject. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegister.java: - Also extends ICDIRegisterObject - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java: - getLocalVariableObject() new method. - -2003-03-09 Mikhail Khodjaiants - New ICDIVariableManager methods for the 'DisplayAsArray' and 'CastToType' actions. - * CVariable.java - -2003-03-11 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java: - New methods getVariableObjectAsArray(), getVariableObjectAsType(). - -2003-03-09 Mikhail Khodjaiants - Core support of the "Display As Array" action. - * ICastToArray.java - * CLocalVariable.java - * CVariable.java - -2003-03-09 Mikhail Khodjaiants - Core support of the "Cast To Type" and "Restore Default Type" actions. - * ICastToType.java: new - * CLocalVariable.java - * CStackFrame.java - * CVariable.java - -2003-02-24 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterObject.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDIArgumentObject.java: - Reorganized imports. - -2003-02-20 Mikhail Khodjaiants - No need to set the source search path to the debugger. - * ICSourceLocation.java - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CDebugTarget.java - -2003-02-20 Mikhail Khodjaiants - Changed to 'public' the access modifier of the 'setAssocition' method. - * CDirectorySourceLocation.java - -2003-02-18 Mikhail Khodjaiants - Added persistency to the source locator. - * plugin.xml: added dependency on the 'org.apache.xerces' plugin - * ICSourceLocation.java - * CDebugUtils.java - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceLocator.java - * CSourceManager.java - -2003-02-13 Mikhail Khodjaiants - Undo changes because the 'asyncExec' method of the 'DebugPlugin' class has added since version 2.1. - * IAsyncExecutor.java: removed - * CDebugCorePlugin.java - -2003-02-13 Mikhail Khodjaiants - Use the 'asyncExec' method of the 'DebugPlugin' class. - * IAsyncExecutor.java: removed - * CDebugCorePlugin.java - -2003-02-12 Mikhail Khodjaiants - The gdb-specific 'setAutoSolibMethod' method is removed from ICDISharedLibraryManager. - * ICDISharedLibraryManager.java - * CSharedLibraryManager.java - -2003-02-12 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/mode/ICDITarget.java (getSharedLibraries): - Remove action done via the manager. - -2003-02-12 Mikhail Khodjaiants - Use ICDIRegisterManager instead of ICDITarget. - * ICDITarget.java - * CDebugTarget.java - * CRegisterGroup.java - -2003-02-11 Mikhail Khodjaiants - The 'auto load symbols' action support in ICSharedLibraryManager. - * ICSharedLibraryManager.java - * CSharedLibraryManager.java - -2003-02-11 Mikhail Khodjaiants - The 'load symbols' actions support in ICSharedLibraryManager. - * ICSharedLibraryManager.java - * CSharedLibraryManager.java - -2003-02-10 Mikhail Khodjaiants - Support of update ('Refresh', 'Auto-Refresh) actions. - * ICUpdateManager.java: new - * ICSharedLibraryManager.java - * CSharedLibraryManager.java - -2003-02-10 Mikhail Khodjaiants - Disable the address breakpoints to prevent the debugger to insert them prematurely. - * CDebugTarget.java - -2003-02-05 David Inglis - - Refactor Constants to debug.core - * src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java - - -2003-02-05 Mikhail Khodjaiants - Support of the 'Resume At C/C++ Line' action. - * IJumpToLine.java: new - * IJumpToAddress.java: new - * ICDebugTarget.java - * CDebugTarget.java - -2003-02-04 Mikhail Khodjaiants - Support of the 'Resume Without Signal' action. - * IResumeWithoutSignal.java: new - * ICDebugTarget.java - * CDebugTarget.java - * CThread.java - * CStackFrame.java - * CSignal.java - -2003-02-03 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java: - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java: - Added methods, signal(), jump() stepReturn(boolean) to - mimic gdb "return/finish". - -2003-02-03 Mikhail Khodjaiants - Filter out breakpoints set in unrelated projects. - * CDebugTarget.java - * CDebugUtils.java - -2003-02-03 Mikhail Khodjaiants - Implemention of the 'handle' command of the 'Signals' view. - * ICDISignal.java: added the 'handle' method - * CSignal.java: implementation of the 'handle' command. - -2003-02-03 Mikhail Khodjaiants - Implementing the 'Signals' view. - * CSignalManager.java: new - * CSignal.java: new - -2003-02-03 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/event/ICDIExitEvent.java: - Extends ICDIDestroyedEvent. - (getReason): New method. - * src/org/eclipse/cdt/debug/core/cdi/ICDISignalExitInfo.java: - New file. - * src/org/eclipse/cdt/debug/internal/core/CDebugTarget.java (handleExitEvent): - Change to conform to new ICDIExitEvent changes. - -2003-02-03 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java: - (getDescription): new Method replace getMeaning(). - (isStopSet): new method. - (isIgnore): new method. - -2003-01-31 Mikhail Khodjaiants - Implementing the 'Signals' view. - * ICSharedLibraryManager.java - * ICSignalManager.java: new - * ICSignal.java: new - * CSignalManager.java: new - * CSignal.java: new - * CDebugTarget.java - -2003-01-30 Mikhail Khodjaiants - Create an address breakpoint if the source locator can not find the file specified by gdb. - * CDebugTarget.java - -2003-01-29 Mikhail Khodjaiants - Managing breakpoints from the gdb console (fixes). - * CDebugModel.java - * CAddressBreakpoint.java - * CBreakpoint.java - * CFunctionBreakpoint.java - * CLineBreakpoint.java - * CWatchpoint.java - * CDebugTarget.java - -2003-01-29 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibraryManger.java (getSharedLibraryPaths): - New method. - (setSharedLibraryPaths): New method. - (setAutoLoadSymbols): New method. - -2003-01-28 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java (setCurrentFrame): - New method. - -2003-01-27 Mikhail Khodjaiants - Managing breakpoints from the gdb console. - * CDebugCorePlugin.java - * CDebugModel.java - * IAsyncExecutor.java - * ICSourceLocator.java - * CAddressBreakpoint.java - * CBreakpoint.java - * CFunctionBreakpoint.java - * CLineBreakpoint.java - * CWatchpoint.java - * CDebugTarget.java - * CSourceLocator.java - * CSourceManager.java - -2003-01-27 Mikhail Khodjaiants - Use 'equals' to compare CDI variables instead of names. - * CStackFrame.java - -2003-01-27 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java: - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgumentObject.java: - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterObject.java: - Move to model package. - * src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManager.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java: - * src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java: - * src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java: - Refactor/move of the ICDIRegisterObject and ICDIVariableObject - -2003-01-25 Alain Magloire - - Added new Managers: - ICDIVariableManager - ICDIExpressionManager - ICDIRegisterManager - ICDIManager. - - Refactor of CSession to Session, CTarget to Target - and CThread to Thread. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java (getGlobalVariables): - Removed. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java (getCurrentStackFrame): - New method. - * src/org/eclipse/cdt/debug/core/cdi/ICDIManger.java: - New interface for the managers. - * src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManger.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDIExpressionManger.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManger.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManger.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDISignalManger.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDISourceManger.java: - * src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManger.java: - Extends ICDIManager. - * src/org/eclipse/cdt/debug/core/cdi/ICDISession.java: - New method to return the managers. - - * src/org/eclipse/cdt/debug/internal/core/model/CDebuTarget.java: - * src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java: - Use the destroyEvent - - -2003-01-21 Alain Magloire - * src/org/eclipse/cdt/debug/core/cdi/event/ICDIConfiguration.java - (supportsSharedLibary): New method. - -2003-01-21 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/event/ICDISuspendedEvent.java: - Use ICDISignalReceived instead. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java: - New file, element of the SignalManager. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDISignalManager.java: - Return model/ICDISignal. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDISignalReceived.java: - New file. - * src/org/eclipse/cdt/debug/core/internal/core/model/CDebugTarget.java: - Use ICDISignalReceived. - * src/org/eclipse/cdt/debug/core/internal/core/model/CThread.java: - Use ICDISignalReceived. - -2003-01-21 Mikhail Khodjaiants - Retry to set breakpoints if shared library's symbols are loaded. - * CDebugTarget.java - * CThread.java - * CSharedLibraryManager.java - -2003-01-20 Mikhail Khodjaiants - Fix for the 'Show breakpoints supported by selected target' action. - * CDebugTarget.java - -2003-01-20 Alain Maglorei - - * src/build.properties: Add schema in soure.cdtdebugcore.jar - variable. - -2003-01-17 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java - (loadSymbols): new method takes an array of IShareLibrary - (loadSymbols): no arguments. - -2003-01-16 Mikhail Khodjaiants - Implementing the Shared Libraries view. - * ICSharedLibrary.java - * ICSharedLibraryManager.java - * CDebugElement.java - * CDebugTarget.java - * CSharedLibrary.java - * CSharedLibraryManager.java - -2003-01-16 Mikhail Khodjaiants - * ICDILoadedEvent.java: Removed. - -2003-01-16 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIStringValue.java: Removed. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIArrayValue.java: Removed. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIStructureValue.java: Removed. - -2003-01-16 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDISession.java (getSharedLibraryManager): - New method. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java (areSymbolsLoaded): - Rename symbolsRead() to areSymbolsLoaded(). - -2003-01-15 Mikhail Khodjaiants - Added the 'ICDISharedLibraryManager' interface. - * ICDISharedLibraryManager.java - -2003-01-15 Mikhail Khodjaiants - Added new methods to the 'ICDISharedLibrary' interface. - * ICDISharedLibarary.java - -2003-01-14 Mikhail Khodjaiants - Check if thread is already disposed in the CDI event handler because the array of listeners used by EventManager - in some situations is not up to date. - * CThread.java - -2003-01-14 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java: New file. - * src/org/eclipse/cdt/debug/core/cdi/ICDIVariableObject.java: New file. - * src/org/eclipse/cdt/debug/core/cdi/ICDIArgumentObject.java: New file. - -2003-01-13 Mikhail Khodjaiants - Added the 'IRunToAddress' interface to support the 'Run To Line' action in disassembly. - * ICDebugTarget.java: extends IRunToAddress - * IRunToAddress.java: new interface - * CDebugTarget.java: implementation - -2003-01-13 Mikhail Khodjaiants - Fix in the thread created event handler: do nothing if thread has already created. - * CDebugTarget.java - -2003-01-10 Mikhail Khodjaiants - Implementation of address breakpoints. - * ICAddressBreakpoint.java - * ICDebugTarget.java - * IDisassemblyStorage.java - * CDebugModel.java - * ICBreakpointManager.java - * CAddressBreakpoint.java - * CFunctionBreakpoint.java - * CDebugTarget.java - * CStackFrame.java - * DisassemblyManager.java - * DisassemblyStorage.java - -2003-01-06 Alain Magloire - - * build.properties: Patch from Judy Green. - -2003-01-06 Mikhail Khodjaiants - Check if project exists when generating the source locations. - * CSourceLocator.java - -2003-01-06 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManager.java (createLocation): - New method to take an address. - -2003-01-02 Mikhail Khodjaiants - The 'DisassemblyStorage' class implements an adapter for the 'IResource' class and returns the executable file. - * IExecFileInfo.java: added a new method: 'getExecFile' - * CDebugTarget.java - * DisassemblyStorage.java - -2003-01-02 Mikhail Khodjaiants - If breakpoint or watchpoint has been disabled before launching the debugger doesn't disable it. - * CDebugTarget.java - -2002-12-29 Mikhail Khodjaiants - Implementation of the 'Source Lookup' property page. - * IDirectorySourceLocation.java: new interface - * IProjectSourceLocation.java: new interface - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - * CSourceLocator.java - -2002-12-29 Mikhail Khodjaiants - Fix in the 'supportsBreakpoints' method of CDebugTarget - * CDebugTarget.java: No need to check if the breakpoint file belongs to the source locator. - -2002-12-18 Mikhail Khodjaiants - Implementing the 'Source Lookup' property page. - * CDirectorySourceLocation.java - * CProjectSourceLocation.java - -2002-12-18 Mikhail Khodjaiants - Check if CValue has variables before calling 'getCDIVariables'. - * CValue.java - -2002-12-17 Mikhail Khodjaiants - Formatting 'char' types. - * CValue.java - * CModificationVariable.java - -2002-12-17 Mikhail Khodjaiants - The core support of the prompting source locator. - * ICSourceLocator.java - * CDebugTarget.java - * CDirectorySourceLocation.java - * CSourceLocator.java - * CSourceManager.java - * DisassemblyManager.java - -2002-12-17 Mikhail Khodjaiants - The 'getLineNumber' method of CStackFrame should return the line number associated with the stack frame if the current source locator - does not implement 'ICSourceLocator'. - * CStackFrame.java - -2002-12-17 Mikhail Khodjaiants - Changed the implementation of the 'refresh' method of CVariable. - * CVariable.java - -2002-12-16 Mikhail Khodjaiants - Added support of variable formatting. - * ICValue.java: new type - TYPE_UNKNOWN - * ICVariable: new interface for object contribution, set/get format and refresh methods - * CValue.java - * CVariable.java - -2002-12-13 Mikhail Khodjaiants - Display message when 'getStackDepth' is timed out. - * CThread.java - -2002-12-10 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java (setFormat): - New method to change the variable formats(hexa, octal, etc..) - -2002-12-10 Mikhail Khodjaiants - If the given source file path is absolute and the source locator can not find it in the all specified locations return a FileStorage object. - * CSourceLocator.java - -2002-12-09 Mikhail Khodjaiants - Split the detail message of ICDIErrorInfo into tokens and trancate aech token if it is too long. - * CDebugTarget.java - -2002-12-08 Mikhail Khodjaiants - Display the error message with details when program is suspended because of ICDIErrorInfo. - * CDebugTarget.java - -2002-12-05 Alain Magloire - - Some debuggers like gdb/mi can provide detail information, for example - gdb/mi dumps errors in mi "log stream" output. - - * src/.../cdi/CDIException.java (getDetailMessage): New method to provide - more information it need be. - * src/.../cdi/ICDIErrorInfo.java (getDetailMessage: New method. - -2002-12-04 Mikhail Khodjaiants - Added the 'setChanged' method to ICValue. This method should common for CValue and - CArrayPartitionValue to implement 'setChanged' of CVariable correctly. - * ICValue.java - * CArrayPartitionValue.java - * CVariable.java - -2002-12-02 Mikhail Khodjaiants - Refactoring - files moved from org.eclipse.cdt.debug.core to the new package: org.eclipse.cdt.debug.core.model: - * ICBreakpoint.java - * ICDebugTarget.java - * ICExpressionEvaluator.java - * ICFunctionBreakpoint.java - * ICLineBreakpoint.java - * ICValue.java - * ICWatchpoint.java - * IDebuggerProcessSupport.java - * IDummyStackFrame.java - * IExecFileInfo.java - * IFormattedMemoryBlock.java - * IFormattedMemoryBlockRow.java - * IGlobalVariable.java - * IInstructionStep.java - * IRestart.java - * IRunToLine.java - * IStackFrameInfo.java - * IState.java - * ISwitchToFrame.java - * ISwitchToThread.java - * ICDebugTargetType.java: new interface - * IFormattedMemoryRetrieval: removed - - -2002-12-02 Mikhail Khodjaiants - Check if the underlying IFile exists when retrieving the path of global variable. - * CDebugTarget.java - -2002-12-02 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java: New file. - -2002-11-28 Mikhail Khodjaiants - 'exec-until' instead of temporary breakpoints for 'run to line'. - * CDebugTarget.java - * CThread.java - -2002-11-28 Mikhail Khodjaiants - Live editing of the memory view: removed support of the 'Save Changes' action. - * IFormattedMemoryBlock.java - * CFormattedMemoryBlock.java - -2002-11-27 Alain Magloire - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java (runUntil): new method. - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java (runUntil): new method. - -2002-11-27 Mikhail Khodjaiants - Typo in plugin.properties. - -2002-11-27 Mikhail Khodjaiants - Fire suspend event for debug target that doesn't have threads. - * CDebugTarget.java - -2002-11-27 Alain Magloire - - * src/.../debug/internal/core/model/CDebugTarget.java (isLittleEndian): - Use CoreModel.getDefault(). - (getGlobals): Use CoreModel.getDefault(). - -2002-11-24 Mikhail Khodjaiants - Fix for watchpoints. - * CSourceLocator.java - -2002-11-22 Mikhail Khodjaiants - Cache source elements to optimize search. - * CProjectSourceLocator.java - -2002-11-22 Mikhail Khodjaiants - Fix in the source locator's search algorithm. - * CProjectSourceLocator.java - -2002-11-21 Mikhail Khodjaiants - The memory view does not display values if the address expression is '0xFFFFFFFF'. - * CFormattedMemoryBlock.java - -2002-11-21 Mikhail Khodjaiants - Added the handler of ICDIDestroyedEvent to 'CFormattedMemoryBlock. - * CFormattedMemoryBlock.java - -2002-11-20 Mikhail Khodjaiants - Fix for bug 26595. - The type of the address expression has been changed from String to ICDIExpression to handle - changes of the start address. - * CDebugModel.java - * CFormattedMemoryBlock.java - * IFormattedMemoryBlock.java: added the 'isStartAddressChanged' method. - -2002-11-15 Mikhail Khodjaiants - Partial fix for bug 25956. - * DisassemblyManager.java: Filter out the instructions that do not belong to the function. - -2002-11-15 Mikhail Khodjaiants - If the backtrace is very deep the debugger is unable to parse MI output. - The limited number of stack frames will be displayed. - * IDummyStackFrame.java - * CDummyStackFrame.java - * CStackFrame.java - * CThread.java - -2002-11-14 Alain Magloire - - This is needed in post-mortem, application doing a - very deep recursion and crashing the stack size, for example - on GNU/Linux it may reach 200000 levels deep. Trying to - bring in the UI a bactrace tree of 200000 nodes is useless. - The UI could check the count and do the appropriate action - by showing ranges etc .. - - * src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java (getStackFrames): - New method to provide a range lowFrame and highFrame. - (getStackFrameCount): New method returns the depth level - of the stackframes. - -2002-11-13 Mikhail Khodjaiants - Fix for the stepping problem if the selected stack frame is not the topmost one. - * CStackFrame.java: The 'stepToFrame' method is temporary replaced by corresponding step method. - -2002-11-13 - * schema/CDebugger.exsd - * src/org/eclipse/cdt/debug/core/ICDebugConfiguration.java - * src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java - Added supported CPU to Debugger extension. - -2002-11-07 Mikhail Khodjaiants - When a referenced project is deleted it's location is null. The source locator should - check this when it returns the path array. - * CProjectSourceLocation.java - -2002-11-05 Mikhail Khodjaiants - Added support of the 'Add Global Variables' action of the Expressions view. - * IExecFileInfo.java - * IGlobalVariable.java - * CDebugTarget.java - -2002-11-03 Mikhail Khodjaiants - Added support of the formatting actions of the Memory view. - * IFormattedMemoryBlock.java - * CFormattedMemoryBlock.java - * CDebugTarget.java - * CDebugUtils.java - -2002-11-01 Mikhail Khodjaiants - Added conversion utilities to support decimal format in the Memory View. - * CDebugUtils.java - -2002-11-01 Mikhail Khodjaiants - Added the 'IExecFileInfo' interface to provide access to the executable file information. - * IExecFileInfo.java: definition - * CDebugTarget.java: implementation - -2002-10-31 Mikhail Khodjaiants - Replaced the 'IProject' argument by 'IFile' in the debug target factory methods - second phase. - * CDebugModel.java: removed unused debug target factory methods. - * CDebugTarget.java: removed unused constructor. - -2002-10-31 Mikhail Khodjaiants - Replaced the 'IProject' argument by 'IFile' in the debug target factory methods. - * CDebugModel.java - * CDebugTarget.java - -2002-10-31 Mikhail Khodjaiants - Fixed the synchronization bug. - * CFormattedMemoryBlock.java - -2002-10-30 Mikhail Khodjaiants - Implementing the 'Refresh Memory' action. - * IFormattedMemoryBlock.java: added the 'refresh' method. - * CFormattedMemoryBlock.java: implementation of the 'refresh' method. - -2002-10-30 Mikhail Khodjaiants - Implementation of the 'SaveMemoryChanges' action. - * IFormattedMemoryBlock.java: added the 'saveChanges' method. - * CFormattedMemoryBlock.java: implementation of the 'saveChanges' method. - -2002-10-30 Mikhail Khodjaiants - Fix for bug 25283. - * CDebugTarget.java: in 'setCurrentThread' method set the 'isCurrent' flag to false for the currently current thread. - -2002-10-29 Mikhail Khodjaiants - Implementing editing features of the memory view. - * IFormattedMemoryBlockRow.java - * IFormattedMemoryBlock.java - * CFormattedMemoryBlock.java - -2002-10-28 Mikhail Khodjaiants - Implementing editing features of the memory view. - * IFormattedMemoryBlockRow.java - * CFormattedMemoryBlock.java - -2002-10-27 Mikhail Khodjaiants - * IFormattedMemoryBlock.java: added the 'setItemValue' method. - * CFormattedMemoryBlock.java: implementation of the 'setItemValue' method. - -2002-10-16 Alain Magloire - - * src/.../core/cdi/model/ICDIMemoryBlock.java (refresh): - New method. - -2002-10-25 Mikhail Khodjaiants - * CDebugUtils.java: Added utilities to convert textual presentation of memory to bytes. - -2002-10-25 Mikhail Khodjaiants - * IFormattedMemoryBlock.java: Replaced 'MEMORY_BYTES_PER_ROW_...' constants by 'MEMORY_NUMBER_OF_COLUMNS_...'. - -2002-10-25 Mikhail Khodjaiants - Remove the 'setWordSize' method from 'IFormattedMemoryBlock' and use 'reformat' instead. - * IFormattedMemoryBlock.java: removed the 'setWordSize' method. - * CFormattedMemoryBlock.java: removed the implementation of 'setWordSize' method. - -2002-10-24 Mikhail Khodjaiants - Support of the "Memory Unit Size" action. - * IFormattedMemoryBlock.java: added the 'setWordsize' method. - * CFormattedMemoryBlock.java: implementation of the 'setWordSize' method. - -2002-10-24 Mikhail Khodjaiants - Moved the memory format constants from IFormattedMemoryRetrieval.java - to IFormattedMemoryBlock.java. - * IFormattedMemoryRetrieval.java - * IFormattedMemoryBlock.java - -2002-10-24 David Inglis - * CDebugTarget.java - fix exception on shutdown with a connected target, CDI session - was not terminated. - -2002-10-23 Mikhail Khodjaiants - Support for debugger console. - * CDebugModel.java: new factory methods for CDebugTarget - * IDebuggerProcessSupport: new interface that defines the debugger - process support functionality. - * CDebugTarget.java: implementation of IDebuggerProcessSupport interface. - -2002-10-22 Alain Magloire - - * src/.../cdi/ICDISession.java (getSessionProcess): - New method to let user acess directly the debugger. - -2002-10-20 Mikhail Khodjaiants - Added a functionality needed to process ICDIMemoryChangedEvent. - * IFormattedMemoryBlock.java - * CFormattedMemoryBlock.java - -2002-10-20 Alain Magloire - - * src/.../cdi/model/ICDITarget.java (getMemoryBlock): Remove - we use the MemoryManager instead. - (evaluateExpressionToValue): Remove not used. - * src/.../cdi/model/ICDISourceManager.java (getFile): Remove not use. - (setFile): Remove not use. - (reset): Remove not use. - -2002-10-19 Alain Magloire - - The UI needs to be told when the memory changes - so it can update the memory view. The responsability - of this been push to the CDI implementation to generate - events(ICDIMemoryChangedEvent) for modified memories. The - getSource() method of the class should return an ICDIMemoryBlock. - Note that the CDI implementation will only try to generate - the event for ICDIMemoryBlock that are not frozen(setFrozen()) since this - is a potentially very time consuming operation. - - * src/.../cdi/event/ICDIMemoryChangedEvent.java: New Class. - -2002-10-17 Mikhail Khodjaiants - Implementing the memory view support: - * CFormattedMemoryBlock.java: implementation of the 'dispose' method added. - -2002-10-17 Mikhail Khodjaiants - Implementing the memory view support: - * CDebugModel.java - * ICMemoryManager.java - * IFormattedMemoryBlock.java - * CFormattedMemoryBlock.java - * CDebugUtils.java - * CMemoryManager.java - -2002-10-16 Alain Magloire - - In the memory manager a string should be allowed to - create a block since an expression can be use. - - * src/.../debug.core.cdi/ICDIMemoryManager.java (createMemoryBlock): - New method that takes a string as the first argument. - -2002-10-15 Mikhail Khodjaiants - * CDebugModel.java: Implementing the memory view support. - * ICMemoryManager: Implementing the memory view support. - * IFormattedMemoryBlock.java: Implementing the memory view support. - * CDebugTarget.java: Implementing the memory view support. - * CFormattedMemoryBlock.java: Implementing the memory view support. - * CMemoryManager.java: Implementing the memory view support. - -2002-10-15 Mikhail Khodjaiants - * ICDebugConstants.java: New interface that contains the constant definitions for C/C++ debug plug-in. - * CSourceManager.java: Implementation of the 'Automatically switch to disassembly mode' preference. - -2002-10-15 Mikhail Khodjaiants - * CThread.java: The previous fix should be done only when switching between frames of the same thread. - -2002-10-14 Mikhail Khodjaiants - * CThread.java: Reset the register's change flag before switching to another frame. - -2002-10-14 Mikhail Khodjaiants - * CThread.java: Set the correct detail for 'resume' event to prevent collapsing of the variable's and - register's trees after stepping. - -2002-10-14 Mikhail Khodjaiants - * ISwitchToThread.java: New method to get the current thread. - * CDebugTarget.java: Implemented the 'getCurrentThread' method of the 'ISwitchToThread' interface. - * CDebugTarget.java: Fix in the 'setCurrentThread' method. - -2002-10-12 Alain Magloire - - * core/cdi/model/ICDIMemoryBlock (supportValueModification): - Remove the method, it should be part of a ICDIConfiguration. - - * core/cdi/ICDIMemoryManager (getBlock): Rename to getMemoryBlock - (createMemoryBlock): New method to get a memory block. - -2002-10-12 Alain Magloire - - * core/cdi/ICDILocation (getInstructions): Methods - removed is now part of SourceManager. - -2002-10-11 Mikhail Khodjaiants - * CDebugTarget.java: Added return for ISourceMode to 'getAdapter'. - * CSourceManager.java: Set the real mode when setting the source mode. - -2002-10-11 Mikhail Khodjaiants - * DisassemblyStorage.java: Changed the format of the disassembly view's output. -2002-10-11 Alain Magloire - - * ICDISourceManager.java (getMixedInstructions): Three - new methods to get the src and the intructions. - - * ICIDMixedInstruction: New Class that return the mixed - of source location and assembly instructions. - -2002-10-10 Mikhail Khodjaiants - * CVariable.java: Made the 'fChanged' field protected to access to it from the derived class (CRegister). - * CRegister.java: Added the 'hasValueChanged' method to 'CRegister'. - -2002-10-10 Mikhail Khodjaiants - * CThread.java: Check if the selected frame is current before calling 'setCurrentStackFrame'. - -2002-10-10 Mikhail Khodjaiants - * CStackFrame.java: Added Getter and Setter for 'fRefreshVariables'. - -2002-10-10 Mikhail Khodjaiants - * DisassemblyManager.java: Replaced 'getInstructions( String fileName, int lineNumber )' - by 'getInstructions( String fileName, int lineNumber, int maxLineCount )'. - -2002-10-10 Mikhail Khodjaiants - * CDebugTarget.java: Implementing the disassembly mode. - * CThread.java: Implementing the disassembly mode. - -2002-10-10 Mikhail Khodjaiants - * CSourceManager.java: Implementing the disassembly mode. - * DisassemblyManager.java: Implementing the disassembly mode. - * DisassemblyStorage.java: Implementing the disassembly mode. - * CDebugUtils.java: Added the 'toHexAddressString' method. - -2002-10-10 Alain Magloire - - * ICDISourceManager.java: Changing the getInstructions() - method to take long instead of String. diff --git a/debug/org.eclipse.cdt.debug.core/about.html b/debug/org.eclipse.cdt.debug.core/about.html deleted file mode 100644 index 293340ea8ed..00000000000 --- a/debug/org.eclipse.cdt.debug.core/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            20th August, 2002

            -

            License

            -

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

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.core/build.properties b/debug/org.eclipse.cdt.debug.core/build.properties deleted file mode 100644 index 68056ad95d9..00000000000 --- a/debug/org.eclipse.cdt.debug.core/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - cdtdebugcore.jar -src.includes = plugin.xml,\ - plugin.properties,\ - about.html -source.cdtdebugcore.jar = src,\ - schema -javadoc.packages = org.eclipse.cdt.debug.core.*,\ - org.eclipse.cdt.debug.core.cdi.*,\ - org.eclipse.cdt.debug.core.cdi.event.*,\ - org.eclipse.cdt.debug.core.cdi.model.* diff --git a/debug/org.eclipse.cdt.debug.core/plugin.properties b/debug/org.eclipse.cdt.debug.core/plugin.properties deleted file mode 100644 index 24d1900c19f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/plugin.properties +++ /dev/null @@ -1,4 +0,0 @@ -pluginName=C/C++ Development Tools Debug Model -providerName=Eclipse.org - -CDebugger.name=C/C++ Development Tools Core Debugger Extension diff --git a/debug/org.eclipse.cdt.debug.core/plugin.xml b/debug/org.eclipse.cdt.debug.core/plugin.xml deleted file mode 100644 index 159f274e96d..00000000000 --- a/debug/org.eclipse.cdt.debug.core/plugin.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.core/schema/CDebugger.exsd b/debug/org.eclipse.cdt.debug.core/schema/CDebugger.exsd deleted file mode 100644 index 2b6865949f8..00000000000 --- a/debug/org.eclipse.cdt.debug.core/schema/CDebugger.exsd +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - [Enter description of this extension point] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java deleted file mode 100644 index 76e4ae846ca..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core; - -import java.util.HashMap; - -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.internal.core.DebugConfiguration; -import org.eclipse.cdt.debug.internal.core.SessionManager; -import org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint; -import org.eclipse.cdt.debug.internal.core.sourcelookup.SourceUtils; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.model.IBreakpoint; - -/** - * The main plugin class to be used in the desktop. - */ -public class CDebugCorePlugin extends Plugin -{ - /** - * Status code indicating an unexpected internal error. - */ - public static final int INTERNAL_ERROR = 1000; - - //The shared instance. - private static CDebugCorePlugin plugin; - - private HashMap fDebugConfigurations; - - private IAsyncExecutor fAsyncExecutor = null; - - private SessionManager fSessionManager = null; - - /** - * The constructor. - */ - public CDebugCorePlugin( IPluginDescriptor descriptor ) - { - super( descriptor ); - plugin = this; - } - - /** - * Returns the shared instance. - * - * @return the shared instance - */ - public static CDebugCorePlugin getDefault() - { - return plugin; - } - - /** - * Returns the workspace instance. - * - * @return the workspace instance - */ - public static IWorkspace getWorkspace() - { - return ResourcesPlugin.getWorkspace(); - } - - /** - * Convenience method which returns the unique identifier of this plugin. - * - * @return the unique identifier of this plugin - */ - public static String getUniqueIdentifier() - { - if ( getDefault() == null ) - { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.debug.core"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - /** - * Logs the specified throwable with this plug-in's log. - * - * @param t throwable to log - */ - public static void log( Throwable t ) - { - Throwable top = t; - if ( t instanceof DebugException ) - { - DebugException de = (DebugException)t; - IStatus status = de.getStatus(); - if ( status.getException() != null ) - { - top = status.getException(); - } - } - // this message is intentionally not internationalized, as an exception may - // be due to the resource bundle itself - log( new Status( IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, "Internal error logged from CDI Debug: ", top ) ); //$NON-NLS-1$ - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status status to log - */ - public static void log( IStatus status ) - { - getDefault().getLog().log( status ); - } - - /** - * Logs the specified message with this plug-in's log. - * - * @param status status to log - */ - public static void log( String message ) - { - getDefault().getLog().log( new Status( IStatus.ERROR, - CDebugModel.getPluginIdentifier(), - INTERNAL_ERROR, - message, - null ) ); - } - - private void initializeDebugConfiguration() { - IPluginDescriptor descriptor= getDefault().getDescriptor(); - IExtensionPoint extensionPoint= descriptor.getExtensionPoint("CDebugger"); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fDebugConfigurations = new HashMap(infos.length); - for (int i= 0; i < infos.length; i++) { - IConfigurationElement configurationElement = infos[i]; - DebugConfiguration configType = new DebugConfiguration(configurationElement); - fDebugConfigurations.put(configType.getID(), configType); - } - } - - public ICDebugConfiguration[] getDebugConfigurations() { - if (fDebugConfigurations == null) { - initializeDebugConfiguration(); - } - return (ICDebugConfiguration[]) fDebugConfigurations.values().toArray(new ICDebugConfiguration[0]); - } - - public ICDebugConfiguration getDebugConfiguration(String id) throws CoreException { - if (fDebugConfigurations == null) { - initializeDebugConfiguration(); - } - ICDebugConfiguration dbgCfg = (ICDebugConfiguration) fDebugConfigurations.get(id); - if ( dbgCfg == null ) { - IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 100, "No such debugger", null); - throw new CoreException(status); - } - return dbgCfg; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#shutdown() - */ - public void shutdown() throws CoreException - { - setSessionManager( null ); - resetBreakpointsInstallCount(); - super.shutdown(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#startup() - */ - public void startup() throws CoreException - { - super.startup(); - resetBreakpointsInstallCount(); - setSessionManager( new SessionManager() ); - } - - protected void resetBreakpointsInstallCount() - { - IBreakpointManager bm = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] breakpoints = bm.getBreakpoints( getUniqueIdentifier() ); - for ( int i = 0; i < breakpoints.length; ++i ) - { - if ( breakpoints[i] instanceof CBreakpoint ) - { - try - { - ((CBreakpoint)breakpoints[i]).resetInstallCount(); - } - catch( CoreException e ) - { - log( e.getStatus() ); - } - } - } - } - - public void setAsyncExecutor( IAsyncExecutor executor ) - { - fAsyncExecutor = executor; - } - - public void asyncExec( Runnable runnable ) - { - if ( fAsyncExecutor != null ) - fAsyncExecutor.asyncExec( runnable ); - } - - protected SessionManager getSessionManager() - { - return fSessionManager; - } - - protected void setSessionManager( SessionManager sm ) - { - if ( fSessionManager != null ) - fSessionManager.dispose(); - fSessionManager = sm; - } - - public void saveCommonSourceLocations( ICSourceLocation[] locations ) - { - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SOURCE_LOCATIONS, SourceUtils.getCommonSourceLocationsMemento( locations ) ); - } - - public ICSourceLocation[] getCommonSourceLocations() - { - return SourceUtils.getCommonSourceLocationsFromMemento( CDebugCorePlugin.getDefault().getPluginPreferences().getString( ICDebugConstants.PREF_SOURCE_LOCATIONS ) ); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java deleted file mode 100644 index 0244754777b..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java +++ /dev/null @@ -1,686 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core; - -import java.text.MessageFormat; -import java.util.HashMap; - -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.IFunction; -import org.eclipse.cdt.core.model.IMethod; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.core.model.ICDebugTargetType; -import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; -import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; -import org.eclipse.cdt.debug.core.model.ICWatchpoint; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; -import org.eclipse.cdt.debug.internal.core.breakpoints.CAddressBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CLineBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CWatchpoint; -import org.eclipse.cdt.debug.internal.core.model.CCoreFileDebugTarget; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.cdt.debug.internal.core.model.CExpression; -import org.eclipse.cdt.debug.internal.core.model.CFormattedMemoryBlock; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.core.model.IProcess; - -/** - * - * Provides utility methods for creating debug sessions, targets and - * breakpoints specific to the CDI debug model. - * - * @since Aug 1, 2002 - */ -public class CDebugModel -{ - /** - * Constructor for CDebugModel. - */ - public CDebugModel() - { - super(); - } - - /** - * Returns the identifier for the CDI debug model plug-in - * - * @return plugin identifier - */ - public static String getPluginIdentifier() - { - return CDebugCorePlugin.getUniqueIdentifier(); - } - - /** - * Creates and returns a debug target for the given CDI target, with - * the specified name, and associates the debug target with the - * given process for console I/O. The allow terminate flag specifies - * whether the debug target will support termination (ITerminate). - * The allow disconnect flag specifies whether the debug target will - * support disconnection (IDisconnect). The resume - * flag specifies if the target process should be resumed on startup. - * The debug target is added to the given launch. - * - * @param launch the launch the new debug target will be contained in - * @param cdiTarget the CDI target to create a debug target for - * @param name the name to associate with this target, which will be - * returned from IDebugTarget.getName. - * @param debuggeeProcess the process to associate with the debug target, - * which will be returned from IDebugTarget.getProcess - * @param debuggerProcess the process to associate with the debugger. - * @param file the executable to debug. - * @param allowTerminate whether the target will support termianation - * @param allowDisconnect whether the target will support disconnection - * @param stopInMain whether to set a temporary breakpoint in main. - * @return a debug target - */ - public static IDebugTarget newDebugTarget( final ILaunch launch, - final ICDITarget cdiTarget, - final String name, - final IProcess debuggeeProcess, - final IProcess debuggerProcess, - final IFile file, - final boolean allowTerminate, - final boolean allowDisconnect, - final boolean stopInMain ) throws DebugException - { - final IDebugTarget[] target = new IDebugTarget[1]; - - IWorkspaceRunnable r = new IWorkspaceRunnable() - { - public void run( IProgressMonitor m ) - { - target[0] = new CDebugTarget( launch, - ICDebugTargetType.TARGET_TYPE_LOCAL_RUN, - cdiTarget, - name, - debuggeeProcess, - debuggerProcess, - file, - allowTerminate, - allowDisconnect ); - } - }; - try - { - ResourcesPlugin.getWorkspace().run( r, null ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e ); - throw new DebugException( e.getStatus() ); - } - - ICDIConfiguration config = cdiTarget.getSession().getConfiguration(); - - if ( config.supportsBreakpoints() && stopInMain ) - { - stopInMain( (CDebugTarget)target[0] ); - } - - if ( config.supportsResume() ) - { - target[0].resume(); - } - - return target[0]; - } - - public static IDebugTarget newAttachDebugTarget( final ILaunch launch, - final ICDITarget cdiTarget, - final String name, - final IProcess debuggerProcess, - final IFile file ) throws DebugException - { - final IDebugTarget[] target = new IDebugTarget[1]; - - IWorkspaceRunnable r = new IWorkspaceRunnable() - { - public void run( IProgressMonitor m ) - { - target[0] = new CDebugTarget( launch, - ICDebugTargetType.TARGET_TYPE_LOCAL_ATTACH, - cdiTarget, - name, - null, - debuggerProcess, - file, - false, - true ); - } - }; - try - { - ResourcesPlugin.getWorkspace().run( r, null ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e ); - throw new DebugException( e.getStatus() ); - } - - ((CDebugTarget)target[0]).handleDebugEvent( new ICDISuspendedEvent() - { - public ICDISessionObject getReason() - { - return null; - } - - public ICDIObject getSource() - { - return cdiTarget; - } - - } ); - - return target[0]; - } - - public static IDebugTarget newCoreFileDebugTarget( final ILaunch launch, - final ICDITarget cdiTarget, - final String name, - final IProcess debuggerProcess, - final IFile file ) throws DebugException - { - final IDebugTarget[] target = new IDebugTarget[1]; - - IWorkspaceRunnable r = new IWorkspaceRunnable() - { - public void run( IProgressMonitor m ) - { - target[0] = new CCoreFileDebugTarget( launch, - cdiTarget, - name, - debuggerProcess, - file ); - } - }; - try - { - ResourcesPlugin.getWorkspace().run( r, null ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e ); - throw new DebugException( e.getStatus() ); - } - - ((CDebugTarget)target[0]).handleDebugEvent( new ICDISuspendedEvent() - { - public ICDISessionObject getReason() - { - return null; - } - - public ICDIObject getSource() - { - return cdiTarget; - } - - } ); - - return target[0]; - } - - /** - * Returns a C/C++ line breakpoint that is already registered with the breakpoint - * manager for a file with the given name at the given line number. - * - * @param fileName fully qualified file name - * @param lineNumber line number - * @return a C/C++ line breakpoint that is already registered with the breakpoint - * manager for a file with the given name at the given line number or null - * if no such breakpoint is registered - * @exception CoreException if unable to retrieve the associated marker - * attributes (line number). - */ - public static ICLineBreakpoint lineBreakpointExists( String fileName, int lineNumber ) throws CoreException - { - String modelId = getPluginIdentifier(); - String markerType = CLineBreakpoint.getMarkerType(); - IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] breakpoints = manager.getBreakpoints( modelId ); - for ( int i = 0; i < breakpoints.length; i++ ) - { - if ( !( breakpoints[i] instanceof ICLineBreakpoint ) ) - { - continue; - } - ICLineBreakpoint breakpoint = (ICLineBreakpoint)breakpoints[i]; - if ( breakpoint.getMarker().getType().equals( markerType ) ) - { - if ( breakpoint.getMarker().getResource().getLocation().toOSString().equals( fileName ) ) - { - if ( breakpoint.getLineNumber() == lineNumber ) - { - return breakpoint; - } - } - } - } - return null; - } - - public static ICLineBreakpoint createLineBreakpoint( IResource resource, - int lineNumber, - boolean enabled, - int ignoreCount, - String condition, - boolean add ) throws DebugException - { - HashMap attributes = new HashMap( 10 ); - attributes.put( IBreakpoint.ID, getPluginIdentifier() ); - attributes.put( IMarker.LINE_NUMBER, new Integer( lineNumber ) ); - attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); - attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); - attributes.put( ICBreakpoint.CONDITION, condition ); - return new CLineBreakpoint( resource, attributes, add ); - } - - public static ICAddressBreakpoint addressBreakpointExists( IResource resource, long address ) throws CoreException - { - String modelId = getPluginIdentifier(); - String markerType = CAddressBreakpoint.getMarkerType(); - IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] breakpoints = manager.getBreakpoints( modelId ); - for ( int i = 0; i < breakpoints.length; i++ ) - { - if ( !( breakpoints[i] instanceof ICAddressBreakpoint ) ) - { - continue; - } - ICAddressBreakpoint breakpoint = (ICAddressBreakpoint)breakpoints[i]; - if ( breakpoint.getMarker().getType().equals( markerType ) ) - { - if ( breakpoint.getMarker().getResource().getLocation().toOSString().equals( resource.getLocation().toOSString() ) ) - { - try - { - if ( Long.parseLong( breakpoint.getAddress() ) == address ) - { - return breakpoint; - } - } - catch( NumberFormatException e ) - { - } - } - } - } - return null; - } - - public static ICAddressBreakpoint createAddressBreakpoint( IResource resource, - long address, - boolean enabled, - int ignoreCount, - String condition, - boolean add ) throws DebugException - { - HashMap attributes = new HashMap( 10 ); - attributes.put( IBreakpoint.ID, getPluginIdentifier() ); - attributes.put( IMarker.CHAR_START, new Integer( 0 ) ); - attributes.put( IMarker.CHAR_END, new Integer( 0 ) ); - attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); - attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); - attributes.put( ICAddressBreakpoint.ADDRESS, Long.toString( address ) ); - attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); - attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); - attributes.put( ICBreakpoint.CONDITION, condition ); - return new CAddressBreakpoint( resource, attributes, add ); - } - - public static ICFunctionBreakpoint functionBreakpointExists( IFunction function ) throws CoreException - { - String modelId = getPluginIdentifier(); - String markerType = CFunctionBreakpoint.getMarkerType(); - IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] breakpoints = manager.getBreakpoints( modelId ); - for ( int i = 0; i < breakpoints.length; i++ ) - { - if ( !( breakpoints[i] instanceof ICFunctionBreakpoint ) ) - { - continue; - } - ICFunctionBreakpoint breakpoint = (ICFunctionBreakpoint)breakpoints[i]; - if ( breakpoint.getMarker().getType().equals( markerType ) ) - { - if ( breakpoint.getMarker().getResource().equals( CDebugUtils.getFunctionResource( function ) ) ) - { - if ( breakpoint.getFunction() != null && breakpoint.getFunction().equals( CDebugUtils.getFunctionName( function ) ) ) - { - return breakpoint; - } - } - } - } - return null; - } - - public static ICFunctionBreakpoint createFunctionBreakpoint( IFunction function, - boolean enabled, - int ignoreCount, - String condition, - boolean add ) throws DebugException - { - HashMap attributes = new HashMap( 10 ); - attributes.put( IBreakpoint.ID, getPluginIdentifier() ); - int lineNumber = -1; - int charStart = -1; - int charEnd = -1; - try - { - ISourceRange sourceRange = function.getSourceRange(); - if ( sourceRange != null ) - { - charStart = sourceRange.getStartPos(); - charEnd = charStart + sourceRange.getLength(); - // for now - if ( charEnd == 0 ) - lineNumber = sourceRange.getStartLine(); - } - } - catch( CModelException e ) - { - CDebugCorePlugin.log( e.getStatus() ); - } - attributes.put( IMarker.CHAR_START, new Integer( charStart ) ); - attributes.put( IMarker.CHAR_END, new Integer( charEnd ) ); - attributes.put( IMarker.LINE_NUMBER, new Integer( lineNumber ) ); - attributes.put( ICFunctionBreakpoint.FUNCTION, CDebugUtils.getFunctionName( function ) ); - attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); - attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); - attributes.put( ICBreakpoint.CONDITION, condition ); - return new CFunctionBreakpoint( CDebugUtils.getFunctionResource( function ), attributes, add ); - } - - public static ICFunctionBreakpoint methodBreakpointExists( IMethod method ) throws CoreException - { - String modelId = getPluginIdentifier(); - String markerType = CFunctionBreakpoint.getMarkerType(); - IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] breakpoints = manager.getBreakpoints( modelId ); - for ( int i = 0; i < breakpoints.length; i++ ) - { - if ( !( breakpoints[i] instanceof ICFunctionBreakpoint ) ) - { - continue; - } - ICFunctionBreakpoint breakpoint = (ICFunctionBreakpoint)breakpoints[i]; - if ( breakpoint.getMarker().getType().equals( markerType ) ) - { - if ( breakpoint.getMarker().getResource().equals( CDebugUtils.getMethodResource( method ) ) ) - { - if ( breakpoint.getFunction() != null && breakpoint.getFunction().equals( CDebugUtils.getMethodQualifiedName( method ) ) ) - { - return breakpoint; - } - } - } - } - return null; - } - - public static ICFunctionBreakpoint createMethodBreakpoint( IMethod method, - boolean enabled, - int ignoreCount, - String condition, - boolean add ) throws DebugException - { - HashMap attributes = new HashMap( 10 ); - attributes.put( IBreakpoint.ID, getPluginIdentifier() ); - int lineNumber = -1; - int charStart = -1; - int charEnd = -1; - try - { - ISourceRange sourceRange = method.getSourceRange(); - if ( sourceRange != null ) - { - charStart = sourceRange.getStartPos(); - charEnd = charStart + sourceRange.getLength(); - // for now - if ( charEnd == 0 ) - lineNumber = sourceRange.getStartLine(); - } - } - catch( CModelException e ) - { - CDebugCorePlugin.log( e.getStatus() ); - } - attributes.put( IMarker.CHAR_START, new Integer( charStart ) ); - attributes.put( IMarker.CHAR_END, new Integer( charEnd ) ); - attributes.put( IMarker.LINE_NUMBER, new Integer( lineNumber ) ); - attributes.put( ICFunctionBreakpoint.FUNCTION, CDebugUtils.getMethodQualifiedName( method ) ); - attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); - attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); - attributes.put( ICBreakpoint.CONDITION, condition ); - return new CFunctionBreakpoint( CDebugUtils.getMethodResource( method ), attributes, add ); - } - - public static ICWatchpoint watchpointExists( IResource resource, boolean write, boolean read, String expression ) throws CoreException - { - String modelId = getPluginIdentifier(); - String markerType = CWatchpoint.getMarkerType(); - IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] breakpoints = manager.getBreakpoints( modelId ); - for ( int i = 0; i < breakpoints.length; i++ ) - { - if ( !( breakpoints[i] instanceof ICWatchpoint ) ) - { - continue; - } - ICWatchpoint breakpoint = (ICWatchpoint)breakpoints[i]; - if ( breakpoint.getMarker().getType().equals( markerType )&& - breakpoint.getMarker().getResource().equals( resource ) && - breakpoint.isWriteType() == write && - breakpoint.isReadType() == read && - breakpoint.getExpression().equals( expression ) ) - { - return breakpoint; - } - } - return null; -} - - public static ICWatchpoint createWatchpoint( IResource resource, - boolean writeAccess, - boolean readAccess, - String expression, - boolean enabled, - int ignoreCount, - String condition, - boolean add ) throws DebugException - { - HashMap attributes = new HashMap( 10 ); - attributes.put( IBreakpoint.ID, getPluginIdentifier() ); - attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); - attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); - attributes.put( ICBreakpoint.CONDITION, condition ); - attributes.put( ICWatchpoint.EXPRESSION, expression ); - attributes.put( ICWatchpoint.READ, new Boolean( readAccess ) ); - attributes.put( ICWatchpoint.WRITE, new Boolean( writeAccess ) ); - return new CWatchpoint( resource, attributes, add ); - } - - public static IExpression createExpression( IDebugTarget target, String text ) throws DebugException - { - if ( target != null && target instanceof CDebugTarget ) - { - try - { - ICDIExpression cdiExpression = ((CDebugTarget)target).getCDISession().getExpressionManager().createExpression( text ); - return new CExpression( (CDebugTarget)target, cdiExpression ); - } - catch( CDIException e ) - { - throw new DebugException( new Status( IStatus.ERROR, - getPluginIdentifier(), - DebugException.TARGET_REQUEST_FAILED, - e.getMessage(), - null ) ); - } - } - return null; - } - - public static IExpression createExpressionForGlobalVariable( IDebugTarget target, IPath fileName, String name ) throws DebugException - { - if ( target != null && target instanceof CDebugTarget ) - { - try - { - ICDIVariableObject vo = ((CDebugTarget)target).getCDISession().getVariableManager().getGlobalVariableObject( fileName.lastSegment(), null, name ); - ICDIVariable cdiVariable = ((CDebugTarget)target).getCDISession().getVariableManager().createVariable( vo ); - return new CExpression( (CDebugTarget)target, cdiVariable ); - } - catch( CDIException e ) - { - throw new DebugException( new Status( IStatus.ERROR, - getPluginIdentifier(), - DebugException.TARGET_REQUEST_FAILED, - e.getMessage(), - null ) ); - } - } - return null; - } - - public static IFormattedMemoryBlock createFormattedMemoryBlock( IDebugTarget target, - String addressExpression, - int format, - int wordSize, - int numberOfRows, - int numberOfColumns, - char paddingChar ) throws DebugException - { - if ( target != null && target instanceof CDebugTarget ) - { - try - { - ICDIExpression expression = ((CDebugTarget)target).getCDISession() - .getExpressionManager() - .createExpression( addressExpression ); - ICDIMemoryBlock cdiMemoryBlock = ((CDebugTarget)target).getCDISession() - .getMemoryManager() - .createMemoryBlock( expression.getName(), wordSize * numberOfRows * numberOfColumns ); - return new CFormattedMemoryBlock( (CDebugTarget)target, - cdiMemoryBlock, - expression, - format, - wordSize, - numberOfRows, - numberOfColumns, - paddingChar ); - } - catch( CDIException e ) - { - throw new DebugException( new Status( IStatus.ERROR, - getPluginIdentifier(), - DebugException.TARGET_REQUEST_FAILED, - e.getDetailMessage(), - null ) ); - } - } - return null; - } - - public static IFormattedMemoryBlock createFormattedMemoryBlock( IDebugTarget target, - String addressExpression, - int format, - int wordSize, - int numberOfRows, - int numberOfColumns ) throws DebugException - { - if ( target != null && target instanceof CDebugTarget ) - { - try - { - ICDIExpression expression = ((CDebugTarget)target).getCDISession() - .getExpressionManager() - .createExpression( addressExpression ); - ICDIMemoryBlock cdiMemoryBlock = ((CDebugTarget)target).getCDISession() - .getMemoryManager() - .createMemoryBlock( expression.getName(), wordSize * numberOfRows * numberOfColumns ); - return new CFormattedMemoryBlock( (CDebugTarget)target, - cdiMemoryBlock, - expression, - format, - wordSize, - numberOfRows, - numberOfColumns ); - } - catch( CDIException e ) - { - throw new DebugException( new Status( IStatus.ERROR, - getPluginIdentifier(), - DebugException.TARGET_REQUEST_FAILED, - e.getDetailMessage(), - null ) ); - } - } - return null; - } - - private static void stopInMain( CDebugTarget target ) throws DebugException - { - ICDILocation location = target.getCDISession().getBreakpointManager().createLocation( "", "main", 0 ); - try - { - target.setInternalTemporaryBreakpoint( location ); - } - catch( DebugException e ) - { - String message = MessageFormat.format( "Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?", new String[] { e.getStatus().getMessage() } ); - IStatus newStatus = new Status( IStatus.WARNING, - e.getStatus().getPlugin(), - ICDebugInternalConstants.STATUS_CODE_QUESTION, - message, - null ); - if ( !CDebugUtils.question( newStatus, target ) ) - { - target.terminate(); - throw new DebugException( new Status( IStatus.OK, - e.getStatus().getPlugin(), - e.getStatus().getCode(), - e.getStatus().getMessage(), - null ) ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java deleted file mode 100644 index 180842d712e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java +++ /dev/null @@ -1,456 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.apache.xml.serialize.Method; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.Serializer; -import org.apache.xml.serialize.SerializerFactory; -import org.eclipse.cdt.core.model.IFunction; -import org.eclipse.cdt.core.model.IMethod; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatValue; -import org.eclipse.cdt.debug.core.model.ICValue; -import org.eclipse.cdt.debug.internal.core.model.CValue; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IStatusHandler; -import org.w3c.dom.Document; - -/** - * - * Enter type comment. - * - * @since Sep 25, 2002 - */ -public class CDebugUtils -{ - public static boolean question( IStatus status, Object source ) - { - Boolean result = new Boolean( false ); - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler( status ); - if ( handler != null ) - { - try - { - result = (Boolean)handler.handleStatus( status, source ); - } - catch( CoreException e ) - { - } - } - return result.booleanValue(); - } - - public static void info( IStatus status, Object source ) - { - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler( status ); - if ( handler != null ) - { - try - { - handler.handleStatus( status, source ); - } - catch( CoreException e ) - { - } - } - } - - public static void error( IStatus status, Object source ) - { - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler( status ); - if ( handler != null ) - { - try - { - handler.handleStatus( status, source ); - } - catch( CoreException e ) - { - } - } - } - - public static String toHexAddressString( long address ) - { - String addressString = Long.toHexString( address ); - StringBuffer sb = new StringBuffer( 10 ); - sb.append( "0x" ); - for ( int i = 0; i < 8 - addressString.length(); ++i ) - { - sb.append( '0' ); - } - sb.append( addressString ); - return sb.toString(); - } - - public static char[] getByteText( byte b ) - { - return new char[]{ charFromByte( (byte)((b >>> 4) & 0x0f) ), - charFromByte( (byte)(b & 0x0f) ) }; - } - - public static byte textToByte( char[] text ) - { - byte result = 0; - if ( text.length == 2 ) - { - byte[] bytes = { charToByte( text[0] ), charToByte( text[1] ) }; - result = (byte)((bytes[0] << 4) + bytes[1]); - } - return result; - } - - public static char charFromByte( byte value ) - { - if ( value >= 0x0 && value <= 0x9 ) - return (char)(value + '0'); - if ( value >= 0xa && value <= 0xf ) - return (char)(value - 0xa + 'a'); - return '0'; - } - - public static byte charToByte( char ch ) - { - if ( Character.isDigit( ch ) ) - { - return (byte)(ch - '0'); - } - if ( ch >= 'a' && ch <= 'f' ) - { - return (byte)(0xa + ch - 'a'); - } - if ( ch >= 'A' && ch <= 'F' ) - { - return (byte)(0xa + ch - 'A'); - } - return 0; - } - - public static char bytesToChar( byte[] bytes ) - { - try - { - return (char)Short.parseShort( new String( bytes ), 16 ); - } - catch( RuntimeException e ) - { - } - return 0; - } - - public static byte toByte( char[] bytes, boolean le ) - { - if ( bytes.length != 2 ) - return 0; - return (byte)Long.parseLong( bytesToString( bytes, le, true ), 16 ); - } - - public static short toUnsignedByte( char[] bytes, boolean le ) - { - if ( bytes.length != 2 ) - return 0; - return (short)Long.parseLong( bytesToString( bytes, le, false ), 16 ); - } - - public static short toShort( char[] bytes, boolean le ) - { - if ( bytes.length != 4 ) - return 0; - return (short)Long.parseLong( bytesToString( bytes, le, true ), 16 ); - } - - public static int toUnsignedShort( char[] bytes, boolean le ) - { - if ( bytes.length != 4 ) - return 0; - return (int)Long.parseLong( bytesToString( bytes, le, false ), 16 ); - } - - public static int toInt( char[] bytes, boolean le ) - { - if ( bytes.length != 8 ) - return 0; - return (int)Long.parseLong( bytesToString( bytes, le, true ), 16 ); - } - - public static long toUnsignedInt( char[] bytes, boolean le ) - { - if ( bytes.length != 8 ) - return 0; - return Long.parseLong( bytesToString( bytes, le, false ), 16 ); - } - - public static long toLongLong( char[] bytes, boolean le ) - { - if ( bytes.length != 16 ) - return 0; - return Long.parseLong( bytesToString( bytes, le, false ), 16 ); - } - - public static long toUnsignedLongLong( char[] bytes, boolean le ) - { - return 0; - } - - private static String bytesToString( char[] bytes, boolean le, boolean signed ) - { - char[] copy = new char[bytes.length]; - if ( le ) - { - for ( int i = 0; i < bytes.length / 2; ++i ) - { - copy[2 * i] = bytes[bytes.length - 2 * i - 2]; - copy[2 * i + 1] = bytes[bytes.length - 2 * i - 1]; - } - } - else - { - System.arraycopy( bytes, 0, copy, 0, copy.length ); - } - return new String( copy ); - } - - public static String prependString( String text, int length, char ch ) - { - StringBuffer sb = new StringBuffer( length ); - if ( text.length() > length ) - { - sb.append( text.substring( 0, length ) ); - } - else - { - char[] prefix = new char[length - text.length()]; - Arrays.fill( prefix, ch ); - sb.append( prefix ); - sb.append( text ); - } - return sb.toString(); - } - - public static boolean isReferencedProject( IProject parent, IProject project ) - { - if ( parent != null && parent.exists() ) - { - List projects = CDebugUtils.getReferencedProjects( project ); - Iterator it = projects.iterator(); - while( it.hasNext() ) - { - IProject prj = (IProject)it.next(); - if ( prj.exists() && ( prj.equals( project ) ) ) - return true; - } - } - return false; - } - - /** - * Serializes a XML document into a string - encoded in UTF8 format, - * with given line separators. - * - * @param doc document to serialize - * @param lineSeparator line separator - * @return the document as a string - */ - public static String serializeDocument( Document doc, String lineSeparator ) throws IOException - { - ByteArrayOutputStream s = new ByteArrayOutputStream(); - OutputFormat format = new OutputFormat(); - format.setIndenting( true ); - format.setLineSeparator( lineSeparator ); //$NON-NLS-1$ - Serializer serializer = SerializerFactory.getSerializerFactory( Method.XML ).makeSerializer( new OutputStreamWriter( s, "UTF8" ), format ); - serializer.asDOMSerializer().serialize( doc ); - return s.toString( "UTF8" ); //$NON-NLS-1$ - } - - /** - * 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 - */ - public static String serializeDocument( Document doc) throws IOException - { - ByteArrayOutputStream s = new ByteArrayOutputStream(); - OutputFormat format = new OutputFormat(); - format.setIndenting( true ); - format.setLineSeparator( System.getProperty( "line.separator" ) ); //$NON-NLS-1$ - Serializer serializer = SerializerFactory.getSerializerFactory( Method.XML ).makeSerializer( new OutputStreamWriter( s, "UTF8" ), format ); - serializer.asDOMSerializer().serialize( doc ); - return s.toString( "UTF8" ); //$NON-NLS-1$ - } - - - public static IResource getFunctionResource( IFunction function ) - { - ITranslationUnit tu = function.getTranslationUnit(); - return ( tu != null ) ? tu.getResource() : function.getCProject().getProject(); - } - - public static IResource getMethodResource( IMethod method ) - { - ITranslationUnit tu = method.getTranslationUnit(); - return ( tu != null ) ? tu.getResource() : method.getCProject().getProject(); - } - - public static String getFunctionName( IFunction function ) - { - String functionName = function.getElementName(); - StringBuffer name = new StringBuffer( functionName ); - if ( functionName.indexOf( "::" ) != -1 ) - { - String[] params = function.getParameterTypes(); - name.append( '(' ); - if ( params.length == 0 ) - { - name.append( "void" ); - } - else - { - for ( int i = 0; i < params.length; ++i ) - { - name.append( params[i] ); - if ( i != params.length - 1 ) - name.append( ',' ); - } - } - name.append( ')' ); - } - return name.toString(); - } - - public static String getMethodQualifiedName( IMethod method ) - { - return null; - } - - public static Number getFloatingPointValue( ICValue value ) - { - if ( value instanceof CValue ) - { - try - { - ICDIValue cdiValue = ((CValue)value).getUnderlyingValue(); - if ( cdiValue instanceof ICDIDoubleValue ) - { - return new Double( ((ICDIDoubleValue)cdiValue).doubleValue() ); - } - if ( cdiValue instanceof ICDIFloatValue ) - { - return new Float( ((ICDIFloatValue)cdiValue).floatValue() ); - } - } - catch( CDIException e ) - { - } - } - return null; - } - - public static boolean isNaN( Number value ) - { - if ( value instanceof Double ) - { - return ((Double)value).isNaN(); - } - if ( value instanceof Float ) - { - return ((Float)value).isNaN(); - } - return false; - } - - public static boolean isPositiveInfinity( Number value ) - { - if ( value instanceof Double ) - { - return ( ((Double)value).isInfinite() && value.doubleValue() == Double.POSITIVE_INFINITY ); - } - if ( value instanceof Float ) - { - return ( ((Float)value).isInfinite() && value.floatValue() == Float.POSITIVE_INFINITY ); - } - return false; - } - - public static boolean isNegativeInfinity( Number value ) - { - if ( value instanceof Double ) - { - return ( ((Double)value).isInfinite() && value.doubleValue() == Double.NEGATIVE_INFINITY ); - } - if ( value instanceof Float ) - { - return ( ((Float)value).isInfinite() && value.floatValue() == Float.NEGATIVE_INFINITY ); - } - return false; - } - - public static List getReferencedProjects( IProject project ) - { - ArrayList list = new ArrayList( 10 ); - if ( project != null && project.exists() && project.isOpen() ) - { - IProject[] refs = new IProject[0]; - try - { - refs = project.getReferencedProjects(); - } - catch( CoreException e ) - { - } - for ( int i = 0; i < refs.length; ++i ) - { - if ( !project.equals( refs[i] ) && refs[i] != null && refs[i].exists() && refs[i].isOpen() ) - { - list.add( refs[i] ); - getReferencedProjects( project, refs[i], list ); - } - } - } - return list; - } - - private static void getReferencedProjects( IProject root, IProject project, List list ) - { - if ( project != null && project.exists() && project.isOpen() ) - { - IProject[] refs = new IProject[0]; - try - { - refs = project.getReferencedProjects(); - } - catch( CoreException e ) - { - } - for ( int i = 0; i < refs.length; ++i ) - { - if ( !list.contains( refs[i] ) && refs[i] != null && - !refs[i].equals( root ) && refs[i].exists() && refs[i].isOpen() ) - { - list.add( refs[i] ); - getReferencedProjects( root, refs[i], list ); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/IAsyncExecutor.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/IAsyncExecutor.java deleted file mode 100644 index e4dce2e58a3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/IAsyncExecutor.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -/** - * Enter type comment. - * - * @since: Jan 27, 2003 - */ -public interface IAsyncExecutor -{ - void asyncExec( Runnable runnable ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpointManager.java deleted file mode 100644 index 3133b541413..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpointManager.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.core.runtime.IAdaptable; - -/** - * Enter type comment. - * - * @since: Jan 7, 2003 - */ -public interface ICBreakpointManager extends IAdaptable -{ - long getBreakpointAddress( ICBreakpoint breakpoint ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java deleted file mode 100644 index 6c687b5c3c9..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDTLaunchConfigurationConstants.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.eclipse.cdt.debug.core; - -/* - * (c) Copyright QNX Software System 2002. - * All Rights Reserved. - */ - - -public interface ICDTLaunchConfigurationConstants { - - public static final String CDT_LAUNCH_ID = "org.eclipse.cdt.launch"; - - /** - * This is the launch type id. - */ - public static final String ID_LAUNCH_C_APP = "org.eclipse.cdt.launch.localCLaunch"; - - /** - * Launch configuration attribute key. The value is a name of - * a C/C++ project associated with a C/C++ launch configuration. - */ - public static final String ATTR_PROJECT_NAME = CDT_LAUNCH_ID + ".PROJECT_ATTR"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a string specifying - * application a C/C++ launch configuration. - */ - public static final String ATTR_PROGRAM_NAME = CDT_LAUNCH_ID + ".PROGRAM_NAME"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a string specifying - * application arguments for a C/C++ launch configuration, as they should appear - * on the command line. - */ - public static final String ATTR_PROGRAM_ARGUMENTS = CDT_LAUNCH_ID + ".PROGRAM_ARGUMENTS"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a string specifying a - * path to the working directory to use when launching a the application. - * When unspecified, the working directory is inherited from the current process. - * When specified as an absolute path, the path represents a path in the local - * file system. When specified as a full path, the path represents a workspace - * relative path. - */ - public static final String ATTR_WORKING_DIRECTORY = CDT_LAUNCH_ID + ".WORKING_DIRECTORY"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a boolean specifying - * whether the current enviroment should be inherited when the application - * is launched. - */ - public static final String ATTR_PROGRAM_ENVIROMENT_INHERIT = CDT_LAUNCH_ID + ".ENVIRONMENT_INHERIT"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a Map specifying the - * environment to use when launching a C/C++ application. - */ - public static final String ATTR_PROGRAM_ENVIROMENT_MAP = CDT_LAUNCH_ID + ".ENVIRONMENT_MAP"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is the platform string of the launch configuration - */ - public static final String ATTR_PLATFORM = CDT_LAUNCH_ID + ".PLATFFORM"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is the debugger id - * used when launching a C/C++ application for debug. - */ - public static final String ATTR_DEBUGGER_ID = CDT_LAUNCH_ID + ".DEBUGGER_ID"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is the platform string of the launch configuration - */ - public static final String ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP = CDT_LAUNCH_ID + ".DEBUGGER_SPECIFIC_ATTRS_MAP"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a boolean specifying whether to stop at main(). - */ - public static final String ATTR_DEBUGGER_STOP_AT_MAIN = CDT_LAUNCH_ID + ".DEBUGGER_STOP_AT_MAIN"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is an int specifying the process id to attach to - * if the ATTR_DEBUGGER_START_MODE is DEBUGGER_MODE_ATTACH. A non existant value or -1 for this - * entry indicates that the user should be asked to supply this value. This value is primarily - * designed to be used by programatic users of the debug interface. - */ - public static final String ATTR_ATTACH_PROCESS_ID = CDT_LAUNCH_ID + ".ATTACH_PROCESS_ID"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is the startup mode for the debugger. - */ - public static final String ATTR_DEBUGGER_START_MODE = CDT_LAUNCH_ID + ".DEBUGGER_START_MODE"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a boolean specifying whether to enable variable bookkeeping. - */ - public static final String ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING = CDT_LAUNCH_ID + ".ENABLE_VARIABLE_BOOKKEEPING"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. Boolean value to set the 'deferred breakpoints' property of debugger. - */ -// public static final String ATTR_DEBUGGER_DEFERRED_BREAKPOINTS = CDT_LAUNCH_ID + ".DEFERRED_BREAKPOINTS"; //$NON-NLS-1$ - - /** - * Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE. - * Startup debugger running the program. - */ - public static String DEBUGGER_MODE_RUN = "run"; - - /** - * Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE. - * Startup debugger and attach to running process. - */ - public static String DEBUGGER_MODE_ATTACH = "attach"; - - /** - * Launch configuration attribute value. The key is ATTR_DEBUGGER_START_MODE. - * Startup debugger to view a core file. - */ - public static String DEBUGGER_MODE_CORE = "core"; - - /** - * Status code indicating that the Eclipse runtime does not support - * launching a program with a working directory. This feature is only - * available if Eclipse is run on a 1.3 runtime or higher. - *

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

            - */ - public static final int ERR_WORKING_DIRECTORY_NOT_SUPPORTED = 100; - - /** - * Status code indicating the specified working directory - * does not exist. - */ - public static final int ERR_WORKING_DIRECTORY_DOES_NOT_EXIST = 101; - - /** - * Status code indicating a launch configuration does not - * specify a project when a project is required. - */ - public static final int ERR_UNSPECIFIED_PROJECT = 102; - - /** - * Status code indicating a launch configuration does not - * specify a vaild project. - */ - public static final int ERR_NOT_A_C_PROJECT = 103; - - /** - * Status code indicating a launch configuration does not - * specify a vaild program. - */ - public static final int ERR_PROGRAM_NOT_EXIST = 104; - - /** - * Status code indicating a launch configuration does not - * specify a program name. - */ - - public static final int ERR_UNSPECIFIED_PROGRAM = 105; - - /** - * Status code indicating that the CDT debugger is missing - *

            - * A status handler may be registered for this error condition, - * and should return a String indicating which debugger to use. - *

            - */ - public static final int ERR_DEBUGGER_NOT_INSTALLED = 106; - - /** - * Status code indicating a the user did not specify a process id - */ - public static final int ERR_NO_PROCESSID = 107; - - /** - * Status code indicating a the user did not specify a path to a corefile - */ - public static final int ERR_NO_COREFILE = 108; - - /** - * Status code indicating an unexpected internal error. - */ - public static final int ERR_INTERNAL_ERROR = 150; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConfiguration.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConfiguration.java deleted file mode 100644 index bb72c012256..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.core.runtime.CoreException; - -public interface ICDebugConfiguration { - ICDebugger getDebugger() throws CoreException; - String getName(); - String getID(); - String getPlatform(); - String[] getCPUList(); - String[] getModeList(); - boolean supportsCPU(String cpu); - boolean supportsMode(String mode); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java deleted file mode 100644 index 1529622fd02..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugConstants.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -/** - * - * Constant definitions for C/C++ debug plug-in. - * - * @since: Oct 15, 2002 - */ -public interface ICDebugConstants -{ - /** - * C/C++ debug plug-in identifier (value "org.eclipse.cdt.debug.core"). - */ - public static final String PLUGIN_ID = CDebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier(); - - /** - * Boolean preference controlling whether the debugger automatically - * switchs to disassembly mode when can not find the source file . - * When true the debugger will automatically switch to - * disassembly mode. - */ - public static final String PREF_AUTO_DISASSEMBLY = PLUGIN_ID + "cDebug.auto_disassembly"; //$NON-NLS-1$ - - /** - * The identifier of the default variable format to use in the variables view - */ - public static final String PREF_DEFAULT_VARIABLE_FORMAT = PLUGIN_ID + "cDebug.default_variable_format"; //$NON-NLS-1$ - - /** - * The identifier of the default register format to use in the registers view - */ - public static final String PREF_DEFAULT_REGISTER_FORMAT = PLUGIN_ID + "cDebug.default_register_format"; //$NON-NLS-1$ - - /** - * The identifier of the default expression format to use in the expressions views - */ - public static final String PREF_DEFAULT_EXPRESSION_FORMAT = PLUGIN_ID + "cDebug.default_expression_format"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether the shared library manager will be - * refreshed every time when the execution of program stops. - */ - public static final String PREF_SHARED_LIBRARIES_AUTO_REFRESH = PLUGIN_ID + "SharedLibraries.auto_refresh"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether the register manager will be - * refreshed every time when the execution of program stops. - */ - public static final String PREF_REGISTERS_AUTO_REFRESH = PLUGIN_ID + "Registers.auto_refresh"; //$NON-NLS-1$ - - /** - * The identifier of the maximum number of instructions displayed in disassembly. - */ - public static final String PREF_MAX_NUMBER_OF_INSTRUCTIONS = PLUGIN_ID + "cDebug.max_number_of_instructions"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether the search for duplicate source files - * will be performed by debugger. - */ - public static final String PREF_SEARCH_DUPLICATE_FILES = PLUGIN_ID + "cDebug.Source.search_duplicate_files"; //$NON-NLS-1$ - - /** - * The identifier of the common source locations list - */ - public static final String PREF_SOURCE_LOCATIONS = PLUGIN_ID + "cDebug.Source.source_locations"; //$NON-NLS-1$ - - /** - * The default number of instructions displayed in disassembly. - */ - public static final int DEF_NUMBER_OF_INSTRUCTIONS = 100; - - /** - * The minimal valid number of instructions displayed in disassembly. - */ - public static final int MIN_NUMBER_OF_INSTRUCTIONS = 1; - - /** - * The maximal valid number of instructions displayed in disassembly. - */ - public static final int MAX_NUMBER_OF_INSTRUCTIONS = 999; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java deleted file mode 100644 index aa1f46376c6..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.ILaunchConfiguration; - -public interface ICDebugger { - public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException ; - public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException; - public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICMemoryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICMemoryManager.java deleted file mode 100644 index ee2d854e696..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICMemoryManager.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Oct 15, 2002 - */ -public interface ICMemoryManager extends IAdaptable -{ - public static final int MEMORY_SIZE_BYTE = 1; - public static final int MEMORY_SIZE_HALF_WORD = 2; - public static final int MEMORY_SIZE_WORD = 4; - public static final int MEMORY_SIZE_DOUBLE_WORD = 8; - public static final int MEMORY_SIZE_FLOAT = 8; - public static final int MEMORY_SIZE_DOUBLE_FLOAT = 16; - - public static final int MEMORY_FORMAT_HEX = 0; - public static final int MEMORY_FORMAT_BINARY = 1; - public static final int MEMORY_FORMAT_OCTAL = 2; - public static final int MEMORY_FORMAT_SIGNED_DECIMAL = 3; - public static final int MEMORY_FORMAT_UNSIGNED_DECIMAL = 4; - - public static final int MEMORY_BYTES_PER_ROW_4 = 4; - public static final int MEMORY_BYTES_PER_ROW_8 = 8; - public static final int MEMORY_BYTES_PER_ROW_16 = 16; - public static final int MEMORY_BYTES_PER_ROW_32 = 32; - public static final int MEMORY_BYTES_PER_ROW_64 = 64; - public static final int MEMORY_BYTES_PER_ROW_128 = 128; - - int[] getSupportedFormats() throws DebugException; - - void setBlockAt( int index, IFormattedMemoryBlock memoryBlock ) throws DebugException; - - void removeBlock( IFormattedMemoryBlock memoryBlock ) throws DebugException; - - void removeBlock( int index ) throws DebugException; - - void removeAllBlocks() throws DebugException; - - IFormattedMemoryBlock getBlock( int index ); - - IFormattedMemoryBlock[] getBlocks(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICRegisterManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICRegisterManager.java deleted file mode 100644 index 2953ee50203..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICRegisterManager.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegisterGroup; - -/** - * Enter type comment. - * - * @since Mar 31, 2003 - */ -public interface ICRegisterManager extends ICUpdateManager, IAdaptable -{ - void initialize(); - - IRegisterGroup[] getRegisterGroups() throws DebugException; - - void addRegisterGroup( IRegisterGroup group ); - - void removeRegisterGroup( IRegisterGroup group ); - - void removeAllRegisterGroups(); - - void reset(); - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSharedLibraryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSharedLibraryManager.java deleted file mode 100644 index 115ca78aaca..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSharedLibraryManager.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Jan 15, 2003 - */ -public interface ICSharedLibraryManager extends ICUpdateManager, IAdaptable -{ - ICSharedLibrary[] getSharedLibraries(); - - void loadSymbolsForAll() throws DebugException; - - void loadSymbols( ICSharedLibrary[] libraries ) throws DebugException; - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSignalManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSignalManager.java deleted file mode 100644 index 2caf7bd8805..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICSignalManager.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Jan 31, 2003 - */ -public interface ICSignalManager extends IAdaptable -{ - ICSignal[] getSignals() throws DebugException; - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICUpdateManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICUpdateManager.java deleted file mode 100644 index 03cab9b5796..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICUpdateManager.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core; - -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Feb 10, 2003 - */ -public interface ICUpdateManager -{ - void setAutoModeEnabled( boolean enable ); - - boolean getAutoModeEnabled(); - - void update() throws DebugException; - - boolean canUpdate(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/CDIException.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/CDIException.java deleted file mode 100644 index 27a53de8090..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/CDIException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents a failure in the CDI model operations. - * - * @since Jul 9, 2002 - */ -public class CDIException extends Exception { - - String details = ""; - - public CDIException() { - super(); - } - - public CDIException(String s) { - super(s); - } - - public CDIException(String s, String d) { - super(s); - details = d; - } - - /** - * Returns a more details message(if any). - */ - public String getDetailMessage() { - return details; - } - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointHit.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointHit.java deleted file mode 100644 index 59729b11fdd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointHit.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; - -/** - * - * Represents an information provided by the session when the program - * stopped by a breakpoint. - * - * @since Aug 27, 2002 - */ -public interface ICDIBreakpointHit extends ICDISessionObject { - /** - * Returns the breakpoint that stopped the program. - * - * @return the breakpoint that stopped the program - */ - ICDIBreakpoint getBreakpoint(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManager.java deleted file mode 100644 index 6a573c913d3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIBreakpointManager.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; - -/** - * - * The breakpoint manager manages the collection of breakpoints - * in the debug session. - * Auto update is off by default. - * @since Jul 9, 2002 - */ -public interface ICDIBreakpointManager extends ICDIManager { - - /** - * Returns a collection of all breakpoints set for this session. - * Returns an empty array if no breakpoints are set. - * - * @return a collection of all breakpoints set for this session - * @throws CDIException on failure. Reasons include: - */ - ICDIBreakpoint[] getBreakpoints() throws CDIException; - - /** - * Deletes the given breakpoint. - * - * @param breakpoint - a breakpoint to be deleted - * @throws CDIException on failure. Reasons include: - */ - void deleteBreakpoint(ICDIBreakpoint breakpoint) throws CDIException; - - /** - * Deletes the given array of breakpoints. - * - * @param breakpoints - the array of breakpoints to be deleted - * @throws CDIException on failure. Reasons include: - */ - void deleteBreakpoints(ICDIBreakpoint[] breakpoints) throws CDIException; - - /** - * Deletes all breakpoints. - * - * @throws CDIException on failure. Reasons include: - */ - void deleteAllBreakpoints() throws CDIException; - - /** - * Sets a breakpoint at the given location. - * The breakpoint is set acording to the choices: - *
            -	 * if location.getFile() != null then
            -	 *    if location.getFunction() != null then
            -	 *       breakpoint = file:function
            -	 *    else
            -	 *       breakpoint = file:line
            -	 * else if (location.getFuntion() != null) then
            -	 *    breakpoint = function
            -	 * else if (location.getLineNumber() != 0 then
            -	 *    breakpoint = line
            -	 * else
            -	 *    breakpoint = address
            -	 * end
            -	 * 
            - * @see ICDIBreakpoint.TEMPORARY - * @see ICDIBreakpoint.HARDWARE - * @see ICDIBreakpoint.REGULAR - * - * @param type - a combination of TEMPORARY and HARDWARE or REGULAR - * @param location - the location - * @param condition - the condition or null - * @param threadId - the thread identifier if this is - * a thread-specific breakpoint or null - * @param deferred - when set to true, if the breakpoint fails - * to be set, it is put a deferred list and the debugger will retry to set - * it when a new Shared library is loaded. - * @return a breakpoint - * @throws CDIException on failure. Reasons include: - */ - ICDILocationBreakpoint setLocationBreakpoint( - int type, - ICDILocation location, - ICDICondition condition, - String threadId, boolean deferred) - throws CDIException; - - /** - * Equivalent to : - * setLocationBreakpoint(type, location, condition, threadID, false); - * The breakpoint is not deferred. - * - * @param type - a combination of TEMPORARY and HARDWARE or REGULAR - * @param location - the location - * @param condition - the condition or null - * @param threadId - the thread identifier if this is - * a thread-specific breakpoint or null - * @return a breakpoint - * @throws CDIException on failure. Reasons include: - */ - ICDILocationBreakpoint setLocationBreakpoint( - int type, - ICDILocation location, - ICDICondition condition, - String threadId) - throws CDIException; - - /** - * Sets a watchpoint for the given expression. - * @param type - a combination of TEMPORARY and HARDWARE or 0 - * @param watchType - a combination of READ and WRITE - * @param expression - the expression to watch - * @param condition - the condition or null - * @return a watchpoint - * @throws CDIException on failure. Reasons include: - */ - ICDIWatchpoint setWatchpoint( - int type, - int watchType, - String expression, - ICDICondition condition) - throws CDIException; - - /** - * Sets a catchpoint for the given catch event. - * @param type - a combination of TEMPORARY and HARDWARE or 0 - * @param event - the event to catch - * @param condition - the condition or null - * @return a catchpoint - * @throws CDIException on failure. Reasons include: - */ - ICDICatchpoint setCatchpoint( - int type, - ICDICatchEvent event, - String expression, - ICDICondition condition) - throws CDIException; - - /** - * Allow the manager to interrupt the target - * if when setting the breakopoint the program was running. - */ - void allowProgramInterruption(boolean allow); - - /** - * Return a ICDICondition - */ - ICDICondition createCondition(int ignoreCount, String expression); - - /** - * Returns a ICDILocation - */ - ICDILocation createLocation(String file, String function, int line); - - /** - * Returns a ICDILocation - */ - ICDILocation createLocation(long address); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICatchEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICatchEvent.java deleted file mode 100644 index 7858dd7d07b..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICatchEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents a program event supported by catchpoints. - * - * @since Jul 9, 2002 - */ -public interface ICDICatchEvent extends ICDISessionObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICondition.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICondition.java deleted file mode 100644 index b5adfc6aa15..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDICondition.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents a break condition. - * - * @since Jul 9, 2002 - */ -public interface ICDICondition { - /** - * Returns the condition expression. - * - * @return the condition expression - */ - String getExpression(); - - /** - * Returns the ignore count of this condition. - * - * @return the ignore count of this condition - */ - int getIgnoreCount(); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java deleted file mode 100644 index 70dc5990b55..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -/** - * Describes the configuration of debug session. - * - * @since Aug 6, 2002 - */ -public interface ICDIConfiguration { - /** - * Returns whether this session supports termination. - * - * @return whether this session supports termination - */ - boolean supportsTerminate(); - - /** - * Returns whether this session supports disconnecting. - * - * @return whether this session supports disconnecting - */ - boolean supportsDisconnect(); - - /** - * Returns whether this session supports suspend. - * - * @return whether this session supports suspend. - */ - boolean supportsSuspend(); - - /** - * Returns whether this session supports Resume. - * - * @return whether this session supports Resume. - */ - boolean supportsResume(); - - /** - * Returns whether this session supports restarting. - * - * @return whether this session supports restarting - */ - boolean supportsRestart(); - - /** - * Returns whether this session supports stepping. - * - * @return whether this session supports stepping - */ - boolean supportsStepping(); - - /** - * Returns whether this session supports instruction stepping. - * - * @return whether this session supports instruction stepping - */ - boolean supportsInstructionStepping(); - - /** - * Returns whether this session supports breakpoints. - * - * @return whether this session supports breakpoints - */ - boolean supportsBreakpoints(); - - /** - * Returns whether this session supports registers. - * - * @return whether this session supports registers - */ - boolean supportsRegisters(); - - /** - * Returns whether this session supports register modification. - * - * @return whether this session supports registers modification - */ - boolean supportsRegisterModification(); - - /** - * Returns whether this session supports shared library. - * - * @return whether this session supports registers modification - */ - boolean supportsSharedLibrary(); - - /** - * Returns whether this session supports memory retrieval. - * - * @return whether this session supports memory retrieval - */ - boolean supportsMemoryRetrieval(); - - /** - * Returns whether this session supports memory modification. - * - * @return whether this session supports memory modification - */ - boolean supportsMemoryModification(); - - /** - * Returns whether this session supports expression evaluation. - * - * @return whether this session supports expression evaluation - */ - boolean supportsExpressionEvaluation(); - - /** - * Returns whether the session should be terminated when the inferior exits. - * - * @return whether the session be terminated when the inferior exits - */ - boolean terminateSessionOnExit(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEndSteppingRange.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEndSteppingRange.java deleted file mode 100644 index 5d45278f658..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEndSteppingRange.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents an information provided by the session when a step command - * is completed. - * - * @since Jul 10, 2002 - */ -public interface ICDIEndSteppingRange extends ICDISessionObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java deleted file mode 100644 index 32425b3edfe..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIErrorInfo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents an information provided by the session when the program - * exited. - * - * @since Jul 10, 2002 - */ -public interface ICDIErrorInfo extends ICDISessionObject { - - /** - * Returns the error message. - */ - String getMessage(); - - /** - * Returns a more verbatim error message(if any). - */ - String getDetailMessage(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEventManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEventManager.java deleted file mode 100644 index 0b6fdcba51a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIEventManager.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; - -/** - * - * Clients interested in the CDI model change notification may - * register with this object. - * - * @since Jul 10, 2002 - */ -public interface ICDIEventManager extends ICDISessionObject { - - /** - * Adds the given listener to the collection of registered - * event listeners. Has no effect if an identical listener is - * already registered. - * - * @param listener - the listener to add - */ - void addEventListener( ICDIEventListener listener ); - - /** - * Removes the given listener from the collection of registered - * event listeners. Has no effect if an identical listener is not - * already registered. - * - * @param listener - the listener to remove - */ - void removeEventListener( ICDIEventListener listener ); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExitInfo.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExitInfo.java deleted file mode 100644 index 10d07543f78..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExitInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents an information provided by the session when the program - * exited. - * - * @since Jul 10, 2002 - */ -public interface ICDIExitInfo extends ICDISessionObject { - - /** - * Returns an exit code. - * - * @return an exit code - */ - int getCode(); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExpressionManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExpressionManager.java deleted file mode 100644 index 6f73e3e0130..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIExpressionManager.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; - -/** - * - * Manages the collection of registered expressions in the - * debug session. - * Auto update is on by default. - * @since Jul 9, 2002 - */ -public interface ICDIExpressionManager extends ICDIManager { - - /** - * Returns an expression specified by the given identifier. - * - * @param expressionId - the expression identifier - * @return ICDIExpression an expression specified by the given identifier - * @throws CDIException on failure. Reasons include: - */ - ICDIExpression createExpression(String name) throws CDIException; - - /** - * Returns a collection of all registered expressions, possibly empty. - * - * @return an array of expressions - * @throws CDIException on failure. Reasons include: - */ - ICDIExpression[] getExpressions() throws CDIException; - - /** - * Removes the given expression from the expression manager. - * - * @param expressions - the expression to remove - * @throws CDIException on failure. Reasons include: - */ - void destroyExpression(ICDIExpression expression) throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIFormat.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIFormat.java deleted file mode 100644 index fbea9b49ed4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIFormat.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.core.cdi; - -/** - * Format constants. - */ -public interface ICDIFormat { - - final static int NATURAL = 0; - final static int DECIMAL = 1; - final static int BINARY = 2; - final static int OCTAL = 3; - final static int HEXADECIMAL = 4; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDILocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDILocation.java deleted file mode 100644 index 34d8267e6ed..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDILocation.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - - -/** - * - * Represents a location in the debuggable program. - * - * @since Jul 9, 2002 - */ -public interface ICDILocation { - - /** - * Returns the address of this location. - * - * @return the address of this location - */ - long getAddress(); - - /** - * Returns the source file of this location or null - * if the source file is unknown. - * - * @return the source file of this location - */ - String getFile(); - - /** - * Returns the function of this location or null - * if the function is unknown. - * - * @return the function of this location - */ - String getFunction(); - - /** - * Returns the line number of this location or null - * if the line number is unknown. - * - * @return the line number of this location - */ - int getLineNumber(); - - /** - * Return true if the both location refers to the same - * place. - */ - boolean equals(ICDILocation location); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIManager.java deleted file mode 100644 index e7a19b7b1e3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIManager.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -/** - */ -public interface ICDIManager extends ICDISessionObject { - - /** - * When the target is suspended the manager will check - * for any updates. The default behaviour (on/off) depend on the manager. - */ - void setAutoUpdate(boolean update); - - /** - * Returns true is the manager is set to autoupdate. - */ - boolean isAutoUpdate(); - - /** - * Force the manager to update its state. - */ - void update() throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java deleted file mode 100644 index da197577ee4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; - -/** - * - * The memory manager manages the collection of memory blocks - * specified for the debug session. - * Auto update is on by default. - * @since Jul 9, 2002 - */ -public interface ICDIMemoryManager extends ICDIManager { - - /** - * Returns a memory block specified by given identifier. - * - * @param address - * @param length - how much for address - * @return a memory block with the specified identifier - * @throws CDIException on failure. Reasons include: - */ - ICDIMemoryBlock createMemoryBlock(String address, int length) - throws CDIException; - - /** - * Returns a memory block specified by given identifier. - * - * @param address - * @param length - how much for address - * @return a memory block with the specified identifier - * @throws CDIException on failure. Reasons include: - */ - ICDIMemoryBlock createMemoryBlock(long address, int length) - throws CDIException; - - /** - * Removes the given memory block from the debug session. - * - * @param memoryBlock - the memory block to be removed - * @exception CDIException on failure. Reasons include: - */ - void removeBlock(ICDIMemoryBlock memoryBlock) throws CDIException; - - /** - * Removes the given array of memory blocks from the debug session. - * - * @param memoryBlock - the array of memory blocks to be removed - * @exception CDIException on failure. Reasons include: - */ - void removeBlocks(ICDIMemoryBlock[] memoryBlocks) throws CDIException; - ; - - /** - * Removes all memory blocks from the debug session. - * - * @exception CDIException on failure. Reasons include: - */ - void removeAllBlocks() throws CDIException; - - /** - * Returns an array of all memory blocks set for this debug session. - * - * @return an array of all memory blocks set for this debug session - * @throws CDIException on failure. Reasons include: - */ - ICDIMemoryBlock[] getMemoryBlocks() throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManager.java deleted file mode 100644 index bdc188635ac..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRegisterManager.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.*; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; - -/** - * The default behaviour of the register is autoupdate on. - */ -public interface ICDIRegisterManager extends ICDIManager { - - /** - * Method getRegisterObjects. - * @return ICDIRegisterObject[] - * @throws CDIException - */ - ICDIRegisterObject[] getRegisterObjects() throws CDIException; - - /** - * Method createRegister. - * @param stack - * @param reg - * @return ICDIRegister - * @throws CDIException - */ - ICDIRegister createRegister(ICDIRegisterObject reg) throws CDIException; - - /** - * Method removeRegister, remove register from the manager list. - * @param reg - */ - void destroyRegister(ICDIRegister reg); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java deleted file mode 100644 index 30471b5e3e3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIRuntimeOptions.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -import java.util.Properties; - -/** - * Describes the configuration of debug session. - * - * @since Aug 6, 2002 - */ -public interface ICDIRuntimeOptions { - - /** - * Program/Inferior arguments. - * - * @param args the string representing the arguments. - */ - void setArguments(String[] args) throws CDIException; - - /** - * Program/Inferior environment settings. - * - * @param props the new environment variable to add. - */ - void setEnvironment(Properties props) throws CDIException; - - /** - * Program/Inferior working directory. - * - * @param wd the working directory to start the program. - */ - void setWorkingDirectory(String wd) throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISession.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISession.java deleted file mode 100644 index bb4d0c7eaad..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISession.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; - -/** - * - * Represents a debug session. - * - * @since Jun 28, 2002 - */ -public interface ICDISession { - /** - * Returns all the debug targets associatd with this sesion, - * or an empty collection if no debug targets are associated - * with this session. - * - * @return an array of debug targets - */ - ICDITarget[] getTargets(); - - /** - * Returns the current debug target associatd with this sesion, - * or null if no debug targets are associated with this session. - * - * @return ICDITarget the current debug target - */ - ICDITarget getCurrentTarget(); - - /** - * Set the current debug target associatd with this sesion. - * - * @return ICDITarget the current debug target - */ - void setCurrentTarget(ICDITarget target) throws CDIException; - - /** - * Sets the value of a debug session attribute. - * - * @param key the attribute key - * @param value the attribute value - */ - void setAttribute(String key, String value); - - /** - * Returns the value of a debug session attribute. - * - * @param key the attribute key - * @return value the attribute value, or null if undefined - */ - String getAttribute(String key); - - /** - * Returns the breakpoint manager of this debug session. - * - * @return the breakpoint manager - */ - ICDIBreakpointManager getBreakpointManager(); - - /** - * Returns the signal manager of this debug session. - * - * @return the signal manager - */ - ICDISignalManager getSignalManager(); - - /** - * Returns the variable manager of this debug session. - * - * @return the variable manager - */ - ICDIVariableManager getVariableManager(); - - /** - * Returns the expression manager of this debug session. - * - * @return the expression manager - */ - ICDIExpressionManager getExpressionManager(); - - /** - * Returns the register manager of this debug session. - * - * @return the register manager - */ - ICDIRegisterManager getRegisterManager(); - - - /** - * Returns the memory manager of this debug session. - * - * @return the memory manager - */ - ICDIMemoryManager getMemoryManager(); - - /** - * Returns the source manager of this debug session. - * - * @return the source manager - */ - ICDISourceManager getSourceManager(); - - /** - * Returns the event manager of this debug session. - * - * @return the event manager - */ - ICDIEventManager getEventManager(); - - /** - * Returns the shared library manager of this debug session. - * - * @return the shared library manager - */ - ICDISharedLibraryManager getSharedLibraryManager(); - - /** - * Returns the configuration description of this debug session. - * - * @return the configuration description - */ - ICDIConfiguration getConfiguration(); - - /** - * Returns the Runtime options for this debug session. - * - * @return the configuration description - */ - ICDIRuntimeOptions getRuntimeOptions(); - - /** - * Causes this element to terminate, generating a KIND_TERMINATE event. - * - * @exception CDIException on failure. Reasons include: - */ - void terminate() throws CDIException; - - /** - * Gaves direct access to the underlying debugger process. - * @return the debugger process. - */ - Process getSessionProcess() throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISessionObject.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISessionObject.java deleted file mode 100644 index 72c58e7df74..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISessionObject.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -/** - * - * Represents an object associated with a debug session. - * - * @since Jul 9, 2002 - */ -public interface ICDISessionObject { - - /** - * Returns the debug session this object is associated with. - * - * @return the debug session this object is associated with - */ - ICDISession getSession(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryEvent.java deleted file mode 100644 index 354cac11000..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - - -/** - * - * Represents an information provided by the session when the program - * stopped by a shared libary event. - * - * @since Aug 18, 2003 - */ -public interface ICDISharedLibraryEvent extends ICDISessionObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java deleted file mode 100644 index 0f7e4a541cd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISharedLibraryManager.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; - -/** - * - * Manages the collection of shared libraries in the debug session. - * Auto update is on by default. - * - * @since: Jan 15, 2003 - */ -public interface ICDISharedLibraryManager extends ICDIManager { - - /** - * Returns the array of loaded shared libraries. - * - * @return the array of loaded shared libraries - * @throws CDIException on failure. Reasons include: - */ - ICDISharedLibrary[] getSharedLibraries() throws CDIException; - - /** - * Loads symbols for the specified shared libraries. - * - * @return the array of loaded shared libraries - * @throws CDIException on failure. Reasons include: - */ - void loadSymbols(ICDISharedLibrary[] libs) throws CDIException; - - /** - * Loads symbols of all shared libraries. - * - * @return the array of loaded shared libraries - * @throws CDIException on failure. Reasons include: - */ - void loadSymbols() throws CDIException; - - /** - * Returns the search paths for shared libraries. - * - * @return the array of the search paths - * @throws CDIException - */ - String[] getSharedLibraryPaths() throws CDIException; - - /** - * Sets the shared libs paths to libpaths. - * - * @param array of search paths - * @throws CDIException - */ - void setSharedLibraryPaths(String[] libpaths) throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalExitInfo.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalExitInfo.java deleted file mode 100644 index 8d4cc68885e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalExitInfo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -/** - * Represents information provided by the session when the program exited. - * - */ -public interface ICDISignalExitInfo extends ICDISessionObject { - - /** - * Method getName. - * @return String - */ - String getName(); - - /** - * Method getDescription. - * @return String - */ - String getDescription(); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalManager.java deleted file mode 100644 index 8d440781114..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalManager.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; - -/** - * - * The signal manager manages the collection of signals defined - * for the debug session. - * Auto update is off by default. - * @since Jul 9, 2002 - */ -public interface ICDISignalManager extends ICDIManager { - - /** - * Returns the array of signals defined for this session. - * - * @return the array of signals - * @throws CDIException on failure. Reasons include: - */ - ICDISignal[] getSignals() throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalReceived.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalReceived.java deleted file mode 100644 index 060798ab788..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISignalReceived.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; - -/** - * - * Represents a signal. - * - * @since Jul 10, 2002 - */ -public interface ICDISignalReceived extends ICDISessionObject { - - /** - * Method getSignal. - * @return ICDISignal - */ - ICDISignal getSignal(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java deleted file mode 100644 index d2b3d82338d..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; - -/** - * - * Maintains the list of directories to search for source files. - * Auto update is off by default. - * - * @since Jul 9, 2002 - */ -public interface ICDISourceManager extends ICDIManager { - - /** - * Set the source search paths for the debug session. - * @param String array of search paths - */ - void addSourcePaths(String[] srcPaths) throws CDIException; - - /** - * Return the array of source paths - * @return String array of search paths. - */ - String[] getSourcePaths() throws CDIException; - - /** - * @param startAddress is the begining address - * @param endAddress is the end address - * @throws CDIException on failure. - */ - ICDIInstruction[] getInstructions(long startAddress, long endAddress) - throws CDIException; - - /** - * @param filename is the name of the file to disassemble - * @param linenum is the line number to disassemble around - * @throws CDIException on failure - */ - ICDIInstruction[] getInstructions(String filename, int linenum) - throws CDIException; - - /** - * @param filename is the name of the file to disassemble - * @param linenum is the line number to disassemble around - * @param lines is the number of disassembly to produced - * @throws CDIException on failure - */ - ICDIInstruction[] getInstructions(String filename, int linenum, int lines) - throws CDIException; - - /** - * @param startAddress is the begining address - * @param endAddress is the end address - * @throws CDIException on failure. - */ - ICDIMixedInstruction[] getMixedInstructions( - long startAddress, - long endAddress) - throws CDIException; - - /** - * @param filename is the name of the file to disassemble - * @param linenum is the line number to disassemble around - * @param lines is the number of disassembly to produced - * @throws CDIException on failure - */ - ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum) - throws CDIException; - - /** - * @param filename is the name of the file to disassemble - * @param linenum is the line number to disassemble around - * @param lines is the number of disassembly to produced - * @throws CDIException on failure - */ - ICDIMixedInstruction[] getMixedInstructions( - String filename, - int linenum, - int lines) - throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java deleted file mode 100644 index 2c6ad84afbf..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint; - -/** - * Manages the collection of registered tracepoints and trace snapshoits - * in the debug session. Provides methods to control tracing. - * - * @since May 15, 2003 - */ -public interface ICDITraceManager extends ICDISessionObject { - /** - * Returns a collection of all tracepoints set for this session. - * Returns an empty array if no tracepoints are set. - * - * @return a collection of all tracepoints set for this session - * @throws CDIException on failure. Reasons include: - */ - ICDITracepoint[] getTracepoints() throws CDIException; - - /** - * Deletes the given tracepoint. - * - * @param tracepoint - a tracepoint to be deleted - * @throws CDIException on failure. Reasons include: - */ - void deleteTracepoint( ICDITracepoint tracepoint ) throws CDIException; - - /** - * Deletes the given array of tracepoints. - * - * @param tracepoints - the array of tracepoints to be deleted - * @throws CDIException on failure. Reasons include: - */ - void deleteTracepoints( ICDITracepoint[] tracepoints ) throws CDIException; - - /** - * Deletes all tracepoints. - * - * @throws CDIException on failure. Reasons include: - */ - void deleteAllTracepoints() throws CDIException; - - /** - * Sets a tracepoint at the given location. - * The tracepoint is set acording to the choices: - *
            -	 * if location.getFile() != null then
            -	 *    if location.getFunction() != null then
            -	 *       tracepoint = file:function
            -	 *    else
            -	 *       tracepoint = file:line
            -	 * else if (location.getFuntion() != null) then
            -	 *    tracepoint = function
            -	 * else if (location.getLineNumber() != 0 then
            -	 *    tracepoint = line
            -	 * else
            -	 *    tracepoint = address
            -	 * end
            -	 * 
            - * - * @param location - the location - * @return a tracepoint - * @throws CDIException on failure. Reasons include: - */ - ICDITracepoint setTracepoint( ICDILocation location ) throws CDIException; - - /** - * Allows the manager to interrupt the excution of program - * when setting a tracepoint. - */ - void allowProgramInterruption( boolean allow ); - - /** - * Starts the tracing and begins collecting data. - * - * @throws CDIException on failure. Reasons include: - */ - void startTracing() throws CDIException; - - /** - * Stops the tracing and ends collecting data. - * - * @throws CDIException on failure. Reasons include: - */ - void stopTracing() throws CDIException; - - /** - * Returns the status of tracing. - * - * @return the status of tracing - * @throws CDIException on failure. Reasons include: - */ - boolean isTracing() throws CDIException; - - /** - * Enables/disables the snapshot debugging mode. - * - * @param enabled true to enable, and false - * to disable - * @throws CDIException on failure. Reasons include: - */ - void enableSnapshotMode( boolean enabled ) throws CDIException; - - /** - * Returns all trace snapshots for this session. - * - * @return all trace snapshots for this session - * @throws CDIException on failure. Reasons include: - */ - ICDITraceSnapshot[] getSnapshots() throws CDIException; - - /** - * Returns all trace snapshots associated with the given tracepoints. - * - * @param tracepoints - an array of tracepoints - * @return all trace snapshots associated with the given tracepoints - * @throws CDIException on failure. Reasons include: - */ - ICDITraceSnapshot[] getSnapshots( ICDITracepoint[] tracepoints ) throws CDIException; - - /** - * Returns all trace snapshots associated with the given locations. - * - * @param locations - an array of locations - * @return all trace snapshots associated with the given locations - * @throws CDIException on failure. Reasons include: - */ - ICDITraceSnapshot[] getSnapshots( ICDILocation[] locations ) throws CDIException; - - /** - * Creates an ICDILocation object for given file name and line number or function. - * - * @param file - a file name - * @param function - a function name - * @param line - a line number - * @return an ICDILocation object - */ - ICDILocation createLocation( String file, String function, int line ); - - /** - * Creates an ICDILocation object for given address. - * - * @param address - an address - * @return an ICDILocation object - */ - ICDILocation createLocation( long address ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceSnapshot.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceSnapshot.java deleted file mode 100644 index 99734be3548..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDITraceSnapshot.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint; - -/** - * Represents a trace snapshot in the debug session. - * - * @since May 15, 2003 - */ -public interface ICDITraceSnapshot extends ICDISessionObject { - - /** - * Returns the number of this snapshot. - * - * @return the number of this snapshot - */ - int getNumber(); - - /** - * Selects this snapshot. - * - * @throws CDIException on failure. Reasons include: - */ - void select() throws CDIException; - - /** - * Returns the data collected at this snapshot. - * - * @return the data collected at this snapshot - * @throws CDIException on failure. Reasons include: - */ - ICDIObject[] getData() throws CDIException; - - /** - * Returns the array of tracepoints associated with this snapshot. - * - * @return array of tracepoints - */ - ICDITracepoint[] getTracepoints(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java deleted file mode 100644 index 5af41f7c773..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.*; -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; - -/** - * Auto update is on by default. - */ -public interface ICDIVariableManager extends ICDIManager { - - /** - * Method getVariableObject. - * you can specify a static/global variable in a particular function or file, - * filename or/and function is the context for the static ICDIVariableObject. - *
            -	 * hello.c:
            -	 *   int bar;
            -	 *   int main() {
            -	 *   	static int bar;
            -	 *   }
            -	 * file.c:
            -	 *   int foo() {
            -	 *   	static int bar;
            -	 *   }
            -	 * getVariableObject(null, null, "bar");
            -	 * getVariableObject(null, "main", "bar");
            -	 * getVariableObject("file.c", "foo", "bar");
            -	 * 
            - * @param filename - * @param function - * @param name - * @return ICDIVariableObject - * @throws CDIException - */ - ICDIVariableObject getGlobalVariableObject(String filename, String function, String name) throws CDIException; - - /** - * Consider the variable object as an Array of type and range[start, start + length - 1] - * @param stack - * @param name - * @return ICDIVariableObject - * @throws CDIException - */ - ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject var, int start, int length) throws CDIException; - - /** - * Consider the variable object as type. - * @param stack - * @param name - * @return ICDIVariableObject - * @throws CDIException - */ - ICDIVariableObject getVariableObjectAsType(ICDIVariableObject var, String type) throws CDIException; - - /** - * Method getVariableObjects. - * Returns all the local variable objects of that stackframe. - * @param stack - * @return ICDIVariableObject[] - * @throws CDIException - */ - ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame stack) throws CDIException; - - /** - * Method getVariableObjects. - * Returns all the local variable objects of that stackframe. - * @param stack - * @return ICDIVariableObject[] - * @throws CDIException - */ - ICDIVariableObject[] getVariableObjects(ICDIStackFrame stack) throws CDIException; - - /** - * Method createVariable. - * Create a Variable for evaluation. A CreatedEvent will be trigger and - * ChangedEvent will also be trigger when the variable is assign a new value. - * DestroyedEvent is fired when the variable is out of scope and automatically - * removed from the manager list. - * @param var - * @return ICDIVariable - * @throws CDIException - */ - ICDIVariable createVariable(ICDIVariableObject var) throws CDIException; - - /** - * Method getArgumentObjects. - * Returns all the local arguments of that stackframe. - * @param stack - * @return ICDIArgumentObject[] - * @throws CDIException - */ - ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame stack) throws CDIException; - - /** - * Method createArgument. - * Create a Variable for evaluation. CreatedEvent will be trigger and - * ChangedEvent will also be trigger when the variable is assign a new value. - * DestroyedEvent is fired when the variable is out of scope and automatically - * from th manager list. - * @param var - * @return ICDIArgument - * @throws CDIException - */ - ICDIArgument createArgument(ICDIArgumentObject var) throws CDIException; - - /** - * Remove the variable from the manager list. - * @param var - * @return ICDIArgument - * @throws CDIException - */ - void destroyVariable(ICDIVariable var) throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointScope.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointScope.java deleted file mode 100644 index b8546eaccdb..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointScope.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; - -/** - * - * Represents an information provided by the session when a watchpoint - * is going out of scope. - * - * @since Aug 27, 2002 - */ -public interface ICDIWatchpointScope extends ICDISessionObject { - /** - * Returns the out of scope watchpoint. - * - * @return the watchpoint - */ - ICDIWatchpoint getWatchpoint(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointTrigger.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointTrigger.java deleted file mode 100644 index 0f0696bb6a6..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIWatchpointTrigger.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; - -/** - * - * Represents an information provided by the session when a watchpoint - * is triggered. - * - * @since Aug 27, 2002 - */ -public interface ICDIWatchpointTrigger extends ICDISessionObject { - /** - * Returns the triggered watchpoint. - * - * @return the triggered watchpoint - */ - ICDIWatchpoint getWatchpoint(); - - /** - * Returns the old value of the watching expression. - * - * @return the old value of the watching expression - */ - String getOldValue(); - - /** - * Returns the new value of the watching expression. - * - * @return the new value of the watching expression - */ - String getNewValue(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIChangedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIChangedEvent.java deleted file mode 100644 index ebc73339f6a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIChangedEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has changed. - * Can be originated by any CDI model object. - * - * @since Jul 10, 2002 - */ -public interface ICDIChangedEvent extends ICDIEvent { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDICreatedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDICreatedEvent.java deleted file mode 100644 index 225a4e4cd06..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDICreatedEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has been created. - * The originators: - *
              - *
            • target (ICDITarget) - *
            • thread (ICDIThread) - *
            - * - * @since Jul 10, 2002 - */ -public interface ICDICreatedEvent extends ICDIEvent { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDestroyedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDestroyedEvent.java deleted file mode 100644 index 33a6b68f517..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDestroyedEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has terminated. - * The originators: - *
              - *
            • target (ICDITarget) - *
            • thread (ICDIThread) - *
            - * - * @since Jul 10, 2002 - */ -public interface ICDIDestroyedEvent extends ICDIEvent { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDisconnectedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDisconnectedEvent.java deleted file mode 100644 index b64c1d2f7af..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIDisconnectedEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has disconnected. - * The originators: - *
              - *
            • target (ICDITarget) - *
            - * - * @since Jul 10, 2002 - */ -public interface ICDIDisconnectedEvent extends ICDIEvent { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEvent.java deleted file mode 100644 index 0ea528cc232..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; - -/** - * - * A base interface for all CDI events. - * - * @since Jul 18, 2002 - */ -public interface ICDIEvent { - /** - * The CDI object on which the event initially occurred. - * - * @return the CDI object on which the event initially occurred - */ - ICDIObject getSource(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEventListener.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEventListener.java deleted file mode 100644 index be9798d9459..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIEventListener.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * An event listener registers with the event manager to receive event - * notification from the CDI model objects. - * - * @since Jul 10, 2002 - */ -public interface ICDIEventListener { - /** - * Notifies this listener of the given event. - * - * @param event - the event - */ - void handleDebugEvent( ICDIEvent event ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIExitedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIExitedEvent.java deleted file mode 100644 index e53e0c18177..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIExitedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; - -/** - * - * Notifies that the program has exited. - * The originators: - *
              - *
            • target (ICDITarget) - *
            - * - * @since Jul 10, 2002 - */ -public interface ICDIExitedEvent extends ICDIDestroyedEvent { - /** - * Returns the information provided by the session when program - * is exited. - * - * @return the exit information - */ - ICDISessionObject getReason(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java deleted file mode 100644 index 5a3a0cf5e74..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has changed. - * - */ -public interface ICDIMemoryChangedEvent extends ICDIChangedEvent { - /** - * @return the modified addresses. - */ - Long[] getAddresses(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIRestartedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIRestartedEvent.java deleted file mode 100644 index 88067e2f3b0..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIRestartedEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has been restarted. - * The originators: - *
              - *
            • target (ICDITarget) - *
            - * - * @since Jul 11, 2002 - */ -public interface ICDIRestartedEvent extends ICDIEvent { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIResumedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIResumedEvent.java deleted file mode 100644 index 9d7c750b8d1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDIResumedEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.event; - -/** - * - * Notifies that the originator has been resumed. - * The originators: - *
              - *
            • target (ICDITarget) - *
            • thread (ICDIThread) - *
            - * - * @since Jul 10, 2002 - */ -public interface ICDIResumedEvent extends ICDIEvent { - final static public int CONTINUE = 0; - final static public int STEP_OVER = 1; - final static public int STEP_INTO = 2; - final static public int STEP_OVER_INSTRUCTION = 3; - final static public int STEP_INTO_INSTRUCTION = 4; - final static public int STEP_RETURN = 5; - - /** - * Returns the stepping type. - * - * @return the stepping type - */ - int getType(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDISuspendedEvent.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDISuspendedEvent.java deleted file mode 100644 index 64a25ac1731..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/event/ICDISuspendedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; - -/** - * - * Notifies that the originator has been suspended. - * The originators: - *
              - *
            • target (ICDITarget) - *
            • thread (ICDIThread) - *
            - * The reason of the suspension can be one of the following session - * objects: - *
              - *
            • breakpoint (ICDIBreakpoint) - *
            • signal (ICDISignalReceived) - *
            • end of the stepping range (ICDIEndSteppingRange) - *
            - * - * @since Jul 10, 2002 - */ -public interface ICDISuspendedEvent extends ICDIEvent { - - /** - * Returns the session object that caused the suspension. - * - * @return ICDIObject - */ - ICDISessionObject getReason(); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgument.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgument.java deleted file mode 100644 index 4967bd0bba5..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgument.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -/** - * - * Represents an argument in the stack frame. - * - * @since Jul 22, 2002 - */ -public interface ICDIArgument extends ICDIVariable, ICDIArgumentObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgumentObject.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgumentObject.java deleted file mode 100644 index b1f76b3ea61..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIArgumentObject.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.model; - - -/** - */ -public interface ICDIArgumentObject extends ICDIVariableObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpoint.java deleted file mode 100644 index edd51c7444a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpoint.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDICondition; - -/** - * - * A breakpoint is capable of suspending the execution of a program - * whenever a certain point in the program is reached. Provides a - * basic functionality for the location breakpoints, watchpoints, - * and catchpoints. - * - * @see ICDILocationBreakpoint - * @see ICDIWatchpoint - * @see ICDICatchpoint - * - * @since Jul 9, 2002 - */ -public interface ICDIBreakpoint extends ICDIObject { - final static public int REGULAR = 0x0; - final static public int TEMPORARY = 0x1; - final static public int HARDWARE = 0x2; - - /** - * Returns whether this breakpoint is temporary. - * - * @return whether this breakpoint is temporary - */ - boolean isTemporary(); - - /** - * Returns whether this breakpoint is hardware-assisted. - * - * @return whether this breakpoint is hardware-assisted - */ - boolean isHardware(); - - /** - * Returns whether this breakpoint is enabled. - * - * @return whether this breakpoint is enabled - * @throws CDIException if this method fails. Reasons include: - */ - boolean isEnabled() throws CDIException; - - /** - * Sets the enabled state of this breakpoint. This has no effect - * if the current enabled state is the same as specified by - * the enabled parameter. - * - * @param enabled - whether this breakpoint should be enabled - * @throws CDIException if this method fails. Reasons include: - */ - void setEnabled( boolean enabled ) throws CDIException; - - /** - * Returns the condition of this breakpoint or null - * if the breakpoint's condition is not set. - * - * @return the condition of this breakpoint - * @throws CDIException if this method fails. Reasons include: - */ - ICDICondition getCondition() throws CDIException; - - /** - * Sets the condition of this breakpoint. - * - * @param the condition to set - * @throws CDIException if this method fails. Reasons include: - */ - void setCondition( ICDICondition condition ) throws CDIException; - - /** - * Returns a thread identifier or null is the breakpoint - * is not thread-specific. - * - * @return a thread identifier - * @throws CDIException if this method fails. Reasons include: - */ - String getThreadId() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDICatchpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDICatchpoint.java deleted file mode 100644 index 6aa2f21db38..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDICatchpoint.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent; - -/** - * - * Represents a catchpoint. - * - * @since Jul 9, 2002 - */ -public interface ICDICatchpoint extends ICDIBreakpoint { - /** - * Returns the catch event for this catchpoint. - * - * @return the catch event for this catchpoint - * @throws CDIException if this method fails. Reasons include: - */ - ICDICatchEvent getEvent() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIExpression.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIExpression.java deleted file mode 100644 index 8c4c1238262..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIExpression.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - - - -/** - * An expression is a snippet of code that can be evaluated to - * produce a value. - * - * @since Jul 9, 2002 - */ -public interface ICDIExpression extends ICDIVariable { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java deleted file mode 100644 index e98a1f48b3f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -/** - * - * Represents a machine instruction. - * - * @since Jul 10, 2002 - */ -public interface ICDIInstruction extends ICDIObject { - /** - * Returns the Address. - * @return the address. - */ - long getAdress(); - - /** - * @return the function name. - */ - String getFuntionName(); - - /** - * @return the instruction. - */ - String getInstruction(); - - /** - * @return the opcode - */ - String getOpcode(); - - /** - * @return any arguments to the opcode - */ - String getArgs(); - - /** - * @return the offset of this machine instruction - * Returns the instruction's offset. - * - * @return the offset of this machine instruction - */ - long getOffset(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDILocationBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDILocationBreakpoint.java deleted file mode 100644 index d70d05b5e13..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDILocationBreakpoint.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; - -/** - * - * Represents a line, function or address breakpoint. - * - * @since Jul 9, 2002 - */ -public interface ICDILocationBreakpoint extends ICDIBreakpoint { - /** - * Returns the location of this breakpoint. - * - * @return the location of this breakpoint - * @throws CDIException if this method fails. Reasons include: - */ - ICDILocation getLocation() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java deleted file mode 100644 index 7a14723e483..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * A contiguous segment of memory in an execution context. A memory - * block is represented by a starting memory address and a length. - * - * @since Jul 18, 2002 - */ -public interface ICDIMemoryBlock extends ICDIObject { - /** - * Returns the start address of this memory block. - * - * @return the start address of this memory block - */ - long getStartAddress(); - - /** - * Returns the length of this memory block in bytes. - * - * @return the length of this memory block in bytes - */ - long getLength(); - - /** - * Returns the values of the bytes currently contained - * in this this memory block. - * - * @return the values of the bytes currently contained - * in this this memory block - * @exception CDIException if this method fails. Reasons include: - *
            • Failure communicating with the debug target. The CDIException's - * status code contains the underlying exception responsible for - * the failure.
            • - *
            - */ - byte[] getBytes() throws CDIException; - - /** - * Sets the value of the bytes in this memory block at the specified - * offset within this memory block to the spcified bytes. - * The offset is zero based. - * - * @param offset the offset at which to set the new values - * @param bytes the new values - * @exception CDIException if this method fails. Reasons include: - *
            • Failure communicating with the debug target. The CDIException's - * status code contains the underlying exception responsible for - * the failure.
            • - *
            • This memory block does not support value modification
            • - *
            • The specified offset is greater than or equal to the length - * of this memory block, or the number of bytes specified goes - * beyond the end of this memory block (index of out of range)
            • - *
            - */ - void setValue(long offset, byte[] bytes) throws CDIException; - - /** - * @return true if the block does not update. - */ - boolean isFrozen(); - - /** - * A memoryBlock set frozen means that the block will - * not update and check for new data. - * @param frozen the block is frozen by default. - */ - void setFrozen(boolean frozen); - - /** - * Refresh the data, this may cause events to be trigger - * if the data values changed. - */ - void refresh() throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMixedInstruction.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMixedInstruction.java deleted file mode 100644 index 0ff221ee2b1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIMixedInstruction.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.model; - -/** - * - * Represents a machine instruction. - * - * @since Jul 10, 2002 - */ -public interface ICDIMixedInstruction extends ICDIObject { - /** - * @return the line Number. - */ - int getLineNumber(); - - /** - * @return the file name - */ - String getFileName(); - - /** - * @return the array of instruction. - */ - ICDIInstruction[] getInstructions(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIObject.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIObject.java deleted file mode 100644 index a9a6a2860bd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIObject.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -/** - * - * Represents an object in the CDI model. - * - * @since Jul 8, 2002 - */ -public interface ICDIObject { - /** - * Returns the target this object is contained in. - * - * @return the target this object is contained in - */ - ICDITarget getTarget(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegister.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegister.java deleted file mode 100644 index f09a800d705..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegister.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -/** - * - * A register is a special kind of variable that is contained - * in a register group. Each register has a name and a value. - * - * @since Jul 9, 2002 - */ -public interface ICDIRegister extends ICDIVariable, ICDIRegisterObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterGroup.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterGroup.java deleted file mode 100644 index 185541c5890..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterGroup.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * Represents a group of registers that are assigned to a target. - * - * @since Jul 9, 2002 - */ -public interface ICDIRegisterGroup extends ICDIObject { - /** - * Returns the registers in this register group. - * - * @return the registers in this register group - * @throws CDIException if this method fails. Reasons include: - */ - ICDIRegister[] getRegisters() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterObject.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterObject.java deleted file mode 100644 index 457787a381e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIRegisterObject.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.model; - - -/** - * - * Represents a break condition. - * - * @since Jul 9, 2002 - */ -public interface ICDIRegisterObject extends ICDIVariableObject { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java deleted file mode 100644 index 0775e4ac66f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * Represents a shared library which has been loaded into - * the debug target. - * - * @since Jul 8, 2002 - */ -public interface ICDISharedLibrary extends ICDIObject { - /** - * Returns the name of shared library file. - * - * @return the name of shared library file - */ - String getFileName(); - - /** - * Returns the start address of this library. - * - * @return the start address of this library - */ - long getStartAddress(); - - /** - * Returns the end address of this library. - * - * @return the end address of this library - */ - long getEndAddress(); - - /** - * Returns whether the symbols of this library are read. - * - * @return whether the symbols of this library are read - */ - boolean areSymbolsLoaded(); - - /** - * Loads the library symbols. - * - * @throws CDIException if this method fails. Reasons include: - */ - void loadSymbols() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java deleted file mode 100644 index eb5b723250b..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDISignal.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * Represents a signal. - * - * @since Jul 10, 2002 - */ -public interface ICDISignal extends ICDIObject { - - /** - * Returns the name of this signal. - * - * @return the name of this signal - */ - String getName(); - - /** - * Returns the meaning of this signal. - * - * @return the meaning of this signal - */ - String getDescription(); - - /** - * if false means program will see the signal. - * Otherwise program does not know. - * - * @return boolean - */ - boolean isIgnore(); - - /** - * Means reenter debugger if this signal happens - * - * Method isStopSet. - * @return boolean - */ - boolean isStopSet(); - - /** - * Continue program giving it this signal. - * - * @throws CDIException if this method fails. Reasons include: - */ - void signal() throws CDIException ; - - /** - * Change the way debugger handles this signal. - * - * @param ignore - if true the debugger should not allow your program to see this signal - * @param stop - if true the debugger should stop your program when this signal happens - * @throws CDIException if this method fails. Reasons include: - */ - void handle(boolean ignore, boolean stop) throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java deleted file mode 100644 index ae7d6fee77c..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; - -/** - * - * A stack frame in a suspended thread. - * A stack frame contains variables representing visible locals and - * arguments at the current execution location. - * - * @since Jul 8, 2002 - */ -public interface ICDIStackFrame extends ICDIObject { - /** - * Returns the location of the instruction pointer in this - * stack frame. - * - * @return the location of the instruction pointer - */ - ICDILocation getLocation(); - - /** - * Returns the visible variables in this stack frame. An empty - * collection is returned if there are no visible variables. - * - * @return a collection of visible variables - * @throws CDIException if this method fails. Reasons include: - */ - ICDIVariable[] getLocalVariables() throws CDIException; - - /** - * Returns the arguments in this stack frame. An empty collection - * is returned if there are no arguments. - * - * @return a collection of arguments - * @throws CDIException if this method fails. Reasons include: - */ - ICDIArgument[] getArguments() throws CDIException; - - /** - * Returns the thread this stackframe is contained in. - * - * @return the thread - */ - ICDIThread getThread(); - - /** - * Returns the level of the stack frame. - * - * @return the level of the stack frame - */ - int getLevel(); - - /** - * Return true if the frames are the same. - */ - boolean equals(ICDIStackFrame stackframe); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStaticVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStaticVariable.java deleted file mode 100644 index 52b43d5123f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIStaticVariable.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -/** - * - * Represents a static data structure in the program. - * - * @since Jul 9, 2002 - */ -public interface ICDIStaticVariable extends ICDIVariable { -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java deleted file mode 100644 index 776242ffe04..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISession; - -/** - * - * Represents a debuggable process. This is a root object of the CDI - * model. - * - * @since Jul 8, 2002 - */ -public interface ICDITarget extends ICDIObject { - /** - * Returns the debug session this target is contained in. - * - * @return the debug session this target is contained in - */ - ICDISession getSession(); - - /** - * Gets the target process. - * - * @return the output stream connected to the normal input of the - * target process. - */ - Process getProcess(); - - /** - * Returns the threads contained in this target. - * An empty collection is returned if this target contains no - * threads. - * - * @return a collection of threads - * @throws CDIException if this method fails. Reasons include: - */ - ICDIThread[] getThreads() throws CDIException; - - /** - * Set the current thread on the target. - * @param - ICDThread - */ - void setCurrentThread(ICDIThread current) throws CDIException; - - /** - * Evaluates the expression specified by the given string. - * Returns the evaluation result as a String. - * - * @param - expression string to be evaluated - * @return the result of the evaluation - * @throws CDIException if this method fails. Reasons include: - */ - String evaluateExpressionToString(String expressionText) - throws CDIException; - - /** - * Returns whether this target is terminated. - * - * @return whether this target is terminated - */ - boolean isTerminated(); - - /** - * Causes this target to terminate. - * - * @throws CDIException if this method fails. Reasons include: - */ - void terminate() throws CDIException; - - /** - * Returns whether this target is disconnected. - * - * @return whether this target is disconnected - */ - boolean isDisconnected(); - - /** - * Disconnects this target from the debuggable process. Generally, - * disconnecting ends a debug session with this target, but allows - * the debuggable program to continue running. - * - * @throws CDIException if this method fails. Reasons include: - */ - void disconnect() throws CDIException; - - /** - * Restarts the execution of this target. - * - * @throws CDIException if this method fails. Reasons include: - */ - void restart() throws CDIException; - - /** - * Returns whether this target is currently suspended. - * - * @return whether this target is currently suspended - */ - boolean isSuspended(); - - /** - * Causes this target to resume its execution. - * Has no effect on a target that is not suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void resume() throws CDIException; - - /** - * Causes this target to suspend its execution. - * Has no effect on an already suspended target. - * - * @throws CDIException if this method fails. Reasons include: - */ - void suspend() throws CDIException; - - /** - * Equivalent to stepReturn(true) - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn() throws CDIException; - - /** - * If execute is true, continue running until just after function. if - * If execute is false, cancel execution of the function and stop the - * program after the function. - * Can only be called when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn(boolean execute) throws CDIException; - - /** - * Steps over the current source line. Can only be called - * when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepOver() throws CDIException; - - /** - * Steps into the current source line. Can only be called - * when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepInto() throws CDIException; - - /** - * Steps over the current machine instruction. Can only be called - * when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepOverInstruction() throws CDIException; - - /** - * Steps into the current machine instruction. Can only be called - * when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepIntoInstruction() throws CDIException; - - /** - * Continues running until location is reached. Can only be called when the associated - * target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void runUntil(ICDILocation location) throws CDIException; - - /** - * Resume execution at location. Note the jump() does not change stackframe. - * The result is undefined if jump outside of the stacframe i.e function. - * Can only be called when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void jump(ICDILocation location) throws CDIException; - - /** - * Method signal, resume execution without giving a signal. - * @throws CDIException - */ - void signal() throws CDIException; - - /** - * Resume execution where the program stopped but immediately give the - * signal. - * - * @param signal - * @throws CDIException - */ - void signal(ICDISignal signal) throws CDIException; - - /** - * Returns the currently selected thread. - * - * @return the currently selected thread - * @throws CDIException if this method fails. Reasons include: - */ - ICDIThread getCurrentThread() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java deleted file mode 100644 index 5458c05b7a5..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; - -/** - * - * A thread in a debug target. - * A thread contains stack frames. Stack frames are only available - * when the thread is suspended, and are returned in top-down order. - * - * @since Jul 8, 2002 - */ -public interface ICDIThread extends ICDIObject { - /** - * Returns the stack frames contained in this thread. An - * empty collection is returned if this thread contains - * no stack frames, or is not currently suspended. Stack frames - * are returned in top down order. - * - * @return a collection of stack frames - * @throws CDIException if this method fails. Reasons include: - */ - ICDIStackFrame[] getStackFrames() throws CDIException; - - /** - * Returns the stack frames contained in this thread whose levels - * are between the two arguments(inclusive). - * An empty collection is returned if this thread contains - * no stack frames, or is not currently suspended. Stack frames - * are returned in top down order. - * - * @return a collection of stack frames - * @throws CDIException if this method fails. Reasons include: - */ - ICDIStackFrame[] getStackFrames(int lowFrame, int highFrame) throws CDIException; - - /** - * Returns the depth of the stack frames - * @return depth of stack frames - * @throws CDIException if this method fails. Reasons include: - */ - int getStackFrameCount() throws CDIException; - - /** - * Set the current Stack for the thread. - * @param - ICDIStackFrame - */ - void setCurrentStackFrame(ICDIStackFrame current) throws CDIException; - - /** - * Set the current frame whithout generation any events, for example - * registers changed events. - * @param frame - * @param b - */ - void setCurrentStackFrame(ICDIStackFrame frame, boolean doUpdate) throws CDIException; - - /** - * Set the current stackframe. - * @return ICDIStackFrame - */ - ICDIStackFrame getCurrentStackFrame() throws CDIException; - /** - * Returns whether this thread is currently suspended. - * - * @return whether this thread is currently suspended - */ - boolean isSuspended(); - - /** - * Causes this thread to resume its execution. - * Has no effect on a thread that is not suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void resume() throws CDIException; - - /** - * Causes this thread to suspend its execution. - * Has no effect on an already suspended thread. - * - * @throws CDIException if this method fails. Reasons include: - */ - void suspend() throws CDIException; - - /** - * Equivalent to stepReturn(true) - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn() throws CDIException; - - /** - * If execute is true, continue running until just after function. if - * If execute is false, cancel execution of the function and stop the - * program after the function. - * Can only be called when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn(boolean execute) throws CDIException; - - /** - * Steps over the current source line. Can only be called - * when the associated thread is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepOver() throws CDIException; - - /** - * Steps into the current source line. Can only be called - * when the associated thread is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepInto() throws CDIException; - - /** - * Steps over the current machine instruction. Can only be called - * when the associated thread is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepOverInstruction() throws CDIException; - - /** - * Steps into the current machine instruction. Can only be called - * when the associated thread is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepIntoInstruction() throws CDIException; - - /** - * Continues running until location is reached. - * Can only be called when the associated thread is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void runUntil(ICDILocation location) throws CDIException; - - /** - * Resume execution at location. Note the jump() does not change stackframe. - * The result is undefined if jump outside of the stacframe i.e function. - * Can only be called when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void jump(ICDILocation location) throws CDIException; - - /** - * Method signal, resume execution without giving a signal. - * @throws CDIException - */ - void signal() throws CDIException; - - /** - * Resume execution where the program stopped but immediately give the - * signal. - * - * @param signal - * @throws CDIException - */ - void signal(ICDISignal signal) throws CDIException; - - /** - * Returns true if the threads are the same. - */ - boolean equals(ICDIThread thead); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITracepoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITracepoint.java deleted file mode 100644 index ce36a415000..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDITracepoint.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; - -/** - * Defines a point in the program execution when the specified data to be collected. - * - * @since May 15, 2003 - */ -public interface ICDITracepoint extends ICDIObject { - - /** - * Represents an action to be taken when the tracepoint is hit. - * - * @since May 15, 2003 - */ - public interface IAction { - } - - /** - * Returns the location of this tracepoint. - * - * @return the location of this tracepoint - * @throws CDIException if this method fails. Reasons include: - */ - ICDILocation getLocation() throws CDIException; - - /** - * Returns whether this tracepoint is enabled. - * - * @return whether this tracepoint is enabled - * @throws CDIException if this method fails. Reasons include: - */ - boolean isEnabled() throws CDIException; - - /** - * Sets the enabled state of this tracepoint. This has no effect - * if the current enabled state is the same as specified by - * the enabled parameter. - * - * @param enabled - whether this tracepoint should be enabled - * @throws CDIException if this method fails. Reasons include: - */ - void setEnabled( boolean enabled ) throws CDIException; - - /** - * Returns the passcount of this tracepoint. - * - * @return the passcount of this tracepoint - * @throws CDIException if this method fails. Reasons include: - */ - int getPassCount() throws CDIException; - - /** - * Sets the passcount of this tracepoint. - * - * @param the passcount to set - * @throws CDIException if this method fails. Reasons include: - */ - void setPassCount( int passCount ) throws CDIException; - - /** - * Adds the given actions to the action list of thie tracepoint. - * - * @param actions to add - * @throws CDIException if this method fails. Reasons include: - */ - void addActions( ICDITracepoint.IAction[] actions ) throws CDIException; - - /** - * Removes the given actions from the action list of thie tracepoint. - * - * @param actions to remove - * @throws CDIException if this method fails. Reasons include: - */ - void removeActions( ICDITracepoint.IAction[] actions ) throws CDIException; - - /** - * Clears the action list of thie tracepoint. - * - * @throws CDIException if this method fails. Reasons include: - */ - void clearActions() throws CDIException; - - /** - * Returns the actions assigned to this tracepoint. - * - * @return the actions of this tracepoint - */ - ICDITracepoint.IAction[] getActions(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java deleted file mode 100644 index 667a6c2f1f3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIValue.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * Represents the value of a variable. A value representing - * a complex data structure contains variables. - * - * @since Jul 9, 2002 - */ -public interface ICDIValue extends ICDIObject { - /** - * Returns a description of the type of data this value contains. - * - * @return the name of this value's data type - * @throws CDIException if this method fails. Reasons include: - */ - String getTypeName() throws CDIException; - - /** - * Returns this value as a String. - * - * @return a String representation of this value - * @throws CDIException if this method fails. Reasons include: - */ - String getValueString() throws CDIException; - - /** - * Return the number of children. - * @return int children count - */ - int getChildrenNumber() throws CDIException; - - /** - * @return true if value is a container like structure. - */ - boolean hasChildren() throws CDIException; - - /** - * Returns the variables in this value. An empty collection - * is returned if there are no variables. - * - * @return an array of variables - * @throws CDIException if this method fails. Reasons include: - */ - ICDIVariable[] getVariables() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java deleted file mode 100644 index d384c9e2e54..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariable.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * Represents a data structure in the program. Each variable has - * a value which may in turn contain more variables. - * - * @since Jul 9, 2002 - */ -public interface ICDIVariable extends ICDIVariableObject { - - - /** - * Returns the value of this variable. - * - * @return the value of this variable - * @throws CDIException if this method fails. Reasons include: - */ - ICDIValue getValue() throws CDIException; - - /** - * Attempts to set the value of this variable to the value of - * the given expression. - * - * @param expression - an expression to generate a new value - * @throws CDIException if this method fails. Reasons include: - */ - void setValue(String expression) throws CDIException; - - /** - * Sets the value of this variable to the given value. - * - * @param value - a new value - * @throws CDIException if this method fails. Reasons include: - */ - void setValue(ICDIValue value) throws CDIException; - - /** - * Set the format of the variable. - * - * @param format - @see ICDIFormat - * @throws CDIException if this method fails. - */ - void setFormat(int format) throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java deleted file mode 100644 index 646d25837f4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; - - -/** - * - */ -public interface ICDIVariableObject extends ICDIObject { - - /** - * Returns the name of this variable. - * - * @return String the name of this variable - */ - String getName(); - - /** - * Returns the stackframe where the variable was found - * may return null. - * - * @return the stackframe - * @throws CDIException if this method fails. Reasons include: - */ - ICDIStackFrame getStackFrame() throws CDIException; - - /** - * Returns the type of data this variable is declared. - * - * @return the type of data this variable is declared - * @throws CDIException if this method fails. Reasons include: - */ - ICDIType getType() throws CDIException; - - /** - * Returns the type of data this variable is declared. - * - * @return the type of data this variable is declared - * @throws CDIException if this method fails. Reasons include: - */ - String getTypeName() throws CDIException; - - /** - * Returns the size of this variable. - * - * @return the size of this variable - * @throws CDIException if this method fails. Reasons include: - */ - int sizeof() throws CDIException; - - /** - * Returns true if the value of this variable could be changed. - * - * @return true if the value of this variable could be changed - * @throws CDIException if this method fails. Reasons include: - */ - boolean isEditable() throws CDIException; - - /** - * Returns the qualified name of this variable. - * - * @return the qualified name of this variable - * @throws CDIException if this method fails. Reasons include: - */ - String getQualifiedName() throws CDIException; - - /** - * Returns true if the variable Object are the same, - * For example event if the name is the same because of - * casting this may return false; - * @return true if the same - */ - boolean equals(ICDIVariableObject varObject); - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIWatchpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIWatchpoint.java deleted file mode 100644 index 6364c4b06a7..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/ICDIWatchpoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - * - * Represents a watchpoint. - * - * @since Jul 9, 2002 - */ -public interface ICDIWatchpoint extends ICDIBreakpoint { - final static public int WRITE = 0x1; - final static public int READ = 0x2; - - /** - * Returns whether this watchppoint is a write watchpoint. - * - * @return whether this watchppoint is a write watchpoint - */ - boolean isWriteType(); - - /** - * Returns whether this watchppoint is a read watchpoint. - * - * @return whether this watchppoint is a read watchpoint - */ - boolean isReadType(); - - /** - * Returns the watchpoint's expression. - * - * @return the expression of this watchpoint - * @throws CDIException if this method fails. Reasons include: - */ - String getWatchExpression() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateType.java deleted file mode 100644 index e200e6c88a5..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateType.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIAggregateType extends ICDIType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateValue.java deleted file mode 100644 index 1d67fbe0add..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIAggregateValue.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIAggregateValue extends ICDIValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayType.java deleted file mode 100644 index f667d39f400..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayType.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIArrayType extends ICDIDerivedType { - - int getDimension(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayValue.java deleted file mode 100644 index 0848be85829..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIArrayValue.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; - - -/** - * - * Represents a value of a array type. - * - * @since April 15, 2003 - */ -public interface ICDIArrayValue extends ICDIDerivedValue { - ICDIVariable[] getVariables(int index, int length) throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolType.java deleted file mode 100644 index f76346e20e4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolType.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -/** - */ -public interface ICDIBoolType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolValue.java deleted file mode 100644 index fb11988f82f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIBoolValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -/** - */ -public interface ICDIBoolValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharType.java deleted file mode 100644 index 744f1f4c4f3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDICharType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharValue.java deleted file mode 100644 index e4d0a3ccbbc..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDICharValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDICharValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedType.java deleted file mode 100644 index 6d1b417b3a4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedType.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIDerivedType extends ICDIType { - - ICDIType getComponentType(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedValue.java deleted file mode 100644 index 46fe292746a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDerivedValue.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIDerivedValue extends ICDIValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleType.java deleted file mode 100644 index a12cbd733b1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIDoubleType extends ICDIFloatingPointType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleValue.java deleted file mode 100644 index 365864d5726..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIDoubleValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDIDoubleValue extends ICDIFloatingPointValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumType.java deleted file mode 100644 index b63085487b2..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumType.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -/** - */ -public interface ICDIEnumType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumValue.java deleted file mode 100644 index 9bec0f2fa8a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIEnumValue.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -/** - */ -public interface ICDIEnumValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatType.java deleted file mode 100644 index fd8afd872b2..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIFloatType extends ICDIFloatingPointType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatValue.java deleted file mode 100644 index e590f123c6e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDIFloatValue extends ICDIFloatingPointValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointType.java deleted file mode 100644 index 7b367486877..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointType.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIFloatingPointType extends ICDIType { - - boolean isImaginary(); - - boolean isComplex(); - - boolean isLong(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointValue.java deleted file mode 100644 index 52e5980dea1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFloatingPointValue.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDIFloatingPointValue extends ICDIValue { - - float floatValue() throws CDIException; - - double doubleValue() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionType.java deleted file mode 100644 index 41030464bfb..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionType.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIFunctionType extends ICDIDerivedType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionValue.java deleted file mode 100644 index 32885f68b22..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIFunctionValue.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIFunctionValue extends ICDIDerivedValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntType.java deleted file mode 100644 index 24118d1cd20..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIIntType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntValue.java deleted file mode 100644 index 0ae289b7d41..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDIIntValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralType.java deleted file mode 100644 index 6a0e763accc..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralType.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIIntegralType extends ICDIType{ - - boolean isUnsigned(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralValue.java deleted file mode 100644 index 6166beca3ef..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIIntegralValue.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDIIntegralValue extends ICDIValue { - - public long longValue() throws CDIException; - - public int intValue() throws CDIException; - - public short shortValue() throws CDIException; - - public int byteValue() throws CDIException; - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongType.java deleted file mode 100644 index 55d387d7ba6..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDILongLongType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongValue.java deleted file mode 100644 index 8fce24ba8f0..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongLongValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDILongLongValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongType.java deleted file mode 100644 index 466055700be..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDILongType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongValue.java deleted file mode 100644 index 84bf70d9ef8..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDILongValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDILongValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerType.java deleted file mode 100644 index bdebe06cd92..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIPointerType extends ICDIDerivedType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java deleted file mode 100644 index 5bb161e6102..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIPointerValue extends ICDIDerivedValue { - - long pointerValue() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceType.java deleted file mode 100644 index 5a3ea8938b1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceType.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - */ -public interface ICDIReferenceType extends ICDIDerivedType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java deleted file mode 100644 index 4a761f71635..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; - -/** - */ -public interface ICDIReferenceValue extends ICDIDerivedValue { - - long referenceValue() throws CDIException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortType.java deleted file mode 100644 index 450a9d6605f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIShortType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortValue.java deleted file mode 100644 index b4c26116040..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIShortValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the value of a variable. - * - * @since April 15, 2003 - */ -public interface ICDIShortValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructType.java deleted file mode 100644 index 25d820f37e5..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructType.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIStructType extends ICDIAggregateType { - - boolean isClass(); - - boolean isStruct(); - - boolean isUnion(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructValue.java deleted file mode 100644 index 5169aa99dea..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIStructValue.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIStructValue extends ICDIAggregateValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIType.java deleted file mode 100644 index 9bc2515c822..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIType extends ICDIObject { - - /** - * Returns the name. - * - * @return the name of the data type - * @throws CDIException if this method fails. - */ - String getTypeName(); - - /** - * Returns a more desciptive name. - * @return - */ - String getDetailTypeName(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIVoidType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIVoidType.java deleted file mode 100644 index 15ca9347fbd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIVoidType.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - - - -/** - * - * Represents the type of a variable. - * - * @since Apr 15, 2003 - */ -public interface ICDIVoidType extends ICDIType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharType.java deleted file mode 100644 index a9c042fa2f4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharType.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.cdi.model.type; - -/** - */ -public interface ICDIWCharType extends ICDIIntegralType { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharValue.java deleted file mode 100644 index 93db900fd58..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/model/type/ICDIWCharValue.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.cdi.model.type; - -/** - */ -public interface ICDIWCharValue extends ICDIIntegralValue { - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICAddressBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICAddressBreakpoint.java deleted file mode 100644 index 3c310252706..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICAddressBreakpoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.CoreException; - -/** - * - * A breakpoint that suspend execution when a particular address is reached. - * - * @since Aug 21, 2002 - */ -public interface ICAddressBreakpoint extends ICLineBreakpoint -{ - /** - * Breakpoint attribute storing the address this breakpoint suspends - * execution at (value "org.eclipse.cdt.debug.core.address"). - * This attribute is a String. - */ - public static final String ADDRESS = "org.eclipse.cdt.debug.core.address"; //$NON-NLS-1$ - - /** - * Returns the address this breakpoint suspends execution at. - * - * @return the address this breakpoint suspends execution at - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public String getAddress() throws CoreException; - - /** - * Sets the address this breakpoint suspends execution at. - * - * @param address the address this breakpoint suspends execution at - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public void setAddress( String address ) throws CoreException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java deleted file mode 100644 index db19c677d8e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICBreakpoint.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.IBreakpoint; - -/** - * - * A breakpoint specific to the C/C++ debug model. A C/C++ breakpoint supports: - *
              - *
            • a condition
            • - *
            • an ignore count
            • - *
            • a thread filter to restrict a breakpoin to a specific thread
            • - *
            • an installed property that indicates a breakpoint was successfully - * installed in debug target
            • - *
            - * - * @since Aug 21, 2002 - */ -public interface ICBreakpoint extends IBreakpoint -{ - /** - * Breakpoint attribute storing the number of debug targets a - * breakpoint is installed in (value "org.eclipse.cdt.debug.core.installCount"). - * This attribute is a int. - */ - public static final String INSTALL_COUNT = "org.eclipse.cdt.debug.core.installCount"; //$NON-NLS-1$ - - /** - * Breakpoint attribute storing the conditional expression - * associated with this breakpoint (value "org.eclipse.cdt.debug.core.condition"). - * This attribute is a String. - */ - public static final String CONDITION = "org.eclipse.cdt.debug.core.condition"; //$NON-NLS-1$ - - /** - * Breakpoint attribute storing a breakpoint's ignore count value - * (value "org.eclipse.cdt.debug.core.ignoreCount"). - * This attribute is a int. - */ - public static final String IGNORE_COUNT = "org.eclipse.cdt.debug.core.ignoreCount"; //$NON-NLS-1$ - - /** - * Breakpoint attribute storing an identifier of the thread this - * breakpoint is restricted in (value "org.eclipse.cdt.debug.core.threadId"). - * This attribute is a String. - */ - public static final String THREAD_ID = "org.eclipse.cdt.debug.core.threadId"; //$NON-NLS-1$ - - /** - * Returns whether this breakpoint is installed in at least - * one debug target. - * - * @return whether this breakpoint is installed - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public boolean isInstalled() throws CoreException; - - /** - * Returns whether this breakpoint is conditional. - * - * @return whether this breakpoint is conditional - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public boolean isConditional() throws CoreException; - - /** - * Returns the conditional expression associated with this breakpoint. - * - * @return this breakpoint's conditional expression - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public String getCondition() throws CoreException; - - /** - * Sets the condition associated with this breakpoint. - * - * @param condition the conditional expression - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public void setCondition( String condition ) throws CoreException; - - /** - * Returns the ignore count used by this breakpoint. - * - * @return the ignore count used by this breakpoint - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public int getIgnoreCount() throws CoreException; - - /** - * Sets the ignore count attribute for this breakpoint. - * - * @param ignoreCount the new ignore count - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public void setIgnoreCount( int ignoreCount ) throws CoreException; - - /** - * Returns the identifier of the thread this breakpoint is restricted in. - * - * @return the thread identifier - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public String getThreadId() throws CoreException; - - /** - * Restricts this breakpoint to suspend only in the given thread - * when encounterd in the given thread's target. - * - * @param threadId the thread identifier - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public void setThreadId( String threadId ) throws CoreException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugElementErrorStatus.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugElementErrorStatus.java deleted file mode 100644 index 0cfa2f52e25..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugElementErrorStatus.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -/** - * Represents the status of a debug element. - * - * @since May 2, 2003 - */ -public interface ICDebugElementErrorStatus -{ - public static final int OK = 0; - public static final int WARNING = 1; - public static final int ERROR = 2; - - boolean isOK(); - - int getSeverity(); - - String getMessage(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java deleted file mode 100644 index e64a882d8ed..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * A C/C++ specific extension of IDebugTarget. - * - * @since: Dec 2, 2002 - */ -public interface ICDebugTarget extends IDebugTarget, - ICDebugTargetType, - ICExpressionEvaluator, - IDebuggerProcessSupport, - IExecFileInfo, - IRestart, - IRunToLine, - IRunToAddress, - IJumpToLine, - IJumpToAddress, - IResumeWithoutSignal, - IState, - ISwitchToThread -{ -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTargetType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTargetType.java deleted file mode 100644 index 46cbf1d4dfd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTargetType.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.cdt.debug.core.model; - -/** - * - * Enter type comment. - * - * @since: Sep 30, 2002 - */ -public interface ICDebugTargetType -{ - public static final int TARGET_TYPE_UNKNOWN = 0; - public static final int TARGET_TYPE_LOCAL_RUN = 1; - public static final int TARGET_TYPE_LOCAL_ATTACH = 2; - public static final int TARGET_TYPE_LOCAL_CORE_DUMP = 3; - - /** - * Returns the type of this target. - * - * @return the type of this target - */ - int getTargetType(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICExpressionEvaluator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICExpressionEvaluator.java deleted file mode 100644 index bfbc6c90ca0..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICExpressionEvaluator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * - * Supports the evaluation of C/C++ expressions. - * - * @since Sep 13, 2002 - */ -public interface ICExpressionEvaluator -{ - /** - * Evaluates the specified expression and returns evaluation result - * as a string. - * - * @param expression the expression to evaluate - * @return the evaluation result - * @throws DebugException on failure. Reasons include: - */ - String evaluateExpressionToString( String expression ) throws DebugException; - - /** - * Returns whether this object can currently evaluate an expression. - * - * @return whether this object can currently evaluate an expression - */ - boolean canEvaluate(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICFunctionBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICFunctionBreakpoint.java deleted file mode 100644 index 8cd39de5304..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICFunctionBreakpoint.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.CoreException; - -/** - * - * A breakpoint that suspend execution when a function is entered. - * - * @since Aug 21, 2002 - */ -public interface ICFunctionBreakpoint extends ICLineBreakpoint -{ - /** - * Breakpoint attribute storing the function this breakpoint suspends - * execution at (value "org.eclipse.cdt.debug.core.function"). - * This attribute is a String. - */ - public static final String FUNCTION = "org.eclipse.cdt.debug.core.function"; //$NON-NLS-1$ - - /** - * Returns the function this breakpoint suspends execution in. - * - * @return the function this breakpoint suspends execution in - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public String getFunction() throws CoreException; - - /** - * Sets the function this breakpoint suspends execution in. - * - * @param function the function this breakpoint suspends execution in - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public void setFunction( String function ) throws CoreException; - - public String getFileName() throws CoreException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint.java deleted file mode 100644 index c7dfa742d45..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICLineBreakpoint.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.model.ILineBreakpoint; - -/** - * - * A breakpoint that suspend execution when a particular line of code - * is reached. - * - * @since Aug 21, 2002 - */ -public interface ICLineBreakpoint extends ICBreakpoint, ILineBreakpoint -{ -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java deleted file mode 100644 index c4676ad7c7a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; - -/** - * Enter type comment. - * - * @since: Jan 15, 2003 - */ -public interface ICSharedLibrary extends IDebugElement -{ - /** - * Returns the name of shared library file. - * - * @return the name of shared library file - */ - String getFileName(); - - /** - * Returns the start address of this library. - * - * @return the start address of this library - */ - long getStartAddress(); - - /** - * Returns the end address of this library. - * - * @return the end address of this library - */ - long getEndAddress(); - - /** - * Returns whether the symbols of this library are read. - * - * @return whether the symbols of this library are read - */ - boolean areSymbolsLoaded(); - - /** - * Loads the library symbols. - * - * @throws DebugException if this method fails. Reasons include: - */ - void loadSymbols() throws DebugException; - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSignal.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSignal.java deleted file mode 100644 index 3ab35fc1567..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICSignal.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; - -/** - * Enter type comment. - * - * @since: Jan 31, 2003 - */ -public interface ICSignal extends IDebugElement -{ - String getName(); - - String getDescription(); - - boolean isPassEnabled(); - - boolean isStopEnabled(); - - void setPassEnabled( boolean enable ) throws DebugException; - - void setStopEnabled( boolean enable ) throws DebugException; - - void signal() throws DebugException; - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICType.java deleted file mode 100644 index c963d3e6ba2..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICType.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.IAdaptable; - -/** - * Enter type comment. - * - * @since Jun 10, 2003 - */ -public interface ICType extends IAdaptable -{ - String getName(); - - boolean isArray(); - - int[] getArrayDimensions(); - - boolean isStructure(); - - boolean isCharacter(); - - boolean isFloatingPointType(); - - boolean isPointer(); - - boolean isReference(); - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICValue.java deleted file mode 100644 index 32a1f3fe4a4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.model.IValue; - -/** - * - * Extends the IValue interface by C/C++ specific functionality. - * - * @since Sep 9, 2002 - */ -public interface ICValue extends IValue -{ - String evaluateAsExpression(); - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICVariable.java deleted file mode 100644 index c432f0a6a0d..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICVariable.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IVariable; - -/** - * - * Enter type comment. - * - * @since Dec 15, 2002 - */ -public interface ICVariable extends IVariable -{ - int getFormat(); - - void setFormat( int format ) throws DebugException; - - ICType getType() throws DebugException; - - boolean isEditable(); - - boolean hasChildren(); - - boolean isEnabled(); - - void setEnabled( boolean enabled ) throws DebugException; - - boolean canEnableDisable(); - - boolean isArgument(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICWatchpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICWatchpoint.java deleted file mode 100644 index f517cb02411..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICWatchpoint.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.CoreException; - -/** - * - * A watchpoint specific to the C/C++ debug model. - * - * @since Sep 4, 2002 - */ -public interface ICWatchpoint extends ICBreakpoint -{ - /** - * Watchpoint attribute storing the expression associated with this - * watchpoint (value "org.eclipse.cdt.debug.core.expression"). - * This attribute is a String. - */ - public static final String EXPRESSION = "org.eclipse.cdt.debug.core.expression"; //$NON-NLS-1$ - - /** - * Write access watchpoint attribute (value "org.eclipse.cdt.debug.core.write"). - * This attribute is a boolean. - */ - public static final String WRITE = "org.eclipse.cdt.debug.core.write"; //$NON-NLS-1$ - - /** - * Read access watchpoint attribute (value "org.eclipse.cdt.debug.core.read"). - * This attribute is a boolean. - */ - public static final String READ = "org.eclipse.cdt.debug.core.read"; //$NON-NLS-1$ - - /** - * Returns whether this watchppoint is a write watchpoint. - * - * @return whether this watchppoint is a write watchpoint - */ - boolean isWriteType() throws CoreException; - - /** - * Returns whether this watchppoint is a read watchpoint. - * - * @return whether this watchppoint is a read watchpoint - */ - boolean isReadType() throws CoreException; - - /** - * Returns the watchpoint's expression. - * - * @return the expression of this watchpoint - * @throws CDIException if this method fails. Reasons include: - */ - String getExpression() throws CoreException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToArray.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToArray.java deleted file mode 100644 index 554f416a99c..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToArray.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since Mar 10, 2003 - */ -public interface ICastToArray extends ICastToType -{ - boolean supportsCastToArray(); - - void castToArray( int startIndex, int length ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToType.java deleted file mode 100644 index 90e3d4bd39f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToType.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since Mar 7, 2003 - */ -public interface ICastToType extends IAdaptable -{ - boolean supportsCasting(); - - String getCurrentType(); - - void cast( String type ) throws DebugException; - - void restoreDefault() throws DebugException; - - boolean isCasted(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDebuggerProcessSupport.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDebuggerProcessSupport.java deleted file mode 100644 index ebd4f02e005..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDebuggerProcessSupport.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -/** - * Provides the functionality to support debugger console. - * - * @since: Oct 23, 2002 - */ -public interface IDebuggerProcessSupport -{ - boolean supportsDebuggerProcess(); - - boolean isDebuggerProcessDefault(); - - void setDebuggerProcessDefault( boolean value ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDummyStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDummyStackFrame.java deleted file mode 100644 index 815909d7e5f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IDummyStackFrame.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -/** - * Enter type comment. - * - * @since: Nov 13, 2002 - */ -public interface IDummyStackFrame -{ -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IExecFileInfo.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IExecFileInfo.java deleted file mode 100644 index 185200fbbe7..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IExecFileInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.resources.IFile; - -/** - * Provides access to executable file information. - * - * @since: Nov 1, 2002 - */ -public interface IExecFileInfo -{ - public IFile getExecFile(); - - public boolean isLittleEndian(); - - public IGlobalVariable[] getGlobals(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java deleted file mode 100644 index 67ec19da326..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IMemoryBlock; - -/** - * - * A contiguos segment of memory in an execution context represented - * as a table of values. - * - * @since Jul 31, 2002 - */ -public interface IFormattedMemoryBlock extends IMemoryBlock -{ - public static final int MEMORY_SIZE_BYTE = 1; - public static final int MEMORY_SIZE_HALF_WORD = 2; - public static final int MEMORY_SIZE_WORD = 4; - public static final int MEMORY_SIZE_DOUBLE_WORD = 8; - public static final int MEMORY_SIZE_FLOAT = 8; - public static final int MEMORY_SIZE_DOUBLE_FLOAT = 16; - - public static final int MEMORY_FORMAT_HEX = 0; - public static final int MEMORY_FORMAT_BINARY = 1; - public static final int MEMORY_FORMAT_OCTAL = 2; - public static final int MEMORY_FORMAT_SIGNED_DECIMAL = 3; - public static final int MEMORY_FORMAT_UNSIGNED_DECIMAL = 4; - - public static final int MEMORY_NUMBER_OF_COLUMNS_1 = 1; - public static final int MEMORY_NUMBER_OF_COLUMNS_2 = 2; - public static final int MEMORY_NUMBER_OF_COLUMNS_4 = 4; - public static final int MEMORY_NUMBER_OF_COLUMNS_8 = 8; - public static final int MEMORY_NUMBER_OF_COLUMNS_16 = 16; - - /** - * Returns the address expression specified to obtain this memory block. - * - * @return the address expression - */ - public String getAddressExpression(); - - /** - * Returns the format of the memory words of this block. - * - * @return The format of the memory words of this block - */ - int getFormat(); - - /** - * Returns the size of each memory word in bytes. - * - * @return the size of each memory word in bytes - */ - int getWordSize(); - - /** - * Returns the number of rows in the output table. - * - * @return the number of rows in the output table - */ - int getNumberOfRows(); - - /** - * Returns the number of columns in the output table. - * - * @return the number of columns in the output table - */ - int getNumberOfColumns(); - - /** - * Returns whether each row should include an ASCII dump. - * - * @return whether each row should include an ASCII dump - */ - boolean displayASCII(); - - /** - * Returns the array of rows. - * - * @return the array of rows - */ - IFormattedMemoryBlockRow[] getRows(); - - - /** - * Sets the value of data item in this block at the specified - * index within this block to the spcified value. - * The index is zero based. - * - * @param index the index of item to change - * @param newValue the new value - * @throws DebugException if this method fails. Reasons include: - */ - void setItemValue( int index, String newValue ) throws DebugException; - - char getPaddingCharacter(); - - long nextRowAddress(); - - long previousRowAddress(); - - long nextPageAddress(); - - long previousPageAddress(); - - void reformat( int format, - int wordSize, - int numberOfRows, - int numberOfColumns ) throws DebugException; - - void reformat( int format, - int wordSize, - int numberOfRows, - int numberOfColumns, - char paddingChar ) throws DebugException; - void dispose(); - - Long[] getChangedAddresses(); - - boolean isFrozen(); - - void setFrozen( boolean frozen ); - - void refresh() throws DebugException; - - boolean canChangeFormat( int format ); - - boolean isLittleEndian(); - - boolean isStartAddressChanged(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java deleted file mode 100644 index 697c233be4d..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -/** - * - * Represents a row in the output table of formatted memory block. - * - * @since Jul 31, 2002 - */ -public interface IFormattedMemoryBlockRow -{ - /** - * Returns the address of this row. - * - * @return the address of this row - */ - long getAddress(); - - /** - * Returns the array of memory words. - * - * @return the array of memory words - */ - String[] getData(); - - /** - * Returns the ASCII dump for this row. - * - * @return the ASCII dump for this row - */ - String getASCII(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IGlobalVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IGlobalVariable.java deleted file mode 100644 index 1b488a9a27f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IGlobalVariable.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.runtime.IPath; - -/** - * Enter type comment. - * - * @since: Nov 4, 2002 - */ -public interface IGlobalVariable -{ - String getName(); - IPath getPath(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IInstructionStep.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IInstructionStep.java deleted file mode 100644 index 7011dc47c14..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IInstructionStep.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to step into and over machine instruction - * at the current execution location. - * - */ -public interface IInstructionStep -{ - /** - * Returns whether this element can currently perform a step - * into the instruction. - * - * @return whether this element can currently perform a step - * into the instruction - */ - boolean canStepIntoInstruction(); - - /** - * Returns whether this element can currently perform a step - * over the instruction (nexti command). - * - * @return whether this element can currently perform a step - * over the instruction - */ - boolean canStepOverInstruction(); - - /** - * Steps into the current instruction. - * - * @exception DebugException on failure. Reasons include:
              - *
            - */ - void stepIntoInstruction() throws DebugException; - - /** - * Steps over the current instruction. - * - * @exception DebugException on failure. Reasons include:
              - *
            - */ - void stepOverInstruction() throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java deleted file mode 100644 index 44393704a47..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to resume a debug target at the given address. - * - * @since: Feb 5, 2003 - */ -public interface IJumpToAddress -{ - /** - * Returns whether this operation is currently available for this element. - * - * @return whether this operation is currently available - */ - public boolean canJumpToAddress( long address ); - - /** - * Causes this element to resume the execution at the specified address. - * - * @exception DebugException on failure. Reasons include: - */ - public void jumpToAddress( long address ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToLine.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToLine.java deleted file mode 100644 index b5d6a125ce4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IJumpToLine.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.resources.IFile; -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to resume a debug target at the given line. - * - * @since: Feb 5, 2003 - */ -public interface IJumpToLine -{ - /** - * Returns whether this operation is currently available for this file and line number. - * - * @return whether this operation is currently available - */ - public boolean canJumpToLine( IFile file, int lineNumber ); - - /** - * Causes this element to resume the execution at the specified line. - * - * @exception DebugException on failure. Reasons include: - */ - public void jumpToLine( IFile file, int lineNumber ) throws DebugException; - - /** - * Returns whether this operation is currently available for this file and line number. - * - * @return whether this operation is currently available - */ - public boolean canJumpToLine( String fileName, int lineNumber ); - - /** - * Causes this element to resume the execution at the specified line. - * - * @exception DebugException on failure. Reasons include: - */ - public void jumpToLine( String fileName, int lineNumber ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRestart.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRestart.java deleted file mode 100644 index 8f77cc1a1e4..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRestart.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -/** - * Provides the ability to restart a debug target. - * - */ -public interface IRestart -{ - /** - * Returns whether this element can currently be restarted. - * - * @return whether this element can currently be restarted - */ - public boolean canRestart(); - - /** - * Causes this element to restart its execution. - * - * @exception DebugException on failure. Reasons include: - */ - public void restart() throws DebugException; -} - diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IResumeWithoutSignal.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IResumeWithoutSignal.java deleted file mode 100644 index 26699a8d24c..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IResumeWithoutSignal.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to resume execution without giving a signal. - * This is useful when the program stopped on account of a signal and would - * ordinary see the signal when resumed. - * - * @since: Feb 4, 2003 - */ -public interface IResumeWithoutSignal -{ - /** - * Causes this element to resume its execution ignoring a signal. - * Has no effect on an element that is not suspended because of a signal. - * - * @exception DebugException on failure. Reasons include: - */ - public void resumeWithoutSignal() throws DebugException; - - /** - * Returns whether this element can currently be resumed without signal. - * - * @return whether this element can currently be resumed without signal - */ - boolean canResumeWithoutSignal(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java deleted file mode 100644 index 04d1af7ba19..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToAddress.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * - * Provides the ability to run a debug target to the given address. - * - * @since Jan 13, 2003 - */ -public interface IRunToAddress -{ - /** - * Returns whether this operation is currently available for this element. - * - * @return whether this operation is currently available - */ - public boolean canRunToAddress( long address ); - - /** - * Causes this element to run to specified address. - * - * @exception DebugException on failure. Reasons include: - */ - public void runToAddress( long address ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToLine.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToLine.java deleted file mode 100644 index 3a90a066170..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IRunToLine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.core.resources.IFile; -import org.eclipse.debug.core.DebugException; - -/** - * - * Provides the ability to run a debug target to the given line. - * - * @since Sep 19, 2002 - */ -public interface IRunToLine -{ - /** - * Returns whether this operation is currently available for this file and line number. - * - * @return whether this operation is currently available - */ - public boolean canRunToLine( IFile file, int lineNumber ); - - /** - * Causes this element to run to specified location. - * - * @exception DebugException on failure. Reasons include: - */ - public void runToLine( IFile file, int lineNumber ) throws DebugException; - - /** - * Returns whether this operation is currently available for this file and line number. - * - * @return whether this operation is currently available - */ - public boolean canRunToLine( String fileName, int lineNumber ); - - /** - * Causes this element to run to specified location. - * - * @exception DebugException on failure. Reasons include: - */ - public void runToLine( String fileName, int lineNumber ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IStackFrameInfo.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IStackFrameInfo.java deleted file mode 100644 index b3b6c45e044..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IStackFrameInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.model.IVariable; - -/** - * - * Provides the access to the stack frame information. - * - * @since Aug 16, 2002 - */ -public interface IStackFrameInfo -{ - /** - * Returns the address of this stack frame. - * - * @return the address of this stack frame - */ - long getAddress(); - - /** - * Returns the source file of this stack frame or null - * if the source file is unknown. - * - * @return the source file of this stack frame - */ - String getFile(); - - /** - * Returns the function of this stack frame or null - * if the function is unknown. - * - * @return the function of this stack frame - */ - String getFunction(); - - /** - * Returns the line number of this stack frame or 0 - * if the line number is unknown. - * - * @return the line number of this stack frame - */ - int getFrameLineNumber(); - - /** - * Returns the level of this stack frame. - * - * @return the level of this stack frame - */ - int getLevel(); - - /** - * Returns the arguments of this stack frame. - * - * @return the arguments of this stack frame - */ - IVariable[] getArguments(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IState.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IState.java deleted file mode 100644 index 42c237c0433..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IState.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.model; - -/** - * - * Represents the current state of debug element. - * - * @since Aug 6, 2002 - */ -public interface IState -{ - public static final int UNKNOWN = 0; - public static final int NOT_RESPONDING = 1; - public static final int STARTING = 2; - public static final int ATTACHING = 3; - public static final int DISCONNECTING = 4; - public static final int RUNNING = 5; - public static final int STEPPING = 6; - public static final int SUSPENDED = 7; - public static final int EXITED = 8; - public static final int DISCONNECTED = 9; - public static final int TERMINATED = 10; - public static final int CORE_DUMP_FILE = 11; - - /** - * Returns the identifier of the current state. - * - * @return the identifier of the current state - */ - int getCurrentStateId(); - - /** - * Returns the info object associated with the current state. - * - * @return the info object associated with the current state - */ - Object getCurrentStateInfo(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToFrame.java deleted file mode 100644 index 81b7d1cd19b..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToFrame.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IStackFrame; - -/** - * - * Enter type comment. - * - * @since Sep 20, 2002 - */ -public interface ISwitchToFrame -{ - void switchToFrame( IStackFrame frame ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToThread.java deleted file mode 100644 index 4e895c71eaa..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ISwitchToThread.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IThread; - -/** - * - * Enter type comment. - * - * @since Sep 20, 2002 - */ -public interface ISwitchToThread -{ - IThread getCurrentThread() throws DebugException; - void setCurrentThread( IThread thread ) throws DebugException; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocation.java deleted file mode 100644 index e3eaf285078..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocation.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; - -/** - * - * A source location defines the location of a repository - * of source code. A source location is capable of retrieving - * source elements. - *

            - * For example, a source location could be a project, zip/archive - * file, or a directory in the file system. - *

            - * - * @since Sep 23, 2002 - */ -public interface ICSourceLocation extends IAdaptable -{ - /** - * Returns an object representing the source code - * for a file with the specified name, or null - * if none could be found. The source element - * returned is implementation specific - for example, a - * resource, a local file, a zip file entry, etc. - * - * @param name the name of the object for which source is being searched for - * - * @return source element - * @exception CoreException if an exception occurs while searching for the specified source element - */ - Object findSourceElement( String name ) throws CoreException; - - /** - * Returns a memento for this source location from which this - * source location can be reconstructed. - * - * @return a memento for this source location - * @exception CoreException if unable to create a memento - */ - String getMemento() throws CoreException; - - /** - * Initializes this source location from the given memento. - * - * @param memento a memento generated by this source location - * @exception CoreException if unable to initialize this source - * location - */ - void initializeFrom( String memento ) throws CoreException; - - /** - * Returns whether to search for all source elements, or just the first match. - * - * @return whether to search for all source elements, or just the first match - */ - boolean searchForDuplicateFiles(); - - /** - * Sets the value of the 'search for duplicate source files' flag. - * - * @param search - a value to set - */ - void setSearchForDuplicateFiles( boolean search ); - - void dispose(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocator.java deleted file mode 100644 index 9b5a2383b21..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ICSourceLocator.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.sourcelookup; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.debug.core.model.ISourceLocator; -import org.eclipse.debug.core.model.IStackFrame; - -/** - * - * A C/C++ extension of ISourceLocator. - * Provides constants and methods to manage different source modes. - * - * @since Aug 19, 2002 - */ -public interface ICSourceLocator extends ISourceLocator -{ - /** - * Returns the project this source locator is associated with or null. - * - * @return project this source locator is associated with or null - */ - IProject getProject(); - - /** - * Returns the line number of the instruction pointer in the specified - * stack frame that corresponds to a line in an associated source element, - * or -1 if line number information is unavailable. - * - * @param frameInfo the frame data - * @return line number of instruction pointer in this stack frame, - * or -1 if line number information is unavailable - */ - int getLineNumber( IStackFrame stackFrame ); - - /** - * Returns the source locations of this locator. - * - * @return the source locations of this locator - */ - ICSourceLocation[] getSourceLocations(); - - /** - * Sets the source locations of this locator. - * - * @param location - an array of source locations - */ - void setSourceLocations( ICSourceLocation[] locations ); - - /** - * Returns whether this locator is able to locate the given resource. - * - * @param resource the resource to locate - * @return whether this locator is able to locate the given resource - */ - boolean contains( IResource resource ); - - /** - * Returns an object representing the source code - * for a type with the specified name, or null - * if none could be found. The source element - * returned is implementation specific - for example, a - * resource, a local file, a zip file entry, etc. - * - * @param name the name of the object for which source is being searched for - * - * @return source element - */ - Object findSourceElement( String fileName ); - - /** - * Returns whether to search for all source elements, or just the first match. - * - * @return whether to search for all source elements, or just the first match - */ - boolean searchForDuplicateFiles(); - - /** - * Sets the value of the 'search for duplicate source files' flag. - * - * @param search - a value to set - */ - void setSearchForDuplicateFiles( boolean search ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDirectorySourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDirectorySourceLocation.java deleted file mode 100644 index 1b4ff0c0e54..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDirectorySourceLocation.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.sourcelookup; - -import org.eclipse.core.runtime.IPath; - -/** - * - * Enter type comment. - * - * @since Dec 24, 2002 - */ -public interface IDirectorySourceLocation extends ICSourceLocation -{ - IPath getDirectory(); - - IPath getAssociation(); - - boolean searchSubfolders(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDisassemblyStorage.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDisassemblyStorage.java deleted file mode 100644 index 809c7fd6c61..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IDisassemblyStorage.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.sourcelookup; - -import org.eclipse.core.resources.IStorage; -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * Defines methods specific to disassembly. - * - * @since: Oct 8, 2002 - */ -public interface IDisassemblyStorage extends IStorage -{ - /** - * Returns the debug target of this disassembly. - * - * @return the debug target of this disassembly - */ - IDebugTarget getDebugTarget(); - - /** - * Returns whether this storage contains the instructions at given address. - * - * @param address - an address - * @return whether this storage contains the instructions at given address - */ - boolean containsAddress( long address ); - - /** - * Returns the line number for given address. - * @param address - an address - * @return the line number for given address - */ - int getLineNumber( long address ) ; - - /** - * Returns the address of instruction at given line. - * @param lineNumber - a line number - * @return the address of instruction at given line - */ - long getAddress( int lineNumber ) ; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IProjectSourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IProjectSourceLocation.java deleted file mode 100644 index ddb9ed278fb..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/IProjectSourceLocation.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.core.sourcelookup; - -import org.eclipse.core.resources.IProject; - -/** - * - * Enter type comment. - * - * @since Dec 24, 2002 - */ -public interface IProjectSourceLocation extends ICSourceLocation -{ - IProject getProject(); - - boolean isGeneric(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ISourceMode.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ISourceMode.java deleted file mode 100644 index 3e52c07fb24..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/ISourceMode.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.sourcelookup; - -/** - * Defines constatnts and methods to set the source presentation mode. - * - * @since: Oct 8, 2002 - */ -public interface ISourceMode -{ - static final public int MODE_SOURCE = 0; - static final public int MODE_DISASSEMBLY = 1; - static final public int MODE_MIXED = 2; - - /** - * Returns the current source presentation mode. - * - * @return the current source presentation mode - */ - int getMode(); - - /** - * Sets the source presentation mode. - * - * @param the source presentation mode to set - */ - void setMode( int mode ); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java deleted file mode 100644 index b3e6471443a..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/sourcelookup/SourceLookupFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.core.sourcelookup; - -import org.eclipse.cdt.debug.internal.core.sourcelookup.CDirectorySourceLocation; -import org.eclipse.cdt.debug.internal.core.sourcelookup.CProjectSourceLocation; -import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLocator; -import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; - -/** - * Enter type comment. - * - * @since Jul 14, 2003 - */ -public class SourceLookupFactory -{ - public static IProjectSourceLocation createProjectSourceLocation( IProject project ) - { - return new CProjectSourceLocation( project ); - } - - public static IProjectSourceLocation createProjectSourceLocation( IProject project, boolean generated ) - { - return new CProjectSourceLocation( project, generated ); - } - - public static IDirectorySourceLocation createDirectorySourceLocation( IPath directory, IPath association, boolean searchSubfolders ) - { - return new CDirectorySourceLocation( directory, association, searchSubfolders ); - } - - public static ICSourceLocator createSourceLocator( IProject project ) - { - return new CSourceManager( new CSourceLocator( project ) ); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java deleted file mode 100644 index 8a2a2801715..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java +++ /dev/null @@ -1,739 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core; - -import java.util.HashMap; -import java.util.Set; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDICondition; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.core.model.ICDebugTarget; -import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; -import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; -import org.eclipse.cdt.debug.core.model.ICWatchpoint; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.ISourceLocator; - -/** - * Enter type comment. - * - * @since Nov 3, 2003 - */ -public class CBreakpointManager implements ICBreakpointManager, ICDIEventListener, IAdaptable -{ - public class BreakpointMap - { - /** - * Maps CBreakpoints to CDI breakpoints. - */ - private HashMap fCBreakpoints; - - /** - * Maps CDI breakpoints to CBreakpoints. - */ - private HashMap fCDIBreakpoints; - - protected BreakpointMap() - { - fCBreakpoints = new HashMap( 10 ); - fCDIBreakpoints = new HashMap( 10 ); - } - - protected synchronized void put( ICBreakpoint breakpoint, ICDIBreakpoint cdiBreakpoint ) - { - fCBreakpoints.put( breakpoint, cdiBreakpoint ); - fCDIBreakpoints.put( cdiBreakpoint, breakpoint ); - } - - protected synchronized ICDIBreakpoint getCDIBreakpoint( ICBreakpoint breakpoint ) - { - return (ICDIBreakpoint)fCBreakpoints.get( breakpoint ); - } - - protected synchronized ICBreakpoint getCBreakpoint( ICDIBreakpoint cdiBreakpoint ) - { - return (ICBreakpoint)fCDIBreakpoints.get( cdiBreakpoint ); - } - - protected void removeCBreakpoint( ICBreakpoint breakpoint ) - { - if ( breakpoint != null ) - { - ICDIBreakpoint cdiBreakpoint = (ICDIBreakpoint)fCBreakpoints.remove( breakpoint ); - if ( cdiBreakpoint != null ) - fCDIBreakpoints.remove( cdiBreakpoint ); - } - } - - protected void removeCDIBreakpoint( ICBreakpoint breakpoin, ICDIBreakpoint cdiBreakpoint ) - { - if ( cdiBreakpoint != null ) - { - ICBreakpoint breakpoint = (ICBreakpoint)fCDIBreakpoints.remove( cdiBreakpoint ); - if ( breakpoint != null ) - fCBreakpoints.remove( breakpoint ); - } - } - - protected ICBreakpoint[] getAllCBreakpoints() - { - Set set = fCBreakpoints.keySet(); - return (ICBreakpoint[])set.toArray( new ICBreakpoint[set.size()]); - } - - protected ICDIBreakpoint[] getAllCDIBreakpoints() - { - Set set = fCDIBreakpoints.keySet(); - return (ICDIBreakpoint[])set.toArray( new ICDIBreakpoint[set.size()]); - } - - protected void dispose() - { - fCBreakpoints.clear(); - fCDIBreakpoints.clear(); - } - } - - private CDebugTarget fDebugTarget; - - private BreakpointMap fMap; - - public CBreakpointManager( CDebugTarget target ) - { - super(); - setDebugTarget( target ); - fMap = new BreakpointMap(); - getDebugTarget().getCDISession().getEventManager().addEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( CBreakpointManager.class.equals( adapter ) ) - return this; - if ( CDebugTarget.class.equals( adapter ) ) - return getDebugTarget(); - if ( ICDebugTarget.class.equals( adapter ) ) - return getDebugTarget(); - if ( IDebugTarget.class.equals( adapter ) ) - return getDebugTarget(); - return null; - } - - public CDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - private void setDebugTarget( CDebugTarget target ) - { - fDebugTarget = target; - } - - protected ICDIBreakpointManager getCDIBreakpointManager() - { - return getDebugTarget().getCDISession().getBreakpointManager(); - } - - protected ICSourceLocator getCSourceLocator() - { - ISourceLocator locator = getDebugTarget().getLaunch().getSourceLocator(); - if ( locator instanceof IAdaptable ) - return (ICSourceLocator)((IAdaptable)locator).getAdapter( ICSourceLocator.class ); - return null; - } - - public void dispose() - { - getDebugTarget().getCDISession().getEventManager().removeEventListener( this ); - removeAllBreakpoints(); - getBreakpointMap().dispose(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - ICDIObject source = event.getSource(); - if ( source != null && source.getTarget().equals( getDebugTarget().getCDITarget() ) ) - { - if ( event instanceof ICDICreatedEvent ) - { - if ( source instanceof ICDIBreakpoint ) - handleBreakpointCreatedEvent( (ICDIBreakpoint)source ); - } - else if ( event instanceof ICDIDestroyedEvent ) - { - if ( source instanceof ICDIBreakpoint ) - handleBreakpointDestroyedEvent( (ICDIBreakpoint)source ); - } - else if ( event instanceof ICDIChangedEvent ) - { - if ( source instanceof ICDIBreakpoint ) - handleBreakpointChangedEvent( (ICDIBreakpoint)source ); - } - } - } - - public boolean isTargetBreakpoint( ICBreakpoint breakpoint ) - { - IResource resource = breakpoint.getMarker().getResource(); - if ( breakpoint instanceof ICAddressBreakpoint ) - return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ); - if ( breakpoint instanceof ICLineBreakpoint ) - { - ICSourceLocator sl = getSourceLocator(); - if ( sl != null ) - return sl.contains( resource ); - } - else - { - IProject project = resource.getProject(); - if ( project != null && project.exists() ) - { - ICSourceLocator sl = getSourceLocator(); - if ( sl != null ) - return sl.contains( project ); - else - { - if ( project.equals( getExecFile().getProject() ) ) - return true; - return CDebugUtils.isReferencedProject( getExecFile().getProject(), project ); - } - } - } - return true; - } - - public boolean isCDIRegistered( ICBreakpoint breakpoint ) - { - return ( getBreakpointMap().getCDIBreakpoint( breakpoint ) != null ); - } - - public boolean supportsAddressBreakpoint( ICAddressBreakpoint breakpoint ) - { - return ( getExecFile() != null && - getExecFile().getLocation().toOSString().equals( breakpoint.getMarker().getResource().getLocation().toOSString() ) ); - } - - public IFile getCDIBreakpointFile( ICDIBreakpoint cdiBreakpoint ) - { - IBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( cdiBreakpoint ); - if ( breakpoint instanceof ICLineBreakpoint && !(breakpoint instanceof ICAddressBreakpoint) ) - { - IResource resource = ((ICLineBreakpoint)breakpoint).getMarker().getResource(); - if ( resource instanceof IFile ) - return (IFile)resource; - } - return null; - } - - public ICBreakpoint getBreakpoint( ICDIBreakpoint cdiBreakpoint ) - { - return getBreakpointMap().getCBreakpoint( cdiBreakpoint ); - } - - public long getBreakpointAddress( ICBreakpoint breakpoint ) - { - if ( breakpoint != null ) - { - ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); - if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) - { - try - { - ICDILocation location = ((ICDILocationBreakpoint)cdiBreakpoint).getLocation(); - if ( location != null ) - return location.getAddress(); - } - catch( CDIException e ) - { - } - } - } - return 0; - } - - public void setBreakpoint( final ICBreakpoint breakpoint ) throws DebugException - { - Runnable runnable = new Runnable() - { - public void run() - { - try - { - doSetBreakpoint( breakpoint ); - } - catch( DebugException e ) - { - } - } - }; - CDebugCorePlugin.getDefault().asyncExec( runnable ); - } - - protected void doSetBreakpoint( ICBreakpoint breakpoint ) throws DebugException - { - try - { - ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); - if ( cdiBreakpoint == null ) - { - if ( breakpoint instanceof ICFunctionBreakpoint ) - cdiBreakpoint = setFunctionBreakpoint( (ICFunctionBreakpoint)breakpoint ); - else if ( breakpoint instanceof ICAddressBreakpoint ) - cdiBreakpoint = setAddressBreakpoint( (ICAddressBreakpoint)breakpoint ); - else if ( breakpoint instanceof ICLineBreakpoint ) - cdiBreakpoint = setLineBreakpoint( (ICLineBreakpoint)breakpoint ); - else if ( breakpoint instanceof ICWatchpoint ) - cdiBreakpoint = setWatchpoint( (ICWatchpoint)breakpoint ); - } - if ( cdiBreakpoint == null ) - return; - if ( !breakpoint.isEnabled() ) - cdiBreakpoint.setEnabled( false ); - setBreakpointCondition( breakpoint ); - } - catch( CoreException e ) - { - requestFailed( "Set breakpoint failed. Reason: " + e.getMessage(), e ); - } - catch( NumberFormatException e ) - { - requestFailed( "Set breakpoint failed. Reason: " + e.getMessage(), e ); - } - catch( CDIException e ) - { - targetRequestFailed( "Set breakpoint failed. Reason: " + e.getMessage(), e ); - } - } - - public void removeBreakpoint( final ICBreakpoint breakpoint ) throws DebugException - { - Runnable runnable = new Runnable() - { - public void run() - { - try - { - doRemoveBreakpoint( breakpoint ); - } - catch( DebugException e ) - { - } - } - }; - CDebugCorePlugin.getDefault().asyncExec( runnable ); - } - - protected void doRemoveBreakpoint( ICBreakpoint breakpoint ) throws DebugException - { - ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); - if ( cdiBreakpoint != null ) - { - ICDIBreakpointManager bm = getCDIBreakpointManager(); - try - { - bm.deleteBreakpoints( new ICDIBreakpoint[] { cdiBreakpoint } ); - } - catch( CDIException e ) - { - targetRequestFailed( "Delete breakpoint failed. Reason: " + e.getMessage(), e ); - } - } - } - - public void changeBreakpointProperties( final ICBreakpoint breakpoint, final IMarkerDelta delta ) throws DebugException - { - Runnable runnable = new Runnable() - { - public void run() - { - try - { - doChangeBreakpointProperties( breakpoint, delta ); - } - catch( DebugException e ) - { - } - } - }; - CDebugCorePlugin.getDefault().asyncExec( runnable ); - } - - protected void doChangeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException - { - ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); - if ( cdiBreakpoint == null ) - return; - ICDIBreakpointManager bm = getCDIBreakpointManager(); - try - { - boolean enabled = breakpoint.isEnabled(); - boolean oldEnabled = delta.getAttribute( IBreakpoint.ENABLED, true ); - int ignoreCount = breakpoint.getIgnoreCount(); - int oldIgnoreCount = delta.getAttribute( ICBreakpoint.IGNORE_COUNT, 0 ); - String condition = breakpoint.getCondition(); - String oldCondition = delta.getAttribute( ICBreakpoint.CONDITION, "" ); - if ( enabled != oldEnabled ) - { - cdiBreakpoint.setEnabled( enabled ); - } - if ( ignoreCount != oldIgnoreCount || !condition.equals( oldCondition ) ) - { - ICDICondition cdiCondition = bm.createCondition( ignoreCount, condition ); - cdiBreakpoint.setCondition( cdiCondition ); - } - } - catch( CoreException e ) - { - requestFailed( "Change breakpoint properties failed. Reason: " + e.getMessage(), e ); - } - catch( CDIException e ) - { - targetRequestFailed( "Change breakpoint properties failed. Reason: " + e.getMessage(), e ); - } - } - - private void handleBreakpointCreatedEvent( final ICDIBreakpoint cdiBreakpoint ) - { - Runnable runnable = new Runnable() - { - public void run() - { - if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) - doHandleLocationBreakpointCreatedEvent( (ICDILocationBreakpoint)cdiBreakpoint ); - else if ( cdiBreakpoint instanceof ICDIWatchpoint ) - doHandleWatchpointCreatedEvent( (ICDIWatchpoint)cdiBreakpoint ); - } - }; - CDebugCorePlugin.getDefault().asyncExec( runnable ); - } - - protected void doHandleLocationBreakpointCreatedEvent( ICDILocationBreakpoint cdiBreakpoint ) - { - if ( cdiBreakpoint.isTemporary() ) - return; - ICBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( cdiBreakpoint ); - if ( breakpoint == null ) - { - try - { - if ( cdiBreakpoint.getLocation().getFile() != null && cdiBreakpoint.getLocation().getFile().length() > 0 ) - { - ICSourceLocator locator = getSourceLocator(); - if ( locator != null ) - { - Object sourceElement = locator.findSourceElement( cdiBreakpoint.getLocation().getFile() ); - if ( sourceElement != null && sourceElement instanceof IFile ) - { - breakpoint = createLineBreakpoint( (IFile)sourceElement, cdiBreakpoint ); - } - else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) - { - breakpoint = createAddressBreakpoint( cdiBreakpoint ); - } - } - } - else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) - { - breakpoint = createAddressBreakpoint( cdiBreakpoint ); - } - } - catch( CDIException e ) - { - } - catch( CoreException e ) - { - } - } - if ( breakpoint != null ) - { - try - { - ((CBreakpoint)breakpoint).incrementInstallCount(); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e.getStatus() ); - } - } - } - - protected void doHandleWatchpointCreatedEvent( ICDIWatchpoint cdiWatchpoint ) - { - ICBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( cdiWatchpoint ); - if ( breakpoint == null ) - { - try - { - breakpoint = CDebugModel.createWatchpoint( getExecFile().getProject(), - cdiWatchpoint.isWriteType(), - cdiWatchpoint.isReadType(), - cdiWatchpoint.getWatchExpression(), - cdiWatchpoint.isEnabled(), - cdiWatchpoint.getCondition().getIgnoreCount(), - cdiWatchpoint.getCondition().getExpression(), - false ); - getBreakpointMap().put( breakpoint, cdiWatchpoint ); - ((CBreakpoint)breakpoint).register( true ); - } - catch( CDIException e ) - { - } - catch( CoreException e ) - { - } - } - if ( breakpoint != null ) - { - try - { - ((CBreakpoint)breakpoint).incrementInstallCount(); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e.getStatus() ); - } - } - } - - private void handleBreakpointDestroyedEvent( final ICDIBreakpoint cdiBreakpoint ) - { - Runnable runnable = new Runnable() - { - public void run() - { - doHandleBreakpointDestroyedEvent( cdiBreakpoint ); - } - - }; - CDebugCorePlugin.getDefault().asyncExec( runnable ); - } - - protected void doHandleBreakpointDestroyedEvent( ICDIBreakpoint cdiBreakpoint ) - { - ICBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( cdiBreakpoint ); - if ( breakpoint != null ) - { - getBreakpointMap().removeCDIBreakpoint( breakpoint, cdiBreakpoint ); - try - { - ((CBreakpoint)breakpoint).decrementInstallCount(); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e.getStatus() ); - } - } - } - - private void handleBreakpointChangedEvent( final ICDIBreakpoint cdiBreakpoint ) - { - Runnable runnable = new Runnable() - { - public void run() - { - doHandleBreakpointChangedEvent( cdiBreakpoint ); - } - - }; - CDebugCorePlugin.getDefault().asyncExec( runnable ); - } - - protected void doHandleBreakpointChangedEvent( ICDIBreakpoint cdiBreakpoint ) - { - ICBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( cdiBreakpoint ); - if ( breakpoint != null ) - { - try - { - breakpoint.setEnabled( cdiBreakpoint.isEnabled() ); - breakpoint.setIgnoreCount( cdiBreakpoint.getCondition().getIgnoreCount() ); - breakpoint.setCondition( cdiBreakpoint.getCondition().getExpression() ); - } - catch( CDIException e ) - { - } - catch( CoreException e ) - { - } - } - } - - private void removeAllBreakpoints() - { - ICDIBreakpoint[] cdiBreakpoints = getBreakpointMap().getAllCDIBreakpoints(); - ICDIBreakpointManager bm = getCDIBreakpointManager(); - if ( cdiBreakpoints.length > 0 ) - { - try - { - bm.deleteBreakpoints( cdiBreakpoints ); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e.getMessage() ); - } - ICBreakpoint[] breakpoints = getBreakpointMap().getAllCBreakpoints(); - for ( int i = 0; i < breakpoints.length; ++i ) - { - try - { - ((CBreakpoint)breakpoints[i]).decrementInstallCount(); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e.getMessage() ); - } - } - } - } - - private synchronized ICDIBreakpoint setFunctionBreakpoint( ICFunctionBreakpoint breakpoint ) throws CDIException, CoreException - { - ICDIBreakpointManager bm = getCDIBreakpointManager(); - String function = breakpoint.getFunction(); - String fileName = ( function != null && function.indexOf( "::" ) == -1 ) ? breakpoint.getFileName() : null; - ICDILocation location = bm.createLocation( fileName, function, -1 ); - ICDIBreakpoint cdiBreakpoint = bm.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true ); - getBreakpointMap().put( breakpoint, cdiBreakpoint ); - return cdiBreakpoint; - } - - private synchronized ICDIBreakpoint setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException - { - ICDIBreakpointManager bm = getCDIBreakpointManager(); - ICDILocation location = bm.createLocation( Long.parseLong( breakpoint.getAddress() ) ); - ICDIBreakpoint cdiBreakpoint = bm.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true ); - getBreakpointMap().put( breakpoint, cdiBreakpoint ); - return cdiBreakpoint; - } - - private synchronized ICDIBreakpoint setLineBreakpoint( ICLineBreakpoint breakpoint ) throws CDIException, CoreException - { - ICDIBreakpointManager bm = getCDIBreakpointManager(); - ICDILocation location = bm.createLocation( breakpoint.getMarker().getResource().getLocation().lastSegment(), null, breakpoint.getLineNumber() ); - ICDIBreakpoint cdiBreakpoint = bm.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true ); - getBreakpointMap().put( breakpoint, cdiBreakpoint ); - return cdiBreakpoint; - } - - private synchronized ICDIBreakpoint setWatchpoint( ICWatchpoint watchpoint ) throws CDIException, CoreException - { - ICDIBreakpointManager bm = getCDIBreakpointManager(); - int accessType = 0; - accessType |= ( watchpoint.isWriteType() ) ? ICDIWatchpoint.WRITE : 0; - accessType |= ( watchpoint.isReadType() ) ? ICDIWatchpoint.READ : 0; - String expression = watchpoint.getExpression(); - ICDIWatchpoint cdiWatchpoint = bm.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, null ); - getBreakpointMap().put( watchpoint, cdiWatchpoint ); - return cdiWatchpoint; - } - - private void setBreakpointCondition( ICBreakpoint breakpoint ) throws CoreException, CDIException - { - ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); - ICDIBreakpointManager bm = getCDIBreakpointManager(); - ICDICondition condition = bm.createCondition( breakpoint.getIgnoreCount(), breakpoint.getCondition() ); - cdiBreakpoint.setCondition( condition ); - } - - private BreakpointMap getBreakpointMap() - { - return fMap; - } - - protected void targetRequestFailed( String message, Throwable e ) throws DebugException - { - requestFailed0( message, e, DebugException.TARGET_REQUEST_FAILED ); - } - - protected void requestFailed( String message, Throwable e ) throws DebugException - { - requestFailed0( message, e, DebugException.REQUEST_FAILED ); - } - - private void requestFailed0( String message, Throwable e, int code ) throws DebugException - { - throw new DebugException( new Status( IStatus.ERROR, - CDebugModel.getPluginIdentifier(), - code, - message, - e ) ); - } - - private ICLineBreakpoint createLineBreakpoint( IFile file, ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException - { - ICLineBreakpoint breakpoint = CDebugModel.createLineBreakpoint( file, - cdiBreakpoint.getLocation().getLineNumber(), - cdiBreakpoint.isEnabled(), - cdiBreakpoint.getCondition().getIgnoreCount(), - cdiBreakpoint.getCondition().getExpression(), - false ); - getBreakpointMap().put( breakpoint, cdiBreakpoint ); - ((CBreakpoint)breakpoint).register( true ); - return breakpoint; - } - - private ICAddressBreakpoint createAddressBreakpoint( ICDILocationBreakpoint cdiBreakpoint ) throws CDIException, CoreException - { - ICAddressBreakpoint breakpoint = CDebugModel.createAddressBreakpoint( getExecFile(), - cdiBreakpoint.getLocation().getAddress(), - cdiBreakpoint.isEnabled(), - cdiBreakpoint.getCondition().getIgnoreCount(), - cdiBreakpoint.getCondition().getExpression(), - false ); - getBreakpointMap().put( breakpoint, cdiBreakpoint ); - ((CBreakpoint)breakpoint).register( true ); - return breakpoint; - } - - private ICSourceLocator getSourceLocator() - { - ISourceLocator locator = getDebugTarget().getLaunch().getSourceLocator(); - return ( locator instanceof IAdaptable ) ? (ICSourceLocator)((IAdaptable)locator).getAdapter( ICSourceLocator.class ) : null; - } - - private IFile getExecFile() - { - return getDebugTarget().getExecFile(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryManager.java deleted file mode 100644 index b017299e0ea..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryManager.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core; - -import java.util.Arrays; - -import org.eclipse.cdt.debug.core.ICMemoryManager; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * Enter type comment. - * - * @since: Oct 15, 2002 - */ -public class CMemoryManager implements ICMemoryManager -{ - private IFormattedMemoryBlock[] fBlocks = new IFormattedMemoryBlock[4]; - private CDebugTarget fDebugTarget; - - /** - * Constructor for CMemoryManager. - */ - public CMemoryManager( CDebugTarget target ) - { - Arrays.fill( fBlocks, null ); - setDebugTarget( target ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#removeBlock(IFormattedMemoryBlock) - */ - public synchronized void removeBlock( IFormattedMemoryBlock memoryBlock ) throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#removeAllBlocks() - */ - public synchronized void removeAllBlocks() throws DebugException - { - for ( int i = 0; i < fBlocks.length; ++i ) - { - if ( fBlocks[i] != null ) - { - fBlocks[i].dispose(); - fBlocks[i] = null; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#getBlock(int) - */ - public IFormattedMemoryBlock getBlock( int index ) - { - return ( index >= 0 && index < fBlocks.length ) ? fBlocks[index] : null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#getBlocks() - */ - public IFormattedMemoryBlock[] getBlocks() - { - return fBlocks; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICMemoryManager.class ) ) - { - return this; - } - if ( adapter.equals( CMemoryManager.class ) ) - { - return this; - } - if ( adapter.equals( IDebugTarget.class ) ) - { - return fDebugTarget; - } - return null; - } - - public IDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - protected void setDebugTarget( CDebugTarget target ) - { - fDebugTarget = target; - } - - public void dispose() - { - for ( int i = 0; i < fBlocks.length; ++i ) - { - if ( fBlocks[i] != null ) - { - fBlocks[i].dispose(); - fBlocks[i] = null; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#removeBlock(int) - */ - public synchronized void removeBlock( int index ) throws DebugException - { - IFormattedMemoryBlock block = getBlock( index ); - if ( block != null ) - { - block.dispose(); - } - setBlockAt( index, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#setBlockAt(int, IFormattedMemoryBlock) - */ - public synchronized void setBlockAt( int index, IFormattedMemoryBlock memoryBlock ) throws DebugException - { - IFormattedMemoryBlock block = getBlock( index ); - if ( block != null ) - { - block.dispose(); - } - fBlocks[index] = memoryBlock; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICMemoryManager#getSupportedFormats() - */ - public int[] getSupportedFormats() throws DebugException - { - return new int[0]; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java deleted file mode 100644 index 2a2590a0cff..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRegisterManager.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.ICRegisterManager; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.cdt.debug.internal.core.model.CRegisterGroup; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegisterGroup; - -/** - * Enter type comment. - * - * @since Mar 31, 2003 - */ -public class CRegisterManager extends CUpdateManager implements ICRegisterManager -{ - /** - * Collection of register groups added to this target. Values are of type CRegisterGroup. - */ - private List fRegisterGroups; - - /** - * - */ - public CRegisterManager( CDebugTarget target ) - { - super( target ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( ICRegisterManager.class.equals( adapter ) ) - return this; - if ( CRegisterManager.class.equals( adapter ) ) - return this; - return super.getAdapter( adapter ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#dispose() - */ - public void dispose() - { - removeAllRegisterGroups(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#addRegisterGroup(org.eclipse.debug.core.model.IRegisterGroup) - */ - public void addRegisterGroup( IRegisterGroup group ) - { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#getRegisterGroups() - */ - public IRegisterGroup[] getRegisterGroups() throws DebugException - { - return (IRegisterGroup[])fRegisterGroups.toArray( new IRegisterGroup[fRegisterGroups.size()] ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#initialize() - */ - public void initialize() - { - fRegisterGroups = new ArrayList( 20 ); - boolean autoRefresh = CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH ); - if ( getCDIManager() != null ) - getCDIManager().setAutoUpdate( autoRefresh ); - createMainRegisterGroup(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#removeAllRegisterGroups() - */ - public void removeAllRegisterGroups() - { - Iterator it = fRegisterGroups.iterator(); - while( it.hasNext() ) - { - ((CRegisterGroup)it.next()).dispose(); - } - fRegisterGroups.clear(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#removeRegisterGroup(org.eclipse.debug.core.model.IRegisterGroup) - */ - public void removeRegisterGroup( IRegisterGroup group ) - { - fRegisterGroups.remove( group ); - } - - private void createMainRegisterGroup() - { - ICDIRegisterObject[] regObjects = null; - try - { - regObjects = getDebugTarget().getCDISession().getRegisterManager().getRegisterObjects(); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - if ( regObjects != null ) - { - fRegisterGroups.add( new CRegisterGroup( getDebugTarget(), "Main", regObjects ) ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICRegisterManager#reset() - */ - public void reset() - { - Iterator it = fRegisterGroups.iterator(); - while( it.hasNext() ) - { - ((CRegisterGroup)it.next()).resetChangeFlags(); - } - } - - protected ICDIManager getCDIManager() - { - if ( getDebugTarget() != null ) - { - return getDebugTarget().getCDISession().getRegisterManager(); - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java deleted file mode 100644 index 017e93ba72f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSharedLibraryManager.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.ICSharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIManager; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.cdt.debug.internal.core.model.CSharedLibrary; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Jan 16, 2003 - */ -public class CSharedLibraryManager extends CUpdateManager implements ICSharedLibraryManager -{ - private ArrayList fSharedLibraries; - - /** - * Constructor for CSharedLibraryManager. - */ - public CSharedLibraryManager( CDebugTarget target ) - { - super( target ); - fSharedLibraries = new ArrayList( 5 ); - boolean autoRefresh = CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ); - if ( getCDIManager() != null ) - getCDIManager().setAutoUpdate( autoRefresh ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#sharedLibararyLoaded(ICDISharedLibrary) - */ - public synchronized void sharedLibraryLoaded( ICDISharedLibrary cdiLibrary ) - { - CSharedLibrary library = new CSharedLibrary( getDebugTarget(), cdiLibrary ); - fSharedLibraries.add( library ); - library.fireCreationEvent(); - if ( library.areSymbolsLoaded() ) - setBreakpoints(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#sharedLibraryUnloaded(ICDISharedLibrary) - */ - public synchronized void sharedLibraryUnloaded( ICDISharedLibrary cdiLibrary ) - { - CSharedLibrary library = find( cdiLibrary ); - if ( library != null ) - { - fSharedLibraries.remove( library ); - library.dispose(); - library.fireTerminateEvent(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#symbolsLoaded(ICDISharedLibrary) - */ - public void symbolsLoaded( ICDISharedLibrary cdiLibrary ) - { - CSharedLibrary library = find( cdiLibrary ); - if ( library != null ) - { - library.fireChangeEvent( DebugEvent.STATE ); - setBreakpoints(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#getSharedLibraries() - */ - public ICSharedLibrary[] getSharedLibraries() - { - return (ICSharedLibrary[])fSharedLibraries.toArray( new ICSharedLibrary[fSharedLibraries.size()] ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#dispose() - */ - public void dispose() - { - Iterator it = fSharedLibraries.iterator(); - while( it.hasNext() ) - { - ((ICSharedLibrary)it.next()).dispose(); - } - fSharedLibraries.clear(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICSharedLibraryManager.class ) ) - { - return this; - } - if ( adapter.equals( CSharedLibraryManager.class ) ) - { - return this; - } - return super.getAdapter( adapter ); - } - - protected CSharedLibrary find( ICDISharedLibrary cdiLibrary ) - { - Iterator it = fSharedLibraries.iterator(); - while( it.hasNext() ) - { - CSharedLibrary library = (CSharedLibrary)it.next(); - if ( library.getCDISharedLibrary().equals( cdiLibrary ) ) - return library; - } - return null; - } - - protected ICDIManager getCDIManager() - { - if ( getDebugTarget() != null ) - { - return getDebugTarget().getCDISession().getSharedLibraryManager(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbols(org.eclipse.cdt.debug.core.model.ICSharedLibrary) - */ - public void loadSymbols( ICSharedLibrary[] libraries ) throws DebugException - { - ICDISharedLibraryManager slm = (ICDISharedLibraryManager)getCDIManager(); - if ( slm != null ) - { - ArrayList cdiLibs = new ArrayList( libraries.length ); - for ( int i = 0; i < libraries.length; ++i ) - { - cdiLibs.add( ((CSharedLibrary)libraries[i]).getCDISharedLibrary() ); - } - try - { - slm.loadSymbols( (ICDISharedLibrary[])cdiLibs.toArray( new ICDISharedLibrary[cdiLibs.size()] ) ); - } - catch( CDIException e ) - { - getDebugTarget().targetRequestFailed( e.getMessage(), null ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSharedLibraryManager#loadSymbolsForAll() - */ - public void loadSymbolsForAll() throws DebugException - { - ICDISharedLibraryManager slm = (ICDISharedLibraryManager)getCDIManager(); - if ( slm != null ) - { - try - { - slm.loadSymbols(); - } - catch( CDIException e ) - { - getDebugTarget().targetRequestFailed( e.getMessage(), null ); - } - } - } - - private void setBreakpoints() - { - getDebugTarget().setBreakpoints(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java deleted file mode 100644 index 2b83ae9a0bd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core; - -import java.util.ArrayList; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.ICSignalManager; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.cdt.debug.internal.core.model.CSignal; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Jan 31, 2003 - */ -public class CSignalManager extends CUpdateManager implements ICSignalManager -{ - private ICSignal[] fSignals = null; - private boolean fIsDisposed = false; - - /** - * Constructor for CSignalManager. - */ - public CSignalManager( CDebugTarget target ) - { - super( target ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSignalManager#getSignals() - */ - public ICSignal[] getSignals() throws DebugException - { - if ( !isDisposed() && fSignals == null ) - { - try - { - ICDISignal[] cdiSignals = getDebugTarget().getCDISession().getSignalManager().getSignals(); - ArrayList list = new ArrayList( cdiSignals.length ); - for ( int i = 0; i < cdiSignals.length; ++i ) - { - list.add( new CSignal( getDebugTarget(), cdiSignals[i] ) ); - } - fSignals = (ICSignal[])list.toArray( new ICSignal[list.size()] ); - } - catch( CDIException e ) - { - throwDebugException( e.getMessage(), DebugException.TARGET_REQUEST_FAILED, e ); - } - } - return ( fSignals != null ) ? fSignals : new ICSignal[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSignalManager#dispose() - */ - public void dispose() - { - if ( fSignals != null ) - for ( int i = 0; i < fSignals.length; ++i ) - { - fSignals[i].dispose(); - } - fSignals = null; - fIsDisposed = true; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICSignalManager.class ) ) - { - return this; - } - if ( adapter.equals( CSignalManager.class ) ) - { - return this; - } - return super.getAdapter( adapter ); - } - - public void signalChanged( ICDISignal cdiSignal ) - { - CSignal signal = find( cdiSignal ); - if ( signal != null ) - { - signal.fireChangeEvent( DebugEvent.STATE ); - } - } - - private CSignal find( ICDISignal cdiSignal ) - { - try - { - ICSignal[] signals = getSignals(); - for ( int i = 0; i < signals.length; ++i ) - if ( signals[i].getName().equals( cdiSignal.getName() ) ) - return (CSignal)signals[i]; - } - catch( DebugException e ) - { - } - return null; - } - - protected boolean isDisposed() - { - return fIsDisposed; - } - - protected ICDIManager getCDIManager() - { - if ( getDebugTarget() != null ) - { - return getDebugTarget().getCDISession().getSignalManager(); - } - return null; - } - - /** - * Throws a debug exception with the given message, error code, and underlying - * exception. - */ - protected void throwDebugException( String message, int code, Throwable exception ) throws DebugException - { - throw new DebugException( new Status( IStatus.ERROR, - CDebugModel.getPluginIdentifier(), - code, - message, - exception ) ); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java deleted file mode 100644 index d4a5fadf694..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CUpdateManager.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core; - -import org.eclipse.cdt.debug.core.ICUpdateManager; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIManager; -import org.eclipse.cdt.debug.core.model.ICDebugTarget; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * Enter type comment. - * - * @since Mar 31, 2003 - */ -public abstract class CUpdateManager implements ICUpdateManager, IAdaptable -{ - private CDebugTarget fDebugTarget = null; - - /** - * - */ - public CUpdateManager( CDebugTarget target ) - { - fDebugTarget = target; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICUpdateManager#setAutoModeEnabled(boolean) - */ - public void setAutoModeEnabled( boolean enable ) - { - if ( getCDIManager() != null ) - { - getCDIManager().setAutoUpdate( enable ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICUpdateManager#getAutoModeEnabled() - */ - public boolean getAutoModeEnabled() - { - if ( getCDIManager() != null ) - { - return getCDIManager().isAutoUpdate(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICUpdateManager#update() - */ - public void update() throws DebugException - { - if ( getCDIManager() != null ) - { - try - { - getCDIManager().update(); - } - catch( CDIException e ) - { - getDebugTarget().targetRequestFailed( e.getMessage(), null ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICUpdateManager#canUpdate() - */ - public boolean canUpdate() - { - if ( getDebugTarget() != null ) - { - return getDebugTarget().isSuspended(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( ICUpdateManager.class.equals( adapter ) ) - return this; - if ( IDebugTarget.class.equals( adapter ) ) - return getDebugTarget(); - if ( ICDebugTarget.class.equals( adapter ) ) - return getDebugTarget(); - return null; - } - - public CDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - abstract protected ICDIManager getCDIManager(); -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java deleted file mode 100644 index 6a128f5c517..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.core; - -import java.util.HashSet; -import java.util.Set; -import java.util.StringTokenizer; - -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.core.ICDebugger; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; - -public class DebugConfiguration implements ICDebugConfiguration { - /** - * The configuration element of the extension. - */ - private IConfigurationElement fElement; - private HashSet fModes; - private HashSet fCPUs; - public static final String NATIVE = "native"; - - public DebugConfiguration(IConfigurationElement element) { - fElement = element; - } - - private IConfigurationElement getConfigurationElement() { - return fElement; - } - - public ICDebugger getDebugger() throws CoreException { - return (ICDebugger) getConfigurationElement().createExecutableExtension("class"); - } - - public String getName() { - String name = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$ - return name != null ? name : ""; - } - - public String getID() { - return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$ - } - - public String getPlatform() { - String platform = getConfigurationElement().getAttribute("platform"); - if (platform == null) { - return NATIVE; - } - return platform; - } - - public String[] getCPUList() { - return (String[]) getCPUs().toArray(new String[0]); - } - - public String[] getModeList() { - return (String[]) getModes().toArray(new String[0]); - } - - public boolean supportsMode(String mode) { - return getModes().contains(mode); - } - - public boolean supportsCPU(String cpu) { - String nativeCPU = BootLoader.getOSArch(); - boolean ret = false; - if ( nativeCPU.startsWith(cpu) ) { - ret = getCPUs().contains(NATIVE); - } - return ret || getCPUs().contains(cpu); - } - /** - * Returns the set of modes specified in the configuration data. - * - * @return the set of modes specified in the configuration data - */ - protected Set getModes() { - if (fModes == null) { - String modes = getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$ - if (modes == null) { - return new HashSet(0); - } - StringTokenizer tokenizer = new StringTokenizer(modes, ","); //$NON-NLS-1$ - fModes = new HashSet(tokenizer.countTokens()); - while (tokenizer.hasMoreTokens()) { - fModes.add(tokenizer.nextToken().trim()); - } - } - return fModes; - } - - protected Set getCPUs() { - if (fCPUs == null) { - String cpus = getConfigurationElement().getAttribute("cpu"); //$NON-NLS-1$ - if (cpus == null) { - fCPUs = new HashSet(1); - fCPUs.add(NATIVE); - } - else { - String nativeCPU = BootLoader.getOSArch(); - StringTokenizer tokenizer = new StringTokenizer(cpus, ","); //$NON-NLS-1$ - fCPUs = new HashSet(tokenizer.countTokens()); - while (tokenizer.hasMoreTokens()) { - String cpu = tokenizer.nextToken().trim(); - fCPUs.add(cpu); - if (nativeCPU.startsWith(cpu)) { // os arch be cpu{le/be} - fCPUs.add(NATIVE); - } - } - } - } - return fCPUs; - } - -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java deleted file mode 100644 index 71f2b15d685..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DisassemblyStorage.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.Arrays; - -import org.eclipse.cdt.debug.core.*; -import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; -import org.eclipse.cdt.debug.core.model.IExecFileInfo; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * Enter type comment. - * - * @since: Oct 8, 2002 - */ -public class DisassemblyStorage implements IDisassemblyStorage -{ - protected ICDIInstruction[] fInstructions; - protected IDebugTarget fDebugTarget; - protected ByteArrayInputStream fInputStream = null; - protected long fStartAddress = 0; - protected long fEndAddress = 0; - - /** - * Constructor for DisassemblyStorage. - */ - public DisassemblyStorage( IDebugTarget target, ICDIInstruction[] instructions ) - { - setDebugTarget( target ); - setInstructions( instructions ); - initializeAddresses(); - createContent(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IDisassemblyStorage#getDebugTarget() - */ - public IDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IDisassemblyStorage#containsAddress(Long) - */ - public boolean containsAddress( long address ) - { - return ( address >= fStartAddress && address <= fEndAddress ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IDisassemblyStorage#getLineNumber(Long) - */ - public int getLineNumber( long address ) - { - for ( int i = 0; i < fInstructions.length; ++i ) - { - if ( fInstructions[i].getAdress() == address ) - { - return i + 1; - } - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getContents() - */ - public InputStream getContents() throws CoreException - { - if ( fInputStream != null ) - fInputStream.reset(); - return fInputStream; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getFullPath() - */ - public IPath getFullPath() - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getName() - */ - public String getName() - { - try - { - if ( getDebugTarget() != null ) - { - return getDebugTarget().getName(); - } - } - catch( DebugException e ) - { - // ignore - } - return "disassembly"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#isReadOnly() - */ - public boolean isReadOnly() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( IStorage.class ) ) - return this; - if ( adapter.equals( IDisassemblyStorage.class ) ) - return this; - if ( adapter.equals( DisassemblyStorage.class ) ) - return this; - if ( adapter.equals( IResource.class ) ) - return getBinary(); - return null; - } - - protected void setDebugTarget( IDebugTarget target ) - { - fDebugTarget = target; - } - - protected void setInstructions( ICDIInstruction[] intructions ) - { - fInstructions = intructions; - } - - private void createContent() - { - StringBuffer lines = new StringBuffer(); - int maxFunctionName = 0; - int maxOpcodeLength = 0; - long maxOffset = 0; - for ( int i = 0; i < fInstructions.length; ++i ) - { - if ( fInstructions[i].getFuntionName().length() > maxFunctionName ) - { - maxFunctionName = fInstructions[i].getFuntionName().length(); - } - - String opcode = fInstructions[i].getOpcode(); - if ( opcode.length() > maxOpcodeLength ) - maxOpcodeLength = opcode.length(); - - if ( fInstructions[i].getOffset() > maxOffset ) - { - maxOffset = fInstructions[i].getOffset(); - } - } - int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset ); - int argPosition = instrPos + maxOpcodeLength + 1; - for ( int i = 0; i < fInstructions.length; ++i ) - { - lines.append( getInstructionString( fInstructions[i], instrPos, argPosition ) ); - } - fInputStream = new ByteArrayInputStream( lines.toString().getBytes() ); - } - - private void initializeAddresses() - { - if ( fInstructions.length > 0 ) - { - fStartAddress = fInstructions[0].getAdress(); - fEndAddress = fInstructions[fInstructions.length - 1].getAdress(); - } - } - - private String getInstructionString( ICDIInstruction instruction, int instrPosition, int argPosition ) - { - int worstCaseSpace = Math.max( instrPosition, argPosition ); - char[] spaces= new char[worstCaseSpace]; - Arrays.fill( spaces, ' ' ); - StringBuffer sb = new StringBuffer(); - if ( instruction != null ) - { - sb.append( CDebugUtils.toHexAddressString( instruction.getAdress() ) ); - sb.append( ' ' ); - if ( instruction.getFuntionName() != null && instruction.getFuntionName().length() > 0 ) - { - sb.append( '<' ); - sb.append( instruction.getFuntionName() ); - if ( instruction.getOffset() != 0 ) - { - sb.append( '+' ); - sb.append( instruction.getOffset() ); - } - sb.append( ">:" ); - sb.append( spaces, 0, instrPosition - sb.length() ); - } - sb.append( instruction.getOpcode() ); - sb.append( spaces, 0, argPosition - sb.length() ); - sb.append( instruction.getArgs() ); - sb.append( '\n' ); - } - return sb.toString(); - } - - private int calculateInstructionPosition( int maxFunctionName, long maxOffset ) - { - return ( 16 + maxFunctionName + Long.toString( maxOffset ).length() ); - } - - private IResource getBinary() - { - if ( getDebugTarget() != null ) - { - IExecFileInfo info = (IExecFileInfo)getDebugTarget().getAdapter( IExecFileInfo.class ); - if ( info != null ) - { - return info.getExecFile(); - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage#getAddress(int) - */ - public long getAddress( int lineNumber ) - { - if ( fInstructions.length > lineNumber && lineNumber >= 0 ) - { - return fInstructions[lineNumber].getAdress(); - } - return 0; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java deleted file mode 100644 index f132127af8c..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core; - -/** - * - * Definitions of the internal constants for C/C++ Debug plug-in. - * - * @since: Sep 25, 2002 - */ -public class ICDebugInternalConstants -{ - /* - * Status handler codes. - */ - public static final int STATUS_CODE_QUESTION = 10000; - public static final int STATUS_CODE_INFO = 10001; - public static final int STATUS_CODE_ERROR = 10002; -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/SessionManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/SessionManager.java deleted file mode 100644 index 233fc454828..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/SessionManager.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * Default implementation of the session manager. - * Terminates session when the last target is terminated; - * - * @since Apr 28, 2003 - */ -public class SessionManager implements IDebugEventSetListener -{ - public SessionManager() - { - DebugPlugin.getDefault().addDebugEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( SessionManager.class.equals( adapter ) ) - return this; - return null; - } - - public void dispose() - { - DebugPlugin.getDefault().removeDebugEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[]) - */ - public void handleDebugEvents( DebugEvent[] events ) - { - for ( int i = 0; i < events.length; i++ ) - { - DebugEvent event = events[i]; - if ( event.getKind() == DebugEvent.TERMINATE ) - { - Object element = event.getSource(); - if ( element instanceof IDebugTarget && ((IDebugTarget)element).getAdapter( ICDITarget.class ) != null ) - { - handleTerminateEvent( ((IDebugTarget)element).getLaunch(), ((ICDITarget)((IDebugTarget)element).getAdapter( ICDITarget.class )).getSession() ); - } - } - } - } - - private void handleTerminateEvent( ILaunch launch, ICDISession session ) - { - IDebugTarget[] targets = launch.getDebugTargets(); - boolean terminate = true; - for ( int i = 0; i < targets.length; ++i ) - { - if ( targets[i].getAdapter( ICDITarget.class ) != null && - session.equals( ((ICDITarget)targets[i].getAdapter( ICDITarget.class )).getSession() ) && - !targets[i].isTerminated() && !targets[i].isDisconnected() ) - terminate = false; - } - if ( terminate ) - { - try - { - session.terminate(); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java deleted file mode 100644 index c80c255fedc..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.breakpoints; - -import java.util.Map; - -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugException; - -/** - * - * Enter type comment. - * - * @since Aug 21, 2002 - */ -public class CAddressBreakpoint extends CBreakpoint implements ICAddressBreakpoint -{ - private static final String C_ADDRESS_BREAKPOINT = "org.eclipse.cdt.debug.core.cAddressBreakpointMarker"; //$NON-NLS-1$ - - /** - * Constructor for CAddressBreakpoint. - */ - public CAddressBreakpoint() - { - } - - /** - * Constructor for CAddressBreakpoint. - */ - public CAddressBreakpoint( IResource resource, Map attributes, boolean add ) throws DebugException - { - super( resource, getMarkerType(), attributes, add ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICAddressBreakpoint#getAddress() - */ - public String getAddress() throws CoreException - { - return ensureMarker().getAttribute( ADDRESS, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICAddressBreakpoint#setAddress(long) - */ - public void setAddress( String address ) throws CoreException - { - setAttribute( ADDRESS, address ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber() - */ - public int getLineNumber() throws CoreException - { - return ensureMarker().getAttribute( IMarker.LINE_NUMBER, -1 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart() - */ - public int getCharStart() throws CoreException - { - return ensureMarker().getAttribute( IMarker.CHAR_START, -1 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd() - */ - public int getCharEnd() throws CoreException - { - return ensureMarker().getAttribute( IMarker.CHAR_END, -1 ); - } - - /** - * Returns the type of marker associated with this type of breakpoints - */ - public static String getMarkerType() - { - return C_ADDRESS_BREAKPOINT; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint#getMarkerMessage() - */ - protected String getMarkerMessage() throws CoreException - { - StringBuffer sb = new StringBuffer( "Address breakpoint:" ); - String name = ensureMarker().getResource().getName(); - if ( name != null && name.length() > 0 ) - { - sb.append( ' ' ); - sb.append( name ); - } - try - { - long address = Long.parseLong( getAddress() ); - sb.append( " [address: " ); - sb.append( CDebugUtils.toHexAddressString( address ) ); - sb.append( ']' ); - } - catch( NumberFormatException e ) - { - } - sb.append( getConditionText() ); - return sb.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java deleted file mode 100644 index aba10956ea6..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.breakpoints; - -import java.util.Map; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.model.Breakpoint; - -/** - * - * Enter type comment. - * - * @since Aug 21, 2002 - */ -public abstract class CBreakpoint extends Breakpoint - implements ICBreakpoint, - IDebugEventSetListener -{ - /** - * Constructor for CBreakpoint. - */ - public CBreakpoint() - { - } - - /** - * Constructor for CBreakpoint. - */ - public CBreakpoint( final IResource resource, final String markerType, final Map attributes, final boolean add ) throws DebugException - { - IWorkspaceRunnable wr= new IWorkspaceRunnable() - { - public void run( IProgressMonitor monitor ) throws CoreException - { - // create the marker - setMarker( resource.createMarker( markerType ) ); - - // set attributes - ensureMarker().setAttributes( attributes ); - - //set the marker message - setAttribute( IMarker.MESSAGE, getMarkerMessage() ); - - // add to breakpoint manager if requested - register( add ); - } - }; - run( wr ); - } - - public void createMarker( final IResource resource, final String markerType, final Map attributes, final boolean add ) throws DebugException - { - IWorkspaceRunnable wr= new IWorkspaceRunnable() - { - public void run( IProgressMonitor monitor ) throws CoreException - { - // create the marker - setMarker( resource.createMarker( markerType ) ); - - // set attributes - ensureMarker().setAttributes( attributes ); - - //set the marker message - setAttribute( IMarker.MESSAGE, getMarkerMessage() ); - - // add to breakpoint manager if requested - register( add ); - } - }; - run( wr ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier() - */ - public String getModelIdentifier() - { - return CDebugModel.getPluginIdentifier(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#isInstalled() - */ - public boolean isInstalled() throws CoreException - { - return ensureMarker().getAttribute( INSTALL_COUNT, 0 ) > 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#getCondition() - */ - public String getCondition() throws CoreException - { - return ensureMarker().getAttribute( CONDITION, "" ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#setCondition(String) - */ - public void setCondition( String condition ) throws CoreException - { - setAttribute( CONDITION, condition ); - setAttribute( IMarker.MESSAGE, getMarkerMessage() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#getIgnoreCount() - */ - public int getIgnoreCount() throws CoreException - { - return ensureMarker().getAttribute( IGNORE_COUNT, 0 ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#setIgnoreCount(int) - */ - public void setIgnoreCount( int ignoreCount ) throws CoreException - { - setAttribute( IGNORE_COUNT, ignoreCount ); - setAttribute( IMarker.MESSAGE, getMarkerMessage() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#getThreadId() - */ - public String getThreadId() throws CoreException - { - return ensureMarker().getAttribute( THREAD_ID, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICBreakpoint#setThreadId(String) - */ - public void setThreadId( String threadId ) throws CoreException - { - setAttribute( THREAD_ID, threadId ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(DebugEvent[]) - */ - public void handleDebugEvents( DebugEvent[] events ) - { - } - - /** - * Execute the given workspace runnable - */ - protected void run( IWorkspaceRunnable wr ) throws DebugException - { - try - { - ResourcesPlugin.getWorkspace().run( wr, null ); - } - catch ( CoreException e ) - { - throw new DebugException( e.getStatus() ); - } - } - - /** - * Add this breakpoint to the breakpoint manager, - * or sets it as unregistered. - */ - public void register( boolean register ) throws CoreException - { - if ( register ) - { - DebugPlugin.getDefault().getBreakpointManager().addBreakpoint( this ); - } -/* - else - { - setRegistered( false ); - } -*/ - } - - protected String getMarkerMessage() throws CoreException - { - return null; - } - - /** - * Resets the install count of this breakpoint - */ - public synchronized void resetInstallCount() throws CoreException - { - setAttribute( INSTALL_COUNT, 0 ); - } - - /** - * Increments the install count of this breakpoint - */ - public synchronized void incrementInstallCount() throws CoreException - { - int count = getInstallCount(); - setAttribute( INSTALL_COUNT, count + 1 ); - } - - /** - * Returns the INSTALL_COUNT attribute of this breakpoint - * or 0 if the attribute is not set. - */ - public int getInstallCount() throws CoreException - { - return ensureMarker().getAttribute( INSTALL_COUNT, 0 ); - } - - /** - * Decrements the install count of this breakpoint. - */ - public synchronized void decrementInstallCount() throws CoreException - { - int count = getInstallCount(); - if ( count > 0 ) - { - setAttribute( INSTALL_COUNT, count - 1 ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.Breakpoint#ensureMarker() - */ - protected IMarker ensureMarker() throws DebugException - { - return super.ensureMarker(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.Breakpoint#setAttribute(String, Object) - */ - protected void setAttribute( String attributeName, Object value ) throws CoreException - { - super.setAttribute( attributeName, value ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICBreakpoint#isConditional() - */ - public boolean isConditional() throws CoreException - { - return ( (getCondition() != null && getCondition().trim().length() > 0) || getIgnoreCount() > 0 ); - } - - protected String getConditionText() throws CoreException - { - StringBuffer sb = new StringBuffer(); - int ignoreCount = getIgnoreCount(); - if ( ignoreCount > 0 ) - { - sb.append( " [" ); - sb.append( "ignore count:" ); - sb.append( ' ' ); - sb.append( ignoreCount ); - sb.append( ']' ); - } - String condition = getCondition(); - if ( condition != null && condition.length() > 0 ) - { - sb.append( " if " ); - sb.append( condition ); - } - return sb.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java deleted file mode 100644 index c3e2156abac..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.breakpoints; - -import java.util.Map; - -import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugException; - -/** - * - * Enter type comment. - * - * @since Aug 21, 2002 - */ -public class CFunctionBreakpoint extends CBreakpoint implements ICFunctionBreakpoint -{ - private static final String C_FUNCTION_BREAKPOINT = "org.eclipse.cdt.debug.core.cFunctionBreakpointMarker"; //$NON-NLS-1$ - - /** - * Breakpoint attribute storing the function this breakpoint suspends - * execution in (value "org.eclipse.cdt.debug.core.function"). - * This attribute is a String. - */ - protected static final String FUNCTION = "org.eclipse.cdt.debug.core.function"; //$NON-NLS-1$ - - /** - * Constructor for CFunctionBreakpoint. - */ - public CFunctionBreakpoint() - { - } - - /** - * Constructor for CFunctionBreakpoint. - */ - public CFunctionBreakpoint( IResource resource, Map attributes, boolean add ) throws DebugException - { - super( resource, getMarkerType(), attributes, add ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICFunctionBreakpoint#getFunction() - */ - public String getFunction() throws CoreException - { - return ensureMarker().getAttribute( FUNCTION, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICFunctionBreakpoint#setFunction(String) - */ - public void setFunction( String function ) throws CoreException - { - setAttribute( FUNCTION, function ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber() - */ - public int getLineNumber() throws CoreException - { - return ensureMarker().getAttribute( IMarker.LINE_NUMBER, -1 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart() - */ - public int getCharStart() throws CoreException - { - return ensureMarker().getAttribute( IMarker.CHAR_START, -1 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd() - */ - public int getCharEnd() throws CoreException - { - return ensureMarker().getAttribute( IMarker.CHAR_END, -1 ); - } - - /** - * Returns the type of marker associated with this type of breakpoints - */ - public static String getMarkerType() - { - return C_FUNCTION_BREAKPOINT; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint#getFileName() - */ - public String getFileName() throws CoreException - { - IResource resource = ensureMarker().getResource(); - if ( resource instanceof IFile ) - { - return ((IFile)resource).getLocation().lastSegment(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint#getMarkerMessage() - */ - protected String getMarkerMessage() throws CoreException - { - StringBuffer sb = new StringBuffer( "Function breakpoint:" ); - String name = ensureMarker().getResource().getName(); - if ( name != null && name.length() > 0 ) - { - sb.append( ' ' ); - sb.append( name ); - } - String function = getFunction(); - if ( function != null && function.trim().length() > 0 ) - { - sb.append( " [" ); - sb.append( "function:" ); - sb.append( ' ' ); - sb.append( function.trim() ); - sb.append( ']' ); - } - sb.append( getConditionText() ); - return sb.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java deleted file mode 100644 index fc871430e20..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.breakpoints; - -import java.util.Map; - -import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugException; - -/** - * - * Enter type comment. - * - * @since Aug 21, 2002 - */ -public class CLineBreakpoint extends CBreakpoint implements ICLineBreakpoint -{ - private static final String C_LINE_BREAKPOINT = "org.eclipse.cdt.debug.core.cLineBreakpointMarker"; //$NON-NLS-1$ - - /** - * Constructor for CLineBreakpoint. - */ - public CLineBreakpoint() - { - } - - /** - * Constructor for CLineBreakpoint. - */ - public CLineBreakpoint( IResource resource, Map attributes, boolean add ) throws DebugException - { - super( resource, getMarkerType(), attributes, add ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber() - */ - public int getLineNumber() throws CoreException - { - return ensureMarker().getAttribute( IMarker.LINE_NUMBER, -1 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart() - */ - public int getCharStart() throws CoreException - { - return ensureMarker().getAttribute( IMarker.CHAR_START, -1 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd() - */ - public int getCharEnd() throws CoreException - { - return ensureMarker().getAttribute( IMarker.CHAR_END, -1 ); - } - - /** - * Returns the type of marker associated with this type of breakpoints - */ - public static String getMarkerType() - { - return C_LINE_BREAKPOINT; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint#getMarkerMessage() - */ - protected String getMarkerMessage() throws CoreException - { - StringBuffer sb = new StringBuffer( "Line breakpoint:" ); - String fileName = ensureMarker().getResource().getName(); - if ( fileName != null && fileName.length() > 0 ) - { - sb.append( ' ' ); - sb.append( fileName ); - } - int lineNumber = getLineNumber(); - if ( lineNumber > 0 ) - { - sb.append( " [" ); - sb.append( "line:" ); - sb.append( ' ' ); - sb.append( lineNumber ); - sb.append( ']' ); - } - sb.append( getConditionText() ); - return sb.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java deleted file mode 100644 index 220acac293f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CWatchpoint.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.breakpoints; - -import java.util.Map; - -import org.eclipse.cdt.debug.core.model.ICWatchpoint; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugException; - -/** - * - * Enter type comment. - * - * @since Sep 4, 2002 - */ -public class CWatchpoint extends CBreakpoint implements ICWatchpoint -{ - private static final String C_WATCHPOINT = "org.eclipse.cdt.debug.core.cWatchpointMarker"; //$NON-NLS-1$ - - /** - * Constructor for CWatchpoint. - */ - public CWatchpoint() - { - } - - /** - * Constructor for CWatchpoint. - */ - public CWatchpoint( IResource resource, Map attributes, boolean add ) throws DebugException - { - super( resource, getMarkerType(), attributes, add ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICWatchpoint#isWriteType() - */ - public boolean isWriteType() throws CoreException - { - return ensureMarker().getAttribute( WRITE, true ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICWatchpoint#isReadType() - */ - public boolean isReadType() throws CoreException - { - return ensureMarker().getAttribute( READ, false ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICWatchpoint#getExpression() - */ - public String getExpression() throws CoreException - { - return ensureMarker().getAttribute( EXPRESSION, "" ); - } - - /** - * Returns the type of marker associated with this type of breakpoints - */ - public static String getMarkerType() - { - return C_WATCHPOINT; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint#getMarkerMessage() - */ - protected String getMarkerMessage() throws CoreException - { - StringBuffer sb = new StringBuffer(); - if ( isWriteType() && !isReadType() ) - sb.append( "Write " ); - else if ( !isWriteType() && isReadType() ) - sb.append( "Read " ); - else if ( isWriteType() && isReadType() ) - sb.append( "Access " ); - sb.append( "watchpoint: " ); - String fileName = ensureMarker().getResource().getName(); - if ( fileName != null && fileName.length() > 0 ) - { - sb.append( ' ' ); - sb.append( fileName ); - } - String expression = getExpression(); - if ( expression != null && expression.length() > 0 ) - { - sb.append( " at \'" ); - sb.append( expression ); - sb.append( '\'' ); - } - sb.append( getConditionText() ); - return sb.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartition.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartition.java deleted file mode 100644 index 3cc2463af4e..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartition.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue; -import org.eclipse.cdt.debug.core.model.ICType; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; - -/** - * - * A sub-range of an array. - * - * @since Sep 9, 2002 - */ -public class CArrayPartition extends CVariable -{ - static final protected int SLOT_SIZE = 100; - - private int fStart; - private int fEnd; - private ICDIVariableObject fCDIVariableObject; - private ICDIVariable fCDIVariable; - private ICType fType = null; - private String fQualifiedName = null; - - /** - * Cache of value. - */ - private CArrayPartitionValue fArrayPartitionValue = null; - - /** - * Constructor for CArrayPartition. - * @param target - */ - public CArrayPartition( CDebugElement parent, ICDIVariable cdiVariable, int start, int end ) - { - super( parent, null ); - fStart = start; - fEnd = end; - fCDIVariable = cdiVariable; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.model.CVariable#retrieveValue() - */ - protected ICDIValue retrieveValue() throws DebugException, CDIException - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getName() - */ - public String getName() throws DebugException - { - StringBuffer name = new StringBuffer(); - name.append( '[' ); - name.append( fStart ); - name.append( ".." ); - name.append( fEnd ); - name.append( ']' ); - return name.toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getValue() - */ - public IValue getValue() throws DebugException - { - if ( fArrayPartitionValue == null ) - { - fArrayPartitionValue = new CArrayPartitionValue( this, fCDIVariable, getStart(), getEnd() ); - } - return fArrayPartitionValue; - } - - static public List splitArray( CDebugElement parent, ICDIVariable cdiVariable, int start, int end ) throws DebugException - { - ArrayList children = new ArrayList(); - int len = end - start + 1; - int perSlot = 1; - while( len > perSlot * SLOT_SIZE ) - { - perSlot *= SLOT_SIZE; - } - if ( perSlot == 1 ) - { - try - { - ICDIValue value = cdiVariable.getValue(); - if ( value instanceof ICDIArrayValue ) - { - ICDIVariable[] cdiVars = ((ICDIArrayValue)value).getVariables( start, len ); - for ( int i = 0; i < cdiVars.length; ++i ) - children.add( new CModificationVariable( parent, cdiVars[i] ) ); - } - } - catch( CDIException e ) - { - children.add( new CModificationVariable( parent, new CVariable.ErrorVariable( null, e ) ) ); - } - } - else - { - int pos = start; - while( pos <= end ) - { - if ( pos + perSlot > end ) - { - perSlot = end - pos + 1; - } - children.add( new CArrayPartition( parent, cdiVariable, pos, pos + perSlot - 1 ) ); - pos += perSlot; - } - } - return children; - } - - protected int getStart() - { - return fStart; - } - - protected int getEnd() - { - return fEnd; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#canEnableDisable() - */ - public boolean canEnableDisable() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#getType() - */ - public ICType getType() throws DebugException - { - if ( fType == null ) - { - try - { - ICDIVariableObject varObject = getVariableObject(); - if ( varObject != null ) - fType = new CType( varObject.getType() ); - } - catch (CDIException e) - { - requestFailed( "Type is not available.", e ); - } - } - return fType; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#hasChildren() - */ - public boolean hasChildren() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.model.CVariable#getQualifiedName() - */ - protected String getQualifiedName() throws DebugException - { - if ( fQualifiedName == null ) - { - try - { - if ( getVariableObject() != null ) - { - fQualifiedName = getVariableObject().getQualifiedName(); - } - } - catch( CDIException e ) - { - requestFailed( "Qualified name is not available.", e ); - } - } - return fQualifiedName; - } - - private ICDIVariableObject getVariableObject() throws CDIException - { - if ( fCDIVariableObject == null ) - { - fCDIVariableObject = getCDISession().getVariableManager().getVariableObjectAsArray( fCDIVariable, getStart(), getEnd() - getStart() + 1 ); - } - return fCDIVariableObject; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartitionValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartitionValue.java deleted file mode 100644 index 6dbe9b12eb1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CArrayPartitionValue.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator; -import org.eclipse.cdt.debug.core.model.ICValue; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IVariable; - -/** - * - * The value for an array partition. - * - * @since Sep 9, 2002 - */ -public class CArrayPartitionValue extends CDebugElement implements ICValue -{ - /** - * The underlying CDI variable. - */ - private ICDIVariable fCDIVariable; - - /** - * Parent variable. - */ - private CVariable fParent = null; - - /** - * List of child variables. - */ - private List fVariables = Collections.EMPTY_LIST; - - private int fStart; - - private int fEnd; - - /** - * Constructor for CArrayPartitionValue. - * @param target - */ - public CArrayPartitionValue( CVariable parent, ICDIVariable cdiVariable, int start, int end ) - { - super( (CDebugTarget)parent.getDebugTarget() ); - fCDIVariable = cdiVariable; - fParent = parent; - fStart = start; - fEnd = end; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getValueString() - */ - public String getValueString() throws DebugException - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#isAllocated() - */ - public boolean isAllocated() throws DebugException - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getVariables() - */ - public IVariable[] getVariables() throws DebugException - { - List list = getVariables0(); - return (IVariable[])list.toArray( new IVariable[list.size()] ); - } - - protected synchronized List getVariables0() throws DebugException - { - if ( !isAllocated() || !hasVariables() ) - return Collections.EMPTY_LIST; - if ( fVariables.size() == 0 ) - { - fVariables = CArrayPartition.splitArray( this, getCDIVariable(), getStart(), getEnd() ); - } - return fVariables; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#hasVariables() - */ - public boolean hasVariables() throws DebugException - { - return true; - } - - protected int getStart() - { - return fStart; - } - - protected int getEnd() - { - return fEnd; - } - - public void setChanged( boolean changed ) throws DebugException - { - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).setChanged( changed ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICValue#computeDetail() - */ - public String evaluateAsExpression() - { - ICExpressionEvaluator ee = (ICExpressionEvaluator)getDebugTarget().getAdapter( ICExpressionEvaluator.class ); - String valueString = null; - if ( ee != null && ee.canEvaluate() ) - { - try - { - if ( getParentVariable() != null ) - valueString = ee.evaluateExpressionToString( getParentVariable().getQualifiedName() ); - } - catch( DebugException e ) - { - valueString = e.getMessage(); - } - } - return valueString; - } - - public CVariable getParentVariable() - { - return fParent; - } - - protected ICDIVariable getCDIVariable() - { - return fCDIVariable; - } - - public void dispose() - { - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).dispose(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CCoreFileDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CCoreFileDebugTarget.java deleted file mode 100644 index 8df4aaecb46..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CCoreFileDebugTarget.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.model.ICDebugTargetType; -import org.eclipse.core.resources.IFile; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IProcess; - -/** - * Enter type comment. - * - * @since Aug 20, 2003 - */ -public class CCoreFileDebugTarget extends CDebugTarget -{ - public CCoreFileDebugTarget( ILaunch launch, - ICDITarget cdiTarget, - String name, - IProcess debuggerProcess, - IFile file ) - { - super( launch, - ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP, - cdiTarget, - name, - null, - debuggerProcess, - file, - true, - false ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() - { - return !isTerminated(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException - { - setTerminating( true ); - terminated(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java deleted file mode 100644 index 82807174ca1..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugElement.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus; -import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; - -/** - * - * Enter type comment. - * - * @since Aug 1, 2002 - */ -public class CDebugElement extends PlatformObject - implements IDebugElement, - ICDebugElementErrorStatus -{ - private CDebugTarget fDebugTarget; - - private int fSeverity = ICDebugElementErrorStatus.OK; - private String fMessage = null; - - /** - * Constructor for CDebugElement. - */ - public CDebugElement( CDebugTarget target ) - { - setDebugTarget( target ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() - */ - public String getModelIdentifier() - { - return CDebugModel.getPluginIdentifier(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() - */ - public IDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() - */ - public ILaunch getLaunch() - { - return getDebugTarget().getLaunch(); - } - - protected void setDebugTarget( CDebugTarget target ) - { - fDebugTarget = target; - } - - /** - * Logs the given exception. - * - * @param e the internal exception - */ - public void internalError( Exception e ) - { - logError( e ); - } - - /** - * Logs the given message. - * - * @param message the message - */ - public void internalError( String message ) - { - logError( message ); - } - - /** - * Convenience method to log errors - * - */ - protected void logError( Exception e ) - { - CDebugCorePlugin.log( e ); - } - - /** - * Convenience method to log errors - * - */ - protected void logError( String message ) - { - CDebugCorePlugin.log( message ); - } - - /** - * Fires a debug event - * - * @param event The debug event to be fired to the listeners - * @see org.eclipse.debug.core.DebugEvent - */ - protected void fireEvent(DebugEvent event) - { - DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { event } ); - } - - /** - * Fires a debug event marking the creation of this element. - */ - public void fireCreationEvent() - { - fireEvent( new DebugEvent( this, DebugEvent.CREATE ) ); - } - - /** - * Fires a debug event marking the RESUME of this element with - * the associated detail. - * - * @param detail The int detail of the event - * @see org.eclipse.debug.core.DebugEvent - */ - public void fireResumeEvent( int detail ) - { - fireEvent( new DebugEvent( this, DebugEvent.RESUME, detail ) ); - } - - /** - * Fires a debug event marking the SUSPEND of this element with - * the associated detail. - * - * @param detail The int detail of the event - * @see org.eclipse.debug.core.DebugEvent - */ - public void fireSuspendEvent( int detail ) - { - fireEvent( new DebugEvent( this, DebugEvent.SUSPEND, detail ) ); - } - - /** - * Fires a debug event marking the termination of this element. - */ - public void fireTerminateEvent() - { - fireEvent( new DebugEvent( this, DebugEvent.TERMINATE ) ); - } - - /** - * Fires a debug event marking the CHANGE of this element - * with the specifed detail code. - * - * @param detail one of STATE or CONTENT - */ - public void fireChangeEvent( int detail ) - { - fireEvent( new DebugEvent( this, DebugEvent.CHANGE, detail ) ); - } - - /** - * Returns the CDI session associated with this element. - * - * @return the CDI session - */ - public ICDISession getCDISession() - { - return getCDITarget().getSession(); - } - - /** - * Returns the underlying CDI target associated with this element. - * - * @return the underlying CDI target - */ - public ICDITarget getCDITarget() - { - return (ICDITarget)getDebugTarget().getAdapter( ICDITarget.class ); - } - - /** - * Throws a new debug exception with a status code of REQUEST_FAILED. - * - * @param message Failure message - * @param e Exception that has occurred (can be null) - * @throws DebugException The exception with a status code of REQUEST_FAILED - */ - public void requestFailed( String message, Exception e ) throws DebugException - { - requestFailed( message, e, DebugException.REQUEST_FAILED ); - } - - /** - * Throws a new debug exception with a status code of TARGET_REQUEST_FAILED - * with the given underlying exception. If the underlying exception is not a JDI - * exception, the original exception is thrown. - * - * @param message Failure message - * @param e underlying exception that has occurred - * @throws DebugException The exception with a status code of TARGET_REQUEST_FAILED - */ - public void targetRequestFailed( String message, CDIException e ) throws DebugException - { - requestFailed( "Target request failed: " + message, e, DebugException.TARGET_REQUEST_FAILED ); - } - - /** - * Throws a new debug exception with the given status code. - * - * @param message Failure message - * @param e Exception that has occurred (can be null) - * @param code status code - * @throws DebugException a new exception with given status code - */ - public void requestFailed( String message, Throwable e, int code ) throws DebugException - { - throwDebugException( message, code, e ); - } - - /** - * Throws a new debug exception with a status code of TARGET_REQUEST_FAILED. - * - * @param message Failure message - * @param e Throwable that has occurred - * @throws DebugException The exception with a status code of TARGET_REQUEST_FAILED - */ - public void targetRequestFailed( String message, Throwable e ) throws DebugException - { - throwDebugException( "Target request failed: " + message, DebugException.TARGET_REQUEST_FAILED, e ); - } - - /** - * Throws a new debug exception with a status code of NOT_SUPPORTED. - * - * @param message Failure message - * @throws DebugException The exception with a status code of NOT_SUPPORTED. - */ - public void notSupported(String message) throws DebugException { - throwDebugException(message, DebugException.NOT_SUPPORTED, null); - } - - /** - * Throws a debug exception with the given message, error code, and underlying - * exception. - */ - protected void throwDebugException( String message, int code, Throwable exception ) throws DebugException - { - throw new DebugException( new Status( IStatus.ERROR, - CDebugModel.getPluginIdentifier(), - code, - message, - exception ) ); - } - - protected void infoMessage( Throwable e ) - { - IStatus newStatus = new Status( IStatus.INFO, - CDebugCorePlugin.getUniqueIdentifier(), - ICDebugInternalConstants.STATUS_CODE_INFO, - e.getMessage(), - null ); - CDebugUtils.info( newStatus, getDebugTarget() ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICDISession.class ) ) - return getCDISession(); - return super.getAdapter(adapter); - } - - protected void setStatus( int severity, String message ) - { - fSeverity = severity; - fMessage = message; - if ( fMessage != null ) - fMessage.trim(); - } - - protected void resetStatus() - { - fSeverity = ICDebugElementErrorStatus.OK; - fMessage = null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus#isOK() - */ - public boolean isOK() - { - return ( fSeverity == ICDebugElementErrorStatus.OK ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus#getSeverity() - */ - public int getSeverity() - { - return fSeverity; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus#getMessage() - */ - public String getMessage() - { - return fMessage; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java deleted file mode 100644 index 339edfe05c0..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ /dev/null @@ -1,2235 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryModule; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICBreakpointManager; -import org.eclipse.cdt.debug.core.ICMemoryManager; -import org.eclipse.cdt.debug.core.ICRegisterManager; -import org.eclipse.cdt.debug.core.ICSharedLibraryManager; -import org.eclipse.cdt.debug.core.ICSignalManager; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange; -import org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo; -import org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent; -import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; -import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope; -import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger; -import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDisconnectedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.event.ICDIExitedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIRestartedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus; -import org.eclipse.cdt.debug.core.model.ICDebugTarget; -import org.eclipse.cdt.debug.core.model.ICDebugTargetType; -import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator; -import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport; -import org.eclipse.cdt.debug.core.model.IExecFileInfo; -import org.eclipse.cdt.debug.core.model.IGlobalVariable; -import org.eclipse.cdt.debug.core.model.IJumpToAddress; -import org.eclipse.cdt.debug.core.model.IJumpToLine; -import org.eclipse.cdt.debug.core.model.IRunToAddress; -import org.eclipse.cdt.debug.core.model.IRunToLine; -import org.eclipse.cdt.debug.core.model.IState; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode; -import org.eclipse.cdt.debug.internal.core.CBreakpointManager; -import org.eclipse.cdt.debug.internal.core.CMemoryManager; -import org.eclipse.cdt.debug.internal.core.CRegisterManager; -import org.eclipse.cdt.debug.internal.core.CSharedLibraryManager; -import org.eclipse.cdt.debug.internal.core.CSignalManager; -import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; -import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceManager; -import org.eclipse.cdt.debug.internal.core.sourcelookup.DisassemblyManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.IExpressionListener; -import org.eclipse.debug.core.IExpressionManager; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchListener; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.core.model.IMemoryBlock; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.model.IRegisterGroup; -import org.eclipse.debug.core.model.ISourceLocator; -import org.eclipse.debug.core.model.IThread; - -/** - * - * Enter type comment. - * - * @since Aug 1, 2002 - */ -public class CDebugTarget extends CDebugElement - implements ICDebugTarget, - ICDIEventListener, - ILaunchListener, - IExpressionListener -{ - public class RunningInfo - { - private int fType = 0; - private int fStackDepth; - - public RunningInfo( int type, int stackDepth ) - { - fType = type; - fStackDepth = stackDepth; - } - - public int getType() - { - return fType; - } - - public int getStackDepth() - { - return fStackDepth; - } - } - - /** - * The type of this target. - */ - private int fTargetType; - - /** - * Threads contained in this debug target. When a thread - * starts it is added to the list. When a thread ends it - * is removed from the list. - */ - private ArrayList fThreads; - - /** - * Associated inferrior process, or null if not available. - */ - private IProcess fDebuggeeProcess = null; - - /** - * Associated debugger process, or null if not available. - */ - private IProcess fDebuggerProcess = null; - - /** - * The underlying CDI target. - */ - private ICDITarget fCDITarget; - - /** - * The name of this target. - */ - private String fName; - - /** - * Whether this target is suspended. - */ - private boolean fSuspended = true; - - /** - * Whether terminated - */ - private boolean fTerminated; - - /** - * Whether in the process of terminating - */ - private boolean fTerminating; - - /** - * Whether disconnected - */ - private boolean fDisconnected; - - /** - * The launch this target is contained in - */ - private ILaunch fLaunch; - - /** - * The debug configuration of this session - */ - private ICDIConfiguration fConfig; - - /** - * The current state identifier. - */ - private int fCurrentStateId = IState.UNKNOWN; - - /** - * The current state info. - */ - private Object fCurrentStateInfo = null; - - /** - * Count of the number of suspend events in this target - */ - private int fSuspendCount = 0; - - /** - * A memory manager for this target. - */ - private CMemoryManager fMemoryManager; - - /** - * A disassembly manager for this target. - */ - private DisassemblyManager fDisassemblyManager; - - /** - * A shared library manager for this target. - */ - private CSharedLibraryManager fSharedLibraryManager; - - /** - * A signal manager for this target. - */ - private CSignalManager fSignalManager; - - /** - * A register manager for this target. - */ - private CRegisterManager fRegisterManager; - - /** - * A breakpoint manager for this target. - */ - private CBreakpointManager fBreakpointManager; - - /** - * Whether the debugger process is default. - */ - private boolean fIsDebuggerProcessDefault = false; - - /** - * The executable file. - */ - private IFile fExecFile; - - private RunningInfo fRunningInfo = null; - - /** - * Constructor for CDebugTarget. - * @param target - */ - public CDebugTarget( ILaunch launch, - int targetType, - ICDITarget cdiTarget, - String name, - IProcess debuggeeProcess, - IProcess debuggerProcess, - IFile file, - boolean allowsTerminate, - boolean allowsDisconnect ) - { - super( null ); - setLaunch( launch ); - setTargetType( targetType ); - setDebugTarget( this ); - setName( name ); - setProcesses( debuggeeProcess, debuggerProcess ); - setCDITarget( cdiTarget ); - setExecFile( file ); - setConfiguration( cdiTarget.getSession().getConfiguration() ); - setThreadList( new ArrayList( 5 ) ); - setDisassemblyManager( new DisassemblyManager( this ) ); - setSharedLibraryManager( new CSharedLibraryManager( this ) ); - setSignalManager( new CSignalManager( this ) ); - setRegisterManager( new CRegisterManager( this ) ); - setBreakpointManager( new CBreakpointManager( this ) ); - initialize(); - DebugPlugin.getDefault().getLaunchManager().addLaunchListener( this ); - DebugPlugin.getDefault().getExpressionManager().addExpressionListener( this ); - getCDISession().getEventManager().addEventListener( this ); - } - - /** - * Initialize state from the underlying debug session. - * - */ - protected void initialize() - { - initializeState(); - initializeBreakpoints(); - initializeRegisters(); - initializeMemoryManager(); - initializeSourceManager(); - getLaunch().addDebugTarget( this ); - fireCreationEvent(); - } - - private void initializeBreakpoints() - { - DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener( this ); - setBreakpoints(); - } - - /** - * Adds all of the pre-existing threads to this debug target. - * - */ - protected void initializeState() - { - ICDIThread[] threads = new ICDIThread[0]; - try - { - threads = getCDITarget().getThreads(); - } - catch( CDIException e ) - { - // ignore - } - for ( int i = 0; i < threads.length; ++i ) - createThread( threads[i] ); - } - - /** - * Installs all C/C++ breakpoints that currently exist in - * the breakpoint manager. - * - */ - public void setBreakpoints() - { - IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] bps = manager.getBreakpoints( CDebugModel.getPluginIdentifier() ); - for ( int i = 0; i < bps.length; i++ ) - { - if ( bps[i] instanceof ICBreakpoint && - getBreakpointManager().isTargetBreakpoint( (ICBreakpoint)bps[i] ) && - !getBreakpointManager().isCDIRegistered( (ICBreakpoint)bps[i] ) ) - { - if ( bps[i] instanceof ICAddressBreakpoint ) - { - // disable address breakpoints to prevent the debugger to insert them prematurely - try - { - bps[i].setEnabled( false ); - } - catch( CoreException e ) - { - } - } - breakpointAdded0( bps[i] ); - } - } - } - - protected void initializeRegisters() - { - getRegisterManager().initialize(); - } - - protected void initializeMemoryManager() - { - fMemoryManager = new CMemoryManager( this ); - } - - protected void initializeSourceManager() - { - ISourceLocator locator = getLaunch().getSourceLocator(); - if ( locator instanceof IAdaptable ) - { - ICSourceLocator clocator = (ICSourceLocator)((IAdaptable)locator).getAdapter( ICSourceLocator.class ); - if ( clocator instanceof IAdaptable ) - { - CSourceManager sm = (CSourceManager)((IAdaptable)clocator).getAdapter( CSourceManager.class ); - if ( sm != null ) - sm.setDebugTarget( this ); - } - IResourceChangeListener listener = (IResourceChangeListener)((IAdaptable)locator).getAdapter( IResourceChangeListener.class ); - if ( listener != null ) - CCorePlugin.getWorkspace().addResourceChangeListener( listener ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#getProcess() - */ - public IProcess getProcess() - { - return ( fIsDebuggerProcessDefault ) ? fDebuggerProcess : fDebuggeeProcess; - } - - /** - * Sets the process associated with this debug target, - * possibly null. Set on creation. - * - * @param process the system process associated with the - * underlying CDI target, or null if no process is - * associated with this debug target (for example, a core dump debugging). - */ - protected void setProcesses( IProcess debuggeeProcess, IProcess debuggerProcess ) - { - fDebuggeeProcess = debuggeeProcess; - fDebuggerProcess = debuggerProcess; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#getThreads() - */ - public IThread[] getThreads() - { - List threads = getThreadList(); - return (IThread[])threads.toArray( new IThread[threads.size()] ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#hasThreads() - */ - public boolean hasThreads() throws DebugException - { - return getThreadList().size() > 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#getName() - */ - public String getName() throws DebugException - { - return fName; - } - - /** - * Sets the name of this debug target. - * - * @param name the name of this debug target - */ - protected void setName( String name ) - { - fName = name; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(IBreakpoint) - */ - public boolean supportsBreakpoint( IBreakpoint breakpoint ) - { - if ( !getConfiguration().supportsBreakpoints() ) - return false; - return ( breakpoint instanceof ICBreakpoint && getBreakpointManager().isCDIRegistered( (ICBreakpoint)breakpoint ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(ILaunch) - */ - public void launchRemoved( ILaunch launch ) - { - if ( !isAvailable() ) - { - return; - } - if ( launch.equals( getLaunch() ) ) - { - // This target has been deregistered, but it hasn't successfully terminated. - // Update internal state to reflect that it is disconnected - disconnected(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(ILaunch) - */ - public void launchAdded( ILaunch launch ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(ILaunch) - */ - public void launchChanged( ILaunch launch ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() - { - return supportsTerminate() && isAvailable(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() - { - return fTerminated; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException - { - try - { - setTerminating( true ); - getCDITarget().terminate(); - } - catch( CDIException e ) - { - setTerminating( false ); - targetRequestFailed( e.getMessage(), e ); - } - } - - /** - * Sets whether this debug target is terminated - * - * @param terminated true if this debug - * target is terminated, otherwise false - */ - protected void setTerminated( boolean terminated ) - { - fTerminated = terminated; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() - { - return getConfiguration().supportsResume() && isSuspended() && isAvailable(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() - { - if ( !getConfiguration().supportsSuspend() ) - return false; - if ( !isSuspended() && isAvailable() ) - { - // only allow suspend if no threads are currently suspended - IThread[] threads = getThreads(); - for ( int i = 0; i < threads.length; i++ ) - { - if ( threads[i].isSuspended() ) - { - return false; - } - } - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() - { - return fSuspended; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException - { - if ( !isSuspended() ) - return; - try - { - getCDITarget().resume(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException - { - if ( isSuspended() ) - return; - try - { - getCDITarget().suspend(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /** - * Notifies threads that they have been suspended. - * - */ - protected void suspendThreads( ICDISuspendedEvent event ) - { - Iterator it = getThreadList().iterator(); - while( it.hasNext() ) - { - ((CThread)it.next()).handleDebugEvent( event ); - } - } - - /** - * Refreshes the thread list. - * - */ - protected synchronized List refreshThreads() - { - ArrayList list = new ArrayList( 5 ); - ArrayList newThreads = new ArrayList( 5 ); - try - { - ICDIThread[] cdiThreads = getCDITarget().getThreads(); - for ( int i = 0; i < cdiThreads.length; ++i ) - { - CThread thread = findThread( cdiThreads[i] ); - if ( thread == null ) - { - thread = new CThread( this, cdiThreads[i] ); - newThreads.add( thread ); - } - else - { - getThreadList().remove( thread ); - } - list.add( thread ); - } - Iterator it = getThreadList().iterator(); - while( it.hasNext() ) - { - ((CThread)it.next()).terminated(); - } - getThreadList().clear(); - setThreadList( list ); - it = newThreads.iterator(); - while( it.hasNext() ) - { - ((CThread)it.next()).fireCreationEvent(); - } - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - setCurrentThread(); - return newThreads; - } - - /** - * Notifies threads that they have been resumed - */ - protected void resumeThreads( ICDIResumedEvent event ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(IBreakpoint) - */ - public void breakpointAdded( IBreakpoint breakpoint ) - { - if ( !(breakpoint instanceof ICBreakpoint) || - !getBreakpointManager().isTargetBreakpoint( (ICBreakpoint)breakpoint ) || - !isAvailable() ) - return; - breakpointAdded0( breakpoint ); - } - - private void breakpointAdded0( IBreakpoint breakpoint ) - { - if ( !isAvailable() ) - return; - if ( breakpoint instanceof ICAddressBreakpoint && !getBreakpointManager().supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ) ) - return; - if ( getConfiguration().supportsBreakpoints() ) - { - try - { - getBreakpointManager().setBreakpoint( (ICBreakpoint)breakpoint ); - } - catch( DebugException e ) - { - } - DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( breakpoint ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(IBreakpoint, IMarkerDelta) - */ - public void breakpointRemoved( IBreakpoint breakpoint, IMarkerDelta delta ) - { - if ( !(breakpoint instanceof ICBreakpoint) || - !getBreakpointManager().isTargetBreakpoint( (ICBreakpoint)breakpoint ) || - !isAvailable() ) - return; - try - { - getBreakpointManager().removeBreakpoint( (ICBreakpoint)breakpoint ); - } - catch( DebugException e ) - { - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(IBreakpoint, IMarkerDelta) - */ - public void breakpointChanged( IBreakpoint breakpoint, IMarkerDelta delta ) - { - if ( !(breakpoint instanceof ICBreakpoint) || - !getBreakpointManager().isTargetBreakpoint( (ICBreakpoint)breakpoint ) || - !isAvailable() || - delta == null ) - return; - try - { - getBreakpointManager().changeBreakpointProperties( (ICBreakpoint)breakpoint, delta ); - } - catch( DebugException e ) - { - } - } - - /** - * Returns whether this debug target supports disconnecting. - * - * @return whether this debug target supports disconnecting - */ - protected boolean supportsDisconnect() - { - return getConfiguration().supportsDisconnect(); - } - - /** - * Returns whether this debug target supports termination. - * - * @return whether this debug target supports termination - */ - protected boolean supportsTerminate() - { - return getConfiguration().supportsTerminate(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDisconnect#canDisconnect() - */ - public boolean canDisconnect() - { - return supportsDisconnect() && isAvailable(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDisconnect#disconnect() - */ - public void disconnect() throws DebugException - { - if ( isDisconnected() ) - { - // already done - return; - } - - if ( !canDisconnect() ) - { - notSupported( "Session does not support \'disconnect\'" ); - } - - try - { - getCDITarget().disconnect(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDisconnect#isDisconnected() - */ - public boolean isDisconnected() - { - return fDisconnected; - } - - /** - * Sets whether this debug target is disconnected - * - * @param disconnected true if this debug - * target is disconnected, otherwise false - */ - protected void setDisconnected( boolean disconnected ) - { - fDisconnected = disconnected; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval() - */ - public boolean supportsStorageRetrieval() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long) - */ - public IMemoryBlock getMemoryBlock( long startAddress, long length ) throws DebugException - { - return null; - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() - */ - public ILaunch getLaunch() - { - return fLaunch; - } - - /** - * Sets the launch this target is contained in - * - * @param launch the launch this target is contained in - */ - private void setLaunch( ILaunch launch ) - { - fLaunch = launch; - } - - /** - * Returns the list of threads contained in this debug target. - * - * @return list of threads - */ - protected ArrayList getThreadList() - { - return fThreads; - } - - /** - * Sets the list of threads contained in this debug target. - * Set to an empty collection on creation. Threads are - * added and removed as they start and end. On termination - * this collection is set to the immutable singleton empty list. - * - * @param threads empty list - */ - private void setThreadList( ArrayList threads ) - { - fThreads = threads; - } - - private void setCDITarget( ICDITarget cdiTarget ) - { - fCDITarget = cdiTarget; - } - - /* (non-Javadoc) - * @see IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( IDebugTarget.class ) ) - return this; - if ( adapter.equals( CDebugTarget.class ) ) - return this; - if ( adapter.equals( ICDITarget.class ) ) - return fCDITarget; - if ( adapter.equals( IState.class ) ) - return this; - if ( adapter.equals( ICExpressionEvaluator.class ) ) - return this; - if ( adapter.equals( ICDebugTargetType.class ) ) - return this; - if ( adapter.equals( ISourceMode.class ) ) - { - if ( getSourceLocator() instanceof IAdaptable ) - { - return ((IAdaptable)getSourceLocator()).getAdapter( ISourceMode.class ); - } - } - if ( adapter.equals( ICMemoryManager.class ) ) - return getMemoryManager(); - if ( adapter.equals( IDebuggerProcessSupport.class ) ) - return this; - if ( adapter.equals( IExecFileInfo.class ) ) - return this; - if ( adapter.equals( IRunToLine.class ) ) - return this; - if ( adapter.equals( IRunToAddress.class ) ) - return this; - if ( adapter.equals( IJumpToLine.class ) ) - return this; - if ( adapter.equals( IJumpToAddress.class ) ) - return this; - if ( adapter.equals( ICBreakpointManager.class ) ) - return getBreakpointManager(); - if ( adapter.equals( DisassemblyManager.class ) ) - return getDisassemblyManager(); - if ( adapter.equals( ICSharedLibraryManager.class ) ) - return getSharedLibraryManager(); - if ( adapter.equals( ICSignalManager.class ) ) - return getSignalManager(); - if ( adapter.equals( ICRegisterManager.class ) ) - return getRegisterManager(); - return super.getAdapter( adapter ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - ICDIObject source = event.getSource(); - if ( source == null && event instanceof ICDIDestroyedEvent ) - { - handleTerminatedEvent( (ICDIDestroyedEvent)event ); - } - else if ( source.getTarget().equals( getCDITarget() ) ) - { - if ( event instanceof ICDICreatedEvent ) - { - if ( source instanceof ICDIThread ) - { - handleThreadCreatedEvent( (ICDICreatedEvent)event ); - } - if ( source instanceof ICDISharedLibrary ) - { - getSharedLibraryManager().sharedLibraryLoaded( (ICDISharedLibrary)source ); - } - } - else if ( event instanceof ICDISuspendedEvent ) - { - if ( source instanceof ICDITarget || source instanceof ICDIThread ) - { - handleSuspendedEvent( (ICDISuspendedEvent)event ); - } - } - else if ( event instanceof ICDIResumedEvent ) - { - if ( source instanceof ICDITarget ) - { - handleResumedEvent( (ICDIResumedEvent)event ); - } - } - else if ( event instanceof ICDIExitedEvent ) - { - if ( source instanceof ICDITarget ) - { - handleExitedEvent( (ICDIExitedEvent)event ); - } - } - else if ( event instanceof ICDIDestroyedEvent ) - { - if ( source instanceof ICDIThread ) - { - handleThreadTerminatedEvent( (ICDIDestroyedEvent)event ); - } - if ( source instanceof ICDISharedLibrary ) - { - getSharedLibraryManager().sharedLibraryUnloaded( (ICDISharedLibrary)source ); - } - } - else if ( event instanceof ICDIDisconnectedEvent ) - { - if ( source instanceof ICDITarget ) - { - handleDisconnectedEvent( (ICDIDisconnectedEvent)event ); - } - } - else if ( event instanceof ICDIChangedEvent ) - { - if ( source instanceof ICDITarget ) - { - handleChangedEvent( (ICDIChangedEvent)event ); - } - if ( source instanceof ICDISharedLibrary ) - { - getSharedLibraryManager().symbolsLoaded( (ICDISharedLibrary)source ); - } - if ( source instanceof ICDISignal ) - { - getSignalManager().signalChanged( (ICDISignal)source ); - } - } - else if ( event instanceof ICDIRestartedEvent ) - { - if ( source instanceof ICDITarget ) - { - handleRestartedEvent( (ICDIRestartedEvent)event ); - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRestart#canRestart() - */ - public boolean canRestart() - { - return getConfiguration().supportsRestart() && isSuspended() && isAvailable(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRestart#restart() - */ - public void restart() throws DebugException - { - if ( !canRestart() ) - { - return; - } - - try - { - ICDILocation location = getCDISession().getBreakpointManager().createLocation( "", "main", 0 ); - setInternalTemporaryBreakpoint( location ); - getCDITarget().restart(); - restarted(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /** - * Updates the state of this target for restarting. - * - */ - protected void restarted() - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryRetrieval#getSupportedFormats() - */ - public int[] getSupportedFormats() throws DebugException - { - return null; - } - - /** - * Returns whether this target is available to handle client - * requests. - * - * @return whether this target is available to handle client requests - */ - public boolean isAvailable() - { - return !( isTerminated() || isTerminating() || isDisconnected() ); - } - - /** - * Sets whether this target is suspended. - * - * @param suspended whether this target is suspended - */ - private void setSuspended( boolean suspended ) - { - fSuspended = suspended; - } - - /** - * Returns whether this target is in the process of terminating. - * - * @return whether this target is terminating - */ - protected boolean isTerminating() - { - return fTerminating; - } - - /** - * Sets whether this target is in the process of terminating. - * - * @param terminating whether this target is terminating - */ - protected void setTerminating( boolean terminating ) - { - fTerminating = terminating; - } - - /** - * Updates the state of this target to be terminated, - * if not already terminated. - */ - protected void terminated() - { - setTerminating( false ); - if ( !isTerminated() ) - { - if ( !isDisconnected() ) - { - setTerminated( true ); - } - cleanup(); - fireTerminateEvent(); - } - } - - /** - * Updates the state of this target for disconnection. - * - */ - protected void disconnected() - { - if ( !isDisconnected() ) - { - setDisconnected( true ); - cleanup(); - fireTerminateEvent(); - } - } - - /** - * Cleans up the internal state of this debug target as a result - * of a session ending. - * - */ - protected void cleanup() - { - resetStatus(); - removeAllThreads(); - getCDISession().getEventManager().removeEventListener( this ); - DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener( this ); - DebugPlugin.getDefault().getExpressionManager().removeExpressionListener( this ); - DebugPlugin.getDefault().getLaunchManager().removeLaunchListener( this ); - disposeMemoryManager(); - disposeSharedLibraryManager(); - disposeSignalManager(); - disposeRegisterManager(); - disposeDisassemblyManager(); - disposeSourceManager(); - disposeBreakpointManager(); - removeAllExpressions(); - } - - /** - * Removes all threads from this target's collection - * of threads, firing a terminate event for each. - * - */ - protected void removeAllThreads() - { - Iterator itr = getThreadList().iterator(); - setThreadList( new ArrayList( 0 ) ); - while( itr.hasNext() ) - { - CThread thread = (CThread)itr.next(); - thread.terminated(); - } - } - - /** - * Removes all expressions from this target. - * - */ - protected void removeAllExpressions() - { - IExpressionManager em = DebugPlugin.getDefault().getExpressionManager(); - IExpression[] expressions = em.getExpressions(); - for ( int i = 0; i < expressions.length; ++i ) - { - if ( expressions[i] instanceof CExpression && expressions[i].getDebugTarget().equals( this ) ) - { - em.removeExpression( expressions[i] ); - } - } - } - - /** - * Creates, adds and returns a thread for the given underlying - * CDI thread. A creation event is fired for the thread. - * Returns null if during the creation of the thread - * this target is set to the disconnected state. - * - * @param thread the underlying CDI thread - * @return model thread - */ - protected CThread createThread( ICDIThread cdiThread ) - { - CThread thread = new CThread( this, cdiThread ); - getThreadList().add( thread ); - thread.fireCreationEvent(); - return thread; - } - - /** - * Creates a new thread from the given CDI thread and initializes - * its state to "Running". - * - * @see CDebugTarget#createThread(ICDIThread) - */ - protected CThread createRunningThread( ICDIThread cdiThread ) - { - CThread thread = new CThread( this, cdiThread ); - thread.setRunning( true ); - getThreadList().add( thread ); - thread.fireCreationEvent(); - return thread; - } - - private void handleSuspendedEvent( ICDISuspendedEvent event ) - { - setSuspended( true ); - setCurrentStateId( IState.SUSPENDED ); - ICDISessionObject reason = event.getReason(); - setCurrentStateInfo( reason ); - setRunningInfo( null ); - List newThreads = refreshThreads(); - if ( event.getSource() instanceof ICDITarget ) - { - suspendThreads( event ); - fireSuspendEvent( DebugEvent.UNSPECIFIED ); - } - // We need this for debuggers that don't have notifications - // for newly created threads. - else if ( event.getSource() instanceof ICDIThread ) - { - CThread thread = findThread( (ICDIThread)event.getSource() ); - if ( thread != null && newThreads.contains( thread ) ) - { - thread.handleDebugEvent( event ); - } - } - if ( reason instanceof ICDIEndSteppingRange ) - { - handleEndSteppingRange( (ICDIEndSteppingRange)reason ); - } - else if ( reason instanceof ICDIBreakpointHit ) - { - handleBreakpointHit( (ICDIBreakpointHit)reason ); - } - else if ( reason instanceof ICDISignalReceived ) - { - handleSuspendedBySignal( (ICDISignalReceived)reason ); - } - else if ( reason instanceof ICDIWatchpointTrigger ) - { - handleWatchpointTrigger( (ICDIWatchpointTrigger)reason ); - } - else if ( reason instanceof ICDIWatchpointScope ) - { - handleWatchpointScope( (ICDIWatchpointScope)reason ); - } - else if ( reason instanceof ICDIErrorInfo ) - { - handleErrorInfo( (ICDIErrorInfo)reason ); - } - else if ( reason instanceof ICDISharedLibraryEvent ) - { - handleSuspendedBySolibEvent( (ICDISharedLibraryEvent)reason ); - } - - } -/* - private boolean handleInternalSuspendedEvent( ICDISuspendedEvent event ) - { - setRetryBreakpoints( true ); - setBreakpoints(); - RunningInfo info = getRunningInfo(); - if ( info != null ) - { - switch( info.getType() ) - { - case ICDIResumedEvent.CONTINUE: - return internalResume(); - case ICDIResumedEvent.STEP_INTO: - return internalStepInto( info.getStackDepth() ); - case ICDIResumedEvent.STEP_OVER: - return internalStepOver( info.getStackDepth() ); - case ICDIResumedEvent.STEP_RETURN: - return internalStepReturn( info.getStackDepth() ); - } - } - return internalResume(); - } - - private boolean internalResume() - { - boolean result = false; - try - { - getCDITarget().resume(); - } - catch( CDIException e ) - { - result = true; - } - return result; - } - - private boolean internalStepInto( int oldDepth ) - { - return internalStepOver( oldDepth ); - } - - private boolean internalStepOver( int oldDepth ) - { - boolean result = true; - try - { - CThread thread = (CThread)getCurrentThread(); - if ( thread != null ) - { - int depth = thread.getStackDepth(); - if ( oldDepth < depth ) - { - ICDIStackFrame[] frames = thread.getCDIStackFrames( depth - oldDepth - 1, depth - oldDepth - 1 ); - if ( frames.length == 1 ) - { - thread.getCDIThread().setCurrentStackFrame( frames[0] ); - getCDITarget().stepReturn(); - result = false; - } - } - } - } - catch( CDIException e ) - { - } - catch( DebugException e ) - { - } - return result; - } - - private boolean internalStepReturn( int oldDepth ) - { - boolean result = true; - try - { - CThread thread = (CThread)getCurrentThread(); - if ( thread != null ) - { - int depth = thread.getStackDepth(); - if ( oldDepth < depth ) - { - ICDIStackFrame[] frames = thread.getCDIStackFrames( depth - oldDepth, depth - oldDepth ); - if ( frames.length == 1 ) - { - thread.getCDIThread().setCurrentStackFrame( frames[0] ); - getCDITarget().stepReturn(); - result = false; - } - } - } - } - catch( CDIException e ) - { - } - catch( DebugException e ) - { - } - return result; - } -*/ - private void handleResumedEvent( ICDIResumedEvent event ) - { - setSuspended( false ); - setCurrentStateId( IState.RUNNING ); - setCurrentStateInfo( null ); - resetStatus(); - resumeThreads( event ); - int detail = DebugEvent.UNSPECIFIED; - switch( event.getType() ) - { - case ICDIResumedEvent.CONTINUE: - detail = DebugEvent.CLIENT_REQUEST; - break; - case ICDIResumedEvent.STEP_INTO: - case ICDIResumedEvent.STEP_INTO_INSTRUCTION: - detail = DebugEvent.STEP_INTO; - break; - case ICDIResumedEvent.STEP_OVER: - case ICDIResumedEvent.STEP_OVER_INSTRUCTION: - detail = DebugEvent.STEP_OVER; - break; - case ICDIResumedEvent.STEP_RETURN: - detail = DebugEvent.STEP_RETURN; - break; - } - if ( getRunningInfo() == null ) - setRunningInfo( event.getType() ); - fireResumeEvent( detail ); - } - - private void handleEndSteppingRange( ICDIEndSteppingRange endSteppingRange ) - { - fireSuspendEvent( DebugEvent.UNSPECIFIED ); - } - - private void handleBreakpointHit( ICDIBreakpointHit breakpointHit ) - { - fireSuspendEvent( DebugEvent.BREAKPOINT ); - } - - private void handleWatchpointTrigger( ICDIWatchpointTrigger wt ) - { - fireSuspendEvent( DebugEvent.BREAKPOINT ); - } - - private void handleWatchpointScope( ICDIWatchpointScope ws ) - { - ICBreakpoint watchpoint = getBreakpointManager().getBreakpoint( ws.getWatchpoint() ); - if ( watchpoint != null ) - { - try - { - getBreakpointManager().removeBreakpoint( watchpoint ); - } - catch( DebugException e ) - { - CDebugCorePlugin.log( e ); - } - fireSuspendEvent( DebugEvent.BREAKPOINT ); - } - } - - private void handleSuspendedBySignal( ICDISignalReceived signal ) - { - fireSuspendEvent( DebugEvent.UNSPECIFIED ); - } - - private void handleErrorInfo( ICDIErrorInfo info ) - { - setStatus( ICDebugElementErrorStatus.ERROR, ( info != null ) ? info.getMessage() : null ); - if ( info != null ) - { - MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), - ICDebugInternalConstants.STATUS_CODE_ERROR, - "The execution of program is suspended because of error.", - null ); - StringTokenizer st = new StringTokenizer( info.getDetailMessage(), "\n\r" ); - while( st.hasMoreTokens() ) - { - String token = st.nextToken(); - if ( token.length() > 200 ) - { - token = token.substring( 0, 200 ); - } - status.add( new Status( IStatus.ERROR, - status.getPlugin(), - ICDebugInternalConstants.STATUS_CODE_ERROR, - token, - null ) ); - } - CDebugUtils.error( status, this ); - } - } - - private void handleSuspendedBySolibEvent( ICDISharedLibraryEvent solibEvent ) - { - fireSuspendEvent( DebugEvent.UNSPECIFIED ); - } - - private void handleExitedEvent( ICDIExitedEvent event ) - { - removeAllThreads(); - setCurrentStateId( IState.EXITED ); - setCurrentStateInfo( event.getReason() ); - fireChangeEvent( DebugEvent.CONTENT ); - if ( getConfiguration().terminateSessionOnExit() ) - terminated(); - } - - private void handleTerminatedEvent( ICDIDestroyedEvent event ) - { - terminated(); - } - - private void handleDisconnectedEvent( ICDIDisconnectedEvent event ) - { - setCurrentStateId( IState.DISCONNECTED ); - setCurrentStateInfo( null ); - disconnected(); - } - - private void handleChangedEvent( ICDIChangedEvent event ) - { - } - - private void handleRestartedEvent( ICDIRestartedEvent event ) - { - } - - private void handleThreadCreatedEvent( ICDICreatedEvent event ) - { - ICDIThread cdiThread = (ICDIThread)event.getSource(); - CThread thread = findThread( cdiThread ); - if ( thread == null ) - { - createThread( cdiThread ); - } - } - - private void handleThreadTerminatedEvent( ICDIDestroyedEvent event ) - { - ICDIThread cdiThread = (ICDIThread)event.getSource(); - CThread thread = findThread( cdiThread ); - if ( thread != null) - { - getThreadList().remove( thread ); - thread.terminated(); - } - } - - /** - * Finds and returns the model thread for the associated CDI thread, - * or null if not found. - * - * @param the underlying CDI thread - * @return the associated model thread - */ - public CThread findThread( ICDIThread cdiThread ) - { - List threads = getThreadList(); - for ( int i = 0; i < threads.size(); i++ ) - { - CThread t = (CThread)threads.get( i ); - if ( t.getCDIThread().equals( cdiThread ) ) - return t; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IState#getCurrentStateId() - */ - public int getCurrentStateId() - { - return fCurrentStateId; - } - - /** - * Sets the current state identifier. - * - * @param id the identifier - */ - private void setCurrentStateId( int id ) - { - fCurrentStateId = id; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IState#getCurrentStateInfo() - */ - public Object getCurrentStateInfo() - { - return fCurrentStateInfo; - } - - /** - * Sets the info object of the current state. - * - * @param id the info object - */ - private void setCurrentStateInfo( Object info ) - { - fCurrentStateInfo = info; - } - - /** - * Returns the number of suspend events that have occurred in this - * target. - * - * @return the number of suspend events that have occurred in this - * target - */ - protected int getSuspendCount() - { - return fSuspendCount; - } - - /** - * Increments the suspend counter for this target. - */ - protected void incrementSuspendCount() - { - fSuspendCount++; - } - - /** - * Overrides the superclass method by incrementing the suspend counter. - * - * @param detail The int detail of the event - * @see org.eclipse.debug.core.DebugEvent - */ - public void fireSuspendEvent( int detail ) - { - incrementSuspendCount(); - super.fireSuspendEvent( detail ); - } - - protected void setCurrentThread() - { - ICDIThread currentCDIThread = null; - try - { - currentCDIThread = getCDITarget().getCurrentThread(); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - Iterator it = getThreadList().iterator(); - while( it.hasNext() ) - { - CThread thread = (CThread)it.next(); - thread.setCurrent( currentCDIThread != null && thread.getCDIThread().equals( currentCDIThread ) ); - } - if ( currentCDIThread == null && !getThreadList().isEmpty() ) - { - ((CThread)getThreadList().get( 0 )).setCurrent( true ); - } - } - - /** - * Returns the debug configuration of this target. - * - * @return the debug configuration of this target - */ - protected ICDIConfiguration getConfiguration() - { - return fConfig; - } - - /** - * Sets the debug configuration of this target. - * - * @param config the debug configuration to set - */ - private void setConfiguration( ICDIConfiguration config ) - { - fConfig = config; - } - - protected boolean supportsExpressionEvaluation() - { - return getConfiguration().supportsExpressionEvaluation(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICExpressionEvaluator#evaluateExpressionToString(String) - */ - public String evaluateExpressionToString( String expression ) throws DebugException - { - try - { - return getCDITarget().evaluateExpressionToString( expression ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICExpressionEvaluator#canEvaluate() - */ - public boolean canEvaluate() - { - return supportsExpressionEvaluation() && isAvailable() && isSuspended(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionListener#expressionAdded(IExpression) - */ - public void expressionAdded( IExpression expression ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionListener#expressionChanged(IExpression) - */ - public void expressionChanged( IExpression expression ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionListener#expressionRemoved(IExpression) - */ - public void expressionRemoved( IExpression expression ) - { - if ( expression != null && expression.getDebugTarget().equals( this ) && expression instanceof CExpression ) - { - ICDIExpressionManager em = getCDISession().getExpressionManager(); - try - { - em.destroyExpression( ((CExpression)expression).getCDIExpression() ); - } - catch( CDIException e ) - { - // do nothing - } - } - } - - public void setInternalTemporaryBreakpoint( ICDILocation location ) throws DebugException - { - try - { - getCDISession().getBreakpointManager().setLocationBreakpoint( ICDIBreakpoint.TEMPORARY, - location, - null, - null ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRunToLine#canRunToLine(IResource, int) - */ - public boolean canRunToLine( String fileName, int lineNumber ) - { - // check if supports run to line - return canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRunToLine#runToLine(IResource, int) - */ - public void runToLine( String fileName, int lineNumber ) throws DebugException - { - if ( !canRunToLine( fileName, lineNumber ) ) - return; - ICDILocation location = getCDISession().getBreakpointManager().createLocation( fileName, null, lineNumber ); - try - { - getCDITarget().runUntil( location ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRunToLine#canRunToLine(IResource, int) - */ - public boolean canRunToLine( IFile file, int lineNumber ) - { - // check if supports run to line - return canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRunToLine#runToLine(IResource, int) - */ - public void runToLine( IFile file, int lineNumber ) throws DebugException - { - if ( !canRunToLine( file, lineNumber ) ) - return; - runToLine( file.getLocation().lastSegment(), lineNumber ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ISwitchToThread#setCurrentThread(IThread) - */ - public void setCurrentThread( IThread thread ) throws DebugException - { - if ( !isSuspended() || !isAvailable() || thread == null || !(thread instanceof CThread) ) - return; - try - { - CThread oldThread = (CThread)getCurrentThread(); - if ( !thread.equals( oldThread ) ) - { - if ( oldThread != null ) - oldThread.setCurrent( false ); - getCDITarget().setCurrentThread( ((CThread)thread).getCDIThread() ); - ((CThread)thread).setCurrent( true ); - } - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - /** - * @see org.eclipse.cdt.debug.core.ISwitchToThread#getCurrentThread() - */ - public IThread getCurrentThread() throws DebugException - { - IThread[] threads = getThreads(); - for ( int i = 0; i < threads.length; ++i ) - { - if ( ((CThread)threads[i]).isCurrent() ) - return threads[i]; - } - return null; - } - - protected ISourceLocator getSourceLocator() - { - return getLaunch().getSourceLocator(); - } - - protected void resetRegisters() - { - getRegisterManager().reset(); - } - - /** - * @see org.eclipse.cdt.debug.core.ICDebugTargetType#getTargetType() - */ - public int getTargetType() - { - return fTargetType; - } - - private void setTargetType( int targetType ) - { - fTargetType = targetType; - } - - protected boolean isCoreDumpTarget() - { - return ( getTargetType() == ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP ); - } - - protected int getRealSourceMode() - { - ISourceLocator sl = getSourceLocator(); - if ( sl != null && - sl instanceof IAdaptable && - ((IAdaptable)sl).getAdapter( ICSourceLocator.class ) != null && - ((IAdaptable)sl).getAdapter( ICSourceLocator.class ) instanceof CSourceManager ) - { - return ((CSourceManager)((IAdaptable)sl).getAdapter( ICSourceLocator.class )).getRealMode(); - } - return ISourceMode.MODE_SOURCE; - } - - protected CMemoryManager getMemoryManager() - { - return fMemoryManager; - } - - protected void disposeMemoryManager() - { - getMemoryManager().dispose(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IDebuggerProcessSupport#isDefault() - */ - public boolean isDebuggerProcessDefault() - { - return fIsDebuggerProcessDefault; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IDebuggerProcessSupport#setDefault(boolean) - */ - public void setDebuggerProcessDefault( boolean value ) - { - fIsDebuggerProcessDefault = value; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IDebuggerProcessSupport#supportsDebuggerProcess() - */ - public boolean supportsDebuggerProcess() - { - return ( fDebuggerProcess != null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IExecFileInfo#isLittleEndian() - */ - public boolean isLittleEndian() - { - if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) ) - { - ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() ); - if ( cFile instanceof IBinary ) - { - ((IBinary)cFile).isLittleEndian(); - } - } - return true; - } - - public IFile getExecFile() - { - return fExecFile; - } - - private void setExecFile( IFile file ) - { - fExecFile = file; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IExecFileInfo#getGlobals() - */ - public IGlobalVariable[] getGlobals() - { - ArrayList list = new ArrayList(); - if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) ) - { - ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() ); - if ( cFile instanceof IParent ) - { - list.addAll( getCFileGlobals( (IParent)cFile ) ); - } - } - return (IGlobalVariable[])list.toArray( new IGlobalVariable[list.size()] ); - } - - private List getCFileGlobals( IParent file ) - { - ArrayList list = new ArrayList(); - ICElement[] elements = file.getChildren(); - for ( int i = 0; i < elements.length; ++i ) - { - if ( elements[i] instanceof org.eclipse.cdt.core.model.IVariable ) - { - list.add( createGlobalVariable( (org.eclipse.cdt.core.model.IVariable)elements[i] ) ); - } - else if ( elements[i] instanceof org.eclipse.cdt.core.model.IParent ) - { - list.addAll( getCFileGlobals( (org.eclipse.cdt.core.model.IParent)elements[i] ) ); - } - } - return list; - } - - private IGlobalVariable createGlobalVariable( final org.eclipse.cdt.core.model.IVariable var ) - { - return new IGlobalVariable() - { - public String getName() - { - return var.getElementName(); - } - - public IPath getPath() - { - IPath path = new Path(""); - ICElement parent = var.getParent(); - if ( parent instanceof IBinaryModule ) - { - path = ((IBinaryModule)parent).getPath(); - } - return path; - } - }; - } - - protected void setDisassemblyManager( DisassemblyManager dm ) - { - fDisassemblyManager = dm; - } - - protected DisassemblyManager getDisassemblyManager() - { - return fDisassemblyManager; - } - - protected void setSharedLibraryManager( CSharedLibraryManager libman ) - { - fSharedLibraryManager = libman; - } - - protected CSharedLibraryManager getSharedLibraryManager() - { - return fSharedLibraryManager; - } - - protected void disposeSharedLibraryManager() - { - fSharedLibraryManager.dispose(); - } - - protected void setSignalManager( CSignalManager sm ) - { - fSignalManager = sm; - } - - protected CSignalManager getSignalManager() - { - return fSignalManager; - } - - protected void disposeSignalManager() - { - fSignalManager.dispose(); - } - - protected void disposeRegisterManager() - { - fRegisterManager.dispose(); - } - - protected void disposeDisassemblyManager() - { - fDisassemblyManager.dispose(); - } - - /** - * @see org.eclipse.cdt.debug.core.model.IRunToAddress#canRunToAddress(long) - */ - public boolean canRunToAddress( long address ) - { - // for now - return canResume(); - } - - /** - * @see org.eclipse.cdt.debug.core.model.IRunToAddress#runToLine(long) - */ - public void runToAddress( long address ) throws DebugException - { - if ( !canRunToAddress( address ) ) - return; - ICDILocation location = getCDISession().getBreakpointManager().createLocation( address ); - try - { - getCDITarget().runUntil( location ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IResumeWithoutSignal#canResumeWithoutSignal() - */ - public boolean canResumeWithoutSignal() - { - // Check if the configuration supports this!!! - return ( isSuspended() && getCurrentStateInfo() instanceof ICDISignalReceived ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IResumeWithoutSignal#resumeWithoutSignal() - */ - public void resumeWithoutSignal() throws DebugException - { - try - { - getCDITarget().signal(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IJumpToLine#canJumpToLine(IResource, int) - */ - public boolean canJumpToLine( IFile file, int lineNumber ) - { - // check if supports jump to line - return canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IJumpToLine#jumpToLine(IResource, int) - */ - public void jumpToLine( IFile file, int lineNumber ) throws DebugException - { - if ( !canJumpToLine( file, lineNumber ) ) - return; - jumpToLine( file.getLocation().lastSegment(), lineNumber ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IJumpToLine#canJumpToLine(IResource, int) - */ - public boolean canJumpToLine( String fileName, int lineNumber ) - { - // check if supports jump to line - return canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IJumpToLine#jumpToLine(IResource, int) - */ - public void jumpToLine( String fileName, int lineNumber ) throws DebugException - { - if ( !canJumpToLine( fileName, lineNumber ) ) - return; - ICDILocation location = getCDISession().getBreakpointManager().createLocation( fileName, null, lineNumber ); - try - { - getCDITarget().jump( location ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#canJumpToAddress(long) - */ - public boolean canJumpToAddress( long address ) - { - // check if supports jump to address - return canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#jumpToAddress(long) - */ - public void jumpToAddress( long address ) throws DebugException - { - if ( !canJumpToAddress( address ) ) - return; - ICDILocation location = getCDISession().getBreakpointManager().createLocation( address ); - try - { - getCDITarget().jump( location ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - public CRegisterManager getRegisterManager() - { - return fRegisterManager; - } - - protected void setRegisterManager( CRegisterManager registerManager ) - { - fRegisterManager = registerManager; - } - - public IRegisterGroup[] getRegisterGroups() throws DebugException - { - return getRegisterManager().getRegisterGroups(); - } - - protected void disposeSourceManager() - { - ISourceLocator locator = getSourceLocator(); - if ( locator instanceof IAdaptable ) - { - IResourceChangeListener listener = (IResourceChangeListener)((IAdaptable)locator).getAdapter( IResourceChangeListener.class ); - if ( listener != null ) - CCorePlugin.getWorkspace().removeResourceChangeListener( listener ); - } - } - - protected RunningInfo getRunningInfo() - { - return fRunningInfo; - } - - public IFile getCurrentBreakpointFile() - { - Object info = getCurrentStateInfo(); - if ( info instanceof ICDIBreakpointHit ) - { - ICDIBreakpoint cdiBreakpoint = ((ICDIBreakpointHit)info).getBreakpoint(); - if ( cdiBreakpoint != null ) - return getBreakpointManager().getCDIBreakpointFile( cdiBreakpoint ); - } - return null; - } - - protected void setRunningInfo( RunningInfo info ) - { - fRunningInfo = info; - } - - protected void setRunningInfo( int type ) - { - RunningInfo info = null; - try - { - CThread thread = (CThread)getCurrentThread(); - if ( thread != null ) - { - int depth = thread.getLastStackDepth(); - if ( depth > 0 ) - { - info = new RunningInfo( type, depth ); - } - } - } - catch( DebugException e ) - { - } - setRunningInfo( info ); - } - - protected CBreakpointManager getBreakpointManager() - { - return fBreakpointManager; - } - - protected void setBreakpointManager( CBreakpointManager manager ) - { - fBreakpointManager = manager; - } - - protected void disposeBreakpointManager() - { - if ( getBreakpointManager() != null ) - getBreakpointManager().dispose(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDummyStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDummyStackFrame.java deleted file mode 100644 index 0c0c892b2bd..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDummyStackFrame.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.model.IDummyStackFrame; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegisterGroup; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.IThread; -import org.eclipse.debug.core.model.IVariable; - -/** - * Enter type comment. - * - * @since: Nov 13, 2002 - */ -public class CDummyStackFrame extends CDebugElement implements IStackFrame, IDummyStackFrame -{ - /** - * Containing thread. - */ - private CThread fThread; - - /** - * Constructor for CDummyStackFrame. - * @param target - */ - public CDummyStackFrame( CThread thread ) - { - super( (CDebugTarget)thread.getDebugTarget() ); - setThread( thread ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getThread() - */ - public IThread getThread() - { - return fThread; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getVariables() - */ - public IVariable[] getVariables() throws DebugException - { - return new IVariable[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#hasVariables() - */ - public boolean hasVariables() throws DebugException - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getLineNumber() - */ - public int getLineNumber() throws DebugException - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getCharStart() - */ - public int getCharStart() throws DebugException - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getCharEnd() - */ - public int getCharEnd() throws DebugException - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getName() - */ - public String getName() throws DebugException - { - return "..."; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups() - */ - public IRegisterGroup[] getRegisterGroups() throws DebugException - { - return ((CDebugTarget)getDebugTarget()).getRegisterGroups(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups() - */ - public boolean hasRegisterGroups() throws DebugException - { - return ((CDebugTarget)getDebugTarget()).getRegisterGroups().length > 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepInto() - */ - public boolean canStepInto() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepOver() - */ - public boolean canStepOver() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepReturn() - */ - public boolean canStepReturn() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#isStepping() - */ - public boolean isStepping() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepInto() - */ - public void stepInto() throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepOver() - */ - public void stepOver() throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepReturn() - */ - public void stepReturn() throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException - { - } - - /** - * Sets the containing thread. - * - * @param thread the containing thread - */ - protected void setThread( CThread thread ) - { - fThread = thread; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( IDummyStackFrame.class ) ) - return this; - if ( adapter.equals( IStackFrame.class ) ) - return this; - return super.getAdapter(adapter); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java deleted file mode 100644 index b55841ec249..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CExpression.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.core.model.IValue; - -/** - * - * Enter type comment. - * - * @since Sep 17, 2002 - */ -public class CExpression extends CModificationVariable - implements IExpression -{ - /** - * Constructor for CExpression. - * @param target - * @param cdiExpression - */ - public CExpression( CDebugTarget target, ICDIExpression cdiExpression ) - { - super( target, cdiExpression ); - fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT ); - } - - /** - * Constructor for CExpression. - * @param target - * @param cdiExpression - */ - public CExpression( CDebugTarget target, ICDIVariableObject cdiVariableObject ) - { - super( target, cdiVariableObject ); - fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IExpression#getExpressionText() - */ - public String getExpressionText() - { - try - { - return getName(); - } - catch( DebugException e ) - { - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IExpression#getValue() - */ - public IValue getValue() - { - try - { - return super.getValue(); - } - catch( DebugException e ) - { - } - return null; - } - - public void dispose() - { - super.dispose(); - } - - protected ICDIExpression getCDIExpression() throws CDIException - { - return (ICDIExpression)getCDIVariable(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - if ( event instanceof ICDIResumedEvent ) - { - if ( event.getSource() instanceof ICDITarget && getCDITarget().equals( event.getSource() ) ) - { - try - { - setChanged( false ); - } - catch( DebugException e ) - { - CDebugCorePlugin.log( e ); - } - } - } - super.handleDebugEvent(event); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#isEnabled() - */ - public boolean isEnabled() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#canEnableDisable() - */ - public boolean canEnableDisable() - { - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java deleted file mode 100644 index e9139b7bd71..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java +++ /dev/null @@ -1,682 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.event.ICDIMemoryChangedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.model.IExecFileInfo; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlockRow; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Oct 15, 2002 - */ -public class CFormattedMemoryBlock extends CDebugElement - implements IFormattedMemoryBlock, - ICDIEventListener -{ - class CFormattedMemoryBlockRow implements IFormattedMemoryBlockRow - { - private long fAddress; - private String[] fData; - private String fAscii; - - /** - * Constructor for CFormattedMemoryBlockRow. - */ - public CFormattedMemoryBlockRow( long address, String[] data, String ascii ) - { - fAddress = address; - fData = data; - fAscii = ascii; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getAddress() - */ - public long getAddress() - { - return fAddress; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getASCII() - */ - public String getASCII() - { - return fAscii; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getData() - */ - public String[] getData() - { - return fData; - } - } - - private ICDIExpression fAddressExpression; - private ICDIMemoryBlock fCDIMemoryBlock; - private byte[] fBytes = null; - private int fFormat; - private int fWordSize; - private int fNumberOfRows; - private int fNumberOfColumns; - private boolean fDisplayAscii = true; - private char fPaddingChar = '.'; - private List fRows = null; - private Long[] fChangedAddresses = new Long[0]; - private boolean fStartAddressChanged = false; - - /** - * Constructor for CFormattedMemoryBlock. - * @param target - */ - public CFormattedMemoryBlock( CDebugTarget target, - ICDIMemoryBlock cdiMemoryBlock, - ICDIExpression addressExpression, - int format, - int wordSize, - int numberOfRows, - int numberOfColumns ) - { - this( target, cdiMemoryBlock, addressExpression, format, wordSize, numberOfRows, numberOfColumns, '\0' ); - } - - /** - * Constructor for CFormattedMemoryBlock. - * @param target - */ - public CFormattedMemoryBlock( CDebugTarget target, - ICDIMemoryBlock cdiMemoryBlock, - ICDIExpression addressExpression, - int format, - int wordSize, - int numberOfRows, - int numberOfColumns, - char paddingChar ) - { - super( target ); - fCDIMemoryBlock = cdiMemoryBlock; - fAddressExpression = addressExpression; - fFormat = format; - fWordSize = wordSize; - fNumberOfRows = numberOfRows; - fNumberOfColumns = numberOfColumns; - fDisplayAscii = true; - fPaddingChar = paddingChar; - getCDISession().getEventManager().addEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getFormat() - */ - public int getFormat() - { - return fFormat; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getWordSize() - */ - public int getWordSize() - { - return fWordSize; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getNumberOfRows() - */ - public int getNumberOfRows() - { - return fNumberOfRows; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getNumberOfColumns() - */ - public int getNumberOfColumns() - { - return fNumberOfColumns; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#displayASCII() - */ - public boolean displayASCII() - { - return ( getWordSize() == IFormattedMemoryBlock.MEMORY_SIZE_BYTE && - /*getFormat() == IFormattedMemoryBlock.MEMORY_FORMAT_HEX &&*/ - fDisplayAscii ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getRows() - */ - public IFormattedMemoryBlockRow[] getRows() - { - if ( fRows == null ) - { - fRows = new ArrayList(); - try - { - int offset = 0; - byte[] bytes = getBytes(); - while( bytes != null && offset < bytes.length ) - { - int length = Math.min( fWordSize * fNumberOfColumns, bytes.length - offset ); - fRows.add( new CFormattedMemoryBlockRow( getRowAddress( offset ), - createData( bytes, offset, length ), - createAscii( bytes, offset, length ) ) ); - offset += length; - } - - } - catch( DebugException e ) - { - } - } - return (IFormattedMemoryBlockRow[])fRows.toArray( new IFormattedMemoryBlockRow[fRows.size()] ); - } - - private synchronized void resetBytes() - { - fBytes = null; - } - - private void resetRows() - { - fRows = null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextRowAddress() - */ - public long nextRowAddress() - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousRowAddress() - */ - public long previousRowAddress() - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextPageAddress() - */ - public long nextPageAddress() - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousPageAddress() - */ - public long previousPageAddress() - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#reformat(long, int, int, int, int) - */ - public void reformat( int format, - int wordSize, - int numberOfRows, - int numberOfColumns ) throws DebugException - { - resetRows(); - fFormat = format; - fWordSize = wordSize; - fNumberOfRows = numberOfRows; - fNumberOfColumns = numberOfColumns; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#reformat(long, int, int, int, int, char) - */ - public void reformat( int format, - int wordSize, - int numberOfRows, - int numberOfColumns, - char paddingChar ) throws DebugException - { - resetRows(); - fFormat = format; - fWordSize = wordSize; - fNumberOfRows = numberOfRows; - fNumberOfColumns = numberOfColumns; - fPaddingChar = paddingChar; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlock#getStartAddress() - */ - public long getStartAddress() - { - if ( fCDIMemoryBlock != null ) - { - return fCDIMemoryBlock.getStartAddress(); - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlock#getLength() - */ - public long getLength() - { - if ( fCDIMemoryBlock != null ) - { - return fCDIMemoryBlock.getLength(); - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlock#getBytes() - */ - public synchronized byte[] getBytes() throws DebugException - { - if ( fBytes == null ) - { - if ( fCDIMemoryBlock != null ) - { - try - { - fBytes = fCDIMemoryBlock.getBytes(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - } - byte[] copyBytes = null; - if ( fBytes != null ) - { - copyBytes = new byte[fBytes.length]; - System.arraycopy( fBytes, 0, copyBytes, 0, fBytes.length ); - } - return copyBytes; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlock#supportsValueModification() - */ - public boolean supportsValueModification() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[]) - */ - public void setValue( long offset, byte[] bytes ) throws DebugException - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getPaddingCharacter() - */ - public char getPaddingCharacter() - { - return fPaddingChar; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#dispose() - */ - public void dispose() - { - if ( fCDIMemoryBlock != null ) - { - try - { - ((CDebugTarget)getDebugTarget()).getCDISession().getMemoryManager().removeBlock( fCDIMemoryBlock ); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - fCDIMemoryBlock = null; - } - if ( fAddressExpression != null ) - { - try - { - ((CDebugTarget)getDebugTarget()).getCDISession().getExpressionManager().destroyExpression( fAddressExpression ); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - fAddressExpression = null; - } - getCDISession().getEventManager().removeEventListener( this ); - fireTerminateEvent(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#getAddressExpression() - */ - public String getAddressExpression() - { - return fAddressExpression.getName(); - } - - private String[] createData( byte[] bytes, int offset, int length ) - { - List data = new ArrayList( length / getWordSize() ); - for ( int i = offset; i < offset + length; i += getWordSize() ) - { - data.add( createDataItem( bytes, i, Math.min( length + offset - i, getWordSize() ) ) ); - } - return (String[])data.toArray( new String[data.size()] ); - } - - private String createDataItem( byte[] bytes, int offset, int length ) - { - StringBuffer sb = new StringBuffer( length * 2 ); - for ( int i = offset; i < length + offset; ++i ) - { - sb.append( CDebugUtils.getByteText( bytes[i] ) ); - } - return sb.toString(); - } - - private String createAscii( byte[] bytes, int offset, int length ) - { - StringBuffer sb = new StringBuffer( length ); - for ( int i = offset; i < offset + length; ++i ) - { - sb.append( ( Character.isISOControl( (char)bytes[i] ) || bytes[i] < 0 ) ? getPaddingCharacter() : (char)bytes[i] ); - } - return sb.toString(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - ICDIObject source = event.getSource(); - if (source == null) - return; - - if ( source.getTarget().equals( getCDITarget() ) ) - { - if ( event instanceof ICDIResumedEvent ) - { - if ( source instanceof ICDITarget ) - { - handleResumedEvent( (ICDIResumedEvent)event ); - } - } - else if ( event instanceof ICDIMemoryChangedEvent ) - { - if ( source instanceof ICDIMemoryBlock && source.equals( getCDIMemoryBlock() ) ) - { - handleChangedEvent( (ICDIMemoryChangedEvent)event ); - } - } - else if ( event instanceof ICDIChangedEvent ) - { - if ( source instanceof ICDIExpression && source.equals( fAddressExpression ) ) - { - handleAddressChangedEvent( (ICDIChangedEvent)event ); - } - } - else if ( event instanceof ICDIDestroyedEvent ) - { - if ( source instanceof ICDIExpression && source.equals( fAddressExpression ) ) - { - handleDestroyedEvent( (ICDIDestroyedEvent)event ); - } - } - } - } - - protected ICDIMemoryBlock getCDIMemoryBlock() - { - return fCDIMemoryBlock; - } - - protected void setCDIMemoryBlock( ICDIMemoryBlock cdiMemoryBlock ) - { - fCDIMemoryBlock = cdiMemoryBlock; - } - - private void handleResumedEvent( ICDIResumedEvent event ) - { - resetChangedAddresses(); - fStartAddressChanged = false; - fireChangeEvent( DebugEvent.CONTENT ); - } - - private void handleChangedEvent( ICDIMemoryChangedEvent event ) - { - resetBytes(); - resetRows(); - setChangedAddresses( event.getAddresses() ); - fireChangeEvent( DebugEvent.CONTENT ); - } - - private void handleAddressChangedEvent( ICDIChangedEvent event ) - { - resetBytes(); - resetRows(); - fStartAddressChanged = true; - fireChangeEvent( DebugEvent.CONTENT ); - } - - private void handleDestroyedEvent( ICDIDestroyedEvent event ) - { - fireTerminateEvent(); - } - - public Long[] getChangedAddresses() - { - return fChangedAddresses; - } - - protected void setChangedAddresses( Long[] changedAddresses ) - { - fChangedAddresses = changedAddresses; - } - - protected void resetChangedAddresses() - { - fChangedAddresses = new Long[0]; - } - - /** - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#isFrozen() - */ - public boolean isFrozen() - { - return getCDIMemoryBlock().isFrozen(); - } - - /** - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#setFrozen(boolean) - */ - public void setFrozen( boolean frozen ) - { - getCDIMemoryBlock().setFrozen( frozen ); - } - - /** - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#setItemValue(int, String) - */ - public void setItemValue( int index, String newValue ) throws DebugException - { - byte[] bytes = itemToBytes( newValue.toCharArray() ); - setBytes( index * getWordSize(), bytes ); - resetRows(); - } - - private void setBytes( int index, byte[] newBytes ) throws DebugException - { - try - { - getCDIMemoryBlock().setValue( index, newBytes ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - private byte[] itemToBytes( char[] chars ) - { - switch( getFormat() ) - { - case IFormattedMemoryBlock.MEMORY_FORMAT_HEX: - return hexItemToBytes( chars ); - } - return new byte[0]; - } - - private byte[] hexItemToBytes( char[] chars ) - { - byte[] result = new byte[chars.length / 2]; - for ( int i = 0; i < result.length; ++i ) - { - result[i] = CDebugUtils.textToByte( new char[] { chars[2 * i], chars[2 * i + 1] } ); - } - return result; - } - - /** - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#isDirty() - */ -/* - public boolean isDirty() - { - if ( fDirtyBytes != null ) - { - return fDirtyBytes.isDirty(); - } - return false; - } -*/ - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#saveChanges() - */ -/* - public void saveChanges() throws DebugException - { - byte[] bytes = getBytes(); - if ( bytes != null && fDirtyBytes != null && getCDIMemoryBlock() != null ) - { - ByteRange[] ranges = fDirtyBytes.getDirtyRanges( getBytes() ); - for ( int i = 0; i < ranges.length; ++i ) - { - try - { - getCDIMemoryBlock().setValue( ranges[i].getStart(), ranges[i].getBytes() ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - fDirtyBytes.reset(); - } - } -*/ - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#refresh() - */ - public void refresh() throws DebugException - { - if ( getCDIMemoryBlock() != null ) - { - try - { - getCDIMemoryBlock().refresh(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - } - - /** - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#canChangeFormat(int) - */ - public boolean canChangeFormat( int format ) - { - switch( format ) - { - case IFormattedMemoryBlock.MEMORY_FORMAT_HEX: - return true; - case IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL: - return ( /*getWordSize() != IFormattedMemoryBlock.MEMORY_SIZE_BYTE &&*/ - getWordSize() != IFormattedMemoryBlock.MEMORY_SIZE_DOUBLE_WORD ); - case IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL: - return ( /*getWordSize() != IFormattedMemoryBlock.MEMORY_SIZE_BYTE &&*/ - getWordSize() != IFormattedMemoryBlock.MEMORY_SIZE_DOUBLE_WORD ); - } - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#isLittleEndian() - */ - public boolean isLittleEndian() - { - IExecFileInfo info = (IExecFileInfo)getDebugTarget().getAdapter( IExecFileInfo.class ); - if ( info != null ) - { - return info.isLittleEndian(); - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#isStartAddressChanged() - */ - public boolean isStartAddressChanged() - { - return fStartAddressChanged; - } - - private long getRowAddress( int offset ) - { - long result = getStartAddress() + offset; - if ( result > 0xFFFFFFFFL ) - { - result -= 0xFFFFFFFFL; - } - return result; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalValue.java deleted file mode 100644 index a0a3655760f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalValue.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.debug.core.DebugException; - -/** - * - * Enter type comment. - * - * @since: Oct 2, 2002 - */ -public class CGlobalValue extends CValue -{ - private Boolean fHasChildren = null; - - - /** - * Constructor for CGlobalValue. - * @param parent - * @param cdiValue - */ - public CGlobalValue( CVariable parent, ICDIValue cdiValue ) - { - super( parent, cdiValue ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#hasVariables() - */ - public boolean hasVariables() throws DebugException - { - if ( fHasChildren == null ) - { - fHasChildren = new Boolean( super.hasVariables() ); - } - return fHasChildren.booleanValue(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java deleted file mode 100644 index 6902c8e6bb9..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; - -/** - * - * Enter type comment. - * - * @since: Oct 2, 2002 - */ -public class CGlobalVariable extends CModificationVariable -{ - /** - * Constructor for CGlobalVariable. - * @param parent - * @param cdiVariable - */ - public CGlobalVariable( CDebugElement parent, ICDIVariable cdiVariable ) - { - super( parent, cdiVariable ); - } - - /** - * Returns the current value of this variable. The value - * is cached. - * - * @see org.eclipse.debug.core.model.IVariable#getValue() - */ - public IValue getValue() throws DebugException - { - if ( fValue == null ) - { - ICDIValue cdiValue = getCurrentValue(); - if ( cdiValue instanceof ICDIArrayValue ) - { - ICDIVariable var = null; - try - { - var = getCDIVariable(); - } - catch( CDIException e ) - { - requestFailed( "", e ); - } - int[] dims = getType().getArrayDimensions(); - if ( dims.length > 0 && dims[0] > 0 ) - fValue = CValueFactory.createArrayValue( this, var, 0, dims.length - 1 ); - } - else - fValue = CValueFactory.createGlobalValue( this, getCurrentValue() ); - } - return fValue; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - super.handleDebugEvent( event ); - - ICDIObject source = event.getSource(); - if (source == null) - return; - - if ( source.getTarget().equals( getCDITarget() ) ) - { - if ( event instanceof ICDIResumedEvent ) - { - try - { - setChanged( false ); - } - catch( DebugException e ) - { - CDebugCorePlugin.log( e ); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java deleted file mode 100644 index ab88d4f20c3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModificationVariable.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; - -/** - * - * Common functionality for variables that support value modification - * - * @since Aug 9, 2002 - */ -public class CModificationVariable extends CVariable -{ - /** - * Constructor for CModificationVariable. - * @param parent - * @param cdiVariable - */ - public CModificationVariable( CDebugElement parent, ICDIVariableObject cdiVariableObject ) - { - super( parent, cdiVariableObject ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification() - */ - public boolean supportsValueModification() - { - CDebugTarget target = (CDebugTarget)getDebugTarget().getAdapter( CDebugTarget.class ); - return ( target != null && !target.isCoreDumpTarget() && isEditable() ); - } - - /** - * @see IValueModification#verifyValue(String) - */ - public boolean verifyValue( String expression ) - { - return true; - } - - /** - * @see IValueModification#verifyValue(IValue) - */ - public boolean verifyValue( IValue value ) - { - return value.getDebugTarget().equals( getDebugTarget() ); - } - - /** - * @see IValueModification#setValue(String) - */ - public final void setValue( String expression ) throws DebugException - { - String newExpression = processExpression( expression ); - ICDIVariable cdiVariable = null; - try - { - cdiVariable = getCDIVariable(); - if ( cdiVariable != null ) - cdiVariable.setValue( newExpression ); - else - requestFailed( "Unable to set value.", null ); - - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - /** - * Set this variable's value to the given value - */ - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.core.CModificationVariable#setValue(ICDIValue) - */ - protected void setValue( ICDIValue value ) throws DebugException - { - ICDIVariable cdiVariable = null; - try - { - cdiVariable = getCDIVariable(); - if ( cdiVariable != null ) - cdiVariable.setValue( value ); - else - requestFailed( "Unable to set value.", null ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - private String processExpression( String oldExpression ) throws DebugException - { - return oldExpression; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java deleted file mode 100644 index 8f8f3192a7f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegister; -import org.eclipse.debug.core.model.IRegisterGroup; -import org.eclipse.debug.core.model.IValue; - -/** - * - * Enter type comment. - * - * @since Sep 16, 2002 - */ -public class CRegister extends CGlobalVariable implements IRegister -{ - public static class ErrorRegister extends ErrorVariable implements ICDIRegister - { - public ErrorRegister( ICDIVariableObject varObject, Exception e ) - { - super( varObject, e ); - } - } - - /** - * Constructor for CRegister. - * @param parent - * @param cdiVariable - */ - public CRegister( CRegisterGroup parent, ICDIRegister cdiRegister ) - { - super( parent, cdiRegister ); - fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IRegister#getRegisterGroup() - */ - public IRegisterGroup getRegisterGroup() throws DebugException - { - return (IRegisterGroup)getParent(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#hasValueChanged() - */ - public boolean hasValueChanged() throws DebugException - { - IValue value = getValue(); - if ( value != null ) - { - return ( value.hasVariables() ) ? false : fChanged; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#isEnabled() - */ - public boolean isEnabled() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#canEnableDisable() - */ - public boolean canEnableDisable() - { - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java deleted file mode 100644 index 8e896567227..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegisterGroup.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegister; -import org.eclipse.debug.core.model.IRegisterGroup; - -/** - * - * Enter type comment. - * - * @since Sep 16, 2002 - */ -public class CRegisterGroup extends CDebugElement implements IRegisterGroup -{ - private String fName; - private ICDIRegisterObject[] fRegisterObjects; - private List fRegisters; - - /** - * Constructor for CRegisterGroup. - * @param target - */ - public CRegisterGroup( CDebugTarget target, String name, ICDIRegisterObject[] regObjects ) - { - super( target ); - fName = name; - fRegisterObjects = regObjects; - fRegisters = new ArrayList(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IRegisterGroup#getName() - */ - public String getName() throws DebugException - { - return fName; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IRegisterGroup#getRegisters() - */ - public IRegister[] getRegisters() throws DebugException - { - List list = getRegisters0(); - return (IRegister[])list.toArray( new IRegister[list.size()] ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IRegisterGroup#hasRegisters() - */ - public boolean hasRegisters() throws DebugException - { - return fRegisterObjects.length > 0; - } - - private List getRegisters0() throws DebugException - { - if ( fRegisters == null || fRegisters.size() == 0 ) - { - ICDIRegister[] regs = getCDIRegisters(); - fRegisters = new ArrayList( regs.length ); - for ( int i = 0; i < regs.length; ++i ) - { - fRegisters.add( new CRegister( this, regs[i] ) ); - } - } - return fRegisters; - } - - public void dispose() - { - Iterator it = fRegisters.iterator(); - while( it.hasNext() ) - { - ((CRegister)it.next()).dispose(); - } - fRegisters.clear(); - } - - private ICDIRegister[] getCDIRegisters() throws DebugException - { - ICDIRegister[] results = new ICDIRegister[fRegisterObjects.length]; - for ( int i = 0; i < fRegisterObjects.length; ++i ) - { - try - { - results[i] = ((CDebugTarget)getDebugTarget()).getCDISession().getRegisterManager().createRegister( fRegisterObjects[i] ); - } - catch( CDIException e ) - { - results[i] = new CRegister.ErrorRegister( fRegisterObjects[i], e ); - } - } - return results; - } - - public void resetChangeFlags() - { - if ( fRegisters == null ) - return; - try - { - Iterator it = fRegisters.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).setChanged( false ); - } - } - catch( DebugException e ) - { - CDebugCorePlugin.log( e ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java deleted file mode 100644 index e90a9822d6c..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Jan 16, 2003 - */ -public class CSharedLibrary extends CDebugElement - implements ICSharedLibrary, - ICDIEventListener -{ - private ICDISharedLibrary fCDILib = null; - - /** - * Constructor for CSharedLibrary. - * @param target - */ - public CSharedLibrary( CDebugTarget target, ICDISharedLibrary cdiLib ) - { - super( target ); - fCDILib = cdiLib; - getCDISession().getEventManager().addEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getFileName() - */ - public String getFileName() - { - if ( getCDISharedLibrary() != null ) - return getCDISharedLibrary().getFileName(); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getStartAddress() - */ - public long getStartAddress() - { - if ( getCDISharedLibrary() != null ) - return getCDISharedLibrary().getStartAddress(); - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getEndAddress() - */ - public long getEndAddress() - { - if ( getCDISharedLibrary() != null ) - return getCDISharedLibrary().getEndAddress(); - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#areSymbolsLoaded() - */ - public boolean areSymbolsLoaded() - { - if ( getCDISharedLibrary() != null ) - return getCDISharedLibrary().areSymbolsLoaded(); - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#loadSymbols() - */ - public void loadSymbols() throws DebugException - { - try - { - if ( getCDISharedLibrary() != null ) - getCDISharedLibrary().loadSymbols(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#dispose() - */ - public void dispose() - { - getCDISession().getEventManager().removeEventListener( this ); - } - - public ICDISharedLibrary getCDISharedLibrary() - { - return fCDILib; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSignal.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSignal.java deleted file mode 100644 index 539946fd19d..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CSignal.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Jan 31, 2003 - */ -public class CSignal extends CDebugElement implements ICSignal, ICDIEventListener -{ - private ICDISignal fCDISignal; - - /** - * Constructor for CSignal. - * @param target - */ - public CSignal( CDebugTarget target, ICDISignal cdiSignal ) - { - super( target ); - fCDISignal = cdiSignal; - getCDISession().getEventManager().addEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#getDescription() - */ - public String getDescription() - { - return getCDISignal().getDescription(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#getName() - */ - public String getName() - { - return getCDISignal().getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#isPassEnabled() - */ - public boolean isPassEnabled() - { - return !getCDISignal().isIgnore(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#isStopEnabled() - */ - public boolean isStopEnabled() - { - return getCDISignal().isStopSet(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#setPassEnabled(boolean) - */ - public void setPassEnabled( boolean enable ) throws DebugException - { - handle( enable, isStopEnabled() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#setStopEnabled(boolean) - */ - public void setStopEnabled( boolean enable ) throws DebugException - { - handle( isPassEnabled(), enable ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#dispose() - */ - public void dispose() - { - getCDISession().getEventManager().removeEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICSignal#signal() - */ - public void signal() throws DebugException - { - try - { - getCDITarget().signal( getCDISignal() ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - protected ICDISignal getCDISignal() - { - return fCDISignal; - } - - private void handle( boolean pass, boolean stop ) throws DebugException - { - try - { - getCDISignal().handle( !pass, stop ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java deleted file mode 100644 index 33c4534b9e2..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java +++ /dev/null @@ -1,783 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.core.model.IRestart; -import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal; -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegisterGroup; -import org.eclipse.debug.core.model.ISourceLocator; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.IThread; -import org.eclipse.debug.core.model.IVariable; - -/** - * - * Proxy to a stack frame on the target. - * - * @since Aug 7, 2002 - */ -public class CStackFrame extends CDebugElement - implements IStackFrame, - IStackFrameInfo, - IRestart, - IResumeWithoutSignal, - ICDIEventListener -{ - /** - * Underlying CDI stack frame. - */ - private ICDIStackFrame fCDIStackFrame; - - /** - * The last (previous) CDI stack frame. - */ - private ICDIStackFrame fLastCDIStackFrame; - - /** - * Containing thread. - */ - private CThread fThread; - - /** - * List of visible variable (includes arguments). - */ - private List fVariables; - - /** - * Whether the variables need refreshing - */ - private boolean fRefreshVariables = true; - - /** - * Constructor for CStackFrame. - * @param target - */ - public CStackFrame( CThread thread, ICDIStackFrame cdiFrame ) - { - super( (CDebugTarget)thread.getDebugTarget() ); - setCDIStackFrame( cdiFrame ); - setThread( thread ); - getCDISession().getEventManager().addEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getThread() - */ - public IThread getThread() - { - return fThread; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getVariables() - */ - public IVariable[] getVariables() throws DebugException - { - List list = getVariables0(); - return (IVariable[])list.toArray( new IVariable[list.size()] ); - } - - protected synchronized List getVariables0() throws DebugException - { - if ( fVariables == null ) - { - List vars = getAllCDIVariableObjects(); - fVariables = new ArrayList( vars.size() ); - Iterator it = vars.iterator(); - while( it.hasNext() ) - { - fVariables.add( new CModificationVariable( this, (ICDIVariableObject)it.next() ) ); - } - } - else if ( refreshVariables() ) - { - updateVariables(); - } - setRefreshVariables( false ); - return fVariables; - } - - /** - * Incrementally updates this stack frame's variables. - * - */ - protected void updateVariables() throws DebugException - { - List locals = getAllCDIVariableObjects(); - int index = 0; - while( index < fVariables.size() ) - { - ICDIVariableObject varObject = findVariable( locals, (CVariable)fVariables.get( index ) ); - if ( varObject != null ) - { - locals.remove( varObject ); - index++; - } - else - { - // remove variable - fVariables.remove( index ); - } - } - - // add any new locals - Iterator newOnes = locals.iterator(); - while( newOnes.hasNext() ) - { - fVariables.add( new CModificationVariable( this, (ICDIVariableObject)newOnes.next() ) ); - } - } - - /** - * Sets the containing thread. - * - * @param thread the containing thread - */ - protected void setThread( CThread thread ) - { - fThread = thread; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#hasVariables() - */ - public boolean hasVariables() throws DebugException - { - return getVariables0().size() > 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getLineNumber() - */ - public int getLineNumber() throws DebugException - { - if ( isSuspended() ) - { - ISourceLocator locator = ((CDebugTarget)getDebugTarget()).getSourceLocator(); - if ( locator != null && locator instanceof IAdaptable && - ((IAdaptable)locator).getAdapter( ICSourceLocator.class ) != null ) - return ((ICSourceLocator)((IAdaptable)locator).getAdapter( ICSourceLocator.class )).getLineNumber( this ); - if ( getCDIStackFrame() != null && getCDIStackFrame().getLocation() != null ) - return getCDIStackFrame().getLocation().getLineNumber(); - } - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getCharStart() - */ - public int getCharStart() throws DebugException - { - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getCharEnd() - */ - public int getCharEnd() throws DebugException - { - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getName() - */ - public String getName() throws DebugException - { - ICDILocation location = getCDIStackFrame().getLocation(); - String name = new String(); - if ( location.getFunction() != null && location.getFunction().trim().length() > 0 ) - name += location.getFunction() + "() "; - if ( location.getFile() != null && location.getFile().trim().length() > 0 ) - { - name += "at " + location.getFile() + ":" ; - if ( location.getLineNumber() != 0 ) - name += location.getLineNumber(); - } - return name.toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups() - */ - public IRegisterGroup[] getRegisterGroups() throws DebugException - { - return ((CDebugTarget)getDebugTarget()).getRegisterGroups(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups() - */ - public boolean hasRegisterGroups() throws DebugException - { - return ((CDebugTarget)getDebugTarget()).getRegisterGroups().length > 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepInto() - */ - public boolean canStepInto() - { - try - { - return exists() && isTopStackFrame() && getThread().canStepInto(); - } - catch( DebugException e ) - { - logError( e ); - return false; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepOver() - */ - public boolean canStepOver() - { - try - { - return exists() && getThread().canStepOver(); - } - catch( DebugException e ) - { - logError( e ); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepReturn() - */ - public boolean canStepReturn() - { - try - { - if ( !exists() ) - { - return false; - } - List frames = ((CThread)getThread()).computeStackFrames(); - if ( frames != null && !frames.isEmpty() ) - { - boolean bottomFrame = this.equals( frames.get( frames.size() - 1 ) ); - return !bottomFrame && getThread().canStepReturn(); - } - } - catch( DebugException e ) - { - logError( e ); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#isStepping() - */ - public boolean isStepping() - { - return getThread().isStepping(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepInto() - */ - public void stepInto() throws DebugException - { - if ( canStepInto() ) - { - getThread().stepInto(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepOver() - */ - public void stepOver() throws DebugException - { - if ( !canStepOver() ) - { - return; - } - if ( isTopStackFrame() ) - { - getThread().stepOver(); - } - else - { -// ((CThread)getThread()).stepToFrame( this ); - getThread().stepOver(); // for now - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepReturn() - */ - public void stepReturn() throws DebugException - { - if ( !canStepReturn() ) - { - return; - } - if ( isTopStackFrame() ) - { - getThread().stepReturn(); - } - else - { -/* - List frames = ((CThread)getThread()).computeStackFrames(); - int index = frames.indexOf( this ); - if ( index >= 0 && index < frames.size() - 1 ) - { - IStackFrame nextFrame = (IStackFrame)frames.get( index + 1 ); - ((CThread)getThread()).stepToFrame( nextFrame ); - } -*/ - getThread().stepReturn(); // for now - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() - { - return getThread().canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() - { - return getThread().canSuspend(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() - { - return getThread().isSuspended(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException - { - getThread().resume(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException - { - getThread().suspend(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() - { - boolean exists = false; - try - { - exists = exists(); - } - catch( DebugException e ) - { - logError( e ); - } - return exists && getThread().canTerminate() || getDebugTarget().canTerminate(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() - { - return getThread().isTerminated(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException - { - if ( getThread().canTerminate() ) - { - getThread().terminate(); - } - else - { - getDebugTarget().terminate(); - } - } - - /** - * Returns the underlying CDI stack frame that this model object is - * a proxy to. - * - * @return the underlying CDI stack frame - */ - protected ICDIStackFrame getCDIStackFrame() - { - return fCDIStackFrame; - } - - /** - * Sets the underlying CDI stack frame. Called by a thread - * when incrementally updating after a step has completed. - * - * @param frame the underlying stack frame - */ - protected void setCDIStackFrame( ICDIStackFrame frame ) - { - if ( frame != null ) - { - fLastCDIStackFrame = frame; - } - else - { - fLastCDIStackFrame = fCDIStackFrame; - } - fCDIStackFrame = frame; - setRefreshVariables( true ); - } - - /** - * The underlying stack frame that existed before the current underlying - * stack frame. Used only so that equality can be checked on stack frame - * after the new one has been set. - */ - protected ICDIStackFrame getLastCDIStackFrame() - { - return fLastCDIStackFrame; - } - - /** - * Helper method for computeStackFrames(). For the purposes of detecting if - * an underlying stack frame needs to be disposed, stack frames are equal if - * the frames are equal and the locations are equal. - */ - protected static boolean equalFrame( ICDIStackFrame frameOne, ICDIStackFrame frameTwo ) - { - if ( frameOne == null || frameTwo == null ) - return false; - ICDILocation loc1 = frameOne.getLocation(); - ICDILocation loc2 = frameTwo.getLocation(); - if ( loc1 == null || loc2 == null ) - return false; - if ( loc1.getFile() != null && loc1.getFile().length() > 0 && - loc2.getFile() != null && loc2.getFile().length() > 0 && - loc1.getFile().equals( loc2.getFile() ) ) - - { - if ( loc1.getFunction() != null && loc1.getFunction().length() > 0 && - loc2.getFunction() != null && loc2.getFunction().length() > 0 && - loc1.getFunction().equals( loc2.getFunction() ) ) - return true; - } - if ( ( loc1.getFile() == null || loc1.getFile().length() < 1 ) && - ( loc2.getFile() == null || loc2.getFile().length() < 1 ) ) - - { - if ( loc1.getFunction() != null && loc1.getFunction().length() > 0 && - loc2.getFunction() != null && loc2.getFunction().length() > 0 && - loc1.getFunction().equals( loc2.getFunction() ) ) - return true; - } - if ( ( loc1.getFile() == null || loc1.getFile().length() < 1 ) && - ( loc2.getFile() == null || loc2.getFile().length() < 1 ) && - ( loc1.getFunction() == null || loc1.getFunction().length() < 1 ) && - ( loc2.getFunction() == null || loc2.getFunction().length() < 1 ) ) - { - if ( loc1.getAddress() == loc2.getAddress() ) - return true; - } - return false; - } - - protected boolean exists() throws DebugException - { - return ((CThread)getThread()).computeStackFrames().indexOf( this ) != -1; - } - - /** - * @see IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter == CStackFrame.class ) - { - return this; - } - if ( adapter == IStackFrame.class ) - { - return this; - } - if ( adapter == ICDIStackFrame.class ) - { - return getCDIStackFrame(); - } - if ( adapter == IStackFrameInfo.class ) - { - return this; - } - return super.getAdapter( adapter ); - } - - protected void dispose() - { - getCDISession().getEventManager().removeEventListener( this ); - disposeAllVariables(); - } - - /** - * Retrieves local variables in this stack frame. Returns an empty - * list if there are no local variables. - * - */ - protected List getCDILocalVariableObjects() throws DebugException - { - List list = new ArrayList(); - try - { - list.addAll( Arrays.asList( getCDISession().getVariableManager().getLocalVariableObjects( getCDIStackFrame() ) ) ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return list; - } - - /** - * Retrieves arguments in this stack frame. Returns an empty list - * if there are no arguments. - * - */ - protected List getCDIArgumentObjects() throws DebugException - { - List list = new ArrayList(); - try - { - list.addAll( Arrays.asList( getCDISession().getVariableManager().getArgumentObjects( getCDIStackFrame() ) ) ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return list; - } -/* - protected List getAllCDIVariables() throws DebugException - { - List list = new ArrayList(); - list.addAll( getCDIArguments() ); - list.addAll( getCDILocalVariables() ); - return list; - } -*/ - protected List getAllCDIVariableObjects() throws DebugException - { - List list = new ArrayList(); - list.addAll( getCDIArgumentObjects() ); - list.addAll( getCDILocalVariableObjects() ); - return list; - } - - protected boolean isTopStackFrame() throws DebugException - { - IStackFrame tos = getThread().getTopStackFrame(); - return tos != null && tos.equals( this ); - } - - protected void disposeAllVariables() - { - if ( fVariables == null ) - return; - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).dispose(); - } - fVariables = null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IStackFrameInfo#getAddress() - */ - public long getAddress() - { - return getCDIStackFrame().getLocation().getAddress(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IStackFrameInfo#getFile() - */ - public String getFile() - { - return getCDIStackFrame().getLocation().getFile(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IStackFrameInfo#getFunction() - */ - public String getFunction() - { - return getCDIStackFrame().getLocation().getFunction(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IStackFrameInfo#getLevel() - */ - public int getLevel() - { - return getCDIStackFrame().getLevel(); - } - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IStackFrameInfo#getFrameLineNumber() - */ - public int getFrameLineNumber() - { - return getCDIStackFrame().getLocation().getLineNumber(); - } - - /* - * @see org.eclipse.cdt.debug.core.IStackFrameInfo#getArguments() - */ - public IVariable[] getArguments() - { - ArrayList list = new ArrayList(); - IVariable[] vars = new IVariable[0]; - try - { - vars = getVariables(); - } - catch( DebugException e ) - { - CDebugCorePlugin.log( e ); - } - for ( int i = 0; i < vars.length; ++i ) - { - if ( vars[i] instanceof CVariable && ((CVariable)vars[i]).isArgument() ) - { - list.add( vars[i] ); - } - } - return (IVariable[])list.toArray( new IVariable[list.size()] ); - } - - protected synchronized void preserve() - { - preserveVariables(); - } - - private void preserveVariables() - { - if ( fVariables == null ) - return; - try - { - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).setChanged( false ); - } - } - catch( DebugException e ) - { - CDebugCorePlugin.log( e ); - } - } - - protected ICDIVariableObject findVariable( List list, CVariable var ) - { - Iterator it = list.iterator(); - while( it.hasNext() ) - { - ICDIVariableObject newVarObject = (ICDIVariableObject)it.next(); - if ( var.sameVariableObject( newVarObject ) ) - return newVarObject; - } - return null; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRestart#canRestart() - */ - public boolean canRestart() - { - return getDebugTarget() instanceof IRestart && ((IRestart)getDebugTarget()).canRestart(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRestart#restart() - */ - public void restart() throws DebugException - { - if ( canRestart() ) - { - ((IRestart)getDebugTarget()).restart(); - } - } - - private void setRefreshVariables( boolean refresh ) - { - fRefreshVariables = refresh; - } - - private boolean refreshVariables() - { - return fRefreshVariables; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IResumeWithoutSignal#canResumeWithoutSignal() - */ - public boolean canResumeWithoutSignal() - { - return ( getDebugTarget() instanceof IResumeWithoutSignal && - ((IResumeWithoutSignal)getDebugTarget()).canResumeWithoutSignal() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IResumeWithoutSignal#resumeWithoutSignal() - */ - public void resumeWithoutSignal() throws DebugException - { - if ( canResumeWithoutSignal() ) - { - ((IResumeWithoutSignal)getDebugTarget()).resumeWithoutSignal(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java deleted file mode 100644 index 9a226c324a6..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java +++ /dev/null @@ -1,1155 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange; -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; -import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDisconnectedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus; -import org.eclipse.cdt.debug.core.model.IDummyStackFrame; -import org.eclipse.cdt.debug.core.model.IInstructionStep; -import org.eclipse.cdt.debug.core.model.IRestart; -import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal; -import org.eclipse.cdt.debug.core.model.IRunToLine; -import org.eclipse.cdt.debug.core.model.IState; -import org.eclipse.cdt.debug.core.model.ISwitchToFrame; -import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.IThread; - -/** - * - * A thread in a C/C++ debug target. - * - * @since Aug 2, 2002 - */ -public class CThread extends CDebugElement - implements IThread, - IState, - IRestart, - IInstructionStep, - IResumeWithoutSignal, - ISwitchToFrame, - ICDIEventListener -{ - private final static int MAX_STACK_DEPTH = 100; - - /** - * Underlying CDI thread. - */ - private ICDIThread fCDIThread; - - /** - * Collection of stack frames - */ - private ArrayList fStackFrames; - - /** - * Whether running. - */ - private boolean fRunning; - - /** - * Whether children need to be refreshed. Set to - * true when stack frames are re-used - * on the next suspend. - */ - private boolean fRefreshChildren = true; - - /** - * The current state identifier. - */ - private int fCurrentStateId = IState.UNKNOWN; - - /** - * The current state info. - */ - private Object fCurrentStateInfo = null; - - /** - * The debug configuration of this session. - */ - private ICDIConfiguration fConfig; - - /** - * Whether this thread is current. - */ - private boolean fIsCurrent = false; - - private CStackFrame fLastStackFrame = null; - - private int fLastStackDepth = 0; - - private boolean fDisposed = false; - - /** - * Constructor for CThread. - * @param target - */ - public CThread( CDebugTarget target, ICDIThread cdiThread ) - { - super( target ); - setCDIThread( cdiThread ); - fConfig = getCDISession().getConfiguration(); - initialize(); - getCDISession().getEventManager().addEventListener( this ); - } - - /** - * Thread initialization:
              - *
            • Sets terminated state to false
            • - *
            • Determines suspended state from underlying thread
            • - *
            • Sets this threads stack frames to an empty collection
            • - *
            - */ - protected void initialize() - { - fStackFrames = new ArrayList(); - setRunning( false ); -// setRunning( !getCDIThread().isSuspended() ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getStackFrames() - */ - public IStackFrame[] getStackFrames() throws DebugException - { - List list = Collections.EMPTY_LIST; - try - { - list = computeStackFrames(); - } - catch( DebugException e ) - { - setStatus( ICDebugElementErrorStatus.ERROR, e.getStatus().getMessage() ); - throw e; - } - return (IStackFrame[])list.toArray( new IStackFrame[list.size()] ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#hasStackFrames() - */ - public boolean hasStackFrames() throws DebugException - { - // Always return true to postpone the stack frames request - return true; - } - - /** - * @see computeStackFrames() - * - * @param refreshChildren whether or not this method should request new stack - * frames from the target - */ - protected synchronized List computeStackFrames( boolean refreshChildren ) throws DebugException - { - if ( isSuspended() ) - { - if ( isTerminated() ) - { - fStackFrames = new ArrayList(); - } - else if ( refreshChildren ) - { - if ( fStackFrames.size() > 0 ) - { - Object frame = fStackFrames.get( fStackFrames.size() - 1 ); - if ( frame instanceof IDummyStackFrame ) - { - fStackFrames.remove( frame ); - } - } - int depth = getStackDepth(); - ICDIStackFrame[] frames = ( depth != 0 ) ? - getCDIStackFrames( 0, ( depth > getMaxStackDepth() ) ? getMaxStackDepth() - 1 : depth - 1 ) : - new ICDIStackFrame[0]; - if ( fStackFrames.isEmpty() ) - { - addStackFrames( frames, 0, frames.length ); - } - else if ( depth < getLastStackDepth() ) - { - disposeStackFrames( 0, getLastStackDepth() - depth ); - updateStackFrames( frames, 0, fStackFrames, fStackFrames.size() ); - if ( fStackFrames.size() < frames.length ) - { - addStackFrames( frames, fStackFrames.size(), frames.length - fStackFrames.size() ); - } - } - else if ( depth > getLastStackDepth() ) - { - disposeStackFrames( frames.length - depth + getLastStackDepth(), depth - getLastStackDepth() ); - addStackFrames( frames, 0, depth - getLastStackDepth() ); - updateStackFrames( frames, depth - getLastStackDepth(), fStackFrames, frames.length - depth + getLastStackDepth() ); - } - else // depth == getLastStackDepth() - { - if ( depth != 0 ) - { - // same number of frames - if top frames are in different - // function, replace all frames - ICDIStackFrame newTopFrame = ( frames.length > 0 ) ? frames[0] : null; - ICDIStackFrame oldTopFrame = ( fStackFrames.size() > 0 ) ? ((CStackFrame)fStackFrames.get( 0 ) ).getLastCDIStackFrame() : null; - if ( !CStackFrame.equalFrame( newTopFrame, oldTopFrame ) ) - { - disposeStackFrames( 0, fStackFrames.size() ); - addStackFrames( frames, 0, frames.length ); - } - else // we are in the same frame - { - updateStackFrames( frames, 0, fStackFrames, frames.length ); - } - } - } - if ( depth > getMaxStackDepth() ) - { - fStackFrames.add( new CDummyStackFrame( this ) ); - } - setLastStackDepth( depth ); - setRefreshChildren( false ); - } - } - return fStackFrames; - } - - /** - * Retrieves and returns all underlying stack frames - * - * @return list of StackFrame - * @exception DebugException if this method fails. Reasons include: - *
              - *
            - */ - protected ICDIStackFrame[] getCDIStackFrames() throws DebugException - { - return new ICDIStackFrame[0]; - } - - /** - * Retrieves and returns underlying stack frames between lowFrame - * and highFrame. - * - * @return list of StackFrame - * @exception DebugException if this method fails. Reasons include: - *
              - *
            - */ - protected ICDIStackFrame[] getCDIStackFrames( int lowFrame, int highFrame ) throws DebugException - { - try - { - return getCDIThread().getStackFrames( lowFrame, highFrame ); - } - catch( CDIException e ) - { - setStatus( ICDebugElementErrorStatus.WARNING, "Stack is not available: " + e.getMessage() ); - targetRequestFailed( e.getMessage(), null ); - } - return new ICDIStackFrame[0]; - } - - /** - * Replaces the underlying stack frame objects in the preserved frames - * list with the current underlying stack frames. - * - * @param newFrames list of current underlying ICDIStackFrames. - * Frames from this list are assigned to the underlying frames in - * the oldFrames list. - * @param offset the offset in the lists at which to start replacing - * the old underlying frames - * @param oldFrames list of preserved frames, of type CStackFrame - * @param length the number of frames to replace - */ - protected void updateStackFrames( ICDIStackFrame[] newFrames, - int offset, - List oldFrames, - int length ) throws DebugException - { - for ( int i = 0; i < length; i++ ) - { - CStackFrame frame = (CStackFrame)oldFrames.get( offset ); - frame.setCDIStackFrame( newFrames[offset] ); - frame.fireChangeEvent( DebugEvent.STATE ); - offset++; - } - } - - protected void addStackFrames( ICDIStackFrame[] newFrames, - int startIndex, - int length ) - { - if ( newFrames.length >= startIndex + length ) - { - for ( int i = 0; i < length; ++i ) - { - fStackFrames.add( i, new CStackFrame( this, newFrames[startIndex + i] ) ); - } - } - } - - /** - * Returns this thread's current stack frames as a list, computing - * them if required. Returns an empty collection if this thread is - * not currently suspended, or this thread is terminated. This - * method should be used internally to get the current stack frames, - * instead of calling #getStackFrames(), which makes a - * copy of the current list. - *

            - * Before a thread is resumed a call must be made to one of:

              - *
            • preserveStackFrames()
            • - *
            • disposeStackFrames()
            • - *
            - * If stack frames are disposed before a thread is resumed, stack frames - * are completely re-computed on the next call to this method. If stack - * frames are to be preserved, this method will attempt to re-use any stack - * frame objects which represent the same stack frame as on the previous - * suspend. Stack frames are cached until a subsequent call to preserve - * or dispose stack frames. - *

            - * - * @return list of IStackFrame - * @exception DebugException if this method fails. Reasons include: - *
              - *
            - */ - public List computeStackFrames() throws DebugException - { - return computeStackFrames( refreshChildren() ); - } - - /** - * @see CThread#computeStackFrames() - * - * This method differs from computeStackFrames() in that it - * always requests new stack frames from the target. As this is - * an expensive operation, this method should only be used - * by clients who know for certain that the stack frames - * on the target have changed. - */ - public List computeNewStackFrames() throws DebugException - { - return computeStackFrames( true ); - } - - /** - * Helper method for #computeStackFrames() to create all - * underlying stack frames. - * - * @exception DebugException if this method fails. Reasons include: - */ - protected List createAllStackFrames( int depth, ICDIStackFrame[] frames ) throws DebugException - { - List list= new ArrayList( frames.length ); - for ( int i = 0; i < frames.length; ++i ) - { - list.add( new CStackFrame( this, frames[i] ) ); - } - if ( depth > frames.length ) - { - list.add( new CDummyStackFrame( this ) ); - } - return list; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getPriority() - */ - public int getPriority() throws DebugException - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getTopStackFrame() - */ - public IStackFrame getTopStackFrame() throws DebugException - { - List c = computeStackFrames(); - return ( c.isEmpty() ) ? null : (IStackFrame)c.get( 0 ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getName() - */ - public String getName() throws DebugException - { - return getCDIThread().toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getBreakpoints() - */ - public IBreakpoint[] getBreakpoints() - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - if ( isDisposed() ) - return; - ICDIObject source = event.getSource(); - if ( source == null ) - return; - if ( source.getTarget().equals( getCDITarget() ) ) - { - if ( event instanceof ICDISuspendedEvent ) - { - if ( ( source instanceof ICDIThread && getCDIThread().equals( (ICDIThread)source ) ) || - source instanceof ICDITarget ) - { -// if ( !(((ICDISuspendedEvent)event).getReason() instanceof ICDISharedLibraryEvent && applyDeferredBreakpoints()) ) - handleSuspendedEvent( (ICDISuspendedEvent)event ); - } - } - else if ( event instanceof ICDIResumedEvent ) - { - if ( ( source instanceof ICDIThread && source.equals( getCDIThread() ) ) || - source instanceof ICDITarget ) - { - handleResumedEvent( (ICDIResumedEvent)event ); - } - } - else if ( event instanceof ICDIDestroyedEvent ) - { - if ( source instanceof ICDIThread ) - { - handleTerminatedEvent( (ICDIDestroyedEvent)event ); - } - } - else if ( event instanceof ICDIDisconnectedEvent ) - { - if ( source instanceof ICDIThread ) - { - handleDisconnectedEvent( (ICDIDisconnectedEvent)event ); - } - } - else if ( event instanceof ICDIChangedEvent ) - { - if ( source instanceof ICDIThread ) - { - handleChangedEvent( (ICDIChangedEvent)event ); - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() - { - return fConfig.supportsResume() && isSuspended(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() - { - return fConfig.supportsSuspend() && !isSuspended(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() - { - return !fRunning && !isTerminated(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException - { - if ( !isSuspended() ) - return; - try - { - getCDIThread().resume(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException - { - if ( isSuspended() ) - { - return; - } - try - { - getCDIThread().suspend(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepInto() - */ - public boolean canStepInto() - { - return canStep(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepOver() - */ - public boolean canStepOver() - { - return canStep(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepReturn() - */ - public boolean canStepReturn() - { - return canStep(); - } - - /** - * Returns whether this thread is in a valid state to - * step. - * - * @return whether this thread is in a valid state to - * step - */ - protected boolean canStep() - { - try - { - return fConfig.supportsStepping() && isSuspended() && getTopStackFrame() != null; - } - catch( DebugException e ) - { - return false; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#isStepping() - */ - public boolean isStepping() - { - return getCurrentStateId() == IState.STEPPING; // ???? - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepInto() - */ - public void stepInto() throws DebugException - { - if ( !canStepInto() ) - return; - try - { - if ( getRealSourceMode() == ISourceMode.MODE_SOURCE ) - { - getCDIThread().stepInto(); - } - else - { - getCDIThread().stepIntoInstruction(); - } - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepOver() - */ - public void stepOver() throws DebugException - { - if ( !canStepOver() ) - return; - try - { - if ( getRealSourceMode() == ISourceMode.MODE_SOURCE ) - { - getCDIThread().stepOver(); - } - else - { - getCDIThread().stepOverInstruction(); - } - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepReturn() - */ - public void stepReturn() throws DebugException - { - if ( !canStepReturn() ) - return; - try - { - getCDIThread().stepReturn(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() - { - return getDebugTarget().canTerminate(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() - { - return getDebugTarget().isTerminated(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException - { - getDebugTarget().terminate(); - } - - /** - * Sets the underlying CDI thread that this model object is - * a proxy to. - * - * @param thread the underlying CDI thread - */ - protected void setCDIThread( ICDIThread cdiThread ) - { - fCDIThread = cdiThread; - } - - /** - * Returns the underlying CDI thread that this model object is - * a proxy to. - * - * @return the underlying CDI thread - */ - protected ICDIThread getCDIThread() - { - return fCDIThread; - } - - /** - * Sets whether this thread is currently executing. - * - * @param running whether this thread is executing - */ - protected void setRunning( boolean running ) - { - fRunning = running; - } - - /** - * Preserves stack frames to be used on the next suspend event. - * Iterates through all current stack frames, setting their - * state as invalid. This method should be called before this thread - * is resumed, when stack frames are to be re-used when it later - * suspends. - * - * @see computeStackFrames() - */ - protected synchronized void preserveStackFrames() - { - Iterator it = fStackFrames.iterator(); - while( it.hasNext() ) - { - CStackFrame frame = (CStackFrame)(((IAdaptable)it.next()).getAdapter( CStackFrame.class )); - if ( frame != null ) - { - frame.preserve(); - } - } - setRefreshChildren( true ); - } - - /** - * Disposes stack frames, to be completely re-computed on - * the next suspend event. This method should be called before - * this thread is resumed when stack frames are not to be re-used - * on the next suspend. - * - */ - protected synchronized void disposeStackFrames() - { - Iterator it = fStackFrames.iterator(); - while( it.hasNext() ) - { - CStackFrame frame = (CStackFrame)(((IAdaptable)it.next()).getAdapter( CStackFrame.class )); - if ( frame != null ) - { - frame.dispose(); - } - } - fStackFrames.clear(); - setLastStackDepth( 0 ); - resetStatus(); - setRefreshChildren( true ); - } - - protected void disposeStackFrames( int index, int length ) - { - List removeList = new ArrayList( length ); - Iterator it = fStackFrames.iterator(); - int counter = 0; - while( it.hasNext() ) - { - CStackFrame frame = (CStackFrame)(((IAdaptable)it.next()).getAdapter( CStackFrame.class )); - if ( frame != null && counter >= index && counter < index + length ) - { - frame.dispose(); - removeList.add( frame ); - } - ++counter; - } - fStackFrames.removeAll( removeList ); - } - - /** - * Notification this thread has terminated - update state - * and fire a terminate event. - */ - protected void terminated() - { - setRunning( false ); - dispose(); - cleanup(); - fireTerminateEvent(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IState#getCurrentStateId() - */ - public int getCurrentStateId() - { - return fCurrentStateId; - } - - /** - * Sets the current state identifier. - * - * @param id the identifier - */ - private void setCurrentStateId( int id ) - { - fCurrentStateId = id; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IState#getCurrentStateInfo() - */ - public Object getCurrentStateInfo() - { - return fCurrentStateInfo; - } - - /** - * Sets the info object of the current state. - * - * @param id the info object - */ - private void setCurrentStateInfo( Object info ) - { - fCurrentStateInfo = info; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IInstructionStep#canStepIntoInstruction() - */ - public boolean canStepIntoInstruction() - { - return canStepInto(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IInstructionStep#canStepOverInstruction() - */ - public boolean canStepOverInstruction() - { - return canStepOver(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IInstructionStep#stepIntoInstruction() - */ - public void stepIntoInstruction() throws DebugException - { - if ( !canStepIntoInstruction() ) - return; - try - { - getCDIThread().stepIntoInstruction(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IInstructionStep#stepOverInstruction() - */ - public void stepOverInstruction() throws DebugException - { - if ( !canStepOverInstruction() ) - return; - try - { - getCDIThread().stepOverInstruction(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), e ); - } - } - - private void handleSuspendedEvent( ICDISuspendedEvent event ) - { - setRunning( false ); - if ( event.getSource() instanceof ICDITarget ) - { - if ( isCurrent() ) - { - setCurrentStateId( IState.SUSPENDED ); - ICDISessionObject reason = event.getReason(); - setCurrentStateInfo( reason ); - if ( reason instanceof ICDIEndSteppingRange ) - { - handleEndSteppingRange( (ICDIEndSteppingRange)reason ); - } - else if ( reason instanceof ICDIBreakpoint ) - { - handleBreakpointHit( (ICDIBreakpoint)reason ); - } - else if ( reason instanceof ICDISignalReceived ) - { - handleSuspendedBySignal( (ICDISignalReceived)reason ); - } - else - { - fireSuspendEvent( DebugEvent.CLIENT_REQUEST ); - } - } - return; - } - setCurrentStateId( IState.SUSPENDED ); - setCurrentStateInfo( null ); - } - - private void handleResumedEvent( ICDIResumedEvent event ) - { - setRunning( true ); - setLastStackFrame( null ); - int state = IState.RUNNING; - int detail = DebugEvent.RESUME; - if ( isCurrent() && event.getType() != ICDIResumedEvent.CONTINUE ) - { - preserveStackFrames(); - switch( event.getType() ) - { - case ICDIResumedEvent.STEP_INTO: - case ICDIResumedEvent.STEP_INTO_INSTRUCTION: - detail = DebugEvent.STEP_INTO; - break; - case ICDIResumedEvent.STEP_OVER: - case ICDIResumedEvent.STEP_OVER_INSTRUCTION: - detail = DebugEvent.STEP_OVER; - break; - case ICDIResumedEvent.STEP_RETURN: - detail = DebugEvent.STEP_RETURN; - break; - } - state = IState.STEPPING; - } - else - { - disposeStackFrames(); - fireChangeEvent( DebugEvent.CONTENT ); - } - setCurrentStateId( state ); - setCurrentStateInfo( null ); - fireResumeEvent( detail ); - } - - private void handleEndSteppingRange( ICDIEndSteppingRange endSteppingRange ) - { - fireSuspendEvent( DebugEvent.STEP_END ); - } - - private void handleBreakpointHit( ICDIBreakpoint breakpoint ) - { - fireSuspendEvent( DebugEvent.BREAKPOINT ); - } - - private void handleSuspendedBySignal( ICDISignalReceived signal ) - { - fireSuspendEvent( DebugEvent.UNSPECIFIED ); - } - - private void handleTerminatedEvent( ICDIDestroyedEvent event ) - { -/* - setCurrentStateId( IState.TERMINATED ); - setCurrentStateInfo( null ); - terminated(); -*/ - } - - private void handleDisconnectedEvent( ICDIDisconnectedEvent event ) - { - setCurrentStateId( IState.TERMINATED ); - setCurrentStateInfo( null ); - terminated(); - } - - private void handleChangedEvent( ICDIChangedEvent event ) - { - } - - //private void handleSteppingEvent( ICDISteppingEvent event ) - //{ - // setCurrentStateId( IState.STEPPING ); - // setCurrentStateInfo( null ); - //} - - /** - * Cleans up the internal state of this thread. - * - */ - protected void cleanup() - { - getCDISession().getEventManager().removeEventListener( this ); - disposeStackFrames(); - } - - /** - * Steps until the specified stack frame is the top frame. Provides - * ability to step over/return in the non-top stack frame. - * This method is synchronized, such that the step request - * begins before a background evaluation can be performed. - * - * @exception DebugException if this method fails. Reasons include: - *
              - *
            - */ - protected synchronized void stepToFrame( IStackFrame frame ) throws DebugException - { - } - - private void setRefreshChildren( boolean refresh ) - { - fRefreshChildren = refresh; - } - - private boolean refreshChildren() - { - return fRefreshChildren; - } - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRestart#canRestart() - */ - public boolean canRestart() - { - return getDebugTarget() instanceof IRestart && ((IRestart)getDebugTarget()).canRestart(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IRestart#restart() - */ - public void restart() throws DebugException - { - if ( canRestart() ) - { - ((IRestart)getDebugTarget()).restart(); - } - } - - protected boolean isCurrent() - { - return fIsCurrent; - } - - protected void setCurrent( boolean current ) - { - fIsCurrent = current; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ISwitchToFrame#switchToFrame(IStackFrame) - */ - public void switchToFrame( IStackFrame frame ) throws DebugException - { - if ( frame == null || !(frame instanceof CStackFrame) || frame.equals( getLastStackFrame() ) ) - { - return; - } - try - { - if ( getLastStackFrame() != null ) - { - ((CDebugTarget)getDebugTarget()).resetRegisters(); - getCDIThread().setCurrentStackFrame( ((CStackFrame)frame).getCDIStackFrame() ); - } - setLastStackFrame( (CStackFrame)frame ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - } - - private int getRealSourceMode() - { - return ((CDebugTarget)getDebugTarget()).getRealSourceMode(); - } - - private void setLastStackFrame( CStackFrame frame ) - { - fLastStackFrame = frame; - } - - private CStackFrame getLastStackFrame() - { - return fLastStackFrame; - } - - protected int getStackDepth() throws DebugException - { - int depth = 0; - try - { - depth = getCDIThread().getStackFrameCount(); - } - catch( CDIException e ) - { - setStatus( ICDebugElementErrorStatus.WARNING, "Stack is not available: " + e.getMessage() ); - } - return depth; - } - - protected int getMaxStackDepth() - { - return MAX_STACK_DEPTH; - } - - private void setLastStackDepth( int depth ) - { - fLastStackDepth = depth; - } - - protected int getLastStackDepth() - { - return fLastStackDepth; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter(Class adapter) - { - if ( adapter.equals( IRunToLine.class ) ) - return this; - return super.getAdapter(adapter); - } - - protected void dispose() - { - fDisposed = true; - } - - protected boolean isDisposed() - { - return fDisposed; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IResumeWithoutSignal#canResumeWithoutSignal() - */ - public boolean canResumeWithoutSignal() - { - return ( getDebugTarget() instanceof IResumeWithoutSignal && - ((IResumeWithoutSignal)getDebugTarget()).canResumeWithoutSignal() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.IResumeWithoutSignal#resumeWithoutSignal() - */ - public void resumeWithoutSignal() throws DebugException - { - if ( canResumeWithoutSignal() ) - { - ((IResumeWithoutSignal)getDebugTarget()).resumeWithoutSignal(); - } - } -/* - private boolean applyDeferredBreakpoints() - { - boolean result = false; - try - { - result = getLaunch().getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_DEFERRED_BREAKPOINTS, false ); - } - catch( CoreException e ) - { - } - return result; - } -*/ -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CType.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CType.java deleted file mode 100644 index f41cebef198..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CType.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; -import org.eclipse.cdt.debug.core.model.ICType; - -/** - * Enter type comment. - * - * @since Jun 10, 2003 - */ -public class CType implements ICType -{ - private ICDIType fCDIType; - - public CType( ICDIType cdiType ) - { - setCDIType( cdiType ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#getName() - */ - public String getName() - { - return ( fCDIType != null ) ? fCDIType.getTypeName() : null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( ICType.class.equals( adapter ) ) - return this; - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#dispose() - */ - public void dispose() - { - fCDIType = null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#getArrayDimensions() - */ - public int[] getArrayDimensions() - { - int length = 0; - ICDIType type = getCDIType(); - while( type instanceof ICDIArrayType ) - { - ++length; - type = ( type instanceof ICDIDerivedType ) ? ((ICDIDerivedType)type).getComponentType() : null; - } - int[] dims = new int[length]; - type = getCDIType(); - for ( int i = length; i > 0; --i ) - { - dims[i - 1] = ((ICDIArrayType)type).getDimension(); - type = ((ICDIDerivedType)type).getComponentType(); - } - return dims; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#isArray() - */ - public boolean isArray() - { - return ( getCDIType() instanceof ICDIArrayType ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#isCharacter() - */ - public boolean isCharacter() - { - return ( getCDIType() instanceof ICDICharType ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#isFloatingPointType() - */ - public boolean isFloatingPointType() - { - return ( getCDIType() instanceof ICDIFloatingPointType ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#isPointer() - */ - public boolean isPointer() - { - return ( getCDIType() instanceof ICDIPointerType ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICType#isReference() - */ - public boolean isReference() - { - return ( getCDIType() instanceof ICDIReferenceType ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.type.ICType#isStructure() - */ - public boolean isStructure() - { - return ( getCDIType() instanceof ICDIStructType ); - } - - protected ICDIType getCDIType() - { - return fCDIType; - } - - protected void setCDIType( ICDIType type ) - { - fCDIType = type; - } - - protected boolean hasChildren() - { - ICDIType type = getCDIType(); - if ( type instanceof ICDIStructType || type instanceof ICDIArrayType || - type instanceof ICDIPointerType || type instanceof ICDIReferenceType ) - return true; - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java deleted file mode 100644 index c709652a7bf..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java +++ /dev/null @@ -1,540 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortValue; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharValue; -import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus; -import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator; -import org.eclipse.cdt.debug.core.model.ICValue; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IVariable; - -/** - * - * The value of a variable. - * - * @since Aug 9, 2002 - */ -public class CValue extends CDebugElement implements ICValue -{ - /** - * Parent variable. - */ - private CVariable fParent = null; - - /** - * Cached value. - */ - private String fValueString = null; - - /** - * Underlying CDI value. - */ - private ICDIValue fCDIValue; - - /** - * List of child variables. - */ - private List fVariables = Collections.EMPTY_LIST; - - /** - * Constructor for CValue. - * @param target - */ - public CValue( CVariable parent, ICDIValue cdiValue ) - { - super( (CDebugTarget)parent.getDebugTarget() ); - fParent = parent; - fCDIValue = cdiValue; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException - { - return ( getParentVariable() != null ) ? getParentVariable().getReferenceTypeName() : null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getValueString() - */ - public String getValueString() throws DebugException - { - if ( fValueString == null && getUnderlyingValue() != null ) - { - try - { - fValueString = processUnderlyingValue( getUnderlyingValue() ); - } - catch( CDIException e ) - { - fValueString = e.getMessage(); - } - } - return fValueString; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#isAllocated() - */ - public boolean isAllocated() throws DebugException - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getVariables() - */ - public IVariable[] getVariables() throws DebugException - { - List list = getVariables0(); - return (IVariable[])list.toArray( new IVariable[list.size()] ); - } - - protected synchronized List getVariables0() throws DebugException - { - if ( !isAllocated() || !hasVariables() ) - return Collections.EMPTY_LIST; - if ( fVariables.size() == 0 ) - { - try - { - List vars = getCDIVariables(); - fVariables = new ArrayList( vars.size() ); - Iterator it = vars.iterator(); - while( it.hasNext() ) - { - fVariables.add( new CModificationVariable( this, (ICDIVariable)it.next() ) ); - } - } - catch( DebugException e ) - { - fVariables = new ArrayList( 1 ); - CModificationVariable var = new CModificationVariable( this, new CVariable.ErrorVariable( null, e ) ); - var.setStatus( ICDebugElementErrorStatus.ERROR, e.getMessage() ); - fVariables.add( var ); - } - } - return fVariables; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#hasVariables() - */ - public boolean hasVariables() throws DebugException - { - try - { - ICDIValue value = getUnderlyingValue(); - if ( value != null ) - return value.getChildrenNumber() > 0; - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return false; - } - - public ICDIValue getUnderlyingValue() - { - return fCDIValue; - } - - protected List getCDIVariables() throws DebugException - { - ICDIVariable[] vars = null; - try - { - ICDIValue value = getUnderlyingValue(); - if ( value != null ) - { - vars = value.getVariables(); - // Quick fix. - // getVariables should return an empty array instead of null. - if ( vars == null ) - { - vars = new ICDIVariable[0]; - } - } - } - catch( CDIException e ) - { - requestFailed( "not available: ", e ); - } - return Arrays.asList( vars ); - } - - public synchronized void setChanged( boolean changed ) throws DebugException - { - if ( changed ) - { - fValueString = null; - } - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).setChanged( changed ); - } - } - - public void dispose() - { - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).dispose(); - } - } - - public CVariable getParentVariable() - { - return fParent; - } - - private String processUnderlyingValue( ICDIValue cdiValue ) throws CDIException - { - if ( cdiValue != null ) - { - if ( cdiValue instanceof ICDICharValue ) - return getCharValueString( (ICDICharValue)cdiValue ); - else if ( cdiValue instanceof ICDIShortValue ) - return getShortValueString( (ICDIShortValue)cdiValue ); - else if ( cdiValue instanceof ICDIIntValue ) - return getIntValueString( (ICDIIntValue)cdiValue ); - else if ( cdiValue instanceof ICDILongValue ) - return getLongValueString( (ICDILongValue)cdiValue ); - else if ( cdiValue instanceof ICDILongLongValue ) - return getLongLongValueString( (ICDILongLongValue)cdiValue ); - else if ( cdiValue instanceof ICDIFloatValue ) - return getFloatValueString( (ICDIFloatValue)cdiValue ); - else if ( cdiValue instanceof ICDIDoubleValue ) - return getDoubleValueString( (ICDIDoubleValue)cdiValue ); - else if ( cdiValue instanceof ICDIPointerValue ) - return getPointerValueString( (ICDIPointerValue)cdiValue ); - else if ( cdiValue instanceof ICDIReferenceValue ) - return getReferenceValueString( (ICDIReferenceValue)cdiValue ); - else if ( cdiValue instanceof ICDIWCharValue ) - return getWCharValueString( (ICDIWCharValue)cdiValue ); - else - return cdiValue.getValueString(); - } - return null; - } - - private String getCharValueString( ICDICharValue value ) throws CDIException - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - { - byte byteValue = (byte)value.byteValue(); - return ( ( Character.isISOControl( (char)byteValue ) && - byteValue != '\b' && - byteValue != '\t' && - byteValue != '\n' && - byteValue != '\f' && - byteValue != '\r' ) || byteValue < 0 ) ? "" : new String( new byte[] { '\'', byteValue, '\'' } ); - } - case ICDIFormat.DECIMAL: - { - return ( isUnsigned() ) ? Integer.toString( value.shortValue() ) : - Integer.toString( (byte)value.byteValue() ); - } - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = ( isUnsigned() ) ? Integer.toHexString( value.shortValue() ) : Integer.toHexString( (byte)value.byteValue() ); - sb.append( ( stringValue.length() > 2 ) ? stringValue.substring( stringValue.length() - 2 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getShortValueString( ICDIShortValue value ) throws CDIException - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - case ICDIFormat.DECIMAL: - return ( isUnsigned() ) ? Integer.toString( value.intValue() ) : Short.toString( value.shortValue() ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Integer.toHexString( ( isUnsigned() ) ? value.intValue() : value.shortValue() ); - sb.append( ( stringValue.length() > 4 ) ? stringValue.substring( stringValue.length() - 4 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getIntValueString( ICDIIntValue value ) throws CDIException - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - case ICDIFormat.DECIMAL: - return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = ( isUnsigned() ) ? Long.toHexString( value.longValue() ) : Integer.toHexString( value.intValue() ); - sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getLongValueString( ICDILongValue value ) throws CDIException - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - case ICDIFormat.DECIMAL: - return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Long.toHexString( ( isUnsigned() ) ? value.longValue() : value.intValue() ); - sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getLongLongValueString( ICDILongLongValue value ) throws CDIException - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - case ICDIFormat.DECIMAL: - { - if ( isUnsigned() ) - { - BigInteger bigValue = new BigInteger( value.getValueString() ); - return bigValue.toString(); - } - else - return Long.toString( value.longValue() ); - } - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - - if ( isUnsigned() ) - { - BigInteger bigValue = new BigInteger( value.getValueString() ); - sb.append( bigValue.toString( 16 ) ); - } - else - sb.append( Long.toHexString( value.longValue() ) ); - return sb.toString(); - } - } - return null; - } - - private String getFloatValueString( ICDIFloatValue value ) throws CDIException - { - float floatValue = value.floatValue(); - Float flt = new Float( floatValue ); - if ( flt.isNaN() || flt.isInfinite() ) - return ""; - long longValue = flt.longValue(); - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - return Float.toString( floatValue ); - case ICDIFormat.DECIMAL: - return Long.toString( longValue ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Long.toHexString( longValue ); - sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getDoubleValueString( ICDIDoubleValue value ) throws CDIException - { - double doubleValue = value.doubleValue(); - Double dbl = new Double( doubleValue ); - if ( dbl.isNaN() || dbl.isInfinite() ) - return ""; - long longValue = dbl.longValue(); - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - return dbl.toString(); - case ICDIFormat.DECIMAL: - return Long.toString( longValue ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Long.toHexString( longValue ); - sb.append( ( stringValue.length() > 16 ) ? stringValue.substring( stringValue.length() - 16 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getPointerValueString( ICDIPointerValue value ) throws CDIException - { - long longValue = value.pointerValue(); - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.DECIMAL: - return Long.toString( longValue ); - case ICDIFormat.NATURAL: - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Long.toHexString( longValue ); - sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException - { - long longValue = value.referenceValue(); - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.DECIMAL: - return Long.toString( longValue ); - case ICDIFormat.NATURAL: - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Long.toHexString( longValue ); - sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } - } - return null; - } - - private String getWCharValueString( ICDIWCharValue value ) throws CDIException - { - if ( getParentVariable() != null ) - { - int size = getParentVariable().sizeof(); - if ( size == 2 ) - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - case ICDIFormat.DECIMAL: - return ( isUnsigned() ) ? Integer.toString( value.intValue() ) : Short.toString( value.shortValue() ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = Integer.toHexString( ( isUnsigned() ) ? value.intValue() : value.shortValue() ); - sb.append( ( stringValue.length() > 4 ) ? stringValue.substring( stringValue.length() - 4 ) : stringValue ); - return sb.toString(); - } - } - } - if ( size == 4 ) - { - switch( getParentVariable().getFormat() ) - { - case ICDIFormat.NATURAL: - case ICDIFormat.DECIMAL: - return ( isUnsigned() ) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); - case ICDIFormat.HEXADECIMAL: - { - StringBuffer sb = new StringBuffer( "0x" ); - String stringValue = ( isUnsigned() ) ? Long.toHexString( value.longValue() ) : Integer.toHexString( value.intValue() ); - sb.append( ( stringValue.length() > 8 ) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } - } - } - } - return value.getValueString(); - } - - private boolean isUnsigned() - { - boolean result = false; - try - { - if ( getParentVariable().getCDIVariable() != null ) - result = ( getParentVariable().getCDIVariable().getType() instanceof ICDIIntegralType ) ? - ((ICDIIntegralType)getParentVariable().getCDIVariable().getType()).isUnsigned() : false; - } - catch( CDIException e ) - { - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICValue#evaluateAsExpression() - */ - public String evaluateAsExpression() - { - ICExpressionEvaluator ee = (ICExpressionEvaluator)getDebugTarget().getAdapter( ICExpressionEvaluator.class ); - String valueString = null; - if ( ee != null && ee.canEvaluate() ) - { - try - { - if ( getParentVariable() != null ) - valueString = ee.evaluateExpressionToString( getParentVariable().getQualifiedName() ); - } - catch( DebugException e ) - { - valueString = e.getMessage(); - } - } - return valueString; - } - - protected void reset() throws DebugException - { - fValueString = null; - Iterator it = fVariables.iterator(); - while( it.hasNext() ) - { - ((CVariable)it.next()).reset(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValueFactory.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValueFactory.java deleted file mode 100644 index 87b35c111aa..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValueFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.debug.core.DebugException; - -/** - * - * Generates values for variable and expressions. - * - * @since Sep 9, 2002 - */ -public class CValueFactory -{ - static public CValue createValue( CVariable parent, ICDIValue cdiValue ) throws DebugException - { - return new CValue( parent, cdiValue ); - } - - static public CArrayPartitionValue createArrayValue( CVariable parent, ICDIVariable cdiVariable, int start, int end ) throws DebugException - { - return new CArrayPartitionValue( parent, cdiVariable, start, end ); - } - - static public CValue createGlobalValue( CVariable parent, ICDIValue cdiValue ) throws DebugException - { - return new CGlobalValue( parent, cdiValue ); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java deleted file mode 100644 index e223f85e5c3..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java +++ /dev/null @@ -1,1030 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.model; - -import java.text.MessageFormat; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; -import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; -import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus; -import org.eclipse.cdt.debug.core.model.ICType; -import org.eclipse.cdt.debug.core.model.ICValue; -import org.eclipse.cdt.debug.core.model.ICVariable; -import org.eclipse.cdt.debug.core.model.ICastToArray; -import org.eclipse.cdt.debug.core.model.ICastToType; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; - -/** - * - * A superclass for all variable classes. - * - * @since Aug 9, 2002 - */ -public abstract class CVariable extends CDebugElement - implements ICVariable, - ICDIEventListener, - ICastToType, - ICastToArray -{ - /** - * The instance of this class is created when the 'getCDIVariable' call throws an exception. - * - * @since Jul 22, 2003 - */ - public static class ErrorVariable implements ICDIVariable - { - private ICDIVariableObject fVariableObject; - private Exception fException; - - public ErrorVariable( ICDIVariableObject varObject, Exception e ) - { - fVariableObject = varObject; - fException = e; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getStackFrame() - */ - public ICDIStackFrame getStackFrame() throws CDIException - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getName() - */ - public String getName() - { - return ( fVariableObject != null ) ? fVariableObject.getName() : ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getTypeName() - */ - public String getTypeName() throws CDIException - { - return ( fVariableObject != null ) ? fVariableObject.getTypeName() : ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getType() - */ - public ICDIType getType() throws CDIException - { - return ( fVariableObject != null ) ? fVariableObject.getType() : null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getValue() - */ - public ICDIValue getValue() throws CDIException - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#isEditable() - */ - public boolean isEditable() throws CDIException - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#setValue(java.lang.String) - */ - public void setValue( String expression ) throws CDIException - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#setValue(org.eclipse.cdt.debug.core.cdi.model.ICDIValue) - */ - public void setValue( ICDIValue value ) throws CDIException - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#setFormat(int) - */ - public void setFormat( int format ) throws CDIException - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIObject#getTarget() - */ - public ICDITarget getTarget() - { - return ( fVariableObject != null ) ? fVariableObject.getTarget() : null; - } - - public Exception getException() - { - return fException; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#sizeof() - */ - public int sizeof() throws CDIException - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName() - */ - public String getQualifiedName() throws CDIException - { - return ( fVariableObject != null ) ? fVariableObject.getQualifiedName() : null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#equals(org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject) - */ - public boolean equals( ICDIVariableObject varObject ) - { - return ( fVariableObject != null ) ? fVariableObject.equals( varObject ) : false; - } - } - - class InternalVariable - { - private ICDIVariableObject fCDIVariableObject; - - private ICDIVariable fCDIVariable; - - private Boolean fEditable = null; - - private ICType fType = null; - - private String fQualifiedName = null; - - public InternalVariable( ICDIVariableObject varObject ) - { - setCDIVariableObject( varObject ); - setCDIVariable( ( varObject instanceof ICDIVariable ) ? (ICDIVariable)varObject : null ); - } - - protected synchronized ICDIVariable getCDIVariable() throws CDIException - { - if ( fCDIVariable == null ) - { - try - { - if ( getCDIVariableObject() instanceof ICDIArgumentObject ) - fCDIVariable = getCDISession().getVariableManager().createArgument( (ICDIArgumentObject)getCDIVariableObject() ); - else if ( getCDIVariableObject() != null ) - fCDIVariable = getCDISession().getVariableManager().createVariable( getCDIVariableObject() ); - } - catch( CDIException e ) - { - fCDIVariable = new ErrorVariable( getCDIVariableObject(), e ); - setStatus( ICDebugElementErrorStatus.ERROR, - MessageFormat.format( "not available: {0}", new String[] { e.getMessage() } ) ); - } - } - return fCDIVariable; - } - - protected ICDIVariableObject getCDIVariableObject() - { - return fCDIVariableObject; - } - - protected ICType getType() throws CDIException - { - if ( fType == null ) - { - ICDIVariableObject varObject = getCDIVariableObject(); - if ( varObject != null ) - fType = new CType( varObject.getType() ); - } - return fType; - } - - protected boolean isEditable() throws CDIException - { - if ( fEditable == null ) - { - ICDIVariableObject varObject = getCDIVariableObject(); - if ( varObject != null && !(varObject instanceof ErrorVariable) ) - fEditable = new Boolean( varObject.isEditable() ); - } - return ( fEditable != null ) ? fEditable.booleanValue() : false; - } - - protected boolean hasChildren() throws CDIException - { - CType type = (CType)getType(); - return ( type != null ) ? type.hasChildren() : false; - } - - private void setCDIVariable( ICDIVariable variable ) - { - fCDIVariable = variable; - } - - private void setCDIVariableObject( ICDIVariableObject object ) - { - fCDIVariableObject = object; - } - - protected synchronized void invalidate() - { - try - { - if ( fCDIVariable != null && !(fCDIVariable instanceof ErrorVariable) ) - getCDISession().getVariableManager().destroyVariable( fCDIVariable ); - } - catch( CDIException e ) - { - logError( e.getMessage() ); - } - setCDIVariable( null ); - if ( fType != null ) - fType.dispose(); - fType = null; - fEditable = null; - } - - protected void dispose() - { - invalidate(); - setCDIVariableObject( null ); - } - - protected boolean isSameVariable( ICDIVariable cdiVar ) - { - return ( fCDIVariable != null ) ? fCDIVariable.equals( cdiVar ) : false; - } - - protected int sizeof() - { - if ( getCDIVariableObject() != null ) - { - try - { - return getCDIVariableObject().sizeof(); - } - catch( CDIException e ) - { - } - } - return 0; - } - - protected String getQualifiedName() throws CDIException - { - if ( fQualifiedName == null ) - { - fQualifiedName = ( fCDIVariableObject != null ) ? fCDIVariableObject.getQualifiedName() : null; - } - return fQualifiedName; - } - } - - /** - * The parent object this variable is contained in. - */ - private CDebugElement fParent; - - /** - * The original internal variable. - */ - private InternalVariable fOriginal; - - /** - * The shadow internal variable used for casting. - */ - private InternalVariable fShadow = null; - - /** - * Cache of current value - see #getValue(). - */ - protected ICValue fValue; - - /** - * The name of this variable. - */ - private String fName = null; - - /** - * Change flag. - */ - protected boolean fChanged = false; - - /** - * The current format of this variable. - */ - protected int fFormat = ICDIFormat.NATURAL; - - private boolean fIsEnabled = true; - - /* - * Temporary solution to avoid NPE in VariablesView. - * This is fixed in the Eclipse 2.1.1 Maintenance Build. - */ - static private IValue fDisabledValue = new IValue() - { - public String getReferenceTypeName() throws DebugException - { - return null; - } - - public String getValueString() throws DebugException - { - return null; - } - - public boolean isAllocated() throws DebugException - { - return false; - } - - public IVariable[] getVariables() throws DebugException - { - return null; - } - - public boolean hasVariables() throws DebugException - { - return false; - } - - public String getModelIdentifier() - { - return CDebugCorePlugin.getUniqueIdentifier(); - } - - public IDebugTarget getDebugTarget() - { - return null; - } - - public ILaunch getLaunch() - { - return null; - } - - public Object getAdapter( Class adapter ) - { - return null; - } - - }; - /** - * Constructor for CVariable. - * @param target - */ - public CVariable( CDebugElement parent, ICDIVariableObject cdiVariableObject ) - { - super( (CDebugTarget)parent.getDebugTarget() ); - fParent = parent; - fIsEnabled = !enableVariableBookkeeping(); - fOriginal = createOriginal( cdiVariableObject ); - fShadow = null; - if ( cdiVariableObject instanceof ErrorVariable ) - setStatus( ICDebugElementErrorStatus.ERROR, - MessageFormat.format( "not available: {0}", new String[] { ((ErrorVariable)cdiVariableObject).getException().getMessage() } ) ); - fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ); - getCDISession().getEventManager().addEventListener( this ); - } - - private InternalVariable createOriginal( ICDIVariableObject varObject ) - { - return new InternalVariable( varObject ); - } - - /** - * Returns the current value of this variable. The value - * is cached, but on each access we see if the value has changed - * and update if required. - * - * @see org.eclipse.debug.core.model.IVariable#getValue() - */ - public IValue getValue() throws DebugException - { - if ( !isEnabled() ) - return fDisabledValue; - if ( fValue == null ) - { - if ( getType() != null && getType().isArray() ) - { - ICDIVariable var = null; - try - { - var = getInternalVariable().getCDIVariable(); - } - catch( CDIException e ) - { - requestFailed( "", e ); - } - int[] dims = getType().getArrayDimensions(); - if ( dims.length > 0 && dims[0] > 0 ) - fValue = CValueFactory.createArrayValue( this, var, 0, dims[0] - 1 ); - } - else - { - ICDIValue cdiValue = getCurrentValue(); - if ( cdiValue != null ) - fValue = CValueFactory.createValue( this, cdiValue ); - } - } - return fValue; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#hasValueChanged() - */ - public boolean hasValueChanged() throws DebugException - { - return fChanged; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#setValue(String) - */ - public void setValue( String expression ) throws DebugException - { - notSupported( "Variable does not support value modification." ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#setValue(IValue) - */ - public void setValue( IValue value ) throws DebugException - { - notSupported( "Variable does not support value modification." ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification() - */ - public boolean supportsValueModification() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#verifyValue(String) - */ - public boolean verifyValue( String expression ) throws DebugException - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#verifyValue(IValue) - */ - public boolean verifyValue( IValue value ) throws DebugException - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICastToType.class ) ) - return this; - if ( adapter.equals( IVariable.class ) ) - return this; - if ( adapter.equals( ICVariable.class ) ) - return this; - return super.getAdapter( adapter ); - } - - /** - * Returns this variable's current underlying CDI value. - * Subclasses must implement #retrieveValue() and do not - * need to guard against CDIException, as this method - * handles them. - * - * @exception DebugException if unable to access the value - */ - protected final ICDIValue getCurrentValue() throws DebugException - { - try - { - return retrieveValue(); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return null; - } - - /** - * Returns the last known value for this variable - */ - protected ICDIValue getLastKnownValue() - { - return ( fValue instanceof CValue ) ? ((CValue)fValue).getUnderlyingValue() : null; - } - - protected void dispose() - { - if ( fValue != null ) - { - fValue.dispose(); - } - getCDISession().getEventManager().removeEventListener( this ); - if ( getShadow() != null ) - getShadow().dispose(); - } - - protected synchronized void setChanged( boolean changed ) throws DebugException - { - if ( getValue() != null && getValue() instanceof CValue ) - { - fChanged = changed; - ((CValue)getValue()).setChanged( changed ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent) - */ - public void handleDebugEvent( ICDIEvent event ) - { - ICDIObject source = event.getSource(); - if (source == null) - return; - - if ( source.getTarget().equals( getCDITarget() ) ) - { - if ( event instanceof ICDIChangedEvent ) - { - if ( source instanceof ICDIVariable && isSameVariable( (ICDIVariable)source ) ) - { - handleChangedEvent( (ICDIChangedEvent)event ); - } - } - else if ( event instanceof ICDIDestroyedEvent ) - { - if ( source instanceof ICDIVariable && isSameVariable( (ICDIVariable)source ) ) - { - handleDestroyedEvent( (ICDIDestroyedEvent)event ); - } - } - else if ( event instanceof ICDIResumedEvent ) - { - handleResumedEvent( (ICDIResumedEvent)event ); - } - } - } - - private void handleResumedEvent( ICDIResumedEvent event ) - { - try - { - if ( getCDIVariable() instanceof ErrorVariable ) - { - getInternalVariable().invalidate(); - setStatus( ICDebugElementErrorStatus.OK, null ); - } - } - catch( CDIException e ) - { - } - } - - private void handleChangedEvent( ICDIChangedEvent event ) - { - try - { - setChanged( true ); - fireChangeEvent( DebugEvent.STATE ); - } - catch( DebugException e ) - { - logError( e ); - } - } - - private void handleDestroyedEvent( ICDIDestroyedEvent event ) - { - if ( fOriginal != null ) - fOriginal.invalidate(); - if ( getShadow() != null ) - getShadow().invalidate(); - invalidateValue(); - } - - /** - * Returns the stack frame this variable is contained in. - * - * @return the stack frame - */ - protected CDebugElement getParent() - { - return fParent; - } - - /** - * Returns the underlying CDI variable. - * - * @return the underlying CDI variable - */ - protected ICDIVariable getCDIVariable() throws CDIException - { - if ( getShadow() != null ) - return getShadow().getCDIVariable(); - return getOriginalCDIVariable(); - } - - /** - * Returns this variable's underlying CDI value. - */ - protected ICDIValue retrieveValue() throws DebugException, CDIException - { - return ( getParent().getDebugTarget().isSuspended() && getCDIVariable() != null ) ? - getCDIVariable().getValue() : getLastKnownValue(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getName() - */ - public String getName() throws DebugException - { - if ( fName == null ) - { - fName = ( fOriginal != null ) ? fOriginal.getCDIVariableObject().getName() : null; - } - return fName; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException - { - return ( getType() != null ) ? getType().getName() : null; - } - - protected void updateParentVariable( CValue parentValue ) throws DebugException - { - parentValue.getParentVariable().setChanged( true ); - parentValue.getParentVariable().fireChangeEvent( DebugEvent.STATE ); - } - - /** - * @see org.eclipse.cdt.debug.core.model.ICVariable#getFormat() - */ - public int getFormat() - { - return fFormat; - } - - /** - * @see org.eclipse.cdt.debug.core.model.ICVariable#setFormat(int) - */ - public void setFormat( int format ) throws DebugException - { - doSetFormat( format ); - reset(); - } - - protected void doSetFormat( int format ) - { - fFormat = format; - } - - protected void reset() throws DebugException - { - ((CValue)getValue()).reset(); - fireChangeEvent( DebugEvent.STATE ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToType#cast(java.lang.String) - */ - public void cast( String type ) throws DebugException - { - try - { - InternalVariable newVar = createShadow( getOriginalCDIVariable().getStackFrame(), type ); - if ( getShadow() != null ) - getShadow().dispose(); - setShadow( newVar ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - finally - { - invalidateValue(); - fireChangeEvent( DebugEvent.STATE ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToType#getCurrentType() - */ - public String getCurrentType() - { - try - { - return getReferenceTypeName(); - } - catch( DebugException e ) - { - logError( e ); - } - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToType#restoreDefault() - */ - public void restoreDefault() throws DebugException - { - InternalVariable oldVar = getShadow(); - setShadow( null ); - if ( oldVar != null ) - oldVar.dispose(); - invalidateValue(); - fireChangeEvent( DebugEvent.STATE ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToType#supportsCasting() - */ - public boolean supportsCasting() - { - CDebugTarget target = (CDebugTarget)getDebugTarget().getAdapter( CDebugTarget.class ); - return ( target != null && isEditable() ); - } - - protected ICDIVariable getOriginalCDIVariable() throws CDIException - { - return ( fOriginal != null ) ? fOriginal.getCDIVariable() : null; - } - - private InternalVariable getShadow() - { - return fShadow; - } - - private void setShadow( InternalVariable shadow ) - { - fShadow = shadow; - } - - private InternalVariable createShadow( ICDIStackFrame cdiFrame, String type ) throws DebugException - { - try - { - return new InternalVariable( getCDISession().getVariableManager().getVariableObjectAsType( getOriginalCDIVariable(), type ) ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return null; - } - - private InternalVariable createShadow( ICDIStackFrame cdiFrame, int start, int length ) throws DebugException - { - try - { - return new InternalVariable( getCDISession().getVariableManager().getVariableObjectAsArray( getCDIVariable(), start, length ) ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToType#isCasted() - */ - public boolean isCasted() - { - return ( getShadow() != null ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToArray#castToArray(int, int) - */ - public void castToArray( int startIndex, int length ) throws DebugException - { - try - { - InternalVariable newVar = createShadow( getOriginalCDIVariable().getStackFrame(), startIndex, length ); - if ( getShadow() != null ) - getShadow().dispose(); - setShadow( newVar ); - } - catch( CDIException e ) - { - targetRequestFailed( e.getMessage(), null ); - } - finally - { - invalidateValue(); - fireChangeEvent( DebugEvent.STATE ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICastToArray#supportsCastToArray() - */ - public boolean supportsCastToArray() - { - CDebugTarget target = (CDebugTarget)getDebugTarget().getAdapter( CDebugTarget.class ); - return ( target != null && isEditable() && hasChildren() ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#hasChildren() - */ - public boolean hasChildren() - { - if ( !isEnabled() ) - return false; - boolean result = false; - try - { - InternalVariable var = getInternalVariable(); - if ( var != null ) - result = var.hasChildren(); - } - catch( CDIException e ) - { - logError( e ); - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#isEditable() - */ - public boolean isEditable() - { - if ( !isEnabled() ) - return false; - boolean result = false; - try - { - InternalVariable var = getInternalVariable(); - if ( var != null ) - result = var.isEditable(); - } - catch( CDIException e ) - { - logError( e ); - } - return result; - } - - protected String getQualifiedName() throws DebugException - { - String result = null; - try - { - result = getInternalVariable().getQualifiedName(); - } - catch( CDIException e ) - { - requestFailed( "Qualified name is not available.", e ); - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#getType() - */ - public ICType getType() throws DebugException - { - ICType type = null; - if ( isEnabled() ) - { - try - { - InternalVariable iv = getInternalVariable(); - if ( iv != null ) - type = iv.getType(); - } - catch( CDIException e ) - { - requestFailed( "Type is not available.", e ); - } - } - return type; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#isEnabled() - */ - public boolean isEnabled() - { - return ( canEnableDisable() ) ? fIsEnabled : true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#setEnabled(boolean) - */ - public void setEnabled( boolean enabled ) throws DebugException - { - setEnabled0( enabled ); - fireChangeEvent( DebugEvent.STATE ); - } - - private synchronized void setEnabled0( boolean enabled ) - { - if ( fOriginal != null ) - fOriginal.invalidate(); - if ( getShadow() != null ) - getShadow().invalidate(); - fIsEnabled = enabled; - invalidateValue(); - } - - private void invalidateValue() - { - if ( fValue != null ) - { - fValue.dispose(); - fValue = null; - } - } - - public boolean isArgument() - { - return ( fOriginal != null ) ? ( fOriginal.getCDIVariableObject() instanceof ICDIArgumentObject ) : false; - } - - protected boolean sameVariableObject( ICDIVariableObject object ) - { - return ( object != null && fOriginal != null ) ? ( object.equals( fOriginal.getCDIVariableObject() ) ) : false; - } - - private boolean enableVariableBookkeeping() - { - boolean result = false; - try - { - result = getLaunch().getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false ); - } - catch( CoreException e ) - { - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.model.ICVariable#canEnableDisable() - */ - public boolean canEnableDisable() - { - return ( getParent() instanceof CStackFrame ); - } - - protected boolean isSameVariable( ICDIVariable cdiVar ) - { - return ( ( getShadow() != null && getShadow().isSameVariable( cdiVar ) ) || - ( fOriginal != null && fOriginal.isSameVariable( cdiVar ) ) ); - } - - private InternalVariable getInternalVariable() - { - return ( getShadow() != null ) ? getShadow() : fOriginal; - } - - protected int sizeof() - { - return getInternalVariable().sizeof(); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java deleted file mode 100644 index 4781c9c8f8f..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CDirectorySourceLocation.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.sourcelookup; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.io.StringReader; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xerces.dom.DocumentImpl; -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * - * Locates source elements in a directory in the local - * file system. Returns instances of FileStorage. - * - * @since Sep 23, 2002 - */ -public class CDirectorySourceLocation implements IDirectorySourceLocation -{ - private static final String ELEMENT_NAME = "cDirectorySourceLocation"; - private static final String ATTR_DIRECTORY = "directory"; - private static final String ATTR_ASSOCIATION = "association"; - private static final String ATTR_SEARCH_SUBFOLDERS = "searchSubfolders"; - - /** - * The root directory of this source location - */ - private IPath fDirectory; - - /** - * The associted path of this source location. - */ - private IPath fAssociation = null; - - private boolean fSearchForDuplicateFiles = false; - - private boolean fSearchSubfolders = false; - - private File[] fFolders = null; - - /** - * Constructor for CDirectorySourceLocation. - */ - public CDirectorySourceLocation() - { - } - - /** - * Constructor for CDirectorySourceLocation. - */ - public CDirectorySourceLocation( IPath directory, IPath association, boolean searchSubfolders ) - { - setDirectory( directory ); - setAssociation( association ); - setSearchSubfolders( searchSubfolders ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#findSourceElement(String) - */ - public Object findSourceElement( String name ) throws CoreException - { - Object result = null; - if ( !isEmpty( name ) && getDirectory() != null ) - { - File file = new File( name ); - if ( file.isAbsolute() ) - result = findFileByAbsolutePath( name ); - else - result = findFileByRelativePath( name ); - if ( result == null && getAssociation() != null ) - { - IPath path = new Path( name ); - if ( path.segmentCount() > 1 && getAssociation().isPrefixOf( path ) ) - { - path = getDirectory().append( path.removeFirstSegments( getAssociation().segmentCount() ) ); - result = findFileByAbsolutePath( path.toOSString() ); - } - } - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICSourceLocation.class ) ) - return this; - if ( adapter.equals( CDirectorySourceLocation.class ) ) - return this; - if ( adapter.equals( IPath.class ) ) - return getDirectory(); - return null; - } - - /** - * Sets the directory in which source elements will be searched for. - * - * @param directory a directory - */ - private void setDirectory( IPath directory ) - { - fDirectory = directory; - } - - /** - * Returns the root directory of this source location. - * - * @return directory - */ - public IPath getDirectory() - { - return fDirectory; - } - - public void getDirectory( IPath path ) - { - fDirectory = path; - } - - public void setAssociation( IPath association ) - { - fAssociation = association; - } - - public IPath getAssociation() - { - return fAssociation; - } - - private Object findFileByAbsolutePath( String name ) - { - File file = new File( name ); - if ( !file.isAbsolute() ) - return null; - File[] folders = getFolders(); - if ( folders != null ) - { - LinkedList list = new LinkedList(); - for ( int i = 0; i < folders.length; ++i ) - { - Object result = findFileByAbsolutePath( folders[i], name ); - if ( result instanceof List ) - { - if ( searchForDuplicateFiles() ) - list.addAll( (List)result ); - else - return list.getFirst(); - } - else if ( result != null ) - { - if ( searchForDuplicateFiles() ) - list.add( result ); - else - return result; - } - } - if ( list.size() > 0 ) - return ( list.size() == 1 ) ? list.getFirst() : list; - } - return null; - } - - private Object findFileByAbsolutePath( File folder, String name ) - { - File file = new File( name ); - if ( !file.isAbsolute() ) - return null; - IPath filePath = new Path( name ); - IPath path = new Path( folder.getAbsolutePath() ); - IPath association = getAssociation(); - if ( !isPrefix( path, filePath ) || path.segmentCount() + 1 != filePath.segmentCount() ) - { - if ( association != null && isPrefix( association, filePath ) && association.segmentCount() + 1 == filePath.segmentCount() ) - filePath = path.append( filePath.removeFirstSegments( association.segmentCount() ) ); - else - return null; - } - - // Try for a file in another workspace project - IFile[] wsFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation( filePath ); - LinkedList list = new LinkedList(); - for ( int j = 0; j < wsFiles.length; ++j ) - if ( wsFiles[j].exists() ) - if ( !searchForDuplicateFiles() ) - return wsFiles[j]; - else - list.add( wsFiles[j] ); - if ( list.size() > 0 ) - return ( list.size() == 1 ) ? list.getFirst() : list; - - file = filePath.toFile(); - if ( file.exists() && file.isFile() ) - { - return createExternalFileStorage( filePath ); - } - return null; - } - - private Object findFileByRelativePath( String fileName ) - { - File[] folders = getFolders(); - if ( folders != null ) - { - LinkedList list = new LinkedList(); - for ( int i = 0; i < folders.length; ++i ) - { - Object result = findFileByRelativePath( folders[i], fileName ); - if ( result instanceof List ) - { - if ( searchForDuplicateFiles() ) - list.addAll( (List)result ); - else - return list.getFirst(); - } - else if ( result != null ) - { - if ( searchForDuplicateFiles() ) - list.add( result ); - else - return result; - } - } - if ( list.size() > 0 ) - return ( list.size() == 1 ) ? list.getFirst() : list; - } - return null; - } - - private Object findFileByRelativePath( File folder, String fileName ) - { - IPath path = new Path( folder.getAbsolutePath() ); - path = path.append( fileName ); - File file = path.toFile(); - if ( file.exists() && file.isFile() ) - { - path = new Path( file.getAbsolutePath() ); - IFile[] wsFiles = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation( path ); - LinkedList list = new LinkedList(); - for ( int j = 0; j < wsFiles.length; ++j ) - if ( wsFiles[j].exists() ) - if ( !searchForDuplicateFiles() ) - return wsFiles[j]; - else - list.add( wsFiles[j] ); - if ( list.size() > 0 ) - return ( list.size() == 1 ) ? list.getFirst() : list; - else - return createExternalFileStorage( path ); - } - return null; - } - - private IStorage createExternalFileStorage( IPath path ) - { - return new FileStorage( path ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#getMemento() - */ - public String getMemento() throws CoreException - { - Document doc = new DocumentImpl(); - Element node = doc.createElement( ELEMENT_NAME ); - doc.appendChild( node ); - node.setAttribute( ATTR_DIRECTORY, getDirectory().toOSString() ); - if ( getAssociation() != null ) - node.setAttribute( ATTR_ASSOCIATION, getAssociation().toOSString() ); - node.setAttribute( ATTR_SEARCH_SUBFOLDERS, new Boolean( searchSubfolders() ).toString() ); - try - { - return CDebugUtils.serializeDocument( doc, " " ); - } - catch( IOException e ) - { - abort( MessageFormat.format( "Unable to create memento for C/C++ directory source location {0}", new String[] { getDirectory().toOSString() } ), e ); - } - // execution will not reach here - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#initializeFrom(java.lang.String) - */ - public void initializeFrom( String memento ) throws CoreException - { - Exception ex = null; - try - { - Element root = null; - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - StringReader reader = new StringReader( memento ); - InputSource source = new InputSource( reader ); - root = parser.parse( source ).getDocumentElement(); - - String dir = root.getAttribute( ATTR_DIRECTORY ); - if ( isEmpty( dir ) ) - { - abort( "Unable to initialize source location - missing directory path", null ); - } - else - { - IPath path = new Path( dir ); - if ( path.isValidPath( dir ) && path.toFile().isDirectory() && path.toFile().exists() ) - { - setDirectory( path ); - } - else - { - abort( MessageFormat.format( "Unable to initialize source location - invalid directory path {0}", new String[] { dir } ), null ); - } - } - dir = root.getAttribute( ATTR_ASSOCIATION ); - if ( isEmpty( dir ) ) - { - setAssociation( null ); - } - else - { - IPath path = new Path( dir ); - if ( path.isValidPath( dir ) ) - { - setAssociation( path ); - } - else - { - setAssociation( null ); - } - } - setSearchSubfolders( Boolean.valueOf( root.getAttribute( ATTR_SEARCH_SUBFOLDERS ) ).booleanValue() ); - return; - } - catch( ParserConfigurationException e ) - { - ex = e; - } - catch( SAXException e ) - { - ex = e; - } - catch( IOException e ) - { - ex = e; - } - abort( "Exception occurred initializing source location.", ex ); - } - - /** - * Throws an internal error exception - */ - private void abort( String message, Throwable e ) throws CoreException - { - IStatus s = new Status( IStatus.ERROR, - CDebugCorePlugin.getUniqueIdentifier(), - CDebugCorePlugin.INTERNAL_ERROR, - message, - e ); - throw new CoreException( s ); - } - - private boolean isEmpty( String string ) - { - return string == null || string.length() == 0; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals( Object obj ) - { - if ( obj instanceof IDirectorySourceLocation ) - { - IPath dir = ((IDirectorySourceLocation)obj).getDirectory(); - IPath association = ((IDirectorySourceLocation)obj).getAssociation(); - if ( dir == null ) - return false; - boolean result = dir.equals( getDirectory() ); - if ( result ) - { - if ( association == null && getAssociation() == null ) - return true; - if ( association != null ) - return association.equals( getAssociation() ); - } - } - return false; - } - - private boolean isPrefix( IPath prefix, IPath path ) - { - int segCount = prefix.segmentCount(); - if ( segCount >= path.segmentCount() ) - return false; - String prefixString = prefix.toOSString(); - String pathString = path.removeLastSegments( path.segmentCount() - segCount ).toOSString(); - return prefixString.equalsIgnoreCase( pathString ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#setSearchForDuplicateFiles(boolean) - */ - public void setSearchForDuplicateFiles( boolean search ) - { - fSearchForDuplicateFiles = search; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#searchForDuplicateFiles() - */ - public boolean searchForDuplicateFiles() - { - return fSearchForDuplicateFiles; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation#searchSubfolders() - */ - public boolean searchSubfolders() - { - return fSearchSubfolders; - } - - public void setSearchSubfolders( boolean search ) - { - resetFolders(); - fSearchSubfolders = search; - } - - protected File[] getFolders() - { - if ( fFolders == null ) - initializeFolders(); - return fFolders; - } - - protected void resetFolders() - { - fFolders = null; - } - - private void initializeFolders() - { - if ( getDirectory() != null ) - { - ArrayList list = new ArrayList(); - File root = getDirectory().toFile(); - list.add( root ); - if ( searchSubfolders() ) - list.addAll( getFileFolders( root ) ); - fFolders = (File[])list.toArray( new File[list.size()] ); - } - } - - private List getFileFolders( File file ) - { - ArrayList list = new ArrayList(); - File[] folders = file.listFiles( - new FileFilter() - { - public boolean accept( File pathname ) - { - return pathname.isDirectory(); - } - } ); - list.addAll( Arrays.asList( folders ) ); - for ( int i = 0; i < folders.length; ++i ) - list.addAll( getFileFolders( folders[i] ) ); - return list; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - public String toString() - { - return ( getDirectory() != null ) ? getDirectory().toOSString() : ""; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#dispose() - */ - public void dispose() - { - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java deleted file mode 100644 index 0f7c9328cc9..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CProjectSourceLocation.java +++ /dev/null @@ -1,396 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.core.sourcelookup; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xerces.dom.DocumentImpl; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * - * Locates source elements in a Java project. Returns instances of IFile. - * - * @since Sep 23, 2002 - */ -public class CProjectSourceLocation implements IProjectSourceLocation -{ - private static final String ELEMENT_NAME = "cProjectSourceLocation"; - private static final String ATTR_PROJECT = "project"; - private static final String ATTR_GENERIC = "generic"; - - /** - * The project associated with this source location - */ - private IProject fProject; - - private IResource[] fFolders; - - private HashMap fCache = new HashMap( 20 ); - - private HashSet fNotFoundCache = new HashSet( 20 ); - - private boolean fGenerated = true; - - private boolean fSearchForDuplicateFiles = false; - - /** - * Constructor for CProjectSourceLocation. - */ - public CProjectSourceLocation() - { - } - - /** - * Constructor for CProjectSourceLocation. - */ - public CProjectSourceLocation( IProject project ) - { - setProject( project ); - fGenerated = true; - } - - /** - * Constructor for CProjectSourceLocation. - */ - public CProjectSourceLocation( IProject project, boolean generated ) - { - setProject( project ); - fGenerated = generated; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#findSourceElement(String) - */ - public Object findSourceElement( String name ) throws CoreException - { - Object result = null; - if ( !isEmpty( name ) && getProject() != null && !notFoundCacheLookup( name ) ) - { - result = cacheLookup( name ); - if ( result == null ) - { - result = doFindSourceElement( name ); - if ( result != null ) - { - cacheSourceElement( name, result ); - } - } - if ( result == null ) - { - cacheNotFound( name ); - } - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( ICSourceLocation.class ) ) - return this; - if ( adapter.equals( CProjectSourceLocation.class ) ) - return this; - if ( adapter.equals( IProject.class ) ) - return getProject(); - return null; - } - - /** - * Sets the project in which source elements will be searched for. - * - * @param project the project - */ - private void setProject( IProject project ) - { - fProject = project; - } - - /** - * Returns the project associated with this source location. - * - * @return project - */ - public IProject getProject() - { - return fProject; - } - - private Object doFindSourceElement( String name ) - { - File file = new File( name ); - return ( file.isAbsolute() ) ? findFileByAbsolutePath( file ) : findFileByRelativePath( name ); - } - - private Object findFileByAbsolutePath( File file ) - { - LinkedList list = new LinkedList(); - if ( file.exists() ) - { - IPath path = new Path( file.getAbsolutePath() ); - IFile[] wsFiles = CDebugCorePlugin.getWorkspace().getRoot().findFilesForLocation( path ); - for ( int i = 0; i < wsFiles.length; ++i ) - if ( wsFiles[i].getProject().equals( getProject() ) && wsFiles[i].exists() ) - if ( !searchForDuplicateFiles() ) - return wsFiles[i]; - else - list.add( wsFiles[i] ); - } - return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null; - } - - private Object findFileByRelativePath( String fileName ) - { - IResource[] folders = getFolders(); - LinkedList list = new LinkedList(); - for ( int i = 0; i < folders.length; ++i ) - { - if ( list.size() > 0 && !searchForDuplicateFiles() ) - break; - IPath path = folders[i].getLocation().append( fileName ); - File file = new File( path.toOSString() ); - if ( file.exists() ) - { - IFile[] wsFiles = CDebugCorePlugin.getWorkspace().getRoot().findFilesForLocation( path ); - for ( int j = 0; j < wsFiles.length; ++j ) - if ( wsFiles[j].exists() ) - if ( !searchForDuplicateFiles() ) - return wsFiles[j]; - else - list.add( wsFiles[j] ); - } - } - return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null; - } - - private Object cacheLookup( String name ) - { - return fCache.get( name ); - } - - private boolean notFoundCacheLookup( String name ) - { - return fNotFoundCache.contains( name ); - } - - private void cacheSourceElement( String name, Object element ) - { - fCache.put( name, element ); - } - - private void cacheNotFound( String name ) - { - fNotFoundCache.add( name ); - } - - public void dispose() - { - fCache.clear(); - fNotFoundCache.clear(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#getMemento() - */ - public String getMemento() throws CoreException - { - Document doc = new DocumentImpl(); - Element node = doc.createElement( ELEMENT_NAME ); - doc.appendChild( node ); - node.setAttribute( ATTR_PROJECT, getProject().getName() ); - node.setAttribute( ATTR_GENERIC, new Boolean( isGeneric() ).toString() ); - try - { - return CDebugUtils.serializeDocument( doc, " " ); - } - catch( IOException e ) - { - abort( MessageFormat.format( "Unable to create memento for C/C++ project source location {0}.", new String[] { getProject().getName() } ), e ); - } - // execution will not reach here - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#initializeFrom(java.lang.String) - */ - public void initializeFrom( String memento ) throws CoreException - { - Exception ex = null; - try - { - Element root = null; - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - StringReader reader = new StringReader( memento ); - InputSource source = new InputSource( reader ); - root = parser.parse( source ).getDocumentElement(); - - String name = root.getAttribute( ATTR_PROJECT ); - if ( isEmpty( name ) ) - { - abort( "Unable to initialize source location - missing project name", null ); - } - else - { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( name ); - setProject( project ); - } - String isGeneric = root.getAttribute( ATTR_GENERIC ); - if ( isGeneric == null || isGeneric.trim().length() == 0 ) - isGeneric = Boolean.FALSE.toString(); - setGenerated( isGeneric.equals( Boolean.TRUE.toString() ) ); - return; - } - catch( ParserConfigurationException e ) - { - ex = e; - } - catch( SAXException e ) - { - ex = e; - } - catch( IOException e ) - { - ex = e; - } - abort( "Exception occurred initializing source location.", ex ); - } - - /** - * Throws an internal error exception - */ - private void abort( String message, Throwable e ) throws CoreException - { - IStatus s = new Status( IStatus.ERROR, - CDebugCorePlugin.getUniqueIdentifier(), - CDebugCorePlugin.INTERNAL_ERROR, - message, - e ); - throw new CoreException( s ); - } - - private boolean isEmpty( String string ) - { - return string == null || string.length() == 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation#isGenerated() - */ - public boolean isGeneric() - { - return fGenerated; - } - - public void setGenerated( boolean b ) - { - fGenerated = b; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals( Object obj ) - { - if ( obj instanceof IProjectSourceLocation && getProject() != null ) - return getProject().equals( ((IProjectSourceLocation)obj).getProject() ); - return false; - } - - private void initializeFolders() - { - final LinkedList list = new LinkedList(); - if ( getProject() != null ) - { - list.add( getProject() ); - try - { - getProject().accept( - new IResourceProxyVisitor() - { - public boolean visit( IResourceProxy proxy ) throws CoreException - { - switch( proxy.getType() ) - { - case IResource.FILE: - return false; - case IResource.FOLDER: - list.addLast( proxy.requestResource() ); - return true; - } - return true; - } - - }, - IResource.NONE ); - } - catch( CoreException e ) - { - } - } - fFolders = (IResource[])list.toArray( new IResource[list.size()] ); - } - - protected IResource[] getFolders() - { - if ( fFolders == null ) - initializeFolders(); - return fFolders; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#searchForDuplicateFiles() - */ - public boolean searchForDuplicateFiles() - { - return fSearchForDuplicateFiles; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation#setSearchForDuplicateFiles(boolean) - */ - public void setSearchForDuplicateFiles( boolean search ) - { - fCache.clear(); - fNotFoundCache.clear(); - fSearchForDuplicateFiles = search; - } - - public String toString() - { - return ( getProject() != null ) ? fProject.toString() : ""; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java deleted file mode 100644 index 0866a38b71b..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceLocator.java +++ /dev/null @@ -1,745 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.sourcelookup; - -import java.io.IOException; -import java.io.StringReader; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xerces.dom.DocumentImpl; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.IStackFrame; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * - * Default source locator. - * - * @since Aug 19, 2002 - */ - -public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocator, IResourceChangeListener -{ - private static final String SOURCE_LOCATOR_NAME = "cSourceLocator"; - private static final String DISABLED_GENERIC_PROJECT_NAME = "disabledGenericProject"; - private static final String ADDITIONAL_SOURCE_LOCATION_NAME = "additionalSourceLocation"; - private static final String SOURCE_LOCATION_NAME = "cSourceLocation"; - private static final String ATTR_CLASS = "class"; - private static final String ATTR_MEMENTO = "memento"; - private static final String ATTR_PROJECT_NAME = "projectName"; - private static final String ATTR_DUPLICATE_FILES = "duplicateFiles"; - - /** - * The project associated with this locator. - */ - private IProject fProject = null; - - /** - * The array of source locations associated with this locator. - */ - private ICSourceLocation[] fSourceLocations; - - /** - * The array of projects referenced by main project. - */ - private List fReferencedProjects = new ArrayList( 10 ); - - /** - * The flag specifies whether to search for all source elements, - * or just the first match. - */ - private boolean fDuplicateFiles = false; - - /** - * Constructor for CSourceLocator. - */ - public CSourceLocator( IProject project ) - { - setProject( project ); - setReferencedProjects(); - setSourceLocations( getDefaultSourceLocations() ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(IStackFrame) - */ - public Object getSourceElement( IStackFrame stackFrame ) - { - if ( stackFrame != null && stackFrame.getAdapter( IStackFrameInfo.class ) != null ) - { - return getInput( (IStackFrameInfo)stackFrame.getAdapter( IStackFrameInfo.class ) ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSourceLocator#getLineNumber(IStackFrameInfo) - */ - public int getLineNumber( IStackFrame frame ) - { - IStackFrameInfo info = (IStackFrameInfo)frame.getAdapter( IStackFrameInfo.class ); - return ( info != null ) ? info.getFrameLineNumber() : 0; - } - - protected Object getInput( IStackFrameInfo info ) - { - LinkedList list = new LinkedList(); - if ( info != null ) - { - Object result = null; - String fileName = info.getFile(); - if ( fileName != null && fileName.length() > 0 ) - { - ICSourceLocation[] locations = getSourceLocations(); - for ( int i = 0; i < locations.length; ++i ) - { - try - { - result = locations[i].findSourceElement( fileName ); - } - catch( CoreException e ) - { - // do nothing - } - if ( result != null ) - { - if ( result instanceof List ) - list.addAll( (List)result ); - else - list.add( result ); - if ( !searchForDuplicateFiles() ) - break; - } - } - } - } - return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.ICSourceLocator#contains(IResource) - */ - public boolean contains( IResource resource ) - { - ICSourceLocation[] locations = getSourceLocations(); - for ( int i = 0; i < locations.length; ++i ) - { - if ( resource instanceof IProject ) - { - if ( locations[i] instanceof CProjectSourceLocation && - ((CProjectSourceLocation)locations[i]).getProject().equals( resource ) ) - { - return true; - } - } - if ( resource instanceof IFile ) - { - try - { - Object result = locations[i].findSourceElement( resource.getLocation().toOSString() ); - if ( result instanceof IFile && ((IFile)result).equals( resource ) ) - return true; - if ( result instanceof List && ((List)result).contains( resource ) ) - return true; - } - catch( CoreException e ) - { - } - } - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getSourceLocations() - */ - public ICSourceLocation[] getSourceLocations() - { - return fSourceLocations; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#setSourceLocations(ICSourceLocation[]) - */ - public void setSourceLocations( ICSourceLocation[] locations ) - { - fSourceLocations = locations; - } - - /** - * Returns a default collection of source locations for - * the given project. Default source locations consist - * of the given project and all of its referenced projects. - * - * @param project a project - * @return a collection of source locations for all required - * projects - * @exception CoreException - */ - public static ICSourceLocation[] getDefaultSourceLocations( IProject project ) - { - ArrayList list = new ArrayList(); - if ( project != null && project.exists() ) - { - list.add( SourceLookupFactory.createProjectSourceLocation( project ) ); - addReferencedSourceLocations( list, project ); - } - return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ); - } - - private static void addReferencedSourceLocations( List list, IProject project ) - { - if ( project != null ) - { - try - { - IProject[] projects = project.getReferencedProjects(); - for ( int i = 0; i < projects.length; i++ ) - { - if ( projects[i].exists() && !containsProject( list, projects[i] ) ) - { - list.add( SourceLookupFactory.createProjectSourceLocation( projects[i] ) ); - addReferencedSourceLocations( list, projects[i] ); - } - } - } - catch( CoreException e ) - { - // do nothing - } - } - } - - private static boolean containsProject( List list, IProject project ) - { - Iterator it = list.iterator(); - while( it.hasNext() ) - { - CProjectSourceLocation location = (CProjectSourceLocation)it.next(); - if ( project.equals( location.getProject() ) ) - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#findSourceElement(String) - */ - public Object findSourceElement( String fileName ) - { - Object result = null; - if ( fileName != null && fileName.length() > 0 ) - { - ICSourceLocation[] locations = getSourceLocations(); - for ( int i = 0; i < locations.length; ++i ) - { - try - { - result = locations[i].findSourceElement( fileName ); - } - catch( CoreException e ) - { - // do nothing - } - if ( result != null ) - break; - } - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento() - */ - public String getMemento() throws CoreException - { - Document doc = new DocumentImpl(); - Element node = doc.createElement( SOURCE_LOCATOR_NAME ); - doc.appendChild( node ); - - ICSourceLocation[] locations = getSourceLocations(); - saveDisabledGenericSourceLocations( locations, doc, node ); - saveAdditionalSourceLocations( locations, doc, node ); - node.setAttribute( ATTR_DUPLICATE_FILES, new Boolean( searchForDuplicateFiles() ).toString() ); - try - { - return CDebugUtils.serializeDocument( doc, " " ); - } - catch( IOException e ) - { - abort( "Unable to create memento for C/C++ source locator.", e ); - } - // execution will not reach here - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeDefaults( ILaunchConfiguration configuration ) throws CoreException - { - setSourceLocations( getDefaultSourceLocations() ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String) - */ - public void initializeFromMemento( String memento ) throws CoreException - { - Exception ex = null; - try - { - Element root = null; - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - StringReader reader = new StringReader( memento ); - InputSource source = new InputSource( reader ); - root = parser.parse( source ).getDocumentElement(); - - if ( !root.getNodeName().equalsIgnoreCase( SOURCE_LOCATOR_NAME ) ) - { - abort( "Unable to restore C/C++ source locator - invalid format.", null ); - } - - List sourceLocations = new ArrayList(); - - // Add locations based on referenced projects - IProject project = getProject(); - if ( project != null && project.exists() && project.isOpen() ) - sourceLocations.addAll( Arrays.asList( getDefaultSourceLocations() ) ); - - removeDisabledLocations( root, sourceLocations ); - addAdditionalLocations( root, sourceLocations ); - // To support old launch configuration - addOldLocations( root, sourceLocations ); - setSourceLocations( (ICSourceLocation[])sourceLocations.toArray( new ICSourceLocation[sourceLocations.size()] ) ); - - setSearchForDuplicateFiles( Boolean.valueOf( root.getAttribute( ATTR_DUPLICATE_FILES ) ).booleanValue() ); - - return; - } - catch( ParserConfigurationException e ) - { - ex = e; - } - catch( SAXException e ) - { - ex = e; - } - catch( IOException e ) - { - ex = e; - } - abort( "Exception occurred initializing source locator.", ex ); - } - - private void removeDisabledLocations( Element root, List sourceLocations ) throws CoreException - { - NodeList list = root.getChildNodes(); - int length = list.getLength(); - HashSet disabledProjects = new HashSet( length ); - for ( int i = 0; i < length; ++i ) - { - Node node = list.item( i ); - short type = node.getNodeType(); - if ( type == Node.ELEMENT_NODE ) - { - Element entry = (Element)node; - if ( entry.getNodeName().equalsIgnoreCase( DISABLED_GENERIC_PROJECT_NAME ) ) - { - String projectName = entry.getAttribute( ATTR_PROJECT_NAME ); - if ( isEmpty( projectName ) ) - { - CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); - } - disabledProjects.add( projectName.trim() ); - } - } - } - Iterator it = sourceLocations.iterator(); - while( it.hasNext() ) - { - ICSourceLocation location = (ICSourceLocation)it.next(); - if ( location instanceof IProjectSourceLocation && - disabledProjects.contains( ((IProjectSourceLocation)location).getProject().getName() ) ) - it.remove(); - } - } - - private void addAdditionalLocations( Element root, List sourceLocations ) throws CoreException - { - ClassLoader classLoader = CDebugCorePlugin.getDefault() .getDescriptor().getPluginClassLoader(); - - MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), - CDebugCorePlugin.INTERNAL_ERROR, - "Error initializing directory source location.", - null ); - NodeList list = root.getChildNodes(); - int length = list.getLength(); - for ( int i = 0; i < length; ++i ) - { - Node node = list.item( i ); - short type = node.getNodeType(); - if ( type == Node.ELEMENT_NODE ) - { - Element entry = (Element)node; - if ( entry.getNodeName().equalsIgnoreCase( ADDITIONAL_SOURCE_LOCATION_NAME ) ) - { - String className = entry.getAttribute( ATTR_CLASS ); - String data = entry.getAttribute( ATTR_MEMENTO ); - if ( isEmpty( className ) ) - { - CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); - continue; - } - Class clazz = null; - try - { - clazz = classLoader.loadClass( className ); - } - catch( ClassNotFoundException e ) - { - CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); - continue; - } - - ICSourceLocation location = null; - try - { - location = (ICSourceLocation)clazz.newInstance(); - } - catch( IllegalAccessException e ) - { - CDebugCorePlugin.log( "Unable to restore source location." ); - continue; - } - catch( InstantiationException e ) - { - CDebugCorePlugin.log( "Unable to restore source location." ); - continue; - } - try - { - location.initializeFrom( data ); - sourceLocations.add( location ); - } - catch( CoreException e ) - { - status.addAll( e.getStatus() ); - } - } - } - } - if ( status.getSeverity() > IStatus.OK ) - throw new CoreException( status ); - } - - private void addOldLocations( Element root, List sourceLocations ) throws CoreException - { - ClassLoader classLoader = CDebugCorePlugin.getDefault() .getDescriptor().getPluginClassLoader(); - - NodeList list = root.getChildNodes(); - int length = list.getLength(); - for ( int i = 0; i < length; ++i ) - { - Node node = list.item( i ); - short type = node.getNodeType(); - if ( type == Node.ELEMENT_NODE ) - { - Element entry = (Element)node; - if ( entry.getNodeName().equalsIgnoreCase( SOURCE_LOCATION_NAME ) ) - { - String className = entry.getAttribute( ATTR_CLASS ); - String data = entry.getAttribute( ATTR_MEMENTO ); - if ( isEmpty( className ) ) - { - CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); - continue; - } - Class clazz = null; - try - { - clazz = classLoader.loadClass( className ); - } - catch( ClassNotFoundException e ) - { - CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); - continue; - } - - ICSourceLocation location = null; - try - { - location = (ICSourceLocation)clazz.newInstance(); - } - catch( IllegalAccessException e ) - { - CDebugCorePlugin.log( "Unable to restore source location." ); - continue; - } - catch( InstantiationException e ) - { - CDebugCorePlugin.log( "Unable to restore source location." ); - continue; - } - location.initializeFrom( data ); - if ( !sourceLocations.contains( location ) ) - { - if ( location instanceof CProjectSourceLocation ) - ((CProjectSourceLocation)location).setGenerated( isReferencedProject( ((CProjectSourceLocation)location).getProject() ) ); - sourceLocations.add( location ); - } - } - } - } - } - - /** - * Throws an internal error exception - */ - private void abort( String message, Throwable e ) throws CoreException - { - IStatus s = new Status( IStatus.ERROR, - CDebugCorePlugin.getUniqueIdentifier(), - CDebugCorePlugin.INTERNAL_ERROR, - message, - e ); - throw new CoreException( s ); - } - - - private boolean isEmpty( String string ) - { - return string == null || string.trim().length() == 0; - } - - public void resourceChanged( IResourceChangeEvent event ) - { - if ( event.getSource() instanceof IWorkspace && event.getDelta() != null ) - { - IResourceDelta[] deltas = event.getDelta().getAffectedChildren(); - if ( deltas != null ) - { - ArrayList list = new ArrayList( deltas.length ); - for ( int i = 0; i < deltas.length; ++i ) - if ( deltas[i].getResource() instanceof IProject ) - list.add( deltas[i].getResource() ); - resetSourceLocations( list ); - } - } - } - - private void saveDisabledGenericSourceLocations( ICSourceLocation[] locations, Document doc, Element node ) - { - IProject project = getProject(); - if ( project != null && project.exists() && project.isOpen() ) - { - List list = CDebugUtils.getReferencedProjects( project ); - HashSet names = new HashSet( list.size() + 1 ); - names.add( project.getName() ); - Iterator it = list.iterator(); - while( it.hasNext() ) - { - names.add( ((IProject)it.next()).getName() ); - } - for ( int i = 0; i < locations.length; ++i ) - if ( locations[i] instanceof IProjectSourceLocation && - ((IProjectSourceLocation)locations[i]).isGeneric() ) - names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() ); - - it = names.iterator(); - while ( it.hasNext() ) - { - Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME ); - child.setAttribute( ATTR_PROJECT_NAME, (String)it.next() ); - node.appendChild( child ); - } - } - } - - private void saveAdditionalSourceLocations( ICSourceLocation[] locations, Document doc, Element node ) - { - for ( int i = 0; i < locations.length; i++ ) - { - if ( locations[i] instanceof IProjectSourceLocation && - ((IProjectSourceLocation)locations[i]).isGeneric() ) - continue; - Element child = doc.createElement( ADDITIONAL_SOURCE_LOCATION_NAME ); - child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() ); - try - { - child.setAttribute( ATTR_MEMENTO, locations[i].getMemento() ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e ); - continue; - } - node.appendChild( child ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getProject() - */ - public IProject getProject() - { - return fProject; - } - - protected void setProject( IProject project ) - { - fProject = project; - } - - private boolean isReferencedProject( IProject ref ) - { - if ( getProject() != null ) - { - try - { - return Arrays.asList( getProject().getReferencedProjects() ).contains( ref ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e ); - } - } - return false; - } - - private void setReferencedProjects() - { - fReferencedProjects.clear(); - fReferencedProjects = CDebugUtils.getReferencedProjects( getProject() ); - } - - protected ICSourceLocation[] getDefaultSourceLocations() - { - Iterator it = fReferencedProjects.iterator(); - ArrayList list = new ArrayList( fReferencedProjects.size() ); - if ( getProject() != null && getProject().exists() && getProject().isOpen() ) - list.add( SourceLookupFactory.createProjectSourceLocation( getProject() ) ); - while( it.hasNext() ) - { - IProject project = (IProject)it.next(); - if ( project != null && project.exists() && project.isOpen() ) - list.add( SourceLookupFactory.createProjectSourceLocation( project ) ); - } - return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ); - } - - private void resetSourceLocations( List affectedProjects ) - { - if ( affectedProjects.size() != 0 && getProject() != null ) - { - if ( !getProject().exists() || !getProject().isOpen() ) - { - removeGenericSourceLocations(); - } - else - { - updateGenericSourceLocations( affectedProjects ); - } - } - } - - private void removeGenericSourceLocations() - { - fReferencedProjects.clear(); - ICSourceLocation[] locations = getSourceLocations(); - ArrayList newLocations = new ArrayList( locations.length ); - for ( int i = 0; i < locations.length; ++i ) - if ( !(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation)locations[i]).isGeneric() ) - newLocations.add( locations[i] ); - setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) ); - } - - private void updateGenericSourceLocations( List affectedProjects ) - { - List newRefs = CDebugUtils.getReferencedProjects( getProject() ); - ICSourceLocation[] locations = getSourceLocations(); - ArrayList newLocations = new ArrayList( locations.length ); - for ( int i = 0; i < locations.length; ++i ) - { - if ( !(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation)locations[i]).isGeneric() ) - { - newLocations.add( locations[i] ); - } - else - { - IProject project = ((IProjectSourceLocation)locations[i]).getProject(); - if ( project.exists() && project.isOpen() ) - { - if ( newRefs.contains( project ) || project.equals( getProject() ) ) - { - newLocations.add( locations[i] ); - newRefs.remove( project ); - } - } - } - } - Iterator it = newRefs.iterator(); - while( it.hasNext() ) - { - IProject project = (IProject)it.next(); - if ( !fReferencedProjects.contains( project ) ) - newLocations.add( SourceLookupFactory.createProjectSourceLocation( project ) ); - } - fReferencedProjects = newRefs; - setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#searchForDuplicateFiles() - */ - public boolean searchForDuplicateFiles() - { - return fDuplicateFiles; - } - - public void setSearchForDuplicateFiles( boolean search ) - { - fDuplicateFiles = search; - ICSourceLocation[] locations = getSourceLocations(); - for ( int i = 0; i < locations.length; ++i ) - locations[i].setSearchForDuplicateFiles( search ); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceManager.java deleted file mode 100644 index 488320e9d49..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/CSourceManager.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.sourcelookup; - -import java.util.ArrayList; -import java.util.Arrays; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.ISourceLocator; -import org.eclipse.debug.core.model.IStackFrame; - -/** - * Locates sources for a C/C++ debug session. - * - * @since: Oct 8, 2002 - */ -public class CSourceManager implements ICSourceLocator, - IPersistableSourceLocator, - ISourceMode, - IAdaptable -{ - private ISourceLocator fSourceLocator = null; - private int fMode = ISourceMode.MODE_SOURCE; - private int fRealMode = fMode; - private ILaunch fLaunch = null; - private CDebugTarget fDebugTarget = null; - - /** - * Constructor for CSourceManager. - */ - public CSourceManager( ISourceLocator sourceLocator ) - { - setSourceLocator( sourceLocator ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getLineNumber(IStackFrameInfo) - */ - public int getLineNumber( IStackFrame frame ) - { - if ( getRealMode() == ISourceMode.MODE_SOURCE ) - { - if ( getCSourceLocator() != null ) - { - return getCSourceLocator().getLineNumber( frame ); - } - IStackFrameInfo info = (IStackFrameInfo)frame.getAdapter( IStackFrameInfo.class ); - if ( info != null ) - { - return info.getFrameLineNumber(); - } - } - if ( getRealMode() == ISourceMode.MODE_DISASSEMBLY && getDisassemblyManager( frame ) != null ) - { - return getDisassemblyManager( frame ).getLineNumber( frame ); - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getSourceLocations() - */ - public ICSourceLocation[] getSourceLocations() - { - return ( getCSourceLocator() != null ) ? getCSourceLocator().getSourceLocations() : new ICSourceLocation[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#setSourceLocations(ICSourceLocation[]) - */ - public void setSourceLocations( ICSourceLocation[] locations ) - { - if ( getCSourceLocator() != null ) - { - getCSourceLocator().setSourceLocations( locations ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#contains(IResource) - */ - public boolean contains( IResource resource ) - { - return ( getCSourceLocator() != null ) ? getCSourceLocator().contains( resource ) : false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ISourceMode#getMode() - */ - public int getMode() - { - return fMode; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ISourceMode#setMode(int) - */ - public void setMode( int mode ) - { - fMode = mode; - setRealMode( mode ); - } - - public int getRealMode() - { - return fRealMode; - } - - protected void setRealMode( int mode ) - { - fRealMode = mode; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( CSourceManager.class ) ) - return this; - if ( adapter.equals( ICSourceLocator.class ) ) - return this; - if ( adapter.equals( ISourceMode.class ) ) - return this; - if ( adapter.equals( IPersistableSourceLocator.class ) ) - return this; - if ( adapter.equals( IResourceChangeListener.class ) && - fSourceLocator instanceof IResourceChangeListener ) - return fSourceLocator; - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(IStackFrame) - */ - public Object getSourceElement( IStackFrame stackFrame ) - { - Object result = null; - boolean autoDisassembly = CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_AUTO_DISASSEMBLY ); - - if ( getMode() == ISourceMode.MODE_SOURCE && getSourceLocator() != null ) - result = getSourceLocator().getSourceElement( stackFrame ); - if ( result == null && - ( autoDisassembly || getMode() == ISourceMode.MODE_DISASSEMBLY ) && - getDisassemblyManager( stackFrame ) != null ) - { - setRealMode( ISourceMode.MODE_DISASSEMBLY ); - result = getDisassemblyManager( stackFrame ).getSourceElement( stackFrame ); - } - else - { - setRealMode( ISourceMode.MODE_SOURCE ); - } - return result; - } - - protected ICSourceLocator getCSourceLocator() - { - if ( getSourceLocator() instanceof ICSourceLocator ) - return (ICSourceLocator)getSourceLocator(); - return null; - } - - protected ISourceLocator getSourceLocator() - { - if ( fSourceLocator != null ) - return fSourceLocator; - else if ( fLaunch != null ) - return fLaunch.getSourceLocator(); - return null; - } - - protected void setSourceLocator( ISourceLocator sl ) - { - fSourceLocator = sl; - } - - protected DisassemblyManager getDisassemblyManager( IStackFrame stackFrame ) - { - if ( stackFrame != null ) - { - return (DisassemblyManager)stackFrame.getDebugTarget().getAdapter( DisassemblyManager.class ); - } - return null; - } - - public void addSourceLocation( ICSourceLocation location ) - { - ICSourceLocation[] locations = getSourceLocations(); - ArrayList list = new ArrayList( Arrays.asList( locations ) ); - list.add( location ); - setSourceLocations( (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#findSourceElement(String) - */ - public Object findSourceElement( String fileName ) - { - if ( getCSourceLocator() != null ) - { - return getCSourceLocator().findSourceElement( fileName ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento() - */ - public String getMemento() throws CoreException - { - if ( getPersistableSourceLocator() != null ) - return getPersistableSourceLocator().getMemento(); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeDefaults( ILaunchConfiguration configuration ) throws CoreException - { - if ( getPersistableSourceLocator() != null ) - getPersistableSourceLocator().initializeDefaults( configuration ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String) - */ - public void initializeFromMemento( String memento ) throws CoreException - { - if ( getPersistableSourceLocator() != null ) - getPersistableSourceLocator().initializeFromMemento( memento ); - } - - private IPersistableSourceLocator getPersistableSourceLocator() - { - if ( fSourceLocator instanceof IPersistableSourceLocator ) - return (IPersistableSourceLocator)fSourceLocator; - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getProject() - */ - public IProject getProject() - { - return ( getCSourceLocator() != null ) ? getCSourceLocator().getProject() : null; - } - - public void setDebugTarget( CDebugTarget target ) - { - fDebugTarget = target; - } - - protected CDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#setSearchForDuplicateFiles(boolean) - */ - public void setSearchForDuplicateFiles( boolean search ) - { - if ( getCSourceLocator() != null ) - getCSourceLocator().setSearchForDuplicateFiles( search ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#searchForDuplicateFiles() - */ - public boolean searchForDuplicateFiles() - { - return ( getCSourceLocator() != null ) ? getCSourceLocator().searchForDuplicateFiles() : false; - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java deleted file mode 100644 index adbf2ec918b..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.sourcelookup; - -import java.util.ArrayList; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.cdt.debug.internal.core.DisassemblyStorage; -import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; -import org.eclipse.debug.core.model.IStackFrame; - -/** - * Enter type comment. - * - * @since: Oct 8, 2002 - */ -public class DisassemblyManager implements Preferences.IPropertyChangeListener -{ - // move to preferences ??? - final static private int DISASSEMBLY_BLOCK_SIZE = 100; - - private CDebugTarget fDebugTarget; - private DisassemblyStorage fStorage = null; - - /** - * Constructor for DisassemblyManager. - */ - public DisassemblyManager( CDebugTarget target ) - { - setDebugTarget( target ); - CDebugCorePlugin.getDefault().getPluginPreferences().addPropertyChangeListener( this ); - } - - public int getLineNumber( IStackFrame frame ) - { - IStackFrameInfo info = (IStackFrameInfo)frame.getAdapter( IStackFrameInfo.class ); - if ( info != null ) - { - DisassemblyStorage storage = getSourceElement( info ); - if ( storage != null ) - { - return storage.getLineNumber( info.getAddress() ); - } - } - return 0; - } - - public Object getSourceElement( IStackFrame stackFrame ) - { - if ( stackFrame != null ) - { - return getSourceElement( (IStackFrameInfo)stackFrame.getAdapter( IStackFrameInfo.class ) ); - } - return null; - } - - public Object getSourceElement( long address ) - { - DisassemblyStorage storage = null; - if ( getDisassemblyStorage() != null && getDisassemblyStorage().containsAddress( address ) ) - { - storage = getDisassemblyStorage(); - } - else - { - storage = loadDisassemblyStorage( address ); - } - return storage; - } - - private void setDebugTarget( CDebugTarget target ) - { - fDebugTarget = target; - } - - public CDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - private void setDisassemblyStorage( DisassemblyStorage ds ) - { - fStorage = ds; - } - - protected DisassemblyStorage getDisassemblyStorage() - { - return fStorage; - } - - private DisassemblyStorage getSourceElement( IStackFrameInfo frameInfo ) - { - DisassemblyStorage storage = null; - if ( frameInfo != null ) - { - long address = frameInfo.getAddress(); - if ( address != 0 ) - { - if ( getDisassemblyStorage() != null && getDisassemblyStorage().containsAddress( address ) ) - { - storage = getDisassemblyStorage(); - } - else - { - storage = loadDisassemblyStorage( frameInfo ); - } - } - } - return storage; - } - - private DisassemblyStorage loadDisassemblyStorage( IStackFrameInfo frameInfo ) - { - setDisassemblyStorage( null ); - if ( frameInfo != null && getDebugTarget() != null && getDebugTarget().isSuspended() ) - { - ICDISourceManager sm = getDebugTarget().getCDISession().getSourceManager(); - if ( sm != null ) - { - String fileName = frameInfo.getFile(); - int lineNumber = frameInfo.getFrameLineNumber(); - ICDIInstruction[] instructions = new ICDIInstruction[0]; - long address = frameInfo.getAddress(); - if ( fileName != null && fileName.length() > 0 ) - { - try - { - instructions = sm.getInstructions( fileName, - lineNumber, - CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) ); - } - catch( CDIException e ) - { - } - } - if ( instructions.length == 0 || - // Double check if debugger returns correct address range. - !containsAddress( instructions, address ) ) - { - if ( address >= 0 ) - { - try - { - instructions = getFunctionInstructions( sm.getInstructions( address, address + DISASSEMBLY_BLOCK_SIZE ) ); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - } - } - if ( instructions.length > 0 ) - { - setDisassemblyStorage( new DisassemblyStorage( getDebugTarget(), instructions ) ); - } - } - } - return getDisassemblyStorage(); - } - - private DisassemblyStorage loadDisassemblyStorage( long address ) - { - setDisassemblyStorage( null ); - if ( getDebugTarget() != null && getDebugTarget().isSuspended() ) - { - ICDISourceManager sm = getDebugTarget().getCDISession().getSourceManager(); - if ( sm != null ) - { - ICDIInstruction[] instructions = new ICDIInstruction[0]; - if ( instructions.length == 0 ) - { - if ( address >= 0 ) - { - try - { - instructions = getFunctionInstructions( sm.getInstructions( address, address + DISASSEMBLY_BLOCK_SIZE ) ); - } - catch( CDIException e ) - { - CDebugCorePlugin.log( e ); - } - } - } - if ( instructions.length > 0 ) - { - setDisassemblyStorage( new DisassemblyStorage( getDebugTarget(), instructions ) ); - } - } - } - return getDisassemblyStorage(); - } - - private ICDIInstruction[] getFunctionInstructions( ICDIInstruction[] rawInstructions ) - { - if ( rawInstructions.length > 0 && - rawInstructions[0].getFuntionName() != null && - rawInstructions[0].getFuntionName().length() > 0 ) - { - ArrayList list = new ArrayList( rawInstructions.length ); - list.add( rawInstructions[0] ); - for ( int i = 1; i < rawInstructions.length; ++i ) - { - if ( rawInstructions[0].getFuntionName().equals( rawInstructions[i].getFuntionName() ) ) - { - list.add( rawInstructions[i] ); - } - } - return (ICDIInstruction[])list.toArray( new ICDIInstruction[list.size()] ); - } - return rawInstructions; - } - - private boolean containsAddress( ICDIInstruction[] instructions, long address ) - { - for ( int i = 0; i < instructions.length; ++i ) - { - if ( instructions[i].getAdress() == address ) - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - if ( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS.equals( event.getProperty() ) ) - setDisassemblyStorage( null ); - } - - public void dispose() - { - CDebugCorePlugin.getDefault().getPluginPreferences().removePropertyChangeListener( this ); - } -} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java deleted file mode 100644 index 2906204a3ca..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/SourceUtils.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.core.sourcelookup; - -import java.io.IOException; -import java.io.StringReader; -import java.text.MessageFormat; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xerces.dom.DocumentImpl; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Enter type comment. - * - * @since Oct 22, 2003 - */ -public class SourceUtils -{ - private static final String NAME_COMMON_SOURCE_LOCATIONS = "commonSourceLocations"; - private static final String NAME_SOURCE_LOCATION = "sourceLocation"; - private static final String ATTR_CLASS = "class"; - private static final String ATTR_MEMENTO = "memento"; - - public static String getCommonSourceLocationsMemento( ICSourceLocation[] locations ) - { - Document doc = new DocumentImpl(); - Element node = doc.createElement( NAME_COMMON_SOURCE_LOCATIONS ); - doc.appendChild( node ); - - saveSourceLocations( doc, node, locations ); - try - { - return CDebugUtils.serializeDocument( doc, " " ); - } - catch( IOException e ) - { - CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error saving common source settings.", e ) ); - } - return null; - } - - private static void saveSourceLocations( Document doc, Element node, ICSourceLocation[] locations ) - { - for ( int i = 0; i < locations.length; i++ ) - { - Element child = doc.createElement( NAME_SOURCE_LOCATION ); - child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() ); - try - { - child.setAttribute( ATTR_MEMENTO, locations[i].getMemento() ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( e ); - continue; - } - node.appendChild( child ); - } - } - - public static ICSourceLocation[] getCommonSourceLocationsFromMemento( String memento ) - { - ICSourceLocation[] result = new ICSourceLocation[0]; - if ( !isEmpty( memento ) ) - { - try - { - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - StringReader reader = new StringReader( memento ); - InputSource source = new InputSource( reader ); - Element root = parser.parse( source ).getDocumentElement(); - - if ( root.getNodeName().equalsIgnoreCase( NAME_COMMON_SOURCE_LOCATIONS ) ) - result = initializeSourceLocations( root ); - } - catch( ParserConfigurationException e ) - { - CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); - } - catch( SAXException e ) - { - CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); - } - catch( IOException e ) - { - CDebugCorePlugin.log( new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), 0, "Error initializing common source settings.", e ) ); - } - } - return result; - } - - public static ICSourceLocation[] initializeSourceLocations( Element root ) - { - List sourceLocations = new LinkedList(); - ClassLoader classLoader = CDebugCorePlugin.getDefault() .getDescriptor().getPluginClassLoader(); - - NodeList list = root.getChildNodes(); - int length = list.getLength(); - for ( int i = 0; i < length; ++i ) - { - Node node = list.item( i ); - short type = node.getNodeType(); - if ( type == Node.ELEMENT_NODE ) - { - Element entry = (Element)node; - if ( entry.getNodeName().equalsIgnoreCase( NAME_SOURCE_LOCATION ) ) - { - String className = entry.getAttribute( ATTR_CLASS ); - String data = entry.getAttribute( ATTR_MEMENTO ); - if ( className == null || className.trim().length() == 0 ) - { - CDebugCorePlugin.log( "Unable to restore common source locations - invalid format." ); - continue; - } - Class clazz = null; - try - { - clazz = classLoader.loadClass( className ); - } - catch( ClassNotFoundException e ) - { - CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); - continue; - } - - ICSourceLocation location = null; - try - { - location = (ICSourceLocation)clazz.newInstance(); - } - catch( IllegalAccessException e ) - { - CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); - continue; - } - catch( InstantiationException e ) - { - CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); - continue; - } - try - { - location.initializeFrom( data ); - sourceLocations.add( location ); - } - catch( CoreException e ) - { - CDebugCorePlugin.log( "Unable to restore source location: " + e.getMessage() ); - } - } - } - } - return (ICSourceLocation[])sourceLocations.toArray( new ICSourceLocation[sourceLocations.size()] ); - } - - private static boolean isEmpty( String string ) - { - return ( string == null || string.trim().length() == 0 ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/.classpath b/debug/org.eclipse.cdt.debug.mi.core/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.mi.core/.cvsignore b/debug/org.eclipse.cdt.debug.mi.core/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/debug/org.eclipse.cdt.debug.mi.core/.options b/debug/org.eclipse.cdt.debug.mi.core/.options deleted file mode 100644 index 76c7d9926fc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/.options +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.cdt.debug.mi.core/debug=true \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.core/.project b/debug/org.eclipse.cdt.debug.mi.core/.project deleted file mode 100644 index 016309439c3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/.project +++ /dev/null @@ -1,30 +0,0 @@ - - - org.eclipse.cdt.debug.mi.core - - - org.eclipse.cdt.core - org.eclipse.cdt.debug.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog deleted file mode 100644 index 60b45209194..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ /dev/null @@ -1,2151 +0,0 @@ -2003-12-22 Mikhail Khodjaiants - Fix for bug 49282 terminate the gdb session if the termination of the inferior fails. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java - -2003-12-22 Mikhail Khodjaiants - Fix for Bug 49278 do not retry the "info threads" command if the first attempt fails. - Throw an exception from the "getCThreads" method when it fails. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java - -2003-12-18 Alain Magloire - - PR 49148 - Set environment variable value to give the program. - Arguments are VAR VALUE where VAR is variable name and VALUE is value. - VALUES of environment variables are uninterpreted strings. - This does not affect the program until the next "run" command. - - So pass the string raw. - - * src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java - * src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java - * src/org/eclipse/cdt/debug/mi/core/CommandFactory.java - -2003-12-17 Mikhail Khodjaiants - - Fix for bug 49061: Different values are used as default for the "Load shared library symbols automatically" option. - - * src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java - * src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java - * src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java - -2003-12-16 Mikhail Khodjaiants - - Show the gdb arguments when tracing. - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java - -2003-12-16 Mikhail Khodjaiants - - Fix for PR 48870: Terminate gdb if attach to process fails. - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java - -2003-12-09 Alain Magloire - - Do not try to interrupt if the target was suspended. - - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java - -2003-12-08 Alain Magloire - - Target.terminate() did not pass the exception up. - Added new method MIInferior.terminate(). - - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java - -2003-12-02 Alain Magloire - - Retry the stack-info-depth when it fails the first time - and decrement the count. GDB can cope up the second try - and probably mark the thread invalid. - Patch base on Ashish Karkare patch: - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java - -2003-11-26 Mikhail Khodjaiants - Cleanup. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java - * src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java - -2003-11-26 Mikhail Khodjaiants - Cleanup. - - * src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java - * src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java - * src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumedEvent.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java - * src/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java - * src/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java - * src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java - * src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java - * src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java - * src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java - * src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java - * src/org/eclipse/cdt/debug/mi/core/output/MIList.java - -2003-11-25 Alain Magloire - - Process the suspend event even if there is not threads - or stack associated with the target. - - * src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java - -2003-11-22 Alain Magloire - - In MISession constructor if the initialization fails shutdown - the Tx/RX/Event threads. - In MIPlugin if the initialization fails shutdown the pty console. - Ditto for GDBDebugger/GDBServerDebugger/CygwinGDBDebugger. - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java - * src/org/eclipse/cdt/debug/mi/core/MISession.java - * src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java - * src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java - -2003-11-21 Alain Magloire - - The wrong MIPlugin.createCSession() method was used. - Problem noted by Ashish. - - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java - -2003-11-21 Mikhail Khodjaiants - - * src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java - Fix for PR 46592: Debug View shows Functions as func(type param,...)(). - Return an empty string instead of "??" if the function name is not available. - -2003-11-20 Alain Magloire - - Fix NPE: 46313. Setting breakpoint when the target was running - was throwing NPE. - - * src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java - * src/org/eclipse/cdt/debug/mi/core/cdit/EventManager.java - -2003-11-19 Mikhail Khodjaiants - - Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process. - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java: removed the 'getAdjustedTimeout' method. - -2003-11-19 Mikhail Khodjaiants - - Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process. - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java: initialization of preferences by default values. - * src/org/eclipse/cdt/debug/mi/core/MISession.java: removed the duplicate constant for the default - launch timeout value. - -2003-11-13 Mikhail Khodjaiants - - * src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java - Fix for PR 46592: Debug View shows Functions as func(type param,...)(). - In some situations gdb returns the function names that include parameter types. - To make the presentation consistent truncate the parameters. - -2003-11-06 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java: - Small fix for the defferred breakpoint support. - -2003-11-06 Alain Magloire - - Patch from Ashish Karkare: - A CDT 1.2 patch that enables setting of - serial line speed in the launch configuration when debugging remote targets. - - * src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java - New attribute definition DEV_SPEED. - - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java - Extracts serial speed value and passes it to createCSession(). - - -2003-10-29 Alain Magloire - - Deal with PR 45533 - - Make a preferenc for Timeout and use it when launching - the ICDebugger session, when way wait for for gdb - to say "ready" by returning the prompt. - - * src/org/eclipse/cdt/debug/mi/core/MISession.java - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java - * src/org/eclipse/cdt/debug/mi/core/IMIConstants.java - -2003-10-17 Alain Magloire - - Put the framework to deal with deferred breakpoint. - - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumeEvent.java - Deal with MIRunningEvent.RETURN. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java - Check if MIBreakpoint is null first. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Watchpoint.java - Check if MIWathchpoint is null first. - * src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java - Implement Deferred Breakpoint - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java - Implement Deferred Breakpoint - * src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java - Enable deferredBreakpoint. - * src/org/eclipse/cdt/debug/mi/core/CygwinDebugger.java - Enable deferredBreakpoint. - - -2003-10-07 Mikhail Khodjaiants - - All methods of 'IRuntimeOptions' should throw CDI exceptions in case of failure. - * src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java - -2003-09-30 Alain Magloire - - ICDIVariableObject.equals(); - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java - -2003-09-29 Mikhail Khodjaiants - Added the initialization of the shared libraries' attributes to CygwinGDBDebugger. - - * src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java - -2003-09-26 Alain Magloire - - Second part of PR 43496. - On the startup of GDB, we have to wait for "(gdb)" prompt - to make sure that gdb is ready to accept command. - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java - -2003-09-25 Alain Magloire - - Fix for PR 43496. - In the event of an error we should Process.destroy() - after creating the Process. - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java - -2003-09-11 Mikhail Khodjaiants - Moving the shared library search paths block to mi UI. - * IMILaunchConfigurationConstants.java: added the 'ATTR_DEBUGGER_SOLIB_PATH' attribute. - -2003-09-11 Alain Magloire - - Fix to info shared parsing. - - * src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibary.java - -2003-09-09 Mikhail Khodjaiants - Regrouping the launch configuration constants. - * IMILaunchConfigurationConstants.java - -2003-09-09 Mikhail Khodjaiants - Added the 'stop-on-solib-events' option. - Changed the initialization of the shared library search path. - Changed the messages of the thrown exceptions. - * GDBDebugger.java - -2003-09-09 Mikhail Khodjaiants - - CoreFileConfiguration supports shared libraries. - - * src/org/eclipse/cdt/debug/mi/core/cdi/CoreFileConfiguration.java - -2003-08-30 Alain Magloire - - Unnecessary synchronization making deadlocks. Should revisit this code. - - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java - -2003-08-29 Mikhail Khodjaiants - - Added new command - 'set stop-on-solib-events'. - - * src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java - * src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java - - Implementation of the new methods added to the 'ICDISharedLibraryManager' interface. - - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java - -2003-08-26 Alain Magloire - - This is still a hack: "info shared" the real solution - is to implement in GDB/MI the corresponding command. - So now we do weird parsing, that varies from platform - to platform. For example Cygwin output of "info shared" - is totally different from the GNU/Linux one etc ... - We the best we can to cope ... but things will break. - - * src/org/eclipse.cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java - -2003-08-26 Alain Magloire - - Using the wrong method for toString() and we were returning - a overly verbose string. - - * src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java - -2003-08-25 Alain Magloire - - Small fix, get the datatype for the GDBTypeParser. - - * src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java - -2003-08-22 Alain Magloire - - For casting array we use the "@" format, hide it in - the name. But show it the qualifiedName() since the - expression is use to evaluate. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java - -2003-08-21 Alain Magloire - - GDB varobj for the arrays children name only returns - the index. We need to construct the entire name: - char buffer[2] - GDB return "0", "1" for the children names. - We will return - "buffer[0]", "buffer[1]" - - * src/org/eclipse/cdt/debug/mi/core/cdi/Variable.java - -2003-08-20 Alain Magloire - - GDB/MI altough define an interface that all commands should - follow .. they do not. For example, we should be able - to separate options from agument with a "--" string not - all commands. The latest is -break-condition. - So we override the MICommand.toString() to do specific - parsing for specific commands. - - * src/org/eclipse/cdt/debug/mi/core/command/MICommand.java - break the toString() method. - * src/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java - -2003-08-19 Alain Magloire - - Fix to the GDBTypeParser to deal with gdb - awkwardness - * src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java - -2003-08-19 Alain Magloire - - GDB, uses false category for C++ class/struct. - Fix to return the correct name. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java - -2003-08-18 Alain Magloire - - Patch from Chris Songer, excerpt from the email. - Using the phrase "To ensure consistency between a register name and its - number, the output list may include empty register names," the MI protocol - appears to allow gdb to return a "sparse" array of registers by giving a 0 - length name in response to the -data-list-register-names-command. CDT 1.0.1 - does not handle this especially well and subsequently exposes a bug in GDB - 5.1.3 and crashes it if the debugger has more than 3 register names of 0 - length. - - example: - - 8-data-list-register-names - (gdb) - 8^done,register-names=["ar0","ar1",... ,"","","","","","","ur0",\ - "ur1","ur2","ur3","ur4","ur5","ur6","ur7","","" ..] - - - * src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java: - New method getNumRealNames(). - * src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java: - Check if the register name is not empty. - -2003-08-18 Alain Magloire - - From the manual: - By default GDB will automatically keep track of objects as they are - loaded and unloaded by the dynamic linker. By using the command `set - stop-on-solib-events 1' you can arrange for GDB to stop the inferior - when shared library events occur, thus allowing you to set breakpoints - in shared libraries which are explicitly loaded by the inferior. - - * src/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java: - New file, StoppedEvent du to shared lib events. - * src/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java: - Catch MISharedLibEvent. - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryevent.java: - New file implements ICDISharedLibaryEvent. - * src/org/eclipse/cdt/debug/mi/core/RxThread.java: - Hack to catch suspend/stop on shared library. - -2003-08-11 Mikhail Khodjaiants - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java: - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - Removed the 'type' parameter from the 'getVariableObjectAsArray' method. - -2003-08-11 Mikhail Khodjaiants - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java: - The 'type' argument of the 'getVariableObjectAsArray' method shouldn't be null. - -2003-08-11 Mikhail Khodjaiants - * src/org/eclipse/cdt/debug/mi/core/cdi/variableManager.java - Mistype in the 'CheckType' method. - -2003-08-07 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/variableManager.java - getVariableObjectAsArray() ignore the type argument it does - not work with gdb. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java - Added hasChildren() method. - -2003-08-07 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - Update the interface to reflect ICDIVariableManager. - -2003-08-06 Mikhail Khodjaiants - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java: - Removed the unused local variable 'children' from the 'getVariables' method. - -2003-08-07 Alain Magloire - - PR 38964. - - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java: - The method interrupted was synchronized and so was the - setSuspended(). Now do a notify when the status change. - Throw an exception if the interrupt() failed. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java: - Do not check for running. - -2003-08-06 Alain Magloire - - Dealing with casting: Casting a field of a structure did not - work properly for example: - struct foo { int bar; } foobar; - To cast the field bar, we need to construct the full qualified - name "foobar.bar". - Unfortunately for C++ things are hectic in the GDB/MI world - the childre of structure are not the fields. So we try to - deal with it too. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java: - New constructor, new method getLanguage() to deal with - different type of languages ex: C vs C++. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java: - Clean up and added a bunch of set/getXXX() methods instead of - accessing directly the fields. - * src/og/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - Clean the methods use for casting and format the indentation. - * src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java: - Added parsing method. - -2003-08-06 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java: - Implement isEditable method. - -2003-08-06 Mikhail Khodjaiants - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java: - Fix for 'isEditable'. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java: - Use correct expression in 'sizeof'. - -2003-08-06 Alain Magloire - - First framework to deal with breaking the arrays in ranges. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java: - Remove unused getArgumentObject(). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java: - Remove unuse getRegisterObject(). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java: - Move methods to VariableObject to comply with the interface. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java: - Implement new methods of ICDIVariableObject.java - Save the castin information. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java: - New method getVariables(int, int). - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - New method encodeVariable(), to get the encode specific string - for gdb casting of arrays. - -2003-07-28 Mikhail Khodjaiants - - Minimize the number of the "evaluate expression" requests when changing the value of the floating point types. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java - -2003-07-17 Alain Magloire - - Catch the use of cli command "detach" and fire the appropriate events. - - * src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java - -2003-07-16 Alain Magloire - - Provide FunctionValue, PointerValue and ArrayValue. - For ArrayValue apply the patch from Chris Songer, excerpt from - his email: - Given GDB performance, we saw CDT start to time out on large array - requests. The following patch corrects this by scaling the time out with - the number of children being retrieved. I have not looked at the head on - this so your mileage may vary. On 1.0.1 with this and the MIParser change - you can open 16k arrays. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValueValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java - -2003-07-10 Alain Magloire - - In the case of not having a PTY to unmixed inferior output from gdb commands - do the only sane thing and when a response comes in that is not a valid - MI format consider it as inferior output. - - * src/org/eclipse/cdt/debug/mi/core/output/MIParser.java: - Put non valid lines in the TargetStream. - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java: - Pass output straight to the target. - * src/org/eclipse/cdt/debug/mi/core/TxThread.java: - Remove unused code. - * src/org/eclipse/cdt/debug/mi/core/command/Command.java: - Try to remove duplicate errors when throwing the MIException. - -2003-07-08 Alain Magloire - - Unfortunately GDB/MI does not make the errors available via the advertise - way explain in the documentation, for example: - 27-var-create - * this->aaa - &"There is no member or method named aaa.\n" - &"Type Hello has no component named aaa.\n" - 27^error,msg="." - - According to the doc, the error should be available in the msg field: - 27^error,msg="There is no member or method named aaaa" - - Since this will not be fix in GDB/MI anytime soon, we cope with it by - grabing the logstream error and make it available in - - CDIException.getDetailedMesssage(). - - * src/org/eclipse/cdt/debug/mi/core/command/*.java: All the commands - changed to grab also the logstream messages if any for the exception. - -2003-06-25 Alain Magloire - - Patch from Chris Songer, excerpt from its email: - The MIParser is O(N^2) time in the length of a line returned from GDB. - While not an issue for OOB messages, this can be quite an issue for array - retrieval from the target and other potentially long messages. It's N^2 - because it relies on StringBuffer.deleteCharAt( 0 ) and - StringBuffer.delete( 0, X ). These operations appear to do a copy of the - remaining data in the Sun Java library rather than bumping some index. - - The following diffs are code that we are using on 1.0.1 to correct this - issue. It's relatively new, so there may be some bugs but has certainly - performed just fine in our initial regressions. Because of that I'm not - sending it in as a patch, more an FYI really. The basic change is exactly - what you'd expect: these diffs make MIParser use a new type of string - buffer that's quite efficient at deleting from the head of the array. - - * src/org/eclipse/cdt/debug/mi/core/output/MIParser.java - -2003-06-18 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java: - Check if the variable was a register. - * src/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java: - Cleanup. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java: - Removing of method {get,set}Value() and new method getChildren(). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java - (setValue): calls update on the appropriate manager. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterValue.java: - Remove file, unused. - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - (getVariableObjectAsType): check for register. - (getVariableObjectAsArray): check for register. - * src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java: - (getRegister): reimplemented. - -2003-06-18 Mikhail Khodjaiants - Removed unused local variable. - * src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java - -2003-06-17 Alain Magloire - - PR 38934 - * src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java (update): - We have to call "-var-update" to update the register values in gdb. - -2003-06-05 Mikhail Khodjaiants - gdb/mi support of infinite values of the floating point types. - * DoubleValue.java - * FloatingPointValue.java - * FloatValue.java - -2003-06-05 Mikhail Khodjaiants - Removed the redundant methods from the 'ICDIFloatingPointValue' interface. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java - -2003-06-04 Mikhail Khodjaiants - Correction in the parsing of reference value. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java - -2003-06-04 Mikhail Khodjaiants - Added some missing types and methods for the type parsing. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatValue.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java: new - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java: new - -2003-06-03 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java: - Bug fix gdb returns fix like "char [200]" no variables. - -2003-06-03 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java - (getType): save the head of the type for the return value. - -2003-06-02 Alain Magloire - - Enable the new type parsing with the class GDBTypeParser. - This class takes the output of GDB/MI - (gdb) whatis - or - (gdb) ptype - And parse it. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedType.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerType.java - * src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionType.java - * src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java - * src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java - -2003-05-25 Alain Magloire - - Do extra parsing. - * src/org/eclipse/cdt/debug/mi/core/model/type/ArrayType.java - * src/org/eclipse/cdt/debug/mi/core/model/type/DerivedType.java - * src/org/eclipse/cdt/debug/mi/core/model/type/PointerType.java - * src/org/eclipse/cdt/debug/mi/core/model/type/FunctionType.java - * src/org/eclipse/cdt/debug/mi/core/model/Variable.java - -2003-05-24 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java - When execption reset the variable to null and rethrow the exception. - -2003-05-24 Alain Magloire - - Continuing the implementation of types. - ICDIType is ICDIObject. - * src/org/eclispe/cdt/mi/core/cdi/model/type/Type.java: - Extends CObject - -2003-05-23 Alain Magloire - - Draft implementation of org.eclipse.cdt.debug.core.cdi.model.type/* - -2003-05-06 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java (suspend): - Suspend the program before selecting the thread. - -2003-05-01 Mikhail Khodjaiants - Implementations of the new "terminateSessionOnExit" method of ICDIConfiguration. - * Configuration.java - * CoreFileConfiguration.java - -2003-04-30 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java: - Call MIInferior.update() if attaching session. - -2003-04-30 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java (supportsTerminate): - Returns true. - -2003-04-25 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/EventManager.java (update): - Remove the call to MIInferior.update(), wrong place. - * src/org/eclipse/cdt/debug/mi/core/EventThread.java (run): - Call MIInferior.update() when suspended. - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java (update): - Do not do the call to "info program" for type "attached" sessions. - * src/org/eclipse/cdt/debug/mi/core/MISession.java (terminate): - When terminate() is call disable posting commands to the queue etc... - -2003-04-25 Mikhail Khodjaiants - - Fix for bug 36909. - * MIFrame.java: - gdb returns "??" as a function name if symbols are not available. - Set the function name in this case to ""; - -2003-04-24 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java (createMIInfoProgram): - New method. - * src/org/eclipse/cdt/debug/mi/core/command/MIInfoProgram.java: - New file, "info program". - * src/org/eclipse/cdt/debug/mi/core/output/MIInfoProgramInfo.java: - New file, parsing of "info Program". - * src/org/eclipse/cdt/debug/mi/core/output/EventManager.java (processSuspend): - Call MIInferio.update(); - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java (update): - New method to retrieve the pid. - (interrupt): Try doing Spawner.raise(pid, INT) as a fallback. - * src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java (supportSuspend): - Bug fix. - -2003-04-23 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java (update): - Move the creation of the list after the call to "info signals". - The call may fail. - -2003-04-21 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/Target.java (suspend): - Remove the delay of 10 secs. - * src/org/eclipse/cdt/debug/mi/core/MIInferior.java (interrupt): - Do a delay of 10 secs to allow time for the inferior to stop. - * src/org/eclipse/cdt/debug/mi/core/MISession.java (terminate) : - Clear the EventQueue, if we restart. - * src/org/eclipse/cdt/debug/mi/core/Queue (isEmpty): - New method. - -2003-04-21 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java: - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java: - Ignore exception when doing "set auto-solib-path on". - -2003-04-17 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java: - setCurrentThread(), calls VariableManager.update(); - * src/org/eclipse/cdt/debug/micore/cdt/model/Thread.java: - setCurrentStackFrame() calls VariableManager.update(); - -2003-04-07 Mikhail Khodjaiants - Changed the messages of CDI exceptions. - * MISession.java - * Target.java - -2003-04-04 Alain Magloire - - Code from Monta Vista to add a Session via GDBServer. - - * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java: - * src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java: - * src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java: - * plugin.xml - -2003-04-04 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdt/VariableManager.java: - Check for null in update(). - -2003-04-03 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdt/VariableManager.java: - update(), put a limit on the number of stack we check for variables. - -2003-04-03 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdt/model/Target.java: - * src/org/eclipse/cdt/debug/mi/core/cdt/model/Thread.java: - Before updating the register check if the manager is on autoupdate. - -2003-04-02 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdt/model/Target.java: - suspend() sync for at least < 10 seconds to allow the gdb to - suspend via SIGINT the program. - -2003-03-28 Mikhail Khodjaiants - Added time stamp to the trace messages. - * MIPlugin.java - -2003-03-28 Mikhail Khodjaiants - Correction of the previous patch. - * MIAsm.java - -2003-03-27 Mikhail Khodjaiants - Applied patch from Chris Songer: Assembly View Fixups - * Instruction.java - * MIAsm.java - -2003-03-19 Alain Magloire - - Some applications, like recursive code, have a very deep stackframes - bigger > 50. This can turn out to be a problem, as the VariableManager - will try to update all the variables and there can be a lot of local - variable in all those stackframes. We can not use: - "-var-update *" - either since on gdb-5.2.1, for reasons unknown to me this will make - gdb unstable/crash. So the approach is to only update variables - in the current stackframe. - The advantage we only update a small set of variables. - The downside if we have side effects i.e. pointers pass to - argument and modifying the pointer affect the callees memory. - But this is a small price to pay and usually C/C++ programmer - are interrested to see changes of variables in the current stack - not changes 20 stack before. - - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - Method update() only check the variable in the scope of the - current stackframe(the highest stack). This will include - any globals. - -2003-03-19 Alain Magloire - - Base on PR/patch from Chris Songer. - Assigning a value to a register may have side-effects - on other registers. When assigning, the action is now - to upate again the values. The same for the variables. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java: - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java: - Method setValue() calls manager.update() after the assignment. - -2003-03-17 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java: - getArguments() and getLocalVariable() are caching the results. - -2003-03-16 Alain Magloire - - GDB/MI does not keep the stack level, from what we expect. In gdb, the - highest stack is level 0 and lower stack as the highest level: - -stack-list-frames - ^done,stack=[frame={level="0 ",addr="0x0804845b",func="main",file="hello.c",line="24"}, - frame={level="1 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - -stack-list-frames - ^done,stack=[frame={level="0 ",addr="0x08048556",func="main2",file="hello.c",line="58"}, - frame={level="1 ",addr="0x08048501",func="main",file="hello.c",line="41"}, - frame={level="2 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - This is of no use to us since the level is always "0". The level is necessary for example when - doing recursive calls to make a distinction between frames. - So in CDT this reverse the hidghest frame will have the highest number. In CDT: - stack=[frame={level="2 ",addr="0x0804845b",func="main",file="hello.c",line="24"}, - frame={level="1 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - stack=[frame={level="3 ",addr="0x08048556",func="main2",file="hello.c",line="58"}, - frame={level="2 ",addr="0x08048501",func="main",file="hello.c",line="41"}, - frame={level="1 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java: - Takes a new Argument in the constructor, the level. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Threawd.java: - Create the StackFrame with the constructor. - * src/org/eclipse/cdt/debug/mi/core/cdi/Location.java: - Fix equals(). - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - Use the right level when setting the frame. - -2003-03-14 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java: - New method getArgumentObject(). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java: - New method getRegisterObject(). - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - Checks for ICDIVariable and ICDIArgument since they are now ICDIVariableObject too. - * src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java: - Checks for ICDIRegister when creating since they are now ICDIRegisterObject too. - -2003-03-13 Alain Magloire - - Small bug fix - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java - -2003-03-13 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - New method getLocalVariableObjects() implemented returns all the local. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java - getLocalVariables() use getLocalVariableObjects(). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java: - getName() does not longer throw an Exception. - -2003-03-11 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - New methods getVariableObjectAsArray() getVariableObjectAsType(). - -2003-03-03 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/CommandQueue.java (print): Comment out. - * src/org/eclipse/cdt/debug/mi/core/Queue.java (print): Comment out. - -2003-02-12 Mikhail Khodjaiants - The 'setAutoSolib' method is no longer in ICDISharedLibraryManager. - * GDBDebugger.java - -2003-02-12 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java: - Removed getRegisterObjects(), getRegisters(), getSharedLibraries(). - Those actions are done via the managers. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java (getChild): - Check the grand children also. - -2003-02-12 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java (isAutoLoadSymbols): - New method. - * src/org/eclipse/cdt/deb/mi/core/command/MIGDBShow.java (getMIGDBShowInfo): - New method. - -2003-02-12 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java (ChangedEvent): - Returns a Variable. - * src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java (DestroyedEvent): - Check if it was an expression also. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java (getVariables): - Calls the parent's implementation. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java (getVariables): - New implementation. - * src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java (update): - Deal with new MIVarDeleteEvent. - * src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java (addExpression): - Removed. - (removeExpression): New method. - * src/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java (getScope): - removed. - * src/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java: - New file. - -2003-02-09 Alain Magloire - - in GDB/MI 5.3 and below, the -data-list-register-xxx can bring gdb down with - an assert(). The problem is that code like this - ui_out_list_begin(); - for () { - if(error) - return ERROR; - } - ui_out_list_end(); - The ui_out_list_end() is never call. - However gdb offers the varobj to deal cleanly with register but calling - "-var-update *" seems to make gdb misbehave and hang after a while. - So we use a mixed of -data-list-register-xxx calls and var-object to deal - with registers and do not call "-var-update *" but rather call it for - each time for individual objects to see the updates. - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java: - Reimplemented to use the var obj. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterValue.java: - New file implement ICDIValue. - * src/org/eclipse/cdt/debug/mi/core/cdi/EventManagero.java (processSuspendedEvent): - Call each manager.update(). - * src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java (update): - Reimplemented. - * src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java (update): - Reimplemented - * src/org/eclipse/cdt/debug/mi/core/cdi/UpdateManager.java: - Removed. - * src/org/eclipse/cdt/debug/mi/core/cdi/IUpdateListener.java: - Removed. - * src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java: - Catch the cli "run" command. - -2003-02-06 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java (getVariableArrayObject): - New Method to type cast in an array. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java (VariableObject): - New constructor. - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalManger.java(getSignal): - Return an signal object even when the session is terminated. - -2003-02-05 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/command/MISignal.java: - * src/org/eclipse/cdt/debug/mi/core/command/MIJump.java: - Return a fake ^running, since the MI semantic is not respected. - -2003-02-04 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/CLICommand.java: - Catch cli command "jump" - -2003-02-04 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java: - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java: - New implementation for signal(), jump, and stepReturn(boolean). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java: - (signal): Calls Target.signal(). - * src/org/eclipse/cdt/debug/mi/core/cdi/model/SignalManager.java: - (signal): Method removed. - * src/org/eclipse/cdt/debug/mi/core/command/MIJump.java: - New file. - * src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java: - New method creteMIJump(). - -2003-02-04 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalManger.java: - Implement signal() method. - * src/org/eclipse/cdt/debug/mi/core/command/MISignal.java: - New file. - * src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java: - (createMISignal): new method. - -2003-02-04 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java: - Catch MIInferiorSignalExitEvent. - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java: - Catch MIInferiorSignalExitEvent. - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalExitInfo.java: - New File. - * src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java: - New File - * src/org/eclipse/cdt/debug/mi/core/event/CLIProcessir.java: - "signal" command is like continue. - * src/org/eclipse/cdt/debug/mi/core/event/RxThread.java: - Catch MIInferiorSignalExitEvent. - -2003-02-04 Alain Magloire - - Refactor MISignal in MISigHandle to not confus with - CLI command "signal SIGNAL". - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java: - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java: - * src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java: - * src/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java: - -2003-02-03 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java: - (loadSymbols): set the read flag to true. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java: - (getMIShared): New method. - * src/org/eclipse/cdt/debug/mi/core/output/MIShared.java: - (setSymbolsRead): New method. - -2003-02-01 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java: - Support for ICDISignal event. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java (handle): - Implemented. - * src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java (update): - Support for ICDISignal event. - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java (handle): - New method. - * src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java (createMIHandle): - New method - * src/org/eclipse/cdt/debug/mi/core/command/MIHandle.java: - New File. - * src/org/eclipse/cdt/debug/mi/core/CLICommand.java: - Check for "handle" and "signal" cli command. - -2003-01-31 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java: - Use deleteSharedLibrary from the manager. - * src/org/eclipse/cdt/debug/mi/core/cdi/signal/Signal.java: - Construct a signal base on the MISignal response. - * src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java - (suspendedInferior): Take ICDITarget as argument. - (resumeInferior): Take ICDITarget as argument. - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java - (containsSharedLibrary): removed. - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java - (update): implemented. - (getSignals): implemented. - * src/org/eclipse/cdt/debug/mi/core/cdi/SignalReceived.java: - Ask the manager for the signal. - * src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java: - New file. - -2003-01-29 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java (getSharedLibraryPaths): - New method. - (setSharedLibraryPaths): New method. - (setAutoLoadSymbols): New methos set autosolib. - * src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java (setAutoSolib): - Move to SharedLibraryManager.java - -2003-01-28 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/command/MIInfoSignals.java: - * src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java: - * src/org/eclipse/cdt/debug/mi/core/output/MISignal.java: - New files. - -2003-01-28 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java: - Use ICDIStackFrame in the constructor. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java: - Use ICDIStackFrame in the constructor. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java: - Use ICDIStackFrame in the constructor. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java (getVariables): - No need to cast to StackFrame. - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java (setCurrentFrame): - Implement new method, takes a boolean as the second method. - * src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java: - No need to cast to StackFrame. - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java: - No need to cast to StackFrame. - -2003-01-28 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java (getCondition): - Condition was initialize with the wrong parameter. - (setMIBreakpoint): reset location and condition. - -2003-01-28 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java (setMIBreakpoint): - New method. - * src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java (update): - Reset the new MIBreakpoint on the Breakpoint object. - (containsBreakpoint): Removed. - (hasBreakpointChanged): Change arguments. - * src/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java (parser): - Better check for watchpoints. - * src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java (isChangeBreakpoint): - Check for "ignore" and "condition" cli commands. - -2003-01-27 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java (getTypeName): - Use MIWhatis to get the type of the register. - (getVariables): Cache the answer. - * src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java (loadSymbols): - Use MISharedLibrary. - * src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java (createMIWhatis): - New method. - (MIPType): New method. - * src/org/eclipse/cdt/debug/mi/core/command/MISharedLibrary.java: - New file. - - -2003-01-27 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java (getCThreads): - When attaching gdb(at least on some platform) does not show - the selected thread(info threads). Fallback on the first one. - -2003-01-27 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java (findVariable): - Bug fix, did not compare the stacks correctly. - -2003-01-27 Alain Magloire - - * src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java: - * src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java: - * src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java: - Move to model package. - -2003-01-26 Alain Magloire - - Major refactor of the code. Rewrote/Added Managers: - VariableManager - ExpressionManager - RegisterManager - UpdateManager. - - Refactor of CSession to Session, CTarget to Target - and CThread to Thread. - * src/.../mi/core/cdi/event/ChangedEvent.java: - * src/.../mi/core/cdi/event/CreatedEvent.java: - * src/.../mi/core/cdi/event/DestroyedEvent.java: - * src/.../mi/core/cdi/event/DisconnectedEvent.java: - * src/.../mi/core/cdi/event/ExitedEvent.java: - * src/.../mi/core/cdi/event/MemoryChangedEvent.java: - * src/.../mi/core/cdi/event/ResumedEvent.java: - * src/.../mi/core/cdi/event/SuspendedEvent.java: - - - * src/.../mi/core/cdi/model/Argument.java: - * src/.../mi/core/cdi/model/Breakpoint.java: - * src/.../mi/core/cdi/model/Thread.java: - * src/.../mi/core/cdi/model/Target.java: - * src/.../mi/core/cdi/model/MemoryBlock.java: - * src/.../mi/core/cdi/model/MixedInstruction.java: - * src/.../mi/core/cdi/model/Instruction.java: - * src/.../mi/core/cdi/model/Signal.java: - * src/.../mi/core/cdi/model/SharedLibrary.java: - * src/.../mi/core/cdi/model/CObject.java: - * src/.../mi/core/cdi/model/Expression.java: - * src/.../mi/core/cdi/model/Variable.java: - * src/.../mi/core/cdi/model/Value.java: - * src/.../mi/core/cdi/model/Register.java: - * src/.../mi/core/cdi/model/StackFrame.java: - - * src/.../mi/core/cdi/ArgumentObject.java: - * src/.../mi/core/cdi/VariableObject.java: - * src/.../mi/core/cdi/RegisterObject.java: - * src/.../mi/core/cdi/BreakpointHit.java: - * src/.../mi/core/cdi/BreakpointManager.java: - * src/.../mi/core/cdi/VariableManager.java: - * src/.../mi/core/cdi/ExpressionManager.java: - * src/.../mi/core/cdi/RegisterManaget.java: - * src/.../mi/core/cdi/SignalManager.java: - * src/.../mi/core/cdi/SharedLibraryManager.java: - * src/.../mi/core/cdi/EventManager.java: - * src/.../mi/core/cdi/MemoryManager.java: - * src/.../mi/core/cdi/ErrorInfo.java: - * src/.../mi/core/cdi/Session.java: - * src/.../mi/core/cdi/ExitInfo.java: - * src/.../mi/core/cdi/UpdateManager.java: - * src/.../mi/core/cdi/IUpdateListener.java: - * src/.../mi/core/cdi/SessionObject.java: - * src/.../mi/core/cdi/SignalReceived.java: - * src/.../mi/core/cdi/SourceManager.java: - * src/.../mi/core/cdi/RuntimeOptions.java: - * src/.../mi/core/cdi/WatchpointScope.java: - * src/.../mi/core/cdi/WatchpointTrigger.java: - * src/.../mi/core/cdi/EndSteppingRange.java: - - * src/.../mi/core/MIPlugin.java: - * src/.../mi/core/CygwinGDBDebugger.java: - * src/.../mi/core/GDBDebugger.java: - - - -2003-01-24 Alain Magloire - - * src/.../mi/core/CLIProcessor.java (isEnableBreakpoint): - Check for "enable", "disable" cli commands. - -2003-01-23 Alain Magloire - - * src/.../mi/core/CLIProcessor.java (isDeletingBreakpoint): - Check for "d" it means delete breakpoints. - -2003-01-20 Alain Magloire - - * src/.../mi/core/cdi/Configuration.java (supporstSharedLibrary): - New method. - * src/.../mi/core/cdi/CoreFileConfiguration.java (supporstSharedLibrary): - New method. - * src/.../mi/core/cdi/SharedLibraryManager.java (update): - Checks if support for shared Libary before doin an update. - -2003-01-20 Alain Magloire - - * src/.../mi/core/cdi/SuspendedEvent.java: Use SignalReceived. - * src/.../mi/core/cdi/model/Signal.java: New file. - * src/.../mi/core/cdi/model/SignalManager.java: Use model/Signal. - * src/.../mi/core/cdi/SignalReceived.java: New file. - -2003-01-20 Alain Magloire - - The problem was that no check was done for the existence of - the program/executable nor the working directory etc ... - By asking the arguements to be File, the check is done by - the caller. - - * src/.../mi/core/MIPlugin.java (createCSession): Change the - the arguments. - * src/.../mi/core/GDBDebugger.java (createCSession): Change the - -2003-01-20 Alain Magloire - - * src/.../mi/core/command/MIWhatis.java: New file. - * src/.../mi/core/command/MIPType.java: New file. - * src/.../mi/core/command/MISharedLibary.java: New file. - * src/.../mi/core/output/MIWhatisInfo.java: New file. - * src/.../mi/core/output/MIPTypeInfo.java: New file. - -2003-01-18 Alain Magloire - - * src/.../mi/core/cdi/event/DestroyedEvent.java (DestroyedEvent): - Remove the deleted shared library from the list. - * src/.../mi/core/cdi/SharedLibraryManager.java (getUnloadedLibrary): - Get a shared library slated for unload. - (removeFromUnloadedList): Remove the library form the list. - -2003-01-17 Alain Magloire - - * src/.../mi/core/output/MIInfoSharedLibraryInfo.java (parseWinShared): - Break the methods in parserUnixShared() and parseWinShared() to cope - with the different formats. - -2003-01-17 Alain Magloire - - * src/.../mi/core/cdi/SharedLibraryManager.java (loadSymbols): - New method takes and array of ICDISharedLibrary. - * src/.../mi/core/cdi/SharedLibrary.java (loadSymbols): - Call the share manager to load. - -2003-01-17 Alain Magloire - - * src/.../mi/core/cdi/SharedLibraryManager.java (loadSymbols): - Call "shared libraryname". - -2003-01-17 Alain Magloire - - The problem here is that we do not knw the state of - the session, for example "target remote server:port" - was issue, in this case the state is suspended. - We try to guess by posting a "info remote-process" - and set suspended when no error. - - * src/.../mi/core/MIPlugin.java (createCSession): - Try "info remote-process" to guess the state. - Remove the "new-console" call to windows specific files. - * src/.../mi/core/CygwinGDBDebugger.java(createLaunchSession): - call "set new-console" for windows plaforms. - -2003-01-16 Alain Magloire - - * src/.../mi/core/cdi/SharedLibary.java (setMIShared): - New method. - * src/.../mi/core/cdi/SharedLibraryManager.java (update): - When changed reset the MIShared of the SharedLibrary. - -2003-01-16 Alain Magloire - - Process gdbinit configuration file. - - * src/.../mi/core/MIPlugin.java (createCSession): Takes now two new - arguments for working directory and configuration file gdbinit. - * src/.../mi/core/GDBDebugger.java (createAttachSession): - (createCoreSession): pass the working directory and gdbinit file - (createLaunchSession): pass the working directory and gdbinit file - * src/.../mi/core/IMILaunchConfigurationConstants.java: - New constant ATTR_GDB_INIT. - -2003-01-16 Alain Magloire - - * src/.../mi/core/cdi/EventManager.java (processSuspended): - Also process the Shared lib by calling update on the manager. - - * src/.../mi/core/cdi/CSession.java: Create a shared - library manager. - -2003-01-16 Alain Magloire - - * src/.../mi/core/event/MISharedLibCreatedEvent.java: New file. - * src/.../mi/core/event/MISharedLibChangedEvent.java: New file. - * src/.../mi/core/event/MISharedLibUndloadedEvent.java: New file. - - * src/.../mi/core/cdi/event/CreatedEvent.java: - new constructors to deal with MISharedLibCreatedEvent. - * src/.../mi/core/cdi/event/ChangedEvent.java: - new constructors to deal with MISharedLibChangedEvent. - * src/.../mi/core/cdi/event/DestroyedEvent.java: - new constructors to deal with MISharedLibUnloadedEvent. - - * src/.../mi/core/cdi/model/SharedLibrary.java: New file. - - * src/.../mi/core/cdi/SharedLibraryManager.java: New file. - * src/.../mi/core/cdi/CSession.java (getSharedLibraryManager): - New method. - * src/.../mi/core/cdi/EventManager.java (update): - Deal with the new MISharedLibXXXEvents. - -2003-01-15 Alain Magloire - - * src/.../mi/core/command/CommandFactory.java (createMIInfoSharedLibrary): - New method. - * src/../mi/core/command/MIInfoSharedLibrary.java: New file. - * src/../mi/core/output/MIInfoSharedLibraryInfo.java: New File. - * src/../mi/core/output/MIShared.java: new File. - -2003-01-13 Mikhail Khodjaiants - * CTarget.java: in the 'runUntil' method check if file name or function name length > 0, otherwise use address. - -2003-01-10 Alain Magloire - - * src/.../mi/core/cdi/BreakpointManager.java (update): fix subscript - (setCondition): Fire a ChangedEvent. - (enableBreakpoint): Fire a ChangedEvent. - (disableBreakpoint): Fire a ChangedEvent. - -2003-01-10 Alain Magloire - - * src/.../mi/core/cdi/model/CTarget.java (runUntil): Address breakpoint - needs a "*" prefix. - -2003-01-09 Alain Magloire - - * src/.../mi/core/cdi/BreakpointManager.java (hasBreakpointChanged): - Implemented. - -2003-01-09 Alain Magloire - - * src/.../mi/core/cdi/model/CTarget.java (setCurrentThread): takes - a new argument to decide if the events should be fired. - * src/.../mi/core/cdi/model/CThread.java (getStackFrameCount): use - the setCurrentThread() with events updates disable - (getStackFrames): Ditto. - (updateState): Wrong subscript in the loop. - -2003-01-09 Alain Magloire - - Generate CreatedEvent's for Variable, Argument, Expression, Memory, Thread - objects when they are created. This makes it consistent with the generated - DestroyedEvent's. - - * src/.../mi/core/cdi/EventManager.java (update): Deal with - MI{Register,Memory,Thread,Var}CreatedEvent events. - * src/.../mi/core/cdi/model/Ctarget.java (updateState): Fire events - when threads are created or destroyed. - * src/.../mi/core/cdi/model/MemoryBlock.java: Move here. - * src/.../mi/core/cdi/model/Register.java (getID): rename getId() to getID(). - * src/.../mi/core/cdi/event/CreatedEvent.java: New constructors - to deal with MI{Register,Memory,Thread,Var}CreatedEvent. - - * src/.../mi/core/event/MIMemoryCreatedEvent.java: New file. - * src/.../mi/core/event/MIRegisterCreatedEvent.java: New file. - * src/.../mi/core/event/MIThreadCreatedEvent.java: New file. - * src/.../mi/core/event/MIVarCreatedEvent.java: New file. - * src/.../mi/core/event/MIBreakpointChangedEvent.java (MIBreakpointChangedEvent): - Reuse the constructor. - * src/.../mi/core/event/MIBreakpointCreatedEvent.java (MIBreakpointCreatedEvent): - Reuse the constructor. - * src/.../mi/core/event/MIBreakpointDeletedEvent.java (MIBreakpointDeletedEvent): - Reuse the constructor. - -2003-01-08 Alain Magloire - - Refactoring, split the org.eclipse.cdt.debug.mi.core.cdi in pacackages - org.eclipse.cdt.debug.mi.core.cdi - org.eclipse.cdt.debug.mi.core.cdi.event - org.eclipse.cdt.debug.mi.core.cdi.model - This help structure things up. - * src/.../mi/core/cdi/event: New files. - * src/.../mi/core/cdi/model: New files. - -2003-01-08 Alain Magloire - - * src/.../mi/core/cdi/EventManager.java (update): bug fix - was calling DestroyedEvent() incorrectly. - -2003-01-08 Alain Magloire - - CLIProcessor a new class to recognise the CLI(Command Line Interface) - of gdb example: - (gdb) next - (gdb) n - (gdb) b - (gdb) break - etc ..: - When the patterns are discover, the class will generate some events - to warn te UI that something change. - - * src/.../mi/core/cdi/BreakpointManager.java (update): - Send a -break-list and generate events for any difference, in - the breakpoints that we know about. - (deleteBreakpoint): Take as argument the breakpoint number. - (getBreakpoints): Call update() to generate events if new breakpoints. - (getMIBreakpoints): return the MIBreakpoints. - * src/.../mi/core/cdi/ChangedEvent.java (ChangedEvent): - New constructor with MIBreakPointChangedEvent. - * src/.../mi/core/cdi/DestroyedEvent.java (DestroyedEvent): - New constructor with MIBreakPointDeletedEvent. - * src/.../mi/core/cdi/Created.java: New file. - * src/.../mi/core/cdi/EventManager.java (update): - Watch for the new MIBreakPoint*Events. - * src/.../mi/core/event/MIBreakPointCreatedEvent.java: New file. - * src/.../mi/core/event/MIBreakPointChangedEvent.java: New file. - * src/.../mi/core/event/MIBreakPointDeletedEvent.java: New file. - * src/.../mi/core/event/MICreatedEvent.java: New file. - * src/.../mi/core/event/MIDestroyedEvent.java: New file. - * src/.../mi/core/event/MIInferiorExitEvent.java: Extends MIDestroyedEvent - * src/.../mi/core/event/MIThreadExitEvent.java: Extends MIDestroyedEvent - * src/.../mi/core/event/MIGDBExitEvent.java: Extends MIDestroyedEvent - * src/.../mi/core/event/MIDetachedEvent.java: Extends MIDestroyedEvent - * src/.../mi/core/CLIProcessor.java: New file. - * src/.../mi/core/TxThread.java: New file. - -2003-01-07 Alain Magloire - - * src/.../mi/core/MIInferior.java (getOutputStream): Remove useless assignement. - * src/.../mi/core/MIPluging.java (debugLog): Not need to be static. - * src/.../mi/core/cdi/EventManager.java (update): Remove useless assignement. - -2003-01-06 Alain Magloire - - * build.properties: Patch from Judy Green. - -2003-01-06 Alain Magloire - - * src/.../mi/core/cdi/BreapoinManager.java (createLocation): new method - to create a breakoint with an address. - * src/.../mi/core/cdi/Location.java (Location): New constructor takes - an address as argument. - -2003-01-03 Alain Magloire - - The Class creating the CDISession part of the initialization would call - (gdb) set autosolib on - this works fine for Unix system, but on Windows it throws an error - failing the debugger. Windows(Cygwin, MingWin) does not need any - special initialization like solib-search-paths etc .. - - * src/.../mi/core/cdi/SourceManager.java (setAutoSolib): Takes a boolean argument - to set the autosolib on or off. - * src/.../mi/core/CygwinGDBDebugger.java(initializeLibraries): - Empty method, cygwin does not need any special handling. - * src/.../mi/core/GDBDebugger.java (initializeLibraries): - Always call autosolib. - - -2003-01-02 Alain Magloire - - Bug when using recursive: - int recursive(int x) { - if (x > 10) - recursive(++x); - return 0; - } - - The Variable Manager is caching the MI/GDB var-obj for speed. - It is finding the object by looking at the name and the stack/thread, - for recursive calls, this is wrong and the code would be full in - thinking the variable "x"(see above) is the same object. To make the distinction - we use the depth "-stack-info-depth" that will be use also in the equality - to make sure we identify an object uniquely. In the recursive() case above - because the depth is different, a new "x" object will be created. The downside - is that on certain platform doing deep recursive/stackframe, we have noticed - that "-stack-info-depth" can be very long, test done for gdb/QNX with - a stack depth of 1000. - - * src/.../mi/core/cdi/VariableManager.java (getElement): - Use the depth when doing equal(). - (createElement): Save the depth of the stack part of the Element. - -2003-01-02 Alain Magloire - - GDB/MI uses some oob reasons that was not documented for the watchpoints - *stopped,reason="access-watchpoint-trigger"... - *stopped,reason="read-watchpoint-trigger",... - * src/.../mi/core/event/MIWatchpointTrigger.java (parse): - check for "hw-awpt" and "hw-rwpt". - * src/.../mi/core/RxThread.java (createEvents): - Check for "access-watchpoint-trigger", "read-watchpoint-trigger. - -2002-12-17 Alain Magloire - - * src/.../mi/core/cdi/Register.java (setFormat): bug fix - The format variable was not set. - -2002-12-05 Alain Magloire - - GDB/MI provides error messages in its log stream, one problem - is that it is not consistent, for example doing: - (gdb) info threads - & "info threads\n" - which is obviously not an error. - So we put the error stream output par of the exception so when - it is relevant it shows in the Exception. - MI2CDIException is the bridge class. - - * src/.../mi/core/cdi/BreakpoinManager.java: - * src/.../mi/core/cdi/CSession.java: - * src/.../mi/core/cdi/CTarget.java: - * src/.../mi/core/cdi/CThread.java: - * src/.../mi/core/cdi/MemoryBlock.java: - * src/.../mi/core/cdi/MemoryManager.java: - * src/.../mi/core/cdi/Register.java: - * src/.../mi/core/cdi/RegisterManager.java: - * src/.../mi/core/cdi/SourceManager.java: - * src/.../mi/core/cdi/Value.java: - * src/.../mi/core/cdi/Variable.java: - * src/.../mi/core/cdi/VariableManager.java: - - * src/.../mi/core/command/Command.java (getMIInfo): - When error get the log stream and put it in the MIException. - * src/.../mi/core/event/MIErrorEvent.java: - Get the log stream error also. - * src/.../mi/core/MIException.java (getLogMessage): New method - contains buffer output. - * src/.../mi/core/RxThread.java (processMIOutput): get the - oob arrays up so it can be use in MIErrorEvent. - -2002-12-02 Alain Magloire - - * src/.../mi/core/cdi/CTarget.java (updateState): If we - have the current thread id set it before, getCThread() if - it is implemented with "info threads" can override it but - "-stack-list-thread" does not give this information. - * src/.../mi/core/cdi/ErrorInfo.java: New file - * src/.../mi/core/cdi/EventManager.java (getReason): Return - an ErrorInfo also. - * src/.../mi/core/event/MIErroEvent.java: New file - * src/.../mi/core/RxThread.java (processMIOutput): - Generated MIErrorEvent for "^error". - -2002-11-29 Alain Magloire - - * src/.../mi/core/cdi/EventManager.java (processSuspended): - get the threadId. - -2002-11-29 Alain Magloire - - * src/.../mi/core/cdi/MemoryBlock.java (setValue): - Check if the change affects other block and fire MemoryChangedEvent - when necessary. - -2002-11-29 Alain Magloire - - * src/.../mi/core/event/MIBreakpointEvent.java: - * src/.../mi/core/event/MIFunctionFinishedEvent.java: - * src/.../mi/core/event/MILocationReachedEvent.java: - * src/.../mi/core/event/MISignalEvent.java: - * src/.../mi/core/event/MISteppingRangeEvent.java: - * src/.../mi/core/event/MIStoppedEvent.java: - * src/.../mi/core/event/MIWatchpointEvent.java: - * src/.../mi/core/event/MIWatchpointTriggerEvent.java: - * src/.../mi/core/RxThread.java: - Some events like the temporary events, do not have - any specific format but do provide a frame and a thread-id - move the code in MIStoppedEvent. - -2002-11-28 Alain Magloire - - * src/.../mi/core/cdi/MemoryBlock.java (setValue): Only get a byte. - -2002-11-28 Alain Magloire - - * src/.../mi/core/cdi/CTarget.java (runUntil): new method implemented. - * src/.../mi/core/cdi/CThread.java (runUntil): new method implemented. - -2002-11-26 Doug Schaefer - - * src/.../mi/core/CygwinGDBDebugger.java: - New Debugger that provides the Cygwin Command Factory to the MISession - * src/.../mi/core/command/CygwinCommandFactory.java: - New Command Factory for Cygwin specific implementations of the commands - * src/.../mi/core/command/CygwinMIEnvironmentDirectory.java: - New. Subclasses the MIEnvironmentDirectory command to convert the - paths using cygpath. - * plugin.xml: - Defines the new debugger extension. - -2002-11-25 Alain Magloire - - * src/.../mi/core/cdi/Watchpoint.java: - Check if it was access point also. - * src/.../mi/core/output/MIBreakInsertInfo.java (parse): - Check for "wpt" variable. - * src/.../mi/core/output/MIBreakpoint.java (IsWriteWatchpoint): - implemented. - -2002-11-20 Mikhail Khodjaiants - Fix for bug 26595. - * src/.../mi/core/cdi/MemoryManager.java (compareBlocks): - If the start address of a memory block has changed fir 'changed' event - only for the corresponding bytes of the overlapping area of new and old blocks. - -2002-11-19 Alain Magloire - - * src/.../mi/core/cdi/MemoryManager.java (compareBlocks): - The startAddress() may have change for example if we were - watching "char *p;" and the address move "p++". Take this - into account now. - -2002-11-18 Alain Magloire - - * src/.../mi/core/cdi/StackFrame.java (getCurrentStackFrame): - if the currentFrame was not set only get the top level - frame for the current. - * src/.../mi/core/cdi/CTarget.java (updateStateId): - Set the currentThreads && currentThreadId. - -2002-11-18 Alain Magloire - - * src/.../mi/core/cdi/CThread.java (getStackFrameCount): - Set the new thread before getting the value and restore - after. - -2002-11-14 Alain Magloire - - This is needed in post-mortem, application doing a - very deep recursion and crashing the stack size, for example - on GNU/Linux it may reach 200000 levels deep. Trying to - bring in the UI a bactrace tree of 200000 nodes is useless. - The UI could check the count and do the appropriate action - by showing ranges etc .. - - * src/.../mi/core/cdi/CThread.java (getStackFrame): - new method with a hi and low. - (getStackFrameCount): new method. - * src/.../mi/core/command/CommandFactory.java (createMIStackInfoDepth): - new method. - * src/.../mi/core/command/MIStackInfoDepth.java (getMIStackInfoDepthInfo): - new method. - -2002-11-13 Dave Inglis - * plugin.xml - Added "native" cpu support. - -2002-11-06 Alain Magloire - - * src/.../mi/core/cdi/StackFrame.java (getLocals): - If an exception was thrown, the array may contain null - entries. Use a list and catch the exception. - -2002-11-06 Alain Magloire - - * src/.../mi/core/cdi/StackFrame.java (getArguments): - If an exception was thrown, the array may contain null - entries. Use and a List and catch the exception. - -2002-11-05 Alain Magloire - - * src/.../mi/core/cdi/Register.java (setValue): Fire a - MIRegisterChangedEvent when changing value. - Fix PR:25730 - -2002-11-01 Alain Magloire - - The change in MISession(), will catch things like starting gdb-5.0 - with argument "-i mi1", that level of mi is not supported. - - * src/.../mi/core/cdi/MemoryBlock.java (refresh): When doing the refresh - check if other blocks wehre affected and update them. - * src/.../mi/core/cdi/MemoryManager.java (update): Return the array of - affected addresses. - * src/.../mi/core/MIPlugin.java (createCSession): Do not throw an - error when trying "set new-console", it does not work on Linux. - * src/.../mi/core/MISession.java (MISession): Check if the process - terminated early, maybe because of wron arguments etc .. and throw - the exception. - -2002-11-1 David Inglis - * src/.../mi/core/MIPlugin.java - throw MIExceptions in createSession (not rethorwn IOExceptions) - -2002-10-30 Alain Magloire - - * src/.../core/cdi/MemoryBlock.java (setDirty): When need a - refresh setDirty() to true. - (isDirty): Return the flag value. - - * src/.../core/cdi/MemoryManager.java (update): Check if - the MemoryBlock isDirty(). - -2002-10-30 Alain Magloire - - * src/.../core/cdi/MemoryBlock.java (setValue): reuse refresh() - to update the memory and fire any MemoryChangedEvents. - -2002-10-26 Alain Magloire - - * src/.../core/cdi/MemoryBlock.java (setValue): Generate - a MemoryChangeEvent when the value is set, gdb/mi will not - do it. - -2002-10-25 Alain Magloire - - * src/.../core/cdi/CThread.java (getStackFrames): Save the - current thread before changing and restore when operation finish. - - * src/.../core/cdi/MemoryBlock.java (refresh): Flush the old - data and get new memory. - (update): New method to compare individual blocks. - -2002-10-25 Alain Magloire - - Automatically suspend/resume gdb when setting a breakpoint. - The workflow when debuggin which gdb command prompt is to - hit CTRL-C set the breakpoint and continue. The UI debugger - should be smart enought to do this by itself. So if the - inferior is running, when setting a breakpoint the program - is suspended(target.suspend()), the suspend event is ignore - the breakpoint is set (--break-insert) and the target is resume. - To ignore a specific event, we use a (mis)behaviour of gdb that - associate the suspend(*stopped) with the last execution command. - (gdb) - 111-exec-continue - 111^running - (gdb) - 222-exec-interrupt - 222^done - (gdb) - 111*stopped,signal-name="SIGINT",signal-meaning="Interrupt", - frame={addr="0x00010140",func="foo",args=[],file="try.c",line="13"} - (gdb) - In the case above event 111 is ignore. - - * src/.../core/command/CLICommand.java (toString): Always put - the identifying token. - * src/.../core/command/Command.java (setToken): Removed. - (getUniqToken): New method returns a global uniq token. - (getToken): Returns a uniq token for the command. - * src/.../core/MIInferior.java (setTerminated): New argument token, - since now all MIEvent has the corresponding command token. - * src/.../core/MISession.java (cmdCount): Removed. - (postCommand): the command getToken() will return a uniq token. - * src/.../core/RxThread.java (processMIOOBRecord): MIEvent take - the corresponding command token as argument. - * src/.../core/TxThrea.java (token): Field removed, token are no - longer created in this tread. - * src/.../core/event/MIBreakpointEvent.java: - * src/.../core/event/MIBreakpointEvent.java: - * src/.../core/event/MIChangedEvent.java: - * src/.../core/event/MIDetachedEvent.java: - * src/.../core/event/MIEvent.java: - * src/.../core/event/MIFunctionFinishedEvent.java: - * src/.../core/event/MIGDBExitEvent.java: - * src/.../core/event/MIInferiorExitEvent.java: - * src/.../core/event/MILocationReachedEvent.java: - * src/.../core/event/MIMemoryChangedEvent.java: - * src/.../core/event/MIRegisterChangedEvent.java: - * src/.../core/event/MIRunningEvent.java: - * src/.../core/event/MISignalEvent.java: - * src/.../core/event/MISteppingRangeEvent.java: - * src/.../core/event/MIStoppedEvent.java: - * src/.../core/event/MIThreadExitEvent.java: - * src/.../core/event/MIVarChangedEvent.java: - * src/.../core/event/MIWatchpointScopeEvent.java: - * src/.../core/event/MIWatchpointTriggerEvent.java: - Calls super with getToken(). - * src/.../core/cdi/BreakpointManager.java (allowProgramInterruption): - New method to allow suspending the program to set a breakpoint. - (suspendInferior): get the last token execution an ignore the suspend - event. - * src/.../core/cdi/CTarget.java (getLastExecutionToken): New method - returns the token of the last execution command. - * src/.../core/cdi/EventManager.java (enableEventToken): New method. - (enableEventTokens): New method. - (disableEventToken): New method. - (disableEventTokens): New method. - (update): Ignore token in the disable list. - * src/.../core/cdi/RegisterManager.java (update): MIEvent takes - a token. - * src/.../core/cdi/Variable.java (setValue): MIEvent takes a token. - * src/.../core/cdi/VariableManager.java (update): MIEvent takes a token. - -2002-10-24 Alain Magloire - - * src/.../core/RxThread.java (processMIOutput): Fire a - suspended event when seeing an error. - -2002-10-24 Alain Magloire - - * src/.../core/output/MIConst.java (isoC): Change to return - a string instead '\n' is platform dependent and has to be - translate to "\r\n" for SWT widgets to work correctly on windows. - -2002-10-23 Alain Magloire - - gdb/mi for program control command will fire a change state event: - -exec-run - ^running - This allow the UI to change its state and wait for the suspended. - Providing a gdb prompt adds some problems, since there is no state - change, i.e.(^running) after command like, next/step/...: - next - &"next\n" - ... - So to palliate, the txthread do some query when the commands are - CLI commands trying to discover the type and fire any appropriate - events on behalf on gdb. - - * src/.../core/RxThread.java (createEvent): Adjust the parser to - not rely on the oob "*stopped", since for CLI command it is not - in the result-class. So the suspended state will be base of - the "reason" only. - * src/.../core/TxThread.java (processCLICommand): new method, - get the command and try to recognize if it is a program control - command like: next, step, etc .. - * src/.../core/command/CLICommand.java (getOperation): New method, - returns the command string. - -2002-10-22 Alain Magloire - - Change the framework to support access to gdb prompt. - Trying to reuse as much as possible Eclipse framework. - The session/gdb process is available via CDI. - - * src/.../core/GDBStreamsProxy.java: Removed. - * src/.../core/GDBProcess.java: Removed. - * src/.../core/GDBStreamMonitor.java: Removed. - * src/.../core/SessionProcess.java: New file. - * src/.../core/MISession.java (getMISessionProcess): - New method, returns a "fake" Process that wraps the input/outpu - stream of gdb. - (getGDBProcess): was getMIProcess(), renamed. - * src/.../core/cdi/CSession.java (getSessionProcess): New method - return gdb process. - -2002-10-22 Alain Magloire - - * src/.../core/GDBStreamsProxy.java (write): - Replace the OutputStream with a Write class. - And clear the buffer on flush(). - -2002-10-21 Alain Magloire - - * src/.../core/GDBProcess.java (getExitValue): Catch - IllegalThreadStateException. - (getAttribute): Only create Properties, when call. - (setAttribute): Only create Properties, when call. - (getAdapter): Implemented. - (canTerminate): true only of the process is alive. - (GDBProcess): Takes one more argument the name. - * src/.../core/GDBStreamMonitor.java (fireStreamAppend): New method. - Use a synchronized LinkedList for the listeners. - (read): new Method. - (startMonitoring): New method, start a thread in the background - to monitor the input. - * src/.../core/GDBStreamsProxy.java (getErrorStream): Start the monitor thread. - (getOutputStream): Start the monitor thread. - -2002-10-21 Alain Magloire - - Framework for having a gdb console. The idea is to reuse - the eclipse console and save a lot of work. We "adapt" - the gdb Process to what eclipse debug LaunchView wants(IProcess). - So when this fake "gdb process" is selected we can grab the - input/output of the console and redirect everything to raw gdb. - - * src/.../core/GDBProcess.java: New file, it implements Eclipse - debug class IProcess. - * src/.../core/GDBStreamMonitor: New file, it implements Eclipse - debug class IStreamMonitor. - * src/.../core/GDBStreamsProxy: New file, it implements Eclipse - debug class IStreamsProxy. - * src/../core/MISession.java (getMIConsoleStream): New method - to return the mi console stream output that we get from gdb/mi. - (getMILogStream): New method, to return the mi log stream output - that we get from gdb/mi. - (terminate): close the fake MI Console and Log streams. - * src/../core/RxThread.java (processMIOOBRecord): Redirect the - console and the log stream to a buffer pipe. - -2002-10-21 Alain Magloire - - * src/.../core/cdi/EventManager.java (update): Only - fire the event for MemoryChangedEvent if the block was - not frozen. - -2002-10-20 Alain Magloire - - Eclipse provides plugins a way to trace by having an .options file, - this mechanism is use to print out the mi exchange between gdb - and the plugin. To enable this in the debug launch one must enable - "tracing" and set for the "org.eclipse.debug.mi.core/debug" to true. - But one problem, the console will simply blow taking down eclipse, - for big MI line response, say 4k length, for example asking the children - of "char buffer[4096]", -var-list-children varxx. - This seem only to happen in Eclipse-gtk or Eclipse-motif - on GNU/Linux, so it will be break in smaller chunks to give a chance to - the console. - - * .options: Set debug to true. - * src/.../core/MIPlugin.java (debugLog): Break the log line in small chuncks of 100. - * src/.../core/MISession.java (postCommand): Print the gdb/mi command. - * src/.../core/RxThread.java (run): Print gdb/mi responses. - -2002-10-20 Alain Magloire - - -data-write-register-values is not in the texinfo manual but implemented in - gdb-5.2.1/gdb/mi/mim-main.c: - Write given values into registers. The registers and values are - given as pairs. The corresponding MI command is - -data-write-register-values [ ... ] - - * src/.../core/command/MIDataWriteRegisterValues.java: New file. - * src/.../core/command/CommandFactory.java (createMIDataWriteMemory): New method. - * src/.../core/cdi/Register.java (setValue): Implemented. - -2002-10-20 Alain Magloire - - Althought -data-write-memory is not documented in the texinfo manual - it is implemented and well documented in the code(gdb-5.2.1/gdb/mi/mi-main.c). - "mi_cmd_data_write_memory: Usage: [-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE."); - - * src/.../core/command/MIDataWriteMemory.java: New file - * src/.../core/command/CommandFactory.java (createMIDataWriteMemory): New method. - * src/.../core/cdi/MemoryBlock.java (setValue): Implemented. - -2002-10-20 Alain Magloire - - * src/.../core/cdi/CTarget.java (getMemoryBlock): Remove - we use the MemoryManager instead. - (EvaluateExpressionToValue): Removed not use. - * src/.../core/cdi/SourceManager.java (setFile): Removed not use. - (getFile): Removed not use. - (reset): Removed not use. - -2002-10-19 Alain Magloire - - The responsability to generate Events for modify memory blocks is push - on the CDI implementation. The way we do this is every time consuming, - when the inferior is suspended(see EventManager.processSuspendedEvent()), - MemoryManager.update() is called, the method will go through the list of MemoryBlocks - that are not MemoryBlocks.setFrozen() and fetch the new memories, the data is compare - and MemoryChangedEvents are fired for blocks with changed values. - Gdb/mi var objects does not seem to provide any support for Memory ranges. - - * src/.../core/cdi/MemoryChangedEvent.java: New File implements ICDIMemoryChangedEvent. - * src/.../core/cdi/EventManager.java (update): Process MIMemoryChangedEvent's. - (processSuspendedEvent): call MemoryManager.update(). - * src/.../core/cdi/MemoryBlock.java (getExpression): New method. - (getMIDataReadMemoryInfo): New method. - (setMIDataReadMemoryInfo): New method. - * src/.../core/cdi/MemoryManager.java (update): New method. - (compareBlock): New method. - (listMemoryBlocks): New method. - - * src/.../core/cdi/CTarget.java (setCurrentThread): Catch null pointer. - (getCThreads): Likewise. - * src/.../core/event/MIMemoryChangedEvent.java: New File. - * src/.../core/event/MIThreadExitEvent.java: Indentation fixes. - * src/.../core/event/MIVarChangedEvent.java: Indentation fixes. - - - -2002-10-16 Alain Magloire - - * src/.../mi/core/cdi/MemoryManager.java (createMemoryBlock): - New method that takes a string instead of a long, rearrange - the method for it. - -2002-10-12 Alain Magloire - - There are some serious problems with gdb/mi, for example - the most recurrent one is when using -data-disassemble - in a threaded program, GNU/Linux uses a thread manager - when trying to access the stackframe, gdb usually coredumps - with an assert, it goes something like this: - --data-disassemble -f manager.c -l 136 -n 100 0 -&"Cannot access memory at address 0x4002d794\n" -^error,msg="Cannot access memory at address 0x4002d794" -(gdb) --data-disassemble -s 0x4002d900 -e 0x4002d964 0 -&"Cannot access memory at address 0x4002d900\n" -^error,msg="Cannot access memory at address 0x4002d900" -(gdb) --thread-select 2 -&"ui-out.c:133: gdb-internal-error: push_level: Assertion `uiout->level >= 0 && uiout->level < MAX_UI_OUT_LEVELS' failed.\n" - - The RxThread will spawn a thread to terminate the session - and clear the receiving queue. - - - * RxThread.java (run): When the thread is being cancel() or - running out of run(), clear the receiving queue(rxQueue) and - notify any commands waiting. - - * TxTread.java (run): Before putting the command in the - receiving queue(rxQueue) check to see if the thread is - still running. - When the thread is being cancel() or running out of run(), - clear the transmition queue(txQueue) an notify any commands - waiting. - - * Queue.java (clearItems): New method that clear the items - on the queue and returning them. - - * CommandQueue.java (clearCommands): New method calls super.clearItems() - whith the appropriate castings. - - * cdi/CThread.java (setCurrentStackFrame): Check for null. - -2002-10-12 Alain Magloire - - The memory block is implemented with - -data-read-memory (MIDataReadMemory) - Since the ICDIMemoryBlock only have - byte[] getBytes() - We will always issue: - -data-read-memory address x 1 1 length - The CDI upper layer will deal with any conversions - - The problem now is how to send changedEvent when - an element of the memory changed. - - * cdi/MemoryBlock.java (getLength): Implemented - (getBytes): Implemented - (getStartAddress): Implemented - - * cdi/MemoryManager.java: Implemented. - - * command/MIDataReadMemory (getMIDataReadMemoryInfo): - New helper method. - -2002-10-12 Alain Magloire - - * cdi/Location (getInstructions): Methods removed - no longer define in ICDILocation. - -2002-10-11 Alain Magloire - - * cdi/SourceManager (getMixedInstruction): - Implement the 3 new methods to return Mixed source - and assemby instructions. - - * cdi/MixedInstruction: New class implements - ICDIMixedInstruction. - -2002-10-11 Alain Magloire - - * cdi/ExpressionManager.java: Not needed, removed. - -2002-10-10 Alain Magloire - - The Eclipse/UI/Debug framewok is being very repetive - and each command can be ask 2, 3 times. So we'll try - to make certain commands smarter by not reissuing them - to gdb if the state is the same. We do this when - selecting the thread and when selecting the stackframe. - - The other problem is that Eclipse/UI/Debug is calling - ICDISession.terminate() twice, this is catch by looking - at isTerminated(). - - * cdi/CThread.java (setCurrentStackFrame): Make it smarter - to not reselect the stack level if it is already at that - level. - - * MISession.java (isTerminated): Declare a flag that will - hold the state. - (terminate): Check if it was call already. - -2002-10-10 Alain Magloire - - * SourceManager.java: Implement getInstructions(). diff --git a/debug/org.eclipse.cdt.debug.mi.core/about.html b/debug/org.eclipse.cdt.debug.mi.core/about.html deleted file mode 100644 index 293340ea8ed..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            20th August, 2002

            -

            License

            -

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

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.core/build.properties b/debug/org.eclipse.cdt.debug.mi.core/build.properties deleted file mode 100644 index 1c84c5c4628..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - cdtmicore.jar -src.includes = plugin.xml,\ - plugin.properties,\ - about.html -source.cdtmicore.jar = src/ -javadoc.packages = org.eclipse.cdt.debug.mi.core.*,\ - org.eclipse.cdt.debug.mi.core.cdi.*,\ - org.eclipse.cdt.debug.mi.core.command.*,\ - org.eclipse.cdt.debug.mi.core.event.*,\ - org.eclipse.cdt.debug.mi.core.output.* diff --git a/debug/org.eclipse.cdt.debug.mi.core/design.txt b/debug/org.eclipse.cdt.debug.mi.core/design.txt deleted file mode 100644 index 782d0275725..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/design.txt +++ /dev/null @@ -1,110 +0,0 @@ - - - - -
            -Note this is an interim the document and subject to changes.
            -
            -
            -****
            -This MI implementation is base on GDB/MI 5.2.1.
            -
            -* Command/Response channels
            -To create an MISession an InputStream and OutputStream are
            -needed(assuming it is the pipe connected to gdb).
            -
            -	MISession misession = new MISession(InputStream, OutputStream);
            -	
            -During initialisation of the session(MISession) two threads
            -are created TxThread, RxThread and associative list queues
            -TxQueue and RxQueue:
            -- The RxThread thread is block on readig the output of the pipe(gdb) for
            -any responses.
            -- The TxThread thread is block waiting for command.
            -
            -MI Commands are created via the CommandFactory and
            -are added to the TxQueue, the TxThread will then wake up
            -generate a token(ID) for the command and send it to the pipe(gdb), after
            -transmission the command is then move to the RxQueue waiting for the 
            -result(MIResultRecord).
            -
            -Any responses will wake the RxThread, the thread will parse
            -the response constructing an MIOutput, then it searches the RxQueue
            -for any commands with the same token waking any thread waiting
            -for a synchronous response(MIResultRecord).  Any out-of-band
            -responses(MIOOBRecord) are dispatch to MISession observers, clients interested
            -in notifications should register to the MISession.
            -
            -* MI Parsing
            -There is a generic MI parser (MIParser) constructing an syntax tree of the output.
            -For example, a ResultRecord response after a "-break-insert", the parser will
            -generate this tree:
            -	10-break-insert main
            -	10^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
            -			addr="0x08048468",func="main",file="hello.c",line="4",times="0"}
            -
            -	- MIOutput
            -		- MIOOBRecord[0]
            -		- MIResutRecord
            -			- token = 10
            -			- ResultClass = "done"
            -			- MIResult[1]
            -				- MIResult[0]
            -					- variable = "bkpt"
            -					- value = MITuple
            -						- MIResult[9]
            -							- MiResult[0]
            -								- variable = "number"
            -								- MIConst = "1"
            -							- MiResult[1]
            -								- variable = "type"
            -								- MIConst = "breakpoint"
            -							- MiResult[2]
            -								- variable = "disp"
            -								- MIConst = "keep"
            -							- MiResult[3]
            -								- variable = "enabled"
            -								- MIConst = "y"
            -							- MiResult[4]
            -								- variable = "addr"
            -								- MIConst = "0x08048468"
            -							- MiResult[5]
            -								- variable = "func"
            -								- MIConst = "main"
            -							- MiResult[6]
            -								- variable = "file"
            -								- MIConst = "hello.c"
            -							- MiResult[7]
            -								- variable = "line"
            -								- MIConst = "4"
            -							- MiResult[8]
            -								- variable = "times"
            -								- MIConst = "0"
            -
            -MICommands will do there own parsing:
            -	session = MISession(in, out);
            -	MIBreakInsert cmd = new MIBreakInsert("main");
            -	session.postCommand(cmd);	// sent to gdb.
            -	MIBreakInsertInfo info = cmd.getBreakInsertInfo(); // Parsing of the Result Record.
            -
            -****
            -MI Process
            -
            -For convienience, to java.lang.Process is provided.
            -
            -		MISession.getSessionProcess();
            -
            -This Process talks directly to gdb and is smart enough to wrap any command
            -in CLICommand etc ..
            -
            -	MISession.getMIInferior()
            -	
            -MIInferior implements Process for the Inferiror.
            -
            -*****
            -MI <==> CDI Adapters
            -
            - To do.
            -
            - - diff --git a/debug/org.eclipse.cdt.debug.mi.core/plugin.properties b/debug/org.eclipse.cdt.debug.mi.core/plugin.properties deleted file mode 100644 index 9692fd64d85..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/plugin.properties +++ /dev/null @@ -1,6 +0,0 @@ -pluginName=C/C++ Development Tools GDB/MI CDI Debugger Core -providerName=Eclipse.org - -GDBDebugger.name=GDB Debugger -CygwinGDBDebugger.name=Cygwin GDB Debugger -GDBServer.name=GDB Server diff --git a/debug/org.eclipse.cdt.debug.mi.core/plugin.xml b/debug/org.eclipse.cdt.debug.mi.core/plugin.xml deleted file mode 100644 index b14464ce5d4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/plugin.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java deleted file mode 100644 index c3bca48b164..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CLIProcessor.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core; - -import org.eclipse.cdt.debug.mi.core.command.CLICommand; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent; - -/** - * Transmission command thread blocks on the command Queue - * and wake cmd are available and push them to gdb out channel. - */ -public class CLIProcessor { - - MISession session; - - public CLIProcessor(MISession s) { - session = s; - } - - /** - * An attempt to discover the command type and - * fire an event if necessary. - */ - void process(CLICommand cmd) { - String operation = cmd.getOperation().trim(); - // Get the command name. - int indx = operation.indexOf(' '); - if (indx != -1) { - operation = operation.substring(0, indx).trim(); - } else { - operation = operation.trim(); - } - - // Check the type of command - - int type = getSteppingOperationKind(operation); - if (type != -1) { - // if it was a step instruction set state running - session.getMIInferior().setRunning(); - MIEvent event = new MIRunningEvent(cmd.getToken(), type); - session.fireEvent(event); - } else if (isSettingBreakpoint(operation) || - isSettingWatchpoint(operation) || - isChangeBreakpoint(operation) || - isDeletingBreakpoint(operation)) { - // We know something change, we just do not know what. - // So the easiest way is to let the top layer handle it. - session.fireEvent(new MIBreakpointChangedEvent(0)); - } else if (isSettingSignal(operation)) { - // We do no know which signal let the upper layer find it. - session.fireEvent(new MISignalChangedEvent("")); - } else if (isDetach(operation)) { - // if it was a "detach" command change the state. - session.getMIInferior().setDisconnected(); - MIEvent event = new MIDetachedEvent(cmd.getToken()); - session.fireEvent(event); - } - } - - int getSteppingOperationKind(String operation) { - int type = -1; - /* execution commands: n, next, s, step, si, stepi, u, until, finish, - c, continue, fg */ - if (operation.equals("n") || operation.equals("next")) { - type = MIRunningEvent.NEXT; - } else if (operation.equals("ni") || operation.equals("nexti")) { - type = MIRunningEvent.NEXTI; - } else if (operation.equals("s") || operation.equals("step")) { - type = MIRunningEvent.STEP; - } else if (operation.equals("si") || operation.equals("stepi")) { - type = MIRunningEvent.STEPI; - } else if (operation.equals("u") || - (operation.startsWith("unt") && "until".indexOf(operation) != -1)) { - type = MIRunningEvent.UNTIL; - } else if (operation.startsWith("fin") && "finish".indexOf(operation) != -1) { - type = MIRunningEvent.FINISH; - } else if (operation.equals("c") || operation.equals("fg") || - (operation.startsWith("cont") && "continue".indexOf(operation) != -1)) { - type = MIRunningEvent.CONTINUE; - } else if (operation.startsWith("sig") && "signal".indexOf(operation) != -1) { - type = MIRunningEvent.CONTINUE; - } else if (operation.startsWith("j") && "jump".indexOf(operation) != -1) { - type = MIRunningEvent.CONTINUE; - } else if (operation.equals("r") || operation.equals("run")) { - type = MIRunningEvent.CONTINUE; - } - return type; - } - - boolean isSettingBreakpoint(String operation) { - boolean isbreak = false; - /* breakpoints: b, break, hbreak, tbreak, rbreak, thbreak */ - /* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */ - if ((operation.startsWith("b") && "break".indexOf(operation) != -1) || - (operation.startsWith("tb") && "tbreak".indexOf(operation) != -1) || - (operation.startsWith("hb") && "hbreak".indexOf(operation) != -1) || - (operation.startsWith("thb") && "thbreak".indexOf(operation) != -1) || - (operation.startsWith("rb") && "rbreak".indexOf(operation) != -1)) { - isbreak = true; - } - return isbreak; - } - - boolean isSettingWatchpoint(String operation) { - boolean isWatch = false; - /* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */ - if ((operation.startsWith("wa") && "watch".indexOf(operation) != -1) || - (operation.startsWith("rw") && "rwatch".indexOf(operation) != -1) || - (operation.startsWith("aw") && "awatch".indexOf(operation) != -1)) { - isWatch = true; - } - return isWatch; - } - - boolean isDeletingBreakpoint(String operation) { - boolean isDelete = false; - /* deleting breaks: clear, delete */ - if ((operation.startsWith("cl") && "clear".indexOf(operation) != -1) || - (operation.equals("d") || (operation.startsWith("del") && "delete".indexOf(operation) != -1))) { - isDelete = true; - } - return isDelete; - } - - boolean isChangeBreakpoint(String operation) { - boolean isChange = false; - /* changing breaks: enable, disable */ - if ((operation.equals("dis") || operation.equals("disa") || - (operation.startsWith("disa") && "disable".indexOf(operation) != -1)) || - (operation.equals("en") || (operation.startsWith("en") && "enable".indexOf(operation) != -1)) || - (operation.startsWith("ig") && "ignore".indexOf(operation) != -1) || - (operation.startsWith("cond") && "condition".indexOf(operation) != -1)) { - isChange = true; - } - return isChange; - } - - boolean isSettingSignal(String operation) { - boolean isChange = false; - /* changing signal: handle, signal */ - if (operation.startsWith("ha") && "handle".indexOf(operation) != -1) { - isChange = true; - } - return isChange; - } - - /** - * @param operation - * @return - */ - boolean isDetach(String operation) { - return (operation.startsWith("det") && "detach".indexOf(operation) != -1); - } - - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CommandQueue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CommandQueue.java deleted file mode 100644 index 39b1681e644..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CommandQueue.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import org.eclipse.cdt.debug.mi.core.command.Command; - -/** - * Simple thread-safe Queue implemetation. - */ -public class CommandQueue extends Queue { - - - public CommandQueue() { - super(); - } - - public Command removeCommand(int id) { - //print("in removeCommand(" + id + ") - entering"); - synchronized (list) { - int size = list.size(); - for (int i = 0; i < size; i++) { - Command cmd = (Command)list.get(i); - int token = cmd.getToken(); - if (token == id) { - list.remove(cmd); - return cmd; - } - } - } - return null; - } - - public Command removeCommand() throws InterruptedException { - //print("in removeCommand() - entering"); - return (Command)removeItem(); - } - - public void addCommand(Command cmd) { - //print("in addCommand() - entering"); - addItem(cmd); - } - - public Command[] clearCommands() { - Object[] objs = clearItems(); - Command[] cmds = new Command[objs.length]; - System.arraycopy(objs, 0, cmds, 0, objs.length); - return cmds; - } - -// private static void print(String msg) { -// String name = Thread.currentThread().getName(); -// System.out.println(name + ": " + msg); -// } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java deleted file mode 100644 index f6237943426..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/CygwinGDBDebugger.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * (c) Copyright Rational Software Corporation. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.CygwinCommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSet; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.ILaunchConfiguration; - -/** - * Cygwin GDB Debugger overrides the GDB Debugger to apply the Cygwin - * Command Factory to the MI Session. - */ -public class CygwinGDBDebugger extends GDBDebugger { - - static final CygwinCommandFactory commandFactory = new CygwinCommandFactory(); - - protected void initializeLibraries(ILaunchConfiguration config, Session session) throws CDIException { - try { - ICDISharedLibraryManager manager = session.getSharedLibraryManager(); - if (manager instanceof SharedLibraryManager) { - SharedLibraryManager mgr = (SharedLibraryManager) manager; - boolean stopOnSolibEvents = - config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT); - try { - mgr.setStopOnSolibEvents(stopOnSolibEvents); - // By default, we provide with the capability of deferred breakpoints - // And we set setStopOnSolib events for them(but they should not see the dll events ). - // - // If the user explicitly set stopOnSolibEvents well it probably - // means that they wanted to see those events so do no do deferred breakpoints. - if (!stopOnSolibEvents) { - mgr.setStopOnSolibEvents(true); - mgr.setDeferredBreakpoint(true); - } - } catch (CDIException e) { - // Ignore this error - // it seems to be a real problem on many gdb platform - } - } - List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); - if (p.size() > 0) { - String[] oldPaths = manager.getSharedLibraryPaths(); - String[] paths = new String[oldPaths.length + p.size()]; - System.arraycopy(p.toArray(new String[p.size()]), 0, paths, 0, p.size()); - System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length); - manager.setSharedLibraryPaths(paths); - } - } catch (CoreException e) { - throw new CDIException("Error initializing shared library options: " + e.getMessage()); - } - } - - public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException { - Session session = null; - boolean failed = false; - try { - session = (Session) super.createLaunchSession(config, exe); - session.getMISession().setCommandFactory(commandFactory); - // For windows we need to start the inferior in a new console window - // to separate the Inferior std{in,out,err} from gdb std{in,out,err} - MISession mi = session.getMISession(); - try { - CommandFactory factory = mi.getCommandFactory(); - MIGDBSet set = factory.createMIGDBSet(new String[] { "new-console" }); - mi.postCommand(set); - MIInfo info = set.getMIInfo(); - if (info == null) { - throw new MIException("No answer"); - } - } catch (MIException e) { - // We ignore this exception, for example - // on GNU/Linux the new-console is an error. - } - initializeLibraries(config, session); - return session; - } catch (CDIException e) { - failed = true; - throw e; - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } - - public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException { - Session session = null; - boolean failed = false; - try { - session = (Session) super.createAttachSession(config, exe, pid); - session.getMISession().setCommandFactory(commandFactory); - initializeLibraries(config, session); - return session; - } catch (CDIException e) { - failed = true; - throw e; - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } - - public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException { - Session session = null; - boolean failed = false; - try { - session = (Session) super.createCoreSession(config, exe, corefile); - session.getMISession().setCommandFactory(commandFactory); - initializeLibraries(config, session); - return session; - } catch (CDIException e) { - failed = true; - throw e; - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/EventThread.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/EventThread.java deleted file mode 100644 index 10e88e81b84..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/EventThread.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core; - -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIStoppedEvent; - -/** - * Event Thread blocks on the event Queue, wakes up - * when events are available and notify all the observers. - */ -public class EventThread extends Thread { - - MISession session; - - public EventThread(MISession s) { - super("MI Event Thread"); - session = s; - } - - public void run() { - // Signal by the session of time to die. - while (session.getChannelOutputStream() != null) { - MIEvent event = null; - Queue eventQueue = session.getEventQueue(); - // removeItem() will block until an item is available. - try { - event = (MIEvent) eventQueue.removeItem(); - } catch (InterruptedException e) { - //e.printStackTrace(); - } - if (event instanceof MIStoppedEvent) { - processSuspendedEvent((MIStoppedEvent)event); - } - try { - if (event != null) { - session.notifyObservers(event); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - void processSuspendedEvent(MIStoppedEvent stopped) { - // give a chance also to the underlying inferior. - session.getMIInferior().update(); - - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java deleted file mode 100644 index 3bd7630f30c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBDebugger.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.ICDebugger; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.ILaunchConfiguration; - -public class GDBDebugger implements ICDebugger { - - protected void initializeLibraries(ILaunchConfiguration config, Session session) throws CDIException { - try { - ICDISharedLibraryManager manager = session.getSharedLibraryManager(); - if (manager instanceof SharedLibraryManager) { - SharedLibraryManager mgr = (SharedLibraryManager)manager; - boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); - boolean stopOnSolibEvents = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT); - try { - mgr.setAutoLoadSymbols(autolib); - mgr.setStopOnSolibEvents(stopOnSolibEvents); - // The idea is that if the user set autolib, by default - // we provide with the capability of deferred breakpoints - // And we set setStopOnSolib events for them(but they should not see those things. - // - // If the user explicitly set stopOnSolibEvents well it probably - // means that they wanted to see those events so do no do deferred breakpoints. - if (autolib && !stopOnSolibEvents) { - mgr.setDeferredBreakpoint(true); - mgr.setStopOnSolibEvents(true); - } - } catch (CDIException e) { - // Ignore this error - // it seems to be a real problem on many gdb platform - } - } - List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST); - if (p.size() > 0) { - String[] oldPaths = manager.getSharedLibraryPaths(); - String[] paths = new String[oldPaths.length + p.size()]; - System.arraycopy(p.toArray(new String[p.size()]), 0, paths, 0, p.size()); - System.arraycopy(oldPaths, 0, paths, p.size(), oldPaths.length); - manager.setSharedLibraryPaths(paths); - } - } catch (CoreException e) { - throw new CDIException("Error initializing shared library options: " + e.getMessage()); - } - } - - public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException { - Session session = null; - boolean failed = false; - try { - String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - File cwd = exe.getProject().getLocation().toFile(); - String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit); - initializeLibraries(config, session); - return session; - } catch (IOException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } catch (MIException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } catch (CoreException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } - - public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException { - Session session = null; - boolean failed = false; - try { - String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - File cwd = exe.getProject().getLocation().toFile(); - String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit); - initializeLibraries(config, session); - return session; - } catch (IOException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } catch (MIException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } catch (CoreException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } - - public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException { - Session session = null; - boolean failed = false; - try { - String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - File cwd = exe.getProject().getLocation().toFile(); - String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit); - initializeLibraries(config, session); - return session; - } catch (IOException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } catch (MIException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } catch (CoreException e) { - failed = true; - throw new CDIException("Error creating session: " + e.getMessage()); - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java deleted file mode 100644 index 826b975b652..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * Monta Vista - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.ICDebugger; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSet; -import org.eclipse.cdt.debug.mi.core.command.MITargetSelect; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Preferences; -import org.eclipse.debug.core.ILaunchConfiguration; - -public class GDBServerDebugger implements ICDebugger { - - void initializeLibraries(ILaunchConfiguration config, Session session) throws CDIException { - try { - ICDISharedLibraryManager mgr = session.getSharedLibraryManager(); - if (mgr instanceof SharedLibraryManager) { - boolean autolib = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT); - try { - ((SharedLibraryManager)mgr).setAutoLoadSymbols(autolib); - } catch (CDIException e) { - // ignore this one, cause problems for many gdb. - } - } - List p = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, new ArrayList(1)); - if (p.size() > 0) { - String[] paths = (String[])p.toArray(new String[0]); - mgr.setSharedLibraryPaths(paths); - } - } catch (CoreException e) { - throw new CDIException("Error initializing: " + e.getMessage()); - } - } - - public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException { - Session session = null; - boolean failed = false; - try { - String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); - File cwd = exe.getProject().getLocation().toFile(); - String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); - if (config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, false)) { - String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_HOST, "invalid"); - remote += ":"; - remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); - String[] args = new String[] {"remote", remote}; - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit); - } else { - MIPlugin plugin = MIPlugin.getDefault(); - Preferences prefs = plugin.getPluginPreferences(); - int launchTimeout = prefs.getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT); - - String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); - String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit); - MISession miSession = session.getMISession(); - CommandFactory factory = miSession.getCommandFactory(); - MIGDBSet setRemoteBaud = factory.createMIGDBSet(new String[]{"remotebaud", remoteBaud}); - // Set serial line parameters - miSession.postCommand(setRemoteBaud, launchTimeout); - MIInfo info = setRemoteBaud.getMIInfo(); - if (info == null) { - throw new MIException ("Can not set Baud"); - } - MITargetSelect select = factory.createMITargetSelect(new String[] {"remote", remote}); - miSession.postCommand(select, launchTimeout); - select.getMIInfo(); - if (info == null) { - throw new MIException ("No answer"); - } - } - initializeLibraries(config, session); - return session; - } catch (IOException e) { - failed = true; - throw new CDIException("Error initializing: " + e.getMessage()); - } catch (MIException e) { - failed = true; - throw new CDIException("Error initializing: " + e.getMessage()); - } catch (CoreException e) { - failed = true; - throw new CDIException("Error initializing: " + e.getMessage()); - } finally { - if (failed) { - if (session != null) { - try { - session.terminate(); - } catch (Exception ex) { - // ignore the exception here. - } - } - } - } - } - - public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException { - throw new CDIException("GDBServer does not support attaching"); - } - - public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException { - throw new CDIException("GDBServer does not support core files"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java deleted file mode 100644 index 031a488a92f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBTypeParser.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core; - -/** - * GDB Type Parser. - * The code was lifted from: The C Programming Language - * B. W. Kernighan and D. Ritchie - */ -public class GDBTypeParser { - - // GDB type parsing from whatis command - // declarator: type dcl - // type: (name)+ - // dcl: ('*' | '&')* direct-decl - // direct-dcl: '(' dcl ')' - // direct-dcl '(' ')' - // direct-dcl '[' integer ']' - // name: ([a-zA-z][0-9])+ - // integer ([0-9)+ - - final static int EOF = -1; - final static int NAME = 0; - final static int PARENS = 1; - final static int BRACKETS = 2; - - String line; - int index; - int tokenType; - String token; - String dataType; - String name; - GDBDerivedType gdbDerivedType; - GDBType genericType; - - public GDBType getGDBType() { - if (gdbDerivedType != null) { - return gdbDerivedType; - } - return genericType; - } - - public String getVariableName() { - return name; - } - - public GDBType parse(String s) { - // Sanity. - if (s == null) { - s = new String(); - } - s = s.trim(); - - // Initialize. - line = s; - index = 0; - token = ""; - dataType = ""; - name = ""; - gdbDerivedType = null; - - // Fetch the datatype. - while (getToken() == NAME) { - dataType += " " + token; - } - - // Hack for GDB, the typename can be something like - // class A : public B, C { ... } * - // We are only interreste in "class A" - int column = dataType.indexOf(':'); - if (column > 0) { - dataType = dataType.substring(0, column); - } - genericType = new GDBType(dataType); - - // Start the recursive parser. - dcl(tokenType); - return getGDBType(); - } - - public class GDBType { - public final static int GENERIC = 0; - public final static int POINTER = 1; - public final static int REFERENCE = 2; - public final static int ARRAY = 3; - public final static int FUNCTION = 4; - - String nameType; - int type; - - public GDBType(String n) { - this(n, 0); - } - - public GDBType(int t) { - this("", t); - } - - GDBType(String n, int t) { - nameType = n; - type = t; - } - - public String toString() { - return nameType; - } - - public String verbose() { - return nameType; - } - - public int getType() { - return type; - } - - } - - public class GDBDerivedType extends GDBType { - int dimension; - GDBType child; - - public GDBDerivedType(GDBType c, int i) { - this(c, i, 0); - } - - public GDBDerivedType(GDBType c, int t, int dim) { - super(t); - setChild(c); - dimension = dim; - } - - public int getDimension() { - return dimension; - } - - public void setChild(GDBType c) { - child = c; - } - - public GDBType getChild() { - return child; - } - - public boolean hasChild() { - return child != null; - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - String childTypeName = (hasChild() ? child.toString() : ""); - sb.append(childTypeName); - switch (getType()) { - case FUNCTION : - sb.append("()"); - //sb.append(" function returning " + (hasChild() ? child.toString() : "")); - break; - case ARRAY : - sb.append("[" + dimension + "]"); - //sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.toString() : "")); - break; - case REFERENCE : - sb.append("&"); - //sb.append(" reference to " + (hasChild() ? child.toString() : "")); - break; - case POINTER : - sb.append("*"); - //sb.append(" pointer to " + (hasChild() ? child.toString() : "")); - break; - } - return sb.toString(); - } - - public String verbose() { - StringBuffer sb = new StringBuffer(); - switch (getType()) { - case FUNCTION : - sb.append(" function returning " + (hasChild() ? child.verbose() : "")); - break; - case ARRAY : - sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.verbose() : "")); - break; - case REFERENCE : - sb.append(" reference to " + (hasChild() ? child.verbose() : "")); - break; - case POINTER : - sb.append(" pointer to " + (hasChild() ? child.verbose() : "")); - break; - } - return sb.toString(); - } - } - - int getch() { - if (index >= line.length() || index < 0) { - return EOF; - } - return line.charAt(index++); - } - - void ungetch() { - if (index > 0) { - index--; - } - } - - // check if the character is an alphabet - boolean isCIdentifierStart(int c) { - if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || c == ':' || c == ',') { - return true; - } - return false; - } - - // check is the character is alpha numeric - // [a-zA-Z0-9] - // GDB hack accept ':' ',' part of the GDB hacks - // when doing ptype gdb returns "class A : public C { ..}" - boolean isCIdentifierPart(int c) { - if ((c >= '0' && c <= 9) || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') { - return true; - } - return false; - } - - boolean isCSpace(int c) { - if (c == ' ' || c == '\t' || c == '\f' || c == '\n') { - return true; - } - return false; - } - - void prependChild(int kind) { - prependChild(kind, 0); - } - - void prependChild(int kind, int d) { - GDBDerivedType dType = new GDBDerivedType(genericType, kind, d); - if (gdbDerivedType != null) { - // get to the last node in the list and add the new to it - GDBType leaf = genericType; - GDBDerivedType node; - boolean keepGoing = true; - for (node = gdbDerivedType; keepGoing;) { - leaf = node.getChild(); - if (leaf instanceof GDBDerivedType) { - node = (GDBDerivedType) leaf; - } else { - keepGoing = false; - } - } - node.setChild(dType); - } else { - gdbDerivedType = dType; - } - } - - // method returns the next token - int getToken() { - token = ""; - - int c = getch(); - - // Skip over any space - while (isCSpace(c)) { - c = getch(); - } - - //char character = (char) c; - - if (c == '(') { - if ((c = getch()) == ')') { - token = "()"; - tokenType = PARENS; - } else { - ungetch(); - tokenType = '('; - } - } else if (c == '[') { - while ((c = getch()) != ']' && c != EOF) { - token += (char) c; - } - tokenType = BRACKETS; - } else if (isCIdentifierStart(c)) { - token = "" + (char) c; - while (isCIdentifierPart((c = getch())) && c != EOF) { - token += (char) c; - } - if (c != EOF) { - ungetch(); - } - tokenType = NAME; - } else if (c == '{') { - // Swallow gdb sends things like "struct foobar {..} *" - // FIXME: if the bracket is not terminate do we throw exception? - int count = 1; - do { - c = getch(); - if (c == '{') { - count++; - } else if (c == '}') { - count--; - } - } while (count > 0 && c != EOF); - } else { - tokenType = c; - } - return tokenType; - } - - void dcl() { - dcl(getToken()); - } - - // parse a declarator - void dcl(int c) { - int nstar = 0; - int namp = 0; - if (c == '*') { - nstar++; - for (; getToken() == '*'; nstar++) { - } - } else if (c == '&') { - namp++; - for (; getToken() == '&'; namp++) { - } - } - dirdcl(); - while (nstar-- > 0) { - prependChild(GDBType.POINTER); - } - while (namp-- > 0) { - prependChild(GDBType.REFERENCE); - } - } - - // parse a direct declarator - void dirdcl() { - int type; - - if (tokenType == '(') { - dcl(); - if (tokenType != ')') { - // FIXME: Do we throw an exception ? not terminate parenthese - return; - } - } else if (tokenType == NAME) { - // Useless we do not need the name of the variable - name = " " + token; - } else if (tokenType == PARENS) { - prependChild(GDBType.FUNCTION); - } else if (tokenType == BRACKETS) { - int len = 0; - if (token.length() > 0) { - try { - len = Integer.parseInt(token); - } catch (NumberFormatException e) { - } - } - prependChild(GDBType.ARRAY, len); - } else { - // oops bad declaration ? - return; - } - - while ((type = getToken()) == PARENS || type == BRACKETS) { - if (type == EOF) { - return; - } - if (type == PARENS) { - prependChild(GDBType.FUNCTION); - } else { - int len = 0; - if (token.length() > 0) { - try { - len = Integer.parseInt(token); - } catch (NumberFormatException e) { - } - } - prependChild(GDBType.ARRAY, len); - } - } - } - - public static void main(String[] args) { - - GDBTypeParser parser = new GDBTypeParser(); - - System.out.println("struct link { int i; int j; struct link * next} *"); - parser.parse("struct link { int i; int j; struct link * next} *"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("char **argv"); - parser.parse("unsigned long long int **argv"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("int (*daytab)[13]"); - parser.parse("int (*daytab)[13]"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("int *daytab[13]"); - parser.parse("int *daytab[13]"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("void *comp()"); - parser.parse("void *comp()"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("void (*comp)()"); - parser.parse("void (*comp)()"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("int (*func[15])()"); - parser.parse("int (*func[15])()"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("char (*(*x())[])()"); - parser.parse("char (*(*x())[])()"); - System.out.println(parser.getGDBType().verbose()); - - System.out.println("char (*(*x[3])())[5]"); - parser.parse("char (*(*x[3])())[5]"); - System.out.println(parser.getGDBType().verbose()); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java deleted file mode 100644 index 7c6f976a631..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IGDBServerMILaunchConfigurationConstants.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * Monta Vista - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core; - - -public interface IGDBServerMILaunchConfigurationConstants extends IMILaunchConfigurationConstants { - - /** - * Launch configuration attribute key. The "remote target xxx" value. - */ - public static final String ATTR_REMOTE_TCP = MIPlugin.getUniqueIdentifier() + ".REMOTE_TCP"; //$NON-NLS-1$ - public static final String ATTR_HOST = MIPlugin.getUniqueIdentifier() + ".HOST"; //$NON-NLS-1$ - public static final String ATTR_PORT = MIPlugin.getUniqueIdentifier() + ".PORT"; //$NON-NLS-1$ - public static final String ATTR_DEV = MIPlugin.getUniqueIdentifier() + ".DEV"; //$NON-NLS-1$ - public static final String ATTR_DEV_SPEED = MIPlugin.getUniqueIdentifier() + ".DEV_SPEED"; //$NON-NLS-1$ -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMIConstants.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMIConstants.java deleted file mode 100644 index 46c559832d0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMIConstants.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core; - -/** - * - * Constant definitions for GDB MI plug-in. - * - * @since Oct 4, 2002 - */ -public interface IMIConstants -{ - /** - * MI plug-in identifier (value "org.eclipse.cdt.debug.mi"). - */ - public static final String PLUGIN_ID = MIPlugin.getDefault().getDescriptor().getUniqueIdentifier(); - - /** - * Preference key for default MI request timeout value. - */ - public static final String PREF_REQUEST_TIMEOUT = PLUGIN_ID + ".PREF_REQUEST_TIMEOUT"; //$NON-NLS-1$ - - /** - * Preference key for default MI launch request timeout value. - */ - public static final String PREF_REQUEST_LAUNCH_TIMEOUT = PLUGIN_ID + ".PREF_REQUEST_LAUNCH_TIMEOUT"; //$NON-NLS-1$ - - /** - * The default MI request timeout when no preference is set. - */ - public static final int DEF_REQUEST_LAUNCH_TIMEOUT = 30000; - - /** - * The default MI request timeout when no preference is set. - */ - public static final int DEF_REQUEST_TIMEOUT = 10000; - - /** - * The minimum value the MI request timeout can have. - */ - public static final int MIN_REQUEST_TIMEOUT = 100; - - /** - * The maximum value the MI request timeout can have. - */ - public static final int MAX_REQUEST_TIMEOUT = Integer.MAX_VALUE; -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java deleted file mode 100644 index 3eb9846e862..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/IMILaunchConfigurationConstants.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.cdt.debug.mi.core; - -/* - * (c) Copyright QNX Software System 2002. - * All Rights Reserved. - */ - - -public interface IMILaunchConfigurationConstants { - /** - * Launch configuration attribute key. The value is the name of - * the Debuger associated with a C/C++ launch configuration. - */ - public static final String ATTR_DEBUG_NAME = MIPlugin.getUniqueIdentifier() + ".DEBUG_NAME"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. Boolean value to set the gdb command file - * Debuger/gdb/MI property. - */ - public static final String ATTR_GDB_INIT = MIPlugin.getUniqueIdentifier() + ".GDB_INIT"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. Boolean value to set the 'automatically load shared library symbols' flag of the debugger. - */ - public static final String ATTR_DEBUGGER_AUTO_SOLIB = MIPlugin.getUniqueIdentifier() + ".AUTO_SOLIB"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. Boolean value to set the 'stop on shared library events' flag of the debugger. - */ - public static final String ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS = MIPlugin.getUniqueIdentifier() + ".STOP_ON_SOLIB_EVENTS"; //$NON-NLS-1$ - - /** - * Launch configuration attribute key. The value is a List (array of String) of directories for the search path of shared libraries. - */ - public static final String ATTR_DEBUGGER_SOLIB_PATH = MIPlugin.getUniqueIdentifier() + ".SOLIB_PATH"; //$NON-NLS-1$ - - /** - * Launch configuration attribute value. The key is ATTR_DEBUGGER_AUTO_SOLIB. - */ - public static boolean DEBUGGER_AUTO_SOLIB_DEFAULT = true; - - /** - * Launch configuration attribute value. The key is ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS. - */ - public static boolean DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT = false; -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java deleted file mode 100644 index 8a4557b4944..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core; - -/** - * - * A checked exception representing a failure. - * - */ -public class MIException extends Exception { - String log = ""; - - public MIException(String s) { - super(s); - } - - public MIException(String s, String l) { - super(s); - log = l; - } - - public String getLogMessage() { - return log; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIFormat.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIFormat.java deleted file mode 100644 index 13a49349952..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIFormat.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -/** - * Help class to specify formats. - */ -public final class MIFormat { - public final static int HEXADECIMAL = 0; - public final static int OCTAL = 1; - public final static int BINARY = 2; - public final static int DECIMAL = 3; - public final static int RAW = 4; - public final static int NATURAL = 5; - - public final static int FLOAT = 10; - public final static int ADDRESS = 11; - public final static int INSTRUCTION = 12; - public final static int CHAR = 13; - public final static int STRING = 14; - public final static int UNSIGNED = 15; - - // no instanciation. - private MIFormat() { - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java deleted file mode 100644 index 8ecb0b45c1c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; - -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIExecAbort; -import org.eclipse.cdt.debug.mi.core.command.MIGDBShowExitCode; -import org.eclipse.cdt.debug.mi.core.command.MIInfoProgram; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowExitCodeInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoProgramInfo; -import org.eclipse.cdt.utils.pty.PTY; -import org.eclipse.cdt.utils.spawner.Spawner; - -/** - */ -public class MIInferior extends Process { - - final static int SUSPENDED = 1; - final static int RUNNING = 2; - final static int TERMINATED = 4; - - boolean connected = false; - - int exitCode = 0; - int state = 0; - - MISession session; - - OutputStream out; - InputStream in; - - PipedOutputStream inPiped; - - PipedInputStream err; - PipedOutputStream errPiped; - PTY pty; - - int inferiorPid; - - MIInferior(MISession mi, PTY p) { - session = mi; - pty = p; - if (pty != null) { - out = pty.getOutputStream(); - in = pty.getInputStream(); - } - } - - /** - * @see java.lang.Process#getOutputStream() - */ - public OutputStream getOutputStream() { - if (out == null) { - out = new OutputStream() { - StringBuffer buf = new StringBuffer(); - public void write(int b) throws IOException { - if (!isRunning()) { - throw new IOException("target is suspended"); - } - OutputStream channel = session.getChannelOutputStream(); - if (channel == null) { - throw new IOException("No MI Session"); - } - channel.write(b); - } - }; - } - return out; - } - - /** - * @see java.lang.Process#getInputStream() - */ - public InputStream getInputStream() { - if (in == null) { - try { - inPiped = new PipedOutputStream(); - in = new PipedInputStream(inPiped); - } catch (IOException e) { - } - } - return in; - } - - /** - * @see java.lang.Process#getErrorStream() - */ - public InputStream getErrorStream() { - // FIXME: We do not have any err stream from gdb/mi - // so this gdb err channel instead. - if (err == null) { - try { - errPiped = new PipedOutputStream(); - err = new PipedInputStream(errPiped); - } catch (IOException e) { - } - } - return err; - } - - /** - * @see java.lang.Process#waitFor() - */ - public synchronized int waitFor() throws InterruptedException { - while (state != TERMINATED) { - wait(); - } - return exitValue(); - } - - /** - * @see java.lang.Process#exitValue() - */ - public int exitValue() { - if (isTerminated()) { - if (!session.isTerminated()) { - CommandFactory factory = session.getCommandFactory(); - MIGDBShowExitCode code = factory.createMIGDBShowExitCode(); - try { - session.postCommand(code); - MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo(); - exitCode = info.getCode(); - } catch (MIException e) { - // no rethrown. - } - } - return exitCode; - } - throw new IllegalThreadStateException(); - } - - /** - * @see java.lang.Process#destroy() - */ - public void destroy() { - try { - terminate(); - } catch (MIException e) { - // do nothing. - } - } - - public void terminate() throws MIException { - // An inferior will be destroy():interrupt and kill if - // - For attach session: - // the inferior was not disconnected yet (no need to try - // to kill a disconnected program). - // - For Program session: - // if the inferior was not terminated. - // - For PostMortem(Core): noop - if ((session.isAttachSession() && isConnected()) || (session.isProgramSession() && !isTerminated())) { - - CommandFactory factory = session.getCommandFactory(); - MIExecAbort abort = factory.createMIExecAbort(); - // Try to interrupt the inferior, first. - interrupt(); - session.postCommand(abort); - abort.getMIInfo(); - setTerminated(abort.getToken(), true); - } - } - - public synchronized void interrupt() throws MIException { - Process gdb = session.getGDBProcess(); - if (gdb instanceof Spawner) { - Spawner gdbSpawner = (Spawner) gdb; - gdbSpawner.interrupt(); - // Allow (5 secs) for the interrupt to propagate. - for (int i = 0;(state == RUNNING) && i < 5; i++) { - try { - wait(1000); - } catch (InterruptedException e) { - } - } - if ((state == RUNNING) && inferiorPid > 0) { - // lets try something else. - gdbSpawner.raise(inferiorPid, gdbSpawner.INT); - for (int i = 0;(state == RUNNING) && i < 5; i++) { - try { - wait(1000); - } catch (InterruptedException e) { - } - } - } - } else { - // Try the exec-interrupt; this will be for "gdb --async" - // CommandFactory factory = session.getCommandFactory(); - // MIExecInterrupt interrupt = factory.createMIExecInterrupt(); - // try { - // session.postCommand(interrupt); - // MIInfo info = interrupt.getMIInfo(); - // } catch (MIException e) { - // } - //throw new MIException("Interruption no supported"); - } - // If we've failed throw an exception up. - if (state == RUNNING) { - throw new MIException("Failed to interrupt"); - } - } - - public boolean isSuspended() { - return state == SUSPENDED; - } - - public boolean isRunning() { - return state == RUNNING; - } - - public boolean isTerminated() { - return state == TERMINATED; - } - - public boolean isConnected() { - return connected; - } - - public synchronized void setConnected() { - connected = true; - } - - public synchronized void setDisconnected() { - connected = false; - } - - public synchronized void setSuspended() { - state = SUSPENDED; - notifyAll(); - } - - public synchronized void setRunning() { - state = RUNNING; - notifyAll(); - } - - public synchronized void setTerminated() { - setTerminated(0, false); - } - - synchronized void setTerminated(int token, boolean fireEvent) { - state = TERMINATED; - // Close the streams. - try { - if (inPiped != null) { - inPiped.close(); - inPiped = null; - } - } catch (IOException e) { - //e.printStackTrace(); - } - try { - if (errPiped != null) { - errPiped.close(); - errPiped = null; - } - } catch (IOException e) { - //e.printStackTrace(); - } - - // If pty is not null then we are using a master/slave terminal - // emulation close the master to notify the slave. - if (pty != null) { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - //e.printStackTrace(); - } - in = null; - } - if (out != null) { - try { - out.close(); - } catch (IOException e) { - //e.printStackTrace(); - } - out = null; - } - } - if (fireEvent) { - session.fireEvent(new MIInferiorExitEvent(token)); - } - notifyAll(); - } - - public OutputStream getPipedOutputStream() { - return inPiped; - } - - public OutputStream getPipedErrorStream() { - return errPiped; - } - - public PTY getPTY() { - return pty; - } - - public void update() { - if (inferiorPid == 0) { - // Do not try this on attach session. - if (!isConnected()) { - // Try to discover the pid - CommandFactory factory = session.getCommandFactory(); - MIInfoProgram prog = factory.createMIInfoProgram(); - try { - session.postCommand(prog); - MIInfoProgramInfo info = prog.getMIInfoProgramInfo(); - inferiorPid = info.getPID(); - } catch (MIException e) { - // no rethrown. - } - } - // We fail permantely. - if (inferiorPid == 0) { - inferiorPid = -1; - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java deleted file mode 100644 index c2b458da05e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.Reader; -import java.text.MessageFormat; - -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.command.CLICommand; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MITargetAttach; -import org.eclipse.cdt.debug.mi.core.command.MITargetSelect; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.utils.pty.PTY; -import org.eclipse.cdt.utils.spawner.ProcessFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Preferences; - -/** - * GDB/MI Plugin. - */ -public class MIPlugin extends Plugin { - - /** - * The plug-in identifier of the Java core support - * (value "org.eclipse.jdt.core"). - */ - public static final String PLUGIN_ID = "org.eclipse.cdt.debug.mi.core" ; //$NON-NLS-1$ - - //The shared instance. - private static MIPlugin plugin; - - // GDB init command file - private static final String GDBINIT = ".gdbinit"; - - // GDB command - private static final String GDB = "gdb"; - - /** - * The constructor - * @see org.eclipse.core.runtime.Plugin#Plugin(IPluginDescriptor) - */ - public MIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - } - - /** - * Returns the singleton. - */ - public static MIPlugin getDefault() { - return plugin; - } - - /** - * Method createMISession. - * @param Process - * @param PTY - * @param int - * @param int - * @throws MIException - * @return MISession - */ - public MISession createMISession(Process process, PTY pty, int timeout, int type, int launchTimeout) throws MIException { - return new MISession(process, pty, timeout, type, launchTimeout); - } - - /** - * Method createMISession. - * @param Process - * @param PTY - * @param type - * @throws MIException - * @return MISession - */ - public MISession createMISession(Process process, PTY pty, int type) throws MIException { - MIPlugin plugin = getDefault(); - Preferences prefs = plugin.getPluginPreferences(); - int timeout = prefs.getInt(IMIConstants.PREF_REQUEST_TIMEOUT); - int launchTimeout = prefs.getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT); - return createMISession(process, pty, timeout, type, launchTimeout); - } - - /** - * Method createCSession. - * @param program - * @return ICDISession - * @throws MIException - */ - public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit) throws IOException, MIException { - PTY pty = null; - boolean failed = false; - - try { - pty = new PTY(); - } catch (IOException e) { - } - - try { - return createCSession(gdb, program, cwd, gdbinit, pty); - } catch (IOException exc) { - failed = true; - throw exc; - } catch (MIException exc) { - failed = true; - throw exc; - } finally { - if (failed) { - // Shutdown the pty console. - if (pty != null) { - try { - OutputStream out = pty.getOutputStream(); - if (out != null) { - out.close(); - } - InputStream in = pty.getInputStream(); - if (in != null) { - in.close(); - } - } catch (IOException e) { - } - } - } - } - } - - /** - * Method createCSession. - * @param program - * @return ICDISession - * @throws IOException - */ - public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit, PTY pty) throws IOException, MIException { - if (gdb == null || gdb.length() == 0) { - gdb = GDB; - } - - if (gdbinit == null || gdbinit.length() == 0) { - gdbinit = GDBINIT; - } - - String[] args; - if (pty != null) { - if (program == null) { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1"}; - } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program.getAbsolutePath()}; - } - } else { - if (program == null) { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1"}; - } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1", program.getAbsolutePath()}; - } - } - - Process pgdb = getGDBProcess(args); - - MISession session; - try { - session = createMISession(pgdb, pty, MISession.PROGRAM); - } catch (MIException e) { - pgdb.destroy(); - throw e; - } - // Try to detect if we have been attach via "target remote localhost:port" - // and set the state to be suspended. - try { - CLICommand cmd = new CLICommand("info remote-process"); - session.postCommand(cmd); - MIInfo info = cmd.getMIInfo(); - if (info == null) { - pgdb.destroy(); - throw new MIException("No answer"); - } - //@@@ We have to manually set the suspended state when we attach - session.getMIInferior().setSuspended(); - session.getMIInferior().update(); - } catch (MIException e) { - // If an exception is thrown that means ok - // we did not attach to any target. - } - return new Session(session, false); - } - - /** - * Method createCSession. - * @param program - * @param core - * @return ICDISession - * @throws IOException - */ - public ICDISession createCSession(String gdb, File program, File core, File cwd, String gdbinit) throws IOException, MIException { - if (gdb == null || gdb.length() == 0) { - gdb = GDB; - } - - if (gdbinit == null || gdbinit.length() == 0) { - gdbinit = GDBINIT; - } - - String[] args; - if (program == null) { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath()}; - } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath(), program.getAbsolutePath()}; - } - Process pgdb = getGDBProcess(args); - MISession session; - try { - session = createMISession(pgdb, null, MISession.CORE); - } catch (MIException e) { - pgdb.destroy(); - throw e; - } - return new Session(session); - } - - /** - * Method createCSession. - * @param program - * @param pid - * @return ICDISession - * @throws IOException - */ - public ICDISession createCSession(String gdb, File program, int pid, String[] targetParams, File cwd, String gdbinit) throws IOException, MIException { - if (gdb == null || gdb.length() == 0) { - gdb = GDB; - } - - if (gdbinit == null || gdbinit.length() == 0) { - gdbinit = GDBINIT; - } - - String[] args; - if (program == null) { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1"}; - } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", program.getAbsolutePath()}; - } - Process pgdb = getGDBProcess(args); - MISession session; - try { - session = createMISession(pgdb, null, MISession.ATTACH); - } catch (MIException e) { - pgdb.destroy(); - throw e; - } - CommandFactory factory = session.getCommandFactory(); - try { - if (targetParams != null && targetParams.length > 0) { - MITargetSelect target = factory.createMITargetSelect(targetParams); - session.postCommand(target); - MIInfo info = target.getMIInfo(); - if (info == null) { - throw new MIException("No answer"); - } - } - if (pid > 0) { - MITargetAttach attach = factory.createMITargetAttach(pid); - session.postCommand(attach); - MIInfo info = attach.getMIInfo(); - if (info == null) { - throw new MIException("No answer"); - } - } - } catch (MIException e) { - pgdb.destroy(); - throw e; - } - //@@@ We have to manually set the suspended state when we attach - session.getMIInferior().setSuspended(); - session.getMIInferior().update(); - return new Session(session, true); - } - - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return PLUGIN_ID; - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - public void debugLog(String message) { - if (getDefault().isDebugging()) { - // Time stamp - message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } ); - // This is to verbose for a log file, better use the console. - // getDefault().getLog().log(StatusUtil.newStatus(Status.ERROR, message, null)); - // ALERT:FIXME: For example for big buffers say 4k length, - // the console will simply blow taking down eclipse. - // This seems only to happen in Eclipse-gtk and Eclipse-motif - // on GNU/Linux, so it will be break in smaller chunks. - while (message.length() > 100) { - String partial = message.substring(0, 100); - message = message.substring(100); - System.err.println(partial + "\\"); - } - if (message.endsWith("\n")) { - System.err.print(message); - } else { - System.err.println(message); - } - } - } - - /** - * Do some basic synchronisation, gdb may take some time to load - * for whatever reasons. - * @param args - * @return Process - * @throws IOException - */ - protected Process getGDBProcess(String[] args) throws IOException { - if ( getDefault().isDebugging() ) - { - StringBuffer sb = new StringBuffer(); - for ( int i = 0; i < args.length; ++i ) - { - sb.append( args[i] ); - sb.append( ' ' ); - } - getDefault().debugLog( sb.toString() ); - } - final Process pgdb = ProcessFactory.getFactory().exec(args); - Thread syncStartup = new Thread("GDB Start") { - public void run() { - try { - String line; - InputStream stream = pgdb.getInputStream(); - Reader r = new InputStreamReader(stream); - BufferedReader reader = new BufferedReader(r); - while ((line = reader.readLine()) != null) { - line = line.trim(); - //System.out.println("GDB " + line); - if (line.startsWith("(gdb)")) { - break; - } - } - } catch (Exception e) { - // Do nothing - } - synchronized (pgdb) { - pgdb.notifyAll(); - } - } - }; - syncStartup.start(); - - synchronized (pgdb) { - MIPlugin plugin = getDefault(); - Preferences prefs = plugin.getPluginPreferences(); - int launchTimeout = prefs.getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT); - while (syncStartup.isAlive()) { - try { - pgdb.wait(launchTimeout); - break; - } catch (InterruptedException e) { - } - } - } - try { - syncStartup.interrupt(); - syncStartup.join(1000); - } catch (InterruptedException e) { - } - return pgdb; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#startup() - */ - public void startup() throws CoreException { - super.startup(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPrefrences() - */ - protected void initializeDefaultPluginPreferences() { - getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_TIMEOUT, IMIConstants.DEF_REQUEST_TIMEOUT); - getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#shutdown() - */ - public void shutdown() throws CoreException { - savePluginPreferences(); - super.shutdown(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java deleted file mode 100644 index fa9af09a30b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MISession.java +++ /dev/null @@ -1,539 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.util.Observable; - -import org.eclipse.cdt.debug.mi.core.command.Command; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIGDBExit; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSet; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIGDBExitEvent; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIParser; -import org.eclipse.cdt.utils.pty.PTY; - -/** - * Represents a GDB/MI session. - * Note that on GNU/Linux the target stream is not - * preceded by the token '@' until this is fix, on GNU/Linux - * there a good change to confuse the parser. - */ -public class MISession extends Observable { - - /** - * Normal program debuging. - */ - public final static int PROGRAM = 0; - /** - * Attach to a running process debuging. - */ - public final static int ATTACH = 1; - /** - * PostMortem analysis. - */ - public final static int CORE = 2; - - boolean terminated; - - // hold the type of the session(post-mortem, attach etc ..) - int sessionType; - - Process sessionProcess; - Process gdbProcess; - InputStream inChannel; - OutputStream outChannel; - - TxThread txThread; - RxThread rxThread; - EventThread eventThread; - - CommandQueue txQueue; - CommandQueue rxQueue; - Queue eventQueue; - - PipedInputStream miInConsolePipe; - PipedOutputStream miOutConsolePipe; - PipedInputStream miInLogPipe; - PipedOutputStream miOutLogPipe; - - - CommandFactory factory; - - MIParser parser; - - long cmdTimeout; - - MIInferior inferior; - - /** - * Create the gdb session. - * - * @param Process gdb Process. - * @param pty Terminal to use for the inferior. - * @param timeout time in milliseconds to wait for command response. - * @param type the type of debugin session. - */ - public MISession(Process process, PTY pty, int timeout, int type, int launchTimeout) throws MIException { - - gdbProcess = process; - inChannel = process.getInputStream(); - outChannel = process.getOutputStream(); - - cmdTimeout = timeout; - - sessionType = type; - - factory = new CommandFactory(); - - parser = new MIParser(); - - inferior = new MIInferior(this, pty); - - txQueue = new CommandQueue(); - rxQueue = new CommandQueue(); - eventQueue = new Queue(); - - // The Process may have terminated earlier because - // of bad arguments etc .. check this here and bail out. - try { - process.exitValue(); - InputStream err = process.getErrorStream(); - BufferedReader reader = new BufferedReader(new InputStreamReader(err)); - String line = null; - try { - line = reader.readLine(); - reader.close(); - } catch (Exception e) { - // the reader may throw a NPE. - } - if (line == null) { - line = "Process Terminated"; - } - throw new MIException(line); - } catch (IllegalThreadStateException e) { - // Ok, it means the process is alive. - } - - txThread = new TxThread(this); - rxThread = new RxThread(this); - eventThread = new EventThread(this); - - txThread.start(); - rxThread.start(); - eventThread.start(); - - // Disable a certain number of irritations from gdb. - // Like confirmation and screen size. - - try { - MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"}); - postCommand(confirm, launchTimeout); - confirm.getMIInfo(); - - MIGDBSet width = new MIGDBSet(new String[]{"width", "0"}); - postCommand(width, launchTimeout); - confirm.getMIInfo(); - - MIGDBSet height = new MIGDBSet(new String[]{"height", "0"}); - postCommand(height, launchTimeout); - confirm.getMIInfo(); - - } catch (MIException exc) { - // Kill the Transmition thread. - if (txThread.isAlive()) { - txThread.interrupt(); - } - // Kill the Receiving Thread. - if (rxThread.isAlive()) { - rxThread.interrupt(); - } - // Kill the event Thread. - if (eventThread.isAlive()) { - eventThread.interrupt(); - } - // rethrow up the exception. - throw exc; - } - } - - /** - * get MI Console Stream. - * The parser will make available the MI console stream output. - */ - public InputStream getMIConsoleStream() { - if (miInConsolePipe == null) { - try { - miOutConsolePipe = new PipedOutputStream(); - miInConsolePipe = new PipedInputStream(miOutConsolePipe); - } catch (IOException e) { - } - } - return miInConsolePipe; - } - - /** - * get MI Console Stream. - * The parser will make available the MI console stream output. - */ - public InputStream getMILogStream() { - if (miInLogPipe == null) { - try { - miOutLogPipe = new PipedOutputStream(); - miInLogPipe = new PipedInputStream(miOutLogPipe); - } catch (IOException e) { - } - } - return miInLogPipe; - } - - /** - * For example the CDI/MI bridge uses the command - * factory to create MI commands this allow overloading. - */ - public CommandFactory getCommandFactory() { - return factory; - } - - /** - * Set a new factory to use for command. - */ - public void setCommandFactory(CommandFactory f) { - factory = f; - } - - /** - * Return the MI parser. - */ - public MIParser getMIParser() { - return parser; - } - - /** - * Reset the MI parser. - */ - public void setMIParser(MIParser p) { - parser = p; - } - - /** - * Set the type of session this is. - * Certain action will base on that, for example - * the inferior will not try to kill/destroy a - * attach session disconnected. - */ - public int getSessionType() { - return sessionType; - } - - public void setSessionType(int type) { - sessionType = type; - } - - /** - * The debug session is a program being debug. - */ - public boolean isProgramSession() { - return sessionType == PROGRAM; - } - - /** - * The debug session is a program being attach to. - */ - public boolean isAttachSession() { - return sessionType == ATTACH; - } - - /** - * The debug session is a core being analysed. - */ - public boolean isCoreSession() { - return sessionType == CORE; - } - - /** - * Reset the default Command Timeout. - */ - public void setCommandTimeout(long timeout) { - cmdTimeout = timeout; - } - - /** - * Return the default Command Timeout, default 10 secs. - */ - public long getCommandTimeout() { - return cmdTimeout; - } - - /** - * equivalent to: - * postCommand(cmd, cmdTimeout) - */ - public void postCommand(Command cmd) throws MIException { - postCommand(cmd, cmdTimeout); - } - - /** - * Sends a command to gdb, and wait(timeout) for a response. - */ - public synchronized void postCommand(Command cmd, long timeout) throws MIException { - - // Test if we are in a sane state. - if (!txThread.isAlive() || !rxThread.isAlive()) { - throw new MIException("{R,T}xThread terminated"); - } - - // Test if we are in the right state? - if (inferior.isRunning()) { - // REMINDER: if we support -exec-interrupt - // Let it throught: - // if (cmd instanceof MIExecInterrupt) { } - // else - throw new MIException("Target is not suspended"); - } - - if (isTerminated()) { - throw new MIException("Session terminated"); - } - - // TRACING: print the command; - MIPlugin.getDefault().debugLog(cmd.toString()); - - txQueue.addCommand(cmd); - - // Wait for the response or timedout - synchronized (cmd) { - // RxThread will set the MIOutput on the cmd - // when the response arrive. - while (cmd.getMIOutput() == null) { - try { - cmd.wait(timeout); - if (cmd.getMIOutput() == null) { - throw new MIException("Target is not responding (timed out)"); - } - } catch (InterruptedException e) { - } - } - } - } - - /** - * Return the inferior "Process". - */ - public MIInferior getMIInferior() { - return inferior; - } - - /** - * Return the "gdb" Process. - */ - public Process getGDBProcess() { - return gdbProcess; - } - - /** - * Return a "fake" Process that will - * encapsulate the call input/output of gdb. - */ - public Process getSessionProcess() { - if (sessionProcess == null) { - sessionProcess = new SessionProcess(this); - } - return sessionProcess; - } - - /** - * Check if the gdb session is terminated. - */ - public boolean isTerminated() { - return terminated; - } - - /** - * Terminate the MISession. - */ - public void terminate() { - - // Sanity check. - if (isTerminated()) { - return; - } - - terminated = true; - - // Destroy any MI Inferior(Process) and streams. - inferior.destroy(); - - // {in,out}Channel is use as predicate/condition - // in the {RX,TX,Event}Thread to detect termination - // and bail out. So they are set to null. - InputStream inGDB = inChannel; - inChannel = null; - OutputStream outGDB = outChannel; - outChannel = null; - - // Although we will close the pipe(). It is cleaner - // to give a chance to gdb to cleanup. - // send the exit(-gdb-exit). - MIGDBExit exit = factory.createMIGDBExit(); - txQueue.addCommand(exit); - - // Wait for the response - synchronized (exit) { - // RxThread will set the MIOutput on the cmd - // when the response arrive. - try { - exit.wait(2000); - } catch (InterruptedException e) { - } - } - - // Make sure gdb is killed. - // FIX: the destroy() must be call before closing gdb streams - // on windows if the order is not follow the close() will hang. - if (gdbProcess != null) { - gdbProcess.destroy(); - } - - // Close the input GDB prompt - try { - if (inGDB != null) - inGDB.close(); - } catch (IOException e) { - } - - // Close the output GDB prompt - try { - if (outGDB != null) - outGDB.close(); - } catch (IOException e) { - } - - // Destroy the MI console stream. - try { - miInConsolePipe = null; - if (miOutConsolePipe != null) { - miOutConsolePipe.close(); - } - } catch (IOException e) { - } - - // Destroy the MI log stream. - try { - miInLogPipe = null; - if (miOutLogPipe != null) { - miOutLogPipe.close(); - } - } catch (IOException e) { - } - - // Kill the Transmition thread. - try { - if (txThread.isAlive()) { - txThread.interrupt(); - txThread.join(cmdTimeout); - } - } catch (InterruptedException e) { - } - - // Kill the Receiving Thread. - try { - if (rxThread.isAlive()) { - rxThread.interrupt(); - rxThread.join(cmdTimeout); - } - } catch (InterruptedException e) { - } - - // Allow (10 secs) for the EventThread to finish processing the queue. - Queue queue = getEventQueue(); - for (int i = 0; !queue.isEmpty() && i < 5; i++) { - try { - java.lang.Thread.sleep(2000); - } catch (InterruptedException e) { - } - } - - // Kill the event Thread. - try { - if (eventThread.isAlive()) { - eventThread.interrupt(); - eventThread.join(cmdTimeout); - } - } catch (InterruptedException e) { - } - - // Tell the observers that the session is terminated - notifyObservers(new MIGDBExitEvent(0)); - } - - /** - * Notify the observers of new MI OOB events. - */ - public void notifyObservers(Object arg) { - setChanged(); - super.notifyObservers(arg); - } - - - OutputStream getConsolePipe() { - return miOutConsolePipe; - } - - OutputStream getLogPipe() { - return miOutLogPipe; - } - - CommandQueue getTxQueue() { - return txQueue; - } - - CommandQueue getRxQueue() { - return rxQueue; - } - - Queue getEventQueue() { - return eventQueue; - } - - RxThread getRxThread() { - return rxThread; - } - - InputStream getChannelInputStream() { - return inChannel; - } - - OutputStream getChannelOutputStream() { - return outChannel; - } - - MIOutput parse(String buffer) { - return parser.parse(buffer); - } - - public void fireEvents(MIEvent[] events) { - if (events != null && events.length > 0) { - for (int i = 0; i < events.length; i++) { - fireEvent(events[i]); - } - } - } - - public void fireEvent(MIEvent event) { - if (event != null) { - getEventQueue().addItem(event); - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/Queue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/Queue.java deleted file mode 100644 index 6f1cb81d2e7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/Queue.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -/** - * Simple thread-safe Queue implemetation. - */ -public class Queue { - - protected List list; - - public Queue() { - list = Collections.synchronizedList(new LinkedList()); - } - - public Object removeItem() throws InterruptedException { - //print("in removeItem() - entering"); - synchronized (list) { - while (list.isEmpty()) { - //print("in removeItem() - about to wait()"); - list.wait(); - //print("in removeItem() - done with wait()"); - } - - // extract the new first cmd - Object item = list.remove(0); - - //print("in removeItem() - leaving"); - return item; - } - } - - public void addItem(Object item) { - //print("in addItem() - entering"); - synchronized (list) { - // There will always be room to add to this List - // because it expands as needed. - list.add(item); - //print("in addItem - just added: '" + cmd + "'"); - - // After adding, notify any and all waiting - // threads that the list has changed. - list.notifyAll(); - //print("in addItem() - just notified"); - } - //print("in addItem() - leaving"); - } - - public Object[] clearItems() { - Object[] array; - synchronized (list) { - array = list.toArray(); - list.clear(); - } - return array; - } - - public boolean isEmpty() { - boolean empty; - synchronized (list) { - empty = list.isEmpty(); - } - return empty; - } - -// private static void print(String msg) { -// String name = Thread.currentThread().getName(); -// System.out.println(name + ": " + msg); -// } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java deleted file mode 100644 index 93bac3fb00f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.mi.core.command.Command; -import org.eclipse.cdt.debug.mi.core.command.MIExecContinue; -import org.eclipse.cdt.debug.mi.core.command.MIExecFinish; -import org.eclipse.cdt.debug.mi.core.command.MIExecNext; -import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction; -import org.eclipse.cdt.debug.mi.core.command.MIExecReturn; -import org.eclipse.cdt.debug.mi.core.command.MIExecStep; -import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction; -import org.eclipse.cdt.debug.mi.core.command.MIExecUntil; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorSignalExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MILocationReachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalEvent; -import org.eclipse.cdt.debug.mi.core.event.MISteppingRangeEvent; -import org.eclipse.cdt.debug.mi.core.event.MIStoppedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointScopeEvent; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointTriggerEvent; -import org.eclipse.cdt.debug.mi.core.output.MIAsyncRecord; -import org.eclipse.cdt.debug.mi.core.output.MIConsoleStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MINotifyAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIStatusAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; -import org.eclipse.cdt.debug.mi.core.output.MITargetStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * Receiving thread of gdb response output. - */ -public class RxThread extends Thread { - - final MISession session; - List oobList; - - public RxThread(MISession s) { - super("MI RX Thread"); - session = s; - oobList = new ArrayList(); - } - - /* - * Get the response, parse the output, dispatch for OOB - * search for the corresponding token in rxQueue for the ResultRecord. - */ - public void run() { - BufferedReader reader = new BufferedReader(new InputStreamReader(session.getChannelInputStream())); - try { - String line; - while ((line = reader.readLine()) != null) { - // TRACING: print the output. - MIPlugin.getDefault().debugLog(line); - processMIOutput(line + "\n"); - } - } catch (IOException e) { - //e.printStackTrace(); - } - // This code should be executed when gdb been abruptly - // or unxepectedly killed. This is detected by checking - // if the channelInputStream is not null. In normal case - // session.terminate() will set the channelInputStream to null. - if (session.getChannelInputStream() != null) { - Runnable cleanup = new Runnable() { - public void run() { - // Change the state of the inferior. - session.getMIInferior().setTerminated(); - session.terminate(); - } - }; - Thread clean = new Thread(cleanup, "GDB Died"); - clean.setDaemon(true); - clean.start(); - } - // Clear the queue and notify any command waiting, we are going down. - CommandQueue rxQueue = session.getRxQueue(); - if (rxQueue != null) { - Command[] cmds = rxQueue.clearCommands(); - for (int i = 0; i < cmds.length; i++) { - synchronized (cmds[i]) { - cmds[i].notifyAll(); - } - } - } - } - - /** - * Search for the command in the RxQueue, set the MIOutput - * and notify() the other end. - * Any OOBs are consider like event and dipatch to the - * listeners/observers in different thread. - */ - void processMIOutput(String buffer) { - MIOutput response = session.parse(buffer); - if (response != null) { - List list = new ArrayList(); - CommandQueue rxQueue = session.getRxQueue(); - - // Notify any command waiting for a ResultRecord. - MIResultRecord rr = response.getMIResultRecord(); - if (rr != null) { - int id = rr.getToken(); - Command cmd = rxQueue.removeCommand(id); - - // Clear the accumulate oobList on each new Result Command - // response. - MIOOBRecord[] oobRecords = (MIOOBRecord[]) oobList.toArray(new MIOOBRecord[0]); - oobList.clear(); - - // Check if the state changed. - String state = rr.getResultClass(); - if ("running".equals(state)) { - int type = 0; - // Check the type of command - // if it was a step instruction set state stepping - if (cmd instanceof MIExecNext) { - type = MIRunningEvent.NEXT; - } else if (cmd instanceof MIExecNextInstruction) { - type = MIRunningEvent.NEXTI; - } else if (cmd instanceof MIExecStep) { - type = MIRunningEvent.STEP; - } else if (cmd instanceof MIExecStepInstruction) { - type = MIRunningEvent.STEPI; - } else if (cmd instanceof MIExecUntil) { - type = MIRunningEvent.UNTIL; - } else if (cmd instanceof MIExecFinish) { - type = MIRunningEvent.FINISH; - } else if (cmd instanceof MIExecReturn) { - type = MIRunningEvent.RETURN; - } else if (cmd instanceof MIExecContinue) { - type = MIRunningEvent.CONTINUE; - } else { - type = MIRunningEvent.CONTINUE; - } - session.getMIInferior().setRunning(); - MIEvent event = new MIRunningEvent(id, type); - session.fireEvent(event); - } else if ("exit".equals(state)) { - // No need to do anything, terminate() will. - session.getMIInferior().setTerminated(); - } else if ("connected".equals(state)) { - session.getMIInferior().setConnected(); - } else if ("error".equals(state)) { - if (session.getMIInferior().isRunning()) { - session.getMIInferior().setSuspended(); - MIEvent event = new MIErrorEvent(rr, oobRecords); - session.fireEvent(event); - } - } - - // Notify the waiting command. - if (cmd != null) { - synchronized (cmd) { - // Set the accumulate console Stream - response.setMIOOBRecords(oobRecords); - cmd.setMIOutput(response); - cmd.notifyAll(); - } - } - // Some result record contains informaton specific to oob. - // This will happen when CLI-Command is use, for example - // doing "run" will block and return a breakpointhit - processMIOOBRecord(rr, list); - - } else { - - // Process OOBs - MIOOBRecord[] oobs = response.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - processMIOOBRecord(oobs[i], list); - } - } - - MIEvent[] events = (MIEvent[]) list.toArray(new MIEvent[list.size()]); - session.fireEvents(events); - } // if response != null - } - - /** - * Dispatch a thread to deal with the listeners. - */ - void processMIOOBRecord(MIOOBRecord oob, List list) { - if (oob instanceof MIAsyncRecord) { - processMIOOBRecord((MIAsyncRecord) oob, list); - oobList.clear(); - } else if (oob instanceof MIStreamRecord) { - processMIOOBRecord((MIStreamRecord) oob); - } - } - - void processMIOOBRecord(MIAsyncRecord async, List list) { - if (async instanceof MIExecAsyncOutput) { - MIExecAsyncOutput exec = (MIExecAsyncOutput) async; - // Change of state. - String state = exec.getAsyncClass(); - if ("stopped".equals(state)) { - MIEvent e = null; - MIResult[] results = exec.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue val = results[i].getMIValue(); - if (var.equals("reason")) { - if (val instanceof MIConst) { - String reason = ((MIConst) val).getString(); - e = createEvent(reason, exec); - if (e != null) { - list.add(e); - } - } - } - } - - // GDB does not have reason when stopping on shared, hopefully - // this will be fix in newer version meanwhile, we will use a hack - // to cope. On most platform we can detect by looking at the - // console stream for phrase: - // ~"Stopped due to shared library event\n" - // - // Althought it is a _real_ bad idea to do this, we do not have - // any other alternatives. - String[] logs = getStreamRecords(); - for (int i = 0; i < logs.length; i++) { - if (logs[i].equalsIgnoreCase("Stopped due to shared library event")) { - session.getMIInferior().setSuspended(); - e = new MISharedLibEvent(exec); - list.add(e); - } - } - - // We were stopped for some unknown reason, for example - // GDB for temporary breakpoints will not send the - // "reason" ??? still fire a stopped event. - if (e == null) { - session.getMIInferior().setSuspended(); - e = new MIStoppedEvent(exec); - list.add(e); - } - } - } else if (async instanceof MIStatusAsyncOutput) { - // Nothing done .. but what about +download?? - } else if (async instanceof MINotifyAsyncOutput) { - // Nothing - } - } - - void processMIOOBRecord(MIStreamRecord stream) { - if (stream instanceof MIConsoleStreamOutput) { - OutputStream console = session.getConsolePipe(); - if (console != null) { - MIConsoleStreamOutput out = (MIConsoleStreamOutput) stream; - String str = out.getString(); - if (str != null) { - try { - console.write(str.getBytes()); - console.flush(); - } catch (IOException e) { - } - } - } - // Accumulate the Console Stream Output response for parsing. - // Some commands will put valuable info in the Console Stream. - oobList.add(stream); - } else if (stream instanceof MITargetStreamOutput) { - OutputStream target = session.getMIInferior().getPipedOutputStream(); - if (target != null) { - MITargetStreamOutput out = (MITargetStreamOutput) stream; - String str = out.getString(); - if (str != null) { - try { - target.write(str.getBytes()); - target.flush(); - } catch (IOException e) { - } - } - } - } else if (stream instanceof MILogStreamOutput) { - // This is meant for the gdb console. - OutputStream log = session.getLogPipe(); - if (log != null) { - MILogStreamOutput out = (MILogStreamOutput) stream; - String str = out.getString(); - if (str != null) { - try { - log.write(str.getBytes()); - log.flush(); - } catch (IOException e) { - } - } - } - // Accumulate the Log Stream Output response for parsing. - // Some commands will put valuable info in the Log Stream. - oobList.add(stream); - } - } - - /** - * Dispatch a thread to deal with the listeners. - */ - void processMIOOBRecord(MIResultRecord rr, List list) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("reason")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String reason = ((MIConst) value).getString(); - MIEvent event = createEvent(reason, rr); - if (event != null) { - list.add(event); - } - } - } - } - } - - MIEvent createEvent(String reason, MIExecAsyncOutput exec) { - return createEvent(reason, null, exec); - } - - MIEvent createEvent(String reason, MIResultRecord rr) { - return createEvent(reason, rr, null); - } - - MIEvent createEvent(String reason, MIResultRecord rr, MIExecAsyncOutput exec) { - MIEvent event = null; - if ("breakpoint-hit".equals(reason)) { - if (exec != null) { - event = new MIBreakpointHitEvent(exec); - } else if (rr != null) { - event = new MIBreakpointHitEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ( - "watchpoint-trigger".equals(reason) - || "read-watchpoint-trigger".equals(reason) - || "access-watchpoint-trigger".equals(reason)) { - if (exec != null) { - event = new MIWatchpointTriggerEvent(exec); - } else if (rr != null) { - event = new MIWatchpointTriggerEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ("watchpoint-scope".equals(reason)) { - if (exec != null) { - event = new MIWatchpointScopeEvent(exec); - } else if (rr != null) { - event = new MIWatchpointScopeEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ("end-stepping-range".equals(reason)) { - if (exec != null) { - event = new MISteppingRangeEvent(exec); - } else if (rr != null) { - event = new MISteppingRangeEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ("signal-received".equals(reason)) { - if (exec != null) { - event = new MISignalEvent(exec); - } else if (rr != null) { - event = new MISignalEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ("location-reached".equals(reason)) { - if (exec != null) { - event = new MILocationReachedEvent(exec); - } else if (rr != null) { - event = new MILocationReachedEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ("function-finished".equals(reason)) { - if (exec != null) { - event = new MIFunctionFinishedEvent(exec); - } else if (rr != null) { - event = new MIFunctionFinishedEvent(rr); - } - session.getMIInferior().setSuspended(); - } else if ("exited-normally".equals(reason) || "exited".equals(reason)) { - if (exec != null) { - event = new MIInferiorExitEvent(exec); - } else if (rr != null) { - event = new MIInferiorExitEvent(rr); - } - session.getMIInferior().setTerminated(); - } else if ("exited-signalled".equals(reason)) { - if (exec != null) { - event = new MIInferiorSignalExitEvent(exec); - } else if (rr != null) { - event = new MIInferiorSignalExitEvent(rr); - } - session.getMIInferior().setTerminated(); - } - return event; - } - - String[] getStreamRecords() { - List streamRecords = new ArrayList(); - MIOOBRecord[] oobRecords = (MIOOBRecord[]) oobList.toArray(new MIOOBRecord[0]); - for (int i = 0; i < oobRecords.length; i++) { - if (oobRecords[i] instanceof MIStreamRecord) { - String s = ((MIStreamRecord) oobRecords[i]).getString().trim(); - if (s != null && s.length() > 0) { - streamRecords.add(s); - } - } - } - return (String[]) streamRecords.toArray(new String[0]); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/SessionProcess.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/SessionProcess.java deleted file mode 100644 index 1c675c5afca..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/SessionProcess.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import org.eclipse.cdt.debug.mi.core.command.CLICommand; - -/** - */ -public class SessionProcess extends Process { - - MISession session; - OutputStream out; - - public SessionProcess(MISession s) { - session = s; - } - - /** - * @see java.lang.Process#destroy() - */ - public void destroy() { - session.getGDBProcess().destroy(); - } - - /** - * @see java.lang.Process#exitValue() - */ - public int exitValue() { - return session.getGDBProcess().exitValue(); - } - - /** - * @see java.lang.Process#getErrorStream() - */ - public InputStream getErrorStream() { - return session.getMILogStream(); - } - - /** - * @see java.lang.Process#getInputStream() - */ - public InputStream getInputStream() { - return session.getMIConsoleStream(); - } - - /** - * @see java.lang.Process#getOutputStream() - */ - public OutputStream getOutputStream() { - if (out == null) { - out = new OutputStream() { - StringBuffer buf = new StringBuffer(); - public void write(int b) throws IOException { - buf.append((char)b); - if (b == '\n') { - post(); - } - } - - // Encapsulate the string sent to gdb in a fake - // command and post it to the TxThread. - public void post() throws IOException { - // Throw away the newline. - String str = buf.toString().trim(); - CLICommand cmd = new CLICommand(str); - buf.setLength(0); - try { - session.postCommand(cmd); - } catch (MIException e) { - //e.printStackTrace(); - throw new IOException(e.getMessage()); - } - } - }; - } - return out; - } - - /** - * @see java.lang.Process#waitFor() - */ - public int waitFor() throws InterruptedException { - return session.getGDBProcess().waitFor(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java deleted file mode 100644 index eaad1eb1fa8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/TxThread.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core; - -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.cdt.debug.mi.core.command.CLICommand; -import org.eclipse.cdt.debug.mi.core.command.Command; - -/** - * Transmission command thread blocks on the command Queue - * and wake cmd are available and push them to gdb out channel. - */ -public class TxThread extends Thread { - - MISession session; - CLIProcessor cli; - - public TxThread(MISession s) { - super("MI TX Thread"); - session = s; - cli = new CLIProcessor(session); - } - - public void run () { - try { - // signal by the session of time to die. - OutputStream out; - while ((out = session.getChannelOutputStream()) != null) { - Command cmd = null; - CommandQueue txQueue = session.getTxQueue(); - // removeCommand() will block until a command is available. - try { - cmd = txQueue.removeCommand(); - } catch (InterruptedException e) { - //e.printStackTrace(); - } - - if (cmd != null) { - // Move to the RxQueue only if RxThread is alive. - Thread rx = session.getRxThread(); - if (rx != null && rx.isAlive()) { - CommandQueue rxQueue = session.getRxQueue(); - rxQueue.addCommand(cmd); - } else { - synchronized (cmd) { - cmd.notifyAll(); - } - } - - // May need to fire event. - if (cmd instanceof CLICommand) { - cli.process((CLICommand)cmd); - } - - // shove in the pipe - String str = cmd.toString(); - if (out != null) { - out.write(str.getBytes()); - out.flush(); - } - } - } - } catch (IOException e) { - //e.printStackTrace(); - } - - // Clear the queue and notify any command waiting, we are going down. - CommandQueue txQueue = session.getTxQueue(); - if (txQueue != null) { - Command[] cmds = txQueue.clearCommands(); - for (int i = 0; i < cmds.length; i++) { - synchronized (cmds[i]) { - cmds[i].notifyAll(); - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointHit.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointHit.java deleted file mode 100644 index 5b792c28f24..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointHit.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent; - -/** - */ -public class BreakpointHit extends SessionObject implements ICDIBreakpointHit { - - MIBreakpointHitEvent breakEvent; - - public BreakpointHit(Session session, MIBreakpointHitEvent e) { - super(session); - breakEvent = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit#getBreakpoint() - */ - public ICDIBreakpoint getBreakpoint() { - int number = breakEvent.getNumber(); - // Ask the breakpointManager for the breakpoint - BreakpointManager mgr = (BreakpointManager)getSession().getBreakpointManager(); - // We need to return the same object as the breakpoint. - Breakpoint point = mgr.getBreakpoint(number); - // FIXME: if point == null ?? Create a new breakpoint ?? - return point; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java deleted file mode 100644 index 5b531d9e522..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ /dev/null @@ -1,560 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent; -import org.eclipse.cdt.debug.core.cdi.ICDICondition; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint; -import org.eclipse.cdt.debug.mi.core.cdi.model.Target; -import org.eclipse.cdt.debug.mi.core.cdi.model.Watchpoint; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIBreakAfter; -import org.eclipse.cdt.debug.mi.core.command.MIBreakCondition; -import org.eclipse.cdt.debug.mi.core.command.MIBreakDelete; -import org.eclipse.cdt.debug.mi.core.command.MIBreakDisable; -import org.eclipse.cdt.debug.mi.core.command.MIBreakEnable; -import org.eclipse.cdt.debug.mi.core.command.MIBreakInsert; -import org.eclipse.cdt.debug.mi.core.command.MIBreakList; -import org.eclipse.cdt.debug.mi.core.command.MIBreakWatch; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointDeletedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.output.MIBreakInsertInfo; -import org.eclipse.cdt.debug.mi.core.output.MIBreakListInfo; -import org.eclipse.cdt.debug.mi.core.output.MIBreakWatchInfo; -import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; - -/** - * Breakpoint Manager for the CDI interface. - */ -public class BreakpointManager extends SessionObject implements ICDIBreakpointManager { - - List breakList; - List deferredList; - boolean allowInterrupt; - boolean autoupdate; - - public BreakpointManager(Session session) { - super(session); - breakList = Collections.synchronizedList(new ArrayList()); - deferredList = Collections.synchronizedList(new ArrayList()); - allowInterrupt = true; - autoupdate = false; - } - - public MIBreakpoint[] getMIBreakpoints() throws CDIException { - Session s = (Session)getSession(); - CommandFactory factory = s.getMISession().getCommandFactory(); - MIBreakList breakpointList = factory.createMIBreakList(); - try { - s.getMISession().postCommand(breakpointList); - MIBreakListInfo info = breakpointList.getMIBreakListInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - return info.getMIBreakpoints(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - boolean hasBreakpointChanged(Breakpoint point, MIBreakpoint miBreakpoint) { - MIBreakpoint miBreak = point.getMIBreakpoint(); - return miBreak.isEnabled() != miBreakpoint.isEnabled() || - !miBreak.getCondition().equals(miBreakpoint.getCondition()) || - miBreak.getIgnoreCount() != miBreakpoint.getIgnoreCount(); - } - - public Breakpoint getBreakpoint(int number) { - Breakpoint[] bkpts = (Breakpoint[]) breakList.toArray(new Breakpoint[0]); - for (int i = 0; i < bkpts.length; i++) { - MIBreakpoint miBreak = bkpts[i].getMIBreakpoint(); - if (miBreak.getNumber() == number) { - return bkpts[i]; - } - } - return null; - } - - public Watchpoint getWatchpoint(int number) { - return (Watchpoint)getBreakpoint(number); - } - - boolean suspendInferior(ICDITarget target) throws CDIException { - boolean shouldRestart = false; - // Stop the program - if (allowInterrupt) { - if (target instanceof Target) { - Target ctarget = (Target)target; - // Disable events. - if (ctarget.isRunning()) { - ctarget.suspend(); - shouldRestart = true; - } - } else if (!target.isSuspended()) { - target.suspend(); - shouldRestart = true; - } - } - return shouldRestart; - } - - void resumeInferior(ICDITarget target, boolean shouldRestart) throws CDIException { - if (shouldRestart) { - target.resume(); - } - } - - public void deleteBreakpoint (int no) { - Breakpoint[] points = (Breakpoint[]) breakList.toArray(new Breakpoint[0]); - for (int i = 0; i < points.length; i++) { - if (points[i].getMIBreakpoint().getNumber() == no) { - breakList.remove(points[i]); - break; - } - } - } - - public void enableBreakpoint(ICDIBreakpoint breakpoint) throws CDIException { - int number = 0; - if (breakpoint instanceof Breakpoint - && breakList.contains(breakpoint)) { - number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber(); - } else { - throw new CDIException("Not a CDT breakpoint"); - } - boolean state = suspendInferior(breakpoint.getTarget()); - Session session = (Session)getSession(); - CommandFactory factory = session.getMISession().getCommandFactory(); - MIBreakEnable breakEnable = factory.createMIBreakEnable(new int[] { number }); - try { - session.getMISession().postCommand(breakEnable); - MIInfo info = breakEnable.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - // Resume the program and enable events. - resumeInferior(breakpoint.getTarget(), state); - } - ((Breakpoint) breakpoint).getMIBreakpoint().setEnabled(true); - // Fire a changed Event. - MISession mi = session.getMISession(); - mi.fireEvent(new MIBreakpointChangedEvent(((Breakpoint)breakpoint).getMIBreakpoint().getNumber())); - } - - public void disableBreakpoint(ICDIBreakpoint breakpoint) throws CDIException { - int number = 0; - if (breakpoint instanceof Breakpoint - && breakList.contains(breakpoint)) { - number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber(); - } else { - throw new CDIException("Not a CDT breakpoint"); - } - - Session session = (Session)getSession(); - boolean state = suspendInferior(breakpoint.getTarget()); - CommandFactory factory = session.getMISession().getCommandFactory(); - MIBreakDisable breakDisable = - factory.createMIBreakDisable(new int[] { number }); - try { - session.getMISession().postCommand(breakDisable); - MIInfo info = breakDisable.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - resumeInferior(breakpoint.getTarget(), state); - } - ((Breakpoint) breakpoint).getMIBreakpoint().setEnabled(false); - // Fire a changed Event. - MISession mi = session.getMISession(); - mi.fireEvent(new MIBreakpointChangedEvent(((Breakpoint)breakpoint).getMIBreakpoint().getNumber())); - } - - public void setCondition(ICDIBreakpoint breakpoint, ICDICondition condition) throws CDIException { - int number = 0; - if (breakpoint instanceof Breakpoint - && breakList.contains(breakpoint)) { - number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber(); - } else { - throw new CDIException("Not a CDT breakpoint"); - } - - Session session = (Session)getSession(); - boolean state = suspendInferior(breakpoint.getTarget()); - CommandFactory factory = session.getMISession().getCommandFactory(); - - // reset the values to sane states. - String exprCond = condition.getExpression(); - if (exprCond == null) { - exprCond = ""; - } - int ignoreCount = condition.getIgnoreCount(); - if (ignoreCount < 0) { - ignoreCount = 0; - } - - try { - MIBreakCondition breakCondition = - factory.createMIBreakCondition(number, exprCond); - session.getMISession().postCommand(breakCondition); - MIInfo info = breakCondition.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MIBreakAfter breakAfter = - factory.createMIBreakAfter(number, ignoreCount); - session.getMISession().postCommand(breakAfter); - info = breakAfter.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - resumeInferior(breakpoint.getTarget(), state); - } - // Fire a changed Event. - MISession mi = session.getMISession(); - mi.fireEvent(new MIBreakpointChangedEvent(((Breakpoint)breakpoint).getMIBreakpoint().getNumber())); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#update() - */ - public void update() throws CDIException { - MIBreakpoint[] newMIBreakpoints = getMIBreakpoints(); - List eventList = new ArrayList(newMIBreakpoints.length); - for (int i = 0; i < newMIBreakpoints.length; i++) { - int no = newMIBreakpoints[i].getNumber(); - Breakpoint bp = getBreakpoint(no); - if (bp != null) { - if (hasBreakpointChanged(bp, newMIBreakpoints[i])) { - // Fire ChangedEvent - bp.setMIBreakpoint(newMIBreakpoints[i]); - eventList.add(new MIBreakpointChangedEvent(no)); - } else { - eventList.add(new MIBreakpointCreatedEvent(no)); - } - } else { - // add the new breakpoint and fire CreatedEvent - if (newMIBreakpoints[i].isWatchpoint()) { - breakList.add(new Watchpoint(this, newMIBreakpoints[i])); - } else { - breakList.add(new Breakpoint(this, newMIBreakpoints[i])); - } - eventList.add(new MIBreakpointCreatedEvent(no)); - } - } - // Check if any breakpoint was removed. - Breakpoint[] oldBreakpoints = (Breakpoint[]) breakList.toArray(new Breakpoint[0]); - for (int i = 0; i < oldBreakpoints.length; i++) { - boolean found = false; - int no = oldBreakpoints[i].getMIBreakpoint().getNumber(); - for (int j = 0; j < newMIBreakpoints.length; j++) { - if (no == newMIBreakpoints[j].getNumber()) { - found = true; - break; - } - } - if (!found) { - // Fire destroyed Events. - eventList.add(new MIBreakpointDeletedEvent(no)); - } - } - MISession mi = ((Session)getSession()).getMISession(); - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#allowProgramInterruption() - */ - public void allowProgramInterruption(boolean e) { - allowInterrupt = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteAllBreakpoints() - */ - public void deleteAllBreakpoints() throws CDIException { - deleteBreakpoints(getBreakpoints()); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteBreakpoint(ICDIBreakpoint) - */ - public void deleteBreakpoint(ICDIBreakpoint breakpoint) throws CDIException { - deleteBreakpoints(new ICDIBreakpoint[] { breakpoint }); - } - - public void deleteFromDeferredList(Breakpoint bkpt) { - deferredList.remove(bkpt); - } - - public void addToBreakpointList(Breakpoint bkpt) { - breakList.add(bkpt); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#deleteBreakpoints(ICDIBreakpoint[]) - */ - public void deleteBreakpoints(ICDIBreakpoint[] breakpoints) throws CDIException { - int[] numbers = new int[breakpoints.length]; - for (int i = 0; i < numbers.length; i++) { - if (breakpoints[i] instanceof Breakpoint - && breakList.contains(breakpoints[i])) { - numbers[i] = - ((Breakpoint) breakpoints[i]).getMIBreakpoint().getNumber(); - } else { - throw new CDIException("Not a CDT breakpoint"); - } - } - Session session = (Session)getSession(); - boolean state = suspendInferior(session.getCurrentTarget()); - CommandFactory factory = session.getMISession().getCommandFactory(); - MIBreakDelete breakDelete = factory.createMIBreakDelete(numbers); - try { - session.getMISession().postCommand(breakDelete); - MIInfo info = breakDelete.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - resumeInferior(session.getCurrentTarget(), state); - } - List eventList = new ArrayList(breakpoints.length); - for (int i = 0; i < breakpoints.length; i++) { - int no = ((Breakpoint)breakpoints[i]).getMIBreakpoint().getNumber(); - eventList.add(new MIBreakpointDeletedEvent(no)); - } - MISession mi = session.getMISession(); - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#getBreakpoints() - */ - public ICDIBreakpoint[] getBreakpoints() throws CDIException { - return (ICDIBreakpoint[]) breakList.toArray(new ICDIBreakpoint[0]); - } - - public ICDIBreakpoint[] getDeferredBreakpoints() throws CDIException { - return (ICDIBreakpoint[]) deferredList.toArray(new ICDIBreakpoint[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setCatchpoint(int, ICDICatchEvent, String, ICDICondition, boolean) - */ - public ICDICatchpoint setCatchpoint( int type, ICDICatchEvent event, String expression, - ICDICondition condition) throws CDIException { - throw new CDIException("Not Supported"); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setLocationBreakpoint(int, ICDILocation, ICDICondition, boolean, String) - */ - public ICDILocationBreakpoint setLocationBreakpoint(int type, ICDILocation location, - ICDICondition condition, String threadId) throws CDIException { - return setLocationBreakpoint(type, location, condition, threadId, false); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setLocationBreakpoint(int, ICDILocation, ICDICondition, boolean, String) - */ - public ICDILocationBreakpoint setLocationBreakpoint(int type, ICDILocation location, - ICDICondition condition, String threadId, boolean deferred) throws CDIException { - - Breakpoint bkpt = new Breakpoint(this, type, location, condition, threadId); - try { - setLocationBreakpoint(bkpt); - breakList.add(bkpt); - - // Fire a created Event. - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - mi.fireEvent(new MIBreakpointCreatedEvent(bkpt.getMIBreakpoint().getNumber())); - } catch (CDIException e) { - if (!deferred) { - throw e; - } else { - Session session = (Session)getSession(); - ICDISharedLibraryManager sharedMgr = session.getSharedLibraryManager(); - if (sharedMgr instanceof SharedLibraryManager) { - SharedLibraryManager mgr = (SharedLibraryManager)sharedMgr; - if (mgr.isDeferredBreakpoint()) { - deferredList.add(bkpt); - } else { - throw e; - } - } - } - } - return bkpt; - } - - MIBreakInsert createMIBreakInsert(Breakpoint bkpt) throws CDIException { - boolean hardware = bkpt.isHardware(); - boolean temporary = bkpt.isTemporary(); - String exprCond = null; - int ignoreCount = 0; - StringBuffer line = new StringBuffer(); - - if (bkpt.getCondition() != null) { - ICDICondition condition = bkpt.getCondition(); - exprCond = condition.getExpression(); - ignoreCount = condition.getIgnoreCount(); - } - - if (bkpt.getLocation() != null) { - ICDILocation location = bkpt.getLocation(); - String file = location.getFile(); - String function = location.getFunction(); - if (file != null && file.length() > 0) { - line.append(file).append(':'); - if (function != null && function.length() > 0) { - line.append(function); - } else { - line.append(location.getLineNumber()); - } - } else if (function != null && function.length() > 0) { - line.append(function); - } else if (location.getLineNumber() != 0) { - line.append(location.getLineNumber()); - } else { - line.append('*').append(location.getAddress()); - } - } - Session session = (Session)getSession(); - CommandFactory factory = session.getMISession().getCommandFactory(); - return factory.createMIBreakInsert(temporary, hardware, exprCond, ignoreCount, line.toString()); - } - - public void setLocationBreakpoint (Breakpoint bkpt) throws CDIException { - Session session = (Session)getSession(); - boolean state = suspendInferior(session.getCurrentTarget()); - MIBreakInsert breakInsert = createMIBreakInsert(bkpt); - MIBreakpoint[] points = null; - try { - session.getMISession().postCommand(breakInsert); - MIBreakInsertInfo info = breakInsert.getMIBreakInsertInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - points = info.getMIBreakpoints(); - if (points == null || points.length == 0) { - throw new CDIException("Error parsing"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - resumeInferior(session.getCurrentTarget(), state); - } - - bkpt.setMIBreakpoint(points[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setWatchpoint(int, int, String, ICDICondition, boolean) - */ - public ICDIWatchpoint setWatchpoint( int type, int watchType, String expression, - ICDICondition condition) throws CDIException { - boolean access = ( (watchType & ICDIWatchpoint.WRITE) == ICDIWatchpoint.WRITE && - (watchType & ICDIWatchpoint.READ) == ICDIWatchpoint.READ ); - boolean read = ( !((watchType & ICDIWatchpoint.WRITE) == ICDIWatchpoint.WRITE) && - (watchType & ICDIWatchpoint.READ) == ICDIWatchpoint.READ ); - - Session session = (Session)getSession(); - boolean state = suspendInferior(session.getCurrentTarget()); - CommandFactory factory = session.getMISession().getCommandFactory(); - MIBreakWatch breakWatch = - factory.createMIBreakWatch(access, read, expression); - MIBreakpoint[] points = null; - try { - session.getMISession().postCommand(breakWatch); - MIBreakWatchInfo info = breakWatch.getMIBreakWatchInfo(); - points = info.getMIBreakpoints(); - if (info == null) { - throw new CDIException("No answer"); - } - if (points == null || points.length == 0) { - throw new CDIException("Parsing Error"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - resumeInferior(session.getCurrentTarget(), state); - } - Watchpoint bkpt = new Watchpoint(this, points[0]); - breakList.add(bkpt); - - // Fire a created Event. - MISession mi = session.getMISession(); - mi.fireEvent(new MIBreakpointCreatedEvent(bkpt.getMIBreakpoint().getNumber())); - return bkpt; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createCondition(int, String) - */ - public ICDICondition createCondition(int ignoreCount, String expression) { - return new Condition(ignoreCount, expression); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createLocation(String, String, int) - */ - public ICDILocation createLocation(String file, String function, int line) { - return new Location(file, function, line); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createLocation(long) - */ - public ICDILocation createLocation(long address) { - return new Location(address); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Condition.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Condition.java deleted file mode 100644 index 7eb5e85821f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Condition.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDICondition; - -/** - */ -public class Condition implements ICDICondition { - - int ignoreCount; - String expression; - - public Condition(int ignore, String exp) { - ignoreCount = ignore; - expression = exp; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDICondition#getIgnoreCount() - */ - public int getIgnoreCount() { - return ignoreCount; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDICondition#getExpression() - */ - public String getExpression() { - return expression; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java deleted file mode 100644 index 65e9aedbe88..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Configuration.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.mi.core.MIInferior; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.utils.spawner.Spawner; - -/** - */ -public class Configuration implements ICDIConfiguration { - protected boolean fAttached; - MISession miSession; - - public Configuration(MISession s, boolean attached) { - fAttached = attached; - miSession = s; - } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsBreakpoints() - */ - public boolean supportsBreakpoints() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsDisconnect() - */ - public boolean supportsDisconnect() { - return fAttached ? true :false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsExpressionEvaluation() - */ - public boolean supportsExpressionEvaluation() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsInstructionStepping() - */ - public boolean supportsInstructionStepping() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsMemoryModification() - */ - public boolean supportsMemoryModification() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsMemoryRetrieval() - */ - public boolean supportsMemoryRetrieval() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsRegisterModification() - */ - public boolean supportsRegisterModification() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsRegisters() - */ - public boolean supportsRegisters() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsSharedLibrary() - */ - public boolean supportsSharedLibrary() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsRestart() - */ - public boolean supportsRestart() { - return fAttached ? false : true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsStepping() - */ - public boolean supportsStepping() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsTerminate() - */ - public boolean supportsTerminate() { - return true; - - } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsResume() - */ - public boolean supportsResume() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsSuspend() - */ - public boolean supportsSuspend() { - String os = null; - try { - os = System.getProperty("os.name", ""); - } catch (SecurityException e) { - } - Process gdb = miSession.getGDBProcess(); - if (gdb instanceof Spawner) { - // If we attached sending a control-c, - // seems to alays work. - if (fAttached) { - return true; - } - - // If we have a pty, sending a control-c will work - // except for solaris. - if (os.equals("SunOS")) { - MIInferior inferior = miSession.getMIInferior(); - if (inferior.getPTY() != null) { - // FIXME: bug in Solaris gdb when using -tty, sending a control-c - // does not work. - return false; - } else { - return true; - } - } - return true; - } - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#terminateSessionOnExit() - */ - public boolean terminateSessionOnExit() { - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CoreFileConfiguration.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CoreFileConfiguration.java deleted file mode 100644 index 0c094afbc62..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CoreFileConfiguration.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; - -public class CoreFileConfiguration implements ICDIConfiguration { - - public boolean supportsTerminate() { - return true; - } - - public boolean supportsDisconnect() { - return false; - } - - public boolean supportsRestart() { - return false; - } - - public boolean supportsStepping() { - return false; - } - - public boolean supportsInstructionStepping() { - return false; - } - - public boolean supportsBreakpoints() { - return false; - } - - public boolean supportsRegisters() { - return true; - } - - public boolean supportsRegisterModification() { - return false; - } - - public boolean supportsMemoryRetrieval() { - return true; - } - - public boolean supportsMemoryModification() { - return false; - } - - public boolean supportsExpressionEvaluation() { - return true; - } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsResume() - */ - public boolean supportsResume() { - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsSuspend() - */ - public boolean supportsSuspend() { - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#supportsSharedLibrary() - */ - public boolean supportsSharedLibrary() { - return true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIConfiguration#terminateSessionOnExit() - */ - public boolean terminateSessionOnExit() { - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EndSteppingRange.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EndSteppingRange.java deleted file mode 100644 index 7ba0ff6588b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EndSteppingRange.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange; - -/** - */ -public class EndSteppingRange extends SessionObject implements ICDIEndSteppingRange { - - public EndSteppingRange(Session session) { - super(session); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java deleted file mode 100644 index 33979beb7dc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ErrorInfo.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo; -import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent; - -/** - */ -public class ErrorInfo extends SessionObject implements ICDIErrorInfo { - - MIErrorEvent event; - - public ErrorInfo(Session session, MIErrorEvent e) { - super(session); - event = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo#getMessage() - */ - public String getMessage() { - return event.getMessage(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo#getDetailMessage() - */ - public String getDetailMessage() { - return event.getLogMessage(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java deleted file mode 100644 index 3781623673a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java +++ /dev/null @@ -1,536 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Observable; -import java.util.Observer; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDIEventManager; -import org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager; -import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager; -import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.ICDISignalManager; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; -import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; -import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.event.ChangedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.CreatedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.DestroyedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.DisconnectedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.ExitedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.MemoryChangedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.ResumedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.event.SuspendedEvent; -import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint; -import org.eclipse.cdt.debug.mi.core.cdi.model.MemoryBlock; -import org.eclipse.cdt.debug.mi.core.cdi.model.Target; -import org.eclipse.cdt.debug.mi.core.cdi.model.Thread; -import org.eclipse.cdt.debug.mi.core.command.Command; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIExecContinue; -import org.eclipse.cdt.debug.mi.core.command.MIExecFinish; -import org.eclipse.cdt.debug.mi.core.command.MIStackInfoDepth; -import org.eclipse.cdt.debug.mi.core.command.MIStackSelectFrame; -import org.eclipse.cdt.debug.mi.core.command.MIThreadSelect; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointDeletedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MICreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIDestroyedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIGDBExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorSignalExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIMemoryChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIMemoryCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRegisterChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRegisterCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibUnloadedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIStoppedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarDeletedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIStackInfoDepthInfo; - -/** - */ -public class EventManager extends SessionObject implements ICDIEventManager, Observer { - - List list = Collections.synchronizedList(new ArrayList(1)); - List tokenList = new ArrayList(1); - MIRunningEvent lastRunningEvent; - Command lastUserCommand = null; - - /** - * Process the event from MI, do any state work on the CDI, - * and fire the corresponding CDI event. - */ - public void update(Observable o, Object arg) { - MIEvent miEvent = (MIEvent)arg; - Session session = (Session)getSession(); - List cdiList = new ArrayList(1); - - if (ignoreEventToken(miEvent.getToken())) { - // Ignore the event if it is on the ignore list. - } else if (miEvent instanceof MIStoppedEvent) { - if (processSuspendedEvent((MIStoppedEvent)miEvent)) { - cdiList.add(new SuspendedEvent(session, miEvent)); - } - } else if (miEvent instanceof MIRunningEvent) { - if (processRunningEvent((MIRunningEvent)miEvent)) - cdiList.add(new ResumedEvent(session, (MIRunningEvent)miEvent)); - } else if (miEvent instanceof MIChangedEvent) { - if (miEvent instanceof MIVarChangedEvent) { - cdiList.add(new ChangedEvent(session, (MIVarChangedEvent)miEvent)); - } else if (miEvent instanceof MIRegisterChangedEvent) { - cdiList.add(new ChangedEvent(session, (MIRegisterChangedEvent)miEvent)); - } else if (miEvent instanceof MIMemoryChangedEvent) { - // We need to fire an event for all the register blocks - // that may contain the modified addresses. - MemoryManager mgr = (MemoryManager)session.getMemoryManager(); - MemoryBlock[] blocks = mgr.listMemoryBlocks(); - MIMemoryChangedEvent miMem = (MIMemoryChangedEvent)miEvent; - Long[] addresses = miMem.getAddresses(); - for (int i = 0; i < blocks.length; i++) { - if (blocks[i].contains(addresses) && - (! blocks[i].isFrozen() || blocks[i].isDirty())) { - cdiList.add(new MemoryChangedEvent(session, blocks[i], miMem)); - blocks[i].setDirty(false); - } - } - } else if (miEvent instanceof MIBreakpointChangedEvent) { - MIBreakpointChangedEvent bpoint = (MIBreakpointChangedEvent)miEvent; - if (bpoint.getNumber() > 0) { - cdiList.add(new ChangedEvent(session, bpoint)); - } else { - // Something change we do not know what - // Let the breakpoint manager handle it with an update(). - try { - session.getBreakpointManager().update(); - } catch (CDIException e) { - } - } - } else if (miEvent instanceof MISharedLibChangedEvent) { - cdiList.add(new ChangedEvent(session, (MISharedLibChangedEvent)miEvent)); - } else if (miEvent instanceof MISignalChangedEvent) { - MISignalChangedEvent sig = (MISignalChangedEvent)miEvent; - String name = sig.getName(); - if (name == null || name.length() == 0) { - // Something change we do not know what - // Let the signal manager handle it with an update(). - try { - session.getSignalManager().update(); - } catch (CDIException e) { - } - } else { - cdiList.add(new ChangedEvent(session, sig)); - } - } - } else if (miEvent instanceof MIDestroyedEvent) { - if (miEvent instanceof MIThreadExitEvent) { - cdiList.add(new DestroyedEvent(session,(MIThreadExitEvent)miEvent)); - } else if (miEvent instanceof MIInferiorSignalExitEvent) { - cdiList.add(new ExitedEvent(session, (MIInferiorSignalExitEvent)miEvent)); - } else if (miEvent instanceof MIInferiorExitEvent) { - cdiList.add(new ExitedEvent(session, (MIInferiorExitEvent)miEvent)); - } else if (miEvent instanceof MIGDBExitEvent) { - cdiList.add(new DestroyedEvent(session)); - } else if (miEvent instanceof MIDetachedEvent) { - cdiList.add(new DisconnectedEvent(session)); - } else if (miEvent instanceof MIBreakpointDeletedEvent) { - MIBreakpointDeletedEvent bpoint = (MIBreakpointDeletedEvent)miEvent; - if (bpoint.getNumber() > 0) { - cdiList.add(new DestroyedEvent(session, bpoint)); - } else { - // Something was deleted we do not know what - // Let the breakpoint manager handle it with an update(). - try { - session.getBreakpointManager().update(); - } catch (CDIException e) { - } - } - } else if (miEvent instanceof MISharedLibUnloadedEvent) { - cdiList.add(new DestroyedEvent(session, (MISharedLibUnloadedEvent)miEvent)); - } else if (miEvent instanceof MIVarDeletedEvent) { - cdiList.add(new DestroyedEvent(session, (MIVarDeletedEvent)miEvent)); - } - } else if (miEvent instanceof MICreatedEvent) { - if (miEvent instanceof MIBreakpointCreatedEvent) { - MIBreakpointCreatedEvent bpoint = (MIBreakpointCreatedEvent)miEvent; - if (bpoint.getNumber() > 0) { - cdiList.add(new CreatedEvent(session, bpoint)); - } else { - // Something created we do not know what - // Let the breakpoint manager handle it with an update(). - try { - session.getBreakpointManager().update(); - } catch (CDIException e) { - } - } - } else if (miEvent instanceof MIVarCreatedEvent) { - cdiList.add(new CreatedEvent(session, (MIVarCreatedEvent)miEvent)); - } else if (miEvent instanceof MIRegisterCreatedEvent) { - cdiList.add(new CreatedEvent(session, (MIRegisterCreatedEvent)miEvent)); - } else if (miEvent instanceof MIThreadCreatedEvent) { - cdiList.add(new CreatedEvent(session, (MIThreadCreatedEvent)miEvent)); - } else if (miEvent instanceof MIMemoryCreatedEvent) { - cdiList.add(new CreatedEvent(session, (MIMemoryCreatedEvent)miEvent)); - } else if (miEvent instanceof MISharedLibCreatedEvent) { - cdiList.add(new CreatedEvent(session, (MISharedLibCreatedEvent)miEvent)); - } - } - - // Fire the event; - ICDIEvent[] cdiEvents = (ICDIEvent[])cdiList.toArray(new ICDIEvent[0]); - fireEvents(cdiEvents); - } - - public EventManager(Session session) { - super(session); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIEventManager#addEventListener(ICDIEventListener) - */ - public void addEventListener(ICDIEventListener listener) { - list.add(listener); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIEventManager#removeEventListener(ICDIEventListener) - */ - public void removeEventListener(ICDIEventListener listener) { - list.remove(listener); - } - - - /** - * Send ICDIEvent to the listeners. - */ - private void fireEvents(ICDIEvent[] cdiEvents) { - if (cdiEvents != null) { - for (int i = 0; i < cdiEvents.length; i++) { - fireEvent(cdiEvents[i]); - } - } - } - - /** - * Send ICDIEvent to the listeners. - */ - private void fireEvent(ICDIEvent cdiEvent) { - if (cdiEvent != null) { - ICDIEventListener[] listeners = - (ICDIEventListener[])list.toArray(new ICDIEventListener[0]); - for (int i = 0; i < listeners.length; i++) { - listeners[i].handleDebugEvent(cdiEvent); - } - } - } - - /** - * When suspended arrives, reset managers and target. - * Alse the variable and the memory needs to be updated and events - * fired for changes. - */ - boolean processSuspendedEvent(MIStoppedEvent stopped) { - Session session = (Session)getSession(); - ICDITarget currentTarget = session.getCurrentTarget(); - - if (processSharedLibEvent(stopped)) { - // Event was consumed by the shared lib processing bailout - return false; - } - - int threadId = threadId = stopped.getThreadId(); - if (currentTarget instanceof Target) { - Target cTarget = (Target)currentTarget; - cTarget.updateState(threadId); - try { - ICDIThread cthread = cTarget.getCurrentThread(); - if (cthread != null) { - cthread.getCurrentStackFrame(); - } else { - return true; - } - } catch (CDIException e1) { - //e1.printStackTrace(); - return true; - } - } - - // Update the managers. - // For the Variable/Expression Managers call only the updateManager. - ICDIVariableManager varMgr = session.getVariableManager(); - ICDIExpressionManager expMgr = session.getExpressionManager(); - ICDIRegisterManager regMgr = session.getRegisterManager(); - ICDIMemoryManager memMgr = session.getMemoryManager(); - ICDIBreakpointManager bpMgr = session.getBreakpointManager(); - ICDISignalManager sigMgr = session.getSignalManager(); - ICDISourceManager srcMgr = session.getSourceManager(); - ICDISharedLibraryManager libMgr = session.getSharedLibraryManager(); - try { - if (varMgr.isAutoUpdate()) { - varMgr.update(); - } - if (expMgr.isAutoUpdate()) { - expMgr.update(); - } - if (regMgr.isAutoUpdate()) { - regMgr.update(); - } - if (memMgr.isAutoUpdate()) { - memMgr.update(); - } - if (bpMgr.isAutoUpdate()) { - bpMgr.update(); - } - if (sigMgr.isAutoUpdate()) { - sigMgr.update(); - } - if (libMgr.isAutoUpdate()) { - libMgr.update(); - } - if (srcMgr.isAutoUpdate()) { - srcMgr.update(); - } - } catch (CDIException e) { - //System.out.println(e); - } - return true; - } - - /** - * If the deferredBreakpoint processing is set - * catch the shared-lib-event go to the last known - * stackframe and try to finish. - * Save the last user command and issue it again. - * @param stopped - * @return - */ - boolean processSharedLibEvent(MIStoppedEvent stopped) { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - - ICDITarget currentTarget = session.getCurrentTarget(); - ICDISharedLibraryManager libMgr = session.getSharedLibraryManager(); - SharedLibraryManager mgr = null; - - if (libMgr instanceof SharedLibraryManager) { - mgr = (SharedLibraryManager)libMgr; - } - - if (mgr !=null && mgr.isDeferredBreakpoint()) { - if (stopped instanceof MISharedLibEvent) { - // Check if we have a new library loaded - List eventList = null; - try { - eventList = mgr.updateState(); - } catch (CDIException e3) { - eventList = Collections.EMPTY_LIST; - } - // A new Libraries loaded, try to set the breakpoints. - if (eventList.size() > 0) { - ICDIBreakpointManager manager = session.getBreakpointManager(); - if (manager instanceof BreakpointManager) { - BreakpointManager bpMgr = (BreakpointManager)manager; - ICDIBreakpoint bpoints[] = null; - try { - bpoints = bpMgr.getDeferredBreakpoints(); - } catch (CDIException e) { - bpoints = new ICDIBreakpoint[0]; - } - for (int i = 0; i < bpoints.length; i++) { - if (bpoints[i] instanceof Breakpoint) { - Breakpoint bkpt = (Breakpoint)bpoints[i]; - try { - bpMgr.setLocationBreakpoint(bkpt); - bpMgr.deleteFromDeferredList(bkpt); - bpMgr.addToBreakpointList(bkpt); - eventList.add(new MIBreakpointCreatedEvent(bkpt.getMIBreakpoint().getNumber())); - } catch (CDIException e) { - } - } - } - } - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - CommandFactory factory = mi.getCommandFactory(); - int type = (lastRunningEvent == null) ? MIRunningEvent.CONTINUE : lastRunningEvent.getType(); - if (lastUserCommand == null) { - switch (type) { - case MIRunningEvent.NEXT: - lastUserCommand = factory.createMIExecNext(); - break; - case MIRunningEvent.NEXTI: - lastUserCommand = factory.createMIExecNextInstruction(); - break; - case MIRunningEvent.STEP: - lastUserCommand = factory.createMIExecStep(); - break; - case MIRunningEvent.STEPI: - lastUserCommand = factory.createMIExecStepInstruction(); - break; - case MIRunningEvent.FINISH: - lastUserCommand = factory.createMIExecFinish(); - break; - case MIRunningEvent.RETURN: - lastUserCommand = factory.createMIExecReturn(); - break; - case MIRunningEvent.CONTINUE: { - MIExecContinue cont = factory.createMIExecContinue(); - try { - mi.postCommand(cont); - MIInfo info = cont.getMIInfo(); - if (info == null) { - // throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - // throw new MI2CDIException(e); - } - return true; // for the continue bailout early no need to the stuff below - } - } - } - - int miLevel = 0; - int tid = 0; - ICDIThread currentThread = null; - try { - currentThread = currentTarget.getCurrentThread(); - } catch (CDIException e1) { - } - if (currentThread instanceof Thread) { - tid = ((Thread)currentThread).getId(); - } - ICDIStackFrame frame = null; - try { - frame = currentThread.getCurrentStackFrame(); - } catch (CDIException e2) { - } - int count = 0; - try { - MIStackInfoDepth depth = factory.createMIStackInfoDepth(); - mi.postCommand(depth); - MIStackInfoDepthInfo info = depth.getMIStackInfoDepthInfo(); - if (info == null) { - //throw new CDIException("No answer"); - } - count = info.getDepth(); - } catch (MIException e) { - //throw new MI2CDIException(e); - //System.out.println(e); - } - if (frame != null) { - // Fortunately the ICDIStackFrame store the level - // in ascending level the higher the stack the higher the level - // GDB does the opposite the highest stack is 0. - // This allow us to do some calculation, in figure out the - // level of the old stack. The -1 is because gdb level is zero-based - miLevel = count - frame.getLevel() - 1; - } - if (tid > 0) { - MIThreadSelect selectThread = factory.createMIThreadSelect(tid); - try { - mi.postCommand(selectThread); - } catch (MIException e) { - } - } - if (miLevel >= 0) { - MIStackSelectFrame selectFrame = factory.createMIStackSelectFrame(miLevel); - MIExecFinish finish = factory.createMIExecFinish(); - try { - mi.postCommand(selectFrame); - mi.postCommand(finish); - } catch (MIException e) { - } - } - return true; - } else if (lastUserCommand != null) { - Command cmd = lastUserCommand; - lastUserCommand = null; - try { - mi.postCommand(cmd); - } catch (MIException e) { - } - return true; - } - } - return false; - } - - /** - * Do any processing of before a running event. - */ - boolean processRunningEvent(MIRunningEvent running) { - lastRunningEvent = running; - return true; - } - - - /** - * Ignore Event with token id. - */ - void disableEventToken(int token) { - tokenList.add(new Integer(token)); - } - - /** - * Ignore events with token ids. - */ - void disableEventTokens(int [] tokens) { - for (int i = 0; i < tokens.length; i++) { - disableEventToken(tokens[i]); - } - } - - /** - * Reenable sending events with this token. - */ - void enableEventToken(int token) { - Integer t = new Integer(token); - if (tokenList.contains(t)) { - tokenList.remove(t); - } - } - - /** - * Reenable sending events with this token. - */ - void enableEventTokens(int [] tokens) { - for (int i = 0; i < tokens.length; i++) { - enableEventToken(tokens[i]); - } - } - - private boolean ignoreEventToken(int token) { - return tokenList.contains(new Integer(token)); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExitInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExitInfo.java deleted file mode 100644 index b178d1bb0b0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExitInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIExitInfo; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; - -/**. - */ -public class ExitInfo extends SessionObject implements ICDIExitInfo { - - MIInferiorExitEvent event; - - public ExitInfo(Session session, MIInferiorExitEvent e) { - super(session); - event = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExitInfo#getCode() - */ - public int getCode() { - return event.getExitCode(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java deleted file mode 100644 index d5ddecd9ead..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Expression; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; -import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIVarCreate; -import org.eclipse.cdt.debug.mi.core.command.MIVarDelete; -import org.eclipse.cdt.debug.mi.core.command.MIVarUpdate; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarDeletedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIVar; -import org.eclipse.cdt.debug.mi.core.output.MIVarChange; -import org.eclipse.cdt.debug.mi.core.output.MIVarCreateInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo; - -/** - */ -public class ExpressionManager extends SessionObject implements ICDIExpressionManager{ - - private List expList; - private boolean autoupdate; - MIVarChange[] noChanges = new MIVarChange[0]; - - public ExpressionManager(Session session) { - super(session); - expList = Collections.synchronizedList(new ArrayList()); - autoupdate = true; - } - - /** - * Tell gdb to remove the underlying var-object also. - */ - void removeMIVar(MIVar miVar) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarDelete var = factory.createMIVarDelete(miVar.getVarName()); - try { - mi.postCommand(var); - var.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * When element are remove from the cache, they are put on the OutOfScope list, oos, - * because they are still needed for the destroy events. The destroy event will - * call removeOutOfScope. - */ - public void removeExpression(String varName) throws CDIException { - Expression[] exps = (Expression[])expList.toArray(new Expression[0]); - for (int i = 0; i < exps.length; i++) { - if (exps[i].getMIVar().getVarName().equals(varName)) { - expList.remove(exps[i]); - removeMIVar(exps[i].getMIVar()); - } - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#createExpression(String) - */ - public ICDIExpression createExpression(String name) throws CDIException { - Expression expression = null; - try { - Session session = (Session)getSession(); - ICDITarget currentTarget = session.getCurrentTarget(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarCreate var = factory.createMIVarCreate(name); - mi.postCommand(var); - MIVarCreateInfo info = var.getMIVarCreateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - VariableObject varObj = new VariableObject(currentTarget, name, null, 0, 0); - expression = new Expression(varObj, info.getMIVar()); - expList.add(expression); - } catch (MIException e) { - throw new MI2CDIException(e); - } - return expression; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#createExpression(ICDIStackFrame, String) - */ - public ICDIExpression createExpression(ICDIStackFrame frame, String name) throws CDIException { - Expression expression = null; - Session session = (Session)getSession(); - ICDITarget currentTarget = session.getCurrentTarget(); - ICDIThread currentThread = currentTarget.getCurrentThread(); - ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); - frame.getThread().setCurrentStackFrame(frame, false); - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarCreate var = factory.createMIVarCreate(name); - mi.postCommand(var); - MIVarCreateInfo info = var.getMIVarCreateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - ICDITarget tgt = frame.getThread().getTarget(); - VariableObject varObj = new VariableObject(tgt, name, frame, 0, 0); - expression = new Expression(varObj, info.getMIVar()); - expList.add(expression); - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - currentThread.setCurrentStackFrame(currentFrame, false); - } - return expression; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#getExpressions() - */ - public ICDIExpression[] getExpressions() throws CDIException { - return (ICDIExpression[])expList.toArray(new ICDIExpression[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#removeExpression(ICDIExpression) - */ - public void destroyExpression(ICDIExpression expression) throws CDIException { - if (expression instanceof Expression) { - // Fire a destroyEvent ? - Expression exp= (Expression)expression; - MIVarDeletedEvent del = new MIVarDeletedEvent(exp.getMIVar().getVarName()); - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - mi.fireEvent(del); - } - } - - /** - * Return the element that have the uniq varName. - * null is return if the element is not in the cache. - */ - public Variable getExpression(String varName) { - Expression[] exps = (Expression[])expList.toArray(new Expression[0]); - for (int i = 0; i < exps.length; i++) { - if (exps[i].getMIVar().getVarName().equals(varName)) { - return exps[i]; - } - Variable v = exps[i].getChild(varName); - if (v != null) { - return v; - } - } - return null; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#update() - */ - public void update() throws CDIException { - List eventList = new ArrayList(); - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - Expression[] exps = (Expression[])expList.toArray(new Expression[0]); - for (int i = 0; i < exps.length; i++) { - String varName = exps[i].getMIVar().getVarName(); - MIVarChange[] changes = noChanges; - MIVarUpdate update = factory.createMIVarUpdate(varName); - try { - mi.postCommand(update); - MIVarUpdateInfo info = update.getMIVarUpdateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - changes = info.getMIVarChanges(); - } catch (MIException e) { - //throw new MI2CDIException(e); - eventList.add(new MIVarDeletedEvent(varName)); - } - for (int j = 0 ; j < changes.length; j++) { - String n = changes[j].getVarName(); - if (changes[j].isInScope()) { - eventList.add(new MIVarChangedEvent(n)); - } - // We do not implicitely delete Expressions. - //else { - // eventList.add(new MIVarDeletedEvent(n)); - //} - } - } - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Format.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Format.java deleted file mode 100644 index 6071890a2ee..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Format.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - */ -public class Format { - - private Format() { - } - - public static int toMIFormat(int format) { - int fmt = MIFormat.NATURAL; - switch (format) { - case ICDIFormat.NATURAL: - fmt = MIFormat.NATURAL; - break; - - case ICDIFormat.DECIMAL: - fmt = MIFormat.DECIMAL; - break; - - case ICDIFormat.BINARY: - fmt = MIFormat.BINARY; - break; - - case ICDIFormat.OCTAL: - fmt = MIFormat.OCTAL; - break; - - case ICDIFormat.HEXADECIMAL: - fmt = MIFormat.HEXADECIMAL; - break; - } - return fmt; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java deleted file mode 100644 index 573f5316d80..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Location.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDILocation; - -/** - */ -public class Location implements ICDILocation { - - long addr; - String file = ""; - String function = ""; - int line; - - public Location(String f, String fnct, int l) { - this(f, fnct, l, 0); - } - - public Location(String f, String fnct, int l, long a) { - if (f != null) - file = f; - if (fnct != null) - function = fnct; - line = l; - addr = a; - } - - public Location(long address) { - addr = address; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getAddress() - */ - public long getAddress() { - return addr; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getFile() - */ - public String getFile() { - return file; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getFunction() - */ - public String getFunction() { - return function; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getLineNumber() - */ - public int getLineNumber() { - return line; - } - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#equals(ICDILocation) - */ - public boolean equals(ICDILocation location) { - String ofile = location.getFile(); - if (file.length() > 0 && ofile.length() > 0) { - if (file.equals(ofile)) { - int oline = location.getLineNumber(); - if (line != 0 && oline != 0) { - if (line == oline) { - return true; - } - } - String ofunction = location.getFunction(); - if (function.length() > 0 && ofunction.length() > 0) { - if (function.equals(ofunction)) { - return true; - } - } - } - } - long oaddr = location.getAddress(); - if (addr != 0 && oaddr != 0) { - if (addr == oaddr) { - return true; - } - } - return super.equals(location); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java deleted file mode 100644 index c9a2c6ef596..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MI2CDIException.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.mi.core.MIException; - -/** - */ -public class MI2CDIException extends CDIException { - - public MI2CDIException(MIException e) { - super(e.getMessage(), e.getLogMessage()); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java deleted file mode 100644 index 11ac2b15a8b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIFormat; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.MemoryBlock; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataReadMemory; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIMemoryChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIMemoryCreatedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo; - -/** - */ -public class MemoryManager extends SessionObject implements ICDIMemoryManager { - - List blockList; - boolean autoupdate; - - public MemoryManager(Session session) { - super(session); - blockList = new ArrayList(); - autoupdate = true; - } - - /** - * This method will be call by the eventManager.processSuspended() every time the - * inferior comes to a Stop/Suspended. It will allow to look at the blocks that - * are registered and fired any event if changed. - * Note: Frozen blocks are not updated. - * - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int) - */ - public void update() { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - MemoryBlock[] blocks = listMemoryBlocks(); - List eventList = new ArrayList(blocks.length); - for (int i = 0; i < blocks.length; i++) { - if (! blocks[i].isFrozen()) { - try { - update(blocks[i], eventList); - } catch (CDIException e) { - } - } - } - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - - /** - * update one Block. - */ - public Long[] update(MemoryBlock block, List aList) throws CDIException { - MemoryBlock newBlock = cloneBlock(block); - boolean newAddress = ( newBlock.getStartAddress() != block.getStartAddress() ); - Long[] array = compareBlocks(block, newBlock); - // Update the block MIDataReadMemoryInfo. - block.setMIDataReadMemoryInfo(newBlock.getMIDataReadMemoryInfo()); - if (array.length > 0 || newAddress) { - if (aList != null) { - aList.add(new MIMemoryChangedEvent(array)); - } else { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - mi.fireEvent(new MIMemoryChangedEvent(array)); - } - } - return array; - } - - /** - * @return the registers MemoryBlock. - */ - public MemoryBlock[] listMemoryBlocks() { - return (MemoryBlock[])blockList.toArray(new MemoryBlock[0]); - } - - /** - * Compare two blocks and return an array of all _addresses_ that are different. - * This method is not smart it always assume that: - * oldBlock.getStartAddress() == newBlock.getStartAddress; - * oldBlock.getLength() == newBlock.getLength(); - * @return Long[] array of modified addresses. - */ - Long[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException { - byte[] oldBytes = oldBlock.getBytes(); - byte[] newBytes = newBlock.getBytes(); - List aList = new ArrayList(newBytes.length); - long diff = newBlock.getStartAddress() - oldBlock.getStartAddress(); - if ( Math.abs( diff ) < newBytes.length ) { - for (int i = 0; i < newBytes.length; i++) { - if (i + (int)diff < oldBytes.length && i + (int)diff >= 0) { - if (oldBytes[i + (int)diff] != newBytes[i]) { - aList.add(new Long(newBlock.getStartAddress() + i)); - } - } - } - } - return (Long[])aList.toArray(new Long[0]); - } - - /** - * Use the same expression and length of the original block - * to create a new MemoryBlock. The new block is not register - * with the MemoryManager. - */ - MemoryBlock cloneBlock(MemoryBlock block) throws CDIException { - Session session = (Session)getSession(); - String exp = block.getExpression(); - MIDataReadMemoryInfo info = createMIDataReadMemoryInfo(exp, (int)block.getLength()); - return new MemoryBlock(session.getCurrentTarget(), exp, info); - } - - /** - * Post a -data-read-memory to gdb/mi. - */ - MIDataReadMemoryInfo createMIDataReadMemoryInfo(String exp, int length) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataReadMemory mem = factory.createMIDataReadMemory(0, exp, MIFormat.HEXADECIMAL, 1, 1, length, null); - try { - mi.postCommand(mem); - MIDataReadMemoryInfo info = mem.getMIDataReadMemoryInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - return info; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int) - */ - public ICDIMemoryBlock createMemoryBlock(long address, int length) - throws CDIException { - String addr = "0x" + Long.toHexString(address); - return createMemoryBlock(addr, length); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(string, int) - */ - public ICDIMemoryBlock createMemoryBlock(String address, int length) throws CDIException { - Session session = (Session)getSession(); - MIDataReadMemoryInfo info = createMIDataReadMemoryInfo(address, length); - ICDIMemoryBlock block = new MemoryBlock(session.getCurrentTarget(), address, info); - blockList.add(block); - MISession mi = session.getMISession(); - mi.fireEvent(new MIMemoryCreatedEvent(block.getStartAddress(), block.getLength())); - return block; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#getBlocks() - */ - public ICDIMemoryBlock[] getMemoryBlocks() throws CDIException { - return (ICDIMemoryBlock[])listMemoryBlocks(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#removeAllBlocks() - */ - public void removeAllBlocks() throws CDIException { - blockList.clear(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#removeBlock(ICDIMemoryBlock) - */ - public void removeBlock(ICDIMemoryBlock memoryBlock) throws CDIException { - blockList.remove(memoryBlock); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#removeBlocks(ICDIMemoryBlock[]) - */ - public void removeBlocks(ICDIMemoryBlock[] memoryBlocks) - throws CDIException { - for (int i = 0; i < memoryBlocks.length; i++) { - removeBlock(memoryBlocks[i]); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java deleted file mode 100644 index e940187fa71..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RegisterManager.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Register; -import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterObject; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataListChangedRegisters; -import org.eclipse.cdt.debug.mi.core.command.MIDataListRegisterNames; -import org.eclipse.cdt.debug.mi.core.command.MIVarCreate; -import org.eclipse.cdt.debug.mi.core.command.MIVarUpdate; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRegisterChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIDataListChangedRegistersInfo; -import org.eclipse.cdt.debug.mi.core.output.MIDataListRegisterNamesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVar; -import org.eclipse.cdt.debug.mi.core.output.MIVarChange; -import org.eclipse.cdt.debug.mi.core.output.MIVarCreateInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo; - -/** - */ -public class RegisterManager extends SessionObject implements ICDIRegisterManager { - - private List regList; - private boolean autoupdate; - MIVarChange[] noChanges = new MIVarChange[0]; - - public RegisterManager(Session session) { - super(session); - regList = Collections.synchronizedList(new ArrayList()); - autoupdate = true; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getRegisterObjects() - */ - public ICDIRegisterObject[] getRegisterObjects() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataListRegisterNames registers = factory.createMIDataListRegisterNames(); - try { - mi.postCommand(registers); - MIDataListRegisterNamesInfo info = - registers.getMIDataListRegisterNamesInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - String[] names = info.getRegisterNames(); - List regsList = new ArrayList(names.length); - for (int i = 0; i < names.length; i++) { - if (names[i].length() > 0) { - regsList.add(new RegisterObject(session.getCurrentTarget(), names[i], i)); - } - } - return (ICDIRegisterObject[])regsList.toArray(new ICDIRegisterObject[0]); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#createRegister() - */ - public ICDIRegister createRegister(ICDIRegisterObject regObject) throws CDIException { - RegisterObject regObj = null; - if (regObject instanceof RegisterObject) { - regObj = (RegisterObject)regObject; - } - if (regObj != null) { - Register reg = getRegister(regObject); - if (reg == null) { - try { - String name = "$" + regObj.getName(); - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarCreate var = factory.createMIVarCreate(name); - mi.postCommand(var); - MIVarCreateInfo info = var.getMIVarCreateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - reg = new Register(regObj, info.getMIVar()); - regList.add(reg); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - return reg; - } - throw new CDIException("Wrong register type"); - } - - public Register createRegister(RegisterObject v, MIVar mivar) throws CDIException { - Register reg = new Register(v, mivar); - regList.add(reg); - return reg; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager#destroyRegister(ICDIRegister) - */ - public void destroyRegister(ICDIRegister reg) { - regList.remove(reg); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * Use by the eventManager to find the Register; - */ - public Register getRegister(String varName) { - Register[] regs = getRegisters(); - for (int i = 0; i < regs.length; i++) { - if (regs[i].getMIVar().getVarName().equals(varName)) { - return regs[i]; - } - try { - Register r = (Register)regs[i].getChild(varName); - if (r != null) { - return r; - } - } catch (ClassCastException e) { - } - } - return null; - } - - /** - * Use by the eventManager to find the Register; - */ - public Register getRegister(int regno) { - Register[] regs = getRegisters(); - for (int i = 0; i < regs.length; i++) { - if (regs[i].getPosition() == regno) { - return regs[i]; - } - } - return null; - } - - /** - * Call the by the EventManager when the target is suspended. - */ - public void update() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataListChangedRegisters changed = factory.createMIDataListChangedRegisters(); - try { - mi.postCommand(changed); - MIDataListChangedRegistersInfo info = - changed.getMIDataListChangedRegistersInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - int[] regnos = info.getRegisterNumbers(); - List eventList = new ArrayList(regnos.length); - // Now that we know the registers changed - // call -var-update to update the value in gdb. - // And send the notification. - for (int i = 0 ; i < regnos.length; i++) { - Register reg = getRegister(regnos[i]); - if (reg != null) { - String varName = reg.getMIVar().getVarName(); - MIVarChange[] changes = noChanges; - MIVarUpdate update = factory.createMIVarUpdate(varName); - try { - mi.postCommand(update); - MIVarUpdateInfo updateInfo = update.getMIVarUpdateInfo(); - if (updateInfo == null) { - throw new CDIException("No answer"); - } - changes = updateInfo.getMIVarChanges(); - } catch (MIException e) { - //throw new MI2CDIException(e); - //eventList.add(new MIVarDeletedEvent(varName)); - } - if (changes.length != 0) { - for (int j = 0 ; j < changes.length; j++) { - String n = changes[j].getVarName(); - if (changes[j].isInScope()) { - eventList.add(new MIVarChangedEvent(n)); - } - } - } else { - // Fall back to the register number. - eventList.add(new MIRegisterChangedEvent(update.getToken(), reg.getName(), regnos[i])); - } - } - } - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - private Register[] getRegisters() { - return (Register[])regList.toArray(new Register[0]); - } - - - private Register getRegister(ICDIRegisterObject regObject) throws CDIException { - Register[] regs = getRegisters(); - for (int i = 0; i < regs.length; i++) { - if (regObject.getName().equals(regs[i].getName())) { - return regs[i]; - } - } - return null; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java deleted file mode 100644 index 46250887caa..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/RuntimeOptions.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.Iterator; -import java.util.Properties; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD; -import org.eclipse.cdt.debug.mi.core.command.MIExecArguments; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetEnvironment; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; - -/** - */ -public class RuntimeOptions implements ICDIRuntimeOptions { - - Session session; - - public RuntimeOptions(Session s) { - session = s; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions#setArguments(String) - */ - public void setArguments(String[] args) throws CDIException { - if (args == null || args.length == 0) { - return; - } - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecArguments arguments = factory.createMIExecArguments(args); - try { - mi.postCommand(arguments); - MIInfo info = arguments.getMIInfo(); - if (info == null) { - throw new CDIException("Unable to set arguments: target is not responding"); - } - } catch (MIException e) { - throw new CDIException("Unable to set arguments: " + e.getMessage()); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions#setEnvironment(Properties) - */ - public void setEnvironment(Properties props) throws CDIException { - if (props == null) { - return; - } - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - Iterator iterator = props.keySet().iterator(); - while (iterator.hasNext()) { - String key = (String)iterator.next(); - String value = props.getProperty(key); - String params[] = null; - if (value == null || value.length() == 0) { - params = new String[] {key}; - } else { - params = new String[] {key, value}; - } - MIGDBSetEnvironment set = factory.createMIGDBSetEnvironment(params); - try { - mi.postCommand(set); - MIInfo info = set.getMIInfo(); - if (info == null) { - throw new CDIException("Unable to set environment: target is not responding"); - } - } catch (MIException e) { - throw new CDIException("Unable to set environment: " + e.getMessage()); - } - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions#setWorkingDirectory(String) - */ - public void setWorkingDirectory(String wd) throws CDIException { - if (wd == null || wd.length() == 0) { - return; - } - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIEnvironmentCD cd = factory.createMIEnvironmentCD(wd); - try { - mi.postCommand(cd); - MIInfo info = cd.getMIInfo(); - if (info == null) { - throw new CDIException("Unable to set working directory: target is not responding"); - } - } catch (MIException e) { - throw new CDIException("Unable to set working directory: " + e.getMessage()); - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Session.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Session.java deleted file mode 100644 index 0dd2f35d29e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/Session.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.Properties; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDIEventManager; -import org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager; -import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager; -import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; -import org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.ICDISignalManager; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; -import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Target; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory; - -/** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession - */ -public class Session implements ICDISession, ICDISessionObject { - - Properties props; - MISession session; - EventManager eventManager; - BreakpointManager breakpointManager; - ExpressionManager expressionManager; - VariableManager variableManager; - RegisterManager registerManager; - MemoryManager memoryManager; - SharedLibraryManager sharedLibraryManager; - SignalManager signalManager; - SourceManager sourceManager; - ICDIConfiguration configuration; - Target ctarget; - - public Session(MISession s, boolean attach) { - commonSetup(s); - configuration = new Configuration(s, attach); - } - - public Session(MISession s) { - commonSetup(s); - configuration = new CoreFileConfiguration(); - } - - private void commonSetup(MISession s) { - session = s; - props = new Properties(); - - breakpointManager = new BreakpointManager(this); - - eventManager = new EventManager(this); - s.addObserver(eventManager); - - expressionManager = new ExpressionManager(this); - variableManager = new VariableManager(this); - registerManager = new RegisterManager(this); - memoryManager = new MemoryManager(this); - signalManager = new SignalManager(this); - sourceManager = new SourceManager(this); - sharedLibraryManager = new SharedLibraryManager(this); - ctarget = new Target(this); - } - - public MISession getMISession() { - return session; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getAttribute(String) - */ - public String getAttribute(String key) { - return props.getProperty(key); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getBreakpointManager() - */ - public ICDIBreakpointManager getBreakpointManager() { - return breakpointManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getEventManager() - */ - public ICDIEventManager getEventManager() { - return eventManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getExpressionManager() - */ - public ICDIExpressionManager getExpressionManager() { - return expressionManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getVariableManager() - */ - public ICDIVariableManager getVariableManager() { - return variableManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getRegisterManager() - */ - public ICDIRegisterManager getRegisterManager() { - return registerManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSharedLibraryManager() - */ - public ICDISharedLibraryManager getSharedLibraryManager() { - return sharedLibraryManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getMemoryManager() - */ - public ICDIMemoryManager getMemoryManager() { - return memoryManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSignalManager() - */ - public ICDISignalManager getSignalManager() { - return signalManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSourceManager() - */ - public ICDISourceManager getSourceManager() { - return sourceManager; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getTargets() - */ - public ICDITarget[] getTargets() { - return new ICDITarget[]{ctarget}; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getCurrentTarget() - */ - public ICDITarget getCurrentTarget() { - return ctarget; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#setCurrentTarget() - */ - public void setCurrentTarget(ICDITarget target) throws CDIException { - if (target instanceof Target) { - ctarget = (Target)target; - } else { - throw new CDIException("Unkown target"); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#setAttribute(String, String) - */ - public void setAttribute(String key, String value) { - props.setProperty(key, value); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#terminate() - */ - public void terminate() throws CDIException { - session.terminate(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getConfiguration() - */ - public ICDIConfiguration getConfiguration() { - return configuration; - } - - public void setConfiguration(ICDIConfiguration conf) { - configuration = conf; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getRuntimeOptions() - */ - public ICDIRuntimeOptions getRuntimeOptions() { - return new RuntimeOptions(this); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISessionObject#getSession() - */ - public ICDISession getSession() { - return this; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#addSearchPaths(String[]) - */ - public void addSearchPaths(String[] dirs) throws CDIException { - CommandFactory factory = session.getCommandFactory(); - MIEnvironmentDirectory dir = factory.createMIEnvironmentDirectory(dirs); - try { - session.postCommand(dir); - dir.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSessionProcess() - */ - public Process getSessionProcess() throws CDIException { - return session.getSessionProcess(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java deleted file mode 100644 index 46e1b441814..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SessionObject.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; - -/** - */ -public class SessionObject implements ICDISessionObject { - - private Session session; - - public SessionObject (Session session) { - this.session = session; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISessionObject#getSession() - */ - public ICDISession getSession() { - return session; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryEvent.java deleted file mode 100644 index 1c06dc0804f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent; - -/** - * - */ -public class SharedLibraryEvent extends SessionObject implements ICDISharedLibraryEvent { - - public SharedLibraryEvent(Session session) { - super(session); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java deleted file mode 100644 index 532200c8ca3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetAutoSolib; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetSolibSearchPath; -import org.eclipse.cdt.debug.mi.core.command.MIGDBSetStopOnSolibEvents; -import org.eclipse.cdt.debug.mi.core.command.MIGDBShow; -import org.eclipse.cdt.debug.mi.core.command.MIGDBShowSolibSearchPath; -import org.eclipse.cdt.debug.mi.core.command.MIInfoSharedLibrary; -import org.eclipse.cdt.debug.mi.core.command.MISharedLibrary; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibUnloadedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowInfo; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowSolibSearchPathInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoSharedLibraryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIShared; - -/** - * Manager of the CDI shared libraries. - */ -public class SharedLibraryManager extends SessionObject implements ICDISharedLibraryManager { - - List sharedList; - boolean autoupdate; - boolean isDeferred; - - public SharedLibraryManager (Session session) { - super(session); - sharedList = new ArrayList(1); - autoupdate = true; - } - - MIShared[] getMIShareds() throws CDIException { - MIShared[] miLibs = new MIShared[0]; - Session session = (Session)getSession(); - CommandFactory factory = session.getMISession().getCommandFactory(); - MIInfoSharedLibrary infoShared = factory.createMIInfoSharedLibrary(); - try { - session.getMISession().postCommand(infoShared); - MIInfoSharedLibraryInfo info = infoShared.getMIInfoSharedLibraryInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - miLibs = info.getMIShared(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - return miLibs; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#update() - */ - public void update() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - List eventList = updateState(); - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - - public List updateState() throws CDIException { - Session session = (Session)getSession(); - ICDIConfiguration conf = session.getConfiguration(); - if (!conf.supportsSharedLibrary()) { - return Collections.EMPTY_LIST; // Bail out early; - } - - MIShared[] miLibs = getMIShareds(); - ArrayList eventList = new ArrayList(miLibs.length); - for (int i = 0; i < miLibs.length; i++) { - ICDISharedLibrary sharedlib = getSharedLibrary(miLibs[i].getName()); - if (sharedlib != null) { - if (hasSharedLibChanged(sharedlib, miLibs[i])) { - // Fire ChangedEvent - ((SharedLibrary)sharedlib).setMIShared(miLibs[i]); - eventList.add(new MISharedLibChangedEvent(miLibs[i].getName())); - } - } else { - // add the new breakpoint and fire CreatedEvent - sharedList.add(new SharedLibrary(this, miLibs[i])); - eventList.add(new MISharedLibCreatedEvent(miLibs[i].getName())); - } - } - // Check if any libraries was unloaded. - ICDISharedLibrary[] oldlibs = (ICDISharedLibrary[])sharedList.toArray(new ICDISharedLibrary[0]); - for (int i = 0; i < oldlibs.length; i++) { - boolean found = false; - for (int j = 0; j < miLibs.length; j++) { - if (miLibs[j].getName().equals(oldlibs[i].getFileName())) { - found = true; - break; - } - } - if (!found) { - // Fire destroyed Events. - eventList.add(new MISharedLibUnloadedEvent(oldlibs[i].getFileName())); - } - } - return eventList; - } - - public boolean hasSharedLibChanged(ICDISharedLibrary lib, MIShared miLib) { - return !miLib.getName().equals(lib.getFileName()) || - miLib.getFrom() != lib.getStartAddress() || - miLib.getTo() != lib.getEndAddress() || - miLib.isRead() != lib.areSymbolsLoaded(); - } - - public void deleteSharedLibrary(ICDISharedLibrary lib) { - sharedList.remove(lib); - } - - public ICDISharedLibrary getSharedLibrary(String name) { - ICDISharedLibrary[] libs = (ICDISharedLibrary[])sharedList.toArray(new ICDISharedLibrary[0]); - for (int i = 0; i < libs.length; i++) { - if (name.equals(libs[i].getFileName())) { - return libs[i]; - } - } - return null; - } - - public void setDeferredBreakpoint (boolean set) { - isDeferred = set; - } - - public boolean isDeferredBreakpoint() { - return isDeferred; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setSharedLibraryPaths(String[]) - */ - public void setAutoLoadSymbols(boolean set) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBSetAutoSolib solib = factory.createMIGDBSetAutoSolib(set); - try { - mi.postCommand(solib); - solib.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - */ - public boolean isAutoLoadSymbols() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBShow show = factory.createMIGDBShow(new String[]{"auto-solib-add"}); - try { - mi.postCommand(show); - MIGDBShowInfo info = show.getMIGDBShowInfo(); - String value = info.getValue(); - if (value != null) { - return value.equalsIgnoreCase("on"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - return false; - } - - public void setStopOnSolibEvents(boolean set) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBSetStopOnSolibEvents stop = factory.createMIGDBSetStopOnSolibEvents(set); - try { - mi.postCommand(stop); - stop.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - public boolean isStopOnSolibEvents() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBShow show = factory.createMIGDBShow(new String[]{"stop-on-solib-events"}); - try { - mi.postCommand(show); - MIGDBShowInfo info = show.getMIGDBShowInfo(); - String value = info.getValue(); - if (value != null) { - return value.equalsIgnoreCase("1"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setSharedLibraryPaths(String[]) - */ - public void setSharedLibraryPaths(String[] libPaths) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBSetSolibSearchPath solib = factory.createMIGDBSetSolibSearchPath(libPaths); - try { - mi.postCommand(solib); - solib.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#getSharedLibraryPaths() - */ - public String[] getSharedLibraryPaths() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBShowSolibSearchPath dir = factory.createMIGDBShowSolibSearchPath(); - try { - mi.postCommand(dir); - MIGDBShowSolibSearchPathInfo info = dir.getMIGDBShowSolibSearchPathInfo(); - return info.getDirectories(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#getSharedLibraries() - */ - public ICDISharedLibrary[] getSharedLibraries() throws CDIException { - return (ICDISharedLibrary[])sharedList.toArray(new ICDISharedLibrary[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols() - */ - public void loadSymbols() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MISharedLibrary sharedlibrary = factory.createMISharedLibrary(); - try { - mi.postCommand(sharedlibrary); - MIInfo info = sharedlibrary.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - update(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#loadSymbols(ICDISharedLibrary[]) - */ - public void loadSymbols(ICDISharedLibrary[] libs) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - for (int i = 0; i < libs.length; i++) { - if (libs[i].areSymbolsLoaded()) { - continue; - } - MISharedLibrary sharedlibrary = factory.createMISharedLibrary(libs[i].getFileName()); - try { - session.getMISession().postCommand(sharedlibrary); - MIInfo info = sharedlibrary.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - ((SharedLibrary)libs[i]).getMIShared().setSymbolsRead(true); - mi.fireEvent(new MISharedLibChangedEvent(libs[i].getFileName())); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#supportsAutoLoadSymbols() - */ - public boolean supportsAutoLoadSymbols() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#supportsStopOnSolibEvents() - */ - public boolean supportsStopOnSolibEvents() - { - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalExitInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalExitInfo.java deleted file mode 100644 index baebff3c775..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalExitInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDISignalExitInfo; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorSignalExitEvent; - -/**. - */ -public class SignalExitInfo extends SessionObject implements ICDISignalExitInfo { - - MIInferiorSignalExitEvent event; - - public SignalExitInfo(Session session, MIInferiorSignalExitEvent e) { - super(session); - event = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalExitInfo#getName() - */ - public String getName() { - return event.getName(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalExitInfo#getDescription() - */ - public String getDescription() { - return event.getMeaning(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java deleted file mode 100644 index 4b3cb7dc4be..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalManager.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISignalManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Signal; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIHandle; -import org.eclipse.cdt.debug.mi.core.command.MIInfoSignals; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIInfoSignalsInfo; -import org.eclipse.cdt.debug.mi.core.output.MISigHandle; - -/** - */ -public class SignalManager extends SessionObject implements ICDISignalManager { - - boolean autoupdate; - MISigHandle[] noSigs = new MISigHandle[0]; - List signalsList = null; - - public SignalManager(Session session) { - super(session); - autoupdate = false; - } - - MISigHandle[] getMISignals() throws CDIException { - MISigHandle[] miSigs = noSigs; - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIInfoSignals sigs = factory.createMIInfoSignals(); - try { - mi.postCommand(sigs); - MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - miSigs = info.getMISignals(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - return miSigs; - } - - MISigHandle getMISignal(String name) throws CDIException { - MISigHandle sig = null; - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIInfoSignals sigs = factory.createMIInfoSignals(name); - try { - mi.postCommand(sigs); - MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MISigHandle[] miSigs = info.getMISignals(); - if (miSigs.length > 0) { - sig = miSigs[0]; - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - return sig; - } - - /** - * Method hasSignalChanged. - * @param sig - * @param mISignal - * @return boolean - */ - private boolean hasSignalChanged(ICDISignal sig, MISigHandle miSignal) { - return !sig.getName().equals(miSignal.getName()) || - sig.isStopSet() != miSignal.isStop() || - sig.isIgnore() != !miSignal.isPass(); - } - - public ICDISignal findSignal(String name) { - ICDISignal sig = null; - if (signalsList != null) { - ICDISignal[] sigs = (ICDISignal[])signalsList.toArray(new ICDISignal[0]); - for (int i = 0; i < sigs.length; i++) { - if (sigs[i].getName().equals(name)) { - sig = sigs[i]; - break; - } - } - } - return sig; - } - - public ICDISignal getSignal(String name) { - ICDISignal sig = findSignal(name); - if (sig == null) { - MISigHandle miSig = null; - try { - miSig = getMISignal(name); - sig = new Signal(this, miSig); - if (signalsList != null) { - signalsList.add(sig); - } - } catch (CDIException e) { - // The session maybe terminated because of the signal. - miSig = new MISigHandle(name, false, false, false, name); - sig = new Signal(this, miSig); - } - } - return sig; - } - - public void handle(ICDISignal sig, boolean isIgnore, boolean isStop) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - StringBuffer buffer = new StringBuffer(sig.getName()); - buffer.append(" "); - if (isIgnore) { - buffer.append("ignore"); - } else { - buffer.append("noignore"); - } - buffer.append(" "); - if (isStop) { - buffer.append("stop"); - } else { - buffer.append("nostop"); - } - MIHandle handle = factory.createMIHandle(buffer.toString()); - try { - mi.postCommand(handle); - handle.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - ((Signal)sig).getMISignal().handle(isIgnore, isStop); - mi.fireEvent(new MISignalChangedEvent(sig.getName())); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#getSignals() - */ - public ICDISignal[] getSignals() throws CDIException { - if (signalsList == null) { - update(); - } - return (ICDISignal[])signalsList.toArray(new ICDISignal[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#update() - */ - public void update() throws CDIException { - Session session = (Session)getSession(); - MISigHandle[] miSigs = getMISignals(); - List eventList = new ArrayList(miSigs.length); - if (signalsList == null) { - signalsList = Collections.synchronizedList(new ArrayList(5)); - } - for (int i = 0; i < miSigs.length; i++) { - ICDISignal sig = findSignal(miSigs[i].getName()); - if (sig != null) { - if (hasSignalChanged(sig, miSigs[i])) { - // Fire ChangedEvent - ((Signal)sig).setMISignal(miSigs[i]); - eventList.add(new MISignalChangedEvent(miSigs[i].getName())); - } - } else { - // add the new breakpoint and fire CreatedEvent - signalsList.add(new Signal(this, miSigs[i])); - } - } - MISession mi = session.getMISession(); - MIEvent[] events = (MIEvent[])eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalReceived.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalReceived.java deleted file mode 100644 index 3d3abbaddab..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SignalReceived.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.mi.core.event.MISignalEvent; - -/** - */ -public class SignalReceived extends SessionObject implements ICDISignalReceived { - - ICDISignal signal; - public SignalReceived(Session session, MISignalEvent event) { - super(session); - SignalManager mgr = (SignalManager)session.getSignalManager(); - signal = mgr.getSignal(event.getName()); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignalReceived#getSignal() - */ - public ICDISignal getSignal() { - return signal; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java deleted file mode 100644 index 10f2beac425..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java +++ /dev/null @@ -1,445 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.StringTokenizer; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.GDBTypeParser; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.GDBTypeParser.GDBDerivedType; -import org.eclipse.cdt.debug.mi.core.GDBTypeParser.GDBType; -import org.eclipse.cdt.debug.mi.core.cdi.model.Instruction; -import org.eclipse.cdt.debug.mi.core.cdi.model.MixedInstruction; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.ArrayType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.BoolType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.CharType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.DerivedType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.DoubleType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.EnumType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.FloatType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.FunctionType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.IntType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.LongLongType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.LongType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.PointerType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.ReferenceType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.ShortType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.StructType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.Type; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.VoidType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.WCharType; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataDisassemble; -import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentDirectory; -import org.eclipse.cdt.debug.mi.core.command.MIGDBShowDirectories; -import org.eclipse.cdt.debug.mi.core.command.MIPType; -import org.eclipse.cdt.debug.mi.core.output.MIAsm; -import org.eclipse.cdt.debug.mi.core.output.MIDataDisassembleInfo; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowDirectoriesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIPTypeInfo; -import org.eclipse.cdt.debug.mi.core.output.MISrcAsm; - - -/** - */ -public class SourceManager extends SessionObject implements ICDISourceManager { - - boolean autoupdate; - GDBTypeParser gdbTypeParser; - - public SourceManager(Session session) { - super(session); - autoupdate = false; - gdbTypeParser = new GDBTypeParser(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#addSourcePaths(String[]) - */ - public void addSourcePaths(String[] dirs) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIEnvironmentDirectory dir = factory.createMIEnvironmentDirectory(dirs); - try { - mi.postCommand(dir); - dir.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getSourcePaths() - */ - public String[] getSourcePaths() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIGDBShowDirectories dir = factory.createMIGDBShowDirectories(); - try { - mi.postCommand(dir); - MIGDBShowDirectoriesInfo info = dir.getMIGDBShowDirectoriesInfo(); - return info.getDirectories(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(String, int, int) - */ - public ICDIInstruction[] getInstructions(String filename, int linenum, int lines) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataDisassemble dis = factory.createMIDataDisassemble(filename, linenum, lines, false); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MIAsm[] asm = info.getMIAsms(); - Instruction[] instructions = new Instruction[asm.length]; - for (int i = 0; i < instructions.length; i++) { - instructions[i] = new Instruction(session.getCurrentTarget(), asm[i]); - } - return instructions; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(String, int) - */ - public ICDIInstruction[] getInstructions(String filename, int linenum) throws CDIException { - return getInstructions(filename, linenum, -1); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long) - */ - public ICDIInstruction[] getInstructions(long start, long end) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String hex = "0x"; - String sa = hex + Long.toHexString(start); - String ea = hex + Long.toHexString(end); - MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MIAsm[] asm = info.getMIAsms(); - Instruction[] instructions = new Instruction[asm.length]; - for (int i = 0; i < instructions.length; i++) { - instructions[i] = new Instruction(session.getCurrentTarget(), asm[i]); - } - return instructions; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(String, int, int) - */ - public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum, int lines) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataDisassemble dis = factory.createMIDataDisassemble(filename, linenum, lines, true); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MISrcAsm[] srcAsm = info.getMISrcAsms(); - ICDIMixedInstruction[] mixed = new ICDIMixedInstruction[srcAsm.length]; - for (int i = 0; i < mixed.length; i++) { - mixed[i] = new MixedInstruction(session.getCurrentTarget(), srcAsm[i]); - } - return mixed; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(String, int) - */ - public ICDIMixedInstruction[] getMixedInstructions(String filename, int linenum) throws CDIException { - return getMixedInstructions(filename, linenum, -1); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(long, long) - */ - public ICDIMixedInstruction[] getMixedInstructions(long start, long end) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String hex = "0x"; - String sa = hex + Long.toHexString(start); - String ea = hex + Long.toHexString(end); - MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true); - try { - mi.postCommand(dis); - MIDataDisassembleInfo info = dis.getMIDataDisassembleInfo(); - MISrcAsm[] srcAsm = info.getMISrcAsms(); - ICDIMixedInstruction[] mixed = new ICDIMixedInstruction[srcAsm.length]; - for (int i = 0; i < mixed.length; i++) { - mixed[i] = new MixedInstruction(session.getCurrentTarget(), srcAsm[i]); - } - return mixed; - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#update() - */ - public void update() throws CDIException { - } - - - public Type getType(ICDITarget target, String name) throws CDIException { - if (name == null) { - name = new String(); - } - String typename = name.trim(); - - // Parse the string. - GDBType gdbType = gdbTypeParser.parse(typename); - Type headType = null; - Type type = null; - - // Convert the GDBType to an ICDIType. - // So we go through the gdbType tree and reconstruct an ICDIType tree - for (Type aType = null; gdbType != null; type = aType) { - if (gdbType instanceof GDBDerivedType) { - switch(gdbType.getType()) { - case GDBType.ARRAY: - int d = ((GDBDerivedType)gdbType).getDimension(); - aType = new ArrayType(target, gdbType.toString(), d); - break; - case GDBType.FUNCTION: - aType = new FunctionType(target, gdbType.toString()); - break; - case GDBType.POINTER: - aType = new PointerType(target, gdbType.toString()); - break; - case GDBType.REFERENCE: - aType = new ReferenceType(target, gdbType.toString()); - break; - } - gdbType = ((GDBDerivedType)gdbType).getChild(); - } else { - aType = toCDIType(target, gdbType.toString()); - gdbType = null; - } - if (type instanceof DerivedType) { - ((DerivedType)type).setComponentType(aType); - } - // Save the head to returning it. - if (headType == null) { - headType = aType; - } - } - - if (headType != null) { - return headType; - } - throw new CDIException("Unknown type"); - } - - Type toCDIType(ICDITarget target, String name) throws CDIException { - // Check the derived types and agregate types - if (name == null) { - name = new String(); - } - String typename = name.trim(); - - // Check the primitives. - if (typename.equals("char")) { - return new CharType(target, typename); - } else if (typename.equals("wchar_t")) { - return new WCharType(target, typename); - } else if (typename.equals("short")) { - return new ShortType(target, typename); - } else if (typename.equals("int")) { - return new IntType(target, typename); - } else if (typename.equals("long")) { - return new LongType(target, typename); - } else if (typename.equals("unsigned")) { - return new IntType(target, typename, true); - } else if (typename.equals("signed")) { - return new IntType(target, typename); - } else if (typename.equals("bool")) { - return new BoolType(target, typename); - } else if (typename.equals("_Bool")) { - return new BoolType(target, typename); - } else if (typename.equals("float")) { - return new FloatType(target, typename); - } else if (typename.equals("double")) { - return new DoubleType(target, typename); - } else if (typename.equals("void")) { - return new VoidType(target, typename); - } else if (typename.equals("enum")) { - return new EnumType(target, typename); - } else if (typename.equals("union")) { - return new StructType(target, typename); - } else if (typename.equals("struct")) { - return new StructType(target, typename); - } else if (typename.equals("class")) { - return new StructType(target, typename); - } - - StringTokenizer st = new StringTokenizer(typename); - int count = st.countTokens(); - - if (count == 2) { - String first = st.nextToken(); - String second = st.nextToken(); - - // ISOC allows permutations: - // "signed int" and "int signed" are equivalent - boolean isUnsigned = (first.equals("unsigned") || second.equals("unsigned")); - boolean isSigned = (first.equals("signed") || second.equals("signed")); - boolean isChar = (first.equals("char") || second.equals("char")); - boolean isInt = (first.equals("int") || second.equals("int")); - boolean isLong = (first.equals("long") || second.equals("long")); - boolean isShort = (first.equals("short") || second.equals("short")); - boolean isLongLong = (first.equals("long") && second.equals("long")); - - boolean isDouble = (first.equals("double") || second.equals("double")); - boolean isFloat = (first.equals("float") || second.equals("float")); - boolean isComplex = (first.equals("complex") || second.equals("complex") || - first.equals("_Complex") || second.equals("_Complex")); - boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary")); - - boolean isStruct = first.equals("struct"); - boolean isClass = first.equals("class"); - boolean isUnion = first.equals("union"); - boolean isEnum = first.equals("enum"); - - if (isChar && (isSigned || isUnsigned)) { - return new CharType(target, typename, isUnsigned); - } else if (isShort && (isSigned || isUnsigned)) { - return new ShortType(target, typename, isUnsigned); - } else if (isInt && (isSigned || isUnsigned)) { - return new IntType(target, typename, isUnsigned); - } else if (isLong && (isInt || isSigned || isUnsigned)) { - return new LongType(target, typename, isUnsigned); - } else if (isLongLong) { - return new LongLongType(target, typename); - } else if (isDouble && (isLong || isComplex || isImaginery)) { - return new DoubleType(target, typename, isComplex, isImaginery, isLong); - } else if (isFloat && (isComplex || isImaginery)) { - return new FloatType(target, typename, isComplex, isImaginery); - } else if (isStruct) { - return new StructType(target, typename); - } else if (isClass) { - return new StructType(target, typename); - } else if (isUnion) { - return new StructType(target, typename); - } else if (isEnum) { - return new EnumType(target, typename); - } - } else if (count == 3) { - // ISOC allows permutation. replace short by: long or short - // "unsigned short int", "unsigned int short" - // "short unsigned int". "short int unsigned" - // "int unsinged short". "int short unsigned" - // - // "unsigned long long", "long long unsigned" - // "signed long long", "long long signed" - String first = st.nextToken(); - String second = st.nextToken(); - String third = st.nextToken(); - - boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed")); - boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned")); - boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int")); - boolean isLong = (first.equals("long") || second.equals("long") || third.equals("long")); - boolean isShort = (first.equals("short") || second.equals("short") || third.equals("short")); - boolean isLongLong = (first.equals("long") && second.equals("long")) || - (second.equals("long") && third.equals("long")); - boolean isDouble = (first.equals("double") || second.equals("double") || third.equals("double")); - boolean isComplex = (first.equals("complex") || second.equals("complex") || third.equals("complex") || - first.equals("_Complex") || second.equals("_Complex") || third.equals("_Complex")); - boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary") || third.equals("_Imaginary")); - - - if (isShort && isInt && (isSigned || unSigned)) { - return new ShortType(target, typename, unSigned); - } else if (isLong && isInt && (isSigned || unSigned)) { - return new LongType(target, typename, unSigned); - } else if (isLongLong && (isSigned || unSigned)) { - return new LongLongType(target, typename, unSigned); - } else if (isDouble && isLong && (isComplex || isImaginery)) { - return new DoubleType(target, typename, isComplex, isImaginery, isLong); - } - } else if (count == 4) { - // ISOC allows permutation: - // "unsigned long long int", "unsigned int long long" - // "long long unsigned int". "long long int unsigned" - // "int unsigned long long". "int long long unsigned" - String first = st.nextToken(); - String second = st.nextToken(); - String third = st.nextToken(); - String fourth = st.nextToken(); - - boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned") || fourth.equals("unsigned")); - boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed") || fourth.equals("signed")); - boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int") || fourth.equals("int")); - boolean isLongLong = (first.equals("long") && second.equals("long")) - || (second.equals("long") && third.equals("long")) - || (third.equals("long") && fourth.equals("long")); - - if (isLongLong && isInt && (isSigned || unSigned)) { - return new LongLongType(target, typename, unSigned); - } - } - throw new CDIException("Unknown type"); - } - - public String getDetailTypeName(String typename) throws CDIException { - try { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIPType ptype = factory.createMIPType(typename); - mi.postCommand(ptype); - MIPTypeInfo info = ptype.getMIPtypeInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - return info.getType(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java deleted file mode 100644 index 2c51b5e9ca5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java +++ /dev/null @@ -1,584 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument; -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.model.Argument; -import org.eclipse.cdt.debug.mi.core.cdi.model.ArgumentObject; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; -import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIPType; -import org.eclipse.cdt.debug.mi.core.command.MIStackListArguments; -import org.eclipse.cdt.debug.mi.core.command.MIStackListLocals; -import org.eclipse.cdt.debug.mi.core.command.MIVarCreate; -import org.eclipse.cdt.debug.mi.core.command.MIVarDelete; -import org.eclipse.cdt.debug.mi.core.command.MIVarUpdate; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarDeletedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIArg; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIPTypeInfo; -import org.eclipse.cdt.debug.mi.core.output.MIStackListArgumentsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIStackListLocalsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVar; -import org.eclipse.cdt.debug.mi.core.output.MIVarChange; -import org.eclipse.cdt.debug.mi.core.output.MIVarCreateInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo; - -/** - */ -public class VariableManager extends SessionObject implements ICDIVariableManager { - - // We put a restriction on how deep we want to - // go when doing update of the variables. - // If the number is to high, gdb will just hang. - int MAX_STACK_DEPTH = 200; - List variableList; - boolean autoupdate; - MIVarChange[] noChanges = new MIVarChange[0]; - - public VariableManager(Session session) { - super(session); - variableList = Collections.synchronizedList(new ArrayList()); - autoupdate = true; - } - - /** - * Return the element that have the uniq varName. - * null is return if the element is not in the cache. - */ - public Variable getVariable(String varName) { - Variable[] vars = getVariables(); - for (int i = 0; i < vars.length; i++) { - if (vars[i].getMIVar().getVarName().equals(varName)) { - return vars[i]; - } - Variable v = vars[i].getChild(varName); - if (v != null) { - return v; - } - } - return null; - } - - /** - * Return the Element with this stackframe, and with this name. - * null is return if the element is not in the cache. - */ - Variable findVariable(VariableObject v) throws CDIException { - ICDIStackFrame stack = v.getStackFrame(); - String name = v.getName(); - int position = v.getPosition(); - int depth = v.getStackDepth(); - Variable[] vars = getVariables(); - for (int i = 0; i < vars.length; i++) { - if (vars[i].getName().equals(name) - && vars[i].getCastingArrayStart() == v.getCastingArrayStart() - && vars[i].getCastingArrayEnd() == v.getCastingArrayEnd() - && ((vars[i].getCastingType() == null && v.getCastingType() == null) - || (vars[i].getCastingType() != null - && v.getCastingType() != null - && vars[i].getCastingType().equals(v.getCastingType())))) { - ICDIStackFrame frame = vars[i].getStackFrame(); - if (stack == null && frame == null) { - return vars[i]; - } else if (frame != null && stack != null && frame.equals(stack)) { - if (vars[i].getPosition() == position) { - if (vars[i].getStackDepth() == depth) { - return vars[i]; - } - } - } - } - } - return null; - } - - /** - * Returns all the elements that are in the cache. - */ - Variable[] getVariables() { - return (Variable[]) variableList.toArray(new Variable[0]); - } - - /** - * Check the type - */ - public void checkType(String type) throws CDIException { - if (type != null && type.length() > 0) { - try { - MISession mi = ((Session) getSession()).getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIPType ptype = factory.createMIPType(type); - mi.postCommand(ptype); - MIPTypeInfo info = ptype.getMIPtypeInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } else { - throw new CDIException("Unknown type"); - } - } - - /** - * Tell gdb to remove the underlying var-object also. - */ - void removeMIVar(MIVar miVar) throws CDIException { - Session session = (Session) getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarDelete var = factory.createMIVarDelete(miVar.getVarName()); - try { - mi.postCommand(var); - var.getMIInfo(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * When element are remove from the cache, they are put on the OutOfScope list, oos, - * because they are still needed for the destroy events. The destroy event will - * call removeOutOfScope. - */ - public void removeVariable(String varName) throws CDIException { - Variable[] vars = getVariables(); - for (int i = 0; i < vars.length; i++) { - if (vars[i].getMIVar().getVarName().equals(varName)) { - variableList.remove(vars[i]); - removeMIVar(vars[i].getMIVar()); - } - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createArgument(ICDIArgumentObject) - */ - public ICDIArgument createArgument(ICDIArgumentObject a) throws CDIException { - ArgumentObject argObj = null; - if (a instanceof ArgumentObject) { - argObj = (ArgumentObject) a; - } - if (argObj != null) { - Variable variable = findVariable(argObj); - Argument argument = null; - if (variable != null && variable instanceof Argument) { - argument = (Argument) variable; - } - if (argument == null) { - String name = argObj.getQualifiedName(); - ICDIStackFrame stack = argObj.getStackFrame(); - Session session = (Session) getSession(); - ICDIThread currentThread = null; - ICDIStackFrame currentFrame = null; - if (stack != null) { - ICDITarget currentTarget = session.getCurrentTarget(); - currentThread = currentTarget.getCurrentThread(); - currentFrame = currentThread.getCurrentStackFrame(); - stack.getThread().setCurrentStackFrame(stack, false); - } - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarCreate var = factory.createMIVarCreate(name); - mi.postCommand(var); - MIVarCreateInfo info = var.getMIVarCreateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - argument = new Argument(argObj, info.getMIVar()); - variableList.add(argument); - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - if (currentThread != null) { - currentThread.setCurrentStackFrame(currentFrame, false); - } - } - } - return argument; - } - throw new CDIException("Wrong variable type"); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getArgumentObjects(ICDIStackFrame) - */ - public ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame frame) throws CDIException { - List argObjects = new ArrayList(); - Session session = (Session) getSession(); - ICDITarget currentTarget = session.getCurrentTarget(); - ICDIThread currentThread = currentTarget.getCurrentThread(); - ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); - frame.getThread().setCurrentStackFrame(frame, false); - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - int depth = frame.getThread().getStackFrameCount(); - int level = frame.getLevel(); - // Need the GDB/MI view of leve which the reverse i.e. Highest frame is 0 - int miLevel = depth - level; - MIStackListArguments listArgs = factory.createMIStackListArguments(false, miLevel, miLevel); - MIArg[] args = null; - mi.postCommand(listArgs); - MIStackListArgumentsInfo info = listArgs.getMIStackListArgumentsInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MIFrame[] miFrames = info.getMIFrames(); - if (miFrames != null && miFrames.length == 1) { - args = miFrames[0].getArgs(); - } - if (args != null) { - ICDITarget tgt = frame.getThread().getTarget(); - for (int i = 0; i < args.length; i++) { - ArgumentObject arg = new ArgumentObject(tgt, args[i].getName(), frame, args.length - i, level); - argObjects.add(arg); - } - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - currentThread.setCurrentStackFrame(currentFrame); - } - return (ICDIArgumentObject[]) argObjects.toArray(new ICDIArgumentObject[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getGlobalVariableObject(String, String, String) - */ - public ICDIVariableObject getGlobalVariableObject(String filename, String function, String name) throws CDIException { - if (filename == null) { - filename = new String(); - } - if (function == null) { - function = new String(); - } - if (name == null) { - name = new String(); - } - StringBuffer buffer = new StringBuffer(); - if (filename.length() > 0) { - buffer.append('\'').append(filename).append('\'').append("::"); - } - if (function.length() > 0) { - buffer.append(function).append("::"); - } - buffer.append(name); - ICDITarget target = getSession().getCurrentTarget(); - return new VariableObject(target, buffer.toString(), null, 0, 0); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, int, int) - */ - public ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject object, int start, int length) - throws CDIException { - VariableObject obj = null; - if (object instanceof VariableObject) { - obj = (VariableObject) object; - } - if (obj != null) { - VariableObject vo = - new VariableObject( - obj.getTarget(), - obj.getName(), - obj.getFullName(), - obj.getStackFrame(), - obj.getPosition(), - obj.getStackDepth()); - vo.setCastingArrayStart(obj.getCastingArrayStart() + start); - vo.setCastingArrayEnd(length); - return vo; - } - throw new CDIException("Unknown variable object"); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int) - */ - public ICDIVariableObject getVariableObjectAsType(ICDIVariableObject object, String type) throws CDIException { - VariableObject obj = null; - if (object instanceof VariableObject) { - obj = (VariableObject) object; - } - if (obj != null) { - // throw an exception if not a good type. - checkType(type); - VariableObject vo = - new VariableObject( - obj.getTarget(), - obj.getName(), - obj.getFullName(), - obj.getStackFrame(), - obj.getPosition(), - obj.getStackDepth()); - String casting = obj.getCastingType(); - if (casting != null && casting.length() > 0) { - type = "(" + type + ")" + "(" + casting + " )"; - } - vo.setCastingType(type); - return vo; - } - throw new CDIException("Unknown variable object"); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjects(ICDIStackFrame) - */ - public ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame frame) throws CDIException { - List varObjects = new ArrayList(); - Session session = (Session) getSession(); - ICDITarget currentTarget = session.getCurrentTarget(); - ICDIThread currentThread = currentTarget.getCurrentThread(); - ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame(); - frame.getThread().setCurrentStackFrame(frame, false); - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - int level = frame.getLevel(); - MIArg[] args = null; - MIStackListLocals locals = factory.createMIStackListLocals(false); - mi.postCommand(locals); - MIStackListLocalsInfo info = locals.getMIStackListLocalsInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - args = info.getLocals(); - if (args != null) { - ICDITarget tgt = frame.getThread().getTarget(); - for (int i = 0; i < args.length; i++) { - VariableObject varObj = new VariableObject(tgt, args[i].getName(), frame, args.length - i, level); - varObjects.add(varObj); - } - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - currentThread.setCurrentStackFrame(currentFrame, false); - } - return (ICDIVariableObject[]) varObjects.toArray(new ICDIVariableObject[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjects(ICDIStackFrame) - */ - public ICDIVariableObject[] getVariableObjects(ICDIStackFrame frame) throws CDIException { - ICDIVariableObject[] locals = getLocalVariableObjects(frame); - ICDIVariableObject[] args = getArgumentObjects(frame); - ICDIVariableObject[] vars = new ICDIVariableObject[locals.length + args.length]; - System.arraycopy(locals, 0, vars, 0, locals.length); - System.arraycopy(args, 0, vars, locals.length, args.length); - return vars; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createVariable(ICDIVariableObject) - */ - public ICDIVariable createVariable(ICDIVariableObject v) throws CDIException { - VariableObject varObj = null; - if (v instanceof VariableObject) { - varObj = (VariableObject) v; - } - if (varObj != null) { - Variable variable = findVariable(varObj); - if (variable == null) { - String name = varObj.getQualifiedName(); - Session session = (Session) getSession(); - ICDIStackFrame stack = varObj.getStackFrame(); - ICDIThread currentThread = null; - ICDIStackFrame currentFrame = null; - if (stack != null) { - ICDITarget currentTarget = session.getCurrentTarget(); - currentThread = currentTarget.getCurrentThread(); - currentFrame = currentThread.getCurrentStackFrame(); - stack.getThread().setCurrentStackFrame(stack, false); - } - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarCreate var = factory.createMIVarCreate(name); - mi.postCommand(var); - MIVarCreateInfo info = var.getMIVarCreateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - variable = new Variable(varObj, info.getMIVar()); - variableList.add(variable); - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - if (currentThread != null) { - currentThread.setCurrentStackFrame(currentFrame, false); - } - } - } - return variable; - } - throw new CDIException("Wrong variable type"); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#destroyVariable(ICDIVariable) - */ - public void destroyVariable(ICDIVariable var) throws CDIException { - if (var instanceof Variable) { - // Fire a destroyEvent ? - Variable variable = (Variable) var; - MIVarDeletedEvent del = new MIVarDeletedEvent(variable.getMIVar().getVarName()); - Session session = (Session) getSession(); - MISession mi = session.getMISession(); - mi.fireEvent(del); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#isAutoUpdate() - */ - public boolean isAutoUpdate() { - return autoupdate; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#setAutoUpdate(boolean) - */ - public void setAutoUpdate(boolean update) { - autoupdate = update; - } - - /** - * Update the elements in the cache, from the response of the "-var-update" - * mi/command. Althought tempting we do not use the "-var-update *" command, since - * for some reason on gdb-5.2.1 it starts to misbehave until it hangs ... sigh - * We take the approach of updating the variables ourselfs. But we do it a smart - * way by only updating the variables visible in the current stackframe but not - * the other locals in different frames. The downside if any side effects we loose, - * This ok, since the IDE only a frame at a time. - * - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createArgument(ICDIArgumentObject) - */ - public void update() throws CDIException { - int high = 0; - int low = 0; - List eventList = new ArrayList(); - Session session = (Session) getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - Variable[] vars = getVariables(); - ICDITarget currentTarget = session.getCurrentTarget(); - ICDIStackFrame[] frames = null; - ICDIStackFrame currentStack = null; - if (currentTarget != null) { - ICDIThread currentThread = currentTarget.getCurrentThread(); - if (currentThread != null) { - currentStack = currentThread.getCurrentStackFrame(); - if (currentStack != null) { - high = currentStack.getLevel(); - } - if (high > 0) { - high--; - } - low = high - MAX_STACK_DEPTH; - if (low < 0) { - low = 0; - } - frames = currentThread.getStackFrames(low, high); - } - } - for (int i = 0; i < vars.length; i++) { - Variable variable = vars[i]; - if (isVariableNeedsToBeUpdate(variable, currentStack, frames, low)) { - String varName = variable.getMIVar().getVarName(); - MIVarChange[] changes = noChanges; - MIVarUpdate update = factory.createMIVarUpdate(varName); - try { - mi.postCommand(update); - MIVarUpdateInfo info = update.getMIVarUpdateInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - changes = info.getMIVarChanges(); - } catch (MIException e) { - //throw new MI2CDIException(e); - eventList.add(new MIVarDeletedEvent(varName)); - } - for (int j = 0; j < changes.length; j++) { - String n = changes[j].getVarName(); - if (changes[j].isInScope()) { - eventList.add(new MIVarChangedEvent(n)); - } else { - eventList.add(new MIVarDeletedEvent(n)); - } - } - } - } - MIEvent[] events = (MIEvent[]) eventList.toArray(new MIEvent[0]); - mi.fireEvents(events); - } - - /** - * We are trying to minimize the impact of the updates, this can be very long and unncessary if we - * have a very deep stack and lots of local variables. We can assume here that the local variables - * in the other non-selected stackframe will not change and only update the selected frame variables. - * - * @param variable - * @param current - * @param frames - * @return - */ - boolean isVariableNeedsToBeUpdate(Variable variable, ICDIStackFrame current, ICDIStackFrame[] frames, int low) - throws CDIException { - ICDIStackFrame varStack = variable.getStackFrame(); - boolean inScope = false; - - // Something wrong and the program terminated bail out here. - if (current == null || frames == null) { - return false; - } - - // If the variable Stack is null, it means this is a global variable we should update - if (varStack == null) { - return true; - } else if (varStack.equals(current)) { - // The variable is in the current selected frame it should be updated - return true; - } else { - if (varStack.getLevel() >= low) { - // Check if the Variable is still in Scope - // if it is no longer in scope so update() call call "-var-delete". - for (int i = 0; i < frames.length; i++) { - if (varStack.equals(frames[i])) { - inScope = true; - } - } - } else { - inScope = true; - } - } - // return true if the variable is no longer in scope we - // need to call -var-delete. - return !inScope; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointScope.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointScope.java deleted file mode 100644 index 94b72091d69..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointScope.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope; -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; -import org.eclipse.cdt.debug.mi.core.cdi.model.Watchpoint; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointScopeEvent; - -/** - */ -public class WatchpointScope extends SessionObject implements ICDIWatchpointScope { - - MIWatchpointScopeEvent watchEvent; - - public WatchpointScope(Session session, MIWatchpointScopeEvent e) { - super(session); - watchEvent = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope#getWatchpoint() - */ - public ICDIWatchpoint getWatchpoint() { - int number = watchEvent.getNumber(); - // Ask the breakpointManager for the breakpoint - BreakpointManager mgr = (BreakpointManager)getSession().getBreakpointManager(); - // We need to return the same object as the reason. - Watchpoint point = mgr.getWatchpoint(number); - // FIXME: if point ==null ??? Create a new breakpoint ? - return point; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointTrigger.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointTrigger.java deleted file mode 100644 index 68a70880f3b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/WatchpointTrigger.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi; - -import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger; -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; -import org.eclipse.cdt.debug.mi.core.cdi.model.Watchpoint; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointTriggerEvent; - -/** - */ -public class WatchpointTrigger extends SessionObject implements ICDIWatchpointTrigger { - - MIWatchpointTriggerEvent watchEvent; - - public WatchpointTrigger(Session session, MIWatchpointTriggerEvent e) { - super(session); - watchEvent = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger#getNewValue() - */ - public String getNewValue() { - return watchEvent.getNewValue(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger#getOldValue() - */ - public String getOldValue() { - return watchEvent.getOldValue(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger#getWatchpoint() - */ - public ICDIWatchpoint getWatchpoint() { - int number = watchEvent.getNumber(); - // Ask the breakpointManager for the breakpoint - BreakpointManager mgr = (BreakpointManager)getSession().getBreakpointManager(); - // We need to return the same object as the reason. - Watchpoint point = mgr.getWatchpoint(number); - // FIXME: if point ==null ??? Create a new breakpoint ? - return point; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java deleted file mode 100644 index 695e7a5f5e9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ChangedEvent.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; -import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager; -import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.cdi.SignalManager; -import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; -import org.eclipse.cdt.debug.mi.core.cdi.model.CObject; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRegisterChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent; - -/** - */ -public class ChangedEvent implements ICDIChangedEvent { - - Session session; - ICDIObject source; - - public ChangedEvent(Session s, MIVarChangedEvent var) { - session = s; - - // Try the Variable manager. - VariableManager mgr = (VariableManager)session.getVariableManager(); - String varName = var.getVarName(); - source = mgr.getVariable(varName); - - // Try the Expression manager - if (source == null) { - ExpressionManager expMgr = (ExpressionManager)session.getExpressionManager(); - source = expMgr.getExpression(varName); - } - - // Try the Register manager - if (source == null) { - RegisterManager regMgr = (RegisterManager)session.getRegisterManager(); - source = regMgr.getRegister(varName); - } - - // Fall back - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public ChangedEvent(Session s, MIRegisterChangedEvent var) { - session = s; - RegisterManager mgr = (RegisterManager)session.getRegisterManager(); - int regno = var.getNumber(); - source = mgr.getRegister(regno); - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public ChangedEvent(Session s, MIBreakpointChangedEvent bpoint) { - session = s; - BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager(); - int number = bpoint.getNumber(); - ICDIBreakpoint breakpoint = mgr.getBreakpoint(number); - if (breakpoint != null) { - source = breakpoint; - } else { - source = new CObject(session.getCurrentTarget()); - } - } - - public ChangedEvent(Session s, MISharedLibChangedEvent slib) { - session = s; - SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager(); - String name = slib.getName(); - ICDISharedLibrary lib = mgr.getSharedLibrary(name); - if (lib != null) { - source = lib; - } else { - source = new CObject(session.getCurrentTarget()); - } - } - - public ChangedEvent(Session s, MISignalChangedEvent sig) { - session = s; - SignalManager mgr = (SignalManager)session.getSignalManager(); - String name = sig.getName(); - ICDISignal signal = mgr.getSignal(name); - if (signal != null) { - source = signal; - } else { - source = new CObject(session.getCurrentTarget()); - } - } - - public ChangedEvent(Session s, ICDIObject src) { - session = s; - source = src; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return source; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java deleted file mode 100644 index 3db0d311914..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; -import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager; -import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; -import org.eclipse.cdt.debug.mi.core.cdi.model.CObject; -import org.eclipse.cdt.debug.mi.core.cdi.model.Target; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIMemoryCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIRegisterCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarCreatedEvent; - -/** - */ -public class CreatedEvent implements ICDICreatedEvent { - - Session session; - ICDIObject source; - - public CreatedEvent(Session s, MIBreakpointCreatedEvent bpoint) { - session = s; - BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager(); - int number = bpoint.getNumber(); - source = mgr.getBreakpoint(number); - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public CreatedEvent(Session s, MIVarCreatedEvent var) { - session = s; - VariableManager mgr = (VariableManager)session.getVariableManager(); - String varName = var.getVarName(); - source = mgr.getVariable(varName); - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public CreatedEvent(Session s, MIRegisterCreatedEvent var) { - session = s; - RegisterManager mgr = (RegisterManager)session.getRegisterManager(); - int regno = var.getNumber(); - source = mgr.getRegister(regno); - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public CreatedEvent(Session s, MIThreadCreatedEvent ethread) { - session = s; - Target target = (Target)session.getCurrentTarget(); - source = target.getThread(ethread.getId()); - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public CreatedEvent(Session s, MIMemoryCreatedEvent mblock) { - session = s; - MemoryManager mgr = (MemoryManager)session.getMemoryManager(); - ICDIMemoryBlock[] blocks = mgr.listMemoryBlocks(); - for (int i = 0; i < blocks.length; i++) { - if (blocks[i].getStartAddress() == mblock.getAddress() && - blocks[i].getLength() == mblock.getLength()) { - source = blocks[i]; - break; - } - } - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public CreatedEvent(Session s, MISharedLibCreatedEvent slib) { - session = s; - SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager(); - String name = slib.getName(); - source = mgr.getSharedLibrary(name); - if (source == null) { - source = new CObject(session.getCurrentTarget()); - } - } - - public CreatedEvent(Session s, ICDIObject src) { - session = s; - source = src; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return source; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java deleted file mode 100644 index 6d5fb54e106..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DestroyedEvent.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; -import org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; -import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint; -import org.eclipse.cdt.debug.mi.core.cdi.model.CObject; -import org.eclipse.cdt.debug.mi.core.cdi.model.Thread; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointDeletedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibUnloadedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIVarDeletedEvent; - -/** - */ -public class DestroyedEvent implements ICDIDestroyedEvent { - - Session session; - ICDIObject source; - - public DestroyedEvent(Session s, MIThreadExitEvent ethread) { - session = s; - source = new Thread(session.getCurrentTarget(), ethread.getId()); - } - - public DestroyedEvent(Session s, MIVarDeletedEvent var) { - session = s; - VariableManager varMgr = (VariableManager)session.getVariableManager(); - String varName = var.getVarName(); - Variable variable = varMgr.getVariable(varName); - if (variable!= null) { - source = variable; - try { - varMgr.removeVariable(variable.getMIVar().getVarName()); - } catch (CDIException e) { - } - } else { - ExpressionManager expMgr = (ExpressionManager)session.getExpressionManager(); - variable = expMgr.getExpression(varName); - if (variable != null) { - source = variable; - try { - expMgr.removeExpression(variable.getMIVar().getVarName()); - } catch (CDIException e) { - } - } else { - source = new CObject(session.getCurrentTarget()); - } - } - } - - public DestroyedEvent(Session s, MIBreakpointDeletedEvent bpoint) { - session = s; - BreakpointManager mgr = (BreakpointManager)session.getBreakpointManager(); - int number = bpoint.getNumber(); - Breakpoint breakpoint = mgr.getBreakpoint(number); - if (breakpoint != null) { - source = breakpoint; - mgr.deleteBreakpoint(number); - } else { - source = new CObject(session.getCurrentTarget()); - } - } - - public DestroyedEvent(Session s, MISharedLibUnloadedEvent slib) { - session = s; - SharedLibraryManager mgr = (SharedLibraryManager)session.getSharedLibraryManager(); - String name = slib.getName(); - ICDISharedLibrary lib = mgr.getSharedLibrary(name); - if (lib != null) { - mgr.deleteSharedLibrary(lib); - source = lib; - } else { - source = new CObject(session.getCurrentTarget()); - } - } - - public DestroyedEvent(Session s, ICDIObject src) { - session = s; - source = src; - } - - public DestroyedEvent(Session s) { - session = s; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return source; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DisconnectedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DisconnectedEvent.java deleted file mode 100644 index 63226c9ab25..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/DisconnectedEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.event.ICDIDisconnectedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.mi.core.cdi.Session; - -/** - */ -public class DisconnectedEvent implements ICDIDisconnectedEvent { - - ICDIObject source; - - public DisconnectedEvent(Session session) { - source = (ICDIObject)session.getCurrentTarget(); - } - - /** - * @see org.eclipse.cdt.debug.core..ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return source; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java deleted file mode 100644 index 5b8a50352ff..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ExitedEvent.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.event.ICDIExitedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.mi.core.cdi.ExitInfo; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SignalExitInfo; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorExitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIInferiorSignalExitEvent; - -/** - */ -public class ExitedEvent implements ICDIExitedEvent { - - MIEvent event; - Session session; - - public ExitedEvent(Session s, MIInferiorExitEvent e) { - session = s; - event = e; - } - - public ExitedEvent(Session s, MIInferiorSignalExitEvent e) { - session = s; - event = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIExitedEvent#getExitInfo() - */ - public ICDISessionObject getReason() { - if (event instanceof MIInferiorExitEvent) { - return new ExitInfo(session, (MIInferiorExitEvent)event); - } else if (event instanceof MIInferiorSignalExitEvent) { - return new SignalExitInfo(session, (MIInferiorSignalExitEvent)event); - } - return session; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return session.getCurrentTarget(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java deleted file mode 100644 index d73fb388ef8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.event.ICDIMemoryChangedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.model.MemoryBlock; -import org.eclipse.cdt.debug.mi.core.event.MIMemoryChangedEvent; - -/** - */ -public class MemoryChangedEvent implements ICDIMemoryChangedEvent { - - Session session; - MemoryBlock source; - MIMemoryChangedEvent miMem; - - public MemoryChangedEvent(Session s, MemoryBlock block, MIMemoryChangedEvent mem) { - session = s; - source = block; - miMem = mem; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getAddresses() - */ - public Long[] getAddresses() { - /* But only returns the address that are in the block. */ - Long[] longs = miMem.getAddresses(); - List aList = new ArrayList(longs.length); - for (int i = 0; i < longs.length; i++) { - if (source.contains(longs[i])) { - aList.add(longs[i]); - } - } - return (Long[])aList.toArray(new Long[0]); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return source; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumedEvent.java deleted file mode 100644 index 8c90eda720f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/ResumedEvent.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent; - -/** - */ -public class ResumedEvent implements ICDIResumedEvent { - - Session session; - MIRunningEvent event; - - public ResumedEvent(Session s, MIRunningEvent e) { - session = s; - event = e; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - return session.getCurrentTarget(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent#getType() - */ - public int getType() { - MIRunningEvent running = event; - int type = running.getType(); - int cdiType = 0; - switch (type) { - case MIRunningEvent.CONTINUE: - cdiType = ICDIResumedEvent.CONTINUE; - break; - - case MIRunningEvent.UNTIL: - case MIRunningEvent.NEXT: - cdiType = ICDIResumedEvent.STEP_OVER; - break; - - case MIRunningEvent.NEXTI: - cdiType = ICDIResumedEvent.STEP_OVER_INSTRUCTION; - break; - - case MIRunningEvent.STEP: - cdiType = ICDIResumedEvent.STEP_INTO; - break; - - case MIRunningEvent.STEPI: - cdiType = ICDIResumedEvent.STEP_INTO_INSTRUCTION; - break; - - case MIRunningEvent.RETURN: - case MIRunningEvent.FINISH: - cdiType = ICDIResumedEvent.STEP_RETURN; - break; - - } - return cdiType; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java deleted file mode 100644 index 2623d539cef..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.event; - -import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; -import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointHit; -import org.eclipse.cdt.debug.mi.core.cdi.EndSteppingRange; -import org.eclipse.cdt.debug.mi.core.cdi.ErrorInfo; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryEvent; -import org.eclipse.cdt.debug.mi.core.cdi.SignalReceived; -import org.eclipse.cdt.debug.mi.core.cdi.WatchpointScope; -import org.eclipse.cdt.debug.mi.core.cdi.WatchpointTrigger; -import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent; -import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent; -import org.eclipse.cdt.debug.mi.core.event.MIEvent; -import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent; -import org.eclipse.cdt.debug.mi.core.event.MILocationReachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MISharedLibEvent; -import org.eclipse.cdt.debug.mi.core.event.MISignalEvent; -import org.eclipse.cdt.debug.mi.core.event.MISteppingRangeEvent; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointScopeEvent; -import org.eclipse.cdt.debug.mi.core.event.MIWatchpointTriggerEvent; - -/** - * - */ -public class SuspendedEvent implements ICDISuspendedEvent { - - MIEvent event; - Session session; - - public SuspendedEvent(Session s, MIEvent e) { - session = s; - event = e; - } - - public ICDISessionObject getReason() { - if (event instanceof MIBreakpointHitEvent) { - return new BreakpointHit(session, (MIBreakpointHitEvent)event); - } else if (event instanceof MIWatchpointTriggerEvent) { - return new WatchpointTrigger(session, (MIWatchpointTriggerEvent)event); - } else if (event instanceof MIWatchpointScopeEvent) { - return new WatchpointScope(session, (MIWatchpointScopeEvent)event); - } else if (event instanceof MISteppingRangeEvent) { - return new EndSteppingRange(session); - } else if (event instanceof MISignalEvent) { - return new SignalReceived(session, (MISignalEvent)event); - } else if (event instanceof MILocationReachedEvent) { - return new EndSteppingRange(session); - } else if (event instanceof MIFunctionFinishedEvent) { - return new EndSteppingRange(session); - } else if (event instanceof MIErrorEvent) { - return new ErrorInfo(session, (MIErrorEvent)event); - } else if (event instanceof MISharedLibEvent) { - return new SharedLibraryEvent(session); - } - return session; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getSource() - */ - public ICDIObject getSource() { - ICDITarget target = session.getCurrentTarget(); - // We can send the target as the Source. CDI - // Will assume that all threads are supended for this. - // This is true for gdb when it suspend the inferior - // all threads are suspended. - return target; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java deleted file mode 100644 index 926786e50a3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Argument.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument; -import org.eclipse.cdt.debug.mi.core.output.MIVar; - -/** - */ -public class Argument extends Variable implements ICDIArgument { - - public Argument(ArgumentObject obj, MIVar var) { - super(obj, var); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java deleted file mode 100644 index a6108bab492..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/ArgumentObject.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; - -/** - */ -public class ArgumentObject extends VariableObject implements ICDIArgumentObject { - - public ArgumentObject(ICDITarget target, String name, ICDIStackFrame frame, int pos, int depth) { - super(target, name, frame, pos, depth); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java deleted file mode 100644 index 9eb28458d57..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDICondition; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; -import org.eclipse.cdt.debug.mi.core.cdi.Condition; -import org.eclipse.cdt.debug.mi.core.cdi.Location; -import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint; - -/** - */ -public class Breakpoint extends CObject implements ICDILocationBreakpoint { - - ICDILocation location; - ICDICondition condition; - MIBreakpoint miBreakpoint; - BreakpointManager mgr; - int type; - String tid; - - public Breakpoint(BreakpointManager m, int kind, ICDILocation loc, ICDICondition cond, String threadId) { - super(m.getSession().getCurrentTarget()); - mgr = m; - type = kind; - location = loc; - condition = cond; - tid = threadId; - } - - public Breakpoint(BreakpointManager m, MIBreakpoint miBreak) { - super(m.getSession().getCurrentTarget()); - miBreakpoint = miBreak; - mgr = m; - } - - public MIBreakpoint getMIBreakpoint() { - return miBreakpoint; - } - - public void setMIBreakpoint(MIBreakpoint newMIBreakpoint) { - miBreakpoint = newMIBreakpoint; - // Force the reset of the location and condition. - location = null; - condition = null; - } - - public boolean isDeferred() { - return (miBreakpoint == null); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#getCondition() - */ - public ICDICondition getCondition() throws CDIException { - if (condition == null) { - if (miBreakpoint != null) - condition = new Condition(miBreakpoint.getIgnoreCount(), miBreakpoint.getCondition()); - } - return condition; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#getThreadId() - */ - public String getThreadId() throws CDIException { - if (miBreakpoint != null) - return miBreakpoint.getThreadId(); - return tid; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isEnabled() - */ - public boolean isEnabled() throws CDIException { - if (miBreakpoint != null) - return miBreakpoint.isEnabled(); - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isHardware() - */ - public boolean isHardware() { - if (miBreakpoint != null) - return miBreakpoint.isHardware(); - return (type == ICDIBreakpoint.HARDWARE); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#isTemporary() - */ - public boolean isTemporary() { - if (miBreakpoint != null) - return miBreakpoint.isTemporary(); - return (type == ICDIBreakpoint.TEMPORARY); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#setCondition(ICDICondition) - */ - public void setCondition(ICDICondition condition) throws CDIException { - if (isEnabled()) { - mgr.setCondition(this, condition); - } - this.condition = condition; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint#setEnabled(boolean) - */ - public void setEnabled(boolean enable) throws CDIException { - if (enable == false && isEnabled() == true) { - mgr.disableBreakpoint(this); - } else if (enable == true && isEnabled() == false) { - mgr.enableBreakpoint(this); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDILocationBreakpoint#getLocation() - */ - public ICDILocation getLocation() throws CDIException { - if (location == null) { - if (miBreakpoint != null) - location = new Location (miBreakpoint.getFile(), - miBreakpoint.getFunction(), - miBreakpoint.getLine(), - miBreakpoint.getAddress()); - } - return location; - } - - public void setLocation(ICDILocation loc) { - location = loc; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/CObject.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/CObject.java deleted file mode 100644 index ba9385a43fb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/CObject.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; - -/** - */ -public class CObject implements ICDIObject { - - ICDITarget target; - - public CObject(ICDITarget t) { - target = t; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIObject#getTarget() - */ - public ICDITarget getTarget() { - return target; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Catchpoint.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Catchpoint.java deleted file mode 100644 index 85b4fcf61ae..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Catchpoint.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDICatchEvent; -import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; -import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint; - -/** - */ -public class Catchpoint extends Breakpoint implements ICDICatchpoint { - - public Catchpoint(BreakpointManager m, MIBreakpoint miBreak) { - super(m, miBreak); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDICatchpoint#getEvent() - */ - public ICDICatchEvent getEvent() throws CDIException { - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java deleted file mode 100644 index 758dc41306d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression; -import org.eclipse.cdt.debug.mi.core.output.MIVar; - -/** - */ -public class Expression extends Variable implements ICDIExpression { - - public Expression(VariableObject obj, MIVar var) { - super(obj, var); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java deleted file mode 100644 index af1b15fedb8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.output.MIAsm; - -/** - */ -public class Instruction extends CObject implements ICDIInstruction { - - MIAsm asm; - - public Instruction(ICDITarget target, MIAsm a) { - super(target); - asm = a; - } - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getAdress() - */ - public long getAdress() { - return asm.getAddress(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getFuntionName() - */ - public String getFuntionName() { - return asm.getFunction(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getInstruction() - */ - public String getInstruction() { - return asm.getInstruction(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getOffset() - */ - public long getOffset() { - return asm.getOffset(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getArgs() - */ - public String getArgs() { - return asm.getArgs(); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getOpcode() - */ - public String getOpcode() { - return asm.getOpcode(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java deleted file mode 100644 index 9f2bc779db0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIFormat; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; -import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataWriteMemory; -import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIMemory; - -/** - */ -public class MemoryBlock extends CObject implements ICDIMemoryBlock { - - MIDataReadMemoryInfo mem; - String expression; - boolean frozen; - boolean dirty; - - public MemoryBlock(ICDITarget target, String exp, MIDataReadMemoryInfo info) { - super(target); - expression = exp; - mem = info; - frozen = true; - } - - /** - * @return the expression use to create the block. - */ - public String getExpression() { - return expression; - } - - /** - * Reset the internal MIDataReadMemoryInfo. - */ - public void setMIDataReadMemoryInfo(MIDataReadMemoryInfo m) { - mem = m; - } - - /** - * @return the internal MIDataReadMemoryInfo. - */ - public MIDataReadMemoryInfo getMIDataReadMemoryInfo() { - return mem; - } - - /** - * @return true if any address in the array is within the block. - */ - public boolean contains(Long[] adds) { - for (int i = 0; i < adds.length; i++) { - if (contains(adds[i])) { - return true; - } - } - return false; - } - - /** - * @return true if the address is within the block. - */ - public boolean contains(Long addr) { - long start = getStartAddress(); - long length = getLength(); - if (start <= addr.longValue() && addr.longValue() <= start + length) { - return true; - } - return false; - } - - /** - * Use by the EventManager to check fire events when doing refresh(). - */ - public boolean isDirty() { - return dirty; - } - - /** - * Use by the EventManager to check fire events when doing refresh(). - */ - public void setDirty(boolean d) { - dirty = d; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getBytes() - */ - public byte[] getBytes() throws CDIException { - MIMemory[] miMem = mem.getMemories(); - List aList = new ArrayList(); - for (int i = 0; i < miMem.length; i++) { - long[] data = miMem[i].getData(); - for (int j = 0; j < data.length; j++) { - aList.add(new Long(data[j])); - } - } - byte[] bytes = new byte[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - Long l = (Long)aList.get(i); - bytes[i] = l.byteValue(); - } - return bytes; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#refresh() - */ - public void refresh() throws CDIException { - MemoryManager mgr = (MemoryManager)getTarget().getSession().getMemoryManager(); - setDirty(true); - Long[] addresses = mgr.update(this, null); - // Check if this affects other blocks. - if (addresses.length > 0) { - MemoryBlock[] blocks = mgr.listMemoryBlocks(); - for (int i = 0; i < blocks.length; i++) { - if (! blocks[i].equals(this) && blocks[i].contains(addresses)) { - blocks[i].setDirty(true); - mgr.update(blocks[i], null); - } - } - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getLength() - */ - public long getLength() { - return mem.getTotalBytes(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress() - */ - public long getStartAddress() { - return mem.getAddress(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#isFrozen() - */ - public boolean isFrozen() { - return frozen; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setFrozen(boolean) - */ - public void setFrozen(boolean frozen) { - this.frozen = frozen; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#setValue(long, byte[]) - */ - public void setValue(long offset, byte[] bytes) throws CDIException { - if (offset >= getLength() || offset + bytes.length > getLength()) { - throw new CDIException("Bad Offset"); - } - Session session = (Session)getTarget().getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - for (int i = 0; i < bytes.length; i++) { - long l = new Byte(bytes[i]).longValue() & 0xff; - String value = "0x" + Long.toHexString(l); - MIDataWriteMemory mw = factory.createMIDataWriteMemory(offset + i, - expression, MIFormat.HEXADECIMAL, 1, value); - try { - mi.postCommand(mw); - MIInfo info = mw.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - // If the assign was succesfull fire a MIChangedEvent() via refresh. - refresh(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MixedInstruction.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MixedInstruction.java deleted file mode 100644 index 1390eb72490..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/MixedInstruction.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; -import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.output.MIAsm; -import org.eclipse.cdt.debug.mi.core.output.MISrcAsm; - -/** - */ -public class MixedInstruction extends CObject implements ICDIMixedInstruction { - - MISrcAsm srcAsm; - - public MixedInstruction (ICDITarget target, MISrcAsm a) { - super(target); - srcAsm = a; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction#getFileName() - */ - public String getFileName() { - return srcAsm.getFile(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction#getInstructions() - */ - public ICDIInstruction[] getInstructions() { - MIAsm[] asms = srcAsm.getMIAsms(); - ICDIInstruction[] instructions = new ICDIInstruction[asms.length]; - for (int i = 0; i < asms.length; i++) { - instructions[i] = new Instruction(getTarget(), asms[i]); - } - return instructions; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction#getLineNumber() - */ - public int getLineNumber() { - return srcAsm.getLine(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java deleted file mode 100644 index d082b059221..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Register.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; -import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIVarListChildren; -import org.eclipse.cdt.debug.mi.core.output.MIVar; -import org.eclipse.cdt.debug.mi.core.output.MIVarListChildrenInfo; - -/** - */ -public class Register extends Variable implements ICDIRegister { - - public Register(RegisterObject obj, MIVar var) { - super(obj, var); - } - - public ICDIVariable[] getChildren() throws CDIException { - Session session = (Session)(getTarget().getSession()); - MISession mi = session.getMISession(); - RegisterManager mgr = (RegisterManager)session.getRegisterManager(); - CommandFactory factory = mi.getCommandFactory(); - MIVarListChildren var = - factory.createMIVarListChildren(getMIVar().getVarName()); - try { - mi.postCommand(var); - MIVarListChildrenInfo info = var.getMIVarListChildrenInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MIVar[] vars = info.getMIVars(); - children = new Register[vars.length]; - for (int i = 0; i < vars.length; i++) { - RegisterObject regObj = new RegisterObject(getTarget(), - vars[i].getExp(), getPosition()); - children[i] = mgr.createRegister(regObj, vars[i]); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - return children; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java deleted file mode 100644 index 8f4e00c4b2b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/RegisterObject.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; - -/** - */ -public class RegisterObject extends VariableObject implements ICDIRegisterObject { - - public RegisterObject(ICDITarget target, String name, int i) { - super(target, name, null, i, 0); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java deleted file mode 100644 index 04cbf3b8164..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.mi.core.output.MIShared; - -/** - * Place holder for shared library info. - */ -public class SharedLibrary extends CObject implements ICDISharedLibrary { - - SharedLibraryManager mgr; - MIShared miShared; - - public SharedLibrary(SharedLibraryManager m, MIShared slib) { - super(m.getSession().getCurrentTarget()); - mgr = m; - miShared = slib; - } - - public void setMIShared(MIShared slib) { - miShared = slib; - } - - public MIShared getMIShared() { - return miShared; - } - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getFileName() - */ - public String getFileName() { - return miShared.getName(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getStartAddress() - */ - public long getStartAddress() { - return miShared.getFrom(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getEndAddress() - */ - public long getEndAddress() { - return miShared.getTo(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#areSymbolsLoaded() - */ - public boolean areSymbolsLoaded() { - return miShared.isRead(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#loadSymbols() - */ - public void loadSymbols() throws CDIException { - mgr.loadSymbols(new ICDISharedLibrary[] { this }); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java deleted file mode 100644 index 8e70f11bf44..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Signal.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.mi.core.cdi.SignalManager; -import org.eclipse.cdt.debug.mi.core.output.MISigHandle; - -/** - */ -public class Signal extends CObject implements ICDISignal { - - SignalManager mgr; - MISigHandle sig; - - public Signal(SignalManager m, MISigHandle s) { - super(m.getSession().getCurrentTarget()); - mgr = m; - sig = s; - } - - public void setMISignal(MISigHandle s) { - sig = s; - } - - public MISigHandle getMISignal() { - return sig; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignal#getMeaning() - */ - public String getDescription() { - return sig.getDescription(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignal#getName() - */ - public String getName() { - return sig.getName(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignal#handle() - */ - public void handle(boolean ignore, boolean stop) throws CDIException { - mgr.handle(this, ignore, stop); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignal#isIgnore() - */ - public boolean isIgnore() { - return !sig.isPass(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDISignal#isStopSet() - */ - public boolean isStopSet() { - return sig.isStop(); - } - - /** - * Continue program giving it signal specified by the argument. - */ - public void signal() throws CDIException { - getTarget().signal(this); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java deleted file mode 100644 index be5872b325c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument; -import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.Location; -import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; - -/** - */ -public class StackFrame extends CObject implements ICDIStackFrame { - - MIFrame frame; - Thread cthread; - int level; - ICDIArgument[] args; - ICDIVariable[] locals; - - /* - * - GDB/MI does not keep the stack level, from what we expect. In gdb, the - highest stack is level 0 and lower stack as the highest level: - -stack-list-frames - ^done,stack=[frame={level="0 ",addr="0x0804845b",func="main",file="hello.c",line="24"}, - frame={level="1 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - -stack-list-frames - ^done,stack=[frame={level="0 ",addr="0x08048556",func="main2",file="hello.c",line="58"}, - frame={level="1 ",addr="0x08048501",func="main",file="hello.c",line="41"}, - frame={level="2 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - This is of no use to us since the level is always "0". The level is necessary for example when - doing recursive calls to make a distinction between frames. - So in CDT this reverse the hidghest frame will have the highest number. In CDT: - stack=[frame={level="2 ",addr="0x0804845b",func="main",file="hello.c",line="24"}, - frame={level="1 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - - stack=[frame={level="3 ",addr="0x08048556",func="main2",file="hello.c",line="58"}, - frame={level="2 ",addr="0x08048501",func="main",file="hello.c",line="41"}, - frame={level="1 ",addr="0x42017499",func="__libc_start_main",from="/lib/i686/libc.so.6"}] - */ - public StackFrame(Thread thread, MIFrame f, int l) { - super(thread.getTarget()); - cthread = thread; - frame = f; - level = l; - } - - public MIFrame getMIFrame() { - return frame; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getThread() - */ - public ICDIThread getThread() { - return cthread; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getArguments() - */ - public ICDIArgument[] getArguments() throws CDIException { - if (args == null) { - Session session = (Session)getTarget().getSession(); - VariableManager mgr = (VariableManager)session.getVariableManager(); - ICDIArgumentObject[] argObjs = mgr.getArgumentObjects(this); - args = new ICDIArgument[argObjs.length]; - for (int i = 0; i < args.length; i++) { - try { - args[i] = mgr.createArgument(argObjs[i]); - } catch (CDIException e) { - args = null; - throw e; - } - } - } - return args; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLocalVariables() - */ - public ICDIVariable[] getLocalVariables() throws CDIException { - if (locals == null) { - Session session = (Session)getTarget().getSession(); - VariableManager mgr = (VariableManager)session.getVariableManager(); - ICDIVariableObject[] varObjs = mgr.getLocalVariableObjects(this); - locals = new ICDIVariable[varObjs.length]; - for (int i = 0; i < locals.length; i++) { - try { - locals[i] = mgr.createVariable(varObjs[i]); - } catch (CDIException e) { - locals = null; - throw e; - } - } - } - return locals; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLocation() - */ - public ICDILocation getLocation() { - if (frame != null) { - return new Location(frame.getFile(), frame.getFunction(), - frame.getLine(), frame.getAddress()); - } - return new Location("", "", 0, 0); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLevel() - */ - public int getLevel() { - return level; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#equals(ICDIStackFrame) - */ - public boolean equals(ICDIStackFrame stackframe) { - if (stackframe instanceof StackFrame) { - StackFrame stack = (StackFrame)stackframe; - return cthread != null && - cthread.equals(stack.getThread()) && - getLevel() == stack.getLevel() && - getLocation().equals(stack.getLocation()); - } - return super.equals(stackframe); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java deleted file mode 100644 index 7564b960738..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java +++ /dev/null @@ -1,678 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; -import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; -import org.eclipse.cdt.debug.mi.core.command.Command; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression; -import org.eclipse.cdt.debug.mi.core.command.MIExecContinue; -import org.eclipse.cdt.debug.mi.core.command.MIExecFinish; -import org.eclipse.cdt.debug.mi.core.command.MIExecNext; -import org.eclipse.cdt.debug.mi.core.command.MIExecNextInstruction; -import org.eclipse.cdt.debug.mi.core.command.MIExecReturn; -import org.eclipse.cdt.debug.mi.core.command.MIExecRun; -import org.eclipse.cdt.debug.mi.core.command.MIExecStep; -import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction; -import org.eclipse.cdt.debug.mi.core.command.MIExecUntil; -import org.eclipse.cdt.debug.mi.core.command.MIInfoThreads; -import org.eclipse.cdt.debug.mi.core.command.MIJump; -import org.eclipse.cdt.debug.mi.core.command.MISignal; -import org.eclipse.cdt.debug.mi.core.command.MITargetDetach; -import org.eclipse.cdt.debug.mi.core.command.MIThreadSelect; -import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent; -import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent; -import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo; - -/** - */ -public class Target implements ICDITarget { - - Session session; - Thread[] noThreads = new Thread[0]; - Thread[] currentThreads; - int currentThreadId; - Command lastExecutionCommand; - - public Target(Session s) { - session = s; - currentThreads = noThreads; - } - - public Session getCSession() { - return session; - } - - public Command getLastExecutionCommand() { - return lastExecutionCommand; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getSession() - */ - public ICDISession getSession() { - return session; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIObject#getTarget() - */ - public ICDITarget getTarget() { - return this; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#setCurrentThread(ICDIThread) - */ - public void setCurrentThread(ICDIThread cthread) throws CDIException { - if (cthread instanceof Thread) { - setCurrentThread(cthread, true); - } else { - throw new CDIException("Unknown thread"); - } - } - - public void setCurrentThread(ICDIThread cthread, boolean doUpdate) throws CDIException { - if (cthread instanceof Thread) { - setCurrentThread((Thread)cthread, doUpdate); - } else { - throw new CDIException("Unknown thread"); - } - } - - /** - */ - public void setCurrentThread(Thread cthread, boolean doUpdate) throws CDIException { - // set us as the current target. - session.setCurrentTarget(this); - - int id = cthread.getId(); - // No need to set thread id 0, it is a dummy thread. - if (id == 0) { - return; - } - // already the current thread? - if (currentThreadId != id) { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIThreadSelect select = factory.createMIThreadSelect(id); - try { - mi.postCommand(select); - MIThreadSelectInfo info = select.getMIThreadSelectInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - currentThreadId = info.getNewThreadId(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - - // Resetting threads may change the value of - // some variables like Register. Call an update() - // To generate changeEvents. - if (doUpdate) { - RegisterManager regMgr = (RegisterManager)session.getRegisterManager(); - if (regMgr.isAutoUpdate()) { - regMgr.update(); - } - VariableManager varMgr = (VariableManager)session.getVariableManager(); - if (varMgr.isAutoUpdate()) { - varMgr.update(); - } - } - } - - // We should be allright now. - if (currentThreadId != id) { - // thread is gone. Generate a Thread destroyed. - MISession mi = session.getMISession(); - mi.fireEvent(new MIThreadExitEvent(id)); - throw new CDIException("Can not swith to thread " + id); - } - } - - /** - * Called when stopping because of breakpoints etc .. - */ - public void updateState(int newThreadId) { - Thread[] oldThreads = currentThreads; - - // If we use "info threads" in getCThreads() this - // will be overwritten. However if we use -stack-list-threads - // it does not provide to the current thread - currentThreadId = newThreadId; - - // get the new Threads. - try { - currentThreads = getCThreads(); - } catch (CDIException e) { - currentThreads = noThreads; - } - - // Fire CreatedEvent for new threads. - // Replace the new threads with the old thread object - // User may have old on to the old Thread object. - List cList = new ArrayList(currentThreads.length); - for (int i = 0; i < currentThreads.length; i++) { - boolean found = false; - for (int j = 0; j < oldThreads.length; j++) { - if (currentThreads[i].getId() == oldThreads[j].getId()) { - oldThreads[j].clearState(); - currentThreads[i] = oldThreads[j]; - found = true; - break; - } - } - if (!found) { - cList.add(new Integer(currentThreads[i].getId())); - } - } - if (!cList.isEmpty()) { - MIThreadCreatedEvent[] events = new MIThreadCreatedEvent[cList.size()]; - for (int j = 0; j < events.length; j++) { - int id = ((Integer)cList.get(j)).intValue(); - events[j] = new MIThreadCreatedEvent(id); - } - MISession miSession = session.getMISession(); - miSession.fireEvents(events); - } - - // Fire destroyedEvent for old threads. - List dList = new ArrayList(oldThreads.length); - for (int i = 0; i < oldThreads.length; i++) { - boolean found = false; - for (int j = 0; j < currentThreads.length; j++) { - if (currentThreads[j].getId() == oldThreads[i].getId()) { - found = true; - break; - } - } - if (!found) { - dList.add(new Integer(oldThreads[i].getId())); - } - } - if (!dList.isEmpty()) { - MIThreadExitEvent[] events = new MIThreadExitEvent[dList.size()]; - for (int j = 0; j < events.length; j++) { - int id = ((Integer)dList.get(j)).intValue(); - events[j] = new MIThreadExitEvent(id); - } - MISession miSession = session.getMISession(); - miSession.fireEvents(events); - } - } - - /** - * Do the real work of call -thread-list-ids. - */ - public Thread[] getCThreads() throws CDIException { - Thread[] cthreads = noThreads; - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIInfoThreads tids = factory.createMIInfoThreads(); - try { - // HACK/FIXME: gdb/mi thread-list-ids does not - // show any newly create thread, we workaround by - // issuing "info threads" instead. - //MIThreadListIds tids = factory.createMIThreadListIds(); - //MIThreadListIdsInfo info = tids.getMIThreadListIdsInfo(); - mi.postCommand(tids); - MIInfoThreadsInfo info = tids.getMIInfoThreadsInfo(); - int [] ids; - if (info == null) { - ids = new int[0]; - } else { - ids = info.getThreadIds(); - } - if (ids != null && ids.length > 0) { - cthreads = new Thread[ids.length]; - // Ok that means it is a multiThreaded. - for (int i = 0; i < ids.length; i++) { - cthreads[i] = new Thread(this, ids[i]); - } - } else { - // Provide a dummy. - cthreads = new Thread[]{new Thread(this, 0)}; - } - currentThreadId = info.getCurrentThread(); - //FIX: When attaching there is no thread selected - // We will choose the first one as a workaround. - if (currentThreadId == 0 && cthreads.length > 0) { - currentThreadId = cthreads[0].getId(); - } - } catch (MIException e) { - // Do not throw anything in this case. - throw new CDIException(e.getMessage()); - } - return cthreads; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getCurrentThread() - */ - public ICDIThread getCurrentThread() throws CDIException { - ICDIThread[] threads = getThreads(); - for (int i = 0; i < threads.length; i++) { - Thread cthread = (Thread)threads[i]; - if (cthread.getId() == currentThreadId) { - return cthread; - } - } - return null; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getThreads() - */ - public ICDIThread[] getThreads() throws CDIException { - if (currentThreads.length == 0) { - currentThreads = getCThreads(); - } - return currentThreads; - } - - public ICDIThread getThread(int tid) { - Thread th = null; - if (currentThreads != null) { - for (int i = 0; i < currentThreads.length; i++) { - Thread cthread = currentThreads[i]; - if (cthread.getId() == tid) { - th = cthread; - break; - } - } - } - return th; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#restart() - */ - public void restart() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecRun run = factory.createMIExecRun(new String[0]); - lastExecutionCommand = run; - try { - mi.postCommand(run); - MIInfo info = run.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#resume() - */ - public void resume() throws CDIException { - MISession mi = session.getMISession(); - if (mi.getMIInferior().isRunning()) { - throw new CDIException("Inferior is already running"); - } else if (mi.getMIInferior().isSuspended()) { - CommandFactory factory = mi.getCommandFactory(); - MIExecContinue cont = factory.createMIExecContinue(); - lastExecutionCommand = cont; - try { - mi.postCommand(cont); - MIInfo info = cont.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } else if (mi.getMIInferior().isTerminated()) { - restart(); - } else { - restart(); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepInto() - */ - public void stepInto() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecStep step = factory.createMIExecStep(); - lastExecutionCommand = step; - try { - mi.postCommand(step); - MIInfo info = step.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepIntoInstruction() - */ - public void stepIntoInstruction() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecStepInstruction stepi = factory.createMIExecStepInstruction(); - lastExecutionCommand = stepi; - try { - mi.postCommand(stepi); - MIInfo info = stepi.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepOver() - */ - public void stepOver() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecNext next = factory.createMIExecNext(); - lastExecutionCommand = next; - try { - mi.postCommand(next); - MIInfo info = next.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepOverInstruction() - */ - public void stepOverInstruction() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecNextInstruction nexti = factory.createMIExecNextInstruction(); - lastExecutionCommand = nexti; - try { - mi.postCommand(nexti); - MIInfo info = nexti.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepReturn() - */ - public void stepReturn() throws CDIException { - stepReturn(true); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#stepReturn(boolean) - */ - public void stepReturn(boolean execute) throws CDIException { - if (execute) { - finish(); - } else { - execReturn(); - } - } - - /** - */ - protected void finish() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecFinish finish = factory.createMIExecFinish(); - lastExecutionCommand = finish; - try { - mi.postCommand(finish); - MIInfo info = finish.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - */ - protected void execReturn() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIExecReturn ret = factory.createMIExecReturn(); - lastExecutionCommand = ret; - try { - mi.postCommand(ret); - MIInfo info = ret.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#suspend() - */ - public void suspend() throws CDIException { - MISession mi = session.getMISession(); - try { - mi.getMIInferior().interrupt(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#disconnect() - */ - public void disconnect() throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MITargetDetach detach = factory.createMITargetDetach(); - try { - mi.postCommand(detach); - MIInfo info = detach.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - // Unfortunately -target-detach does not generate an - // event so we do it here. - MISession miSession = session.getMISession(); - miSession.fireEvent(new MIDetachedEvent(detach.getToken())); - session.getMISession().getMIInferior().setDisconnected(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#runUntil(ICDILocation) - */ - public void runUntil(ICDILocation location) throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String loc = ""; - if (location.getFile() != null && location.getFile().length() > 0) { - loc = location.getFile() + ":" + location.getLineNumber(); - } else if (location.getFunction() != null && location.getFunction().length() > 0) { - loc = location.getFunction(); - } else if (location.getAddress() != 0) { - loc = "*" + location.getAddress(); - } - MIExecUntil until = factory.createMIExecUntil(loc); - lastExecutionCommand = until; - try { - mi.postCommand(until); - MIInfo info = until.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#jump(ICDILocation) - */ - public void jump(ICDILocation location) throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String loc = ""; - if (location.getFile() != null && location.getFile().length() > 0) { - loc = location.getFile() + ":" + location.getLineNumber(); - } else if (location.getFunction() != null && location.getFunction().length() > 0) { - loc = location.getFunction(); - } else if (location.getAddress() != 0) { - loc = "*" + location.getAddress(); - } - MIJump jump = factory.createMIJump(loc); - lastExecutionCommand = jump; - try { - mi.postCommand(jump); - MIInfo info = jump.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#evaluateExpressionToString(String) - */ - public String evaluateExpressionToString(String expressionText) - throws CDIException { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIDataEvaluateExpression evaluate = - factory.createMIDataEvaluateExpression(expressionText); - try { - mi.postCommand(evaluate); - MIDataEvaluateExpressionInfo info = - evaluate.getMIDataEvaluateExpressionInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - return info.getExpression(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#terminate() - */ - public void terminate() throws CDIException { - try { - session.getMISession().getMIInferior().terminate(); - } catch (MIException e) { - session.terminate(); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#isTerminated() - */ - public boolean isTerminated() { - return session.getMISession().getMIInferior().isTerminated(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#isDisconnected() - */ - public boolean isDisconnected() { - return !session.getMISession().getMIInferior().isConnected(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#isSuspended() - */ - public boolean isSuspended() { - return session.getMISession().getMIInferior().isSuspended(); - } - - public boolean isRunning() { - return session.getMISession().getMIInferior().isRunning(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getProcess() - */ - public Process getProcess() { - return session.getMISession().getMIInferior(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#signal() - */ - public void signal() throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MISignal signal = factory.createMISignal("0"); - try { - mi.postCommand(signal); - MIInfo info = signal.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#signal(ICDISignal) - */ - public void signal(ICDISignal signal) throws CDIException { - Session session = (Session)getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MISignal sig = factory.createMISignal(signal.getName()); - try { - mi.postCommand(sig); - MIInfo info = sig.getMIInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java deleted file mode 100644 index 2b063b15b16..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Thread.java +++ /dev/null @@ -1,376 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; -import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.VariableManager; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIStackInfoDepth; -import org.eclipse.cdt.debug.mi.core.command.MIStackListFrames; -import org.eclipse.cdt.debug.mi.core.command.MIStackSelectFrame; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIStackInfoDepthInfo; -import org.eclipse.cdt.debug.mi.core.output.MIStackListFramesInfo; - -/** - */ -public class Thread extends CObject implements ICDIThread { - - static ICDIStackFrame[] noStack = new ICDIStackFrame[0]; - int id; - ICDIStackFrame currentFrame; - int stackdepth = 0; - - public Thread(ICDITarget target, int threadId) { - super(target); - id = threadId; - } - - public int getId() { - return id; - } - - public void clearState() { - stackdepth = 0; - currentFrame = null; - } - - public String toString() { - return Integer.toString(id); - } - - public void updateState() { - try { - getCurrentStackFrame(); - } catch (CDIException e) { - } - } - - public ICDIStackFrame getCurrentStackFrame() throws CDIException { - if (currentFrame == null) { - ICDIStackFrame[] frames = getStackFrames(0, 0); - if (frames.length > 0) { - currentFrame = frames[0]; - } - } - return currentFrame; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#getStackFrames() - */ - public ICDIStackFrame[] getStackFrames() throws CDIException { - int depth = 0; - ICDIStackFrame[] stacks = noStack; - Session session = (Session)getTarget().getSession(); - Target currentTarget = (Target)session.getCurrentTarget(); - ICDIThread currentThread = currentTarget.getCurrentThread(); - currentTarget.setCurrentThread(this, false); - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIStackListFrames frames = factory.createMIStackListFrames(); - depth = getStackFrameCount(); - mi.postCommand(frames); - MIStackListFramesInfo info = frames.getMIStackListFramesInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MIFrame[] miFrames = info.getMIFrames(); - stacks = new StackFrame[miFrames.length]; - for (int i = 0; i < stacks.length; i++) { - stacks[i] = new StackFrame(this, miFrames[i], depth - miFrames[i].getLevel()); - } - } catch (MIException e) { - //throw new CDIException(e.getMessage()); - //System.out.println(e); - } catch (CDIException e) { - //throw e; - //System.out.println(e); - } finally { - currentTarget.setCurrentThread(currentThread, false); - } - if (currentFrame == null) { - for (int i = 0; i < stacks.length; i++) { - if (stacks[i].getLevel() == depth) { - currentFrame = stacks[i]; - } - } - } - return stacks; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#getStackFrames() - */ - public int getStackFrameCount() throws CDIException { - if (stackdepth == 0) { - Session session = (Session)(getTarget().getSession()); - Target currentTarget = (Target)session.getCurrentTarget(); - ICDIThread currentThread = currentTarget.getCurrentThread(); - currentTarget.setCurrentThread(this, false); - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIStackInfoDepth depth = factory.createMIStackInfoDepth(); - mi.postCommand(depth); - MIStackInfoDepthInfo info = null; - try { - // Catch the first exception gdb can recover the second time. - info = depth.getMIStackInfoDepthInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - stackdepth = info.getDepth(); - } catch (MIException e) { - // First try fails, retry. gdb patches up the corrupt frame - // so retry should give us a frame count that is safe. - mi.postCommand(depth); - info = depth.getMIStackInfoDepthInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - stackdepth = info.getDepth(); - if (stackdepth > 0) { - stackdepth--; - } - } - } catch (MIException e) { - throw new MI2CDIException(e); - } finally { - currentTarget.setCurrentThread(currentThread, false); - } - } - return stackdepth; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#getStackFrames() - */ - public ICDIStackFrame[] getStackFrames(int low, int high) throws CDIException { - ICDIStackFrame[] stacks = noStack; - Session session = (Session)getTarget().getSession(); - Target currentTarget = (Target)session.getCurrentTarget(); - ICDIThread currentThread = currentTarget.getCurrentThread(); - currentTarget.setCurrentThread(this, false); - try { - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIStackListFrames frames = factory.createMIStackListFrames(low, high); - int depth = getStackFrameCount(); - mi.postCommand(frames); - MIStackListFramesInfo info = frames.getMIStackListFramesInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MIFrame[] miFrames = info.getMIFrames(); - stacks = new StackFrame[miFrames.length]; - for (int i = 0; i < stacks.length; i++) { - stacks[i] = new StackFrame(this, miFrames[i], depth - miFrames[i].getLevel()); - } - } catch (MIException e) { - //throw new CDIException(e.getMessage()); - //System.out.println(e); - } catch (CDIException e) { - //throw e; - //System.out.println(e); - } finally { - currentTarget.setCurrentThread(currentThread, false); - } - if (currentFrame == null) { - for (int i = 0; i < stacks.length; i++) { - StackFrame f = (StackFrame)stacks[i]; - if (f.getMIFrame().getLevel() == 0) { - currentFrame = stacks[i]; - } - } - } - return stacks; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#setCurrentStackFrame(ICDIStackFrame) - */ - public void setCurrentStackFrame(ICDIStackFrame stackframe) throws CDIException { - setCurrentStackFrame(stackframe, true); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#setCurrentStackFrame(ICDIStackFrame, boolean) - */ - public void setCurrentStackFrame(ICDIStackFrame stackframe, boolean doUpdate) throws CDIException { - int frameLevel = 0; - if (stackframe != null) { - frameLevel = stackframe.getLevel(); - } - - // Check to see if we are already at this level - ICDIStackFrame current = getCurrentStackFrame(); - if (current != null && current.getLevel() == frameLevel) { - // noop - return; - } - - try { - Session session = (Session)getTarget().getSession(); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - // Need the GDB/MI view of level which is the reverse, i.e. the highest level is 0 - // See comment in StackFrame constructor. - int miLevel = getStackFrameCount() - frameLevel; - MIStackSelectFrame frame = factory.createMIStackSelectFrame(miLevel); - // Set ourself as the current thread first. - ((Target)getTarget()).setCurrentThread(this, doUpdate); - mi.postCommand(frame); - MIInfo info = frame.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - currentFrame = stackframe; - // Resetting stackframe may change the value of - // some variables like registers. Call an update() - // To generate changeEvents. - if (doUpdate) { - RegisterManager regMgr = (RegisterManager)session.getRegisterManager(); - if (regMgr.isAutoUpdate()) { - regMgr.update(); - } - VariableManager varMgr = (VariableManager)session.getVariableManager(); - if (varMgr.isAutoUpdate()) { - varMgr.update(); - } - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#isSuspended() - */ - public boolean isSuspended() { - return getTarget().isSuspended(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#resume() - */ - public void resume() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().resume(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepInto() - */ - public void stepInto() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().stepInto(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepIntoInstruction() - */ - public void stepIntoInstruction() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().stepIntoInstruction(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepOver() - */ - public void stepOver() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().stepOver(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepOverInstruction() - */ - public void stepOverInstruction() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().stepOverInstruction(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepReturn() - */ - public void stepReturn() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().stepReturn(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#stepReturn(boolean) - */ - public void stepReturn(boolean execute) throws CDIException { - getTarget().setCurrentThread(this); - getTarget().stepReturn(execute); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#runUntil(ICDILocation) - */ - public void runUntil(ICDILocation location) throws CDIException { - getTarget().setCurrentThread(this); - getTarget().runUntil(location); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#suspend() - */ - public void suspend() throws CDIException { - getTarget().suspend(); - getTarget().setCurrentThread(this); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#jump(org.eclipse.cdt.debug.core.cdi.ICDILocation) - */ - public void jump(ICDILocation location) throws CDIException { - getTarget().setCurrentThread(this); - getTarget().jump(location); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#signal() - */ - public void signal() throws CDIException { - getTarget().setCurrentThread(this); - getTarget().signal(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#signal(org.eclipse.cdt.debug.core.cdi.model.ICDISignal) - */ - public void signal(ICDISignal signal) throws CDIException { - getTarget().setCurrentThread(this); - getTarget().signal(signal); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#equals(ICDIThread) - */ - public boolean equals(ICDIThread thread) { - if (thread instanceof Thread) { - Thread cthread = (Thread) thread; - return id == cthread.getId(); - } - return super.equals(thread); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java deleted file mode 100644 index 1ccbfcbff5d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Value.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIVarEvaluateExpression; -import org.eclipse.cdt.debug.mi.core.output.MIVarEvaluateExpressionInfo; - -/** - */ -public class Value extends CObject implements ICDIValue { - - protected Variable variable; - - public Value(Variable v) { - super(v.getTarget()); - variable = v; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getTypeName() - */ - public String getTypeName() throws CDIException { - return variable.getTypeName(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getValueString() - */ - public String getValueString() throws CDIException { - String result = ""; - MISession mi = ((Session)(getTarget().getSession())).getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarEvaluateExpression var = - factory.createMIVarEvaluateExpression(variable.getMIVar().getVarName()); - try { - mi.postCommand(var); - MIVarEvaluateExpressionInfo info = var.getMIVarEvaluateExpressionInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - result = info.getValue(); - } catch (MIException e) { - //throw new CDIException(e.getMessage()); - } - return result; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() - */ - public int getChildrenNumber() throws CDIException { - return variable.getMIVar().getNumChild(); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() - */ - public boolean hasChildren() throws CDIException { - /* - int number = 0; - MISession mi = getCTarget().getCSession().getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarInfoNumChildren children = - factory.createMIVarInfoNumChildren(variable.getMIVar().getVarName()); - try { - mi.postCommand(children); - MIVarInfoNumChildrenInfo info = children.getMIVarInfoNumChildrenInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - number = info.getChildNumber(); - } catch (MIException e) { - throw new CDIException(e.getMessage()); - } - return (number > 0); - */ - return (getChildrenNumber() > 0); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() - */ - public ICDIVariable[] getVariables() throws CDIException { - return variable.getChildren(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java deleted file mode 100644 index e67d08371eb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java +++ /dev/null @@ -1,391 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager; -import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager; -import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.Format; -import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.ArrayValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.BoolValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.CharValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.DoubleValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.EnumValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.FloatValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.FunctionValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.IntValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.LongLongValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.LongValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.PointerValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.ReferenceValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.ShortValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.StructValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.WCharValue; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIVarAssign; -import org.eclipse.cdt.debug.mi.core.command.MIVarInfoExpression; -import org.eclipse.cdt.debug.mi.core.command.MIVarListChildren; -import org.eclipse.cdt.debug.mi.core.command.MIVarSetFormat; -import org.eclipse.cdt.debug.mi.core.command.MIVarShowAttributes; -import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVar; -import org.eclipse.cdt.debug.mi.core.output.MIVarInfoExpressionInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVarListChildrenInfo; -import org.eclipse.cdt.debug.mi.core.output.MIVarShowAttributesInfo; - -/** - */ -public class Variable extends VariableObject implements ICDIVariable { - - MIVar miVar; - Value value; - ICDIVariable[] children = new ICDIVariable[0]; - String editable = null; - String language; - boolean isFake = false; - - public Variable(VariableObject obj, MIVar v) { - super(obj); - miVar = v; - } - - public Variable(ICDITarget target, String n, String q, ICDIStackFrame stack, int pos, int depth, MIVar v) { - super(target, n, q, stack, pos, depth); - miVar = v; - } - - public MIVar getMIVar() { - return miVar; - } - - public Variable getChild(String name) { - for (int i = 0; i < children.length; i++) { - Variable variable = (Variable) children[i]; - if (name.equals(variable.getMIVar().getVarName())) { - return variable; - } else { - // Look also in the grandchildren. - Variable grandChild = variable.getChild(name); - if (grandChild != null) { - return grandChild; - } - } - } - return null; - } - - String getLanguage() throws CDIException { - if (language == null) { - Session session = (Session) (getTarget().getSession()); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarInfoExpression var = factory.createMIVarInfoExpression(getMIVar().getVarName()); - try { - mi.postCommand(var); - MIVarInfoExpressionInfo info = var.getMIVarInfoExpressionInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - language = info.getLanguage(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - return (language == null) ? "" : language; - } - - boolean isCPPLanguage() throws CDIException { - return getLanguage().equalsIgnoreCase("C++"); - } - - void setIsFake(boolean f) { - isFake = f; - } - - boolean isFake() { - return isFake; - } - - public ICDIVariable[] getChildren() throws CDIException { - // Use the default timeout. - return getChildren(-1); - } - - /** - * This can be a potentially long operation for GDB. - * allow the override of the timeout. - */ - public ICDIVariable[] getChildren(int timeout) throws CDIException { - Session session = (Session) (getTarget().getSession()); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarListChildren var = factory.createMIVarListChildren(getMIVar().getVarName()); - try { - if (timeout >= 0) { - mi.postCommand(var, timeout); - } else { - mi.postCommand(var); - } - MIVarListChildrenInfo info = var.getMIVarListChildrenInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - MIVar[] vars = info.getMIVars(); - children = new Variable[vars.length]; - for (int i = 0; i < vars.length; i++) { - String fn= getFullName(); - String childName = vars[i].getExp(); - String childTypename = null; - boolean childFake = false; - ICDIType t = getType(); - if (t instanceof ICDIArrayType) { - fn = "(" + fn + ")[" + i + "]"; - // For Array gdb varobj only return the index, override here. - int index = castingIndex + i; - childName = getName() + "[" + index + "]"; - } else if (t instanceof ICDIPointerType) { - fn = "*(" + fn + ")"; - } else if (t instanceof ICDIStructType) { - if (isCPPLanguage()) { - // For C++ in GDB the children of the - // the struture are the scope and the inherited classes. - // For example: - // class foo: public bar { - // int x; - // public: int y; - // } foobar; - // This will map to - // - foobar - // + bar - // - private - // - x - // - public - // - y - // So we choose to ignore the first set of children - // but carry over to those "fake" variables the typename and the qualified name - if (!isFake() - || (isFake() && !(name.equals("private") || name.equals("public") || name.equals("protected")))) { - childFake = true; - childTypename = getTypeName(); - } else { - fn = "(" + fn + ")." + vars[i].getExp(); - } - } else { // If not C++ language - fn = "(" + fn + ")." + vars[i].getExp(); - } - } - Variable v = new Variable(getTarget(), childName, fn, getStackFrame(), getPosition(), getStackDepth(), vars[i]); - if (childTypename != null) { - // Hack to reset the typename to a known value - v.typename = childTypename; - } - v.setIsFake(childFake); - children[i] = v; - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - return children; - } - - public int getChildrenNumber() throws CDIException { - return miVar.getNumChild(); - } - - /** - * We overload the VariableObject since the gdb-varobject already knows - * the type and its probably more accurate. - * - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getTypeName() - */ - public String getTypeName() throws CDIException { - // We overload here not to use the whatis command. - if (typename == null) { - typename = miVar.getType(); - } - return typename; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getValue() - */ - public ICDIValue getValue() throws CDIException { - if (value == null) { - ICDIType t = getType(); - if (t instanceof ICDIBoolType) { - value = new BoolValue(this); - } else if (t instanceof ICDICharType) { - value = new CharValue(this); - } else if (t instanceof ICDIWCharType) { - value = new WCharValue(this); - } else if (t instanceof ICDIShortType) { - value = new ShortValue(this); - } else if (t instanceof ICDIIntType) { - value = new IntValue(this); - } else if (t instanceof ICDILongType) { - value = new LongValue(this); - } else if (t instanceof ICDILongLongType) { - value = new LongLongValue(this); - } else if (t instanceof ICDIEnumType) { - value = new EnumValue(this); - } else if (t instanceof ICDIFloatType) { - value = new FloatValue(this); - } else if (t instanceof ICDIDoubleType) { - value = new DoubleValue(this); - } else if (t instanceof ICDIFunctionType) { - value = new FunctionValue(this); - } else if (t instanceof ICDIPointerType) { - value = new PointerValue(this); - } else if (t instanceof ICDIReferenceType) { - value = new ReferenceValue(this); - } else if (t instanceof ICDIArrayType) { - value = new ArrayValue(this); - } else if (t instanceof ICDIStructType) { - value = new StructValue(this); - } else { - value = new Value(this); - } - } - return value; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#setValue(ICDIValue) - */ - public void setValue(ICDIValue value) throws CDIException { - setValue(value.getValueString()); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#setValue(String) - */ - public void setValue(String expression) throws CDIException { - Session session = (Session) (getTarget().getSession()); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarAssign var = factory.createMIVarAssign(miVar.getVarName(), expression); - try { - mi.postCommand(var); - MIInfo info = var.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - - // If the assign was succesfull fire a MIVarChangedEvent() for the variable - // Note GDB will not fire an event for the changed variable we have to do it manually. - MIVarChangedEvent change = new MIVarChangedEvent(var.getToken(), miVar.getVarName()); - mi.fireEvent(change); - - // Changing values may have side effects i.e. affecting other variables - // if the manager is on autoupdate check all the other variables. - // Note: This maybe very costly. - if (this instanceof Register) { - // If register was on autoupdate, update all the other registers - // assigning may have side effects i.e. affecting other registers. - ICDIRegisterManager mgr = session.getRegisterManager(); - if (mgr.isAutoUpdate()) { - mgr.update(); - } - } else if (this instanceof Expression) { - // If expression was on autoupdate, update all the other expression - // assigning may have side effects i.e. affecting other expressions. - ICDIExpressionManager mgr = session.getExpressionManager(); - if (mgr.isAutoUpdate()) { - mgr.update(); - } - } else { - // FIXME: Should we always call the Variable Manager ? - ICDIVariableManager mgr = session.getVariableManager(); - if (mgr.isAutoUpdate()) { - mgr.update(); - } - } - } - - /** - * Overload the implementation of VariableObject and let gdb - * handle it. - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#isEditable() - */ - public boolean isEditable() throws CDIException { - if (editable == null) { - MISession mi = ((Session) (getTarget().getSession())).getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarShowAttributes var = factory.createMIVarShowAttributes(miVar.getVarName()); - try { - mi.postCommand(var); - MIVarShowAttributesInfo info = var.getMIVarShowAttributesInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - editable = String.valueOf(info.isEditable()); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - return (editable == null) ? false : editable.equalsIgnoreCase("true"); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#setFormat() - */ - public void setFormat(int format) throws CDIException { - int fmt = Format.toMIFormat(format); - MISession mi = ((Session) (getTarget().getSession())).getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIVarSetFormat var = factory.createMIVarSetFormat(miVar.getVarName(), fmt); - try { - mi.postCommand(var); - MIInfo info = var.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#equals() - */ - public boolean equals(ICDIVariable var) { - if (var instanceof Variable) { - Variable variable = (Variable) var; - return miVar.getVarName().equals(variable.getMIVar().getVarName()); - } - return super.equals(var); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java deleted file mode 100644 index b78fa20db6c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/VariableObject.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MISession; -import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SourceManager; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.IncompleteType; -import org.eclipse.cdt.debug.mi.core.cdi.model.type.Type; -import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression; -import org.eclipse.cdt.debug.mi.core.command.MIWhatis; -import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo; -import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo; - -/** - */ -public class VariableObject extends CObject implements ICDIVariableObject { - - // Casting info. - String castingType; - int castingIndex; - int castingLength; - - String name; - int position; - ICDIStackFrame frame; - int stackdepth; - - String qualifiedName = null; - String fullName = null; - Type type = null; - String typename = null; - String sizeof = null; - - /** - * Copy constructor. - * @param obj - */ - public VariableObject(VariableObject obj) { - super(obj.getTarget()); - name = obj.getName(); - try { - frame = obj.getStackFrame(); - } catch (CDIException e) { - } - position = obj.getPosition(); - stackdepth = obj.getStackDepth(); - castingIndex = obj.getCastingArrayStart(); - castingLength = obj.getCastingArrayEnd(); - castingType = obj.getCastingType(); - } - - public VariableObject(ICDITarget target, String n, ICDIStackFrame stack, int pos, int depth) { - this(target, n, null, stack, pos, depth); - } - - public VariableObject(ICDITarget target, String n, String fn, ICDIStackFrame stack, int pos, int depth) { - super(target); - name = n; - fullName = fn; - frame = stack; - position = pos; - stackdepth = depth; - } - - public int getPosition() { - return position; - } - - public int getStackDepth() { - return stackdepth; - } - - public void setCastingArrayStart(int start) { - castingIndex = start; - } - public int getCastingArrayStart() { - return castingIndex; - } - - public void setCastingArrayEnd(int end) { - castingLength = end; - } - public int getCastingArrayEnd() { - return castingLength; - } - - public void setCastingType(String t) { - castingType = t; - } - public String getCastingType() { - return castingType; - } - - /** - * If the variable was a cast encode the string appropriately for GDB. - * For example castin to an array is of 2 elements: - * (foo)@2 - * @return - */ - public String encodeVariable() { - String fn = getFullName(); - if (castingLength > 0 || castingIndex > 0) { - StringBuffer buffer = new StringBuffer(); - buffer.append("*("); - buffer.append('(').append(fn).append(')'); - if (castingIndex != 0) { - buffer.append('+').append(castingIndex); - } - buffer.append(')'); - buffer.append('@').append(castingLength); - fn = buffer.toString(); - } else if (castingType != null && castingType.length() > 0) { - StringBuffer buffer = new StringBuffer(); - buffer.append("((").append(castingType).append(')'); - buffer.append(fn).append(')'); - fn = buffer.toString(); - } - return fn; - } - - public String getFullName() { - if (fullName == null) { - fullName = getName(); - } - return fullName; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableObject#getName() - */ - public String getName() { - return name; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getType() - */ - public ICDIType getType() throws CDIException { - if (type == null) { - ICDITarget target = getTarget(); - Session session = (Session) (target.getSession()); - SourceManager sourceMgr = (SourceManager) session.getSourceManager(); - String nametype = getTypeName(); - try { - type = sourceMgr.getType(target, nametype); - } catch (CDIException e) { - // Try with ptype. - try { - String ptype = sourceMgr.getDetailTypeName(nametype); - type = sourceMgr.getType(target, ptype); - } catch (CDIException ex) { - } - } - if (type == null) { - type = new IncompleteType(target, nametype); - } - } - return type; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#sizeof() - */ - public int sizeof() throws CDIException { - if (sizeof == null) { - ICDITarget target = getTarget(); - Session session = (Session) (target.getSession()); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - String exp = "sizeof(" + getTypeName() + ")"; - MIDataEvaluateExpression evaluate = factory.createMIDataEvaluateExpression(exp); - try { - mi.postCommand(evaluate); - MIDataEvaluateExpressionInfo info = evaluate.getMIDataEvaluateExpressionInfo(); - if (info == null) { - throw new CDIException("Target is not responding"); - } - sizeof = info.getExpression(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - - if (sizeof != null) { - try { - return Integer.parseInt(sizeof); - } catch (NumberFormatException e) { - throw new CDIException(e.getMessage()); - } - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#isEdiTable() - */ - public boolean isEditable() throws CDIException { - ICDIType t = getType(); - if (t instanceof ICDIArrayType - || t instanceof ICDIStructType - || t instanceof ICDIVoidType - || t instanceof ICDIFunctionType) { - return false; - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getStackFrame() - */ - public ICDIStackFrame getStackFrame() throws CDIException { - return frame; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getTypeName() - */ - public String getTypeName() throws CDIException { - if (typename == null) { - try { - ICDITarget target = getTarget(); - Session session = (Session) (target.getSession()); - MISession mi = session.getMISession(); - CommandFactory factory = mi.getCommandFactory(); - MIWhatis whatis = factory.createMIWhatis(getQualifiedName()); - mi.postCommand(whatis); - MIWhatisInfo info = whatis.getMIWhatisInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - typename = info.getType(); - } catch (MIException e) { - throw new MI2CDIException(e); - } - } - return typename; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#hasChildren() - */ - public boolean hasChildren() throws CDIException { - ICDIType t = getType(); - - // For reference we need to get the referenced type - // to make a decision. - if (t instanceof ICDIReferenceType) { - t = ((ICDIReferenceType) t).getComponentType(); - } - - if (t instanceof ICDIArrayType || t instanceof ICDIStructType) { - return true; - } else if (t instanceof ICDIPointerType) { - ICDIType sub = ((ICDIPointerType) t).getComponentType(); - if (sub instanceof ICDIVoidType) { - return false; - } - return true; - } - return false; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName() - */ - public String getQualifiedName() throws CDIException { - if (qualifiedName == null) { - qualifiedName = encodeVariable(); - } - return qualifiedName; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#equals(ICDIVariableObject) - */ - public boolean equals(ICDIVariableObject varObj) { - if (varObj instanceof VariableObject) { - VariableObject var = (VariableObject) varObj; - if (var.getName().equals(getName()) - && var.getCastingArrayStart() == getCastingArrayStart() - && var.getCastingArrayEnd() == getCastingArrayEnd() - && ((var.getCastingType() == null && getCastingType() == null) - || (var.getCastingType() != null && getCastingType() != null && var.getCastingType().equals(getCastingType())))) { - ICDIStackFrame varFrame = null; - ICDIStackFrame ourFrame = null; - try { - varFrame = var.getStackFrame(); - ourFrame = getStackFrame(); - } catch (CDIException e) { - } - if (ourFrame == null && varFrame == null) { - return true; - } else if (varFrame != null && ourFrame != null && varFrame.equals(ourFrame)) { - if (var.getStackDepth() == getStackDepth()) { - if (var.getPosition() == getPosition()) { - return true; - } - } - } - } - } - return super.equals(varObj); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Watchpoint.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Watchpoint.java deleted file mode 100644 index 7ab814166de..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/Watchpoint.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDICondition; -import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint; -import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager; -import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint; - -/** - */ -public class Watchpoint extends Breakpoint implements ICDIWatchpoint { - - int watchType; - String what; - - public Watchpoint(BreakpointManager m, String expression, int type, int wType, ICDICondition cond) { - super(m, type, null, cond, ""); - watchType = wType; - what = expression; - } - - public Watchpoint(BreakpointManager m, MIBreakpoint miBreak) { - super(m, miBreak); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#getWatchExpression() - */ - public String getWatchExpression() throws CDIException { - MIBreakpoint miPoint = getMIBreakpoint(); - if (miPoint != null) - return getMIBreakpoint().getWhat(); - return what; - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#isReadType() - */ - public boolean isReadType() { - MIBreakpoint miPoint = getMIBreakpoint(); - if (miPoint != null) - return getMIBreakpoint().isReadWatchpoint() || getMIBreakpoint().isAccessWatchpoint(); - return ((watchType & ICDIWatchpoint.READ) == ICDIWatchpoint.READ); - } - - /** - * @see org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint#isWriteType() - */ - public boolean isWriteType() { - MIBreakpoint miPoint = getMIBreakpoint(); - if (miPoint != null) - return getMIBreakpoint().isAccessWatchpoint() || getMIBreakpoint().isWriteWatchpoint(); - return ((watchType & ICDIWatchpoint.WRITE) == ICDIWatchpoint.WRITE); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateType.java deleted file mode 100644 index c2f338a1968..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIAggregateType; - -/** - */ -public abstract class AggregateType extends Type implements ICDIAggregateType { - - public AggregateType(ICDITarget target, String typename) { - super(target, typename); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateValue.java deleted file mode 100644 index f67ff5fba62..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/AggregateValue.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIAggregateValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Value; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public abstract class AggregateValue extends Value implements ICDIAggregateValue { - - public AggregateValue(Variable v) { - super(v); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java deleted file mode 100644 index 10881debaf0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; - -/** - */ -public class ArrayType extends DerivedType implements ICDIArrayType { - - int dimension; - - /** - * @param typename - */ - public ArrayType(ICDITarget target, String typename,int dim) { - super(target, typename); - dimension = dim; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType#getDimension() - */ - public int getDimension() { - if (derivedType == null) { - getComponentType(); - } - return dimension; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIArrayType#getComponentType() - */ - public ICDIType getComponentType() { - if (derivedType == null) { - String orig = getTypeName(); - String name = orig; - int lbracket = orig.lastIndexOf('['); - int rbracket = orig.lastIndexOf(']'); - if (lbracket != -1 && rbracket != -1 && (rbracket > lbracket)) { - try { - String dim = name.substring(lbracket + 1, rbracket).trim(); - dimension = Integer.parseInt(dim); - } catch (NumberFormatException e) { - } - name = orig.substring(0, lbracket).trim(); - } - setComponentType(name); - } - return derivedType; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java deleted file mode 100644 index e6382e1e084..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; -import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - * Enter type comment. - * - * @since Jun 3, 2003 - */ -public class ArrayValue extends DerivedValue implements ICDIArrayValue { - - public ArrayValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getVariables() - */ - public ICDIVariable[] getVariables() throws CDIException { - - /* GDB is appallingly slow on array fetches. As as slow as 128 entries - * per second on NT gdbs with slow processors. We need to set a timeout - * that's appropraitely scaled by number of children to give the slave - * GDB time to respond. In the end perhaps we want a UI for this. As it - * is, let's just make up a number that's 5 seconds for us plus one - * second for every 128 entries. */ - int timeout = variable.getMIVar().getNumChild() * 8 + 5000; - - return variable.getChildren(timeout); - } - - /** - * - * an Array of range[index, index + length - 1] - */ - public ICDIVariable[] getVariables(int index, int length) throws CDIException { - //int children = getChildrenNumber(); - //if (index >= children || index + length >= children) { - // throw new CDIException("Index out of bound"); - //} - - //String subarray = "*(" + variable.getName() + "+" + index + ")@" + length; - ICDITarget target = getTarget(); - Session session = (Session) (target.getSession()); - ICDIVariableManager mgr = session.getVariableManager(); - ICDIVariableObject vo = mgr.getVariableObjectAsArray(variable, index, length); - return mgr.createVariable(vo).getValue().getVariables(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolType.java deleted file mode 100644 index 57b92ded14e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolType.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolType; - -/** - */ -public class BoolType extends IntegralType implements ICDIBoolType { - - /** - * @param typename - */ - public BoolType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public BoolType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolValue.java deleted file mode 100644 index 2320715eb6a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/BoolValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class BoolValue extends IntegralValue implements ICDIBoolValue { - - /** - * @param v - */ - public BoolValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharType.java deleted file mode 100644 index 98f6000037c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharType.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType; - -/** - */ -public class CharType extends IntegralType implements ICDICharType { - - /** - * @param typename - */ - public CharType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public CharType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharValue.java deleted file mode 100644 index 0cac662d221..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/CharValue.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class CharValue extends IntegralValue implements ICDICharValue { - - /** - * @param v - */ - public CharValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDICharValue#getValue() - */ - public char getValue() throws CDIException { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedType.java deleted file mode 100644 index 38360a2d892..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedType.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SourceManager; - -/** - */ -public abstract class DerivedType extends Type implements ICDIDerivedType { - - ICDIType derivedType; - - public DerivedType(ICDITarget target, String typename) { - super(target, typename); - } - - public void setComponentType(ICDIType dtype) { - derivedType = dtype; - } - - public void setComponentType(String name) { - ICDITarget target = getTarget(); - Session session = (Session)(target.getSession()); - SourceManager sourceMgr = (SourceManager)session.getSourceManager(); - try { - derivedType = sourceMgr.getType(target, name); - } catch (CDIException e) { - // Try after ptype. - try { - String ptype = sourceMgr.getDetailTypeName(name); - derivedType = sourceMgr.getType(target, ptype); - } catch (CDIException ex) { - } - } - if (derivedType == null) { - derivedType = new IncompleteType(getTarget(), name); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedValue.java deleted file mode 100644 index 8d785b214df..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DerivedValue.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Value; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public abstract class DerivedValue extends Value implements ICDIDerivedValue { - - public DerivedValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleType.java deleted file mode 100644 index ed9c0e10c0a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleType.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleType; - -/** - */ -public class DoubleType extends FloatingPointType implements ICDIDoubleType { - - /** - * @param typename - */ - public DoubleType(ICDITarget target, String typename) { - this(target, typename, false, false, false); - } - - public DoubleType(ICDITarget target, String typename, boolean isComplex, boolean isImg, boolean isLong) { - super(target, typename, isComplex, isImg, isLong); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleValue.java deleted file mode 100644 index f25b06d9875..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/DoubleValue.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class DoubleValue extends FloatingPointValue implements ICDIDoubleValue { - - /** - * @param Variable - */ - public DoubleValue(Variable v) { - super(v); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumType.java deleted file mode 100644 index 8dc088c2f53..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumType.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumType; - -/** - */ -public class EnumType extends IntegralType implements ICDIEnumType { - - /** - * @param typename - */ - public EnumType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public EnumType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumValue.java deleted file mode 100644 index bb331280a5e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/EnumValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class EnumValue extends IntegralValue implements ICDIEnumValue { - - /** - * @param v - */ - public EnumValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatType.java deleted file mode 100644 index 87388d4c86f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatType.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatType; - -/** - */ -public class FloatType extends FloatingPointType implements ICDIFloatType { - - /** - * @param typename - */ - public FloatType(ICDITarget target, String typename) { - this(target, typename, false, false); - } - - public FloatType(ICDITarget target, String typename, boolean isComplex, boolean isImg) { - super(target, typename, isComplex, isImg, false); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatValue.java deleted file mode 100644 index a2ff54ca178..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatValue.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class FloatValue extends FloatingPointValue implements ICDIFloatValue { - - /** - * @param Variable - */ - public FloatValue(Variable v) { - super(v); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointType.java deleted file mode 100644 index c4f7a332b0e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointType.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType; - -/** - */ -public abstract class FloatingPointType extends Type implements ICDIFloatingPointType { - - boolean complex; - boolean imaginary; - boolean islong; - - public FloatingPointType(ICDITarget target, String typename, boolean comp, boolean img, boolean l) { - super(target, typename); - complex = comp; - imaginary = img; - islong = l; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType#isComplex() - */ - public boolean isComplex() { - return complex; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType#isImaginary() - */ - public boolean isImaginary() { - return imaginary; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType#isLong() - */ - public boolean isLong() { - return islong; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java deleted file mode 100644 index 47f68d02a69..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FloatingPointValue.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Value; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public abstract class FloatingPointValue extends Value implements ICDIFloatingPointValue { - - /** - * @param v - */ - public FloatingPointValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointValue#doubleValue() - */ - public double doubleValue() throws CDIException { - double result = 0; - String valueString = getValueString(); - if (isNaN(valueString)) - result = Double.NaN; - else if (isNegativeInfinity(valueString)) - result = Double.NEGATIVE_INFINITY; - else if (isPositiveInfinity(valueString)) - result = Double.POSITIVE_INFINITY; - else { - try { - result = Double.parseDouble(valueString); - } catch (NumberFormatException e) { - } - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointValue#floatValue() - */ - public float floatValue() throws CDIException { - float result = 0; - String valueString = getValueString(); - if (isNaN(valueString)) - result = Float.NaN; - else if (isNegativeInfinity(valueString)) - result = Float.NEGATIVE_INFINITY; - else if (isPositiveInfinity(valueString)) - result = Float.POSITIVE_INFINITY; - else { - try { - result = Float.parseFloat(valueString); - } catch (NumberFormatException e) { - } - } - return result; - } - - private boolean isPositiveInfinity(String valueString) { - return (valueString != null) ? valueString.indexOf("inf") != -1 : false; - } - - private boolean isNegativeInfinity(String valueString) { - return (valueString != null) ? valueString.indexOf("-inf") != -1 : false; - } - - private boolean isNaN(String valueString) { - return (valueString != null) ? valueString.indexOf("nan") != -1 : false; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionType.java deleted file mode 100644 index ef595b30afe..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionType.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; - -/** - */ -public class FunctionType extends DerivedType implements ICDIFunctionType { - - String params = ""; - - public FunctionType(ICDITarget target, String typename) { - super(target, typename); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType#getComponentType() - */ - public ICDIType getComponentType() { - if (derivedType != null) { - String orig = getTypeName(); - String name = orig; - int lparen = orig.lastIndexOf('('); - int rparen = orig.lastIndexOf(')'); - if (lparen != -1 && rparen != -1 && (rparen > lparen)) { - params = name.substring(lparen + 1, rparen).trim(); - name = orig.substring(0, lparen).trim(); - } - setComponentType(name); - } - return derivedType; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionValue.java deleted file mode 100644 index 1d394339515..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/FunctionValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - * Enter type comment. - * - * @since Jun 3, 2003 - */ -public class FunctionValue extends DerivedValue implements ICDIFunctionValue { - - public FunctionValue(Variable v) { - super(v); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IncompleteType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IncompleteType.java deleted file mode 100644 index e33fee65089..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IncompleteType.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; - - -/** - */ -public class IncompleteType extends Type { - - /** - * @param name - */ - public IncompleteType(ICDITarget target, String name) { - super(target, name); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntType.java deleted file mode 100644 index db520bdc62a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntType.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntType; - -/** - */ -public class IntType extends IntegralType implements ICDIIntType { - - /** - * @param typename - */ - public IntType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public IntType(ICDITarget target, String typename, boolean isUnsigned) { - super(target, typename, isUnsigned); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntValue.java deleted file mode 100644 index 5006ff4f38a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class IntValue extends IntegralValue implements ICDIIntValue { - - /** - * @param v - */ - public IntValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralType.java deleted file mode 100644 index 39a7710ef18..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralType.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralType; - -/** - */ -public abstract class IntegralType extends Type implements ICDIIntegralType { - - boolean unSigned; - - public IntegralType(ICDITarget target, String typename, boolean isUnsigned) { - super(target, typename); - unSigned = isUnsigned; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIIntegralType#isUnsigned() - */ - public boolean isUnsigned() { - return unSigned; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralValue.java deleted file mode 100644 index 46359233f96..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/IntegralValue.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Value; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public abstract class IntegralValue extends Value implements ICDIIntegralValue { - - /** - * @param v - */ - public IntegralValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIIntegralValue#longValue() - */ - public long longValue() throws CDIException { - long value = 0; - String valueString = getValueString(); - int space = valueString.indexOf(' '); - if (space != -1) { - valueString = valueString.substring(0, space).trim(); - } - try { - value = Long.decode(valueString).longValue(); - } catch (NumberFormatException e) { - } - return value; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIIntegralValue#longValue() - */ - public int intValue() throws CDIException { - int value = 0; - String valueString = getValueString(); - int space = valueString.indexOf(' '); - if (space != -1) { - valueString = valueString.substring(0, space).trim(); - } - try { - value = Integer.decode(valueString).intValue(); - } catch (NumberFormatException e) { - } - return value; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIIntegralValue#shortValue() - */ - public short shortValue() throws CDIException { - short value = 0; - String valueString = getValueString(); - int space = valueString.indexOf(' '); - if (space != -1) { - valueString = valueString.substring(0, space).trim(); - } - try { - value = Short.decode(valueString).shortValue(); - } catch (NumberFormatException e) { - } - return value; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIIntegralValue#byteValue() - */ - public int byteValue() throws CDIException { - byte value = 0; - String valueString = getValueString(); - int space = valueString.indexOf(' '); - if (space != -1) { - valueString = valueString.substring(0, space).trim(); - } - try { - value = Byte.decode(valueString).byteValue(); - } catch (NumberFormatException e) { - } - return value; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongType.java deleted file mode 100644 index b7b64bc38d1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongType.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongType; - -/** - */ -public class LongLongType extends IntegralType implements ICDILongLongType { - - /** - * @param typename - */ - public LongLongType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public LongLongType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongValue.java deleted file mode 100644 index e2a89fbc562..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongLongValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class LongLongValue extends IntegralValue implements ICDILongLongValue { - - /** - * @param v - */ - public LongLongValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongType.java deleted file mode 100644 index 231aef0326c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongType.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongType; - -/** - */ -public class LongType extends IntegralType implements ICDILongType { - - /** - * @param typename - */ - public LongType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public LongType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongValue.java deleted file mode 100644 index 86253e4b8a7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/LongValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class LongValue extends IntegralValue implements ICDILongValue { - - /** - * @param v - */ - public LongValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerType.java deleted file mode 100644 index df1f82c55ba..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerType.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; - -/** - */ -public class PointerType extends DerivedType implements ICDIPointerType { - - public PointerType(ICDITarget target, String typename) { - super(target, typename); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType#getComponentType() - */ - public ICDIType getComponentType() { - if (derivedType == null) { - String orig = getTypeName(); - String name = orig; - int star = orig.lastIndexOf('*'); - // remove last '*' - if (star != -1) { - name = orig.substring(0, star).trim(); - } - setComponentType(name); - } - return derivedType; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java deleted file mode 100644 index ef555a87297..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - * Enter type comment. - * - * @since Jun 3, 2003 - */ -public class PointerValue extends DerivedValue implements ICDIPointerValue { - - public PointerValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue() - */ - public long pointerValue() throws CDIException { - long value = 0; - String valueString = getValueString(); - int space = valueString.indexOf(' '); - if (space != -1) { - valueString = valueString.substring(0, space).trim(); - } - try { - value = Long.decode(valueString).longValue(); - } catch (NumberFormatException e) { - } - return value; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceType.java deleted file mode 100644 index b821d4a94c3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceType.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; - -/** - */ -public class ReferenceType extends DerivedType implements ICDIReferenceType { - - /** - * @param name - */ - public ReferenceType(ICDITarget target, String name) { - super(target, name); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType#getComponentType() - */ - public ICDIType getComponentType() { - if (derivedType == null) { - String orig = getTypeName(); - String name = orig; - int amp = orig.lastIndexOf('&'); - // remove last '&' - if (amp != -1) { - name = orig.substring(0, amp).trim(); - } - setComponentType(name); - } - return derivedType; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java deleted file mode 100644 index dc075b1fbaa..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - * Enter type comment. - * - * @since Jun 3, 2003 - */ -public class ReferenceValue extends DerivedValue implements ICDIReferenceValue { - - /** - * @param v - */ - public ReferenceValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue#referenceValue() - */ - public long referenceValue() throws CDIException { - long value = 0; - String valueString = getValueString().trim(); - if ( valueString.startsWith("@") ) - valueString = valueString.substring( 1 ); - int space = valueString.indexOf(":"); - if (space != -1) { - valueString = valueString.substring(0, space).trim(); - } - try { - value = Long.decode(valueString).longValue(); - } catch (NumberFormatException e) { - } - return value; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortType.java deleted file mode 100644 index 9d841de94b4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortType.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortType; - -/** - */ -public class ShortType extends IntegralType implements ICDIShortType { - - /** - * @param typename - */ - public ShortType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public ShortType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortValue.java deleted file mode 100644 index 2d8ce4e9375..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ShortValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class ShortValue extends IntegralValue implements ICDIShortValue { - - /** - * @param v - */ - public ShortValue(Variable v) { - super(v); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructType.java deleted file mode 100644 index 6ee857bced4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructType.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType; - -/** - */ -public class StructType extends AggregateType implements ICDIStructType { - - /** - * @param typename - */ - public StructType(ICDITarget target, String typename) { - super(target, typename); - } - - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isClass() - */ - public boolean isClass() { - return getDetailTypeName().startsWith("class"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isStruct() - */ - public boolean isStruct() { - return getDetailTypeName().startsWith("struct"); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isUnion() - */ - public boolean isUnion() { - return getDetailTypeName().startsWith("union"); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructValue.java deleted file mode 100644 index 8b9cde9a9c9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/StructValue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - * Enter type comment. - * - * @since Jun 3, 2003 - */ -public class StructValue extends AggregateValue implements ICDIStructValue { - - public StructValue(Variable v) { - super(v); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/Type.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/Type.java deleted file mode 100644 index f782a0c4fb2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/Type.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; -import org.eclipse.cdt.debug.mi.core.cdi.model.CObject; - -/** - */ -public abstract class Type extends CObject implements ICDIType { - - String typename; - String detailName; - - public Type(ICDITarget target, String name) { - super(target); - typename = name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIType#getTypeName() - */ - public String getTypeName() { - return typename; - } - - public void setDetailTypeName(String name) { - detailName = name; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIType#getDetailTypeName() - */ - public String getDetailTypeName() { - if (detailName == null) { - return getTypeName(); - } - return detailName; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/VoidType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/VoidType.java deleted file mode 100644 index f0ca3e278c1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/VoidType.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType; - -/** - */ -public class VoidType extends Type implements ICDIVoidType { - - public VoidType(ICDITarget target, String typename) { - super(target, typename); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharType.java deleted file mode 100644 index a671d28e766..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType; - -/** - */ -public class WCharType extends IntegralType implements ICDIWCharType { - - /** - * @param typename - */ - public WCharType(ICDITarget target, String typename) { - this(target, typename, false); - } - - public WCharType(ICDITarget target, String typename, boolean usigned) { - super(target, typename, usigned); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharValue.java deleted file mode 100644 index 27bfcbdee99..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/WCharValue.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.cdi.model.type; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharValue; -import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; - -/** - */ -public class WCharValue extends IntegralValue implements ICDIWCharValue { - - /** - * @param v - */ - public WCharValue(Variable v) { - super(v); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.cdi.model.ICDICharValue#getValue() - */ - public char getValue() throws CDIException { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java deleted file mode 100644 index 1cf0d811bdc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CLICommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * Represents a CLI command. - */ -public class CLICommand extends Command -{ - - String operation = ""; - - public CLICommand(String oper) { - operation = oper; - } - - public String getOperation() { - return operation; - } - - /** - * Returns the text representation of this command. - * - * @return the text representation of this command - */ - public String toString(){ - String str = getToken() + " " + operation; - if (str.endsWith("\n")) - return str; - return str + "\n"; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java deleted file mode 100644 index 092ad350ed0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/Command.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; - -/** - * A base class for all mi requests. - */ -public abstract class Command -{ - private static int globalCounter; - - int token = 0; - MIOutput output; - - /** - * A global counter for all command, the token - * will be use to identify uniquely a command. - * Unless the value wraps around which is unlikely. - */ - private static synchronized int getUniqToken() { - int count = ++globalCounter; - // If we ever wrap around. - if (count <= 0) { - count = globalCounter = 1; - } - return count; - } - - /** - * Returns the identifier of this request. - * - * @return the identifier of this request - */ - public int getToken() { - if (token == 0) { - token = getUniqToken(); - } - return token; - } - -// public void setToken(int token) { -// this.token = token; -// } - - public MIOutput getMIOutput() { - return output; - } - - public void setMIOutput(MIOutput mi) { - output = mi; - } - - /** - * Parse the MIOutput generate after posting the command. - */ - public MIInfo getMIInfo () throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - - /** - * throw an MIException. - */ - protected void throwMIException (MIInfo info, MIOutput out) throws MIException { - String mesg = info.getErrorMsg().trim(); - StringBuffer sb = new StringBuffer(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MILogStreamOutput) { - MIStreamRecord o = (MIStreamRecord) oobs[i]; - String s = o.getString(); - if (!s.trim().equalsIgnoreCase(mesg)) { - sb.append(s); - } - } - } - String details = sb.toString(); - if (details.trim().length() == 0) { - details = mesg; - } - throw new MIException(mesg, details); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java deleted file mode 100644 index 5d9b5f330f1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java +++ /dev/null @@ -1,368 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * Factory to create GDB commands. - */ -public class CommandFactory { - - public MIBreakAfter createMIBreakAfter(int brknum, int count) { - return new MIBreakAfter(brknum, count); - } - - public MIBreakCondition createMIBreakCondition (int brknum, String expr) { - return new MIBreakCondition(brknum, expr); - } - - public MIBreakDelete createMIBreakDelete (int[] brknum) { - return new MIBreakDelete(brknum); - } - - public MIBreakDisable createMIBreakDisable(int[] brknum) { - return new MIBreakDisable(brknum); - } - - public MIBreakEnable createMIBreakEnable(int[] brknum) { - return new MIBreakEnable(brknum); - } - - public MIBreakInsert createMIBreakInsert(boolean isTemporary, boolean isHardware, - String condition, int ignoreCount, String line) { - return new MIBreakInsert(isTemporary, isHardware, condition, ignoreCount, line); - } - - public MIBreakInsert createMIBreakInsert(String func) { - return new MIBreakInsert(func); - } - - public MIBreakList createMIBreakList() { - return new MIBreakList(); - } - - public MIBreakWatch createMIBreakWatch(boolean access, boolean read, String expression) { - return new MIBreakWatch(access, read, expression); - } - - public MIDataDisassemble createMIDataDisassemble(String start, String end, boolean mixed) { - return new MIDataDisassemble(start, end, mixed); - } - - public MIDataDisassemble createMIDataDisassemble(String file, int linenum, int lines, boolean mixed) { - return new MIDataDisassemble(file, linenum, lines, mixed); - } - - public MIDataEvaluateExpression createMIDataEvaluateExpression(String expression) { - return new MIDataEvaluateExpression(expression); - } - - public MIDataListChangedRegisters createMIDataListChangedRegisters() { - return new MIDataListChangedRegisters(); - } - - public MIDataListRegisterNames createMIDataListRegisterNames() { - return new MIDataListRegisterNames(); - } - - public MIDataListRegisterNames createMIDataListRegisterNames(int[] regnos) { - return new MIDataListRegisterNames(regnos); - } - - public MIDataListRegisterValues createMIDataListRegisterValues(int fmt, int[] regnos) { - return new MIDataListRegisterValues(fmt, regnos); - } - - public MIDataWriteRegisterValues createMIDataWriteRegisterValues(int fmt, int[] regnos, String[] values) { - return new MIDataWriteRegisterValues(fmt, regnos, values); - } - - public MIDataReadMemory createMIDataReadMemory(long offset, String address, - int wordFormat, int wordSize, - int rows, int cols, Character asChar) { - return new MIDataReadMemory(offset, address, wordFormat, wordSize, - rows, cols, asChar); - } - - public MIDataWriteMemory createMIDataWriteMemory(long offset, String address, - int wordFormat, int wordSize, - String value) { - return new MIDataWriteMemory(offset, address, wordFormat, wordSize, value); - } - - public MIEnvironmentCD createMIEnvironmentCD(String pathdir) { - return new MIEnvironmentCD(pathdir); - } - - public MIEnvironmentDirectory createMIEnvironmentDirectory(String[] pathdirs) { - return new MIEnvironmentDirectory(pathdirs); - } - - public MIEnvironmentPath createMIEnvironmentPath(String[] paths) { - return new MIEnvironmentPath(paths); - } - - public MIEnvironmentPWD createMIEnvironmentPWD() { - return new MIEnvironmentPWD(); - } - - /** - * @param params - * @return - */ - public MIGDBSetEnvironment createMIGDBSetEnvironment(String[] params) { - return new MIGDBSetEnvironment(params); - } - - public MIExecAbort createMIExecAbort() { - return new MIExecAbort(); - } - - public MIExecArguments createMIExecArguments(String[] args) { - return new MIExecArguments(args); - } - - public MIExecContinue createMIExecContinue() { - return new MIExecContinue(); - } - - public MIExecFinish createMIExecFinish() { - return new MIExecFinish(); - } - - public MIExecInterrupt createMIExecInterrupt() { - return new MIExecInterrupt(); - } - - public MIExecNext createMIExecNext() { - return new MIExecNext(); - } - - public MIExecNextInstruction createMIExecNextInstruction() { - return new MIExecNextInstruction(); - } - - public MIExecReturn createMIExecReturn() { - return new MIExecReturn(); - } - - public MIExecRun createMIExecRun(String[] args) { - return new MIExecRun(args); - } - - public MIExecStep createMIExecStep() { - return new MIExecStep(); - } - - public MIExecStepInstruction createMIExecStepInstruction() { - return new MIExecStepInstruction(); - } - - public MIExecUntil createMIExecUntil(String location) { - return new MIExecUntil(location); - } - - public MIJump createMIJump(String location) { - return new MIJump(location); - } - - public MIFileExecFile createMIFileExecFile(String file) { - return new MIFileExecFile(file); - } - - public MIFileSymbolFile createMIFileSymbolFile(String file) { - return new MIFileSymbolFile(file); - } - - public MIGDBExit createMIGDBExit() { - return new MIGDBExit(); - } - - public MIGDBSet createMIGDBSet(String[] params) { - return new MIGDBSet(params); - } - - public MIGDBSetAutoSolib createMIGDBSetAutoSolib(boolean set) { - return new MIGDBSetAutoSolib(set); - } - - public MIGDBSetStopOnSolibEvents createMIGDBSetStopOnSolibEvents(boolean set) { - return new MIGDBSetStopOnSolibEvents(set); - } - - public MIGDBSetSolibSearchPath createMIGDBSetSolibSearchPath(String[] params) { - return new MIGDBSetSolibSearchPath(params); - } - - public MIGDBShow createMIGDBShow(String[] params) { - return new MIGDBShow(params); - } - - public MIGDBShowExitCode createMIGDBShowExitCode() { - return new MIGDBShowExitCode(); - } - - public MIGDBShowDirectories createMIGDBShowDirectories() { - return new MIGDBShowDirectories(); - } - - public MIGDBShowSolibSearchPath createMIGDBShowSolibSearchPath() { - return new MIGDBShowSolibSearchPath(); - } - - public MIStackInfoDepth createMIStackInfoDepth() { - return new MIStackInfoDepth(); - } - - public MIStackInfoDepth createMIStackInfoDepth(int depth) { - return new MIStackInfoDepth(depth); - } - - public MIStackListArguments createMIStackListArguments(boolean showValue) { - return new MIStackListArguments(showValue); - } - - public MIStackListArguments createMIStackListArguments(boolean showValue, int lowFrame, int highFrame) { - return new MIStackListArguments(showValue, lowFrame, highFrame); - } - - public MIStackListFrames createMIStackListFrames() { - return new MIStackListFrames(); - } - - public MIStackListFrames createMIStackListFrames(int lowFrame, int highFrame) { - return new MIStackListFrames(lowFrame, highFrame); - } - - public MIStackListLocals createMIStackListLocals(boolean showValues) { - return new MIStackListLocals(showValues); - } - - public MIStackSelectFrame createMIStackSelectFrame(int frameNum) { - return new MIStackSelectFrame(frameNum); - } - - public MITargetAttach createMITargetAttach(int pid) { - return new MITargetAttach(pid); - } - - public MITargetDetach createMITargetDetach() { - return new MITargetDetach(); - } - - public MITargetSelect createMITargetSelect(String[] params) { - return new MITargetSelect(params); - } - - public MIThreadListIds createMIThreadListIds() { - return new MIThreadListIds(); - } - - public MIInfoThreads createMIInfoThreads() { - return new MIInfoThreads(); - } - - public MIThreadSelect createMIThreadSelect(int threadNum) { - return new MIThreadSelect(threadNum); - } - - public MIInfoSharedLibrary createMIInfoSharedLibrary() { - return new MIInfoSharedLibrary(); - } - - public MISharedLibrary createMISharedLibrary() { - return new MISharedLibrary(); - } - - public MISharedLibrary createMISharedLibrary(String name) { - return new MISharedLibrary(name); - } - - public MIWhatis createMIWhatis(String name) { - return new MIWhatis(name); - } - - public MIInfoSignals createMIInfoSignals() { - return new MIInfoSignals(); - } - - public MIInfoSignals createMIInfoSignals(String name) { - return new MIInfoSignals(name); - } - - public MIHandle createMIHandle(String arg) { - return new MIHandle(arg); - } - - public MISignal createMISignal(String arg) { - return new MISignal(arg); - } - - public MIPType createMIPType(String name) { - return new MIPType(name); - } - - public MIInfoProgram createMIInfoProgram() { - return new MIInfoProgram(); - } - - public MIVarCreate createMIVarCreate(String expression) { - return new MIVarCreate(expression); - } - - public MIVarCreate createMIVarCreate(String name, String frameAddr, String expression) { - return new MIVarCreate(name, frameAddr, expression); - } - - public MIVarDelete createMIVarDelete(String name) { - return new MIVarDelete(name); - } - - public MIVarSetFormat createMIVarSetFormat(String name, int format) { - return new MIVarSetFormat(name, format); - } - - public MIVarShowFormat createMIVarShowFormat(String name) { - return new MIVarShowFormat(name); - } - - public MIVarInfoNumChildren createMIVarInfoNumChildren(String name) { - return new MIVarInfoNumChildren(name); - } - - public MIVarListChildren createMIVarListChildren(String name) { - return new MIVarListChildren(name); - } - - public MIVarInfoType createMIVarInfoType(String name) { - return new MIVarInfoType(name); - } - - public MIVarInfoExpression createMIVarInfoExpression(String name) { - return new MIVarInfoExpression(name); - } - - public MIVarShowAttributes createMIVarShowAttributes(String name) { - return new MIVarShowAttributes(name); - } - - public MIVarEvaluateExpression createMIVarEvaluateExpression(String name) { - return new MIVarEvaluateExpression(name); - } - - public MIVarAssign createMIVarAssign(String name, String expr) { - return new MIVarAssign(name, expr); - } - - public MIVarUpdate createMIVarUpdate() { - return new MIVarUpdate(); - } - - public MIVarUpdate createMIVarUpdate(String name) { - return new MIVarUpdate(name); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinCommandFactory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinCommandFactory.java deleted file mode 100644 index 2ca72c38e47..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinCommandFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - *(c) Copyright Rational Software Corporation, 2002 - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * Cygwin Command Factory overrides the regular Command Factory to allow for - * commands to take into account the cygwin environment. - */ -public class CygwinCommandFactory extends CommandFactory { - - public MIEnvironmentDirectory createMIEnvironmentDirectory(String[] pathdirs) { - return new CygwinMIEnvironmentDirectory(pathdirs); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentDirectory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentDirectory.java deleted file mode 100644 index 3265bee8822..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/CygwinMIEnvironmentDirectory.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright Rational Software Corporation, 2002 - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import java.io.ByteArrayOutputStream; - -import org.eclipse.cdt.core.CommandLauncher; -import org.eclipse.core.runtime.Path; - -/** - * Cygwin implementation of the MIEnvironmentDirectory command. In the cygwin - * environment, the paths are DOS paths and need to be converted to cygwin - * style paths before passing them to gdb. - */ -public class CygwinMIEnvironmentDirectory extends MIEnvironmentDirectory { - - CygwinMIEnvironmentDirectory(String[] paths) { - super(paths); - - String[] newpaths = new String[paths.length]; - for (int i = 0; i < paths.length; i++) { - // Use the cygpath utility to convert the path - CommandLauncher launcher = new CommandLauncher(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - - launcher.execute( - new Path("cygpath"), - new String[] { "-u", paths[i] }, - new String[0], - new Path(".")); - if (launcher.waitAndRead(output, output) != CommandLauncher.OK) - newpaths[i] = paths[i]; - else - newpaths[i] = output.toString().trim(); - } - - setParameters(newpaths); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java deleted file mode 100644 index 4db162c6c09..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakAfter.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * -break-after NUMBER COUNT - * The breakpoint number NUMBER is not in effect until it has been hit - * COUNT times. - * - * Result: - * ^done - * - */ -public class MIBreakAfter extends MICommand -{ - public MIBreakAfter(int brknum, int count) { - super("-break-after",new String[]{Integer.toString(brknum), - Integer.toString(count)}); - - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java deleted file mode 100644 index d64d9d70070..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakCondition.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * - * -break-condition NUMBER EXPR - * - * Breakpoint NUMBER will stop the program only if the condition in - * EXPR is true. The condition becomes part of the `-break-list' output - * Result: - * ^done - */ -public class MIBreakCondition extends MICommand { - public MIBreakCondition(int brknum, String expr) { - super("-break-condition", new String[] { Integer.toString(brknum), expr }); - } - - /** - * Do not do any munging on the string i.e. quoting spaces - * etc .. doing this will break the command -break-condition. - */ - protected String parametersToString() { - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < parameters.length; i++) { - buffer.append(' ').append(parameters[i]); - } - return buffer.toString().trim(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java deleted file mode 100644 index eb238efe31d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDelete.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -break-delete ( BREAKPOINT )+ - * - * Delete the breakpoint(s) whose number(s) are specified in the - * argument list. This is obviously reflected in the breakpoint list. - * - * Result: - * ^done - * - */ -public class MIBreakDelete extends MICommand -{ - public MIBreakDelete (int[] array) { - super("-break-delete"); - if (array != null && array.length > 0) { - String[] brkids = new String[array.length]; - for (int i = 0; i < array.length; i++) { - brkids[i] = Integer.toString(array[i]); - } - setParameters(brkids); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java deleted file mode 100644 index 736602c4a9f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakDisable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -break-disable ( BREAKPOINT )+ - * - * Disable the named BREAKPOINT(s). The field `enabled' in the break - * list is now set to `n' for the named BREAKPOINT(s). - * - * Result: - * ^done - */ -public class MIBreakDisable extends MICommand -{ - public MIBreakDisable (int[] array) { - super("-break-disable"); - if (array != null && array.length > 0) { - String[] brkids = new String[array.length]; - for (int i = 0; i < array.length; i++) { - brkids[i] = Integer.toString(array[i]); - } - setParameters(brkids); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java deleted file mode 100644 index 46e4e3a4509..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakEnable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -break-enable ( BREAKPOINT )+ - * - * Enable (previously disabled) BREAKPOINT(s). - * - * Result: - * ^done - */ -public class MIBreakEnable extends MICommand -{ - public MIBreakEnable (int[] array) { - super("-break-enable"); - if (array != null && array.length > 0) { - String[] brkids = new String[array.length]; - for (int i = 0; i < array.length; i++) { - brkids[i] = Integer.toString(array[i]); - } - setParameters(brkids); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java deleted file mode 100644 index ba520a05350..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakInsert.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIBreakInsertInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -break-insert [ -t ] [ -h ] [ -r ] - * [ -c CONDITION ] [ -i IGNORE-COUNT ] - * [ -p THREAD ] [ LINE | ADDR ] - * - * If specified, LINE, can be one of: - * - * * function - * - * * filename:linenum - * - * * filename:function - * - * * *address - * - * The possible optional parameters of this command are: - * - * `-t' - * Insert a tempoary breakpoint. - * - * `-h' - * Insert a hardware breakpoint. - * - * `-c CONDITION' - * Make the breakpoint conditional on CONDITION. - * - * `-i IGNORE-COUNT' - * Initialize the IGNORE-COUNT. - * - * `-r' - * - * Insert a regular breakpoint in all the functions whose names match - * the given regular expression. Other flags are not applicable to - * regular expresson. - * - * The result is in the form: - * - * ^done,bkptno="NUMBER",func="FUNCNAME", - * file="FILENAME",line="LINENO" - * - */ -public class MIBreakInsert extends MICommand -{ - public MIBreakInsert(String func) { - this(false, false, null, 0, func); - } - - public MIBreakInsert(boolean isTemporary, boolean isHardware, - String condition, int ignoreCount, String line) { - super("-break-insert"); - - int i = 0; - if (isTemporary || isHardware) { - i++; - } - if (condition != null && condition.length() > 0) { - i += 2; - } - if (ignoreCount > 0) { - i += 2; - } - - String[] opts = new String[i]; - - i = 0; - if (isTemporary) { - opts[i] = "-t"; - i++; - } else if (isHardware) { - opts[i] = "-h"; - i++; - } - if (condition != null && condition.length() > 0) { - opts[i] = "-c"; - i++; - opts[i] = condition; - i++; - } - if (ignoreCount > 0) { - opts[i] = "-i"; - i++; - opts[i] = Integer.toString(ignoreCount); - i++; - } - - if (opts.length > 0) { - setOptions(opts); - } - setParameters(new String[]{line}); - } - - public MIBreakInsertInfo getMIBreakInsertInfo() throws MIException { - return (MIBreakInsertInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIBreakInsertInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java deleted file mode 100644 index 64b5bc5ddcc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakList.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIBreakListInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -break-list - * - * Displays the list of inserted breakpoints, showing the following - * fields: - * - * `Number' - * number of the breakpoint - * - * `Type' - * type of the breakpoint: `breakpoint' or `watchpoint' - * - * `Disposition' - * should the breakpoint be deleted or disabled when it is hit: `keep' - * or `nokeep' - * - * `Enabled' - * is the breakpoint enabled or no: `y' or `n' - * - * `Address' - * memory location at which the breakpoint is set - * - * `What' - * logical location of the breakpoint, expressed by function name, - * - * `Times' - * number of times the breakpoint has been hit - * - * If there are no breakpoints or watchpoints, the `BreakpointTable' - * `body' field is an empty list. - * - */ -public class MIBreakList extends MICommand -{ - public MIBreakList () { - super("-break-list"); - } - - public MIBreakListInfo getMIBreakListInfo() throws MIException { - return (MIBreakListInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIBreakListInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java deleted file mode 100644 index 443d376a4a6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIBreakWatchInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -break-watch [ -a | -r ] - * - * Create a watchpoint. With the `-a' option it will create an - * "access" watchpoint, i.e. a watchpoint that triggers either on a read - * from or on a write to the memory location. With the `-r' option, the - * watchpoint created is a "read" watchpoint, i.e. it will trigger only - * when the memory location is accessed for reading. Without either of - * the options, the watchpoint created is a regular watchpoint, i.e. it - * will trigger when the memory location is accessed for writing. - * - */ -public class MIBreakWatch extends MICommand -{ - public MIBreakWatch (boolean access, boolean read, String expr) { - super("-break-watch"); - String[] opts = null; - if (access) { - opts = new String[] {"-a"}; - } else if (read) { - opts = new String[] {"-r"}; - } - if (opts != null) { - setOptions(opts); - } - setParameters(new String[]{expr}); - } - - public MIBreakWatchInfo getMIBreakWatchInfo() throws MIException { - return (MIBreakWatchInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIBreakWatchInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java deleted file mode 100644 index 55fb82144e8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MICommand.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * Represents a MI command. - */ -public class MICommand extends Command { - final String[] empty = new String[0]; - String[] options = empty; - String[] parameters = empty; - String operation = ""; - - public MICommand(String oper) { - this.operation = oper; - } - - public MICommand(String oper, String[] param) { - this.operation = oper; - this.parameters = param; - } - - public MICommand(String oper, String[] opt, String[] param) { - this.operation = oper; - this.options = opt; - this.parameters = param; - } - - /** - * Returns the operation of this command. - * - * @return the operation of this command - */ - public String getOperation() { - return operation; - } - - /** - * Returns an array of command's options. An empty collection is - * returned if there are no options. - * - * @return an array of command's options - */ - public String[] getOptions() { - return options; - } - - public void setOptions(String[] opt) { - options = opt; - } - - /** - * Returns an array of command's parameters. An empty collection is - * returned if there are no parameters. - * - * @return an array of command's parameters - */ - public String[] getParameters() { - return parameters; - } - - public void setParameters(String[] p) { - parameters = p; - } - - protected String optionsToString() { - StringBuffer sb = new StringBuffer(); - if (options != null && options.length > 0) { - for (int i = 0; i < options.length; i++) { - // If the option contains a space according to - // GDB/MI spec we must surround it with double quotes. - if (options[i].indexOf('\t') != -1 || options[i].indexOf(' ') != -1) { - sb.append(' ').append('"').append(options[i]).append('"'); - } else { - sb.append(' ').append(options[i]); - } - } - } - return sb.toString().trim(); - } - - protected String parametersToString() { - StringBuffer buffer = new StringBuffer(); - if (parameters != null && parameters.length > 0) { - // According to GDB/MI spec - // Add a "--" separator if any parameters start with "-" - if (options != null && options.length > 0) { - for (int i = 0; i < parameters.length; i++) { - if (parameters[i].startsWith("-")) { - buffer.append('-').append('-'); - break; - } - } - } - - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < parameters.length; i++) { - // We need to escape the double quotes and the backslash. - sb.setLength(0); - String param = parameters[i]; - for (int j = 0; j < param.length(); j++) { - char c = param.charAt(j); - if (c == '"' || c == '\\') { - sb.append('\\'); - } - sb.append(c); - } - - // If the string contains spaces instead of escaping - // surround the parameter with double quotes. - if (containsWhitespace(param)) { - sb.insert(0, '"'); - sb.append('"'); - } - buffer.append(' ').append(sb); - } - } - return buffer.toString().trim(); - } - - public String toString() { - StringBuffer command = new StringBuffer(getToken() + getOperation()); - String opt = optionsToString(); - if (opt.length() > 0) { - command.append(' ').append(opt); - } - String p = parametersToString(); - if (p.length() > 0) { - command.append(' ').append(p); - } - command.append('\n'); - return command.toString(); - } - - boolean containsWhitespace(String s) { - for (int i = 0; i < s.length(); i++) { - if (Character.isWhitespace(s.charAt(i))) { - return true; - } - } - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java deleted file mode 100644 index b500f5562b0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataDisassemble.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataDisassembleInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-disassemble - * [ -s START-ADDR -e END-ADDR ] - * | [ -f FILENAME -l LINENUM [ -n LINES ] ] - * -- MODE - * - *Where: - * - *`START-ADDR' - * is the beginning address (or `$pc') - * - *`END-ADDR' - * is the end address - * - *`FILENAME' - * is the name of the file to disassemble - * - *`LINENUM' - * is the line number to disassemble around - * - *`LINES' - * is the the number of disassembly lines to be produced. If it is - * -1, the whole function will be disassembled, in case no END-ADDR is - * specified. If END-ADDR is specified as a non-zero value, and - * LINES is lower than the number of disassembly lines between - * START-ADDR and END-ADDR, only LINES lines are displayed; if LINES - * is higher than the number of lines between START-ADDR and - * END-ADDR, only the lines up to END-ADDR are displayed. - * - *`MODE' - * is either 0 (meaning only disassembly) or 1 (meaning mixed source - * and disassembly). - * - *Result - *...... - * - * The output for each instruction is composed of four fields: - * - * * Address - * - * * Func-name - * - * * Offset - * - * * Instruction - * - * Note that whatever included in the instruction field, is not - *manipulated directely by GDB/MI, i.e. it is not possible to adjust its - *format. - * - * - */ -public class MIDataDisassemble extends MICommand -{ - public MIDataDisassemble(String start, String end, boolean mode) { - super("-data-disassemble"); - setOptions(new String[]{"-s", start, "-e", end}); - String mixed = "0"; - if (mode) { - mixed = "1"; - } - setParameters(new String[]{mixed}); - } - - public MIDataDisassemble(String file, int linenum, int lines, boolean mode) { - super("-data-disassemble"); - setOptions(new String[]{"-f", file, "-l", - Integer.toString(linenum), "-n", Integer.toString(lines)}); - String mixed = "0"; - if (mode) { - mixed = "1"; - } - setParameters(new String[]{mixed}); - } - - public MIDataDisassembleInfo getMIDataDisassembleInfo() throws MIException { - return (MIDataDisassembleInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataDisassembleInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java deleted file mode 100644 index 29cf08d5f33..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataEvaluateExpression.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-evaluate-expression EXPR - * - * Evaluate EXPR as an expression. The expression could contain an - *inferior function call. The function call will execute synchronously. - *If the expression contains spaces, it must be enclosed in double quotes. - * - */ -public class MIDataEvaluateExpression extends MICommand -{ - public MIDataEvaluateExpression(String expr) { - super("-data-evaluate-expression", new String[]{expr}); - } - - public MIDataEvaluateExpressionInfo getMIDataEvaluateExpressionInfo() throws MIException { - return (MIDataEvaluateExpressionInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataEvaluateExpressionInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java deleted file mode 100644 index 2c8a2b16077..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListChangedRegisters.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataListChangedRegistersInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-list-changed-registers - * - * Display a list of the registers that have changed. - * - */ -public class MIDataListChangedRegisters extends MICommand -{ - public MIDataListChangedRegisters() { - super("-data-list-changed-registers" ); - } - - public MIDataListChangedRegistersInfo getMIDataListChangedRegistersInfo() throws MIException { - return (MIDataListChangedRegistersInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataListChangedRegistersInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java deleted file mode 100644 index f4e0b766463..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterNames.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIDataListRegisterNamesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-list-register-names [ ( REGNO )+ ] - * - * Show a list of register names for the current target. If no - * arguments are given, it shows a list of the names of all the registers. - * If integer numbers are given as arguments, it will print a list of the - * names of the registers corresponding to the arguments. To ensure - * consistency between a register name and its number, the output list may - * include empty register names. - * - */ -public class MIDataListRegisterNames extends MICommand -{ - public MIDataListRegisterNames() { - super("-data-list-register-names"); - } - - public MIDataListRegisterNames(int [] regnos) { - this(); - if (regnos != null && regnos.length > 0) { - String[] array = new String[regnos.length]; - for (int i = 0; i < regnos.length; i++) { - array[i] = Integer.toString(regnos[i]); - } - setParameters(array); - } - } - - public MIDataListRegisterNamesInfo getMIDataListRegisterNamesInfo() throws MIException { - return (MIDataListRegisterNamesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataListRegisterNamesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java deleted file mode 100644 index 81f63868140..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataListRegisterValues.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIFormat; -import org.eclipse.cdt.debug.mi.core.output.MIDataListRegisterValuesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-list-register-values FMT [ ( REGNO )*] - * - * Display the registers' contents. FMT is the format according to - * which the registers' contents are to be returned, followed by an - * optional list of numbers specifying the registers to display. A - * missing list of numbers indicates that the contents of all the - * registers must be returned. - * - */ -public class MIDataListRegisterValues extends MICommand -{ - public MIDataListRegisterValues(int fmt) { - this(fmt, null); - } - - public MIDataListRegisterValues(int fmt, int [] regnos) { - super("-data-list-register-values"); - - String format = "x"; - switch (fmt) { - case MIFormat.NATURAL: - format = "N"; - break; - - case MIFormat.RAW: - format = "r"; - break; - - case MIFormat.DECIMAL: - format = "d"; - break; - - case MIFormat.BINARY: - format = "t"; - break; - - case MIFormat.OCTAL: - format = "o"; - break; - - case MIFormat.HEXADECIMAL: - default: - format = "x"; - break; - } - - setOptions(new String[]{format}); - - if (regnos != null && regnos.length > 0) { - String[] array = new String[regnos.length]; - for (int i = 0; i < regnos.length; i++) { - array[i] = Integer.toString(regnos[i]); - } - setParameters(array); - } - } - - public MIDataListRegisterValuesInfo getMIDataListRegisterValuesInfo() throws MIException { - return (MIDataListRegisterValuesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataListRegisterValuesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java deleted file mode 100644 index 2dc792efcf5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataReadMemory.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIFormat; -import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -data-read-memory [ -o BYTE-OFFSET ] - * ADDRESS WORD-FORMAT WORD-SIZE - * NR-ROWS NR-COLS [ ASCHAR ] - * - * where: - * - * `ADDRESS' - * An expression specifying the address of the first memory word to be - * read. Complex expressions containing embedded white space should - * be quoted using the C convention. - * - * `WORD-FORMAT' - * The format to be used to print the memory words. The notation is - * the same as for GDB's `print' command (*note Output formats: - * Output Formats.). - * - * `WORD-SIZE' - * The size of each memory word in bytes. - * - * `NR-ROWS' - * The number of rows in the output table. - * - * `NR-COLS' - * The number of columns in the output table. - * - * `ASCHAR' - * If present, indicates that each row should include an ASCII dump. - * The value of ASCHAR is used as a padding character when a byte is - * not a member of the printable ASCII character set (printable ASCII - * characters are those whose code is between 32 and 126, - * inclusively). - * - * `BYTE-OFFSET' - * - * - */ -public class MIDataReadMemory extends MICommand { - - public MIDataReadMemory( - long offset, - String address, - int wordFormat, - int wordSize, - int rows, - int cols, - Character asChar) { - super("-data-read-memory"); - if (offset != 0) { - setOptions(new String[] { "-o", Long.toString(offset)}); - } - - String format = "x"; - switch (wordFormat) { - case MIFormat.UNSIGNED : - format = "u"; - break; - - case MIFormat.FLOAT : - format = "f"; - break; - - case MIFormat.ADDRESS : - format = "a"; - break; - - case MIFormat.INSTRUCTION : - format = "i"; - break; - - case MIFormat.CHAR : - format = "c"; - break; - - case MIFormat.STRING : - format = "s"; - break; - - case MIFormat.DECIMAL : - format = "d"; - break; - - case MIFormat.BINARY : - format = "t"; - break; - - case MIFormat.OCTAL : - format = "o"; - break; - - case MIFormat.HEXADECIMAL : - default : - format = "x"; - break; - } - - if (asChar == null) { - setParameters( - new String[] { - address, - format, - Integer.toString(wordSize), - Integer.toString(rows), - Integer.toString(cols)}); - } else { - setParameters( - new String[] { - address, - format, - Integer.toString(wordSize), - Integer.toString(rows), - Integer.toString(cols), - asChar.toString()}); - } - } - - public MIDataReadMemoryInfo getMIDataReadMemoryInfo() throws MIException { - return (MIDataReadMemoryInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIDataReadMemoryInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java deleted file mode 100644 index 316af46e1b8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteMemory.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * - * -data-write-memory [-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE."); - * - * where: - * - * DATA-MEMORY-WRITE: - * - * COLUMN_OFFSET: optional argument. Must be preceeded by '-o'. The - * offset from the beginning of the memory grid row where the cell to - * be written is. - * ADDR: start address of the row in the memory grid where the memory - * cell is, if OFFSET_COLUMN is specified. Otherwise, the address of - * the location to write to. - * FORMAT: a char indicating format for the ``word''. See - * the ``x'' command. - * WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes - * VALUE: value to be written into the memory address. - * - * Writes VALUE into ADDR + (COLUMN_OFFSET * WORD_SIZE). - * - * Prints nothing. - * - */ -public class MIDataWriteMemory extends MICommand { - - public MIDataWriteMemory(long offset, String address, int wordFormat, int wordSize, - String value) { - - super ("-data-write-memory"); - - if (offset != 0) { - setOptions(new String[] { "-o", Long.toString(offset)}); - } - - String format = "x"; - switch (wordFormat) { - case MIFormat.UNSIGNED : - format = "u"; - break; - - case MIFormat.FLOAT : - format = "f"; - break; - - case MIFormat.ADDRESS : - format = "a"; - break; - - case MIFormat.INSTRUCTION : - format = "i"; - break; - - case MIFormat.CHAR : - format = "c"; - break; - - case MIFormat.STRING : - format = "s"; - break; - - case MIFormat.DECIMAL : - format = "d"; - break; - - case MIFormat.BINARY : - format = "t"; - break; - - case MIFormat.OCTAL : - format = "o"; - break; - - case MIFormat.HEXADECIMAL : - default : - format = "x"; - break; - } - - setParameters(new String[] {address, format, Integer.toString(wordSize), value}); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java deleted file mode 100644 index 9d6992b81be..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIDataWriteRegisterValues.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * - * Write given values into registers. The registers and values are - * given as pairs. The corresponding MI command is - * -data-write-register-values [ ... ] - * - */ -public class MIDataWriteRegisterValues extends MICommand { - - public MIDataWriteRegisterValues(int fmt, int[] regnos, String[] values) { - super("-data-write-register-values"); - - String format = "x"; - switch (fmt) { - case MIFormat.NATURAL: - format = "N"; - break; - - case MIFormat.RAW: - format = "r"; - break; - - case MIFormat.DECIMAL: - format = "d"; - break; - - case MIFormat.BINARY: - format = "t"; - break; - - case MIFormat.OCTAL: - format = "o"; - break; - - case MIFormat.HEXADECIMAL: - default: - format = "x"; - break; - } - - setOptions(new String[]{format}); - - if (regnos != null && values != null) { - List aList = new ArrayList(regnos.length); - for (int i = 0; i < regnos.length && i < values.length; i++) { - aList.add(Integer.toString(regnos[i])); - aList.add(values[i]); - } - String[] array = (String[])aList.toArray(new String[0]); - setParameters(array); - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java deleted file mode 100644 index 251f47f25a9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentCD.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * - * -environment-cd PATHDIR - * - * Set GDB's working directory. - * - * - */ -public class MIEnvironmentCD extends MICommand -{ - public MIEnvironmentCD(String path) { - super("-environment-cd", new String[]{path}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java deleted file mode 100644 index 6dd7168a6b4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentDirectory.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -environment-directory PATHDIR - * - * Add directory PATHDIR to beginning of search path for source files. - * - */ -public class MIEnvironmentDirectory extends MICommand -{ - public MIEnvironmentDirectory(String[] paths) { - super("-environment-directory", paths); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java deleted file mode 100644 index 91ab759e624..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPWD.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIEnvironmentPWDInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -environment-pwd - * - * Show the current working directory. - * - */ -public class MIEnvironmentPWD extends MICommand -{ - public MIEnvironmentPWD() { - super("-environment-pwd"); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIEnvironmentPWDInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java deleted file mode 100644 index 7f4dd1f4fac..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIEnvironmentPath.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -environment-path ( PATHDIR )+ - * - * Add directories PATHDIR to beginning of search path for object files. - * - */ -public class MIEnvironmentPath extends MICommand -{ - public MIEnvironmentPath(String[] paths) { - super("-environment-path", paths); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecAbort.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecAbort.java deleted file mode 100644 index 58a24d28075..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecAbort.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-finish - * - * Asynchronous command. Resumes the execution of the inferior program - * until the current function is exited. Displays the results returned by - * the function. - * - */ -public class MIExecAbort extends CLICommand -{ - public MIExecAbort() { - super("kill"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java deleted file mode 100644 index 17cf2c15926..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecArguments.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-arguments ARGS - * - * Set the inferior program arguments, to be used in the next - * `-exec-run'. - * - */ -public class MIExecArguments extends MICommand -{ - public MIExecArguments(String[] args) { - super("-exec-arguments", args); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java deleted file mode 100644 index a9a9b5a7325..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecContinue.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-continue - * - * Asynchronous command. Resumes the execution of the inferior program - * until a breakpoint is encountered, or until the inferior exits. - * - */ -public class MIExecContinue extends MICommand -{ - public MIExecContinue() { - super("-exec-continue"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java deleted file mode 100644 index 9d71a839ced..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecFinish.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-finish - * - * Asynchronous command. Resumes the execution of the inferior program - * until the current function is exited. Displays the results returned by - * the function. - * - */ -public class MIExecFinish extends MICommand -{ - public MIExecFinish() { - super("-exec-finish"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java deleted file mode 100644 index 11ad0144408..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecInterrupt.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-interrupt - * - * Asynchronous command. Interrupts the background execution of the - * target. Note how the token associated with the stop message is the one - * for the execution command that has been interrupted. The token for the - * interrupt itself only appears in the `^done' output. If the user is - * trying to interrupt a non-running program, an error message will be - * printed. - * - */ -public class MIExecInterrupt extends MICommand -{ - public MIExecInterrupt() { - super("-exec-interrupt"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java deleted file mode 100644 index ec8c4878298..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNext.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-next - * - * Asynchronous command. Resumes execution of the inferior program, - * stopping when the beginning of the next source line is reached. - * - */ -public class MIExecNext extends MICommand -{ - public MIExecNext() { - super("-exec-next"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java deleted file mode 100644 index a93d3e5edab..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecNextInstruction.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-next-instruction - * - * Asynchronous command. Executes one machine instruction. If the - * instruction is a function call continues until the function returns. If - * the program stops at an instruction in the middle of a source line, the - * address will be printed as well. - * - */ -public class MIExecNextInstruction extends MICommand -{ - public MIExecNextInstruction() { - super("-exec-next-instruction"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java deleted file mode 100644 index 3c8a00eadcc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecReturn.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * -exec-return - * - * Makes current function return immediately. Doesn't execute the - * inferior. Displays the new current frame. - * - */ -public class MIExecReturn extends MICommand -{ - public MIExecReturn() { - super("-exec-return"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java deleted file mode 100644 index f47d1b654c6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecRun.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-run - * - * Asynchronous command. Starts execution of the inferior from the - * beginning. The inferior executes until either a breakpoint is - * encountered or the program exits. - * - */ -public class MIExecRun extends MICommand -{ - public MIExecRun() { - super("-exec-run"); - } - - public MIExecRun(String[] args) { - super("-exec-run", args); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java deleted file mode 100644 index 4bf36936951..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStep.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-step - * - * Asynchronous command. Resumes execution of the inferior program, - * stopping when the beginning of the next source line is reached, if the - * next source line is not a function call. If it is, stop at the first - * instruction of the called function. - * - */ -public class MIExecStep extends MICommand -{ - public MIExecStep() { - super("-exec-step"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java deleted file mode 100644 index b784cb639a9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecStepInstruction.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * -exec-step-instruction - - * Asynchronous command. Resumes the inferior which executes one - * machine instruction. The output, once GDB has stopped, will vary - * depending on whether we have stopped in the middle of a source line or - * not. In the former case, the address at which the program stopped will - * be printed as well. - * - */ -public class MIExecStepInstruction extends MICommand -{ - public MIExecStepInstruction() { - super("-exec-step-instruction"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java deleted file mode 100644 index bdf98e68a1a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIExecUntil.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -exec-until [ LOCATION ] - * - * Asynchronous command. Executes the inferior until the LOCATION - * specified in the argument is reached. If there is no argument, the - * inferior executes until a source line greater than the current one is - * reached. The reason for stopping in this case will be - * `location-reached'. - * - */ -public class MIExecUntil extends MICommand -{ - public MIExecUntil() { - super("-exec-until"); - } - - public MIExecUntil(String loc) { - super("-exec-until", new String[]{loc}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java deleted file mode 100644 index 1abda350dd9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileExecFile.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -file-exec-file FILE - * - * Specify the executable file to be debugged. Unlike - * `-file-exec-and-symbols', the symbol table is _not_ read from this - * file. If used without argument, GDB clears the information about the - * executable file. No output is produced, except a completion - * notification. - * - */ -public class MIFileExecFile extends MICommand -{ - public MIFileExecFile(String file) { - super("-file-exec-file", new String[]{file}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java deleted file mode 100644 index 284b37f90d3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIFileSymbolFile.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -file-symbol-file FILE - * - * Read symbol table info from the specified FILE argument. When used - * without arguments, clears GDB's symbol table info. No output is - * produced, except for a completion notification. - * - */ -public class MIFileSymbolFile extends MICommand -{ - public MIFileSymbolFile(String file) { - super("-file-symbol-file", new String[]{file}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java deleted file mode 100644 index 88cb763f86d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBExit.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-exit - * - * Exit GDB immediately. - * - */ -public class MIGDBExit extends MICommand -{ - public MIGDBExit() { - super("-gdb-exit"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java deleted file mode 100644 index 4ed52be2af2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSet.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSet extends MICommand -{ - public MIGDBSet(String[] params) { - super("-gdb-set", params); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java deleted file mode 100644 index f91d3274bd8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetAutoSolib.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetAutoSolib extends MIGDBSet { - public MIGDBSetAutoSolib(boolean isSet) { - super(new String[] {"auto-solib-add", (isSet) ? "on" : "off"}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java deleted file mode 100644 index f2612ad4406..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetEnvironment.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetEnvironment extends MIGDBSet { - - public MIGDBSetEnvironment(String[] paths) { - super(paths); - // Overload the parameter - String[] newPaths = new String[paths.length + 1]; - newPaths[0] = "environment"; - System.arraycopy(paths, 0, newPaths, 1, paths.length); - setParameters(newPaths); - } - - /** - * According to the help.: - * Set environment variable value to give the program. - * Arguments are VAR VALUE where VAR is variable name and VALUE is value. - * VALUES of environment variables are uninterpreted strings. - * This does not affect the program until the next "run" command. - * - * So pass the strings raw without interpretation. - */ - protected String parametersToString() { - StringBuffer buffer = new StringBuffer(); - if (parameters != null) { - for (int i = 0; i < parameters.length; i++) { - buffer.append(' ').append(parameters[i]); - } - } - return buffer.toString().trim(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java deleted file mode 100644 index 8a8625d8d76..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetSolibSearchPath.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetSolibSearchPath extends MIGDBSet { - public MIGDBSetSolibSearchPath(String[] paths) { - super(paths); - // Overload the parameter - String sep = System.getProperty("path.separator", ":"); - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < paths.length; i++) { - if (buffer.length() == 0) { - buffer.append(paths[i]); - } else { - buffer.append(sep).append(paths[i]); - } - } - String[] p = new String [] {"solib-search-path", buffer.toString()}; - setParameters(p); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java deleted file mode 100644 index 976508e2c97..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBSetStopOnSolibEvents.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -gdb-set stop-on-solib-events - * - * Set an internal GDB variable. - * - */ -public class MIGDBSetStopOnSolibEvents extends MIGDBSet { - public MIGDBSetStopOnSolibEvents(boolean isSet) { - super(new String[] {"stop-on-solib-events", (isSet) ? "1" : "0"}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java deleted file mode 100644 index 7c0abb75b16..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShow.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -gdb-show - * - * Show the current value of a GDB variable. - * - */ -public class MIGDBShow extends MICommand { - public MIGDBShow(String[] params) { - super("-gdb-show", params); - } - - public MIGDBShowInfo getMIGDBShowInfo() throws MIException { - return (MIGDBShowInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java deleted file mode 100644 index 2daf09f87ef..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowDirectories.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowDirectoriesInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -gdb-show directories - * - * Show the current value of a GDB variable(directories). - * - */ -public class MIGDBShowDirectories extends MIGDBShow { - public MIGDBShowDirectories() { - super(new String[] { "directories" }); - } - - public MIGDBShowDirectoriesInfo getMIGDBShowDirectoriesInfo() throws MIException { - return (MIGDBShowDirectoriesInfo)getMIInfo(); - } - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowDirectoriesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java deleted file mode 100644 index 40db3e3caf1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowExitCode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowExitCodeInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - *-data-evaluate-expression $_exitcode - * ^done,value="10" - * - * Show the current value of a $_exitcode - * - */ -public class MIGDBShowExitCode extends MIDataEvaluateExpression { - - public MIGDBShowExitCode() { - super("$_exitcode"); - } - - public MIGDBShowExitCodeInfo getMIGDBShowExitCodeInfo() throws MIException { - return (MIGDBShowExitCodeInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowExitCodeInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java deleted file mode 100644 index 1cb287252e4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIGDBShowSolibSearchPath.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIGDBShowSolibSearchPathInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * -gdb-show directories - * - * Show the current value of a GDB variable(directories). - * - */ -public class MIGDBShowSolibSearchPath extends MIGDBShow { - public MIGDBShowSolibSearchPath() { - super(new String[] { "solib-search-path" }); - } - - public MIGDBShowSolibSearchPathInfo getMIGDBShowSolibSearchPathInfo() throws MIException { - return (MIGDBShowSolibSearchPathInfo)getMIInfo(); - } - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIGDBShowSolibSearchPathInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIHandle.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIHandle.java deleted file mode 100644 index 5b7e1448845..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIHandle.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * handle SIGUSR1 nostop noignore - * - */ -public class MIHandle extends CLICommand { - - public MIHandle(String arg) { - super("handle " + arg); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoProgram.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoProgram.java deleted file mode 100644 index a0b3257f866..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoProgram.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoProgramInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class MIInfoProgram extends CLICommand -{ - public MIInfoProgram() { - super("info program"); - } - - public MIInfoProgramInfo getMIInfoProgramInfo() throws MIException { - return (MIInfoProgramInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIInfoProgramInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSharedLibrary.java deleted file mode 100644 index 1a3bbab3256..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSharedLibrary.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoSharedLibraryInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class MIInfoSharedLibrary extends CLICommand -{ - public MIInfoSharedLibrary() { - super("info sharedlibrary"); - } - - public MIInfoSharedLibraryInfo getMIInfoSharedLibraryInfo() throws MIException { - return (MIInfoSharedLibraryInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIInfoSharedLibraryInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSignals.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSignals.java deleted file mode 100644 index db3c2f67736..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoSignals.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoSignalsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class MIInfoSignals extends CLICommand -{ - public MIInfoSignals() { - super("info signals"); - } - - public MIInfoSignals(String name) { - super("info signal " + name); - } - - public MIInfoSignalsInfo getMIInfoSignalsInfo() throws MIException { - return (MIInfoSignalsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIInfoSignalsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoThreads.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoThreads.java deleted file mode 100644 index 6f57f6b81b5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIInfoThreads.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; - -/** - * - * info threads - * - */ -public class MIInfoThreads extends CLICommand -{ - public MIInfoThreads() { - super("info threads"); - } - - public MIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException { - return (MIInfoThreadsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIInfoThreadsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIJump.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIJump.java deleted file mode 100644 index 941ddbcc29b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIJump.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; - - -/** - * - * jump LINESPEC - * - */ -public class MIJump extends CLICommand { - - MIOutput out; - - public MIJump(String loc) { - super("jump " + loc); - } - - /** - * This is a CLI command contraly to - * the -exec-continue or -exec-run - * it does not return so we have to fake - * a return value. We return "^running" - */ - public MIOutput getMIOutput() { - if (out == null) { - out = new MIOutput(); - MIResultRecord rr = new MIResultRecord(); - rr.setToken(getToken()); - rr.setResultClass(MIResultRecord.RUNNING); - out.setMIResultRecord(rr); - } - return out; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIPType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIPType.java deleted file mode 100644 index 1dfe92851af..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIPType.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIPTypeInfo; - -/** - * - * ptype type - * - */ -public class MIPType extends CLICommand -{ - public MIPType(String var) { - super("ptype " + var); - } - - public MIPTypeInfo getMIPtypeInfo() throws MIException { - return (MIPTypeInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIPTypeInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISharedLibrary.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISharedLibrary.java deleted file mode 100644 index 7a89e1f6f78..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISharedLibrary.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * sharedlibrary filename - * - */ -public class MISharedLibrary extends CLICommand { - - public MISharedLibrary() { - super("sharedlibrary"); - } - - public MISharedLibrary(String name) { - super("sharedlibrary " + name); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISignal.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISignal.java deleted file mode 100644 index 709910f09ce..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MISignal.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; - - - -/** - * - * signal SIGUSR1 - * - */ -public class MISignal extends CLICommand { - - MIOutput out; - - public MISignal(String arg) { - super("signal " + arg); - } - - /** - * This is a CLI command contraly to - * the -exec-continue or -exec-run - * it does not return so we have to fake - * a return value. We return "^running" - */ - public MIOutput getMIOutput() { - if (out == null) { - out = new MIOutput(); - MIResultRecord rr = new MIResultRecord(); - rr.setToken(getToken()); - rr.setResultClass(MIResultRecord.RUNNING); - out.setMIResultRecord(rr); - } - return out; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java deleted file mode 100644 index 1cdb8f4a082..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackInfoDepth.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStackInfoDepthInfo; - -/** - * - * -stack-info-depth [ MAX-DEPTH ] - * - * Return the depth of the stack. If the integer argument MAX-DEPTH is - * specified, do not count beyond MAX-DEPTH frames. - * - */ -public class MIStackInfoDepth extends MICommand -{ - public MIStackInfoDepth() { - super("-stack-info-depth"); - } - - public MIStackInfoDepth(int maxDepth) { - super("-stack-info-depth", new String[]{Integer.toString(maxDepth)}); - } - - public MIStackInfoDepthInfo getMIStackInfoDepthInfo() throws MIException { - return (MIStackInfoDepthInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackInfoDepthInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java deleted file mode 100644 index 9b65ef30f94..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListArguments.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStackListArgumentsInfo; - -/** - * - * -stack-list-arguments SHOW-VALUES - * [ LOW-FRAME HIGH-FRAME ] - * - * Display a list of the arguments for the frames between LOW-FRAME and - * HIGH-FRAME (inclusive). If LOW-FRAME and HIGH-FRAME are not provided, - * list the arguments for the whole call stack. - * - * The SHOW-VALUES argument must have a value of 0 or 1. A value of 0 - * means that only the names of the arguments are listed, a value of 1 - * means that both names and values of the arguments are printed. - * - */ -public class MIStackListArguments extends MICommand -{ - public MIStackListArguments(boolean showValues) { - super("-stack-list-arguments"); - if (showValues) { - setParameters(new String[]{"1"}); - } else { - setParameters(new String[]{"0"}); - } - } - - public MIStackListArguments(boolean showValues, int low, int high) { - super("-stack-list-arguments"); - String[] params = new String[3]; - if (showValues) { - params[0] = "1"; - } else { - params[0] = "0"; - } - params[1] = Integer.toString(low); - params[2] = Integer.toString(high); - setParameters(params); - } - - public MIStackListArgumentsInfo getMIStackListArgumentsInfo() throws MIException { - return (MIStackListArgumentsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackListArgumentsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java deleted file mode 100644 index aa93c8c05b9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListFrames.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStackListFramesInfo; - -/** - * - * -stack-list-frames [ LOW-FRAME HIGH-FRAME ] - * - * List the frames currently on the stack. For each frame it displays - * the following info: - * - * `LEVEL' - * The frame number, 0 being the topmost frame, i.e. the innermost - * function. - * - * `ADDR' - * The `$pc' value for that frame. - * - * `FUNC' - * Function name. - * - * `FILE' - * File name of the source file where the function lives. - * - * `LINE' - * Line number corresponding to the `$pc'. - * - * If invoked without arguments, this command prints a backtrace for the - * whole stack. If given two integer arguments, it shows the frames whose - * levels are between the two arguments (inclusive). If the two arguments - * are equal, it shows the single frame at the corresponding level. - * - */ -public class MIStackListFrames extends MICommand -{ - public MIStackListFrames() { - super("-stack-list-frames"); - } - - public MIStackListFrames(int low, int high) { - super("-stack-list-frames", new String[]{Integer.toString(low), - Integer.toString(high)}); - } - - public MIStackListFramesInfo getMIStackListFramesInfo() throws MIException { - return (MIStackListFramesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackListFramesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java deleted file mode 100644 index d282cfd042f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackListLocals.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIStackListLocalsInfo; - -/** - * - * -stack-list-locals PRINT-VALUES - * - * Display the local variable names for the current frame. With an - * argument of 0 prints only the names of the variables, with argument of 1 - * prints also their values. - * - */ -public class MIStackListLocals extends MICommand -{ - public MIStackListLocals(boolean printValues) { - super("-stack-list-locals"); - if (printValues) { - setParameters(new String[]{"1"}); - } else { - setParameters(new String[]{"0"}); - } - } - - public MIStackListLocalsInfo getMIStackListLocalsInfo() throws MIException { - return (MIStackListLocalsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIStackListLocalsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java deleted file mode 100644 index 3992330178c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIStackSelectFrame.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - - - -/** - * - * -stack-select-frame FRAMENUM - * - * Change the current frame. Select a different frame FRAMENUM on the - * stack. - * - */ -public class MIStackSelectFrame extends MICommand -{ - public MIStackSelectFrame(int frameNum) { - super("-stack-select-frame", new String[]{Integer.toString(frameNum)}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java deleted file mode 100644 index 00d458e2969..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetAttach.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * - * -target-attach PID | FILE - * - * Attach to a process PID or a file FILE outside of GDB. - * - */ -public class MITargetAttach extends CLICommand -{ - public MITargetAttach(int pid) { - super("attach " + Integer.toString(pid)); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java deleted file mode 100644 index bcbac34dc2b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDetach.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * - * -target-detach - * - * Disconnect from the remote target. There's no output. - * - */ -public class MITargetDetach extends MICommand -{ - public MITargetDetach() { - super("-target-detach"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java deleted file mode 100644 index 5cc0142c2e3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetDownload.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * - * (c) 2002 Copyright RedHat Inc - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * RedHat Inc - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -target-download - * - * Load the executable to the remote target. This command takes no args. - * - * - * Loads the executable onto the remote target. It prints out an - * update message every half second, which includes the fields: - * - * +download,{section=".text",section-size="6668",total-size="9880"} - * +download,{section=".text",section-sent="512",section-size="6668", - * total-sent="512",total-size="9880"} - * - */ -public class MITargetDownload extends MICommand -{ - public MITargetDownload() { - super("-target-download"); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java deleted file mode 100644 index 50465eb4079..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MITargetSelect.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -target-select TYPE PARAMETERS ... - * - * Connect GDB to the remote target. This command takes two args: - * - * `TYPE' - * The type of target, for instance `async', `remote', etc. - * - * `PARAMETERS' - * Device names, host names and the like. *Note Commands for - * managing targets: Target Commands, for more details. - * - * The output is a connection notification, followed by the address at - * which the target program is, in the following form: - * - * ^connected,addr="ADDRESS",func="FUNCTION NAME", - * args=[ARG LIST] - * - */ -public class MITargetSelect extends MICommand -{ - public MITargetSelect(String[] params) { - super("-target-select", params); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java deleted file mode 100644 index ed4cd77cfc6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadListIds.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIThreadListIdsInfo; - -/** - * - * -thread-list-ids - * - * Produces a list of the currently known GDB thread ids. At the end - * of the list it also prints the total number of such threads. - * - */ -public class MIThreadListIds extends MICommand -{ - public MIThreadListIds() { - super("-thread-list-ids"); - } - - public MIThreadListIdsInfo getMIThreadListIdsInfo() throws MIException { - return (MIThreadListIdsInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIThreadListIdsInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java deleted file mode 100644 index 0de7ac636de..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIThreadSelect.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo; - -/** - * - * -thread-select THREADNUM - * - * Make THREADNUM the current thread. It prints the number of the new - * current thread, and the topmost frame for that thread. - * - */ -public class MIThreadSelect extends MICommand -{ - public MIThreadSelect(int threadNum) { - super("-thread-select", new String[]{Integer.toString(threadNum)}); - } - - public MIThreadSelectInfo getMIThreadSelectInfo() throws MIException { - return (MIThreadSelectInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIThreadSelectInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java deleted file mode 100644 index cf7b071720f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarAssign.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -var-assign NAME EXPRESSION - * - * Assigns the value of EXPRESSION to the variable object specified by - * NAME. The object must be `editable'. - * - */ -public class MIVarAssign extends MICommand -{ - public MIVarAssign(String name, String expression) { - super("-var-assign", new String[]{name, expression}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java deleted file mode 100644 index 47fe53e89d0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarCreate.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarCreateInfo; - -/** - * - * -var-create {NAME | "-"} - * {FRAME-ADDR | "*"} EXPRESSION - * - * This operation creates a variable object, which allows the - * monitoring of a variable, the result of an expression, a memory cell or - * a CPU register. - * - * The NAME parameter is the string by which the object can be - * referenced. It must be unique. If `-' is specified, the varobj system - * will generate a string "varNNNNNN" automatically. It will be unique - * provided that one does not specify NAME on that format. The command - * fails if a duplicate name is found. - * - * The frame under which the expression should be evaluated can be - * specified by FRAME-ADDR. A `*' indicates that the current frame should - * be used. - * - * EXPRESSION is any expression valid on the current language set (must - * not begin with a `*'), or one of the following: - * - * * `*ADDR', where ADDR is the address of a memory cell - * - * * `*ADDR-ADDR' -- a memory address range (TBD) - * - * * `$REGNAME' -- a CPU register name - * - */ -public class MIVarCreate extends MICommand -{ - public MIVarCreate(String expression) { - this("-", "*", expression); - } - - public MIVarCreate(String name, String expression) { - this(name, "*", expression); - } - - public MIVarCreate(String name, String frameAddr, String expression) { - super("-var-create", new String[]{name, frameAddr, expression}); - } - - public MIVarCreateInfo getMIVarCreateInfo() throws MIException { - return (MIVarCreateInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarCreateInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java deleted file mode 100644 index 8c206b6a97d..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarDelete.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarDeleteInfo; - -/** - * - * -var-delete NAME - * - * Deletes a previously created variable object and all of its children. - * - * Returns an error if the object NAME is not found. - * - */ -public class MIVarDelete extends MICommand -{ - public MIVarDelete(String name) { - super("-var-delete", new String[]{name}); - } - - public MIVarDeleteInfo getMIVarDeleteInfo() throws MIException { - return (MIVarDeleteInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarDeleteInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java deleted file mode 100644 index ec90e3f3a95..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarEvaluateExpression.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarEvaluateExpressionInfo; - -/** - * - * -var-evaluate-expression NAME - * - * Evaluates the expression that is represented by the specified - * variable object and returns its value as a string in the current format - * specified for the object: - * - * value=VALUE - * - */ -public class MIVarEvaluateExpression extends MICommand { - public MIVarEvaluateExpression(String expression) { - super("-var-evaluate-expression", new String[] { expression }); - } - - public MIVarEvaluateExpressionInfo getMIVarEvaluateExpressionInfo() - throws MIException { - return (MIVarEvaluateExpressionInfo) getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarEvaluateExpressionInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java deleted file mode 100644 index 98f01703178..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoExpression.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarInfoExpressionInfo; - -/** - * - * -var-info-expression NAME - * - * Returns what is represented by the variable object NAME: - * - * lang=LANG-SPEC,exp=EXPRESSION - * - * where LANG-SPEC is `{"C" | "C++" | "Java"}'. - * - */ -public class MIVarInfoExpression extends MICommand -{ - public MIVarInfoExpression(String name) { - super("-var-info-expression", new String[]{name}); - } - - public MIVarInfoExpressionInfo getMIVarInfoExpressionInfo() throws MIException { - return (MIVarInfoExpressionInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarInfoExpressionInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java deleted file mode 100644 index 6963d54246c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoNumChildren.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarInfoNumChildrenInfo; - -/** - * - * -var-info-num-children NAME - * - * Returns the number of children of a variable object NAME: - * - * numchild=N - * - */ -public class MIVarInfoNumChildren extends MICommand -{ - public MIVarInfoNumChildren(String name) { - super("-var-info-num-children", new String[]{name}); - } - - public MIVarInfoNumChildrenInfo getMIVarInfoNumChildrenInfo() throws MIException { - return (MIVarInfoNumChildrenInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarInfoNumChildrenInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java deleted file mode 100644 index 166bc36e865..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarInfoType.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -var-info-type NAME - * - * Returns the type of the specified variable NAME. The type is - * returned as a string in the same format as it is output by the GDB CLI: - * - * type=TYPENAME - * - */ -public class MIVarInfoType extends MICommand -{ - public MIVarInfoType(String name) { - super("-var-info-type", new String[]{name}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java deleted file mode 100644 index 9f13dd26229..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarListChildren.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarListChildrenInfo; - -/** - * - * -var-list-children NAME - * - * Returns a list of the children of the specified variable object: - * - * numchild=N,children={{name=NAME, - * numchild=N,type=TYPE},(repeats N times)} - * - */ -public class MIVarListChildren extends MICommand -{ - public MIVarListChildren(String name) { - super("-var-list-children", new String[]{name}); - } - - public MIVarListChildrenInfo getMIVarListChildrenInfo() throws MIException { - return (MIVarListChildrenInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarListChildrenInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java deleted file mode 100644 index 6d8c477236b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarSetFormat.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * - * -var-set-format NAME FORMAT-SPEC - * - * Sets the output format for the value of the object NAME to be - * FORMAT-SPEC. - * - * The syntax for the FORMAT-SPEC is as follows: - * - * FORMAT-SPEC ==> - * {binary | decimal | hexadecimal | octal | natural} - * - */ -public class MIVarSetFormat extends MICommand -{ - public MIVarSetFormat(String name, int fmt) { - super("-var-set-format"); - String format = "hexadecimal"; - switch (fmt) { - case MIFormat.NATURAL: - format = "natural"; - break; - case MIFormat.DECIMAL: - format = "decimal"; - break; - case MIFormat.BINARY: - format = "binary"; - break; - case MIFormat.OCTAL: - format = "octal"; - break; - /* - case MIFormat.HEXADECIMAL: - case MIFormat.RAW: - default: - format = "hexadecimal"; - break; - */ - } - setParameters(new String[]{name, format}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java deleted file mode 100644 index eed087e057c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowAttributes.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarShowAttributesInfo; - -/** - * - * -var-show-attributes NAME - * - * List attributes of the specified variable object NAME: - * - * status=ATTR [ ( ,ATTR )* ] - * - * where ATTR is `{ { editable | noneditable } | TBD }'. - * - */ -public class MIVarShowAttributes extends MICommand -{ - public MIVarShowAttributes(String name) { - super("-var-show-attributes", new String[]{name}); - } - - public MIVarShowAttributesInfo getMIVarShowAttributesInfo() throws MIException { - return (MIVarShowAttributesInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarShowAttributesInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java deleted file mode 100644 index 72d6a14c089..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarShowFormat.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -/** - * - * -var-show-format NAME - * - * Returns the format used to display the value of the object NAME. - * - * FORMAT ==> - * FORMAT-SPEC - * - */ -public class MIVarShowFormat extends MICommand -{ - public MIVarShowFormat(String name) { - super("-var-show-format", new String[]{name}); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java deleted file mode 100644 index 0978c1bdfea..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIVarUpdate.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo; - -/** - * - * -var-update {NAME | "*"} - * - * Update the value of the variable object NAME by evaluating its - * expression after fetching all the new values from memory or registers. - * A `*' causes all existing variable objects to be updated. - * - */ -public class MIVarUpdate extends MICommand { - - public MIVarUpdate() { - this("*"); - } - - public MIVarUpdate(String name) { - super("-var-update", new String[] { name }); - } - - public MIVarUpdateInfo getMIVarUpdateInfo() throws MIException { - return (MIVarUpdateInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIVarUpdateInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIWhatis.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIWhatis.java deleted file mode 100644 index 6a1e55c9fd5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/command/MIWhatis.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.command; - -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.output.MIInfo; -import org.eclipse.cdt.debug.mi.core.output.MIOutput; -import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo; - -/** - * - * whatis type - * - */ -public class MIWhatis extends CLICommand -{ - public MIWhatis(String var) { - super("whatis " + var); - } - - public MIWhatisInfo getMIWhatisInfo() throws MIException { - return (MIWhatisInfo)getMIInfo(); - } - - public MIInfo getMIInfo() throws MIException { - MIInfo info = null; - MIOutput out = getMIOutput(); - if (out != null) { - info = new MIWhatisInfo(out); - if (info.isError()) { - throwMIException(info, out); - } - } - return info; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java deleted file mode 100644 index 2bb65072b6a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointChangedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - */ -public class MIBreakpointChangedEvent extends MIChangedEvent { - - int no; - - public MIBreakpointChangedEvent(int number) { - this(0, number); - } - - public MIBreakpointChangedEvent(int id, int number) { - super(id); - no = number; - } - - public int getNumber() { - return no; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java deleted file mode 100644 index 7ad96268f3b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointCreatedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - */ -public class MIBreakpointCreatedEvent extends MICreatedEvent { - - int no; - - public MIBreakpointCreatedEvent(int number) { - this(0, number); - } - - public MIBreakpointCreatedEvent(int id, int number) { - super(id); - no = number; - } - - public int getNumber() { - return no; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java deleted file mode 100644 index a07e1b4587f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointDeletedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - */ -public class MIBreakpointDeletedEvent extends MIDestroyedEvent { - - int no; - - public MIBreakpointDeletedEvent(int number) { - this(0, number); - } - - public MIBreakpointDeletedEvent(int id, int number) { - super(id); - no = number; - } - - public int getNumber() { - return no; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java deleted file mode 100644 index 656a9b7ad6e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIBreakpointHitEvent.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * ^stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048468",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="4"} - * - */ -public class MIBreakpointHitEvent extends MIStoppedEvent { - - int bkptno; - MIFrame frame; - - public MIBreakpointHitEvent(MIExecAsyncOutput record) { - super(record); - parse(); - } - - public MIBreakpointHitEvent(MIResultRecord record) { - super(record); - parse(); - } - - public int getNumber() { - return bkptno; - } - - public MIFrame getMIFrame() { - return frame; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("number=").append(bkptno).append('\n'); - buffer.append("thread-id=").append(getThreadId()).append('\n'); - buffer.append(frame.toString()); - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("bkptno")) { - try { - bkptno = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("thread-id")) { - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - frame = new MIFrame((MITuple)value); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java deleted file mode 100644 index cc6828e4d2a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIChangedEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public abstract class MIChangedEvent extends MIEvent { - public MIChangedEvent(int id) { - super(id); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java deleted file mode 100644 index 15c4617dda5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MICreatedEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public abstract class MICreatedEvent extends MIEvent { - public MICreatedEvent(int id) { - super(id); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java deleted file mode 100644 index f0216f06881..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDestroyedEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public abstract class MIDestroyedEvent extends MIEvent { - public MIDestroyedEvent(int id) { - super(id); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java deleted file mode 100644 index 4de71c0fce0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIDetachedEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - * ^running - */ -public class MIDetachedEvent extends MIDestroyedEvent { - - public MIDetachedEvent(int token) { - super(token); - } - - public String toString() { - return "Detached"; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java deleted file mode 100644 index d4ddf07b6a2..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIErrorEvent.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MILogStreamOutput; -import org.eclipse.cdt.debug.mi.core.output.MIOOBRecord; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - - - -/** - * (gdb) - * &"warning: Cannot insert breakpoint 2:\n" - * &"Cannot access memory at address 0x8020a3\n" - * 30^error,msg=3D"Cannot access memory at address 0x8020a3"=20 - */ -public class MIErrorEvent extends MIStoppedEvent { - - String msg = ""; - String log = ""; - MIOOBRecord[] oobs; - - public MIErrorEvent(MIResultRecord rr, MIOOBRecord[] o) { - super(rr); - oobs = o; - parse(); - } - - public String getMessage() { - return msg; - } - - public String getLogMessage() { - return log; - } - - void parse () { - MIResultRecord rr = getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("msg")) { - msg = str; - } - } - } - if (oobs != null) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MILogStreamOutput) { - MIStreamRecord o = (MIStreamRecord)oobs[i]; - sb.append(o.getString()); - } - } - log = sb.toString(); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIEvent.java deleted file mode 100644 index 45843d65f5c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -/** - */ -public abstract class MIEvent { - - int token; - - public MIEvent(int token) { - this.token = token; - } - - public int getToken() { - return token; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java deleted file mode 100644 index a30599704b5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIFunctionFinishedEvent.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="function-finished",thread-id="0",frame={addr="0x0804855a",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="17"},gdb-result-var="$1",return-value="10" - */ -public class MIFunctionFinishedEvent extends MIStoppedEvent { - - String gdbResult = ""; - String returnValue = ""; - - public MIFunctionFinishedEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MIFunctionFinishedEvent(MIResultRecord record) { - super(record); - parse(); - } - - public String getGDBResultVar() { - return gdbResult; - } - - public String getReturnValue() { - return returnValue; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("gdb-result-var=" + gdbResult + "\n"); - buffer.append("return-value=" + returnValue + "\n"); - buffer.append("thread-id=").append(getThreadId()).append('\n'); - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse () { - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("gdb-result-var")) { - gdbResult = str; - } else if (var.equals("return-value")) { - returnValue = str; - } else if (var.equals("thread-id")) { - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java deleted file mode 100644 index 36862fdfc3b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIGDBExitEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * Gdb Session terminated. - */ -public class MIGDBExitEvent extends MIDestroyedEvent { - - public MIGDBExitEvent(int token) { - super(token); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java deleted file mode 100644 index f18a0c5fa66..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorExitEvent.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - - - -/** - * *stopped,reason="exited-normally" - * *stopped,reason="exited",exit-code="04" - * ^done,reason="exited",exit-code="04" - * - */ -public class MIInferiorExitEvent extends MIDestroyedEvent { - - int code = 0; - - MIExecAsyncOutput exec = null; - MIResultRecord rr = null; - - public MIInferiorExitEvent(int token) { - super(token); - } - - public MIInferiorExitEvent(MIExecAsyncOutput async) { - super(async.getToken()); - exec = async; - parse(); - } - - public MIInferiorExitEvent(MIResultRecord record) { - super(record.getToken()); - rr = record; - parse(); - } - - public int getExitCode() { - return code; - } - - void parse () { - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("exit-code")) { - try { - code = Integer.decode(str.trim()).intValue(); - } catch (NumberFormatException e) { - } - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java deleted file mode 100644 index c2fd9bf2c28..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIInferiorSignalExitEvent.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * signal 2 - * "signal 2\n" - * ^done,reason="exited-signalled",signal-name="SIGINT",signal-meaning="Interrupt" - * - */ -public class MIInferiorSignalExitEvent extends MIDestroyedEvent { - - String sigName = ""; - String sigMeaning = ""; - - MIExecAsyncOutput exec = null; - MIResultRecord rr = null; - - public MIInferiorSignalExitEvent(MIExecAsyncOutput async) { - super(async.getToken()); - exec = async; - parse(); - } - - public MIInferiorSignalExitEvent(MIResultRecord record) { - super(record.getToken()); - rr = record; - parse(); - } - - public String getName() { - return sigName; - } - - public String getMeaning() { - return sigMeaning; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("signal-name=" + sigName + "\n"); - buffer.append("signal-meaning=" + sigMeaning + "\n"); - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("signal-name")) { - sigName = str; - } else if (var.equals("signal-meaning")) { - sigMeaning = str; - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java deleted file mode 100644 index 0973018eee6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MILocationReachedEvent.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="location-reached",thread-id="0",frame={addr="0x0804858e",func="main2",args=[],file="hello.c",line="27"} - */ -public class MILocationReachedEvent extends MIStoppedEvent { - - public MILocationReachedEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MILocationReachedEvent(MIResultRecord record) { - super(record); - parse(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("thread-id=").append(getThreadId()).append('\n'); - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("thread-id")) { - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java deleted file mode 100644 index 0bbd7b2088f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIMemoryChangedEvent extends MIChangedEvent { - - Long[] addresses; - - public MIMemoryChangedEvent(Long[] addrs) { - this(0, addrs); - } - - public MIMemoryChangedEvent(int token, Long[] addrs) { - super(token); - addresses = addrs; - } - - public Long[] getAddresses() { - return addresses; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java deleted file mode 100644 index 07e06f87ff9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIMemoryCreatedEvent extends MICreatedEvent { - - long address; - long totalBytes; - - public MIMemoryCreatedEvent(long addr, long total) { - this(0, addr, total); - } - - public MIMemoryCreatedEvent(int token, long addr, long total) { - super(token); - address = addr; - totalBytes = total; - } - - public long getAddress() { - return address; - } - - public long getLength() { - return totalBytes; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java deleted file mode 100644 index d15f28555a8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterChangedEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIRegisterChangedEvent extends MIChangedEvent { - - String regName; - int regno; - - public MIRegisterChangedEvent(int token, String name, int no) { - super(token); - regName = name; - regno = no; - } - - public String getName() { - return regName; - } - - public int getNumber() { - return regno; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java deleted file mode 100644 index ec019932e78..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRegisterCreatedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIRegisterCreatedEvent extends MICreatedEvent { - - String regName; - int regno; - - public MIRegisterCreatedEvent(String name, int number) { - this(0, name, number); - } - - public MIRegisterCreatedEvent(int token, String name, int number) { - super(token); - regName = name; - regno = number; - } - - public String getName() { - return regName; - } - - public int getNumber() { - return regno; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java deleted file mode 100644 index d5b5167d810..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIRunningEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - * ^running - */ -public class MIRunningEvent extends MIEvent { - - public static final int CONTINUE = 0; - public static final int NEXT = 1; - public static final int NEXTI = 2; - public static final int STEP = 3; - public static final int STEPI = 4; - public static final int FINISH = 5; - public static final int UNTIL = 6; - public static final int RETURN = 7; - - int type; - - public MIRunningEvent(int token, int t) { - super(token); - type = t; - } - - public int getType() { - return type; - } - - public String toString() { - return "Running"; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java deleted file mode 100644 index 1506547b489..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibChangedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - */ -public class MISharedLibChangedEvent extends MIChangedEvent { - - String filename; - - public MISharedLibChangedEvent(String name) { - this(0, name); - } - - public MISharedLibChangedEvent(int id, String name) { - super(id); - filename = name; - } - - public String getName() { - return filename; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java deleted file mode 100644 index d05400d23d9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibCreatedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - */ -public class MISharedLibCreatedEvent extends MICreatedEvent { - - String filename; - - public MISharedLibCreatedEvent(String name) { - this(0, name); - } - - public MISharedLibCreatedEvent(int id, String name) { - super(id); - filename = name; - } - - public String getName() { - return filename; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java deleted file mode 100644 index 114c44bfb61..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; - - - -/** - * - */ -public class MISharedLibEvent extends MIStoppedEvent { - - public MISharedLibEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MISharedLibEvent(MIResultRecord record) { - super(record); - parse(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java deleted file mode 100644 index a5bf6b5a1d9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISharedLibUnloadedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -/** - * - */ -public class MISharedLibUnloadedEvent extends MIDestroyedEvent { - - String filename; - - public MISharedLibUnloadedEvent(String name) { - this(0, name); - } - - public MISharedLibUnloadedEvent(int id, String name) { - super(id); - filename = name; - } - - public String getName() { - return filename; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java deleted file mode 100644 index f235c3c851b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalChangedEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * - */ -public class MISignalChangedEvent extends MIChangedEvent { - - String name; - - public MISignalChangedEvent(String n) { - this(0, n); - } - - public MISignalChangedEvent(int id, String n) { - super(id); - name = n; - } - - public String getName() { - return name; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java deleted file mode 100644 index fbc653b1bfd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISignalEvent.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt",thread-id="0",frame={addr="0x400e18e1",func="__libc_nanosleep",args=[],file="__libc_nanosleep",line="-1"} - * - */ -public class MISignalEvent extends MIStoppedEvent { - - String sigName = ""; - String sigMeaning = ""; - - public MISignalEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MISignalEvent(MIResultRecord record) { - super(record); - parse(); - } - - public String getName() { - return sigName; - } - - public String getMeaning() { - return sigMeaning; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("signal-name=" + sigName + "\n"); - buffer.append("signal-meaning=" + sigMeaning + "\n"); - buffer.append("thread-id=").append(getThreadId()).append('\n'); - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse () { - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("signal-name")) { - sigName = str; - } else if (var.equals("signal-meaning")) { - sigMeaning = str; - } else if (var.equals("thread-id")) { - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java deleted file mode 100644 index 3579c04f67c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MISteppingRangeEvent.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * - * *stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x08048538",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="13"} - */ -public class MISteppingRangeEvent extends MIStoppedEvent { - - public MISteppingRangeEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MISteppingRangeEvent(MIResultRecord record) { - super(record); - parse(); - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("thread-id=").append(getThreadId()).append('\n'); - MIFrame f = getFrame(); - if (f != null) { - buffer.append(getFrame().toString()); - } - return buffer.toString(); - } - - void parse () { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("thread-id")) { - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple)value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java deleted file mode 100644 index 69b0bc333dd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIStoppedEvent.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - - - -/** - * *stopped - * - */ -public class MIStoppedEvent extends MIEvent { - - private int threadId; - private MIFrame frame; - private MIExecAsyncOutput exec; - private MIResultRecord rr; - - public MIStoppedEvent(MIExecAsyncOutput record) { - super(record.getToken()); - exec = record; - parse(); - } - - public MIStoppedEvent(MIResultRecord record) { - super(record.getToken()); - rr = record; - parse(); - } - - public int getThreadId() { - return threadId; - } - - public void setThreadId(int id) { - threadId = id; - } - - public MIFrame getFrame() { - return frame; - } - - public void setFrame(MIFrame f) { - frame = f; - } - - public MIExecAsyncOutput getMIExecAsyncOutput() { - return exec; - } - - public MIResultRecord getMIResultRecord() { - return rr; - } - - void parse () { - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("thread-id")) { - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - threadId = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - frame = new MIFrame((MITuple)value); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java deleted file mode 100644 index f2cb656f067..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadCreatedEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIThreadCreatedEvent extends MICreatedEvent { - - int tid; - - public MIThreadCreatedEvent(int id) { - this(0, id); - } - - public MIThreadCreatedEvent(int token, int id) { - super(token); - tid = id; - } - - public int getId() { - return tid; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java deleted file mode 100644 index 7b4ba5ab15f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIThreadExitEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIThreadExitEvent extends MIDestroyedEvent { - - int tid; - - public MIThreadExitEvent(int id) { - this(0, id); - } - - public MIThreadExitEvent(int token, int id) { - super(token); - tid = id; - } - - public int getId() { - return tid; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java deleted file mode 100644 index 3bf730356a6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarChangedEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIVarChangedEvent extends MIChangedEvent { - - String varName; - - public MIVarChangedEvent(String var) { - this(0, var); - } - - public MIVarChangedEvent(int token, String var) { - super(token); - varName = var; - } - - public String getVarName() { - return varName; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java deleted file mode 100644 index 0a072127aaf..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarCreatedEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIVarCreatedEvent extends MICreatedEvent { - - String varName; - - public MIVarCreatedEvent(String var) { - super(0); - varName = var; - } - - public MIVarCreatedEvent(int token, String var) { - super(token); - varName = var; - } - - public String getVarName() { - return varName; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java deleted file mode 100644 index a815964062c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIVarDeletedEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - - - -/** - * This can not be detected yet by gdb/mi. - * - */ -public class MIVarDeletedEvent extends MIDestroyedEvent { - - String varName; - - public MIVarDeletedEvent(String var) { - this(0, var); - } - - public MIVarDeletedEvent(int token, String var) { - super(token); - varName = var; - } - - public String getVarName() { - return varName; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java deleted file mode 100644 index 696e7f7b290..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointScopeEvent.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="watchpoint-trigger",wpt={number="2",exp="i"},value={old="0",new="1"},thread-id="0",frame={addr="0x08048534",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="10"} - * - */ -public class MIWatchpointScopeEvent extends MIStoppedEvent { - - int number; - - public MIWatchpointScopeEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MIWatchpointScopeEvent(MIResultRecord record) { - super(record); - parse(); - } - - public int getNumber() { - return number; - } - - void parse() { - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - - MIResult[] results = null; - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("wpnum")) { - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - number = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("thread-id")) { - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple) value); - setFrame(f); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java deleted file mode 100644 index 70494e47d7f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/event/MIWatchpointTriggerEvent.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.event; - -import org.eclipse.cdt.debug.mi.core.output.MIConst; -import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput; -import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIResult; -import org.eclipse.cdt.debug.mi.core.output.MIResultRecord; -import org.eclipse.cdt.debug.mi.core.output.MITuple; -import org.eclipse.cdt.debug.mi.core.output.MIValue; - -/** - * *stopped,reason="watchpoint-trigger",wpt={number="2",exp="i"},value={old="0",new="1"},thread-id="0",frame={addr="0x08048534",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbffff18c"}],file="hello.c",line="10"} - * - */ -public class MIWatchpointTriggerEvent extends MIStoppedEvent { - - int number; - String exp = ""; - String oldValue = ""; - String newValue = ""; - - public MIWatchpointTriggerEvent(MIExecAsyncOutput async) { - super(async); - parse(); - } - - public MIWatchpointTriggerEvent(MIResultRecord record) { - super(record); - parse(); - } - - public int getNumber() { - return number; - } - - public String getExpression() { - return exp; - } - - public String getOldValue() { - return oldValue; - } - - public String getNewValue() { - return newValue; - } - - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("number=").append(number).append('\n'); - buffer.append("expression=" + exp + "\n"); - buffer.append("old=" + oldValue + "\n"); - buffer.append("new=" + newValue + "\n"); - buffer.append("thread-id=").append(getThreadId()).append('\n'); - MIFrame f = getFrame(); - if (f != null) { - buffer.append(f.toString()); - } - return buffer.toString(); - } - - void parse() { - MIResult[] results = null; - MIExecAsyncOutput exec = getMIExecAsyncOutput(); - MIResultRecord rr = getMIResultRecord(); - if (exec != null) { - results = exec.getMIResults(); - } else if (rr != null) { - results = rr.getMIResults(); - } - if (results != null) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("wpt") || var.equals("hw-awpt") || var.equals("hw-rwpt")) { - if (value instanceof MITuple) { - parseWPT((MITuple) value); - } - } else if (var.equals("value")) { - if (value instanceof MITuple) { - parseValue((MITuple) value); - } - } else if (var.equals("thread-id")) { - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - int id = Integer.parseInt(str.trim()); - setThreadId(id); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { - if (value instanceof MITuple) { - MIFrame f = new MIFrame((MITuple) value); - setFrame(f); - } - } - } - } - } - - void parseWPT(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("number")) { - if (value instanceof MIConst) { - String str = ((MIConst) value).getString(); - try { - number = Integer.parseInt(str); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("exp")) { - if (value instanceof MIConst) { - exp = ((MIConst) value).getString(); - } - } - } - } - - void parseValue(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst) value).getString(); - } - - if (var.equals("old")) { - oldValue = str; - } else if (var.equals("new")) { - newValue = str; - } else if (var.equals("value")) { - oldValue = newValue = str; - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIArg.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIArg.java deleted file mode 100644 index 8a525f68419..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIArg.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * Represents a set name=value. - */ -public class MIArg { - String name; - String value; - - public MIArg(String name, String value) { - this.name = name; - this.value = value; - } - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - - /** - * Parsing a MIList of the form: - * [{name="xxx",value="yyy"},{name="xxx",value="yyy"},..] - * [name="xxx",name="xxx",..] - */ - public static MIArg[] getMIArgs(MIList miList) { - List aList = new ArrayList(); - MIValue[] values = miList.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - MIArg arg = getMIArg((MITuple)values[i]); - if (arg != null) { - aList.add(arg); - } - } - } - MIResult[] results = miList.getMIResults(); - for (int i = 0; i < results.length; i++) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - aList.add(new MIArg(str, "")); - } - } - return ((MIArg[])aList.toArray(new MIArg[aList.size()])); - } - - /** - * Parsing a MITuple of the form: - * {name="xxx",value="yyy"} - */ - public static MIArg getMIArg(MITuple tuple) { - MIResult[] args = tuple.getMIResults(); - MIArg arg = null; - if (args.length == 2) { - // Name - String aName = ""; - MIValue value = args[0].getMIValue(); - if (value != null && value instanceof MIConst) { - aName = ((MIConst)value).getCString(); - } else { - aName = ""; - } - - // Value - String aValue = ""; - value = args[1].getMIValue(); - if (value != null && value instanceof MIConst) { - aValue = ((MIConst)value).getCString(); - } else { - aValue = ""; - } - - arg = new MIArg(aName, aValue); - } - return arg; - } - - public String toString() { - return name + "=" + value; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsm.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsm.java deleted file mode 100644 index 3888711d164..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsm.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * Represent a GDB Tuple MI assembly response. - */ -public class MIAsm { - long address; - String function = ""; - String opcode = ""; - String args = ""; - long offset; - - public MIAsm (MITuple tuple) { - parse(tuple); - } - - public long getAddress() { - return address; - } - - public String getFunction() { - return function; - } - - public long getOffset() { - return offset; - } - - public String getInstruction() { - return opcode + " " + args; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('{'); - buffer.append("address=\"" + Long.toHexString(address) +"\""); - buffer.append(",func-name=\"" + function + "\""); - buffer.append(",offset=\"").append(offset).append('"'); - buffer.append(",inst=\"" + getInstruction() + "\""); - buffer.append('}'); - return buffer.toString(); - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("address")) { - try { - address = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("func-name")) { - function = str; - } else if (var.equals("offset")) { - try { - offset = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("inst")) { - /* for the instruction, we do not want the C string but the - translated string since the only thing we are doing is - displaying it. */ - str = ((MIConst)value).getString(); - - char chars[] = str.toCharArray(); - int index = 0; - - // count the non-whitespace characters. - while( (index < chars.length) && (chars[index] > '\u0020')) - index++; - - opcode = str.substring( 0, index ); - - // skip any whitespace characters - while( index < chars.length && chars[index] >= '\u0000' && chars[index] <= '\u0020') - index++; - - // guard no argument - if( index < chars.length ) - args = str.substring( index ); - } - } - } - - /** - * @return String - */ - public String getArgs() { - return args; - } - - /** - * @return String - */ - public String getOpcode() { - return opcode; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java deleted file mode 100644 index 277d61bfd8b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIAsyncRecord.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * base Abstract class for the OOB stream MI responses. - */ -public abstract class MIAsyncRecord extends MIOOBRecord { - - final static MIResult[] nullResults = new MIResult[0]; - - MIResult[] results = null; - String asynClass = ""; - int token = 0; - - public int getToken() { - return token; - } - - public void setToken(int t) { - token = t; - } - - public String getAsyncClass() { - return asynClass; - } - - public void setAsyncClass(String a) { - asynClass = a; - } - - public MIResult[] getMIResults() { - if (results == null) { - return nullResults; - } - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - if (token != 0) { - buffer.append(token); - } - if (this instanceof MIExecAsyncOutput) { - buffer.append('*'); - } else if (this instanceof MIStatusAsyncOutput) { - buffer.append('+'); - } else if (this instanceof MINotifyAsyncOutput) { - buffer.append('='); - } - buffer.append(asynClass); - if (results != null) { - for (int i = 0; i < results.length; i++) { - buffer.append(','); - buffer.append(results.toString()); - } - } - buffer.append('\n'); - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java deleted file mode 100644 index d52d9444974..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakInsertInfo.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * -break-insert main - * ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048468",func="main",file="hello.c",line="4",times="0"} - * -break-insert -a p - * ^done,hw-awpt={number="2",exp="p"} - * -break-watch -r p - * ^done,hw-rwpt={number="4",exp="p"} - * -break-watch p - * ^done,wpt={number="6",exp="p"} - */ -public class MIBreakInsertInfo extends MIInfo { - - MIBreakpoint[] breakpoints; - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue val = results[i].getMIValue(); - MIBreakpoint bpt = null; - if (var.equals("wpt")) { - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setEnabled(true); - bpt.setWriteWatchpoint(true); - } - } else if (var.equals("bkpt")) { - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setEnabled(true); - } - } else if (var.equals("hw-awpt")) { - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setAccessWatchpoint(true); - bpt.setEnabled(true); - } - } else if (var.equals("hw-rwpt")) { - if (val instanceof MITuple) { - bpt = new MIBreakpoint((MITuple)val); - bpt.setReadWatchpoint(true); - bpt.setEnabled(true); - } - } - if (bpt != null) { - aList.add(bpt); - } - } - } - } - breakpoints = (MIBreakpoint[])aList.toArray(new MIBreakpoint[aList.size()]); - } - - public MIBreakInsertInfo(MIOutput record) { - super(record); - } - - public MIBreakpoint[] getMIBreakpoints() { - if (breakpoints == null) { - parse(); - } - return breakpoints; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java deleted file mode 100644 index 76075dd3c9c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakListInfo.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * A -break-list result-record is the form: - *
            - * ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[..],body=[brkpt={},brkpt={}]}
            - *-break-list
            -^done,BreakpointTable={nr_rows="6",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"},bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",cond="1",times="0"},bkpt={number="4",type="hw breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"},bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",thread="0",thread="0",times="0"},bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",thread="1",thread="1",times="0"}]}
            - * 
            - */ -public class MIBreakListInfo extends MIInfo { - - MIBreakpoint[] breakpoints; - - public MIBreakListInfo(MIOutput rr) { - super(rr); - } - - public MIBreakpoint[] getMIBreakpoints() { - if (breakpoints == null) { - parse(); - } - return breakpoints; - } - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("BreakpointTable")) { - parseTable(results[i].getMIValue(), aList); - } - } - } - } - breakpoints = (MIBreakpoint[])aList.toArray(new MIBreakpoint[aList.size()]); - } - - void parseTable(MIValue val, List aList) { - if (val instanceof MITuple) { - MIResult[] table = ((MITuple)val).getMIResults(); - for (int j = 0; j < table.length; j++) { - String variable = table[j].getVariable(); - if (variable.equals("body")) { - parseBody(table[j].getMIValue(), aList); - } - } - } - } - - void parseBody(MIValue body, List aList) { - if (body instanceof MIList) { - MIResult[] bkpts = ((MIList)body).getMIResults(); - for (int i = 0; i < bkpts.length; i++) { - String b = bkpts[i].getVariable(); - if (b.equals("bkpt")) { - MIValue value = bkpts[i].getMIValue(); - if (value instanceof MITuple) { - aList.add(new MIBreakpoint((MITuple)value)); - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java deleted file mode 100644 index fe627293e66..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakWatchInfo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * -break-watch buf - * ^done,wpt={number="2",exp="buf"} - */ -public class MIBreakWatchInfo extends MIBreakInsertInfo { - - public MIBreakWatchInfo(MIOutput rr) { - super(rr); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java deleted file mode 100644 index 3da45ea10c6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * Contain info about the GDB/MI breakpoint info. - *
              - *
            • - * -break-insert main - * ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"} - * (gdb) - *
            • - *
            • - * -break-insert -t main - * ^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"} - *
            • - *
            • - * -break-insert -c 1 main -^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",cond="1",times="0"} - *
            • - *
            • - * -break-insert -h main - * ^done,bkpt={number="4",type="hw breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",times="0"} - *
            • - * -break-insert -p 0 main - * ^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x0804846b",func="main",file="hello.c",line="4",thread="0",thread="0",times="0"} - *
            • - *
            • - * -break-insert -a p - * ^done,hw-awpt={number="2",exp="p"} - *
            • - *
            • - * -break-watch -r p - * ^done,hw-rwpt={number="4",exp="p"} - *
            • - *
            • - * -break-watch p - * ^done,wpt={number="6",exp="p"} - *
            • - *
            - */ -public class MIBreakpoint { - - int number; - String type = ""; - String disp = ""; - boolean enabled; - long address; - String func = ""; - String file = ""; - int line; - String cond = ""; - int times; - String what = ""; - String threadId = ""; - int ignore; - - boolean isWpt; - boolean isAWpt; - boolean isRWpt; - boolean isWWpt; - boolean isHdw; - - public MIBreakpoint(MITuple tuple) { - parse(tuple); - } - - public int getNumber() { - return number; - } - - public void setNumber(int num) { - number = num; - } - - public String getType() { - return type; - } - - public boolean isTemporary() { - return getDisposition().equals("del"); - } - - public boolean isWatchpoint() { - return isWpt; - } - - public void setWatchpoint(boolean w) { - isWpt = w; - } - - public boolean isHardware() { - return isHdw; - } - - public void setHardware(boolean hd) { - isWpt = hd; - isHdw = hd; - } - - public boolean isAccessWatchpoint() { - return isAWpt; - } - - public void setAccessWatchpoint(boolean a) { - isWpt = a; - isAWpt = a; - } - - public boolean isReadWatchpoint() { - return isRWpt; - } - - public void setReadWatchpoint(boolean r) { - isWpt = r; - isRWpt = r; - } - - public boolean isWriteWatchpoint() { - return isWWpt; - } - - public void setWriteWatchpoint(boolean w) { - isWpt = w; - isWWpt = w; - } - - public String getDisposition() { - return disp; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean e) { - enabled = e; - } - - public long getAddress() { - return address; - } - - public String getFunction() { - return func; - } - - public String getFile() { - return file; - } - - public int getLine() { - return line; - } - - public int getTimes() { - return times; - } - - public String getWhat() { - return what; - } - - public int getIgnoreCount() { - return ignore; - } - - public String getCondition() { - return cond; - } - - public String getThreadId() { - return threadId; - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("number")) { - try { - number = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("type")) { - type = str; - //type="hw watchpoint" - if (type.startsWith("hw")) { - isHdw = true; - isWWpt = true; - isWpt = true; - } - //type="acc watchpoint" - if (type.startsWith("acc")) { - isWWpt = true; - isRWpt = true; - isWpt = true; - } - //type="read watchpoint" - if (type.startsWith("read")) { - isRWpt = true; - isWpt = true; - } - // ?? - if (type.equals("watchpoint")) { - isWpt = true; - } - // type="breakpoint" - // default ok. - } else if (var.equals("disp")) { - disp = str; - } else if (var.equals("enabled")) { - enabled = str.equals("y"); - } else if (var.equals("addr")) { - try { - address = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("func")) { - func = str; - } else if (var.equals("file")) { - file = str; - } else if (var.equals("thread")) { - threadId = str; - } else if (var.equals("line")) { - try { - line = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("times")) { - try { - times = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("what") || var.equals("exp")) { - what = str; - } else if (var.equals("ignore")) { - try { - ignore = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("cond")) { - cond = str; - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java deleted file mode 100644 index 8f6896fb032..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConsoleStreamOutput.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIStreamRecord - */ -public class MIConsoleStreamOutput extends MIStreamRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java deleted file mode 100644 index bd167348c9c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIConst.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI const value represents a ios-c string. - */ -public class MIConst extends MIValue { - String cstring = ""; - - public String getCString() { - return cstring; - } - - public void setCString(String str) { - cstring = str; - } - - /** - * Translate gdb c-string. - */ - public String getString() { - return getString(cstring); - } - - public static String getString(String str) { - StringBuffer buffer = new StringBuffer(); - boolean escape = false; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '\\') { - if (escape) { - buffer.append(c); - escape = false; - } else { - escape = true; - } - } else { - if (escape) { - buffer.append(isoC(c)); - } else { - buffer.append(c); - } - escape = false; - } - } - - // If escape is still true it means that the - // last char was an '\'. - if (escape) { - buffer.append('\\'); - } - - return buffer.toString(); - } - - public String toString() { - return getCString(); - } - - /** - * Assuming that the precedent character was the - * escape sequence '\' - */ - private static String isoC(char c) { - String s = new Character(c).toString(); - if (c == '"') { - s = "\""; - } else if (c == '\'') { - s = "\'"; - } else if (c == '?') { - s = "?"; - } else if (c == 'a') { - s = "\007"; - } else if (c == 'b') { - s = "\b"; - } else if (c == 'f') { - s = "\f"; - } else if (c == 'n') { - s = System.getProperty("line.separator", "\n"); - } else if (c == 'r') { - s = "\r"; - } else if (c == 't') { - s = "\t"; - } else if (c == 'v') { - s = "\013"; - } - return s; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java deleted file mode 100644 index a3a41dbfa3f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataDisassembleInfo.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI disassemble parsing response. - */ -public class MIDataDisassembleInfo extends MIInfo { - - MISrcAsm[] src_asm; - MIAsm[] asm; - boolean mixed; - - public MIDataDisassembleInfo(MIOutput rr) { - super(rr); - mixed = false; - parse(); - } - - public MIAsm[] getMIAsms() { - return asm; - } - - public boolean isMixed() { - return mixed; - } - - public MISrcAsm[] getMISrcAsms() { - return src_asm; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("asm_insns=["); - - if (isMixed()) { - MISrcAsm[] array = getMISrcAsms(); - for (int i = 0; i < array.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(array[i].toString()); - } - } else { - MIAsm[] array = getMIAsms(); - for (int i = 0; i < array.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(array[i].toString()); - } - } - buffer.append("]"); - return buffer.toString(); - } - - void parse() { - List asmList = new ArrayList(); - List srcList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("asm_insns")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - parse((MIList)value, srcList, asmList); - } - } - } - } - } - src_asm = (MISrcAsm[])srcList.toArray(new MISrcAsm[srcList.size()]); - asm = (MIAsm[])asmList.toArray(new MIAsm[asmList.size()]); - } - - void parse(MIList list, List srcList, List asmList) { - // src and assenbly is different - - // Mixed mode. - MIResult[] results = list.getMIResults(); - if (results != null && results.length > 0) { - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("src_and_asm_line")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - srcList.add(new MISrcAsm((MITuple)value)); - } - } - } - mixed = true; - } - - // Non Mixed with source - MIValue[] values = list.getMIValues(); - if (values != null && values.length > 0) { - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - asmList.add(new MIAsm((MITuple)values[i])); - } - } - mixed = false; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java deleted file mode 100644 index ecb262a1c6c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataEvaluateExpressionInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI Data evalue expression parsing response. - */ -public class MIDataEvaluateExpressionInfo extends MIInfo{ - - String expr; - - public MIDataEvaluateExpressionInfo(MIOutput rr) { - super(rr); - } - - public String getExpression() { - if (expr == null) { - parse(); - } - return expr; - } - - void parse() { - expr = ""; - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("value")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - expr = ((MIConst)value).getCString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java deleted file mode 100644 index 17273d02e2b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListChangedRegistersInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI data list changed registers response parsing. - */ -public class MIDataListChangedRegistersInfo extends MIInfo { - - int[] registers; - - public MIDataListChangedRegistersInfo(MIOutput rr) { - super(rr); - } - - public int[] getRegisterNumbers() { - if (registers == null) { - parse(); - } - return registers; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("changed-registers")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - parseRegisters((MIList)value, aList); - } - } - } - } - } - registers = new int[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - String str = (String)aList.get(i); - try { - registers[i] = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - - void parseRegisters(MIList list, List aList) { - MIValue[] values = list.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MIConst) { - String str = ((MIConst)values[i]).getCString(); - if (str != null && str.length() > 0) { - aList.add(str); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java deleted file mode 100644 index 41a28915933..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterNamesInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI data list regiter names response extraction. - */ -public class MIDataListRegisterNamesInfo extends MIInfo { - - String[] names; - protected int realNameCount = 0; - - public MIDataListRegisterNamesInfo(MIOutput rr) { - super(rr); - } - - /** - * @return the list of register names. This list can include 0 length - * strings in the case where the underlying GDB has a sparse set of - * registers. They are returned as 0 length strings - */ - public String[] getRegisterNames() { - if (names == null) { - parse(); - } - return names; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("register-names")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - parseRegisters((MIList) value, aList); - } - } - } - } - } - names = (String[]) aList.toArray(new String[aList.size()]); - } - - void parseRegisters(MIList list, List aList) { - MIValue[] values = list.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MIConst) { - String str = ((MIConst) values[i]).getCString(); - - /* this cannot filter nulls because index is critical in retreival - * and index is assigned in the layers above. The MI spec allows - * empty returns, for some register names. */ - if (str != null && str.length() > 0) { - realNameCount++; - aList.add(str); - } else { - aList.add(""); - } - } - } - } - - /** - * @return the number of non-null and non-empty names in the - * register list - */ - public int getNumRealNames() { - if (names == null) - parse(); - return realNameCount; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java deleted file mode 100644 index 08474b5c62b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataListRegisterValuesInfo.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI data list register values extraction. - */ -public class MIDataListRegisterValuesInfo extends MIInfo { - - MIRegisterValue[] registers; - - public MIDataListRegisterValuesInfo(MIOutput rr) { - super(rr); - } - - public MIRegisterValue[] getMIRegisterValues() { - if (registers == null) { - parse(); - } - return registers; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("register-values")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - registers = MIRegisterValue.getMIRegisterValues((MIList)value); - } - } - } - } - } - if (registers == null) { - registers = new MIRegisterValue[0]; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java deleted file mode 100644 index 13a75acb199..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - - - -/** - * GDB/MI data read memor info extraction. - */ -public class MIDataReadMemoryInfo extends MIInfo { - - long addr; - long nextRow; - long prevRow; - long nextPage; - long prevPage; - long numBytes; - long totalBytes; - MIMemory[] memories; - - - public MIDataReadMemoryInfo(MIOutput rr) { - super(rr); - parse(); - } - - public long getAddress() { - return addr; - } - - public long getNumberBytes() { - return numBytes; - } - - public long getTotalBytes() { - return totalBytes; - } - - public long getNextRow() { - return nextRow; - } - - public long getPreviousRow() { - return prevRow; - } - - public long getNextPage() { - return nextPage; - } - - public long getPreviousPage() { - return prevPage; - } - - public MIMemory[] getMemories() { - return memories; - } -/* - public String toString() { - MIMemory[] mem = getMemories(); - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < mem.length; i++) { - buffer.append(Long.toHexString(mem[i].getAddress())); - buffer.append(":"); - long[] data = mem[i].getData(); - for (int j = 0; j < data.length; j++) { - buffer.append(" ").append(Long.toHexString(data[j])); - } - buffer.append("\t").append(mem[i].getAscii()); - } - return buffer.toString(); - } -*/ - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("addr")) { - try { - addr = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("nr-bytes")) { - try { - numBytes = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("total-bytes")) { - try { - totalBytes = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("next-row")) { - try { - nextRow = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("prev-row")) { - try { - prevRow = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("next-page")) { - try { - nextPage = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("prev-page")) { - try { - prevPage = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("memory")) { - if (value instanceof MIList) { - parseMemory((MIList)value); - } - } - } - } - } - if (memories == null) { - memories = new MIMemory[0]; - } - } - - void parseMemory(MIList list) { - MIValue[] values = list.getMIValues(); - memories = new MIMemory[values.length]; - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - memories[i] = new MIMemory((MITuple)values[i]); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java deleted file mode 100644 index 80628881ec3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIEnvironmentPWDInfo.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - - - - -/** - * GDB/MI environment PWD info extraction. - */ -public class MIEnvironmentPWDInfo extends MIInfo { - - String pwd = ""; - - public MIEnvironmentPWDInfo(MIOutput o) { - super(o); - parse(); - } - - public String getWorkingDirectory() { - return pwd; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord)oobs[i]; - String str = cons.getString(); - if (str.startsWith("Working directory")) { - int len = "Working directory".length(); - str = str.substring(len).trim(); - len = str.indexOf('.'); - if (len != -1) { - str = str.substring(0, len); - } - pwd = str; - } - } - } - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java deleted file mode 100644 index e08c6454780..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIExecAsyncOutput.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIAsyncRecord - */ -public class MIExecAsyncOutput extends MIAsyncRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java deleted file mode 100644 index e58ca2a9c19..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIFrame.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI Frame tuple parsing. - */ -public class MIFrame { - - int level; - long addr; - String func = ""; - String file = ""; - int line; - MIArg[] args = new MIArg[0]; - - public MIFrame(MITuple tuple) { - parse(tuple); - } - - public MIArg[] getArgs() { - return args; - } - - public String getFile() { - return file; - } - - public String getFunction() { - return func; - } - - public int getLine() { - return line; - } - - public long getAddress() { - return addr; - } - - public int getLevel() { - return level; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("level=\"" + level + "\""); - buffer.append(",addr=\"" + Long.toHexString(addr) + "\""); - buffer.append(",func=\"" + func + "\""); - buffer.append(",file=\"" + file + "\""); - buffer.append(",line=\"").append(line).append('"'); - buffer.append(",args=["); - for (int i = 0; i < args.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append("{name=\"" + args[i].getName() + "\""); - buffer.append(",value=\"" + args[i].getValue() + "\"}"); - } - buffer.append(']'); - return buffer.toString(); - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("level")) { - try { - level = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("addr")) { - try { - addr = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("func")) { - func = null; - if ( str != null ) { - str = str.trim(); - if ( str.equals( "??" ) ) - func = ""; - else - { - // In some situations gdb returns the function names that include parameter types. - // To make the presentation consistent truncate the parameters. PR 46592 - int end = str.indexOf( '(' ); - if ( end != -1 ) - func = str.substring( 0, end ); - else - func = str; - } - } - } else if (var.equals("file")) { - file = str; - } else if (var.equals("line")) { - try { - line = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("args")) { - if (value instanceof MIList) { - args = MIArg.getMIArgs((MIList)value); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java deleted file mode 100644 index b8755345ac1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowDirectoriesInfo.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.StringTokenizer; - - -/** - * GDB/MI show parsing. - * (gdb) - * -gdb-show directories - * ~"Source directories searched: /tmp:$cdir:$cwd\n" - * ^done - */ -public class MIGDBShowDirectoriesInfo extends MIInfo { - - String[] dirs = new String[0]; - - public MIGDBShowDirectoriesInfo(MIOutput o) { - super(o); - parse(); - } - - public String[] getDirectories() { - return dirs; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord)oobs[i]; - String str = cons.getString(); - if (str.startsWith("Source directories searched:")) { - int j = str.indexOf(':'); - if (j != -1) { - String sub = str.substring(j + 1).trim(); - parseDirectories(sub); - } - } - } - } - } - } - - void parseDirectories(String d) { - String sep = System.getProperty("path.separator", ":"); - StringTokenizer st = new StringTokenizer(d, sep); - int count = st.countTokens(); - dirs = new String[count]; - for (int i = 0; st.hasMoreTokens() && i < count; i++) { - dirs[i] = st.nextToken(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java deleted file mode 100644 index b919d0e7155..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowExitCodeInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - - - -/** - * GDB/MI show parsing. - * (gdb) - * -data-evaluate-expression $_exitcode - * ^done,value="10" - * (gdb) - */ -public class MIGDBShowExitCodeInfo extends MIDataEvaluateExpressionInfo { - - public MIGDBShowExitCodeInfo(MIOutput o) { - super(o); - } - - public int getCode() { - int code = 0; - String exp = getExpression(); - try { - code = Integer.parseInt(exp); - } catch (NumberFormatException e) { - } - return code; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java deleted file mode 100644 index 39edb38d929..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowInfo.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - - - -/** - * GDB/MI show parsing. - */ -public class MIGDBShowInfo extends MIInfo { - - String value = ""; - - public MIGDBShowInfo(MIOutput o) { - super(o); - parse(); - } - - public String getValue() { - return value; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("value")) { - MIValue val = results[i].getMIValue(); - if (val instanceof MIConst) { - value = ((MIConst)val).getString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java deleted file mode 100644 index 41282c0892e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIGDBShowSolibSearchPathInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.StringTokenizer; - - -/** - * GDB/MI show parsing. - * -gdb-show solib-search-path - * ^done,value="" - * (gdb) - * -gdb-set solib-search-path /tmp:/lib - * ^done - * (gdb) - * -gdb-show solib-search-path - * ^done,value="/tmp:/lib" - */ -public class MIGDBShowSolibSearchPathInfo extends MIGDBShowInfo { - - String[] dirs = null; - - public MIGDBShowSolibSearchPathInfo(MIOutput o) { - super(o); - } - - public String[] getDirectories() { - if (dirs == null) { - String val = getValue(); - parseDirectories(val); - } - return dirs; - } - - void parseDirectories(String d) { - String sep = System.getProperty("path.separator", ":"); - StringTokenizer st = new StringTokenizer(d, sep); - int count = st.countTokens(); - dirs = new String[count]; - for (int i = 0; st.hasMoreTokens() && i < count; i++) { - dirs[i] = st.nextToken(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfo.java deleted file mode 100644 index eb275e63048..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfo.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * Base class for teh parsing/info GDB/MI classes. - */ -public class MIInfo { - - MIOutput miOutput; - - public MIInfo(MIOutput record) { - miOutput = record; - } - - public MIOutput getMIOutput () { - return miOutput; - } - - public boolean isDone() { - return isResultClass(MIResultRecord.DONE); - } - - public boolean isRunning() { - return isResultClass(MIResultRecord.RUNNING); - } - - public boolean isConnected() { - return isResultClass(MIResultRecord.CONNECTED); - } - - public boolean isError() { - return isResultClass(MIResultRecord.ERROR); - } - - public boolean isExit() { - return isResultClass(MIResultRecord.EXIT); - } - - public String toString() { - if (miOutput != null) { - return miOutput.toString(); - } - return ""; - } - - boolean isResultClass(String rc) { - if (miOutput != null) { - MIResultRecord rr = miOutput.getMIResultRecord(); - if (rr != null) { - String clazz = rr.getResultClass(); - return clazz.equals(rc); - } - } - return false; - } - - public String getErrorMsg() { - if (miOutput != null) { - MIResultRecord rr = miOutput.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("msg")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String s = ((MIConst)value).getCString(); - return s; - } - } - } - } - } - return ""; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoProgramInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoProgramInfo.java deleted file mode 100644 index 6eb250fbeaa..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoProgramInfo.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.StringTokenizer; - - -/** - * GDB/MI info program parsing. -(gdb) -info program -&"info program\n" -~"\tUsing the running image of child process 21301.\n" -~"Program stopped at 0x804853f.\n" -~"It stopped at breakpoint 1.\n" -~"Type \"info stack\" or \"info registers\" for more information.\n" -^done -(gdb) - - */ -public class MIInfoProgramInfo extends MIInfo { - - int pid; - - public MIInfoProgramInfo(MIOutput out) { - super(out); - parse(); - } - - public int getPID() { - return pid; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the signal info - parseLine(str); - } - } - } - } - - void parseLine(String str) { - if (str != null && str.length() > 0) { - str = str.replace('.', ' '); - str = str.trim(); - if (str.startsWith("Using")) { - StringTokenizer st = new StringTokenizer(str); - while (st.hasMoreTokens()) { - String s = st.nextToken(); - if (Character.isDigit(s.charAt(0))) { - try { - pid = Integer.decode(s).intValue(); - break; - } catch (NumberFormatException e) { - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java deleted file mode 100644 index 8d64c7ce669..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI thread list parsing. -&"info shared\n" -~"From To Syms Read Shared Object Library\n" -~"0x40042fa0 0x4013ba9b Yes /lib/i686/libc.so.6\n" -~"0x40001db0 0x4001321c Yes /lib/ld-linux.so.2\n" - - */ -public class MIInfoSharedLibraryInfo extends MIInfo { - - MIShared[] shared; - boolean isUnixFormat = true; - boolean hasProcessHeader = false; - - public MIInfoSharedLibraryInfo(MIOutput out) { - super(out); - parse(); - } - - public MIShared[] getMIShared() { - return shared; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the shared info - parseShared(str.trim(), aList); - } - } - } - shared = new MIShared[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - shared[i] = (MIShared) aList.get(i); - } - } - - void parseShared(String str, List aList) { - if (!hasProcessHeader) { - // Process the header and choose a type. - if (str.startsWith("DLL")) { - isUnixFormat = false; - } - hasProcessHeader = true; - } else if (isUnixFormat) { - parseUnixShared(str, aList); - } else { - parseWinShared(str, aList); - } - } - - /** - * We do the parsing backward because on some Un*x system, the To or the From - * and even the "Sym Read" can be empty.... - * @param str - * @param aList - */ - void parseUnixShared(String str, List aList) { - if (str.length() > 0) { - // Pass the header - int index = -1; - long from = 0; - long to = 0; - boolean syms = false; - String name = ""; - - for (int i = 0;(index = str.lastIndexOf(' ')) != -1 || i <= 3; i++) { - if (index == -1) { - index = 0; - } - String sub = str.substring(index).trim(); - // move to previous column - str = str.substring(0, index).trim(); - switch (i) { - case 0 : - name = sub; - break; - case 1 : - if (sub.equalsIgnoreCase("Yes")) { - syms = true; - } - break; - case 2 : // second column is "To" - try { - to = Long.decode(sub).longValue(); - } catch (NumberFormatException e) { - } - break; - case 3 : // first column is "From" - try { - from = Long.decode(sub).longValue(); - } catch (NumberFormatException e) { - } - break; - } - } - if (name.length() > 0) { - MIShared s = new MIShared(from, to, syms, name); - aList.add(s); - } - } - } - - void parseWinShared(String str, List aList) { - long from = 0; - long to = 0; - boolean syms = true; - - int index = str.lastIndexOf(' '); - if (index > 0) { - String sub = str.substring(index).trim(); - // Go figure they do not print the "0x" to indicate hexadecimal!! - if (!sub.startsWith("0x")) { - sub = "0x" + sub; - } - try { - from = Long.decode(sub).longValue(); - } catch (NumberFormatException e) { - } - str = str.substring(0, index).trim(); - } - MIShared s = new MIShared(from, to, syms, str.trim()); - aList.add(s); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java deleted file mode 100644 index f0d0c6ba357..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoSignalsInfo.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** - * GDB/MI signal table parsing. - info signals - &"info signals\n" - ~"Signal Stop\tPrint\tPass to program\tDescription\n" - ~"\n" - ~"SIGHUP Yes\tYes\tYes\t\tHangup\n" - ~"SIGINT Yes\tYes\tNo\t\tInterrupt\n" - ~"SIGQUIT Yes\tYes\tYes\t\tQuit\n" - ~"SIGILL Yes\tYes\tYes\t\tIllegal instruction\n" - ~"SIGTRAP Yes\tYes\tNo\t\tTrace/breakpoint trap\n" - ~"SIGABRT Yes\tYes\tYes\t\tAborted\n" - ~"SIGEMT Yes\tYes\tYes\t\tEmulation trap\n" - */ -public class MIInfoSignalsInfo extends MIInfo { - - MISigHandle[] signals; - - public MIInfoSignalsInfo(MIOutput out) { - super(out); - parse(); - } - - public MISigHandle[] getMISignals() { - return signals; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the signal info - parseSignal(str.trim(), aList); - } - } - } - signals = new MISigHandle[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - signals[i] = (MISigHandle)aList.get(i); - } - } - - void parseSignal(String str, List aList) { - if (str.length() > 0) { - // Pass the header and th tailer. - // ~"Signal Stop\tPrint\tPass to program\tDescription\n" - // ~"Use the \"handle\" command to change these tables.\n" - if (!str.startsWith("Signal ") && !str.startsWith("Use ")) { - String signal = ""; - boolean stop = false; - boolean print = false; - boolean pass = false; - String desc = ""; - - StringTokenizer tokenizer = new StringTokenizer(str); - for (int i = 0; tokenizer.hasMoreTokens(); i++) { - String sub = null; - if (i == 4) { - sub = tokenizer.nextToken("\n"); - } else { - sub = tokenizer.nextToken(); - } - switch (i) { - case 0: // first column is "Signal" - signal = sub; - break; - case 1: // second column is "Stop" - stop = getBoolean(sub); - break; - case 2: // third column is "Print" - print = getBoolean(sub); - break; - case 3: // third column is "Pass to Program" - pass = getBoolean(sub); - break; - case 4: // last column is "Description" - desc = sub; - break; - } - } - MISigHandle s = new MISigHandle(signal, stop, print, pass, desc.trim()); - aList.add(s); - } - } - } - - static boolean getBoolean(String value) { - if (value != null && value.equalsIgnoreCase("Yes")) { - return true; - } - return false; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java deleted file mode 100644 index 50a4dd74535..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIInfoThreadsInfo.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI thread list parsing. -~"\n" -~" 2 Thread 2049 (LWP 29354) " -~"* 1 Thread 1024 (LWP 29353) " - - */ -public class MIInfoThreadsInfo extends MIInfo { - - int[] threadIds; - int currentThreadId; - - public MIInfoThreadsInfo(MIOutput out) { - super(out); - parse(); - } - - public int[] getThreadIds() { - return threadIds; - } - - public int getCurrentThread() { - return currentThreadId; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in finding the current thread - parseThreadInfo(str.trim(), aList); - } - } - } - threadIds = new int[aList.size()]; - for (int i = 0; i < aList.size(); i++) { - threadIds[i] = ((Integer) aList.get(i)).intValue(); - } - } - - void parseThreadInfo(String str, List aList) { - if (str.length() > 0) { - boolean isCurrentThread = false; - // Discover the current thread - if (str.charAt(0) == '*') { - isCurrentThread = true; - str = str.substring(1).trim(); - } - // Fetch the threadId - if (str.length() > 0 && Character.isDigit(str.charAt(0))) { - int i = 1; - while (i < str.length() && Character.isDigit(str.charAt(i))) { - i++; - } - String number = str.substring(0, i); - try { - Integer num = Integer.valueOf(number); - aList.add(num); - if (isCurrentThread) { - currentThreadId = num.intValue(); - } - } catch (NumberFormatException e) { - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java deleted file mode 100644 index 262100851b4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIList.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI list semantic. - */ -public class MIList extends MIValue { - - final static MIResult[] nullResults = new MIResult[0]; - final static MIValue[] nullValues = new MIValue[0]; - - MIResult[] results = nullResults; - MIValue[] values = nullValues; - - public MIResult[] getMIResults() { - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public MIValue[] getMIValues() { - return values; - } - - public void setMIValues(MIValue[] vals) { - values = vals; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('['); - for (int i = 0; i < results.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(results[i].toString()); - } - for (int i = 0; i < values.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(values[i].toString()); - } - buffer.append(']'); - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java deleted file mode 100644 index 5430058b300..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MILogStreamOutput.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIStreamRecord - */ -public class MILogStreamOutput extends MIStreamRecord { - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIMemory.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIMemory.java deleted file mode 100644 index f3b7d02150e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIMemory.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI memory parsing. - */ -public class MIMemory { - long addr; - long [] data = new long[0]; - String ascii = ""; - - public MIMemory(MITuple tuple) { - parse(tuple); - } - - public long getAddress() { - return addr; - } - - public long [] getData() { - return data; - } - - public String getAscii() { - return ascii; - } - - public String toSting() { - StringBuffer buffer = new StringBuffer(); - buffer.append("addr=\"" + Long.toHexString(addr) + "\""); - buffer.append("data=["); - for (int i = 0 ; i < data.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append('"').append(Long.toHexString(data[i])).append('"'); - } - buffer.append(']'); - if (ascii.length() > 0) { - buffer.append(",ascii=\"" + ascii + "\""); - } - return buffer.toString(); - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("addr")) { - try { - addr = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - } - } else if (var.equals("data")) { - if (value != null && value instanceof MIList) { - parseData((MIList)value); - } - } else if (var.equals("ascii")) { - ascii = str; - } - } - } - - void parseData(MIList list) { - MIValue[] values = list.getMIValues(); - data = new long[values.length]; - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MIConst) { - String str = ((MIConst)values[i]).getCString(); - try { - data[i] = Long.decode(str.trim()).longValue(); - } catch (NumberFormatException e) { - data[i] = 0; - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java deleted file mode 100644 index f050da04ae7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MINotifyAsyncOutput.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIAsyncRecord - */ -public class MINotifyAsyncOutput extends MIAsyncRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java deleted file mode 100644 index f6b4cba9160..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOOBRecord.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIOOBRecord - */ -public abstract class MIOOBRecord { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java deleted file mode 100644 index ff55dfe1265..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIOutput.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI response. - */ -public class MIOutput { - - public static final String terminator = "(gdb)"; - public static final MIOOBRecord[] nullOOBRecord = new MIOOBRecord[0]; - MIResultRecord rr = null; - MIOOBRecord[] oobs = nullOOBRecord; - - - public MIResultRecord getMIResultRecord() { - return rr; - } - - public void setMIResultRecord(MIResultRecord res) { - rr = res ; - } - - public MIOOBRecord[] getMIOOBRecords() { - return oobs; - } - - public void setMIOOBRecords(MIOOBRecord [] bands) { - oobs = bands; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < oobs.length; i++) { - buffer.append(oobs[i].toString()); - } - if (rr != null) { - buffer.append(rr.toString()); - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIPTypeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIPTypeInfo.java deleted file mode 100644 index a21d91c68e3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIPTypeInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI whatis parsing. - */ -public class MIPTypeInfo extends MIInfo { - - String type; - - public MIPTypeInfo(MIOutput out) { - super(out); - parse(); - } - - public String getType() { - return type; - } - - void parse() { - StringBuffer buffer = new StringBuffer(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the shared info - if (str != null) { - str = str.trim(); - if (str.startsWith ("type")) { - int equal = str.indexOf('='); - if (equal > 0) { - str = str.substring(equal + 1); - } - } - buffer.append(str); - } - } - } - } - type = buffer.toString().trim(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java deleted file mode 100644 index d62bddd550e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java +++ /dev/null @@ -1,514 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** -
            -`OUTPUT :'
            -     `( OUT-OF-BAND-RECORD )* [ RESULT-RECORD ] "(gdb)" NL'
            -
            -`RESULT-RECORD :'
            -     ` [ TOKEN ] "^" RESULT-CLASS ( "," RESULT )* NL'
            -
            -`OUT-OF-BAND-RECORD :'
            -     `ASYNC-RECORD | STREAM-RECORD'
            -
            -`ASYNC-RECORD :'
            -     `EXEC-ASYNC-OUTPUT | STATUS-ASYNC-OUTPUT | NOTIFY-ASYNC-OUTPUT'
            -
            -`EXEC-ASYNC-OUTPUT :'
            -     `[ TOKEN ] "*" ASYNC-OUTPUT'
            -
            -`STATUS-ASYNC-OUTPUT :'
            -     `[ TOKEN ] "+" ASYNC-OUTPUT'
            -
            -`NOTIFY-ASYNC-OUTPUT :'
            -     `[ TOKEN ] "=" ASYNC-OUTPUT'
            -
            -`ASYNC-OUTPUT :'
            -     `ASYNC-CLASS ( "," RESULT )* NL'
            -
            -`RESULT-CLASS :'
            -     `"done" | "running" | "connected" | "error" | "exit"'
            -
            -`ASYNC-CLASS :'
            -     `"stopped" | OTHERS' (where OTHERS will be added depending on the
            -     needs--this is still in development).
            -
            -`RESULT :'
            -     ` VARIABLE "=" VALUE'
            -
            -`VARIABLE :'
            -     ` STRING '
            -
            -`VALUE :'
            -     ` CONST | TUPLE | LIST '
            -
            -`CONST :'
            -     `C-STRING'
            -
            -`TUPLE :'
            -     ` "{}" | "{" RESULT ( "," RESULT )* "}" '
            -
            -`LIST :'
            -     ` "[]" | "[" VALUE ( "," VALUE )* "]" | "[" RESULT ( "," RESULT )*
            -     "]" '
            -
            -`STREAM-RECORD :'
            -     `CONSOLE-STREAM-OUTPUT | TARGET-STREAM-OUTPUT | LOG-STREAM-OUTPUT'
            -
            -`CONSOLE-STREAM-OUTPUT :'
            -     `"~" C-STRING'
            -
            -`TARGET-STREAM-OUTPUT :'
            -     `"@" C-STRING'
            -
            -`LOG-STREAM-OUTPUT :'
            -     `"&" C-STRING'
            -
            -`NL :'
            -     `CR | CR-LF'
            -
            -`TOKEN :'
            -     _any sequence of digits_.
            -
            -`C-STRING :'
            -     `""" SEVEN-BIT-ISO-C-STRING-CONTENT """'
            -
            - */ -public class MIParser { - - /** - * Point of entry to create an AST for MI. - * - * @param buffer Output from MI Channel. - * @return MIOutput - * @see MIOutput - */ - public MIOutput parse(String buffer) { - MIOutput mi = new MIOutput(); - MIResultRecord rr = null; - List oobs = new ArrayList(1); - int id = -1; - - StringTokenizer st = new StringTokenizer(buffer, "\n"); - while (st.hasMoreTokens()) { - StringBuffer token = new StringBuffer(st.nextToken()); - - // Fetch the Token/Id - if (token.length() > 0 && Character.isDigit(token.charAt(0))) { - int i = 1; - while (i < token.length() && Character.isDigit(token.charAt(i))) { - i++; - } - String numbers = token.substring(0, i); - try { - id = Integer.parseInt(numbers); - } catch (NumberFormatException e) { - } - // Consume the token. - token.delete(0, i); - } - - // ResultRecord ||| Out-Of-Band Records - if (token.length() > 0) { - if (token.charAt(0) == '^') { - token.deleteCharAt(0); - rr = processMIResultRecord(token, id); - } else if (token.toString().startsWith(MIOutput.terminator)) { - //break; // Do nothing. - } else { - MIOOBRecord band = processMIOOBRecord(token, id); - if (band != null) { - oobs.add(band); - } - } - } - } - MIOOBRecord[] bands = (MIOOBRecord[]) oobs.toArray(new MIOOBRecord[oobs.size()]); - mi.setMIOOBRecords(bands); - mi.setMIResultRecord(rr); - return mi; - } - - /** - * Assuming '^' was deleted from the Result Record. - */ - private MIResultRecord processMIResultRecord(StringBuffer buffer, int id) { - MIResultRecord rr = new MIResultRecord(); - rr.setToken(id); - if (buffer.toString().startsWith(MIResultRecord.DONE)) { - rr.setResultClass(MIResultRecord.DONE); - buffer.delete(0, MIResultRecord.DONE.length()); - } else if (buffer.toString().startsWith(MIResultRecord.ERROR)) { - rr.setResultClass(MIResultRecord.ERROR); - buffer.delete(0, MIResultRecord.ERROR.length()); - } else if (buffer.toString().startsWith(MIResultRecord.EXIT)) { - rr.setResultClass(MIResultRecord.EXIT); - buffer.delete(0, MIResultRecord.EXIT.length()); - } else if (buffer.toString().startsWith(MIResultRecord.RUNNING)) { - rr.setResultClass(MIResultRecord.RUNNING); - buffer.delete(0, MIResultRecord.RUNNING.length()); - } else if (buffer.toString().startsWith(MIResultRecord.CONNECTED)) { - rr.setResultClass(MIResultRecord.CONNECTED); - buffer.delete(0, MIResultRecord.CONNECTED.length()); - } else { - // FIXME: - // Error throw an exception? - } - - // Results are separated by commas. - if (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - MIResult[] res = processMIResults(new FSB(buffer)); - rr.setMIResults(res); - } - return rr; - } - - /** - * Find OutOfBand Records depending on the starting token. - */ - private MIOOBRecord processMIOOBRecord(StringBuffer buffer, int id) { - MIOOBRecord oob = null; - char c = buffer.charAt(0); - if (c == '*' || c == '+' || c == '=') { - // Consume the first char - buffer.deleteCharAt(0); - MIAsyncRecord async = null; - switch (c) { - case '*' : - async = new MIExecAsyncOutput(); - break; - - case '+' : - async = new MIStatusAsyncOutput(); - break; - - case '=' : - async = new MINotifyAsyncOutput(); - break; - } - async.setToken(id); - // Extract the Async-Class - int i = buffer.toString().indexOf(','); - if (i != -1) { - String asyncClass = buffer.substring(0, i); - async.setAsyncClass(asyncClass); - // Consume the async-class and the comma - buffer.delete(0, i + 1); - } else { - async.setAsyncClass(buffer.toString().trim()); - buffer.setLength(0); - } - MIResult[] res = processMIResults(new FSB(buffer)); - async.setMIResults(res); - oob = async; - } else if (c == '~' || c == '@' || c == '&') { - // Consume the first char - buffer.deleteCharAt(0); - MIStreamRecord stream = null; - switch (c) { - case '~' : - stream = new MIConsoleStreamOutput(); - break; - - case '@' : - stream = new MITargetStreamOutput(); - break; - - case '&' : - stream = new MILogStreamOutput(); - break; - } - // translateCString() assumes that the leading " is deleted - if (buffer.length() > 0 && buffer.charAt(0) == '"') { - buffer.deleteCharAt(0); - } - stream.setCString(translateCString(new FSB(buffer))); - oob = stream; - } else { - // Badly format MI line, just pass it to the user as target stream - MIStreamRecord stream = new MITargetStreamOutput(); - stream.setCString(buffer.toString() + "\n"); - oob = stream; - } - return oob; - } - - /** - * Assuming that the usual leading comma was consumed. - * Extract the MI Result comma seperated responses. - */ - private MIResult[] processMIResults(FSB buffer) { - List aList = new ArrayList(); - MIResult result = processMIResult(buffer); - if (result != null) { - aList.add(result); - } - while (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - result = processMIResult(buffer); - if (result != null) { - aList.add(result); - } - } - return (MIResult[]) aList.toArray(new MIResult[aList.size()]); - } - - /** - * Construct the MIResult. Characters will be consume/delete - * moving forward constructing the AST. - */ - private MIResult processMIResult(FSB buffer) { - MIResult result = new MIResult(); - int equal; - if (buffer.length() > 0 && Character.isLetter(buffer.charAt(0)) && (equal = buffer.indexOf('=')) != -1) { - String variable = buffer.substring(0, equal); - result.setVariable(variable); - buffer.delete(0, equal + 1); - MIValue value = processMIValue(buffer); - result.setMIValue(value); - } else { - result.setVariable(buffer.toString()); - result.setMIValue(new MIConst()); // Empty string:??? - buffer.setLength(0); - } - return result; - } - - /** - * Find a MIValue implementation or return null. - */ - private MIValue processMIValue(FSB buffer) { - MIValue value = null; - if (buffer.length() > 0) { - if (buffer.charAt(0) == '{') { - buffer.deleteCharAt(0); - value = processMITuple(buffer); - } else if (buffer.charAt(0) == '[') { - buffer.deleteCharAt(0); - value = processMIList(buffer); - } else if (buffer.charAt(0) == '"') { - buffer.deleteCharAt(0); - MIConst cnst = new MIConst(); - cnst.setCString(translateCString(buffer)); - value = cnst; - } - } - return value; - } - - /** - * Assuming the starting '{' was deleted form the StringBuffer, - * go to the closing '}' consuming/deleting all the characters. - * This is usually call by processMIvalue(); - */ - private MIValue processMITuple(FSB buffer) { - MITuple tuple = new MITuple(); - MIResult[] results = null; - // Catch closing '}' - while (buffer.length() > 0 && buffer.charAt(0) != '}') { - results = processMIResults(buffer); - } - if (buffer.length() > 0 && buffer.charAt(0) == '}') { - buffer.deleteCharAt(0); - } - if (results == null) { - results = new MIResult[0]; - } - tuple.setMIResults(results); - return tuple; - } - - /** - * Assuming the leading '[' was deleted, find the closing - * ']' consuming/delete chars from the StringBuffer. - */ - private MIValue processMIList(FSB buffer) { - MIList list = new MIList(); - List valueList = new ArrayList(); - List resultList = new ArrayList(); - // catch closing ']' - while (buffer.length() > 0 && buffer.charAt(0) != ']') { - // Try for the MIValue first - MIValue value = processMIValue(buffer); - if (value != null) { - valueList.add(value); - } else { - MIResult result = processMIResult(buffer); - if (result != null) { - resultList.add(result); - } - } - if (buffer.length() > 0 && buffer.charAt(0) == ',') { - buffer.deleteCharAt(0); - } - } - if (buffer.length() > 0 && buffer.charAt(0) == ']') { - buffer.deleteCharAt(0); - } - MIValue[] values = (MIValue[]) valueList.toArray(new MIValue[valueList.size()]); - MIResult[] res = (MIResult[]) resultList.toArray(new MIResult[resultList.size()]); - list.setMIValues(values); - list.setMIResults(res); - return list; - } - - /* - * MI C-String rather MICOnst values are enclose in double quotes - * and any double quotes or backslash in the string are escaped. - * Assuming the starting double quote was removed. - * This method will stop at the closing double quote remove the extra - * backslach escaping and return the string __without__ the enclosing double quotes - * The orignal StringBuffer will move forward. - */ - private String translateCString(FSB buffer) { - boolean escape = false; - boolean closingQuotes = false; - - StringBuffer sb = new StringBuffer(); - - int index = 0; - for (; index < buffer.length() && !closingQuotes; index++) { - char c = buffer.charAt(index); - if (c == '\\') { - if (escape) { - sb.append(c); - escape = false; - } else { - escape = true; - } - } else if (c == '"') { - if (escape) { - sb.append(c); - escape = false; - } else { - // Bail out. - closingQuotes = true; - } - } else { - if (escape) { - sb.append('\\'); - } - sb.append(c); - escape = false; - } - } - buffer.delete(0, index); - return sb.toString(); - } - - /** - * Fast String Buffer class. MIParser does a lot - * of deleting off the front of a string, that's clearly - * an order N operation for StringBuffer which makes - * the MIParser an order N^2 operation. There are "issues" - * with this for large arrays. Use of FSB rather than String - * Buffer makes MIParser N rather than N^2 because FSB can - * delete from the front in constant time. - */ - public class FSB { - StringBuffer buf; - int pos; - boolean shared; - - public FSB(StringBuffer buf) { - this.buf = buf; - pos = 0; - shared = false; - } - - public FSB(FSB fbuf) { - pos = fbuf.pos; - buf = fbuf.buf; - shared = true; - } - - public int length() { - int res = buf.length() - pos; - if (res < 0) - return 0; - - return res; - } - - public char charAt(int index) { - return buf.charAt(index + pos); - } - - private void resolveCopy() { - if (shared) { - buf = new StringBuffer(buf.toString()); - shared = false; - } - } - - public FSB deleteCharAt(int index) { - if (index == 0) { - pos++; - } else { - resolveCopy(); - buf = buf.deleteCharAt(pos + index); - } - - return this; - } - - public FSB delete(int start, int end) { - if (start == 0) { - pos = pos + end - start; - } else { - resolveCopy(); - buf.delete(start + pos, end + pos); - } - - return this; - } - - public void setLength(int a) { - if (a == 0) - pos = buf.length(); - else { - // panic! fortunately we don't do this. - } - } - - public String substring(int start, int end) { - return buf.substring(start + pos, end + pos); - } - - public String toString() { - return buf.substring(pos, buf.length()); - } - - int indexOf(char c) { - int len = buf.length(); - for (int i = pos; i < len; i++) { - if (buf.charAt(i) == c) - return i - pos; - } - - return -1; - } - - boolean startsWith(String s) { - int len = Math.min(s.length(), length()); - if (len < s.length()) - return false; - - for (int i = 0; i < len; i++) { - if (s.charAt(i) != buf.charAt(pos + i)) - return false; - } - - return true; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java deleted file mode 100644 index 2ec93ae7c92..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIRegisterValue.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - - -/** - * GDB/MI register response parsing. - */ -public class MIRegisterValue { - int number; - String value; - - public MIRegisterValue(int n, String v) { - number = n; - value = v; - } - - public int getNumber() { - return number; - } - - public String getValue() { - return value; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("number=\"").append(number).append('"'); - buffer.append(',').append("value=\"" + value + "\""); - return buffer.toString(); - } - - /** - * Parsing a MIList of the form: - * [{number="1",value="0xffff"},{number="xxx",value="yyy"},..] - */ - public static MIRegisterValue[] getMIRegisterValues(MIList miList) { - List aList = new ArrayList(); - MIValue[] values = miList.getMIValues(); - for (int i = 0; i < values.length; i++) { - if (values[i] instanceof MITuple) { - MIRegisterValue reg = getMIRegisterValue((MITuple)values[i]); - if (reg != null) { - aList.add(reg); - } - } - } - return ((MIRegisterValue[])aList.toArray(new MIRegisterValue[aList.size()])); - } - - /** - * Parsing a MITuple of the form: - * {number="xxx",value="yyy"} - */ - public static MIRegisterValue getMIRegisterValue(MITuple tuple) { - MIResult[] args = tuple.getMIResults(); - MIRegisterValue arg = null; - if (args.length == 2) { - // Name - String aName = ""; - MIValue value = args[0].getMIValue(); - if (value != null && value instanceof MIConst) { - aName = ((MIConst)value).getCString(); - } else { - aName = ""; - } - - // Value - String aValue = ""; - value = args[1].getMIValue(); - if (value != null && value instanceof MIConst) { - aValue = ((MIConst)value).getCString(); - } else { - aValue = ""; - } - - try { - int reg = Integer.parseInt(aName.trim()); - arg = new MIRegisterValue(reg, aValue.trim()); - } catch (NumberFormatException e) { - } - } - return arg; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java deleted file mode 100644 index 1a9464a1ed9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResult.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI result sematic (Variable=Value) - */ -public class MIResult { - String variable = ""; - MIValue value = null; - - public String getVariable() { - return variable; - } - - public void setVariable(String var) { - variable = var; - } - - public MIValue getMIValue() { - return value; - } - - public void setMIValue(MIValue val) { - value = val; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(variable); - if (value != null) { - String v = value.toString(); - buffer.append('='); - if (v.charAt(0) == '[' || v.charAt(0) =='{') { - buffer.append(v); - } else { - buffer.append("\"" + value.toString() + "\""); - } - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java deleted file mode 100644 index a8e1369d649..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIResultRecord.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI ResultRecord. - */ -public class MIResultRecord { - - public final static String DONE ="done"; - public final static String RUNNING ="running"; - public final static String CONNECTED ="connected"; - public final static String ERROR ="error"; - public final static String EXIT ="exit"; - - static final MIResult[] nullResults = new MIResult[0]; - MIResult[] results = nullResults; - String resultClass = ""; - int token = -1; - - public int getToken() { - return token; - } - - public void setToken(int t) { - token = t; - } - - /** - */ - public String getResultClass() { - return resultClass; - } - - public void setResultClass(String type) { - resultClass = type; - } - - public MIResult[] getMIResults() { - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append(token).append('^').append(resultClass); - for (int i = 0; i < results.length; i++) { - buffer.append(',').append(results[i].toString()); - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIShared.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIShared.java deleted file mode 100644 index 554f44f257b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIShared.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI shared information - */ -public class MIShared { - - long from; - long to; - boolean isread; - String name; - - public MIShared (long start, long end, boolean read, String location) { - from = start; - to = end; - isread = read; - name = location; - } - - public long getFrom() { - return from; - } - - public long getTo() { - return to; - } - - public boolean isRead() { - return isread; - } - - public String getName() { - return name; - } - - public void setSymbolsRead(boolean read) { - isread = read; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java deleted file mode 100644 index 9f5b5f88fe8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISigHandle.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI shared information - */ -public class MISigHandle { - - String signal = ""; - boolean stop; - boolean print; - boolean pass; - String description = ""; - - public MISigHandle (String name, boolean stp, boolean prnt, boolean ps, String desc) { - signal = name; - stop = stp; - print = prnt; - pass = ps; - description = desc; - } - - public String getName() { - return signal; - } - - public boolean isStop() { - return stop; - } - - public boolean isPrint() { - return print; - } - - public boolean isPass() { - return pass; - } - - public void handle(boolean isIgnore, boolean isStop) { - pass = !isIgnore; - stop = isStop; - } - - public String getDescription() { - return description; - } - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java deleted file mode 100644 index 12921c67892..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MISrcAsm.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represent a GDB Tuple MI assembly response. - */ -public class MISrcAsm { - int line; - String file = ""; - MIAsm[] asm; - - public MISrcAsm(MITuple tuple) { - parse(tuple); - } - - public int getLine() { - return line; - } - - public String getFile() { - return file; - } - - public MIAsm[] getMIAsms() { - return asm; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("src_and_asm_line={"); - buffer.append("line=\"").append(line).append('"'); - buffer.append(",file=\"" + file + "\","); - buffer.append("line_asm_insn=["); - for (int i = 0; i < asm.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(asm[i].toString()); - } - buffer.append(']'); - buffer.append('}'); - return buffer.toString(); - } - - void parse(MITuple tuple) { - List aList = new ArrayList(); - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("line_asm_insn")) { - if (value instanceof MIList) { - MIList list = (MIList)value; - MIValue[] values = list.getMIValues(); - for (int j = 0; j < values.length; j++) { - if (values[j] instanceof MITuple) { - aList.add(new MIAsm((MITuple)values[j])); - } - } - } - } if (var.equals("line")) { - try { - line = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("file")) { - file = str; - } - } - asm = (MIAsm[])aList.toArray(new MIAsm[aList.size()]); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java deleted file mode 100644 index 872ae47a614..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackInfoDepthInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI stack info depth parsing. - */ -public class MIStackInfoDepthInfo extends MIInfo { - - int depth; - - public MIStackInfoDepthInfo(MIOutput out) { - super(out); - parse(); - } - - public int getDepth() { - return depth; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("depth")) { - MIValue val = results[i].getMIValue(); - if (val instanceof MIConst) { - String str = ((MIConst)val).getCString(); - try { - depth = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java deleted file mode 100644 index d3d54bea793..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListArgumentsInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * GDB/MI stack list arguments parsing. - */ -public class MIStackListArgumentsInfo extends MIInfo { - - MIFrame[] frames; - - public MIStackListArgumentsInfo(MIOutput out) { - super(out); - } - - public MIFrame[] getMIFrames() { - if (frames == null) { - parse(); - } - return frames; - } - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("stack-args")) { - MIValue val = results[i].getMIValue(); - if (val instanceof MIList) { - parseStack((MIList)val, aList); - } - } - } - } - } - frames = (MIFrame[])aList.toArray(new MIFrame[aList.size()]); - } - - void parseStack(MIList miList, List aList) { - MIResult[] results = miList.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java deleted file mode 100644 index ba7d910d6a0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListFramesInfo.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - - -/** - * GDB/MI stack list frames info. - */ -public class MIStackListFramesInfo extends MIInfo { - - MIFrame[] frames; - - public MIStackListFramesInfo(MIOutput out) { - super(out); - } - - public MIFrame[] getMIFrames() { - if (frames == null) { - parse(); - } - return frames; - } - - void parse() { - List aList = new ArrayList(1); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("stack")) { - MIValue val = results[i].getMIValue(); - if (val instanceof MIList) { - parseStack((MIList)val, aList); - } else if (val instanceof MITuple) { - parseStack((MITuple)val, aList); - } - } - } - } - } - frames = (MIFrame[])aList.toArray(new MIFrame[aList.size()]); - } - - void parseStack(MIList miList, List aList) { - MIResult[] results = miList.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } - - // Old gdb use tuple instead of a list. - void parseStack(MITuple tuple, List aList) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("frame")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add (new MIFrame((MITuple)value)); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java deleted file mode 100644 index a3c1309afad..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStackListLocalsInfo.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - - - -/** - * GDB/MI stack list locals parsing. - * -stack-list-locals 1 - * ^done,locals=[{name="p",value="0x8048600 \"ghislaine\""},{name="buf",value="\"'\", 'x' , \"i,xxxxxxxxx\", 'a' "},{name="buf2",value="\"\\\"?'\\\\()~\""},{name="buf3",value="\"alain\""},{name="buf4",value="\"\\t\\t\\n\\f\\r\""},{name="i",value="0"}] - */ -public class MIStackListLocalsInfo extends MIInfo { - - MIArg[] locals; - - public MIStackListLocalsInfo(MIOutput out) { - super(out); - parse(); - } - - public MIArg[] getLocals() { - if (locals == null) { - parse(); - } - return locals; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("locals")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIList) { - locals = MIArg.getMIArgs((MIList)value); - } - } - } - } - } - if (locals == null) { - locals = new MIArg[0]; - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java deleted file mode 100644 index 5bfa0d8a31c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStatusAsyncOutput.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIAsyncRecord - */ -public class MIStatusAsyncOutput extends MIAsyncRecord { - -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java deleted file mode 100644 index 7a357c54c70..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIStreamRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI stream record response. - */ -public abstract class MIStreamRecord extends MIOOBRecord { - - String cstring = ""; - - public String getCString() { - return cstring; - } - - public void setCString(String str) { - cstring = str; - } - - public String getString () { - return MIConst.getString(getCString()); - } - - public String toString() { - if (this instanceof MIConsoleStreamOutput) { - return "~\"" + cstring + "\"\n"; - } else if (this instanceof MITargetStreamOutput) { - return "@\"" + cstring + "\"\n"; - } else if (this instanceof MILogStreamOutput) { - return "&\"" + cstring + "\"\n"; - } - return "\"" + cstring + "\"\n"; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java deleted file mode 100644 index d1a5f442eb1..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITargetStreamOutput.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * @see MIStreamRecord - */ -public class MITargetStreamOutput extends MIStreamRecord { - - public static final String startTag = "@"; -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java deleted file mode 100644 index 0b2dc359a41..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadListIdsInfo.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI thread list parsing. - */ -public class MIThreadListIdsInfo extends MIInfo { - - int[] threadIds; - - public MIThreadListIdsInfo(MIOutput out) { - super(out); - } - - public int[] getThreadIds() { - if (threadIds == null) { - parse(); - } - return threadIds; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("thread-ids")) { - MIValue val = results[i].getMIValue(); - if (val instanceof MITuple) { - parseThreadIds((MITuple)val); - } - } - } - } - } - if (threadIds == null) { - threadIds = new int[0]; - } - } - - void parseThreadIds(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - threadIds = new int[results.length]; - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("thread-id")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - try { - threadIds[i] = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java deleted file mode 100644 index dc66cdef9e9..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIThreadSelectInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI thread select parsing. - */ -public class MIThreadSelectInfo extends MIInfo { - - int threadId; - MIFrame frame; - - public MIThreadSelectInfo(MIOutput out) { - super(out); - parse(); - } - - public int getNewThreadId() { - return threadId; - } - - public MIFrame getFrame() { - return frame; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("new-thread-id")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getCString(); - try { - threadId = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("frame")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - frame = new MIFrame((MITuple)value); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java deleted file mode 100644 index 6547d02b17e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MITuple.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI tuple value. - */ -public class MITuple extends MIValue { - - final static MIResult[] nullResults = new MIResult[0]; - MIResult[] results = nullResults; - - public MIResult[] getMIResults() { - return results; - } - - public void setMIResults(MIResult[] res) { - results = res; - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append('{'); - for (int i = 0; i < results.length; i++) { - if (i != 0) { - buffer.append(','); - } - buffer.append(results[i].toString()); - } - buffer.append('}'); - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java deleted file mode 100644 index a44e98f80fe..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIValue.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI value. - */ -public abstract class MIValue { -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVar.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVar.java deleted file mode 100644 index 4e8c2fcd64b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVar.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-list-children - * -var-list-children var2 - * ^done,numchild="6",children={child={name="var2.0",exp="0",numchild="0",type="char"},child={name="var2.1",exp="1",numchild="0",type="char"},child={name="var2.2",exp="2",numchild="0",type="char"},child={name="var2.3",exp="3",numchild="0",type="char"},child={name="var2.4",exp="4",numchild="0",type="char"},child={name="var2.5",exp="5",numchild="0",type="char"}} - * - */ -public class MIVar { - - String name = ""; - String type = ""; - String exp = ""; - int numchild; - - - public MIVar(String n, int num, String t) { - name = n; - numchild = num; - type = t; - } - - public MIVar(MITuple tuple) { - parse(tuple); - } - - public String getVarName() { - return name; - } - - public String getType() { - return type; - } - - public int getNumChild() { - return numchild; - } - - public String getExp() { - return exp; - } - - void parse(MITuple tuple) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value != null && value instanceof MIConst) { - str = ((MIConst)value).getCString(); - } - - if (var.equals("numchild")) { - try { - numchild = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("name")) { - name = str; - } else if (var.equals("type")) { - type = str; - } else if (var.equals("exp")) { - exp = str; - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java deleted file mode 100644 index 5018a16dac3..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarChange.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-update. - */ - -public class MIVarChange { - String name; - boolean inScope; - boolean changed; - - public MIVarChange(String n) { - name = n; - } - - public String getVarName() { - return name; - } - - public boolean isInScope() { - return inScope; - } - - public boolean isChanged() { - return changed; - } - - public void setInScope(boolean b) { - inScope = b; - } - - public void setChanged(boolean c) { - changed = c; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java deleted file mode 100644 index c86434b95cc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarCreateInfo.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-create. - * -var-create "-" * buf3 - * ^done,name="var1",numchild="6",type="char [6]" - */ -public class MIVarCreateInfo extends MIInfo { - - String name = ""; - int numChild; - String type = ""; - MIVar child; - - public MIVarCreateInfo(MIOutput record) { - super(record); - parse(); - } - - public MIVar getMIVar() { - if (child == null) { - child = new MIVar(name, numChild, type); - } - return child; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("name")) { - name = str; - } else if (var.equals("numchild")) { - try { - numChild = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } else if (var.equals("type")) { - type = str; - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java deleted file mode 100644 index cf373773d72..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarDeleteInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-delete. - */ -public class MIVarDeleteInfo extends MIInfo { - - int ndeleted; - - public MIVarDeleteInfo(MIOutput record) { - super(record); - parse(); - } - - public int getNumberDeleted () { - return ndeleted; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("ndeleted")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - ndeleted = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java deleted file mode 100644 index fd49348645c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarEvaluateExpressionInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-evalute-expression - */ -public class MIVarEvaluateExpressionInfo extends MIInfo { - - String value = ""; - - public MIVarEvaluateExpressionInfo(MIOutput record) { - super(record); - parse(); - } - - public String getValue () { - return value; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("value")) { - MIValue val = results[i].getMIValue(); - if (val instanceof MIConst) { - value = ((MIConst)val).getCString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java deleted file mode 100644 index 3df7772a9a0..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoExpressionInfo.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-info-expression. - */ -public class MIVarInfoExpressionInfo extends MIInfo { - - String lang = ""; - String exp = ""; - - public MIVarInfoExpressionInfo(MIOutput record) { - super(record); - parse(); - } - - public String getLanguage () { - return lang; - } - - public String getExpression() { - return exp; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - - if (var.equals("lang")) { - lang = str; - } else if (var.equals("exp")) { - exp = str; - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java deleted file mode 100644 index c6d88a27558..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoNumChildrenInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-info-num-children. - */ -public class MIVarInfoNumChildrenInfo extends MIInfo { - - int children; - - public MIVarInfoNumChildrenInfo(MIOutput record) { - super(record); - parse(); - } - - public int getChildNumber() { - return children; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - - if (var.equals("numchild")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - children = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java deleted file mode 100644 index 81b79e2ad18..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarInfoTypeInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - - -/** - * GDB/MI var-info-type - */ -public class MIVarInfoTypeInfo extends MIInfo { - - String type = ""; - - public MIVarInfoTypeInfo(MIOutput record) { - super(record); - parse(); - } - - public String getType() { - return type; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("type")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - type = ((MIConst)value).getString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java deleted file mode 100644 index 569d97a5e89..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarListChildrenInfo.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI var-list-children - * -var-list-children var2 - * ^done,numchild="6",children={child={name="var2.0",exp="0",numchild="0",type="char"},child={name="var2.1",exp="1",numchild="0",type="char"},child={name="var2.2",exp="2",numchild="0",type="char"},child={name="var2.3",exp="3",numchild="0",type="char"},child={name="var2.4",exp="4",numchild="0",type="char"},child={name="var2.5",exp="5",numchild="0",type="char"}} - * - */ -public class MIVarListChildrenInfo extends MIInfo { - - MIVar[] children; - int numchild; - - public MIVarListChildrenInfo(MIOutput record) { - super(record); - parse(); - } - - public MIVar[] getMIVars() { - return children; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - - if (var.equals("numchild")) { - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - try { - numchild = Integer.parseInt(str.trim()); - } catch (NumberFormatException e) { - } - } - } else if (var.equals("children")) { - if (value instanceof MITuple) { - parseChildren((MITuple)value, aList); - } - } - } - } - } - children = (MIVar[])aList.toArray(new MIVar[aList.size()]); - } - - void parseChildren(MITuple tuple, List aList) { - MIResult[] results = tuple.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("child")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - aList.add(new MIVar((MITuple)value)); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java deleted file mode 100644 index 67b428d36bd..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowAttributesInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI var-show-attributes - */ -public class MIVarShowAttributesInfo extends MIInfo { - - String attr = ""; - - public MIVarShowAttributesInfo(MIOutput record) { - super(record); - parse(); - } - - public String getAttributes () { - return attr; - } - - public boolean isEditable() { - return attr.equals("editable"); - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("attr")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - attr = ((MIConst)value).getString(); - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java deleted file mode 100644 index c1cf409503a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarShowFormatInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import org.eclipse.cdt.debug.mi.core.MIFormat; - -/** - * GDB/MI var-show-format - */ -public class MIVarShowFormatInfo extends MIInfo { - - int format = MIFormat.NATURAL; - - public MIVarShowFormatInfo(MIOutput record) { - super(record); - parse(); - } - - public int getFormat() { - return format; - } - - void parse() { - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("name")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MIConst) { - String str = ((MIConst)value).getString(); - if ("binary".equals(str)) { - format = MIFormat.BINARY; - } else if ("decimal".equals(str)) { - format = MIFormat.DECIMAL; - } else if ("hexadecimal".equals(str)) { - format = MIFormat.HEXADECIMAL; - } else if ("octal".equals(str)) { - format = MIFormat.OCTAL; - } else if ("natural".equals(str)) { - format = MIFormat.NATURAL; - } - } - } - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java deleted file mode 100644 index 84051a2f79a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIVarUpdateInfo.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -import java.util.ArrayList; -import java.util.List; - -/** - * GDB/MI var-update. - * -var-update * - * ^done,changelist={name="var3",in_scope="true",type_changed="false",name="var2",in_scope="true",type_changed="false"} - */ -public class MIVarUpdateInfo extends MIInfo { - - MIVarChange[] changeList; - - public MIVarUpdateInfo(MIOutput record) { - super(record); - parse(); - } - - public MIVarChange[] getMIVarChanges() { - return changeList; - } - - void parse() { - List aList = new ArrayList(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIResultRecord rr = out.getMIResultRecord(); - if (rr != null) { - MIResult[] results = rr.getMIResults(); - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - if (var.equals("changelist")) { - MIValue value = results[i].getMIValue(); - if (value instanceof MITuple) { - parseChangeList((MITuple)value, aList); - } - } - } - } - } - changeList = (MIVarChange[])aList.toArray(new MIVarChange[aList.size()]); - } - - void parseChangeList(MITuple tuple, List aList) { - MIResult[] results = tuple.getMIResults(); - MIVarChange change = null; - for (int i = 0; i < results.length; i++) { - String var = results[i].getVariable(); - MIValue value = results[i].getMIValue(); - String str = ""; - if (value instanceof MIConst) { - str = ((MIConst)value).getString(); - } - if (var.equals("name")) { - change = new MIVarChange(str); - aList.add(change); - } else if (var.equals("in_scope")) { - if (change != null) { - change.setInScope("true".equals(str)); - } - } else if (var.equals("type_changed")) { - if (change != null) { - change.setChanged("true".equals(str)); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIWhatisInfo.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIWhatisInfo.java deleted file mode 100644 index 404100e1252..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIWhatisInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.core.output; - -/** - * GDB/MI whatis parsing. - */ -public class MIWhatisInfo extends MIInfo { - - String type; - - public MIWhatisInfo(MIOutput out) { - super(out); - parse(); - } - - public String getType() { - return type; - } - - void parse() { - StringBuffer buffer = new StringBuffer(); - if (isDone()) { - MIOutput out = getMIOutput(); - MIOOBRecord[] oobs = out.getMIOOBRecords(); - for (int i = 0; i < oobs.length; i++) { - if (oobs[i] instanceof MIConsoleStreamOutput) { - MIStreamRecord cons = (MIStreamRecord) oobs[i]; - String str = cons.getString(); - // We are interested in the shared info - if (str != null) { - str = str.trim(); - if (str.startsWith ("type")) { - int equal = str.indexOf('='); - if (equal > 0) { - str = str.substring(equal + 1); - } - } - buffer.append(str); - } - } - } - } - type = buffer.toString().trim(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/.classpath b/debug/org.eclipse.cdt.debug.mi.ui/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.mi.ui/.cvsignore b/debug/org.eclipse.cdt.debug.mi.ui/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/debug/org.eclipse.cdt.debug.mi.ui/.project b/debug/org.eclipse.cdt.debug.mi.ui/.project deleted file mode 100644 index ee92c3d5275..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - org.eclipse.cdt.debug.mi.ui - - - org.eclipse.cdt.debug.core - org.eclipse.cdt.debug.mi.core - org.eclipse.cdt.debug.ui - org.eclipse.cdt.launch - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog deleted file mode 100644 index d415f650958..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog +++ /dev/null @@ -1,138 +0,0 @@ -2003-12-17 Mikhail Khodjaiants - Fix for bug 49061: Different values are used as default for the "Load shared library symbols automatically" option. - * GDBSolibBlock.java - -2003-12-01 Mikhail Khodjaiants - Fix for PR 47230: Need a shared library search path editing capability for GDBServerDebugger. - Implemented 'GDBServerDebuggerPage' as an extension of 'GDBDebuggerPage'. - Added two new control blocks - "TCP Connection" and "Serial Connection". - * src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java - * src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java - * src/org/eclipse/cdt/debug/mi/internal/ui/SerialPortSettingsBlock.java: new - * src/org/eclipse/cdt/debug/mi/internal/ui/TCPSettingsBlock.java: new - -2003-11-26 Mikhail Khodjaiants - Cleanup. - * GDBServerDebuggerPage.java - * ComboDialogField.java - -2003-11-20 Mikhail Khodjaiants - Removed dependencies on internal packages from other cdt plugins. - * src/org/eclipse/cdt/debug/mi/internal/ui/PixelConverter.java: added - * src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java - -2003-11-19 Mikhail Khodjaiants - - Fix for PR 45533: MIException while creating MISession can leave an orphan gdb process. - * src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java: - added a text field for the launch timeout. - -2003-11-06 Alain Magloire - - Patch from Ashish Karkare(TimeSys) - *src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java - Add a new Combo that helps select a reasonable line speed, and storing - the selected value as a configuration attribute. - -2003-09-29 Mikhail Khodjaiants - Improved the layout of the 'Shared Libraries' component. - * SolibSearchPathBlock.java - -2003-09-11 Mikhail Khodjaiants - Moving the shared library search paths block to mi UI. - * SolibSearchPathBlock.java: new - * GDBSolibBlock.java - -2003-09-11 Mikhail Khodjaiants - Added the 'org.eclipse.cdt.debug.mi.internal.ui.dialogfields' package. - * CheckedListDialogField.java: new - * ComboDialogField.java: new - * DialogField.java: new - * IDialogFieldListener.java: new - * IListAdapter.java: new - * IStringButtonAdapter.java: new - * LayoutUtil.java: new - * ListDialogField.java: new - * SelectionButtonDialogField.java: new - * SelectionButtonDialogFieldGroup.java: new - * Separator.java: new - * StringButtonDialogField.java: new - * StringButtonStatusDialogField.java: new - * StringDialogField.java: new - -2003-09-09 Mikhail Khodjaiants - New UI for the 'Debugger' page of launch configuration. - * CygwinDebuggerPage.java - * GDBDebuggerPage.java - * GDBSolibBlock.java - -2003-04-07 Mikhail Khodjaiants - Replaced 'toString()' by 'getMessage()' for CDI exceptions. - * SetAutoSolibActionDelegate.java - -2004-04-04 Alain Magloire - - Code from Monta Vista to do a GDBServer launch. - The GDBServer launch page. - - * src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPager.java: - * plugin.xml - -2003-03-26 Mikhail Khodjaiants - Cosmetic changes in the 'MIPreferencePage' class. - * MIPreferencePage.java - -2003-02-12 Mikhail Khodjaiants - Changes in the 'Automatically Load Symbols' action because of the removal of the - 'setAutoSolib' method from ICDISharedLibraryManager. - * SetAutoSolibActionDelegate.java - * plugin.xml - -2003-02-11 Mikhail Khodjaiants - The 'Automatically Load Symbols' action is added to the 'Shared Libraries' view. - * SetAutoSolibActionDelegate.java: new - * plugin.properties - * plugin.xml - * icons/full/clcl16/auto_solib_co.gif: new - * icons/full/dlcl16/auto_solib_co.gif: new - * icons/full/elcl16/auto_solib_co.gif: new - -2003-02-11 Mikhail Khodjaiants - New package 'org.eclipse.cdt.debug.mi.internal.ui.actions' is added. - -2003-02-06 Alain Magloire - - * src/.../internal/ui/CygwinDebuggerPage.java (updateLaunchConfigurationDialog): - New method to increase visibility for inner classes. - (getShell): New method to increase visibility for inner classes. - (fGDBCommandText): Change scope to protected. - (fGDBInitText) Change scope to protected. - * src/.../internal/ui/GDBDebuggerPage.java: Ditto. - -2003-01-24 David Inglis - - * src/.../internal/ui/CDebuggerPage.java (removed) - * src/.../internal/ui/GDBDebuggerPage.java (added) - rename class plus small layout fix. - - * plugin.xml - * src/.../internal/ui/CygwinDebuggerPage.java (added) - make Cywin use its own debug page and remove the auto load solib option. - -2003-01-17 David Inglis - * src/.../internal/ui/CDebuggerPage.java - Added some browse buttons and new text field for gdbinit file. - -2003-01-03 Alain Magloire - - * build.properties: Patch from Judy Green. - -2003-01-03 Alain Magloire - - * src/org/eclipse./cdt/debug/mi/internal/ui/CDebuggerPage.java (setDefaults): - Set autosolib to true by default. - -2002-11-26 Doug Schaefer - - * plugin.xml: - Added new debugPage for Cygwin GDB. diff --git a/debug/org.eclipse.cdt.debug.mi.ui/about.html b/debug/org.eclipse.cdt.debug.mi.ui/about.html deleted file mode 100644 index 293340ea8ed..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            20th August, 2002

            -

            License

            -

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

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/build.properties b/debug/org.eclipse.cdt.debug.mi.ui/build.properties deleted file mode 100644 index 86e748287d4..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - icons/,\ - cdtmiui.jar -src.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - icons/ -source.cdtmiui.jar = src/ diff --git a/debug/org.eclipse.cdt.debug.mi.ui/icons/full/clcl16/auto_solib_co.gif b/debug/org.eclipse.cdt.debug.mi.ui/icons/full/clcl16/auto_solib_co.gif deleted file mode 100644 index 5a3fe16f204..00000000000 Binary files a/debug/org.eclipse.cdt.debug.mi.ui/icons/full/clcl16/auto_solib_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.mi.ui/icons/full/dlcl16/auto_solib_co.gif b/debug/org.eclipse.cdt.debug.mi.ui/icons/full/dlcl16/auto_solib_co.gif deleted file mode 100644 index e8771f1e7e3..00000000000 Binary files a/debug/org.eclipse.cdt.debug.mi.ui/icons/full/dlcl16/auto_solib_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.mi.ui/icons/full/elcl16/auto_solib_co.gif b/debug/org.eclipse.cdt.debug.mi.ui/icons/full/elcl16/auto_solib_co.gif deleted file mode 100644 index e6a4a9728ee..00000000000 Binary files a/debug/org.eclipse.cdt.debug.mi.ui/icons/full/elcl16/auto_solib_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.mi.ui/plugin.properties b/debug/org.eclipse.cdt.debug.mi.ui/plugin.properties deleted file mode 100644 index 7d444eef8ba..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/plugin.properties +++ /dev/null @@ -1,7 +0,0 @@ -pluginName=C/C++ Development Tools GDB/MI CDI Debugger UI -providerName=Eclipse.org - -MIPreferencePage.name=GDB MI - -SetAutoSolibAction.label=Automatically Load Shared Libraries -SetAutoSolibAction.tooltip=Automatically Load Shared Libraries On/Off diff --git a/debug/org.eclipse.cdt.debug.mi.ui/plugin.xml b/debug/org.eclipse.cdt.debug.mi.ui/plugin.xml deleted file mode 100644 index f27c176b45a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/plugin.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CygwinDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CygwinDebuggerPage.java deleted file mode 100644 index 743abee4787..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CygwinDebuggerPage.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui; - -import org.eclipse.swt.widgets.Composite; - - -public class CygwinDebuggerPage extends GDBDebuggerPage -{ - public String getName() - { - return "Cygwin GDB Debugger Options"; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#createSolibBlock(org.eclipse.swt.widgets.Composite) - */ - public GDBSolibBlock createSolibBlock(Composite parent) - { - GDBSolibBlock block = new GDBSolibBlock(); - block.createBlock( parent, true, false, true ); - return block; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java deleted file mode 100644 index 5bda33a621f..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBDebuggerPage.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui; - -import java.io.File; -import java.util.Observable; -import java.util.Observer; - -import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; -import org.eclipse.swt.widgets.Text; - -public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements Observer -{ - protected TabFolder fTabFolder; - protected Text fGDBCommandText; - protected Text fGDBInitText; - private GDBSolibBlock fSolibBlock; - - public void createControl( Composite parent ) - { - Composite comp = new Composite( parent, SWT.NONE ); - comp.setLayout( new GridLayout() ); - comp.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - - fTabFolder = new TabFolder( comp, SWT.NONE ); - fTabFolder.setLayoutData( new GridData( GridData.FILL_BOTH | GridData.GRAB_VERTICAL ) ); - - createTabs( fTabFolder ); - - fTabFolder.setSelection( 0 ); - setControl( parent ); - } - - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb" ); - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, "" ); - if ( fSolibBlock != null ) - fSolibBlock.setDefaults( configuration ); - } - - /** - * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) - */ - public boolean isValid( ILaunchConfiguration launchConfig ) - { - boolean valid = fGDBCommandText.getText().length() != 0; - if ( valid ) - { - setErrorMessage( null ); - setMessage( null ); - } - else - { - setErrorMessage( "Debugger executable must be specified" ); - setMessage( null ); - } - return valid; - } - - public void initializeFrom( ILaunchConfiguration configuration ) - { - String gdbCommand = "gdb"; - String gdbInit = ""; - try - { - gdbCommand = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb" ); - gdbInit = configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, "" ); - } - catch( CoreException e ) - { - } - fGDBCommandText.setText( gdbCommand ); - fGDBInitText.setText( gdbInit ); - if ( fSolibBlock != null ) - fSolibBlock.initializeFrom( configuration ); - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - String gdbStr = fGDBCommandText.getText(); - gdbStr.trim(); - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbStr ); - gdbStr = fGDBInitText.getText(); - gdbStr.trim(); - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_GDB_INIT, gdbStr ); - if ( fSolibBlock != null ) - fSolibBlock.performApply( configuration ); - } - - public String getName() - { - return "GDB Debugger Options"; - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getShell() - */ - protected Shell getShell() - { - return super.getShell(); - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() - */ - protected void updateLaunchConfigurationDialog() - { - super.updateLaunchConfigurationDialog(); - } - - /* (non-Javadoc) - * @see java.util.Observer#update(java.util.Observable, java.lang.Object) - */ - public void update( Observable o, Object arg ) - { - updateLaunchConfigurationDialog(); - } - - public GDBSolibBlock createSolibBlock( Composite parent ) - { - GDBSolibBlock block = new GDBSolibBlock(); - block.createBlock( parent, true, true, true ); - return block; - } - - public void createTabs( TabFolder tabFolder ) - { - createMainTab( tabFolder ); - createSolibTab( tabFolder ); - } - - public void createMainTab( TabFolder tabFolder ) - { - TabItem tabItem = new TabItem( tabFolder, SWT.NONE ); - tabItem.setText( "Main" ); - - Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH ); - ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false; - tabItem.setControl( comp ); - - Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL ); - ((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false; - - Label label = ControlFactory.createLabel( subComp, "GDB debugger:" ); - GridData gd = new GridData(); -// gd.horizontalSpan = 2; - label.setLayoutData( gd ); - - fGDBCommandText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER ); - fGDBCommandText.addModifyListener( - new ModifyListener() - { - public void modifyText( ModifyEvent evt ) - { - updateLaunchConfigurationDialog(); - } - } ); - - Button button = createPushButton( subComp, "&Browse...", null ); - button.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleGDBButtonSelected(); - updateLaunchConfigurationDialog(); - } - - private void handleGDBButtonSelected() - { - FileDialog dialog = new FileDialog( getShell(), SWT.NONE ); - dialog.setText( "GDB Command File" ); - String gdbCommand = fGDBCommandText.getText().trim(); - int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator ); - if ( lastSeparatorIndex != -1 ) - { - dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) ); - } - String res = dialog.open(); - if ( res == null ) - { - return; - } - fGDBCommandText.setText( res ); - } - } ); - - label = ControlFactory.createLabel( subComp, "GDB command file:" ); - gd = new GridData(); -// gd.horizontalSpan = 2; - label.setLayoutData( gd ); - - fGDBInitText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER ); - gd = new GridData( GridData.FILL_HORIZONTAL ); - fGDBInitText.setLayoutData( gd ); - fGDBInitText.addModifyListener( new ModifyListener() - { - public void modifyText( ModifyEvent evt ) - { - updateLaunchConfigurationDialog(); - } - } ); - button = createPushButton( subComp, "&Browse...", null ); - button.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleGDBInitButtonSelected(); - updateLaunchConfigurationDialog(); - } - - private void handleGDBInitButtonSelected() - { - FileDialog dialog = new FileDialog( getShell(), SWT.NONE ); - dialog.setText( "GDB command file" ); - String gdbCommand = fGDBInitText.getText().trim(); - int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator ); - if ( lastSeparatorIndex != -1 ) - { - dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) ); - } - String res = dialog.open(); - if ( res == null ) - { - return; - } - fGDBInitText.setText( res ); - } - } ); - - label = ControlFactory.createLabel( comp, - "(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example \"run\".)", - 200, - SWT.DEFAULT, - SWT.WRAP ); - gd = new GridData( GridData.FILL_HORIZONTAL ); - gd.horizontalSpan = 1; - gd.widthHint = 200; - label.setLayoutData( gd ); - } - - public void createSolibTab( TabFolder tabFolder ) - { - TabItem tabItem = new TabItem( tabFolder, SWT.NONE ); - tabItem.setText( "Shared Libraries" ); - - Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH ); - tabItem.setControl( comp ); - - fSolibBlock = createSolibBlock( comp ); - fSolibBlock.addObserver( this ); - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() - */ - public void dispose() - { - if ( fSolibBlock != null ) - { - fSolibBlock.deleteObserver( this ); - fSolibBlock.dispose(); - } - super.dispose(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java deleted file mode 100644 index 8d5ad8630d7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBServerDebuggerPage.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.internal.ui; - -import java.io.File; - -import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.LayoutUtil; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StackLayout; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; - -/** - * Enter type comment. - * - * @since Nov 20, 2003 - */ -public class GDBServerDebuggerPage extends GDBDebuggerPage -{ - private final static String CONNECTION_TCP = "TCP"; - private final static String CONNECTION_SERIAL = "Serial"; - - private ComboDialogField fConnectionField; - - private String[] fConnections = new String[] { CONNECTION_TCP, CONNECTION_SERIAL }; - private TCPSettingsBlock fTCPBlock; - private SerialPortSettingsBlock fSerialBlock; - private Composite fConnectionStack; - - public GDBServerDebuggerPage() - { - super(); - fConnectionField = createConnectionField(); - fTCPBlock = new TCPSettingsBlock(); - fSerialBlock = new SerialPortSettingsBlock(); - fTCPBlock.addObserver( this ); - fSerialBlock.addObserver( this ); - } - - public void createMainTab( TabFolder tabFolder ) - { - TabItem tabItem = new TabItem( tabFolder, SWT.NONE ); - tabItem.setText( "Main" ); - - Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH ); - ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false; - tabItem.setControl( comp ); - - Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL ); - ((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false; - - Label label = ControlFactory.createLabel( subComp, "GDB debugger:" ); - GridData gd = new GridData(); -// gd.horizontalSpan = 2; - label.setLayoutData( gd ); - - fGDBCommandText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER ); - fGDBCommandText.addModifyListener( - new ModifyListener() - { - public void modifyText( ModifyEvent evt ) - { - updateLaunchConfigurationDialog(); - } - } ); - - Button button = createPushButton( subComp, "&Browse...", null ); - button.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleGDBButtonSelected(); - updateLaunchConfigurationDialog(); - } - - private void handleGDBButtonSelected() - { - FileDialog dialog = new FileDialog( getShell(), SWT.NONE ); - dialog.setText( "GDB Command File" ); - String gdbCommand = fGDBCommandText.getText().trim(); - int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator ); - if ( lastSeparatorIndex != -1 ) - { - dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) ); - } - String res = dialog.open(); - if ( res == null ) - { - return; - } - fGDBCommandText.setText( res ); - } - } ); - - label = ControlFactory.createLabel( subComp, "GDB command file:" ); - gd = new GridData(); -// gd.horizontalSpan = 2; - label.setLayoutData( gd ); - - fGDBInitText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER ); - gd = new GridData( GridData.FILL_HORIZONTAL ); - fGDBInitText.setLayoutData( gd ); - fGDBInitText.addModifyListener( new ModifyListener() - { - public void modifyText( ModifyEvent evt ) - { - updateLaunchConfigurationDialog(); - } - } ); - button = createPushButton( subComp, "&Browse...", null ); - button.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleGDBInitButtonSelected(); - updateLaunchConfigurationDialog(); - } - - private void handleGDBInitButtonSelected() - { - FileDialog dialog = new FileDialog( getShell(), SWT.NONE ); - dialog.setText( "GDB command file" ); - String gdbCommand = fGDBInitText.getText().trim(); - int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator ); - if ( lastSeparatorIndex != -1 ) - { - dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) ); - } - String res = dialog.open(); - if ( res == null ) - { - return; - } - fGDBInitText.setText( res ); - } - } ); - - extendMainTab( comp ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#extendMainTab(org.eclipse.swt.widgets.Composite) - */ - protected void extendMainTab( Composite parent ) - { - Composite comp = ControlFactory.createCompositeEx( parent, 2, GridData.FILL_BOTH ); - ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false; - - - fConnectionField.doFillIntoGrid( comp, 2 ); - ((GridData)fConnectionField.getComboControl( null ).getLayoutData()).horizontalAlignment = GridData.BEGINNING; - PixelConverter converter = new PixelConverter( comp ); - LayoutUtil.setWidthHint( fConnectionField.getComboControl( null ), converter.convertWidthInCharsToPixels( 15 ) ); - fConnectionStack = ControlFactory.createCompositeEx( comp, 1, GridData.FILL_BOTH ); - StackLayout stackLayout = new StackLayout(); - fConnectionStack.setLayout( stackLayout ); - ((GridData)fConnectionStack.getLayoutData()).horizontalSpan = 2; - fTCPBlock.createBlock( fConnectionStack ); - fSerialBlock.createBlock( fConnectionStack ); - connectionTypeChanged(); - } - - private ComboDialogField createConnectionField() - { - ComboDialogField field = new ComboDialogField( SWT.DROP_DOWN | SWT.READ_ONLY ); - field.setLabelText( "Connection: " ); - field.setItems( fConnections ); - field.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - connectionTypeChanged(); - } - } ); - return field; - } - - protected void connectionTypeChanged() - { - ((StackLayout)fConnectionStack.getLayout()).topControl = null; - int index = fConnectionField.getSelectionIndex(); - if ( index >= 0 && index < fConnections.length ) - { - String[] connTypes = fConnectionField.getItems(); - if ( CONNECTION_TCP.equals( connTypes[index] ) ) - ((StackLayout)fConnectionStack.getLayout()).topControl = fTCPBlock.getControl(); - else if ( CONNECTION_SERIAL.equals( connTypes[index] ) ) - ((StackLayout)fConnectionStack.getLayout()).topControl = fSerialBlock.getControl(); - } - fConnectionStack.layout(); - updateLaunchConfigurationDialog(); - } - - public boolean isValid( ILaunchConfiguration launchConfig ) - { - if ( super.isValid( launchConfig ) ) - { - setErrorMessage( null ); - setMessage( null ); - - int index = fConnectionField.getSelectionIndex(); - if ( index >= 0 && index < fConnections.length ) - { - String[] connTypes = fConnectionField.getItems(); - if ( CONNECTION_TCP.equals( connTypes[index] ) ) - { - if ( !fTCPBlock.isValid( launchConfig ) ) - { - setErrorMessage( fTCPBlock.getErrorMessage() ); - return false; - } - } - else if ( CONNECTION_SERIAL.equals( connTypes[index] ) ) - { - if ( !fSerialBlock.isValid( launchConfig ) ) - { - setErrorMessage( fSerialBlock.getErrorMessage() ); - return false; - } - } - return true; - } - } - return false; - } - - public void initializeFrom( ILaunchConfiguration configuration ) - { - super.initializeFrom( configuration ); - - boolean isTcp = false; - try - { - isTcp = configuration.getAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, false ); - } - catch( CoreException e ) - { - } - - fTCPBlock.initializeFrom( configuration ); - fSerialBlock.initializeFrom( configuration ); - - fConnectionField.selectItem( ( isTcp ) ? 0 : 1 ); - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - super.performApply( configuration ); - if ( fConnectionField != null ) - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, fConnectionField.getSelectionIndex() == 0 ); - fTCPBlock.performApply( configuration ); - fSerialBlock.performApply( configuration ); - } - - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - super.setDefaults( configuration ); - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, false ); - fTCPBlock.setDefaults( configuration ); - fSerialBlock.setDefaults( configuration ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBSolibBlock.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBSolibBlock.java deleted file mode 100644 index 904d3688394..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/GDBSolibBlock.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.mi.internal.ui; - -import java.util.Map; -import java.util.Observable; -import java.util.Observer; - -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -/** - * Enter type comment. - * - * @since Sep 3, 2003 - */ -public class GDBSolibBlock extends Observable implements Observer -{ - private SolibSearchPathBlock fSolibSearchPathBlock; - private Button fAutoSoLibButton; - private Button fStopOnSolibEventsButton; - private Composite fControl; - - public GDBSolibBlock() - { - super(); - } - - public void createBlock( Composite parent, boolean solibPath, boolean autoSolib, boolean stopOnSolibEvents ) - { - Composite subComp = ControlFactory.createCompositeEx( parent, 1, GridData.FILL_HORIZONTAL ); - ((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false; - ((GridLayout)subComp.getLayout()).marginHeight = 0; - ((GridLayout)subComp.getLayout()).marginWidth = 0; - - if ( solibPath ) - { - fSolibSearchPathBlock = new SolibSearchPathBlock(); - fSolibSearchPathBlock.createBlock( subComp ); - fSolibSearchPathBlock.addObserver( this ); - } - - if ( autoSolib ) - { - fAutoSoLibButton = ControlFactory.createCheckBox( subComp, "Load shared library symbols automatically" ); - fAutoSoLibButton.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent e ) - { - updateButtons(); - changed(); - } - } ); - } - - if ( stopOnSolibEvents ) - { - fStopOnSolibEventsButton = ControlFactory.createCheckBox( subComp, "Stop on shared library events" ); - fStopOnSolibEventsButton.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent e ) - { - updateButtons(); - changed(); - } - } ); - } - setControl( subComp ); - } - - public void initializeFrom( ILaunchConfiguration configuration ) - { - if ( fSolibSearchPathBlock != null ) - fSolibSearchPathBlock.initializeFrom( configuration ); - try - { - if ( fAutoSoLibButton != null ) - fAutoSoLibButton.setSelection( configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT ) ); - if ( fStopOnSolibEventsButton != null ) - fStopOnSolibEventsButton.setSelection( configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT ) ); - initializeButtons( configuration ); - updateButtons(); - } - catch( CoreException e ) - { - return; - } - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - if ( fSolibSearchPathBlock != null ) - fSolibSearchPathBlock.performApply( configuration ); - try - { - Map attrs = configuration.getAttributes(); - if ( fAutoSoLibButton != null ) - attrs.put( IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, new Boolean( fAutoSoLibButton.getSelection() ) ); - if ( fStopOnSolibEventsButton != null ) - attrs.put( IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, new Boolean( fStopOnSolibEventsButton.getSelection() ) ); - configuration.setAttributes( attrs ); - } - catch( CoreException e ) - { - } - } - - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - if ( fSolibSearchPathBlock != null ) - fSolibSearchPathBlock.setDefaults( configuration ); - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, - IMILaunchConfigurationConstants.DEBUGGER_AUTO_SOLIB_DEFAULT ); - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, - IMILaunchConfigurationConstants.DEBUGGER_STOP_ON_SOLIB_EVENTS_DEFAULT ); - } - - protected void updateButtons() - { - } - - public void dispose() - { - deleteObservers(); - if ( fSolibSearchPathBlock != null ) - { - fSolibSearchPathBlock.deleteObserver( this ); - fSolibSearchPathBlock.dispose(); - } - } - - public void disable() - { - if ( fAutoSoLibButton != null ) - fAutoSoLibButton.setEnabled( false ); - if ( fStopOnSolibEventsButton != null ) - fStopOnSolibEventsButton.setEnabled( false ); - } - - /* (non-Javadoc) - * @see java.util.Observer#update(java.util.Observable, java.lang.Object) - */ - public void update( Observable o, Object arg ) - { - changed(); - } - - protected void changed() - { - setChanged(); - notifyObservers(); - } - - public Composite getControl() - { - return fControl; - } - - protected void setControl( Composite composite ) - { - fControl = composite; - } - - protected void initializeButtons( ILaunchConfiguration configuration ) - { - try - { - boolean enable = !ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE.equals( configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, "" ) ); - if ( fAutoSoLibButton != null ) - fAutoSoLibButton.setEnabled( enable ); - if ( fStopOnSolibEventsButton != null ) - fStopOnSolibEventsButton.setEnabled( enable ); - } - catch( CoreException e ) - { - } - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIHelpContextIds.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIHelpContextIds.java deleted file mode 100644 index dc8207c843c..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIHelpContextIds.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.internal.ui; - -/** - * - * Help context ids for the C/C++ debug ui. - *

            - * This interface contains constants only; it is not intended to be implemented - * or extended. - *

            - * - * @since Oct 4, 2002 - */ -public interface IMIHelpContextIds -{ - public static final String PREFIX = IMIUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$ - - // Preference pages - public static final String MI_PREFERENCE_PAGE = PREFIX + "mi_preference_page_context"; //$NON-NLS-1$ -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIUIConstants.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIUIConstants.java deleted file mode 100644 index 462eeca6e46..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/IMIUIConstants.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.internal.ui; - -/** - * - * Constant definitions for MI UI plug-in. - * - * @since Oct 4, 2002 - */ -public interface IMIUIConstants -{ - /** - * C/C++ Debug UI plug-in identifier (value "org.eclipse.cdt.debug.ui"). - */ - public static final String PLUGIN_ID = MIUIPlugin.getDefault().getDescriptor().getUniqueIdentifier(); -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java deleted file mode 100644 index 4a3138cb168..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.eclipse.cdt.debug.mi.internal.ui; - -import org.eclipse.ui.plugin.*; -import org.eclipse.core.runtime.*; -import org.eclipse.core.resources.*; -import java.util.*; - -/** - * The main plugin class to be used in the desktop. - */ -public class MIUIPlugin extends AbstractUIPlugin { - //The shared instance. - private static MIUIPlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - /** - * The constructor. - */ - public MIUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - try { - resourceBundle= ResourceBundle.getBundle("org.eclipse.cdt.debug.mi.ui.UiPluginResources"); - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - /** - * Returns the shared instance. - */ - public static MIUIPlugin getDefault() { - return plugin; - } - - /** - * Returns the workspace instance. - */ - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle= MIUIPlugin.getDefault().getResourceBundle(); - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - return resourceBundle; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/PixelConverter.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/PixelConverter.java deleted file mode 100644 index 287c58018d7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/PixelConverter.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.eclipse.cdt.debug.mi.internal.ui; - - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html - -Contributors: - IBM Corporation - Initial implementation -**********************************************************************/ - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.swt.graphics.FontMetrics; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.widgets.Control; - -public class PixelConverter -{ - private FontMetrics fFontMetrics; - - public PixelConverter( Control control ) - { - GC gc = new GC( control ); - gc.setFont( control.getFont() ); - fFontMetrics = gc.getFontMetrics(); - gc.dispose(); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int) - */ - public int convertHeightInCharsToPixels( int chars ) - { - return Dialog.convertHeightInCharsToPixels( fFontMetrics, chars ); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int) - */ - public int convertHorizontalDLUsToPixels( int dlus ) - { - return Dialog.convertHorizontalDLUsToPixels( fFontMetrics, dlus ); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int) - */ - public int convertVerticalDLUsToPixels( int dlus ) - { - return Dialog.convertVerticalDLUsToPixels( fFontMetrics, dlus ); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int) - */ - public int convertWidthInCharsToPixels( int chars ) - { - return Dialog.convertWidthInCharsToPixels( fFontMetrics, chars ); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SerialPortSettingsBlock.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SerialPortSettingsBlock.java deleted file mode 100644 index 6e2a3bce8b5..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SerialPortSettingsBlock.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.internal.ui; - -import java.util.Observable; - -import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.LayoutUtil; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.StringDialogField; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -/** - * Enter type comment. - * - * @since Nov 20, 2003 - */ -public class SerialPortSettingsBlock extends Observable -{ - private final static String DEFAULT_ASYNC_DEVICE = "/dev/ttyS0"; - private final static String DEFAULT_ASYNC_DEVICE_SPEED = "115200"; - - private Shell fShell; - - private StringDialogField fDeviceField; - private ComboDialogField fSpeedField; - - private String fSpeedChoices[] = { "9600", "19200", "38400", "57600", "115200" }; - - private Control fControl; - - private String fErrorMessage = null; - - public SerialPortSettingsBlock() - { - super(); - fDeviceField = createDeviceField(); - fSpeedField = createSpeedField(); - } - - public void createBlock( Composite parent ) - { - fShell = parent.getShell(); - Composite comp = ControlFactory.createCompositeEx( parent, 2, GridData.FILL_BOTH ); - ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false; - ((GridLayout)comp.getLayout()).marginHeight = 0; - ((GridLayout)comp.getLayout()).marginWidth = 0; - comp.setFont( JFaceResources.getDialogFont() ); - - PixelConverter converter = new PixelConverter( comp ); - - fDeviceField.doFillIntoGrid( comp, 2 ); - LayoutUtil.setWidthHint( fDeviceField.getTextControl( null ), converter.convertWidthInCharsToPixels( 20 ) ); - fSpeedField.doFillIntoGrid( comp, 2 ); - ((GridData)fSpeedField.getComboControl( null ).getLayoutData()).horizontalAlignment = GridData.BEGINNING; - - setControl( comp ); - } - - protected Shell getShell() - { - return fShell; - } - - public void dispose() - { - deleteObservers(); - } - - public void initializeFrom( ILaunchConfiguration configuration ) - { - initializeDevice( configuration ); - initializeSpeed( configuration ); - } - - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_DEV, DEFAULT_ASYNC_DEVICE ); - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, DEFAULT_ASYNC_DEVICE_SPEED ); - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - if ( fDeviceField != null ) - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_DEV, fDeviceField.getText().trim() ); - if ( fSpeedField != null ) - { - int index = fSpeedField.getSelectionIndex(); - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, getSpeedItem( index ) ); - } - } - - private StringDialogField createDeviceField() - { - StringDialogField field = new StringDialogField(); - field.setLabelText( "Device: " ); - field.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - deviceFieldChanged(); - } - } ); - return field; - } - - private ComboDialogField createSpeedField() - { - ComboDialogField field = new ComboDialogField( SWT.DROP_DOWN | SWT.READ_ONLY ); - field.setLabelText( "Speed: " ); - field.setItems( fSpeedChoices ); - field.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - speedFieldChanged(); - } - } ); - return field; - } - - protected void deviceFieldChanged() - { - updateErrorMessage(); - setChanged(); - notifyObservers(); - } - - protected void speedFieldChanged() - { - updateErrorMessage(); - setChanged(); - notifyObservers(); - } - - private void initializeDevice( ILaunchConfiguration configuration ) - { - if ( fDeviceField != null ) - { - try - { - fDeviceField.setText( configuration.getAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_DEV, DEFAULT_ASYNC_DEVICE ) ); - } - catch( CoreException e ) - { - } - } - } - - private void initializeSpeed( ILaunchConfiguration configuration ) - { - if ( fSpeedField != null ) - { - int index = 0; - try - { - index = getSpeedItemIndex( configuration.getAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, DEFAULT_ASYNC_DEVICE_SPEED ) ); - } - catch( CoreException e ) - { - } - fSpeedField.selectItem( index ); - } - } - - private String getSpeedItem( int index ) - { - return ( index >= 0 && index < fSpeedChoices.length ) ? fSpeedChoices[index] : null; - } - - private int getSpeedItemIndex( String item ) - { - for ( int i = 0; i < fSpeedChoices.length; ++i ) - if ( fSpeedChoices[i].equals( item ) ) - return i; - return 0; - } - - public Control getControl() - { - return fControl; - } - - protected void setControl( Control control ) - { - fControl = control; - } - - public boolean isValid( ILaunchConfiguration configuration ) - { - updateErrorMessage(); - return ( getErrorMessage() == null ); - } - - private void updateErrorMessage() - { - setErrorMessage( null ); - if ( fDeviceField != null && fSpeedField != null ) - { - if ( fDeviceField.getText().trim().length() == 0 ) - setErrorMessage( "Device must be specified." ); - else if ( !deviceIsValid( fDeviceField.getText().trim() ) ) - setErrorMessage( "Invalid device." ); - else if ( fSpeedField.getSelectionIndex() < 0 ) - setErrorMessage( "Speed must be specified." ); - } - } - - public String getErrorMessage() - { - return fErrorMessage; - } - - private void setErrorMessage( String string ) - { - fErrorMessage = string; - } - - private boolean deviceIsValid( String hostName ) - { - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java deleted file mode 100644 index 6d698fe4ecb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.internal.ui; - -import java.util.Collections; -import java.util.Observable; - -import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IListAdapter; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.LayoutUtil; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ListDialogField; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Shell; - -/** - * Enter type comment. - * - * @since Sep 4, 2003 - */ -public class SolibSearchPathBlock extends Observable -{ - public class SolibSearchPathListDialogField extends ListDialogField - { - public SolibSearchPathListDialogField( IListAdapter adapter, String[] buttonLabels, ILabelProvider lprovider ) - { - super( adapter, buttonLabels, lprovider ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.dialogfields.ListDialogField#managedButtonPressed(int) - */ - protected boolean managedButtonPressed( int index ) - { - boolean result = super.managedButtonPressed( index ); - if ( result ) - buttonPressed( index ); - return result; - } - - } - - private Shell fShell; - private SolibSearchPathListDialogField fDirList; - - public SolibSearchPathBlock() - { - super(); - - String[] buttonLabels = new String[] - { - /* 0 */ "Add...", - /* 1 */ null, - /* 2 */ "Up", - /* 3 */ "Down", - /* 4 */ null, - /* 5 */ "Remove", - }; - - IListAdapter listAdapter = new IListAdapter() - { - public void customButtonPressed( DialogField field, int index ) - { - buttonPressed( index ); - } - - public void selectionChanged( DialogField field ) - { - } - }; - - fDirList = new SolibSearchPathListDialogField( listAdapter, buttonLabels, new LabelProvider() ); - fDirList.setLabelText( "Directories:" ); - fDirList.setUpButtonIndex( 2 ); - fDirList.setDownButtonIndex( 3 ); - fDirList.setRemoveButtonIndex( 5 ); - } - - public void createBlock( Composite parent ) - { - fShell = parent.getShell(); - Composite comp = ControlFactory.createCompositeEx( parent, 2, GridData.FILL_BOTH ); - ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false; - ((GridLayout)comp.getLayout()).marginHeight = 0; - ((GridLayout)comp.getLayout()).marginWidth = 0; - comp.setFont( JFaceResources.getDialogFont() ); - - PixelConverter converter = new PixelConverter( comp ); - - fDirList.doFillIntoGrid( comp, 3 ); - LayoutUtil.setHorizontalSpan( fDirList.getLabelControl( null ), 2 ); - LayoutUtil.setWidthHint( fDirList.getLabelControl( null ), converter.convertWidthInCharsToPixels( 30 ) ); - LayoutUtil.setHorizontalGrabbing( fDirList.getListControl( null ) ); - } - - public void initializeFrom( ILaunchConfiguration configuration ) - { - if ( fDirList != null ) - { - try - { - fDirList.addElements( configuration.getAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST ) ); - } - catch( CoreException e ) - { - } - } - } - - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST ); - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - if ( fDirList != null ) - { - configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, fDirList.getElements() ); - } - } - - protected void buttonPressed( int index ) - { - if ( index == 0 ) - addDirectory(); - setChanged(); - notifyObservers(); - } - - protected Shell getShell() - { - return fShell; - } - - private void addDirectory() - { - DirectoryDialog dialog = new DirectoryDialog( getShell() ); - dialog.setMessage( "Select directory that contains shared library." ); - String res = dialog.open(); - if ( res != null ) - fDirList.addElement( res ); - } - - public void dispose() - { - deleteObservers(); - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/TCPSettingsBlock.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/TCPSettingsBlock.java deleted file mode 100644 index 34146efb8bb..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/TCPSettingsBlock.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.mi.internal.ui; - -import java.util.Observable; - -import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.LayoutUtil; -import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.StringDialogField; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -/** - * Enter type comment. - * - * @since Nov 20, 2003 - */ -public class TCPSettingsBlock extends Observable -{ - private final static String DEFAULT_HOST_NAME = "localhost"; - private final static String DEFAULT_PORT_NUMBER = "10000"; - - private Shell fShell; - - private StringDialogField fHostNameField; - private StringDialogField fPortNumberField; - - private Control fControl; - - private String fErrorMessage = null; - - public TCPSettingsBlock() - { - super(); - fHostNameField = createHostNameField(); - fPortNumberField = createPortNumberField(); - } - - public void createBlock( Composite parent ) - { - fShell = parent.getShell(); - Composite comp = ControlFactory.createCompositeEx( parent, 2, GridData.FILL_BOTH ); - ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false; - ((GridLayout)comp.getLayout()).marginHeight = 0; - ((GridLayout)comp.getLayout()).marginWidth = 0; - comp.setFont( JFaceResources.getDialogFont() ); - - PixelConverter converter = new PixelConverter( comp ); - - fHostNameField.doFillIntoGrid( comp, 2 ); - LayoutUtil.setWidthHint( fHostNameField.getTextControl( null ), converter.convertWidthInCharsToPixels( 20 ) ); - fPortNumberField.doFillIntoGrid( comp, 2 ); - ((GridData)fPortNumberField.getTextControl( null ).getLayoutData()).horizontalAlignment = GridData.BEGINNING; - LayoutUtil.setWidthHint( fPortNumberField.getTextControl( null ), converter.convertWidthInCharsToPixels( 10 ) ); - - setControl( comp ); - } - - protected Shell getShell() - { - return fShell; - } - - public void dispose() - { - deleteObservers(); - } - - public void initializeFrom( ILaunchConfiguration configuration ) - { - initializeHostName( configuration ); - initializePortNumber( configuration ); - } - - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_HOST, DEFAULT_HOST_NAME ); - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_PORT, DEFAULT_PORT_NUMBER ); - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - if ( fHostNameField != null ) - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_HOST, fHostNameField.getText().trim() ); - if ( fPortNumberField != null ) - configuration.setAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_PORT, fPortNumberField.getText().trim() ); - } - - private StringDialogField createHostNameField() - { - StringDialogField field = new StringDialogField(); - field.setLabelText( "Host name or IP address: " ); - field.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - hostNameFieldChanged(); - } - } ); - return field; - } - - private StringDialogField createPortNumberField() - { - StringDialogField field = new StringDialogField(); - field.setLabelText( "Port number: " ); - field.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - portNumberFieldChanged(); - } - } ); - return field; - } - - protected void hostNameFieldChanged() - { - updateErrorMessage(); - setChanged(); - notifyObservers(); - } - - protected void portNumberFieldChanged() - { - updateErrorMessage(); - setChanged(); - notifyObservers(); - } - - private void initializeHostName( ILaunchConfiguration configuration ) - { - if ( fHostNameField != null ) - { - try - { - fHostNameField.setText( configuration.getAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_HOST, DEFAULT_HOST_NAME ) ); - } - catch( CoreException e ) - { - } - } - } - - private void initializePortNumber( ILaunchConfiguration configuration ) - { - if ( fPortNumberField != null ) - { - try - { - fPortNumberField.setText( configuration.getAttribute( IGDBServerMILaunchConfigurationConstants.ATTR_PORT, DEFAULT_PORT_NUMBER ) ); - } - catch( CoreException e ) - { - } - } - } - - public Control getControl() - { - return fControl; - } - - protected void setControl( Control control ) - { - fControl = control; - } - - public boolean isValid( ILaunchConfiguration configuration ) - { - updateErrorMessage(); - return ( getErrorMessage() == null ); - } - - private void updateErrorMessage() - { - setErrorMessage( null ); - if ( fHostNameField != null && fPortNumberField != null ) - { - if ( fHostNameField.getText().trim().length() == 0 ) - setErrorMessage( "Host name or IP address must be specified." ); - else if ( !hostNameIsValid( fHostNameField.getText().trim() ) ) - setErrorMessage( "Invalid host name or IP address." ); - else if ( fPortNumberField.getText().trim().length() == 0 ) - setErrorMessage( "Port number must be specified." ); - else if ( !portNumberIsValid( fPortNumberField.getText().trim() ) ) - setErrorMessage( "Invalid port number." ); - } - } - - public String getErrorMessage() - { - return fErrorMessage; - } - - private void setErrorMessage( String string ) - { - fErrorMessage = string; - } - - private boolean hostNameIsValid( String hostName ) - { - return true; - } - - private boolean portNumberIsValid( String portNumber ) - { - try - { - int port = Short.parseShort( portNumber ); - if ( port < 0 ) - return false; - } - catch( NumberFormatException e ) - { - return false; - } - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java deleted file mode 100644 index f2e83818952..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/actions/SetAutoSolibActionDelegate.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.internal.ui.actions; - -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.mi.core.MIPlugin; -import org.eclipse.cdt.debug.mi.core.cdi.Session; -import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; - -/** - * Enter type comment. - * - * @since: Feb 11, 2003 - */ -public class SetAutoSolibActionDelegate implements IViewActionDelegate, - ISelectionListener, - IPartListener -{ - private IViewPart fView = null; - private IAction fAction; - private IStatus fStatus = null; - - /** - * Constructor for SetAutoSolibActionDelegate. - */ - public SetAutoSolibActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) - */ - public void init( IViewPart view ) - { - fView = view; - view.getSite().getPage().addPartListener( this ); - view.getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) - { - update( getAction() ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( DebugUITools.getDebugContext() ); - setStatus( null ); - } - catch( DebugException e ) - { - setStatus( e.getStatus() ); - } - } - } ); - if ( getStatus() != null && !getStatus().isOK() ) - { - IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( getErrorDialogMessage(), getStatus() ); - } - else - { - CDebugUIPlugin.log( getStatus() ); - } - } - update( action ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - setAction( action ); - if ( getView() != null ) - { - update( action ); - } - } - - protected void update( IAction action ) - { - if ( action != null ) - { - IAdaptable element = DebugUITools.getDebugContext(); - action.setEnabled( getEnableStateForSelection( element ) ); - action.setChecked( getCheckStateForSelection( element ) ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart) - */ - public void partActivated( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart) - */ - public void partBroughtToTop( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart) - */ - public void partClosed( IWorkbenchPart part ) - { - if ( part.equals( getView() ) ) - { - dispose(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart) - */ - public void partDeactivated( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart) - */ - public void partOpened( IWorkbenchPart part ) - { - } - - protected IViewPart getView() - { - return fView; - } - - protected void setView( IViewPart viewPart ) - { - fView = viewPart; - } - - protected void setAction( IAction action ) - { - fAction = action; - } - - protected IAction getAction() - { - return fAction; - } - - protected void dispose() - { - if ( getView() != null ) - { - getView().getViewSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - getView().getViewSite().getPage().removePartListener( this ); - } - } - - protected boolean getCheckStateForSelection( IAdaptable element ) - { - SharedLibraryManager slm = getSharedLibraryManager( element ); - if ( slm != null ) - { - try - { - return slm.isAutoLoadSymbols(); - } - catch( CDIException e ) - { - } - } - return false; - } - - protected boolean getEnableStateForSelection( IAdaptable element ) - { - return ( element instanceof IDebugElement && - ((IDebugElement)element).getDebugTarget().isSuspended() && - getSharedLibraryManager( element ) != null ); - } - - protected String getStatusMessage() - { - return "Exceptions occurred attempting to set 'Automaticaly Load Symbols' mode."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogMessage() - */ - protected String getErrorDialogMessage() - { - return "Set 'Automatically Load Symbols' mode failed."; - } - - protected void setStatus( IStatus status ) - { - fStatus = status; - } - - protected IStatus getStatus() - { - return fStatus; - } - - protected void doAction( IAdaptable element ) throws DebugException - { - if ( getView() == null ) - return; - SharedLibraryManager slm = getSharedLibraryManager( element ); - if ( slm != null && getAction() != null ) - { - try - { - slm.setAutoLoadSymbols( getAction().isChecked() ); - } - catch( CDIException e ) - { - getAction().setChecked( !getAction().isChecked() ); - throw new DebugException( new Status( IStatus.ERROR, - MIPlugin.getUniqueIdentifier(), - DebugException.TARGET_REQUEST_FAILED, - e.getMessage(), - null ) ); - } - } - } - - private SharedLibraryManager getSharedLibraryManager( IAdaptable element ) - { - if ( element != null ) - { - ICDISession session = (ICDISession)element.getAdapter( ICDISession.class ); - if ( session instanceof Session && ((Session)session).getSharedLibraryManager() instanceof SharedLibraryManager ) - return (SharedLibraryManager)((Session)session).getSharedLibraryManager(); - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/CheckedListDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/CheckedListDialogField.java deleted file mode 100644 index c69739cdc65..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/CheckedListDialogField.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Table; - -/** - * A list with checkboxes and a button bar. Typical buttons are 'Check All' and 'Uncheck All'. - * List model is independend of widget creation. - * DialogFields controls are: Label, List and Composite containing buttons. - */ -public class CheckedListDialogField extends ListDialogField { - - private int fCheckAllButtonIndex; - private int fUncheckAllButtonIndex; - - private List fCheckElements; - - public CheckedListDialogField(IListAdapter adapter, String[] customButtonLabels, ILabelProvider lprovider) { - super(adapter, customButtonLabels, lprovider); - fCheckElements= new ArrayList(); - - fCheckAllButtonIndex= -1; - fUncheckAllButtonIndex= -1; - } - - /** - * Sets the index of the 'check' button in the button label array passed in the constructor. - * The behaviour of the button marked as the check button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setCheckAllButtonIndex(int checkButtonIndex) { - Assert.isTrue(checkButtonIndex < fButtonLabels.length); - fCheckAllButtonIndex= checkButtonIndex; - } - - /** - * Sets the index of the 'uncheck' button in the button label array passed in the constructor. - * The behaviour of the button marked as the uncheck button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setUncheckAllButtonIndex(int uncheckButtonIndex) { - Assert.isTrue(uncheckButtonIndex < fButtonLabels.length); - fUncheckAllButtonIndex= uncheckButtonIndex; - } - - - /* - * @see ListDialogField#createTableViewer - */ - protected TableViewer createTableViewer(Composite parent) { - Table table= new Table(parent, SWT.CHECK + getListStyle()); - CheckboxTableViewer tableViewer= new CheckboxTableViewer(table); - tableViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent e) { - doCheckStateChanged(e); - } - }); - return tableViewer; - } - - - /* - * @see ListDialogField#getListControl - */ - public Control getListControl(Composite parent) { - Control control= super.getListControl(parent); - if (parent != null) { - ((CheckboxTableViewer)fTable).setCheckedElements(fCheckElements.toArray()); - } - return control; - } - - /* - * @see DialogField#dialogFieldChanged - * Hooks in to get element changes to update check model. - */ - public void dialogFieldChanged() { - for (int i= fCheckElements.size() -1; i >= 0; i--) { - if (!fElements.contains(fCheckElements.get(i))) { - fCheckElements.remove(i); - } - } - super.dialogFieldChanged(); - } - - private void checkStateChanged() { - //call super and do not update check model - super.dialogFieldChanged(); - } - - /** - * Gets the checked elements. - */ - public List getCheckedElements() { - return new ArrayList(fCheckElements); - } - - /** - * Returns true if the element is checked. - */ - public boolean isChecked(Object obj) { - return fCheckElements.contains(obj); - } - - /** - * Sets the checked elements. - */ - public void setCheckedElements(List list) { - fCheckElements= new ArrayList(list); - if (fTable != null) { - ((CheckboxTableViewer)fTable).setCheckedElements(list.toArray()); - } - checkStateChanged(); - } - - /** - * Sets the checked state of an element. - */ - public void setChecked(Object object, boolean state) { - setCheckedWithoutUpdate(object, state); - checkStateChanged(); - } - - /** - * Sets the checked state of an element. no dialog changed listener informed - */ - public void setCheckedWithoutUpdate(Object object, boolean state) { - if (state) { - if (!fCheckElements.contains(object)) { - fCheckElements.add(object); - } - } - else { - if (fCheckElements.contains(object)) { - fCheckElements.remove(object); - } - } - if (fTable != null) { - ((CheckboxTableViewer)fTable).setChecked(object, state); - } - } - - /** - * Sets the check state of all elements - */ - public void checkAll(boolean state) { - if (state) { - fCheckElements= getElements(); - } else { - fCheckElements.clear(); - } - if (fTable != null) { - ((CheckboxTableViewer)fTable).setAllChecked(state); - } - checkStateChanged(); - } - - - protected void doCheckStateChanged(CheckStateChangedEvent e) { - if (e.getChecked()) { - fCheckElements.add(e.getElement()); - } else { - fCheckElements.remove(e.getElement()); - } - checkStateChanged(); - } - - // ------ enable / disable management - - /* - * @see ListDialogField#getManagedButtonState - */ - protected boolean getManagedButtonState(ISelection sel, int index) { - if (index == fCheckAllButtonIndex) { - return !fElements.isEmpty(); - } else if (index == fUncheckAllButtonIndex) { - return !fElements.isEmpty(); - } - return super.getManagedButtonState(sel, index); - } - - /* - * @see ListDialogField#extraButtonPressed - */ - protected boolean managedButtonPressed(int index) { - if (index == fCheckAllButtonIndex) { - checkAll(true); - } else if (index == fUncheckAllButtonIndex) { - checkAll(false); - } else { - return super.managedButtonPressed(index); - } - return true; - } - - - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ComboDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ComboDialogField.java deleted file mode 100644 index dcb05b64e57..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ComboDialogField.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field containing a label and a combo control. - */ -public class ComboDialogField extends DialogField { - - private String fText; - private int fSelectionIndex; - private String[] fItems; - private Combo fComboControl; - private ModifyListener fModifyListener; - private int fFlags; - - public ComboDialogField(int flags) { - super(); - fText= ""; //$NON-NLS-1$ - fItems= new String[0]; - fFlags= flags; - fSelectionIndex= -1; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Combo combo= getComboControl(parent); - combo.setLayoutData(gridDataForCombo(nColumns - 1)); - - return new Control[] { label, combo }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 2; - } - - protected static GridData gridDataForCombo(int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - return gd; - } - - // ------- focus methods - - /* - * @see DialogField#setFocus - */ - public boolean setFocus() { - if (isOkToUse(fComboControl)) { - fComboControl.setFocus(); - } - return true; - } - - // ------- ui creation - - /** - * Creates or returns the created combo control. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Combo getComboControl(Composite parent) { - if (fComboControl == null) { - assertCompositeNotNull(parent); - fModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - doModifyText(e); - } - }; - SelectionListener selectionListener= new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - doSelectionChanged(e); - } - - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - fComboControl= new Combo(parent, fFlags); - // moved up due to 1GEUNW2 - fComboControl.setItems(fItems); - if (fSelectionIndex != -1) { - fComboControl.select(fSelectionIndex); - } else { - fComboControl.setText(fText); - } - fComboControl.setFont(parent.getFont()); - fComboControl.addModifyListener(fModifyListener); - fComboControl.addSelectionListener(selectionListener); - fComboControl.setEnabled(isEnabled()); - } - return fComboControl; - } - - protected void doModifyText(ModifyEvent e) { - if (isOkToUse(fComboControl)) { - fText= fComboControl.getText(); - fSelectionIndex= fComboControl.getSelectionIndex(); - } - dialogFieldChanged(); - } - - protected void doSelectionChanged(SelectionEvent e) { - if (isOkToUse(fComboControl)) { - fItems= fComboControl.getItems(); - fText= fComboControl.getText(); - fSelectionIndex= fComboControl.getSelectionIndex(); - } - dialogFieldChanged(); - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fComboControl)) { - fComboControl.setEnabled(isEnabled()); - } - } - - // ------ text access - - /** - * Gets the combo items. - */ - public String[] getItems() { - return fItems; - } - - /** - * Sets the combo items. Triggers a dialog-changed event. - */ - public void setItems(String[] items) { - fItems= items; - if (isOkToUse(fComboControl)) { - fComboControl.setItems(items); - } - dialogFieldChanged(); - } - - /** - * Gets the text. - */ - public String getText() { - return fText; - } - - /** - * Sets the text. Triggers a dialog-changed event. - */ - public void setText(String text) { - fText= text; - if (isOkToUse(fComboControl)) { - fComboControl.setText(text); - } else { - dialogFieldChanged(); - } - } - - /** - * Selects an item. - */ - public void selectItem(int index) { - if (isOkToUse(fComboControl)) { - fComboControl.select(index); - } else { - if (index >= 0 && index < fItems.length) { - fText= fItems[index]; - fSelectionIndex= index; - } - } - dialogFieldChanged(); - } - - public int getSelectionIndex() { - return fSelectionIndex; - } - - - /** - * Sets the text without triggering a dialog-changed event. - */ - public void setTextWithoutUpdate(String text) { - fText= text; - if (isOkToUse(fComboControl)) { - fComboControl.removeModifyListener(fModifyListener); - fComboControl.setText(text); - fComboControl.addModifyListener(fModifyListener); - } - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/DialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/DialogField.java deleted file mode 100644 index e5f47d91937..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/DialogField.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; - -/** - * Base class of all dialog fields. - * Dialog fields manage controls together with the model, independed - * from the creation time of the widgets. - * - support for automated layouting. - * - enable / disable, set focus a concept of the base class. - * - * DialogField have a label. - */ -public class DialogField { - - private Label fLabel; - protected String fLabelText; - - private IDialogFieldListener fDialogFieldListener; - - private boolean fEnabled; - - public DialogField() { - fEnabled= true; - fLabel= null; - fLabelText= ""; //$NON-NLS-1$ - } - - /** - * Sets the label of the dialog field. - */ - public void setLabelText(String labeltext) { - fLabelText= labeltext; - } - - // ------ change listener - - /** - * Defines the listener for this dialog field. - */ - public final void setDialogFieldListener(IDialogFieldListener listener) { - fDialogFieldListener= listener; - } - - /** - * Programatical invocation of a dialog field change. - */ - public void dialogFieldChanged() { - if (fDialogFieldListener != null) { - fDialogFieldListener.dialogFieldChanged(this); - } - } - - // ------- focus management - - /** - * Tries to set the focus to the dialog field. - * Returns true if the dialog field can take focus. - * To be reimplemented by dialog field implementors. - */ - public boolean setFocus() { - return false; - } - - /** - * Posts setFocus to the display event queue. - */ - public void postSetFocusOnDialogField(Display display) { - if (display != null) { - display.asyncExec( - new Runnable() { - public void run() { - setFocus(); - } - } - ); - } - } - - // ------- layout helpers - - /** - * Creates all controls of the dialog field and fills it to a composite. - * The composite is assumed to have MGridLayout as - * layout. - * The dialog field will adjust its controls' spans to the number of columns given. - * To be reimplemented by dialog field implementors. - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(nColumns)); - - return new Control[] { label }; - } - - /** - * Returns the number of columns of the dialog field. - * To be reimplemented by dialog field implementors. - */ - public int getNumberOfControls() { - return 1; - } - - protected static GridData gridDataForLabel(int span) { - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= span; - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created label widget. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Label getLabelControl(Composite parent) { - if (fLabel == null) { - assertCompositeNotNull(parent); - - fLabel= new Label(parent, SWT.LEFT | SWT.WRAP); - fLabel.setFont(parent.getFont()); - fLabel.setEnabled(fEnabled); - if (fLabelText != null && !"".equals(fLabelText)) { //$NON-NLS-1$ - fLabel.setText(fLabelText); - } else { - // XXX: to avoid a 16 pixel wide empty label - revisit - fLabel.setText("."); //$NON-NLS-1$ - fLabel.setVisible(false); - } - } - return fLabel; - } - - /** - * Creates a spacer control. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent) { - return createEmptySpace(parent, 1); - } - - /** - * Creates a spacer control with the given span. - * The composite is assumed to have MGridLayout as - * layout. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent, int span) { - Label label= new Label(parent, SWT.LEFT); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.BEGINNING; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.horizontalIndent= 0; - gd.widthHint= 0; - gd.heightHint= 0; - label.setLayoutData(gd); - return label; - } - - /** - * Tests is the control is not null and not disposed. - */ - protected final boolean isOkToUse(Control control) { - return (control != null) && !(control.isDisposed()); - } - - // --------- enable / disable management - - /** - * Sets the enable state of the dialog field. - */ - public final void setEnabled(boolean enabled) { - if (enabled != fEnabled) { - fEnabled= enabled; - updateEnableState(); - } - } - - /** - * Called when the enable state changed. - * To be extended by dialog field implementors. - */ - protected void updateEnableState() { - if (fLabel != null) { - fLabel.setEnabled(fEnabled); - } - } - - /** - * Gets the enable state of the dialog field. - */ - public final boolean isEnabled() { - return fEnabled; - } - - protected final void assertCompositeNotNull(Composite comp) { - Assert.isNotNull(comp, "uncreated control requested with composite null"); //$NON-NLS-1$ - } - - protected final void assertEnoughColumns(int nColumns) { - Assert.isTrue(nColumns >= getNumberOfControls(), "given number of columns is too small"); //$NON-NLS-1$ - } - - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IDialogFieldListener.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IDialogFieldListener.java deleted file mode 100644 index 4c1b5add25b..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IDialogFieldListener.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -/** - * Change listener used by DialogField - */ -public interface IDialogFieldListener { - - /** - * The dialog field has changed. - */ - void dialogFieldChanged(DialogField field); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IListAdapter.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IListAdapter.java deleted file mode 100644 index f0138e2ae0a..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IListAdapter.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -/** - * Change listener used by ListDialogField and CheckedListDialogField - */ -public interface IListAdapter { - - /** - * A button from the button bar has been pressed. - */ - void customButtonPressed(DialogField field, int index); - - /** - * The selection of the list has changed. - */ - void selectionChanged(DialogField field); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IStringButtonAdapter.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IStringButtonAdapter.java deleted file mode 100644 index f397ec8c840..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/IStringButtonAdapter.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -/** - * Change listener used by StringButtonDialogField - */ -public interface IStringButtonAdapter { - - void changeControlPressed(DialogField field); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/LayoutUtil.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/LayoutUtil.java deleted file mode 100644 index 61892ea68cc..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/LayoutUtil.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -public class LayoutUtil { - - /** - * Calculates the number of columns needed by field editors - */ - public static int getNumberOfColumns(DialogField[] editors) { - int nCulumns= 0; - for (int i= 0; i < editors.length; i++) { - nCulumns= Math.max(editors[i].getNumberOfControls(), nCulumns); - } - return nCulumns; - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop) { - doDefaultLayout(parent, editors, labelOnTop, 0, 0, 0, 0); - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - * @param minWidth The minimal width of the composite - * @param minHeight The minimal height of the composite - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int minWidth, int minHeight) { - doDefaultLayout(parent, editors, labelOnTop, minWidth, minHeight, 0, 0); - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - * @param minWidth The minimal width of the composite - * @param minHeight The minimal height of the composite - * @param marginWidth The margin width to be used by the composite - * @param marginHeight The margin height to be used by the composite - * @deprecated - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int minWidth, int minHeight, int marginWidth, int marginHeight) { - int nCulumns= getNumberOfColumns(editors); - Control[][] controls= new Control[editors.length][]; - for (int i= 0; i < editors.length; i++) { - controls[i]= editors[i].doFillIntoGrid(parent, nCulumns); - } - if (labelOnTop) { - nCulumns--; - modifyLabelSpans(controls, nCulumns); - } - GridLayout layout= new GridLayout(); - if (marginWidth != SWT.DEFAULT) { - layout.marginWidth= marginWidth; - } - if (marginHeight != SWT.DEFAULT) { - layout.marginHeight= marginHeight; - } - layout.numColumns= nCulumns; - parent.setLayout(layout); - } - - private static void modifyLabelSpans(Control[][] controls, int nCulumns) { - for (int i= 0; i < controls.length; i++) { - setHorizontalSpan(controls[i][0], nCulumns); - } - } - - /** - * Sets the span of a control. Assumes that GridData is used. - */ - public static void setHorizontalSpan(Control control, int span) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).horizontalSpan= span; - } else if (span != 1) { - GridData gd= new GridData(); - gd.horizontalSpan= span; - control.setLayoutData(gd); - } - } - - /** - * Sets the width hint of a control. Assumes that GridData is used. - */ - public static void setWidthHint(Control control, int widthHint) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).widthHint= widthHint; - } - } - - /** - * Sets the heigthHint hint of a control. Assumes that GridData is used. - */ - public static void setHeigthHint(Control control, int heigthHint) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).heightHint= heigthHint; - } - } - - /** - * Sets the horizontal indent of a control. Assumes that GridData is used. - */ - public static void setHorizontalIndent(Control control, int horizontalIndent) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).horizontalIndent= horizontalIndent; - } - } - - /** - * Sets the horizontal indent of a control. Assumes that GridData is used. - */ - public static void setHorizontalGrabbing(Control control) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).grabExcessHorizontalSpace= true; - } - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ListDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ListDialogField.java deleted file mode 100644 index 67609c9b590..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/ListDialogField.java +++ /dev/null @@ -1,767 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Table; - -/** - * A list with a button bar. - * Typical buttons are 'Add', 'Remove', 'Up' and 'Down'. - * List model is independend of widget creation. - * DialogFields controls are: Label, List and Composite containing buttons. - */ -public class ListDialogField extends DialogField { - - protected TableViewer fTable; - protected ILabelProvider fLabelProvider; - protected ListViewerAdapter fListViewerAdapter; - protected List fElements; - protected ViewerSorter fViewerSorter; - - protected String[] fButtonLabels; - private Button[] fButtonControls; - - private boolean[] fButtonsEnabled; - - private int fRemoveButtonIndex; - private int fUpButtonIndex; - private int fDownButtonIndex; - - private Label fLastSeparator; - - protected Table fTableControl; - private Composite fButtonsControl; - private ISelection fSelectionWhenEnabled; - - private IListAdapter fListAdapter; - - private Object fParentElement; - - /** - * Creates the ListDialogField. - * @param adapter A listener for button invocation, selection changes. - * @param buttonLabels The labels of all buttons: null is a valid array entry and - * marks a separator. - * @param lprovider The label provider to render the table entries - */ - public ListDialogField(IListAdapter adapter, String[] buttonLabels, ILabelProvider lprovider) { - super(); - fListAdapter= adapter; - - fLabelProvider= lprovider; - fListViewerAdapter= new ListViewerAdapter(); - fParentElement= this; - - fElements= new ArrayList(10); - - fButtonLabels= buttonLabels; - if (fButtonLabels != null) { - int nButtons= fButtonLabels.length; - fButtonsEnabled= new boolean[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtonsEnabled[i]= true; - } - } - - fTable= null; - fTableControl= null; - fButtonsControl= null; - - fRemoveButtonIndex= -1; - fUpButtonIndex= -1; - fDownButtonIndex= -1; - } - - /** - * Sets the index of the 'remove' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'remove' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setRemoveButtonIndex(int removeButtonIndex) { - Assert.isTrue(removeButtonIndex < fButtonLabels.length); - fRemoveButtonIndex= removeButtonIndex; - } - - /** - * Sets the index of the 'up' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'up' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setUpButtonIndex(int upButtonIndex) { - Assert.isTrue(upButtonIndex < fButtonLabels.length); - fUpButtonIndex= upButtonIndex; - } - - /** - * Sets the index of the 'down' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'down' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setDownButtonIndex(int downButtonIndex) { - Assert.isTrue(downButtonIndex < fButtonLabels.length); - fDownButtonIndex= downButtonIndex; - } - - /** - * Sets the viewerSorter. - * @param viewerSorter The viewerSorter to set - */ - public void setViewerSorter(ViewerSorter viewerSorter) { - fViewerSorter= viewerSorter; - } - - // ------ adapter communication - - private void buttonPressed(int index) { - if (!managedButtonPressed(index)) { - fListAdapter.customButtonPressed(this, index); - } - } - - /** - * Checks if the button pressed is handled internally - * @return Returns true if button has been handled. - */ - protected boolean managedButtonPressed(int index) { - if (index == fRemoveButtonIndex) { - remove(); - } else if (index == fUpButtonIndex) { - up(); - } else if (index == fDownButtonIndex) { - down(); - } else { - return false; - } - return true; - } - - - // ------ layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - PixelConverter converter= new PixelConverter(parent); - - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - GridData gd= gridDataForLabel(1); - gd.verticalAlignment= GridData.BEGINNING; - label.setLayoutData(gd); - - Control list= getListControl(parent); - gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.verticalAlignment= GridData.FILL; - gd.grabExcessVerticalSpace= true; - gd.horizontalSpan= nColumns - 2; - gd.widthHint= converter.convertWidthInCharsToPixels(50); - gd.heightHint= converter.convertHeightInCharsToPixels(6); - - list.setLayoutData(gd); - - Composite buttons= getButtonBox(parent); - gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.verticalAlignment= GridData.FILL; - gd.grabExcessVerticalSpace= true; - gd.horizontalSpan= 1; - buttons.setLayoutData(gd); - - return new Control[] { label, list, buttons }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 3; - } - - /** - * Sets the minimal width of the buttons. Must be called after widget creation. - */ - public void setButtonsMinWidth(int minWidth) { - if (fLastSeparator != null) { - ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; - } - } - - - // ------ ui creation - - /** - * Returns the list control. When called the first time, the control will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Control getListControl(Composite parent) { - if (fTableControl == null) { - assertCompositeNotNull(parent); - - fTable= createTableViewer(parent); - fTable.setContentProvider(fListViewerAdapter); - fTable.setLabelProvider(fLabelProvider); - fTable.addSelectionChangedListener(fListViewerAdapter); - - fTableControl= (Table)fTable.getControl(); - - fTable.setInput(fParentElement); - - if (fViewerSorter != null) { - fTable.setSorter(fViewerSorter); - } - - fTableControl.setEnabled(isEnabled()); - if (fSelectionWhenEnabled != null) { - postSetSelection(fSelectionWhenEnabled); - } - } - return fTableControl; - } - - /** - * Returns the internally used table viewer. - */ - public TableViewer getTableViewer() { - return fTable; - } - - /* - * Subclasses may override to specify a different style. - */ - protected int getListStyle(){ - return SWT.BORDER + SWT.MULTI + SWT.H_SCROLL + SWT.V_SCROLL; - } - - protected TableViewer createTableViewer(Composite parent) { - Table table= new Table(parent, getListStyle()); - return new TableViewer(table); - } - - protected Button createButton(Composite parent, String label, SelectionListener listener) { - Button button= new Button(parent, SWT.PUSH); - button.setText(label); - button.addSelectionListener(listener); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= true; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - - button.setLayoutData(gd); - return button; - } - - private Label createSeparator(Composite parent) { - Label separator= new Label(parent, SWT.NONE); - separator.setVisible(false); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint= 4; - separator.setLayoutData(gd); - return separator; - } - - /** - * Returns the composite containing the buttons. When called the first time, the control - * will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Composite getButtonBox(Composite parent) { - if (fButtonsControl == null) { - assertCompositeNotNull(parent); - - SelectionListener listener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doButtonSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doButtonSelected(e); - } - }; - - Composite contents= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - layout.marginWidth= 0; - layout.marginHeight= 0; - contents.setLayout(layout); - - if (fButtonLabels != null) { - fButtonControls= new Button[fButtonLabels.length]; - for (int i= 0; i < fButtonLabels.length; i++) { - String currLabel= fButtonLabels[i]; - if (currLabel != null) { - fButtonControls[i]= createButton(contents, currLabel, listener); - fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]); - } else { - fButtonControls[i]= null; - createSeparator(contents); - } - } - } - - fLastSeparator= createSeparator(contents); - - updateButtonState(); - fButtonsControl= contents; - } - - return fButtonsControl; - } - - protected void doButtonSelected(SelectionEvent e) { - if (fButtonControls != null) { - for (int i= 0; i < fButtonControls.length; i++) { - if (e.widget == fButtonControls[i]) { - buttonPressed(i); - return; - } - } - } - } - - // ------ enable / disable management - - /* - * @see DialogField#dialogFieldChanged - */ - public void dialogFieldChanged() { - super.dialogFieldChanged(); - updateButtonState(); - } - - /* - * Updates the enable state of the all buttons - */ - protected void updateButtonState() { - if (fButtonControls != null) { - ISelection sel= fTable.getSelection(); - for (int i= 0; i < fButtonControls.length; i++) { - Button button= fButtonControls[i]; - if (isOkToUse(button)) { - boolean extraState= getManagedButtonState(sel, i); - button.setEnabled(isEnabled() && extraState && fButtonsEnabled[i]); - } - } - } - } - - protected boolean getManagedButtonState(ISelection sel, int index) { - if (index == fRemoveButtonIndex) { - return !sel.isEmpty(); - } else if (index == fUpButtonIndex) { - return !sel.isEmpty() && canMoveUp(); - } else if (index == fDownButtonIndex) { - return !sel.isEmpty() && canMoveDown(); - } - return true; - } - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - - boolean enabled= isEnabled(); - if (isOkToUse(fTableControl)) { - if (!enabled) { - fSelectionWhenEnabled= fTable.getSelection(); - selectElements(null); - } else { - selectElements(fSelectionWhenEnabled); - fSelectionWhenEnabled= null; - } - fTableControl.setEnabled(enabled); - } - updateButtonState(); - } - - /** - * Sets a button enabled or disabled. - */ - public void enableButton(int index, boolean enable) { - if (fButtonsEnabled != null && index < fButtonsEnabled.length) { - fButtonsEnabled[index]= enable; - updateButtonState(); - } - } - - // ------ model access - - /** - * Sets the elements shown in the list. - */ - public void setElements(List elements) { - fElements= new ArrayList(elements); - if (fTable != null) { - fTable.refresh(); - } - dialogFieldChanged(); - } - - /** - * Gets the elements shown in the list. - * The list returned is a copy, so it can be modified by the user. - */ - public List getElements() { - return new ArrayList(fElements); - } - - /** - * Gets the elements shown at the given index. - */ - public Object getElement(int index) { - return fElements.get(index); - } - - /** - * Replace an element. - */ - public void replaceElement(Object oldElement, Object newElement) throws IllegalArgumentException { - int idx= fElements.indexOf(oldElement); - if (idx != -1) { - if (oldElement.equals(newElement) || fElements.contains(newElement)) { - return; - } - fElements.set(idx, newElement); - if (fTable != null) { - List selected= getSelectedElements(); - if (selected.remove(oldElement)) { - selected.add(newElement); - } - fTable.refresh(); - selectElements(new StructuredSelection(selected)); - } - dialogFieldChanged(); - } else { - throw new IllegalArgumentException(); - } - } - - /** - * Adds an element at the end of the list. - */ - public void addElement(Object element) { - if (fElements.contains(element)) { - return; - } - fElements.add(element); - if (fTable != null) { - fTable.add(element); - } - dialogFieldChanged(); - } - - /** - * Adds elements at the end of the list. - */ - public void addElements(List elements) { - int nElements= elements.size(); - - if (nElements > 0) { - // filter duplicated - ArrayList elementsToAdd= new ArrayList(nElements); - - for (int i= 0; i < nElements; i++) { - Object elem= elements.get(i); - if (!fElements.contains(elem)) { - elementsToAdd.add(elem); - } - } - fElements.addAll(elementsToAdd); - if (fTable != null) { - fTable.add(elementsToAdd.toArray()); - } - dialogFieldChanged(); - } - } - - /** - * Adds an element at a position. - */ - public void insertElementAt(Object element, int index) { - if (fElements.contains(element)) { - return; - } - fElements.add(index, element); - if (fTable != null) { - fTable.add(element); - } - - dialogFieldChanged(); - } - - - /** - * Adds an element at a position. - */ - public void removeAllElements() { - if (fElements.size() > 0) { - fElements.clear(); - if (fTable != null) { - fTable.refresh(); - } - dialogFieldChanged(); - } - } - - /** - * Removes an element from the list. - */ - public void removeElement(Object element) throws IllegalArgumentException { - if (fElements.remove(element)) { - if (fTable != null) { - fTable.remove(element); - } - dialogFieldChanged(); - } else { - throw new IllegalArgumentException(); - } - } - - /** - * Removes elements from the list. - */ - public void removeElements(List elements) { - if (elements.size() > 0) { - fElements.removeAll(elements); - if (fTable != null) { - fTable.remove(elements.toArray()); - } - dialogFieldChanged(); - } - } - - /** - * Gets the number of elements - */ - public int getSize() { - return fElements.size(); - } - - - public void selectElements(ISelection selection) { - fSelectionWhenEnabled= selection; - if (fTable != null) { - fTable.setSelection(selection, true); - } - } - - public void selectFirstElement() { - Object element= null; - if (fViewerSorter != null) { - Object[] arr= fElements.toArray(); - fViewerSorter.sort(fTable, arr); - if (arr.length > 0) { - element= arr[0]; - } - } else { - if (fElements.size() > 0) { - element= fElements.get(0); - } - } - if (element != null) { - selectElements(new StructuredSelection(element)); - } - } - - - public void postSetSelection(final ISelection selection) { - if (isOkToUse(fTableControl)) { - Display d= fTableControl.getDisplay(); - d.asyncExec(new Runnable() { - public void run() { - if (isOkToUse(fTableControl)) { - selectElements(selection); - } - } - }); - } - } - - /** - * Refreshes the table. - */ - public void refresh() { - fTable.refresh(); - } - - // ------- list maintenance - - private List moveUp(List elements, List move) { - int nElements= elements.size(); - List res= new ArrayList(nElements); - Object floating= null; - for (int i= 0; i < nElements; i++) { - Object curr= elements.get(i); - if (move.contains(curr)) { - res.add(curr); - } else { - if (floating != null) { - res.add(floating); - } - floating= curr; - } - } - if (floating != null) { - res.add(floating); - } - return res; - } - - private void moveUp(List toMoveUp) { - if (toMoveUp.size() > 0) { - setElements(moveUp(fElements, toMoveUp)); - fTable.reveal(toMoveUp.get(0)); - } - } - - private void moveDown(List toMoveDown) { - if (toMoveDown.size() > 0) { - setElements(reverse(moveUp(reverse(fElements), toMoveDown))); - fTable.reveal(toMoveDown.get(toMoveDown.size() - 1)); - } - } - - private List reverse(List p) { - List reverse= new ArrayList(p.size()); - for (int i= p.size()-1; i >= 0; i--) { - reverse.add(p.get(i)); - } - return reverse; - } - - - private void remove() { - removeElements(getSelectedElements()); - } - - private void up() { - moveUp(getSelectedElements()); - } - - private void down() { - moveDown(getSelectedElements()); - } - - private boolean canMoveUp() { - if (isOkToUse(fTableControl)) { - int[] indc= fTableControl.getSelectionIndices(); - for (int i= 0; i < indc.length; i++) { - if (indc[i] != i) { - return true; - } - } - } - return false; - } - - private boolean canMoveDown() { - if (isOkToUse(fTableControl)) { - int[] indc= fTableControl.getSelectionIndices(); - int k= fElements.size() - 1; - for (int i= indc.length - 1; i >= 0 ; i--, k--) { - if (indc[i] != k) { - return true; - } - } - } - return false; - } - - /** - * Returns the selected elements. - */ - public List getSelectedElements() { - List result= new ArrayList(); - if (fTable != null) { - ISelection selection= fTable.getSelection(); - if (selection instanceof IStructuredSelection) { - Iterator iter= ((IStructuredSelection)selection).iterator(); - while (iter.hasNext()) { - result.add(iter.next()); - } - } - } - return result; - } - - // ------- ListViewerAdapter - - private class ListViewerAdapter implements IStructuredContentProvider, ISelectionChangedListener { - - // ------- ITableContentProvider Interface ------------ - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // will never happen - } - - public boolean isDeleted(Object element) { - return false; - } - - public void dispose() { - } - - public Object[] getElements(Object obj) { - return fElements.toArray(); - } - - // ------- ISelectionChangedListener Interface ------------ - - public void selectionChanged(SelectionChangedEvent event) { - doListSelected(event); - } - - } - - - protected void doListSelected(SelectionChangedEvent event) { - updateButtonState(); - if (fListAdapter != null) { - fListAdapter.selectionChanged(this); - } - } - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogField.java deleted file mode 100644 index ceace7ac198..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogField.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * Dialog Field containing a single button: e.g. radio or checkbox button. - */ -public class SelectionButtonDialogField extends DialogField { - - private Button fButton; - private boolean fIsSelected; - private DialogField[] fAttachedDialogFields; - private int fButtonStyle; - - /** - * Creates a selection button. - * Allowed button styles: SWT.RADIO, SWT.CHECK, SWT.TOGGLE, SWT.PUSH - */ - public SelectionButtonDialogField(int buttonStyle) { - super(); - fIsSelected= false; - fAttachedDialogFields= null; - fButtonStyle= buttonStyle; - } - - /** - * Attaches a field to the selection state of the selection button. - * The attached field will be disabled if the selection button is not selected. - */ - public void attachDialogField(DialogField dialogField) { - attachDialogFields(new DialogField[] { dialogField }); - } - - /** - * Attaches fields to the selection state of the selection button. - * The attached fields will be disabled if the selection button is not selected. - */ - public void attachDialogFields(DialogField[] dialogFields) { - fAttachedDialogFields= dialogFields; - for (int i= 0; i < dialogFields.length; i++) { - dialogFields[i].setEnabled(fIsSelected); - } - } - - /** - * Returns true is teh gived field is attached to the selection button. - */ - public boolean isAttached(DialogField editor) { - if (fAttachedDialogFields != null) { - for (int i=0; i < fAttachedDialogFields.length; i++) { - if (fAttachedDialogFields[i] == editor) { - return true; - } - } - } - return false; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Button button= getSelectionButton(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns; - gd.horizontalAlignment= GridData.FILL; - if (fButtonStyle == SWT.PUSH) { - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - } - - button.setLayoutData(gd); - - return new Control[] { button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 1; - } - - // ------- ui creation - - /** - * Returns the selection button widget. When called the first time, the widget will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Button getSelectionButton(Composite group) { - if (fButton == null) { - assertCompositeNotNull(group); - - fButton= new Button(group, fButtonStyle); - fButton.setFont(group.getFont()); - fButton.setText(fLabelText); - fButton.setEnabled(isEnabled()); - fButton.setSelection(fIsSelected); - fButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doWidgetSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doWidgetSelected(e); - } - }); - } - return fButton; - } - - protected void doWidgetSelected(SelectionEvent e) { - if (isOkToUse(fButton)) { - changeValue(fButton.getSelection()); - } - } - - private void changeValue(boolean newState) { - if (fIsSelected != newState) { - fIsSelected= newState; - if (fAttachedDialogFields != null) { - boolean focusSet= false; - for (int i= 0; i < fAttachedDialogFields.length; i++) { - fAttachedDialogFields[i].setEnabled(fIsSelected); - if (fIsSelected && !focusSet) { - focusSet= fAttachedDialogFields[i].setFocus(); - } - } - } - dialogFieldChanged(); - } else if (fButtonStyle == SWT.PUSH) { - dialogFieldChanged(); - } - } - - // ------ model access - - /** - * Returns the selection state of the button. - */ - public boolean isSelected() { - return fIsSelected; - } - - /** - * Sets the selection state of the button. - */ - public void setSelection(boolean selected) { - changeValue(selected); - if (isOkToUse(fButton)) { - fButton.setSelection(selected); - } - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fButton)) { - fButton.setEnabled(isEnabled()); - } - } - - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java deleted file mode 100644 index d387dc4fb24..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field describing a group with buttons (Checkboxes, radio buttons..) - */ -public class SelectionButtonDialogFieldGroup extends DialogField { - - private Composite fButtonComposite; - - private Button[] fButtons; - private String[] fButtonNames; - private boolean[] fButtonsSelected; - private boolean[] fButtonsEnabled; - - private int fGroupBorderStyle; - private int fGroupNumberOfColumns; - private int fButtonsStyle; - - /** - * Creates a group without border. - */ - public SelectionButtonDialogFieldGroup(int buttonsStyle, String[] buttonNames, int nColumns) { - this(buttonsStyle, buttonNames, nColumns, SWT.NONE); - } - - - /** - * Creates a group with border (label in border). - * Accepted button styles are: SWT.RADIO, SWT.CHECK, SWT.TOGGLE - * For border styles see Group - */ - public SelectionButtonDialogFieldGroup(int buttonsStyle, String[] buttonNames, int nColumns, int borderStyle) { - super(); - - Assert.isTrue(buttonsStyle == SWT.RADIO || buttonsStyle == SWT.CHECK || buttonsStyle == SWT.TOGGLE); - fButtonNames= buttonNames; - - int nButtons= buttonNames.length; - fButtonsSelected= new boolean[nButtons]; - fButtonsEnabled= new boolean[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtonsSelected[i]= false; - fButtonsEnabled[i]= true; - } - if (fButtonsStyle == SWT.RADIO) { - fButtonsSelected[0]= true; - } - - fGroupBorderStyle= borderStyle; - fGroupNumberOfColumns= (nColumns <= 0) ? nButtons : nColumns; - - fButtonsStyle= buttonsStyle; - - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - if (fGroupBorderStyle == SWT.NONE) { - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - - Composite buttonsgroup= getSelectionButtonsGroup(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns - 1; - buttonsgroup.setLayoutData(gd); - - return new Control[] { label, buttonsgroup }; - } else { - Composite buttonsgroup= getSelectionButtonsGroup(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns; - buttonsgroup.setLayoutData(gd); - - return new Control[] { buttonsgroup }; - } - } - - /* - * @see DialogField#doFillIntoGrid - */ - public int getNumberOfControls() { - return (fGroupBorderStyle == SWT.NONE) ? 2 : 1; - } - - // ------- ui creation - - private Button createSelectionButton(int index, Composite group, SelectionListener listener) { - Button button= new Button(group, fButtonsStyle | SWT.LEFT); - button.setFont(group.getFont()); - button.setText(fButtonNames[index]); - button.setEnabled(isEnabled() && fButtonsEnabled[index]); - button.setSelection(fButtonsSelected[index]); - button.addSelectionListener(listener); - button.setLayoutData(new GridData()); - return button; - } - - /** - * Returns the group widget. When called the first time, the widget will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Composite getSelectionButtonsGroup(Composite parent) { - if (fButtonComposite == null) { - assertCompositeNotNull(parent); - - GridLayout layout= new GridLayout(); - layout.makeColumnsEqualWidth= true; - layout.numColumns= fGroupNumberOfColumns; - - if (fGroupBorderStyle != SWT.NONE) { - Group group= new Group(parent, fGroupBorderStyle); - if (fLabelText != null && fLabelText.length() > 0) { - group.setText(fLabelText); - } - fButtonComposite= group; - } else { - fButtonComposite= new Composite(parent, SWT.NULL); - layout.marginHeight= 0; - layout.marginWidth= 0; - } - - fButtonComposite.setLayout(layout); - - SelectionListener listener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doWidgetSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doWidgetSelected(e); - } - }; - int nButtons= fButtonNames.length; - fButtons= new Button[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtons[i]= createSelectionButton(i, fButtonComposite, listener); - } - int nRows= nButtons / fGroupNumberOfColumns; - int nFillElements= nRows * fGroupNumberOfColumns - nButtons; - for (int i= 0; i < nFillElements; i++) { - createEmptySpace(fButtonComposite); - } - } - return fButtonComposite; - } - - /** - * Returns a button from the group or null if not yet created. - */ - public Button getSelectionButton(int index) { - if (index >= 0 && index < fButtons.length) { - return fButtons[index]; - } - return null; - } - - protected void doWidgetSelected(SelectionEvent e) { - Button button= (Button)e.widget; - for (int i= 0; i < fButtons.length; i++) { - if (fButtons[i] == button) { - fButtonsSelected[i]= button.getSelection(); - dialogFieldChanged(); - return; - } - } - } - - // ------ model access - - /** - * Returns the selection state of a button contained in the group. - * @param The index of the button - */ - public boolean isSelected(int index) { - if (index >= 0 && index < fButtonsSelected.length) { - return fButtonsSelected[index]; - } - return false; - } - - /** - * Sets the selection state of a button contained in the group. - */ - public void setSelection(int index, boolean selected) { - if (index >= 0 && index < fButtonsSelected.length) { - if (fButtonsSelected[index] != selected) { - fButtonsSelected[index]= selected; - if (fButtons != null) { - Button button= fButtons[index]; - if (isOkToUse(button)) { - button.setSelection(selected); - } - } - } - } - } - - // ------ enable / disable management - - protected void updateEnableState() { - super.updateEnableState(); - if (fButtons != null) { - boolean enabled= isEnabled(); - for (int i= 0; i < fButtons.length; i++) { - Button button= fButtons[i]; - if (isOkToUse(button)) { - button.setEnabled(enabled && fButtonsEnabled[i]); - } - } - } - } - - /** - * Sets the enable state of a button contained in the group. - */ - public void enableSelectionButton(int index, boolean enable) { - if (index >= 0 && index < fButtonsEnabled.length) { - fButtonsEnabled[index]= enable; - if (fButtons != null) { - Button button= fButtons[index]; - if (isOkToUse(button)) { - button.setEnabled(isEnabled() && enable); - } - } - } - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/Separator.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/Separator.java deleted file mode 100644 index aa6de737d0e..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/Separator.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field describing a separator. - */ -public class Separator extends DialogField { - - private Label fSeparator; - private int fStyle; - - public Separator() { - this(SWT.NONE); - } - - /** - * @param style of the separator. See Label for possible - * styles. - */ - public Separator(int style) { - super(); - fStyle= style; - } - - // ------- layout helpers - - /** - * Creates the separator and fills it in a MGridLayout. - * @param height The heigth of the separator - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns, int height) { - assertEnoughColumns(nColumns); - - Control separator= getSeparator(parent); - separator.setLayoutData(gridDataForSeperator(nColumns, height)); - - return new Control[] { separator }; - } - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - return doFillIntoGrid(parent, nColumns, 4); - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 1; - } - - protected static GridData gridDataForSeperator(int span, int height) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint= height; - gd.horizontalSpan= span; - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created separator. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Control getSeparator(Composite parent) { - if (fSeparator == null) { - assertCompositeNotNull(parent); - fSeparator= new Label(parent, fStyle); - } - return fSeparator; - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonDialogField.java deleted file mode 100644 index 05b7d5ec8e7..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonDialogField.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Dialog field containing a label, text control and a button control. - */ -public class StringButtonDialogField extends StringDialogField { - - private Button fBrowseButton; - private String fBrowseButtonLabel; - private IStringButtonAdapter fStringButtonAdapter; - - private boolean fButtonEnabled; - - public StringButtonDialogField(IStringButtonAdapter adapter) { - super(); - fStringButtonAdapter= adapter; - fBrowseButtonLabel= "!Browse...!"; //$NON-NLS-1$ - fButtonEnabled= true; - } - - /** - * Sets the label of the button. - */ - public void setButtonLabel(String label) { - fBrowseButtonLabel= label; - } - - // ------ adapter communication - - /** - * Programmatical pressing of the button - */ - public void changeControlPressed() { - fStringButtonAdapter.changeControlPressed(this); - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 2)); - Button button= getChangeControl(parent); - button.setLayoutData(gridDataForButton(button, 1)); - - return new Control[] { label, text, button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 3; - } - - protected static GridData gridDataForButton(Button button, int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created buttom widget. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Button getChangeControl(Composite parent) { - if (fBrowseButton == null) { - assertCompositeNotNull(parent); - - fBrowseButton= new Button(parent, SWT.PUSH); - fBrowseButton.setText(fBrowseButtonLabel); - fBrowseButton.setEnabled(isEnabled() && fButtonEnabled); - fBrowseButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - changeControlPressed(); - } - public void widgetSelected(SelectionEvent e) { - changeControlPressed(); - } - }); - - } - return fBrowseButton; - } - - // ------ enable / disable management - - /** - * Sets the enable state of the button. - */ - public void enableButton(boolean enable) { - if (isOkToUse(fBrowseButton)) { - fBrowseButton.setEnabled(isEnabled() && enable); - } - fButtonEnabled= enable; - } - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fBrowseButton)) { - fBrowseButton.setEnabled(isEnabled() && fButtonEnabled); - } - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonStatusDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonStatusDialogField.java deleted file mode 100644 index 746d4c6b5c6..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringButtonStatusDialogField.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Dialog field containing a label, text control, status label and a button control. - * The status label can be either a image or text label, and can be usd to give - * additional information about the current element chosen. - */ -public class StringButtonStatusDialogField extends StringButtonDialogField { - - private Label fStatusLabelControl; - private Object fStatus; // String or ImageDescriptor - - private String fWidthHintString; - private int fWidthHint; - - public StringButtonStatusDialogField(IStringButtonAdapter adapter) { - super(adapter); - fStatus= null; - fWidthHintString= null; - fWidthHint= -1; - } - - // ------ set status - - /** - * Sets the status string. - */ - public void setStatus(String status) { - if (isOkToUse(fStatusLabelControl)) { - fStatusLabelControl.setText(status); - } - fStatus= status; - } - - /** - * Sets the status image. - * Caller is responsible to dispose image - */ - public void setStatus(Image image) { - if (isOkToUse(fStatusLabelControl)) { - if (image == null) { - fStatusLabelControl.setImage(null); - } else { - fStatusLabelControl.setImage(image); - } - } - fStatus= image; - } - - /** - * Sets the staus string hint of the status label. - * The string is used to calculate the size of the status label. - */ - public void setStatusWidthHint(String widthHintString) { - fWidthHintString= widthHintString; - fWidthHint= -1; - } - - /** - * Sets the width hint of the status label. - */ - public void setStatusWidthHint(int widthHint) { - fWidthHint= widthHint; - fWidthHintString= null; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 3)); - Label status= getStatusLabelControl(parent); - status.setLayoutData(gridDataForStatusLabel(parent, 1)); - Button button= getChangeControl(parent); - button.setLayoutData(gridDataForButton(button, 1)); - - return new Control[] { label, text, status, button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 4; - } - - protected GridData gridDataForStatusLabel(Control aControl, int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.BEGINNING; - gd.grabExcessHorizontalSpace= false; - gd.horizontalIndent= 0; - if (fWidthHintString != null) { - GC gc= new GC(aControl); - gd.widthHint= gc.textExtent(fWidthHintString).x; - gc.dispose(); - } else if (fWidthHint != -1) { - gd.widthHint= fWidthHint; - } else { - gd.widthHint= SWT.DEFAULT; - } - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created status label widget. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Label getStatusLabelControl(Composite parent) { - if (fStatusLabelControl == null) { - assertCompositeNotNull(parent); - fStatusLabelControl= new Label(parent, SWT.LEFT); - fStatusLabelControl.setFont(parent.getFont()); - fStatusLabelControl.setEnabled(isEnabled()); - if (fStatus instanceof Image) { - fStatusLabelControl.setImage((Image)fStatus); - } else if (fStatus instanceof String) { - fStatusLabelControl.setText((String)fStatus); - } else { - // must be null - } - } - return fStatusLabelControl; - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fStatusLabelControl)) { - fStatusLabelControl.setEnabled(isEnabled()); - } - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringDialogField.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringDialogField.java deleted file mode 100644 index 9db224a2de8..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/dialogfields/StringDialogField.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.mi.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Dialog field containing a label and a text control. - */ -public class StringDialogField extends DialogField { - - private String fText; - private Text fTextControl; - private ModifyListener fModifyListener; - - public StringDialogField() { - super(); - fText= ""; //$NON-NLS-1$ - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 1)); - - return new Control[] { label, text }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 2; - } - - protected static GridData gridDataForText(int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - return gd; - } - - // ------- focus methods - - /* - * @see DialogField#setFocus - */ - public boolean setFocus() { - if (isOkToUse(fTextControl)) { - fTextControl.setFocus(); - fTextControl.setSelection(0, fTextControl.getText().length()); - } - return true; - } - - // ------- ui creation - - /** - * Creates or returns the created text control. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Text getTextControl(Composite parent) { - if (fTextControl == null) { - assertCompositeNotNull(parent); - fModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - doModifyText(e); - } - }; - - fTextControl= new Text(parent, SWT.SINGLE | SWT.BORDER); - // moved up due to 1GEUNW2 - fTextControl.setText(fText); - fTextControl.setFont(parent.getFont()); - fTextControl.addModifyListener(fModifyListener); - - fTextControl.setEnabled(isEnabled()); - } - return fTextControl; - } - - protected void doModifyText(ModifyEvent e) { - if (isOkToUse(fTextControl)) { - fText= fTextControl.getText(); - } - dialogFieldChanged(); - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fTextControl)) { - fTextControl.setEnabled(isEnabled()); - } - } - - // ------ text access - - /** - * Gets the text. Can not be null - */ - public String getText() { - return fText; - } - - /** - * Sets the text. Triggers a dialog-changed event. - */ - public void setText(String text) { - fText= text; - if (isOkToUse(fTextControl)) { - fTextControl.setText(text); - } else { - dialogFieldChanged(); - } - } - - /** - * Sets the text without triggering a dialog-changed event. - */ - public void setTextWithoutUpdate(String text) { - fText= text; - if (isOkToUse(fTextControl)) { - fTextControl.removeModifyListener(fModifyListener); - fTextControl.setText(text); - fTextControl.addModifyListener(fModifyListener); - } - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java deleted file mode 100644 index 460b4c67532..00000000000 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/preferences/MIPreferencePage.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.mi.internal.ui.preferences; - -import java.text.MessageFormat; - -import org.eclipse.cdt.debug.mi.core.IMIConstants; -import org.eclipse.cdt.debug.mi.core.MIPlugin; -import org.eclipse.cdt.debug.mi.internal.ui.IMIHelpContextIds; -import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * Page for preferences that apply specifically to GDB MI. - * - * @since Oct 4, 2002 - */ -public class MIPreferencePage extends PreferencePage implements IWorkbenchPreferencePage -{ - // Debugger timeout preference widgets - IntegerFieldEditor fDebugTimeoutText; - - // Launch timeout preference widgets - IntegerFieldEditor fLaunchTimeoutText; - - /** - * Constructor for MIPreferencePage. - */ - public MIPreferencePage() - { - super(); - setPreferenceStore( MIUIPlugin.getDefault().getPreferenceStore() ); - setDescription( "General settings for GDB MI." ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite) - */ - protected Control createContents( Composite parent ) - { - WorkbenchHelp.setHelp( getControl(), IMIHelpContextIds.MI_PREFERENCE_PAGE ); - - //The main composite - Composite composite = new Composite( parent, SWT.NULL ); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout( layout ); - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.horizontalAlignment = GridData.FILL; - composite.setLayoutData( data ); - - createSpacer( composite, 1 ); - createCommunicationPreferences( composite ); - - setValues(); - - return composite; - } - - /** - * Creates composite group and sets the default layout data. - * - * @param parent the parent of the new composite - * @param numColumns the number of columns for the new composite - * @param labelText the text label of the new composite - * @return the newly-created composite - */ - private Composite createGroupComposite( Composite parent, int numColumns, String labelText ) - { - return ControlFactory.createGroup( parent, labelText, numColumns ); - } - - /** - * Set the values of the component widgets based on the - * values in the preference store - */ - private void setValues() - { - fDebugTimeoutText.setStringValue( new Integer( MIPlugin.getDefault().getPluginPreferences().getInt( IMIConstants.PREF_REQUEST_TIMEOUT ) ).toString() ); - fLaunchTimeoutText.setStringValue( new Integer( MIPlugin.getDefault().getPluginPreferences().getInt( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT ) ).toString() ); - } - - /** - * @see IPreferencePage#performOk() - */ - public boolean performOk() - { - storeValues(); - MIUIPlugin.getDefault().savePluginPreferences(); - MIPlugin.getDefault().savePluginPreferences(); - return true; - } - - /** - * Sets the default preferences. - * @see PreferencePage#performDefaults() - */ - protected void performDefaults() - { - setDefaultValues(); - super.performDefaults(); - } - - private void setDefaultValues() - { - fDebugTimeoutText.setStringValue( new Integer( IMIConstants.DEF_REQUEST_TIMEOUT ).toString() ); - fLaunchTimeoutText.setStringValue( new Integer( IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT ).toString() ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - protected void createSpacer( Composite composite, int columnSpan ) - { - Label label = new Label( composite, SWT.NONE ); - GridData gd = new GridData(); - gd.horizontalSpan = columnSpan; - label.setLayoutData( gd ); - } - - private void createCommunicationPreferences( Composite composite ) - { - Composite comp = createGroupComposite( composite, 1, "Communication" ); - //Add in an intermediate composite to allow for spacing - Composite spacingComposite = new Composite( comp, SWT.NONE ); - GridLayout layout = new GridLayout(); - spacingComposite.setLayout( layout ); - GridData data = new GridData(); - data.horizontalSpan = 2; - spacingComposite.setLayoutData( data ); - - fDebugTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_TIMEOUT, "&Debugger timeout (ms):", spacingComposite ); - fDebugTimeoutText.setPropertyChangeListener( - new IPropertyChangeListener() - { - public void propertyChange( PropertyChangeEvent event ) - { - if ( event.getProperty().equals( FieldEditor.IS_VALID ) ) - setValid( fDebugTimeoutText.isValid() ); - } - } ); - - fLaunchTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, "&Launch &timeout (ms):", spacingComposite ); - fLaunchTimeoutText.setPropertyChangeListener( - new IPropertyChangeListener() - { - public void propertyChange( PropertyChangeEvent event ) - { - if ( event.getProperty().equals( FieldEditor.IS_VALID ) ) - setValid( fLaunchTimeoutText.isValid() ); - } - } ); - } - - /** - * Store the preference values based on the state of the - * component widgets - */ - private void storeValues() - { - MIPlugin.getDefault().getPluginPreferences().setValue( IMIConstants.PREF_REQUEST_TIMEOUT, fDebugTimeoutText.getIntValue() ); - MIPlugin.getDefault().getPluginPreferences().setValue( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, fLaunchTimeoutText.getIntValue() ); - } - - private IntegerFieldEditor createTimeoutField( String preference, String label, Composite parent ) - { - IntegerFieldEditor toText = new IntegerFieldEditor( preference, label, parent ); - GridData data = new GridData(); - data.widthHint = convertWidthInCharsToPixels( 10 ); - toText.getTextControl( parent ).setLayoutData( data ); - toText.setPreferenceStore( MIUIPlugin.getDefault().getPreferenceStore() ); - toText.setPreferencePage( this ); - toText.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE ); - toText.setValidRange( IMIConstants.MIN_REQUEST_TIMEOUT, IMIConstants.MAX_REQUEST_TIMEOUT ); - String minValue = Integer.toString( IMIConstants.MIN_REQUEST_TIMEOUT ); - String maxValue = Integer.toString( IMIConstants.MAX_REQUEST_TIMEOUT ); - toText.setErrorMessage( MessageFormat.format( "The valid value range is [{0},{1}].", new String[]{ minValue, maxValue } ) ); - toText.load(); - return toText; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui.tests/.classpath b/debug/org.eclipse.cdt.debug.ui.tests/.classpath deleted file mode 100644 index d16b7548c1d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.ui.tests/.cvsignore b/debug/org.eclipse.cdt.debug.ui.tests/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/debug/org.eclipse.cdt.debug.ui.tests/.project b/debug/org.eclipse.cdt.debug.ui.tests/.project deleted file mode 100644 index bec51f088aa..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/.project +++ /dev/null @@ -1,31 +0,0 @@ - - - org.eclipse.cdt.debug.ui.tests - - - org.eclipse.cdt.core - org.eclipse.cdt.debug.core - org.eclipse.cdt.debug.mi.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/debug/org.eclipse.cdt.debug.ui.tests/Changelog b/debug/org.eclipse.cdt.debug.ui.tests/Changelog deleted file mode 100644 index 3276944b412..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/Changelog +++ /dev/null @@ -1,48 +0,0 @@ -2003-07-03 Peter Graves - - Major cleanup. Pulled all resouces out of the source tree, and fixed the - tests to get them from the new location. - Made sure the debug sessions were all terminated before we try to delete the - the projects (if the tests failed, the session would not be terminated, and - then we would not be able to remove the projects.) - Also updated the breakpoint tests to only create and build the test project - once per run, not once per test method. - -2003-04-04 Alain Magloire - - * src/org/eclipse/cdt/debug/testplugin/util/VeryfyDialog.java: - Get rig of some warnings. - -2003-03-27 Alain Magloire - - Adjust the code because of refactoring. - ICFolder and ICResource are removed. - -2003-01-29 Peter Graves - - Fixed warnings when accessing static methods - * src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java: - * src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java: - * src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java: - * ChangeLog: Make all the entries have the same formatting - -2003-01-22 Judy N. Green - - * /home/tools/org.eclipse.cdt.debug.ui.tests/.project - * /home/tools/org.eclipse.cdt.debug.ui.tests/.classpath - updated classpath and .project to reflect classpath changes. - -2003-01-21 Peter Graves - - * src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java: Updated to use new parameters to - ICDISession.createCSession - -2002-12-17 Peter Graves - - * plugin.xml,test.xml: Some simple cleanups to remove refrences to the jdt and - to move closer to automated running. - -2002-10-30 Alain Magloire - - * core/org/eclipse/cdt/debug/core/tests/TargetTests.java: Test number - 24183 is no longer valid, the method was remove from the CDI API. \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui.tests/about.html b/debug/org.eclipse.cdt.debug.ui.tests/about.html deleted file mode 100644 index fad1e4a429b..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/about.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            20th June, 2002

            -

            License

            -

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

            - -

            Third Party Content

            - -

            The Content includes items that may be have been sourced from third parties as follows:

            - -

            JUnit 3.7

            -

            The plug-in is based on software developed by JUnit.org. Your use of JUnit 3.7 in both source and binary code -form contained in the plug-in is subject to the terms and conditions of the IBM Public License 1.0 which is available at -http://oss.software.ibm.com/developerworks/opensource/license10.html. -The source code is located in testresources/junit37-noUI-src.zip.

            - -

            i) IBM effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;

            -

            ii) IBM effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;

            -

            iii) IBM states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui.tests/build.properties b/debug/org.eclipse.cdt.debug.ui.tests/build.properties deleted file mode 100644 index 2e02fcb8b3a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -source.cdtdebuguitests.jar = src/,\ - core/ -bin.includes = about.html,\ - plugin.xml,\ - resources/,\ - cdtdebuguitests.jar,\ - test.xml -src.includes = about.html,\ - plugin.xml,\ - test.xml diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java deleted file mode 100644 index 4831d0e5f64..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.cdt.debug.core.tests; -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - - -import junit.framework.Test; -import junit.framework.TestSuite; - - -/** - * - * AllDedbugTests.java - * This is the main entry point for running this suite of JUnit tests - * for all tests within the package "org.eclipse.cdt.debug.core" - * - * @author Judy N. Green - * @since Jul 19, 2002 - */ -public class AllDebugTests { - - public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); - } - - public static Test suite() { - TestSuite suite = new TestSuite(); - - // Just add more test cases here as you create them for - // each class being tested - - suite.addTest(DebugTests.suite()); - suite.addTest(BreakpointTests.suite()); - suite.addTest(LocationTests.suite()); - return suite; - - - } -} // End of AllDebugTests.java - diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java deleted file mode 100644 index f6256621f86..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java +++ /dev/null @@ -1,697 +0,0 @@ -package org.eclipse.cdt.debug.core.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; - -import junit.extensions.TestSetup; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDICondition; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.testplugin.CDebugHelper; -import org.eclipse.cdt.debug.testplugin.CProjectHelper; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -/** - * @author Peter Graves - * - * This file contains a set of generic tests for the CDI break point interfaces. - * It will currenly use the mi implementation. - * - */ -public class BreakpointTests extends TestCase { - IWorkspace workspace; - IWorkspaceRoot root; - static ICProject testProject=null; - NullProgressMonitor monitor; - static ICDISession session=null; - static ICDITarget targets[] = null; - - - /** - * Constructor for BreakpointTests - * @param name - */ - public BreakpointTests(String name) { - super(name); - /*** - * The tests assume that they have a working workspace - * and workspace root object to use to create projects/files in, - * so we need to get them setup first. - */ - workspace= ResourcesPlugin.getWorkspace(); - root= workspace.getRoot(); - monitor = new NullProgressMonitor(); - if (workspace==null) - fail("Workspace was not setup"); - if (root==null) - fail("Workspace root was not setup"); - - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected static void oneTimeSetUp() throws CoreException, InvocationTargetException, IOException { - ResourcesPlugin.getWorkspace().getDescription().setAutoBuilding(false); - /*** - * Create a new project and import the test source. - */ - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile(); - pluginRoot=pluginRoot+"resources/debugTest.zip"; - testProject=CProjectHelper.createCProjectWithImport("filetest", pluginRoot); - if (testProject==null) - fail("Unable to create project"); - /* Build the test project.. */ - - testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null); - } - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() throws CoreException { - if (targets!=null) { - try { - targets[0].terminate(); - targets=null; - } catch (CDIException e) {} - } - if (session!=null) { - try { - session.terminate(); - session=null; - } catch (CDIException e) {} - } - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected static void oneTimeTearDown() throws CoreException { - if (targets!=null) { - try { - targets[0].terminate(); - } catch (CDIException e) {} - } - if (session!=null) { - try { - session.terminate(); - } catch (CDIException e) {} - } - CProjectHelper.delete(testProject); - - } - - public static Test suite() { - TestSuite suite= new TestSuite(BreakpointTests.class); - /*** - * Create a wrapper suite around the test suite we created above to - * allow us to only do the general setup once for all the tests. This - * is needed because the creation of the source and target projects - * takes a long time and we really only need to do it once. We could - * do the setup in the constructor, but we need to be able to remove - * everything when we are done. - */ - TestSetup wrapper = new TestSetup(suite) { - - protected void setUp() throws FileNotFoundException, IOException, InterruptedException, InvocationTargetException, CoreException { - oneTimeSetUp(); - } - - protected void tearDown() throws FileNotFoundException, IOException, CoreException { - oneTimeTearDown(); - } - }; - return(wrapper); - } - - - - /*** - * A couple tests to make sure setting breakpoints on functions works as - * expected. - */ - public void testFunctionBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException { - ICDISession session; - ICDIBreakpointManager breaks; - ICDILocation location; - boolean caught=false; - session=CDebugHelper.createSession("main", testProject); - assertNotNull(session); - breaks=session.getBreakpointManager(); - assertNotNull(breaks); - - /********************************************************************** - * Create a break point on a generic function - **********************************************************************/ - - location=breaks.createLocation(null, "func1", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - /********************************************************************** - * Create a break point on main - **********************************************************************/ - - location=breaks.createLocation(null, "main", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - - /********************************************************************** - * Try to create a break point on a function name that does not exist - * We expect that this will cause the setLocationBreakpoint to throw - * a CDIException - **********************************************************************/ - - location=breaks.createLocation(null, "badname", 0); - assertNotNull(location); - try { - breaks.setLocationBreakpoint(0, location, null, null); - } catch (CDIException e) { - caught=true; - } - assertTrue(caught); - - breaks.deleteAllBreakpoints(); - - /********************************************************************** - * Create a break point on a generic function and see if it will - * get hit and stop program execution. - **********************************************************************/ - - location=breaks.createLocation(null, "func1", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - targets=session.getTargets(); - /* We better only have one target connected to this session or something - * is not right... - */ - assertTrue(targets.length==1); - /* Resume the target, this should cause it to run till it hits the - * breakpoint - */ - targets[0].resume(); - /** - * Give the process up to 10 seconds to become either terminated or - * suspended. It sould hit the breakponint almost immediatly so we - * should only sleep for max 100 ms - */ - for (int x=0;x<100;x++) { - if (targets[0].isTerminated() || targets[0].isSuspended()) - break; - Thread.sleep(100); - } - assertTrue(targets[0].isSuspended()); - location=targets[0].getCurrentThread().getStackFrames()[0].getLocation(); - assertTrue(location.getLineNumber()==6); - assertTrue(location.getFunction().equals("func1")); - assertTrue(location.getFile().equals("main.c")); - - /* clean up the session */ - targets[0].terminate(); - int x=0; - while ((!targets[0].isTerminated()) && (x<30)) { - Thread.sleep(100); - } - if (!targets[0].isTerminated()) - targets[0].terminate(); - session.terminate(); - session=null; - targets=null; - - - } - - /*** - * A couple tests to make sure setting breakpoints on line numbers works as - * expected. - */ - public void testLineBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException { - ICDIBreakpointManager breaks; - ICDILocation location; - boolean caught=false; - session=CDebugHelper.createSession("main", testProject); - assertNotNull(session); - breaks=session.getBreakpointManager(); - assertNotNull(breaks); - - /********************************************************************** - * Create a break point in a generic function - **********************************************************************/ - location=breaks.createLocation("main.c", null, 7); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - - /********************************************************************** - * Create a break point in main - **********************************************************************/ - location=breaks.createLocation("main.c", null, 18); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - - /********************************************************************** - * Try to create a break point on a line that does not exist - * We expect that this will cause the setLocationBreakpoint to throw - * a CDIException - **********************************************************************/ - - location=breaks.createLocation("main.c", null, 30); - assertNotNull(location); - try { - breaks.setLocationBreakpoint(0, location, null, null); - } catch (CDIException e) { - caught=true; - } - assertTrue(caught); - - caught=false; - /********************************************************************** - * Try to create a break point on a line that does not have code on it - **********************************************************************/ - - location=breaks.createLocation("main.c", null, 11); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - /********************************************************************** - * Create a break point in a generic function without passing the source - * file name. At the time of writing this would just silently fail, so - * to make sure it works, we will do it once with a valid line number - * and once with an invalid line number, and the first should always - * succeed and the second should always throw an exception. - **********************************************************************/ - location=breaks.createLocation(null, null, 7); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - caught=false; - location=breaks.createLocation(null, null, 30); - assertNotNull(location); - try { - breaks.setLocationBreakpoint(0, location, null, null); - } catch (CDIException e) { - caught=true; - } - assertTrue("Ignoring line numbers with no file specified?", caught); - - breaks.deleteAllBreakpoints(); - - /********************************************************************** - * Create a break point on a line number and see if it will - * get hit and stop program execution. - **********************************************************************/ - - location=breaks.createLocation(null, null, 7); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - targets=session.getTargets(); - /* We better only have one target connected to this session or something - * is not right... - */ - assertTrue(targets.length==1); - /* Resume the target, this should cause it to run till it hits the - * breakpoint - */ - targets[0].resume(); - /** - * Give the process up to 10 seconds to become either terminated or - * suspended. It sould hit the breakponint almost immediatly so we - * should only sleep for max 100 ms - */ - for (int x=0;x<100;x++) { - if (targets[0].isSuspended() || targets[0].isTerminated()) - break; - Thread.sleep(100); - } - assertTrue("Suspended: " + targets[0].isSuspended() + " Termiunated: " + targets[0].isTerminated(), targets[0].isSuspended()); - location=targets[0].getCurrentThread().getStackFrames()[0].getLocation(); - assertTrue(location.getLineNumber()==7); - assertTrue(location.getFunction().equals("func1")); - assertTrue(location.getFile().equals("main.c")); - - - /* clean up the session */ - session.terminate(); - session=null; - targets=null; - - } - /*** - * A couple tests to make sure getting breakpoints works as expected - */ - public void testGetBreak() throws CoreException, MIException, IOException, CDIException { - ICDIBreakpointManager breaks; - ICDILocation location; - ICDIBreakpoint[] breakpoints; - ICDILocationBreakpoint curbreak; - session=CDebugHelper.createSession("main", testProject); - assertNotNull(session); - breaks=session.getBreakpointManager(); - assertNotNull(breaks); - - /********************************************************************** - * Make sure initially we don't have any breakpoints - **********************************************************************/ - breakpoints=breaks.getBreakpoints(); - assertNotNull(breakpoints); - assertTrue(breakpoints.length==0); - - /********************************************************************** - * Make sure if we create a simple breakpoint, that we can get it back - * from the system - *********************************************************************/ - /* Create a break point on a generic function */ - location=breaks.createLocation("main.c", "func1", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - breakpoints=breaks.getBreakpoints(); - assertNotNull(breakpoints); - assertTrue(breakpoints.length==1); - if (breakpoints[0] instanceof ICDILocationBreakpoint) { - curbreak=(ICDILocationBreakpoint) breakpoints[0]; - } else - curbreak=null; - assertNotNull(curbreak); - - assertTrue(curbreak.getLocation().equals(location)); - - /********************************************************************** - * Make sure if we create multiple break points that we can still - * get them all back from the system, - **********************************************************************/ - /* Create another break point on main */ - location=breaks.createLocation("main.c", "main", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - breakpoints=breaks.getBreakpoints(); - assertNotNull(breakpoints); - assertTrue(breakpoints.length==2); - if (breakpoints[1] instanceof ICDILocationBreakpoint) { - curbreak=(ICDILocationBreakpoint) breakpoints[1]; - } else - curbreak=null; - assertNotNull(curbreak); - /* Make sure the location still looks like we expect it to.. - . */ - assertTrue(curbreak.getLocation().equals(location)); - - breaks.deleteAllBreakpoints(); - - - /* clean up the session */ - session.terminate(); - session=null; - - } - - /*** - * A couple tests to make sure deleting breakpoints works as expected - */ - public void testDelBreak() throws CoreException, MIException, IOException, CDIException { - ICDIBreakpointManager breaks; - ICDILocation location, savedLocation; - ICDIBreakpoint[] breakpoints, savedbreakpoints; - ICDILocationBreakpoint curbreak; - - session=CDebugHelper.createSession("main", testProject); - assertNotNull(session); - breaks=session.getBreakpointManager(); - assertNotNull(breaks); - - /* Make sure initially we don't have any breakpoints */ - breakpoints=breaks.getBreakpoints(); - assertNotNull(breakpoints); - assertTrue(breakpoints.length==0); - - /********************************************************************** - * - * Test to make sure if we create a new breakpoint, we can delete - * it by passing a refrence to it to deleteBreakpoint() - * - **********************************************************************/ - - /* Create a break point on a generic function */ - location=breaks.createLocation("main.c", "func1", 0); - assertNotNull(location); - curbreak=breaks.setLocationBreakpoint(0, location, null, null); - breaks.deleteBreakpoint(curbreak); - pause(); - /** - * we should not have any breakpoints left. - */ - breakpoints=breaks.getBreakpoints(); - assertTrue(breakpoints.length==0); - - /********************************************************************** - * - * Test to make sure if we create multiple new breakpoint, we can delete - * one of them by passing a refrence to it to deleteBreakpoint() - * - **********************************************************************/ - - /* Create a break point on a generic function */ - location=breaks.createLocation("main.c", "func1", 0); - assertNotNull(location); - curbreak=breaks.setLocationBreakpoint(0, location, null, null); - savedLocation=curbreak.getLocation(); - - location=breaks.createLocation("main.c", "main", 0); - assertNotNull(location); - curbreak=breaks.setLocationBreakpoint(0, location, null, null); - breaks.deleteBreakpoint(curbreak); - pause(); - breakpoints=breaks.getBreakpoints(); - /*** - * Make sure there is only 1 breakpoint left, and it's the one we expect - */ - assertTrue(breakpoints.length==1); - curbreak=(ICDILocationBreakpoint) breakpoints[0]; - assertNotNull(curbreak); - assertTrue(curbreak.getLocation().equals(savedLocation)); - /*** - * Then delete the other breakpoint. - */ - breaks.deleteBreakpoint(curbreak); - pause(); - breakpoints=breaks.getBreakpoints(); - assertTrue(breakpoints.length==0); - - /********************************************************************** - * Make sure deleteBreakpoints works when given 1 breakpoint to delete - **********************************************************************/ - savedbreakpoints= new ICDIBreakpoint[1]; - for (int x=0;x<10;x++) { - location=breaks.createLocation("main.c", null, x+1); - savedbreakpoints[0]=breaks.setLocationBreakpoint(0, location, null, null); - assertNotNull(savedbreakpoints[0]); - } - breaks.deleteBreakpoints(savedbreakpoints); - pause(); - /* We should now have 9 breakpoints left. */ - breakpoints=breaks.getBreakpoints(); - assertTrue(breakpoints.length==9); - /* Make sure we have the correct 9 breakpoints left */ - for (int x=0;x10"); - - breaks.setLocationBreakpoint(0, location, cond, null); - targets=session.getTargets(); - /* We better only have one target connected to this session or something - * is not right... - */ - assertTrue(targets.length==1); - /* Resume the target, this should cause it to run till it hits the - * breakpoint - */ - targets[0].resume(); - /** - * Give the process up to 10 seconds to become either terminated or - * suspended. It sould hit the breakponint almost immediatly so we - * should only sleep for max 100 ms - */ - for (int x=0;x<100;x++) { - if (targets[0].isSuspended() || targets[0].isTerminated()) - break; - Thread.sleep(100); - } - assertTrue("Suspended: " + targets[0].isSuspended() + " Termiunated: " + targets[0].isTerminated(), targets[0].isSuspended()); - location=targets[0].getCurrentThread().getStackFrames()[0].getLocation(); - assertTrue(location.getLineNumber()==23); - assertTrue(location.getFunction().equals("main")); - assertTrue(location.getFile().equals("main.c")); - /* Get the value of a and and make sure it is 11 */ - assertTrue(targets[0].evaluateExpressionToString("a"), - targets[0].evaluateExpressionToString("a").equals("11")); - - - /* clean up the session */ - session.terminate(); - session=null; - targets=null; - - } - void pause() { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - } - } - -} diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java deleted file mode 100644 index 1d41d21aa87..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java +++ /dev/null @@ -1,141 +0,0 @@ -package org.eclipse.cdt.debug.core.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.testplugin.CDebugHelper; -import org.eclipse.cdt.debug.testplugin.CProjectHelper; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -/** - * @author Peter Graves - * - * This file contains a set of generic tests for the debug stuff. It currenly - * uses the mi debugger. - * - */ -public class DebugTests extends TestCase { - IWorkspace workspace; - IWorkspaceRoot root; - ICProject testProject; - NullProgressMonitor monitor; - ICDISession session; - - - /** - * Constructor for DebugTests - * @param name - */ - public DebugTests(String name) { - super(name); - /*** - * The assume that they have a working workspace - * and workspace root object to use to create projects/files in, - * so we need to get them setup first. - */ - workspace= ResourcesPlugin.getWorkspace(); - root= workspace.getRoot(); - monitor = new NullProgressMonitor(); - if (workspace==null) - fail("Workspace was not setup"); - if (root==null) - fail("Workspace root was not setup"); - - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected void setUp() throws CoreException, InvocationTargetException, IOException { - ResourcesPlugin.getWorkspace().getDescription().setAutoBuilding(false); - /*** - * Create a new project and import the test source. - */ - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile(); - pluginRoot=pluginRoot+"resources/debugTest.zip"; - testProject=CProjectHelper.createCProjectWithImport("filetest", pluginRoot); - if (testProject==null) - fail("Unable to create project"); - /* Build the test project.. */ - - testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null); - - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() throws CoreException, CDIException { - if (session!=null) { - session.terminate(); - session=null; - } - CProjectHelper.delete(testProject); - } - - public static TestSuite suite() { - return new TestSuite(DebugTests.class); - } - - public static void main (String[] args){ - junit.textui.TestRunner.run(suite()); - } - - - /*** - * Can we setup a debug? - * This is sort of a catch all sanity tests to make sure we can create a debug - * session with a break point and start it without having any exceptions thrown. - * It's not ment to be a real proper test. - */ - public void testDebug() throws CoreException, MIException, IOException, CDIException { - ICDISourceManager source; - ICDIBreakpointManager breaks; - ICDILocation location; - - session=CDebugHelper.createSession("main",testProject); - assertNotNull(session); - source=session.getSourceManager(); - assertNotNull(source); - breaks=session.getBreakpointManager(); - assertNotNull(breaks); - location=breaks.createLocation(null, "func1", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - session.getCurrentTarget().resume(); - session.terminate(); - session=null; - - } - - -} diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java deleted file mode 100644 index 03594819ab6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.eclipse.cdt.debug.core.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager; -import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; -import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.testplugin.CDebugHelper; -import org.eclipse.cdt.debug.testplugin.CProjectHelper; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -/** - * @author Peter Graves - * - * This file contains a set of generic tests for the CDI Location interfaces. - * It will currenly use the mi implementation. - * - */ -public class LocationTests extends TestCase { - IWorkspace workspace; - IWorkspaceRoot root; - ICProject testProject; - NullProgressMonitor monitor; - ICDISession session; - - - /** - * Constructor for LocationTests - * @param name - */ - public LocationTests(String name) { - super(name); - /*** - * The assume that they have a working workspace - * and workspace root object to use to create projects/files in, - * so we need to get them setup first. - */ - workspace= ResourcesPlugin.getWorkspace(); - root= workspace.getRoot(); - monitor = new NullProgressMonitor(); - if (workspace==null) - fail("Workspace was not setup"); - if (root==null) - fail("Workspace root was not setup"); - - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected void setUp() throws CoreException, InvocationTargetException, IOException { - ResourcesPlugin.getWorkspace().getDescription().setAutoBuilding(false); - /*** - * Create a new project and import the test source. - */ - String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile(); - pluginRoot=pluginRoot+"resources/debugTest.zip"; - testProject=CProjectHelper.createCProjectWithImport("filetest", pluginRoot); - if (testProject==null) - fail("Unable to create project"); - /* Build the test project.. */ - - testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null); - - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() throws CoreException, CDIException { - if (session!=null) { - session.terminate(); - session=null; - } - CProjectHelper.delete(testProject); - } - - public static TestSuite suite() { - return new TestSuite(LocationTests.class); - } - - public static void main (String[] args){ - junit.textui.TestRunner.run(suite()); - } - - - /*** - * A couple tests to make sure comparing Locations works as expected. - */ - public void testIsEquals() throws CoreException, MIException, IOException, CDIException { - ICDIBreakpointManager breaks; - ICDILocation location, location2; - ICDIBreakpoint[] breakpoints; - ICDILocationBreakpoint curbreak; - session=CDebugHelper.createSession("main",testProject); - assertNotNull(session); - breaks=session.getBreakpointManager(); - assertNotNull(breaks); - - /********************************************************************** - * Simple test.. this should work. - **********************************************************************/ - location=breaks.createLocation("main.c", "func1", 0); - location2=breaks.createLocation("main.c", "func1", 0); - assertTrue(location.equals(location2)); - /********************************************************************** - * Simple test.. this should work. - **********************************************************************/ - location=breaks.createLocation("main.c", null, 10); - location2=breaks.createLocation("main.c", null, 10); - assertTrue(location.equals(location2)); - - /********************************************************************** - * make sure that the location returned from getLocation on the - * ICDILocationBreakpoint.getLocation that is returned from - * setLocationBreakpoint is the same as the breakpoint returned from - * BreakpointManager.getBreakpoints.getLocation() - **********************************************************************/ - location=breaks.createLocation("main.c", "func1", 0); - assertNotNull(location); - location2=breaks.setLocationBreakpoint(0, location, null, null).getLocation(); - - breakpoints=breaks.getBreakpoints(); - assertNotNull(breakpoints); - assertTrue(breakpoints.length==1); - if (breakpoints[0] instanceof ICDILocationBreakpoint) { - curbreak=(ICDILocationBreakpoint) breakpoints[0]; - } else - curbreak=null; - assertNotNull(curbreak); - - assertTrue(curbreak.getLocation().equals(location2)); - breaks.deleteAllBreakpoints(); - /* Create a break point on a generic function with a file name that - * gdb will change to the relitive path of the source file. This - * should work, but at the time of writing (Sept 25, 2002) does not. - */ - location=breaks.createLocation("main.c", "func1", 0); - assertNotNull(location); - breaks.setLocationBreakpoint(0, location, null, null); - - breakpoints=breaks.getBreakpoints(); - assertNotNull(breakpoints); - assertTrue(breakpoints.length==1); - if (breakpoints[0] instanceof ICDILocationBreakpoint) { - curbreak=(ICDILocationBreakpoint) breakpoints[0]; - } else - curbreak=null; - assertNotNull(curbreak); - - assertTrue("PR:23879",curbreak.getLocation().equals(location)); - - - /* clean up the session */ - session.terminate(); - session=null; - - } - - -} diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java deleted file mode 100644 index 7e51086d24e..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.eclipse.cdt.debug.core.tests; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ - - -import java.io.FileNotFoundException; -import java.io.IOException; - -import junit.framework.TestCase; -import junit.framework.TestSuite; -import org.eclipse.cdt.debug.testplugin.*; -import org.eclipse.cdt.core.model.*; -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.eclipse.cdt.debug.mi.core.*; -import org.eclipse.cdt.debug.core.cdi.*; - -/** - * @author Peter Graves - * - * This file contains a set of generic tests for the CDI Target interfaces. - * It will currenly use the mi implementation. - * - */ -public class TargetTests extends TestCase { - IWorkspace workspace; - IWorkspaceRoot root; - ICProject testProject; - NullProgressMonitor monitor; - - - /** - * Constructor for TargetTests - * @param name - */ - public TargetTests(String name) { - super(name); - /*** - * The assume that they have a working workspace - * and workspace root object to use to create projects/files in, - * so we need to get them setup first. - */ - workspace= ResourcesPlugin.getWorkspace(); - root= workspace.getRoot(); - monitor = new NullProgressMonitor(); - if (workspace==null) - fail("Workspace was not setup"); - if (root==null) - fail("Workspace root was not setup"); - - } - - /** - * Sets up the test fixture. - * - * Called before every test case method. - * - * Example code test the packages in the project - * "com.qnx.tools.ide.cdt.core" - */ - protected void setUp() throws CoreException,FileNotFoundException { - - /*** - * Setup the various files, paths and projects that are needed by the - * tests - */ - testProject=CProjectHelper.createCProject("filetest"); - if (testProject==null) - fail("Unable to create project"); - } - - /** - * Tears down the test fixture. - * - * Called after every test case method. - */ - protected void tearDown() throws CoreException { - CProjectHelper.delete(testProject); - } - - public static TestSuite suite() { - return new TestSuite(TargetTests.class); - } - - public static void main (String[] args){ - junit.textui.TestRunner.run(suite()); - } - - - /*** - * A couple tests to make sure various evaluations work as expected - */ - public void testEvaluate() throws CoreException, MIException, IOException, CDIException, InterruptedException { - - /*** - * Tests to come - */ - - } - - -} diff --git a/debug/org.eclipse.cdt.debug.ui.tests/plugin.xml b/debug/org.eclipse.cdt.debug.ui.tests/plugin.xml deleted file mode 100644 index 16fbc5fc23f..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/plugin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip b/debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip deleted file mode 100644 index 6278570d8ee..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java deleted file mode 100644 index 4b2b22035cb..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.cdt.debug.testplugin; - -import java.io.File; -import java.io.IOException; - -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.mi.core.MIException; -import org.eclipse.cdt.debug.mi.core.MIPlugin; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; - - -/** - * Helper methods to set up a Debug session. - */ -public class CDebugHelper { - - - - /** - * Creates a ICDISession. - */ - public static ICDISession createSession(String exe) throws IOException, MIException { - MIPlugin mi; - ICDISession session; - String os = System.getProperty("os.name"); - String exename; - mi=MIPlugin.getDefault(); - - exename=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile(); - exename+="core/org/eclipse/cdt/debug/core/tests/resources/"; - os=os.toLowerCase(); - /* We need to get the correct executable to execute - */ - if (os.indexOf("windows")!=-1) - exename+="win/"+ exe +".exe"; - else if (os.indexOf("qnx")!=-1) - exename+="qnx/" + exe; - else if (os.indexOf("linux")!=-1) - exename+="linux/"+exe; - else if (os.indexOf("sol")!=-1) - exename+="sol/" + exe; - else - return(null); - session=mi.createCSession(null, new File(exename), new File("."), null); - return(session); - } - /** - * Creates a ICDISession. - */ - public static ICDISession createSession(String exe, ICProject project) throws IOException, MIException { - MIPlugin mi; - String workspacePath= Platform.getLocation().toOSString(); - ICDISession session; - mi=MIPlugin.getDefault(); - - IBinary bins[] = project.getBinaryContainer().getBinaries(); - if (bins.length!=1) { - //SHOULD NOT HAPPEN - return(null); - } - - session=mi.createCSession(null, new File(workspacePath +bins[0].getPath().toOSString()), new File("."), null); - return(session); - } - - -} - diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java deleted file mode 100644 index 93b9edf5abe..00000000000 --- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.eclipse.cdt.debug.testplugin; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.util.zip.ZipFile; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.model.IArchive; -import org.eclipse.cdt.core.model.IArchiveContainer; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.IBinaryContainer; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.ui.dialogs.IOverwriteQuery; -import org.eclipse.ui.wizards.datatransfer.ImportOperation; -import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider; - -/** - * Helper methods to set up a ICProject. - */ -public class CProjectHelper { - /** - * Creates a ICProject. - */ - public static ICProject createCProjectWithImport(String projectName, String zipFile) throws CoreException, InvocationTargetException, IOException { - IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); - IProject project= root.getProject(projectName); - if (!project.exists()) { - project.create(null); - } else { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - if (!project.isOpen()) { - project.open(null); - } - importFilesFromZip(new ZipFile(zipFile),project.getFullPath(),null); - - if (!project.hasNature(CProjectNature.C_NATURE_ID)) { - addNatureToProject(project, CProjectNature.C_NATURE_ID, null); - } - - ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project); - /* Try to guess at the correct binary parser.. elf or pe at this point.. */ - String os = System.getProperty("os.name"); - boolean pe=(os.toLowerCase().indexOf("windows")!=-1); - ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project); - desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID); - desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, pe?"org.eclipse.cdt.core.PE":"org.eclipse.cdt.core.ELF"); - CCorePlugin.getDefault().getCoreModel().resetBinaryParser(project); - return cproject; - } - - - /** - * Creates a ICProject. - */ - public static ICProject createCProject(String projectName) throws CoreException { - IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); - IProject project= root.getProject(projectName); - if (!project.exists()) { - project.create(null); - } else { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - if (!project.isOpen()) { - project.open(null); - } - - if (!project.hasNature(CProjectNature.C_NATURE_ID)) { - addNatureToProject(project, CProjectNature.C_NATURE_ID, null); - } - - ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project); - - return cproject; - } - - /** - * Removes a ICProject. - */ - public static void delete(ICProject cproject) throws CoreException { - cproject.getProject().delete(true, true, null); - } - - - - /** - * Attempts to find an archive with the given name in the workspace - */ - public static IArchive findArchive(ICProject testProject,String name) { - int x; - IArchive[] myArchives; - IArchiveContainer archCont; - archCont=testProject.getArchiveContainer(); - myArchives=archCont.getArchives(); - if (myArchives.length<1) - return(null); - for (x=0;x - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.ui/.classpath b/debug/org.eclipse.cdt.debug.ui/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.ui/.cvsignore b/debug/org.eclipse.cdt.debug.ui/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/debug/org.eclipse.cdt.debug.ui/.project b/debug/org.eclipse.cdt.debug.ui/.project deleted file mode 100644 index 9786a16312f..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/.project +++ /dev/null @@ -1,31 +0,0 @@ - - - org.eclipse.cdt.debug.ui - - - org.eclipse.cdt.core - org.eclipse.cdt.debug.core - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog deleted file mode 100644 index 72fbe2fe759..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ /dev/null @@ -1,1271 +0,0 @@ -2004-01-06 Mikhail Khodjaiants - Fix for bug 49587: Unable to set breakpoints in the editors that extend CEditor. - * ManageBreakpointRulerActionDelegate.java - -2003-12-05 Mikhail Khodjaiants - 'performApply' of 'SourceLookupBlock' should check if the project in configuration is the same as - project saved in the block. - * SourceLookupBlock.java - -2003-12-04 Mikhail Khodjaiants - Changed the message displayed when the source file is not found. - * CDebugEditor.java - -2003-11-26 Mikhail Khodjaiants - Fix for PR 47595: Referenced projects are not checked in the list of generic source locations. - * SourceLookupBlock.java - -2003-11-26 Mikhail Khodjaiants - Cleanup. - * CDTDebugModelPresentation.java - * AddExpressionActionDelegate.java - * AddGlobalsActionDelegate.java - * AddWatchpointActionDelegate.java - * AddWatchpointDialog.java - * AutoRefreshAction.java - * CBreakpointPreferencePage.java - * ExpressionDialog.java - * ManageBreakpointRulerAction.java - * MemoryFormatAction.java - * MemoryNumberOfColumnAction.java - * MemorySizeAction.java - * RunToLineRulerAction.java - * ShowRegisterTypesAction.java - * ComboDialogField.java - * DisassemblyMarkerAnnotationModel.java - * MemoryViewer.java - * AddProjectSourceLocationBlock.java - * CDebugUIPlugin.java - * SourceLookupBlock.java - * SourcePropertyPage.java - -2003-11-21 Mikhail Khodjaiants - Use "symbol not available" for empty function names when generating a stack frame label. - * CDTDebugModelPresentation.java - -2003-11-13 Mikhail Khodjaiants - Use 'StringBuffer' instead of 'String' when generating stack frame labels. - Added a label for dummy stack frames instead of using the name provided by the rendered object. - * CDTDebugModelPresentation.java - -2003-11-05 Mikhail Khodjaiants - The argument type of the 'getBreakpointAddress' of 'ICBreakpointManager' is changed from - 'ICBreakpoint' to 'ICBreakpointManager'. - * DisassemblyMarkerAnnotationModel.java - -2003-11-03 Mikhail Khodjaiants - Fix for PR 45957: Memory view: last column does not show updates. - * MemoryPresentation.java - -2003-10-31 Mikhail Khodjaiants - Applied the changes made to the corresponding classes of 'org.eclipse.debug.ui'. - * AbstractDebugActionDelegate.java - * AbstractListenerActionDelegate.java - * AddAddressBreakpointActionDelegate.java - * DebuggerConsoleActionDelegate.java - * SwitchToDisassemblyActionDelegate.java - * SignalZeroWorkbenchActionDelegate.java - -2003-10-28 Mikhail Khodjaiants - Changed name of source lookup preference page. - * plugin.properties - -2003-10-27 Mikhail Khodjaiants - Added support of the old launch configurations. - * plugin.xml - * plugin.properties - -2003-10-27 Mikhail Khodjaiants - Changed the initialization of 'SourceLookupBlock'. - * SourceLookupBlock.java - * SourcePropertyPage.java - -2003-10-27 Mikhail Khodjaiants - Moved the 'org.eclipse.debug.core.sourceLocators' extension from the launcher. - * plugin.xml - * plugin.properties - -2003-10-27 Mikhail Khodjaiants - Added dependency to 'org.apache.xerces'. - * plugin.xml - * .classpath - * .project - -2003-10-27 Mikhail Khodjaiants - Moved 'DefaultSourceLocator' from the 'org.eclipse.cdt.launch' plugin and merge it with 'CUISourceLocator'. - * CUISourceLocator.java: removed - * DefaultSourceLocator.java: moved from the launcher. - * CDebugUIPlugin.java: added the 'createSourceLocator' method. - -2003-10-27 Mikhail Khodjaiants - Renamed 'SourceLocationFactory' to 'SourceLookupFactory'. - * AddDirectorySourceLocationBlock.java - * AddProjectSourceLocationBlock.java - -2003-10-23 Mikhail Khodjaiants - Added a preference page for the source lookup. - It includes two new preferences: 'Source Locations' and 'Search For Duplicate Source Files'. - * plugin.properties - * plugin.xml - * ICDebugHelpContextIds.java - * SourcePreferencePage.java - * SourceListDialogField.java - * SourceLookupBlock.java - -2003-10-22 Mikhail Khodjaiants - Refactoring: converting nested types 'SourceListDialogField' and 'SourceLookupLabelProvider' - of 'SourceLookupBlock' to the top level types. - Added 'dispose' method to 'SourceLookupBlock'. - * SourceLookupBlock.java - * SourcePropertyPage.java - * SourceListDialogField.java - * SourceLookupLabelProvider.java - -2003-10-20 Mikhail Khodjaiants - Implementation of the "Search subfolders" option for directory source locations. - * AddDirectorySourceLocationBlock.java - * SourceLookupBlock.java - -2003-10-17 Mikhail Khodjaiants - UI support of the 'Search for duplicate source files' option. - * icons/full/obj16/prj_file_obj.gif: new - * icons/full/obj16/ext_file_obj.gif: new - * CDebugImages.java - * CUISourceLocator.java - * SourceLookupBlock.java - * SourcePropertyPage.java - -2003-10-17 Mikhail Khodjaiants - * CDebugEditor.java: changed the message displayed when the source file not found. - -2003-10-14 Mikhail Khodjaiants - * DebugTextHover.java: check if the result of 'evaluateExpression' is not null before trim it. - -2003-10-06 Mikhail Khodjaiants - Mark the function arguments in the Variables View. - * icons\full\ovr16\argument_ovr.gif: new - * icons\full\ovr16\castarray_ovr.gif: new - * icons\full\ovr16\casttype_ovr.gif: new - * CDebugImages.java - * CDTDebugModelPresentation.java - -2003-09-30 Mikhail Khodjaiants - Fix for PR 39737: Tooltip in debug mode over long strings is not handled properly. - Added an internal constant to limit the hover text size. - Present the hover text in HTML format. - * DebugTextHover.java - -2003-09-24 Mikhail Khodjaiants - Fix for PR 43624: The "Show Types Name" action of the Registers view doesn't work. - * ShowRegisterTypesAction.java - * RegistersView.java - -2003-09-22 Mikhail Khodjaiants - Moved the 'AddAddressBreakpointActionDelegate' action - to the 'org.eclipse.cdt.debug.internal.ui.actions' package. - * AddAddressBreakpointActionDelegate.java - * plugin.xml - -2003-09-16 Mikhail Khodjaiants - Cleanup. - * CUISourceLocator.java - -2003-09-11 Mikhail Khodjaiants - Reset the selection of variable after casting. - * CastToArrayActionDelegate.java - * CastToTypeActionDelegate.java - -2003-10-11 Mikhail Khodjaiants - Moving the shared library search paths block to mi UI. - * SolibSearchPathBlock.java: moved to mi UI. - -2003-09-09 Mikhail Khodjaiants - New class - SolibSearchPathBlock. Implements the UI control block to set the shared library search path. - * SolibSearchPathBlock.java - -2003-08-29 Mikhail Khodjaiants - Label for target suspended by shared library event. - * CDTDebugModelPresentation.java - -2003-08-19 Mikhail Khodjaiants - * plugin.properties: "Restore Default Type" changed to "Restore Original Type". - -2003-08-13 Mikhail Khodjaiants - * CDebugImages.java: new images for the 'Cast to type" and 'Display As Array' dialogs - * CastToTypeActionDelegate.java: new image - * CastToArrayActionDelegate.java: removed the 'type' field, added new image - -2003-08-13 Mikhail Khodjaiants - Display the proper image for reference types. - * CDTDebugModelPresentation.java - -2003-07-30 Mikhail Khodjaiants - Moved the 'getReferencedProject' method to 'CDebugUtils'. Added the cycle checking. - * SourceLookupBlock.java - -2003-07-29 Mikhail Khodjaiants - Fix for PR 40911: Double clicking on breakpoint with no source causes internal error. - * CDTDebugModelPresentation.java: check if the resource associated with breakpoint is a file. - -2003-07-28 Mikhail Khodjaiants - Minimize the number of the "evaluate expression" requests when changing the value of the floating point types. - * CDTDebugModelPresentation.java - -2003-07-28 Mikhail Khodjaiants - Refactoring: moved the 'isNaN', 'isPositiveInfinity' and 'isNegativeInfinity' to the 'CDebugUtils' class. - * CDTDebugModelPresentation.java - -2003-07-28 Mikhail Khodjaiants - Refactoring: moved the 'CDebugUtils' class to the 'org.eclipse.cdt.debug.core' package - - the methods of this class are mostly used in UI plugins. - * CDTDebugModelPresentation.java - * CBreakpointPreferencePage.java - * MemoryPresentation.java - * SharedLibrariesView.java - -2003-07-28 Mikhail Khodjaiants - Cleanup. Removed the 'reset' method from the 'ICVaraible' interface. - * VariableFormatActionDelegate.java - -2003-07-24 Mikhail Khodjaiants - New icon for closed projects. - * icons/full/obj16/cproject_obj.gif: new - * CDebugImages.java - * SourceLookupBlock.java - -2003-07-24 Mikhail Khodjaiants - When initializing the generic source locations list filter out non-generic locations. - * SourceLookupBlock.java - -2003-07-22 Mikhail Khodjaiants - Check if the value that getName returns is not null. - * CDTDebugModelPresentation.java - -2003-07-17 Mikhail Khodjaiants - Automatically update the list of source locations when the list of the referenced - projects is modified. - * CheckedListDialogField.java - * AddDirectorySourceLocationBlock.java - * AddProjectSourceLocationBlock.java - * CUISourceLocator.java - * SourceLookupBlock.java - -2003-06-29 Mikhail Khodjaiants - Fix for PR 39101: No hilight when changing the value of register. - * RegistersView.java - * RegistersViewer.java - -2003-06-26 Mikhail Khodjaiants - New icon for shared libraries with loaded symbols. - * icons/full/ovr16/symbols_ovr.gif: new - * CDebugImages.java - * CDTDebugModelPresentation.java - -2003-06-24 Mikhail Khodjaiants - Warnings cleanup. - * CDebugPreferencePage.java - * MemoryControlArea.java - -2003-06-20 Mikhail Khodjaiants - In the 'getVariableText' and 'getVariableImage' methods of CDTDebugModelPresentation - ignore exceptions thrown by getType. - * CDTDebugModelPresentation.java - -2003-06-20 Mikhail Khodjaiants - Variable bookkeeping (phase 0.1). - The 'Enable' and 'Disable' actions added to the Variables view. - * plugin.properties - * plugin.xml - * icons/full/obj16/vard_aggr.gif: new - * icons/full/obj16/vard_pointer.gif: new - * icons/full/obj16/vard_simple.gif: new - * icons/full/clc16/disabled_co.gif: new - * icons/full/clc16/enabled_co.gif: new - * CDebugImages.java - * CDTDebugModelPresentation.java - * DisableVariablesActionDelegate.java: new - * EnableVariablesActionDelegate.java: new - -2003-06-13 Mikhail Khodjaiants - Fix for PR 38788: Ctrl-X, Ctrl-C, Ctrl-V, Ctrl-A, Ctrl-Z and Ctrl-Y keys don't work - in the address field of the Memory view. - Note: Ctrl-Z still doesn't work because there is no support of it in the Text widget. - * MemoryViewAction.java: moved to the org.eclipse.cdt.debug.internal.ui.views.memory package. - * MemoryControlArea.java - * MemoryView.java - -2003-06-12 Mikhail Khodjaiants - Fixing "trivial" PR 38788: Ctrl-X, Ctrl-C, Ctrl-V, Ctrl-A, Ctrl-Z and Ctrl-Y keys don't work - in the address field of the Memory view. - * MemoryViewAction.java: new - * MemoryControlArea.java - * MemoryView.java - * MemoryViewer.java - -2003-06-10 Mikhail Khodjaiants - Refactoring: moved the type and value related methods from ICVariable to ICType and ICValue. - * CDTDebugModelPresentation.java - -2003-06-09 Mikhail Khodjaiants - Added default format preferences for variables, registers and expressions. - * CDebugPreferencePage.java - -2003-06-09 Mikhail Khodjaiants - Renamed the 'refresh' method of ICVariable to 'reset'. - * VariableFormatActionDelegate.java - -2003-06-05 Mikhail Khodjaiants - Changed the presentation of arrays and array types. - * CDTDebugModelPresentation.java - -2003-06-05 Mikhail Khodjaiants - UI support of infinite values of the floating point types. - * CDTDebugModelPresentation.java - -2003-06-05 Mikhail Khodjaiants - Evaluate expressions of detail panel asynchronously. - * CDTValueDetailProvider.java - -2003-06-04 Mikhail Khodjaiants - Implementing the UI support of the detail panel. - * CDTDebugModelPresentation.java - * CDTValueDetailProvider.java: new - -2003-06-04 Mikhail Khodjaiants - The presentation of the new types. - * CDTDebugModelPresentation.java - -2003-05-23 Mikhail Khodjaiants - Fix for PR 38047: Unable to save changes in C/C++ debug editor. - * CDebugEditor.java - * EditorInputDelegate.java - * CDebugUIPlugin.java - -2003-05-29 Mikhail Khodjaiants - PR 38268: added the image cache for overlay images. - * OverlayImageCache.java: new - * CDTDebugModelPresentation.java - -2003-05-29 Mikhail Khodjaiants - Changed the vizualization of arrays and structures. - * CDTDebugModelPresentation.java - -2003-05-14 Mikhail Khodjaiants - Created preference for the maximum number of disassembly instructions. - * CDebugPreferencePage.java - -2003-05-13 Mikhail Khodjaiants - Enable/disable the 'Add Globals' action when the 'Expressions' view is initializing. - * AddGlobalsActionDelegate.java - -2003-05-12 Mikhail Khodjaiants - Accumulate the status information when adding multiple globals to the Expression view. - * AddGlobalsActionDelegate.java - -2003-05-12 Mikhail Khodjaiants - Moved the generation of expressions for global variables to the mi plugin. - * AddGlobalsActionDelegate.java - -2003-05-07 Mikhail Khodjaiants - Display the error message and error image in the debug target's label - if the error status is set. - * CDTDebugModelPresentation.java - -2003-05-06 Mikhail Khodjaiants - Ruler tooltips in the dissassembly editor. - * DisassemblyEditor.java - * DisassemblySourceViewerConfiguration.java: new - -2003-05-05 Mikhail Khodjaiants - New implementation of overlayed images. - * OverlayImageDescriptor.java: new - * CImageDescriptor.java: removed - * CDebugImages.java: new overlay images - * CDTDebugModelPresentation.java: presentation of breakpoints and debug elements. - * icons/full/ovr16/address_ovr.gif: new - * icons/full/ovr16/address_ovr_disabled.gif: new - * icons/full/ovr16/function_ovr.gif: new - * icons/full/ovr16/function_ovr_disabled.gif: new - * icons/full/ovr16/conditional_ovr.gif: new - * icons/full/ovr16/conditional_ovr_disabled.gif: new - * icons/full/ovr16/error_ovr.gif: new - * icons/full/ovr16/warning_ovr.gif: new - -2003-04-29 Alain Magloire - - * src/org/eclipse/cdt/debug/internal/ui/editor/CDebugDocumentProvider.java (doSetInput): - Disconnect the old input from the working manager. - -2003-04-27 Alain Magloire - - Bug PR 36759, the outliner was not updated, when using - the CDebugEditor. - - * src/org/eclipse/cdt/debug/internal/ui/editor/CDebugDocumentProvider.java (getBufferFactory): - New method overload getBufferFactory() to return the factory of - CUIPlugin.getDefault().getDocumentProvider().getBufferFactory(). - -2003-04-25 Mikhail Khodjaiants - Fix for bug 36909. - * NoSymbolOrSourceElement.java: new file. - * CDTDebugModelPresentation.java - * CUISourceLocator.java - -2003-04-24 Mikhail Khodjaiants - Display error messages in the 'Registers' view. - * RegistersView.java - -2003-04-24 Mikhail Khodjaiants - Added shortcuts for the C/C++ Debug specific views. - * plugin.xml - -2003-04-24 Mikhail Khodjaiants - Update the actions of the 'Shared Libraries' view even if the viewer's input - is the same as before. - * SharedLibrariesView.java - -2003-04-23 Mikhail Khodjaiants - If error occurs when acquiring the signal information from gdb - the error message should be displayed in the 'Signals' view. - * SignalsView.java - * SignalsViewer.java - * SignalsViewEventHandler.java - -2003-04-21 Mikhail Khodjaiants - Fix for bug 36682. - * CDTDebugModelPresentation.java - -2003-04-21 Mikhail Khodjaiants - Temporary fix for character values. - * CDTDebugModelPresentation.java - -2003-04-16 Mikhail Khodjaiants - Quick fix for variable values. - * CDTDebugModelPresentation.java - -2003-04-14 Mikhail Khodjaiants - Added icon to the 'Add/Remove Breakpoint' action for functions and methods. - * plugin.xml - -2003-04-14 Mikhail Khodjaiants - Commented default format preferences. - * CDebugPreferencePage.java - -2003-04-14 Mikhail Khodjaiants - Fixes for toggle actions. - * plugin.xml - * MemoryFormatAction.java - * MemoryNumberOfColumnAction.java - * MemorySizeAction.java - -2003-04-11 Mikhail Khodjaiants - Method and function breakpoints. - * plugin.properties - * plugin.xml - * icons/full/obj16/brkpd_obj.gif: new - * icons/full/obj16/funbrkp_obj.gif: new - * icons/full/obj16/funbrkpd_obj.gif: new - * CDTDebugModelPresentation.java - * CDebugImages.java - * CBreakpointPreferencePage.java - * ManageFunctionBreakpointActionDelegate.java: new - * DisassemblyMarkerAnnotation.java - * DisassemblyMarkerAnnotationModel.java - -2003-04-08 Mikhail Khodjaiants - Removed unused private methods and members. - * CDebugEditor.java - * MemoryPresentation.java - * MemoryText.java - * MemoryViewer.java - -2003-04-08 Mikhail Khodjaiants - Preserving the registers tree structure during the debug session. - * ViewerState.java: new - * RegistersView.java - * RegistersViewEventHandler.java - -2003-04-07 Mikhail Khodjaiants - No dialog if switch to frame failed. - * CDebugUIPlugin.java - -2003-04-05 Alain Magloire - - * CDebugEditor.java - Change to make the ContentOutline work. - -2003-04-01 Mikhail Khodjaiants - Changed the labels of the C/C++ specific actions. - * plugin.properties - * plugin.xml - -2003-04-01 Mikhail Khodjaiants - The 'Auto-Refresh' preferences were moved to the code plugin. Changed the preference - pages for the Registers and Shared Libraries views to reflect this. - * ICDebugPreferenceConstants.java - * RegistersViewPreferencePage.java - * SharedLibrariesViewPreferencePage.java - -2003-04-01 Mikhail Khodjaiants - Changed implementation and initialization of 'AutoRefreshAction'. - * AutoRefreshAction.java - * RegistersView.java - * SharedLibrariesView.java - -2003-04-01 Mikhail Khodjaiants - Removed the 'Show Type Names' preference from the Registers view's preference page. - * ShowRegisterTypesAction.java - * RegistersViewPreferencePage.java - * RegistersView.java - -2003-03-31 Mikhail Khodjaiants - 'Auto-Refresh' and 'Refresh' actions for registers view. - * ICDebugHelpContextIds.java - * RefreshAction.java - * ICDebugPreferenceConstants.java - * RegistersViewPreferencePage.java - * RegistersView.java - * RegistersViewContentProvider.java - -2003-03-28 Mikhail Khodjaiants - Added the default format section for variables, registers and expressions - to the debugger preference page. - * CDebugPreferencePage.java - -2003-03-28 Mikhail Khodjaiants - 'Run To C/C++ Line' and 'Resume At C/C++ Line' actions for external files. - * JumpToLineActionDelegate.java - * RunToLineActionDelegate.java - * RunToLineRulerAction.java - -2003-03-25 Mikhail Khodjaiants - Fix for bug 35092. - * CDebugImages.java - -2003-03-25 Mikhail Khodjaiants - Added the 'logErrorMessage' static method to the 'CDebugUIPlugin' class. - * CDebugUIPlugin.java - -2003-03-18 Mikhail Khodjaiants - Removed the gdb-specific variable parsing. - * VariableFormatActionDelegate.java - * CDTDebugModelPresentation.java - -2003-03-17 Mikhail Khodjaiants - Replace range by start index and length in 'Display As Array' action. - * CastToArrayActionDelegate.java - -2003-03-14 Mikhail Khodjaiants - Fix for the 'Restore Default Type' action. - * RestoreDefaultTypeActionDelegate.java - -2003-03-11 Mikhail Khodjaiants - The implementation of the "Display As Array" action. - * CastToArrayActionDelegate.java - * CastToTypeActionDelegate.java - -2003-03-10 Mikhail Khodjaiants - Implementing the "Display As Array" action. - * plugin.xml - * plugin.propeties - * CastToArrayActionDelegate.java: new - -2003-03-09 Mikhail Khodjaiants - The implementation of the "Cast To Type" and "Restore Default Type" actions. - * plugin.xml - * plugin.propeties - * CastToTypeActionDelegate.java: new - * RestoreDefaultTypeActionDelegate.java: new - -2003-03-05 Mikhail Khodjaiants - The extension of CEditor that displays the 'Source Not Found' form. - * plugin.properties - * plugin.xml - * CDTDebugModelPresentation.java - * AttachSourceEditor.java: removed - * AttachSourceEditorInput.java: removed - * FileNotFoundElement.java: new - * CDebugDocumentProvider.java: new - * CDebugEditor.java: new - * EditorInputDelegate.java: new - * ManageBreakpointRulerActionDelegate.java - -2003-02-28 Mikhail Khodjaiants - Check if part is not null when set the selection. - * AddExpressionActionDelegate.java - * AddGlobalsActionDelegate.java - * JumpToLineActionDelegate.java - * RunToLineActionDelegate.java - -2003-02-28 Mikhail Khodjaiants - Check if page exists before adding a listener. - * AbstractListenerActionDelegate.java - -2003-02-21 Mikhail Khodjaiants - Implementing the 'Attach Source' editor. - * plugin.properties - * plugin.xml - * icons/full/obj16/filenotfound_obj.gif: new - * CDTDebugModelPresentation.java - * AttachSourceEditor.java: new - * AttachSourceEditorInput.java: new - * FileNotFoundElement.java: new - * CUISourceLocator.java - -2003-02-20 Mikhail Khodjaiants - Added the 'Association' column and the 'Restore Defaults' button to the SourceLookupBlock. - * SourceLookupBlock.java - * SourcePropertyPage.java - -2003-02-18 Mikhail Khodjaiants - Added persistency to the source locator. - * CUISourceLocator.java - * SourceLookupBlock.java - * SourcePropertyPage.java - -2003-02-14 Mikhail Khodjaiants - Enable the 'Resume With Signal' action only if target is suspended. - * SignalActionDelegate.java - -2003-02-14 Mikhail Khodjaiants - Change the 'Deliver Signal' action name to 'Resume With Signal'. - * plugin.properties - -2003-02-13 Mikhail Khodjaiants - Undo changes because the 'asyncExec' method of the 'DebugPlugin' class has added since version 2.1. - * CDebugUIPlugin.java - -2003-02-13 Mikhail Khodjaiants - Use the 'asyncExec' method of the 'DebugPlugin' class. - * CDebugUIPlugin.java - -2003-02-11 Mikhail Khodjaiants - The 'Load Symbole For All' action is added to the 'Shared Libraries' view - * CDebugImages.java - * ICDebugHelpContextIds.java - * LoadSymbolsForAllAction.java: new - * SharedLibrariesView.java - * ICDebugUIConstants.java - * icons/full/clcl16/load_all_symbols_co.gif: new - * icons/full/dlcl16/load_all_symbols_co.gif: new - * icons/full/elcl16/load_all_symbols_co.gif: new - -2003-02-10 Mikhail Khodjaiants - The 'Auto-Refresh' and 'Refresh' actions are added to the 'Shared Libraries' view. - * RefreshAction.java: new - * AutoRefreshAction.java: new - * RefreshMemoryAction.java - * AutoRefreshMemoryAction.java - * SharedLibrariesView.java - * CDebugImages.java - * ICDebugHelpContextIds.java - -2003-02-09 Alain Magloire - - Changing the scope of methods to protected to let inner class - have access to it. - * StringDialogField.java - * CheckedListDialogField.java - * ComboDialogField.java - * ListDialogField.java - * SelectionButtonDialogField.java - * SelectionButtonDialogFieldGroup.java - -2003-02-07 Mikhail Khodjaiants - Implementing the preference page for the 'Shared Libraries' view. - * ICDebugHelpContextIds.java - * ICDebugPreferenceConstants.java - * SharedLibrariesViewPreferencePage.java: new - * CDebugUIPlugin.java - * plugin.xml - * plugin.properties - -2003-02-07 Mikhail Khodjaiants - The viewer type of the 'Shared Libraries' view changed to 'TableTreeViewer'. - * CDTDebugModelPresentation.java - * AbstractDebugEventHandler.java - * SharedLibrariesView.java - * SharedLibrariesViewContentProvider.java - * SharedLibrariesViewEventHandler.java - -2003-02-07 Mikhail Khodjaiants - The 'Resume Without Signal' action added to the 'Run' menu of the workbench window. - * SignalZeroWorkbenchActionDelegate.java: new - * plugin.xml - -2003-02-07 Mikhail Khodjaiants - Rename 'SignalZeroActionDelegate' to 'SignalZeroObjectActionDelegate'. - * SignalZeroObjectActionDelegate.java - * plugin.xml - -2003-02-05 Mikhail Khodjaiants - Removed warnings. - * AddAddressBreakpointActionDelegate.java - * AddExpressionActionDelegate.java - * CBreakpointPropertiesDialog.java - * CUISourceLocator.java - * SourceLookupBlock.java - -2003-02-05 Mikhail Khodjaiants - Implementation of the 'Resume At C/C++ Line' action. - * RunToLineActionDelegate.java - * JumpToLineActionDelegate.java - * plugin.properties - * plugin.xml - icons/full/clcl16/jump_co.gif - icons/full/dlcl16/jump_co.gif - icons/full/elcl16/jump_co.gif - -2003-02-04 Mikhail Khodjaiants - Implementation of the 'Resume Without Signal' action. - * SignalZeroActionDelegate.java - * plugin.properties - * plugin.xml - icons/full/clcl16/signal0_co.gif - icons/full/dlcl16/signal0_co.gif - icons/full/elcl16/signal0_co.gif - -2003-02-04 Mikhail Khodjaiants - 'DebugException' handling in the 'Signals' view. - * SignalsView.java - * SignalsViewer.java - -2003-02-04 Mikhail Khodjaiants - Changed the 'Signal' action name to 'Deliver Signal'. - * plugin.properties - -2003-02-03 Mikhail Khodjaiants - Implementing the 'Signals' view. - * SignalActionDelegate.java - * SignalsViewer.java: new - * CDTDebugModelPresentation.java - -2003-01-31 Mikhail Khodjaiants - Implementing the 'Signals' view. - * CDebugImages.java - * ICDebugHelpContextIds.java - * SignalActionDelegate.java - * SignalsView.java: new - * SignalsViewContentProvider.java: new - * SignalsViewer.java: new - * SignalsViewEventHandler.java: new - * AbstractDebugEventHandler.java - * plugin.xml - * plugin.properties - icons/full/clcl16/signal_co.gif - icons/full/dlcl16/signal_co.gif - icons/full/elcl16/signal_co.gif - icons/full/eview6/signals_view.gif - icons/full/cview6/signals_view.gif - -2003-01-30 Mikhail Khodjaiants - Disassembly editor input fix. - * CDTDebugModelPresentation.java - -2003-01-27 Mikhail Khodjaiants - Managing breakpoints from the gdb console. - * AddAddressBreakpointActionDelegate.java - * ManageBreakpointRulerAction.java - * CDebugUIPlugin.java - -2003-01-23 Mikhail Khodjaiants - Ignore the text selection when hovering. - * DebugTextHovering.java - -2003-01-21 Mikhail Khodjaiants - Changed the viewer of the Shared Libraries view to TreeViewer. - * SharedLibrariesView.java - * SharedLibrariesViewContentProvider.java - * SharedLibrariesViewEventHandler.java - -2003-01-21 Mikhail Khodjaiants - - * src/org/eclipse/cdt/debu/internal/ui/CDTDebugModelPresentation.java - (getTargetText): Use Signal. - -2003-01-20 Mikhail Khodjaiants - Changed the icon for the 'Load Symbols' action. - icons/full/clcl16/load_symbols_co.gif - icons/full/dlcl16/load_symbols_co.gif - icons/full/elcl16/load_symbols_co.gif - -2003-01-19 Mikhail Khodjaiants - Set the start or end address value in the shared libraries view to 'Not available' if the address value is 0. - * CDTDebugModelPresentation.java - -2003-01-17 Mikhail Khodjaiants - Use the C editor instead of the default editor for files without extensions. - * CDTDebugModelPresentation.java - -2003-01-17 Mikhail Khodjaiants - Added the handlers for the 'Create' and 'Terminate' events to the 'Shared Libraries' view. - * SharedLibrariesViewEventHandler.java - -2003-01-17 Mikhail Khodjaiants - Implementation of the shared library view. - * LoadSymbolsActionDelegate.java - * SharedLibrariesView.java - * SharedLibrariesViewEventHandler.java - * CDTDebugModelPresentation.java - * CDebugImages.java - * plugin.properties - * plugin.xml - -2003-01-16 Mikhail Khodjaiants - Implementing the Shared Libraries view. - * SharedLibrariesView.java - * SharedLibrariesViewContentProvider.java - * SharedLibrariesViewEventHandler.java - * CDebugImages.java - * ICDebugHelpContextIds.java - * plugin.properties - * plugin.xml - * icons/full/cview16/sharedlibraries_view.gif - * icons/full/eview16/sharedlibraries_view.gif - * icons/full/obj16/sharedlibraryl_obj.gif - * icons/full/obj16/sharedlibraryu_obj.gif - -2003-01-15 Mikhail Khodjaiants - The 'getDefaultEditor' method returns 'null' for file names that don't have an extension and - are not registered with some editor. Use the default text editor in this case. - * CDTDebugModelPresentation.java - -2003-01-14 Mikhail Khodjaiants - Added the 'Add Address Breakpoint' action to the workbench 'Run' menu. - * AddAddressBreakpointActionDelegate.java - * plugin.properties - * plugin.xml - * icons/full/obj16/brkp_obj.gif - -2003-01-13 Mikhail Khodjaiants - Implementation of the 'Run To Line' action for disassembly. - * RunToLineActionDelegate.java - -2003-01-13 Alain Magloire - - * src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java (getHoverInfo): - IndexArrayOutOfBound exception, do no use the index when doing targetList.add(). - -2003-01-10 Mikhail Khodjaiants - Added contributions of the breakpoint actions to the disassembly editor. - * DisassemblyEditor.java - * plugin.xml - -2003-01-10 Mikhail Khodjaiants - Implementation of address breakpoints. - * CDebugImages.java - * CDTDebugModelPresentation.java - * BreakpointLocationVerifier.java - * CBreakpointPreferencePage.java - * ManageBreakpointActionDelegate.java - * ManageBreakpointRulerAction.java - * ManageBreakpointRulerActionDelegate.java - * DisassemblyDocumentProvider.java - * DisassemblyEditor.java - * DisassemblyEditorInput.java - * DisassemblyMarkerAnnotation.java - * DisassemblyMarkerAnnotationModel.java - * CDebugUIPlugin.java - * plugin.properties - * plugin.xml - - New icons: - * full/obj16/addrbrkp_obj.gif - * full/obj16/addrbrkpd_obj.gif - -2003-01-06 Alain Magloire - - * build.properties: Patch from Judy Green. - -2003-01-06 Mikhail Khodjaiants - Fix for bug 28977: Unable to set breakpoint properties from the Breakpoint view. - * plugin.xml - -2003-01-02 Mikhail Khodjaiants - Adapter for 'IResource' in 'DisassemblyEditorInput'. - * DisassemblyEditorInput.java - -2002-12-29 Mikhail Khodjaiants - Implementation of the 'Source Lookup' property page. - * AddDirectorySourceLocationBlock.java (new) - * AddDirectorySourceLocationWizard.java (new) - * AddProjectSourceLocationBlock.java (new) - * AddProjectSourceLocationWizard.java (new) - * AddSourceLocationWizard.java - * SourceLocationSelectionPage.java (new) - * SourceLocationWizardNode.java (new) - * CDebugImages.java - * AttachSourceLocationBlock.java renamed to AddDirectorySourceLocationBlock.java - * AttachSourceLocationDialog.java (deleted - dialog replaced by wizard). - * INewSourceLocationWizard.java (new) - * SourceLookupBlock.java - Added new wizard and tool icons. - -2002-12-19 Mikhail Khodjaiants - Implementing the 'Source Lookup' property page. - * AddSourceLocationWizard.java - * SourceLookupBlock.java - * SourcePropertyPage.java - icons/full/obj16/project_obj.gif - icons/full/obj16/folder_obj.gif - -2002-12-19 Mikhail Khodjaiants - Added the 'org.eclipse.cdt.debug.internal.ui.dialogfields' package. - -2002-12-19 Mikhail Khodjaiants - Added new utility class - SWTUtil - * SWTUtil.java - * AttachSourceLocationBlock.java - -2002-12-19 Mikhail Khodjaiants - Added new utility class - PixelConverter - * PixelCoverter.java - * AttachSourceLocationBlock.java - -2002-12-18 Mikhail Khodjaiants - Implementing the "Source Lookup" property page. - * SourceLookupBlock.java: common control block. - * SourcePropertyPage.java: implementation - * plugin.properties: page name - * plugin.xml: contribution to ICDebugTarget properties - -2002-12-18 Mikhail Khodjaiants - Do not show the source lookup dialog if file name is not specified. - * CUISourceLocator.java - -2002-12-17 Mikhail Khodjaiants - Disable the association controls in the 'Attach Source Location" dialog if path is not absolute. - * AttachSourceLocationBlock.java - * CUISourceLocator.java - -2002-12-17 Mikhail Khodjaiants - Formatting 'char' types. - * VariableFormatActionDelegate.java - -2002-12-17 Mikhail Khodjaiants - Removed the "Primitive type display options" section from the C/C++ Debug preference page because of the different formattong strategy. - * CDebugPreferencePage.java - -2002-12-17 Mikhail Khodjaiants - The UI part of the prompting source locator. - * AttachSourceLocationBlock.java - * AttachSourceLocationDialog.java - * CUISourceLocator.java - * plugin.xml - -2002-12-16 Mikhail Khodjaiants - New formating actions for variables, registers, and expressions - * VariableFormatActionDelegate.java - * DecVariableFormatActionDelegate.java - * HexVariableFormatActionDelegate.java - * NaturalVariableFormatActionDelegate.java - * plugin.xml - * plugin.properties - -2002-12-10 Mikhail Khodjaiants - Added new case in the 'getEditorInput' method of CDTDebugModelPresentation for FileStorage objects. - * CDTDebugModelPresentation.java - -2002-12-08 Mikhail Khodjaiants - Implementation of the status handler for core errors. - * ErrorStatusHandler.java - -2002-12-04 Mikhail Khodjaiants - Small fix for the Registers view. - * RegistersView.java - -2002-12-02 Mikhail Khodjaiants - If the target is suspended because of error display the error message in the Launch view. - * CDTDebugModelPresentation.java - -2002-12-02 Mikhail Khodjaiants - Refactoring org.eclipse.cdt.debug.core - UI changes. - -2002-12-02 Mikhail Khodjaiants - 'Run to line' and 'Add expression' actions for assembly editor. - *plugin.xml - -2002-12-01 Mikhail Khodjaiants - Contributing breakpoint actions to asm editor. - * plugin.xml - * ManageBreakpointRulerActionDelegate.java - -2002-11-29 Mikhail Khodjaiants - Cosmetic change for the MemoryView preference page. - * plugin.properties - * MemoryViewPreferencePage.java - -2002-11-29 Mikhail Khodjaiants - Cosmetic fix for the memory view tab's tooltips. - * MemoryControlArea.java - -2002-11-28 Mikhail Khodjaiants - Fixes for 'Run to line' actions. - * RunToLineActionDelegate.java - * RunToLineRulerAction.java - -2002-11-28 Mikhail Khodjaiants - Live editing of the memory view. - * SaveMemoryChangesAction.java - removed - * MemoryPresentation.java - * MemoryControlArea.java - * MemoryText.java - * MemoryViewer.java - * MemoryView.java - -2002-11-27 Mikhail Khodjaiants - Render debug target as suspended if no reason is specified. - * CDTDebugModelPresentation.java - -2002-11-26 Mikhail Khodjaiants - Fix for evaluation of expression to address in the Memory view. - GDB evaluates the array of chars to a string not an address. - * MemoryControlArea.java - -2002-11-21 Mikhail Khodjaiants - Added the 'Evaluate' button to the Memory view. - * MemoryControlArea.java - -2002-11-20 Mikhail Khodjaiants - Reset the tooltips of the memory view tabs on terminate. - * MemoryControlArea.java - -2002-11-20 Mikhail Khodjaiants - Added the TERMINATE event handler to MemoryViewEventHandler. - * MemoryViewer.java - * MemoryViewEventHandler.java - -2002-11-20 Mikhail Khodjaiants - Fix for bug 26595. - Highlight the addresses if the start address of a memory expression has changed. - *MemoryPresentation.java - *MemoryText.java - -2002-11-19 Mikhail Khodjaiants - Added enablement condition to some actions. - *plugin.xml - -2002-11-19 Mikhail Khodjaiants - Fix for bug 26693. - * SwitchToDisassemblyActionDelegate.java - -2002-11-19 Mikhail Khodjaiants - Fix for bug 26401. - * ExpressionDialog.java: Highlight the content of the expression field on intialization. - -2002-11-18 Mikhail Khodjaiants - Fixes for the 'Add Global Variables' action's bugs. - The action disabled after 'Remove All'. - Error message after adding a valid expression. - * AddGlobalsActionDelegate.java - -2002-11-15 Mikhail Khodjaiants - Added presentation for dummy stack frames. - * CDTDebugModelPresentation.java - -2002-11-13 Mikhail Khodjaiants - Added tooltips to the Memory view's tabs. - * MemoryControlArea.java - -2002-11-13 Mikhail Khodjaiants - Added the 'Auto-Refresh by default' and 'Show ASCII by default' preferences - to the 'Memory Views' preference page. - * ICDebugPreferenceConstants.java - * MemoryViewPreferencePage.java - * MemoryControlArea.java - * MemoryView.java - -2002-11-11 Mikhail Khodjaiants - Fix for PR 25988: The 'Padding Character' preference of the Memory view doesn't work. - * MemoryControlArea.java - * MemoryViewPreferencePage.java - -2002-11-05 Mikhail Khodjaiants - Implementation of the "Add Global Variables" action of the Expressions view. - Action images: - watch_globals.gif (clcl, dlcl, elcl). - * AddGlobalsActionDelegate.java: implementation. - * plugin.xml: contribution to the Expression view - * plugin.xml: added dependency to org.eclipse.cdt.core - * .classpath: added dependency to org.eclipse.cdt.core - * .project: added dependency to org.eclipse.cdt.core - * plugin.properties: action's label and tooltip text - -2002-11-03 Mikhail Khodjaiants - Implementation of the "Format/Decimal" and "Format/Unsigned Decimal" actions of the Memory view. - * MemoryFormataction.java - * MemorySizeAction.java - * MemoryNumberOfColumnsAction.java - * MemoryPresentation.java - * MemoryViewer.java - * MemoryView.java - -2002-11-01 Mikhail Khodjaiants - Implementing decimal format support of the Memory view. - * MemoryPresentation.java - -2002-10-31 Mikhail Khodjaiants - Removed the 'Modified Value Color' field from the 'Debug/Memory Views' - preference page. - * MemoryViewPreferencePage.java - -2002-10-30 Mikhail Khodjaiants - Implementing the 'Refresh Memory' action. - * RefreshMemoryAction.java - * MemoryControlArea.java - * MemoryViewer.java - -2002-10-30 Mikhail Khodjaiants - Implementation of the 'SaveMemoryChanges' action. - * SaveMemoryChangesAction.java - * CDebugImages.java - * ICDebugHelpConstants.java - * MemoryControlArea.java - * MemoryText.java - * MemoryViewer.java - * MemoryView.java - -2002-10-30 Alain Magloire - - * src/.../ui/CDebugUIPlugin.java (selectionChanged): - sameThread() code is commented out amd we let the underlying - implementation swith thread. - -2002-10-29 Mikhail Khodjaiants - Implementing editing features of the memory view. - * MemoryPresentation.java - * MemoryControlArea.java - * MemoryText.java - -2002-10-28 Mikhail Khodjaiants - Implementing editing features of the memory view. - * MemoryPresentation.java - * MemoryControlArea.java - * MemoryText.java - -2002-10-27 Mikhail Khodjaiants - * MemoryPresentation.java: adding editing features to the memory view. - -2002-10-25 Mikhail Khodjaiants - Implementation of the 'Number Of Columns' action. - * MemoryNumberOfColumnAction.java: the action class - * MemoryViewer.java: support of the action - * MemoryView.java: support of the action - -2002-10-25 Mikhail Khodjaiants - Replaced the usage of 'setWordSize' method by the 'reformat' method of 'IFormattedMemoryBlock'. - * MemorySizeAction.java - * MemoryViewer.java - -2002-10-24 Mikhail Khodjaiants - Set the 'relationship' attribute value to 'stack' for the 'MemoryView' perspective extension. - * plugin.xml - -2002-10-24 Mikhail Khodjaiants - Implementation of the 'Memory Unit Size' action. - * MemorySizeAction.java - * MemoryView.java - -2002-10-24 Mikhail Khodjaiants - Implementing Memory view formatting actions. - * MemoryActionSelectionGroup.java: implementation of a toggle action group. - * MemorySizeAction.java: implementation of the "Memory Unit Size" menu item. - * MemoryView.java: add new actions to the view. - * MemoryViewer.java: support for new action. - * ICDebugHelpContextIds.java: help context id for the new action. - * ICDebugUIConstants.java: new menu group - "Format". - -2002-10-23 Mikhail Khodjaiants - * DebuggerConsoleActionDelegate.java: The debugger/inferrior console should become visible when checking "Show Debug Console". - -2002-10-23 Mikhail Khodjaiants - "Show Debugger Console" action. - Action images: - debugger_console.gif (clcl, dlcl, elcl); - * DebuggerConsoleActionDelegate.java: implementation of action delegate. - * plugin.xml: action extenions - * plugin.properties: action label and tooltip text. - -2002-10-22 Mikhail Khodjaiants - Implementation of the "Show ASCII" action. - Action images: - show_ascii.gif (clcl, dlcl, elcl). - * ShowAsciiAction.java - * MemoryPresentation.java - * MemoryText.java - * MemoryView.java - * MemoryViewer.java - * CDebugImages.java - * ICDebugHelpContextIds.java - -2002-10-21 Mikhail Khodjaiants - Framework tries to refresh memory view before the view controls are created. - * MemoryViewer.java: Check if CTabFolder has already created when refreshing the view. - -2002-10-21 Mikhail Khodjaiants - Implementation of the "Clear" action for the memory view. - * ClearMemoryAction.java - * ICDebugHelpContextIds.java - * MemoryControlArea.java - * MemoryView.java - * MemoryViewer.java - -2002-10-21 Mikhail Khodjaiants - Implementation of the "Auto-Refresh" and "Refresh" actions for the memory view. - * AutoRefreshMemoryAction.java - * RefreshMemoryAction.java - * ICDebugHelpContextIds.java - * MemoryControlArea.java - * MemoryView.java - * MemoryViewer.java - * MemoryViewEventHandler.java - -2002-10-20 Mikhail Khodjaiants - Display the memory changes in different color in the memory view. - * MemoryControlArea.java - * MemoryPresentation.java - * MemoryText.java - * MemoryViewer.java - * MemoryViewEventHandler.java - -2002-10-18 Mikhail Khodjaiants - Implementing the memory view support: - Images for the view's actions: - autorefresh_mem.gif (clcl, dlcl, elcl), - refresh_mem.gif (clcl, dlcl, elcl), - memory_save.gif (clcl, dlcl, elcl), - memory_clear.gif (clcl, dlcl, elcl). - * RefreshMemoryAction.java - * MemoryControlArea.java - * MemoryPresentation.java - * MemoryText.java - * MemoryView.java - * MemoryViewer.java - * CDebugImages.java - * ICDebugHelpContextIds.java - * ICDebugUIConstants.java - -2002-10-17 Mikhail Khodjaiants - Implementing the memory view support: - * MemoryControlArea.java - * MemoryPresentation.java - * MemoryView.java - * MemoryViewer.java - -2002-10-15 Mikhail Khodjaiants - * CDebugUIPlugin.java: Moved the memory management functionality to the core. - * MemoryControlArea.java: Moved the memory management functionality to the core. - -2002-10-15 Mikhail Khodjaiants - * CDebugPreferencePage.java: Implementation of the 'Automatically switch to disassembly mode' preference. - -2002-10-14 Mikhail Khodjaiants - * CDebugUIPlugin.java: In the 'selectionChanged' method check if the thread of the new frame is current. If not make it current. - -2002-10-11 Mikhail Khodjaiants - * SwitchToDisassemblyActionDelegate.java: Implementation of the 'Switch to disassembly mode' action. - * plugin.properties: Action label and tooltip. - * plugin.xml: Contribution to the 'Launch View'. - * icons/full/clcl16/disassembly.gif: Hover icon. - * icons/full/dlcl16/disassembly.gif: Disabled icon. - * icons/full/elcl16/disassembly.gif: Enabled icon. diff --git a/debug/org.eclipse.cdt.debug.ui/about.html b/debug/org.eclipse.cdt.debug.ui/about.html deleted file mode 100644 index 293340ea8ed..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

            About This Content

            - -

            20th August, 2002

            -

            License

            -

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

            - -

            Contributions

            - -

            If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

            - -

            If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

            - - - \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/build.properties b/debug/org.eclipse.cdt.debug.ui/build.properties deleted file mode 100644 index 566017b98c1..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - icons/,\ - cdtdebugui.jar -src.includes = plugin.xml,\ - plugin.properties,\ - about.html,\ - icons/ -javadoc.packages = org.eclipse.cdt.debug.ui.*,\ - org.eclipse.cdt.debug.ui.sourcelookup.* -source.cdtdebugui.jar = src/ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/autorefresh_mem.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/autorefresh_mem.gif deleted file mode 100644 index a063c230aca..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/autorefresh_mem.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/casttotype_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/casttotype_co.gif deleted file mode 100644 index a13d1549214..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/casttotype_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif deleted file mode 100644 index b6b60770eb2..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/change_reg_value_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/debugger_console.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/debugger_console.gif deleted file mode 100644 index e6d5b138d46..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/debugger_console.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disabled_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disabled_co.gif deleted file mode 100644 index e11c4116a50..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disabled_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disassembly.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disassembly.gif deleted file mode 100644 index a78e3024c87..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/disassembly.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/enabled_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/enabled_co.gif deleted file mode 100644 index c256109dc06..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/enabled_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/jump_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/jump_co.gif deleted file mode 100644 index 7de2134e81d..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/jump_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_all_symbols_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_all_symbols_co.gif deleted file mode 100644 index b659df9d645..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_all_symbols_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_symbols_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_symbols_co.gif deleted file mode 100644 index 3b95b8bda22..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/load_symbols_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_clear.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_clear.gif deleted file mode 100644 index 255832653fd..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_clear.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_update.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_update.gif deleted file mode 100644 index ca4fe2b1cff..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/memory_update.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/refresh_mem.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/refresh_mem.gif deleted file mode 100644 index 9eb88fa444a..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/refresh_mem.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/restart.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/restart.gif deleted file mode 100644 index 0ca0683909c..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/restart.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/runtoline_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/runtoline_co.gif deleted file mode 100644 index a5a56e36a2e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/runtoline_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_ascii.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_ascii.gif deleted file mode 100644 index 4affa870e8e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_ascii.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_paths.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_paths.gif deleted file mode 100644 index 6c23051e9f0..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/show_paths.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/showasarray_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/showasarray_co.gif deleted file mode 100644 index a87ddbf9ca8..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/showasarray_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal0_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal0_co.gif deleted file mode 100644 index d8ce27f4487..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal0_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal_co.gif deleted file mode 100644 index 3a65ffa4f9e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/signal_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/tnames_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/tnames_co.gif deleted file mode 100644 index 1bbbb95c8ea..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/tnames_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/watch_globals.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/watch_globals.gif deleted file mode 100644 index 30fabfdfa95..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/clcl16/watch_globals.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/adddirsource_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/adddirsource_wiz.gif deleted file mode 100644 index 188c920c3f3..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/adddirsource_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/addprjsource_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/addprjsource_wiz.gif deleted file mode 100644 index ca7ef1be4d8..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ctool16/addprjsource_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/memory_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/memory_view.gif deleted file mode 100644 index 6343974cee6..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/memory_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/registers_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/registers_view.gif deleted file mode 100644 index dfb5e7c5de2..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/registers_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/sharedlibraries_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/sharedlibraries_view.gif deleted file mode 100644 index e45ab0f692c..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/sharedlibraries_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/signals_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/signals_view.gif deleted file mode 100644 index f51bec130a4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/cview16/signals_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/autorefresh_mem.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/autorefresh_mem.gif deleted file mode 100644 index b2281b40cc6..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/autorefresh_mem.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/casttotype_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/casttotype_co.gif deleted file mode 100644 index a13d1549214..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/casttotype_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/change_reg_value_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/change_reg_value_co.gif deleted file mode 100644 index 53762f25469..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/change_reg_value_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/debugger_console.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/debugger_console.gif deleted file mode 100644 index 85876974fbc..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/debugger_console.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/disassembly.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/disassembly.gif deleted file mode 100644 index dbde1a090aa..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/disassembly.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/jump_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/jump_co.gif deleted file mode 100644 index 0107e2ecc6c..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/jump_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_all_symbols_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_all_symbols_co.gif deleted file mode 100644 index 0e062888d77..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_all_symbols_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_symbols_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_symbols_co.gif deleted file mode 100644 index 82a542cefab..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/load_symbols_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_clear.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_clear.gif deleted file mode 100644 index d873c49b8a0..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_clear.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_update.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_update.gif deleted file mode 100644 index 42890d67054..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/memory_update.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/refresh_mem.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/refresh_mem.gif deleted file mode 100644 index b8c1865c696..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/refresh_mem.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/restart.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/restart.gif deleted file mode 100644 index fe2b2c32580..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/restart.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/runtoline_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/runtoline_co.gif deleted file mode 100644 index 786a24535a2..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/runtoline_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_ascii.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_ascii.gif deleted file mode 100644 index 31e97de7401..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_ascii.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_paths.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_paths.gif deleted file mode 100644 index e928437f1f4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/show_paths.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/showasarray_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/showasarray_co.gif deleted file mode 100644 index a87ddbf9ca8..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/showasarray_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal0_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal0_co.gif deleted file mode 100644 index bbea1d3334c..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal0_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal_co.gif deleted file mode 100644 index 081ae40f6f8..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/signal_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif deleted file mode 100644 index 764201b3783..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/tnames_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/watch_globals.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/watch_globals.gif deleted file mode 100644 index 797b0e0e7b4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/watch_globals.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/adddirsource_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/adddirsource_wiz.gif deleted file mode 100644 index 70ec11691b7..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/adddirsource_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/addprjsource_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/addprjsource_wiz.gif deleted file mode 100644 index bd5772ade77..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/dtool16/addprjsource_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/autorefresh_mem.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/autorefresh_mem.gif deleted file mode 100644 index 919423d4357..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/autorefresh_mem.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/casttotype_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/casttotype_co.gif deleted file mode 100644 index a13d1549214..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/casttotype_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif deleted file mode 100644 index 899ad97909e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/change_reg_value_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/debugger_console.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/debugger_console.gif deleted file mode 100644 index f60aba1679b..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/debugger_console.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/disassembly.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/disassembly.gif deleted file mode 100644 index 174087f454a..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/disassembly.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/jump_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/jump_co.gif deleted file mode 100644 index 5239257a8b4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/jump_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_all_symbols_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_all_symbols_co.gif deleted file mode 100644 index 22e5ab675a5..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_all_symbols_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_symbols_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_symbols_co.gif deleted file mode 100644 index 5d90607eb3c..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/load_symbols_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_clear.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_clear.gif deleted file mode 100644 index 6faf8d66fef..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_clear.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_update.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_update.gif deleted file mode 100644 index ca4fe2b1cff..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/memory_update.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/refresh_mem.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/refresh_mem.gif deleted file mode 100644 index d28167335d6..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/refresh_mem.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/restart.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/restart.gif deleted file mode 100644 index adcbec69525..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/restart.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/runtoline_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/runtoline_co.gif deleted file mode 100644 index 2ec717803cc..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/runtoline_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_ascii.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_ascii.gif deleted file mode 100644 index 31e97de7401..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_ascii.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_parents.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_parents.gif deleted file mode 100644 index 7cd61d03595..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/show_parents.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/showasarray_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/showasarray_co.gif deleted file mode 100644 index a87ddbf9ca8..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/showasarray_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal0_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal0_co.gif deleted file mode 100644 index d8ce27f4487..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal0_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal_co.gif deleted file mode 100644 index 3a65ffa4f9e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/signal_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif deleted file mode 100644 index c63f59ece28..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/tnames_co.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/watch_globals.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/watch_globals.gif deleted file mode 100644 index dc1a3bce85d..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/watch_globals.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/etool16/adddirsource_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/etool16/adddirsource_wiz.gif deleted file mode 100644 index 86b35e403c5..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/etool16/adddirsource_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/etool16/addprjsource_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/etool16/addprjsource_wiz.gif deleted file mode 100644 index 617b5a6a5c9..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/etool16/addprjsource_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/memory_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/memory_view.gif deleted file mode 100644 index 5cf0a55329a..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/memory_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/registers_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/registers_view.gif deleted file mode 100644 index f1d3dca820d..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/registers_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/sharedlibraries_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/sharedlibraries_view.gif deleted file mode 100644 index e45ab0f692c..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/sharedlibraries_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/signals_view.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/signals_view.gif deleted file mode 100644 index f51bec130a4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/eview16/signals_view.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkp_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkp_obj.gif deleted file mode 100644 index 80eb70008cd..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkp_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkpd_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkpd_obj.gif deleted file mode 100644 index 5f6c10598b4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/addrbrkpd_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkp_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkp_obj.gif deleted file mode 100644 index 06d007905b2..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkp_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpd_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpd_obj.gif deleted file mode 100644 index 8e8cac5a9d7..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpd_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpi_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpi_obj.gif deleted file mode 100644 index afcf4b89103..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/brkpi_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/cproject_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/cproject_obj.gif deleted file mode 100644 index 04e530e37c4..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/cproject_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/disassembly_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/disassembly_obj.gif deleted file mode 100644 index 546c93c42d1..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/disassembly_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/expression_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/expression_obj.gif deleted file mode 100644 index 870df5c473a..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/expression_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/ext_file_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/ext_file_obj.gif deleted file mode 100644 index 8b2df2ef24f..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/ext_file_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/filenotfound_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/filenotfound_obj.gif deleted file mode 100644 index 1bb68c2d649..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/filenotfound_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/folder_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/folder_obj.gif deleted file mode 100644 index a9c777343c0..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/folder_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkp_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkp_obj.gif deleted file mode 100644 index a61b6bce3d7..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkp_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkpd_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkpd_obj.gif deleted file mode 100644 index f047c8ec4b3..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/funbrkpd_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_obj.gif deleted file mode 100644 index f3b58c0fc32..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_syms_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_syms_obj.gif deleted file mode 100644 index ffd9e1fbbf6..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/library_syms_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/prj_file_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/prj_file_obj.gif deleted file mode 100644 index e49af938c67..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/prj_file_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/project_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/project_obj.gif deleted file mode 100644 index 7b2b6334ca0..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/project_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj.gif deleted file mode 100644 index 793b189d849..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj_disabled.gif deleted file mode 100644 index d9c0c91a040..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/read_obj_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif deleted file mode 100644 index 0b1184d72a8..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif deleted file mode 100644 index 8eba2e1c289..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif deleted file mode 100644 index 277322cf606..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/register_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif deleted file mode 100644 index 952c2af4ab1..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/registergroup_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/showpaths_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/showpaths_obj.gif deleted file mode 100644 index 6c23051e9f0..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/showpaths_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/signal_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/signal_obj.gif deleted file mode 100644 index de072720a96..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/signal_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_aggr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_aggr.gif deleted file mode 100644 index 1aec8baac60..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_aggr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_env.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_env.gif deleted file mode 100644 index 65d63ec00d6..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_env.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global.gif deleted file mode 100644 index b63237dcead..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global_aggr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global_aggr.gif deleted file mode 100644 index 694d6f6f3bd..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_global_aggr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_pointer.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_pointer.gif deleted file mode 100644 index ca17bd232f6..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_pointer.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple.gif deleted file mode 100644 index 600d968f7cf..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple_aggr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple_aggr.gif deleted file mode 100644 index 9ff5c50ace9..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_simple_aggr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static.gif deleted file mode 100644 index 1ffe406e283..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static_aggr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static_aggr.gif deleted file mode 100644 index c63f58ee7b3..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_static_aggr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_string.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_string.gif deleted file mode 100644 index f87131b9652..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/var_string.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_aggr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_aggr.gif deleted file mode 100644 index 8c494d67678..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_aggr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_pointer.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_pointer.gif deleted file mode 100644 index 25c010a9ac0..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_pointer.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_simple.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_simple.gif deleted file mode 100644 index 1e16bc0d69f..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/vard_simple.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj.gif deleted file mode 100644 index b5fa352bb51..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj_disabled.gif deleted file mode 100644 index c4f8b8b7a89..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/obj16/write_obj_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr.gif deleted file mode 100644 index 0914fc22c4e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr_disabled.gif deleted file mode 100644 index ea1b7fe6093..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/address_ovr_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/argument_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/argument_ovr.gif deleted file mode 100644 index b89b9298297..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/argument_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/castarray_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/castarray_ovr.gif deleted file mode 100644 index 2bf69356aa2..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/castarray_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/casttype_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/casttype_ovr.gif deleted file mode 100644 index 766e87314a7..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/casttype_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr.gif deleted file mode 100644 index 7c3e9f04f33..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr_disabled.gif deleted file mode 100644 index ea88a6a7c07..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/conditional_ovr_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/error_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/error_ovr.gif deleted file mode 100644 index 8612eaff599..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/error_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr.gif deleted file mode 100644 index 7227afd4921..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr_disabled.gif deleted file mode 100644 index 7dd73bdb9c7..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/function_ovr_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr.gif deleted file mode 100644 index 7f4a31ee7eb..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr_disabled.gif deleted file mode 100644 index 9325bc10473..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/installed_ovr_disabled.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/symbols_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/symbols_ovr.gif deleted file mode 100644 index 08438a590ab..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/symbols_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/warning_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/warning_ovr.gif deleted file mode 100644 index 3af228ceac3..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/ovr16/warning_ovr.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_dir_source_location_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_dir_source_location_wiz.gif deleted file mode 100644 index 47bcb45449e..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_dir_source_location_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_prj_source_location_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_prj_source_location_wiz.gif deleted file mode 100644 index fdb64a836e2..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_prj_source_location_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_source_location_wiz.gif b/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_source_location_wiz.gif deleted file mode 100644 index b084ad9cfed..00000000000 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/full/wizban/add_source_location_wiz.gif and /dev/null differ diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties deleted file mode 100644 index ba3637b28df..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/plugin.properties +++ /dev/null @@ -1,85 +0,0 @@ -###################################################################### -# (c) Copyright QNX Software Systems Ltd. 2002. -# All Rights Reserved. -###################################################################### - -pluginName=C/C++ Development Tools Debugger UI -providerName=Eclipse.org - -RegistersView.name=Registers -MemoryView.name=Memory -SharedLibrariesView.name=Shared Libraries -SignalsView.name=Signals - -CDebuggerPage.name=C Debugger UI Page -MemoryPreferencePage.name=Memory View -RegistersPreferencePage.name=Registers View -CDebugPreferencePage.name=Debug -SharedLibrariesPreferencePage.name=Shared Libraries View -SourcePreferencePage.name=Source Code Locations - -RunMenu.label=&Run -DebugActionSet.label=C/C++ Debug - -RestartAction.label=Restart -RestartAction.tooltip=Restart - -SwitchToDisassemblyAction.label=Disassembly Mode -SwitchToDisassemblyAction.tooltip=Disassembly Mode On/Off - -ShowDebuggerConsoleAction.label=Show Debugger Console -ShowDebuggerConsoleAction.tooltip=Show Debugger Console On Target Selection - -AddBreakpoint.label=Add/Remove &Breakpoint -EnableBreakpoint.label=T&oggle Breakpoint -BreakpointProperties.label=Breakpoint P&roperties... -GlobalManageBreakpointAction.label=Add/Remove Brea&kpoint (C/C++) -ManageFunctionBreakpointAction.label=Add/Remove Breakpoint -ManageFunctionBreakpointAction.tooltip=Add/Remove Function Breakpoint -BreakpointPropertiesAction.label=P&roperties... -GlobalManageWatchpointAction.label=Add &Watchpoint (C/C++)... -AddExpressionAction.label=Add &Expression... -GlobalAddExpressionAction.label=Add &Expression (C/C++)... -AddAddressBreakpointAction.label=Add &Address Breakpoint... -RunToLineAction.label=Run To &Line -JumpToLineAction.label=Resume At Li&ne -GlobalRunToLineAction.label=Run To &Line (C/C++) -GlobalJumpToLineAction.label=Resume At Li&ne (C/C++) -ShowFullPathsAction.label=Show Full Paths -ShowFullPathsAction.tooltip=Show Full Paths - -AddGlobalsAction.label=Add Global Variables... -AddGlobalsAction.tooltip=Add Global Variables - -CVariableFormatMenu.label=Format -HexVariableFormatAction.label=Hexadecimal -DecVariableFormatAction.label=Decimal -NaturalVariableFormatAction.label=Natural - -CDebugActionGroup.name=C/C++ Debug - -SourcePropertyPage.name=Source Lookup - -DisassemblyEditor.name=Disassembly Editor -AttachSourceEditor.name= Attach Source Editor -CDebugEditor.name= C/C++ Debug Editor - -LoadSymbolsAction.label=Load Symbols -SignalAction.label=Resume With Signal -SignalZeroAction.label=Resume Without Signal - -CastToTypeAction.label=Cast To Type... -CastToTypeAction.tooltip=Cast Varibale To Type -RestoreDefaultTypeAction.label=Restore Original Type -RestoreDefaultTypeAction.tooltip=Restore Original Type Of Variable -CastToArrayAction.label=Display As Array... -CastToArrayAction.tooltip=Display Variable As Array - -EnableVariablesAction.label=Enable -EnableVariablesAction.tooltip=Enable Selected Variables - -DisableVariablesAction.label=Disable -DisableVariablesAction.tooltip=Disable Selected Variables - -DefaultSourceLocator.name=Default C/C++ Source Locator -OldDefaultSourceLocator.name=Default C/C++ Source Locator (old) diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml deleted file mode 100644 index 37ce2cd4ef9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ /dev/null @@ -1,1267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java deleted file mode 100644 index b260aa31d48..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java +++ /dev/null @@ -1,1010 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -import java.text.MessageFormat; -import java.util.HashMap; - -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; -import org.eclipse.cdt.debug.core.cdi.ICDIExitInfo; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent; -import org.eclipse.cdt.debug.core.cdi.ICDISignalExitInfo; -import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; -import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope; -import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger; -import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus; -import org.eclipse.cdt.debug.core.model.ICDebugTargetType; -import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; -import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.cdt.debug.core.model.ICType; -import org.eclipse.cdt.debug.core.model.ICValue; -import org.eclipse.cdt.debug.core.model.ICVariable; -import org.eclipse.cdt.debug.core.model.ICWatchpoint; -import org.eclipse.cdt.debug.core.model.IDummyStackFrame; -import org.eclipse.cdt.debug.core.model.IExecFileInfo; -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.cdt.debug.core.model.IState; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.cdt.debug.internal.core.sourcelookup.DisassemblyManager; -import org.eclipse.cdt.debug.internal.ui.editors.CDebugEditor; -import org.eclipse.cdt.debug.internal.ui.editors.DisassemblyEditorInput; -import org.eclipse.cdt.debug.internal.ui.editors.EditorInputDelegate; -import org.eclipse.cdt.debug.internal.ui.editors.FileNotFoundElement; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.internal.ui.util.ExternalEditorInput; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IDisconnect; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.core.model.IRegister; -import org.eclipse.debug.core.model.IRegisterGroup; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.ITerminate; -import org.eclipse.debug.core.model.IThread; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.debug.ui.IValueDetailListener; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorRegistry; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.FileEditorInput; - -/** - * - * Responsible for providing labels, images, and editors associated - * with debug elements in the CDT debug model. - * - * @since Jul 22, 2002 - */ -public class CDTDebugModelPresentation extends LabelProvider - implements IDebugModelPresentation -{ - /** - * Qualified names presentation property (value "org.eclipse.debug.ui.displayQualifiedNames"). - * When DISPLAY_QUALIFIED_NAMES is set to True, - * this label provider should use fully qualified type names when rendering elements. - * When set to False,this label provider should use simple names - * when rendering elements. - * @see #setAttribute(String, Object) - */ - public final static String DISPLAY_FULL_PATHS = "DISPLAY_FULL_PATHS"; //$NON-NLS-1$ - - private static final String DUMMY_STACKFRAME_LABEL = "..."; - - protected HashMap fAttributes = new HashMap(3); - - protected CDebugImageDescriptorRegistry fDebugImageRegistry = CDebugUIPlugin.getImageDescriptorRegistry(); - - private static CDTDebugModelPresentation fInstance = null; - - private OverlayImageCache fImageCache = new OverlayImageCache(); - - /** - * Constructor for CDTDebugModelPresentation. - */ - public CDTDebugModelPresentation() - { - super(); - fInstance = this; - } - - public static CDTDebugModelPresentation getDefault() - { - return fInstance; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(String, Object) - */ - public void setAttribute( String attribute, Object value ) - { - if ( value != null ) - { - fAttributes.put( attribute, value ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDebugModelPresentation#computeDetail(IValue, IValueDetailListener) - */ - public void computeDetail( IValue value, IValueDetailListener listener ) - { - CDTValueDetailProvider.getDefault().computeDetail( value, listener ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ISourcePresentation#getEditorInput(Object) - */ - public IEditorInput getEditorInput( Object element ) - { - if ( element instanceof IMarker ) - { - IResource resource = ((IMarker)element).getResource(); - if ( resource instanceof IFile ) - return new FileEditorInput( (IFile)resource ); - } - if ( element instanceof IFile ) - { - return new FileEditorInput( (IFile)element ); - } - if ( element instanceof ICAddressBreakpoint ) - { - return getDisassemblyEditorInput( (ICAddressBreakpoint)element ); - } - if ( element instanceof ICLineBreakpoint ) - { - IFile file = (IFile)((ICLineBreakpoint)element).getMarker().getResource().getAdapter( IFile.class ); - if ( file != null ) - return new FileEditorInput( file ); - } - if ( element instanceof FileStorage ) - { - return new ExternalEditorInput( (IStorage)element ); - } - if ( element instanceof IDisassemblyStorage ) - { - return new DisassemblyEditorInput( (IStorage)element ); - } - if ( element instanceof FileNotFoundElement ) - { - return new EditorInputDelegate( (FileNotFoundElement)element ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(IEditorInput, Object) - */ - public String getEditorId( IEditorInput input, Object element ) - { - if ( input instanceof EditorInputDelegate ) - { - if ( ((EditorInputDelegate)input).getDelegate() == null ) - return CDebugEditor.EDITOR_ID; - else - return getEditorId( ((EditorInputDelegate)input).getDelegate(), element ); - } - - String id = null; - if ( input != null ) - { - IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); - IEditorDescriptor descriptor = registry.getDefaultEditor( input.getName() ); - id = ( descriptor != null ) ? descriptor.getId() : CUIPlugin.EDITOR_ID; - } - if ( CUIPlugin.EDITOR_ID.equals( id ) ) - { - return CDebugEditor.EDITOR_ID; - } - return id; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILabelProvider#getImage(Object) - */ - public Image getImage( Object element ) - { - Image baseImage = getBaseImage( element ); - if ( baseImage != null ) - { - ImageDescriptor[] overlays = new ImageDescriptor[] { null, null, null, null }; - if ( element instanceof ICDebugElementErrorStatus && !((ICDebugElementErrorStatus)element).isOK() ) - { - switch( ((ICDebugElementErrorStatus)element).getSeverity() ) - { - case ICDebugElementErrorStatus.WARNING: - overlays[OverlayImageDescriptor.BOTTOM_LEFT] = CDebugImages.DESC_OVRS_WARNING; - break; - case ICDebugElementErrorStatus.ERROR: - overlays[OverlayImageDescriptor.BOTTOM_LEFT] = CDebugImages.DESC_OVRS_ERROR; - break; - } - } - if ( element instanceof ICVariable && ((ICVariable)element).isArgument() ) - overlays[OverlayImageDescriptor.TOP_RIGHT] = CDebugImages.DESC_OVRS_ARGUMENT; - - return fImageCache.getImageFor( new OverlayImageDescriptor( baseImage, overlays ) ); - } - return null; - } - - private Image getBaseImage( Object element ) - { - if ( element instanceof IDebugTarget ) - { - ICDebugTargetType targetType = (ICDebugTargetType)((IDebugTarget)element).getAdapter( ICDebugTargetType.class ); - int type = ( targetType != null ) ? targetType.getTargetType() : ICDebugTargetType.TARGET_TYPE_UNKNOWN; - if ( type == ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP ) - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED ) ); - } - IDebugTarget target = (IDebugTarget)element; - if ( target.isTerminated() || target.isDisconnected() ) - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED ) ); - } - else - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_DEBUG_TARGET ) ); - } - } - if ( element instanceof IThread ) - { - ICDebugTargetType targetType = (ICDebugTargetType)((IThread)element).getDebugTarget().getAdapter( ICDebugTargetType.class ); - int type = ( targetType != null ) ? targetType.getTargetType() : ICDebugTargetType.TARGET_TYPE_UNKNOWN; - if ( type == ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP ) - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED ) ); - } - IThread thread = (IThread)element; - if ( thread.isSuspended() ) - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED ) ); - } - else if (thread.isTerminated()) - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED ) ); - } - else - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_RUNNING ) ); - } - } - - try - { - if ( element instanceof IMarker ) - { - IBreakpoint bp = getBreakpoint( (IMarker)element ); - if ( bp != null && bp instanceof ICBreakpoint ) - { - return getBreakpointImage( (ICBreakpoint)bp ); - } - } - if ( element instanceof ICBreakpoint ) - { - return getBreakpointImage( (ICBreakpoint)element ); - } - if ( element instanceof IRegisterGroup ) - { - return getRegisterGroupImage( (IRegisterGroup)element ); - } - if ( element instanceof IExpression ) - { - return getExpressionImage( (IExpression)element ); - } - if ( element instanceof IRegister ) - { - return getRegisterImage( (IRegister)element ); - } - if ( element instanceof IVariable ) - { - return getVariableImage( (IVariable)element ); - } - if ( element instanceof ICSharedLibrary ) - { - return getSharedLibraryImage( (ICSharedLibrary)element ); - } - } - catch( CoreException e ) - { - } - return super.getImage( element ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILabelProvider#getText(Object) - */ - public String getText( Object element ) - { - StringBuffer baseText = new StringBuffer( getBaseText( element ) ); - if ( element instanceof ICDebugElementErrorStatus && !((ICDebugElementErrorStatus)element).isOK() ) - { - baseText.append( getFormattedString( " <{0}>", ((ICDebugElementErrorStatus)element).getMessage() ) ); - } - return baseText.toString(); - } - - private String getBaseText( Object element ) - { - boolean showQualified= isShowQualifiedNames(); - StringBuffer label = new StringBuffer(); - try - { - if ( element instanceof ICSharedLibrary ) - { - label.append( getSharedLibraryText( (ICSharedLibrary)element, showQualified ) ); - return label.toString(); - } - - if ( element instanceof IRegisterGroup ) - { - label.append( ((IRegisterGroup)element).getName() ); - return label.toString(); - } - - if ( element instanceof IVariable ) - { - label.append( getVariableText( (IVariable)element ) ); - return label.toString(); - } - - if ( element instanceof IStackFrame ) - { - label.append( getStackFrameText( (IStackFrame)element, showQualified ) ); - return label.toString(); - } - - if ( element instanceof IMarker ) - { - IBreakpoint breakpoint = getBreakpoint( (IMarker)element ); - if ( breakpoint != null ) - { - return getBreakpointText( breakpoint, showQualified ); - } - return null; - } - - if ( element instanceof IBreakpoint ) - { - return getBreakpointText( (IBreakpoint)element, showQualified ); - } - - if ( element instanceof IDebugTarget ) - label.append( getTargetText( (IDebugTarget)element, showQualified ) ); - else if ( element instanceof IThread ) - label.append( getThreadText( (IThread)element, showQualified ) ); - - if ( element instanceof ITerminate ) - { - if ( ((ITerminate)element).isTerminated() ) - { - label.insert( 0, "" ); - return label.toString(); - } - } - if ( element instanceof IDisconnect ) - { - if ( ((IDisconnect)element).isDisconnected() ) - { - label.insert( 0, "" ); - return label.toString(); - } - } - - if ( label.length() > 0 ) - { - return label.toString(); - } - } - catch( DebugException e ) - { - return ""; - } - catch( CoreException e ) - { - CDebugUIPlugin.log( e ); - } - - return null; - } - - protected boolean isShowQualifiedNames() - { - Boolean showQualified = (Boolean)fAttributes.get( DISPLAY_FULL_PATHS ); - showQualified = showQualified == null ? Boolean.FALSE : showQualified; - return showQualified.booleanValue(); - } - - protected boolean isShowVariableTypeNames() - { - Boolean show = (Boolean)fAttributes.get( DISPLAY_VARIABLE_TYPE_NAMES ); - show = show == null ? Boolean.FALSE : show; - return show.booleanValue(); - } - - protected String getTargetText( IDebugTarget target, boolean qualified ) throws DebugException - { - if ( target instanceof IState ) - { - IState state = (IState)target; - switch( state.getCurrentStateId() ) - { - case IState.EXITED: - { - Object info = state.getCurrentStateInfo(); - String label = target.getName() + " (Exited"; - if ( info != null && info instanceof ICDISignalExitInfo) - { - ICDISignalExitInfo sigInfo = (ICDISignalExitInfo)info; - label += MessageFormat.format( ": Signal ''{0}'' received. Description: {1}.", - new String[] { sigInfo.getName(), sigInfo.getDescription() } ); - } - else if ( info != null && info instanceof ICDIExitInfo ) - { - label += ". Exit code = " + ((ICDIExitInfo)info).getCode(); - } - return label + ")"; - } - case IState.SUSPENDED: - { - Object info = state.getCurrentStateInfo(); - if ( info != null && info instanceof ICDISignalReceived ) - { - ICDISignal signal = ((ICDISignalReceived)info).getSignal(); - String label = target.getName() + - MessageFormat.format( " (Signal ''{0}'' received. Description: {1})", - new String[] { signal.getName(), signal.getDescription() } ); - return label; - } - if ( info != null && info instanceof ICDIWatchpointTrigger ) - { - String label = target.getName() + - MessageFormat.format( " (Watchpoint triggered. Old value: ''{0}''. New value: ''{1}'')", - new String[] { ((ICDIWatchpointTrigger)info).getOldValue(), - ((ICDIWatchpointTrigger)info).getNewValue() } ); - return label; - } - if ( info != null && info instanceof ICDIWatchpointScope ) - { - return target.getName() + " (Watchpoint is out of scope)"; - } - if ( info != null && info instanceof ICDIBreakpointHit ) - { - return target.getName() + " (Breakpoint hit)"; - } - if ( info != null && info instanceof ICDISharedLibraryEvent ) - { - return target.getName() + " (Stopped on shared library event)"; - } - if ( info != null && info instanceof ICDISession ) - { - return target.getName() + " (Suspended)"; - } - } - } - } - return target.getName(); - } - - protected String getThreadText( IThread thread, boolean qualified ) throws DebugException - { - ICDebugTargetType targetType = (ICDebugTargetType)thread.getDebugTarget().getAdapter( ICDebugTargetType.class ); - int type = ( targetType != null ) ? targetType.getTargetType() : ICDebugTargetType.TARGET_TYPE_UNKNOWN; - if ( type == ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP ) - { - return getFormattedString( "Thread [{0}]", thread.getName() ); - } - if ( thread.isTerminated() ) - { - return getFormattedString( "Thread [{0}] (Terminated)", thread.getName() ); - } - if ( thread.isStepping() ) - { - return getFormattedString( "Thread [{0}] (Stepping)", thread.getName()); - } - if ( !thread.isSuspended() ) - { - return getFormattedString( "Thread [{0}] (Running)", thread.getName() ); - } - return getFormattedString( "Thread [{0}] (Suspended)", thread.getName() ); - } - - protected String getStackFrameText( IStackFrame stackFrame, boolean qualified ) throws DebugException - { - IStackFrameInfo info = (IStackFrameInfo)stackFrame.getAdapter( IStackFrameInfo.class ); - if ( info != null ) - { - StringBuffer label = new StringBuffer(); - label.append( info.getLevel() ); - label.append( ' ' ); - - String function = info.getFunction(); - if ( function != null ) - { - function = function.trim(); - if ( function.length() > 0 ) - { - label.append( function ); - label.append( "() " ); - if ( info.getFile() != null ) - { - IPath path = new Path( info.getFile() ); - if ( !path.isEmpty() ) - { - label.append( "at " ); - label.append( ( qualified ? path.toOSString() : path.lastSegment() ) ); - label.append( ":" ); - if ( info.getFrameLineNumber() != 0 ) - label.append( info.getFrameLineNumber() ); - } - } - } - } - if ( isEmpty( function ) ) - label.append( "" ); - return label.toString(); - } - return ( stackFrame.getAdapter( IDummyStackFrame.class ) != null ) ? - getDummyStackFrameLabel( stackFrame ) : stackFrame.getName(); - } - - private String getDummyStackFrameLabel( IStackFrame stackFrame ) - { - return DUMMY_STACKFRAME_LABEL; - } - - protected String getVariableText( IVariable var ) throws DebugException - { - StringBuffer label = new StringBuffer(); - if ( var instanceof ICVariable ) - { - ICType type = null; - try - { - type = ((ICVariable)var).getType(); - } - catch( DebugException e ) - { - // don't display type - } - if ( type != null && isShowVariableTypeNames() ) - { - String typeName = getVariableTypeName( type ); - if ( typeName != null && typeName.length() > 0 ) - { - label.append( typeName ); - if ( type.isArray() ) - { - int[] dims = type.getArrayDimensions(); - for ( int i = 0; i < dims.length; ++i ) - { - label.append( '[' ); - label.append( dims[i] ); - label.append( ']' ); - } - } - label.append( ' ' ); - } - } - if ( !((ICVariable)var).isEnabled() ) - label.append( " " ); - String name = var.getName(); - if ( name != null ) - label.append( name.trim() ); - IValue value = var.getValue(); - if ( value instanceof ICValue && value.getValueString() != null ) - { - String valueString = value.getValueString().trim(); - if ( type != null && type.isCharacter() ) - { - if ( valueString.length() == 0 ) - valueString = "."; - label.append( "= " ); - label.append( valueString ); - } - else if ( type != null && type.isFloatingPointType() ) - { - Number floatingPointValue = CDebugUtils.getFloatingPointValue( (ICValue)value ); - if ( CDebugUtils.isNaN( floatingPointValue ) ) - valueString = "NAN"; - if ( CDebugUtils.isPositiveInfinity( floatingPointValue ) ) - valueString = "Infinity"; - if ( CDebugUtils.isNegativeInfinity( floatingPointValue ) ) - valueString = "-Infinity"; - label.append( "= " ); - label.append( valueString ); - } - else if ( type == null || ( !type.isArray() && !type.isStructure() ) ) - { - if ( valueString.length() > 0 ) - { - label.append( "= " ); - label.append( valueString ); - } - } - } - } - return label.toString(); - } - - protected String getSharedLibraryText( ICSharedLibrary library, boolean qualified ) throws DebugException - { - String label = new String(); - IPath path = new Path( library.getFileName() ); - if ( !path.isEmpty() ) - label += ( qualified ? path.toOSString() : path.lastSegment() ); - return label; - } - - /** - * Plug in the single argument to the resource String for the key to - * get a formatted resource String. - * - */ - public static String getFormattedString( String key, String arg ) - { - return getFormattedString( key, new String[]{ arg } ); - } - - /** - * Plug in the arguments to the resource String for the key to get - * a formatted resource String. - * - */ - public static String getFormattedString(String string, String[] args) - { - return MessageFormat.format( string, args ); - } - - protected Image getBreakpointImage( ICBreakpoint breakpoint ) throws CoreException - { - if ( breakpoint instanceof ICLineBreakpoint ) - { - return getLineBreakpointImage( (ICLineBreakpoint)breakpoint ); - } - if ( breakpoint instanceof ICWatchpoint ) - { - return getWatchpointImage( (ICWatchpoint)breakpoint ); - } - return null; - } - - protected Image getLineBreakpointImage( ICLineBreakpoint breakpoint ) throws CoreException - { - ImageDescriptor descriptor = null; - if ( breakpoint.isEnabled() ) - { - descriptor = DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_BREAKPOINT ); - } - else - { - descriptor = DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED ); - } - return fImageCache.getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeBreakpointOverlays( breakpoint ) ) ); - } - - protected Image getWatchpointImage( ICWatchpoint watchpoint ) throws CoreException - { - ImageDescriptor descriptor = null; - if ( watchpoint.isEnabled() ) - { - if ( watchpoint.isReadType() && !watchpoint.isWriteType() ) - descriptor = CDebugImages.DESC_OBJS_READ_WATCHPOINT_ENABLED; - else if ( !watchpoint.isReadType() && watchpoint.isWriteType() ) - descriptor = CDebugImages.DESC_OBJS_WRITE_WATCHPOINT_ENABLED; - else - descriptor = CDebugImages.DESC_OBJS_WATCHPOINT_ENABLED; - } - else - { - if ( watchpoint.isReadType() && !watchpoint.isWriteType() ) - descriptor = CDebugImages.DESC_OBJS_READ_WATCHPOINT_DISABLED; - else if ( !watchpoint.isReadType() && watchpoint.isWriteType() ) - descriptor = CDebugImages.DESC_OBJS_WRITE_WATCHPOINT_DISABLED; - else - descriptor = CDebugImages.DESC_OBJS_WATCHPOINT_DISABLED; - } - return fImageCache.getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeBreakpointOverlays( watchpoint ) ) ); - } - - protected IBreakpoint getBreakpoint( IMarker marker ) - { - return DebugPlugin.getDefault().getBreakpointManager().getBreakpoint( marker ); - } - - protected String getBreakpointText( IBreakpoint breakpoint, boolean qualified ) throws CoreException - { - if ( breakpoint instanceof ICAddressBreakpoint ) - { - return getAddressBreakpointText( (ICAddressBreakpoint)breakpoint, qualified ); - } - if ( breakpoint instanceof ICFunctionBreakpoint ) - { - return getFunctionBreakpointText( (ICFunctionBreakpoint)breakpoint, qualified ); - } - if ( breakpoint instanceof ICLineBreakpoint ) - { - return getLineBreakpointText( (ICLineBreakpoint)breakpoint, qualified ); - } - if ( breakpoint instanceof ICWatchpoint ) - { - return getWatchpointText( (ICWatchpoint)breakpoint, qualified ); - } - return ""; //$NON-NLS-1$ - } - - protected String getLineBreakpointText( ICLineBreakpoint breakpoint, boolean qualified ) throws CoreException - { - StringBuffer label = new StringBuffer(); - appendResourceName( breakpoint, label, qualified ); - appendLineNumber( breakpoint, label ); - appendIgnoreCount( breakpoint, label ); - appendCondition( breakpoint, label ); - return label.toString(); - } - - protected String getWatchpointText( ICWatchpoint watchpoint, boolean qualified ) throws CoreException - { - StringBuffer label = new StringBuffer(); - appendResourceName( watchpoint, label, qualified ); - appendWatchExpression( watchpoint, label ); - appendIgnoreCount( watchpoint, label ); - appendCondition( watchpoint, label ); - return label.toString(); - } - - protected String getAddressBreakpointText( ICAddressBreakpoint breakpoint, boolean qualified ) throws CoreException - { - StringBuffer label = new StringBuffer(); - appendResourceName( breakpoint, label, qualified ); - appendAddress( breakpoint, label ); - appendIgnoreCount( breakpoint, label ); - appendCondition( breakpoint, label ); - return label.toString(); - } - - protected String getFunctionBreakpointText( ICFunctionBreakpoint breakpoint, boolean qualified ) throws CoreException - { - StringBuffer label = new StringBuffer(); - appendResourceName( breakpoint, label, qualified ); - appendFunction( breakpoint, label ); - appendIgnoreCount( breakpoint, label ); - appendCondition( breakpoint, label ); - return label.toString(); - } - - protected StringBuffer appendResourceName( ICBreakpoint breakpoint, StringBuffer label, boolean qualified ) throws CoreException - { - IPath path = breakpoint.getMarker().getResource().getLocation(); - if ( !path.isEmpty() ) - label.append( qualified ? path.toOSString() : path.lastSegment() ); - return label; - } - - protected StringBuffer appendLineNumber( ICLineBreakpoint breakpoint, StringBuffer label ) throws CoreException - { - int lineNumber = breakpoint.getLineNumber(); - if ( lineNumber > 0 ) - { - label.append( " [" ); //$NON-NLS-1$ - label.append( "line:" ); - label.append( ' ' ); - label.append( lineNumber ); - label.append( ']' ); - } - return label; - } - - protected StringBuffer appendAddress( ICAddressBreakpoint breakpoint, StringBuffer label ) throws CoreException - { - try - { - long address = Long.parseLong( breakpoint.getAddress() ); - label.append( " [address: " ); - label.append( CDebugUtils.toHexAddressString( address ) ); - label.append( ']' ); - } - catch( NumberFormatException e ) - { - } - return label; - } - - protected StringBuffer appendFunction( ICFunctionBreakpoint breakpoint, StringBuffer label ) throws CoreException - { - String function = breakpoint.getFunction(); - if ( function != null && function.trim().length() > 0 ) - { - label.append( " [" ); //$NON-NLS-1$ - label.append( "function:" ); - label.append( ' ' ); - label.append( function.trim() ); - label.append( ']' ); - } - return label; - } - - protected StringBuffer appendIgnoreCount( ICBreakpoint breakpoint, StringBuffer label ) throws CoreException - { - int ignoreCount = breakpoint.getIgnoreCount(); - if ( ignoreCount > 0 ) - { - label.append( " [" ); //$NON-NLS-1$ - label.append( "ignore count:" ); //$NON-NLS-1$ - label.append( ' ' ); - label.append( ignoreCount ); - label.append( ']' ); - } - return label; - } - - protected void appendCondition( ICBreakpoint breakpoint, StringBuffer buffer ) throws CoreException - { - String condition = breakpoint.getCondition(); - if ( condition != null && condition.length() > 0 ) - { - buffer.append( " if " ); - buffer.append( condition ); - } - } - - private void appendWatchExpression( ICWatchpoint watchpoint, StringBuffer label ) throws CoreException - { - String expression = watchpoint.getExpression(); - if ( expression != null && expression.length() > 0 ) - { - label.append( " at \'" ); - label.append( expression ); - label.append( '\'' ); - } - } - - private ImageDescriptor[] computeBreakpointOverlays( ICBreakpoint breakpoint ) - { - ImageDescriptor[] overlays = new ImageDescriptor[] { null, null, null, null }; - try - { - if ( breakpoint.isConditional() ) - { - overlays[OverlayImageDescriptor.TOP_LEFT] = ( breakpoint.isEnabled() ) ? - CDebugImages.DESC_OVRS_BREAKPOINT_CONDITIONAL : CDebugImages.DESC_OVRS_BREAKPOINT_CONDITIONAL_DISABLED; - } - if ( breakpoint.isInstalled() ) - { - overlays[OverlayImageDescriptor.BOTTOM_LEFT] = ( breakpoint.isEnabled() ) ? - CDebugImages.DESC_OVRS_BREAKPOINT_INSTALLED : CDebugImages.DESC_OVRS_BREAKPOINT_INSTALLED_DISABLED; - } - if ( breakpoint instanceof ICAddressBreakpoint ) - { - overlays[OverlayImageDescriptor.TOP_RIGHT] = ( breakpoint.isEnabled() ) ? - CDebugImages.DESC_OVRS_ADDRESS_BREAKPOINT : CDebugImages.DESC_OVRS_ADDRESS_BREAKPOINT_DISABLED; - } - if ( breakpoint instanceof ICFunctionBreakpoint ) - { - overlays[OverlayImageDescriptor.TOP_RIGHT] = ( breakpoint.isEnabled() ) ? - CDebugImages.DESC_OVRS_FUNCTION_BREAKPOINT : CDebugImages.DESC_OVRS_FUNCTION_BREAKPOINT_DISABLED; - } - } - catch( CoreException e ) - { - CDebugUIPlugin.log( e ); - } - return overlays; - } - - protected Image getVariableImage( IVariable element ) throws DebugException - { - if ( element instanceof ICVariable ) - { - ICType type = null; - try - { - type = ((ICVariable)element).getType(); - } - catch( DebugException e ) - { - // use default image - } - if ( type != null && (type.isPointer() || type.isReference()) ) - return fDebugImageRegistry.get( ( ((ICVariable)element).isEnabled() ) ? - CDebugImages.DESC_OBJS_VARIABLE_POINTER : CDebugImages.DESC_OBJS_VARIABLE_POINTER_DISABLED ); - else if ( ((ICVariable)element).hasChildren() ) - return fDebugImageRegistry.get( ( ((ICVariable)element).isEnabled() ) ? - CDebugImages.DESC_OBJS_VARIABLE_AGGREGATE : CDebugImages.DESC_OBJS_VARIABLE_AGGREGATE_DISABLED ); - else - return fDebugImageRegistry.get( ( ((ICVariable)element).isEnabled() ) ? - CDebugImages.DESC_OBJS_VARIABLE_SIMPLE : CDebugImages.DESC_OBJS_VARIABLE_SIMPLE_DISABLED ); - } - return null; - } - - protected Image getRegisterGroupImage( IRegisterGroup element ) throws DebugException - { - return fDebugImageRegistry.get( CDebugImages.DESC_OBJS_REGISTER_GROUP ); - } - - protected Image getRegisterImage( IRegister element ) throws DebugException - { - return fDebugImageRegistry.get( CDebugImages.DESC_OBJS_REGISTER ); - } - - protected Image getExpressionImage( IExpression element ) throws DebugException - { - return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_EXPRESSION ) ); - } - - protected Image getSharedLibraryImage( ICSharedLibrary element ) throws DebugException - { - if ( element.areSymbolsLoaded() ) - { - return fImageCache.getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( CDebugImages.DESC_OBJS_LOADED_SHARED_LIBRARY ), - new ImageDescriptor[] { null, CDebugImages.DESC_OVRS_SYMBOLS, null, null } ) ); - } - return CDebugUIPlugin.getImageDescriptorRegistry().get( CDebugImages.DESC_OBJS_SHARED_LIBRARY ); - } - - protected DisassemblyEditorInput getDisassemblyEditorInput( ICAddressBreakpoint breakpoint ) - { - IDebugTarget[] targets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets(); - for ( int i = 0; i < targets.length; ++i ) - { - IResource resource = breakpoint.getMarker().getResource(); - if ( resource != null && resource instanceof IFile && - targets[i].getAdapter( IExecFileInfo.class )!= null && - ((IFile)resource).getLocation().toOSString().equals( ((IExecFileInfo)targets[i].getAdapter( IExecFileInfo.class )).getExecFile().getLocation().toOSString() ) ) - { - if ( targets[i].getAdapter( DisassemblyManager.class ) != null ) - { - try - { - long address = Long.parseLong( breakpoint.getAddress() ); - IStorage storage = (IStorage)(((DisassemblyManager)targets[i].getAdapter( DisassemblyManager.class )).getSourceElement( address ) ); - if ( storage != null ) - return new DisassemblyEditorInput( storage ); - } - catch( NumberFormatException e ) - { - } - catch( CoreException e ) - { - } - } - } - } - return null; - } - - private String getVariableTypeName( ICType type ) - { - String typeName = type.getName(); - if ( type.isArray() && typeName != null ) - { - int index = typeName.indexOf( '[' ); - if ( index != -1 ) - return typeName.substring( 0, index ).trim(); - } - return typeName; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() - */ - public void dispose() - { - fImageCache.disposeAll(); - } - - private boolean isEmpty( String str ) - { - return ( str == null || str.length() == 0 ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTValueDetailProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTValueDetailProvider.java deleted file mode 100644 index d77196f1c42..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTValueDetailProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.cdt.debug.core.model.ICValue; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.ui.IValueDetailListener; -import org.eclipse.swt.widgets.Display; - -/** - * Enter type comment. - * - * @since Jun 4, 2003 - */ -public class CDTValueDetailProvider -{ - //The shared instance. - private static CDTValueDetailProvider fInstance = null; - - public static CDTValueDetailProvider getDefault() - { - if ( fInstance == null ) - { - fInstance = new CDTValueDetailProvider(); - } - return fInstance; - } - - public void computeDetail( final IValue value, final IValueDetailListener listener ) - { - if ( value instanceof ICValue ) - { - Display.getCurrent().asyncExec( new Runnable() - { - public void run() - { - listener.detailComputed( value, ((ICValue)value).evaluateAsExpression() ); - } - } ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java deleted file mode 100644 index 5398e836405..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui; - -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; - -/** - * - * A registry that maps ImageDescriptors to Image. - * - * @since Aug 30, 2002 - */ -public class CDebugImageDescriptorRegistry -{ - private HashMap fRegistry = new HashMap(10); - private Display fDisplay; - - /** - * Creates a new image descriptor registry for the current or default display, - * respectively. - */ - public CDebugImageDescriptorRegistry() - { - this( CDebugUIPlugin.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 diaplay the display the images managed by this registry are allocated for - */ - public CDebugImageDescriptorRegistry( Display display ) - { - fDisplay = display; - Assert.isNotNull( fDisplay ); - hookDisplay(); - } - - /** - * Returns the image associated with the given image descriptor. - * - * @param descriptor the image descriptor for which the registry manages an image - * @return the image associated with the image descriptor or null - * if the image descriptor can't create the requested image. - */ - public Image get( ImageDescriptor descriptor ) - { - if ( descriptor == null ) - descriptor = ImageDescriptor.getMissingImageDescriptor(); - - Image result = (Image)fRegistry.get( descriptor ); - if ( result != null ) - return result; - - Assert.isTrue( fDisplay == CDebugUIPlugin.getStandardDisplay(), "Allocating image for wrong display" ); - result = descriptor.createImage(); - if ( result != null ) - fRegistry.put( descriptor, result ); - return result; - } - - /** - * Disposes all images managed by this registry. - */ - public void dispose() - { - for ( Iterator iter = fRegistry.values().iterator(); iter.hasNext(); ) - { - Image image = (Image)iter.next(); - image.dispose(); - } - fRegistry.clear(); - } - - private void hookDisplay() - { - fDisplay.disposeExec( new Runnable() - { - public void run() - { - dispose(); - } - } ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java deleted file mode 100644 index b933118fc02..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; - -/** - * - * Bundle of most images used by the C/C++ debug plug-in. - * - * @since Aug 30, 2002 - */ -public class CDebugImages -{ - private static final String NAME_PREFIX = "org.eclipse.cdt.debug.ui."; //$NON-NLS-1$ - private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length(); - - private static URL fgIconBaseURL = null; - - static - { - String pathSuffix = "icons/full/"; //$NON-NLS-1$ - try - { - fgIconBaseURL = new URL( CDebugUIPlugin.getDefault().getDescriptor().getInstallURL(), pathSuffix ); - } - catch( MalformedURLException e ) - { - CDebugUIPlugin.log( e ); - } - } - - // The plugin registry - private static ImageRegistry fgImageRegistry = null; - private static HashMap fgAvoidSWTErrorMap = null; - - /* - * Available cached Images in the C/C++ debug plug-in image registry. - */ - public static final String IMG_OVRS_BREAKPOINT_INSTALLED = NAME_PREFIX + "installed_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_BREAKPOINT_INSTALLED_DISABLED = NAME_PREFIX + "installed_ovr_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_BREAKPOINT_CONDITIONAL = NAME_PREFIX + "conditional_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_BREAKPOINT_CONDITIONAL_DISABLED = NAME_PREFIX + "conditional_ovr_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_ADDRESS_BREAKPOINT = NAME_PREFIX + "address_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_ADDRESS_BREAKPOINT_DISABLED = NAME_PREFIX + "address_ovr_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_FUNCTION_BREAKPOINT = NAME_PREFIX + "function_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_FUNCTION_BREAKPOINT_DISABLED = NAME_PREFIX + "function_ovr_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_ERROR = NAME_PREFIX + "error_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_WARNING = NAME_PREFIX + "warning_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_SYMBOLS = NAME_PREFIX + "symbols_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_VARIABLE_CASTED = NAME_PREFIX + "casttype_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OVRS_ARGUMENT = NAME_PREFIX + "argument_ovr.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_ADDRESS_BREAKPOINT_ENABLED = NAME_PREFIX + "addrbrkp_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_ADDRESS_BREAKPOINT_DISABLED = NAME_PREFIX + "addrbrkpd_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_FUNCTION_BREAKPOINT_ENABLED = NAME_PREFIX + "funbrkp_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_FUNCTION_BREAKPOINT_DISABLED = NAME_PREFIX + "funbrkpd_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_WATCHPOINT_ENABLED = NAME_PREFIX + "readwrite_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_WATCHPOINT_DISABLED = NAME_PREFIX + "readwrite_obj_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_READ_WATCHPOINT_ENABLED = NAME_PREFIX + "read_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_READ_WATCHPOINT_DISABLED = NAME_PREFIX + "read_obj_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_WRITE_WATCHPOINT_ENABLED = NAME_PREFIX + "write_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_WRITE_WATCHPOINT_DISABLED = NAME_PREFIX + "write_obj_disabled.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_SIMPLE = NAME_PREFIX + "var_simple.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_SIMPLE_DISABLED = NAME_PREFIX + "vard_simple.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_AGGREGATE = NAME_PREFIX + "var_aggr.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_AGGREGATE_DISABLED = NAME_PREFIX + "vard_aggr.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_POINTER = NAME_PREFIX + "var_pointer.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_POINTER_DISABLED = NAME_PREFIX + "vard_pointer.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_VARIABLE_STRING = NAME_PREFIX + "var_string.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_REGISTER_GROUP = NAME_PREFIX + "registergroup_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_REGISTER = NAME_PREFIX + "register_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_DISASSEMBLY = NAME_PREFIX + "disassembly_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_PROJECT = NAME_PREFIX + "project_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_CLOSED_PROJECT = NAME_PREFIX + "cproject_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_FOLDER = NAME_PREFIX + "folder_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_LOADED_SHARED_LIBRARY = NAME_PREFIX + "library_syms_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_SHARED_LIBRARY = NAME_PREFIX + "library_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_SIGNAL = NAME_PREFIX + "signal_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_WORKSPACE_SOURCE_FILE = NAME_PREFIX + "prj_file_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_EXTERNAL_SOURCE_FILE = NAME_PREFIX + "ext_file_obj.gif"; //$NON-NLS-1$ - - public static final String IMG_LCL_TYPE_NAMES = NAME_PREFIX + "tnames_co.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_CHANGE_REGISTER_VALUE = NAME_PREFIX + "change_reg_value_co.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_AUTO_REFRESH = NAME_PREFIX + "autorefresh_mem.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_REFRESH = NAME_PREFIX + "refresh_mem.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_MEMORY_SAVE = NAME_PREFIX + "memory_update.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_MEMORY_CLEAR = NAME_PREFIX + "memory_clear.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_SHOW_ASCII = NAME_PREFIX + "show_ascii.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_LOAD_ALL_SYMBOLS = NAME_PREFIX + "load_all_symbols_co.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_CAST_TO_TYPE = NAME_PREFIX + "casttotype_co.gif"; //$NON-NLS-1$ - public static final String IMG_LCL_DISPLAY_AS_ARRAY = NAME_PREFIX + "showasarray_co.gif"; //$NON-NLS-1$ - - public static final String IMG_TOOLS_ADD_DIR_SOURCE_LOCATION = NAME_PREFIX + "adddirsource_wiz.gif"; //$NON-NLS-1$ - public static final String IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION = NAME_PREFIX + "addprjsource_wiz.gif"; //$NON-NLS-1$ - - public static final String IMG_WIZBAN_ADD_SOURCE_LOCATION = NAME_PREFIX + "add_source_location_wiz.gif"; //$NON-NLS-1$ - public static final String IMG_WIZBAN_ADD_DIR_SOURCE_LOCATION = NAME_PREFIX + "add_dir_source_location_wiz.gif"; //$NON-NLS-1$ - public static final String IMG_WIZBAN_ADD_PRJ_SOURCE_LOCATION = NAME_PREFIX + "add_prj_source_location_wiz.gif"; //$NON-NLS-1$ - - /* - * Set of predefined Image Descriptors. - */ - private static final String T_OBJ = "obj16"; //$NON-NLS-1$ - private static final String T_OVR = "ovr16"; //$NON-NLS-1$ - private static final String T_WIZBAN = "wizban"; //$NON-NLS-1$ - private static final String T_LCL = "lcl16"; //$NON-NLS-1$ - private static final String T_CLCL = "clcl16"; //$NON-NLS-1$ - private static final String T_CTOOL = "ctool16"; //$NON-NLS-1$ -// private static final String T_CVIEW = "cview16"; //$NON-NLS-1$ -// private static final String T_DTOOL = "dtool16"; //$NON-NLS-1$ -// private static final String T_ETOOL = "etool16"; //$NON-NLS-1$ - - public static final ImageDescriptor DESC_OVRS_ERROR = createManaged( T_OVR, IMG_OVRS_ERROR ); - public static final ImageDescriptor DESC_OVRS_WARNING = createManaged( T_OVR, IMG_OVRS_WARNING ); - public static final ImageDescriptor DESC_OVRS_BREAKPOINT_INSTALLED = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_INSTALLED ); - public static final ImageDescriptor DESC_OVRS_BREAKPOINT_INSTALLED_DISABLED = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_INSTALLED_DISABLED ); - public static final ImageDescriptor DESC_OVRS_BREAKPOINT_CONDITIONAL = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_CONDITIONAL ); - public static final ImageDescriptor DESC_OVRS_BREAKPOINT_CONDITIONAL_DISABLED = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_CONDITIONAL_DISABLED ); - public static final ImageDescriptor DESC_OVRS_ADDRESS_BREAKPOINT = createManaged( T_OVR, IMG_OVRS_ADDRESS_BREAKPOINT ); - public static final ImageDescriptor DESC_OVRS_ADDRESS_BREAKPOINT_DISABLED = createManaged( T_OVR, IMG_OVRS_ADDRESS_BREAKPOINT_DISABLED ); - public static final ImageDescriptor DESC_OVRS_FUNCTION_BREAKPOINT = createManaged( T_OVR, IMG_OVRS_FUNCTION_BREAKPOINT ); - public static final ImageDescriptor DESC_OVRS_FUNCTION_BREAKPOINT_DISABLED = createManaged( T_OVR, IMG_OVRS_FUNCTION_BREAKPOINT_DISABLED ); - public static final ImageDescriptor DESC_OVRS_SYMBOLS = createManaged( T_OVR, IMG_OVRS_SYMBOLS ); - public static final ImageDescriptor DESC_OVRS_VARIABLE_CASTED = createManaged( T_OVR, IMG_OVRS_VARIABLE_CASTED ); - public static final ImageDescriptor DESC_OVRS_ARGUMENT = createManaged( T_OVR, IMG_OVRS_ARGUMENT ); - public static final ImageDescriptor DESC_OBJS_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_ENABLED ); - public static final ImageDescriptor DESC_OBJS_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_DISABLED ); - public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_ENABLED ); - public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_DISABLED ); - public static final ImageDescriptor DESC_OBJS_WRITE_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WRITE_WATCHPOINT_ENABLED ); - public static final ImageDescriptor DESC_OBJS_WRITE_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_WRITE_WATCHPOINT_DISABLED ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_SIMPLE = createManaged( T_OBJ, IMG_OBJS_VARIABLE_SIMPLE ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_SIMPLE_DISABLED = createManaged( T_OBJ, IMG_OBJS_VARIABLE_SIMPLE_DISABLED ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_AGGREGATE = createManaged( T_OBJ, IMG_OBJS_VARIABLE_AGGREGATE ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_AGGREGATE_DISABLED = createManaged( T_OBJ, IMG_OBJS_VARIABLE_AGGREGATE_DISABLED ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_POINTER = createManaged( T_OBJ, IMG_OBJS_VARIABLE_POINTER ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_POINTER_DISABLED = createManaged( T_OBJ, IMG_OBJS_VARIABLE_POINTER_DISABLED ); - public static final ImageDescriptor DESC_OBJS_VARIABLE_STRING = createManaged( T_OBJ, IMG_OBJS_VARIABLE_STRING ); - public static final ImageDescriptor DESC_OBJS_REGISTER_GROUP = createManaged( T_OBJ, IMG_OBJS_REGISTER_GROUP ); - public static final ImageDescriptor DESC_OBJS_REGISTER = createManaged( T_OBJ, IMG_OBJS_REGISTER ); - public static final ImageDescriptor DESC_OBJS_DISASSEMBLY = createManaged( T_OBJ, IMG_OBJS_DISASSEMBLY ); - public static final ImageDescriptor DESC_OBJS_PROJECT = createManaged( T_OBJ, IMG_OBJS_PROJECT ); - public static final ImageDescriptor DESC_OBJS_CLOSED_PROJECT = createManaged( T_OBJ, IMG_OBJS_CLOSED_PROJECT ); - public static final ImageDescriptor DESC_OBJS_FOLDER = createManaged( T_OBJ, IMG_OBJS_FOLDER ); - public static final ImageDescriptor DESC_OBJS_LOADED_SHARED_LIBRARY = createManaged( T_OBJ, IMG_OBJS_LOADED_SHARED_LIBRARY ); - public static final ImageDescriptor DESC_OBJS_SHARED_LIBRARY = createManaged( T_OBJ, IMG_OBJS_SHARED_LIBRARY ); - public static final ImageDescriptor DESC_OBJS_SIGNAL = createManaged( T_OBJ, IMG_OBJS_SIGNAL ); - public static final ImageDescriptor DESC_OBJS_WORKSPACE_SOURCE_FILE = createManaged( T_OBJ, IMG_OBJS_WORKSPACE_SOURCE_FILE ); - public static final ImageDescriptor DESC_OBJS_EXTERNAL_SOURCE_FILE = createManaged( T_OBJ, IMG_OBJS_EXTERNAL_SOURCE_FILE ); - public static final ImageDescriptor DESC_WIZBAN_ADD_SOURCE_LOCATION = createManaged( T_WIZBAN, IMG_WIZBAN_ADD_SOURCE_LOCATION ); //$NON-NLS-1$ - public static final ImageDescriptor DESC_WIZBAN_ADD_PRJ_SOURCE_LOCATION = createManaged( T_WIZBAN, IMG_WIZBAN_ADD_PRJ_SOURCE_LOCATION ); //$NON-NLS-1$ - public static final ImageDescriptor DESC_WIZBAN_ADD_DIR_SOURCE_LOCATION = createManaged( T_WIZBAN, IMG_WIZBAN_ADD_DIR_SOURCE_LOCATION ); //$NON-NLS-1$ - public static final ImageDescriptor DESC_TOOLS_ADD_PRJ_SOURCE_LOCATION = createManaged( T_CTOOL, IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION ); //$NON-NLS-1$ - public static final ImageDescriptor DESC_TOOLS_ADD_DIR_SOURCE_LOCATION = createManaged( T_CTOOL, IMG_TOOLS_ADD_DIR_SOURCE_LOCATION ); //$NON-NLS-1$ - public static final ImageDescriptor DESC_LCL_CAST_TO_TYPE = createManaged( T_CLCL, IMG_LCL_CAST_TO_TYPE ); //$NON-NLS-1$ - public static final ImageDescriptor DESC_LCL_DISPLAY_AS_ARRAY = createManaged( T_CLCL, IMG_LCL_DISPLAY_AS_ARRAY ); //$NON-NLS-1$ - - /** - * Returns the image managed under the given key in this registry. - * - * @param key the image's key - * @return the image managed under the given key - */ - public static Image get( String key ) - { - return getImageRegistry().get( key ); - } - - /** - * Sets the three image descriptors for enabled, disabled, and hovered to an action. The actions - * are retrieved from the *tool16 folders. - */ - public static void setToolImageDescriptors( IAction action, String iconName ) - { - setImageDescriptors( action, "tool16", iconName ); //$NON-NLS-1$ - } - - /** - * Sets the three image descriptors for enabled, disabled, and hovered to an action. The actions - * are retrieved from the *lcl16 folders. - */ - public static void setLocalImageDescriptors( IAction action, String iconName ) - { - setImageDescriptors( action, T_LCL, iconName ); - } - - /* - * Helper method to access the image registry from the JDIDebugUIPlugin class. - */ - /* package */ static ImageRegistry getImageRegistry() - { - if ( fgImageRegistry == null ) - { - fgImageRegistry = new ImageRegistry(); - for ( Iterator iter = fgAvoidSWTErrorMap.keySet().iterator(); iter.hasNext(); ) - { - String key = (String)iter.next(); - fgImageRegistry.put( key, (ImageDescriptor)fgAvoidSWTErrorMap.get( key ) ); - } - fgAvoidSWTErrorMap = null; - } - return fgImageRegistry; - } - - //---- Helper methods to access icons on the file system -------------------------------------- - - private static void setImageDescriptors( IAction action, String type, String relPath ) - { - relPath = relPath.substring( NAME_PREFIX_LENGTH ); - try - { - ImageDescriptor id = ImageDescriptor.createFromURL( makeIconFileURL( "d" + type, relPath ) ); //$NON-NLS-1$ - if ( id != null ) - action.setDisabledImageDescriptor( id ); - } - catch( MalformedURLException e ) - { - CDebugUIPlugin.log( e ); - } - - try - { - ImageDescriptor id = ImageDescriptor.createFromURL( makeIconFileURL( "c" + type, relPath ) ); //$NON-NLS-1$ - if ( id != null ) - action.setHoverImageDescriptor( id ); - } - catch( MalformedURLException e ) - { - CDebugUIPlugin.log( e ); - } - - action.setImageDescriptor( create( "e" + type, relPath ) ); //$NON-NLS-1$ - } - - private static ImageDescriptor createManaged( String prefix, String name ) - { - try - { - ImageDescriptor result = ImageDescriptor.createFromURL( makeIconFileURL( prefix, name.substring( NAME_PREFIX_LENGTH ) ) ); - if ( fgAvoidSWTErrorMap == null ) - { - fgAvoidSWTErrorMap = new HashMap(); - } - fgAvoidSWTErrorMap.put( name, result ); - if ( fgImageRegistry != null ) - { - CDebugUIPlugin.logErrorMessage( "Internal Error: Image registry already defined" ); //$NON-NLS-1$ - } - return result; - } - catch( MalformedURLException e ) - { - CDebugUIPlugin.log( e ); - return ImageDescriptor.getMissingImageDescriptor(); - } - } - - private static ImageDescriptor create( String prefix, String name ) - { - try - { - return ImageDescriptor.createFromURL( makeIconFileURL( prefix, name ) ); - } - catch( MalformedURLException e ) - { - CDebugUIPlugin.log( e ); - return ImageDescriptor.getMissingImageDescriptor(); - } - } - - private static URL makeIconFileURL( String prefix, String name ) throws MalformedURLException - { - if ( fgIconBaseURL == null ) - throw new MalformedURLException(); - - StringBuffer buffer = new StringBuffer( prefix ); - buffer.append( '/' ); - buffer.append( name ); - return new URL( fgIconBaseURL, buffer.toString() ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java deleted file mode 100644 index 321ca1bb7c3..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Region; - -/** - * - * Enter type comment. - * - * @since Jul 30, 2002 - */ -public class CDebugUIUtils -{ - static public String toHexAddressString( long address ) - { - String tmp = Long.toHexString( address ); - char[] prefix = new char[10 - tmp.length()]; - prefix[0] = '0'; - prefix[1] = 'x'; - for ( int i = 2; i < prefix.length; ++i ) - prefix[i] = '0'; - return new String( prefix ) + tmp; - } - - static public IRegion findWord( IDocument document, int offset ) - { - int start = -1; - int end = -1; - - try - { - int pos = offset; - char c; - - while( pos >= 0 ) - { - c = document.getChar( pos ); - if ( !Character.isJavaIdentifierPart( c ) ) - break; - --pos; - } - - start = pos; - - pos = offset; - int length = document.getLength(); - - while( pos < length ) - { - c = document.getChar( pos ); - if ( !Character.isJavaIdentifierPart( c ) ) - break; - ++pos; - } - - end = pos; - - } - catch( BadLocationException x ) - { - } - - if ( start > -1 && end > -1 ) - { - if ( start == offset && end == offset ) - return new Region( offset, 0 ); - else if ( start == offset ) - return new Region( start, end - start ); - else - return new Region( start + 1, end - start - 1 ); - } - - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java deleted file mode 100644 index 6afb13c32c8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ColorManager.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -/** - * - * Color manager for C/C++ Debug UI. - * - * @since Jul 23, 2002 - */ -public class ColorManager -{ - private static ColorManager fgColorManager; - - private ColorManager() - { - } - - public static ColorManager getDefault() - { - if ( fgColorManager == null ) - { - fgColorManager = new ColorManager(); - } - return fgColorManager; - } - - protected Map fColorTable = new HashMap( 10 ); - - public Color getColor( RGB rgb ) - { - Color color = (Color)fColorTable.get( rgb ); - if ( color == null ) - { - color = new Color( Display.getCurrent(), rgb ); - fColorTable.put( rgb, color ); - } - return color; - } - - public void dispose() - { - Iterator e = fColorTable.values().iterator(); - while( e.hasNext() ) - ((Color)e.next()).dispose(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java deleted file mode 100644 index 417a4f57999..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.dialogs.ErrorDialog; - -/** - * - * Enter type comment. - * - * @since Sep 25, 2002 - */ -public class ErrorStatusHandler implements IStatusHandler -{ - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) - */ - public Object handleStatus( final IStatus status, Object source ) throws CoreException - { - if ( status != null && source != null && source instanceof IDebugTarget ) - { - final String title = ((IDebugTarget)source).getName(); - CDebugUIPlugin.getStandardDisplay().asyncExec( - new Runnable() - { - public void run() - { - ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status ); - } - } ); - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java deleted file mode 100644 index df0ad8a4f2f..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugHelpContextIds.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; - -/** - * - * Help context ids for the C/C++ debug ui. - *

            - * This interface contains constants only; it is not intended to be implemented - * or extended. - *

            - * - * @since Jul 23, 2002 - */ -public interface ICDebugHelpContextIds -{ - public static final String PREFIX = ICDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$ - - // Actions - public static final String CHANGE_REGISTER_VALUE_ACTION = PREFIX + "change_register_value_action_context"; //$NON-NLS-1$ - public static final String SHOW_TYPES_ACTION = PREFIX + "show_types_action_context"; //$NON-NLS-1$ - public static final String REFRESH_MEMORY_ACTION = PREFIX + "refresh_memory_action_context"; //$NON-NLS-1$ - public static final String AUTO_REFRESH_MEMORY_ACTION = PREFIX + "auto_refresh_memory_action_context"; //$NON-NLS-1$ - public static final String MEMORY_CLEAR_ACTION = PREFIX + "memory_clear_action_context"; //$NON-NLS-1$ - public static final String MEMORY_SAVE_ACTION = PREFIX + "memory_save_action_context"; //$NON-NLS-1$ - public static final String MEMORY_SHOW_ASCII_ACTION = PREFIX + "memory_show_ascii_action_context"; //$NON-NLS-1$ - public static final String REFRESH_SHARED_LIBRARIES_ACTION = PREFIX + "refresh_shared_libraries_action_context"; //$NON-NLS-1$ - public static final String AUTO_REFRESH_SHARED_LIBRARIES_ACTION = PREFIX + "auto_refresh_shared_libraries_action_context"; //$NON-NLS-1$ - public static final String LOAD_SYMBOLS_FOR_ALL = PREFIX + "load_symbols_for_all_action_context"; //$NON-NLS-1$ - public static final String REFRESH_REGISTERS_ACTION = PREFIX + "refresh_registers_action_context"; //$NON-NLS-1$ - public static final String AUTO_REFRESH_REGISTERS_ACTION = PREFIX + "auto_refresh_registers_action_context"; //$NON-NLS-1$ - - // Views - public static final String REGISTERS_VIEW = PREFIX + "registers_view_context"; //$NON-NLS-1$ - public static final String MEMORY_VIEW = PREFIX + "memory_view_context"; //$NON-NLS-1$ - public static final String SHARED_LIBRARIES_VIEW = PREFIX + "shared_libraries_view_context"; //$NON-NLS-1$ - public static final String SIGNALS_VIEW = PREFIX + "signals_view_context"; //$NON-NLS-1$ - - // Preference pages - public static final String SOURCE_PREFERENCE_PAGE = PREFIX + "source_preference_page_context"; //$NON-NLS-1$ - public static final String SHARED_LIBRARIES_PREFERENCE_PAGE = PREFIX + "shared_libraries_preference_page_context"; //$NON-NLS-1$ - public static final String MEMORY_PREFERENCE_PAGE = PREFIX + "memory_preference_page_context"; //$NON-NLS-1$ - public static final String REGISTERS_PREFERENCE_PAGE = PREFIX + "registers_preference_page_context"; //$NON-NLS-1$ - public static final String C_DEBUG_PREFERENCE_PAGE = PREFIX + "c_debug_preference_page_context"; //$NON-NLS-1$ -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugUIInternalConstants.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugUIInternalConstants.java deleted file mode 100644 index e3934ee48fd..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ICDebugUIInternalConstants.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -/** - * - * Definitions of the internal constants for C/C++ Debug UI plug-in. - * - * @since Jul 25, 2002 - */ -public interface ICDebugUIInternalConstants -{ - /* - * Memory view constants. - */ - public static final int MEMORY_SIZE_BYTE = 1; - public static final int MEMORY_SIZE_HALF_WORD = 2; - public static final int MEMORY_SIZE_WORD = 4; - public static final int MEMORY_SIZE_DOUBLE_WORD = 8; - public static final int MEMORY_SIZE_FLOAT = 8; - public static final int MEMORY_SIZE_DOUBLE_FLOAT = 16; - - public static final int MEMORY_FORMAT_HEX = 0; - public static final int MEMORY_FORMAT_BINARY = 1; - public static final int MEMORY_FORMAT_OCTAL = 2; - public static final int MEMORY_FORMAT_SIGNED_DECIMAL = 3; - public static final int MEMORY_FORMAT_UNSIGNED_DECIMAL = 4; - - public static final int MEMORY_BYTES_PER_ROW_4 = 4; - public static final int MEMORY_BYTES_PER_ROW_8 = 8; - public static final int MEMORY_BYTES_PER_ROW_16 = 16; - public static final int MEMORY_BYTES_PER_ROW_32 = 32; - public static final int MEMORY_BYTES_PER_ROW_64 = 64; - public static final int MEMORY_BYTES_PER_ROW_128 = 128; - - public static final int DEFAULT_MEMORY_NUMBER_OF_BYTES = 512; - public static final int DEFAULT_MEMORY_SIZE = MEMORY_SIZE_BYTE; - public static final int DEFAULT_MEMORY_FORMAT = MEMORY_FORMAT_HEX; - public static final int DEFAULT_MEMORY_BYTES_PER_ROW = MEMORY_BYTES_PER_ROW_16; - public static final boolean DEFAULT_MEMORY_DISPLAY_ASCII = true; -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java deleted file mode 100644 index 2bf237d4182..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.dialogs.MessageDialog; - -/** - * - * Enter type comment. - * - * @since Sep 25, 2002 - */ -public class InfoStatusHandler implements IStatusHandler -{ - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) - */ - public Object handleStatus( IStatus status, Object source ) throws CoreException - { - if ( status != null && source != null && source instanceof IDebugTarget ) - { - final String title = ((IDebugTarget)source).getName(); - final String message = status.getMessage(); - CDebugUIPlugin.getStandardDisplay().asyncExec( - new Runnable() - { - public void run() - { - MessageDialog.openInformation( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); - } - } ); - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java deleted file mode 100644 index cd8374870d7..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageCache.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.swt.graphics.Image; - -/** - * Maintains a cache of overlay images. - * - * @since May 30, 2003 - */ -public class OverlayImageCache -{ - private Map cache = new HashMap(); - - /** - * Returns and caches an image corresponding to the specified image descriptor. - * - * @param imageDecsriptor the image descriptor - * @return the image - */ - public Image getImageFor( OverlayImageDescriptor imageDescriptor ) - { - Image image = (Image)cache.get( imageDescriptor ); - if ( image == null ) - { - image = imageDescriptor.createImage(); - cache.put( imageDescriptor, image ); - } - return image; - } - - /** - * Disposes of all images in the cache. - */ - public void disposeAll() - { - for ( Iterator it = cache.values().iterator(); it.hasNext(); ) - { - Image image = (Image)it.next(); - image.dispose(); - } - cache.clear(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageDescriptor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageDescriptor.java deleted file mode 100644 index f7d25428682..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/OverlayImageDescriptor.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui; - -import java.util.Arrays; - -import org.eclipse.jface.resource.CompositeImageDescriptor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.Point; - -public class OverlayImageDescriptor extends CompositeImageDescriptor -{ - static final int DEFAULT_WIDTH = 16; - static final int DEFAULT_HEIGHT = 16; - - public static final int TOP_LEFT = 0; - public static final int TOP_RIGHT = 1; - public static final int BOTTOM_LEFT = 2; - public static final int BOTTOM_RIGHT = 3; - - // the base image - private Image fBase; - - // the overlay images - private ImageDescriptor[] fOverlays; - - // the size - private Point fSize; - - public OverlayImageDescriptor( Image base, ImageDescriptor[] overlays ) - { - fBase = base; - fOverlays = overlays; - fSize = new Point( DEFAULT_WIDTH, DEFAULT_HEIGHT ); - } - - public OverlayImageDescriptor( Image base, ImageDescriptor[] overlays, Point size ) - { - fBase = base; - fOverlays = overlays; - fSize = size; - } - - /** - * Draw the fOverlays for the reciever. - */ - protected void drawOverlays( ImageDescriptor[] overlays ) - { - Point size = getSize(); - - for ( int i = 0; i < overlays.length; i++ ) - { - ImageDescriptor overlay = overlays[i]; - if ( overlay == null ) - continue; - ImageData overlayData = overlay.getImageData(); - //Use the missing descriptor if it is not there. - if ( overlayData == null ) - overlayData = ImageDescriptor.getMissingImageDescriptor().getImageData(); - switch( i ) - { - case TOP_LEFT: - drawImage( overlayData, 0, 0 ); - break; - case TOP_RIGHT: - drawImage( overlayData, size.x - overlayData.width, 0 ); - break; - case BOTTOM_LEFT: - drawImage( overlayData, 0, size.y - overlayData.height ); - break; - case BOTTOM_RIGHT: - drawImage( overlayData, size.x - overlayData.width, size.y - overlayData.height ); - break; - } - } - } - - public boolean equals( Object o ) - { - if ( !( o instanceof OverlayImageDescriptor ) ) - return false; - OverlayImageDescriptor other = (OverlayImageDescriptor)o; - return fBase.equals( other.fBase ) && Arrays.equals( fOverlays, other.fOverlays ); - } - - public int hashCode() - { - int code = fBase.hashCode(); - for ( int i = 0; i < fOverlays.length; i++ ) - { - if ( fOverlays[i] != null ) - code ^= fOverlays[i].hashCode(); - } - return code; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int) - */ - protected void drawCompositeImage( int width, int height ) - { - drawImage( fBase.getImageData(), 0, 0 ); - drawOverlays( fOverlays ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.resource.CompositeImageDescriptor#getSize() - */ - protected Point getSize() - { - return fSize; - } - -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/PixelConverter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/PixelConverter.java deleted file mode 100644 index 7ff1efc9e44..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/PixelConverter.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.eclipse.cdt.debug.internal.ui; - -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -All rights reserved. This program and the accompanying materials -are made available under the terms of the Common Public License v0.5 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v05.html - -Contributors: - IBM Corporation - Initial implementation -**********************************************************************/ - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.swt.graphics.FontMetrics; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.widgets.Control; - -public class PixelConverter -{ - private FontMetrics fFontMetrics; - - public PixelConverter( Control control ) - { - GC gc = new GC( control ); - gc.setFont( control.getFont() ); - fFontMetrics = gc.getFontMetrics(); - gc.dispose(); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int) - */ - public int convertHeightInCharsToPixels( int chars ) - { - return Dialog.convertHeightInCharsToPixels( fFontMetrics, chars ); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int) - */ - public int convertHorizontalDLUsToPixels( int dlus ) - { - return Dialog.convertHorizontalDLUsToPixels( fFontMetrics, dlus ); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int) - */ - public int convertVerticalDLUsToPixels( int dlus ) - { - return Dialog.convertVerticalDLUsToPixels( fFontMetrics, dlus ); - } - - /** - * @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int) - */ - public int convertWidthInCharsToPixels( int chars ) - { - return Dialog.convertWidthInCharsToPixels( fFontMetrics, chars ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java deleted file mode 100644 index c14000f29ef..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.dialogs.MessageDialog; - -/** - * - * Enter type comment. - * - * @since Sep 25, 2002 - */ -public class QuestionStatusHandler implements IStatusHandler -{ - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IStatusHandler#handleStatus(IStatus, Object) - */ - public Object handleStatus( IStatus status, Object source ) throws CoreException - { - final boolean result[] = new boolean[1]; - if ( status != null && source != null && source instanceof IDebugTarget ) - { - final String title = ((IDebugTarget)source).getName(); - final String message = status.getMessage(); - CDebugUIPlugin.getStandardDisplay().syncExec( - new Runnable() - { - public void run() - { - result[0] = MessageDialog.openQuestion( CDebugUIPlugin.getActiveWorkbenchShell(), title, message ); - } - } ); - } - return new Boolean( result[0] ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/SWTUtil.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/SWTUtil.java deleted file mode 100644 index c88acf148b1..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/SWTUtil.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui; - -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.DragSource; -import org.eclipse.swt.dnd.DropTarget; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Caret; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Widget; - -/** - * Utility class to simplify access to some SWT resources. - */ -public class SWTUtil -{ - - /** - * Returns the standard display to be used. The method first checks, if - * the thread calling this method has an associated disaply. If so, this - * display is returned. Otherwise the method returns the default display. - */ - public static Display getStandardDisplay() - { - Display display; - display = Display.getCurrent(); - if ( display == null ) - display = Display.getDefault(); - return display; - } - - /** - * Returns the shell for the given widget. If the widget doesn't represent - * a SWT object that manage a shell, null is returned. - * - * @return the shell for the given widget - */ - public static Shell getShell( Widget widget ) - { - if ( widget instanceof Control ) - return ((Control) widget).getShell(); - if ( widget instanceof Caret ) - return ((Caret) widget).getParent().getShell(); - if ( widget instanceof DragSource ) - return ((DragSource) widget).getControl().getShell(); - if ( widget instanceof DropTarget ) - return ((DropTarget) widget).getControl().getShell(); - if ( widget instanceof Menu ) - return ((Menu) widget).getParent().getShell(); - if ( widget instanceof ScrollBar ) - return ((ScrollBar) widget).getParent().getShell(); - - return null; - } - - /** - * Returns a width hint for a button control. - */ - public static int getButtonWidthHint( Button button ) - { - PixelConverter converter = new PixelConverter( button ); - int widthHint = converter.convertHorizontalDLUsToPixels( IDialogConstants.BUTTON_WIDTH ); - return Math.max( widthHint, button.computeSize( SWT.DEFAULT, SWT.DEFAULT, true ).x ); - } - - /** - * Returns a height hint for a button control. - */ - public static int getButtonHeigthHint( Button button ) - { - PixelConverter converter = new PixelConverter( button ); - return converter.convertVerticalDLUsToPixels( IDialogConstants.BUTTON_HEIGHT ); - } - - /** - * Sets width and height hint for the button control. - * Note: This is a NOP if the button's layout data is not - * an instance of GridData. - * - * @param the button for which to set the dimension hint - */ - public static void setButtonDimensionHint( Button button ) - { - Assert.isNotNull( button ); - Object gd = button.getLayoutData(); - if ( gd instanceof GridData ) - { - ((GridData) gd).heightHint = getButtonHeigthHint( button ); - ((GridData) gd).widthHint = getButtonWidthHint( button ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractBreakpointRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractBreakpointRulerAction.java deleted file mode 100644 index ac498d62664..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractBreakpointRulerAction.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * - * Enter type comment. - * - * @since Aug 26, 2002 - */ -public abstract class AbstractBreakpointRulerAction extends Action implements IUpdate -{ - private IVerticalRulerInfo fInfo; - - private ITextEditor fTextEditor; - - private IBreakpoint fBreakpoint; - - protected IBreakpoint determineBreakpoint() - { - IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints( CDebugCorePlugin.getUniqueIdentifier() ); - for ( int i = 0; i < breakpoints.length; i++ ) - { - IBreakpoint breakpoint = breakpoints[i]; - if ( breakpoint instanceof ICLineBreakpoint ) - { - ICLineBreakpoint cBreakpoint = (ICLineBreakpoint)breakpoint; - try - { - if ( breakpointAtRulerLine( cBreakpoint ) ) - { - return cBreakpoint; - } - } - catch( CoreException ce ) - { - CDebugUIPlugin.log( ce ); - continue; - } - } - } - return null; - } - - protected IVerticalRulerInfo getInfo() - { - return fInfo; - } - - protected void setInfo( IVerticalRulerInfo info ) - { - fInfo = info; - } - - protected ITextEditor getTextEditor() - { - return fTextEditor; - } - - protected void setTextEditor( ITextEditor textEditor ) - { - fTextEditor = textEditor; - } - - /** - * Returns the resource for which to create the marker, - * or null if there is no applicable resource. - * - * @return the resource for which to create the marker or null - */ - protected IResource getResource() - { - IEditorInput input = fTextEditor.getEditorInput(); - IResource resource = (IResource)input.getAdapter( IFile.class ); - if ( resource == null ) - { - resource = (IResource)input.getAdapter( IResource.class ); - } - return resource; - } - - protected boolean breakpointAtRulerLine( ICLineBreakpoint cBreakpoint ) throws CoreException - { - AbstractMarkerAnnotationModel model = getAnnotationModel(); - if ( model != null ) - { - Position position = model.getMarkerPosition( cBreakpoint.getMarker() ); - if ( position != null ) - { - IDocumentProvider provider = getTextEditor().getDocumentProvider(); - IDocument doc = provider.getDocument( getTextEditor().getEditorInput() ); - try - { - int markerLineNumber = doc.getLineOfOffset( position.getOffset() ); - int rulerLine = getInfo().getLineOfLastMouseButtonActivity(); - if ( rulerLine == markerLineNumber ) - { - if ( getTextEditor().isDirty() ) - { - return cBreakpoint.getLineNumber() == markerLineNumber + 1; - } - return true; - } - } - catch ( BadLocationException x ) - { - CDebugUIPlugin.log( x ); - } - } - } - - return false; - } - - protected IBreakpoint getBreakpoint() - { - return fBreakpoint; - } - - protected void setBreakpoint( IBreakpoint breakpoint ) - { - fBreakpoint = breakpoint; - } - - /** - * Returns the AbstractMarkerAnnotationModel of the editor's input. - * - * @return the marker annotation model - */ - protected AbstractMarkerAnnotationModel getAnnotationModel() - { - IDocumentProvider provider = fTextEditor.getDocumentProvider(); - IAnnotationModel model = provider.getAnnotationModel( getTextEditor().getEditorInput() ); - if ( model instanceof AbstractMarkerAnnotationModel ) - { - return (AbstractMarkerAnnotationModel)model; - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractDebugActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractDebugActionDelegate.java deleted file mode 100644 index 1823b407e5d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractDebugActionDelegate.java +++ /dev/null @@ -1,319 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.Iterator; - -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.INullSelectionListener; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -public abstract class AbstractDebugActionDelegate implements IWorkbenchWindowActionDelegate, IViewActionDelegate, ISelectionListener, INullSelectionListener { - - /** - * The underlying action for this delegate - */ - private IAction fAction; - /** - * This action's view part, or null - * if not installed in a view. - */ - private IViewPart fViewPart; - - /** - * Cache of the most recent seletion - */ - private IStructuredSelection fSelection; - - /** - * Whether this delegate has been initialized - */ - private boolean fInitialized = false; - - /** - * The window associated with this action delegate - * May be null - */ - protected IWorkbenchWindow fWindow; - - /** - * It's crucial that delegate actions have a zero-arg constructor so that - * they can be reflected into existence when referenced in an action set - * in the plugin's plugin.xml file. - */ - public AbstractDebugActionDelegate() { - } - - /** - * @see IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose(){ - if (getWindow() != null) { - getWindow().getSelectionService().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this); - } - } - - /** - * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init(IWorkbenchWindow window){ - // listen to selection changes in the debug view - setWindow(window); - window.getSelectionService().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this); - } - - /** - * @see IActionDelegate#run(IAction) - */ - public void run(IAction action){ - IStructuredSelection selection= getSelection(); - - final Iterator enum= selection.iterator(); - String pluginId= DebugUIPlugin.getUniqueIdentifier(); - final MultiStatus ms= - new MultiStatus(pluginId, DebugException.REQUEST_FAILED, getStatusMessage(), null); - BusyIndicator.showWhile(Display.getCurrent(), new Runnable() { - public void run() { - while (enum.hasNext()) { - Object element= enum.next(); - try { - doAction(element); - } catch (DebugException e) { - ms.merge(e.getStatus()); - } - } - } - }); - if (!ms.isOK()) { - IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow(); - if (window != null) { - DebugUIPlugin.errorDialog(window.getShell(), getErrorDialogTitle(), getErrorDialogMessage(), ms); - } else { - DebugUIPlugin.log(ms); - } - } - } - - /** - * AbstractDebugActionDelegates come in 2 flavors: IViewActionDelegate, - * IWorkbenchWindowActionDelegate delegates. - *

            - *
              - *
            • IViewActionDelegate delegate: getView() != null
            • - *
            • IWorkbenchWindowActionDelegate: getView == null
            • - *
            - *

            - * Only want to call update(action, selection) for IViewActionDelegates. - * An initialize call to update(action, selection) is made for all flavors to set the initial - * enabled state of the underlying action. - * IWorkbenchWindowActionDelegate's listen to selection changes - * in the debug view only. - *

            - * - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection s) { - boolean wasInitialized= initialize(action, s); - if (!wasInitialized) { - if (getView() != null) { - update(action, s); - } - } - } - - protected void update(IAction action, ISelection s) { - if (s instanceof IStructuredSelection) { - IStructuredSelection ss = (IStructuredSelection)s; - action.setEnabled(getEnableStateForSelection(ss)); - setSelection(ss); - } else { - action.setEnabled(false); - setSelection(StructuredSelection.EMPTY); - } - } - - /** - * Performs the specific action on this element. - */ - protected abstract void doAction(Object element) throws DebugException; - - /** - * Returns the String to use as an error dialog title for - * a failed action. Default is to return null. - */ - protected String getErrorDialogTitle(){ - return null; - } - /** - * Returns the String to use as an error dialog message for - * a failed action. This message appears as the "Message:" in - * the error dialog for this action. - * Default is to return null. - */ - protected String getErrorDialogMessage(){ - return null; - } - /** - * Returns the String to use as a status message for - * a failed action. This message appears as the "Reason:" - * in the error dialog for this action. - * Default is to return the empty String. - */ - protected String getStatusMessage(){ - return ""; //$NON-NLS-1$ - } - - /** - * @see IViewActionDelegate#init(IViewPart) - */ - public void init(IViewPart view) { - fViewPart = view; - } - - /** - * Returns this action's view part, or null - * if not installed in a view. - * - * @return view part or null - */ - protected IViewPart getView() { - return fViewPart; - } - - /** - * Initialize this delegate, updating this delegate's - * presentation. - * As well, all of the flavors of AbstractDebugActionDelegates need to - * have the initial enabled state set with a call to update(IAction, ISelection). - * - * @param action the presentation for this action - * @return whether the action was initialized - */ - protected boolean initialize(IAction action, ISelection selection) { - if (!isInitialized()) { - setAction(action); - if (getView() == null) { - //update on the selection in the debug view - IWorkbenchWindow window= getWindow(); - if (window != null && window.getShell() != null && !window.getShell().isDisposed()) { - IWorkbenchPage page= window.getActivePage(); - if (page != null) { - selection= page.getSelection(IDebugUIConstants.ID_DEBUG_VIEW); - } - } - } - update(action, selection); - setInitialized(true); - return true; - } - return false; - } - - /** - * Returns the most recent selection - * - * @return structured selection - */ - protected IStructuredSelection getSelection() { - if (getView() != null) { - //cannot used the cached selection in a view - //as the selection can be out of date for context menu - //actions. See bug 14556 - ISelection s= getView().getViewSite().getSelectionProvider().getSelection(); - if (s instanceof IStructuredSelection) { - return (IStructuredSelection)s; - } else { - return StructuredSelection.EMPTY; - } - } - return fSelection; - } - - /** - * Sets the most recent selection - * - * @parm selection structured selection - */ - private void setSelection(IStructuredSelection selection) { - fSelection = selection; - } - - /** - * @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - update(getAction(), selection); - } - - protected void setAction(IAction action) { - fAction = action; - } - - protected IAction getAction() { - return fAction; - } - - protected void setView(IViewPart viewPart) { - fViewPart = viewPart; - } - - protected boolean isInitialized() { - return fInitialized; - } - - protected void setInitialized(boolean initialized) { - fInitialized = initialized; - } - - protected IWorkbenchWindow getWindow() { - return fWindow; - } - - protected void setWindow(IWorkbenchWindow window) { - fWindow = window; - } - - /** - * Return whether the action should be enabled or not based on the given selection. - */ - protected boolean getEnableStateForSelection(IStructuredSelection selection) { - if (selection.size() == 0) { - return false; - } - Iterator enum= selection.iterator(); - while (enum.hasNext()) { - Object element= enum.next(); - if (!isEnabledFor(element)) { - return false; - } - } - return true; - } - - protected boolean isEnabledFor(Object element) { - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractEditorActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractEditorActionDelegate.java deleted file mode 100644 index 4859f7048be..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractEditorActionDelegate.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.ui.IEditorActionDelegate; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.INullSelectionListener; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.actions.ActionDelegate; - -/** - * - * Enter type comment. - * - * @since Sep 19, 2002 - */ -public abstract class AbstractEditorActionDelegate extends ActionDelegate - implements IWorkbenchWindowActionDelegate, - IEditorActionDelegate, - IPartListener, - ISelectionListener, - INullSelectionListener -{ - private IAction fAction; - private IWorkbenchWindow fWorkbenchWindow; - private IWorkbenchPart fTargetPart; - private IDebugTarget fDebugTarget = null; - - /** - * Constructor for AbstractEditorActionDelegate. - */ - public AbstractEditorActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose() - { - IWorkbenchWindow win = getWorkbenchWindow(); - if ( win != null ) - { - win.getPartService().removePartListener( this ); - win.getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init( IWorkbenchWindow window ) - { - setWorkbenchWindow( window ); - IWorkbenchPage page = window.getActivePage(); - if ( page != null ) - { - setTargetPart( page.getActivePart() ); - } - window.getPartService().addPartListener( this ); - window.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - initializeDebugTarget(); - update(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(IAction, IEditorPart) - */ - public void setActiveEditor( IAction action, IEditorPart targetEditor ) - { - setAction( action ); - if ( getWorkbenchWindow() == null ) - { - IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow(); - setWorkbenchWindow( window ); - if ( window != null ) - { - window.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } - } - setTargetPart( targetEditor ); - initializeDebugTarget(); - update(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart) - */ - public void partActivated( IWorkbenchPart part ) - { - setTargetPart( part ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart) - */ - public void partBroughtToTop( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart) - */ - public void partClosed( IWorkbenchPart part ) - { - if ( part == getTargetPart() ) - { - setTargetPart( null ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart) - */ - public void partDeactivated(IWorkbenchPart part) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart) - */ - public void partOpened( IWorkbenchPart part ) - { - } - - public abstract void selectionChanged( IWorkbenchPart part, ISelection selection ); - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public abstract void run( IAction action ); - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) - { - setAction( action ); - update(); - } - - protected IWorkbenchPart getTargetPart() - { - return fTargetPart; - } - - protected void setTargetPart( IWorkbenchPart part ) - { - fTargetPart = part; - } - - protected ISelection getTargetSelection() - { - IWorkbenchPart part = getTargetPart(); - if ( part != null ) - { - ISelectionProvider provider = part.getSite().getSelectionProvider(); - if ( provider != null ) - { - return provider.getSelection(); - } - } - return null; - } - - protected void setDebugTarget( IDebugTarget target ) - { - fDebugTarget = target; - } - - protected IDebugTarget getDebugTarget() - { - return fDebugTarget; - } - - protected IAction getAction() - { - return fAction; - } - - protected void setAction( IAction action ) - { - fAction = action; - } - - protected IWorkbenchWindow getWorkbenchWindow() - { - return fWorkbenchWindow; - } - - protected void setWorkbenchWindow( IWorkbenchWindow workbenchWindow ) - { - fWorkbenchWindow = workbenchWindow; - } - - protected void update() - { - IAction action = getAction(); - if ( action != null ) - { - action.setEnabled( getDebugTarget() != null && getTargetPart() != null ); - } - } - - protected abstract void initializeDebugTarget(); -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java deleted file mode 100644 index 1f391967a5b..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.jface.action.IAction; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IActionDelegate2; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchWindow; - -public abstract class AbstractListenerActionDelegate extends AbstractDebugActionDelegate implements IDebugEventSetListener, IActionDelegate2 { - - /** - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() - * @see org.eclipse.ui.IActionDelegate2#dispose() - */ - public void dispose() { - super.dispose(); - DebugPlugin.getDefault().removeDebugEventListener(this); - } - - /** - * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[]) - */ - public void handleDebugEvents(final DebugEvent[] events) { - if (getWindow() == null || getAction() == null) { - return; - } - Shell shell= getWindow().getShell(); - if (shell == null || shell.isDisposed()) { - return; - } - Runnable r= new Runnable() { - public void run() { - Shell shell= getWindow().getShell(); - if (shell == null || shell.isDisposed()) { - return; - } - for (int i = 0; i < events.length; i++) { - if (events[i].getSource() != null) { - doHandleDebugEvent(events[i]); - } - } - } - }; - - shell.getDisplay().asyncExec(r); - } - - /** - * Default implementation to update on specific debug events. - * Subclasses should override to handle events differently. - */ - protected void doHandleDebugEvent(DebugEvent event) { - switch (event.getKind()) { - case DebugEvent.TERMINATE : - update(getAction(), getSelection()); - break; - case DebugEvent.RESUME : - if (!event.isEvaluation() || !((event.getDetail() & DebugEvent.EVALUATION_IMPLICIT) != 0)) { - update(getAction(), getSelection()); - } - break; - case DebugEvent.SUSPEND : - // Update on suspend events (even for evaluations), in case the user changed - // the selection during an implicit evaluation. - update(getAction(), getSelection()); - break; - } - } - - /** - * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init(IWorkbenchWindow window){ - super.init(window); - DebugPlugin.getDefault().addDebugEventListener(this); - } - - /** - * @see IViewActionDelegate#init(IViewPart) - */ - public void init(IViewPart view) { - super.init(view); - DebugPlugin.getDefault().addDebugEventListener(this); - setWindow(view.getViewSite().getWorkbenchWindow()); - } - - /** - * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) - */ - public void init(IAction action) { - } - - /** - * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event) - */ - public void runWithEvent(IAction action, Event event) { - run(action); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddAddressBreakpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddAddressBreakpointActionDelegate.java deleted file mode 100644 index a7bc28be279..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddAddressBreakpointActionDelegate.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.model.IExecFileInfo; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.dialogs.IInputValidator; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.window.Window; - -/** - * - * Enter type comment. - * - * @since Jan 13, 2003 - */ -public class AddAddressBreakpointActionDelegate extends AbstractListenerActionDelegate -{ - /** - * - * Enter type comment. - * - * @since Jan 13, 2003 - */ - public class AddressValidator implements IInputValidator - { - /** - * Constructor for AddressValidator. - */ - public AddressValidator() - { - super(); - } - - /** - * @see org.eclipse.jface.dialogs.IInputValidator#isValid(String) - */ - public String isValid( String newText ) - { - if ( newText.trim().length() == 0 ) - return ""; - long value = 0; - try - { - value = parseValue( newText.trim() ); - } - catch( NumberFormatException e ) - { - return "Invalid address."; - } - return ( value > 0 ) ? null : "Address can not be 0."; - } - } - - /** - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object) - */ - protected void doAction( Object element ) throws DebugException - { - InputDialog dialog = new InputDialog( getWindow().getShell(), - "Add Address Breakpoint", - "Enter address:", - null, - new AddressValidator() ); - if ( dialog.open() == Window.OK ) - { - CDebugModel.createAddressBreakpoint( ((IExecFileInfo)getDebugTarget( element ).getAdapter( IExecFileInfo.class )).getExecFile(), - parseValue( dialog.getValue().trim() ), - true, - 0, - "", - true ); - } - } - - /** - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object) - */ - protected boolean isEnabledFor( Object element ) - { - if ( element != null && element instanceof IDebugElement ) - { - IDebugTarget target = getDebugTarget( element ); - return ( target != null && !target.isTerminated() && target.getAdapter( IExecFileInfo.class ) != null ); - } - return false; - } - - protected long parseValue( String text ) throws NumberFormatException - { - long value = 0; - if ( text.trim().startsWith( "0x" ) ) - { - value = Integer.parseInt( text.substring( 2 ), 16 ); - } - else - { - value = Integer.parseInt( text ); - } - return value; - } - - private IDebugTarget getDebugTarget( Object element ) - { - if ( element != null && element instanceof IDebugElement ) - { - return ((IDebugElement)element).getDebugTarget(); - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionActionDelegate.java deleted file mode 100644 index f3238d93346..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddExpressionActionDelegate.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; - -/** - * - * Enter type comment. - * - * @since Sep 17, 2002 - */ -public class AddExpressionActionDelegate extends AbstractEditorActionDelegate -{ - /** - * Constructor for AddExpressionActionDelegate. - */ - public AddExpressionActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - String text = getSelectedText(); - ExpressionDialog dlg = new ExpressionDialog( getShell(), text ); - if ( dlg.open() != Window.OK ) - return; - createExpression( dlg.getExpression() ); - } - - protected String getSelectedText() - { - ISelection selection = getTargetSelection(); - if ( selection != null && selection instanceof ITextSelection ) - { - return ((ITextSelection)selection).getText().trim(); - } - return ""; - } - - protected Shell getShell() - { - if ( getTargetPart() != null ) - { - return getTargetPart().getSite().getShell(); - } - else - { - return CDebugUIPlugin.getActiveWorkbenchShell(); - } - } - - private void createExpression( final String text ) - { - final Display display = CDebugUIPlugin.getStandardDisplay(); - if ( display.isDisposed() ) - { - return; - } - display.asyncExec( new Runnable() - { - public void run() - { - try - { - IExpression expression = CDebugModel.createExpression( getDebugTarget(), text ); - DebugPlugin.getDefault().getExpressionManager().addExpression( expression ); - showExpressionView(); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Evaluation of expression failed.", e ); - } - } - } ); - } - - /** - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - IDebugTarget target = null; - if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof IDebugElement ) - { - IDebugTarget target1 = ((IDebugElement)element).getDebugTarget(); - if ( target1 != null && target1 instanceof ICExpressionEvaluator ) - { - target = target1; - } - } - } - setDebugTarget( target ); - update(); - } - } - - protected void initializeDebugTarget() - { - setDebugTarget( null ); - IAdaptable context = DebugUITools.getDebugContext(); - if ( context != null && context instanceof IDebugElement ) - { - IDebugTarget target = ((IDebugElement)context).getDebugTarget(); - if ( target != null && target instanceof ICExpressionEvaluator ) - { - setDebugTarget( target ); - } - } - } - - /** - * Make the expression view visible or open one if required. - * - */ - protected void showExpressionView() - { - IWorkbenchPage page = CDebugUIPlugin.getActivePage(); - if ( page != null ) - { - IViewPart part = page.findView( IDebugUIConstants.ID_EXPRESSION_VIEW ); - if ( part == null ) - { - try - { - page.showView( IDebugUIConstants.ID_EXPRESSION_VIEW ); - } - catch( PartInitException e ) - { - CDebugUIPlugin.log( e.getStatus() ); - } - } - else - { - page.bringToTop( part ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java deleted file mode 100644 index 3003180419d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java +++ /dev/null @@ -1,393 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.model.IExecFileInfo; -import org.eclipse.cdt.debug.core.model.IGlobalVariable; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.ActionDelegate; -import org.eclipse.ui.dialogs.ListSelectionDialog; - -/** - * Enter type comment. - * - * @since: Nov 4, 2002 - */ -public class AddGlobalsActionDelegate extends ActionDelegate - implements IViewActionDelegate, - ISelectionListener, - IPartListener -{ - protected class Global - { - private String fName; - private IPath fPath; - - /** - * Constructor for Global. - */ - public Global( String name, IPath path ) - { - fName = name; - fPath = path; - } - - public String getName() - { - return fName; - } - - public IPath getPath() - { - return fPath; - } - } - - private Global[] fGlobals; - private IViewPart fView = null; - private IAction fAction; - private IStructuredSelection fSelection; - private IStatus fStatus = null; - - /** - * Constructor for AddGlobalsActionDelegate. - */ - public AddGlobalsActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) - */ - public void init( IViewPart view ) - { - fView = view; - view.getSite().getPage().addPartListener( this ); - view.getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) - { - if ( selection instanceof IStructuredSelection ) - { - setSelection( (IStructuredSelection)selection ); - } - else - { - setSelection( null ); - } - update( getAction() ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - final IStructuredSelection selection = getSelection(); - if ( selection != null && selection.size() != 1 ) - return; - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( selection.getFirstElement() ); - setStatus( null ); - } - catch( DebugException e ) - { - setStatus( e.getStatus() ); - } - } - } ); - if ( getStatus() != null && !getStatus().isOK() ) - { - IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( getErrorDialogMessage(), getStatus() ); - } - else - { - CDebugUIPlugin.log( getStatus() ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - setAction( action ); - if ( getView() != null ) - { - update( action ); - } - } - - protected void update( IAction action ) - { - if ( action != null ) - { - action.setEnabled( getEnableStateForSelection( getSelection() ) ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart) - */ - public void partActivated( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart) - */ - public void partBroughtToTop( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart) - */ - public void partClosed( IWorkbenchPart part ) - { - if ( part.equals( getView() ) ) - { - dispose(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart) - */ - public void partDeactivated( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart) - */ - public void partOpened( IWorkbenchPart part ) - { - } - - protected IViewPart getView() - { - return fView; - } - - protected void setView( IViewPart viewPart ) - { - fView = viewPart; - } - - protected void setAction( IAction action ) - { - fAction = action; - } - - protected IAction getAction() - { - return fAction; - } - - private void setSelection( IStructuredSelection selection ) - { - fSelection = selection; - } - - private IStructuredSelection getSelection() - { - return fSelection; - } - - public void dispose() - { - if ( getView() != null ) - { - getView().getViewSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - getView().getViewSite().getPage().removePartListener( this ); - } - } - - protected boolean getEnableStateForSelection( IStructuredSelection selection ) - { - if ( selection == null || selection.size() != 1 ) - { - return false; - } - Object element = selection.getFirstElement(); - return ( element != null && - element instanceof IDebugElement && - ((IDebugElement)element).getDebugTarget().getAdapter( IExecFileInfo.class ) != null ); - } - - private ListSelectionDialog createDialog() - { - return new ListSelectionDialog( getView().getSite().getShell(), - fGlobals, - new IStructuredContentProvider() - { - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - } - - public void dispose() - { - } - - public Object[] getElements( Object parent ) - { - return getGlobals(); - } - }, - new LabelProvider() - { - public String getText( Object element ) - { - if ( element instanceof Global ) - { - String path = ""; - if ( ((Global)element).getPath() != null ) - { - path = ((Global)element).getPath().toString(); - int index = path.lastIndexOf( '/' ); - if ( index != -1 ) - path = path.substring( index + 1 ); - } - return ( path.length() > 0 ? ( '\'' + path + "\'::" ) : "" ) + ((Global)element).getName(); - } - return null; - } - }, - "Select Variables:" ); - } - - protected Global[] getGlobals() - { - return fGlobals; - } - - protected void doAction( Object element ) throws DebugException - { - if ( getView() == null ) - return; - if ( element != null && element instanceof IDebugElement ) - { - IExecFileInfo info = (IExecFileInfo)((IDebugElement)element).getDebugTarget().getAdapter( IExecFileInfo.class ); - if ( info != null ) - { - IGlobalVariable[] globalVars = info.getGlobals(); - fGlobals = new Global[globalVars.length]; - for ( int i = 0; i < globalVars.length; ++i ) - { - fGlobals[i] = new Global( globalVars[i].getName(), globalVars[i].getPath() ); - } - ListSelectionDialog dlg = createDialog(); - if ( dlg.open() == Window.OK ) - { - MultiStatus ms = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, getStatusMessage(), null ); - Object[] selections = dlg.getResult(); - for ( int i = 0; i < selections.length; ++i ) - { - try - { - createExpression( ((IDebugElement)element).getDebugTarget(), (Global)selections[i] ); - } - catch( DebugException e ) - { - ms.merge( e.getStatus() ); - } - } - if ( !ms.isOK() ) - { - throw new DebugException( ms ); - } - } - } - } - } - - protected String getStatusMessage() - { - return "Exceptions occurred attempting to add global variables."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogMessage() - */ - protected String getErrorDialogMessage() - { - return "Add global variables failed."; - } - - protected void setStatus( IStatus status ) - { - fStatus = status; - } - - protected IStatus getStatus() - { - return fStatus; - } - - private void createExpression( IDebugTarget target, Global global ) throws DebugException - { - IExpression expression = CDebugModel.createExpressionForGlobalVariable( target, global.getPath(), global.getName() ); - DebugPlugin.getDefault().getExpressionManager().addExpression( expression ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) - */ - public void init( IAction action ) - { - super.init( action ); - Object element = DebugUITools.getDebugContext(); - setSelection( (element != null ) ? new StructuredSelection( element ) : new StructuredSelection() ); - update( action ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java deleted file mode 100644 index 44f48eaada8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointActionDelegate.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.window.Window; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.actions.ActionDelegate; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Action for adding/removing watchpoints at a selection in the active - * C/C++ or assembly editor. - * - * @since Sep 4, 2002 - */ -public class AddWatchpointActionDelegate extends ActionDelegate - implements IWorkbenchWindowActionDelegate, - IPartListener -{ - private boolean fInitialized = false; - private IAction fAction = null; - private ITextEditor fTextEditor = null; - private IWorkbenchWindow fWorkbenchWindow = null; - private IProject fProject = null; - - /** - * Constructor for AddWatchpointActionDelegate. - */ - public AddWatchpointActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init( IWorkbenchWindow window ) - { - setWorkbenchWindow( window ); - window.getPartService().addPartListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - String expression = getSelectedExpression(); - AddWatchpointDialog dlg = new AddWatchpointDialog( CDebugUIPlugin.getActiveWorkbenchShell(), - true, - false, - expression ); - if ( dlg.open() != Window.OK ) - return; - if ( getTextEditor() != null ) - { - update(); - addWatchpoint( getTextEditor().getEditorInput(), - dlg.getWriteAccess(), - dlg.getReadAccess(), - dlg.getExpression() ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( !fInitialized ) - { - setAction( action ); - if ( getWorkbenchWindow() != null ) - { - IWorkbenchPage page = getWorkbenchWindow().getActivePage(); - if ( page != null ) - { - IEditorPart part = page.getActiveEditor(); - if ( part instanceof ITextEditor ) - { - setTextEditor( (ITextEditor)part ); - } - } - } - fInitialized = true; - } - } - - protected IAction getAction() - { - return fAction; - } - - protected void setAction( IAction action ) - { - fAction = action; - } - - protected IWorkbenchWindow getWorkbenchWindow() - { - return fWorkbenchWindow; - } - - protected void setWorkbenchWindow( IWorkbenchWindow workbenchWindow ) - { - fWorkbenchWindow = workbenchWindow; - } - - protected ITextEditor getTextEditor() - { - return fTextEditor; - } - - protected void setTextEditor( ITextEditor editor ) - { - fTextEditor = editor; - if ( fTextEditor != null ) - { - IEditorInput input = fTextEditor.getEditorInput(); - IFile file = ( input != null && input instanceof IFileEditorInput ) ? ((IFileEditorInput)input).getFile() : null; - setProject( ( file != null ) ? file.getProject() : null ); - } - setEnabledState( editor ); - } - - protected String getSelectedExpression() - { - if ( getTextEditor() != null ) - { - ISelectionProvider sp = getTextEditor().getSelectionProvider(); - if ( sp != null ) - { - ISelection s = sp.getSelection(); - if ( s instanceof ITextSelection ) - { - return ((ITextSelection)s).getText().trim(); - } - } - } - return ""; - } - - protected void update( ISelection selection ) - { - setEnabledState( getTextEditor() ); - } - - protected void update() - { - IAction action = getAction(); - if ( action != null ) - { - action.setEnabled( getTextEditor() != null ); - } - } - - protected void setEnabledState( ITextEditor editor ) - { - if ( getAction() != null ) - { - getAction().setEnabled( editor != null ); - } - } - - protected IProject getProject() - { - return fProject; - } - - protected void setProject( IProject project ) - { - fProject = project; - } - - protected void addWatchpoint( IEditorInput editorInput, boolean write, boolean read, String expression ) - { - if ( getProject() == null ) - return; - IDocument document = getTextEditor().getDocumentProvider().getDocument( editorInput ); - WatchpointExpressionVerifier wev = new WatchpointExpressionVerifier(); - if ( wev.isValidExpression( document, expression ) ) - { - try - { - CDebugModel.createWatchpoint( getProject(), - write, - read, - expression, - true, - 0, - "", - true ); - } - catch( CoreException ce ) - { - CDebugUIPlugin.errorDialog( "Cannot add watchpoint", ce ); - } - } - } - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart) - */ - public void partActivated( IWorkbenchPart part ) - { - if ( part instanceof ITextEditor ) - { - setTextEditor( (ITextEditor)part ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart) - */ - public void partBroughtToTop( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart) - */ - public void partClosed( IWorkbenchPart part ) - { - if ( part == getTextEditor() ) - { - setTextEditor( null ); - if ( getAction() != null ) - { - getAction().setEnabled( false ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart) - */ - public void partDeactivated( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart) - */ - public void partOpened( IWorkbenchPart part ) - { - if ( part instanceof ITextEditor ) - { - if ( getTextEditor() == null ) - { - setTextEditor( (ITextEditor)part ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java deleted file mode 100644 index 80b7e496bfd..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * - * Enter type comment. - * - * @since Sep 4, 2002 - */ -public class AddWatchpointDialog extends Dialog -{ - private Button fBtnOk = null; - private Text fTextExpression; - private Button fChkBtnWrite; - private Button fChkBtnRead; - - private boolean fWrite = true; - private boolean fRead = false; - private String fExpression = ""; - - /** - * Constructor for AddWatchpointDialog. - * @param parentShell - */ - public AddWatchpointDialog( Shell parentShell, boolean write, boolean read, String expression ) - { - super( parentShell ); - fWrite = write; - fRead = read; - if ( expression != null ) - fExpression = expression; - } - - protected void configureShell( Shell shell ) - { - super.configureShell( shell ); - shell.setText( "Add C/C++ Watchpoint" ); - shell.setImage( CDebugImages.get( CDebugImages.IMG_OBJS_WATCHPOINT_ENABLED ) ); - } - - protected Control createContents( Composite parent ) - { - Control control = super.createContents( parent ); - setOkButtonState(); - return control; - } - - protected Control createDialogArea( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout() ); - ((GridLayout)composite.getLayout()).marginWidth = 10; - composite.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - createDataWidgets( composite ); - initializeDataWidgets(); - return composite; - } - - protected void createButtonsForButtonBar( Composite parent ) - { - fBtnOk = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true ); - createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false ); - } - - private void createDataWidgets( Composite parent ) - { - fTextExpression = createExpressionText( parent ); - createAccessWidgets( parent ); - } - - private void initializeDataWidgets() - { - fTextExpression.setText( fExpression ); - fChkBtnRead.setSelection( fRead ); - fChkBtnWrite.setSelection( fWrite ); - setOkButtonState(); - } - - private Text createExpressionText( Composite parent ) - { - Label label = new Label( parent, SWT.RIGHT ); - label.setText( "Expression to watch:" ); - final Text text = new Text( parent, SWT.BORDER ); - GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); - gridData.widthHint = 300; - text.setLayoutData( gridData ); - addModifyListener( text ); - return text; - } - - private void createAccessWidgets( Composite parent ) - { - Group group = new Group( parent, SWT.NONE ); - group.setLayout( new GridLayout() ); - group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - group.setText( "Access" ); - fChkBtnWrite = new Button( group, SWT.CHECK ); - fChkBtnWrite.setText( "Write" ); - addSelectionListener( fChkBtnWrite ); - fChkBtnRead = new Button( group, SWT.CHECK ); - fChkBtnRead.setText( "Read" ); - addSelectionListener( fChkBtnRead ); - } - - private void addSelectionListener( Button button ) - { - button.addSelectionListener( - new SelectionAdapter() - { - public void widgetSelected( SelectionEvent e ) - { - setOkButtonState(); - } - } ); - } - - protected void setOkButtonState() - { - if ( fBtnOk == null ) - return; - fBtnOk.setEnabled( (fChkBtnRead.getSelection() || fChkBtnWrite.getSelection()) && - fTextExpression.getText().trim().length() > 0 ); - } - - private void storeData() - { - fExpression = fTextExpression.getText().trim(); - fRead = fChkBtnRead.getSelection(); - fWrite = fChkBtnWrite.getSelection(); - } - - private void addModifyListener( Text text ) - { - text.addModifyListener( - new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - setOkButtonState(); - } - } ); - } - - public String getExpression() - { - return fExpression; - } - - public boolean getWriteAccess() - { - return fWrite; - } - - public boolean getReadAccess() - { - return fRead; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#okPressed() - */ - protected void okPressed() - { - storeData(); - super.okPressed(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshAction.java deleted file mode 100644 index 04e9df26688..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshAction.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.ICUpdateManager; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Feb 10, 2003 - */ -public class AutoRefreshAction extends Action implements IUpdate -{ - private Viewer fViewer = null; - - /** - * Constructor for AutoRefreshAction. - */ - public AutoRefreshAction( Viewer viewer, String text ) - { - super( text, IAction.AS_CHECK_BOX ); - fViewer = viewer; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - if ( fViewer != null && fViewer.getInput() instanceof IAdaptable ) - { - ICUpdateManager uman = (ICUpdateManager)((IAdaptable)fViewer.getInput()).getAdapter( ICUpdateManager.class ); - if ( uman != null ) - { - setEnabled( uman.canUpdate() ); - setChecked( uman.getAutoModeEnabled() ); - return; - } - } - setEnabled( false ); - setChecked( false ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - if ( fViewer != null && fViewer.getInput() instanceof IAdaptable ) - { - ICUpdateManager uman = (ICUpdateManager)((IAdaptable)fViewer.getInput()).getAdapter( ICUpdateManager.class ); - if ( uman != null ) - { - uman.setAutoModeEnabled( isChecked() ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshMemoryAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshMemoryAction.java deleted file mode 100644 index 8d415332db8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AutoRefreshMemoryAction.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.ui.actions.SelectionProviderAction; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Oct 21, 2002 - */ -public class AutoRefreshMemoryAction extends SelectionProviderAction implements IUpdate -{ - private MemoryViewer fMemoryViewer; - - /** - * Constructor for AutoRefreshMemoryAction. - * @param provider - * @param text - */ - public AutoRefreshMemoryAction( MemoryViewer viewer ) - { - super( viewer, "Auto-Refresh" ); - fMemoryViewer = viewer; - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_AUTO_REFRESH ); - setDescription( "Automatically Refresh Memory Block" ); - setToolTipText( "Auto-Refresh" ); - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.AUTO_REFRESH_MEMORY_ACTION ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canUpdate() ); - setChecked( !fMemoryViewer.isFrozen() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - fMemoryViewer.setFrozen( !isChecked() ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BreakpointLocationVerifier.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BreakpointLocationVerifier.java deleted file mode 100644 index 6ee353e13f1..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BreakpointLocationVerifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.jface.text.IDocument; - -/** - * - * Enter type comment. - * - * @since Aug 29, 2002 - */ -public class BreakpointLocationVerifier -{ - /** - * Returns the line number closest to the given line number that represents a - * valid location for a breakpoint in the given document, or -1 if a valid location - * cannot be found. - */ - public int getValidLineBreakpointLocation( IDocument doc, int lineNumber ) - { - // for now - return lineNumber + 1; - } - - public int getValidAddressBreakpointLocation( IDocument doc, int lineNumber ) - { - // for now - return lineNumber; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferencePage.java deleted file mode 100644 index b616b0d3e21..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferencePage.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; -import org.eclipse.cdt.debug.core.model.ICWatchpoint; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.ILineBreakpoint; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * - * The preference page that is used to present the properties of a breakpoint as - * preferences. A CBreakpointPreferenceStore is used to interface between this - * page and the breakpoint. - * - * @since Aug 27, 2002 - */ -public class CBreakpointPreferencePage extends FieldEditorPreferencePage -{ - class BreakpointIntegerFieldEditor extends IntegerFieldEditor - { - public BreakpointIntegerFieldEditor( String name, String labelText, Composite parent ) - { - super( name, labelText, parent ); - setErrorMessage( "Ignore count must be a positive integer" ); - } - - /** - * @see IntegerFieldEditor#checkState() - */ - protected boolean checkState() - { - Text control = getTextControl(); - if ( !control.isEnabled() ) - { - clearErrorMessage(); - return true; - } - return super.checkState(); - } - - /** - * Overrode here to be package visible. - */ - protected void refreshValidState() - { - super.refreshValidState(); - } - - /** - * Only store if the text control is enabled - * @see FieldEditor#doStore() - */ - protected void doStore() - { - Text text = getTextControl(); - if ( text.isEnabled() ) - { - super.doStore(); - } - } - /** - * Clears the error message from the message line if the error - * message is the error message from this field editor. - */ - protected void clearErrorMessage() - { - if ( getPreferencePage() != null ) - { - String message = getPreferencePage().getErrorMessage(); - if ( message != null ) - { - if ( getErrorMessage().equals( message ) ) - { - super.clearErrorMessage(); - } - } - else - { - super.clearErrorMessage(); - } - } - } - } - - class BreakpointStringFieldEditor extends StringFieldEditor - { - public BreakpointStringFieldEditor( String name, String labelText, Composite parent ) - { - super( name, labelText, parent ); - } - - /** - * @see StringFieldEditor#checkState() - */ - protected boolean checkState() - { - Text control = getTextControl(); - if ( !control.isEnabled() ) - { - clearErrorMessage(); - return true; - } - return super.checkState(); - } - - protected void doStore() - { - Text text = getTextControl(); - if ( text.isEnabled() ) - { - super.doStore(); - } - } - - /** - * @see FieldEditor#refreshValidState() - */ - protected void refreshValidState() - { - super.refreshValidState(); - } - - /** - * Clears the error message from the message line if the error - * message is the error message from this field editor. - */ - protected void clearErrorMessage() - { - if ( getPreferencePage() != null ) - { - String message = getPreferencePage().getErrorMessage(); - if ( message != null ) - { - if ( getErrorMessage().equals( message ) ) - { - super.clearErrorMessage(); - } - - } - else - { - super.clearErrorMessage(); - } - } - } - } - - class LabelFieldEditor extends FieldEditor - { - private Label fTitleLabel; - private Label fValueLabel; - private Composite fBasicComposite; - private String fValue; - private String fTitle; - - public LabelFieldEditor( Composite parent, String title, String value ) - { - fValue = value; - fTitle = title; - this.createControl( parent ); - } - - protected void adjustForNumColumns( int numColumns ) - { - ((GridData)fBasicComposite.getLayoutData()).horizontalSpan = numColumns; - } - - protected void doFillIntoGrid( Composite parent, int numColumns ) - { - fBasicComposite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 2; - fBasicComposite.setLayout( layout ); - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.horizontalAlignment = GridData.FILL; - fBasicComposite.setLayoutData( data ); - - fTitleLabel = new Label( fBasicComposite, SWT.NONE ); - fTitleLabel.setText( fTitle ); - GridData gd = new GridData(); - gd.verticalAlignment = SWT.TOP; - fTitleLabel.setLayoutData( gd ); - - fValueLabel = new Label( fBasicComposite, SWT.WRAP ); - fValueLabel.setText( fValue ); - gd = new GridData(); - fValueLabel.setLayoutData( gd ); - } - - public int getNumberOfControls() - { - return 1; - } - - /** - * The label field editor is only used to present a text label - * on a preference page. - */ - protected void doLoad() - { - } - - protected void doLoadDefault() - { - } - - protected void doStore() - { - } - } - - private BreakpointStringFieldEditor fCondition; - - private Text fIgnoreCountTextControl; - private BreakpointIntegerFieldEditor fIgnoreCount; - - private ICBreakpoint fBreakpoint; - - /** - * Constructor for CBreakpointPreferencePage. - * @param breakpoint - */ - public CBreakpointPreferencePage( ICBreakpoint breakpoint ) - { - super( GRID ); - setBreakpoint( breakpoint ); - noDefaultAndApplyButton(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() - { - ICBreakpoint breakpoint = getBreakpoint(); - - createTypeSpecificLabelFieldEditors( breakpoint ); - - IPreferenceStore store = getPreferenceStore(); - - try - { - String condition= breakpoint.getCondition(); - if ( condition == null ) - { - condition = ""; - } - store.setValue( CBreakpointPreferenceStore.CONDITION, condition ); - - createConditionEditor( getFieldEditorParent() ); - - store.setValue( CBreakpointPreferenceStore.ENABLED, breakpoint.isEnabled() ); - int ignoreCount = breakpoint.getIgnoreCount(); - store.setValue( CBreakpointPreferenceStore.IGNORE_COUNT, ( ignoreCount >= 0 ) ? ignoreCount : 0 ); - - createIgnoreCountEditor( getFieldEditorParent() ); - } - catch( CoreException ce ) - { - CDebugUIPlugin.log( ce ); - } - } - - /** - * Method createTypeSpecificLabelFieldEditors. - * @param breakpoint - */ - private void createTypeSpecificLabelFieldEditors( ICBreakpoint breakpoint ) - { - if ( breakpoint instanceof ICFunctionBreakpoint ) - { - ICFunctionBreakpoint fbrkpt = (ICFunctionBreakpoint)breakpoint; - String function = "Not available"; - try - { - function = fbrkpt.getFunction(); - } - catch( CoreException e ) - { - } - catch( NumberFormatException e ) - { - } - if ( function != null ) - { - addField( createLabelEditor( getFieldEditorParent(), "Function name: ", function ) ); - } - setTitle( "C/C++ Function Breakpoint Properties" ); - } - else if ( breakpoint instanceof ICAddressBreakpoint ) - { - ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint; - String address = "Not available"; - try - { - address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) ); - } - catch( CoreException e ) - { - } - catch( NumberFormatException e ) - { - } - if ( address != null ) - { - addField( createLabelEditor( getFieldEditorParent(), "Address: ", address ) ); - } - setTitle( "C/C++ Address Breakpoint Properties" ); - } - else if ( breakpoint instanceof ILineBreakpoint ) - { - String fileName = breakpoint.getMarker().getResource().getLocation().toOSString(); - if ( fileName != null ) - { - addField( createLabelEditor( getFieldEditorParent(), "File: ", fileName ) ); - } - setTitle( "C/C++ Line Breakpoint Properties" ); - ILineBreakpoint lBreakpoint = (ILineBreakpoint)breakpoint; - StringBuffer lineNumber = new StringBuffer( 4 ); - try - { - int lNumber = lBreakpoint.getLineNumber(); - if ( lNumber > 0 ) - { - lineNumber.append( lNumber ); - } - } - catch( CoreException ce ) - { - CDebugUIPlugin.log( ce ); - } - if ( lineNumber.length() > 0 ) - { - addField( createLabelEditor( getFieldEditorParent(), "Line Number: ", lineNumber.toString() ) ); - } - } - else if ( breakpoint instanceof ICWatchpoint ) - { - String projectName = breakpoint.getMarker().getResource().getLocation().toOSString(); - if ( projectName != null ) - { - addField( createLabelEditor( getFieldEditorParent(), "Project: ", projectName ) ); - } - ICWatchpoint watchpoint = (ICWatchpoint)breakpoint; - String title = ""; - String expression = ""; - try - { - if ( watchpoint.isReadType() && !watchpoint.isWriteType() ) - title = "C/C++ Read Watchpoint Properties"; - else if ( !watchpoint.isReadType() && watchpoint.isWriteType() ) - title = "C/C++ Watchpoint Properties"; - else - title = "C/C++ Access Watchpoint Properties"; - expression = watchpoint.getExpression(); - } - catch( CoreException ce ) - { - CDebugUIPlugin.log( ce ); - } - setTitle( title ); - addField( createLabelEditor( getFieldEditorParent(), "Expression To Watch: ", expression ) ); - } - } - - protected void createConditionEditor( Composite parent ) - { - fCondition = new BreakpointStringFieldEditor( CBreakpointPreferenceStore.CONDITION, "&Condition", parent ); - fCondition.setEmptyStringAllowed( true ); - fCondition.setErrorMessage( "Invalid_condition" ); - addField( fCondition ); - } - - protected void createIgnoreCountEditor( Composite parent ) - { - fIgnoreCount = new BreakpointIntegerFieldEditor( CBreakpointPreferenceStore.IGNORE_COUNT, "&Ignore Count: ", parent ); - fIgnoreCount.setValidRange( 0, Integer.MAX_VALUE ); - fIgnoreCountTextControl = fIgnoreCount.getTextControl( parent ); - try - { - fIgnoreCountTextControl.setEnabled( getBreakpoint().getIgnoreCount() >= 0 ); - } - catch (CoreException ce) - { - CDebugUIPlugin.log( ce ); - } - addField( fIgnoreCount ); - } - - protected FieldEditor createLabelEditor( Composite parent, String title, String value ) - { - return new LabelFieldEditor( parent, title, value ); - } - - protected ICBreakpoint getBreakpoint() - { - return fBreakpoint; - } - - protected void setBreakpoint( ICBreakpoint breakpoint ) - { - fBreakpoint = breakpoint; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java deleted file mode 100644 index eb1a9eec9a2..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPreferenceStore.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.HashMap; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.ListenerList; -import org.eclipse.jface.util.PropertyChangeEvent; - -/** - * - * A preference store that presents the state of the properties - * of a C/C++ breakpoint. Default settings are not supported. - * - * @since Aug 27, 2002 - */ -public class CBreakpointPreferenceStore implements IPreferenceStore -{ - protected final static String ENABLED = "ENABLED"; //$NON-NLS-1$ - protected final static String CONDITION = "CONDITION"; //$NON-NLS-1$ - protected final static String IGNORE_COUNT = "IGNORE_COUNT"; //$NON-NLS-1$ - - protected HashMap fProperties; - private boolean fIsDirty = false; - private ListenerList fListeners; - - /** - * Constructor for CBreakpointPreferenceStore. - */ - public CBreakpointPreferenceStore() - { - fProperties = new HashMap( 3 ); - fListeners = new ListenerList(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#addPropertyChangeListener(IPropertyChangeListener) - */ - public void addPropertyChangeListener( IPropertyChangeListener listener ) - { - fListeners.add( listener ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#contains(String) - */ - public boolean contains( String name ) - { - return fProperties.containsKey( name ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#firePropertyChangeEvent(String, Object, Object) - */ - public void firePropertyChangeEvent( String name, Object oldValue, Object newValue ) - { - Object[] listeners = fListeners.getListeners(); - if ( listeners.length > 0 && (oldValue == null || !oldValue.equals( newValue ) ) ) - { - PropertyChangeEvent pe = new PropertyChangeEvent( this, name, oldValue, newValue ); - for ( int i = 0; i < listeners.length; ++i ) - { - IPropertyChangeListener l = (IPropertyChangeListener)listeners[i]; - l.propertyChange( pe ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getBoolean(String) - */ - public boolean getBoolean( String name ) - { - Object b = fProperties.get( name ); - if ( b instanceof Boolean ) - { - return ((Boolean)b).booleanValue(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultBoolean(String) - */ - public boolean getDefaultBoolean( String name ) - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultDouble(String) - */ - public double getDefaultDouble( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultFloat(String) - */ - public float getDefaultFloat( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultInt(String) - */ - public int getDefaultInt( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultLong(String) - */ - public long getDefaultLong( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultString(String) - */ - public String getDefaultString( String name ) - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getDouble(String) - */ - public double getDouble( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getFloat(String) - */ - public float getFloat( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getInt(String) - */ - public int getInt( String name ) - { - Object i = fProperties.get( name ); - if ( i instanceof Integer ) - { - return ((Integer)i).intValue(); - } - return 1; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getLong(String) - */ - public long getLong( String name ) - { - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#getString(String) - */ - public String getString( String name ) - { - Object str = fProperties.get( name ); - if ( str instanceof String ) - { - return (String)str; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#isDefault(String) - */ - public boolean isDefault( String name ) - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#needsSaving() - */ - public boolean needsSaving() - { - return fIsDirty; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#putValue(String, String) - */ - public void putValue( String name, String newValue ) - { - Object oldValue = fProperties.get( name ); - if ( oldValue == null || !oldValue.equals( newValue ) ) - { - fProperties.put( name, newValue ); - setDirty( true ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#removePropertyChangeListener(IPropertyChangeListener) - */ - public void removePropertyChangeListener( IPropertyChangeListener listener ) - { - fListeners.remove( listener ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(String, double) - */ - public void setDefault( String name, double value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(String, float) - */ - public void setDefault( String name, float value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(String, int) - */ - public void setDefault( String name, int value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(String, long) - */ - public void setDefault( String name, long value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(String, String) - */ - public void setDefault( String name, String defaultObject ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(String, boolean) - */ - public void setDefault( String name, boolean value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setToDefault(String) - */ - public void setToDefault( String name ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(String, double) - */ - public void setValue( String name, double value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(String, float) - */ - public void setValue( String name, float value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(String, int) - */ - public void setValue( String name, int newValue ) - { - int oldValue = getInt( name ); - if ( oldValue != newValue ) - { - fProperties.put( name, new Integer( newValue ) ); - setDirty( true ); - firePropertyChangeEvent( name, new Integer( oldValue ), new Integer( newValue ) ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(String, long) - */ - public void setValue( String name, long value ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(String, String) - */ - public void setValue( String name, String newValue ) - { - Object oldValue = fProperties.get( name ); - if ( oldValue == null || !oldValue.equals( newValue ) ) - { - fProperties.put( name, newValue ); - setDirty( true ); - firePropertyChangeEvent( name, oldValue, newValue ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferenceStore#setValue(String, boolean) - */ - public void setValue( String name, boolean newValue ) - { - boolean oldValue = getBoolean( name ); - if ( oldValue != newValue ) - { - fProperties.put( name, new Boolean( newValue ) ); - setDirty(true); - firePropertyChangeEvent( name, new Boolean( oldValue ), new Boolean( newValue ) ); - } - } - - protected void setDirty( boolean isDirty ) - { - fIsDirty = isDirty; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesAction.java deleted file mode 100644 index f42180d0ebc..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesAction.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -/** - * - * Presents a custom properties dialog to configure the attibutes of a C/C++ breakpoint. - * - * @since Sep 3, 2002 - */ -public class CBreakpointPropertiesAction implements IObjectActionDelegate -{ - private IWorkbenchPart fPart; - private ICBreakpoint fBreakpoint; - - /** - * Constructor for CBreakpointPropertiesAction. - */ - public CBreakpointPropertiesAction() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - fPart = targetPart; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - Dialog d = new CBreakpointPropertiesDialog( getActivePart().getSite().getShell(), getBreakpoint() ); - d.open(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - IStructuredSelection ss = (IStructuredSelection)selection; - if ( ss.isEmpty() || ss.size() > 1 ) - { - return; - } - Object element = ss.getFirstElement(); - if ( element instanceof ICBreakpoint ) - { - setBreakpoint( (ICBreakpoint)element ); - } - } - } - - protected IWorkbenchPart getActivePart() - { - return fPart; - } - - protected void setActivePart( IWorkbenchPart part ) - { - fPart = part; - } - - protected ICBreakpoint getBreakpoint() - { - return fBreakpoint; - } - - protected void setBreakpoint( ICBreakpoint breakpoint ) - { - fBreakpoint = breakpoint; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java deleted file mode 100644 index e3947ca17f6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesDialog.java +++ /dev/null @@ -1,505 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.preference.IPreferencePageContainer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceDialog; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.jface.resource.JFaceColors; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Layout; -import org.eclipse.swt.widgets.Shell; - -/** - * - * - * @since Aug 29, 2002 - */ -public class CBreakpointPropertiesDialog extends Dialog - implements IPreferencePageContainer -{ - /** - * Layout for the page container. - * - * @see CBreakpointPropertiesDialog#createPageContainer(Composite, int) - */ - private class PageLayout extends Layout - { - public void layout( Composite composite, boolean force ) - { - Rectangle rect = composite.getClientArea(); - Control[] children = composite.getChildren(); - for ( int i = 0; i < children.length; i++ ) - { - children[i].setSize( rect.width, rect.height ); - } - } - - public Point computeSize( Composite composite, int wHint, int hHint, boolean force ) - { - if ( wHint != SWT.DEFAULT && hHint != SWT.DEFAULT ) - return new Point( wHint, hHint ); - int x = getMinimumPageSize().x; - int y = getMinimumPageSize().y; - - Control[] children = composite.getChildren(); - for ( int i = 0; i < children.length; i++ ) - { - Point size = children[i].computeSize( SWT.DEFAULT, SWT.DEFAULT, force ); - x = Math.max( x, size.x ); - y = Math.max( y, size.y ); - } - if ( wHint != SWT.DEFAULT ) - x = wHint; - if ( hHint != SWT.DEFAULT ) - y = hHint; - return new Point( x, y ); - } - } - - private Composite fTitleArea; - private Label fTitleImage; - private CLabel fMessageLabel; - - private String fMessage; - private Color fNormalMsgAreaBackground; - private Image fErrorMsgImage; - - - private CBreakpointPreferencePage fPage; - - private Button fOkButton; - - /** - * Must declare our own images as the JFaceResource images will not be created unless - * a property/preference dialog has been shown - */ - protected static final String PREF_DLG_TITLE_IMG = "breakpoint_preference_dialog_title_image"; //$NON-NLS-1$ - protected static final String PREF_DLG_IMG_TITLE_ERROR = "breakpoint_preference_dialog_title_error_image"; //$NON-NLS-1$ - static - { - ImageRegistry reg = CDebugUIPlugin.getDefault().getImageRegistry(); - reg.put( PREF_DLG_TITLE_IMG, ImageDescriptor.createFromFile( PreferenceDialog.class, "images/pref_dialog_title.gif" ) ); //$NON-NLS-1$ - reg.put( PREF_DLG_IMG_TITLE_ERROR, ImageDescriptor.createFromFile( Dialog.class, "images/message_error.gif" ) ); //$NON-NLS-1$ - } - - /** - * The Composite in which a page is shown. - */ - private Composite fPageContainer; - - /** - * The minimum page size; 200 by 200 by default. - * - * @see #setMinimumPageSize(Point) - */ - private Point fMinimumPageSize = new Point(200,200); - - /** - * The breakpoint that this dialog is operating on - */ - private ICBreakpoint fBreakpoint; - - /** - * The "fake" preference store used to interface between - * the breakpoint and the breakpoint preference page. - */ - private CBreakpointPreferenceStore fCBreakpointPreferenceStore; - - /** - * Constructor for CBreakpointPropertiesDialog. - * @param parentShell - */ - public CBreakpointPropertiesDialog( Shell parentShell, ICBreakpoint breakpoint ) - { - super( parentShell ); - setBreakpoint( breakpoint ); - fCBreakpointPreferenceStore= new CBreakpointPreferenceStore(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePageContainer#getPreferenceStore() - */ - public IPreferenceStore getPreferenceStore() - { - return fCBreakpointPreferenceStore; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePageContainer#updateButtons() - */ - public void updateButtons() - { - if ( fOkButton != null ) - { - fOkButton.setEnabled( fPage.isValid() ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePageContainer#updateMessage() - */ - public void updateMessage() - { - String pageMessage = fPage.getMessage(); - String pageErrorMessage = fPage.getErrorMessage(); - - // Adjust the font - if ( pageMessage == null && pageErrorMessage == null ) - fMessageLabel.setFont( JFaceResources.getBannerFont() ); - else - fMessageLabel.setFont( JFaceResources.getDialogFont() ); - - // Set the message and error message - if ( pageMessage == null ) - { - setMessage( fPage.getTitle() ); - } - else - { - setMessage( pageMessage ); - } - setErrorMessage( pageErrorMessage ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePageContainer#updateTitle() - */ - public void updateTitle() - { - setTitle( fPage.getTitle() ); - } - - /** - * Display the given error message. The currently displayed message - * is saved and will be redisplayed when the error message is set - * to null. - * - * @param errorMessage the errorMessage to display or null - */ - public void setErrorMessage( String errorMessage ) - { - if ( errorMessage == null ) - { - if ( fMessageLabel.getImage() != null ) - { - // we were previously showing an error - fMessageLabel.setBackground( fNormalMsgAreaBackground ); - fMessageLabel.setImage( null ); - fTitleImage.setImage( CDebugUIPlugin.getDefault().getImageRegistry().get( PREF_DLG_TITLE_IMG ) ); - fTitleArea.layout( true ); - } - // show the message - setMessage( fMessage ); - } - else - { - fMessageLabel.setText( errorMessage ); - if ( fMessageLabel.getImage() == null ) - { - // we were not previously showing an error - - // lazy initialize the error background color and image - if ( fErrorMsgImage == null ) - { - fErrorMsgImage = CDebugUIPlugin.getDefault().getImageRegistry().get( PREF_DLG_IMG_TITLE_ERROR ); - } - - // show the error - fNormalMsgAreaBackground = fMessageLabel.getBackground(); - fMessageLabel.setBackground( JFaceColors.getErrorBackground( fMessageLabel.getDisplay() ) ); - fMessageLabel.setImage( fErrorMsgImage ); - fTitleImage.setImage( null ); - fTitleArea.layout( true ); - } - } - } - - /** - * Set the message text. If the message line currently displays an error, - * the message is stored and will be shown after a call to clearErrorMessage - */ - public void setMessage( String newMessage ) - { - fMessage = newMessage; - if ( fMessage == null ) - { - fMessage = ""; //$NON-NLS-1$ - } - if ( fMessageLabel.getImage() == null ) - { - // we are not showing an error - fMessageLabel.setText( fMessage ); - } - } - - /** - * Sets the title for this dialog. - * - * @param title the title. - */ - public void setTitle( String title ) - { - Shell shell = getShell(); - if ( ( shell != null ) && !shell.isDisposed() ) - { - shell.setText( title ); - } - } - - /** - * @see Dialog#okPressed() - */ - protected void okPressed() - { - final List changedProperties = new ArrayList( 5 ); - getPreferenceStore().addPropertyChangeListener( - new IPropertyChangeListener() - { - /** - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - changedProperties.add( event.getProperty() ); - } - } ); - fPage.performOk(); - setBreakpointProperties( changedProperties ); - super.okPressed(); - } - - /** - * All of the properties that the user has changed via the dialog - * are written through to the breakpoint. - */ - protected void setBreakpointProperties( final List changedProperties ) - { - IWorkspaceRunnable wr = new IWorkspaceRunnable() - { - public void run( IProgressMonitor monitor ) throws CoreException - { - ICBreakpoint breakpoint = getBreakpoint(); - Iterator changed = changedProperties.iterator(); - while ( changed.hasNext() ) - { - String property = (String)changed.next(); - if ( property.equals( CBreakpointPreferenceStore.IGNORE_COUNT ) ) - { - breakpoint.setIgnoreCount( getPreferenceStore().getInt( CBreakpointPreferenceStore.IGNORE_COUNT ) ); - } - else if ( property.equals( CBreakpointPreferenceStore.CONDITION ) ) - { - breakpoint.setCondition( getPreferenceStore().getString( CBreakpointPreferenceStore.CONDITION ) ); - } - } - } - }; - - try - { - ResourcesPlugin.getWorkspace().run( wr, null ); - } - catch( CoreException ce ) - { - CDebugUIPlugin.log( ce ); - } - } - - protected ICBreakpoint getBreakpoint() - { - return fBreakpoint; - } - - protected void setBreakpoint( ICBreakpoint breakpoint ) - { - fBreakpoint = breakpoint; - } - - /** - * @see Dialog#createDialogArea(Composite) - */ - protected Control createDialogArea( Composite parent ) - { - GridData gd; - Composite composite = (Composite) super.createDialogArea( parent ); - ((GridLayout)composite.getLayout()).numColumns = 1; - - // Build the title area and separator line - Composite titleComposite = new Composite( composite, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.verticalSpacing = 0; - layout.horizontalSpacing = 0; - titleComposite.setLayout( layout ); - titleComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - - createTitleArea( titleComposite ); - - Label titleBarSeparator = new Label( titleComposite, SWT.HORIZONTAL | SWT.SEPARATOR ); - gd = new GridData( GridData.FILL_HORIZONTAL ); - titleBarSeparator.setLayoutData( gd ); - - // Build the Page container - fPageContainer = createPageContainer( composite, 2 ); - fPageContainer.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - fPageContainer.setFont( parent.getFont() ); - - fPage = new CBreakpointPreferencePage( getBreakpoint() ); - fPage.setContainer( this ); - fPage.createControl( fPageContainer ); - - // Build the separator line - Label separator = new Label( composite, SWT.HORIZONTAL | SWT.SEPARATOR ); - gd = new GridData( GridData.FILL_HORIZONTAL ); - gd.horizontalSpan = 2; - separator.setLayoutData( gd ); - - return composite; - } - - /** - * Creates the dialog's title area. - * - * @param parent the SWT parent for the title area composite - * @return the created title area composite - */ - private Composite createTitleArea( Composite parent ) - { - // Create the title area which will contain - // a title, message, and image. - fTitleArea = new Composite( parent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.verticalSpacing = 0; - layout.horizontalSpacing = 0; - layout.numColumns = 2; - - // Get the colors for the title area - Display display = parent.getDisplay(); - Color bg = JFaceColors.getBannerBackground( display ); - Color fg = JFaceColors.getBannerForeground( display ); - - GridData layoutData = new GridData( GridData.FILL_BOTH ); - fTitleArea.setLayout( layout ); - fTitleArea.setLayoutData( layoutData ); - fTitleArea.setBackground( bg ); - - // Message label - fMessageLabel = new CLabel( fTitleArea, SWT.LEFT ); - fMessageLabel.setBackground( bg ); - fMessageLabel.setForeground( fg ); - fMessageLabel.setText( " " ); //$NON-NLS-1$ - fMessageLabel.setFont( JFaceResources.getBannerFont() ); - - final IPropertyChangeListener fontListener = - new IPropertyChangeListener() - { - public void propertyChange( PropertyChangeEvent event ) - { - if ( JFaceResources.BANNER_FONT.equals( event.getProperty() ) || - JFaceResources.DIALOG_FONT.equals( event.getProperty() ) ) - { - updateMessage(); - } - } - }; - - fMessageLabel.addDisposeListener( - new DisposeListener() - { - public void widgetDisposed( DisposeEvent event ) - { - JFaceResources.getFontRegistry().removeListener( fontListener ); - } - } ); - - JFaceResources.getFontRegistry().addListener( fontListener ); - - GridData gd = new GridData( GridData.FILL_BOTH ); - fMessageLabel.setLayoutData( gd ); - - // Title image - fTitleImage = new Label( fTitleArea, SWT.LEFT ); - fTitleImage.setBackground( bg ); - fTitleImage.setImage( CDebugUIPlugin.getDefault().getImageRegistry().get( PREF_DLG_TITLE_IMG ) ); - gd = new GridData(); - gd.horizontalAlignment = GridData.END; - fTitleImage.setLayoutData( gd ); - - return fTitleArea; - } - - /** - * Creates the inner page container. - */ - private Composite createPageContainer( Composite parent, int numColumns ) - { - Composite result = new Composite( parent, SWT.NULL ); - result.setLayout( new PageLayout() ); - return result; - } - - /** - * Sets the minimum page size. - * - * @param size the page size encoded as - * new Point(width,height) - * @see #setMinimumPageSize(int,int) - */ - public void setMinimumPageSize( Point size ) - { - fMinimumPageSize.x = size.x; - fMinimumPageSize.y = size.y; - } - - /** - * @see Dialog#createButtonsForButtonBar(Composite) - */ - protected void createButtonsForButtonBar( Composite parent ) - { - fOkButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true ); - createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false ); - } - - protected Point getMinimumPageSize() - { - return fMinimumPageSize; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerAction.java deleted file mode 100644 index 0e5e6863cc8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerAction.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Presents a custom properties dialog to configure the attibutes of - * a C/C++ breakpoint from the ruler popup menu of a text editor. - * - * @since Aug 29, 2002 - */ -public class CBreakpointPropertiesRulerAction extends AbstractBreakpointRulerAction -{ - /** - * Creates the action to enable/disable breakpoints - */ - public CBreakpointPropertiesRulerAction( ITextEditor editor, IVerticalRulerInfo info ) - { - setInfo( info ); - setTextEditor( editor ); - setText( "Breakpoint &Properties..." ); - } - - /** - * @see Action#run() - */ - public void run() - { - if ( getBreakpoint() != null ) - { - Dialog d = new CBreakpointPropertiesDialog( getTextEditor().getEditorSite().getShell(), (ICBreakpoint)getBreakpoint() ); - d.open(); - } - } - - /** - * @see IUpdate#update() - */ - public void update() - { - setBreakpoint( determineBreakpoint() ); - if ( getBreakpoint() == null || !( getBreakpoint() instanceof ICBreakpoint ) ) - { - setBreakpoint( null ); - setEnabled( false ); - return; - } - setEnabled( true ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerActionDelegate.java deleted file mode 100644 index dd3cf374237..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CBreakpointPropertiesRulerActionDelegate.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.texteditor.AbstractRulerActionDelegate; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Enter type comment. - * - * @since Aug 29, 2002 - */ -public class CBreakpointPropertiesRulerActionDelegate extends AbstractRulerActionDelegate -{ - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(ITextEditor, IVerticalRulerInfo) - */ - protected IAction createAction( ITextEditor editor, IVerticalRulerInfo rulerInfo ) - { - return new CBreakpointPropertiesRulerAction( editor, rulerInfo ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java deleted file mode 100644 index 8495b3855ce..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.ICastToArray; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.ui.IDebugView; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.ActionDelegate; - -/** - * Enter type comment. - * - * @since Mar 10, 2003 - */ -public class CastToArrayActionDelegate extends ActionDelegate implements IObjectActionDelegate -{ - protected class CastToArrayDialog extends Dialog - { - private String fType = ""; - private int fFirstIndex = 0; - private int fLength = 0; - - private Button fOkButton; - private Label fErrorMessageLabel; - - private Text fFirstIndexText; - private Text fLengthText; - - public CastToArrayDialog( Shell parentShell, String initialType, int initialStart, int initialLength ) - { - super( parentShell ); - fType = ( initialType == null ) ? "" : initialType; - fFirstIndex = initialStart; - fLength = initialLength; - } - - protected String getType() - { - return fType; - } - - protected int getFirstIndex() - { - return fFirstIndex; - } - - protected int getLength() - { - return fLength; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) - */ - protected void configureShell( Shell newShell ) - { - super.configureShell( newShell ); - newShell.setText( "Display As Array" ); - newShell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_DISPLAY_AS_ARRAY ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) - */ - protected void createButtonsForButtonBar( Composite parent ) - { - // create OK and Cancel buttons by default - fOkButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true ); - createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false ); - - //do this here because setting the text will set enablement on the ok button -/* - fTypeText.setFocus(); - if ( fType != null ) - { - fTypeText.setText( fType ); - fTypeText.selectAll(); - fFirstIndexText.setText( String.valueOf( fFirstIndex ) ); - fLengthText.setText( String.valueOf( fLength ) ); - } -*/ - fFirstIndexText.setText( String.valueOf( fFirstIndex ) ); - fLengthText.setText( String.valueOf( fLength ) ); - } - - protected Label getErrorMessageLabel() - { - return fErrorMessageLabel; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createDialogArea( Composite parent ) - { - Composite composite = (Composite)super.createDialogArea( parent ); - - createDialogFields( composite ); - - fErrorMessageLabel = new Label( composite, SWT.NONE ); - fErrorMessageLabel.setLayoutData( new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL ) ); - fErrorMessageLabel.setFont(parent.getFont()); - return composite; - } - - private void createDialogFields( Composite parent ) - { - Composite composite = ControlFactory.createComposite( parent, 4 ); - ((GridData)composite.getLayoutData()).widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH ); - ((GridLayout)composite.getLayout()).makeColumnsEqualWidth = true; - - Label label = ControlFactory.createLabel( composite, "Start index:" ); - ((GridData)label.getLayoutData()).horizontalSpan = 3; - fFirstIndexText = ControlFactory.createTextField( composite ); - fFirstIndexText.addModifyListener( - new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - validateInput(); - } - } ); - - label = ControlFactory.createLabel( composite, "Length:" ); - ((GridData)label.getLayoutData()).horizontalSpan = 3; - fLengthText = ControlFactory.createTextField( composite ); - fLengthText.addModifyListener( - new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - validateInput(); - } - } ); - } - - protected void validateInput() - { - boolean enabled = true; - String message = ""; - String firstIndex = fFirstIndexText.getText().trim(); - if ( firstIndex.length() == 0 ) - { - message = "The 'First index' field must not be empty."; - enabled = false; - } - else - { - try - { - Integer.parseInt( firstIndex ); - } - catch( NumberFormatException e ) - { - message = "Invalid first index."; - enabled = false; - } - if ( enabled ) - { - String lengthText = fLengthText.getText().trim(); - if ( lengthText.length() == 0 ) - { - message = "The 'Last index' field must not be empty."; - enabled = false; - } - else - { - int length = -1; - try - { - length = Integer.parseInt( lengthText ); - } - catch( NumberFormatException e ) - { - message = "Invalid last index."; - enabled = false; - } - if ( enabled && length < 1 ) - { - message = "The length must be greater than 0."; - enabled = false; - } - } - } - } - fOkButton.setEnabled( enabled ); - getErrorMessageLabel().setText( message ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) - */ - protected void buttonPressed( int buttonId ) - { - if ( buttonId == IDialogConstants.OK_ID ) - { - String firstIndex = fFirstIndexText.getText().trim(); - String lengthText = fLengthText.getText().trim(); - try - { - fFirstIndex = Integer.parseInt( firstIndex ); - fLength = Integer.parseInt( lengthText ); - } - catch( NumberFormatException e ) - { - fFirstIndex = 0; - fLength = 0; - } - } - else - { - fType = null; - } - super.buttonPressed( buttonId ); - } - } - - private ICastToArray fCastToArray = null; - private IStatus fStatus = null; - private IWorkbenchPart fTargetPart = null; - - public CastToArrayActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - fTargetPart = targetPart; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run( IAction action ) - { - if ( getCastToArray() == null ) - return; - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getCastToArray() ); - setStatus( null ); - } - catch( DebugException e ) - { - setStatus( e.getStatus() ); - } - } - } ); - if ( getStatus() != null && !getStatus().isOK() ) - { - IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Unable to display this variable as an array.", getStatus() ); - } - else - { - CDebugUIPlugin.log( getStatus() ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICastToArray ) - { - boolean enabled = ((ICastToArray)element).supportsCastToArray(); - action.setEnabled( enabled ); - if ( enabled ) - { - setCastToArray( (ICastToArray)element ); - return; - } - } - } - action.setEnabled( false ); - setCastToArray( null ); - } - - protected ICastToArray getCastToArray() - { - return fCastToArray; - } - - protected void setCastToArray( ICastToArray castToArray ) - { - fCastToArray = castToArray; - } - - public IStatus getStatus() - { - return fStatus; - } - - public void setStatus( IStatus status ) - { - fStatus = status; - } - - protected void doAction( ICastToArray castToArray ) throws DebugException - { - String currentType = castToArray.getCurrentType().trim(); - CastToArrayDialog dialog = new CastToArrayDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType, 0, 1 ); - if ( dialog.open() == Window.OK ) - { - int firstIndex = dialog.getFirstIndex(); - int lastIndex = dialog.getLength(); - castToArray.castToArray( firstIndex, lastIndex ); - if ( getSelectionProvider() != null ) - getSelectionProvider().setSelection( new StructuredSelection( castToArray ) ); - } - } - - private ISelectionProvider getSelectionProvider() - { - return ( fTargetPart instanceof IDebugView ) ? ((IDebugView)fTargetPart).getViewer() : null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java deleted file mode 100644 index b20b2951e52..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.ICastToType; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.ui.IDebugView; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.IInputValidator; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.ActionDelegate; - -/** - * Enter type comment. - * - * @since Mar 7, 2003 - */ -public class CastToTypeActionDelegate extends ActionDelegate - implements IObjectActionDelegate -{ - static protected class CastToTypeInputValidator implements IInputValidator - { - public CastToTypeInputValidator() - { - } - - public String isValid( String newText ) - { - if ( newText.trim().length() == 0 ) - { - return "The 'Type' field must not be empty."; - } - return null; - } - - } - - protected class CastToTypeDialog extends InputDialog - { - public CastToTypeDialog( Shell parentShell, String initialValue ) - { - super( parentShell, "Cast To Type", "Enter type:", initialValue, new CastToTypeInputValidator() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) - */ - protected void configureShell( Shell shell ) - { - super.configureShell( shell ); - shell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_CAST_TO_TYPE ) ); - } - - } - - private ICastToType fCastToType = null; - private IStatus fStatus = null; - private IWorkbenchPart fTargetPart = null; - - public CastToTypeActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - fTargetPart = targetPart; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run( IAction action ) - { - if ( getCastToType() == null ) - return; - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getCastToType() ); - setStatus( null ); - } - catch( DebugException e ) - { - setStatus( e.getStatus() ); - } - } - } ); - if ( getStatus() != null && !getStatus().isOK() ) - { - IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Unable to cast to type.", getStatus() ); - } - else - { - CDebugUIPlugin.log( getStatus() ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICastToType ) - { - boolean enabled = ((ICastToType)element).supportsCasting(); - action.setEnabled( enabled ); - if ( enabled ) - { - setCastToType( (ICastToType)element ); - return; - } - } - } - action.setEnabled( false ); - setCastToType( null ); - } - - protected ICastToType getCastToType() - { - return fCastToType; - } - - protected void setCastToType( ICastToType castToType ) - { - fCastToType = castToType; - } - - public IStatus getStatus() - { - return fStatus; - } - - public void setStatus( IStatus status ) - { - fStatus = status; - } - - protected void doAction( ICastToType castToType ) throws DebugException - { - String currentType = castToType.getCurrentType().trim(); - CastToTypeDialog dialog = new CastToTypeDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType ); - if ( dialog.open() == Window.OK ) - { - String newType = dialog.getValue().trim(); - castToType.cast( newType ); - if ( getSelectionProvider() != null ) - getSelectionProvider().setSelection( new StructuredSelection( castToType ) ); - } - } - - private ISelectionProvider getSelectionProvider() - { - return ( fTargetPart instanceof IDebugView ) ? ((IDebugView)fTargetPart).getViewer() : null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java deleted file mode 100644 index b61be612ded..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ChangeRegisterValueAction.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.Iterator; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValueModification; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.TreeEditor; -import org.eclipse.swt.events.FocusAdapter; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.SelectionProviderAction; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * Enter type comment. - * - * @since Sep 16, 2002 - */ -public class ChangeRegisterValueAction extends SelectionProviderAction -{ - protected Tree fTree; - protected TreeEditor fTreeEditor; - protected Composite fComposite; - protected Label fEditorLabel; - protected Text fEditorText; - protected IVariable fVariable; - protected boolean fKeyReleased = false; - - /** - * Constructor for ChangeRegisterValueAction. - * @param provider - * @param text - */ - public ChangeRegisterValueAction( Viewer viewer ) - { - super( viewer, "Change Register Value" ); - setDescription( "Change Register Value" ); - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_CHANGE_REGISTER_VALUE ); - fTree = ((TreeViewer)viewer).getTree(); - fTreeEditor = new TreeEditor( fTree ); - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.CHANGE_REGISTER_VALUE_ACTION ); - } - - /** - * Edit the variable value with an inline text editor. - */ - protected void doActionPerformed( final IVariable variable ) - { - IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window == null ) - { - return; - } - final Shell activeShell = window.getShell(); - - // If a previous edit is still in progress, finish it - if ( fEditorText != null ) - { - saveChangesAndCleanup( fVariable, activeShell ); - } - fVariable = variable; - - // Use a Composite containing a Label and a Text. This allows us to edit just - // the value, while still showing the variable name. - fComposite = new Composite( fTree, SWT.NONE ); - fComposite.setBackground( fTree.getBackground() ); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginHeight = 0; - layout.marginWidth = 0; - fComposite.setLayout( layout ); - - fEditorLabel = new Label( fComposite, SWT.LEFT ); - fEditorLabel.setLayoutData( new GridData( GridData.FILL_VERTICAL ) ); - - // Fix for bug 1766. Border behavior on Windows & Linux for text - // fields is different. On Linux, you always get a border, on Windows, - // you don't. Specifying a border on Linux results in the characters - // getting pushed down so that only there very tops are visible. Thus, - // we have to specify different style constants for the different platforms. - int textStyles = SWT.SINGLE | SWT.LEFT; - if ( SWT.getPlatform().equals( "win32" ) ) - { //$NON-NLS-1$ - textStyles |= SWT.BORDER; - } - fEditorText = new Text( fComposite, textStyles ); - fEditorText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL ) ); - String valueString = ""; //$NON-NLS-1$ - try - { - valueString = fVariable.getValue().getValueString(); - } - catch( DebugException de ) - { - CDebugUIPlugin.errorDialog( "Setting the register value failed.", de ); - } - TreeItem[] selectedItems = fTree.getSelection(); - fTreeEditor.horizontalAlignment = SWT.LEFT; - fTreeEditor.grabHorizontal = true; - fTreeEditor.setEditor( fComposite, selectedItems[0] ); - - // There is no API on the model presentation to get just the variable name, - // so we have to make do with just calling IVariable.getName() - String varName = ""; //$NON-NLS-1$ - try - { - varName = fVariable.getName(); - } - catch (DebugException de) - { - CDebugUIPlugin.errorDialog( "Setting the register value failed.", de ); - } - fEditorLabel.setText( varName + "=" ); //$NON-NLS-1$ - - fEditorText.setText( valueString ); - fEditorText.selectAll(); - - fComposite.layout( true ); - fComposite.setVisible( true ); - fEditorText.setFocus(); - - // CR means commit the changes, ESC means abort changing the value - fEditorText.addKeyListener( - new KeyAdapter() - { - public void keyReleased( KeyEvent event ) - { - if ( event.character == SWT.CR ) - { - if ( fKeyReleased ) - { - saveChangesAndCleanup( fVariable, activeShell ); - } - else - { - cleanup(); - return; - } - } - if ( event.character == SWT.ESC ) - { - cleanup(); - return; - } - fKeyReleased = true; - } - } ); - - // If the focus is lost, then act as if user hit CR and commit changes - fEditorText.addFocusListener( - new FocusAdapter() - { - public void focusLost( FocusEvent fe ) - { - if ( fKeyReleased ) - { - saveChangesAndCleanup( fVariable, activeShell ); - } - else - { - cleanup(); - } - } - } ); - } - - /** - * If the new value validates, save it, and dispose the text widget, - * otherwise sound the system bell and leave the user in the editor. - */ - protected void saveChangesAndCleanup( IVariable variable, Shell shell ) - { - String newValue = fEditorText.getText(); - try - { - if ( !variable.verifyValue( newValue ) ) - { - shell.getDisplay().beep(); - return; - } - variable.setValue( newValue ); - } - catch( DebugException de ) - { - CDebugUIPlugin.errorDialog( "Setting the register value failed.", de ); - } - cleanup(); - } - - /** - * Tidy up the widgets that were used - */ - protected void cleanup() - { - fKeyReleased = false; - if ( fEditorText != null ) - { - fEditorText.dispose(); - fEditorText = null; - fVariable = null; - fTreeEditor.setEditor( null, null ); - fComposite.setVisible( false ); - } - } - - /** - * Updates the enabled state of this action based - * on the selection - */ - protected void update( IStructuredSelection sel ) - { - Iterator iter = sel.iterator(); - if (iter.hasNext()) - { - Object object = iter.next(); - if ( object instanceof IValueModification ) - { - IValueModification varMod = (IValueModification)object; - if ( !varMod.supportsValueModification() ) - { - setEnabled( false ); - return; - } - setEnabled( !iter.hasNext() ); - return; - } - } - setEnabled( false ); - } - - /** - * @see Action - */ - public void run() - { - Iterator iterator = getStructuredSelection().iterator(); - doActionPerformed( (IVariable)iterator.next() ); - } - - /** - * @see SelectionProviderAction - */ - public void selectionChanged( IStructuredSelection sel ) - { - update( sel ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ClearMemoryAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ClearMemoryAction.java deleted file mode 100644 index dffbed5b73d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ClearMemoryAction.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.ui.actions.SelectionProviderAction; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Oct 21, 2002 - */ -public class ClearMemoryAction extends SelectionProviderAction implements IUpdate -{ - private MemoryViewer fMemoryViewer; - - /** - * Constructor for ClearMemoryAction. - * @param provider - * @param text - */ - public ClearMemoryAction( MemoryViewer viewer ) - { - super( viewer, "Clear" ); - fMemoryViewer = viewer; - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_MEMORY_CLEAR ); - setDescription( "Clear Memory Block" ); - setToolTipText( "Clear" ); - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.MEMORY_CLEAR_ACTION ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canUpdate() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - fMemoryViewer.clear(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DebuggerConsoleActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DebuggerConsoleActionDelegate.java deleted file mode 100644 index dbacb4264e6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DebuggerConsoleActionDelegate.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport; -import org.eclipse.cdt.debug.internal.core.model.CDebugElement; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.ui.AbstractDebugView; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IViewPart; - -/** - * Enter type comment. - * - * @since: Oct 23, 2002 - */ -public class DebuggerConsoleActionDelegate extends AbstractListenerActionDelegate -{ - private IViewPart fViewPart = null; - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object) - */ - protected void doAction( Object element ) throws DebugException - { - if ( element != null && element instanceof CDebugElement && getAction() != null && getAction().isEnabled() ) - { - IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class ); - if ( dps != null && dps.supportsDebuggerProcess() ) - { - dps.setDebuggerProcessDefault( getAction().isChecked() ); - ((CDebugElement)element).fireChangeEvent( DebugEvent.CLIENT_REQUEST ); - if ( fViewPart != null && fViewPart instanceof AbstractDebugView ) - { - final AbstractDebugView view = (AbstractDebugView)fViewPart; - fViewPart.getViewSite().getShell().getDisplay().asyncExec( - new Runnable() - { - public void run() - { - Viewer viewer = view.getViewer(); - viewer.setSelection( viewer.getSelection() ); - } - } ); - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object) - */ - protected boolean isEnabledFor( Object element ) - { - if ( element != null && element instanceof CDebugElement ) - { - IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class ); - return ( dps != null && dps.supportsDebuggerProcess() ); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#enableForMultiSelection() - */ - protected boolean enableForMultiSelection() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - super.selectionChanged(action, selection); - boolean checked = false; - if ( selection != null && selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof CDebugElement ) - { - IDebuggerProcessSupport dps = (IDebuggerProcessSupport)((CDebugElement)element).getDebugTarget().getAdapter( IDebuggerProcessSupport.class ); - checked = ( dps != null && dps.supportsDebuggerProcess() ) ? dps.isDebuggerProcessDefault() : false; - } - } - action.setChecked( checked ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) - */ - public void init( IViewPart view ) - { - super.init( view ); - fViewPart = view; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java deleted file mode 100644 index 7689f339761..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; - -/** - * - * Enter type comment. - * - * @since Dec 16, 2002 - */ -public class DecVariableFormatActionDelegate extends VariableFormatActionDelegate -{ - - /** - * Constructor for DecVariableFormatActionDelegate. - * @param format - */ - public DecVariableFormatActionDelegate() - { - super( ICDIFormat.DECIMAL ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java deleted file mode 100644 index 92ca696511c..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -/** - * Enter type comment. - * - * @since Jun 19, 2003 - */ -public class DisableVariablesActionDelegate extends EnableVariablesActionDelegate -{ - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate#isEnableAction() - */ - protected boolean isEnableAction() - { - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerAction.java deleted file mode 100644 index 5de26a7f8b5..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerAction.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.texteditor.ITextEditor; - -public class EnableDisableBreakpointRulerAction extends AbstractBreakpointRulerAction -{ - /** - * Creates the action to enable/disable breakpoints - */ - public EnableDisableBreakpointRulerAction( ITextEditor editor, IVerticalRulerInfo info ) - { - setInfo( info ); - setTextEditor( editor ); - setText( "&Enable Breakpoint" ); - } - - /** - * @see Action#run() - */ - public void run() - { - if (getBreakpoint() != null) - { - try - { - getBreakpoint().setEnabled( !getBreakpoint().isEnabled() ); - } - catch (CoreException e) - { - ErrorDialog.openError( getTextEditor().getEditorSite().getShell(), - "Enabling/disabling breakpoints", - "Exceptions occurred enabling disabling the breakpoint", - e.getStatus() ); - } - } - } - - /** - * @see IUpdate#update() - */ - public void update() - { - setBreakpoint(determineBreakpoint()); - if ( getBreakpoint() == null ) - { - setEnabled( false ); - return; - } - setEnabled( true ); - try - { - boolean enabled = getBreakpoint().isEnabled(); - setText( enabled ? "&Disable Breakpoint" : "&Enable Breakpoint" ); - } - catch( CoreException ce ) - { - CDebugUIPlugin.log( ce ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerActionDelegate.java deleted file mode 100644 index ae6d4f68f47..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableDisableBreakpointRulerActionDelegate.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.texteditor.AbstractRulerActionDelegate; -import org.eclipse.ui.texteditor.ITextEditor; - -public class EnableDisableBreakpointRulerActionDelegate extends AbstractRulerActionDelegate -{ - /** - * @see AbstractRulerActionDelegate#createAction(ITextEditor, IVerticalRulerInfo) - */ - protected IAction createAction( ITextEditor editor, IVerticalRulerInfo rulerInfo ) - { - return new EnableDisableBreakpointRulerAction( editor, rulerInfo ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java deleted file mode 100644 index 4b341bf2a5a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.Iterator; - -import org.eclipse.cdt.debug.core.model.ICVariable; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; - -/** - * Enter type comment. - * - * @since Jun 19, 2003 - */ -public class EnableVariablesActionDelegate implements IViewActionDelegate -{ - private IViewPart fView; - - private IAction fAction; - - public EnableVariablesActionDelegate() - { - } - - protected IViewPart getView() - { - return fView; - } - - protected void setView( IViewPart view ) - { - fView = view; - } - - protected IAction getAction() - { - return fAction; - } - - protected void setAction( IAction action ) - { - fAction = action; - } - - /** - * This action enables variables. - */ - protected boolean isEnableAction() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init( IViewPart view ) - { - setView(view); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run( IAction action ) - { - IStructuredSelection selection = getSelection(); - final int size = selection.size(); - if ( size == 0 ) - return; - - final Iterator enum = selection.iterator(); - final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, "Enable variable(s) failed.", null ); - Runnable runnable = new Runnable() - { - public void run() - { - while( enum.hasNext() ) - { - ICVariable var = (ICVariable)enum.next(); - try - { - if ( size > 1 ) - { - if ( isEnableAction() ) - var.setEnabled( true ); - else - var.setEnabled( false ); - } - else - var.setEnabled( !var.isEnabled() ); - } - catch( DebugException e ) - { - ms.merge( e.getStatus() ); - } - } - update(); - } - }; - - final Display display = CDebugUIPlugin.getStandardDisplay(); - if ( display.isDisposed() ) - return; - display.asyncExec( runnable ); - - if ( !ms.isOK() ) - { - CDebugUIPlugin.errorDialog( "Exceptions occurred enabling the variable(s).", ms ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - setAction( action ); - if ( !( selection instanceof IStructuredSelection ) ) - return; - IStructuredSelection sel = (IStructuredSelection)selection; - Object o = sel.getFirstElement(); - if ( !( o instanceof ICVariable ) ) - return; - - Iterator enum = sel.iterator(); - boolean allEnabled = true; - boolean allDisabled = true; - while( enum.hasNext() ) - { - ICVariable var = (ICVariable)enum.next(); - if ( !var.canEnableDisable() ) - continue; - if ( var.isEnabled() ) - allDisabled = false; - else - allEnabled = false; - } - - if ( isEnableAction() ) - action.setEnabled( !allEnabled ); - else - action.setEnabled( !allDisabled ); - } - - private IStructuredSelection getSelection() - { - return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection(); - } - - protected void update() - { - getView().getViewSite().getSelectionProvider().setSelection( getView().getViewSite().getSelectionProvider().getSelection() ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ExpressionDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ExpressionDialog.java deleted file mode 100644 index 4cb372c460d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ExpressionDialog.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.debug.internal.ui.DebugPluginImages; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * - * Enter type comment. - * - * @since Sep 17, 2002 - */ -public class ExpressionDialog extends Dialog -{ - private Button fBtnOk = null; - private Text fTextExpression; - - private String fExpression = ""; - - /** - * Constructor for ExpressionDialog. - * @param parentShell - */ - public ExpressionDialog( Shell parentShell, String expression ) - { - super( parentShell ); - if ( expression != null ) - fExpression = expression; - } - - protected void configureShell( Shell shell ) - { - super.configureShell( shell ); - shell.setText( "Add Expression" ); - shell.setImage( DebugPluginImages.getImage( IDebugUIConstants.IMG_OBJS_EXPRESSION ) ); - } - - protected Control createContents( Composite parent ) - { - Control control = super.createContents( parent ); - setOkButtonState(); - return control; - } - - protected Control createDialogArea( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout() ); - ((GridLayout)composite.getLayout()).marginWidth = 10; - composite.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - createDataWidgets( composite ); - initializeDataWidgets(); - return composite; - } - - protected void createButtonsForButtonBar( Composite parent ) - { - fBtnOk = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true ); - createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false ); - } - - private void createDataWidgets( Composite parent ) - { - fTextExpression = createExpressionText( parent ); - } - - private void initializeDataWidgets() - { - fTextExpression.setText( fExpression ); - fTextExpression.setSelection( fExpression.length() ); - fTextExpression.selectAll(); - setOkButtonState(); - } - - private Text createExpressionText( Composite parent ) - { - Label label = new Label( parent, SWT.RIGHT ); - label.setText( "Expression to add:" ); - final Text text = new Text( parent, SWT.BORDER ); - GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); - gridData.widthHint = 300; - text.setLayoutData( gridData ); - addModifyListener( text ); - return text; - } - - protected void setOkButtonState() - { - if ( fBtnOk == null ) - return; - fBtnOk.setEnabled( fTextExpression.getText().trim().length() > 0 ); - } - - private void storeData() - { - fExpression = fTextExpression.getText().trim(); - } - - private void addModifyListener( Text text ) - { - text.addModifyListener( - new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - setOkButtonState(); - } - } ); - } - - public String getExpression() - { - return fExpression; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#okPressed() - */ - protected void okPressed() - { - storeData(); - super.okPressed(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java deleted file mode 100644 index ebd682fc882..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; - -/** - * - * Enter type comment. - * - * @since Dec 16, 2002 - */ -public class HexVariableFormatActionDelegate extends VariableFormatActionDelegate -{ - /** - * Constructor for HexVariableFormatActionDelegate. - * @param format - */ - public HexVariableFormatActionDelegate() - { - super( ICDIFormat.HEXADECIMAL ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java deleted file mode 100644 index 88a14e58594..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.debug.core.model.IJumpToAddress; -import org.eclipse.cdt.debug.core.model.IJumpToLine; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * Enter type comment. - * - * @since: Feb 5, 2003 - */ -public class JumpToLineActionDelegate extends AbstractEditorActionDelegate -{ - /** - * Constructor for JumpToLineActionDelegate. - */ - public JumpToLineActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - IDebugTarget target = null; - if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof IDebugElement ) - { - IDebugTarget target1 = ((IDebugElement)element).getDebugTarget(); - if ( target1 != null && - ( target1 instanceof IJumpToLine || target1 instanceof IJumpToAddress ) ) - { - target = target1; - } - } - } - setDebugTarget( target ); - update(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getTargetPart() != null && getTargetPart() instanceof ITextEditor ) - { - IEditorInput input = ((ITextEditor)getTargetPart()).getEditorInput(); - if ( input != null && input instanceof IFileEditorInput ) - { - IFile file = ((IFileEditorInput)input).getFile(); - if ( file != null ) - { - ITextSelection selection = (ITextSelection)((ITextEditor)getTargetPart()).getSelectionProvider().getSelection(); - int lineNumber = selection.getStartLine() + 1; - jumpToLine( file, lineNumber ); - } - } - else if ( input != null && input instanceof IStorageEditorInput ) - { - try - { - IStorage storage = ((IStorageEditorInput)input).getStorage(); - if ( storage instanceof FileStorage ) - { - IPath path = storage.getFullPath(); - if ( path != null ) - { - ITextSelection selection = (ITextSelection)((ITextEditor)getTargetPart()).getSelectionProvider().getSelection(); - int lineNumber = selection.getStartLine() + 1; - jumpToLine( path.lastSegment(), lineNumber ); - } - } - else if ( storage != null && storage.getAdapter( IDisassemblyStorage.class ) != null ) - { - IDisassemblyStorage disassemblyStorage = (IDisassemblyStorage)storage.getAdapter( IDisassemblyStorage.class ); - ITextSelection selection = (ITextSelection)((ITextEditor)getTargetPart()).getSelectionProvider().getSelection(); - int lineNumber = selection.getStartLine(); - long address = disassemblyStorage.getAddress( lineNumber ); - if ( address > 0 ) - jumpToAddress( address ); - } - } - catch( CoreException e ) - { - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractEditorActionDelegate#initializeDebugTarget() - */ - protected void initializeDebugTarget() - { - setDebugTarget( null ); - IAdaptable context = DebugUITools.getDebugContext(); - if ( context != null && context instanceof IDebugElement ) - { - IDebugTarget target = ((IDebugElement)context).getDebugTarget(); - if ( target != null && - ( target instanceof IJumpToLine || target instanceof IJumpToAddress ) ) - { - setDebugTarget( target ); - } - } - } - - protected void jumpToLine( IFile file, int lineNumber ) - { - IJumpToLine target = (IJumpToLine)getDebugTarget().getAdapter( IJumpToLine.class ); - if ( target != null ) - { - if ( !target.canJumpToLine( file, lineNumber ) ) - { - getTargetPart().getSite().getShell().getDisplay().beep(); - return; - } - try - { - target.jumpToLine( file, lineNumber ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } - } - - protected void jumpToLine( String fileName, int lineNumber ) - { - IJumpToLine target = (IJumpToLine)getDebugTarget().getAdapter( IJumpToLine.class ); - if ( target != null ) - { - if ( !target.canJumpToLine( fileName, lineNumber ) ) - { - getTargetPart().getSite().getShell().getDisplay().beep(); - return; - } - try - { - target.jumpToLine( fileName, lineNumber ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } - } - - protected void jumpToAddress( long address ) - { - IJumpToAddress target = (IJumpToAddress)getDebugTarget().getAdapter( IJumpToAddress.class ); - if ( target != null ) - { - if ( !target.canJumpToAddress( address ) ) - { - getTargetPart().getSite().getShell().getDisplay().beep(); - return; - } - try - { - target.jumpToAddress( address ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsActionDelegate.java deleted file mode 100644 index 8d2b056ff7a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsActionDelegate.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; - -/** - * Enter type comment. - * - * @since: Jan 17, 2003 - */ -public class LoadSymbolsActionDelegate implements IObjectActionDelegate -{ - private ICSharedLibrary fLibrary = null; - - /** - * Constructor for LoadSymbolsActionDelegate. - */ - public LoadSymbolsActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getSharedLibrary() != null ) - { - final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, "Unable to load symbols of shared library.", null ); - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getSharedLibrary() ); - } - catch( DebugException e ) - { - ms.merge( e.getStatus() ); - } - } - } ); - if ( !ms.isOK() ) - { - IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Operation failed.", ms ); - } - else - { - CDebugUIPlugin.log( ms ); - } - } - - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICSharedLibrary ) - { - boolean enabled = enablesFor( (ICSharedLibrary)element ); - action.setEnabled( enabled ); - if ( enabled ) - { - setSharedLibrary( (ICSharedLibrary)element ); - return; - } - } - } - action.setEnabled( false ); - setSharedLibrary( null ); - } - - protected void doAction( ICSharedLibrary library ) throws DebugException - { - library.loadSymbols(); - } - - private boolean enablesFor( ICSharedLibrary library ) - { - return ( library != null && !library.areSymbolsLoaded() ); - } - - private void setSharedLibrary( ICSharedLibrary library ) - { - fLibrary = library; - } - - protected ICSharedLibrary getSharedLibrary() - { - return fLibrary; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java deleted file mode 100644 index f7f460b1926..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllAction.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.ICSharedLibraryManager; -import org.eclipse.cdt.debug.core.model.ICDebugTarget; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Feb 11, 2003 - */ -public class LoadSymbolsForAllAction extends Action implements IUpdate -{ - private Viewer fViewer = null; - - /** - * Constructor for LoadSymbolsForAllAction. - */ - public LoadSymbolsForAllAction( Viewer viewer ) - { - super( "Load Symbols For All" ); - fViewer = viewer; - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_LOAD_ALL_SYMBOLS ); - setDescription( "Load symbols for all shared libraries." ); - setToolTipText( "Load Symbols For All" ); - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.LOAD_SYMBOLS_FOR_ALL ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - if ( fViewer != null && fViewer.getInput() instanceof IAdaptable ) - { - ICDebugTarget target = (ICDebugTarget)((IAdaptable)fViewer.getInput()).getAdapter( ICDebugTarget.class ); - if ( target != null ) - { - setEnabled( target.isSuspended() ); - return; - } - } - setEnabled( false ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - if ( fViewer != null && fViewer.getInput() instanceof IAdaptable ) - { - ICSharedLibraryManager slm = (ICSharedLibraryManager)((IAdaptable)fViewer.getInput()).getAdapter( ICSharedLibraryManager.class ); - if ( slm != null ) - { - try - { - slm.loadSymbolsForAll(); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to load symbols.", e.getStatus() ); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointActionDelegate.java deleted file mode 100644 index 87a4c8e61ae..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointActionDelegate.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Action for adding/removing breakpoints at a line in the source file - * shown in the active C/C++ Editor. - * - * @since Sep 3, 2002 - */ -public class ManageBreakpointActionDelegate implements IWorkbenchWindowActionDelegate, - IPartListener -{ - private boolean fInitialized = false; - private IAction fAction = null; - private int fLineNumber; - private ITextEditor fTextEditor = null; - private IWorkbenchWindow fWorkbenchWindow = null; - private IFile fFile = null; - - /** - * Constructor for ManageBreakpointActionDelegate. - */ - public ManageBreakpointActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() - */ - public void dispose() - { - getWorkbenchWindow().getPartService().removePartListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow) - */ - public void init( IWorkbenchWindow window ) - { - setWorkbenchWindow( window ); - window.getPartService().addPartListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart) - */ - public void partActivated( IWorkbenchPart part ) - { - if ( part instanceof ITextEditor ) - { - setTextEditor( (ITextEditor)part ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart) - */ - public void partBroughtToTop( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart) - */ - public void partClosed( IWorkbenchPart part ) - { - if ( part == getTextEditor() ) - { - setTextEditor( null ); - if ( getAction() != null ) - { - getAction().setEnabled( false ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart) - */ - public void partDeactivated( IWorkbenchPart part ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart) - */ - public void partOpened( IWorkbenchPart part ) - { - if ( part instanceof ITextEditor ) - { - if ( getTextEditor() == null ) - { - setTextEditor( (ITextEditor)part ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getTextEditor() != null ) - { - update(); - manageBreakpoint( getTextEditor().getEditorInput() ); - } - } - - protected void update( ISelection selection ) - { - setEnabledState( getTextEditor() ); - } - - protected void update() - { - IAction action = getAction(); - if ( action != null ) - { - if ( getTextEditor() != null ) - { - breakpointExists( getTextEditor().getEditorInput() ); - } - action.setEnabled( getTextEditor() != null && getFile() != null ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( !fInitialized ) - { - setAction( action ); - if ( getWorkbenchWindow() != null ) - { - IWorkbenchPage page = getWorkbenchWindow().getActivePage(); - if ( page != null ) - { - IEditorPart part = page.getActiveEditor(); - if ( part instanceof ITextEditor ) - { - setTextEditor( (ITextEditor)part ); - update( getTextEditor().getSelectionProvider().getSelection() ); - } - } - } - fInitialized = true; - } - update( selection ); - } - - /** - * Manages a breakpoint. - */ - protected void manageBreakpoint( IEditorInput editorInput ) - { - ISelectionProvider sp = getTextEditor().getSelectionProvider(); - if ( sp == null || getFile() == null ) - { - beep(); - return; - } - ISelection selection = sp.getSelection(); - if ( selection instanceof ITextSelection ) - { - if ( getFile() == null ) - return; - IDocument document = getTextEditor().getDocumentProvider().getDocument( editorInput ); - BreakpointLocationVerifier bv = new BreakpointLocationVerifier(); - int lineNumber = bv.getValidLineBreakpointLocation( document, ((ITextSelection)selection).getStartLine()); - if ( lineNumber > -1 ) - { - try - { - ICLineBreakpoint breakpoint = CDebugModel.lineBreakpointExists( getFile().getLocation().toOSString(), lineNumber ); - if ( breakpoint != null ) - { - DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint( breakpoint, true ); - } - else - { - CDebugModel.createLineBreakpoint( getFile(), - lineNumber, - true, - 0, - "", - true ); - } - } - catch( CoreException ce ) - { - CDebugUIPlugin.errorDialog( "Cannot add breakpoint", ce ); - } - } - } - } - - /** - * Determines if a breakpoint exists on the line of the current selection. - */ - protected boolean breakpointExists(IEditorInput editorInput) - { - if ( getFile() != null ) - { - try - { - return CDebugModel.lineBreakpointExists( getFile().getLocation().toOSString(), getLineNumber() ) == null; - } - catch (CoreException ce) - { - CDebugUIPlugin.log( ce ); - } - } - - return false; - } - - protected IWorkbenchWindow getWorkbenchWindow() - { - return fWorkbenchWindow; - } - - protected void setWorkbenchWindow( IWorkbenchWindow workbenchWindow ) - { - fWorkbenchWindow = workbenchWindow; - } - - protected ITextEditor getTextEditor() - { - return fTextEditor; - } - - protected void setTextEditor( ITextEditor editor ) - { - fTextEditor = editor; - if ( fTextEditor != null ) - { - IEditorInput input = fTextEditor.getEditorInput(); - setFile( ( input != null && input instanceof IFileEditorInput ) ? ((IFileEditorInput)input).getFile() : null ); - } - setEnabledState( editor ); - } - - protected void setEnabledState( ITextEditor editor ) - { - if ( getAction() != null ) - { - getAction().setEnabled( editor != null ); - } - } - - protected void beep() - { - if ( CDebugUIPlugin.getActiveWorkbenchShell() != null ) - { - CDebugUIPlugin.getActiveWorkbenchShell().getDisplay().beep(); - } - } - - protected int getLineNumber() - { - return fLineNumber; - } - - protected void setLineNumber( int lineNumber ) - { - fLineNumber = lineNumber; - } - - protected IAction getAction() - { - return fAction; - } - - protected void setAction( IAction action ) - { - fAction = action; - } - - protected IFile getFile() - { - return fFile; - } - - protected void setFile( IFile file ) - { - fFile = file; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerAction.java deleted file mode 100644 index 1d177911170..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerAction.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.cdt.debug.internal.ui.editors.DisassemblyEditorInput; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * - * Enter type comment. - * - * @since Aug 23, 2002 - */ -public class ManageBreakpointRulerAction extends Action implements IUpdate -{ - private IVerticalRulerInfo fRuler; - private ITextEditor fTextEditor; - private List fMarkers; - - private String fAddLabel; - private String fRemoveLabel; - - /** - * Constructor for ManageBreakpointRulerAction. - * - * @param ruler - * @param editor - */ - public ManageBreakpointRulerAction( IVerticalRulerInfo ruler, ITextEditor editor ) - { - fRuler = ruler; - fTextEditor = editor; - fAddLabel = "Add Breakpoint"; - fRemoveLabel = "Remove Breakpoint"; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - fMarkers = getMarkers(); - setText( fMarkers.isEmpty() ? fAddLabel : fRemoveLabel ); - } - - /** - * @see Action#run() - */ - public void run() - { - if ( fMarkers.isEmpty() ) - { - addMarker(); - } - else - { - removeMarkers( fMarkers ); - } - } - - protected List getMarkers() - { - List breakpoints = new ArrayList(); - - IResource resource = getResource(); - IDocument document = getDocument(); - AbstractMarkerAnnotationModel model = getAnnotationModel(); - - if ( model != null ) - { - try - { - IMarker[] markers = null; - if ( resource instanceof IFile && !(getTextEditor().getEditorInput() instanceof DisassemblyEditorInput) ) - { - markers = resource.findMarkers( IBreakpoint.BREAKPOINT_MARKER, - true, - IResource.DEPTH_INFINITE ); - } - else - { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - markers = root.findMarkers( IBreakpoint.BREAKPOINT_MARKER, - true, - IResource.DEPTH_INFINITE ); - } - - if ( markers != null ) - { - IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager(); - for ( int i = 0; i < markers.length; i++ ) - { - IBreakpoint breakpoint = breakpointManager.getBreakpoint( markers[i] ); - if ( breakpoint != null && - breakpointManager.isRegistered( breakpoint ) && - includesRulerLine( model.getMarkerPosition( markers[i] ), document ) ) - breakpoints.add( markers[i] ); - } - } - } - catch( CoreException x ) - { - CDebugUIPlugin.log( x.getStatus() ); - } - } - return breakpoints; - } - - /** - * Returns the resource for which to create the marker, - * or null if there is no applicable resource. - * - * @return the resource for which to create the marker or null - */ - protected IResource getResource() - { - IEditorInput input = fTextEditor.getEditorInput(); - IResource resource = (IResource)input.getAdapter( IFile.class ); - if ( resource == null ) - resource = (IResource)input.getAdapter( IResource.class ); - return resource; - } - - /** - * Checks whether a position includes the ruler's line of activity. - * - * @param position the position to be checked - * @param document the document the position refers to - * @return true if the line is included by the given position - */ - protected boolean includesRulerLine( Position position, IDocument document ) - { - if ( position != null ) - { - try - { - int markerLine = document.getLineOfOffset( position.getOffset() ); - int line = fRuler.getLineOfLastMouseButtonActivity(); - if ( line == markerLine ) - { - return true; - } - } - catch( BadLocationException x ) - { - } - } - return false; - } - - /** - * Returns this action's vertical ruler info. - * - * @return this action's vertical ruler - */ - protected IVerticalRulerInfo getVerticalRulerInfo() - { - return fRuler; - } - - /** - * Returns this action's editor. - * - * @return this action's editor - */ - protected ITextEditor getTextEditor() - { - return fTextEditor; - } - - /** - * Returns the AbstractMarkerAnnotationModel of the editor's input. - * - * @return the marker annotation model - */ - protected AbstractMarkerAnnotationModel getAnnotationModel() - { - IDocumentProvider provider = fTextEditor.getDocumentProvider(); - IAnnotationModel model = provider.getAnnotationModel( fTextEditor.getEditorInput() ); - if ( model instanceof AbstractMarkerAnnotationModel ) - { - return (AbstractMarkerAnnotationModel)model; - } - return null; - } - - /** - * Returns the IDocument of the editor's input. - * - * @return the document of the editor's input - */ - protected IDocument getDocument() - { - IDocumentProvider provider = fTextEditor.getDocumentProvider(); - return provider.getDocument( fTextEditor.getEditorInput() ); - } - - protected void addMarker() - { - IEditorInput editorInput = getTextEditor().getEditorInput(); - int rulerLine = getVerticalRulerInfo().getLineOfLastMouseButtonActivity(); - try - { - if ( editorInput instanceof IFileEditorInput ) - { - createLineBreakpoint( (IFileEditorInput)editorInput, rulerLine ); - } - else if ( editorInput.getAdapter( DisassemblyEditorInput.class ) != null ) - { - createAddressBreakpoint( (DisassemblyEditorInput)editorInput.getAdapter( DisassemblyEditorInput.class ), rulerLine ); - } - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Cannot add breakpoint", e ); - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( "Cannot add breakpoint", e ); - } - } - - private void createLineBreakpoint( IFileEditorInput editorInput, int rulerLine ) throws CoreException - { - IDocument document = getDocument(); - BreakpointLocationVerifier bv = new BreakpointLocationVerifier(); - int lineNumber = bv.getValidLineBreakpointLocation( document, rulerLine ); - if ( lineNumber > -1 ) - { - String fileName = editorInput.getFile().getLocation().toString(); - if ( fileName != null ) - { - if ( CDebugModel.lineBreakpointExists( fileName, lineNumber ) == null ) - { - CDebugModel.createLineBreakpoint( editorInput.getFile(), lineNumber, true, 0, "", true ); - } - } - } - } - - private void createAddressBreakpoint( DisassemblyEditorInput editorInput, int rulerLine ) throws CoreException - { - IDocument document = getDocument(); - BreakpointLocationVerifier bv = new BreakpointLocationVerifier(); - int lineNumber = bv.getValidAddressBreakpointLocation( document, rulerLine ); - if ( lineNumber > -1 ) - { - IResource resource = (IResource)editorInput.getAdapter( IResource.class ); - if ( resource != null ) - { - if ( editorInput.getStorage() != null ) - { - long address = ((IDisassemblyStorage)editorInput.getStorage()).getAddress( lineNumber ); - if ( address != 0 && CDebugModel.addressBreakpointExists( resource, address ) == null ) - { - CDebugModel.createAddressBreakpoint( resource, address, true, 0, "", true ); - } - } - } - } - } - - protected void removeMarkers( List markers ) - { - IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager(); - try - { - Iterator e = markers.iterator(); - while( e.hasNext() ) - { - IBreakpoint breakpoint = breakpointManager.getBreakpoint( (IMarker)e.next() ); - breakpointManager.removeBreakpoint( breakpoint, true ); - } - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( "Cannot remove breakpoint", e ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerActionDelegate.java deleted file mode 100644 index e9f02a1327b..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageBreakpointRulerActionDelegate.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.texteditor.AbstractRulerActionDelegate; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Enter type comment. - * - * @since Aug 23, 2002 - */ -public class ManageBreakpointRulerActionDelegate extends AbstractRulerActionDelegate -{ - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(ITextEditor, IVerticalRulerInfo) - */ - public IAction createAction( ITextEditor editor, IVerticalRulerInfo rulerInfo ) - { - return new ManageBreakpointRulerAction( rulerInfo, editor ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java deleted file mode 100644 index b33c884ab45..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ManageFunctionBreakpointActionDelegate.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunction; -import org.eclipse.cdt.core.model.IMethod; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.actions.ActionDelegate; - -/** - * Enter type comment. - * - * @since Apr 2, 2003 - */ -public class ManageFunctionBreakpointActionDelegate extends ActionDelegate - implements IObjectActionDelegate -{ -// private IFunction fFunction = null; - private ICElement fElement = null; - - /** - * - */ - public ManageFunctionBreakpointActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run( IAction action ) - { - if ( getMethod() != null ) - manageBreakpoint( getMethod() ); - else if ( getFunction() != null ) - manageBreakpoint( getFunction() ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICElement ) - { - boolean enabled = enablesFor( (ICElement)element ); - action.setEnabled( enabled ); - if ( enabled ) - { - setElement( (ICElement)element ); - return; - } - } - } - action.setEnabled( false ); - setElement( null ); - } - - public ICElement getElement() - { - return fElement; - } - - public void setElement( ICElement element ) - { - fElement = element; - } - - private boolean enablesFor( ICElement element ) - { - // for now - return true; - } - - private void manageBreakpoint( IFunction function ) - { - try - { - ICFunctionBreakpoint breakpoint = CDebugModel.functionBreakpointExists( function ); - if ( breakpoint != null ) - { - DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint( breakpoint, true ); - } - else - { - CDebugModel.createFunctionBreakpoint( function, true, 0, "", true ); - } - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( "Cannot add breakpoint", e ); - } - } - - private IFunction getFunction() - { - return ( getElement() != null ) ? (IFunction)getElement().getAdapter( IFunction.class ) : null; - } - - private void manageBreakpoint( IMethod method ) - { - try - { - ICFunctionBreakpoint breakpoint = CDebugModel.methodBreakpointExists( method ); - if ( breakpoint != null ) - { - DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint( breakpoint, true ); - } - else - { - CDebugModel.createMethodBreakpoint( method, true, 0, "", true ); - } - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( "Cannot add breakpoint", e ); - } - } - - private IMethod getMethod() - { - return ( getElement() != null ) ? (IMethod)getElement().getAdapter( IMethod.class ) : null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryActionSelectionGroup.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryActionSelectionGroup.java deleted file mode 100644 index bcab6f29c35..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryActionSelectionGroup.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jface.action.IAction; - -/** - * Enter type comment. - * - * @since: Oct 22, 2002 - */ -public class MemoryActionSelectionGroup -{ - private List fActions; - private IAction fSelection = null; - - /** - * Constructor for MemoryActionSelectionGroup. - */ - public MemoryActionSelectionGroup() - { - fActions = new ArrayList(); - } - - public IAction getCurrentSelection() - { - return fSelection; - } - - public void setCurrentSelection( IAction selection ) - { - Iterator it = fActions.iterator(); - while( it.hasNext() ) - { - IAction action = (IAction)it.next(); - if ( !action.equals( selection ) ) - { - action.setChecked( false ); - } - } - if ( fActions.contains( selection ) ) - { - fSelection = selection; - } - else - { - fSelection = null; - } - } - - public void addAction( IAction action ) - { - fActions.add( action ); - } - - public void dispose() - { - fActions.clear(); - fSelection = null; - } - - public IAction[] getActions() - { - return (IAction[])fActions.toArray( new IAction[fActions.size()] ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryFormatAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryFormatAction.java deleted file mode 100644 index c13f19d9e59..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryFormatAction.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * - * Enter type comment. - * - * @since Nov 3, 2002 - */ -public class MemoryFormatAction extends Action implements IUpdate -{ - private MemoryActionSelectionGroup fGroup; - private MemoryViewer fMemoryViewer; - private int fFormat = 0; - - /** - * Constructor for MemoryFormatAction. - */ - public MemoryFormatAction( MemoryActionSelectionGroup group, - MemoryViewer viewer, - int format ) - { - super( getLabel( format ), IAction.AS_CHECK_BOX ); - fGroup = group; - fMemoryViewer = viewer; - fFormat = format; - } - - /** - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canChangeFormat( fFormat ) ); - setChecked( fMemoryViewer.getCurrentFormat() == fFormat ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - try - { - fMemoryViewer.setFormat( fFormat ); - fGroup.setCurrentSelection( this ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to change format.", e.getStatus() ); - setChecked( false ); - } - } - - private static String getLabel( int id ) - { - String label = ""; - switch( id ) - { - case( IFormattedMemoryBlock.MEMORY_FORMAT_HEX ): - label = "Hexadecimal"; - break; - case( IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL ): - label = "Signed Decimal"; - break; - case( IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL ): - label = "Unsigned Decimal"; - break; - } - return label; - } - - public String getActionId() - { - return "MemoryFormat" + fFormat; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryNumberOfColumnAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryNumberOfColumnAction.java deleted file mode 100644 index 286a84bb259..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemoryNumberOfColumnAction.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Oct 25, 2002 - */ -public class MemoryNumberOfColumnAction extends Action implements IUpdate -{ - private MemoryActionSelectionGroup fGroup; - private MemoryViewer fMemoryViewer; - private int fNumberOfColumns = 0; - - /** - * Constructor for MemoryNumberOfColumnAction. - */ - public MemoryNumberOfColumnAction( MemoryActionSelectionGroup group, - MemoryViewer viewer, - int numberOfColumns ) - { - super( getLabel( numberOfColumns ), IAction.AS_CHECK_BOX ); - fGroup = group; - fMemoryViewer = viewer; - fNumberOfColumns = numberOfColumns; - } - - private static String getLabel( int numberOfColumns ) - { - return Integer.toString( numberOfColumns) + " column" + ( ( numberOfColumns > 1 ) ? "s" : "" ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canUpdate() ); - setChecked( fMemoryViewer.getCurrentNumberOfColumns() == fNumberOfColumns ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - try - { - fMemoryViewer.setNumberOfColumns( fNumberOfColumns ); - fGroup.setCurrentSelection( this ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to change the column number.", e.getStatus() ); - setChecked( false ); - } - } - - public String getActionId() - { - return "MemoryNumberOfColumns" + fNumberOfColumns; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemorySizeAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemorySizeAction.java deleted file mode 100644 index e9c153ae13d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MemorySizeAction.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Oct 22, 2002 - */ -public class MemorySizeAction extends Action implements IUpdate -{ - private MemoryActionSelectionGroup fGroup; - private MemoryViewer fMemoryViewer; - private int fId = 0; - - /** - * Constructor for MemorySizeAction. - */ - public MemorySizeAction( MemoryActionSelectionGroup group, - MemoryViewer viewer, - int id ) - { - super( getLabel( id ), IAction.AS_CHECK_BOX ); - fGroup = group; - fMemoryViewer = viewer; - fId = id; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canUpdate() ); - setChecked( fMemoryViewer.getCurrentWordSize() == fId ); - } - - private static String getLabel( int id ) - { - String label = ""; - switch( id ) - { - case( IFormattedMemoryBlock.MEMORY_SIZE_BYTE ): - label = "1 byte"; - break; - case( IFormattedMemoryBlock.MEMORY_SIZE_HALF_WORD ): - label = "2 bytes"; - break; - case( IFormattedMemoryBlock.MEMORY_SIZE_WORD ): - label = "4 bytes"; - break; - case( IFormattedMemoryBlock.MEMORY_SIZE_DOUBLE_WORD ): - label = "8 bytes"; - break; - } - return label; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - try - { - fMemoryViewer.setWordSize( fId ); - fGroup.setCurrentSelection( this ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to change memory unit size.", e.getStatus() ); - setChecked( false ); - } - } - - public String getActionId() - { - return "MemorySize" + fId; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java deleted file mode 100644 index d803b75623a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; - -/** - * - * Enter type comment. - * - * @since Dec 16, 2002 - */ -public class NaturalVariableFormatActionDelegate extends VariableFormatActionDelegate -{ - /** - * Constructor for NaturalVariableFormatActionDelegate. - * @param format - */ - public NaturalVariableFormatActionDelegate() - { - super( ICDIFormat.NATURAL ); - } - -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshAction.java deleted file mode 100644 index 6211528f1ee..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshAction.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.ICUpdateManager; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Feb 10, 2003 - */ -public class RefreshAction extends Action implements IUpdate -{ - private Viewer fViewer = null; - - /** - * Constructor for RefreshAction. - */ - public RefreshAction( Viewer viewer, String text ) - { - super( text ); - fViewer = viewer; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - if ( fViewer != null && fViewer.getInput() instanceof IAdaptable ) - { - ICUpdateManager uman = (ICUpdateManager)((IAdaptable)fViewer.getInput()).getAdapter( ICUpdateManager.class ); - if ( uman != null ) - { - setEnabled( uman.canUpdate() ); - return; - } - } - setEnabled( false ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - if ( fViewer != null && fViewer.getInput() instanceof IAdaptable ) - { - ICUpdateManager uman = (ICUpdateManager)((IAdaptable)fViewer.getInput()).getAdapter( ICUpdateManager.class ); - if ( uman != null ) - { - try - { - uman.update(); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to refresh.", e.getStatus() ); - } - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshMemoryAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshMemoryAction.java deleted file mode 100644 index c7d39f3c8cf..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RefreshMemoryAction.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.ui.actions.SelectionProviderAction; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Oct 18, 2002 - */ -public class RefreshMemoryAction extends SelectionProviderAction implements IUpdate -{ - private MemoryViewer fMemoryViewer; - - /** - * Constructor for RefreshMemoryAction. - * @param provider - * @param text - */ - public RefreshMemoryAction( MemoryViewer viewer ) - { - super( viewer, "Refresh" ); - fMemoryViewer = viewer; - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_REFRESH ); - setDescription( "Refresh Memory Block" ); - setToolTipText( "Refresh" ); - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.REFRESH_MEMORY_ACTION ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canUpdate() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - fMemoryViewer.refreshMemoryBlock(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestartActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestartActionDelegate.java deleted file mode 100644 index 011931efcd6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestartActionDelegate.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IRestart; -import org.eclipse.debug.core.DebugException; - -/** - * - * Enter type comment. - * - * @since Aug 23, 2002 - */ -public class RestartActionDelegate extends AbstractListenerActionDelegate -{ - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object) - */ - protected void doAction( Object element ) throws DebugException - { - if ( element instanceof IRestart ) - { - ((IRestart)element).restart(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object) - */ - protected boolean isEnabledFor( Object element ) - { - if ( element instanceof IRestart ) - { - return checkCapability( (IRestart)element ); - } - return false; - } - - protected boolean checkCapability( IRestart element ) - { - return element.canRestart(); - } - - /** - * @see AbstractDebugActionDelegate#enableForMultiSelection() - */ - protected boolean enableForMultiSelection() - { - return false; - } - - /** - * @see AbstractDebugActionDelegate#getStatusMessage() - */ - protected String getStatusMessage() - { - return "Exceptions occurred attempting to restart."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogMessage() - */ - protected String getErrorDialogMessage() - { - return "Restart failed."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogTitle() - */ - protected String getErrorDialogTitle() - { - return "Restart"; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionDelegate.java deleted file mode 100644 index 424b31cf383..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionDelegate.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.ICastToType; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.actions.ActionDelegate; - -/** - * Enter type comment. - * - * @since Mar 9, 2003 - */ -public class RestoreDefaultTypeActionDelegate extends ActionDelegate - implements IObjectActionDelegate -{ - private ICastToType fCastToType = null; - private IStatus fStatus = null; - - /** - * - */ - public RestoreDefaultTypeActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - } - - protected ICastToType getCastToType() - { - return fCastToType; - } - - protected void setCastToType( ICastToType castToType ) - { - fCastToType = castToType; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run( IAction action ) - { - if ( getCastToType() == null ) - return; - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getCastToType() ); - setStatus( null ); - } - catch( DebugException e ) - { - setStatus( e.getStatus() ); - } - } - } ); - if ( getStatus() != null && !getStatus().isOK() ) - { - IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Unable to cast to type.", getStatus() ); - } - else - { - CDebugUIPlugin.log( getStatus() ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICastToType ) - { - boolean enabled = ((ICastToType)element).isCasted(); - action.setEnabled( enabled ); - if ( enabled ) - { - setCastToType( (ICastToType)element ); - return; - } - } - } - action.setEnabled( false ); - setCastToType( null ); - } - - public IStatus getStatus() - { - return fStatus; - } - - public void setStatus( IStatus status ) - { - fStatus = status; - } - - protected void doAction( ICastToType castToType ) throws DebugException - { - castToType.restoreDefault(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineActionDelegate.java deleted file mode 100644 index b0c4c14b30e..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineActionDelegate.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.debug.core.model.IRunToAddress; -import org.eclipse.cdt.debug.core.model.IRunToLine; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IStorageEditorInput; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Enter type comment. - * - * @since Sep 19, 2002 - */ -public class RunToLineActionDelegate extends AbstractEditorActionDelegate -{ - /** - * Constructor for RunToLineActionDelegate. - */ - public RunToLineActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getTargetPart() != null && getTargetPart() instanceof ITextEditor ) - { - IEditorInput input = ((ITextEditor)getTargetPart()).getEditorInput(); - if ( input != null && input instanceof IFileEditorInput ) - { - IFile file = ((IFileEditorInput)input).getFile(); - if ( file != null ) - { - ITextSelection selection = (ITextSelection)((ITextEditor)getTargetPart()).getSelectionProvider().getSelection(); - int lineNumber = selection.getStartLine() + 1; - runToLine( file, lineNumber ); - } - } - else if ( input != null && input instanceof IStorageEditorInput ) - { - try - { - IStorage storage = ((IStorageEditorInput)input).getStorage(); - if ( storage instanceof FileStorage ) - { - IPath path = storage.getFullPath(); - if ( path != null ) - { - ITextSelection selection = (ITextSelection)((ITextEditor)getTargetPart()).getSelectionProvider().getSelection(); - int lineNumber = selection.getStartLine() + 1; - runToLine( path.lastSegment(), lineNumber ); - } - } - else if ( storage != null && storage.getAdapter( IDisassemblyStorage.class ) != null ) - { - IDisassemblyStorage disassemblyStorage = (IDisassemblyStorage)storage.getAdapter( IDisassemblyStorage.class ); - ITextSelection selection = (ITextSelection)((ITextEditor)getTargetPart()).getSelectionProvider().getSelection(); - int lineNumber = selection.getStartLine(); - long address = disassemblyStorage.getAddress( lineNumber ); - if ( address > 0 ) - runToAddress( address ); - } - } - catch( CoreException e ) - { - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractEditorActionDelegate#initializeDebugTarget() - */ - protected void initializeDebugTarget() - { - setDebugTarget( null ); - IAdaptable context = DebugUITools.getDebugContext(); - if ( context != null && context instanceof IDebugElement ) - { - IDebugTarget target = ((IDebugElement)context).getDebugTarget(); - if ( target != null && - ( target instanceof IRunToLine || target instanceof IRunToAddress ) ) - { - setDebugTarget( target ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - IDebugTarget target = null; - if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof IDebugElement ) - { - IDebugTarget target1 = ((IDebugElement)element).getDebugTarget(); - if ( target1 != null && - ( target1 instanceof IRunToLine || target1 instanceof IRunToAddress ) ) - { - target = target1; - } - } - } - setDebugTarget( target ); - update(); - } - } - - protected void runToLine( IFile file, int lineNumber ) - { - IRunToLine target = (IRunToLine)getDebugTarget().getAdapter( IRunToLine.class ); - if ( target != null ) - { - if ( !target.canRunToLine( file, lineNumber ) ) - { - getTargetPart().getSite().getShell().getDisplay().beep(); - return; - } - try - { - target.runToLine( file, lineNumber ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } - } - - protected void runToLine( String fileName, int lineNumber ) - { - IRunToLine target = (IRunToLine)getDebugTarget().getAdapter( IRunToLine.class ); - if ( target != null ) - { - if ( !target.canRunToLine( fileName, lineNumber ) ) - { - getTargetPart().getSite().getShell().getDisplay().beep(); - return; - } - try - { - target.runToLine( fileName, lineNumber ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } - } - - protected void runToAddress( long address ) - { - IRunToAddress target = (IRunToAddress)getDebugTarget().getAdapter( IRunToAddress.class ); - if ( target != null ) - { - if ( !target.canRunToAddress( address ) ) - { - getTargetPart().getSite().getShell().getDisplay().beep(); - return; - } - try - { - target.runToAddress( address ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerAction.java deleted file mode 100644 index d0d57687ac5..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerAction.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IRunToLine; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.INullSelectionListener; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * - * Enter type comment. - * - * @since Sep 19, 2002 - */ -public class RunToLineRulerAction extends Action - implements IUpdate, - ISelectionListener, - INullSelectionListener -{ - private IVerticalRulerInfo fInfo; - private ITextEditor fTextEditor; - private IRunToLine fTarget = null; - - /** - * Constructor for RunToLineRulerAction. - */ - public RunToLineRulerAction( IVerticalRulerInfo info, ITextEditor editor ) - { - setInfo( info ); - setTextEditor( editor ); - setText( "Run To Line" ); - initializeTarget(); - update(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - boolean enabled = false; - IFile file = getFile(); - int lineNumber = getLineNumber(); - IDocumentProvider provider = getTextEditor().getDocumentProvider(); - IDocument doc = provider.getDocument( getTextEditor().getEditorInput() ); - if ( file != null && lineNumber <= doc.getNumberOfLines() && lineNumber > 0 ) - { - enabled = ( getTarget() != null && getTarget().canRunToLine( file, lineNumber ) ); - } - setEnabled( enabled ); - } - - /** - * @see Action#run() - */ - public void run() - { - runToLine( getFile(), getLineNumber() ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - IRunToLine target = null; - if ( part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) - { - if ( selection != null && selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof IRunToLine ) - { - target = (IRunToLine)element; - } - } - setTarget( target ); - update(); - } - } - - protected void initializeTarget() - { - setTarget( null ); - IAdaptable context = DebugUITools.getDebugContext(); - if ( context != null && context instanceof IRunToLine ) - { - setTarget( (IRunToLine)context ); - } - } - - protected void setTarget( IRunToLine target ) - { - fTarget = target; - } - - protected IRunToLine getTarget() - { - return fTarget; - } - - protected IVerticalRulerInfo getInfo() - { - return fInfo; - } - - protected void setInfo( IVerticalRulerInfo info ) - { - fInfo = info; - } - - protected ITextEditor getTextEditor() - { - return fTextEditor; - } - - protected void setTextEditor( ITextEditor textEditor ) - { - fTextEditor = textEditor; - } - - protected IFile getFile() - { - IEditorInput input = getTextEditor().getEditorInput(); - if ( input != null && input instanceof IFileEditorInput ) - { - return ((IFileEditorInput)input).getFile(); - } - return null; - } - - protected int getLineNumber() - { - return getInfo().getLineOfLastMouseButtonActivity() + 1; - } - - protected void runToLine( IFile file, int lineNumber ) - { - if ( !getTarget().canRunToLine( file, lineNumber ) ) - { - getTextEditor().getSite().getShell().getDisplay().beep(); - return; - } - try - { - getTarget().runToLine( file, lineNumber ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), e ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerActionDelegate.java deleted file mode 100644 index ac619e67e3d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineRulerActionDelegate.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.source.IVerticalRulerInfo; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.texteditor.AbstractRulerActionDelegate; -import org.eclipse.ui.texteditor.ITextEditor; - -/** - * - * Enter type comment. - * - * @since Sep 19, 2002 - */ -public class RunToLineRulerActionDelegate extends AbstractRulerActionDelegate -{ - static final private String C_EDITOR_ID = "org.eclipse.cdt.ui.editor.CEditor"; //$NON-NLS-1$ - - /** - * @see IEditorActionDelegate#setActiveEditor(IAction, IEditorPart) - */ - public void setActiveEditor( IAction callerAction, IEditorPart targetEditor ) - { - if ( targetEditor != null ) - { - String id = targetEditor.getSite().getId(); - if ( !id.equals( C_EDITOR_ID ) ) - targetEditor = null; - } - super.setActiveEditor( callerAction, targetEditor ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(ITextEditor, IVerticalRulerInfo) - */ - public IAction createAction( ITextEditor editor, IVerticalRulerInfo rulerInfo ) - { - return new RunToLineRulerAction( rulerInfo, editor ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowAsciiAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowAsciiAction.java deleted file mode 100644 index 352c79c1690..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowAsciiAction.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer; -import org.eclipse.ui.actions.SelectionProviderAction; -import org.eclipse.ui.help.WorkbenchHelp; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since: Oct 21, 2002 - */ -public class ShowAsciiAction extends SelectionProviderAction implements IUpdate -{ - private MemoryViewer fMemoryViewer; - - /** - * Constructor for ShowAsciiAction. - * @param provider - * @param text - */ - public ShowAsciiAction( MemoryViewer viewer ) - { - super( viewer, "Show ASCII" ); - fMemoryViewer = viewer; - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_SHOW_ASCII ); - setDescription( "Show ASCII" ); - setToolTipText( "Show ASCII" ); - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.MEMORY_SHOW_ASCII_ACTION ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() - { - setEnabled( fMemoryViewer.canShowAscii() ); - setChecked( fMemoryViewer.showAscii() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() - { - fMemoryViewer.setShowAscii( isChecked() ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java deleted file mode 100644 index 8cfcdb1c81a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDTDebugModelPresentation; -import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.swt.custom.BusyIndicator; - -/** - * - * Enter type comment. - * - * @since Oct 4, 2002 - */ -public class ShowFullPathsAction extends ToggleDelegateAction -{ - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.ToggleDelegateAction#initActionId() - */ - protected void initActionId() - { - fId = CDebugUIPlugin.getUniqueIdentifier() + getView().getSite().getId() + ".ShowFullPathsAction"; //$NON-NLS-1$ - } - - protected void setAction( IAction action ) - { - super.setAction( action ); - action.setChecked( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.ToggleDelegateAction#valueChanged(boolean) - */ - protected void valueChanged( boolean on ) - { - if ( getViewer().getControl().isDisposed() ) - { - return; - } - ILabelProvider labelProvider = (ILabelProvider)getViewer().getLabelProvider(); - if ( labelProvider instanceof IDebugModelPresentation ) - { - IDebugModelPresentation debugLabelProvider = (IDebugModelPresentation)labelProvider; - debugLabelProvider.setAttribute( CDTDebugModelPresentation.DISPLAY_FULL_PATHS, ( on ? Boolean.TRUE : Boolean.FALSE ) ); - BusyIndicator.showWhile( getViewer().getControl().getDisplay(), - new Runnable() - { - public void run() - { - getViewer().refresh(); - } - } ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java deleted file mode 100644 index ba13ef8b818..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowRegisterTypesAction.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.IDebugView; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * An action that toggles the state of a viewer to show/hide type names - * of registers. - * - * @since Sep 16, 2002 - */ -public class ShowRegisterTypesAction extends Action -{ - private IDebugView fView; - - /** - * Constructor for ShowRegisterTypesAction. - */ - public ShowRegisterTypesAction( IDebugView view ) - { - super( "Show &Type Names", IAction.AS_CHECK_BOX ); - setView( view ); - setToolTipText( "Show Type Names" ); - CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_TYPE_NAMES ); - setId( CDebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction" ); //$NON-NLS-1$ - WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.SHOW_TYPES_ACTION ); - } - - /** - * @see Action#run() - */ - public void run() - { - valueChanged( isChecked() ); - } - - private void valueChanged( boolean on ) - { - if ( getViewer().getControl().isDisposed() ) - { - return; - } - IDebugModelPresentation debugLabelProvider = (IDebugModelPresentation)getView().getAdapter( IDebugModelPresentation.class ); - if ( debugLabelProvider != null ) - { - debugLabelProvider.setAttribute( IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, ( on ? Boolean.TRUE : Boolean.FALSE ) ); - BusyIndicator.showWhile( getViewer().getControl().getDisplay(), - new Runnable() - { - public void run() - { - getViewer().refresh(); - } - } ); - } - } - - /** - * @see Action#setChecked(boolean) - */ - public void setChecked( boolean value ) - { - super.setChecked( value ); - valueChanged( value ); - } - - protected StructuredViewer getViewer() - { - if ( getView() != null && getView().getViewer() instanceof StructuredViewer ) - return (StructuredViewer)getView().getViewer(); - return null; - } - - protected IDebugView getView() - { - return fView; - } - - public void setView( IDebugView view ) - { - fView = view; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java deleted file mode 100644 index 9ebe62b460e..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import java.text.MessageFormat; - -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; - -/** - * Enter type comment. - * - * @since: Jan 31, 2003 - */ -public class SignalActionDelegate implements IObjectActionDelegate -{ - private ICSignal fSignal = null; - - /** - * Constructor for SignalActionDelegate. - */ - public SignalActionDelegate() - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getSignal() != null ) - { - final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, - MessageFormat.format( "Unable to deliver the signal ''{0}'' to the target.", new String[] { getSignal().getName() } ), - null ); - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getSignal() ); - } - catch( DebugException e ) - { - ms.merge( e.getStatus() ); - } - } - } ); - if ( !ms.isOK() ) - { - IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Operation failed.", ms ); - } - else - { - CDebugUIPlugin.log( ms ); - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICSignal ) - { - boolean enabled = enablesFor( (ICSignal)element ); - action.setEnabled( enabled ); - if ( enabled ) - { - setSignal( (ICSignal)element ); - return; - } - } - } - action.setEnabled( false ); - setSignal( null ); - } - - protected void doAction( ICSignal signal ) throws DebugException - { - signal.signal(); - } - - private boolean enablesFor( ICSignal signal ) - { - return ( signal != null && signal.getDebugTarget().isSuspended() ); - } - - private void setSignal( ICSignal signal ) - { - fSignal = signal; - } - - protected ICSignal getSignal() - { - return fSignal; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroObjectActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroObjectActionDelegate.java deleted file mode 100644 index d248889936e..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroObjectActionDelegate.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; - -/** - * Enter type comment. - * - * @since: Feb 4, 2003 - */ -public class SignalZeroObjectActionDelegate implements IObjectActionDelegate -{ - private IResumeWithoutSignal fTarget = null; - - /** - * Constructor for SignalZeroObjectActionDelegate. - */ - public SignalZeroObjectActionDelegate() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getTarget() != null ) - { - final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, - "Unable to resume ignoring signal.", - null ); - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getTarget() ); - } - catch( DebugException e ) - { - ms.merge( e.getStatus() ); - } - } - } ); - if ( !ms.isOK() ) - { - IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Operation failed.", ms ); - } - else - { - CDebugUIPlugin.log( ms ); - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof IResumeWithoutSignal ) - { - boolean enabled = ((IResumeWithoutSignal)element).canResumeWithoutSignal(); - action.setEnabled( enabled ); - if ( enabled ) - { - setTarget( (IResumeWithoutSignal)element ); - return; - } - } - } - action.setEnabled( false ); - setTarget( null ); - } - - protected void doAction( IResumeWithoutSignal target ) throws DebugException - { - target.resumeWithoutSignal(); - } - - protected IResumeWithoutSignal getTarget() - { - return fTarget; - } - - protected void setTarget( IResumeWithoutSignal target ) - { - fTarget = target; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java deleted file mode 100644 index 580650284c8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalZeroWorkbenchActionDelegate.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal; -import org.eclipse.debug.core.DebugException; - -/** - * Enter type comment. - * - * @since: Feb 7, 2003 - */ -public class SignalZeroWorkbenchActionDelegate extends AbstractListenerActionDelegate -{ - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object) - */ - protected void doAction( Object element ) throws DebugException - { - if ( element instanceof IResumeWithoutSignal ) - { - ((IResumeWithoutSignal)element).resumeWithoutSignal(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(java.lang.Object) - */ - protected boolean isEnabledFor( Object element ) - { - if ( element instanceof IResumeWithoutSignal ) - { - return ((IResumeWithoutSignal)element).canResumeWithoutSignal(); - } - return false; - } - - /** - * @see AbstractDebugActionDelegate#getStatusMessage() - */ - protected String getStatusMessage() - { - return "Exceptions occurred attempting to resume without signal."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogMessage() - */ - protected String getErrorDialogMessage() - { - return "Resume without signal failed."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogTitle() - */ - protected String getErrorDialogTitle() - { - return "Resume Without Signal"; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java deleted file mode 100644 index 9e8cfa2f30c..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SwitchToDisassemblyActionDelegate.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode; -import org.eclipse.cdt.debug.internal.core.model.CDebugElement; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.ui.AbstractDebugView; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IViewPart; - -/** - * Enter type comment. - * - * @since: Oct 11, 2002 - */ -public class SwitchToDisassemblyActionDelegate extends AbstractListenerActionDelegate -{ - private IViewPart fViewPart = null; - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object) - */ - protected void doAction( Object element ) throws DebugException - { - if ( element != null && element instanceof CDebugElement && getAction() != null && getAction().isEnabled() ) - { - ISourceMode sourceMode = (ISourceMode)((CDebugElement)element).getDebugTarget().getAdapter( ISourceMode.class ); - if ( sourceMode != null ) - { - sourceMode.setMode( ( getAction().isChecked() ) ? ISourceMode.MODE_DISASSEMBLY : ISourceMode.MODE_SOURCE ); - ((CDebugElement)element).fireChangeEvent( DebugEvent.CLIENT_REQUEST ); - if ( fViewPart != null && fViewPart instanceof ISelectionChangedListener ) - { - final AbstractDebugView view = (AbstractDebugView)fViewPart; - fViewPart.getViewSite().getShell().getDisplay().asyncExec( - new Runnable() - { - public void run() - { - Viewer viewer = view.getViewer(); - viewer.setSelection( viewer.getSelection() ); - } - } ); - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object) - */ - protected boolean isEnabledFor( Object element ) - { - if ( element != null && element instanceof CDebugElement ) - { - return ( ((CDebugElement)element).getDebugTarget().getAdapter( ISourceMode.class ) != null ); - } - return false; - } - - /** - * @see AbstractDebugActionDelegate#enableForMultiSelection() - */ - protected boolean enableForMultiSelection() - { - return false; - } - - /** - * @see AbstractDebugActionDelegate#getStatusMessage() - */ - protected String getStatusMessage() - { - return "Exceptions occurred attempting to switch to disassembly/source mode."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogMessage() - */ - protected String getErrorDialogMessage() - { - return "Switch to disassembly/source mode failed."; - } - - /** - * @see AbstractDebugActionDelegate#getErrorDialogTitle() - */ - protected String getErrorDialogTitle() - { - return "Switch to disassembly/source mode"; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - super.selectionChanged( action, selection ); - boolean checked = false; - if ( selection != null && selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof CDebugElement ) - { - ISourceMode sourceMode = (ISourceMode)((CDebugElement)element).getDebugTarget().getAdapter( ISourceMode.class ); - checked = ( sourceMode != null && sourceMode.getMode() == ISourceMode.MODE_DISASSEMBLY ); - } - } - action.setChecked( checked ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) - */ - public void init( IViewPart view ) - { - super.init( view ); - fViewPart = view; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleDelegateAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleDelegateAction.java deleted file mode 100644 index 0ca41718f81..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleDelegateAction.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.ui.IDebugView; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPart; - -/** - * - * A generic Toggle view action delegate, meant to be subclassed to provide - * a specific filter. - * - * @since Oct 4, 2002 - */ -public abstract class ToggleDelegateAction implements IViewActionDelegate, - IPropertyChangeListener, - IPartListener -{ - /** - * The viewer that this action works for - */ - private StructuredViewer fViewer; - - private IViewPart fView; - - protected String fId = ""; //$NON-NLS-1$ - - private IAction fAction; - private boolean fNeedsInitialization = true; - - protected void dispose() - { - if ( fView != null ) - { - fView.getViewSite().getPage().removePartListener( this ); - } - CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this ); - } - - /** - * @see IViewActionDelegate#init(IViewPart) - */ - public void init( IViewPart view ) - { - setView( view ); - initActionId(); - IDebugView adapter = (IDebugView)view.getAdapter( IDebugView.class ); - if ( adapter != null && adapter.getViewer() instanceof StructuredViewer ) - { - setViewer( (StructuredViewer)adapter.getViewer() ); - } - view.getViewSite().getPage().addPartListener( this ); - CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); - } - - protected abstract void initActionId(); - - /** - * @see IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - //do nothing.."run" will occur from the property change - //this allows for setting the checked state of the IAction - //to drive the execution of this delegate. - //see propertyChange(PropertyChangeEvent) - } - - protected abstract void valueChanged( boolean on ); - - protected String getActionId() - { - return fId; - } - - protected StructuredViewer getViewer() - { - return fViewer; - } - - protected void setViewer( StructuredViewer viewer ) - { - fViewer = viewer; - } - - /** - * @see IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( fNeedsInitialization ) - { - setAction( action ); - action.setId( getActionId() ); - fNeedsInitialization = false; - } - } - - protected IAction getAction() - { - return fAction; - } - - protected void setAction( IAction action ) - { - fAction = action; - action.addPropertyChangeListener( this ); - } - - /** - * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - if ( event.getProperty().equals( getActionId() ) ) - { - getAction().setChecked( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( getActionId() ) ); - } - else if ( event.getProperty().equals( IAction.CHECKED ) ) - { - CDebugUIPlugin.getDefault().getPreferenceStore().setValue( getActionId(), getAction().isChecked() ); - valueChanged( getAction().isChecked() ); - } - } - - /** - * @see IPartListener#partActivated(IWorkbenchPart) - */ - public void partActivated( IWorkbenchPart part ) - { - } - - /** - * @see IPartListener#partBroughtToTop(IWorkbenchPart) - */ - public void partBroughtToTop( IWorkbenchPart part ) - { - } - - /** - * @see IPartListener#partClosed(IWorkbenchPart) - */ - public void partClosed( IWorkbenchPart part ) - { - if ( part.equals( getView() ) ) - { - dispose(); - } - } - - /** - * @see IPartListener#partDeactivated(IWorkbenchPart) - */ - public void partDeactivated( IWorkbenchPart part ) - { - } - - /** - * @see IPartListener#partOpened(IWorkbenchPart) - */ - public void partOpened( IWorkbenchPart part ) - { - } - - protected IViewPart getView() - { - return fView; - } - - protected void setView( IViewPart view ) - { - fView = view; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java deleted file mode 100644 index 2f0372e391d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; -import org.eclipse.cdt.debug.core.model.ICVariable; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; - -/** - * - * Enter type comment. - * - * @since Dec 16, 2002 - */ -public class VariableFormatActionDelegate implements IObjectActionDelegate -{ - private int fFormat = ICDIFormat.DECIMAL; - private ICVariable fVariable = null; - - /** - * Constructor for VariableFormatActionDelegate. - */ - public VariableFormatActionDelegate( int format ) - { - fFormat = format; - } - - /** - * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) - */ - public void setActivePart( IAction action, IWorkbenchPart targetPart ) - { - } - - /** - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run( IAction action ) - { - if ( getVariable() != null ) - { - final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, "", null ); - BusyIndicator.showWhile( Display.getCurrent(), - new Runnable() - { - public void run() - { - try - { - doAction( getVariable() ); - } - catch( DebugException e ) - { - ms.merge( e.getStatus() ); - } - } - } ); - if ( !ms.isOK() ) - { - IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow(); - if ( window != null ) - { - CDebugUIPlugin.errorDialog( "Unable to set format of variable.", ms ); - } - else - { - CDebugUIPlugin.log( ms ); - } - } - - } - } - - /** - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged( IAction action, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element instanceof ICVariable ) - { - boolean enabled = enablesFor( (ICVariable)element ); - action.setEnabled( enabled ); - if ( enabled ) - { - action.setChecked( ( ((ICVariable)element).getFormat() == fFormat ) ); - setVariable( (ICVariable)element ); - return; - } - } - } - action.setChecked( false ); - action.setEnabled( false ); - setVariable( null ); - } - - private boolean enablesFor( ICVariable var ) - { - return var.isEditable(); - } - - private void setVariable( ICVariable var ) - { - fVariable = var; - } - - protected ICVariable getVariable() - { - return fVariable; - } - - protected void doAction( ICVariable var ) throws DebugException - { - var.setFormat( fFormat ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/WatchpointExpressionVerifier.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/WatchpointExpressionVerifier.java deleted file mode 100644 index 743af06f6ab..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/WatchpointExpressionVerifier.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.actions; - -import org.eclipse.jface.text.IDocument; - -/** - * - * Enter type comment. - * - * @since Sep 5, 2002 - */ -public class WatchpointExpressionVerifier -{ - /** - * Returns whether the specified expression is valid for a watchpoint. - */ - public boolean isValidExpression( IDocument doc, String expression ) - { - // for now - return expression.trim().length() > 0; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/CheckedListDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/CheckedListDialogField.java deleted file mode 100644 index 59440a41a85..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/CheckedListDialogField.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Table; - -/** - * A list with checkboxes and a button bar. Typical buttons are 'Check All' and 'Uncheck All'. - * List model is independend of widget creation. - * DialogFields controls are: Label, List and Composite containing buttons. - */ -public class CheckedListDialogField extends ListDialogField { - - private int fCheckAllButtonIndex; - private int fUncheckAllButtonIndex; - - private List fCheckElements; - - public CheckedListDialogField(IListAdapter adapter, String[] customButtonLabels, ILabelProvider lprovider) { - super(adapter, customButtonLabels, lprovider); - fCheckElements= new ArrayList(); - - fCheckAllButtonIndex= -1; - fUncheckAllButtonIndex= -1; - } - - /** - * Sets the index of the 'check' button in the button label array passed in the constructor. - * The behaviour of the button marked as the check button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setCheckAllButtonIndex(int checkButtonIndex) { - Assert.isTrue(checkButtonIndex < fButtonLabels.length); - fCheckAllButtonIndex= checkButtonIndex; - } - - /** - * Sets the index of the 'uncheck' button in the button label array passed in the constructor. - * The behaviour of the button marked as the uncheck button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setUncheckAllButtonIndex(int uncheckButtonIndex) { - Assert.isTrue(uncheckButtonIndex < fButtonLabels.length); - fUncheckAllButtonIndex= uncheckButtonIndex; - } - - - /* - * @see ListDialogField#createTableViewer - */ - protected TableViewer createTableViewer(Composite parent) { - Table table= new Table(parent, SWT.CHECK + getListStyle()); - CheckboxTableViewer tableViewer= new CheckboxTableViewer(table); - tableViewer.addCheckStateListener(new ICheckStateListener() { - public void checkStateChanged(CheckStateChangedEvent e) { - doCheckStateChanged(e); - } - }); - return tableViewer; - } - - - /* - * @see ListDialogField#getListControl - */ - public Control getListControl(Composite parent) { - Control control= super.getListControl(parent); - if (parent != null) { - ((CheckboxTableViewer)fTable).setCheckedElements(fCheckElements.toArray()); - } - return control; - } - - /* - * @see DialogField#dialogFieldChanged - * Hooks in to get element changes to update check model. - */ - public void dialogFieldChanged() { - for (int i= fCheckElements.size() -1; i >= 0; i--) { - if (!fElements.contains(fCheckElements.get(i))) { - fCheckElements.remove(i); - } - } - super.dialogFieldChanged(); - } - - private void checkStateChanged() { - //call super and do not update check model - super.dialogFieldChanged(); - } - - /** - * Gets the checked elements. - */ - public List getCheckedElements() { - return new ArrayList(fCheckElements); - } - - /** - * Returns true if the element is checked. - */ - public boolean isChecked(Object obj) { - return fCheckElements.contains(obj); - } - - /** - * Sets the checked elements. - */ - public void setCheckedElements(List list) { - fCheckElements= new ArrayList(list); - if (fTable != null) { - ((CheckboxTableViewer)fTable).setCheckedElements(list.toArray()); - } - checkStateChanged(); - } - - /** - * Sets the checked state of an element. - */ - public void setChecked(Object object, boolean state) { - setCheckedWithoutUpdate(object, state); - checkStateChanged(); - } - - /** - * Sets the checked state of an element. no dialog changed listener informed - */ - public void setCheckedWithoutUpdate(Object object, boolean state) { - if (state) { - if (!fCheckElements.contains(object)) { - fCheckElements.add(object); - } - } - else { - if (fCheckElements.contains(object)) { - fCheckElements.remove(object); - } - } - if (fTable != null) { - ((CheckboxTableViewer)fTable).setChecked(object, state); - } - } - - /** - * Sets the check state of all elements - */ - public void checkAll(boolean state) { - if (state) { - fCheckElements= getElements(); - } else { - fCheckElements.clear(); - } - if (fTable != null) { - ((CheckboxTableViewer)fTable).setAllChecked(state); - } - checkStateChanged(); - } - - - protected void doCheckStateChanged(CheckStateChangedEvent e) { - if (e.getChecked()) { - fCheckElements.add(e.getElement()); - } else { - fCheckElements.remove(e.getElement()); - } - checkStateChanged(); - } - - // ------ enable / disable management - - /* - * @see ListDialogField#getManagedButtonState - */ - protected boolean getManagedButtonState(ISelection sel, int index) { - if (index == fCheckAllButtonIndex) { - return !fElements.isEmpty(); - } else if (index == fUncheckAllButtonIndex) { - return !fElements.isEmpty(); - } - return super.getManagedButtonState(sel, index); - } - - /* - * @see ListDialogField#extraButtonPressed - */ - protected boolean managedButtonPressed(int index) { - if (index == fCheckAllButtonIndex) { - checkAll(true); - } else if (index == fUncheckAllButtonIndex) { - checkAll(false); - } else { - return super.managedButtonPressed(index); - } - return true; - } - - - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ComboDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ComboDialogField.java deleted file mode 100644 index 7b0fd5e674c..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ComboDialogField.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field containing a label and a combo control. - */ -public class ComboDialogField extends DialogField { - - private String fText; - private int fSelectionIndex; - private String[] fItems; - private Combo fComboControl; - private ModifyListener fModifyListener; - private int fFlags; - - public ComboDialogField(int flags) { - super(); - fText= ""; //$NON-NLS-1$ - fItems= new String[0]; - fFlags= flags; - fSelectionIndex= -1; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Combo combo= getComboControl(parent); - combo.setLayoutData(gridDataForCombo(nColumns - 1)); - - return new Control[] { label, combo }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 2; - } - - protected static GridData gridDataForCombo(int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - return gd; - } - - // ------- focus methods - - /* - * @see DialogField#setFocus - */ - public boolean setFocus() { - if (isOkToUse(fComboControl)) { - fComboControl.setFocus(); - } - return true; - } - - // ------- ui creation - - /** - * Creates or returns the created combo control. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Combo getComboControl(Composite parent) { - if (fComboControl == null) { - assertCompositeNotNull(parent); - fModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - doModifyText(e); - } - }; - SelectionListener selectionListener= new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - doSelectionChanged(e); - } - - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - fComboControl= new Combo(parent, fFlags); - // moved up due to 1GEUNW2 - fComboControl.setItems(fItems); - if (fSelectionIndex != -1) { - fComboControl.select(fSelectionIndex); - } else { - fComboControl.setText(fText); - } - fComboControl.setFont(parent.getFont()); - fComboControl.addModifyListener(fModifyListener); - fComboControl.addSelectionListener(selectionListener); - fComboControl.setEnabled(isEnabled()); - } - return fComboControl; - } - - protected void doModifyText(ModifyEvent e) { - if (isOkToUse(fComboControl)) { - fText= fComboControl.getText(); - fSelectionIndex= fComboControl.getSelectionIndex(); - } - dialogFieldChanged(); - } - - protected void doSelectionChanged(SelectionEvent e) { - if (isOkToUse(fComboControl)) { - fItems= fComboControl.getItems(); - fText= fComboControl.getText(); - fSelectionIndex= fComboControl.getSelectionIndex(); - } - dialogFieldChanged(); - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fComboControl)) { - fComboControl.setEnabled(isEnabled()); - } - } - - // ------ text access - - /** - * Gets the combo items. - */ - public String[] getItems() { - return fItems; - } - - /** - * Sets the combo items. Triggers a dialog-changed event. - */ - public void setItems(String[] items) { - fItems= items; - if (isOkToUse(fComboControl)) { - fComboControl.setItems(items); - } - dialogFieldChanged(); - } - - /** - * Gets the text. - */ - public String getText() { - return fText; - } - - /** - * Sets the text. Triggers a dialog-changed event. - */ - public void setText(String text) { - fText= text; - if (isOkToUse(fComboControl)) { - fComboControl.setText(text); - } else { - dialogFieldChanged(); - } - } - - /** - * Selects an item. - */ - public void selectItem(int index) { - if (isOkToUse(fComboControl)) { - fComboControl.select(index); - } else { - if (index >= 0 && index < fItems.length) { - fText= fItems[index]; - fSelectionIndex= index; - } - } - dialogFieldChanged(); - } - - public int getSelectionIndex() { - return fSelectionIndex; - } - - - /** - * Sets the text without triggering a dialog-changed event. - */ - public void setTextWithoutUpdate(String text) { - fText= text; - if (isOkToUse(fComboControl)) { - fComboControl.removeModifyListener(fModifyListener); - fComboControl.setText(text); - fComboControl.addModifyListener(fModifyListener); - } - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java deleted file mode 100644 index 41c528f7f6b..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; - -/** - * Base class of all dialog fields. - * Dialog fields manage controls together with the model, independed - * from the creation time of the widgets. - * - support for automated layouting. - * - enable / disable, set focus a concept of the base class. - * - * DialogField have a label. - */ -public class DialogField { - - private Label fLabel; - protected String fLabelText; - - private IDialogFieldListener fDialogFieldListener; - - private boolean fEnabled; - - public DialogField() { - fEnabled= true; - fLabel= null; - fLabelText= ""; //$NON-NLS-1$ - } - - /** - * Sets the label of the dialog field. - */ - public void setLabelText(String labeltext) { - fLabelText= labeltext; - } - - // ------ change listener - - /** - * Defines the listener for this dialog field. - */ - public final void setDialogFieldListener(IDialogFieldListener listener) { - fDialogFieldListener= listener; - } - - /** - * Programatical invocation of a dialog field change. - */ - public void dialogFieldChanged() { - if (fDialogFieldListener != null) { - fDialogFieldListener.dialogFieldChanged(this); - } - } - - // ------- focus management - - /** - * Tries to set the focus to the dialog field. - * Returns true if the dialog field can take focus. - * To be reimplemented by dialog field implementors. - */ - public boolean setFocus() { - return false; - } - - /** - * Posts setFocus to the display event queue. - */ - public void postSetFocusOnDialogField(Display display) { - if (display != null) { - display.asyncExec( - new Runnable() { - public void run() { - setFocus(); - } - } - ); - } - } - - // ------- layout helpers - - /** - * Creates all controls of the dialog field and fills it to a composite. - * The composite is assumed to have MGridLayout as - * layout. - * The dialog field will adjust its controls' spans to the number of columns given. - * To be reimplemented by dialog field implementors. - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(nColumns)); - - return new Control[] { label }; - } - - /** - * Returns the number of columns of the dialog field. - * To be reimplemented by dialog field implementors. - */ - public int getNumberOfControls() { - return 1; - } - - protected static GridData gridDataForLabel(int span) { - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= span; - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created label widget. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Label getLabelControl(Composite parent) { - if (fLabel == null) { - assertCompositeNotNull(parent); - - fLabel= new Label(parent, SWT.LEFT | SWT.WRAP); - fLabel.setFont(parent.getFont()); - fLabel.setEnabled(fEnabled); - if (fLabelText != null && !"".equals(fLabelText)) { //$NON-NLS-1$ - fLabel.setText(fLabelText); - } else { - // XXX: to avoid a 16 pixel wide empty label - revisit - fLabel.setText("."); //$NON-NLS-1$ - fLabel.setVisible(false); - } - } - return fLabel; - } - - /** - * Creates a spacer control. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent) { - return createEmptySpace(parent, 1); - } - - /** - * Creates a spacer control with the given span. - * The composite is assumed to have MGridLayout as - * layout. - * @param parent The parent composite - */ - public static Control createEmptySpace(Composite parent, int span) { - Label label= new Label(parent, SWT.LEFT); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.BEGINNING; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.horizontalIndent= 0; - gd.widthHint= 0; - gd.heightHint= 0; - label.setLayoutData(gd); - return label; - } - - /** - * Tests is the control is not null and not disposed. - */ - protected final boolean isOkToUse(Control control) { - return (control != null) && !(control.isDisposed()); - } - - // --------- enable / disable management - - /** - * Sets the enable state of the dialog field. - */ - public final void setEnabled(boolean enabled) { - if (enabled != fEnabled) { - fEnabled= enabled; - updateEnableState(); - } - } - - /** - * Called when the enable state changed. - * To be extended by dialog field implementors. - */ - protected void updateEnableState() { - if (fLabel != null) { - fLabel.setEnabled(fEnabled); - } - } - - /** - * Gets the enable state of the dialog field. - */ - public final boolean isEnabled() { - return fEnabled; - } - - protected final void assertCompositeNotNull(Composite comp) { - Assert.isNotNull(comp, "uncreated control requested with composite null"); //$NON-NLS-1$ - } - - protected final void assertEnoughColumns(int nColumns) { - Assert.isTrue(nColumns >= getNumberOfControls(), "given number of columns is too small"); //$NON-NLS-1$ - } - - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IDialogFieldListener.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IDialogFieldListener.java deleted file mode 100644 index 117d179931c..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IDialogFieldListener.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -/** - * Change listener used by DialogField - */ -public interface IDialogFieldListener { - - /** - * The dialog field has changed. - */ - void dialogFieldChanged(DialogField field); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IListAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IListAdapter.java deleted file mode 100644 index 39fcc6719c8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IListAdapter.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -/** - * Change listener used by ListDialogField and CheckedListDialogField - */ -public interface IListAdapter { - - /** - * A button from the button bar has been pressed. - */ - void customButtonPressed(DialogField field, int index); - - /** - * The selection of the list has changed. - */ - void selectionChanged(DialogField field); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IStringButtonAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IStringButtonAdapter.java deleted file mode 100644 index b570fbd8fe8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/IStringButtonAdapter.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -/** - * Change listener used by StringButtonDialogField - */ -public interface IStringButtonAdapter { - - void changeControlPressed(DialogField field); - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/LayoutUtil.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/LayoutUtil.java deleted file mode 100644 index 9de9406d2f7..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/LayoutUtil.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -public class LayoutUtil { - - /** - * Calculates the number of columns needed by field editors - */ - public static int getNumberOfColumns(DialogField[] editors) { - int nCulumns= 0; - for (int i= 0; i < editors.length; i++) { - nCulumns= Math.max(editors[i].getNumberOfControls(), nCulumns); - } - return nCulumns; - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop) { - doDefaultLayout(parent, editors, labelOnTop, 0, 0, 0, 0); - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - * @param minWidth The minimal width of the composite - * @param minHeight The minimal height of the composite - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int minWidth, int minHeight) { - doDefaultLayout(parent, editors, labelOnTop, minWidth, minHeight, 0, 0); - } - - /** - * Creates a composite and fills in the given editors. - * @param labelOnTop Defines if the label of all fields should be on top of the fields - * @param minWidth The minimal width of the composite - * @param minHeight The minimal height of the composite - * @param marginWidth The margin width to be used by the composite - * @param marginHeight The margin height to be used by the composite - * @deprecated - */ - public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int minWidth, int minHeight, int marginWidth, int marginHeight) { - int nCulumns= getNumberOfColumns(editors); - Control[][] controls= new Control[editors.length][]; - for (int i= 0; i < editors.length; i++) { - controls[i]= editors[i].doFillIntoGrid(parent, nCulumns); - } - if (labelOnTop) { - nCulumns--; - modifyLabelSpans(controls, nCulumns); - } - GridLayout layout= new GridLayout(); - if (marginWidth != SWT.DEFAULT) { - layout.marginWidth= marginWidth; - } - if (marginHeight != SWT.DEFAULT) { - layout.marginHeight= marginHeight; - } - layout.numColumns= nCulumns; - parent.setLayout(layout); - } - - private static void modifyLabelSpans(Control[][] controls, int nCulumns) { - for (int i= 0; i < controls.length; i++) { - setHorizontalSpan(controls[i][0], nCulumns); - } - } - - /** - * Sets the span of a control. Assumes that GridData is used. - */ - public static void setHorizontalSpan(Control control, int span) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).horizontalSpan= span; - } else if (span != 1) { - GridData gd= new GridData(); - gd.horizontalSpan= span; - control.setLayoutData(gd); - } - } - - /** - * Sets the width hint of a control. Assumes that GridData is used. - */ - public static void setWidthHint(Control control, int widthHint) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).widthHint= widthHint; - } - } - - /** - * Sets the heigthHint hint of a control. Assumes that GridData is used. - */ - public static void setHeigthHint(Control control, int heigthHint) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).heightHint= heigthHint; - } - } - - /** - * Sets the horizontal indent of a control. Assumes that GridData is used. - */ - public static void setHorizontalIndent(Control control, int horizontalIndent) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).horizontalIndent= horizontalIndent; - } - } - - /** - * Sets the horizontal indent of a control. Assumes that GridData is used. - */ - public static void setHorizontalGrabbing(Control control) { - Object ld= control.getLayoutData(); - if (ld instanceof GridData) { - ((GridData)ld).grabExcessHorizontalSpace= true; - } - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java deleted file mode 100644 index c3fccc28ccf..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java +++ /dev/null @@ -1,767 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.jface.util.Assert; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Table; - -/** - * A list with a button bar. - * Typical buttons are 'Add', 'Remove', 'Up' and 'Down'. - * List model is independend of widget creation. - * DialogFields controls are: Label, List and Composite containing buttons. - */ -public class ListDialogField extends DialogField { - - protected TableViewer fTable; - protected ILabelProvider fLabelProvider; - protected ListViewerAdapter fListViewerAdapter; - protected List fElements; - protected ViewerSorter fViewerSorter; - - protected String[] fButtonLabels; - private Button[] fButtonControls; - - private boolean[] fButtonsEnabled; - - private int fRemoveButtonIndex; - private int fUpButtonIndex; - private int fDownButtonIndex; - - private Label fLastSeparator; - - protected Table fTableControl; - private Composite fButtonsControl; - private ISelection fSelectionWhenEnabled; - - private IListAdapter fListAdapter; - - private Object fParentElement; - - /** - * Creates the ListDialogField. - * @param adapter A listener for button invocation, selection changes. - * @param buttonLabels The labels of all buttons: null is a valid array entry and - * marks a separator. - * @param lprovider The label provider to render the table entries - */ - public ListDialogField(IListAdapter adapter, String[] buttonLabels, ILabelProvider lprovider) { - super(); - fListAdapter= adapter; - - fLabelProvider= lprovider; - fListViewerAdapter= new ListViewerAdapter(); - fParentElement= this; - - fElements= new ArrayList(10); - - fButtonLabels= buttonLabels; - if (fButtonLabels != null) { - int nButtons= fButtonLabels.length; - fButtonsEnabled= new boolean[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtonsEnabled[i]= true; - } - } - - fTable= null; - fTableControl= null; - fButtonsControl= null; - - fRemoveButtonIndex= -1; - fUpButtonIndex= -1; - fDownButtonIndex= -1; - } - - /** - * Sets the index of the 'remove' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'remove' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setRemoveButtonIndex(int removeButtonIndex) { - Assert.isTrue(removeButtonIndex < fButtonLabels.length); - fRemoveButtonIndex= removeButtonIndex; - } - - /** - * Sets the index of the 'up' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'up' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setUpButtonIndex(int upButtonIndex) { - Assert.isTrue(upButtonIndex < fButtonLabels.length); - fUpButtonIndex= upButtonIndex; - } - - /** - * Sets the index of the 'down' button in the button label array passed in the constructor. - * The behaviour of the button marked as the 'down' button will then be handled internally. - * (enable state, button invocation behaviour) - */ - public void setDownButtonIndex(int downButtonIndex) { - Assert.isTrue(downButtonIndex < fButtonLabels.length); - fDownButtonIndex= downButtonIndex; - } - - /** - * Sets the viewerSorter. - * @param viewerSorter The viewerSorter to set - */ - public void setViewerSorter(ViewerSorter viewerSorter) { - fViewerSorter= viewerSorter; - } - - // ------ adapter communication - - private void buttonPressed(int index) { - if (!managedButtonPressed(index)) { - fListAdapter.customButtonPressed(this, index); - } - } - - /** - * Checks if the button pressed is handled internally - * @return Returns true if button has been handled. - */ - protected boolean managedButtonPressed(int index) { - if (index == fRemoveButtonIndex) { - remove(); - } else if (index == fUpButtonIndex) { - up(); - } else if (index == fDownButtonIndex) { - down(); - } else { - return false; - } - return true; - } - - - // ------ layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - PixelConverter converter= new PixelConverter(parent); - - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - GridData gd= gridDataForLabel(1); - gd.verticalAlignment= GridData.BEGINNING; - label.setLayoutData(gd); - - Control list= getListControl(parent); - gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.verticalAlignment= GridData.FILL; - gd.grabExcessVerticalSpace= true; - gd.horizontalSpan= nColumns - 2; - gd.widthHint= converter.convertWidthInCharsToPixels(50); - gd.heightHint= converter.convertHeightInCharsToPixels(6); - - list.setLayoutData(gd); - - Composite buttons= getButtonBox(parent); - gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.verticalAlignment= GridData.FILL; - gd.grabExcessVerticalSpace= true; - gd.horizontalSpan= 1; - buttons.setLayoutData(gd); - - return new Control[] { label, list, buttons }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 3; - } - - /** - * Sets the minimal width of the buttons. Must be called after widget creation. - */ - public void setButtonsMinWidth(int minWidth) { - if (fLastSeparator != null) { - ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; - } - } - - - // ------ ui creation - - /** - * Returns the list control. When called the first time, the control will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Control getListControl(Composite parent) { - if (fTableControl == null) { - assertCompositeNotNull(parent); - - fTable= createTableViewer(parent); - fTable.setContentProvider(fListViewerAdapter); - fTable.setLabelProvider(fLabelProvider); - fTable.addSelectionChangedListener(fListViewerAdapter); - - fTableControl= (Table)fTable.getControl(); - - fTable.setInput(fParentElement); - - if (fViewerSorter != null) { - fTable.setSorter(fViewerSorter); - } - - fTableControl.setEnabled(isEnabled()); - if (fSelectionWhenEnabled != null) { - postSetSelection(fSelectionWhenEnabled); - } - } - return fTableControl; - } - - /** - * Returns the internally used table viewer. - */ - public TableViewer getTableViewer() { - return fTable; - } - - /* - * Subclasses may override to specify a different style. - */ - protected int getListStyle(){ - return SWT.BORDER + SWT.MULTI + SWT.H_SCROLL + SWT.V_SCROLL; - } - - protected TableViewer createTableViewer(Composite parent) { - Table table= new Table(parent, getListStyle()); - return new TableViewer(table); - } - - protected Button createButton(Composite parent, String label, SelectionListener listener) { - Button button= new Button(parent, SWT.PUSH); - button.setText(label); - button.addSelectionListener(listener); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= true; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - - button.setLayoutData(gd); - return button; - } - - private Label createSeparator(Composite parent) { - Label separator= new Label(parent, SWT.NONE); - separator.setVisible(false); - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint= 4; - separator.setLayoutData(gd); - return separator; - } - - /** - * Returns the composite containing the buttons. When called the first time, the control - * will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Composite getButtonBox(Composite parent) { - if (fButtonsControl == null) { - assertCompositeNotNull(parent); - - SelectionListener listener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doButtonSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doButtonSelected(e); - } - }; - - Composite contents= new Composite(parent, SWT.NULL); - GridLayout layout= new GridLayout(); - layout.marginWidth= 0; - layout.marginHeight= 0; - contents.setLayout(layout); - - if (fButtonLabels != null) { - fButtonControls= new Button[fButtonLabels.length]; - for (int i= 0; i < fButtonLabels.length; i++) { - String currLabel= fButtonLabels[i]; - if (currLabel != null) { - fButtonControls[i]= createButton(contents, currLabel, listener); - fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]); - } else { - fButtonControls[i]= null; - createSeparator(contents); - } - } - } - - fLastSeparator= createSeparator(contents); - - updateButtonState(); - fButtonsControl= contents; - } - - return fButtonsControl; - } - - protected void doButtonSelected(SelectionEvent e) { - if (fButtonControls != null) { - for (int i= 0; i < fButtonControls.length; i++) { - if (e.widget == fButtonControls[i]) { - buttonPressed(i); - return; - } - } - } - } - - // ------ enable / disable management - - /* - * @see DialogField#dialogFieldChanged - */ - public void dialogFieldChanged() { - super.dialogFieldChanged(); - updateButtonState(); - } - - /* - * Updates the enable state of the all buttons - */ - protected void updateButtonState() { - if (fButtonControls != null) { - ISelection sel= fTable.getSelection(); - for (int i= 0; i < fButtonControls.length; i++) { - Button button= fButtonControls[i]; - if (isOkToUse(button)) { - boolean extraState= getManagedButtonState(sel, i); - button.setEnabled(isEnabled() && extraState && fButtonsEnabled[i]); - } - } - } - } - - protected boolean getManagedButtonState(ISelection sel, int index) { - if (index == fRemoveButtonIndex) { - return !sel.isEmpty(); - } else if (index == fUpButtonIndex) { - return !sel.isEmpty() && canMoveUp(); - } else if (index == fDownButtonIndex) { - return !sel.isEmpty() && canMoveDown(); - } - return true; - } - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - - boolean enabled= isEnabled(); - if (isOkToUse(fTableControl)) { - if (!enabled) { - fSelectionWhenEnabled= fTable.getSelection(); - selectElements(null); - } else { - selectElements(fSelectionWhenEnabled); - fSelectionWhenEnabled= null; - } - fTableControl.setEnabled(enabled); - } - updateButtonState(); - } - - /** - * Sets a button enabled or disabled. - */ - public void enableButton(int index, boolean enable) { - if (fButtonsEnabled != null && index < fButtonsEnabled.length) { - fButtonsEnabled[index]= enable; - updateButtonState(); - } - } - - // ------ model access - - /** - * Sets the elements shown in the list. - */ - public void setElements(List elements) { - fElements= new ArrayList(elements); - if (fTable != null) { - fTable.refresh(); - } - dialogFieldChanged(); - } - - /** - * Gets the elements shown in the list. - * The list returned is a copy, so it can be modified by the user. - */ - public List getElements() { - return new ArrayList(fElements); - } - - /** - * Gets the elements shown at the given index. - */ - public Object getElement(int index) { - return fElements.get(index); - } - - /** - * Replace an element. - */ - public void replaceElement(Object oldElement, Object newElement) throws IllegalArgumentException { - int idx= fElements.indexOf(oldElement); - if (idx != -1) { - if (oldElement.equals(newElement) || fElements.contains(newElement)) { - return; - } - fElements.set(idx, newElement); - if (fTable != null) { - List selected= getSelectedElements(); - if (selected.remove(oldElement)) { - selected.add(newElement); - } - fTable.refresh(); - selectElements(new StructuredSelection(selected)); - } - dialogFieldChanged(); - } else { - throw new IllegalArgumentException(); - } - } - - /** - * Adds an element at the end of the list. - */ - public void addElement(Object element) { - if (fElements.contains(element)) { - return; - } - fElements.add(element); - if (fTable != null) { - fTable.add(element); - } - dialogFieldChanged(); - } - - /** - * Adds elements at the end of the list. - */ - public void addElements(List elements) { - int nElements= elements.size(); - - if (nElements > 0) { - // filter duplicated - ArrayList elementsToAdd= new ArrayList(nElements); - - for (int i= 0; i < nElements; i++) { - Object elem= elements.get(i); - if (!fElements.contains(elem)) { - elementsToAdd.add(elem); - } - } - fElements.addAll(elementsToAdd); - if (fTable != null) { - fTable.add(elementsToAdd.toArray()); - } - dialogFieldChanged(); - } - } - - /** - * Adds an element at a position. - */ - public void insertElementAt(Object element, int index) { - if (fElements.contains(element)) { - return; - } - fElements.add(index, element); - if (fTable != null) { - fTable.add(element); - } - - dialogFieldChanged(); - } - - - /** - * Adds an element at a position. - */ - public void removeAllElements() { - if (fElements.size() > 0) { - fElements.clear(); - if (fTable != null) { - fTable.refresh(); - } - dialogFieldChanged(); - } - } - - /** - * Removes an element from the list. - */ - public void removeElement(Object element) throws IllegalArgumentException { - if (fElements.remove(element)) { - if (fTable != null) { - fTable.remove(element); - } - dialogFieldChanged(); - } else { - throw new IllegalArgumentException(); - } - } - - /** - * Removes elements from the list. - */ - public void removeElements(List elements) { - if (elements.size() > 0) { - fElements.removeAll(elements); - if (fTable != null) { - fTable.remove(elements.toArray()); - } - dialogFieldChanged(); - } - } - - /** - * Gets the number of elements - */ - public int getSize() { - return fElements.size(); - } - - - public void selectElements(ISelection selection) { - fSelectionWhenEnabled= selection; - if (fTable != null) { - fTable.setSelection(selection, true); - } - } - - public void selectFirstElement() { - Object element= null; - if (fViewerSorter != null) { - Object[] arr= fElements.toArray(); - fViewerSorter.sort(fTable, arr); - if (arr.length > 0) { - element= arr[0]; - } - } else { - if (fElements.size() > 0) { - element= fElements.get(0); - } - } - if (element != null) { - selectElements(new StructuredSelection(element)); - } - } - - - public void postSetSelection(final ISelection selection) { - if (isOkToUse(fTableControl)) { - Display d= fTableControl.getDisplay(); - d.asyncExec(new Runnable() { - public void run() { - if (isOkToUse(fTableControl)) { - selectElements(selection); - } - } - }); - } - } - - /** - * Refreshes the table. - */ - public void refresh() { - fTable.refresh(); - } - - // ------- list maintenance - - private List moveUp(List elements, List move) { - int nElements= elements.size(); - List res= new ArrayList(nElements); - Object floating= null; - for (int i= 0; i < nElements; i++) { - Object curr= elements.get(i); - if (move.contains(curr)) { - res.add(curr); - } else { - if (floating != null) { - res.add(floating); - } - floating= curr; - } - } - if (floating != null) { - res.add(floating); - } - return res; - } - - private void moveUp(List toMoveUp) { - if (toMoveUp.size() > 0) { - setElements(moveUp(fElements, toMoveUp)); - fTable.reveal(toMoveUp.get(0)); - } - } - - private void moveDown(List toMoveDown) { - if (toMoveDown.size() > 0) { - setElements(reverse(moveUp(reverse(fElements), toMoveDown))); - fTable.reveal(toMoveDown.get(toMoveDown.size() - 1)); - } - } - - private List reverse(List p) { - List reverse= new ArrayList(p.size()); - for (int i= p.size()-1; i >= 0; i--) { - reverse.add(p.get(i)); - } - return reverse; - } - - - private void remove() { - removeElements(getSelectedElements()); - } - - private void up() { - moveUp(getSelectedElements()); - } - - private void down() { - moveDown(getSelectedElements()); - } - - private boolean canMoveUp() { - if (isOkToUse(fTableControl)) { - int[] indc= fTableControl.getSelectionIndices(); - for (int i= 0; i < indc.length; i++) { - if (indc[i] != i) { - return true; - } - } - } - return false; - } - - private boolean canMoveDown() { - if (isOkToUse(fTableControl)) { - int[] indc= fTableControl.getSelectionIndices(); - int k= fElements.size() - 1; - for (int i= indc.length - 1; i >= 0 ; i--, k--) { - if (indc[i] != k) { - return true; - } - } - } - return false; - } - - /** - * Returns the selected elements. - */ - public List getSelectedElements() { - List result= new ArrayList(); - if (fTable != null) { - ISelection selection= fTable.getSelection(); - if (selection instanceof IStructuredSelection) { - Iterator iter= ((IStructuredSelection)selection).iterator(); - while (iter.hasNext()) { - result.add(iter.next()); - } - } - } - return result; - } - - // ------- ListViewerAdapter - - private class ListViewerAdapter implements IStructuredContentProvider, ISelectionChangedListener { - - // ------- ITableContentProvider Interface ------------ - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // will never happen - } - - public boolean isDeleted(Object element) { - return false; - } - - public void dispose() { - } - - public Object[] getElements(Object obj) { - return fElements.toArray(); - } - - // ------- ISelectionChangedListener Interface ------------ - - public void selectionChanged(SelectionChangedEvent event) { - doListSelected(event); - } - - } - - - protected void doListSelected(SelectionChangedEvent event) { - updateButtonState(); - if (fListAdapter != null) { - fListAdapter.selectionChanged(this); - } - } - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogField.java deleted file mode 100644 index ad77bd52922..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogField.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * Dialog Field containing a single button: e.g. radio or checkbox button. - */ -public class SelectionButtonDialogField extends DialogField { - - private Button fButton; - private boolean fIsSelected; - private DialogField[] fAttachedDialogFields; - private int fButtonStyle; - - /** - * Creates a selection button. - * Allowed button styles: SWT.RADIO, SWT.CHECK, SWT.TOGGLE, SWT.PUSH - */ - public SelectionButtonDialogField(int buttonStyle) { - super(); - fIsSelected= false; - fAttachedDialogFields= null; - fButtonStyle= buttonStyle; - } - - /** - * Attaches a field to the selection state of the selection button. - * The attached field will be disabled if the selection button is not selected. - */ - public void attachDialogField(DialogField dialogField) { - attachDialogFields(new DialogField[] { dialogField }); - } - - /** - * Attaches fields to the selection state of the selection button. - * The attached fields will be disabled if the selection button is not selected. - */ - public void attachDialogFields(DialogField[] dialogFields) { - fAttachedDialogFields= dialogFields; - for (int i= 0; i < dialogFields.length; i++) { - dialogFields[i].setEnabled(fIsSelected); - } - } - - /** - * Returns true is teh gived field is attached to the selection button. - */ - public boolean isAttached(DialogField editor) { - if (fAttachedDialogFields != null) { - for (int i=0; i < fAttachedDialogFields.length; i++) { - if (fAttachedDialogFields[i] == editor) { - return true; - } - } - } - return false; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Button button= getSelectionButton(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns; - gd.horizontalAlignment= GridData.FILL; - if (fButtonStyle == SWT.PUSH) { - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - } - - button.setLayoutData(gd); - - return new Control[] { button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 1; - } - - // ------- ui creation - - /** - * Returns the selection button widget. When called the first time, the widget will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Button getSelectionButton(Composite group) { - if (fButton == null) { - assertCompositeNotNull(group); - - fButton= new Button(group, fButtonStyle); - fButton.setFont(group.getFont()); - fButton.setText(fLabelText); - fButton.setEnabled(isEnabled()); - fButton.setSelection(fIsSelected); - fButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doWidgetSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doWidgetSelected(e); - } - }); - } - return fButton; - } - - protected void doWidgetSelected(SelectionEvent e) { - if (isOkToUse(fButton)) { - changeValue(fButton.getSelection()); - } - } - - private void changeValue(boolean newState) { - if (fIsSelected != newState) { - fIsSelected= newState; - if (fAttachedDialogFields != null) { - boolean focusSet= false; - for (int i= 0; i < fAttachedDialogFields.length; i++) { - fAttachedDialogFields[i].setEnabled(fIsSelected); - if (fIsSelected && !focusSet) { - focusSet= fAttachedDialogFields[i].setFocus(); - } - } - } - dialogFieldChanged(); - } else if (fButtonStyle == SWT.PUSH) { - dialogFieldChanged(); - } - } - - // ------ model access - - /** - * Returns the selection state of the button. - */ - public boolean isSelected() { - return fIsSelected; - } - - /** - * Sets the selection state of the button. - */ - public void setSelection(boolean selected) { - changeValue(selected); - if (isOkToUse(fButton)) { - fButton.setSelection(selected); - } - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fButton)) { - fButton.setEnabled(isEnabled()); - } - } - - - - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java deleted file mode 100644 index 7d53cfffed2..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/SelectionButtonDialogFieldGroup.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field describing a group with buttons (Checkboxes, radio buttons..) - */ -public class SelectionButtonDialogFieldGroup extends DialogField { - - private Composite fButtonComposite; - - private Button[] fButtons; - private String[] fButtonNames; - private boolean[] fButtonsSelected; - private boolean[] fButtonsEnabled; - - private int fGroupBorderStyle; - private int fGroupNumberOfColumns; - private int fButtonsStyle; - - /** - * Creates a group without border. - */ - public SelectionButtonDialogFieldGroup(int buttonsStyle, String[] buttonNames, int nColumns) { - this(buttonsStyle, buttonNames, nColumns, SWT.NONE); - } - - - /** - * Creates a group with border (label in border). - * Accepted button styles are: SWT.RADIO, SWT.CHECK, SWT.TOGGLE - * For border styles see Group - */ - public SelectionButtonDialogFieldGroup(int buttonsStyle, String[] buttonNames, int nColumns, int borderStyle) { - super(); - - Assert.isTrue(buttonsStyle == SWT.RADIO || buttonsStyle == SWT.CHECK || buttonsStyle == SWT.TOGGLE); - fButtonNames= buttonNames; - - int nButtons= buttonNames.length; - fButtonsSelected= new boolean[nButtons]; - fButtonsEnabled= new boolean[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtonsSelected[i]= false; - fButtonsEnabled[i]= true; - } - if (fButtonsStyle == SWT.RADIO) { - fButtonsSelected[0]= true; - } - - fGroupBorderStyle= borderStyle; - fGroupNumberOfColumns= (nColumns <= 0) ? nButtons : nColumns; - - fButtonsStyle= buttonsStyle; - - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - if (fGroupBorderStyle == SWT.NONE) { - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - - Composite buttonsgroup= getSelectionButtonsGroup(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns - 1; - buttonsgroup.setLayoutData(gd); - - return new Control[] { label, buttonsgroup }; - } else { - Composite buttonsgroup= getSelectionButtonsGroup(parent); - GridData gd= new GridData(); - gd.horizontalSpan= nColumns; - buttonsgroup.setLayoutData(gd); - - return new Control[] { buttonsgroup }; - } - } - - /* - * @see DialogField#doFillIntoGrid - */ - public int getNumberOfControls() { - return (fGroupBorderStyle == SWT.NONE) ? 2 : 1; - } - - // ------- ui creation - - private Button createSelectionButton(int index, Composite group, SelectionListener listener) { - Button button= new Button(group, fButtonsStyle | SWT.LEFT); - button.setFont(group.getFont()); - button.setText(fButtonNames[index]); - button.setEnabled(isEnabled() && fButtonsEnabled[index]); - button.setSelection(fButtonsSelected[index]); - button.addSelectionListener(listener); - button.setLayoutData(new GridData()); - return button; - } - - /** - * Returns the group widget. When called the first time, the widget will be created. - * @param The parent composite when called the first time, or null - * after. - */ - public Composite getSelectionButtonsGroup(Composite parent) { - if (fButtonComposite == null) { - assertCompositeNotNull(parent); - - GridLayout layout= new GridLayout(); - layout.makeColumnsEqualWidth= true; - layout.numColumns= fGroupNumberOfColumns; - - if (fGroupBorderStyle != SWT.NONE) { - Group group= new Group(parent, fGroupBorderStyle); - if (fLabelText != null && fLabelText.length() > 0) { - group.setText(fLabelText); - } - fButtonComposite= group; - } else { - fButtonComposite= new Composite(parent, SWT.NULL); - layout.marginHeight= 0; - layout.marginWidth= 0; - } - - fButtonComposite.setLayout(layout); - - SelectionListener listener= new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - doWidgetSelected(e); - } - public void widgetSelected(SelectionEvent e) { - doWidgetSelected(e); - } - }; - int nButtons= fButtonNames.length; - fButtons= new Button[nButtons]; - for (int i= 0; i < nButtons; i++) { - fButtons[i]= createSelectionButton(i, fButtonComposite, listener); - } - int nRows= nButtons / fGroupNumberOfColumns; - int nFillElements= nRows * fGroupNumberOfColumns - nButtons; - for (int i= 0; i < nFillElements; i++) { - createEmptySpace(fButtonComposite); - } - } - return fButtonComposite; - } - - /** - * Returns a button from the group or null if not yet created. - */ - public Button getSelectionButton(int index) { - if (index >= 0 && index < fButtons.length) { - return fButtons[index]; - } - return null; - } - - protected void doWidgetSelected(SelectionEvent e) { - Button button= (Button)e.widget; - for (int i= 0; i < fButtons.length; i++) { - if (fButtons[i] == button) { - fButtonsSelected[i]= button.getSelection(); - dialogFieldChanged(); - return; - } - } - } - - // ------ model access - - /** - * Returns the selection state of a button contained in the group. - * @param The index of the button - */ - public boolean isSelected(int index) { - if (index >= 0 && index < fButtonsSelected.length) { - return fButtonsSelected[index]; - } - return false; - } - - /** - * Sets the selection state of a button contained in the group. - */ - public void setSelection(int index, boolean selected) { - if (index >= 0 && index < fButtonsSelected.length) { - if (fButtonsSelected[index] != selected) { - fButtonsSelected[index]= selected; - if (fButtons != null) { - Button button= fButtons[index]; - if (isOkToUse(button)) { - button.setSelection(selected); - } - } - } - } - } - - // ------ enable / disable management - - protected void updateEnableState() { - super.updateEnableState(); - if (fButtons != null) { - boolean enabled= isEnabled(); - for (int i= 0; i < fButtons.length; i++) { - Button button= fButtons[i]; - if (isOkToUse(button)) { - button.setEnabled(enabled && fButtonsEnabled[i]); - } - } - } - } - - /** - * Sets the enable state of a button contained in the group. - */ - public void enableSelectionButton(int index, boolean enable) { - if (index >= 0 && index < fButtonsEnabled.length) { - fButtonsEnabled[index]= enable; - if (fButtons != null) { - Button button= fButtons[index]; - if (isOkToUse(button)) { - button.setEnabled(isEnabled() && enable); - } - } - } - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/Separator.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/Separator.java deleted file mode 100644 index 17992d66313..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/Separator.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * Dialog field describing a separator. - */ -public class Separator extends DialogField { - - private Label fSeparator; - private int fStyle; - - public Separator() { - this(SWT.NONE); - } - - /** - * @param style of the separator. See Label for possible - * styles. - */ - public Separator(int style) { - super(); - fStyle= style; - } - - // ------- layout helpers - - /** - * Creates the separator and fills it in a MGridLayout. - * @param height The heigth of the separator - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns, int height) { - assertEnoughColumns(nColumns); - - Control separator= getSeparator(parent); - separator.setLayoutData(gridDataForSeperator(nColumns, height)); - - return new Control[] { separator }; - } - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - return doFillIntoGrid(parent, nColumns, 4); - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 1; - } - - protected static GridData gridDataForSeperator(int span, int height) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.verticalAlignment= GridData.BEGINNING; - gd.heightHint= height; - gd.horizontalSpan= span; - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created separator. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Control getSeparator(Composite parent) { - if (fSeparator == null) { - assertCompositeNotNull(parent); - fSeparator= new Label(parent, fStyle); - } - return fSeparator; - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonDialogField.java deleted file mode 100644 index f73e64a3db9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonDialogField.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Dialog field containing a label, text control and a button control. - */ -public class StringButtonDialogField extends StringDialogField { - - private Button fBrowseButton; - private String fBrowseButtonLabel; - private IStringButtonAdapter fStringButtonAdapter; - - private boolean fButtonEnabled; - - public StringButtonDialogField(IStringButtonAdapter adapter) { - super(); - fStringButtonAdapter= adapter; - fBrowseButtonLabel= "!Browse...!"; //$NON-NLS-1$ - fButtonEnabled= true; - } - - /** - * Sets the label of the button. - */ - public void setButtonLabel(String label) { - fBrowseButtonLabel= label; - } - - // ------ adapter communication - - /** - * Programmatical pressing of the button - */ - public void changeControlPressed() { - fStringButtonAdapter.changeControlPressed(this); - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 2)); - Button button= getChangeControl(parent); - button.setLayoutData(gridDataForButton(button, 1)); - - return new Control[] { label, text, button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 3; - } - - protected static GridData gridDataForButton(Button button, int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - gd.heightHint = SWTUtil.getButtonHeigthHint(button); - gd.widthHint = SWTUtil.getButtonWidthHint(button); - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created buttom widget. - * @param parent The parent composite or null if the widget has - * already been created. - */ - public Button getChangeControl(Composite parent) { - if (fBrowseButton == null) { - assertCompositeNotNull(parent); - - fBrowseButton= new Button(parent, SWT.PUSH); - fBrowseButton.setText(fBrowseButtonLabel); - fBrowseButton.setEnabled(isEnabled() && fButtonEnabled); - fBrowseButton.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - changeControlPressed(); - } - public void widgetSelected(SelectionEvent e) { - changeControlPressed(); - } - }); - - } - return fBrowseButton; - } - - // ------ enable / disable management - - /** - * Sets the enable state of the button. - */ - public void enableButton(boolean enable) { - if (isOkToUse(fBrowseButton)) { - fBrowseButton.setEnabled(isEnabled() && enable); - } - fButtonEnabled= enable; - } - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fBrowseButton)) { - fBrowseButton.setEnabled(isEnabled() && fButtonEnabled); - } - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonStatusDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonStatusDialogField.java deleted file mode 100644 index fc7d3d1ad4f..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringButtonStatusDialogField.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Dialog field containing a label, text control, status label and a button control. - * The status label can be either a image or text label, and can be usd to give - * additional information about the current element chosen. - */ -public class StringButtonStatusDialogField extends StringButtonDialogField { - - private Label fStatusLabelControl; - private Object fStatus; // String or ImageDescriptor - - private String fWidthHintString; - private int fWidthHint; - - public StringButtonStatusDialogField(IStringButtonAdapter adapter) { - super(adapter); - fStatus= null; - fWidthHintString= null; - fWidthHint= -1; - } - - // ------ set status - - /** - * Sets the status string. - */ - public void setStatus(String status) { - if (isOkToUse(fStatusLabelControl)) { - fStatusLabelControl.setText(status); - } - fStatus= status; - } - - /** - * Sets the status image. - * Caller is responsible to dispose image - */ - public void setStatus(Image image) { - if (isOkToUse(fStatusLabelControl)) { - if (image == null) { - fStatusLabelControl.setImage(null); - } else { - fStatusLabelControl.setImage(image); - } - } - fStatus= image; - } - - /** - * Sets the staus string hint of the status label. - * The string is used to calculate the size of the status label. - */ - public void setStatusWidthHint(String widthHintString) { - fWidthHintString= widthHintString; - fWidthHint= -1; - } - - /** - * Sets the width hint of the status label. - */ - public void setStatusWidthHint(int widthHint) { - fWidthHint= widthHint; - fWidthHintString= null; - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 3)); - Label status= getStatusLabelControl(parent); - status.setLayoutData(gridDataForStatusLabel(parent, 1)); - Button button= getChangeControl(parent); - button.setLayoutData(gridDataForButton(button, 1)); - - return new Control[] { label, text, status, button }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 4; - } - - protected GridData gridDataForStatusLabel(Control aControl, int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.BEGINNING; - gd.grabExcessHorizontalSpace= false; - gd.horizontalIndent= 0; - if (fWidthHintString != null) { - GC gc= new GC(aControl); - gd.widthHint= gc.textExtent(fWidthHintString).x; - gc.dispose(); - } else if (fWidthHint != -1) { - gd.widthHint= fWidthHint; - } else { - gd.widthHint= SWT.DEFAULT; - } - return gd; - } - - // ------- ui creation - - /** - * Creates or returns the created status label widget. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Label getStatusLabelControl(Composite parent) { - if (fStatusLabelControl == null) { - assertCompositeNotNull(parent); - fStatusLabelControl= new Label(parent, SWT.LEFT); - fStatusLabelControl.setFont(parent.getFont()); - fStatusLabelControl.setEnabled(isEnabled()); - if (fStatus instanceof Image) { - fStatusLabelControl.setImage((Image)fStatus); - } else if (fStatus instanceof String) { - fStatusLabelControl.setText((String)fStatus); - } else { - // must be null - } - } - return fStatusLabelControl; - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fStatusLabelControl)) { - fStatusLabelControl.setEnabled(isEnabled()); - } - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringDialogField.java deleted file mode 100644 index 220edc187d0..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/StringDialogField.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.ui.dialogfields; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * Dialog field containing a label and a text control. - */ -public class StringDialogField extends DialogField { - - private String fText; - private Text fTextControl; - private ModifyListener fModifyListener; - - public StringDialogField() { - super(); - fText= ""; //$NON-NLS-1$ - } - - // ------- layout helpers - - /* - * @see DialogField#doFillIntoGrid - */ - public Control[] doFillIntoGrid(Composite parent, int nColumns) { - assertEnoughColumns(nColumns); - - Label label= getLabelControl(parent); - label.setLayoutData(gridDataForLabel(1)); - Text text= getTextControl(parent); - text.setLayoutData(gridDataForText(nColumns - 1)); - - return new Control[] { label, text }; - } - - /* - * @see DialogField#getNumberOfControls - */ - public int getNumberOfControls() { - return 2; - } - - protected static GridData gridDataForText(int span) { - GridData gd= new GridData(); - gd.horizontalAlignment= GridData.FILL; - gd.grabExcessHorizontalSpace= false; - gd.horizontalSpan= span; - return gd; - } - - // ------- focus methods - - /* - * @see DialogField#setFocus - */ - public boolean setFocus() { - if (isOkToUse(fTextControl)) { - fTextControl.setFocus(); - fTextControl.setSelection(0, fTextControl.getText().length()); - } - return true; - } - - // ------- ui creation - - /** - * Creates or returns the created text control. - * @param parent The parent composite or null when the widget has - * already been created. - */ - public Text getTextControl(Composite parent) { - if (fTextControl == null) { - assertCompositeNotNull(parent); - fModifyListener= new ModifyListener() { - public void modifyText(ModifyEvent e) { - doModifyText(e); - } - }; - - fTextControl= new Text(parent, SWT.SINGLE | SWT.BORDER); - // moved up due to 1GEUNW2 - fTextControl.setText(fText); - fTextControl.setFont(parent.getFont()); - fTextControl.addModifyListener(fModifyListener); - - fTextControl.setEnabled(isEnabled()); - } - return fTextControl; - } - - protected void doModifyText(ModifyEvent e) { - if (isOkToUse(fTextControl)) { - fText= fTextControl.getText(); - } - dialogFieldChanged(); - } - - // ------ enable / disable management - - /* - * @see DialogField#updateEnableState - */ - protected void updateEnableState() { - super.updateEnableState(); - if (isOkToUse(fTextControl)) { - fTextControl.setEnabled(isEnabled()); - } - } - - // ------ text access - - /** - * Gets the text. Can not be null - */ - public String getText() { - return fText; - } - - /** - * Sets the text. Triggers a dialog-changed event. - */ - public void setText(String text) { - fText= text; - if (isOkToUse(fTextControl)) { - fTextControl.setText(text); - } else { - dialogFieldChanged(); - } - } - - /** - * Sets the text without triggering a dialog-changed event. - */ - public void setTextWithoutUpdate(String text) { - fText= text; - if (isOkToUse(fTextControl)) { - fTextControl.removeModifyListener(fModifyListener); - fTextControl.setText(text); - fTextControl.addModifyListener(fModifyListener); - } - } - -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/CDebugEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/CDebugEditor.java deleted file mode 100644 index e2fc7e812c2..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/CDebugEditor.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.internal.ui.wizards.AddDirectorySourceLocationWizard; -import org.eclipse.cdt.debug.internal.ui.wizards.AddSourceLocationWizard; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.util.ExternalEditorInput; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.debug.ui.IDebugView; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.ControlListener; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.ScrollBar; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.part.FileEditorInput; - -/** - * Enter type comment. - * - * @since: Feb 26, 2003 - */ -public class CDebugEditor extends CEditor -{ - public class AttachSourceForm implements IPropertyChangeListener - { - /** The horizontal scroll increment. */ - private static final int HORIZONTAL_SCROLL_INCREMENT = 10; - /** The vertical scroll increment. */ - private static final int VERTICAL_SCROLL_INCREMENT = 10; - /** The form's root widget */ - private Font fFont; - /** The form's root widget */ - private ScrolledComposite fScrolledComposite; - /** The background color */ - private Color fBackgroundColor; - /** The foreground color */ - private Color fForegroundColor; - /** The separator's color */ - private Color fSeparatorColor; - /** The form headers */ - private List fHeaderLabels = new ArrayList(); - /** The form banners */ - private List fBannerLabels = new ArrayList(); - /** The form text */ - private Label fInputLabel; - /** The attach source button */ - private Button fAttachButton = null; - /** The preference change listener */ -// private IPropertyChangeListener fPropertyChangeListener; - - private IEditorInput fInput = null; - - public AttachSourceForm( Composite parent, IEditorInput input ) - { - Display display = parent.getDisplay(); - fBackgroundColor = display.getSystemColor( SWT.COLOR_LIST_BACKGROUND ); - fForegroundColor = display.getSystemColor( SWT.COLOR_LIST_FOREGROUND ); - fSeparatorColor = new Color( display, 152, 170, 203 ); - - JFaceResources.getFontRegistry().addListener( AttachSourceForm.this ); - - fScrolledComposite = new ScrolledComposite( parent, SWT.H_SCROLL | SWT.V_SCROLL ); - fScrolledComposite.setAlwaysShowScrollBars( false ); - fScrolledComposite.setExpandHorizontal( true ); - fScrolledComposite.setExpandVertical( true ); - fScrolledComposite.addDisposeListener( - new DisposeListener() - { - public void widgetDisposed( DisposeEvent e ) - { - JFaceResources.getFontRegistry().removeListener( AttachSourceForm.this ); - setScrolledComposite( null ); - getSeparatorColor().dispose(); - setSeparatorColor( null ); - getBannerLabels().clear(); - getHeaderLabels().clear(); - if ( getFont() != null ) - { - getFont().dispose(); - setFont( null ); - } - } - } ); - - fScrolledComposite.addControlListener( - new ControlListener() - { - public void controlMoved( ControlEvent e ) - { - } - - public void controlResized(ControlEvent e) - { - Rectangle clientArea = getScrolledComposite().getClientArea(); - - ScrollBar verticalBar = getScrolledComposite().getVerticalBar(); - verticalBar.setIncrement( VERTICAL_SCROLL_INCREMENT ); - verticalBar.setPageIncrement( clientArea.height - verticalBar.getIncrement() ); - - ScrollBar horizontalBar = getScrolledComposite().getHorizontalBar(); - horizontalBar.setIncrement( HORIZONTAL_SCROLL_INCREMENT ); - horizontalBar.setPageIncrement( clientArea.width - horizontalBar.getIncrement() ); - } - } ); - - Composite composite = createComposite( fScrolledComposite ); - composite.setLayout( new GridLayout() ); - - createTitleLabel( composite, "C/C++ File Editor" ); - createLabel( composite, null ); - createLabel( composite, null ); - - createHeadingLabel( composite, "Source not found" ); - - Composite separator = createCompositeSeparator( composite ); - GridData data = new GridData( GridData.FILL_HORIZONTAL ); - data.heightHint = 2; - separator.setLayoutData( data ); - - fInputLabel = createLabel( composite, "" ); - createLabel( composite, "You can attach a new source location by pressing the button below:" ); - createLabel( composite, null ); - - fAttachButton = createButton( composite, "&Attach Source..." ); - fAttachButton.addSelectionListener( - new SelectionListener() - { - public void widgetSelected( SelectionEvent event ) - { - attachSourceLocation(); - } - - public void widgetDefaultSelected( SelectionEvent e ) - { - } - } ); - - separator = createCompositeSeparator( composite ); - data = new GridData( GridData.FILL_HORIZONTAL ); - data.heightHint = 2; - separator.setLayoutData( data ); - - fScrolledComposite.setContent( composite ); - fScrolledComposite.setMinSize( composite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); - - if ( getEditorInput() != null ) - { - setInputLabelText( getEditorInput() ); - } - - fInput = input; - } - - private Composite createComposite( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setBackground( fBackgroundColor ); - return composite; - } - - private Label createLabel( Composite parent, String text ) - { - Label label = new Label( parent, SWT.NONE ); - if ( text != null ) - label.setText( text ); - label.setBackground( fBackgroundColor ); - label.setForeground( fForegroundColor ); - return label; - } - - private Label createTitleLabel( Composite parent, String text ) - { - Label label = new Label( parent, SWT.NONE ); - if ( text != null ) - label.setText( text ); - label.setBackground( fBackgroundColor ); - label.setForeground( fForegroundColor ); - label.setFont( JFaceResources.getHeaderFont() ); - fHeaderLabels.add( label ); - return label; - } - - private Label createHeadingLabel( Composite parent, String text ) - { - Label label = new Label( parent, SWT.NONE ); - if ( text != null ) - label.setText( text ); - label.setBackground( fBackgroundColor ); - label.setForeground( fForegroundColor ); - label.setFont( JFaceResources.getBannerFont() ); - fBannerLabels.add( label ); - return label; - } - - private Composite createCompositeSeparator( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setBackground( fSeparatorColor ); - return composite; - } - - private Button createButton( Composite parent, String text ) - { - Button button = new Button( parent, SWT.FLAT ); - button.setBackground( fBackgroundColor ); - button.setForeground( fForegroundColor ); - if ( text != null ) - button.setText( text ); - return button; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - for ( Iterator iterator = fBannerLabels.iterator(); iterator.hasNext(); ) - { - Label label = (Label)iterator.next(); - label.setFont( JFaceResources.getBannerFont() ); - } - - for ( Iterator iterator = fHeaderLabels.iterator(); iterator.hasNext(); ) - { - Label label = (Label)iterator.next(); - label.setFont( JFaceResources.getHeaderFont() ); - } - - Control control = fScrolledComposite.getContent(); - fScrolledComposite.setMinSize( control.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); - fScrolledComposite.setContent( control ); - - fScrolledComposite.layout( true ); - fScrolledComposite.redraw(); - } - - private void setInputLabelText( IEditorInput input ) - { - FileNotFoundElement element = (FileNotFoundElement)input.getAdapter( FileNotFoundElement.class ); - if ( element != null ) - fInputLabel.setText( MessageFormat.format( "Can not find the file ''{0}'' in the specified source locations.", new String[] { element.getFullPath().toOSString() } ) ); - } - - protected ScrolledComposite getScrolledComposite() - { - return fScrolledComposite; - } - - protected void setScrolledComposite( ScrolledComposite scrolledComposite ) - { - fScrolledComposite = scrolledComposite; - } - - protected Color getSeparatorColor() - { - return fSeparatorColor; - } - - protected void setSeparatorColor( Color separatorColor ) - { - fSeparatorColor = separatorColor; - } - - protected List getBannerLabels() - { - return fBannerLabels; - } - - protected void setBannerLabels( List bannerLabels ) - { - fBannerLabels = bannerLabels; - } - - protected List getHeaderLabels() - { - return fHeaderLabels; - } - - protected void setHeaderLabels( List headerLabels ) - { - fHeaderLabels = headerLabels; - } - - protected Font getFont() - { - return fFont; - } - - protected void setFont( Font font ) - { - fFont = font; - } - - public Control getControl() - { - return fScrolledComposite; - } - - public IEditorInput getInput() - { - return fInput; - } - } - - public static final String EDITOR_ID = CDebugUIPlugin.getUniqueIdentifier() + ".editor.CDebugEditor"; - - private AttachSourceForm fAttachSourceForm = null; - - /** - * Constructor for CDebugEditor. - */ - public CDebugEditor() - { - super(); - setDocumentProvider( CUIPlugin.getDefault().getDocumentProvider() ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) - */ - public void createPartControl( Composite parent ) - { - super.createPartControl( parent ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput) - */ - protected void doSetInput( IEditorInput input ) throws CoreException - { - IEditorInput newInput = input; - if ( input instanceof EditorInputDelegate && ((EditorInputDelegate)input).getDelegate() != null ) - { - newInput = ((EditorInputDelegate)input).getDelegate(); - } - IEditorInput oldInput = getEditorInput(); - if ( oldInput instanceof EditorInputDelegate ) - { - oldInput = ((EditorInputDelegate)oldInput).getDelegate(); - } - if (oldInput != null) - { - CUIPlugin.getDefault().getWorkingCopyManager().disconnect(oldInput); - } - super.doSetInput( newInput ); - // This hack should be after the super.doSetInput(); - CUIPlugin.getDefault().getWorkingCopyManager().connect(newInput); - } - - protected void attachSourceLocation() - { - if ( getEditorInput() != null && getEditorInput().getAdapter( FileNotFoundElement.class ) != null ) - { - FileNotFoundElement element = (FileNotFoundElement)getEditorInput().getAdapter( FileNotFoundElement.class ); - if ( element.getLaunch() != null && element.getLaunch().getSourceLocator() instanceof IAdaptable ) - { - ILaunch launch = element.getLaunch(); - ICSourceLocator locator = (ICSourceLocator)((IAdaptable)element.getLaunch().getSourceLocator()).getAdapter( ICSourceLocator.class ); - if ( locator != null ) - { - IPath path = element.getFullPath(); - INewSourceLocationWizard wizard = null; - if ( path.isAbsolute() ) - { - path = path.removeLastSegments( 1 ); - wizard = new AddDirectorySourceLocationWizard( path ); - } - else - { - wizard = new AddSourceLocationWizard( locator.getSourceLocations() ); - } - WizardDialog dialog = new WizardDialog( CDebugUIPlugin.getActiveWorkbenchShell(), wizard ); - if ( dialog.open() == Window.OK ) - { - ICSourceLocation[] locations = locator.getSourceLocations(); - ArrayList list = new ArrayList( Arrays.asList( locations ) ); - list.add( wizard.getSourceLocation() ); - locator.setSourceLocations( (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ) ); - - if ( locator instanceof IPersistableSourceLocator ) - { - ILaunchConfiguration configuration = launch.getLaunchConfiguration(); - saveChanges( configuration, (IPersistableSourceLocator)launch.getSourceLocator() ); - } - Object newElement = locator.getSourceElement( element.getStackFrame() ); - IEditorInput newInput = null; - if ( newElement instanceof IFile ) - { - newInput = new FileEditorInput( (IFile)newElement ); - } - else if ( newElement instanceof FileStorage ) - { - newInput = new ExternalEditorInput( (IStorage)newElement ); - } - IEditorInput oldInput = ((EditorInputDelegate)getEditorInput()).getDelegate(); - CUIPlugin.getDefault().getWorkingCopyManager().disconnect(oldInput); - ((EditorInputDelegate)getEditorInput()).setDelegate( newInput ); - resetInput( element.getStackFrame() ); - } - } - } - } - } - - private void resetInput( IStackFrame frame ) - { - setInput( getEditorInput() ); - IViewPart view = CDebugUIPlugin.getActivePage().findView( IDebugUIConstants.ID_DEBUG_VIEW ); - if ( view instanceof IDebugView ) - { - ((IDebugView)view).getViewer().setSelection( new StructuredSelection( frame ) ); - } - } - - protected void saveChanges( ILaunchConfiguration configuration, IPersistableSourceLocator locator ) - { - try - { - ILaunchConfigurationWorkingCopy copy = configuration.copy( configuration.getName() ); - copy.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() ); - copy.doSave(); - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null ); - } - } - - /** - * @see org.eclipse.ui.texteditor.StatusTextEditor#createStatusControl(Composite, IStatus) - */ - protected Control createStatusControl( Composite parent, IStatus status ) - { - fAttachSourceForm = new AttachSourceForm( parent, getEditorInput() ); - return fAttachSourceForm.getControl(); - } - - /** - * @see org.eclipse.ui.texteditor.StatusTextEditor#updatePartControl(IEditorInput) - */ - public void updatePartControl( IEditorInput input ) - { - if ( fAttachSourceForm != null ) - { - if ( fAttachSourceForm.getInput() != null && !fAttachSourceForm.getInput().equals( input ) ) - { - fAttachSourceForm = null; - super.updatePartControl( input ); - } - } - else - super.updatePartControl( input ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPart#dispose() - */ - public void dispose() { - IEditorInput input = getEditorInput(); - IEditorInput newInput = input; - if ( input instanceof EditorInputDelegate && ((EditorInputDelegate)input).getDelegate() != null ) - { - newInput = ((EditorInputDelegate)input).getDelegate(); - } - CUIPlugin.getDefault().getWorkingCopyManager().disconnect(newInput); - super.dispose(); - } - -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java deleted file mode 100644 index 87ea488f416..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DebugTextHover.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.editors; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.ITextViewer; - -/** - * - * The text hovering support for C/C++ debugger. - * - * @since: Sep 12, 2002 - */ -public class DebugTextHover implements ITextHover -{ - static final private int MAX_HOVER_INFO_SIZE = 100; - - /** - * Constructor for DebugTextHover. - */ - public DebugTextHover() - { - super(); - } - - /** - * @see org.eclipse.jface.text.ITextHover#getHoverInfo(ITextViewer, IRegion) - */ - public String getHoverInfo( ITextViewer textViewer, IRegion hoverRegion ) - { - DebugPlugin debugPlugin = DebugPlugin.getDefault(); - if ( debugPlugin == null ) - { - return null; - } - ILaunchManager launchManager = debugPlugin.getLaunchManager(); - if ( launchManager == null ) - { - return null; - } - - IDebugTarget[] targets = launchManager.getDebugTargets(); - if ( targets != null && targets.length > 0 ) - { - try - { - IDocument document = textViewer.getDocument(); - if ( document == null ) - return null; - - String expression = document.get( hoverRegion.getOffset(), hoverRegion.getLength() ); - if ( expression == null ) - return null; - expression = expression.trim(); - if ( expression.length() == 0 ) - return null; - List targetList = new ArrayList( targets.length ); - for ( int i = 0; i < targets.length; i++ ) - { - ICExpressionEvaluator ee = (ICExpressionEvaluator)targets[i].getAdapter( ICExpressionEvaluator.class ); - if ( ee != null ) - { - targetList.add(targets[i] ); - } - } - StringBuffer buffer = new StringBuffer(); - boolean showDebugTarget = targetList.size() > 1; - Iterator iterator = targetList.iterator(); - while ( iterator.hasNext() ) - { - IDebugTarget target = (IDebugTarget)iterator.next(); - ICExpressionEvaluator ee = (ICExpressionEvaluator)target.getAdapter( ICExpressionEvaluator.class ); - if ( ee.canEvaluate() ) - { - String result = evaluateExpression( ee, expression ); - try - { - if ( result != null ) - appendVariable( buffer, expression, result.trim(), showDebugTarget ? target.getName() : null ); - } - catch( DebugException x ) - { - CDebugUIPlugin.log( x ); - } - } - } - if ( buffer.length() > 0 ) - { - return buffer.toString(); - } - } - catch ( BadLocationException x ) - { - CDebugUIPlugin.log( x ); - } - } - return null; - } - - /** - * @see org.eclipse.jface.text.ITextHover#getHoverRegion(ITextViewer, int) - */ - public IRegion getHoverRegion( ITextViewer viewer, int offset ) - { -/* - Point selectedRange = viewer.getSelectedRange(); - if ( selectedRange.x >= 0 && - selectedRange.y > 0 && - offset >= selectedRange.x && - offset <= selectedRange.x + selectedRange.y ) - return new Region( selectedRange.x, selectedRange.y ); -*/ - if ( viewer != null ) - return CDebugUIUtils.findWord( viewer.getDocument(), offset ); - return null; - } - - private String evaluateExpression( ICExpressionEvaluator ee, String expression ) - { - String result = null; - try - { - result = ee.evaluateExpressionToString( expression ); - } - catch( DebugException e ) - { - // ignore - } - return result; - } - - /** - * A variable gets one line for each debug target it appears in. - */ - private static void appendVariable( StringBuffer buffer, - String expression, - String value, - String debugTargetName ) throws DebugException - { - if ( value.length() > MAX_HOVER_INFO_SIZE ) - value = value.substring( 0, MAX_HOVER_INFO_SIZE ) + " ..."; - buffer.append( "

            " ); //$NON-NLS-1$ - if ( debugTargetName != null ) - { - buffer.append( '[' + debugTargetName + "] " ); //$NON-NLS-1$ - } - buffer.append( makeHTMLSafe( expression ) ); - buffer.append( " = " ); //$NON-NLS-1$ - - String safeValue = "" + makeHTMLSafe( value ) + ""; //$NON-NLS-1$ //$NON-NLS-2$ - buffer.append( safeValue ); - buffer.append( "

            " ); //$NON-NLS-1$ - } - - /** - * Replace any characters in the given String that would confuse an HTML - * parser with their escape sequences. - */ - private static String makeHTMLSafe( String string ) - { - StringBuffer buffer = new StringBuffer( string.length() ); - - for ( int i = 0; i != string.length(); i++ ) - { - char ch = string.charAt( i ); - - switch( ch ) - { - case '&': - buffer.append( "&" ); //$NON-NLS-1$ - break; - - case '<': - buffer.append( "<" ); //$NON-NLS-1$ - break; - - case '>': - buffer.append( ">" ); //$NON-NLS-1$ - break; - - default: - buffer.append( ch ); - break; - } - } - return buffer.toString(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyDocumentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyDocumentProvider.java deleted file mode 100644 index dc217d6dba9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyDocumentProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.ui.editors.text.StorageDocumentProvider; - -/** - * Enter type comment. - * - * @since: Jan 6, 2003 - */ -public class DisassemblyDocumentProvider extends StorageDocumentProvider -{ - /** - * Constructor for DisassemblyDocumentProvider. - */ - public DisassemblyDocumentProvider() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createAnnotationModel(Object) - */ - protected IAnnotationModel createAnnotationModel( Object element ) throws CoreException - { - if ( element != null && element instanceof DisassemblyEditorInput ) - { - IResource resource = (IResource)((DisassemblyEditorInput)element).getAdapter( IResource.class ); - IStorage storage = ((DisassemblyEditorInput)element).getStorage(); - if ( resource != null && storage != null && storage instanceof IDisassemblyStorage ) - return new DisassemblyMarkerAnnotationModel( (IDisassemblyStorage)storage, resource ); - } - return super.createAnnotationModel( element ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditor.java deleted file mode 100644 index 8b0fca0c0d6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor; -import org.eclipse.cdt.ui.CUIPlugin; - -/** - * Enter type comment. - * - * @since: Jan 6, 2003 - */ -public class DisassemblyEditor extends AsmTextEditor -{ - static final public String DISASSEMBLY_EDITOR_ID = "org.eclipse.cdt.debug.ui.DisassemblyEditor"; //$NON-NLS-1$ - - /** - * Constructor for DisassemblyEditor. - */ - public DisassemblyEditor() - { - super(); - setDocumentProvider( CDebugUIPlugin.getDefault().getDisassemblyDocumentProvider() ); - setSourceViewerConfiguration( new DisassemblySourceViewerConfiguration( CUIPlugin.getDefault().getAsmTextTools(), this ) ); - setEditorContextMenuId("#DisassemblyEditorContext"); //$NON-NLS-1$ - setRulerContextMenuId("#DisassemblyEditorRulerContext"); //$NON-NLS-1$ - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditorInput.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditorInput.java deleted file mode 100644 index 060f38fdbd4..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyEditorInput.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IPersistableElement; -import org.eclipse.ui.IStorageEditorInput; - -/** - * Enter type comment. - * - * @since: Oct 8, 2002 - */ -public class DisassemblyEditorInput implements IStorageEditorInput -{ - private final static String FILE_NAME_EXTENSION = ".dasm"; - protected IStorage fStorage; - - /** - * Constructor for DisassemblyEditorInput. - */ - public DisassemblyEditorInput( IStorage storage ) - { - fStorage = storage; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IStorageEditorInput#getStorage() - */ - public IStorage getStorage() throws CoreException - { - return fStorage; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#exists() - */ - public boolean exists() - { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getImageDescriptor() - */ - public ImageDescriptor getImageDescriptor() - { - return CDebugImages.DESC_OBJS_DISASSEMBLY; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getName() - */ - public String getName() - { - try - { - if ( getStorage() != null ) - { - return getStorage().getName() + FILE_NAME_EXTENSION; - } - } - catch( CoreException e ) - { - // ignore - } - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getPersistable() - */ - public IPersistableElement getPersistable() - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IEditorInput#getToolTipText() - */ - public String getToolTipText() - { - return "Disassembly"; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( IResource.class ) ) - { - try - { - IStorage storage = getStorage(); - if ( storage != null ) - { - return storage.getAdapter( adapter ); - } - } - catch( CoreException e ) - { - // ignore - } - } - if ( adapter.equals( DisassemblyEditorInput.class ) ) - { - return this; - } - return null; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(Object) - */ - public boolean equals( Object obj ) - { - if ( obj != null && obj instanceof DisassemblyEditorInput ) - { - try - { - IStorage storage = ((DisassemblyEditorInput)obj).getStorage(); - if ( storage != null && storage.equals( fStorage ) ) - return true; - else if ( storage == null && fStorage == null ) - return true; - } - catch( CoreException e ) - { - } - } - return false; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotation.java deleted file mode 100644 index 2b9e5b7a577..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotation.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.cdt.debug.internal.core.breakpoints.CAddressBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CLineBreakpoint; -import org.eclipse.core.resources.IMarker; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.ui.texteditor.MarkerAnnotation; -import org.eclipse.ui.texteditor.MarkerUtilities; - -/** - * Enter type comment. - * - * @since: Jan 6, 2003 - */ -public class DisassemblyMarkerAnnotation extends MarkerAnnotation -{ - private IDebugModelPresentation fPresentation; - - /** - * Constructor for DisassemblyMarkerAnnotation. - * @param marker - */ - public DisassemblyMarkerAnnotation( IMarker marker ) - { - super( marker ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.MarkerAnnotation#initialize() - */ - protected void initialize() - { - IMarker marker = getMarker(); - - if ( MarkerUtilities.isMarkerType( marker, CLineBreakpoint.getMarkerType() ) || - MarkerUtilities.isMarkerType( marker, CFunctionBreakpoint.getMarkerType() ) || - MarkerUtilities.isMarkerType( marker, CAddressBreakpoint.getMarkerType() ) ) - { - if ( fPresentation == null ) - fPresentation = DebugUITools.newDebugModelPresentation(); - - setLayer( 4 ); - setImage( fPresentation.getImage( marker ) ); - return; - } - super.initialize(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotationModel.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotationModel.java deleted file mode 100644 index ffff8db027e..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblyMarkerAnnotationModel.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import java.util.ArrayList; - -import org.eclipse.cdt.debug.core.ICBreakpointManager; -import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.core.model.ICBreakpoint; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.cdt.debug.internal.core.breakpoints.CAddressBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint; -import org.eclipse.cdt.debug.internal.core.breakpoints.CLineBreakpoint; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Position; -import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; -import org.eclipse.ui.texteditor.MarkerAnnotation; - -/** - * Enter type comment. - * - * @since: Jan 9, 2003 - */ -public class DisassemblyMarkerAnnotationModel extends AbstractMarkerAnnotationModel -{ - /** - * Internal resource change listener. - */ - class ResourceChangeListener implements IResourceChangeListener - { - /* - * @see IResourceChangeListener#resourceChanged - */ - public void resourceChanged( IResourceChangeEvent e ) - { - IResourceDelta delta = e.getDelta(); - try - { - if ( delta != null ) - delta.accept( getResourceDeltaVisitor() ); - } - catch( CoreException x ) - { - doHandleCoreException( x, "Resource Changed" ); - } - } - } - - /** - * Internal resource delta visitor. - */ - class ResourceDeltaVisitor implements IResourceDeltaVisitor - { - /* - * @see IResourceDeltaVisitor#visit - */ - public boolean visit( IResourceDelta delta ) throws CoreException - { - if ( delta != null && /*getResource().equals( delta.getResource() )*/delta.getResource() instanceof IFile ) - { - update( delta.getMarkerDeltas() ); - return false; - } - return true; - } - } - - /** The workspace */ - private IWorkspace fWorkspace; - - /** The resource */ - private IResource fResource; - - /** The resource change listener */ - private IResourceChangeListener fResourceChangeListener = new ResourceChangeListener(); - - /** The resource delta visitor */ - private IResourceDeltaVisitor fResourceDeltaVisitor = new ResourceDeltaVisitor(); - - private IDisassemblyStorage fStorage = null; - - /** - * Constructor for DisassemblyMarkerAnnotationModel. - */ - public DisassemblyMarkerAnnotationModel( IDisassemblyStorage storage, IResource resource ) - { - fResource = resource; - fWorkspace = resource.getWorkspace(); - fStorage = storage; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#retrieveMarkers() - */ - protected IMarker[] retrieveMarkers() throws CoreException - { - if ( fStorage == null ) - return null; - IDebugTarget target = fStorage.getDebugTarget(); - if ( target != null ) - { - IBreakpointManager bm = DebugPlugin.getDefault().getBreakpointManager(); - IBreakpoint[] brkpts = bm.getBreakpoints(); - ArrayList list = new ArrayList( brkpts.length ); - for ( int i = 0; i < brkpts.length; ++i ) - { - if ( target.supportsBreakpoint( brkpts[i] ) && isAcceptable( brkpts[i].getMarker() ) ) - { - list.add( brkpts[i].getMarker() ); - } - } - return (IMarker[])list.toArray( new IMarker[list.size()] ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#deleteMarkers(IMarker[]) - */ - protected void deleteMarkers( final IMarker[] markers ) throws CoreException - { - fWorkspace.run( new IWorkspaceRunnable() - { - public void run( IProgressMonitor monitor ) throws CoreException - { - for ( int i = 0; i < markers.length; ++i ) - { - markers[i].delete(); - } - } - }, null ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#listenToMarkerChanges(boolean) - */ - protected void listenToMarkerChanges( boolean listen ) - { - if ( listen ) - fWorkspace.addResourceChangeListener( fResourceChangeListener ); - else - fWorkspace.removeResourceChangeListener( fResourceChangeListener ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#isAcceptable(IMarker) - */ - protected boolean isAcceptable( IMarker marker ) - { - try - { - return ( marker.getType().equals( CLineBreakpoint.getMarkerType() ) || - marker.getType().equals( CFunctionBreakpoint.getMarkerType() ) || - marker.getType().equals( CAddressBreakpoint.getMarkerType() ) ); - } - catch( CoreException e ) - { - } - return false; - } - - protected IResourceDeltaVisitor getResourceDeltaVisitor() - { - return fResourceDeltaVisitor; - } - - /** - * Updates this model to the given marker deltas. - * - * @param markerDeltas the list of marker deltas - */ - protected void update( IMarkerDelta[] markerDeltas ) - { - if ( markerDeltas.length == 0 ) - return; - - for( int i = 0; i < markerDeltas.length; i++ ) - { - IMarkerDelta delta = markerDeltas[i]; - switch( delta.getKind() ) - { - case IResourceDelta.ADDED : - addMarkerAnnotation( delta.getMarker() ); - break; - case IResourceDelta.REMOVED : - removeMarkerAnnotation( delta.getMarker() ); - break; - case IResourceDelta.CHANGED : - modifyMarkerAnnotation( delta.getMarker() ); - break; - } - } - - fireModelChanged(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#createPositionFromMarker(IMarker) - */ - protected Position createPositionFromMarker( IMarker marker ) - { - try - { - if ( marker.getType().equals( CLineBreakpoint.getMarkerType() ) ) - { - return createPositionFromLineBreakpoint( marker ); - } - if ( marker.getType().equals( CFunctionBreakpoint.getMarkerType() ) ) - { - return createPositionFromLineBreakpoint( marker ); - } - if ( marker.getType().equals( CAddressBreakpoint.getMarkerType() ) ) - { - return createPositionFromAddressBreakpoint( marker ); - } - } - catch( CoreException e ) - { - } - return null; - } - - private Position createPositionFromLineBreakpoint( IMarker marker ) - { - if ( fStorage != null ) - { - IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint( marker ); - if ( breakpoint instanceof ICBreakpoint ) - { - IDebugTarget target = fStorage.getDebugTarget(); - if ( target != null && target.getAdapter( ICBreakpointManager.class ) != null ) - { - ICBreakpointManager bm = (ICBreakpointManager)target.getAdapter( ICBreakpointManager.class ); - long address = bm.getBreakpointAddress( (ICBreakpoint)breakpoint ); - if ( address != 0 ) - return createPositionFromAddress( address ); - } - } - } - return null; - } - - private Position createPositionFromAddressBreakpoint( IMarker marker ) throws CoreException - { - try - { - return createPositionFromAddress( Long.parseLong( marker.getAttribute( ICAddressBreakpoint.ADDRESS, "0" ) ) ); - } - catch( NumberFormatException e ) - { - } - return null; - } - - private Position createPositionFromAddress( long address ) - { - try - { - int start = -1; - int line = fStorage.getLineNumber( address ); - if ( line > 0 && fDocument != null ) - { - start = fDocument.getLineOffset( line - 1 ); - if ( start > -1 ) - { - return new Position( start, fDocument.getLineLength( line - 1 ) ); - } - } - } - catch ( BadLocationException x ) - { - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#createMarkerAnnotation(IMarker) - */ - protected MarkerAnnotation createMarkerAnnotation( IMarker marker ) - { - return new DisassemblyMarkerAnnotation( marker ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#getMarkerPosition(IMarker) - */ - public Position getMarkerPosition( IMarker marker ) - { - return createPositionFromMarker( marker ); - } - - protected void doHandleCoreException( CoreException e, String message ) - { - handleCoreException( e, message ); - } - - protected IResource getResource() - { - return fResource; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblySourceViewerConfiguration.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblySourceViewerConfiguration.java deleted file mode 100644 index d1830a2e38b..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/DisassemblySourceViewerConfiguration.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.cdt.internal.ui.editor.asm.AsmSourceViewerConfiguration; -import org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor; -import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools; -import org.eclipse.cdt.internal.ui.text.CAnnotationHover; -import org.eclipse.cdt.internal.ui.text.HTMLTextPresenter; -import org.eclipse.jface.text.DefaultInformationControl; -import org.eclipse.jface.text.IInformationControl; -import org.eclipse.jface.text.IInformationControlCreator; -import org.eclipse.jface.text.source.IAnnotationHover; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Shell; - -/** - * Enter type comment. - * - * @since May 5, 2003 - */ -public class DisassemblySourceViewerConfiguration extends AsmSourceViewerConfiguration -{ - public DisassemblySourceViewerConfiguration( AsmTextTools tools, AsmTextEditor editor ) - { - super( tools, editor ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer) - */ - public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) - { - return new CAnnotationHover(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer) - */ - public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer ) - { - return getInformationControlCreator( sourceViewer, true ); - } - - public IInformationControlCreator getInformationControlCreator( ISourceViewer sourceViewer, final boolean cutDown ) - { - return new IInformationControlCreator() - { - public IInformationControl createInformationControl( Shell parent ) - { - int style = cutDown ? SWT.NONE : ( SWT.V_SCROLL | SWT.H_SCROLL ); - return new DefaultInformationControl( parent, style, new HTMLTextPresenter( cutDown ) ); - } - }; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/EditorInputDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/EditorInputDelegate.java deleted file mode 100644 index 2a7dba26943..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/EditorInputDelegate.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import org.eclipse.cdt.ui.IEditorInputDelegate; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IPersistableElement; -import org.eclipse.ui.IStorageEditorInput; - -/** - * - * Enter type comment. - * - * @since Mar 4, 2003 - */ -public class EditorInputDelegate implements IEditorInputDelegate -{ - public static final int TYPE_ATTACH_SOURCE = 0; - public static final int TYPE_WORKSPACE_FILE = 1; - public static final int TYPE_EXTERNAL_FILE = 2; - - private int fType = TYPE_ATTACH_SOURCE; - private IEditorInput fDelegate = null; - private FileNotFoundElement fElement = null; - - /** - * Constructor for EditorInputDelegate. - */ - public EditorInputDelegate( FileNotFoundElement element ) - { - fElement = element; - } - - /** - * @see org.eclipse.ui.IEditorInput#exists() - */ - public boolean exists() - { - if ( fDelegate != null ) - return fDelegate.exists(); - return true; - } - - /** - * @see org.eclipse.ui.IEditorInput#getImageDescriptor() - */ - public ImageDescriptor getImageDescriptor() - { - if ( fDelegate != null ) - return fDelegate.getImageDescriptor(); - return null; - } - - /** - * @see org.eclipse.ui.IEditorInput#getName() - */ - public String getName() - { - if ( fDelegate != null ) - return fDelegate.getName(); - return ( fElement != null ) ? fElement.getName() : ""; - } - - /** - * @see org.eclipse.ui.IEditorInput#getPersistable() - */ - public IPersistableElement getPersistable() - { - if ( fDelegate != null ) - return fDelegate.getPersistable(); - return null; - } - - /** - * @see org.eclipse.ui.IEditorInput#getToolTipText() - */ - public String getToolTipText() - { - if ( fDelegate != null ) - return fDelegate.getToolTipText(); - return ""; - } - - /** - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) - */ - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( FileNotFoundElement.class ) ) - return fElement; - if ( getDelegate() != null ) - return getDelegate().getAdapter( adapter ); - return null; - } - - public int getType() - { - return fType; - } - - public void setType( int type ) - { - fType = type; - } - - public IEditorInput getDelegate() - { - return fDelegate; - } - - public void setDelegate( IEditorInput input ) - { - fDelegate = input; - } - - public IStorage getStorage() throws CoreException - { - if ( getDelegate() instanceof IStorageEditorInput ) - return ((IStorageEditorInput)getDelegate()).getStorage(); - return getDummyStorage(); - } - - private IStorage getDummyStorage() - { - return new IStorage() - { - public InputStream getContents() throws CoreException - { - return new ByteArrayInputStream( new byte[0] ); - } - - public IPath getFullPath() - { - if ( getElement() != null ) - return getElement().getFullPath(); - return null; - } - - public String getName() - { - if ( getElement() != null ) - return getElement().getName(); - return ""; - } - - public boolean isReadOnly() - { - return true; - } - - public Object getAdapter( Class adapter ) - { - if ( adapter.equals( IStorage.class ) ) - return this; - return null; - } - }; - } - - protected FileNotFoundElement getElement() - { - return fElement; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/FileNotFoundElement.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/FileNotFoundElement.java deleted file mode 100644 index 1730ee539d9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/FileNotFoundElement.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IStackFrame; - -/** - * The source locator creates an instance of this class if it cannot find the file specified in stack frame. - * - * @since: Feb 21, 2003 - */ -public class FileNotFoundElement -{ - private IStackFrame fStackFrame; - - /** - * Constructor for FileNotFoundElement. - */ - public FileNotFoundElement( IStackFrame stackFrame ) - { - fStackFrame = stackFrame; - } - - public IPath getFullPath() - { - IStackFrameInfo frameInfo = (IStackFrameInfo)fStackFrame.getAdapter( IStackFrameInfo.class ); - if ( frameInfo != null && frameInfo.getFile() != null && frameInfo.getFile().length() > 0 ) - { - Path path = new Path( frameInfo.getFile() ); - if ( path.isValidPath( frameInfo.getFile() ) ) - { - return path; - } - } - return null; - } - - public String getName() - { - IPath path = getFullPath(); - return ( path != null ) ? path.lastSegment() : ""; - } - - public IStackFrame getStackFrame() - { - return fStackFrame; - } - - public ILaunch getLaunch() - { - return ( fStackFrame != null ) ? fStackFrame.getLaunch() : null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/NoSymbolOrSourceElement.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/NoSymbolOrSourceElement.java deleted file mode 100644 index ff8d42a009d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/NoSymbolOrSourceElement.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.editors; - -import org.eclipse.debug.core.model.IStackFrame; - -/** - * Enter type comment. - * - * @since Apr 25, 2003 - */ -public class NoSymbolOrSourceElement -{ - private IStackFrame fStackFrame; - - public NoSymbolOrSourceElement( IStackFrame frame ) - { - fStackFrame = frame; - } - - public IStackFrame getStackFrame() - { - return fStackFrame; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java deleted file mode 100644 index 7ea0e6a18e1..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.preferences; - -import java.text.MessageFormat; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.cdi.ICDIFormat; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.debug.ui.IDebugView; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.IntegerFieldEditor; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * Preference page for debug preferences that apply specifically to - * C/C++ Debugging. - * - * @since Oct 3, 2002 - */ -public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPreferencePage -{ - // View setting widgets - private Button fPathsButton; - private Combo fVariableFormatCombo; - private Combo fExpressionFormatCombo; - private Combo fRegisterFormatCombo; - // Disassembly setting widgets - private Button fAutoDisassemblyButton; - - // Maximum number of disassembly instructions to display - private IntegerFieldEditor fMaxNumberOfInstructionsText; - - private static final int NUMBER_OF_DIGITS = 3; - - // Format constants - private static int[] fFormatIds = new int[]{ ICDIFormat.NATURAL, ICDIFormat.HEXADECIMAL, ICDIFormat.DECIMAL }; - private static String[] fFormatLabels = new String[] { "Natural", "Hexadecimal", "Decimal" }; - - private PropertyChangeListener fPropertyChangeListener; - - protected class PropertyChangeListener implements IPropertyChangeListener - { - private boolean fHasStateChanged = false; - - public void propertyChange( PropertyChangeEvent event ) - { - if ( event.getProperty().equals( ICDebugPreferenceConstants.PREF_SHOW_HEX_VALUES ) ) - { - fHasStateChanged = true; - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.PREF_SHOW_CHAR_VALUES ) ) - { - fHasStateChanged = true; - } - } - - protected boolean hasStateChanged() - { - return fHasStateChanged; - } - } - - /** - * Constructor for CDebugPreferencePage. - */ - public CDebugPreferencePage() - { - super(); - setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); - getPreferenceStore().addPropertyChangeListener( getPropertyChangeListener() ); - setDescription( "General settings for C/C++ Debugging." ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite) - */ - protected Control createContents( Composite parent ) - { - WorkbenchHelp.setHelp( getControl(), ICDebugHelpContextIds.C_DEBUG_PREFERENCE_PAGE ); - - //The main composite - Composite composite = new Composite( parent, SWT.NULL ); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout( layout ); - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.horizontalAlignment = GridData.FILL; - composite.setLayoutData( data ); - - createSpacer( composite, 1 ); - createViewSettingPreferences( composite ); - createSpacer( composite, 1 ); - createDisassemblySettingPreferences( composite ); - setValues(); - - return composite; - } - - /** - * Creates composite group and sets the default layout data. - * - * @param parent the parent of the new composite - * @param numColumns the number of columns for the new composite - * @param labelText the text label of the new composite - * @return the newly-created composite - */ - private Composite createGroupComposite( Composite parent, int numColumns, String labelText ) - { - return ControlFactory.createGroup( parent, labelText, numColumns ); - } - - /** - * Set the values of the component widgets based on the - * values in the preference store - */ - private void setValues() - { - IPreferenceStore store = getPreferenceStore(); - - fPathsButton.setSelection( store.getBoolean( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS ) ); - fAutoDisassemblyButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_AUTO_DISASSEMBLY ) ); - getMaxNumberOfInstructionsText().setStringValue( new Integer( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) ).toString() ); - fVariableFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ) ) ); - fExpressionFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT ) ) ); - fRegisterFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT ) ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - protected PropertyChangeListener getPropertyChangeListener() - { - if ( fPropertyChangeListener == null ) - { - fPropertyChangeListener = new PropertyChangeListener(); - } - return fPropertyChangeListener; - } - - /** - * Set the default preferences for this page. - */ - public static void initDefaults(IPreferenceStore store) - { - store.setDefault( ICDebugPreferenceConstants.PREF_SHOW_HEX_VALUES, false ); - store.setDefault( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS, true ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_AUTO_DISASSEMBLY, false ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS, ICDebugConstants.DEF_NUMBER_OF_INSTRUCTIONS ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, ICDIFormat.NATURAL ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT, ICDIFormat.NATURAL ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, ICDIFormat.NATURAL ); - } - - /** - * @see DialogPage#dispose() - */ - public void dispose() - { - super.dispose(); - getPreferenceStore().removePropertyChangeListener( getPropertyChangeListener() ); - } - - /** - * Create the view setting preferences composite widget - */ - private void createViewSettingPreferences( Composite parent ) - { - Composite comp = createGroupComposite( parent, 1, "Opened view default settings" ); - fPathsButton = createCheckButton( comp, "Show full &paths" ); - Composite formatComposite = ControlFactory.createCompositeEx( comp, 2, 0 ); - ((GridLayout)formatComposite.getLayout()).makeColumnsEqualWidth = true; - fVariableFormatCombo = createComboBox( formatComposite, "Default variable format:", fFormatLabels, fFormatLabels[0] ); - fExpressionFormatCombo = createComboBox( formatComposite, "Default expression format:", fFormatLabels, fFormatLabels[0] ); - fRegisterFormatCombo = createComboBox( formatComposite, "Default register format:", fFormatLabels, fFormatLabels[0] ); - } - - /** - * Create the disassembly setting preferences composite widget - */ - private void createDisassemblySettingPreferences( Composite parent ) - { - Composite comp = createGroupComposite( parent, 1, "Disassembly options" ); - fAutoDisassemblyButton = createCheckButton( comp, "Automatically switch to &disassembly mode" ); - createMaxNumberOfInstructionsField( comp ); - } - - private void createMaxNumberOfInstructionsField( Composite parent ) - { - Composite composite = ControlFactory.createComposite( parent, 2 ); - fMaxNumberOfInstructionsText = new IntegerFieldEditor( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS, - "Maximum number of instructions: ", - composite, - NUMBER_OF_DIGITS ); - GridData data = (GridData)fMaxNumberOfInstructionsText.getTextControl( composite ).getLayoutData(); - data.horizontalAlignment = GridData.BEGINNING; - data.widthHint = convertWidthInCharsToPixels( NUMBER_OF_DIGITS + 1 ); - fMaxNumberOfInstructionsText.setPreferencePage( this ); - fMaxNumberOfInstructionsText.setValidateStrategy( StringFieldEditor.VALIDATE_ON_KEY_STROKE ); - fMaxNumberOfInstructionsText.setValidRange( ICDebugConstants.MIN_NUMBER_OF_INSTRUCTIONS, ICDebugConstants.MAX_NUMBER_OF_INSTRUCTIONS ); - String minValue = Integer.toString( ICDebugConstants.MIN_NUMBER_OF_INSTRUCTIONS ); - String maxValue = Integer.toString( ICDebugConstants.MAX_NUMBER_OF_INSTRUCTIONS ); - fMaxNumberOfInstructionsText.setErrorMessage( MessageFormat.format( "The valid value range is [{0},{1}].", new String[]{ minValue, maxValue } ) ); - fMaxNumberOfInstructionsText.load(); - fMaxNumberOfInstructionsText.setPropertyChangeListener( - new IPropertyChangeListener() - { - public void propertyChange( PropertyChangeEvent event ) - { - if ( event.getProperty().equals( FieldEditor.IS_VALID ) ) - setValid( getMaxNumberOfInstructionsText().isValid() ); - } - } ); - } - - /** - * Creates a button with the given label and sets the default - * configuration data. - */ - private Button createCheckButton( Composite parent, String label ) - { - Button button = new Button( parent, SWT.CHECK | SWT.LEFT ); - button.setText( label ); - // FieldEditor GridData - GridData data = new GridData(); - button.setLayoutData( data ); - return button; - } - - /** - * Creates a button with the given label and sets the default - * configuration data. - */ - private Combo createComboBox( Composite parent, String label, String[] items, String selection ) - { - ControlFactory.createLabel( parent, label ); - Combo combo = ControlFactory.createSelectCombo( parent, items, selection ); - combo.setLayoutData( new GridData() ); - return combo; - } - - protected void createSpacer( Composite composite, int columnSpan ) - { - Label label = new Label( composite, SWT.NONE ); - GridData gd = new GridData(); - gd.horizontalSpan = columnSpan; - label.setLayoutData( gd ); - } - - /** - * @see IPreferencePage#performOk() - * Also, notifies interested listeners - */ - public boolean performOk() - { - storeValues(); - if ( getPropertyChangeListener().hasStateChanged() ) - { - refreshViews(); - } - CDebugUIPlugin.getDefault().savePluginPreferences(); - CDebugCorePlugin.getDefault().savePluginPreferences(); - return true; - } - - /** - * Refresh the variables and expression views as changes - * have occurred that affects these views. - */ - private void refreshViews() - { - BusyIndicator.showWhile( getShell().getDisplay(), - new Runnable() - { - public void run() - { - // Refresh interested views - IWorkbenchWindow[] windows = CDebugUIPlugin.getDefault().getWorkbench().getWorkbenchWindows(); - IWorkbenchPage page = null; - for ( int i = 0; i < windows.length; i++ ) - { - page = windows[i].getActivePage(); - if ( page != null ) - { - refreshViews( page, IDebugUIConstants.ID_EXPRESSION_VIEW ); - refreshViews( page, IDebugUIConstants.ID_VARIABLE_VIEW ); - refreshViews( page, ICDebugUIConstants.ID_REGISTERS_VIEW ); - } - } - } - } ); - } - - /** - * Refresh all views in the given workbench page with the given view id - */ - protected void refreshViews( IWorkbenchPage page, String viewID ) - { - IViewPart part = page.findView( viewID ); - if ( part != null ) - { - IDebugView adapter = (IDebugView)part.getAdapter( IDebugView.class ); - if ( adapter != null ) - { - Viewer viewer = adapter.getViewer(); - if ( viewer instanceof StructuredViewer ) - { - ((StructuredViewer)viewer).refresh(); - } - } - } - } - - /** - * Store the preference values based on the state of the component widgets - */ - private void storeValues() - { - IPreferenceStore store = getPreferenceStore(); - store.setValue( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS, fPathsButton.getSelection() ); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_AUTO_DISASSEMBLY, fAutoDisassemblyButton.getSelection() ); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS, getMaxNumberOfInstructionsText().getIntValue() ); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, getFormatId( fVariableFormatCombo.getSelectionIndex() ) ); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT, getFormatId( fExpressionFormatCombo.getSelectionIndex() ) ); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, getFormatId( fRegisterFormatCombo.getSelectionIndex() ) ); - } - - /** - * Sets the default preferences. - * @see PreferencePage#performDefaults() - */ - protected void performDefaults() - { - setDefaultValues(); - super.performDefaults(); - } - - private void setDefaultValues() - { - IPreferenceStore store = getPreferenceStore(); - fPathsButton.setSelection( store.getDefaultBoolean( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS ) ); - fAutoDisassemblyButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_AUTO_DISASSEMBLY ) ); - getMaxNumberOfInstructionsText().setStringValue( new Integer( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) ).toString() ); - fVariableFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ) ) ); - fExpressionFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultInt( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT ) ) ); - fRegisterFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultInt( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT ) ) ); - } - - private static int getFormatId( int index ) - { - return ( index >= 0 && index < fFormatIds.length ) ? fFormatIds[index] : fFormatIds[0]; - } - - private static int getFormatIndex( int id ) - { - for ( int i = 0; i < fFormatIds.length; ++i ) - if ( fFormatIds[i] == id ) - return i; - return -1; - } - - protected IntegerFieldEditor getMaxNumberOfInstructionsText() - { - return fMaxNumberOfInstructionsText; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ComboFieldEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ComboFieldEditor.java deleted file mode 100644 index be7b90a3f89..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ComboFieldEditor.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.eclipse.cdt.debug.internal.ui.preferences; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.util.Assert; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * A field editor for a combo box that allows the drop-down selection of one of a list of items. - */ -public class ComboFieldEditor extends FieldEditor { - - /** - * The Combo widget. - */ - protected Combo fCombo; - - /** - * The value (not the name) of the currently selected item in the Combo widget. - */ - protected String fValue; - - /** - * The names (labels) and underlying values to populate the combo widget. These should be - * arranged as: { {name1, value1}, {name2, value2}, ...} - */ - private String[][] fEntryNamesAndValues; - - public ComboFieldEditor(String name, String labelText, String[][] entryNamesAndValues, Composite parent) { - init(name, labelText); - Assert.isTrue(checkArray(entryNamesAndValues)); - fEntryNamesAndValues = entryNamesAndValues; - createControl(parent); - } - - /** - * Checks whether given String[][] is of "type" - * String[][2]. - * - * @return true if it is ok, and false otherwise - */ - private boolean checkArray(String[][] table) { - if (table == null) { - return false; - } - for (int i = 0; i < table.length; i++) { - String[] array = table[i]; - if (array == null || array.length != 2) { - return false; - } - } - return true; - } - - /** - * @see FieldEditor#adjustForNumColumns(int) - */ - protected void adjustForNumColumns(int numColumns) { - if ( numColumns <= 1 ) - return; - int span = numColumns; - Control control = getLabelControl(); - if (control != null) { - ((GridData)control.getLayoutData()).horizontalSpan = 1; - --span; - } - ((GridData)fCombo.getLayoutData()).horizontalSpan = span; - } - - /** - * @see FieldEditor#doFillIntoGrid(Composite, int) - */ - protected void doFillIntoGrid(Composite parent, int numColumns) { - Control control = getLabelControl(parent); - GridData gd = new GridData(); - gd.horizontalSpan = numColumns; - control.setLayoutData(gd); - control = getComboBoxControl(parent); - gd = new GridData(); - gd.horizontalSpan = numColumns; - control.setLayoutData(gd); - } - - /** - * @see FieldEditor#doLoad() - */ - protected void doLoad() { - updateComboForValue(getPreferenceStore().getString(getPreferenceName())); - } - - /** - * @see FieldEditor#doLoadDefault() - */ - protected void doLoadDefault() { - updateComboForValue(getPreferenceStore().getDefaultString(getPreferenceName())); - } - - /** - * @see FieldEditor#doStore() - */ - protected void doStore() { - if (fValue == null) { - getPreferenceStore().setToDefault(getPreferenceName()); - return; - } - - getPreferenceStore().setValue(getPreferenceName(), fValue); - } - - /** - * @see FieldEditor#getNumberOfControls() - */ - public int getNumberOfControls() { - return 1; - } - - /** - * Lazily create and return the Combo control. - */ - public Combo getComboBoxControl(Composite parent) { - if (fCombo == null) { - fCombo = new Combo(parent, SWT.READ_ONLY); - for (int i = 0; i < fEntryNamesAndValues.length; i++) { - fCombo.add(fEntryNamesAndValues[i][0], i); - } - - fCombo.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - String oldValue = fValue; - String name = fCombo.getText(); - fValue = getValueForName(name); - setPresentsDefaultValue(false); - fireValueChanged(VALUE, oldValue, fValue); - } - }); - } - return fCombo; - } - - /** - * Given the name (label) of an entry, return the corresponding value. - */ - protected String getValueForName(String name) { - for (int i = 0; i < fEntryNamesAndValues.length; i++) { - String[] entry = fEntryNamesAndValues[i]; - if (name.equals(entry[0])) { - return entry[1]; - } - } - return fEntryNamesAndValues[0][0]; - } - - /** - * Set the name in the combo widget to match the specified value. - */ - protected void updateComboForValue(String value) { - fValue = value; - for (int i = 0; i < fEntryNamesAndValues.length; i++) { - if (value.equals(fEntryNamesAndValues[i][1])) { - fCombo.setText(fEntryNamesAndValues[i][0]); - return; - } - } - if (fEntryNamesAndValues.length > 0) { - fValue = fEntryNamesAndValues[0][1]; - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#fireValueChanged(String, Object, Object) - */ - protected void fireValueChanged( String property, Object oldValue, Object newValue ) - { - super.fireValueChanged( property, oldValue, newValue ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditor#setPresentsDefaultValue(boolean) - */ - protected void setPresentsDefaultValue( boolean b ) - { - super.setPresentsDefaultValue( b ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ICDebugPreferenceConstants.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ICDebugPreferenceConstants.java deleted file mode 100644 index 96c77a4faeb..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/ICDebugPreferenceConstants.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.preferences; - -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -/** - * - * Constants defining the keys to be used for accessing preferences - * inside the debug ui plugin's preference bundle. - * - * In descriptions (of the keys) below describe the preference - * stored at the given key. The type indicates type of the stored preferences - * - * The preference store is loaded by the plugin (CDebugUIPlugin). - * @see CDebugUIPlugin.initializeDefaultPreferences(IPreferenceStore) - for initialization of the store - * - * @since Jul 23, 2002 - */ -public interface ICDebugPreferenceConstants -{ - /** - * Boolean preference controlling whether the debugger shows - * full paths. When true the debugger - * will show full paths in newly opened views. - */ - public static final String PREF_SHOW_FULL_PATHS = ICDebugUIConstants.PLUGIN_ID + "cDebug.show_full_paths"; - - /** - * The RGB for the color to be used to indicate changed registers - */ - public static final String CHANGED_REGISTER_RGB = "Changed.Register.RGB"; //$NON-NLS-1$ - - /** - * The default values for the memory view parameters. - */ - public static final String DEFAULT_MEMORY_PADDING_CHAR = "."; - public static final FontData DEFAULT_MEMORY_FONT = Display.getDefault().getSystemFont().getFontData()[0]; - - public static final RGB DEFAULT_MEMORY_FOREGROUND_RGB = Display.getCurrent().getSystemColor( SWT.COLOR_LIST_FOREGROUND ).getRGB(); - public static final RGB DEFAULT_MEMORY_BACKGROUND_RGB = Display.getCurrent().getSystemColor( SWT.COLOR_LIST_BACKGROUND ).getRGB(); - public static final RGB DEFAULT_MEMORY_ADDRESS_RGB = Display.getCurrent().getSystemColor( SWT.COLOR_DARK_GRAY ).getRGB(); - public static final RGB DEFAULT_MEMORY_CHANGED_RGB = Display.getCurrent().getSystemColor( SWT.COLOR_RED ).getRGB(); - public static final RGB DEFAULT_MEMORY_DIRTY_RGB = Display.getCurrent().getSystemColor( SWT.COLOR_BLUE ).getRGB(); - - public static final String PREF_MEMORY_NUMBER_OF_BYTES = "Memory.NumberOfBytes"; - public static final String PREF_MEMORY_SIZE = "Memory.Size"; - public static final String PREF_MEMORY_FORMAT = "Memory.Format"; - public static final String PREF_MEMORY_BYTES_PER_ROW = "Memory.BytesPerRow"; - public static final String PREF_MEMORY_PADDING_CHAR = "Memory.PaddingChar"; - - /** - * The RGB for the memory text foreground color - */ - public static final String MEMORY_FOREGROUND_RGB = "Memory.Foreground.RGB"; //$NON-NLS-1$ - - /** - * The RGB for the memory text background color - */ - public static final String MEMORY_BACKGROUND_RGB = "Memory.background.RGB"; //$NON-NLS-1$ - - /** - * The RGB for the color to be used to indicate address values in the memory view - */ - public static final String MEMORY_ADDRESS_RGB = "Memory.Address.RGB"; //$NON-NLS-1$ - - /** - * The RGB for the color to be used to indicate changed values in the memory view - */ - public static final String MEMORY_CHANGED_RGB = "Memory.Changed.RGB"; //$NON-NLS-1$ - - /** - * The RGB for the color to be used to indicate dirty values in the memory view - */ - public static final String MEMORY_DIRTY_RGB = "Memory.Dirty.RGB"; //$NON-NLS-1$ - - /** - * The name of the font to use for the memory view - */ - public static final String MEMORY_FONT = "Memory.font"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether primitive types - * types display hexidecimal values. - */ - public static final String PREF_SHOW_HEX_VALUES = ICDebugUIConstants.PLUGIN_ID + "cDebug.showHexValues"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether primitive types - * types display char values. - */ - public static final String PREF_SHOW_CHAR_VALUES = ICDebugUIConstants.PLUGIN_ID + "cDebug.showCharValues"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether the memory view shows ASCII characters. - * When true the memory view will show ASCII characters by default. - */ - public static final String PREF_MEMORY_SHOW_ASCII = ICDebugUIConstants.PLUGIN_ID + "Memory.show_ascii"; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether the memory view will be refreshed - * every time when the execution of program stops. - * When true the 'Auto-Refresh' option will be checked. - */ - public static final String PREF_MEMORY_AUTO_REFRESH = ICDebugUIConstants.PLUGIN_ID + "Memory.auto_refresh"; //$NON-NLS-1$ -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/MemoryViewPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/MemoryViewPreferencePage.java deleted file mode 100644 index b44f009c664..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/MemoryViewPreferencePage.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.preferences; - -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.ColorFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.FontFieldEditor; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * Enter type comment. - * - * @since Jul 25, 2002 - */ -public class MemoryViewPreferencePage extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage -{ - - /** - * Constructor for MemoryViewPreferencePage. - * @param style - */ - public MemoryViewPreferencePage() - { - super( GRID ); - setDescription( "Memory View Settings." ); - setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); - } - - /** - * @see PreferencePage#createControl(Composite) - */ - public void createControl( Composite parent ) - { - super.createControl( parent ); - WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.MEMORY_PREFERENCE_PAGE ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() - { -/* - String[][] sizes = { { "Byte", "1" }, - { "Half Word", "2" }, - { "Word", "4" }, - { "Double Word", "8" }, -// { "Float", "8" }, -// { "Double Float", "16" }, - }; - addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_SIZE, "Size:", sizes, getFieldEditorParent() ) ); - - String[][] formats = { { "Hexadecimal", "0" }, - { "Binary", "1" }, -// { "Octal", "2" }, -// { "Signed Decimal", "3" }, -// { "Unsigned Decimal", "4" }, - }; - addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_FORMAT, "Format:", formats, getFieldEditorParent() ) ); - - String[][] bytesPerRow = { { "4", "4" }, { "8", "8" }, - { "16", "16" }, { "32", "32" }, - { "64", "64" }, { "128", "128" } }; - addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_BYTES_PER_ROW, "Bytes Per Row:", bytesPerRow, getFieldEditorParent() ) ); - - addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_DISPLAY_ASCII, "Display ASCII", getFieldEditorParent() ) ); -*/ - ColorFieldEditor foreground = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB, "Text Color:", getFieldEditorParent() ); - ColorFieldEditor background = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB, "Background Color:", getFieldEditorParent() ); - ColorFieldEditor address = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_ADDRESS_RGB, "Address Color:", getFieldEditorParent() ); - ColorFieldEditor changed = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_CHANGED_RGB, "Changed Value Color:", getFieldEditorParent() ); -// ColorFieldEditor dirty = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_DIRTY_RGB, "Modified Value Color:", getFieldEditorParent() ); - - FontFieldEditor font = new FontFieldEditor( ICDebugPreferenceConstants.MEMORY_FONT, "Font:", getFieldEditorParent() ); - - addField( foreground ); - addField( background ); - addField( address ); - addField( changed ); -// addField( dirty ); - addField( font ); - - StringFieldEditor paddingChar = createPaddingCharacterField(); - paddingChar.setTextLimit( 1 ); - addField( paddingChar ); - createSpacer( getFieldEditorParent(), 1 ); - createDefaultSettingsFields(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - protected void createSpacer( Composite composite, int columnSpan ) - { - Label label = new Label( composite, SWT.NONE ); - GridData gd = new GridData(); - gd.horizontalSpan = columnSpan; - label.setLayoutData( gd ); - } - - public static void initDefaults( IPreferenceStore store ) - { - store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, ICDebugPreferenceConstants.DEFAULT_MEMORY_PADDING_CHAR ); - store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH, true ); - store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII, true ); - PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_FONT, ICDebugPreferenceConstants.DEFAULT_MEMORY_FONT ); - PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_FOREGROUND_RGB ); - PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_BACKGROUND_RGB ); - PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_ADDRESS_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_ADDRESS_RGB ); - PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_CHANGED_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_CHANGED_RGB ); - PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_DIRTY_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_DIRTY_RGB ); - } - - /** - * @see IPreferencePage#performOk() - */ - public boolean performOk() - { - boolean ok = super.performOk(); - CDebugUIPlugin.getDefault().savePluginPreferences(); - return ok; - } - - private StringFieldEditor createPaddingCharacterField() - { - return new StringFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, "Padding Character:", 1, getFieldEditorParent() ) - { - protected boolean doCheckState() - { - return ( getTextControl().getText().length() == 1 ); - } - }; - } - - private void createDefaultSettingsFields() - { - addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH, "Auto-Refresh by default", SWT.NONE, getFieldEditorParent() ) ); - addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII, "Show ASCII by default", SWT.NONE, getFieldEditorParent() ) ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java deleted file mode 100644 index 92e47e75f3d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/RegistersViewPreferencePage.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.preferences; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.preference.ColorFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * A page to set the preferences for the registers view - * - * @since Sep 16, 2002 - */ -public class RegistersViewPreferencePage extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage -{ - private Button fAutoRefreshField = null; - - /** - * Constructor for RegistersViewPreferencePage. - * @param style - */ - public RegistersViewPreferencePage() - { - super( GRID ); - setDescription( "Registers View Settings." ); - setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); - } - - /** - * @see PreferencePage#createControl(Composite) - */ - public void createControl( Composite parent ) - { - super.createControl( parent ); - WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.REGISTERS_PREFERENCE_PAGE ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() - { - addField( new ColorFieldEditor( ICDebugPreferenceConstants.CHANGED_REGISTER_RGB, "&Changed register value color:", getFieldEditorParent() ) ); - createSpacer( getFieldEditorParent(), 2 ); - fAutoRefreshField = ControlFactory.createCheckBox( getFieldEditorParent(), "Auto-Refresh by default" ); - fAutoRefreshField.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - public static void initDefaults( IPreferenceStore store ) - { - PreferenceConverter.setDefault( store, - ICDebugPreferenceConstants.CHANGED_REGISTER_RGB, - new RGB( 255, 0, 0 ) ); - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH, true ); - } - - protected void createSpacer( Composite composite, int columnSpan ) - { - Label label = new Label( composite, SWT.NONE ); - GridData gd = new GridData(); - gd.horizontalSpan = columnSpan; - label.setLayoutData( gd ); - } - - /** - * @see IPreferencePage#performOk() - */ - public boolean performOk() - { - boolean ok = super.performOk(); - storeValues(); - CDebugUIPlugin.getDefault().savePluginPreferences(); - CDebugCorePlugin.getDefault().savePluginPreferences(); - return ok; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() - { - setDefaultValues(); - super.performDefaults(); - } - - private void setDefaultValues() - { - fAutoRefreshField.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH ) ); - } - - private void storeValues() - { - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH, fAutoRefreshField.getSelection() ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java deleted file mode 100644 index 2001f13fa85..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.preferences; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * Enter type comment. - * - * @since: Feb 7, 2003 - */ -public class SharedLibrariesViewPreferencePage extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage -{ - private Button fAutoRefreshField = null; - - /** - * Constructor for SharedLibrariesViewPreferencePage. - * @param style - */ - public SharedLibrariesViewPreferencePage() - { - super( GRID ); - setDescription( "Shared Libraries View Settings." ); - setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() - { - fAutoRefreshField = ControlFactory.createCheckBox( getFieldEditorParent(), "Auto-Refresh by default" ); - fAutoRefreshField.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) - { - super.createControl( parent ); - WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.SHARED_LIBRARIES_PREFERENCE_PAGE ); - } - - public static void initDefaults( IPreferenceStore store ) - { - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, true ); - } - - protected void createSpacer( Composite composite, int columnSpan ) - { - Label label = new Label( composite, SWT.NONE ); - GridData gd = new GridData(); - gd.horizontalSpan = columnSpan; - label.setLayoutData( gd ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() - { - boolean ok = super.performOk(); - storeValues(); - CDebugUIPlugin.getDefault().savePluginPreferences(); - CDebugCorePlugin.getDefault().savePluginPreferences(); - return ok; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() - { - setDefaultValues(); - super.performDefaults(); - } - - private void setDefaultValues() - { - fAutoRefreshField.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) ); - } - - private void storeValues() - { - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, fAutoRefreshField.getSelection() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#adjustGridLayout() - */ - protected void adjustGridLayout() - { - super.adjustGridLayout(); - // If there are no editor fields on this page set the number of columns to prevent stack overflow - if ( ((GridLayout)getFieldEditorParent().getLayout()).numColumns == 0 ) - ((GridLayout)getFieldEditorParent().getLayout()).numColumns = 2; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java deleted file mode 100644 index 5afc6f17181..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SourcePreferencePage.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.preferences; - -import java.util.Arrays; -import java.util.Observable; -import java.util.Observer; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.dialogfields.DialogField; -import org.eclipse.cdt.debug.internal.ui.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.debug.internal.ui.dialogfields.IListAdapter; -import org.eclipse.cdt.debug.internal.ui.dialogfields.LayoutUtil; -import org.eclipse.cdt.debug.internal.ui.dialogfields.SelectionButtonDialogField; -import org.eclipse.cdt.debug.internal.ui.wizards.AddSourceLocationWizard; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.sourcelookup.SourceListDialogField; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * Enter type comment. - * - * @since Oct 22, 2003 - */ -public class SourcePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Observer -{ - private SourceListDialogField fSourceListField; - private SelectionButtonDialogField fSearchForDuplicateFiles; - - private boolean fChanged = false; - - public SourcePreferencePage() - { - super(); - setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); - setDescription( "Common source lookup settings." ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) - */ - protected Control createContents( Composite parent ) - { - WorkbenchHelp.setHelp( getControl(), ICDebugHelpContextIds.SOURCE_PREFERENCE_PAGE ); - - fSourceListField = createSourceListField(); - fSearchForDuplicateFiles = createSearchForDuplicateFilesButton(); - - Composite control = new Composite( parent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = 5; - layout.marginHeight = 5; - control.setLayout( layout ); - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.horizontalAlignment = GridData.FILL; - control.setLayoutData( data ); - control.setFont( JFaceResources.getDialogFont() ); - - PixelConverter converter = new PixelConverter( control ); - - fSourceListField.doFillIntoGrid( control, 3 ); - LayoutUtil.setHorizontalSpan( fSourceListField.getLabelControl( null ), 2 ); - LayoutUtil.setWidthHint( fSourceListField.getLabelControl( null ), converter.convertWidthInCharsToPixels( 40 ) ); - LayoutUtil.setHorizontalGrabbing( fSourceListField.getListControl( null ) ); - fSearchForDuplicateFiles.doFillIntoGrid( control, 3 ); - - setValues(); - - return control; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - /* (non-Javadoc) - * @see java.util.Observer#update(java.util.Observable, java.lang.Object) - */ - public void update( Observable o, Object arg ) - { - setChanged( true ); - } - - private SourceListDialogField createSourceListField() - { - SourceListDialogField field = - new SourceListDialogField( "Source Locations", - new IListAdapter() - { - public void customButtonPressed( DialogField field, int index ) - { - sourceButtonPressed( index ); - } - - public void selectionChanged(DialogField field) - { - } - } ); - field.addObserver( this ); - return field; - } - - private SelectionButtonDialogField createSearchForDuplicateFilesButton() - { - SelectionButtonDialogField button = new SelectionButtonDialogField( SWT.CHECK ); - button.setLabelText( "Search for duplicate source files" ); - button.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - setChanged( true ); - } - } ); - return button; - } - - protected void sourceButtonPressed( int index ) - { - switch( index ) - { - case 0: // Add... - if ( addSourceLocation() ) - setChanged( true ); - break; - case 2: // Up - case 3: // Down - case 5: // Remove - setChanged( true ); - break; - } - } - - protected boolean isChanged() - { - return fChanged; - } - - protected void setChanged( boolean changed ) - { - fChanged = changed; - } - - private boolean addSourceLocation() - { - AddSourceLocationWizard wizard = new AddSourceLocationWizard( getSourceLocations() ); - WizardDialog dialog = new WizardDialog( getShell(), wizard ); - if ( dialog.open() == Window.OK ) - { - fSourceListField.addElement( wizard.getSourceLocation() ); - return true; - } - return false; - } - - public ICSourceLocation[] getSourceLocations() - { - return ( fSourceListField != null ) ? fSourceListField.getSourceLocations() : new ICSourceLocation[0]; - } - - public void setSourceLocations( ICSourceLocation[] locations ) - { - if ( fSourceListField != null ) - fSourceListField.setElements( Arrays.asList( locations ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() - { - setSourceLocations( new ICSourceLocation[0] ); - setSearchForDuplicateFiles( false ); - super.performDefaults(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() - { - storeValues(); - CDebugCorePlugin.getDefault().savePluginPreferences(); - return true; - } - - private boolean searchForDuplicateFiles() - { - return ( fSearchForDuplicateFiles != null ) ? fSearchForDuplicateFiles.isSelected() : false; - } - - private void setSearchForDuplicateFiles( boolean search ) - { - if ( fSearchForDuplicateFiles != null ) - fSearchForDuplicateFiles.setSelection( search ); - } - - private void setValues() - { - setSourceLocations( CDebugCorePlugin.getDefault().getCommonSourceLocations() ); - setSearchForDuplicateFiles( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) ); - } - - private void storeValues() - { - CDebugCorePlugin.getDefault().saveCommonSourceLocations( getSourceLocations() ); - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES, searchForDuplicateFiles() ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java deleted file mode 100644 index e347041e394..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.views; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.ui.AbstractDebugView; -import org.eclipse.jface.viewers.IBasicPropertyConstants; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableTreeViewer; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; - -/** - * - * Handles debug events, updating a view and viewer. - * - * @since Jul 23, 2002 - */ -public abstract class AbstractDebugEventHandler implements IDebugEventSetListener -{ - /** - * This event handler's view - */ - private AbstractDebugView fView; - - /** - * Constructs an event handler for the given view. - * - * @param view debug view - */ - public AbstractDebugEventHandler( AbstractDebugView view ) - { - setView( view ); - DebugPlugin plugin = DebugPlugin.getDefault(); - plugin.addDebugEventListener( this ); - } - - /** - * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[]) - */ - public void handleDebugEvents( final DebugEvent[] events ) - { - if ( !isAvailable() ) - { - return; - } - Runnable r = new Runnable() - { - public void run() - { - if ( isAvailable() ) - { - doHandleDebugEvents( events ); - } - } - }; - - getView().asyncExec( r ); - } - - /** - * Implementation specific handling of debug events. - * Subclasses should override. - */ - protected abstract void doHandleDebugEvents( DebugEvent[] events ); - - /** - * Helper method for inserting the given element - must be called in UI thread - */ - protected void insert( Object element ) - { - if ( isAvailable() ) - { - final Object parent = ((ITreeContentProvider)getTreeViewer().getContentProvider()).getParent( element ); - // a parent can be null for a debug target or process that has not yet been associated - // with a launch - if ( parent != null ) - { - getView().showViewer(); - getTreeViewer().add( parent, element ); - } - } - } - - /** - * Helper method to remove the given element - must be called in UI thread. - */ - protected void remove( Object element ) - { - if ( isAvailable() ) - { - getView().showViewer(); - getTreeViewer().remove( element ); - } - } - - /** - * Helper method to update the label of the given element - must be called in UI thread - */ - protected void labelChanged( Object element ) - { - if ( isAvailable() ) - { - getView().showViewer(); - getTreeViewer().update( element, - new String[] { IBasicPropertyConstants.P_TEXT } ); - } - } - - /** - * Refresh the given element in the viewer - must be called in UI thread. - */ - protected void refresh( Object element ) - { - if ( isAvailable() ) - { - getView().showViewer(); - getTreeViewer().refresh( element ); - } - } - - /** - * Refresh the viewer - must be called in UI thread. - */ - public void refresh() - { - if ( isAvailable() ) - { - getView().showViewer(); - getTreeViewer().refresh(); - } - } - - /** - * Helper method to select and reveal the given element - must be called in UI thread - */ - protected void selectAndReveal( Object element ) - { - if ( isAvailable() ) - { - getViewer().setSelection( new StructuredSelection( element ), true ); - } - } - - /** - * De-registers this event handler from the debug model. - */ - public void dispose() - { - DebugPlugin plugin = DebugPlugin.getDefault(); - plugin.removeDebugEventListener( this ); - } - - /** - * Returns the view this event handler is - * updating. - * - * @return debug view - */ - protected AbstractDebugView getView() - { - return fView; - } - - /** - * Sets the view this event handler is updating. - * - * @param view debug view - */ - private void setView( AbstractDebugView view ) - { - fView = view; - } - - /** - * Returns the viewer this event handler is updating. - * - * @return viewer - */ - protected Viewer getViewer() - { - return getView().getViewer(); - } - - /** - * Returns this event handler's viewer as a tree - * viewer or null if none. - * - * @return this event handler's viewer as a tree - * viewer or null if none - */ - protected TreeViewer getTreeViewer() - { - if ( getViewer() instanceof TreeViewer ) - { - return (TreeViewer)getViewer(); - } - return null; - } - - /** - * Returns this event handler's viewer as a table - * viewer or null if none. - * - * @return this event handler's viewer as a table - * viewer or null if none - */ - protected TableViewer getTableViewer() - { - if ( getViewer() instanceof TableViewer ) - { - return (TableViewer)getViewer(); - } - return null; - } - - /** - * Returns this event handler's viewer as a table tree - * viewer or null if none. - * - * @return this event handler's viewer as a table tree - * viewer or null if none - */ - protected TableTreeViewer getTableTreeViewer() - { - if ( getViewer() instanceof TableTreeViewer ) - { - return (TableTreeViewer)getViewer(); - } - return null; - } - - /** - * Returns whether this event handler's viewer is - * currently available. - * - * @return whether this event handler's viewer is - * currently available - */ - protected boolean isAvailable() - { - return getView().isAvailable(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandlerView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandlerView.java deleted file mode 100644 index 5f6049a7441..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandlerView.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views; - -import org.eclipse.debug.ui.AbstractDebugView; - -/** - * - * A debug view that uses an event handler to update its view/viewer. - * - * @since Jul 23, 2002 - */ -public abstract class AbstractDebugEventHandlerView extends AbstractDebugView -{ - /** - * Event handler for this view - */ - private AbstractDebugEventHandler fEventHandler; - - /** - * Sets the event handler for this view - * - * @param eventHandler event handler - */ - protected void setEventHandler( AbstractDebugEventHandler eventHandler ) - { - fEventHandler = eventHandler; - } - - /** - * Returns the event handler for this view - * - * @return The event handler for this view - */ - protected AbstractDebugEventHandler getEventHandler() - { - return fEventHandler; - } - - /** - * @see IWorkbenchPart#dispose() - */ - public void dispose() - { - super.dispose(); - if ( getEventHandler() != null ) - { - getEventHandler().dispose(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/IDebugExceptionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/IDebugExceptionHandler.java deleted file mode 100644 index a4a6ba8c1ea..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/IDebugExceptionHandler.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -package org.eclipse.cdt.debug.internal.ui.views; - -import org.eclipse.debug.core.DebugException; - -/** - * A plugable exception handler. - */ -public interface IDebugExceptionHandler -{ - /** - * Handles the given debug exception. - * - * @param e debug exception - */ - public abstract void handleException( DebugException e ); -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/ViewerState.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/ViewerState.java deleted file mode 100644 index 168bc3af53d..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/ViewerState.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.internal.ui.views; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TreeViewer; - -/** - * Memento of the expanded and selected items in a tree - * viewer for. - * - * @since 2.1 - */ -public class ViewerState { - - private Object[] fExpandedElements = null; - private ISelection fSelection = null; - - /** - * Constructs a memento for the given viewer. - */ - public ViewerState(TreeViewer viewer) { - saveState(viewer); - } - - /** - * Saves the current state of the given viewer into - * this memento. - * - * @param viewer viewer of which to save the state - */ - public void saveState(TreeViewer viewer) { - fExpandedElements = viewer.getExpandedElements(); - fSelection = viewer.getSelection(); - } - - /** - * Restores the state of the given viewer to this mementos - * saved state. - * - * @param viewer viewer to which state is restored - */ - public void restoreState(TreeViewer viewer) { - if (fExpandedElements != null) { - viewer.setExpandedElements(fExpandedElements); - } - if (fSelection != null) { - viewer.setSelection(fSelection); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java deleted file mode 100644 index b3bb3513fd6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.ICMemoryManager; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; -import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.TraverseEvent; -import org.eclipse.swt.events.TraverseListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * - * The tab content in the memory view. - * - * @since Jul 25, 2002 - */ -public class MemoryControlArea extends Composite implements ITextOperationTarget -{ - private MemoryView fMemoryView; - private MemoryPresentation fPresentation; - private int fIndex = 0; - private ICMemoryManager fMemoryManager = null; - - private Text fAddressText; - private Button fEvaluateButton; - private MemoryText fMemoryText; - - private int fFormat = ICMemoryManager.MEMORY_FORMAT_HEX; - private int fWordSize = ICMemoryManager.MEMORY_SIZE_BYTE; - private int fNumberOfRows = 40; - private int fNumberOfColumns = 16; - private char fPaddingChar = '.'; - - /** - * Constructor for MemoryControlArea. - * @param parent - * @param style - */ - public MemoryControlArea( Composite parent, int style, int index, MemoryView view ) - { - super( parent, style ); - fMemoryView = view; - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - GridData gridData = new GridData( GridData.FILL_BOTH | - GridData.GRAB_HORIZONTAL | - GridData.GRAB_VERTICAL ); - setLayout( layout ); - setLayoutData( gridData ); - setIndex( index ); - fPresentation = createPresentation(); - fAddressText = createAddressText( this ); - fMemoryText = createMemoryText( this, style, fPresentation ); - setDefaultPreferences(); - updateToolTipText(); - } - - private void setDefaultPreferences() - { - char[] paddingCharStr = CDebugUIPlugin.getDefault().getPreferenceStore().getString( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR ).toCharArray(); - setPaddingChar( ( paddingCharStr.length > 0 ) ? paddingCharStr[0] : '.' ); - fPresentation.setDisplayAscii( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII ) ); - } - - private MemoryPresentation createPresentation() - { - return new MemoryPresentation(); - } - - public MemoryPresentation getPresentation() - { - return fPresentation; - } - - private Text createAddressText( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout( 3, false ) ); - composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - // create label - Label label = new Label( composite, SWT.RIGHT ); - label.setText( "Address: " ); - label.pack(); - - // create address text - Text text = new Text( composite, SWT.BORDER ); - text.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - text.addTraverseListener( new TraverseListener() - { - public void keyTraversed( TraverseEvent e ) - { - if ( e.detail == SWT.TRAVERSE_RETURN && e.stateMask == 0 ) - { - e.doit = false; - handleAddressEnter(); - } - } - } ); - text.addFocusListener( new FocusListener() - { - public void focusGained( FocusEvent e ) - { - getMemoryView().updateObjects(); - } - - public void focusLost( FocusEvent e ) - { - getMemoryView().updateObjects(); - } - } ); - text.addModifyListener( new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - handleAddressModification(); - } - } ); - text.addKeyListener( new KeyListener() - { - public void keyPressed( KeyEvent e ) - { - getMemoryView().updateObjects(); - } - - public void keyReleased( KeyEvent e ) - { - getMemoryView().updateObjects(); - } - } ); - text.addMouseListener( new MouseListener() - { - public void mouseDoubleClick( MouseEvent e ) - { - getMemoryView().updateObjects(); - } - - public void mouseDown( MouseEvent e ) - { - getMemoryView().updateObjects(); - } - - public void mouseUp( MouseEvent e ) - { - getMemoryView().updateObjects(); - } - } ); - - fEvaluateButton = new Button( composite, SWT.PUSH ); - fEvaluateButton.setText( "Evaluate" ); - fEvaluateButton.setToolTipText( "Evaluate expression to address" ); - fEvaluateButton.addSelectionListener( new SelectionAdapter() - { - public void widgetSelected( SelectionEvent e ) - { - evaluateAddressExpression(); - } - } ); - return text; - } - - private MemoryText createMemoryText( Composite parent, - int styles, - MemoryPresentation presentation ) - { - return new MemoryText( parent, SWT.BORDER | SWT.HIDE_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL, presentation ); - } - - protected void handleAddressEnter() - { - if ( getMemoryManager() != null ) - { - String address = fAddressText.getText().trim(); - try - { - removeBlock(); - if ( address.length() > 0 ) - { - createBlock( address ); - } - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to get memory block.", e.getStatus() ); - } - refresh(); - getMemoryView().updateObjects(); - } - } - - public void propertyChange( PropertyChangeEvent event ) - { - if ( event.getProperty().equals( ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB ) ) - { - fMemoryText.setBackgroundColor(); - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB ) ) - { - fMemoryText.setForegroundColor(); - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.MEMORY_FONT ) ) - { - fMemoryText.changeFont(); - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.MEMORY_ADDRESS_RGB ) ) - { - fMemoryText.setAddressColor(); - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.MEMORY_CHANGED_RGB ) ) - { - fMemoryText.setChangedColor(); - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.MEMORY_DIRTY_RGB ) ) - { - fMemoryText.setDirtyColor(); - } - else if ( event.getProperty().equals( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR ) ) - { - String paddingCharString = (String)event.getNewValue(); - setPaddingChar( ( paddingCharString.length() > 0 ) ? paddingCharString.charAt( 0 ) : '.' ); - refresh(); - } - } - - public void setInput( Object input ) - { - setMemoryManager( ( input instanceof ICMemoryManager ) ? (ICMemoryManager)input : null ); - getPresentation().setMemoryBlock( getMemoryBlock() ); - setState(); - refresh(); - } - - protected void refresh() - { - fAddressText.setText( ( getPresentation() != null ) ? getPresentation().getAddressExpression() : "" ); - fMemoryText.refresh(); - getMemoryView().updateObjects(); - updateToolTipText(); - } - - protected void setMemoryManager( ICMemoryManager mm ) - { - fMemoryManager = mm; - } - - protected ICMemoryManager getMemoryManager() - { - return fMemoryManager; - } - - protected IFormattedMemoryBlock getMemoryBlock() - { - return ( getMemoryManager() != null ) ? getMemoryManager().getBlock( getIndex() ) : null; - } - - protected int getIndex() - { - return fIndex; - } - - protected void setIndex( int index ) - { - fIndex = index; - } - - private void createBlock( String address ) throws DebugException - { - if ( getMemoryManager() != null ) - { - getMemoryManager().setBlockAt( getIndex(), - CDebugModel.createFormattedMemoryBlock( (IDebugTarget)getMemoryManager().getAdapter( IDebugTarget.class ), - address, - getFormat(), - getWordSize(), - getNumberOfRows(), - getNumberOfColumns(), - getPaddingChar() ) ); - getMemoryBlock().setFrozen( !CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH ) ); - getPresentation().setMemoryBlock( getMemoryBlock() ); - } - setMemoryTextState(); - updateToolTipText(); - } - - private void removeBlock() throws DebugException - { - if ( getMemoryManager() != null ) - { - getMemoryManager().removeBlock( getIndex() ); - getPresentation().setMemoryBlock( null ); - } - setMemoryTextState(); - updateToolTipText(); - } - - public int getFormat() - { - return fFormat; - } - - public int getNumberOfColumns() - { - return fNumberOfColumns; - } - - public int getNumberOfRows() - { - return fNumberOfRows; - } - - public char getPaddingChar() - { - return fPaddingChar; - } - - public int getWordSize() - { - return fWordSize; - } - - public void setFormat(int format) - { - fFormat = format; - } - - public void setNumberOfColumns( int numberOfColumns ) - { - fNumberOfColumns = numberOfColumns; - } - - public void setNumberOfRows( int numberOfRows ) - { - fNumberOfRows = numberOfRows; - } - - public void setPaddingChar( char paddingChar ) - { - fPaddingChar = paddingChar; - if ( getMemoryBlock() != null ) - { - try - { - getMemoryBlock().reformat( getMemoryBlock().getFormat(), - getMemoryBlock().getWordSize(), - getMemoryBlock().getNumberOfRows(), - getMemoryBlock().getNumberOfColumns(), - fPaddingChar ); - } - catch( DebugException e ) - { - // ignore - } - } - } - - public void setWordSize( int wordSize ) - { - fWordSize = wordSize; - } - - private void enableAddressText( boolean enable ) - { - fAddressText.setEnabled( enable ); - } - - protected void setState() - { - enableAddressText( getMemoryManager() != null ); - setMemoryTextState(); - } - - private void setMemoryTextState() - { - fMemoryText.setEditable( getMemoryManager() != null && getMemoryBlock() != null ); - } - - protected MemoryText getMemoryText() - { - return fMemoryText; - } - - protected void clear() - { - fAddressText.setText( "" ); - handleAddressEnter(); - updateToolTipText(); - } - - /** - * @see org.eclipse.swt.widgets.Widget#dispose() - */ - public void dispose() - { - if ( getPresentation() != null ) - { - getPresentation().dispose(); - } - super.dispose(); - } - - protected String getTitle() - { - if ( getParent() instanceof CTabFolder ) - { - CTabItem[] tabItems = ((CTabFolder)getParent()).getItems(); - return tabItems[fIndex].getText(); - } - return ""; - } - - protected void setTitle( String title ) - { - if ( getParent() instanceof CTabFolder ) - { - CTabItem[] tabItems = ((CTabFolder)getParent()).getItems(); - tabItems[fIndex].setText( title ); - } - } - - protected void setTabItemToolTipText( String text ) - { - String newText = replaceMnemonicCharacters( text ); - if ( getParent() instanceof CTabFolder ) - { - CTabItem[] tabItems = ((CTabFolder)getParent()).getItems(); - tabItems[fIndex].setToolTipText( "Memory View " + (fIndex + 1) + ( ( newText.length() > 0 ) ? ( ": " + newText ) : "" ) ); - } - } - - protected void refreshMemoryBlock() - { - if ( getMemoryBlock() != null ) - { - try - { - getMemoryBlock().refresh(); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to refresh memory.", e.getStatus() ); - } - } - } - - private void updateToolTipText() - { - setTabItemToolTipText( fAddressText.getText().trim() ); - } - - private String replaceMnemonicCharacters( String text ) - { - StringBuffer sb = new StringBuffer( text.length() ); - for ( int i = 0; i < text.length(); ++i ) - { - char ch = text.charAt( i ); - sb.append( ch ); - if ( ch == '&' ) - { - sb.append( ch ); - } - } - return sb.toString(); - } - - protected void handleAddressModification() - { - fEvaluateButton.setEnabled( fAddressText.getText().trim().length() > 0 ); - } - - protected void evaluateAddressExpression() - { - if ( getMemoryManager() != null ) - { - if ( getMemoryBlock() == null ) - { - String expression = fAddressText.getText().trim(); - try - { - removeBlock(); - if ( expression.length() > 0 ) - { - createBlock( expression ); - } - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( "Unable to get memory block.", e.getStatus() ); - } - } - if ( getMemoryBlock() != null ) - { - fAddressText.setText( CDebugUIUtils.toHexAddressString( getMemoryBlock().getStartAddress() ) ); - handleAddressEnter(); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.ITextOperationTarget#canDoOperation(int) - */ - public boolean canDoOperation( int operation ) - { - switch( operation ) - { - case CUT: - case COPY: - return ( fAddressText != null && fAddressText.isFocusControl() && fAddressText.isEnabled() && fAddressText.getSelectionCount() > 0 ); - case PASTE: - case SELECT_ALL: - return ( fAddressText != null && fAddressText.isFocusControl() && fAddressText.isEnabled() ); - } - - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.ITextOperationTarget#doOperation(int) - */ - public void doOperation( int operation ) - { - switch( operation ) - { - case CUT: - fAddressText.cut(); - break; - case COPY: - fAddressText.copy(); - break; - case PASTE: - fAddressText.paste(); - break; - case SELECT_ALL: - fAddressText.selectAll(); - break; - } - } - - protected MemoryView getMemoryView() - { - return fMemoryView; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java deleted file mode 100644 index d6bb6fd5f83..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java +++ /dev/null @@ -1,535 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICMemoryManager; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlockRow; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; -import org.eclipse.debug.core.DebugException; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Display; - -/** - * - * Provides rendering methods to the MemoryText widget. - * - * @since Jul 25, 2002 - */ -public class MemoryPresentation -{ - private static final int INTERVAL_BETWEEN_ADDRESS_AND_DATA = 2; - private static final int INTERVAL_BETWEEN_DATA_ITEMS = 1; - private static final int INTERVAL_BETWEEN_DATA_AND_ASCII = 1; - - private IFormattedMemoryBlock fBlock; - - private List fAddressZones; - private List fChangedZones; - - private boolean fDisplayAscii = true; - - /** - * Constructor for MemoryPresentation. - */ - public MemoryPresentation() - { - fAddressZones = new LinkedList(); - fChangedZones = new LinkedList(); - } - - public IFormattedMemoryBlock getMemoryBlock() - { - return fBlock; - } - - public void setMemoryBlock( IFormattedMemoryBlock block ) - { - fBlock = block; - } - - /** - * Returns the string that contains the textual representation of - * the memory according to this presentation. - * - * @return the string that contains the textual representation of the memory - */ - public String getText() - { - fAddressZones.clear(); - IFormattedMemoryBlockRow[] rows = ( getMemoryBlock() != null ) ? getMemoryBlock().getRows() : new IFormattedMemoryBlockRow[0]; - StringBuffer sb = new StringBuffer(); - for ( int i = 0; i < rows.length; ++i ) - { - int offset = sb.length(); - sb.append( getRowText( rows[i] ) ); - fAddressZones.add( new Point( offset, offset + getAddressLength() ) ); - } - return sb.toString(); - } - - public String[] getText( Point[] zones ) - { - return new String[0]; - } - - public boolean isAcceptable( char ch, int offset ) - { - if ( isInAsciiArea( offset ) ) - return true; - if ( isInDataArea( offset ) ) - return isValidValue( ch ); - return false; - } - - public Point[] getAddressZones() - { - return (Point[])fAddressZones.toArray( new Point[fAddressZones.size()] ); - } - - public Point[] getChangedZones() - { - fChangedZones.clear(); - Long[] changedAddresses = getChangedAddresses(); - for ( int i = 0; i < changedAddresses.length; ++i ) - { - int dataOffset = getDataItemOffsetByAddress( changedAddresses[i] ); - if ( dataOffset != -1 ) - { - fChangedZones.add( new Point( dataOffset, dataOffset + getDataItemLength() - 1 ) ); - } - if ( displayASCII() ) - { - int asciiOffset = getAsciiOffsetByAddress( changedAddresses[i] ); - if ( asciiOffset != -1 ) - { - fChangedZones.add( new Point( asciiOffset, asciiOffset ) ); - } - } - } - return (Point[])fChangedZones.toArray( new Point[fChangedZones.size()] ); - } - - public String getStartAddress() - { - return ( fBlock != null ) ? getAddressString( fBlock.getStartAddress() ) : ""; - } - - public String getAddressExpression() - { - return ( fBlock != null ) ? fBlock.getAddressExpression() : ""; - } - - private String getInterval( int length ) - { - char[] chars = new char[length]; - Arrays.fill( chars, ' ' ); - return new String( chars ); - } - - private String getAddressString( long address ) - { - return CDebugUIUtils.toHexAddressString( address ); - } - - private String getRowText( IFormattedMemoryBlockRow row ) - { - StringBuffer result = new StringBuffer( getRowLength() ); - result.append( getAddressString( row.getAddress() ) ); - result.append( getInterval( INTERVAL_BETWEEN_ADDRESS_AND_DATA ) ); - String[] items = row.getData(); - for ( int i = 0; i < items.length; ++i ) - { - result.append( getDataItemPresentation( items[i] ) ); - result.append( getInterval( INTERVAL_BETWEEN_DATA_ITEMS ) ); - } - if ( displayASCII() ) - { - result.append( getInterval( INTERVAL_BETWEEN_DATA_AND_ASCII ) ); - result.append( row.getASCII() ); - } - result.append( '\n' ); - return result.toString(); - } - - private int getRowLength() - { - return getAddressLength() + - INTERVAL_BETWEEN_ADDRESS_AND_DATA + - (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) * getNumberOfDataItemsInRow() + - ( ( displayASCII() ) ? INTERVAL_BETWEEN_DATA_AND_ASCII + - getDataBytesPerRow() : 0 ) + 1; - } - - private int getAddressLength() - { - return 10; - } - - private boolean isInAsciiArea( int offset ) - { - if ( displayASCII() && getRowLength() != 0 ) - { - int pos = offset % getRowLength(); - int asciiColumn = getAddressLength() + - INTERVAL_BETWEEN_ADDRESS_AND_DATA + - (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS ) * getNumberOfDataItemsInRow() + - INTERVAL_BETWEEN_DATA_AND_ASCII; - return ( pos >= asciiColumn && pos < getRowLength() - 1 ); - } - return false; - } - - private boolean isInDataArea( int offset ) - { - if ( getRowLength() != 0 ) - { - int pos = offset % getRowLength(); - int dataBegin = getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA; - int dataEnd = dataBegin + ((getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS ) * getNumberOfDataItemsInRow()); - if ( pos >= dataBegin && pos < dataEnd ) - return isInDataItem( pos - dataBegin ); - } - return false; - } - - private boolean isInDataItem( int pos ) - { - for ( int i = 0; i < getNumberOfDataItemsInRow(); ++i ) - { - if ( pos < i * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) ) - return false; - if ( pos >= i * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) && - pos < (i * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + getDataItemLength() ) - return true; - } - return false; - } - - private int getDataItemLength() - { - if ( getMemoryBlock() != null ) - { - switch( getDataFormat() ) - { - case IFormattedMemoryBlock.MEMORY_FORMAT_HEX: - return getMemoryBlock().getWordSize() * 2; - case IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL: - return getDecimalDataItemLength( getMemoryBlock().getWordSize(), true ); - case IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL: - return getDecimalDataItemLength( getMemoryBlock().getWordSize(), false ); - } - } - return 0; - } - - private int getNumberOfDataItemsInRow() - { - if ( getMemoryBlock() != null ) - return getMemoryBlock().getNumberOfColumns(); - return 0; - } - - protected boolean displayASCII() - { - if ( canDisplayAscii() ) - return fDisplayAscii; - return false; - } - - protected void setDisplayAscii( boolean displayAscii ) - { - fDisplayAscii = displayAscii; - } - - private int getDataBytesPerRow() - { - if ( getMemoryBlock() != null ) - return getMemoryBlock().getNumberOfColumns() * getMemoryBlock().getWordSize(); - return 0; - } - - private boolean isValidValue( char ch ) - { - switch( getDataFormat() ) - { - case ICMemoryManager.MEMORY_FORMAT_HEX: - return isHexadecimal( ch ); - case ICMemoryManager.MEMORY_FORMAT_BINARY: - case ICMemoryManager.MEMORY_FORMAT_OCTAL: - case ICMemoryManager.MEMORY_FORMAT_SIGNED_DECIMAL: - case ICMemoryManager.MEMORY_FORMAT_UNSIGNED_DECIMAL: - case -1: - default: - return false; - } - } - - private boolean isHexadecimal( char ch ) - { - return ( Character.isDigit( ch ) || - ( ch >= 'a' && ch <= 'f' ) || - ( ch >= 'A' && ch <= 'F' ) ); - } - - private int getDataFormat() - { - if ( getMemoryBlock() != null ) - return getMemoryBlock().getFormat(); - return IFormattedMemoryBlock.MEMORY_FORMAT_HEX; - } - - private Long[] getChangedAddresses() - { - return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new Long[0]; - } - - private int getDataItemOffsetByAddress( Long address ) - { - if ( getMemoryBlock() != null ) - { - IFormattedMemoryBlockRow[] rows = getMemoryBlock().getRows(); - for ( int i = 0; i < rows.length; ++i ) - { - int wordSize = getMemoryBlock().getWordSize(); - int numberOfColumns = getMemoryBlock().getNumberOfColumns(); - if ( address.longValue() >= rows[i].getAddress() && - address.longValue() < rows[i].getAddress() + (wordSize * numberOfColumns) ) - { - for ( int j = 1; j <= numberOfColumns; ++j ) - { - if ( address.longValue() >= rows[i].getAddress() + ((j - 1) * wordSize) && - address.longValue() < rows[i].getAddress() + (j * wordSize) ) - { - return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA; - } - } - } - } - - } - return -1; - } - - private int getAsciiOffsetByAddress( Long address ) - { - if ( getMemoryBlock() != null ) - { - IFormattedMemoryBlockRow[] rows = getMemoryBlock().getRows(); - if ( rows.length > 0 ) - { - IFormattedMemoryBlockRow firstRow = rows[0]; - IFormattedMemoryBlockRow lastRow = rows[rows.length - 1]; - if ( address.longValue() >= firstRow.getAddress() && address.longValue() <= lastRow.getAddress() ) - { - int asciiOffset = (int)(address.longValue() - firstRow.getAddress()); - int asciiRowlength = getMemoryBlock().getWordSize() * getMemoryBlock().getNumberOfColumns(); - int numberOfRows = asciiOffset / asciiRowlength; - int offsetInRow = asciiOffset % asciiRowlength; - return (numberOfRows * getRowLength()) + - getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA + - (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) * getMemoryBlock().getNumberOfColumns() + - INTERVAL_BETWEEN_DATA_AND_ASCII + offsetInRow; - } - } - } - return -1; - } - - protected boolean canDisplayAscii() - { - if ( getMemoryBlock() != null ) - return getMemoryBlock().displayASCII(); - return false; - } - - protected int getDataItemIndex( int offset ) - { - int row = offset / getRowLength(); - int pos = offset % getRowLength() - getAddressLength() - INTERVAL_BETWEEN_ADDRESS_AND_DATA; - for ( int i = 0; i < getNumberOfDataItemsInRow(); ++i ) - { - if ( pos < i * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) ) - return -1; - if ( pos >= i * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) && - pos < (i * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + getDataItemLength() ) - return i + (row * getNumberOfDataItemsInRow()); - } - if ( displayASCII() && pos >= getNumberOfDataItemsInRow() * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) + INTERVAL_BETWEEN_DATA_AND_ASCII ) - { - return ((pos - ((getNumberOfDataItemsInRow() * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) + INTERVAL_BETWEEN_DATA_AND_ASCII))) * 2 / getDataItemLength()) + row * getNumberOfDataItemsInRow(); - } - return -1; - } - - private int getDataItemOffset( int index ) - { - int row = index / getNumberOfDataItemsInRow(); - int pos = index % getNumberOfDataItemsInRow(); - return row * getRowLength() + - getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA + - pos * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS); - } - - private char[] getDataItemChars( int index ) - { - if ( getMemoryBlock() != null ) - { - int rowNumber = index / getMemoryBlock().getNumberOfColumns(); - int pos = index % getMemoryBlock().getNumberOfColumns(); - IFormattedMemoryBlockRow[] rows = getMemoryBlock().getRows(); - if ( rowNumber < rows.length ) - { - String[] data = rows[rowNumber].getData(); - if ( pos < data.length ) - { - return data[pos].toCharArray(); - } - } - } - return new char[0]; - } - - private int getOffsetInDataItem( int offset, int index ) - { - if ( isInDataArea( offset ) ) - { - return offset - getDataItemOffset( index ); - } - return -1; - } - - public void dispose() - { - if ( fAddressZones != null ) - { - fAddressZones.clear(); - } - if ( fChangedZones != null ) - { - fChangedZones.clear(); - } - } - - private String getDataItemPresentation( String item ) - { - switch( getDataFormat() ) - { - case IFormattedMemoryBlock.MEMORY_FORMAT_HEX: - return item; - case IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL: - return convertToDecimal( getWordSize(), item, true ); - case IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL: - return convertToDecimal( getWordSize(), item, false ); - } - return ""; - } - - private int getDecimalDataItemLength( int wordSize, boolean signed ) - { - switch( wordSize ) - { - case IFormattedMemoryBlock.MEMORY_SIZE_BYTE: - return ( signed ) ? 4 : 3; - case IFormattedMemoryBlock.MEMORY_SIZE_HALF_WORD: - return ( signed ) ? 6 : 5; - case IFormattedMemoryBlock.MEMORY_SIZE_WORD: - return ( signed ) ? 11 : 10; - } - return 0; - } - - private int getWordSize() - { - if ( getMemoryBlock() != null ) - { - return getMemoryBlock().getWordSize(); - } - return 0; - } - - private String convertToDecimal( int wordSize, String item, boolean signed ) - { - String result = ""; - boolean le = getMemoryBlock().isLittleEndian(); - switch( wordSize ) - { - case IFormattedMemoryBlock.MEMORY_SIZE_BYTE: - result = Long.toString( ( signed ) ? CDebugUtils.toByte( item.toCharArray(), le ) : CDebugUtils.toUnsignedByte( item.toCharArray(), le ) ); - break; - case IFormattedMemoryBlock.MEMORY_SIZE_HALF_WORD: - result = Long.toString( ( signed ) ? CDebugUtils.toShort( item.toCharArray(), le ) : CDebugUtils.toUnsignedShort( item.toCharArray(), le ) ); - break; - case IFormattedMemoryBlock.MEMORY_SIZE_WORD: - result = Long.toString( ( signed ) ? CDebugUtils.toInt( item.toCharArray(), le ) : CDebugUtils.toUnsignedInt( item.toCharArray(), le ) ); - break; - } - return CDebugUtils.prependString( result, getDataItemLength(), ' ' ); - } - - protected boolean isStartAddressChanged() - { - if ( getMemoryBlock() != null ) - { - return getMemoryBlock().isStartAddressChanged(); - } - return false; - } - - protected String getNewItemValue( int offset, char newChar ) - { - if ( getMemoryBlock() != null ) - { - int index = getDataItemIndex( offset ); - if ( index != -1 ) - { - char[] chars = getDataItemChars( index ); - if ( isInDataArea( offset ) ) - { - int charIndex = getOffsetInDataItem( offset, index ); - chars[charIndex] = newChar; - } - if ( isInAsciiArea( offset ) ) - { - chars = CDebugUtils.getByteText( (byte)newChar ); - } - return new String( chars ); - } - } - return null; - } - - protected void setItemValue( int offset, char ch ) - { - if ( getMemoryBlock() != null ) - { - int index = getDataItemIndex( offset ); - if ( index != -1 ) - { - String newValue = getNewItemValue( offset, ch ); - if ( newValue != null ) - { - try - { - getMemoryBlock().setItemValue( index, newValue ); - return; - } - catch( DebugException e ) - { - Display.getDefault().beep(); - } - } - } - } - Display.getDefault().beep(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryText.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryText.java deleted file mode 100644 index 31b67489a50..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryText.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ExtendedModifyEvent; -import org.eclipse.swt.custom.ExtendedModifyListener; -import org.eclipse.swt.custom.StyleRange; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.custom.VerifyKeyListener; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * - * A widget that displays the textual content of the memory block. - * - * @since Jul 25, 2002 - */ -public class MemoryText -{ - private StyledText fText = null; - private MemoryPresentation fPresentation = null; - private boolean fUpdating = false; - - /** - * Constructor for MemoryText. - * - * @param parent - * @param style - */ - public MemoryText( Composite parent, - int style, - MemoryPresentation presentation ) - { - fText = new StyledText( parent, style ); - fText.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - fPresentation = presentation; - initialize(); - } - - private void initialize() - { - // Switch to overwrite mode - fText.invokeAction( SWT.INSERT ); - // Unmap INSERT key action to preserve the overwrite mode - fText.setKeyBinding( SWT.INSERT, SWT.NULL ); - - fText.addExtendedModifyListener( - new ExtendedModifyListener() - { - public void modifyText( ExtendedModifyEvent e ) - { - handleExtendedModify( e ); - } - } ); - - fText.addVerifyKeyListener( - new VerifyKeyListener() - { - public void verifyKey( VerifyEvent e ) - { - handleVerifyKey( e ); - } - } ); - refresh(); - } - - protected void handleExtendedModify( ExtendedModifyEvent event ) - { - if ( fUpdating ) - return; - if ( event.length != 1 ) - return; - int caretOffset = fText.getCaretOffset(); - fText.getCaret().setVisible( false ); - char ch = fText.getText().charAt( event.start ); - restoreText( event.start, event.length, event.replacedText ); - fPresentation.setItemValue( event.start, ch ); - fText.setCaretOffset( caretOffset ); - fText.getCaret().setVisible( true ); - } - - public void refresh() - { - int offset = fText.getCaretOffset(); - fText.getCaret().setVisible( false ); - fText.setFont( new Font( fText.getDisplay(), getFontData() ) ); - fText.setBackground( getBackgroundColor() ); - fText.setForeground( getForegroundColor() ); - fText.setText( fPresentation.getText() ); - Point[] zones = fPresentation.getChangedZones(); - for ( int i = 0; i < zones.length; ++i ) - { - fText.setStyleRange( new StyleRange( zones[i].x, - zones[i].y - zones[i].x + 1, - getChangedColor(), - getBackgroundColor() ) ); - - } - zones = fPresentation.getAddressZones(); - boolean isStartAddressChanged = fPresentation.isStartAddressChanged(); - for ( int i = 0; i < zones.length; ++i ) - { - fText.setStyleRange( new StyleRange( zones[i].x, - zones[i].y - zones[i].x + 1, - ( isStartAddressChanged ) ? getChangedColor() : getAddressColor(), - getBackgroundColor() ) ); - } - fText.redraw(); - fText.setCaretOffset( offset ); - fText.getCaret().setVisible( true ); - } - - protected void handleVerifyKey( VerifyEvent event ) - { - if ( event.character == SWT.LF || - event.character == SWT.CR || - event.character == SWT.BS || - event.character == SWT.DEL ) - { - event.doit = false; - return; - } - if ( Character.isISOControl( event.character ) ) - return; - if ( getSelectionCount() != 0 ) - { - event.doit = false; - return; - } - if ( !fPresentation.isAcceptable( event.character, fText.getCaretOffset() ) ) - event.doit = false; - } - - private FontData getFontData() - { - IPreferenceStore pstore = CDebugUIPlugin.getDefault().getPreferenceStore(); - FontData fontData = PreferenceConverter.getFontData( pstore, ICDebugPreferenceConstants.MEMORY_FONT ); - return fontData; - } - - private Color getForegroundColor() - { - return CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB ); - } - - private Color getBackgroundColor() - { - return CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB ); - } - - private Color getAddressColor() - { - return CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.MEMORY_ADDRESS_RGB ); - } - - private Color getChangedColor() - { - return CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.MEMORY_CHANGED_RGB ); - } - - public void changeFont() - { - Font oldFont = fText.getFont(); - fText.setFont( new Font( fText.getDisplay(), getFontData() ) ); - oldFont.dispose(); - } - - public void setForegroundColor() - { - fText.setForeground( CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB ) ); - } - - public void setBackgroundColor() - { - fText.setBackground( CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB ) ); - } - - public void setChangedColor() - { - Point[] zones = fPresentation.getChangedZones(); - for ( int i = 0; i < zones.length; ++i ) - { - fText.setStyleRange( new StyleRange( zones[i].x, - zones[i].y - zones[i].x + 1, - getChangedColor(), - getBackgroundColor() ) ); - } - } - - public void setAddressColor() - { - Point[] zones = fPresentation.getAddressZones(); - for ( int i = 0; i < zones.length; ++i ) - { - fText.setStyleRange( new StyleRange( zones[i].x, - zones[i].y - zones[i].x + 1, - getAddressColor(), - getBackgroundColor() ) ); - } - } - - public void setDirtyColor() - { -/* - Point[] zones = fPresentation.getDirtyZones(); - for ( int i = 0; i < zones.length; ++i ) - { - fText.setStyleRange( new StyleRange( zones[i].x, - zones[i].y - zones[i].x + 1, - getDirtyColor(), - getBackgroundColor() ) ); - } -*/ - } - - protected void setEditable( boolean editable ) - { - fText.setEditable( editable ); - } - - protected int getSelectionCount() - { - return fText.getSelectionCount(); - } - - protected Control getControl() - { - return fText; - } -/* - protected void update( TextReplacement[] trs ) - { - fUpdating = true; - for ( int i = 0; i < trs.length; ++i ) - { - fText.replaceTextRange( trs[i].getStart(), - trs[i].getText().length(), - trs[i].getText() ); - fText.setStyleRange( new StyleRange( trs[i].getStart(), - trs[i].getText().length(), - getDirtyColor(), - getBackgroundColor() ) ); - fText.redrawRange( trs[i].getStart(), trs[i].getText().length(), false ); - } - saveChanges(); - fUpdating = false; - updateTitle(); - } -*/ - private void restoreText( int start, int length, String text ) - { - fUpdating = true; - fText.replaceTextRange( start, length, text ); - fUpdating = false; - } -/* - private void updateTitle() - { - if ( fText.getParent() instanceof MemoryControlArea ) - { - String title = ((MemoryControlArea)fText.getParent()).getTitle(); - if ( title.charAt( 0 ) == '*' ) - { - title = title.substring( 1 ); - } - if ( fPresentation.isDirty() ) - { - title = '*' + title; - } - ((MemoryControlArea)fText.getParent()).setTitle( title ); - } - } - - private void saveChanges() - { - if ( fText.getParent() instanceof MemoryControlArea ) - { - ((MemoryControlArea)fText.getParent()).saveChanges(); - } - } -*/ -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java deleted file mode 100644 index 8ee8c55185f..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryView.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.cdt.debug.core.ICMemoryManager; -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.actions.AutoRefreshMemoryAction; -import org.eclipse.cdt.debug.internal.ui.actions.ClearMemoryAction; -import org.eclipse.cdt.debug.internal.ui.actions.MemoryActionSelectionGroup; -import org.eclipse.cdt.debug.internal.ui.actions.MemoryFormatAction; -import org.eclipse.cdt.debug.internal.ui.actions.MemoryNumberOfColumnAction; -import org.eclipse.cdt.debug.internal.ui.actions.MemorySizeAction; -import org.eclipse.cdt.debug.internal.ui.actions.RefreshMemoryAction; -import org.eclipse.cdt.debug.internal.ui.actions.ShowAsciiAction; -import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * - * This view shows the content of the memory blocks associated - * with the selected debug target. - * - * @since Jul 24, 2002 - */ -public class MemoryView extends AbstractDebugEventHandlerView - implements ISelectionListener, - IPropertyChangeListener, - IDebugExceptionHandler -{ - private IDebugModelPresentation fModelPresentation = null; - private MemoryActionSelectionGroup fMemoryFormatGroup = null; - private MemoryActionSelectionGroup fMemorySizeGroup = null; - private MemoryActionSelectionGroup fMemoryNumberOfColumnsGroup = null; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite) - */ - protected Viewer createViewer( Composite parent ) - { - CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); - final MemoryViewer viewer = new MemoryViewer( parent, this ); - viewer.setContentProvider( createContentProvider() ); - viewer.setLabelProvider( getModelPresentation() ); - - getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - setEventHandler( createEventHandler( viewer ) ); - - return viewer; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createActions() - */ - protected void createActions() - { - IAction action = null; - - action = new MemoryViewAction( this, ITextOperationTarget.CUT ); - action.setText( "Cut" ); - action.setToolTipText( "Cut" ); - action.setDescription( "Cut" ); - setGlobalAction( ITextEditorActionConstants.CUT, (MemoryViewAction)action ); - - action = new MemoryViewAction( this, ITextOperationTarget.COPY ); - action.setText( "Copy" ); - action.setToolTipText( "Copy" ); - action.setDescription( "Copy" ); - setGlobalAction( ITextEditorActionConstants.COPY, (MemoryViewAction)action ); - - action = new MemoryViewAction( this, ITextOperationTarget.PASTE ); - action.setText( "Paste" ); - action.setToolTipText( "Paste" ); - action.setDescription( "Paste" ); - setGlobalAction( ITextEditorActionConstants.PASTE, (MemoryViewAction)action ); - - action = new MemoryViewAction( this, ITextOperationTarget.SELECT_ALL ); - action.setText( "Select All" ); - action.setToolTipText( "Select All" ); - action.setDescription( "Select All" ); - setGlobalAction( ITextEditorActionConstants.SELECT_ALL, (MemoryViewAction)action ); - - action = new RefreshMemoryAction( (MemoryViewer)getViewer() ); - action.setEnabled( false ); - setAction( "RefreshMemory", action ); //$NON-NLS-1$ - add( (RefreshMemoryAction)action ); - - action = new AutoRefreshMemoryAction( (MemoryViewer)getViewer() ); - action.setEnabled( false ); - action.setChecked( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH ) ); - setAction( "AutoRefreshMemory", action ); //$NON-NLS-1$ - add( (AutoRefreshMemoryAction)action ); - - action = new ClearMemoryAction( (MemoryViewer)getViewer() ); - action.setEnabled( false ); - setAction( "ClearMemory", action ); //$NON-NLS-1$ - add( (ClearMemoryAction)action ); - - action = new ShowAsciiAction( (MemoryViewer)getViewer() ); - action.setEnabled( false ); - action.setChecked( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII ) ); - setAction( "ShowAscii", action ); //$NON-NLS-1$ - add( (ShowAsciiAction)action ); - - fMemoryFormatGroup = new MemoryActionSelectionGroup(); - createFormatActionGroup( fMemoryFormatGroup ); - - fMemorySizeGroup = new MemoryActionSelectionGroup(); - createSizeActionGroup( fMemorySizeGroup ); - - fMemoryNumberOfColumnsGroup = new MemoryActionSelectionGroup(); - createNumberOfColumnsActionGroup( fMemoryNumberOfColumnsGroup ); - - // set initial content here, as viewer has to be set - setInitialContent(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() - */ - protected String getHelpContextId() - { - return ICDebugHelpContextIds.MEMORY_VIEW; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(IMenuManager) - */ - protected void fillContextMenu( IMenuManager menu ) - { - menu.add( new Separator( ICDebugUIConstants.EMPTY_MEMORY_GROUP ) ); - menu.add( new Separator( ICDebugUIConstants.MEMORY_GROUP ) ); - - menu.add( new Separator( ICDebugUIConstants.EMPTY_FORMAT_GROUP ) ); - menu.add( new Separator( ICDebugUIConstants.FORMAT_GROUP ) ); - - menu.add( new Separator( IDebugUIConstants.EMPTY_RENDER_GROUP ) ); - menu.add( new Separator( IDebugUIConstants.RENDER_GROUP ) ); - - menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); - - menu.appendToGroup( ICDebugUIConstants.MEMORY_GROUP, getAction( "AutoRefreshMemory" ) ); //$NON-NLS-1$ - menu.appendToGroup( ICDebugUIConstants.MEMORY_GROUP, getAction( "RefreshMemory" ) ); //$NON-NLS-1$ - menu.appendToGroup( ICDebugUIConstants.MEMORY_GROUP, getAction( "ClearMemory" ) ); //$NON-NLS-1$ - - MenuManager subMenu = new MenuManager( "Format" ); - { - IAction[] actions = fMemoryFormatGroup.getActions(); - for ( int i = 0; i < actions.length; ++i ) - { - subMenu.add( actions[i] ); - } - } - menu.appendToGroup( ICDebugUIConstants.FORMAT_GROUP, subMenu ); - - subMenu = new MenuManager( "Memory Unit Size " ); - { - IAction[] actions = fMemorySizeGroup.getActions(); - for ( int i = 0; i < actions.length; ++i ) - { - subMenu.add( actions[i] ); - } - } - menu.appendToGroup( ICDebugUIConstants.FORMAT_GROUP, subMenu ); - - subMenu = new MenuManager( "Number Of Columns" ); - { - IAction[] actions = fMemoryNumberOfColumnsGroup.getActions(); - for ( int i = 0; i < actions.length; ++i ) - { - subMenu.add( actions[i] ); - } - } - menu.appendToGroup( ICDebugUIConstants.FORMAT_GROUP, subMenu ); - - menu.appendToGroup( IDebugUIConstants.RENDER_GROUP, getAction( "ShowAscii" ) ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(IToolBarManager) - */ - protected void configureToolBar( IToolBarManager tbm ) - { - tbm.add( new Separator( this.getClass().getName() ) ); - tbm.add( new Separator( ICDebugUIConstants.MEMORY_GROUP ) ); - tbm.add( getAction( "AutoRefreshMemory" ) ); //$NON-NLS-1$ - tbm.add( getAction( "RefreshMemory" ) ); //$NON-NLS-1$ - tbm.add( getAction( "ClearMemory" ) ); //$NON-NLS-1$ - - tbm.add( new Separator( IDebugUIConstants.RENDER_GROUP ) ); - tbm.add( getAction( "ShowAscii" ) ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - setViewerInput( (IStructuredSelection)selection ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - ((MemoryViewer)getViewer()).propertyChange( event ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler#handleException(DebugException) - */ - public void handleException( DebugException e ) - { - } - - /** - * Remove myself as a selection listener and preference change - * listener. - * - * @see IWorkbenchPart#dispose() - */ - public void dispose() - { - removeActionGroup( fMemoryFormatGroup ); - fMemoryFormatGroup.dispose(); - removeActionGroup( fMemorySizeGroup ); - fMemorySizeGroup.dispose(); - removeActionGroup( fMemoryNumberOfColumnsGroup ); - fMemoryNumberOfColumnsGroup.dispose(); - - remove( (ShowAsciiAction)getAction( "ShowAscii" ) ); - remove( (ClearMemoryAction)getAction( "ClearMemory" ) ); - remove( (RefreshMemoryAction)getAction( "RefreshMemory" ) ); - remove( (AutoRefreshMemoryAction)getAction( "AutoRefreshMemory" ) ); - - getSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this ); - super.dispose(); - } - - protected void setViewerInput( IStructuredSelection ssel ) - { - ICMemoryManager mm = null; - if ( ssel != null && ssel.size() == 1 ) - { - Object input = ssel.getFirstElement(); - if ( input instanceof IDebugElement ) - { - mm = (ICMemoryManager)((IDebugElement)input).getDebugTarget().getAdapter( ICMemoryManager.class ); - } - } - - Object current = getViewer().getInput(); - if ( current != null && current.equals( mm ) ) - { - return; - } - showViewer(); - getViewer().setInput( mm ); - updateObjects(); - } - - private IContentProvider createContentProvider() - { - return new MemoryViewContentProvider(); - } - - private IDebugModelPresentation getModelPresentation() - { - if ( fModelPresentation == null ) - { - fModelPresentation = CDebugUIPlugin.getDebugModelPresentation(); - } - return fModelPresentation; - } - - /** - * Creates this view's event handler. - * - * @param viewer the viewer associated with this view - * @return an event handler - */ - protected AbstractDebugEventHandler createEventHandler( Viewer viewer ) - { - return new MemoryViewEventHandler( this ); - } - - /** - * Initializes the viewer input on creation - */ - protected void setInitialContent() - { - ISelection selection = - getSite().getPage().getSelection( IDebugUIConstants.ID_DEBUG_VIEW ); - if ( selection instanceof IStructuredSelection && !selection.isEmpty() ) - { - setViewerInput( (IStructuredSelection)selection ); - } - else - { - setViewerInput( null ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createContextMenu(Control) - */ - protected void createContextMenu( Control menuControl ) - { - CTabItem[] items = ((MemoryViewer)getViewer()).getTabFolder().getItems(); - for ( int i = 0; i < items.length; ++i ) - { - super.createContextMenu( ((MemoryControlArea)items[i].getControl()).getMemoryText().getControl() ); - } - } - - private void createFormatActionGroup( MemoryActionSelectionGroup group ) - { - int[] formats = new int[] { IFormattedMemoryBlock.MEMORY_FORMAT_HEX, - IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL, - IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL }; - for ( int i = 0; i < formats.length; ++i ) - { - MemoryFormatAction action = new MemoryFormatAction( group, (MemoryViewer)getViewer(), formats[i] ); - action.setEnabled( false ); - setAction( action.getActionId(), action ); //$NON-NLS-1$ - add( action ); - group.addAction( action ); - } - } - - private void createSizeActionGroup( MemoryActionSelectionGroup group ) - { - int[] ids = new int[] { IFormattedMemoryBlock.MEMORY_SIZE_BYTE, - IFormattedMemoryBlock.MEMORY_SIZE_HALF_WORD, - IFormattedMemoryBlock.MEMORY_SIZE_WORD, - IFormattedMemoryBlock.MEMORY_SIZE_DOUBLE_WORD }; - for ( int i = 0; i < ids.length; ++i ) - { - MemorySizeAction action = new MemorySizeAction( group, (MemoryViewer)getViewer(), ids[i] ); - action.setEnabled( false ); - setAction( action.getActionId(), action ); //$NON-NLS-1$ - add( action ); - group.addAction( action ); - } - } - - private void createNumberOfColumnsActionGroup( MemoryActionSelectionGroup group ) - { - int[] nocs = new int[] { IFormattedMemoryBlock.MEMORY_NUMBER_OF_COLUMNS_1, - IFormattedMemoryBlock.MEMORY_NUMBER_OF_COLUMNS_2, - IFormattedMemoryBlock.MEMORY_NUMBER_OF_COLUMNS_4, - IFormattedMemoryBlock.MEMORY_NUMBER_OF_COLUMNS_8, - IFormattedMemoryBlock.MEMORY_NUMBER_OF_COLUMNS_16 }; - for ( int i = 0; i < nocs.length; ++i ) - { - MemoryNumberOfColumnAction action = new MemoryNumberOfColumnAction( group, (MemoryViewer)getViewer(), nocs[i] ); - action.setEnabled( false ); - setAction( action.getActionId(), action ); //$NON-NLS-1$ - add( action ); - group.addAction( action ); - } - } - - private void removeActionGroup( MemoryActionSelectionGroup group ) - { - IAction[] actions = group.getActions(); - for ( int i = 0; i < actions.length; ++i ) - { - remove( (IUpdate)actions[i] ); - } - } - - private void setGlobalAction( String actionId, MemoryViewAction action ) - { - add( action ); - getViewSite().getActionBars().setGlobalActionHandler( actionId, action ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if (ITextOperationTarget.class.equals( adapter ) ) - { - return ((MemoryViewer)getViewer()).getTextOperationTarget(); - } - - return super.getAdapter(adapter); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewAction.java deleted file mode 100644 index 1ed415f6f1a..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewAction.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Enter type comment. - * - * @since Jun 12, 2003 - */ -public class MemoryViewAction extends Action implements IUpdate -{ - /** The text operation code */ - private int fOperationCode = -1; - /** The text operation target */ - private ITextOperationTarget fOperationTarget; - /** The text operation target provider */ - private IAdaptable fTargetProvider; - - public MemoryViewAction( ITextOperationTarget target, int operationCode ) - { - super(); - fOperationCode = operationCode; - fOperationTarget = target; - update(); - } - - public MemoryViewAction( IAdaptable targetProvider, int operationCode ) - { - super(); - fTargetProvider = targetProvider; - fOperationCode = operationCode; - update(); - } - - /** - * The TextOperationAction implementation of this - * IUpdate method discovers the operation through the current - * editor's ITextOperationTarget adapter, and sets the - * enabled state accordingly. - */ - public void update() - { - if ( fTargetProvider != null && fOperationCode != -1 ) - { - ITextOperationTarget target = getTextOperationTarget(); - boolean isEnabled = ( target != null && target.canDoOperation( fOperationCode ) ); - setEnabled( isEnabled ); - } - } - - /** - * The TextOperationAction implementation of this - * IAction method runs the operation with the current - * operation code. - */ - public void run() - { - ITextOperationTarget target = getTextOperationTarget(); - if ( fOperationCode != -1 && target != null ) - target.doOperation( fOperationCode ); - } - - private ITextOperationTarget getTextOperationTarget() - { - if ( fOperationTarget == null ) - { - if ( fTargetProvider != null ) - return (ITextOperationTarget)fTargetProvider.getAdapter( ITextOperationTarget.class ); - } - return fOperationTarget; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewContentProvider.java deleted file mode 100644 index c14c67121f0..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewContentProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.Viewer; - -/** - * - * Enter type comment. - * - * @since Jul 29, 2002 - */ -public class MemoryViewContentProvider implements IContentProvider -{ - /** - * Constructor for MemoryViewContentProvider. - */ - public MemoryViewContentProvider() - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewEventHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewEventHandler.java deleted file mode 100644 index 3af418fd3e9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewEventHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.ui.AbstractDebugView; - -/** - * - * Enter type comment. - * - * @since Jul 29, 2002 - */ -public class MemoryViewEventHandler extends AbstractDebugEventHandler -{ - - /** - * Constructor for MemoryViewEventHandler. - * @param view - */ - public MemoryViewEventHandler( AbstractDebugView view ) - { - super( view ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler#doHandleDebugEvents(DebugEvent[]) - */ - protected void doHandleDebugEvents( DebugEvent[] events ) - { - for( int i = 0; i < events.length; i++ ) - { - DebugEvent event = events[i]; - switch( event.getKind() ) - { - case DebugEvent.CHANGE: - if ( event.getSource() instanceof IFormattedMemoryBlock && event.getDetail() == DebugEvent.CONTENT ) - { - refresh( event.getSource() ); - getView().updateObjects(); - return; - } - break; - case DebugEvent.TERMINATE: - if ( event.getSource() instanceof IFormattedMemoryBlock ) - { - remove( event.getSource() ); - getView().updateObjects(); - return; - } - break; - } - } - } - - /** - * Refresh the given element in the viewer - must be called in UI thread. - */ - protected void refresh( Object element ) - { - if ( isAvailable() ) - { - getView().showViewer(); - ((MemoryViewer)getViewer()).refresh( element ); - } - } - - /** - * Refresh the viewer - must be called in UI thread. - */ - public void refresh() - { - if ( isAvailable() ) - { - getView().showViewer(); - getViewer().refresh(); - } - } - - protected void remove( Object element ) - { - ((MemoryViewer)getViewer()).remove( element ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewer.java deleted file mode 100644 index 27ab64da9d8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryViewer.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.memory; - -import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ContentViewer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * - * Memory viewer. - * - * @since Jul 24, 2002 - */ -public class MemoryViewer extends ContentViewer -{ - static final private int NUMBER_OF_TABS = 4; - - protected MemoryView fView = null; - protected Composite fParent = null; - protected CTabFolder fTabFolder = null; - private Composite fControl = null; - private MemoryControlArea[] fMemoryControlAreas = new MemoryControlArea[NUMBER_OF_TABS]; - - /** - * Constructor for MemoryViewer. - */ - public MemoryViewer( Composite parent, MemoryView view ) - { - super(); - fParent = parent; - fView = view; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.Viewer#getControl() - */ - public Control getControl() - { - if ( fControl == null ) - { - fControl = new Composite( fParent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - fControl.setLayout( layout ); - fControl.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - fTabFolder = new CTabFolder( fControl, SWT.TOP ); - fTabFolder.setLayoutData( new GridData( GridData.FILL_BOTH | GridData.GRAB_VERTICAL ) ); - for ( int i = 0; i < NUMBER_OF_TABS; ++i ) - { - CTabItem tabItem = new CTabItem( fTabFolder, SWT.NONE ); - tabItem.setText( "Memory " + (i + 1) ); - fMemoryControlAreas[i] = new MemoryControlArea( fTabFolder, SWT.NONE, i, fView ); - tabItem.setControl( fMemoryControlAreas[i] ); - } - fTabFolder.addSelectionListener( new SelectionListener() - { - public void widgetSelected( SelectionEvent e ) - { - fView.updateObjects(); - } - - public void widgetDefaultSelected( SelectionEvent e ) - { - fView.updateObjects(); - } - } ); - fTabFolder.setSelection( 0 ); - } - return fControl; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() - */ - public ISelection getSelection() - { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.Viewer#refresh() - */ - public void refresh() - { - if ( fTabFolder != null ) - { - CTabItem[] tabItems = fTabFolder.getItems(); - for ( int i = 0; i < tabItems.length; ++i ) - if ( tabItems[i].getControl() instanceof MemoryControlArea ) - ((MemoryControlArea)tabItems[i].getControl()).refresh(); - } - } - - public void refresh( Object element ) - { - if ( element instanceof IFormattedMemoryBlock ) - { - MemoryControlArea mca = getMemoryControlArea( (IFormattedMemoryBlock)element ); - if ( mca != null ) - { - mca.refresh(); - } - } - } - - public void remove( Object element ) - { - if ( element instanceof IFormattedMemoryBlock ) - { - MemoryControlArea mca = getMemoryControlArea( (IFormattedMemoryBlock)element ); - if ( mca != null ) - { - mca.clear(); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.Viewer#setSelection(ISelection, boolean) - */ - public void setSelection( ISelection selection, boolean reveal ) - { - } - - public void propertyChange( PropertyChangeEvent event ) - { - if ( fTabFolder != null ) - { - CTabItem[] tabItems = fTabFolder.getItems(); - for ( int i = 0; i < tabItems.length; ++i ) - if ( tabItems[i].getControl() instanceof MemoryControlArea ) - ((MemoryControlArea)tabItems[i].getControl()).propertyChange( event ); - } - } - - protected void inputChanged( Object input, Object oldInput ) - { - for ( int i = 0; i < fMemoryControlAreas.length; ++i ) - fMemoryControlAreas[i].setInput( input ); - } - - protected CTabFolder getTabFolder() - { - return fTabFolder; - } - - private MemoryControlArea getMemoryControlArea( IFormattedMemoryBlock block ) - { - CTabItem[] tabItems = fTabFolder.getItems(); - for ( int i = 0; i < tabItems.length; ++i ) - { - if ( tabItems[i].getControl() instanceof MemoryControlArea && - block != null && - block.equals( ((MemoryControlArea)tabItems[i].getControl()).getMemoryBlock() ) ) - { - return (MemoryControlArea)tabItems[i].getControl(); - } - } - return null; - } - - public boolean canChangeFormat( int format ) - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - return ( block != null && block.canChangeFormat( format ) ); - } - - public boolean canUpdate() - { - return ( ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock() != null ); - } - - public boolean canSave() - { - return ( ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock() != null ); - } - - public boolean isFrozen() - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - return ( block != null ) ? block.isFrozen() : true; - } - - public void setFrozen( boolean frozen ) - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - if ( block != null ) - { - block.setFrozen( frozen ); - } - } - - public void clear() - { - ((MemoryControlArea)fTabFolder.getSelection().getControl()).clear(); - } - - public void refreshMemoryBlock() - { - ((MemoryControlArea)fTabFolder.getSelection().getControl()).refreshMemoryBlock(); - } - - public boolean showAscii() - { - return ((MemoryControlArea)fTabFolder.getSelection().getControl()).getPresentation().displayASCII(); - } - - public void setShowAscii( boolean show ) - { - ((MemoryControlArea)fTabFolder.getSelection().getControl()).getPresentation().setDisplayAscii( show ); - ((MemoryControlArea)fTabFolder.getSelection().getControl()).refresh(); - } - - public boolean canShowAscii() - { - return ((MemoryControlArea)fTabFolder.getSelection().getControl()).getPresentation().canDisplayAscii(); - } - - public int getCurrentFormat() - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - return ( block != null ) ? block.getFormat() : 0; - } - - public void setFormat( int format ) throws DebugException - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - if ( block != null ) - { - block.reformat( format, block.getWordSize(), block.getNumberOfRows(), block.getNumberOfColumns() ); - ((MemoryControlArea)fTabFolder.getSelection().getControl()).refresh(); - } - } - - public int getCurrentWordSize() - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - return ( block != null ) ? block.getWordSize() : 0; - } - - public void setWordSize( int size ) throws DebugException - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - if ( block != null ) - { - block.reformat( block.getFormat(), size, block.getNumberOfRows(), block.getNumberOfColumns() ); - ((MemoryControlArea)fTabFolder.getSelection().getControl()).refresh(); - } - } - - public int getCurrentNumberOfColumns() - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - return ( block != null ) ? block.getNumberOfColumns() : 0; - } - - public void setNumberOfColumns( int numberOfColumns ) throws DebugException - { - IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock(); - if ( block != null ) - { - block.reformat( block.getFormat(), block.getWordSize(), block.getNumberOfRows(), numberOfColumns ); - ((MemoryControlArea)fTabFolder.getSelection().getControl()).refresh(); - } - } - - protected ITextOperationTarget getTextOperationTarget() - { - return (MemoryControlArea)fTabFolder.getSelection().getControl(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java deleted file mode 100644 index 01b25148591..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersView.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.internal.ui.views.registers; - -import java.util.HashMap; - -import org.eclipse.cdt.debug.core.ICRegisterManager; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.actions.AutoRefreshAction; -import org.eclipse.cdt.debug.internal.ui.actions.ChangeRegisterValueAction; -import org.eclipse.cdt.debug.internal.ui.actions.RefreshAction; -import org.eclipse.cdt.debug.internal.ui.actions.ShowRegisterTypesAction; -import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.cdt.debug.internal.ui.views.ViewerState; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegister; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.IColorProvider; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * - * This view shows registers and their values for a particular stack frame. - * - * @since Jul 23, 2002 - */ -public class RegistersView extends AbstractDebugEventHandlerView - implements ISelectionListener, - IPropertyChangeListener, - IDebugExceptionHandler -{ - /** - * A label provider that delegates to a debug model - * presentation and adds coloring to registers to - * reflect their changed state - */ - class VariablesViewLabelProvider implements ILabelProvider, IColorProvider - { - private IDebugModelPresentation fPresentation; - - public VariablesViewLabelProvider( IDebugModelPresentation presentation ) - { - fPresentation = presentation; - } - - public IDebugModelPresentation getPresentation() - { - return fPresentation; - } - - public Image getImage( Object element ) - { - return fPresentation.getImage( element ); - } - public String getText( Object element ) - { - return fPresentation.getText( element ); - } - public void addListener( ILabelProviderListener listener ) - { - fPresentation.addListener( listener ); - } - public void dispose() - { - fPresentation.dispose(); - } - public boolean isLabelProperty( Object element, String property ) - { - return fPresentation.isLabelProperty( element, property ); - } - public void removeListener( ILabelProviderListener listener ) - { - fPresentation.removeListener( listener ); - } - - public Color getForeground( Object element ) - { - if ( element instanceof IRegister ) - { - IRegister register = (IRegister)element; - try - { - if ( register.hasValueChanged() ) - { - return CDebugUIPlugin.getPreferenceColor( ICDebugPreferenceConstants.CHANGED_REGISTER_RGB ); - } - } - catch( DebugException e ) - { - CDebugUIPlugin.log( e ); - } - } - return null; - } - - public Color getBackground( Object element ) - { - return null; - } - } - - /** - * The model presentation used as the label provider for the tree viewer. - */ - private IDebugModelPresentation fModelPresentation; - - protected static final String VARIABLES_SELECT_ALL_ACTION = SELECT_ALL_ACTION + ".Registers"; //$NON-NLS-1$ - - /** - * A map of register managers to ViewerStates. - * Used to restore the expanded state of the registers view on - * re-selection of the register manager. The cache is cleared on - * a frame by frame basis when a thread/target is terminated. - */ - private HashMap fExpandedRegisters = new HashMap( 10 ); - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite) - */ - protected Viewer createViewer( Composite parent ) - { - CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); - - // add tree viewer - final TreeViewer vv = new RegistersViewer( parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL ); - vv.setContentProvider( createContentProvider() ); - vv.setLabelProvider( new VariablesViewLabelProvider( getModelPresentation() ) ); - vv.setUseHashlookup( true ); - setAction( SELECT_ALL_ACTION, getAction( VARIABLES_SELECT_ALL_ACTION ) ); - getViewSite().getActionBars().updateActionBars(); - - // listen to selection in debug view - getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - setEventHandler( createEventHandler( vv ) ); - - return vv; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createActions() - */ - protected void createActions() - { - IAction action = new ShowRegisterTypesAction( this ); - setAction( "ShowTypeNames", action ); //$NON-NLS-1$ - - action = new ChangeRegisterValueAction( getViewer() ); - action.setEnabled( false ); - setAction( "ChangeRegisterValue", action ); //$NON-NLS-1$ - setAction( DOUBLE_CLICK_ACTION, action ); - - action = new AutoRefreshAction( getViewer(), "Auto-Refresh" ); - CDebugImages.setLocalImageDescriptors( action, CDebugImages.IMG_LCL_AUTO_REFRESH ); - action.setDescription( "Automatically Refresh Registers View" ); - action.setToolTipText( "Auto-Refresh" ); - WorkbenchHelp.setHelp( action, ICDebugHelpContextIds.AUTO_REFRESH_REGISTERS_ACTION ); - action.setEnabled( false ); - setAction( "AutoRefresh", action ); //$NON-NLS-1$ - add( (AutoRefreshAction)action ); - - action = new RefreshAction( getViewer(), "Refresh" ); - CDebugImages.setLocalImageDescriptors( action, CDebugImages.IMG_LCL_REFRESH ); - action.setDescription( "Refresh Registers View" ); - action.setToolTipText( "Refresh" ); - WorkbenchHelp.setHelp( action, ICDebugHelpContextIds.REFRESH_REGISTERS_ACTION ); - action.setEnabled( false ); - setAction( "Refresh", action ); //$NON-NLS-1$ - add( (RefreshAction)action ); - - // set initial content here, as viewer has to be set - setInitialContent(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() - */ - protected String getHelpContextId() - { - return ICDebugHelpContextIds.REGISTERS_VIEW; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(IMenuManager) - */ - protected void fillContextMenu( IMenuManager menu ) - { - menu.add( new Separator( ICDebugUIConstants.EMPTY_REGISTER_GROUP ) ); - menu.add( new Separator( ICDebugUIConstants.REGISTER_GROUP ) ); - - menu.add( new Separator( IDebugUIConstants.EMPTY_RENDER_GROUP ) ); - menu.add( new Separator( IDebugUIConstants.RENDER_GROUP ) ); - - menu.add( new Separator( ICDebugUIConstants.EMPTY_REFRESH_GROUP ) ); - menu.add( new Separator( ICDebugUIConstants.REFRESH_GROUP ) ); - - menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); - - menu.appendToGroup( ICDebugUIConstants.REGISTER_GROUP, getAction( "ChangeRegisterValue" ) ); //$NON-NLS-1$ -// menu.appendToGroup( IDebugUIConstants.RENDER_GROUP, getAction( "ShowTypeNames" ) ); //$NON-NLS-1$ - menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "AutoRefresh" ) ); //$NON-NLS-1$ - menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "Refresh" ) ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(IToolBarManager) - */ - protected void configureToolBar( IToolBarManager tbm ) - { - tbm.add( new Separator( this.getClass().getName() ) ); - - tbm.add( new Separator( ICDebugUIConstants.REFRESH_GROUP ) ); - tbm.add( getAction( "AutoRefresh" ) ); //$NON-NLS-1$ - tbm.add( getAction( "Refresh" ) ); //$NON-NLS-1$ - - tbm.add( new Separator( IDebugUIConstants.RENDER_GROUP ) ); - tbm.add( getAction( "ShowTypeNames" ) ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - setViewerInput( (IStructuredSelection)selection ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - String propertyName= event.getProperty(); - if ( propertyName.equals( ICDebugPreferenceConstants.CHANGED_REGISTER_RGB ) ) - { - getEventHandler().refresh(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler#handleException(DebugException) - */ - public void handleException( DebugException e ) - { - showMessage( e.getMessage() ); - } - - /** - * Remove myself as a selection listener - * and preference change listener. - * - * @see IWorkbenchPart#dispose() - */ - public void dispose() - { - fModelPresentation.dispose(); - getSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this ); - super.dispose(); - } - - /** - * Creates this view's content provider. - * - * @return a content provider - */ - protected IContentProvider createContentProvider() - { - RegistersViewContentProvider cp = new RegistersViewContentProvider(); - cp.setExceptionHandler( this ); - return cp; - } - - protected IDebugModelPresentation getModelPresentation() - { - if ( fModelPresentation == null ) - { - fModelPresentation = DebugUITools.newDebugModelPresentation(); - } - return fModelPresentation; - } - - /** - * Creates this view's event handler. - * - * @param viewer the viewer associated with this view - * @return an event handler - */ - protected AbstractDebugEventHandler createEventHandler( Viewer viewer ) - { - return new RegistersViewEventHandler( this ); - } - - protected void setViewerInput( IStructuredSelection ssel ) - { - ICRegisterManager rm = null; - if ( ssel.size() == 1 && ssel.getFirstElement() instanceof IStackFrame ) - { - rm = (ICRegisterManager)((IStackFrame)ssel.getFirstElement()).getDebugTarget().getAdapter( ICRegisterManager.class ); - } - - if ( getViewer() == null ) - { - return; - } - - Object current = getViewer().getInput(); - if ( current == null && rm == null ) - { - return; - } - - if ( current != null && current.equals( rm ) ) - { - return; - } - - if ( current != null ) - { - // save state - ViewerState state = new ViewerState( getRegistersViewer() ); - fExpandedRegisters.put( current, state ); - } - - showViewer(); - getViewer().setInput( rm ); - - // restore state - if ( rm != null ) - { - ViewerState state = (ViewerState)fExpandedRegisters.get( rm ); - if ( state != null ) - { - state.restoreState( getRegistersViewer() ); - } - } - - updateObjects(); - } - - /** - * Initializes the viewer input on creation - */ - protected void setInitialContent() - { - ISelection selection = - getSite().getPage().getSelection( IDebugUIConstants.ID_DEBUG_VIEW ); - if ( selection instanceof IStructuredSelection && !selection.isEmpty() ) - { - setViewerInput( (IStructuredSelection)selection ); - } - } - - protected RegistersViewer getRegistersViewer() - { - return (RegistersViewer)getViewer(); - } - - protected void clearExpandedRegisters( ICRegisterManager rm ) - { - fExpandedRegisters.remove( rm ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( IDebugModelPresentation.class.equals( adapter ) ) - { - IBaseLabelProvider labelProvider = getStructuredViewer().getLabelProvider(); - if ( labelProvider instanceof VariablesViewLabelProvider ) - { - return ((VariablesViewLabelProvider)labelProvider).getPresentation(); - } - } - return super.getAdapter( adapter ); - } - -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java deleted file mode 100644 index 811f1d600b9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewContentProvider.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.registers; - -import java.util.HashMap; - -import org.eclipse.cdt.debug.core.ICRegisterManager; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IRegisterGroup; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; - -/** - * - * Provide the contents for a registers viewer. - * - * @since Jul 23, 2002 - */ -public class RegistersViewContentProvider implements ITreeContentProvider -{ - /** - * A table that maps children to their parent element - * such that this content provider can walk back up the - * parent chain (since values do not know their - * parent). - * Map of IVariable (child) -> IVariable (parent). - */ - private HashMap fParentCache; - - /** - * Handler for exceptions as content is retrieved - */ - private IDebugExceptionHandler fExceptionHandler = null; - - /** - * Constructor for RegistersViewContentProvider. - */ - public RegistersViewContentProvider() - { - fParentCache = new HashMap( 10 ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(Object) - */ - public Object[] getChildren( Object parent ) - { - Object[] children= null; - try - { - if ( parent instanceof ICRegisterManager ) - { - children = ((ICRegisterManager)parent).getRegisterGroups(); - } - else if ( parent instanceof IRegisterGroup ) - { - children = ((IRegisterGroup)parent).getRegisters(); - } - else if ( parent instanceof IVariable ) - { - children = ((IVariable)parent).getValue().getVariables(); - } - if ( children != null ) - { - cache( parent, children ); - return children; - } - } - catch( DebugException e ) - { - if ( getExceptionHandler() != null ) - { - getExceptionHandler().handleException( e ); - } - else - { - CDebugUIPlugin.log( e ); - } - } - return new Object[0]; - } - - /** - * Caches the given elememts as children of the given - * parent. - * - * @param parent parent element - * @param children children elements - */ - protected void cache( Object parent, Object[] children ) - { - for ( int i = 0; i < children.length; i++ ) - { - fParentCache.put( children[i], parent ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(Object) - */ - public Object getParent( Object element ) - { - return fParentCache.get( element ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(Object) - */ - public boolean hasChildren( Object element ) - { - try - { - if ( element instanceof IVariable ) - { - return ((IVariable)element).getValue().hasVariables(); - } - if ( element instanceof IValue ) - { - return ((IValue)element).hasVariables(); - } - if ( element instanceof IRegisterGroup ) - { - return ((IRegisterGroup)element).hasRegisters(); - } - if ( element instanceof IStackFrame ) - { - return ((IStackFrame)element).hasRegisterGroups(); - } - } - catch( DebugException e ) - { - CDebugUIPlugin.log( e ); - return false; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object) - */ - public Object[] getElements( Object inputElement ) - { - return getChildren( inputElement ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() - { - fParentCache = null; - setExceptionHandler( null ); - } - - protected void clearCache() - { - if ( fParentCache != null ) - { - fParentCache.clear(); - } - } - - /** - * Remove the cached parent for the given children - * - * @param children for which to remove cached parents - */ - public void removeCache( Object[] children ) - { - if ( fParentCache != null ) - { - for ( int i = 0; i < children.length; i++ ) - { - fParentCache.remove( children[i] ); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - clearCache(); - } - - /** - * Sets an exception handler for this content provider. - * - * @param handler debug exception handler or null - */ - protected void setExceptionHandler( IDebugExceptionHandler handler ) - { - fExceptionHandler = handler; - } - - /** - * Returns the exception handler for this content provider. - * - * @return debug exception handler or null - */ - protected IDebugExceptionHandler getExceptionHandler() - { - return fExceptionHandler; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewEventHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewEventHandler.java deleted file mode 100644 index 75d33cc5ece..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewEventHandler.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.registers; - -import org.eclipse.cdt.debug.core.ICRegisterManager; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.debug.ui.AbstractDebugView; - -/** - * - * Updates the registers view - * - * @since Jul 23, 2002 - */ -public class RegistersViewEventHandler extends AbstractDebugEventHandler -{ - - /** - * Constructor for RegistersViewEventHandler. - * @param view - */ - public RegistersViewEventHandler( AbstractDebugView view ) - { - super( view ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler#doHandleDebugEvents(DebugEvent[]) - */ - protected void doHandleDebugEvents( DebugEvent[] events ) - { - for( int i = 0; i < events.length; i++ ) - { - DebugEvent event = events[i]; - switch( event.getKind() ) - { - case DebugEvent.TERMINATE : - if ( event.getSource() instanceof IDebugTarget && - ((IDebugTarget)event.getSource()).getAdapter( ICRegisterManager.class ) != null ) - { - getRegistersView().clearExpandedRegisters( (ICRegisterManager)(((IDebugTarget)event.getSource()).getAdapter( ICRegisterManager.class )) ); - } - break; - case DebugEvent.SUSPEND : - if ( event.getDetail() != DebugEvent.EVALUATION_IMPLICIT ) - { - // Don't refresh everytime an implicit evaluation finishes - refresh(); - // return since we've done a complete refresh - return; - } - break; - case DebugEvent.CHANGE : - if ( event.getDetail() == DebugEvent.STATE ) - { - // only process variable state changes - if ( event.getSource() instanceof IVariable ) - { - refresh( event.getSource() ); - } - } - else - { - refresh(); - // return since we've done a complete refresh - return; - } - break; - } - } - } - - protected RegistersView getRegistersView() - { - return (RegistersView)getView(); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewer.java deleted file mode 100644 index a1c10a33098..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/RegistersViewer.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.registers; - -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Item; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.Widget; - -/** - * - * Registers viewer. As the user steps through code, this - * viewer renders registers that have changed with a - * different foreground color thereby drawing attention - * to the values that have changed. - * - * @since Jul 23, 2002 - */ -public class RegistersViewer extends TreeViewer -{ - - private Item fNewItem; - - /** - * Constructor for RegistersViewer. - * @param parent - */ - public RegistersViewer( Composite parent ) - { - super( parent ); - } - - /** - * Constructor for RegistersViewer. - * @param parent - * @param style - */ - public RegistersViewer( Composite parent, int style ) - { - super( parent, style ); - } - - /** - * Constructor for RegistersViewer. - * @param tree - */ - public RegistersViewer( Tree tree ) - { - super( tree ); - } - - public void refresh() - { - super.refresh(); - - if ( getSelection().isEmpty() && getNewItem() != null ) - { - if ( !getNewItem().isDisposed() ) - { - //ensure that new items are visible - showItem( getNewItem() ); - } - setNewItem( null ); - } - //expandToLevel( 2 ); - } - - /** - * @see AbstractTreeViewer#newItem(Widget, int, int) - */ - protected Item newItem( Widget parent, int style, int index ) - { - if ( index != -1 ) - { - //ignore the dummy items - setNewItem( super.newItem( parent, style, index ) ); - return getNewItem(); - } - return super.newItem( parent, style, index ); - } - - protected Item getNewItem() - { - return fNewItem; - } - - protected void setNewItem( Item newItem ) - { - fNewItem = newItem; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java deleted file mode 100644 index c02ba9c03e9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.sharedlibs; - -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICSharedLibraryManager; -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.cdt.debug.internal.ui.CDTDebugModelPresentation; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.actions.AutoRefreshAction; -import org.eclipse.cdt.debug.internal.ui.actions.LoadSymbolsForAllAction; -import org.eclipse.cdt.debug.internal.ui.actions.RefreshAction; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.cdt.debug.ui.ICDebugUIConstants; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.TableTreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * Enter type comment. - * - * @since: Jan 21, 2003 - */ -public class SharedLibrariesView extends AbstractDebugEventHandlerView - implements ISelectionListener, - IPropertyChangeListener, - IDebugExceptionHandler -{ - public class SharedLibrariesLabelProvider extends CDTDebugModelPresentation implements ITableLabelProvider - { - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) - */ - public Image getColumnImage( Object element, int columnIndex ) - { - if ( element instanceof ICSharedLibrary && columnIndex == 1 ) - { - return getImage( element ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) - */ - public String getColumnText( Object element, int columnIndex ) - { - if ( element instanceof ICSharedLibrary ) - { - ICSharedLibrary library = (ICSharedLibrary)element; - switch( columnIndex ) - { - case 0: - return ""; - case 1: - return getText( element ); - case 2: - return ( library.getStartAddress() > 0 ) ? - CDebugUtils.toHexAddressString( library.getStartAddress() ) : ""; - case 3: - return ( library.getEndAddress() > 0 ) ? - CDebugUtils.toHexAddressString( library.getEndAddress() ) : ""; - } - } - return null; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite) - */ - protected Viewer createViewer( Composite parent ) - { - TableTreeViewer viewer = new TableTreeViewer( parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL ); - Table table = viewer.getTableTree().getTable(); - table.setLinesVisible( true ); - table.setHeaderVisible( true ); - - // Create the table columns - new TableColumn( table, SWT.NULL ); - new TableColumn( table, SWT.NULL ); - new TableColumn( table, SWT.NULL ); - new TableColumn( table, SWT.NULL ); - TableColumn[] columns = table.getColumns(); - columns[1].setResizable( true ); - columns[2].setResizable( true ); - columns[3].setResizable( true ); - - columns[0].setText( "" ); - columns[1].setText( "Name" ); - columns[2].setText( "Start Address" ); - columns[3].setText( "End Address" ); - - PixelConverter pc = new PixelConverter( parent ); - columns[0].setWidth( pc.convertWidthInCharsToPixels( 3 ) ); - columns[1].setWidth( pc.convertWidthInCharsToPixels( 50 ) ); - columns[2].setWidth( pc.convertWidthInCharsToPixels( 20 ) ); - columns[3].setWidth( pc.convertWidthInCharsToPixels( 20 ) ); - - viewer.setContentProvider( new SharedLibrariesViewContentProvider() ); - viewer.setLabelProvider( new SharedLibrariesLabelProvider() ); - - // listen to selection in debug view - getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - setEventHandler( createEventHandler( viewer ) ); - - return viewer; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createActions() - */ - protected void createActions() - { - IAction action = new AutoRefreshAction( getViewer(), "Auto-Refresh" ); - CDebugImages.setLocalImageDescriptors( action, CDebugImages.IMG_LCL_AUTO_REFRESH ); - action.setDescription( "Automatically Refresh Shared Libraries View" ); - action.setToolTipText( "Auto-Refresh" ); - WorkbenchHelp.setHelp( action, ICDebugHelpContextIds.AUTO_REFRESH_SHARED_LIBRARIES_ACTION ); - action.setEnabled( false ); - setAction( "AutoRefresh", action ); //$NON-NLS-1$ - add( (AutoRefreshAction)action ); - - action = new RefreshAction( getViewer(), "Refresh" ); - CDebugImages.setLocalImageDescriptors( action, CDebugImages.IMG_LCL_REFRESH ); - action.setDescription( "Refresh Shared Libraries View" ); - action.setToolTipText( "Refresh" ); - WorkbenchHelp.setHelp( action, ICDebugHelpContextIds.REFRESH_SHARED_LIBRARIES_ACTION ); - action.setEnabled( false ); - setAction( "Refresh", action ); //$NON-NLS-1$ - add( (RefreshAction)action ); - - action = new LoadSymbolsForAllAction( getViewer() ); - action.setEnabled( false ); - setAction( "LoadSymbolsForAll", action ); //$NON-NLS-1$ - add( (LoadSymbolsForAllAction)action ); - - // set initial content here, as viewer has to be set - setInitialContent(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() - */ - protected String getHelpContextId() - { - return ICDebugHelpContextIds.SHARED_LIBRARIES_VIEW; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(IMenuManager) - */ - protected void fillContextMenu( IMenuManager menu ) - { - updateObjects(); - - menu.add( new Separator( ICDebugUIConstants.EMPTY_SHARED_LIBRARIES_GROUP ) ); - menu.add( new Separator( ICDebugUIConstants.SHARED_LIBRARIES_GROUP ) ); - - menu.add( new Separator( ICDebugUIConstants.EMPTY_REFRESH_GROUP ) ); - menu.add( new Separator( ICDebugUIConstants.REFRESH_GROUP ) ); - - menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); - - menu.appendToGroup( ICDebugUIConstants.SHARED_LIBRARIES_GROUP, getAction( "LoadSymbolsForAll" ) ); //$NON-NLS-1$ - menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "AutoRefresh" ) ); //$NON-NLS-1$ - menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "Refresh" ) ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(IToolBarManager) - */ - protected void configureToolBar( IToolBarManager tbm ) - { - tbm.add( new Separator( this.getClass().getName() ) ); - - tbm.add( new Separator( ICDebugUIConstants.SHARED_LIBRARIES_GROUP ) ); - tbm.add( getAction( "LoadSymbolsForAll" ) ); //$NON-NLS-1$ - - tbm.add( new Separator( ICDebugUIConstants.REFRESH_GROUP ) ); - tbm.add( getAction( "AutoRefresh" ) ); //$NON-NLS-1$ - tbm.add( getAction( "Refresh" ) ); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - setViewerInput( (IStructuredSelection)selection ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler#handleException(DebugException) - */ - public void handleException( DebugException e ) - { - } - - protected void setViewerInput( IStructuredSelection ssel ) - { - ICSharedLibraryManager slm = null; - if ( ssel != null && ssel.size() == 1 ) - { - Object input = ssel.getFirstElement(); - if ( input instanceof IDebugElement ) - { - slm = (ICSharedLibraryManager)((IDebugElement)input).getDebugTarget().getAdapter( ICSharedLibraryManager.class ); - } - } - - if ( getViewer() == null ) - { - return; - } - - Object current = getViewer().getInput(); - if ( current != null && current.equals( slm ) ) - { - updateObjects(); - return; - } - showViewer(); - getViewer().setInput( slm ); - updateObjects(); - } - - /** - * Initializes the viewer input on creation - */ - protected void setInitialContent() - { - ISelection selection = - getSite().getPage().getSelection( IDebugUIConstants.ID_DEBUG_VIEW ); - if ( selection instanceof IStructuredSelection && !selection.isEmpty() ) - { - setViewerInput( (IStructuredSelection)selection ); - } - else - { - setViewerInput( null ); - } - } - - /** - * Creates this view's event handler. - * - * @param viewer the viewer associated with this view - * @return an event handler - */ - protected AbstractDebugEventHandler createEventHandler( Viewer viewer ) - { - return new SharedLibrariesViewEventHandler( this ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewContentProvider.java deleted file mode 100644 index 575f9c297b6..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewContentProvider.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.sharedlibs; - -import java.util.HashMap; - -import org.eclipse.cdt.debug.core.ICSharedLibraryManager; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; - -/** - * Enter type comment. - * - * @since: Jan 21, 2003 - */ -public class SharedLibrariesViewContentProvider implements ITreeContentProvider -{ - /** - * A table that maps children to their parent element - * such that this content provider can walk back up the - * parent chain (since values do not know their - * parent). - * Map of IVariable (child) -> IVariable (parent). - */ - private HashMap fParentCache; - - /** - * Handler for exceptions as content is retrieved - */ - private IDebugExceptionHandler fExceptionHandler = null; - - - /** - * Constructor for SharedLibrariesViewContentProvider. - */ - public SharedLibrariesViewContentProvider() - { - fParentCache = new HashMap( 10 ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(Object) - */ - public Object[] getChildren( Object parent ) - { - Object[] children = null; - if ( parent != null && parent instanceof ICSharedLibraryManager ) - { - children = ((ICSharedLibraryManager)parent).getSharedLibraries(); - } - if ( children != null ) - { - cache( parent, children ); - return children; - } - return new Object[0]; - } - - /** - * Caches the given elememts as children of the given - * parent. - * - * @param parent parent element - * @param children children elements - */ - protected void cache( Object parent, Object[] children ) - { - for ( int i = 0; i < children.length; i++ ) - { - fParentCache.put( children[i], parent ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(Object) - */ - public Object getParent( Object element ) - { - return fParentCache.get( element ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(Object) - */ - public boolean hasChildren( Object parent ) - { - if ( parent instanceof ICSharedLibraryManager ) - { - return ( ((ICSharedLibraryManager)parent).getSharedLibraries().length > 0 ); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object) - */ - public Object[] getElements( Object inputElement ) - { - return getChildren( inputElement ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() - { - fParentCache = null; - setExceptionHandler( null ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - clearCache(); - } - - protected void clearCache() - { - if ( fParentCache != null ) - { - fParentCache.clear(); - } - } - - /** - * Remove the cached parent for the given children - * - * @param children for which to remove cached parents - */ - public void removeCache( Object[] children ) - { - if ( fParentCache != null ) - { - for ( int i = 0; i < children.length; i++ ) - { - fParentCache.remove( children[i] ); - } - } - } - - /** - * Sets an exception handler for this content provider. - * - * @param handler debug exception handler or null - */ - protected void setExceptionHandler( IDebugExceptionHandler handler ) - { - fExceptionHandler = handler; - } - - /** - * Returns the exception handler for this content provider. - * - * @return debug exception handler or null - */ - protected IDebugExceptionHandler getExceptionHandler() - { - return fExceptionHandler; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewEventHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewEventHandler.java deleted file mode 100644 index 8fc79c30841..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesViewEventHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.sharedlibs; - -import org.eclipse.cdt.debug.core.model.ICSharedLibrary; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.ui.AbstractDebugView; - -/** - * Enter type comment. - * - * @since: Jan 21, 2003 - */ -public class SharedLibrariesViewEventHandler extends AbstractDebugEventHandler -{ - /** - * Constructor for SharedLibrariesViewEventHandler. - * @param view - */ - public SharedLibrariesViewEventHandler( AbstractDebugView view ) - { - super( view ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler#doHandleDebugEvents(DebugEvent[]) - */ - protected void doHandleDebugEvents( DebugEvent[] events ) - { - for( int i = 0; i < events.length; i++ ) - { - DebugEvent event = events[i]; - switch( event.getKind() ) - { - case DebugEvent.CREATE: - case DebugEvent.TERMINATE: - if ( event.getSource() instanceof IDebugTarget || - event.getSource() instanceof ICSharedLibrary ) - refresh(); - break; - case DebugEvent.CHANGE : - if ( event.getSource() instanceof ICSharedLibrary ) - refresh( event.getSource() ); - break; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler#refresh() - */ - public void refresh() - { - if ( isAvailable() ) - { - getView().showViewer(); - getTableTreeViewer().refresh(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler#refresh(java.lang.Object) - */ - protected void refresh( Object element ) - { - if ( isAvailable() ) - { - getView().showViewer(); - getTableTreeViewer().refresh( element ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java deleted file mode 100644 index e4112848bd9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.signals; - -import org.eclipse.cdt.debug.core.ICSignalManager; -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPart; - -/** - * Enter type comment. - * - * @since: Jan 30, 2003 - */ -public class SignalsView extends AbstractDebugEventHandlerView - implements ISelectionListener, - IPropertyChangeListener, - IDebugExceptionHandler -{ - /** - * Enter type comment. - * - * @since: Jan 30, 2003 - */ - public class SignalsViewLabelProvider extends LabelProvider implements ITableLabelProvider - { - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(Object, int) - */ - public Image getColumnImage( Object element, int columnIndex ) - { - if ( columnIndex == 0 ) - return CDebugUIPlugin.getImageDescriptorRegistry().get( CDebugImages.DESC_OBJS_SIGNAL ); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(Object, int) - */ - public String getColumnText( Object element, int columnIndex ) - { - if ( element instanceof ICSignal ) - { - switch( columnIndex ) - { - case 0: - return ((ICSignal)element).getName(); - case 1: - return ( ((ICSignal)element).isPassEnabled() ) ? - SignalsViewer.YES_VALUE : SignalsViewer.NO_VALUE; - case 2: - return ( ((ICSignal)element).isStopEnabled() ) ? - SignalsViewer.YES_VALUE : SignalsViewer.NO_VALUE; - case 3: - return ((ICSignal)element).getDescription(); - } - } - return null; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite) - */ - protected Viewer createViewer( Composite parent ) - { - CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this ); - - // add tree viewer - final SignalsViewer vv = new SignalsViewer( parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL ); - vv.setContentProvider( createContentProvider() ); - vv.setLabelProvider( new SignalsViewLabelProvider() ); - vv.setUseHashlookup( true ); - vv.setExceptionHandler( this ); - - // listen to selection in debug view - getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - setEventHandler( new SignalsViewEventHandler( this ) ); - - return vv; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createActions() - */ - protected void createActions() - { - // set initial content here, as viewer has to be set - setInitialContent(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() - */ - protected String getHelpContextId() - { - return ICDebugHelpContextIds.SIGNALS_VIEW; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(IMenuManager) - */ - protected void fillContextMenu( IMenuManager menu ) - { - menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(IToolBarManager) - */ - protected void configureToolBar( IToolBarManager tbm ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( selection instanceof IStructuredSelection ) - { - setViewerInput( (IStructuredSelection)selection ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent) - */ - public void propertyChange( PropertyChangeEvent event ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler#handleException(DebugException) - */ - public void handleException( DebugException e ) - { - showMessage( e.getMessage() ); - } - - protected void setViewerInput( IStructuredSelection ssel ) - { - ICSignalManager sm = null; - if ( ssel != null && ssel.size() == 1 ) - { - Object input = ssel.getFirstElement(); - if ( input instanceof IDebugElement ) - { - sm = (ICSignalManager)((IDebugElement)input).getDebugTarget().getAdapter( ICSignalManager.class ); - } - } - - if ( getViewer() == null ) - { - return; - } - - Object current = getViewer().getInput(); - if ( current != null && current.equals( sm ) ) - { - return; - } - showViewer(); - getViewer().setInput( sm ); - updateObjects(); - } - - /** - * Initializes the viewer input on creation - */ - protected void setInitialContent() - { - ISelection selection = - getSite().getPage().getSelection( IDebugUIConstants.ID_DEBUG_VIEW ); - if ( selection instanceof IStructuredSelection && !selection.isEmpty() ) - { - setViewerInput( (IStructuredSelection)selection ); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPart#dispose() - */ - public void dispose() - { - getSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this ); - super.dispose(); - } - - /** - * Creates this view's content provider. - * - * @return a content provider - */ - protected IContentProvider createContentProvider() - { - SignalsViewContentProvider cp = new SignalsViewContentProvider(); - cp.setExceptionHandler( this ); - return cp; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java deleted file mode 100644 index 9002e792bb9..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.signals; - -import org.eclipse.cdt.debug.core.ICSignalManager; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; - -/** - * Enter type comment. - * - * @since: Jan 30, 2003 - */ -public class SignalsViewContentProvider implements IStructuredContentProvider -{ - /** - * Handler for exceptions as content is retrieved - */ - private IDebugExceptionHandler fExceptionHandler = null; - - /** - * Constructor for SignalsViewContentProvider. - */ - public SignalsViewContentProvider() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object) - */ - public Object[] getElements( Object inputElement ) - { - if ( inputElement instanceof ICSignalManager ) - { - try - { - return ((ICSignalManager)inputElement).getSignals(); - } - catch( DebugException e ) - { - if ( getExceptionHandler() != null ) - { - getExceptionHandler().handleException( e ); - } - else - { - CDebugUIPlugin.log( e ); - } - } - } - return new Object[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#dispose() - */ - public void dispose() - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object) - */ - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - } - - /** - * Sets an exception handler for this content provider. - * - * @param handler debug exception handler or null - */ - protected void setExceptionHandler( IDebugExceptionHandler handler ) - { - fExceptionHandler = handler; - } - - /** - * Returns the exception handler for this content provider. - * - * @return debug exception handler or null - */ - protected IDebugExceptionHandler getExceptionHandler() - { - return fExceptionHandler; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewEventHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewEventHandler.java deleted file mode 100644 index bd8b092eea0..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewEventHandler.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.signals; - -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.ui.AbstractDebugView; - -/** - * Enter type comment. - * - * @since: Jan 30, 2003 - */ -public class SignalsViewEventHandler extends AbstractDebugEventHandler -{ - /** - * Constructor for SignalsViewEventHandler. - * @param view - */ - public SignalsViewEventHandler( AbstractDebugView view ) - { - super( view ); - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler#doHandleDebugEvents(DebugEvent[]) - */ - protected void doHandleDebugEvents( DebugEvent[] events ) - { - for( int i = 0; i < events.length; i++ ) - { - DebugEvent event = events[i]; - switch( event.getKind() ) - { - case DebugEvent.CREATE: - case DebugEvent.TERMINATE: - if ( event.getSource() instanceof IDebugTarget || - event.getSource() instanceof ICSignal ) - refresh(); - break; - case DebugEvent.SUSPEND : - refresh(); - break; - case DebugEvent.CHANGE : - if ( event.getSource() instanceof ICSignal ) - refresh( event.getSource() ); - break; - } - } - } - - /** - * Refresh the given element in the viewer - must be called in UI thread. - */ - protected void refresh( Object element ) - { - if ( isAvailable() ) - { - getView().showViewer(); - getTableViewer().refresh( element ); - } - } - - /** - * Refresh the viewer - must be called in UI thread. - */ - public void refresh() - { - if ( isAvailable() ) - { - getView().showViewer(); - getTableViewer().refresh(); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewer.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewer.java deleted file mode 100644 index 530a43a5ffe..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewer.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.views.signals; - -import org.eclipse.cdt.debug.core.model.ICSignal; -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler; -import org.eclipse.debug.core.DebugException; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.ComboBoxCellEditor; -import org.eclipse.jface.viewers.ICellModifier; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; - -/** - * Enter type comment. - * - * @since: Jan 30, 2003 - */ -public class SignalsViewer extends TableViewer -{ - // String constants - protected static final String YES_VALUE = "yes"; - protected static final String NO_VALUE = "no"; - - // Column properties - private static final String CP_NAME = "name"; - private static final String CP_PASS = "pass"; - private static final String CP_SUSPEND = "suspend"; - private static final String CP_DESCRIPTION = "description"; - - private IDebugExceptionHandler fExceptionHandler = null; - - /** - * Constructor for SignalsViewer. - * @param parent - * @param style - */ - public SignalsViewer( Composite parent, int style ) - { - super( parent, style ); - Table table = getTable(); - table.setLinesVisible( true ); - table.setHeaderVisible( true ); - table.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - - // Create the table columns - new TableColumn( table, SWT.NULL ); - new TableColumn( table, SWT.NULL ); - new TableColumn( table, SWT.NULL ); - new TableColumn( table, SWT.NULL ); - TableColumn[] columns = table.getColumns(); - columns[0].setResizable( true ); - columns[1].setResizable( false ); - columns[2].setResizable( false ); - columns[3].setResizable( true ); - - columns[0].setText( "Name" ); - columns[1].setText( "Pass" ); - columns[2].setText( "Suspend" ); - columns[3].setText( "Description" ); - - PixelConverter pc = new PixelConverter( parent ); - columns[0].setWidth( pc.convertWidthInCharsToPixels( 20 ) ); - columns[1].setWidth( pc.convertWidthInCharsToPixels( 15 ) ); - columns[2].setWidth( pc.convertWidthInCharsToPixels( 15 ) ); - columns[3].setWidth( pc.convertWidthInCharsToPixels( 50 ) ); - - CellEditor cellEditor = new ComboBoxCellEditor( table, new String[]{ YES_VALUE, NO_VALUE } ); - setCellEditors( new CellEditor[]{ null, cellEditor, cellEditor, null } ); - setColumnProperties( new String[]{ CP_NAME, CP_PASS, CP_SUSPEND, CP_DESCRIPTION } ); - setCellModifier( createCellModifier() ); - } - - private ICellModifier createCellModifier() - { - return new ICellModifier() - { - public boolean canModify( Object element, String property ) - { - if ( element instanceof ICSignal ) - { - return ((ICSignal)element).getDebugTarget().isSuspended(); - } - return false; - } - - public Object getValue( Object element, String property ) - { - if ( element instanceof ICSignal ) - { - if ( CP_PASS.equals( property ) ) - { - return ( ((ICSignal)element).isPassEnabled() ) ? new Integer( 0 ) : new Integer( 1 ); - } - else if ( CP_SUSPEND.equals( property ) ) - { - return ( ((ICSignal)element).isStopEnabled() ) ? new Integer( 0 ) : new Integer( 1 ); - } - } - return null; - } - - public void modify( Object element, String property, Object value ) - { - IStructuredSelection sel = (IStructuredSelection)getSelection(); - Object entry = sel.getFirstElement(); - if ( entry instanceof ICSignal && value instanceof Integer ) - { - try - { - boolean enable = ( ((Integer)value).intValue() == 0 ); - if ( CP_PASS.equals( property ) ) - { - ((ICSignal)entry).setPassEnabled( enable ); - } - else if ( CP_SUSPEND.equals( property ) ) - { - ((ICSignal)entry).setStopEnabled( enable ); - } - refresh( entry ); - } - catch( DebugException e ) - { - Display.getCurrent().beep(); - } - } - } - }; - } - - protected IDebugExceptionHandler getExceptionHandler() - { - return fExceptionHandler; - } - - protected void setExceptionHandler( IDebugExceptionHandler handler ) - { - fExceptionHandler = handler; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationBlock.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationBlock.java deleted file mode 100644 index f3b57aa2ee2..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationBlock.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory; -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.SWTUtil; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * Enter type comment. - * - * @since: Dec 12, 2002 - */ -public class AddDirectorySourceLocationBlock -{ - private Composite fControl = null; - private Text fLocationText = null; - private Text fAssociationText = null; - private Button fAssocitedCheckButton = null; - private Button fSearchSubfoldersButton = null; - private Shell fShell = null; - - private IPath fInitialAssosciationPath = null; - - /** - * Constructor for AddDirectorySourceLocationBlock. - */ - public AddDirectorySourceLocationBlock( IPath initialAssosciationPath ) - { - fInitialAssosciationPath = initialAssosciationPath; - } - - public void createControl( Composite parent ) - { - fShell = parent.getShell(); - fControl = new Composite( parent, SWT.NONE ); - fControl.setLayout( new GridLayout() ); - fControl.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - fControl.setFont( JFaceResources.getDialogFont() ); - - createLocationControls( fControl ); - createAssociationControls( fControl ); - createSearchSubfoldersButton( fControl ); - - setInitialAssociationPath(); - } - - private void setInitialAssociationPath() - { - fAssociationText.setEnabled( ( fInitialAssosciationPath != null ) ); - fAssocitedCheckButton.setSelection( ( fInitialAssosciationPath != null ) ); - if ( fInitialAssosciationPath != null ) - { - fAssociationText.setText( fInitialAssosciationPath.toOSString() ); - } - } - - public Control getControl() - { - return fControl; - } - - protected void createLocationControls( Composite parent ) - { - PixelConverter converter = new PixelConverter( parent ); - Label label = new Label( parent, SWT.NONE ); - label.setText( "Select location directory:" ); - label.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ) ); - Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout( 2, false ) ); - GridData data = new GridData( GridData.FILL_BOTH ); - data.widthHint = converter.convertWidthInCharsToPixels( 70 ); - composite.setLayoutData( data ); - fLocationText = new Text( composite, SWT.SINGLE | SWT.BORDER ); - fLocationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ) ); - Button button = createButton( composite, "&Browse..." ); - button.addSelectionListener( new SelectionAdapter() - { - /* (non-Javadoc) - * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent) - */ - public void widgetSelected( SelectionEvent e ) - { - selectLocation(); - } - } ); - } - - protected void selectLocation() - { - DirectoryDialog dialog = new DirectoryDialog( fShell ); - dialog.setMessage( "Select Location Directory" ); - String result = dialog.open(); - if ( result != null ) - { - fLocationText.setText( result ); - } - } - - protected void createAssociationControls( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout() ); - GridData data = new GridData( GridData.FILL_BOTH ); - composite.setLayoutData( data ); - fAssocitedCheckButton = new Button( composite, SWT.CHECK ); - fAssocitedCheckButton.setText( "&Associate with" ); - fAssociationText = new Text( composite, SWT.SINGLE | SWT.BORDER ); - fAssociationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - fAssocitedCheckButton.addSelectionListener( new SelectionAdapter() - { - /* (non-Javadoc) - * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent) - */ - public void widgetSelected(SelectionEvent e) - { - associationSelectionChanged(); - } - - } ); - } - - protected void associationSelectionChanged() - { - boolean checked = fAssocitedCheckButton.getSelection(); - fAssociationText.setEnabled( checked ); - if ( !checked ) - fAssociationText.setText( "" ); - } - - protected void createSearchSubfoldersButton( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NONE ); - composite.setLayout( new GridLayout() ); - GridData data = new GridData( GridData.FILL_BOTH ); - composite.setLayoutData( data ); - fSearchSubfoldersButton = new Button( composite, SWT.CHECK ); - fSearchSubfoldersButton.setText( "Search sub&folders" ); - } - - protected Button createButton( Composite parent, String label ) - { - Button button = new Button( parent, SWT.PUSH ); - button.setText( label ); - GridData data = new GridData( GridData.END ); - button.setLayoutData( data ); - SWTUtil.setButtonDimensionHint( button ); - button.setFont( parent.getFont() ); - - return button; - } - - public String getLocationPath() - { - return fLocationText.getText().trim(); - } - - public String getAssociationPath() - { - if ( fAssocitedCheckButton.getSelection() ) - { - return fAssociationText.getText().trim(); - } - return ""; - } - - public boolean searchSubfolders() - { - return ( fSearchSubfoldersButton != null ) ? fSearchSubfoldersButton.getSelection() : false; - } - - public IDirectorySourceLocation getSourceLocation() - { - if ( isLocationPathValid() ) - { - Path association = ( isAssociationPathValid() ) ? new Path( getAssociationPath() ) : null; - return SourceLookupFactory.createDirectorySourceLocation( new Path( getLocationPath() ), association, searchSubfolders() ); - } - return null; - } - - public void addDirectoryModifyListener( ModifyListener listener ) - { - if ( fLocationText != null ) - { - fLocationText.addModifyListener( listener ); - } - } - - public void addAssociationModifyListener( ModifyListener listener ) - { - if ( fAssociationText != null ) - { - fAssociationText.addModifyListener( listener ); - } - } - - public void removeDirectoryModifyListener( ModifyListener listener ) - { - if ( fLocationText != null ) - { - fLocationText.removeModifyListener( listener ); - } - } - - public void removeAssociationModifyListener( ModifyListener listener ) - { - if ( fAssociationText != null ) - { - fAssociationText.removeModifyListener( listener ); - } - } - - private boolean isLocationPathValid() - { - if ( fLocationText != null && Path.EMPTY.isValidPath( fLocationText.getText().trim() ) ) - { - Path path = new Path( fLocationText.getText().trim() ); - return ( path.toFile().exists() && path.toFile().isAbsolute() ); - } - return false; - } - - public boolean isAssociationPathValid() - { - String pathString = getAssociationPath(); - if ( pathString.length() > 0 ) - { - return Path.EMPTY.isValidPath( pathString ); - } - return true; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationWizard.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationWizard.java deleted file mode 100644 index 608d207dc57..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddDirectorySourceLocationWizard.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import java.io.File; - -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; - -/** - * - * Enter type comment. - * - * @since Dec 23, 2002 - */ -public class AddDirectorySourceLocationWizard extends Wizard implements INewSourceLocationWizard -{ - protected static final String PAGE_NAME = "AddDirectorySourceLocationWizardPage"; - - /** - * - * Enter type comment. - * - * @since Dec 25, 2002 - */ - public class AddDirtectorySourceLocationWizardPage extends WizardPage - { - private AddDirectorySourceLocationBlock fAttachBlock; - - /** - * Constructor for AddDirtectorySourceLocationWizardPage. - * @param pageName - * @param title - * @param titleImage - */ - public AddDirtectorySourceLocationWizardPage( AddDirectorySourceLocationWizard wizard, IPath initialAssociationPath ) - { - super( PAGE_NAME, "Select Directory", CDebugImages.DESC_WIZBAN_ADD_DIR_SOURCE_LOCATION ); - setWindowTitle( "Add Directory Source Location" ); - setMessage( "Add a local file system directory to the source locations list." ); - setWizard( wizard ); - fAttachBlock = new AddDirectorySourceLocationBlock( initialAssociationPath ); - } - - /** - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite) - */ - public void createControl( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NULL ); - composite.setLayout( new GridLayout() ); - composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - - fAttachBlock.createControl( composite ); - fAttachBlock.addDirectoryModifyListener( new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - directoryChanged(); - } - } ); - - fAttachBlock.addAssociationModifyListener( new ModifyListener() - { - public void modifyText( ModifyEvent e ) - { - associationChanged(); - } - } ); - - setControl( composite ); - updateState(); - } - - protected void directoryChanged() - { - updateState(); - } - - protected void associationChanged() - { - updateState(); - } - - private void updateState() - { - boolean complete = true; - setErrorMessage( null ); - String dirText = fAttachBlock.getLocationPath(); - if ( dirText.length() == 0 ) - { - setErrorMessage( "Directory must not be empty." ); - complete = false; - } - else - { - File file = new File( dirText ); - if ( !file.exists() || !file.isDirectory() ) - { - setErrorMessage( "Directory does not exist." ); - complete = false; - } - else if ( !file.isAbsolute() ) - { - setErrorMessage( "Directory must be absolute." ); - complete = false; - } - } - setPageComplete( complete ); - } - - private IDirectorySourceLocation getSourceLocation() - { - return fAttachBlock.getSourceLocation(); - } - - protected boolean finish() - { - fSourceLocation = getSourceLocation(); - return ( fSourceLocation != null ); - } - } - - protected IDirectorySourceLocation fSourceLocation = null; - private IPath fInitialAssociationPath = null; - - /** - * Constructor for AddDirectorySourceLocationWizard. - */ - public AddDirectorySourceLocationWizard() - { - super(); - } - - /** - * Constructor for AddDirectorySourceLocationWizard. - */ - public AddDirectorySourceLocationWizard( IPath initialAssociationPath ) - { - super(); - fInitialAssociationPath = initialAssociationPath; - } - - /** - * @see org.eclipse.jface.wizard.IWizard#performFinish() - */ - public boolean performFinish() - { - AddDirtectorySourceLocationWizardPage page = (AddDirtectorySourceLocationWizardPage)getStartingPage(); - if ( page != null ) - { - return page.finish(); - } - return false; - } - - /** - * @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription() - */ - public String getDescription() - { - return "Add a local file system directory to the source locations list."; - } - - /** - * @see org.eclipse.jface.wizard.IWizard#addPages() - */ - public void addPages() - { - addPage( new AddDirtectorySourceLocationWizardPage( this, fInitialAssociationPath ) ); - } - - /** - * @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getSourceLocation() - */ - public ICSourceLocation getSourceLocation() - { - return fSourceLocation; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationBlock.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationBlock.java deleted file mode 100644 index 9278b755fd7..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationBlock.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Table; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * - * Enter type comment. - * - * @since Dec 27, 2002 - */ -public class AddProjectSourceLocationBlock -{ - private Composite fControl = null; - private TableViewer fViewer; - - protected IProject[] fProjects = null; - - /** - * Constructor for AddProjectSourceLocationBlock. - */ - public AddProjectSourceLocationBlock( IProject[] projects ) - { - fProjects = projects; - } - - public void createControl( Composite parent ) - { - fControl = new Composite( parent, SWT.NONE ); - fControl.setLayout( new GridLayout() ); - fControl.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - fControl.setFont( JFaceResources.getDialogFont() ); - - //Create a table for the list - Table table = new Table( fControl, SWT.BORDER | SWT.SINGLE ); - GridData data = new GridData( GridData.FILL_BOTH ); - table.setLayoutData( data ); - - // the list viewer - fViewer = new TableViewer( table ); - fViewer.setContentProvider( new IStructuredContentProvider() - { - public Object[] getElements( Object inputElement ) - { - return fProjects; - } - - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - } - - public void dispose() - { - } - } ); - fViewer.setLabelProvider( new WorkbenchLabelProvider() ); - - fViewer.setInput( fProjects ); - } - - public Control getControl() - { - return fControl; - } - - public IProjectSourceLocation getSourceLocation() - { - if ( fViewer != null ) - { - if ( !((IStructuredSelection)fViewer.getSelection()).isEmpty() ) - { - return SourceLookupFactory.createProjectSourceLocation( (IProject)((IStructuredSelection)fViewer.getSelection()).getFirstElement(), false ); - } - } - return null; - } - - public void addSelectionChangedListener( ISelectionChangedListener listener ) - { - if ( fViewer != null ) - { - fViewer.addSelectionChangedListener( listener ); - } - } - - public void removeSelectionChangedListener( ISelectionChangedListener listener ) - { - if ( fViewer != null ) - { - fViewer.removeSelectionChangedListener( listener ); - } - } - - public void addDoubleClickListener( IDoubleClickListener listener ) - { - if ( fViewer != null ) - { - fViewer.addDoubleClickListener( listener ); - } - } - - public void removeDoubleClickListener( IDoubleClickListener listener ) - { - if ( fViewer != null ) - { - fViewer.removeDoubleClickListener( listener ); - } - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationWizard.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationWizard.java deleted file mode 100644 index c85732746d4..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddProjectSourceLocationWizard.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; - -/** - * - * Enter type comment. - * - * @since Dec 23, 2002 - */ -public class AddProjectSourceLocationWizard extends Wizard implements INewSourceLocationWizard -{ - protected static final String PAGE_NAME = "AddProjectSourceLocationWizardPage"; - - protected IProject[] fProjects = null; - - protected IProjectSourceLocation fSourceLocation = null; - - /** - * - * Enter type comment. - * - * @since Dec 27, 2002 - */ - public class AddProjectSourceLocationWizardPage extends WizardPage - implements ISelectionChangedListener, IDoubleClickListener - { - private AddProjectSourceLocationBlock fBlock; - - /** - * Constructor for AddProjectSourceLocationWizardPage. - * @param pageName - */ - public AddProjectSourceLocationWizardPage( AddProjectSourceLocationWizard wizard ) - { - super( PAGE_NAME, "Select Project", CDebugImages.DESC_WIZBAN_ADD_PRJ_SOURCE_LOCATION ); - setWindowTitle( "Add Project Source Location" ); - setMessage( "Add an existing workspace project to the source locations list." ); - setWizard( wizard ); - fBlock = new AddProjectSourceLocationBlock( fProjects ); - setPageComplete( false ); - } - - /** - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite) - */ - public void createControl( Composite parent ) - { - Composite composite = new Composite( parent, SWT.NULL ); - composite.setLayout( new GridLayout() ); - composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); - - fBlock.createControl( composite ); - fBlock.addDoubleClickListener( this ); - fBlock.addSelectionChangedListener( this ); - - setControl( composite ); - } - - /** - * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(SelectionChangedEvent) - */ - public void selectionChanged( SelectionChangedEvent event ) - { - setPageComplete( !event.getSelection().isEmpty() ); - } - - /** - * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent) - */ - public void doubleClick( DoubleClickEvent event ) - { - - } - - protected boolean finish() - { - if ( fBlock != null ) - { - fSourceLocation = fBlock.getSourceLocation(); - } - return ( fSourceLocation != null ); - } - } - /** - * Constructor for AddProjectSourceLocationWizard. - */ - public AddProjectSourceLocationWizard( IProject[] projects ) - { - super(); - fProjects = projects; - } - - /** - * @see org.eclipse.jface.wizard.IWizard#performFinish() - */ - public boolean performFinish() - { - AddProjectSourceLocationWizardPage page = (AddProjectSourceLocationWizardPage)getStartingPage(); - if ( page != null ) - { - return page.finish(); - } - return false; - } - - /** - * @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription() - */ - public String getDescription() - { - return "Add an existing project to the source locations list."; - } - - /** - * @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getSourceLocation() - */ - public ICSourceLocation getSourceLocation() - { - return fSourceLocation; - } - - /** - * @see org.eclipse.jface.wizard.IWizard#addPages() - */ - public void addPages() - { - addPage( new AddProjectSourceLocationWizardPage( this ) ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddSourceLocationWizard.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddSourceLocationWizard.java deleted file mode 100644 index f59b4d167cd..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/AddSourceLocationWizard.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard; -import org.eclipse.jface.wizard.Wizard; - -/** - * Enter type comment. - * - * @since: Dec 20, 2002 - */ -public class AddSourceLocationWizard extends Wizard implements INewSourceLocationWizard -{ - private ICSourceLocation[] fLocations = null; - - /** - * Constructor for AddSourceLocationWizard. - */ - public AddSourceLocationWizard( ICSourceLocation[] locations ) - { - super(); - setWindowTitle( "Add Source Location" ); - setForcePreviousAndNextButtons( true ); - fLocations = locations; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.wizard.IWizard#performFinish() - */ - public boolean performFinish() - { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.wizard.Wizard#addPages() - */ - public void addPages() - { - addPage( new SourceLocationSelectionPage( fLocations ) ); - } - - public ICSourceLocation getSourceLocation() - { - SourceLocationSelectionPage page = (SourceLocationSelectionPage)getStartingPage(); - if ( page != null ) - { - return page.getSourceLocation(); - } - return null; - } - - /** - * @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription() - */ - public String getDescription() - { - return ""; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationSelectionPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationSelectionPage.java deleted file mode 100644 index 9632125752f..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationSelectionPage.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import java.util.ArrayList; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.wizard.IWizardNode; -import org.eclipse.jface.wizard.WizardSelectionPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Table; - -/** - * - * Enter type comment. - * - * @since Dec 24, 2002 - */ -public class SourceLocationSelectionPage extends WizardSelectionPage - implements ISelectionChangedListener, - IDoubleClickListener -{ - private static final String PAGE_NAME = "Add Source Location"; - private final static int SIZING_LISTS_HEIGHT = 200; - private final static int SIZING_LISTS_WIDTH = 150; - - protected TableViewer fWizardSelectionViewer; - - protected Object[] fElements = null; - - /** - * Constructor for SourceLocationSelectionPage. - * @param pageName - */ - public SourceLocationSelectionPage( ICSourceLocation[] locations ) - { - super( PAGE_NAME ); - setTitle( "Select" ); - setImageDescriptor( CDebugImages.DESC_WIZBAN_ADD_SOURCE_LOCATION ); - fElements = new Object[] { new AddProjectSourceLocationWizard( getProjectList( locations ) ), - new AddDirectorySourceLocationWizard() }; - } - - /** - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite) - */ - public void createControl( Composite parent ) - { - // create composite for page. - Composite outerContainer = new Composite( parent, SWT.NONE ); - outerContainer.setLayout( new GridLayout() ); - outerContainer.setLayoutData( new GridData( GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL ) ); - - new Label( outerContainer, SWT.NONE ).setText( "Select source location type:" ); - - //Create a table for the list - Table table = new Table( outerContainer, SWT.BORDER ); - GridData data = new GridData( GridData.FILL_HORIZONTAL ); - data.widthHint = SIZING_LISTS_WIDTH; - data.heightHint = SIZING_LISTS_HEIGHT; - table.setLayoutData( data ); - - // the list viewer - fWizardSelectionViewer = new TableViewer( table ); - fWizardSelectionViewer.setContentProvider( new IStructuredContentProvider() - { - public Object[] getElements( Object inputElement ) - { - return fElements; - } - - public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) - { - } - - public void dispose() - { - } - } ); - fWizardSelectionViewer.setLabelProvider( new LabelProvider() - { - public String getText( Object element ) - { - if ( element instanceof AddProjectSourceLocationWizard ) - { - return "Existing Project Into Workspace"; - } - if ( element instanceof AddDirectorySourceLocationWizard ) - { - return "File System Directory"; - } - return super.getText( element ); - } - - /** - * @see org.eclipse.jface.viewers.LabelProvider#getImage(Object) - */ - public Image getImage(Object element) - { - if ( element instanceof AddProjectSourceLocationWizard ) - { - return CDebugImages.get( CDebugImages.IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION ); - } - if ( element instanceof AddDirectorySourceLocationWizard ) - { - return CDebugImages.get( CDebugImages.IMG_TOOLS_ADD_DIR_SOURCE_LOCATION ); - } - return super.getImage( element ); - } - } ); - fWizardSelectionViewer.addSelectionChangedListener( this ); - fWizardSelectionViewer.addDoubleClickListener( this ); - - fWizardSelectionViewer.setInput( fElements ); - - fWizardSelectionViewer.setSelection( new StructuredSelection( fElements[0] ) ); - - setControl( outerContainer ); - } - - /** - * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(SelectionChangedEvent) - */ - public void selectionChanged( SelectionChangedEvent event ) - { - setErrorMessage( null ); - IStructuredSelection selection = (IStructuredSelection)event.getSelection(); - INewSourceLocationWizard currentWizardSelection = (INewSourceLocationWizard)selection.getFirstElement(); - if ( currentWizardSelection == null ) - { - setMessage( null ); - setSelectedNode( null ); - return; - } - - setSelectedNode( createWizardNode( currentWizardSelection ) ); - setMessage( currentWizardSelection.getDescription() ); - } - - /** - * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent) - */ - public void doubleClick( DoubleClickEvent event ) - { - selectionChanged( new SelectionChangedEvent( fWizardSelectionViewer, fWizardSelectionViewer.getSelection() ) ); - getContainer().showPage( getNextPage() ); - } - - private IWizardNode createWizardNode( INewSourceLocationWizard wizard ) - { - return new SourceLocationWizardNode( wizard ); - } - - /** - * @see org.eclipse.jface.dialogs.IDialogPage#dispose() - */ - public void dispose() - { - if ( fElements != null ) - { - for ( int i = 0; i < fElements.length; ++i ) - { - ((INewSourceLocationWizard)fElements[i]).dispose(); - } - fElements = null; - } - super.dispose(); - } - - public ICSourceLocation getSourceLocation() - { - return ((INewSourceLocationWizard)getSelectedNode().getWizard()).getSourceLocation(); - } - - private IProject[] getProjectList( ICSourceLocation[] locations ) - { - ArrayList projects = new ArrayList( locations.length ); - for ( int i = 0; i < locations.length; ++i ) - { - if ( locations[i] instanceof IProjectSourceLocation ) - { - projects.add( ((IProjectSourceLocation)locations[i]).getProject() ); - } - } - IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - ArrayList result = new ArrayList( allProjects.length ); - for ( int i = 0; i < allProjects.length; ++i ) - { - if ( ( CoreModel.getDefault().hasCNature( allProjects[i] ) || CoreModel.getDefault().hasCNature( allProjects[i] ) ) && - allProjects[i].isOpen() && - !projects.contains( allProjects[i] ) ) - { - result.add( allProjects[i] ); - } - } - return (IProject[])result.toArray( new IProject[result.size()] ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationWizardNode.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationWizardNode.java deleted file mode 100644 index a56190eb692..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/wizards/SourceLocationWizardNode.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.wizards; - -import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard; -import org.eclipse.jface.wizard.IWizard; -import org.eclipse.jface.wizard.IWizardNode; -import org.eclipse.swt.graphics.Point; - -/** - * - * Enter type comment. - * - * @since Dec 25, 2002 - */ -public class SourceLocationWizardNode implements IWizardNode -{ - private INewSourceLocationWizard fWizard = null; - - /** - * Constructor for SourceLocationWizardNode. - */ - public SourceLocationWizardNode( INewSourceLocationWizard wizard ) - { - fWizard = wizard; - } - - /** - * @see org.eclipse.jface.wizard.IWizardNode#dispose() - */ - public void dispose() - { - } - - /** - * @see org.eclipse.jface.wizard.IWizardNode#getExtent() - */ - public Point getExtent() - { - return new Point( -1, -1 ); - } - - /** - * @see org.eclipse.jface.wizard.IWizardNode#getWizard() - */ - public IWizard getWizard() - { - return fWizard; - } - - /** - * @see org.eclipse.jface.wizard.IWizardNode#isContentCreated() - */ - public boolean isContentCreated() - { - return ( fWizard != null && fWizard.getPageCount() > 0 ); - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java deleted file mode 100644 index a31175776ef..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java +++ /dev/null @@ -1,531 +0,0 @@ -package org.eclipse.cdt.debug.ui; - -import java.util.HashMap; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.IAsyncExecutor; -import org.eclipse.cdt.debug.core.model.ISwitchToFrame; -import org.eclipse.cdt.debug.core.model.ISwitchToThread; -import org.eclipse.cdt.debug.core.sourcelookup.IDisassemblyStorage; -import org.eclipse.cdt.debug.internal.ui.CDTDebugModelPresentation; -import org.eclipse.cdt.debug.internal.ui.CDebugImageDescriptorRegistry; -import org.eclipse.cdt.debug.internal.ui.ColorManager; -import org.eclipse.cdt.debug.internal.ui.editors.DisassemblyDocumentProvider; -import org.eclipse.cdt.debug.internal.ui.editors.DisassemblyEditorInput; -import org.eclipse.cdt.debug.internal.ui.preferences.CDebugPreferencePage; -import org.eclipse.cdt.debug.internal.ui.preferences.MemoryViewPreferencePage; -import org.eclipse.cdt.debug.internal.ui.preferences.RegistersViewPreferencePage; -import org.eclipse.cdt.debug.internal.ui.preferences.SharedLibrariesViewPreferencePage; -import org.eclipse.cdt.debug.ui.sourcelookup.DefaultSourceLocator; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.IThread; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * The main plugin class to be used in the desktop. - */ -public class CDebugUIPlugin extends AbstractUIPlugin - implements ISelectionListener, - IDebugEventSetListener, - IAsyncExecutor -{ - //The shared instance. - private static CDebugUIPlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - protected Map fDebuggerPageMap; - - private CDebugImageDescriptorRegistry fImageDescriptorRegistry; - - // Document provider for disassembly editor - private DisassemblyDocumentProvider fDisassemblyDocumentProvider = null; - - /** - * The constructor. - */ - public CDebugUIPlugin( IPluginDescriptor descriptor ) - { - super( descriptor ); - plugin = this; - try - { - resourceBundle = - ResourceBundle.getBundle( "org.eclipse.cdt.debug.ui.CDebugUIPluginResources" ); - } - catch( MissingResourceException x ) - { - resourceBundle = null; - } - } - - /** - * Returns the shared instance. - */ - public static CDebugUIPlugin getDefault() - { - return plugin; - } - - /** - * Returns the workspace instance. - */ - public static IWorkspace getWorkspace() - { - return ResourcesPlugin.getWorkspace(); - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) - { - ResourceBundle bundle = CDebugUIPlugin.getDefault().getResourceBundle(); - try - { - return bundle.getString( key ); - } - catch ( MissingResourceException e ) - { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() - { - return resourceBundle; - } - - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() - { - if ( getDefault() == null ) - { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.debug.ui"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - /** - * Returns the a color based on the type of output. - * Valid types: - *
          • CHANGED_REGISTER_RGB
          • - */ - public static Color getPreferenceColor( String type ) - { - return ColorManager.getDefault().getColor( - PreferenceConverter.getColor( getDefault().getPreferenceStore(), type ) ); - } - - /** - * @see AbstractUIPlugin#initializeDefaultPreferences - */ - protected void initializeDefaultPreferences( IPreferenceStore pstore ) - { - MemoryViewPreferencePage.initDefaults( pstore ); - RegistersViewPreferencePage.initDefaults( pstore ); - SharedLibrariesViewPreferencePage.initDefaults( pstore ); - CDebugPreferencePage.initDefaults( pstore ); - } - - public static CDTDebugModelPresentation getDebugModelPresentation() - { - return CDTDebugModelPresentation.getDefault(); - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status status to log - */ - public static void log( IStatus status ) - { - getDefault().getLog().log( status ); - } - - /** - * Logs an internal error with the specified throwable - * - * @param e the exception to be logged - */ - public static void log( Throwable e ) - { - log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, "Internal Error", e ) ); - } - - /** - * Logs an internal error with the specified message. - * - * @param message the error message to log - */ - public static void logErrorMessage( String message ) - { - log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, message, null ) ); - } - - public ILaunchConfigurationTab getDebuggerPage(String debuggerID) { - if (fDebuggerPageMap == null) { - initializeDebuggerPageMap(); - } - IConfigurationElement configElement = (IConfigurationElement) fDebuggerPageMap.get(debuggerID); - ILaunchConfigurationTab tab = null; - if (configElement != null) { - try { - tab = (ILaunchConfigurationTab) configElement.createExecutableExtension("class"); //$NON-NLS-1$ - } catch(CoreException ce) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), 100, "An error occurred retrieving a C Debugger page", ce)); - } - } - return tab; - } - - protected void initializeDebuggerPageMap() { - fDebuggerPageMap = new HashMap(10); - - IPluginDescriptor descriptor= getDefault().getDescriptor(); - IExtensionPoint extensionPoint= descriptor.getExtensionPoint("CDebuggerPage"); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - for (int i = 0; i < infos.length; i++) { - String id = infos[i].getAttribute("debuggerID"); //$NON-NLS-1$ - fDebuggerPageMap.put(id, infos[i]); - } - } - - public static void errorDialog( String message, IStatus status ) - { - log( status ); - Shell shell = getActiveWorkbenchShell(); - if ( shell != null ) - { - ErrorDialog.openError( shell, "Error", message, status ); - } - } - - public static void errorDialog( String message, Throwable t ) - { - log( t ); - Shell shell = getActiveWorkbenchShell(); - if ( shell != null ) - { - IStatus status = new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, t.getMessage(), null ); //$NON-NLS-1$ - ErrorDialog.openError( shell, "Error", message, status ); - } - } - - /** - * Returns the active workbench window - * - * @return the active workbench window - */ - public static IWorkbenchWindow getActiveWorkbenchWindow() - { - return getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - public static IWorkbenchPage getActivePage() - { - IWorkbenchWindow w = getActiveWorkbenchWindow(); - if ( w != null ) - { - return w.getActivePage(); - } - return null; - } - - /** - * Returns the active workbench shell or null if none - * - * @return the active workbench shell or null if none - */ - public static Shell getActiveWorkbenchShell() - { - IWorkbenchWindow window = getActiveWorkbenchWindow(); - if ( window != null ) - { - return window.getShell(); - } - return null; - } - - /** - * Returns the standard display to be used. The method first checks, if - * the thread calling this method has an associated display. If so, this - * display is returned. Otherwise the method returns the default display. - */ - public static Display getStandardDisplay() - { - Display display; - display = Display.getCurrent(); - if ( display == null ) - display = Display.getDefault(); - return display; - } - - /** - * Returns the image descriptor registry used for this plugin. - */ - public static CDebugImageDescriptorRegistry getImageDescriptorRegistry() - { - if ( getDefault().fImageDescriptorRegistry == null ) - { - getDefault().fImageDescriptorRegistry = new CDebugImageDescriptorRegistry(); - } - return getDefault().fImageDescriptorRegistry; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#shutdown() - */ - public void shutdown() throws CoreException - { - DebugPlugin.getDefault().removeDebugEventListener( this ); - IWorkbenchWindow ww = getActiveWorkbenchWindow(); - if ( ww != null ) - { - ww.getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } - if ( fImageDescriptorRegistry != null ) - { - fImageDescriptorRegistry.dispose(); - } - CDebugCorePlugin.getDefault().setAsyncExecutor( null ); - super.shutdown(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#startup() - */ - public void startup() throws CoreException - { - super.startup(); - IWorkbenchWindow ww = getActiveWorkbenchWindow(); - if ( ww != null ) - { - ww.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } - CDebugCorePlugin.getDefault().setAsyncExecutor( this ); - DebugPlugin.getDefault().addDebugEventListener( this ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) - */ - public void selectionChanged( IWorkbenchPart part, ISelection selection ) - { - if ( selection != null && selection instanceof IStructuredSelection ) - { - if ( ((IStructuredSelection)selection).size() == 1 ) - { - Object element = ((IStructuredSelection)selection).getFirstElement(); - if ( element != null && element instanceof IThread ) - { - if ( ((IThread)element).getDebugTarget() instanceof ISwitchToThread ) - { - try - { - if ( !sameThread( (IDebugElement)element ) ) - { - ((ISwitchToThread)((IThread)element).getDebugTarget()).setCurrentThread( (IThread)element ); - } - } - catch( DebugException e ) - { - errorDialog( e.getMessage(), e ); - } - } - } - else if ( element != null && element instanceof IStackFrame ) - { - if ( ((IStackFrame)element).getThread() instanceof ISwitchToFrame ) - { - try - { - if ( !sameThread( (IDebugElement)element ) ) - { - ((ISwitchToThread)((IStackFrame)element).getDebugTarget()).setCurrentThread( ((IStackFrame)element).getThread() ); - } - ((ISwitchToFrame)((IStackFrame)element).getThread()).switchToFrame( (IStackFrame)element ); - } - catch( DebugException e ) - { -// errorDialog( "Switch to stack frame failed.", e ); - } - } - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(DebugEvent[]) - */ - public void handleDebugEvents( DebugEvent[] events ) - { - for ( int i = 0; i < events.length; i++ ) - { - DebugEvent event = events[i]; - if ( event.getKind() == DebugEvent.TERMINATE ) - { - Object element = event.getSource(); - if ( element != null && element instanceof IDebugTarget ) - { - closeDisassemblyEditors( (IDebugTarget)element ); - } - } - } - } - - private void closeDisassemblyEditors( final IDebugTarget target ) - { - IWorkbenchWindow[] windows = getWorkbench().getWorkbenchWindows(); - for ( int i = 0; i < windows.length; ++i ) - { - IWorkbenchPage[] pages = windows[i].getPages(); - for ( int j = 0; j < pages.length; ++j ) - { - IEditorReference[] refs = pages[j].getEditorReferences(); - for ( int k = 0; k < refs.length; ++k ) - { - IEditorPart editor = refs[k].getEditor( false ); - if ( editor != null ) - { - IEditorInput input = editor.getEditorInput(); - if ( input != null && input instanceof DisassemblyEditorInput ) - { - try - { - IStorage storage = ((DisassemblyEditorInput)input).getStorage(); - if ( storage != null && storage instanceof IDisassemblyStorage && - target.equals( ((IDisassemblyStorage)storage).getDebugTarget() ) ) - { - Shell shell = windows[i].getShell(); - if ( shell != null ) - { - Display display = shell.getDisplay(); - if ( display != null ) - { - final IWorkbenchPage page = pages[j]; - final IEditorPart editor0 = editor; - display.asyncExec( new Runnable() - { - public void run() - { - page.closeEditor( editor0, false ); - } - } ); - } - } - } - } - catch( CoreException e ) - { - // ignore - } - } - } - } - } - } - } - - private boolean sameThread( IDebugElement element ) throws DebugException - { - if ( element.getDebugTarget() instanceof ISwitchToThread ) - { - if ( element instanceof IThread ) - { - return ((IThread)element).equals( ((ISwitchToThread)element.getDebugTarget()).getCurrentThread() ); - } - if ( element instanceof IStackFrame ) - { - return ((IStackFrame)element).getThread().equals( ((ISwitchToThread)element.getDebugTarget()).getCurrentThread() ); - } - } - return false; - } - - /** - * Returns the document provider used for the disassembly editor - */ - public DisassemblyDocumentProvider getDisassemblyDocumentProvider() - { - if ( fDisassemblyDocumentProvider == null ) - fDisassemblyDocumentProvider = new DisassemblyDocumentProvider(); - return fDisassemblyDocumentProvider; - } - - /* (non-Javadoc) - * @see org.eclipse.cdt.debug.core.IAsyncExecutor#asyncExec(Runnable) - */ - public void asyncExec( Runnable runnable ) - { - Display display = getStandardDisplay(); - if ( display != null ) - { - display.asyncExec( runnable ); - } - } - - public static IPersistableSourceLocator createDefaultSourceLocator() - { - return new DefaultSourceLocator(); - } - - public static String getDefaultSourceLocatorID() - { - return DefaultSourceLocator.ID_DEFAULT_SOURCE_LOCATOR; - } - - /* - * to support old launch configurations - */ - public static String getDefaultSourceLocatorOldID() - { - return DefaultSourceLocator.ID_OLD_DEFAULT_SOURCE_LOCATOR; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java deleted file mode 100644 index a2c80022c9e..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/ICDebugUIConstants.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.ui; - - - -/** - * - * Constant definitions for C/C++ Debug UI plug-in. - * - * @since Jul 23, 2002 - */ -public interface ICDebugUIConstants -{ - /** - * C/C++ Debug UI plug-in identifier (value "org.eclipse.cdt.debug.ui"). - */ - public static final String PLUGIN_ID = CDebugUIPlugin.getUniqueIdentifier(); - - // Debug views - - /** - * Registers view identifier (value "org.eclipse.cdt.debug.ui.RegitersView"). - */ - public static final String ID_REGISTERS_VIEW = "org.eclipse.cdt.debug.ui.RegitersView"; //$NON-NLS-1$ - - /** - * Memory view identifier (value "org.eclipse.cdt.debug.ui.MemoryView"). - */ - public static final String ID_MEMORY_VIEW = "org.eclipse.cdt.debug.ui.MemoryView"; //$NON-NLS-1$ - - /** - * Status code indicating an unexpected internal error. - */ - public static final int INTERNAL_ERROR = 150; - - /** - * Identifier for an empty group preceeding a - * register group in a menu (value "emptyRegisterGroup"). - */ - public static final String EMPTY_REGISTER_GROUP = "emptyRegisterGroup"; //$NON-NLS-1$ - - /** - * Identifier for a register group in a menu (value "registerGroup"). - */ - public static final String REGISTER_GROUP = "registerGroup"; //$NON-NLS-1$ - - /** - * Identifier for an empty group preceeding a - * memory group in a menu (value "emptyMemoryGroup"). - */ - public static final String EMPTY_MEMORY_GROUP = "emptyMemoryGroup"; //$NON-NLS-1$ - - /** - * Identifier for a memory group in a menu (value "memoryGroup"). - */ - public static final String MEMORY_GROUP = "memoryGroup"; //$NON-NLS-1$ - - /** - * Identifier for an empty group preceeding a - * format group in a menu (value "emptyFormatGroup"). - */ - public static final String EMPTY_FORMAT_GROUP = "emptyFormatGroup"; //$NON-NLS-1$ - - /** - * Identifier for a format group in a menu (value "formatGroup"). - */ - public static final String FORMAT_GROUP = "formatGroup"; //$NON-NLS-1$ - - /** - * Identifier for an empty group preceeding a - * refresh group in a menu (value "emptyRefreshGroup"). - */ - public static final String EMPTY_REFRESH_GROUP = "emptyRefreshGroup"; //$NON-NLS-1$ - - /** - * Identifier for a refresh group in a menu (value "refreshGroup" - * ). - */ - public static final String REFRESH_GROUP = "refreshGroup"; //$NON-NLS-1$ - /** - * Identifier for an empty group preceeding a - * shared libraries group in a menu (value " - * emptySharedLibrariesGroup" - * ). - */ - public static final String EMPTY_SHARED_LIBRARIES_GROUP = "emptySharedLibrariesGroup"; //$NON-NLS-1$ - - /** - * Identifier for a shared libraries group in a menu (value " - * sharedLibrariesGroup" - * ). - */ - public static final String SHARED_LIBRARIES_GROUP = "sharedLibrariesGroup"; //$NON-NLS-1$ -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java deleted file mode 100644 index 5dac8882209..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/DefaultSourceLocator.java +++ /dev/null @@ -1,434 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.ui.sourcelookup; - -import java.io.IOException; -import java.io.StringReader; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.xerces.dom.DocumentImpl; -import org.eclipse.cdt.core.resources.FileStorage; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.model.IStackFrameInfo; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.core.sourcelookup.ISourceMode; -import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory; -import org.eclipse.cdt.debug.internal.ui.CDebugImageDescriptorRegistry; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.cdt.debug.internal.ui.dialogfields.SelectionButtonDialogField; -import org.eclipse.cdt.debug.internal.ui.editors.FileNotFoundElement; -import org.eclipse.cdt.debug.internal.ui.editors.NoSymbolOrSourceElement; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.ListDialog; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Enter type comment. - * - * @since Oct 24, 2003 - */ -public class DefaultSourceLocator implements IPersistableSourceLocator, IAdaptable -{ - public class SourceSelectionDialog extends ListDialog - { - private SelectionButtonDialogField fAlwaysUseThisFileButton = new SelectionButtonDialogField( SWT.CHECK ); - - public SourceSelectionDialog( Shell parent ) - { - super( parent ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.dialogs.ListDialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createDialogArea( Composite parent ) - { - Composite comp = ControlFactory.createComposite( parent, 1 ); - super.createDialogArea( comp ); - Composite comp1 = ControlFactory.createComposite( comp, 1 ); - fAlwaysUseThisFileButton.setLabelText( "Always map to the selection" ); - fAlwaysUseThisFileButton.doFillIntoGrid( comp1, 1 ); - return comp; - } - - public boolean alwaysMapToSelection() - { - return fAlwaysUseThisFileButton.isSelected(); - } - } - - public class SourceElementLabelProvider extends LabelProvider - { - protected CDebugImageDescriptorRegistry fDebugImageRegistry = CDebugUIPlugin.getImageDescriptorRegistry(); - - public SourceElementLabelProvider() - { - super(); - } - - public String getText(Object element) - { - if ( element instanceof IFile ) - return ((IFile)element).getFullPath().toString(); - if ( element instanceof FileStorage ) - return ((FileStorage)element).getFullPath().toOSString(); - return super.getText(element); - } - - public Image getImage( Object element ) - { - if ( element instanceof IFile ) - return fDebugImageRegistry.get( CDebugImages.DESC_OBJS_WORKSPACE_SOURCE_FILE ); - if ( element instanceof FileStorage ) - return fDebugImageRegistry.get( CDebugImages.DESC_OBJS_EXTERNAL_SOURCE_FILE ); - return super.getImage( element ); - } - } - - /** - * Identifier for the 'Default C/C++ Source Locator' extension - * (value "org.eclipse.cdt.debug.ui.DefaultSourceLocator"). - */ - public static final String ID_DEFAULT_SOURCE_LOCATOR = CDebugUIPlugin.getUniqueIdentifier() + ".DefaultSourceLocator"; //$NON-NLS-1$ - // to support old configurations - public static final String ID_OLD_DEFAULT_SOURCE_LOCATOR = "org.eclipse.cdt.launch" + ".DefaultSourceLocator"; //$NON-NLS-1$ - - private static final String ELEMENT_NAME = "PromptingSourceLocator"; - private static final String ATTR_PROJECT = "project"; - private static final String ATTR_MEMENTO = "memento"; - - /** - * The project being debugged. - */ - private IProject fProject = null; - - /** - * Underlying source locator. - */ - private ICSourceLocator fSourceLocator; - - private HashMap fFramesToSource = null; - private HashMap fNamesToSource = null; - - public DefaultSourceLocator() - { - super(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento() - */ - public String getMemento() throws CoreException - { - if ( fSourceLocator != null ) - { - Document doc = new DocumentImpl(); - Element node = doc.createElement( ELEMENT_NAME ); - doc.appendChild( node ); - node.setAttribute( ATTR_PROJECT, fSourceLocator.getProject().getName() ); - - IPersistableSourceLocator psl = getPersistableSourceLocator(); - if ( psl != null ) - { - node.setAttribute( ATTR_MEMENTO, psl.getMemento() ); - } - try - { - return CDebugUtils.serializeDocument( doc, " " ); - } - catch( IOException e ) - { - abort( "Unable to create memento for C/C++ source locator.", e ); - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String) - */ - public void initializeFromMemento( String memento ) throws CoreException - { - Exception ex = null; - try - { - Element root = null; - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - StringReader reader = new StringReader( memento ); - InputSource source = new InputSource( reader ); - root = parser.parse( source ).getDocumentElement(); - - if ( !root.getNodeName().equalsIgnoreCase( ELEMENT_NAME ) ) - { - abort( "Unable to restore prompting source locator - invalid format.", null ); - } - - String projectName = root.getAttribute( ATTR_PROJECT ); - String data = root.getAttribute( ATTR_MEMENTO ); - if ( isEmpty( projectName ) ) - { - abort( "Unable to restore prompting source locator - invalid format.", null ); - } - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); - if ( project == null || !project.exists() || !project.isOpen() ) - { - abort( MessageFormat.format( "Unable to restore prompting source locator - project {0} not found.", new String[] { projectName } ), null ); - } - ICSourceLocator locator = getCSourceLocator(); - if ( locator == null ) - { - fSourceLocator = SourceLookupFactory.createSourceLocator( project ); - } - else if ( locator.getProject() != null && !project.equals( locator.getProject() ) ) - { - return; - } - IPersistableSourceLocator psl = getPersistableSourceLocator(); - if ( psl != null ) - { - psl.initializeFromMemento( data ); - } - else - { - abort( "Unable to restore C/C++ source locator - invalid format.", null ); - } - return; - } - catch( ParserConfigurationException e ) - { - ex = e; - } - catch( SAXException e ) - { - ex = e; - } - catch( IOException e ) - { - ex = e; - } - abort( "Exception occurred initializing source locator.", ex ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeDefaults( ILaunchConfiguration configuration ) throws CoreException - { - fSourceLocator = SourceLookupFactory.createSourceLocator( getProject( configuration ) ); - String memento = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "" ); - if ( !isEmpty( memento ) ) - initializeFromMemento( memento ); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter( Class adapter ) - { - if ( fSourceLocator instanceof IAdaptable ) - { - if ( adapter.equals( ICSourceLocator.class ) ) - { - return ((IAdaptable)fSourceLocator).getAdapter( adapter ); - } - if ( adapter.equals( IResourceChangeListener.class ) ) - { - return ((IAdaptable)fSourceLocator).getAdapter( adapter ); - } - if ( adapter.equals( ISourceMode.class ) ) - { - return ((IAdaptable)fSourceLocator).getAdapter( adapter ); - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(org.eclipse.debug.core.model.IStackFrame) - */ - public Object getSourceElement( IStackFrame stackFrame ) - { - Object res = cacheLookup( stackFrame ); - if ( res == null ) - { - res = fSourceLocator.getSourceElement( stackFrame ); - if ( res instanceof List ) - { - List list = (List)res; - if ( list.size() != 0 ) - { - SourceSelectionDialog dialog = createSourceSelectionDialog( list ); - dialog.open(); - Object[] objs = dialog.getResult(); - res = ( objs != null && objs.length > 0 ) ? objs[0] : null; - if ( res != null ) - cacheSourceElement( stackFrame, res, dialog.alwaysMapToSelection() ); - } - else - res = null; - } - } - if ( res == null ) - { - IStackFrameInfo frameInfo = (IStackFrameInfo)stackFrame.getAdapter( IStackFrameInfo.class ); - if ( frameInfo != null && frameInfo.getFile() != null && frameInfo.getFile().length() > 0 ) - { - res = new FileNotFoundElement( stackFrame ); - } - else // don't show in editor - { - res = new NoSymbolOrSourceElement( stackFrame ); - } - } - return res; - } - - public IProject getProject() - { - return fProject; - } - - protected void saveChanges( ILaunchConfiguration configuration, IPersistableSourceLocator locator ) - { - try - { - ILaunchConfigurationWorkingCopy copy = configuration.copy( configuration.getName() ); - copy.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() ); - copy.doSave(); - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null ); - } - } - - private SourceSelectionDialog createSourceSelectionDialog( List list ) - { - SourceSelectionDialog dialog = new SourceSelectionDialog( CDebugUIPlugin.getActiveWorkbenchShell() ); - dialog.setInput( list.toArray() ); - dialog.setContentProvider( new ArrayContentProvider() ); - dialog.setLabelProvider( new SourceElementLabelProvider() ); - dialog.setTitle( "Selection needed" ); - dialog.setMessage( "Debugger has found multiple files with the same name.\nPlease select one associated with the selected stack frame." ); - dialog.setInitialSelections( new Object[] { list.get( 0 ) } ); - return dialog; - } - - private void cacheSourceElement( IStackFrame frame, Object sourceElement, boolean alwaysMapToSelection ) - { - if ( alwaysMapToSelection ) - { - String name = getFileName( frame ); - if ( name != null ) - { - if ( fNamesToSource == null ) - fNamesToSource = new HashMap(); - fNamesToSource.put( name, sourceElement ); - } - } - else - { - if ( fFramesToSource == null ) - fFramesToSource = new HashMap(); - fFramesToSource.put( frame, sourceElement ); - } - } - - private Object cacheLookup( IStackFrame frame ) - { - String name = getFileName( frame ); - if ( name != null && fNamesToSource != null ) - { - Object result = fNamesToSource.get( name ); - if ( result != null ) - return result; - } - return ( fFramesToSource != null ) ? fFramesToSource.get( frame ) : null; - } - - private String getFileName( IStackFrame frame ) - { - IStackFrameInfo frameInfo = (IStackFrameInfo)frame.getAdapter( IStackFrameInfo.class ); - if ( frameInfo != null ) - { - String name = frameInfo.getFile(); - if ( name != null && name.trim().length() > 0 ) - return name.trim(); - } - return null; - } - - private ICSourceLocator getCSourceLocator() - { - return fSourceLocator; - } - - private IPersistableSourceLocator getPersistableSourceLocator() - { - ICSourceLocator sl = getCSourceLocator(); - return ( sl instanceof IPersistableSourceLocator ) ? (IPersistableSourceLocator)sl : null; - } - - /** - * Throws an internal error exception - */ - private void abort( String message, Throwable e ) throws CoreException - { - IStatus s = new Status( IStatus.ERROR, CDebugUIPlugin.getUniqueIdentifier(), 0, message, e ); - throw new CoreException( s ); - } - - private boolean isEmpty( String string ) - { - return string == null || string.length() == 0; - } - - private IProject getProject( ILaunchConfiguration configuration ) throws CoreException - { - String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null ); - if ( !isEmpty( projectName ) ) - { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); - if ( project.exists() ) - { - return project; - } - } - abort( MessageFormat.format( "Project \"{0}\" does not exist.", new String[] { projectName } ), null ); - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/INewSourceLocationWizard.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/INewSourceLocationWizard.java deleted file mode 100644 index 6be96fe88ef..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/INewSourceLocationWizard.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.ui.sourcelookup; - -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.jface.wizard.IWizard; - -/** - * - * Enter type comment. - * - * @since Dec 25, 2002 - */ -public interface INewSourceLocationWizard extends IWizard -{ - String getDescription(); - ICSourceLocation getSourceLocation(); -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceListDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceListDialogField.java deleted file mode 100644 index 831dc2f83a5..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceListDialogField.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.ui.sourcelookup; - -import java.util.List; -import java.util.Observable; -import java.util.Observer; - -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.internal.core.sourcelookup.CDirectorySourceLocation; -import org.eclipse.cdt.debug.internal.ui.dialogfields.IListAdapter; -import org.eclipse.cdt.debug.internal.ui.dialogfields.ListDialogField; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.ComboBoxCellEditor; -import org.eclipse.jface.viewers.ICellModifier; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; - - -public class SourceListDialogField extends ListDialogField -{ - public class ObservableSourceList extends Observable - { - protected synchronized void setChanged() - { - super.setChanged(); - } - } - - // String constants - protected static final String YES_VALUE = "yes"; - protected static final String NO_VALUE = "no"; - - // Column properties - private static final String CP_LOCATION = "location"; - private static final String CP_ASSOCIATION = "association"; - private static final String CP_SEARCH_SUBFOLDERS = "searchSubfolders"; - - private ObservableSourceList fObservable = new ObservableSourceList(); - - public SourceListDialogField( String title, IListAdapter listAdapter ) - { - super( listAdapter, - new String[] - { - /* 0 */ "Add...", - /* 1 */ null, - /* 2 */ "Up", - /* 3 */ "Down", - /* 4 */ null, - /* 5 */ "Remove", - }, - new SourceLookupLabelProvider() ); - setUpButtonIndex( 2 ); - setDownButtonIndex( 3 ); - setRemoveButtonIndex( 5 ); - setLabelText( title ); - } - - protected boolean managedButtonPressed( int index ) - { - super.managedButtonPressed( index ); - return false; - } - - protected TableViewer createTableViewer( Composite parent ) - { - TableViewer viewer = super.createTableViewer( parent ); - Table table = viewer.getTable(); - - TableLayout tableLayout = new TableLayout(); - table.setLayout( tableLayout ); - - GridData gd = new GridData( GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL ); - gd.grabExcessVerticalSpace = true; - gd.grabExcessHorizontalSpace = true; - table.setLayoutData( gd ); - - table.setLinesVisible( true ); - table.setHeaderVisible( true ); - - new TableColumn( table, SWT.NULL ); - tableLayout.addColumnData( new ColumnWeightData( 2, true ) ); - new TableColumn( table, SWT.NULL ); - tableLayout.addColumnData( new ColumnWeightData( 2, true ) ); - new TableColumn( table, SWT.NULL ); - tableLayout.addColumnData( new ColumnWeightData( 1, true ) ); - - TableColumn[] columns = table.getColumns(); - columns[0].setText( "Location" ); - columns[1].setText( "Association" ); - columns[2].setText( "Search subfolders" ); - - CellEditor textCellEditor = new TextCellEditor( table ); - CellEditor comboCellEditor = new ComboBoxCellEditor( table, new String[]{ YES_VALUE, NO_VALUE } ); - viewer.setCellEditors( new CellEditor[]{ null, textCellEditor, comboCellEditor } ); - viewer.setColumnProperties( new String[]{ CP_LOCATION, CP_ASSOCIATION, CP_SEARCH_SUBFOLDERS } ); - viewer.setCellModifier( createCellModifier() ); - - return viewer; - } - - private ICellModifier createCellModifier() - { - return new ICellModifier() - { - public boolean canModify( Object element, String property ) - { - return ( element instanceof CDirectorySourceLocation && ( property.equals( CP_ASSOCIATION ) || property.equals( CP_SEARCH_SUBFOLDERS ) ) ); - } - - public Object getValue( Object element, String property ) - { - if ( element instanceof CDirectorySourceLocation && property.equals( CP_ASSOCIATION ) ) - { - return ( ((CDirectorySourceLocation)element).getAssociation() != null ) ? - ((CDirectorySourceLocation)element).getAssociation().toOSString() : ""; - } - if ( element instanceof CDirectorySourceLocation && property.equals( CP_SEARCH_SUBFOLDERS ) ) - { - return ( ((CDirectorySourceLocation)element).searchSubfolders() ) ? new Integer( 0 ) : new Integer( 1 ); - } - return null; - } - - public void modify( Object element, String property, Object value ) - { - Object entry = getSelection(); - if ( entry instanceof CDirectorySourceLocation ) - { - if ( property.equals( CP_ASSOCIATION ) && value instanceof String ) - { - IPath association = new Path( (String)value ); - if ( association.isValidPath( (String)value ) ) - { - ((CDirectorySourceLocation)entry).setAssociation( association ); - setChanged(); - } - } - if ( property.equals( CP_SEARCH_SUBFOLDERS ) && value instanceof Integer ) - { - ((CDirectorySourceLocation)entry).setSearchSubfolders( ((Integer)value).intValue() == 0 ); - setChanged(); - } - if ( hasChanged() ) - { - refresh(); - notifyObservers(); - } - } - } - }; - } - - protected Object getSelection() - { - List list = getSelectedElements(); - return ( list.size() > 0 ) ? list.get( 0 ) : null; - } - - public synchronized void addObserver( Observer o ) - { - fObservable.addObserver( o ); - } - - public synchronized void deleteObserver( Observer o ) - { - fObservable.deleteObserver( o ); - } - - public synchronized boolean hasChanged() - { - return fObservable.hasChanged(); - } - - public void notifyObservers() - { - fObservable.notifyObservers(); - } - - public void notifyObservers( Object arg ) - { - fObservable.notifyObservers( arg ); - } - - public void dispose() - { - } - - protected void setChanged() - { - fObservable.setChanged(); - } - - public ICSourceLocation[] getSourceLocations() - { - List list = getElements(); - return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ); - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java deleted file mode 100644 index 0970486a82b..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java +++ /dev/null @@ -1,526 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.ui.sourcelookup; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Observable; -import java.util.Observer; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory; -import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLocator; -import org.eclipse.cdt.debug.internal.ui.PixelConverter; -import org.eclipse.cdt.debug.internal.ui.dialogfields.CheckedListDialogField; -import org.eclipse.cdt.debug.internal.ui.dialogfields.DialogField; -import org.eclipse.cdt.debug.internal.ui.dialogfields.IDialogFieldListener; -import org.eclipse.cdt.debug.internal.ui.dialogfields.IListAdapter; -import org.eclipse.cdt.debug.internal.ui.dialogfields.LayoutUtil; -import org.eclipse.cdt.debug.internal.ui.dialogfields.SelectionButtonDialogField; -import org.eclipse.cdt.debug.internal.ui.dialogfields.Separator; -import org.eclipse.cdt.debug.internal.ui.wizards.AddSourceLocationWizard; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -/** - * - * Enter type comment. - * - * @since Dec 18, 2002 - */ -public class SourceLookupBlock implements Observer -{ - private Composite fControl = null; - private CheckedListDialogField fGeneratedSourceListField; - private SourceListDialogField fAddedSourceListField; - private SelectionButtonDialogField fSearchForDuplicateFiles; - private ILaunchConfigurationDialog fLaunchConfigurationDialog = null; - private boolean fIsDirty = false; - private IProject fProject = null; - - /** - * Constructor for SourceLookupBlock. - */ - public SourceLookupBlock() - { - fGeneratedSourceListField = createGeneratedSourceListField(); - fAddedSourceListField = createAddedSourceListField(); - fSearchForDuplicateFiles = createSearchForDuplicateFilesButton(); - } - - public void createControl( Composite parent ) - { - fControl = new Composite( parent, SWT.NONE ); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = 0; - layout.marginHeight = 0; - fControl.setLayout( layout ); - fControl.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - fControl.setFont( JFaceResources.getDialogFont() ); - - PixelConverter converter = new PixelConverter( fControl ); - - fGeneratedSourceListField.doFillIntoGrid( fControl, 3 ); - LayoutUtil.setHorizontalSpan( fGeneratedSourceListField.getLabelControl( null ), 2 ); - LayoutUtil.setWidthHint( fGeneratedSourceListField.getLabelControl( null ), converter.convertWidthInCharsToPixels( 40 ) ); - LayoutUtil.setHorizontalGrabbing( fGeneratedSourceListField.getListControl( null ) ); - ((CheckboxTableViewer)fGeneratedSourceListField.getTableViewer()). - addCheckStateListener( new ICheckStateListener() - { - public void checkStateChanged( CheckStateChangedEvent event ) - { - if ( event.getElement() instanceof IProjectSourceLocation ) - doCheckStateChanged(); - } - - } ); - - new Separator().doFillIntoGrid( fControl, 3, converter.convertHeightInCharsToPixels( 1 ) ); - - fAddedSourceListField.doFillIntoGrid( fControl, 3 ); - LayoutUtil.setHorizontalSpan( fAddedSourceListField.getLabelControl( null ), 2 ); - LayoutUtil.setWidthHint( fAddedSourceListField.getLabelControl( null ), converter.convertWidthInCharsToPixels( 40 ) ); - LayoutUtil.setHorizontalGrabbing( fAddedSourceListField.getListControl( null ) ); - -// new Separator().doFillIntoGrid( fControl, 3, converter.convertHeightInCharsToPixels( 1 ) ); - - fSearchForDuplicateFiles.doFillIntoGrid( fControl, 3 ); - } - - public Control getControl() - { - return fControl; - } - - public void initialize( ILaunchConfiguration configuration ) - { - IProject project = getProjectFromLaunchConfiguration( configuration ); - if ( project != null ) - { - setProject( project ); - try - { - String id = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "" ); - if ( isEmpty( id ) || - CDebugUIPlugin.getDefaultSourceLocatorID().equals( id ) || - CDebugUIPlugin.getDefaultSourceLocatorOldID().equals( id ) ) - { - String memento = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "" ); - if ( !isEmpty( memento ) ) - initializeFromMemento( memento ); - else - initializeDefaults(); - } - } - catch( CoreException e ) - { - initializeDefaults(); - } - } - else - { - initializeGeneratedLocations( null, new ICSourceLocation[0] ); - resetAdditionalLocations( CDebugCorePlugin.getDefault().getCommonSourceLocations() ); - fSearchForDuplicateFiles.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) ); - } - } - - private void initializeFromMemento( String memento ) throws CoreException - { - IPersistableSourceLocator locator = CDebugUIPlugin.createDefaultSourceLocator(); - locator.initializeFromMemento( memento ); - if ( locator instanceof IAdaptable ) - { - ICSourceLocator clocator = (ICSourceLocator)((IAdaptable)locator).getAdapter( ICSourceLocator.class ); - if ( clocator != null ) - initializeFromLocator( clocator ); - } - } - - private void initializeDefaults() - { - fGeneratedSourceListField.removeAllElements(); - IProject project = getProject(); - if ( project != null && project.exists() && project.isOpen() ) - { - ICSourceLocation location = SourceLookupFactory.createProjectSourceLocation( project, true ); - fGeneratedSourceListField.addElement( location ); - fGeneratedSourceListField.setChecked( location, true ); - List list = CDebugUtils.getReferencedProjects( project ); - Iterator it = list.iterator(); - while( it.hasNext() ) - { - location = SourceLookupFactory.createProjectSourceLocation( (IProject)it.next(), true ); - fGeneratedSourceListField.addElement( location ); - fGeneratedSourceListField.setChecked( location, true ); - } - } - resetAdditionalLocations( CDebugCorePlugin.getDefault().getCommonSourceLocations() ); - fSearchForDuplicateFiles.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) ); - } - - private void initializeFromLocator( ICSourceLocator locator ) - { - ICSourceLocation[] locations = locator.getSourceLocations(); - initializeGeneratedLocations( locator.getProject(), locations ); - resetAdditionalLocations( locations ); - fSearchForDuplicateFiles.setSelection( locator.searchForDuplicateFiles() ); - } - - private void initializeGeneratedLocations( IProject project, ICSourceLocation[] locations ) - { - fGeneratedSourceListField.removeAllElements(); - if ( project == null || !project.exists() || !project.isOpen() ) - return; - List list = CDebugUtils.getReferencedProjects( project ); - IProject[] refs = (IProject[])list.toArray( new IProject[list.size()] ); - ICSourceLocation loc = getLocationForProject( project, locations ); - boolean checked = ( loc != null && ((IProjectSourceLocation)loc).isGeneric() ); - if ( loc == null ) - loc = SourceLookupFactory.createProjectSourceLocation( project, true ); - fGeneratedSourceListField.addElement( loc ); - fGeneratedSourceListField.setChecked( loc, checked ); - - for ( int i = 0; i < refs.length; ++i ) - { - loc = getLocationForProject( refs[i], locations ); - checked = ( loc != null ); - if ( loc == null ) - loc = SourceLookupFactory.createProjectSourceLocation( refs[i], true ); - fGeneratedSourceListField.addElement( loc ); - fGeneratedSourceListField.setChecked( loc, checked ); - } - } - - private void resetGeneratedLocations( ICSourceLocation[] locations ) - { - fGeneratedSourceListField.checkAll( false ); - for ( int i = 0; i < locations.length; ++i ) - { - if ( locations[i] instanceof IProjectSourceLocation && - ((IProjectSourceLocation)locations[i]).isGeneric() ) - fGeneratedSourceListField.setChecked( locations[i], true ); - } - } - - private void resetAdditionalLocations( ICSourceLocation[] locations ) - { - fAddedSourceListField.removeAllElements(); - for ( int i = 0; i < locations.length; ++i ) - { - if ( !( locations[i] instanceof IProjectSourceLocation ) || !((IProjectSourceLocation)locations[i]).isGeneric() ) - fAddedSourceListField.addElement( locations[i] ); - } - } - - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - IPersistableSourceLocator locator = CDebugUIPlugin.createDefaultSourceLocator(); - try - { - locator.initializeDefaults( configuration ); - if ( locator instanceof IAdaptable ) - { - ICSourceLocator clocator = (ICSourceLocator)((IAdaptable)locator).getAdapter( ICSourceLocator.class ); - if ( clocator != null && getProject() != null && getProject().equals( getProjectFromLaunchConfiguration( configuration ) ) ) - { - clocator.setSourceLocations( getSourceLocations() ); - clocator.setSearchForDuplicateFiles( searchForDuplicateFiles() ); - } - } - configuration.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() ); - } - catch( CoreException e ) - { - } - } - - protected void doCheckStateChanged() - { - fIsDirty = true; - updateLaunchConfigurationDialog(); - } - - protected void doGeneratedSourceButtonPressed( int index ) - { - switch( index ) - { - case 0: // Select All - case 1: // Deselect All - fIsDirty = true; - break; - } - if ( isDirty() ) - updateLaunchConfigurationDialog(); - } - - protected void doGeneratedSourceSelectionChanged() - { - } - - protected void doAddedSourceButtonPressed( int index ) - { - switch( index ) - { - case 0: // Add... - if ( addSourceLocation() ) - fIsDirty = true; - break; - case 2: // Up - case 3: // Down - case 5: // Remove - fIsDirty = true; - break; - } - if ( isDirty() ) - updateLaunchConfigurationDialog(); - } - - public ICSourceLocation[] getSourceLocations() - { - ArrayList list = new ArrayList( getGeneratedSourceListField().getElements().size() + getAddedSourceListField().getElements().size() ); - Iterator it = getGeneratedSourceListField().getElements().iterator(); - while( it.hasNext() ) - { - IProjectSourceLocation location = (IProjectSourceLocation)it.next(); - if ( getGeneratedSourceListField().isChecked( location ) ) - list.add( location ); - } - list.addAll( getAddedSourceListField().getElements() ); - return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ); - } - - private boolean addSourceLocation() - { - AddSourceLocationWizard wizard = new AddSourceLocationWizard( getSourceLocations() ); - WizardDialog dialog = new WizardDialog( fControl.getShell(), wizard ); - if ( dialog.open() == Window.OK ) - { - fAddedSourceListField.addElement( wizard.getSourceLocation() ); - return true; - } - return false; - } - - protected void updateLaunchConfigurationDialog() - { - if ( getLaunchConfigurationDialog() != null ) - { - getLaunchConfigurationDialog().updateMessage(); - getLaunchConfigurationDialog().updateButtons(); - fIsDirty = false; - } - } - - public ILaunchConfigurationDialog getLaunchConfigurationDialog() - { - return fLaunchConfigurationDialog; - } - - public void setLaunchConfigurationDialog( ILaunchConfigurationDialog launchConfigurationDialog ) - { - fLaunchConfigurationDialog = launchConfigurationDialog; - } - - public boolean isDirty() - { - return fIsDirty; - } - - protected Object getSelection() - { - List list = fAddedSourceListField.getSelectedElements(); - return ( list.size() > 0 ) ? list.get( 0 ) : null; - } - - protected void restoreDefaults() - { - ICSourceLocation[] locations = new ICSourceLocation[0]; - if ( getProject() != null ) - locations = CSourceLocator.getDefaultSourceLocations( getProject() ); - resetGeneratedLocations( locations ); - resetAdditionalLocations( locations ); - fSearchForDuplicateFiles.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) ); - } - - public IProject getProject() - { - return fProject; - } - - private void setProject( IProject project ) - { - fProject = project; - } - - public SourceListDialogField getAddedSourceListField() - { - return fAddedSourceListField; - } - - public CheckedListDialogField getGeneratedSourceListField() - { - return fGeneratedSourceListField; - } - - private ICSourceLocation getLocationForProject( IProject project, ICSourceLocation[] locations ) - { - for ( int i = 0; i < locations.length; ++i ) - if ( locations[i] instanceof IProjectSourceLocation && - project.equals( ((IProjectSourceLocation)locations[i]).getProject() ) ) - return locations[i]; - return null; - } - - public boolean searchForDuplicateFiles() - { - return ( fSearchForDuplicateFiles != null ) ? fSearchForDuplicateFiles.isSelected() : false; - } - - private CheckedListDialogField createGeneratedSourceListField() - { - String[] generatedSourceButtonLabels = new String[] - { - /* 0 */ "Select All", - /* 1 */ "Deselect All", - }; - - IListAdapter generatedSourceAdapter = new IListAdapter() - { - public void customButtonPressed( DialogField field, int index ) - { - doGeneratedSourceButtonPressed( index ); - } - - public void selectionChanged( DialogField field ) - { - doGeneratedSourceSelectionChanged(); - } - }; - - CheckedListDialogField field = new CheckedListDialogField( generatedSourceAdapter, generatedSourceButtonLabels, new SourceLookupLabelProvider() ); - field.setLabelText( "Generic Source Locations" ); - field.setCheckAllButtonIndex( 0 ); - field.setUncheckAllButtonIndex( 1 ); - field.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - doCheckStateChanged(); - } - } ); - return field; - } - - private SourceListDialogField createAddedSourceListField() - { - SourceListDialogField field = - new SourceListDialogField( "Additional Source Locations", - new IListAdapter() - { - public void customButtonPressed( DialogField field, int index ) - { - doAddedSourceButtonPressed( index ); - } - - public void selectionChanged(DialogField field) - { - } - } ); - field.addObserver( this ); - return field; - } - - private SelectionButtonDialogField createSearchForDuplicateFilesButton() - { - SelectionButtonDialogField button = new SelectionButtonDialogField( SWT.CHECK ); - button.setLabelText( "Search for duplicate source files" ); - button.setDialogFieldListener( - new IDialogFieldListener() - { - public void dialogFieldChanged( DialogField field ) - { - doCheckStateChanged(); - } - } ); - return button; - } - - /* (non-Javadoc) - * @see java.util.Observer#update(java.util.Observable, java.lang.Object) - */ - public void update( Observable o, Object arg ) - { - if ( arg instanceof Integer && ((Integer)arg).intValue() == 0 ) - { - if ( addSourceLocation() ) - fIsDirty = true; - } - else - fIsDirty = true; - if ( fIsDirty ) - updateLaunchConfigurationDialog(); - } - - private boolean isEmpty( String string ) - { - return string == null || string.length() == 0; - } - - public void dispose() - { - if ( getAddedSourceListField() != null ) - { - getAddedSourceListField().deleteObserver( this ); - getAddedSourceListField().dispose(); - } - } - - private IProject getProjectFromLaunchConfiguration( ILaunchConfiguration configuration ) - { - try - { - String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" ); - if ( !isEmpty( projectName ) ) - { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); - if ( project != null && project.exists() && project.isOpen() ) - return project; - } - } - catch( CoreException e ) - { - } - return null; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupLabelProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupLabelProvider.java deleted file mode 100644 index 1642c2146f0..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupLabelProvider.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ - -package org.eclipse.cdt.debug.ui.sourcelookup; - -import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation; -import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation; -import org.eclipse.cdt.debug.internal.ui.CDebugImages; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; - - -public class SourceLookupLabelProvider extends LabelProvider implements ITableLabelProvider -{ - public Image getColumnImage( Object element, int columnIndex ) - { - if ( columnIndex == 0 ) - { - if ( element instanceof IProjectSourceLocation ) - { - if ( ((IProjectSourceLocation)element).getProject().isOpen() ) - return CDebugImages.get( CDebugImages.IMG_OBJS_PROJECT ); - else - return CDebugImages.get( CDebugImages.IMG_OBJS_CLOSED_PROJECT ); - } - if ( element instanceof IDirectorySourceLocation ) - { - return CDebugImages.get( CDebugImages.IMG_OBJS_FOLDER ); - } - } - return null; - } - - public String getColumnText( Object element, int columnIndex ) - { - if ( columnIndex == 0 ) - { - if ( element instanceof IProjectSourceLocation ) - { - return ((IProjectSourceLocation)element).getProject().getName(); - } - if ( element instanceof IDirectorySourceLocation ) - { - return ((IDirectorySourceLocation)element).getDirectory().toOSString(); - } - } - else if ( columnIndex == 1 ) - { - if ( element instanceof IDirectorySourceLocation && ((IDirectorySourceLocation)element).getAssociation() != null ) - { - return ((IDirectorySourceLocation)element).getAssociation().toOSString(); - } - } - else if ( columnIndex == 2 ) - { - if ( element instanceof IDirectorySourceLocation ) - return ( ((IDirectorySourceLocation)element).searchSubfolders() ) ? SourceListDialogField.YES_VALUE : SourceListDialogField.NO_VALUE; - } - return ""; - } -} \ No newline at end of file diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java deleted file mode 100644 index 0412ac04414..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.ui.sourcelookup; - -import org.eclipse.cdt.debug.core.model.ICDebugTarget; -import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.dialogs.PropertyPage; - -/** - * - * Enter type comment. - * - * @since Dec 18, 2002 - */ -public class SourcePropertyPage extends PropertyPage -{ - private SourceLookupBlock fBlock = null; - - /** - * Constructor for SourcePropertyPage. - */ - public SourcePropertyPage() - { - noDefaultAndApplyButton(); - fBlock = new SourceLookupBlock(); - } - - /** - * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite) - */ - protected Control createContents( Composite parent ) - { - ICDebugTarget target = getDebugTarget(); - if ( target == null || target.isTerminated() || target.isDisconnected() ) - { - return createTerminatedContents( parent ); - } - return createActiveContents( parent ); - } - - protected Control createTerminatedContents( Composite parent ) - { - Label label= new Label( parent, SWT.LEFT ); - label.setText( "Terminated." ); - return label; - } - - protected Control createActiveContents( Composite parent ) - { - fBlock.initialize( getLaunchConfiguration() ); - fBlock.createControl( parent ); - return fBlock.getControl(); - } - - protected ICDebugTarget getDebugTarget() - { - IAdaptable element = getElement(); - if ( element != null ) - { - return (ICDebugTarget)element.getAdapter( ICDebugTarget.class ); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() - { - if ( fBlock.isDirty() ) - { - try - { - setAttributes( fBlock ); - } - catch( DebugException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null ); - return false; - } - } - return true; - } - - private void setAttributes( SourceLookupBlock block ) throws DebugException - { - ICDebugTarget target = getDebugTarget(); - if ( target != null ) - { - if ( target.getLaunch().getSourceLocator() instanceof IAdaptable ) - { - ICSourceLocator locator = (ICSourceLocator)((IAdaptable)target.getLaunch().getSourceLocator()).getAdapter( ICSourceLocator.class ); - if ( locator != null ) - { - locator.setSourceLocations( block.getSourceLocations() ); - locator.setSearchForDuplicateFiles( block.searchForDuplicateFiles() ); - if ( target.getLaunch().getSourceLocator() instanceof IPersistableSourceLocator ) - { - ILaunchConfiguration configuration = target.getLaunch().getLaunchConfiguration(); - saveChanges( configuration, (IPersistableSourceLocator)target.getLaunch().getSourceLocator() ); - } - } - } - } - } - - protected void saveChanges( ILaunchConfiguration configuration, IPersistableSourceLocator locator ) - { - try - { - ILaunchConfigurationWorkingCopy copy = configuration.copy( configuration.getName() ); - copy.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() ); - copy.doSave(); - } - catch( CoreException e ) - { - CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null ); - } - } - - private ILaunchConfiguration getLaunchConfiguration() - { - ICDebugTarget target = getDebugTarget(); - return ( target != null ) ? target.getLaunch().getLaunchConfiguration() : null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IDialogPage#dispose() - */ - public void dispose() - { - if ( fBlock != null ) - fBlock.dispose(); - super.dispose(); - } - -} diff --git a/doc/org.eclipse.cdt.doc.isv/.project b/doc/org.eclipse.cdt.doc.isv/.project deleted file mode 100644 index 3d7ca9106e0..00000000000 --- a/doc/org.eclipse.cdt.doc.isv/.project +++ /dev/null @@ -1,11 +0,0 @@ - - - org.eclipse.cdt.doc.isv - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/.project b/doc/org.eclipse.cdt.doc.user/.project deleted file mode 100644 index 6fffba66603..00000000000 --- a/doc/org.eclipse.cdt.doc.user/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.eclipse.cdt.doc.user - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/doc/org.eclipse.cdt.doc.user/build.properties b/doc/org.eclipse.cdt.doc.user/build.properties deleted file mode 100644 index 24d515fea00..00000000000 --- a/doc/org.eclipse.cdt.doc.user/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -bin.includes = plugin.properties,\ - *.xml,\ - doc.zip \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/build.xml b/doc/org.eclipse.cdt.doc.user/build.xml deleted file mode 100644 index 1f9816e2f48..00000000000 --- a/doc/org.eclipse.cdt.doc.user/build.xml +++ /dev/null @@ -1,57 +0,0 @@ - -- -- - - - - - - - -- - - - -- - - - - - -- - - -- - - - - - - - -- - - - - -- - - -- - - - - -- - - -- - - -- - - - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm deleted file mode 100644 index f00555c11d2..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - -Build overview - - - - - -

            Build overview

            - -

            The CDT uses the same make utility and makefile used on the command line. -The CDT can generate makefiles automatically when you create a Managed Make C project -or a Managed Make C++ project. You have the option of creating a Standard Make C -project or a Standard Make C++ project and providing the makefile.

            - -

            Required utilities

            -

            In order to build your project, you need to install and configure the following utilities:

            - -
              -
            • build (such as make)
            • -
            • compile (such as gcc, for more information, see - http://gcc.gnu.org)
            • -
            - -

            Build terminology

            - -

            The CDT uses a number of terms to describe the scope of the build.

            - -

            Build Project

            - -

            This is an incremental build (make all). Only the components affected by modified files in that particular -project are built.

            - -

            Rebuild Project

            - -

            Builds every file in the project whether or not a file has been modified since -the last build. A rebuild is a clean followed by a -build.

            - -

            For more information on builds, see:

            - -
              -
            • Workbench User Guide > Concepts > Workbench > Builds
            • -
            • Workbench User Guide > Tasks > Building resources
            • -
            - -

            Build-related information is displayed as follows:

            - -
              -
            • The C-Build view displays the output of the make utility.
            • -
            • The Tasks view displays a list of compiler errors and warnings related to - your projects.
            • -
            • Makefile actions are displayed in the Make Targets view.
            • -
            - -

            For more information about the Tasks view, see Workbench User Guide > Reference > User interface information > Views and editors > Tasks -view.

            - -

            Build preferences

            - -

            Build order

            - -

            If certain projects must be built before others, you can set the build order. -If your project refers to another project, the CDT must built the other project first.

            - -

            When you set the build order, the CDT does not rebuild projects that depend -on a project; you must rebuild all projects to ensure all changes are -propagated.

            - -

            For more information on build order, see Workbench User Guide > Reference -> Preference > Build Order.

            - -

            Automatic save

            - -

            The CDT will save all unsaved modified resources when you perform a manual -build. By default, this feature is disabled.

            - -

            Related concepts -
            -CDT Projects
            -Project file views

            -

            Related tasks -
            -Defining project properties
            -Building

            -IBM Copyright Statement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_comments.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_comments.htm deleted file mode 100644 index 10e17fa86cb..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_comments.htm +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -Comments - - - - - -

            Comments

            - -

            You can select one or more lines of code, right-click, and click Comment -to add the leading characters // to the beginning of lines. When -you uncomment lines of code, the leading // characters are removed -from the selected lines.

            - -

            Tip: The characters /* */ on lines that already are -already commented out, are not affected when you comment and uncomment code.

            - -

            Related concepts -
            -Content Assist and code completion

            -

            Related tasks -
            -Customizing the C++ editor
            -Commenting out code

            -

            Related reference -
            -C/C++ editor, code templates and search -preferences

            - IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm deleted file mode 100644 index 7afccd2f33e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_content_assist.htm +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - -Content assist - - - - - -

            Content assist

            - -

            In the C/C++ editor, when you enter a letter combination in the editor, -right-click and click Content Assist. A list of code elements and code -templates that start with the letter combination that you typed is displayed.

            - -

            Code Completion

            - -

            Content assist provides code completion assistance while you code from within -the body of a method or a function. For the current project -and any referenced projects, a list is displayed of the elements that begin with the -letter combination you entered in the order shown below:

            - -
              -
            • Global variables
            • -
            • Global functions
            • -
            • Global enumerations
            • -
            • Global structs
            • -
            • Global classes
            • -
            • Global unions
            • -
            • Global macros
            • -
            - -

            You can view the signature of each item on the list in a pop-up by pointing -to it. You can then select an -item in the list to insert it directly into your code. Newly created -elements in your current or referenced project(s) must be saved before they will -appear in the Content Assist list.

            - -

            Code Templates

            - -

            Code templates are frequently used sections of code that you can create and -then save for reuse. The Content Assist feature also provides access to code -templates. Code Template names beginning -with the letter combination you entered are displayed in a list in alphabetical -order followed by code elements. You can then select a code template from the list and -it is inserted directly -into your code.

            - -

            -

            - -

            For example, the code template do - while statement contains the code:

            - -

            do {
            -${cursor}
            -} while (${condition});

            - -

            When you select the do code template from the list, the -following is inserted in your code:

            - -

            -do {
            -} while (condition);

            - -

            A selection of common code templates are already defined. These can be browsed in -Window > Preferences > C/C++ > Code Templates.

            - -

            You can create, import and, export code templates.

            - -

            Related concepts -
            -Code entry

            -

            Related tasks -
            -Using Content Assist
            -Creating and editing code templates
            -Importing and exporting code templates

            -

            Related reference -
            -C/C++ perspective icons

            - -

            - -IBM Copyright Statement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_dbg_info.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_dbg_info.htm deleted file mode 100644 index a6c13a1e33a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_dbg_info.htm +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - -Debug information - - - - - -

            Debug information

            - -

            The Debug perspective lets you manage the debugging or running of a program -in the Workbench. You can control the execution of your program by setting -breakpoints, suspending launched programs, stepping through your code, and -examining the contents of variables.

            -

             The Debug perspective displays the following information:

            - -
              -
            • The stack frame for the suspended threads -for each target that you are debugging
            • -
            • Each thread in your program represented as a node in the tree
            • -
            • The process for each program that you are running
            • -
            -

            The Debug perspective also drives the C/C++ Editor. As you step -through your program, the C/C++ Editor highlights the location of the -execution pointer.

            - -

            Variables

            - -

            You can view information about the variables in a selected stack frame in the -Variables view. When execution stops, the changed values are -by default highlighted in red. Like the other debug-related views, the Variables view does -not refresh as you run your executable. A refresh occurs when execution stops.

            - -

            Expressions

            - -

            An expression is a snippet of code that can be evaluated to produce a result. -The context for an expression depends on the particular debug model. Some -expressions may need to be evaluated at a specific location in the program so -that the variables can be referenced. You can view information about expressions -in the Expressions view.

            - -

            Registers

            - -

            You can view information about the registers in a selected stack frame. -Values that have changed are highlighted in the Registers view when your program -stops.

            - -

            Memory

            - -

            You can inspect and change your process memory.

            - -

            Shared libraries

            - -

            You can view information about the shared libraries loaded in the current -debug session.

            - -

            Signals

            - -

            You can view the signals defined on the selected debug target and how the -debugger handles each one.

            -

            Related concepts -
            -Overview of the CDT
            -Debug overview

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Run and Debug dialog box
            -Debug views

            - -IBM Copyright Statement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm deleted file mode 100644 index 9d30768c4dc..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_open_declarations.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - -Open declarations - - - - - -

            Open declarations

            - -

            You can select an element name in your code and navigate to its declaration.

            - -

            The table below describes what happens when matching declarations are found.

            - - - - - - - - - - - - - - - - - - -
            If this is foundThis is what happens
            Only one matching declaration is found, and it is in another - fileThe file that contains the declaration will be opened
            Only one matching declaration is found, and it is in the - same fileThe line on which the declaration is found is highlighted
            More than one matching declaration is foundA list is displayed of each matching declaration and the - file in which it is found
            -

            Related concepts
            -CDT Projects
            -C/C++ search

            -

            Related tasks
            -Navigate to a C or C++ element's -declaration
            -Searching for C/C++ elements

            -

            Related reference
            -

            -

             

            -

            -IBM Copyright Statement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_outlineview.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_outlineview.htm deleted file mode 100644 index 5a0ec8a24ec..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_outlineview.htm +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - -Outline view - - - - - -

            Outline view

            - -

            The Outline view gives you a language-based structural view of your C/C++ source code.

            - -

            The Outline view shows the following elements in the source file in the order -in which they occur:

            - -
              -
            • C or C++ file
            • -
            • Class
            • -
            • Namespace
            • -
            • Include
            • -
            • Enum
            • -
            • Enumerator
            • -
            • Field
            • -
            • Field private
            • -
            • Field protected
            • -
            • Field public
            • -
            • Include
            • -
            • Method private
            • -
            • Method protected
            • -
            • Method public Struct
            • -
            • Type definition
            • -
            • Union
            • -
            • Variable
            • -
            - -

            You can also sort the list -alphabetically. When you select an element in the Outline view, the C/C++ -editor highlights both the selected item and the marker bar (left margin). For example, to jump -to the start of main() in the C/C++ editor, click main() in the Outline -view.

            - -

            For more information on the marker bar, see Workbench User Guide > Reference > User interface -information > Views and editors > Editor area.

            - -

            You can filter the Outline view by choosing to display or hide the following -items:

            - -
              -
            • Fields
            • -
            • Static members
            • -
            • Non-public members
            • -
            - -

            You can select an element in the Outline view, and do the following:

            -
              -
            • Open the C/C++ Search dialog box. The Search string box is populated and - the element type is selected.
            • -
            • Complete a text-based search, of a workspace or a specified working set for the - selected element.
            • -
            • Open a selected .h file in the editor.
            • -
            - -

            For more information on:

            -
              -
            • The Eclipse workspace, see Workbench User Guide > Tasks > Upgrading -Eclipse
            • -
            • Working sets, see Workbench User Guide > Concepts > Working sets
            • -
            - -

            Related concepts -
            -Comments
            -Content Assist and code completion
            -C/C++ search
            -Open Declarations

            -

            Related tasks -
            -Displaying C/C++ file components in the -C/C++ Projects view
            -Searching for C/C++ elements

            -

            Related reference -
            -Outline view

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_cdt.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_cdt.htm deleted file mode 100644 index a02052c81f9..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_cdt.htm +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - -CDT overview - - - - - -

            CDT overview

            - -

            The C/C++ development tool (CDT) is a set of Eclipse plugins that provide a -C/C++ development environment on the Eclipse platform. For more information on -Eclipse, see Workbench User Guide > Concepts > Workbench.

            - -

            The CDT provides a graphical interface for many of the same tools -that you use from the command line. The CDT communicates with, and interprets -messages from, utilities that include:

            - - - -

            The CDT is launched as the C/C++ perspective of the Eclipse workbench. The -C/C++ perspective consists of an editor and the following -views:

            -
              -
            • The C/C++ Projects view lists all C/C++ projects.
            • -
            • The Navigator view lists all Eclipse projects.
            • -
            • The Tasks view lists items such as tasks, compiler warnings and errors.
            • -
            • The C-Build view displays the output from make.
            • -
            • The Properties view lists the properties of a file that has been selected in - the C/C++ Projects view or the Navigator view.
            • -
            • The Outline view lists file components.
            • -
            -

            For more information, see Workbench User Guide > Concepts > Perspectives.

            - -

            Additional information

            - -

            Refer to http://www.eclipse.org/cdt/ -for additional information on the CDT project, including:

            - -
              -
            •  CDT newsgroups: Ask questions on how to use the CDT.
            • -
            •  User FAQ: View answers to the most common questions about using the - CDT.
            • -
            •  Developer FAQ: View answers to the most common questions about - building and extending the CDT.
            • -
            •  CDT community web: Learn about plugins and tools developed by and for the - CDT community.
            • -
            - -

            CDT updates

            - -

            The Install/Update perspective provides information on your current -Eclipse installation and lets you manage updates. For more information, see Workbench User Guide > Tasks > Updating - features with the update manager.

            - -

            To view a list of the updates available for the toolsets that you have -installed, click Help > Software Updates > New Updates .

            -

            -Related concepts -
            -Working with existing code
            -What's new

            -

            Related tasks -
            -Updating the CDT
            -Defining project properties

            -

            Related reference -
            -Views

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_dbg.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_dbg.htm deleted file mode 100644 index b33fcc709d5..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_over_dbg.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - -Debug overview - - - - - -

            Debug overview

            - -

            The debugger lets you see what's going on "inside" a program while it -executes.

            -

            In order to debug your application, you must use executables compiled for -debugging. These executables contain additional debug information that lets the -debugger make direct associations between the source code and the binaries -generated from that original source.

            -

            The CDT debugger uses GDB as the underlying debug engine. It translates each -user interface action into a sequence of GDB commands and processes the output from GDB to -display the current state of the program being debugged.

            -

            Tip: Editing the source after compiling causes the line numbering to be out of -step because the debug information is tied directly to the source. Similarly, -debugging optimized binaries can also cause unexpected jumps in the execution -trace.

            -

            Related concepts -
            -Overview of the CDT
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Run and Debug dialog box

            - -IBM STatement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_proj_file_views.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_proj_file_views.htm deleted file mode 100644 index f41c2a3b194..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_proj_file_views.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - -Project file views - - - - - -

            Project file views

            - -

            Projects files are displayed in the C/C++ Projects view and in the Navigator view.

            - -

            C/C++ Projects view

            - -

            C and C++ project files are controlled in the C/C++ Projects view. The C/C++ Projects view -displays only C/C++ project files. Files selected in the C/C++ -Projects view affect the information displayed in other views.

            - -

            The C/C++ Projects view shows only open C/C++ projects. Project files are displayed in a tree structure. -You can right-click a project to view its properties.

            - -

            Navigator view

            - -

            The Navigator view is part of the Eclipse Workbench.

            - -
              -
            • For information about the Navigator view toolbar and icons, see - Workbench User Guide > Concepts > Views > Navigator View.
            • -
            • For information about the context menu in the Navigator view, see - Workbench User Guide > Reference > User interface -information > Views and Editors > Navigator View.
            • -
            -

            Related concepts -
            -CDT Projects
            -Working with existing code

            -

            Related tasks -
            -Creating a project
            -Defining project properties
            -Working with C/C++ project files

            -

            Related reference -
            -C/C++ Projects view
            -C/C++ perspective icons

            -

            - -IBM Corporation Statement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_projects.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_projects.htm deleted file mode 100644 index 6207c5b2145..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_projects.htm +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - -CDT projects - - - - - -

            CDT projects

            - -

            Before you do any work in the CDT, you must create a project to store your -source code, makefiles, binaries and related files. C/C++ projects are displayed -in the C/C++ Projects view.

            - -

            Tip: Nested projects are not supported. Each project must be organized as a -discrete entity. Project dependencies are supported by allowing a project -to reference other projects that reside in your workspace. For more information, -see Selecting referenced projects.

            - -

            For more information about projects and where they are stored, see:

            - -
              -
            • Workbench User Guide > Tasks > Resources
            • -
            • Workbench User Guide > Tasks > Running Eclipse
            • -
            - -

            Project types

            - -

            You can create a standard make C or C++ project or a managed make C or C++ -project.

            - -

            Standard Make C or C++ project

            - -

            You need to create a makefile in order to build your project or use an -existing makefile.

            - -

            Managed Make C or C++ project

            - -

            A managed make project generates the makefile for you. In addition, the -files module.dep and module.mk are created for every project sub-directory. -These files are required for your managed make project to successfully build.

            - -

            How the CDT associates project natures

            - -

            Projects are assigned natures and tags that identify the -properties of each project. The CDT uses natures to identify what can and cannot be done with each project. The -CDT also uses natures to filter out projects that are contextually -irrelevant; for example, non-library projects from a list of library projects.

            - - - - - - - - - - - - - - - - - - - - -
            Project - Associated natures -
            Standard Make C ProjectC, make
            Managed Make C ProjectC, gen make
            Standard Make C++ ProjectC, C++
            Managed Make C++ ProjectC, C++
            - -

            Project conversion

            - -

            You can convert a C project to a C++ project and vice versa. An example of -when this may be useful is if you create a C project, your requirements change during the course of -the development, and you -need to continue coding in C++. Since the initial project was coded in C, -the parser will not recognize certain semantics such as "class", or keywords -such as -"public", "private", and  "template". You need to create a C++ project to -make the parser and other tools aware of the language change. You can simply -convert your C project to a C++ project rather than creating a new C++ project, copying your project files over and resolving source control issues.

            - -

            A few notes about projects

            - -
              -
            • When you create a file within a project, a record (local -history) is created of every time that you modify the file and how you modify it. - For more information about local history, see Workbench User Guide > Reference > User interface - information > Development environment > Local history.
            • -
            • Spaces in projects and filenames can cause problems with some -tools, such as the make utility or the compiler.
            • -
            • Be careful when using case alone to between distinguish files and projects. UNIX-based - operating system -filenames are case-sensitive, but Windows filenames are not. Therefore, Hello.c and -hello.c overwrite each other in Windows, but are separate files in UNIX.
            • -
            - - -

            For more information about projects, see Workbench User Guide > Concepts > Workbench > Resources.

            - - -

            Related concepts -
            -Project file views
            -How to bring C/C++ source into Eclipse

            -

            Related tasks -
            -Defining project properties
            -Working with C/C++ project files

            -

            Related reference -
            -Project properties
            -Views

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_search.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_search.htm deleted file mode 100644 index 68066cb1617..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_search.htm +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - -C/C++ search - - - - - -

            C/C++ search

            - -

            The CDT lets you search for language constructs in the projects in your -workspace or a working set for references to, declarations or definitions of, particular -elements.

            - -

            For information on:

            - -
              -
            • Working sets, see Workbench User Guide > Concepts > Workbench > Working sets
            • -
            • The Eclipse workspace, see Workbench User Guide > Tasks > Upgrading -Eclipse
            • -
            - -

            You can conduct a fully or partially qualified name search. Further -qualifying a search increases the accuracy and relevance of search results. The -sections below provide guidance on how to control the scope of your search -through the use of search delimiters, correct syntax, and wildcards.

            - -

            What you can search for

            -

            The table below lists the element types that you can search for and special - considerations to note when searching for a given element type. You can search - for some or all of the element types matching a search string that you - specify. If you choose to search for matching elements, all types, macros, and typdefs are included in the search.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ElementNote
             Class/StructSearches for classes and structs.

            You can further qualify - the search by specifying "class" or "struct" in front of the name - that you are - searching for. Specifying "class" or "struct" also allows you to - search for anonymous classes and structures.

             FunctionSearches for global functions or functions in a namespace - (functions that are not members of a class, struct, or union).

            You can - specify parameters to further qualify your search. When specifying a - parameter list, everything between the parentheses should be valid C/C++ - syntax.

            -

            Do not specify the return type of the function.

             VariableSearches for variables that are not members of a class, - struct, or union.
             UnionSearches for unions.

            Anonymous unions can be searched for by - specifying "union" as the search pattern.

             MethodSearches for methods that are members of a class, struct, or - union.

            Searching for methods also finds constructors and destructors. See - above note for functions.

             Field Searches for fields that are members of a class, struct, or - union.

            Searching for fields also finds enumerators.

             EnumerationSearches for enumerations.
             NamespaceSearches for namespaces.
            - -

            How you can limit your search

            - -

            You can limit your search to one or all of the following:

            - -
              -
            • Declarations
            • -
            • References
            • -
            • Definitions (for functions, methods, variables and fields)
            • -
            - -

            You can control the scope of the search by specifying which of the following -is to be searched:

            -
              -
            • Workspace
            • -
            • Working Set
            • -
            • Selected Resources
            • -
            -

            Wildcard characters

            -

            You can use wildcard characters to further refine your search.

            - - - - - - - - - - - - - - - - - -
            Use this wildcard characterTo search for this
             *Any string

            Tip:
            -
            Use the character * to search for - operators that begin with *. See syntax examples in the table below.

             ?A single character
             ::Nested elements
            -

            Tip: Do not use wild cards between the brackets of a function or -method pattern. For example, the search -string f( * ) is an invalid search that results in a search for any function f - because -the asterisk is interpreted as a pointer rather than a wild card.

            -

            Syntax examples

            -

            The table below provides syntax examples and an explanation for each example -to help you conduct an effective search.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            SyntaxSearches for this
              ::*::*::AA nested element two levels deep
              ::*::*::A?Any two-letter name that begins with A and is two levels - deep
              ::A Searches for A not nested in anything
              *()Any function taking no parameters
              *( A * ) Any function taking 1 parameter that is a pointer to type - A
              f( int * )Will search for function f taking 1 parameter that is an - int *
              f( const char [ - ], A & )Will search for a function f, taking 2 parameters; one is a - const char array, the other is a reference to type A
             operator \*Finds only operator *
             operator \*=Finds only operator *=
             operator *Finds all operators
             classSearches for anonymous classes
             structSearches for anonymous structs
             unionSearches for anonymous unions
            -

            Search results

            -

            Search results are displayed in the Search view. You can sort your search by Name, Parent Name and Path. You can also repeat -your last search.

            - -

            For more information, see:

              -
            • Workbench User Guide > Concepts > Views > Search view
            • -
            • Workbench User Guide > Tasks > Navigating and finding resources
            • -
            -

            Related concepts -
            -CDT Projects
            -Open Declarations

            -

            Related tasks -
            -Searching for C/C++ elements
            -Navigating to C/C++ declarations

            -

            Related reference
            -C/C++ search page, Search dialog box
            -C/C++ perspective icons

            - -IBM Copyright Statement

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_whatsnew.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_whatsnew.htm deleted file mode 100644 index 53c98c335d6..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_c_whatsnew.htm +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - -What's new - - - - - -

            What's new

            - -

            Find out what's new in CDT 1.2.

            - -

            C/C++ Search

            -

            You can search the projects in your workspace for references to, declarations -or definitions of, particular elements. Only header files referenced by a source -file in your workspace are included in a search.

            -

            Build

            -

            Managed build

            -

            You can now create a Managed build and have makefiles generated for you.

            -

            Error parser

            -

            The error parsers are now extension-points that can contributed by other -plugins. The error parsers are used to detect errors or warnings or -informational messages from compilers, linkers, etc... during a build.

            -

            New Global preferences for all Standard Make Project properties

            -

            Make builder options

            -

            Support changing/enabling default make targets for each workbench build type. -New default build location setting.

            -

            Make project options

            -

            New user settable error parser configuration. User can enable/disable and -change older of the build error parsers used during the project build.

            -

            New Includes paths and Preprocessor symbols entry to allow proper indexing -and search of the project.

            -

            Make target

            -

            Make targets now support Stop on error build option and ability to change the -default build command.

            -

            New Standard Make projects

            -

            Old Standard Make projects will be automatically updated to support the new -options. If update is declined, then selecting Update Old Make project... from -the context menu of the project will update the project to a new Standard Make -project.

            -

            Debug

            -

            Formatting of variables and expressions

            -

            You can now select the number system (natural, decimal, hexadecimal) used to display -variables and expressions.

            -

            Variable view, detail pane

            -

            In the Variable view, a detail pane has been -added to let you see the value of a selected variable. This is practical when -looking at a string (char *).

            -

            Casting of variables, expressions and registers

            -

            In the Variable view, a variable can be cast to a different type or be restored to -its original type. Also, a pointer can be cast to an array type.

            -

            Debug disable variable query

            -

            The value of variables are queried at every step.

            -

            This can be time-consuming on certain embedded targets. The automatic -query of variables can be disabled. Manual queries are now an option.

            -

            Source location

            -

            A new source locator in the Run/Debug dialog box makes it possible to add directories -to search, mapping, and the order of the search.

            -

            GDB/MI new shared library launch pane

            -

            For GDB/MI code, two new actions are added in the launch view, stop-on-solib -and auto-load-symbols. Stop-on-solib will force the debugger to stop on any -shared library events. Auto load will load the symbols for any shared library.

            -

            GDB/MI improvements in display of arrays

            -

            Arrays are now separated into ranges, to limit the possibility of a timeout -on large arrays.

            -

            What's new for previous releases

            - -

            You can keep track of previous release-specific developments in the CDT.

            - -

            For more information, see http://www.eclipse.org/cdt/ -> CDT Project Management/Plans. The Official CDT Plans section lists -previous releases.

            - -

            Related concepts -
            -C/C++ search
            -Build overview

            -

            Related tasks -
            -Creating a project
            -Defining project properties

            -

            Related reference -
            -

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm deleted file mode 100644 index 56942c58875..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_build_conc.htm +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - -Build - - - - - -

            Build

            This section describes the build views and terminology.

            - - - - - - - - - - - - - -
            To learn aboutSee
            Build views and terminologyBuild overview
            Extending the build capabilities of the CDT - - Build Extensibility
            - - 

            - -IBM Copyright Statement

            - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_code_entry.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_code_entry.htm deleted file mode 100644 index e90a2c4de77..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_code_entry.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Coding aids - - - - - -

            Coding aids

            This section provides information on code entry aids.

            - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn aboutSee
            The structure of your source codeOutline view
            Using comments to document your codeComments
            Code completion and code templatesContent - Assist
            C/C++ language-based searchC/C++ search
            Declarations of elementsOpen - declarations
            - - 

            - -IBM Copyright Statement

            - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm deleted file mode 100644 index 2206b7e0cc7..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_concepts.htm +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - -Concepts - - - - - -

            Concepts

            - -

            Conceptual topics provide background information that you need to know to -complete a specific task.

            -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn aboutSee
            What's new for this release of the CDTWhat's new
            The C/C++ perspectiveCDT overview
            Recommended approaches for dealing with source - files and files systems that were created outside of EclipseHow to bring - C/C++ source into Eclipse
            C/C++ projectsCDT projects
            Code aidsCoding aids
            Building your C/C++ projectsBuild
            Debugging your C/C++ projectsDebug
            - - 

            - -IBM Corporation Statement

            - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_dbg_concepts.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_dbg_concepts.htm deleted file mode 100644 index c58c88396c6..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_dbg_concepts.htm +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -Debug - - - - - -

            Debug

            - -

            This section describes CDT debug concepts.

            - - - - - - - - - - - - - - -
            To learn aboutSee
            CDT debuggerDebug overview
            How debug information is displayedDebug information
            - -

             

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_home.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_home.htm deleted file mode 100644 index 9c5e74055da..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_home.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -C/C++ Development User Guide - - - - - -

            C/C++ Development User Guide

            -

            The C/C++ Development User Guide provides all of the information you need to -that you need get started.

            - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Learn C/C++ Development Tool (CDT) basicsTutorial
            Learn CDT background informationConcepts
            Get step-by-step instructions to use the CDTTasks
            Learn about CDT icons, views and dialog boxesReference
            - -

            - -IBM Copyright Statement

            - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_projects.htm b/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_projects.htm deleted file mode 100644 index 1d28159f6ca..00000000000 --- a/doc/org.eclipse.cdt.doc.user/concepts/cdt_o_projects.htm +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - -CDT projects - - - - - -

            CDT Projects

            This section provides information on C/C++ project files and project-related -C/C++ views.

            - - - - - - - - - - - - - -
            To learn aboutSee
            CDT project filesCDT projects
            Project files viewsProject - file views
            - - 

            - -IBM Copyright Statement

            - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/contextHelp.xml b/doc/org.eclipse.cdt.doc.user/contextHelp.xml deleted file mode 100644 index 35b56198a9f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/contextHelp.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - Click below to see help. - - - - - Define the build settings for the current project. - - - - - Control the build messages displayed in the Tasks view. - - - - - Select a binary parser for the target platform. - - - - - Enter include paths and symbols. - - - - - View C/C++ file components. - - - - - Create and manage C/C++ files. - - - - - The registers view displays the register values of a selected stack frame. - - - - - Change the color in which register values are displayed. - - - - - The memory view displays process memory. - - - - - Click below to see help - - - - - Click below to see help - - - - - Set the refresh preference for the Shared Libraries view. - - - - - Click below to see help - - - - - View information about your program as you debug. - - - - - Enter a timeout value in milliseconds. - - - - - Provide information on the project and application you want to run or debug. - - - - - Provide information on the project and application you want to run or debug. - - - - - Set environment variables and values. - - - - - Select a debugger. - - - - - Specify where the debugger should look for source files. - - - - - Specify where your run configuration is stored. - - - - - Customize the appearance of the C/C++ Editor. - - - - - Customize the appearance of the C/C++ Editor. - - - - - Customize the appearance of the C/C++ editor. - - - - - Customize how the Content Assist feature works. - - - - - Create, edit, remove, import, or export code templates. - - - - - Click below to see help - - - - diff --git a/doc/org.eclipse.cdt.doc.user/contexts_CDT.xml b/doc/org.eclipse.cdt.doc.user/contexts_CDT.xml deleted file mode 100644 index aba2b14bd43..00000000000 --- a/doc/org.eclipse.cdt.doc.user/contexts_CDT.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - Click below to see help. - - - - - Control the build messages displayed in the Tasks view. - - - - - Select a binary parser for the target platform. - - - - - Select a target deployment platform. - - - - - Customize the appearance of the C/C++ Editor. - - - - - Customize the appearance of the C/C++ Editor. - - - - - Customize the appearance of the C/C++ editor. - - - - - Customize how the Content Assist feature works. - - - - - Create, edit, remove, import, or export code templates. - - - - - Search for C/C++ elements. - - - - diff --git a/doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER.xml b/doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER.xml deleted file mode 100644 index 586e3a6ac2c..00000000000 --- a/doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - Click below to see help. - - - - - The registers view displays the register values of a selected stack frame. - - - - - Change the color in which register values are displayed. - - - - The memory view displays process memory. - - - - - Click below to see help - - - - - Click below to see help - - - - - Set the refresh preference for the Shared Libraries view. - - - - Click below to see help - - - - - View information about your program as you debug. - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER_MI.xml b/doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER_MI.xml deleted file mode 100644 index 6797b30ef9c..00000000000 --- a/doc/org.eclipse.cdt.doc.user/contexts_CDT_DEBUGGER_MI.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - Click below to see help. - - - - - Enter a timeout value in milliseconds. - - - diff --git a/doc/org.eclipse.cdt.doc.user/contexts_CDT_LAUNCH.xml b/doc/org.eclipse.cdt.doc.user/contexts_CDT_LAUNCH.xml deleted file mode 100644 index ef5d68138c4..00000000000 --- a/doc/org.eclipse.cdt.doc.user/contexts_CDT_LAUNCH.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - Click below to see help. - - - - - Provide information on the project and application you want to run or debug. - - - - - Provide information on the project and application you want to run or debug. - - - - - Set environment variables and values. - - - - - Select a debugger. - - - - - Specify where the debugger should look for source files. - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/contexts_CDT_make.xml b/doc/org.eclipse.cdt.doc.user/contexts_CDT_make.xml deleted file mode 100644 index 779bc417d74..00000000000 --- a/doc/org.eclipse.cdt.doc.user/contexts_CDT_make.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - Click below to see help. - - - - - Define the build settings for the current project. - - - - - Enter include paths and symbols. - - - - diff --git a/doc/org.eclipse.cdt.doc.user/doc.zip b/doc/org.eclipse.cdt.doc.user/doc.zip deleted file mode 100644 index 1674f7b3a28..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/doc.zip and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_build.htm b/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_build.htm deleted file mode 100644 index f906eb5d20d..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_build.htm +++ /dev/null @@ -1,25 +0,0 @@ -vti_encoding:SR|utf8-nl -vti_timelastmodified:TR|27 Nov 2003 20:35:43 -0000 -vti_extenderversion:SR|5.0.2.2623 -vti_author:SR|tdesous -vti_modifiedby:SR|tdesous -vti_timecreated:TR|27 Nov 2003 13:47:44 -0000 -vti_title:SR|Building your project -vti_lineageid:SR|{C426A02B-2FB6-4720-B4E8-6BFFC5942BD3} -vti_backlinkinfo:VX|tasks/cdt_o_tutorial.htm getting_started/cdt_w_debug.htm getting_started/cdt_w_newmake.htm -vti_nexttolasttimemodified:TR|27 Nov 2003 20:33:32 -0000 -vti_cacheddtm:TX|27 Nov 2003 20:35:43 -0000 -vti_filesize:IR|2336 -vti_cachedtitle:SR|Building your project -vti_cachedbodystyle:SR| -vti_cachedlinkinfo:VX|Q|../help.css S|../images/ngconcepts.gif H|../concepts/cdt_c_projects.htm H|../concepts/cdt_c_build_over.htm S|../images/ngtasks.gif H|../tasks/cdt_o_build_task.htm S|../images/ngref.gif H|../reference/cdt_u_newproj_buildset.htm H|cdt_w_debug.htm S|../images/ngnext.gif H|cdt_w_debug.htm H|cdt_w_newmake.htm S|../images/ngback.gif H|cdt_w_newmake.htm S|../images/ngtasks.gif -vti_cachedsvcrellinks:VX|FQUS|help.css FSUS|images/ngconcepts.gif FHUS|concepts/cdt_c_projects.htm FHUS|concepts/cdt_c_build_over.htm FSUS|images/ngtasks.gif FHUS|tasks/cdt_o_build_task.htm FSUS|images/ngref.gif FHUS|reference/cdt_u_newproj_buildset.htm FHUS|getting_started/cdt_w_debug.htm FSUS|images/ngnext.gif FHUS|getting_started/cdt_w_debug.htm FHUS|getting_started/cdt_w_newmake.htm FSUS|images/ngback.gif FHUS|getting_started/cdt_w_newmake.htm FSUS|images/ngtasks.gif -vti_cachedneedsrewrite:BR|false -vti_cachedhasbots:BR|false -vti_cachedhastheme:BR|false -vti_cachedhasborder:BR|false -vti_metatags:VR|HTTP-EQUIV=Content-Language en-us GENERATOR Microsoft\\ FrontPage\\ 5.0 ProgId FrontPage.Editor.Document HTTP-EQUIV=Content-Type text/html;\\ charset=UTF-8 -vti_charset:SR|utf-8 -vti_language:SR|en-us -vti_progid:SR|FrontPage.Editor.Document -vti_generator:SR|Microsoft FrontPage 5.0 diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_debug.htm b/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_debug.htm deleted file mode 100644 index d367e365c32..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_debug.htm +++ /dev/null @@ -1,25 +0,0 @@ -vti_encoding:SR|utf8-nl -vti_timelastmodified:TR|27 Nov 2003 20:33:56 -0000 -vti_extenderversion:SR|5.0.2.2623 -vti_author:SR|tdesous -vti_modifiedby:SR|tdesous -vti_timecreated:TR|27 Nov 2003 14:37:52 -0000 -vti_title:SR|Debugging your project -vti_lineageid:SR|{5ACBE23B-330E-4908-89B6-8413A9847BDB} -vti_backlinkinfo:VX|tasks/cdt_o_tutorial.htm getting_started/cdt_w_build.htm -vti_cacheddtm:TX|27 Nov 2003 20:33:56 -0000 -vti_filesize:IR|3364 -vti_cachedtitle:SR|Debugging your project -vti_cachedbodystyle:SR| -vti_cachedlinkinfo:VX|Q|../help.css H|cdt_w_build.htm S|../images/ngback.gif H|cdt_w_build.htm S|../images/ngconcepts.gif H|../concepts/cdt_c_over_dbg.htm H|../concepts/cdt_c_dbg_info.htm S|../images/ngtasks.gif H|../tasks/cdt_o_debug.htm S|../images/ngref.gif H|../reference/cdt_u_dbg_view.htm H|../reference/cdt_u_dbg_view.htm S|../images/ngtasks.gif -vti_cachedsvcrellinks:VX|FQUS|help.css FHUS|getting_started/cdt_w_build.htm FSUS|images/ngback.gif FHUS|getting_started/cdt_w_build.htm FSUS|images/ngconcepts.gif FHUS|concepts/cdt_c_over_dbg.htm FHUS|concepts/cdt_c_dbg_info.htm FSUS|images/ngtasks.gif FHUS|tasks/cdt_o_debug.htm FSUS|images/ngref.gif FHUS|reference/cdt_u_dbg_view.htm FHUS|reference/cdt_u_dbg_view.htm FSUS|images/ngtasks.gif -vti_cachedneedsrewrite:BR|false -vti_cachedhasbots:BR|false -vti_cachedhastheme:BR|false -vti_cachedhasborder:BR|false -vti_metatags:VR|HTTP-EQUIV=Content-Language en-us GENERATOR Microsoft\\ FrontPage\\ 5.0 ProgId FrontPage.Editor.Document HTTP-EQUIV=Content-Type text/html;\\ charset=UTF-8 -vti_charset:SR|utf-8 -vti_language:SR|en-us -vti_progid:SR|FrontPage.Editor.Document -vti_generator:SR|Microsoft FrontPage 5.0 -vti_nexttolasttimemodified:TR|27 Nov 2003 14:37:52 -0000 diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_existing_code.htm b/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_existing_code.htm deleted file mode 100644 index b36a24aa2f7..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_existing_code.htm +++ /dev/null @@ -1,25 +0,0 @@ -vti_encoding:SR|utf8-nl -vti_timelastmodified:TR|27 Nov 2003 20:39:26 -0000 -vti_extenderversion:SR|5.0.2.2623 -vti_author:SR|tdesous -vti_modifiedby:SR|tdesous -vti_timecreated:TR|27 Nov 2003 13:53:19 -0000 -vti_title:SR|How to bring C/C++ source files into Eclipse -vti_lineageid:SR|{8ED3B7BB-6E0F-4AE4-A721-3A10DE2F9584} -vti_backlinkinfo:VX|concepts/cdt_c_projects.htm concepts/cdt_c_proj_file_views.htm concepts/cdt_c_over_cdt.htm concepts/cdt_o_concepts.htm -vti_nexttolasttimemodified:TR|27 Nov 2003 20:35:22 -0000 -vti_cacheddtm:TX|27 Nov 2003 20:39:26 -0000 -vti_filesize:IR|4033 -vti_cachedtitle:SR|How to bring C/C++ source files into Eclipse -vti_cachedbodystyle:SR| -vti_cachedlinkinfo:VX|Q|../help.css H|../tasks/cdt_t_proj_new.htm H|../tasks/cdt_o_proj_prop.htm H|../tasks/cdt_t_proj_new.htm H|../tasks/cdt_o_proj_prop.htm S|../images/ngconcepts.gif H|../concepts/cdt_c_over_cdt.htm H|../concepts/cdt_c_projects.htm S|../images/ngtasks.gif H|../tasks/cdt_o_proj_files.htm S|../images/ngref.gif H|../reference/cdt_o_proj_prop_pages.htm S|../images/ngtasks.gif -vti_cachedsvcrellinks:VX|FQUS|help.css FHUS|tasks/cdt_t_proj_new.htm FHUS|tasks/cdt_o_proj_prop.htm FHUS|tasks/cdt_t_proj_new.htm FHUS|tasks/cdt_o_proj_prop.htm FSUS|images/ngconcepts.gif FHUS|concepts/cdt_c_over_cdt.htm FHUS|concepts/cdt_c_projects.htm FSUS|images/ngtasks.gif FHUS|tasks/cdt_o_proj_files.htm FSUS|images/ngref.gif FHUS|reference/cdt_o_proj_prop_pages.htm FSUS|images/ngtasks.gif -vti_cachedneedsrewrite:BR|false -vti_cachedhasbots:BR|false -vti_cachedhastheme:BR|false -vti_cachedhasborder:BR|false -vti_metatags:VR|HTTP-EQUIV=Content-Language en-us GENERATOR Microsoft\\ FrontPage\\ 5.0 ProgId FrontPage.Editor.Document HTTP-EQUIV=Content-Type text/html;\\ charset=UTF-8 -vti_charset:SR|utf-8 -vti_language:SR|en-us -vti_progid:SR|FrontPage.Editor.Document -vti_generator:SR|Microsoft FrontPage 5.0 diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newcpp.htm b/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newcpp.htm deleted file mode 100644 index 9de42ed5ca4..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newcpp.htm +++ /dev/null @@ -1,25 +0,0 @@ -vti_encoding:SR|utf8-nl -vti_timelastmodified:TR|27 Nov 2003 20:35:33 -0000 -vti_extenderversion:SR|5.0.2.2623 -vti_author:SR|tdesous -vti_modifiedby:SR|tdesous -vti_timecreated:TR|27 Nov 2003 13:53:18 -0000 -vti_title:SR|Creating your C++ file -vti_lineageid:SR|{FC472724-E701-47F3-BC38-E0667264ED63} -vti_backlinkinfo:VX|tasks/cdt_o_tutorial.htm getting_started/cdt_w_newmake.htm getting_started/cdt_w_newproj.htm -vti_nexttolasttimemodified:TR|27 Nov 2003 20:34:30 -0000 -vti_cacheddtm:TX|27 Nov 2003 20:35:33 -0000 -vti_filesize:IR|4197 -vti_cachedtitle:SR|Creating your C++ file -vti_cachedbodystyle:SR| -vti_cachedlinkinfo:VX|Q|../help.css H|cdt_w_newproj.htm H|cdt_w_newmake.htm S|../images/ngnext.gif H|cdt_w_newmake.htm H|cdt_w_newproj.htm S|../images/ngback.gif H|cdt_w_newproj.htm S|../images/ngconcepts.gif H|../concepts/cdt_c_projects.htm H|../concepts/cdt_c_proj_file_views.htm H|../concepts/cdt_o_code_entry.htm S|../images/ngtasks.gif H|../tasks/cdt_o_proj_files.htm H|../tasks/cdt_o_write_code.htm S|../images/ngref.gif H|../reference/cdt_o_proj_prop_pages.htm S|../images/ngtasks.gif -vti_cachedsvcrellinks:VX|FQUS|help.css FHUS|getting_started/cdt_w_newproj.htm FHUS|getting_started/cdt_w_newmake.htm FSUS|images/ngnext.gif FHUS|getting_started/cdt_w_newmake.htm FHUS|getting_started/cdt_w_newproj.htm FSUS|images/ngback.gif FHUS|getting_started/cdt_w_newproj.htm FSUS|images/ngconcepts.gif FHUS|concepts/cdt_c_projects.htm FHUS|concepts/cdt_c_proj_file_views.htm FHUS|concepts/cdt_o_code_entry.htm FSUS|images/ngtasks.gif FHUS|tasks/cdt_o_proj_files.htm FHUS|tasks/cdt_o_write_code.htm FSUS|images/ngref.gif FHUS|reference/cdt_o_proj_prop_pages.htm FSUS|images/ngtasks.gif -vti_cachedneedsrewrite:BR|false -vti_cachedhasbots:BR|false -vti_cachedhastheme:BR|false -vti_cachedhasborder:BR|false -vti_metatags:VR|HTTP-EQUIV=Content-Language en-us GENERATOR Microsoft\\ FrontPage\\ 5.0 ProgId FrontPage.Editor.Document HTTP-EQUIV=Content-Type text/html;\\ charset=UTF-8 -vti_charset:SR|utf-8 -vti_language:SR|en-us -vti_progid:SR|FrontPage.Editor.Document -vti_generator:SR|Microsoft FrontPage 5.0 diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newmake.htm b/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newmake.htm deleted file mode 100644 index 5ad74c1a55b..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newmake.htm +++ /dev/null @@ -1,25 +0,0 @@ -vti_encoding:SR|utf8-nl -vti_timelastmodified:TR|27 Nov 2003 20:35:33 -0000 -vti_extenderversion:SR|5.0.2.2623 -vti_author:SR|tdesous -vti_modifiedby:SR|tdesous -vti_timecreated:TR|27 Nov 2003 13:53:19 -0000 -vti_title:SR|Creating your makefile -vti_lineageid:SR|{97737D43-A0C2-43B0-887D-522EAC2360C1} -vti_backlinkinfo:VX|tasks/cdt_o_tutorial.htm getting_started/cdt_w_build.htm getting_started/cdt_w_newcpp.htm -vti_nexttolasttimemodified:TR|27 Nov 2003 20:34:30 -0000 -vti_cacheddtm:TX|27 Nov 2003 20:35:33 -0000 -vti_filesize:IR|2881 -vti_cachedtitle:SR|Creating your makefile -vti_cachedbodystyle:SR| -vti_cachedlinkinfo:VX|Q|../help.css H|cdt_w_build.htm S|../images/ngnext.gif H|cdt_w_build.htm H|cdt_w_build.htm H|cdt_w_newcpp.htm S|../images/ngback.gif H|cdt_w_newcpp.htm S|../images/ngconcepts.gif H|../concepts/cdt_o_projects.htm H|../concepts/cdt_o_code_entry.htm S|../images/ngtasks.gif H|../tasks/cdt_o_proj_files.htm H|../tasks/cdt_o_write_code.htm S|../images/ngref.gif H|../reference/cdt_o_proj_prop_pages.htm S|../images/ngtasks.gif -vti_cachedsvcrellinks:VX|FQUS|help.css FHUS|getting_started/cdt_w_build.htm FSUS|images/ngnext.gif FHUS|getting_started/cdt_w_build.htm FHUS|getting_started/cdt_w_build.htm FHUS|getting_started/cdt_w_newcpp.htm FSUS|images/ngback.gif FHUS|getting_started/cdt_w_newcpp.htm FSUS|images/ngconcepts.gif FHUS|concepts/cdt_o_projects.htm FHUS|concepts/cdt_o_code_entry.htm FSUS|images/ngtasks.gif FHUS|tasks/cdt_o_proj_files.htm FHUS|tasks/cdt_o_write_code.htm FSUS|images/ngref.gif FHUS|reference/cdt_o_proj_prop_pages.htm FSUS|images/ngtasks.gif -vti_cachedneedsrewrite:BR|false -vti_cachedhasbots:BR|false -vti_cachedhastheme:BR|false -vti_cachedhasborder:BR|false -vti_metatags:VR|HTTP-EQUIV=Content-Language en-us GENERATOR Microsoft\\ FrontPage\\ 5.0 ProgId FrontPage.Editor.Document HTTP-EQUIV=Content-Type text/html;\\ charset=UTF-8 -vti_charset:SR|utf-8 -vti_language:SR|en-us -vti_progid:SR|FrontPage.Editor.Document -vti_generator:SR|Microsoft FrontPage 5.0 diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newproj.htm b/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newproj.htm deleted file mode 100644 index a93b7f6c59f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/_vti_cnf/cdt_w_newproj.htm +++ /dev/null @@ -1,25 +0,0 @@ -vti_encoding:SR|utf8-nl -vti_timelastmodified:TR|27 Nov 2003 20:35:22 -0000 -vti_extenderversion:SR|5.0.2.2623 -vti_author:SR|tdesous -vti_modifiedby:SR|tdesous -vti_timecreated:TR|27 Nov 2003 13:53:18 -0000 -vti_title:SR|Creating your project -vti_lineageid:SR|{41DD5123-C630-4CE3-AFCE-3E005940D5A9} -vti_backlinkinfo:VX|tasks/cdt_o_tutorial.htm getting_started/cdt_w_newcpp.htm -vti_nexttolasttimemodified:TR|27 Nov 2003 20:34:30 -0000 -vti_cacheddtm:TX|27 Nov 2003 20:35:22 -0000 -vti_filesize:IR|3794 -vti_cachedtitle:SR|Creating your project -vti_cachedbodystyle:SR| -vti_cachedlinkinfo:VX|Q|../help.css H|cdt_w_newcpp.htm S|../images/ngnext.gif H|cdt_w_newcpp.htm S|../images/ngconcepts.gif H|../concepts/cdt_c_over_cdt.htm H|../concepts/cdt_c_projects.htm H|../concepts/cdt_c_proj_file_views.htm S|../images/ngtasks.gif H|../tasks/cdt_o_proj_prop.htm H|../tasks/cdt_o_proj_files.htm S|../images/ngref.gif H|../reference/cdt_o_proj_prop_pages.htm S|../images/ngtasks.gif -vti_cachedsvcrellinks:VX|FQUS|help.css FHUS|getting_started/cdt_w_newcpp.htm FSUS|images/ngnext.gif FHUS|getting_started/cdt_w_newcpp.htm FSUS|images/ngconcepts.gif FHUS|concepts/cdt_c_over_cdt.htm FHUS|concepts/cdt_c_projects.htm FHUS|concepts/cdt_c_proj_file_views.htm FSUS|images/ngtasks.gif FHUS|tasks/cdt_o_proj_prop.htm FHUS|tasks/cdt_o_proj_files.htm FSUS|images/ngref.gif FHUS|reference/cdt_o_proj_prop_pages.htm FSUS|images/ngtasks.gif -vti_cachedneedsrewrite:BR|false -vti_cachedhasbots:BR|false -vti_cachedhastheme:BR|false -vti_cachedhasborder:BR|false -vti_metatags:VR|HTTP-EQUIV=content-language en-us generator Microsoft\\ FrontPage\\ 5.0 progid FrontPage.Editor.Document HTTP-EQUIV=content-type text/html;\\ charset=UTF-8 -vti_charset:SR|utf-8 -vti_language:SR|en-us -vti_progid:SR|FrontPage.Editor.Document -vti_generator:SR|Microsoft FrontPage 5.0 diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_o_tutorial.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_o_tutorial.htm deleted file mode 100644 index 0e6c34f13e8..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_o_tutorial.htm +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - -Tutorial - - - - - -

            Tutorial

            This tutorial guides you through the basic steps to get started -with the C/C++ Development Toolkit (CDT) by creating a HelloWorld -project on Windows.

            -

            Before you begin

            -

            You need to install and configure the following utilities:

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Create, name, and specify the location of your - projectCreating your - project
            Create, name, and save your .cpp fileCreating your C++ - file
            Create, name, and save your gnu makefileCreating your makefile
            Build your projectBuilding your project
            Create a debug configuration and debug - your projectDebugging your - project
            - - 

            -IBM Copyright Statement

            - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_build.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_build.htm deleted file mode 100644 index 36c88316578..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_build.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - -Building your project - - - - - -

            Building your project

            - -

            Make output and build progress information is displayed in the C-Build view. -The Make Targets view displays makefile actions. The Tasks view displays compile warnings or -errors.

            - -

            To build your project:

            -
              -
            1. In the C/C++ Projects view, select the HelloWorld project.
            2. -
            3. Click Project > Build Project.
            4. -

               

              - -

              If you get the error message:

              - -

              Exec error:Launching failed

              - -

              This error message means -that the CDT cannot locate the build command, usually make. Either your path is -not configured correctly or you do not have make installed on your system.

              - -
            -

            Related concepts -
            -CDT Projects
            -Build overview

            -

            Related tasks -
            -Building

            -

            Related reference -
            -Make Builder page, C/C++ Properties window

            -

            - Next: Debugging your project   

            - -

            - Back: Creating your makefile   

            - - -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm deleted file mode 100644 index 6adce8ff01a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - -Debugging your project - - - - - -

            Debugging your project

            - -

            The debugger lets you control the execution of your program by setting -breakpoints, suspending executed programs, stepping through your code, and -examining the contents of variables.

            -

            To debug a project:

            -
              -
            1. Click Run > Debug.

              The Debug dialog box - opens.

            2. -
            3. Double-click C++ Local.
            4. -
            5. In the Name box, type Hello World.
            6. -

              You can now select this debug launch configuration by name the next time - that you debug this project.

              -
            7. In the C/C++ Application box, type hello.exe.
            8. -
            9. Click Debug.
            10. -

              The debug perspective the hello.exe application window open. - The C/C++ editor is repositioned in the perspective.

              -
            11. In the left margin of the main.cpp window, double-click to set a - breakpoint on:
              -  cout << "You just entered"
            12. -
            13. Click Run > Resume.
            14. -
            15. When prompted, type a value other than 'm'.
              - The breakpoint will be hit.
            16. -
            17. In the Variable view, verify that the variable is not 'm'.
            18. -
            19. Click Run > Resume.
            20. -
            21. When prompted, type a value other than 'm'.
            22. -

              The breakpoint will be hit.

              -
            23. In the Variable view, verify that the variable is not 'm'.
            24. -
            25. In the Variable view, right-click the input variable, and select Change - Variable Value and type 'm'.
            26. -
            27. Click Run > Resume.
            28. -

              The output in the hello.exe application window is:
              - "You just entered m, you need to enter m to exit."

            29. Type 'm' to end the program.
              - The hello.exe application window closes and the debug session ends. The debug - perspective remains open.
            30. -
            - -

            To learn more about the debug aids at your disposal, refer to the related -debug conceptual topics.

            - -

            - Back: Building your project   

            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Debug view
            -Debug launch controls

            -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_existing_code.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_existing_code.htm deleted file mode 100644 index 01618ef460a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_existing_code.htm +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - -How to bring C/C++ source files into Eclipse - - - - - -

            How to bring C/C++ source files into Eclipse

            - -

            A common scenario that you may encounter when starting to use the CDT, is -determining how -to bring existing C/C++ source files into Eclipse. There are a number of ways to -do this. The scenarios described below are recommended approaches.

            - -

            Create new projects for existing source roots

            - -

            If you can access the source from your desktop using the command -line, then you can make the root source folders Eclipse projects. This is accomplished by -creating a C/C++ Standard Make Project. For more information, see -Creating a project and -Defining project properties.

            - -

            The resources for the project are maintained in the remote location specified, -not in the workspace folder for Eclipse. However, your existing folder structure -is displayed in the C/C++ Projects view. Meta data for the project, such as the -index for the project and the link to the existing source, is stored in the metadata -directory in the workspace folder. For more information on the workspace folder, -see Workbench User Guide > Tasks > Importing > Upgrading Eclipse.

            - -

            Create a project from CVS

            - -

            If your existing source tree is managed in CVS, you can use the CVS -Repository perspective to "Checkout As..." any folder in the repository. -The first time you "Checkout As...", the New Project wizard is launched and you need to -create a C or C++ project for the folder. For more information, see -Creating a project and -Defining project properties.

            - -

            A CVS checkout of the project into the project's location occurs.

            - -

            Import your C/C++ source file system

            - -

            Another approach would be to create a C/C++ Project and then import your -existing file system. - -For more information, see Workbench User Guide > Tasks > Importing > -Importing resources from the file system.

            - -

            This approach copies the files from your file system to an Eclipse Workbench -project or folder. Your original source files remain unchanged and it is the -copies of the files that will be edited, built and debugged using the CDT.  -When you have successfully imported your existing file system, the folder -structure is displayed in the C/C++ Projects view.

            - -

            Tip:

            - -
              -
            • Importing your existing file system can consume significant disk space - depending on the size of your files.
            • -
            • Your files may become detached from an existing source control system that - previously referenced the original file location such as a ClearCase view.
            • -
            - -

            Related concepts -
            -Overview of the CDT
            CDT Projects

            -

            Related tasks -
            -Working with C/C++ project files

            -

            Related reference -
            -Project properties

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newcpp.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newcpp.htm deleted file mode 100644 index ec9251498b3..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newcpp.htm +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - -Creating your C++ file - - - - - -

            Creating your C++ file

            - -

            You can begin coding your HelloWorld program. The .cpp file that you -create will be saved in the project folder you just created -Creating your project.

            - -

            Files are edited in the C/C++ editor located to the right of -the C/C++ Projects view. The left margin of the C/C++ editor, called the marker -bar, displays icons for -items such as bookmarks, breakpoints, and compiler errors and warnings.

            - -

            For more information about:

            -
              -
            • The marker bar, see Workbench User Guide > Reference > User interface - information > Icons and buttons > Editor area marker bar
            • -
            • The editor area, see Workbench User Guide > Reference > User interface - information > Views and editors > Editor area
            • -
            -

            To create your C++ file:

            -
              -
            1. In the C++ Projects view, right-click the HelloWorld project - folder, and select New > File.
            2. -
            3. In the File name box, type main.cpp.
            4. -
            5. Click Finish.
            6. -
            7. Type the code below in the editor. Lines are indented with tab - characters, not with spaces.
            8. - -
              -

              #include <iostream>
              - using namespace std;
              -
              - int main () {
              -     - // Say Hello five times
              -     - for (int index = 0; index < 5; ++index)
              -     - cout << "HelloWorld!" << endl;
              -
              -     - char input = 'i';
              -
              -     - cout << "To exit, press 'm'" << endl;
              -
              -     - while(input != 'm') {
              -         - cin  >> input;
              -         - cout << "You just entered " << input
              -             << " you need to enter m to exit." << endl;
              -     - }
              -
              -     - exit(0);
              - }

              -
              -
            9. Click File > - Save.
            10. -
            - -

            Your new .cpp file is displayed in the C/C++ Projects -view and in the Navigator view. Your project now contains main.cpp. Before you -can build your HelloWorld project, you must next create a makefile.

            - -

            - - Next: Creating your makefile -

            - -

            - Back: Creating your project

            - -

            Related concepts -
            -CDT projects
            -Project file views
            -Coding aids

            -

            Related tasks -
            -Working with C/C++ project files
            -Writing code

            -

            Related reference -
            -C/C++ Projects view

            - -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newmake.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newmake.htm deleted file mode 100644 index e348a54675b..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newmake.htm +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - -Creating your makefile - - - - - -

            Creating your makefile

            - -

            For the purpose of this tutorial, you were instructed to create a Standard -Make C++ Project which requires you to create a makefile. Managed Make C/C++ projects generate makefiles for you.

            - -

            To create your makefile:

            -
              -
            1. In the C++ Projects view, right-click the HelloWorld project - folder and select New > File.
            2. -
            3. In the File name box, type makefile.
            4. -
            5. Click Finish.
            6. -
            7. Type the gnu make instructions below in the editor. Lines are - indented with tab characters, not with spaces.
            8. - -
              -

              -
              - all: hello.exe
              -
              - clean:
              -    rm main.o hello.exe
              -
              - hello.exe: main.o
              -    g++ -g -o hello main.o
              -
              - main.o:
              -    g++ -c -g main.cpp

              -
              -
            9. Click File > - Save.
            - -

            Your new makefile, along with your main.cpp file are -displayed in the C/C++ Projects view and in the Navigator view. Your project now -contains main.cpp and makefile. You can now build your HelloWorld project.

            - -

            - - - - Next: Building your project -

            -

            - - - Back: Creating your C++ file

            -

            Related concepts -
            -Project
            -Code entry

            -

            Related tasks -
            -Working with C/C++ project files
            -Writing code

            -

            Related reference -
            -C/C++ Projects view

            - -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newproj.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newproj.htm deleted file mode 100644 index bc648ebe982..00000000000 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_newproj.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - -Creating your project - -

            Creating your project

            You need to create a project to -contain your source code and related files. A project has an associated builder -that can incrementally compile source files as they are changed.

            -To create your project:

              -
            1. Click File > New > Project.
              The New Project Wizard opens. -
            2. -
            3. Select C++.
            4. -
            5. Click Standard Make C++ Project.
              You can also create a managed -make C++ project so that a makefile is automatically generated. For the -purpose of this tutorial, you will create a standard make C++ project which -requires you to provide a makefile in order to build the project.
            6. -
            7. Click Next.
            8. -
            9. In the Name box, type HelloWorld.
            10. -
            11. Leave the Use Default Location check box selected.
              Note that -the location of the workspace folder where your project is saved is grayed -out in the Location box.
            12. -
            13. Click Next.
            14. -
            15. Click the Binary Parser tab.
            16. -
            17. In the Binary Parser list, click PE Windows Parser.
            18. -

              To ensure the accuracy of the C/C++ Projects view and the ability to successfully -run and debug your programs, select the correct parser is important. After -you select the correct parser for your development environment and build your - project, you can view the components of the .o file in the C/C++ Projects -view. You can also view the contents of the .o file in the C/C++ editor. -

              -
            19. Click Finish.
            20. -
            21. If a message box prompts you to switch perspectives, click Yes. -
            22. -

            Your new project is displayed in the C/C++ Projects view and in -the Navigator view. Your project is empty because you have not yet created -files for your project. You can now start writing the code for your HelloWorld -program.

            Tip: You can view and modify the properties of your -HelloWorld project by right-clicking on the project in the C/C++ Projects -view and clicking Properties.

            -Next: Creating your C++ file

            For more information -about:

              -
            • Projects, see Workbench User Guide > Concepts > Workbench > Resources -
            • -
            • The workspace, see Workbench User Guide > Tasks > Upgrading Eclipse -
            • -

            Related concepts
            CDT overview
            -CDT projects
            Project file views -

            Related tasks
            Defining project properties -
            Working with C/C++ project files

            Related reference
            C/C++ Projects view

            - diff --git a/doc/org.eclipse.cdt.doc.user/help.css b/doc/org.eclipse.cdt.doc.user/help.css deleted file mode 100644 index 1276d8d1e3e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/help.css +++ /dev/null @@ -1,52 +0,0 @@ -/* following font face declarations need to be removed for DBCS */ - - -body, h1, h2, h3, h4, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, sans-serif; color: #000000} -pre { font-family: Courier, monospace} - -/* end font face declarations */ - -/* following font size declarations should be OK for DBCS */ -body, h1, h2, h3, h4, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; } -pre { font-size: 10pt} - -/* end font size declarations */ - -body { background: #FFFFFF} -h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 } -h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 } -h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 } -h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic } -p { margin-top: 10px; margin-bottom: 10px } -pre { margin-left: 6; font-size: 9pt } - -a:link { color: #006699 } -a:visited { color: #996699 } -a:hover { color: #006699 } - -ul { margin-top: 0; margin-bottom: 10 } -li { margin-top: 0; margin-bottom: 0 } -li p { margin-top: 0; margin-bottom: 0 } -ol { margin-top: 0; margin-bottom: 10 } -dl { margin-top: 0; margin-bottom: 10 } -dt { margin-top: 0; margin-bottom: 0; font-weight: bold } -dd { margin-top: 0; margin-bottom: 0 } -strong { font-weight: bold} -em { font-style: italic} -var { font-style: italic} -div.revision { border-left-style: solid; border-left-width: thin; - border-left-color: #7B68EE; padding-left:5 } -th { font-weight: bold } - -/* Mike Behm's addition to the style sheet */ -.userinput { font-family: monospace; } -.guitab, .important, .guibutton, .selectblue, .guimenu, .guilabel, -.notetitle { - color: #000000; - font-family: helvetica, arial, sans-serif; - font-weight: bold; - } -div.linux {display:none;} -.firsterm {font-style:italic;} - - diff --git a/doc/org.eclipse.cdt.doc.user/images/alphab_sort_co.gif b/doc/org.eclipse.cdt.doc.user/images/alphab_sort_co.gif deleted file mode 100644 index 6d772441d0d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/alphab_sort_co.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/c_file_obj.gif b/doc/org.eclipse.cdt.doc.user/images/c_file_obj.gif deleted file mode 100644 index 1bb68c2d649..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/c_file_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/class_obj.gif b/doc/org.eclipse.cdt.doc.user/images/class_obj.gif deleted file mode 100644 index a4a14864987..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/class_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/container_obj.gif b/doc/org.eclipse.cdt.doc.user/images/container_obj.gif deleted file mode 100644 index 3aa2efae2e0..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/container_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/contents_view.gif b/doc/org.eclipse.cdt.doc.user/images/contents_view.gif deleted file mode 100644 index 20e0ff988de..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/contents_view.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/define_obj.gif b/doc/org.eclipse.cdt.doc.user/images/define_obj.gif deleted file mode 100644 index b3ddb5deebc..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/define_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/editor_c_codetemplates_use.gif b/doc/org.eclipse.cdt.doc.user/images/editor_c_codetemplates_use.gif deleted file mode 100644 index a7ff13dfa63..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/editor_c_codetemplates_use.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/enum_obj.gif b/doc/org.eclipse.cdt.doc.user/images/enum_obj.gif deleted file mode 100644 index 3ce0d82ebc4..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/enum_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/enumerator_obj.gif b/doc/org.eclipse.cdt.doc.user/images/enumerator_obj.gif deleted file mode 100644 index a73f31a81f6..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/enumerator_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/error_icon.gif b/doc/org.eclipse.cdt.doc.user/images/error_icon.gif deleted file mode 100644 index fcb99dc9bc2..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/error_icon.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/field_obj.gif b/doc/org.eclipse.cdt.doc.user/images/field_obj.gif deleted file mode 100644 index 19d27defb62..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/field_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/field_private_obj.gif b/doc/org.eclipse.cdt.doc.user/images/field_private_obj.gif deleted file mode 100644 index 0e292426734..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/field_private_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/field_protected_obj.gif b/doc/org.eclipse.cdt.doc.user/images/field_protected_obj.gif deleted file mode 100644 index 222116b455c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/field_protected_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/field_public_obj.gif b/doc/org.eclipse.cdt.doc.user/images/field_public_obj.gif deleted file mode 100644 index 630b286c3bd..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/field_public_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/fields_co.gif b/doc/org.eclipse.cdt.doc.user/images/fields_co.gif deleted file mode 100644 index e14ce565b4f..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/fields_co.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/filterbutton.gif b/doc/org.eclipse.cdt.doc.user/images/filterbutton.gif deleted file mode 100644 index 5fde436055e..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/filterbutton.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/function_obj.gif b/doc/org.eclipse.cdt.doc.user/images/function_obj.gif deleted file mode 100644 index 18103b11fc7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/function_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_breakpoint_obj.gif b/doc/org.eclipse.cdt.doc.user/images/icon_breakpoint_obj.gif deleted file mode 100644 index 06d007905b2..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_breakpoint_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_debug_exc.gif b/doc/org.eclipse.cdt.doc.user/images/icon_debug_exc.gif deleted file mode 100644 index 3052a80cd67..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_debug_exc.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_debugt_obj.gif b/doc/org.eclipse.cdt.doc.user/images/icon_debugt_obj.gif deleted file mode 100644 index d139cde9dd4..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_debugt_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_disconnect.gif b/doc/org.eclipse.cdt.doc.user/images/icon_disconnect.gif deleted file mode 100644 index f1d5fb31e51..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_disconnect.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_installed_ovr.gif b/doc/org.eclipse.cdt.doc.user/images/icon_installed_ovr.gif deleted file mode 100644 index 7f4a31ee7eb..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_installed_ovr.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_memory_update.gif b/doc/org.eclipse.cdt.doc.user/images/icon_memory_update.gif deleted file mode 100644 index ca4fe2b1cff..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_memory_update.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_relaunch.gif b/doc/org.eclipse.cdt.doc.user/images/icon_relaunch.gif deleted file mode 100644 index 6b0c23d8f61..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_relaunch.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_remove_all.gif b/doc/org.eclipse.cdt.doc.user/images/icon_remove_all.gif deleted file mode 100644 index 2c069ab3f43..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_remove_all.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_run_exc.gif b/doc/org.eclipse.cdt.doc.user/images/icon_run_exc.gif deleted file mode 100644 index 8174dade2bb..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_run_exc.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_stackframe.gif b/doc/org.eclipse.cdt.doc.user/images/icon_stackframe.gif deleted file mode 100644 index b9783c814a7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_stackframe.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_stackframe_running.gif b/doc/org.eclipse.cdt.doc.user/images/icon_stackframe_running.gif deleted file mode 100644 index ef406cf24c9..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_stackframe_running.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_terminate.gif b/doc/org.eclipse.cdt.doc.user/images/icon_terminate.gif deleted file mode 100644 index d47876f6857..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_terminate.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_terminate_all.gif b/doc/org.eclipse.cdt.doc.user/images/icon_terminate_all.gif deleted file mode 100644 index ec56a24fabc..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_terminate_all.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_terminate_rem.gif b/doc/org.eclipse.cdt.doc.user/images/icon_terminate_rem.gif deleted file mode 100644 index bd53994fb7b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_terminate_rem.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_thread1.gif b/doc/org.eclipse.cdt.doc.user/images/icon_thread1.gif deleted file mode 100644 index 7e4a43cd78c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_thread1.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_thread2.gif b/doc/org.eclipse.cdt.doc.user/images/icon_thread2.gif deleted file mode 100644 index fb5175f5c68..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_thread2.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_thread3.gif b/doc/org.eclipse.cdt.doc.user/images/icon_thread3.gif deleted file mode 100644 index f2a16394e6d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_thread3.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/icon_watchpoint_readwrite_obj.gif b/doc/org.eclipse.cdt.doc.user/images/icon_watchpoint_readwrite_obj.gif deleted file mode 100644 index 0b1184d72a8..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/icon_watchpoint_readwrite_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/include_obj.gif b/doc/org.eclipse.cdt.doc.user/images/include_obj.gif deleted file mode 100644 index 2cc5866a64c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/include_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/makefile.gif b/doc/org.eclipse.cdt.doc.user/images/makefile.gif deleted file mode 100644 index 9d5a508bc49..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/makefile.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/method_private_obj.gif b/doc/org.eclipse.cdt.doc.user/images/method_private_obj.gif deleted file mode 100644 index b5b88535179..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/method_private_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/method_protected_obj.gif b/doc/org.eclipse.cdt.doc.user/images/method_protected_obj.gif deleted file mode 100644 index 2b76d36edf5..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/method_protected_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/method_public_obj.gif b/doc/org.eclipse.cdt.doc.user/images/method_public_obj.gif deleted file mode 100644 index 18103b11fc7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/method_public_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ng03_04.gif b/doc/org.eclipse.cdt.doc.user/images/ng03_04.gif deleted file mode 100644 index df5c0a3b5df..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ng03_04.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ng2003.gif b/doc/org.eclipse.cdt.doc.user/images/ng2003.gif deleted file mode 100644 index 66ea615ccfe..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ng2003.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ngback.gif b/doc/org.eclipse.cdt.doc.user/images/ngback.gif deleted file mode 100644 index 86f437113b7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ngback.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ngconcepts.gif b/doc/org.eclipse.cdt.doc.user/images/ngconcepts.gif deleted file mode 100644 index c304d54745a..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ngconcepts.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ngnext.gif b/doc/org.eclipse.cdt.doc.user/images/ngnext.gif deleted file mode 100644 index 874563abfb2..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ngnext.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ngref.gif b/doc/org.eclipse.cdt.doc.user/images/ngref.gif deleted file mode 100644 index c113299234b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ngref.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ngtasks.gif b/doc/org.eclipse.cdt.doc.user/images/ngtasks.gif deleted file mode 100644 index 2a3a7110634..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ngtasks.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ngtopics.gif b/doc/org.eclipse.cdt.doc.user/images/ngtopics.gif deleted file mode 100644 index 43e506a37c3..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ngtopics.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/public_co.gif b/doc/org.eclipse.cdt.doc.user/images/public_co.gif deleted file mode 100644 index 18103b11fc7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/public_co.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/ref-79.gif b/doc/org.eclipse.cdt.doc.user/images/ref-79.gif deleted file mode 100644 index 7ef1a62ba7d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/ref-79.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/static_co.gif b/doc/org.eclipse.cdt.doc.user/images/static_co.gif deleted file mode 100644 index 10d08aeff73..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/static_co.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/struct_obj.gif b/doc/org.eclipse.cdt.doc.user/images/struct_obj.gif deleted file mode 100644 index cb2869f2488..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/struct_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/template_obj.gif b/doc/org.eclipse.cdt.doc.user/images/template_obj.gif deleted file mode 100644 index b4d8ea83502..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/template_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/toc_closed.gif b/doc/org.eclipse.cdt.doc.user/images/toc_closed.gif deleted file mode 100644 index e5bc046e136..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/toc_closed.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/typedef_obj.gif b/doc/org.eclipse.cdt.doc.user/images/typedef_obj.gif deleted file mode 100644 index 7e3ace3e77b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/typedef_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/union_obj.gif b/doc/org.eclipse.cdt.doc.user/images/union_obj.gif deleted file mode 100644 index b8405d54bb4..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/union_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/var_declaration_obj.gif b/doc/org.eclipse.cdt.doc.user/images/var_declaration_obj.gif deleted file mode 100644 index 74a3d222c70..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/var_declaration_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/images/warning_icon.gif b/doc/org.eclipse.cdt.doc.user/images/warning_icon.gif deleted file mode 100644 index 0eab1c9f84c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/images/warning_icon.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/plugin.properties b/doc/org.eclipse.cdt.doc.user/plugin.properties deleted file mode 100644 index 1f4c1ccdd39..00000000000 --- a/doc/org.eclipse.cdt.doc.user/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2003 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -pluginName=C/C++ Development User Guide -providerName=Eclipse.org - diff --git a/doc/org.eclipse.cdt.doc.user/plugin.xml b/doc/org.eclipse.cdt.doc.user/plugin.xml deleted file mode 100644 index 6101a232d27..00000000000 --- a/doc/org.eclipse.cdt.doc.user/plugin.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/about.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/about.html deleted file mode 100644 index 5ee8cf34cec..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/about.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - -About This Guide - - - - -

            About This Guide

            - - - - -

            The C/C++ Development Tools (CDT) User's Guide describes the components -of the CDT Eclipse plugins that are available as part of the Eclipse project. This guide -describes how to use the CDT tools environment to build your C/C++ based applications. - -

            - -

            The following may help you find information quickly: - -

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            If you want to:See:
            Learn about perspectives, views, and editors IDE Concepts
            Create a C or C++ program Developing C/C++ Programs
            Track and control different versions of software Source Control
            Debug your executables Debugging Programs
            Create a new QNX C Application project Common Wizards
            Run or debug your program Starting Your Programs
            - - -

            -

            This book is organized so you can learn what you need to know quickly and easily. Each chapter has these common sections: -

            -
              -
            • The overview gives you a quick synopsis of what you're about to learn. -
            • -
            • The suggested reading section tells you what you should know before starting each chapter. -
            • -
            • The related information section gives you a quick list of the supporting material, including tutorials and movies. Some are marked "recommended." -
            • -
            • The "How ... works" section gives you an idea of what's happening "underneath the covers" -- how the IDE, the host, and the target work together.
            • -
            -

            The tutorials are in a separate guide so you can print and use them side by side with the corresponding chapters in this guide.

            -

            - -

            - - -

            Assumptions

            - -

            This guide assumes the following: - - -

            -
              -
            • You've already installed the base Eclipse components.
            • -
            • You've installed the C/C++ Development Tools (CDT) plugin feature.
            • -
            • You can write code in C or C++.
            • -
            - -

            Note to Windows users

            - -

            In our documentation, we use a forward slash -(/) as a delimiter in all pathnames, -including those pointing to Windows files. - - -

            -

            We also generally follow POSIX/UNIX filesystem conventions. - -

            - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cdev.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cdev.html deleted file mode 100644 index 76b5c2c6bff..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cdev.html +++ /dev/null @@ -1,812 +0,0 @@ - - - - - -Developing C/C++ Programs - - - -
            - - -

            Developing C/C++ Programs

            - - - - -

            - -The C/C++ Development perspective is probably the perspective -where you'll spend most of your time. In it, you'll develop and build -your programs. As you move further through your project, you'll likely -use this perspective as the jump point for doing your debugging, program -analysis, and target system integration.

            -

            - -Suggested prior reading:

            - -

            - -Related information:

            - -

            -In this chapter: - - - -

            Introduction

            - - -

            - -Before you begin C/C++ development, you must create a project to contain your code; in the IDE, all your work must be contained in projects.

            -

            - -The views in the C/C++ Development perspective are driven primarily by selections you make in the C/C++ Editor and the C/C++ Projects view, a specialized version of the Navigator view. Ensure you understand their functionality thoroughly. - -

            - -

            Wizards and the Launch Configurations dialog

            - -

            In addition to perspectives and views, the IDE has two major "sections": wizards and the Launch Configurations dialog. To create and run your first program, you need both. The wizards let you quickly create a new project; the Launch Configurations dialog lets you set up how your program runs. -Once you've used all these parts of the IDE for the first time, you'll be able to create, build, and run your programs very quickly. For more information, see the Common Wizards and Starting Your Programs chapters.

            -

            - -The C/C++ Development perspective also has many features that help you develop code quickly. Once you've learned the basics of creating programs and running them (in this chapter), take some time to browse through this chapter.

            -

            - -

            - -

            Controlling the IDE (C/C++ Projects view)

            - -

            C/C++ Projects view

            -

            The C/C++ Projects view is probably the most important view in the IDE because you control your projects with it. The selections you make in the C/C++ Projects view greatly affect what information the other views display.

            -

            - -The C/C++ Projects view offers a filtered and slightly rearranged version of the Navigator view.

            -

            The Navigator view is part of the core Eclipse platform, so some of the features are documented there: - -

            -
              -
            • For information about the Navigator view toolbar and icons, follow these links in the Workbench User Guide: Concepts-->Views-->Navigator view. - -
            • -
            • For information about the right-click context menu in the Navigator view, follow these links in the Workbench User Guide: Reference-->User interface information-->Views and Editors-->Navigator View. -
            • -
            -

            The C/C++ Projects view has many of the same features as the Navigator view, but is configured specifically for C and C++ development. At first glance, the two may seem identical, but the C/C++ Projects view:

            -
              -
            • shows only open C/C++ projects -
            • -
            • pretends that the project's executables are stored in a virtual subdirectory called bin -
            • -
            • for a library project, pretends that the project's libraries are in a virtual subdirectory called lib -
            • -
            • hides certain files -
            • -
            • includes Build Project and related commands in its right-click menu -
            • -
            • gives an outline of *.c, *.cc, *.cpp, *.h, and binary files. -
            • -
            - -

            Opening files

            - -

            To open files and display them in the editor area:

            - - - - -
            =>>In the C/C++ Projects view, double-click the file to be opened. -The file -- even if it's executable -- opens in the editor area.
            - - - -

            Opening projects

            - -

            Because the C/C++ Projects view hides closed projects, you must use the Navigator view to open them.

            -

            - -To open projects:

            - - - - -
            =>>In the Navigator view, right-click your project, and select Open Project. -The project opens and appears in the C/C++ Projects view.
            - - - -

            Filtering files

            - -

            To filter files in the C/C++ Projects view:

            -
              - -
            1. In the C/C++ Projects view, click the menu dropdown button Icon; menu dropdown. -
            2. -
            3. Select Filter. - The File Filter dialog appears:

              C/C++ Projects view; File Filter dialog -

            4. -
            5. In the filter pane, select the types of files you wish to hide. The .* selection hides files that start with a period, such as .cdtproject and .project. -
            6. -
            7. Click OK. - The C/C++ Projects view automatically refreshes and shows only the unfiltered file types. -
            8. -
            - - -

            Outlines of source and executable files

            - -

            - -The C/C++ Projects view shows you the outline of .c, .cc, and .h files:

            -

            C/C++ Projects view; outline; source

            -

            This outline is similar to that found in the Outline view. To learn more about the Outline view, see the "Code synopsis (Outline view)" section in this chapter.

            -

            -

            The C/C++ Projects view shows you the outlines of executables as well. You can examine the structure of executables to see not only the functions that you declared and used in the file, but the elements that were called indirectly, such as malloc(), _init(), and errno:

            -

            C/C++ Projects view; outline; executable

            -

            -

            To view a file outline in the C/C++ Project view:

            - - - - -
            =>>In the C/C++ Projects view, click the "+" symbol to the left of any .c, .cc, or .h, or executable file. All the executables are grouped in the virtual bin directory. The tree expands to show the outline for that file. Click the "-" symbol to collapse the tree again.
            - - - -

            Creating projects (New Project wizard)

            - -

            -@@@ NOTE I've left this in even though it is QNX specific, we would have to -customize it to make it CDT generic -

            - -

            If you're creating an application from scratch, you'll probably want to create a QNX C Application Project or a QNX C ++ Application Project.

            -

            - -
            - - - -
            Note:For examples of creating specific types of projects, see the Tutorials book. We recommend that you create a few tutorial projects before you do too much reading. Having hands-on experience with the IDE gives you a better context for what you read in this guide. -

            - -For a complete explanation of all the C/C++ project types and options, see the Common Wizards chapter.

            -
            - - -

            To create a "Hello World!" QNX C Application Project:

            -
              - -
            1. In the C/C++ Development perspective, click the Create a new QNX C Application Project button Icon: Create a QNX C Application Project button. - The New Project dialog appears:

              Wizard: Create a QNX C Application Project -

            2. -
            3. In the Name field, type a name for your project (e.g. myHelloWorldProject). -
            4. -
            5. Click Next. The dialog displays the appropriate with tabs. -
            6. -
            7. In the Options tab, enable Build debug version and Build release version:

              Common wizards: C/C++ Projects; Options tab - -

            8. -
            9. Click Finish. - The IDE creates the project and displays the C file (e.g. myHelloWorldProject.c in the C Editor. It contains a working "Hello, World!" program:

              C/C++ Editor; Hello World! program -

            10. -
            - - -

            Building projects (make)

            - -

            Once you've created your project, you can build it. The IDE uses the same make utility and makefiles used on the command line. The IDE can perform makes automatically or let you do them manually. When you do manual builds, you can also decide on the scope of the build.

            -

            - -You can watch the progress and see the build information in the C-Build view. If building your programs generates any errors or warnings, you can see them in the Tasks view.

            -

            This section includes:

            - - -

            Build terminology

            - -

            The IDE uses a number of terms to describe the scope of the build: - -

            -
            - -
            Build -
            -
            Build only the components affected by modified files in that particular project (i.e. make all). -
            -
            Clean -
            -
            Delete all the built components (i.e. .o, .so, .exe, and so on) without building anything (i.e. make clean). -
            -
            Rebuild -
            -
            Build every component from scratch. A Rebuild is really a Clean followed by a Build (i.e. make clean; make all). - -
            -
            - - -

            Choosing autobuild or manual build

            - -

            By default, the IDE automatically rebuilds every time you change a resource (e.g. file). This is handy if you have only a few open projects and if they're small. As the projects get larger, this feature can become a bit of a hindrance. You may find that you prefer to turn autobuilding off.

            -

            - -To turn off autobuilding:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Workbench. - The dialog displays your workbench preferences:

              Window; Preferences; Workbench -

            4. -
            5. In the right pane, disable the Perform build automatically on resource modification option. The IDE now builds only when you ask it to. - -
            6. -
            - - -

            Autobuilds

            - -

            - -The IDE builds automatically every time you save a change. Thus, if you're using the default IDE configuration, you don't need to do anything. Even in this setting, you can build manually as well. Because the IDE always does incremental builds while in autobuild mode, you may wish to manually do a clean build to ensure you have fresh executables.

            - -

            Manual builds

            - -

            Manual builds let you choose the scope of the build, as well as whether to do a Build, a Clean, or a Rebuild.

            - -

            Building everything

            - -

            The IDE lets you manually choose to rebuild all your open projects. Depending on the number of projects, the size of the projects, and the number of target architectures, this can take a significant amount of time.

            -

            - -To rebuild all your open projects:

            - - - - -
            =>>From the main menu, select Project-->Rebuild All.
            - - - -

            Building selected projects

            - -

            Because rebuilding all your open projects may be time-consuming, you may often wish to build only certain projects individually.

            -

            - -To rebuild a single project:

            - - - - -
            =>>In the C/C++ Projects view, right-click a project and select one of: -
              -
            • Build -
            • -
            • Rebuild -
            • -
            • Clean.
            • -
            -

            The IDE builds the selected project as you desired. For more information on the build methods, see the "Build terminology" section in this chapter.

            C/C++ Projects view; building

            - - - -

            Manual build preferences

            - -

            To have the IDE save your unsaved resources before manual builds:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Workbench. -
            4. -
            5. In the right pane, enable the Save all modified resources automatically prior to manual build option. - The IDE saves your resources before it builds.
            6. -
            - - -

            Configuring project build order

            - -

            The IDE lets you determine the build order of your projects. If certain projects must be built before others, you can set that. If your project refers to another project, the IDE builds that project first. - -

            - -
            - - - -
            Note:Setting the build order doesn't cause the IDE to rebuild projects that depend on the project; you must rebuild all projects to ensure all the changes are propagated.
            -
            - - -

            - -To manually configure the project build order:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Build Order. -
            4. -
            5. Disable the Use default build order option. - You may now configure the build order as you desire. When you're done, click Apply, then OK.
            6. -
            - - -

            Creating personal build options (make targets)

            - - -
            - - - -
            Note:In this subsection, "targets" refer to actions in the makefiles, not target machines.
            -
            - - -

            A make target is an action called by the make utility to perform a customized build-related task. For example, many makefiles support a target named clean, which gets called as make clean. The IDE lets you call your own target such as myMakeAction to be called as make myMakeAction. You can also use a make target to pass options such as CPULIST=x86, which causes the make utility to build only for x86. Of course, these options work only if they're already defined in the makefile.

            -

            - -If you've added your own make targets, you can configure the IDE to call them specifically.

            -

            - -To add a customized make target to the C/C++ Project view right-click menu:

            -
              - -
            1. In the C/C++ Projects view, right-click a project and select Add Make Targets. -
            2. -
            3. Type the name of the make target (e.g. myMakeOption): -

              C/C++ Projects view; Targets Dialog dialog

            4. -
            5. Click OK. - The target option appears in the right-click menu of the C/C++ Projects view.
            6. -
            - -

            - -To use a customized make target:

            -
              - -
            1. In the C/C++ Projects view, right-click a project. The right-click context menu appears. If there are any customized make targets for your project, the Make item is selectable. -
            2. -
            3. Choose your make target from the Make menu: -

              C/C++ Projects view; make target; using

            4. -
            - - -

            Running projects (launcher)

            -

            -@@@ Again the same thing applies here about stripping out the QNX -specific information (ie regarding needing a target for launch) and -replacing it with generic CDT information. I've much of it in for -context. -

            -

            - -Once you've built your project, you'll want to run it. The IDE lets you -run or debug your executables on either a local or a remote QNX Neutrino -target machine. For a description of local and remote targets, see the -IDE Concepts chapter.

            -

            - -To run or debug your program, you must create a QNX Target System Project -that specifies how the IDE communicates with your target. You must also create -a Launch Configuration that describes how the program runs on your target. -

            - -
            - - - -
            Note:For a complete description of the Launch Configurations dialog and the available options, see the Starting Your Programs chapter.

            -
            - -To run your "Hello World!" QNX C Application Project:

            -
              - -
            1. In the C/C++ Projects view, select your project (e.g. myHelloWorldProject). -
            2. -
            3. In the C/C++ Development perspective, click the dropdown menu Icon: Menu dropdown part of the run menu button set Icon: RunIcon: Menu dropdown. -
            4. -
            5. Select Run. - The Launch Configurations dialog appears:

              Launcher -

            6. -
            7. In the left pane, select C/C++ QNX QConn (IP). -
            8. -
            9. Click New. - The dialog displays the appropriate tabs:

              Launcher; Main tab -

            10. -
            11. In the Name field, type a meaningful name for your launch configuration (e.g. myHelloProject IP launch). - The IDE automatically fills in the Project field. -
            12. -
            13. Click the Search button beside the C/C++ Application field. - The Program Selection dialog appears. - -
              - - - -
              Note:If the Program Selection dialog is blank, you must cancel and build your project. To learn how to build projects, see the "Building projects (make)" section. -
              -
              - - -
            14. -
            15. Select a program to run. The _g indicates it's compiled with debug symbols. If you wish to run on an x86 target, select myHelloWorldProject [x86le] -
            16. -
            17. Click OK. -
            18. -
            19. In the Target Options pane, select your target. -
            20. -
            21. Click Run. - Your program runs. The IDE displays the output in the Console view. For example: -

              Console view; Hello World! -

            22. -
            - - -

            Writing code (C/C++ Editor)

            - -

            Within the C/C++ Development perspective, the C/C++ Editor is where you'll likely spend the great majority of your time -- you use it to write and modify your code:

            -

            C/C++ Editor

            -

            The C/C++ Editor drives many of the other views. As you code, many of the other views update dynamically (even if you haven't saved).

            -

            This section includes:

            - - -

            C/C++ Editor layout

            - -

            The C/C++ Editor has a gray border on each side. The border on the left margin might contain icons that flag errors, warnings, or problems detected by the IDE. It also displays icons for any bookmarks, breakpoints, or tasks from the Tasks view. The icons in the left margin correspond to the line of code.

            -

            The border on the right margin displays red and yellow bars that correspond to the errors and warnings from the Tasks view. Unlike the left margin, the right margin displays the icons for the entire length of the file.

            -

            - - -

            - -

            Finishing function names (Content Assist)

            - -

            The IDE can help you finish the names of functions if they're long, or you can't remember the exact spelling.

            -

            - -To use Content Assist:

            -
              - -
            1. In the C/C++ Editor, type at least the first letter of the function. -
            2. -
            3. Press Ctrl-Space. (Or, right-click near the cursor and select Content Assist). - A menu with the available functions appears:

              C/C++ Editor; Content Assist -

            4. -
            5. You may do one of the following: -
                -
              • Continue typing. The list shortens. When there's only one function that matches, it's automatically inserted. -
              • -
              • Scroll with the up and down arrows. Press Enter to select the function. -
              • -
              • Scroll with the mouse. Double-click a function to select it. -
              • -
              • Press Esc to close the Content Assist window. -
              • -
            6. -
            - - -

            Inserting code snippets (Code Templates)

            - -

            - -The IDE can help you by inserting snippets of code such as an empty do-while structure. If you've used the Content Assist feature, you may have already noticed this feature; you access it the same way.

            -

            - -To use Code Templates:

            - - - - -
            =>>Follow the procedure for using Content Assist, with the following exception: -
              -
            • If any code templates start with the letter combination you've typed, they appear first in the list and have a different icon:

              C/C++ Editor; Code Templates; using

            • -
            - - -

            To add Code Templates:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select C/C++-->Code Templates. -
            4. -
            5. Click New. - A dialog for adding new templates appears. You can view the format of existing templates by selecting them and clicking Edit:

              Window; Preferences; C/C++; Code Templates dialog

            6. -
            - - -

            Adding #include directives (Add Include)

            - -

            To insert the #include directive for any documented QNX Neutrino function:

            -
              - -
            1. In the C/C++ Editor, highlight the entire function name by double-clicking it. Don't highlight the parentheses or any leading tabs or spaces. -
            2. -
            3. Right-click and select Add Include. - The IDE automatically adds the #include statement to the top of the file, if it isn't already there.
            4. -
            - - -

            Hover help

            - -

            The IDE can give you information about functions while you're coding.

            -

            - -To use hover help:

            - - - - -
            =>>In the C/C++ Editor, place your pointer over a function. -A tag appears, showing the function summary and synopsis:

            C/C++ Editor; Hover help

            - - - -

            Commenting out code

            - -

            The IDE makes it easy to comment out large sections of code. You can quickly add // characters to the beginning of lines, letting you comment out large sections, even if they have /* */ comments. -When you uncomment lines, the IDE removes the leading // characters from all lines that have them, so be careful not to accidentally uncomment sections. Also, the IDE comments or uncomments the selected lines -- if you select a partial line, the IDE comments out the entire line, not just the highlighted section of code.

            -

            - -To comment or uncomment a block of code:

            -
              - -
            1. In the C/C++ Editor, highlight a section of code to be commented or uncommented. For one line, place your cursor on that line. -
            2. -
            3. Right-click and select Comment or Uncomment. -
            4. -
            - - -

            Customizing the C/C++ Editor appearance

            - -

            You can change the font, set the background color, display line numbers, and control many other visual aspects of the C/C++ Editor. You can also configure context highlighting, and change how the Code Assist feature works. - -

            -

            To access the C/C++ Editor preferences dialog:

            -
              - -
            1. Select Window-->Preferences. - The Preferences dialog appears. -
            2. -
            3. In the left pane, select C/C++-->C/C++ Editor.
            4. -
            - - -

            Using other editors

            - -

            The IDE lets you use other editors, but you should consider the added functionality the C/C++ Editor offers before changing.

            -

            - -The C/C++ Editor is highly integrated with the IDE. The other views are designed to support the C/C++ Editor by updating dynamically. Since other editors aren't designed to interface with the IDE, you won't get the support from the views that the IDE provides.

            -

            - -You can use other editors either outside or inside the IDE. - -

            - -

            Outside the IDE

            - -

            You can edit your code with an editor started outside of the IDE (e.g. from the command line). When you're done editing, you'll have to synchronize the IDE with the changes.

            -

            - -To synchronize the IDE with changes you've made outside of the IDE:

            - - - - -
            =>>In the C/C++ Projects view, right-click the tree pane and select Refresh. -The IDE updates to reflect any changes you've made (such as creating new files).
            - - - -

            Within the IDE

            - -

            - -The IDE lets you set file associations that determine the editor you use for each file type. For example, you can tell the IDE to use an external program such as WordPad to edit all .h files. Once that preference is set, you can double-click a file in the C/C++ Projects view, and the IDE automatically opens the file in your selected program.

            -

            - -If the IDE doesn't have a set association for a certain file type, it uses the OS defaults. Thus, in Windows, double-clicking on a .DOC file automatically opens the file in MS Word or WordPad.

            -

            - -For information about file associations, follow these links in the Eclipse Workbench User Guide: Reference-->Preferences-->File Associations.

            -

            - -

            More development features

            - -

            The IDE has many features that help you work faster. Not all the features are things you'd necessarily think to look for; after you've used the IDE for a while, take some time to read this entire section.

            -

            - -This section includes:

            - - -

            Tracking remaining work (Tasks view)

            - -

            - -The Tasks view provides you with a list of errors and warnings related to your projects. These are typically syntax errors, typos, and other programming errors found by the compiler:

            -

            Tasks view - -

            -

            The Tasks view is part of the core Eclipse platform. For more information about the Tasks view, follow these links in the Workbench User Guide: Reference-->User interface information-->View and Editors-->Tasks view.

            -

            - -The IDE also shows corresponding markers in several other locations:

            -
              -
            • C/C++ Projects view: on both the file that contained compile errors and the project -
            • -
            • Outline view: in the method (e.g. main()) -
            • -
            • C/C++ Editor: on the left side, beside the offending line of code.
            • -
            - -

            Jumping to errors

            - -

            To quickly jump to the source of errors (if the IDE can determine where it is):

            - - - - -
            =>>In the Tasks view, double-click the error marker Icon: Error marker or warning marker Icon: Warning marker. -The file opens in the editor area, and the cursor jumps to the offending line.
            - - -

            - -To jump to errors sequentially:

            - - - - -
            =>>Click the Jump to next error marker button Icon: Jump to next error marker button or Jump to previous error marker button Icon: Jump to previous error marker button.
            - - - -

            Filtering errors

            - -

            Depending on the complexity and stage of your program, the IDE can generate an overwhelming number of errors. The IDE lets you customize the Tasks view so you see only the errors you want to see.

            -

            - -To access the error filtering dialog:

            - - - - -
            =>>In the Tasks view, click the Filter icon Icon: Filter button. -The Filter Tasks dialog appears and lets you adjust the scope of the errors shown in the Tasks view. To see all errors and warnings, check all the boxes in Show items of type and enable On any resource:

            Tasks view; Filter Tasks dialog

            - - - -

            Setting reminders

            - -

            The Tasks view lets you create your own tasks. In addition to having the Tasks view automatically list build errors, you can set personal reminders regarding the unfinished function you're writing, the error handling routine you want to check, or anything else.

            -

            - -To access the New Tasks dialog to add a personal task:

            - - - - -
            =>>In the Tasks view, right-click the tasks pane and select New Task. -A New Tasks dialog appears:

            Tasks view; New Tasks dialog

            - - -

            To remove a personal task:

            - - - - -
            =>>In the Tasks view, right-click the task and select one of Delete or Mark Completed.
            - - - -

            Code synopsis (Outline view)

            - -

            - -The Outline view gives you a structural view of your C/C++ source code:

            -

            Outline view

            -

            It shows the elements in the source file in the order they occur, including functions, libraries, and variables. You may also sort the list alphabetically. If you double-click an entry in the Outline view, the C/C++ Editor moves the cursor to the start of the item selected. (For example, to jump to the start of main() in the C/C++ Editor, double-click main() in the Outline view.)

            - -

            Checking your build (C-Build view)

            - -

            - -The IDE displays the output from the make utility in the C-Build view:

            -

            C-Build view - -

            - -

            Customizing the C-Build view

            - -

            You can choose to clear the C-Build view before each new build or let the results of each subsequent build to append to the display. You can have the C-Build view brought to the top when you build.

            -

            - -To access the C-Build view configurations:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select C/C++:

              C-Build view; configurations

            4. -
            - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/conc.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/conc.html deleted file mode 100644 index 915c47f13f1..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/conc.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - -IDE Concepts - - - -
            - - -

            IDE Concepts

            - - - - - -

            - -This chapter introduces a number of terms and concepts that are used throughout this -guide and the core Eclipse documentation.

            -

            Related information:

            -
              -
            • the Workbench User Guide: Concepts in the Eclipse documentation
            • -
            -

            -In this chapter: - - -

            Workbench

            - -

            The workbench is the window that appears when you run the IDE. It includes:

            -
              -
            • views -
            • -
            • editors -
            • -
            • the main menu -
            • -
            • the control bars.
            • -
            -

            -

            - -
            -

            IDE Concepts; workbench with C/C++ Development perspective

            -
            - - -

            Major components of the IDE workbench.

            -
            -
            -
            - - - -
            - - - -
            Note:Eclipse is written in JAVA and is interpreted by a Java Virtual Machine (JVM) -that's specific to the host OS. So, whether you run Eclipse on Windows, -QNX Neutrino, or Solaris, you're running the same code. However, you might -notice some differences in the user interface.
            -
            - - -

            The CDT provides a graphical development environment for C and C++ -developers. The CDT works in a complimentary manner with many of the -same tools that you use on the command line. The CDT communicates with -and interprets messages from many utilities, including:

            -
              -
            • make -(which drives compilers such as gcc) -
            • -
            • gdb -
            • -
            • ctags
            • -
            - - -

            - -

            Perspectives

            - -

            A perspective is a task-oriented configuration of the workbench window.

            -

            - -For example, if you're debugging, you use the preconfigured Debug -perspective. This perspective sets up the IDE to show all the tools related to -debugging, but doesn't show the elements and tools related to profiling, for example. -You can customize a perspective by adding and removing views.

            - -Perspectives generally consist of these components:

            -
              -
            • toolbars -
            • -
            • editors -
            • -
            • views
            • -
            - -

            Editors and views

            - -

            - -Editors are what you use to change the content of your files. Each editor -in the IDE is for a specific set of files. The editor that you'll likely use -the most for C and C++ development is the C/C++ Editor.

            -

            - -Views take information and organize it in various convenient ways. -For example, the Outline view shows you a list of all the function -names when you're editing a C file in the C/C++ Editor. -The Outline view is dynamic; if you declare a function called mynewfunc(), the Outline view immediately lists it, even if you haven't saved the file yet.

            -

            Views provide:

            -
              -
            • insight into editor contents (e.g. Outline view) -
            • -
            • navigation (e.g. Navigator view) -
            • -
            • information (e.g. Tasks view) -
            • -
            • control (e.g. Debug view).
            • -
            -

            -

            - -Different views may show you different interpretations of the same -information. For example, the Navigator view shows all -your projects; the C/C++ Projects view shows just the -C and C++ projects you have open.

            -

            - -The editor area is a section of the workbench window reserved for editors. All the editors live together in the editor area; all the views can be anywhere except in the editor area.

            -

            - -The IDE lets you rearrange views and editors so they're beside each other (tiled) or stacked on top of each other (tabbed), among other possibilities.

            -

            - -To see how dynamic the interface is, see the Perspectives, Views, and Editors movie. - -

            - -

            Projects and workspace

            - -

            Projects are generic containers for your source code, makefiles, -and binaries. Before you do any work in the IDE, you must create projects to -store your work. Developers using the CDT will most ofent work with C Project.

            -

            Projects can be open or closed. If they're closed, you can't access them.

            -

            When you create a file within a project, the IDE also creates a record -(local history) of every time you changed that file and how you changed it.

            -

            - -Your workspace is where you keep your projects. For the exact location of your workspace, see the appendix Where Files Are Stored.

            -

            - -
            - - - -
            Note:Don't use spaces in projects and filenames; they can cause problems with some tools, such as the make utility. -

            Also, don't use case alone to distinguish files and projects; Unix-based OS filenames are case-sensitive, but Windows filenames aren't. Thus, Hello.c and hello.c overwrite each other in Windows, but are separate files elsewhere.

            -
            - - - -

            How the IDE looks at projects

            - -

            The IDE associates projects with natures, tags that tell the IDE about the properties of each project. - -

            -

            The IDE doesn't support nested projects; each project must be organized as a discrete entity. The IDE does support project dependencies by allowing a project to reference other projects that reside in your workspace.

            -

            - -The most common projects look like this to the IDE:

            - - - - - - - - - - - - - - - - - - -
            Project Associated natures
            Simple Project  
            Standard Make C Application Project C
            Standard Make C++ Application Project C, C++
            - -

            The natures tell the IDE what can and can't be done with each project. The IDE also uses the natures to filter out projects that would be contextually irrelevant (e.g. nonlibrary projects from a list of library projects).

            -

            - -In this guide, you'll see mixed references such as:

            -
              -
            • QNX C/C++ Applications -- refers to both QNX C Application Projects and QNX C++ Application Projects. -
            • -
            • QNX Library Projects -- refers to both QNX C Library Projects and QNX C++ Library Projects.
            • -
            -

            The IDE saves these natures and other information in .project and .cdtproject files in each project. To ensure the natures persist in CVS, include these files when you commit your project. - - - -

            - -

            Launcher

            - -

            Before you run any program, you must use the launcher to specify what -program to run, what arguments to pass to the program, and so on.

            -

            - -If you want to run the program with different you can either modify -an existing launch configuration or create a new Launch Configuration. -Once you save the Launch Configuration, you can quickly rerun -each configuration. - -

            - -

            Resources

            - -

            Resources is a collective term for projects, folders, and files that exist in the workbench. You store all your resources in your workspace.

            - -

            Wizards

            - -

            Wizards guide you through a sequenced set of tasks. For example, to create a QNX C Application Project, you run a wizard that takes you through all the steps and gathers all the necessary information before creating the project. For more information, see the Common Wizards chapter.

            -

            - - - -

            - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cvs.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cvs.html deleted file mode 100644 index 3e63d6c5726..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cvs.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - -Source Control - - - -
            - - -

            Source Control

            - -

            -If you use CVS, you can check code in and out without leaving the IDE.

            -

            - -Related information:

            -
              -
            • the Source Control movie (recommended) -
            • -
            • the following links in the Eclipse Workbench User Guide: Tasks-->Working in the team environment-->Working with a CVS repository (recommended) -
            • -
            -

            Suggested prior reading:

            - -

            -In this chapter: - - -

            Introduction

            - -

            The CVS Repository Exploring perspective lets you bring code from CVS into your workspace. -While you're working on your code, the IDE automatically keeps track of the changes you make; it lets you roll back to an earlier version of a file that you saved but didn't commit to CVS. If another developer changes the source in CVS while you're working on it, the IDE helps you synchronize with CVS and resolve any conflicts. Finally, the CVS Repository Exploring perspective lets you check the modified code back into CVS.

            -

            - -
            - - - -
            Note:The IDE stores project information in .project and .cdtproject -files; you must include them with your project when you commit it to CVS. Otherwise, -you must manually set the nature of the project (e.g. Standard C Project). -For more information about setting project natures, see the Common -Wizards chapter.
            -
            - - -

            Unlike many other components of the IDE, the CVS Repository Exploring perspective doesn't connect to a utility. Instead of connecting via the cvs utility, the IDE uses its own engine to connect directly to your CVS repository. - -

            -

            Because the CVS Repository Exploring perspective is a core Eclipse feature, we've covered the perspective only lightly in this book. For more information, follow these links the Eclipse Workbench User Guide: Tasks-->Working in the team environment.

            -

            - -

            This table may help you find information more easily:

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            If you want to: - See:
            Connect to a CVS repository - Tasks-->Working in the team environment-->Working with a CVS repository-->Creating a CVS repository location
            Check code out of a CVS repository - Tasks-->Working in the team environment-->Working with projects shared with CVS-->Checking out a project from a CVS repository
            Synchronize with a CVS repository - Tasks-->Working in the team environment-->Synchronizing with the repository, especially the Updating section
            Resolve CVS conflicts - Tasks-->Working in the team environment-->Synchronizing with the repository-->Resolving conflicts -
            Prevent certain files from being committed to CVS - Tasks-->Working in the team environment-->Synchronizing with the repository-->Version control life cycle: adding and ignoring resources - -
            Create and apply a patch - Tasks-->Working in the team environment-->Working with patches
            Track code changes that haven't been committed to CVS - Tasks-->Working with local history, especially the Comparing resources with the local history section
            View an online FAQ about the CVS Repository Exploring perspective - Reference-->Team Support-->CVS
            - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cwiz.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cwiz.html deleted file mode 100644 index cb364e3f12b..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/cwiz.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - -Common Wizards - - - -
            - - -

            Common Wizards

            - -

            - -

            -

            -In this chapter: - -

            - -

            Introduction

            - -

            Wizards guide you through a sequenced set of tasks. In the IDE, these tasks may -be creating something new (e.g. a project) or converting one thing to another -(e.g. converting to a Standard C project). Most often, you use wizards to create -new projects and folders.

            -

            - -Wizards aren't directly connected to any perspective, though you're more likely to call them from some perspectives than from others (most likely from the C/C++ Development perspective).

            -

            You can access all the wizards from the main menu by selecting File-->New. The File-->New-->Project selection filters out all the wizards except projects; File-->New-->Other doesn't filter anything. (The exception to this is Target System Project, which, while labeled as a project, isn't a project as far as the IDE is concerned.)

            -

            In the New Project dialog, the wizards are further sorted: selecting C in the left pane displays all the projects with a C nature in the IDE; selecting QNX in the left pane shows all the projects with a QNX nature:

            -

            Common wizards dialog

            -

            Notice the overlap: the QNX C Application Project wizard appears in the right pane for both C and QNX.

            -

            - -So-called "simple" wizards show the very basic elements of projects: Project, Folder, and File. These elements have no natures associated with them. You can access the wizards for these by selecting File-->New-->Other, then selecting Simple from the left pane.

            -

            - -
            - - - -
            Note:

            Although projects may appear as directories in your workspace, the IDE attaches special meaning to them. The IDE won't automatically recognize a directory you create in your workspace directory as a project.

            - -The IDE automatically recognizes directories and new files of any type if you create them outside of the IDE (i.e. using Windows Explorer) and place them in a project directory. To have the IDE recognize them, in the Navigator view, right-click the navigator pane and select Refresh.

            -
            - - - -

            Creating a C/C++ project (New Project wizard)

            - -

            The New Project wizard helps you create a C or C++ project.

            -

            This section includes:

            - - -

            Types of projects

            - -

            The IDE lets you create a variety of projects, each with certain properties. Most of these projects are also subdivided into C or C++ projects: - -

            -
            - -
            Standard Make C Project
            Standard Make C++ Project -
            -
            A basic C or C++ project that uses a standard makefile and GNU make to build the source files. You don't get the added functionality provided by the QNX build organization and the common.mk file. - -
            -
            - -

            Creating your C/C++ project (New Projects wizard)

            - -

            To create a C/C++ project : - -

            -
              - -
            1. From the menu, select File-->New-->Project. -The New dialog appears. Projects are filtered by the natures listed in the left pane. -
            2. -
            3. In the left pane, select the nature in the table:

              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              If you want to build: - Select:
              Standard Make C Application Project - C
              QNX C Application Project - C or QNX
              QNX C Library Project - C or QNX
              Standard Make C++ Application Project - C++
              QNX C++ Application Project - C++ or QNX
              QNX C++ Library Project - C++ or QNX
              - - -
            4. -
            5. In the right pane, select the type of project that you want (e.g. QNX C Application Project). -
            6. -
            7. Click Next. -
            8. -
            9. Type a name for your project in the Name field. -
            10. -
            11. Ensure that Use Default Location is checked. Don't use a different location. -
            12. -
            13. Click Next. - The wizard displays the appropriate tabs. -
            14. -
            15. Select each tab and fill in the required information. The fields for each tab are described in the "New C/C++ Project wizard tabs" section, below. -
            16. -
            17. Click Finish. -The IDE creates your new project in your workspace.
            18. -
            - - -
            - - - -
            Note:In the C/C++ Development perspective, you can also access the QNX C/C++ Projects with the -Icon: QNX C++ Library Project   -Icon: QNX C Library Project  -Icon: QNX C++ Application Project  -Icon: QNX C Application Project  - buttons. -
            -
            - - - -

            New C/C++ Project wizard tabs

            - -

            Depending on the type of project you choose, the New Project wizard displays different tabs: - -

            - - - - - - - - - - - - - - - - - - - - - - - - - - -
            Project Type - Architecture tab,
            Options tab -
            Projects tab,
            Build Settings tab -
            Library tab - -
            Standard Make C Project or
            Standard Make C++ Project -
            Yes - No - No - -
            QNX C Application Project or
            QNX C++ Application Project -
            Yes - Yes - No - -
            QNX C Library Project or
            QNX C++ Library Project -
            Yes - Yes - Yes - -
            - - -
            - - - -
            Note: You can find the default settings for the New Project wizard by selecting Window-->Preferences from the main menu. From the left pane, select C/C++, then New QNX Projects.
            -
            - - - -

            Architecture tab

            - -

            The Architecture tab lets you choose the platforms to compile executables for:

            -

            Common wizards: C/C++ Projects; Architecture tab

            -

            For example, to build for a PowerPC platform, enable PPC (Big Endian).

            -

            - -If you've already created a QNX Target System Project, you'll also see entries such as Doug [localhost - x 86]. These let you build specifically for a configured target. If you also enable X86 (Little Endian), the IDE builds only one executable, not two.

            -

            - -You must choose at least one platform. - -

            - -

            Projects tab

            - -

            The Projects tab lets you configure your preferred order of building:

            -

            Common wizards: C/C++ Projects; Projects tab

            -

            For example, if you associate myProject with mySubProject, the IDE builds mySubProject first during rebuilds. If you change mySubProject, the IDE doesn't automatically rebuild myProject. - - -

            - -

            Build Settings tab

            - -

            The Build Settings tab lets you configure how the IDE handles make errors and what command to use to build your project:

            -

            Common wizards: C/C++ Projects; Build Settings tab - - -

            -
            - -
            Build Settings
            -
            If you want the IDE to stop building when it encounters a make error, enable Stop on Error. Otherwise, enable Keep Going On Error. - -
            -
            Build Command
            -
            If you want the IDE to use the default make command, enable Use Default. If you want to use a different utility to build your project, disable Use Default and enter your own command in the Build Command field (e.g. C:\myCustomizedMakeProgram). - -
            -
            - - -

            Options tab

            - -

            The Options tab lets you choose what type of executables the IDE builds:

            -

            Common wizards: C/C++ Projects; Options tab - -

            -
            - -
            Build Type
            -
            To build a regular executable, enable Build release version. To build a debuggable executable, enable Build debug version (debug versions have _g appended to their filename). -

            - -You must select at least one build type. - - -

            -
            Build Options
            -
            To fully enable profiling with the QNX Application Profiler perspective, enable Build with Profiling. The IDE adds profiling code to all the versions selected in Build Types. See the Profiling Your Application chapter.
            -
            - - -

            Library tab

            - -

            The Library tab lets you choose the type of library you wish to build (e.g. Static library, Shared library):

            -

            Common wizards: C/C++ Projects; Library tab

            -
            - -
            Static library (libxx.a) -
            -
            Combine binary object files (i.e. *.o) into an archive that will later be directly linked into an executable. - -
            -
            Shared library (libxx.so) -
            -
            Combine binary objects together and join them so they are relocatable and can be shared by many processes. Shared libraries are named using the format libxx.so.version, where version is a number with a default of 1. The libxx.so file symlinks to the latest version. - -
            -
            Static library for shared objects (libxxS.a) -
            -
            Same as static library, but using position-independent code (PIC). Use this for a library that will later be linked into a shared object. The System Builder uses these types of libraries to create new shared libraries that contain only the symbols that are absolutely required by a specific set of programs. - -
            -
            Shared library without export (xx.so) -
            -
            A shared library without versioning. Generally, you manually open the library with the dlopen() function and look up specific functions with the dlsym() function.
            -
            - -

            You must choose one of the options. - - -

            - -

            Creating a target (New Target System Project wizard)

            - -

            You must create a Target System Project for every target you have. When you create a launch configuration, you have the option of adding a new target from within the Launch Configurations dialog. When you do, the IDE opens up the New Target System Project wizard.

            -

            - -To create a new target:

            -
              - -
            1. From the menu, select File-->New-->Other. -
            2. -
            3. In the left pane, select QNX. -
            4. -
            5. In the right pane, select QNX Target System Project. -
            6. -
            7. Click Next. - The New QNX Target System Project wizard appears:

              - Common wizards: New Target System Project -

            8. -
            9. Fill in the fields described below: -
              - -
              Target Name -
              -
              Type a descriptive name for your QNX Target System Project. - -
              -
              Project contents -
              -
              Enable Use default to store it in your workspace, or disable it and select another location in the Directory field. - -
              -
              QNX Connector Selection -
              -
              Type the target connection in the Hostname or IP and Port fields. If you're running the IDE on a QNX Neutrino machine running qconn, make sure Use local QNX Connector is enabled; the IDE automatically fills in the connection information. (If you wish to connect to a different target, you may disable Use local QNX Connector and fill in the fields manually.) - -
              -
              Target Configuration -
              -
              This section is for a future feature. -
              -
              - - - -
            10. -
            11. Click Finish. - Your new QNX Target System Project appears in the Navigator view. When you create a Launch Configuration, the target is listed under the Main tab in the Target Options pane. - - -
              - - - -
              Note:You can also reach the New Target System Project wizard by right-clicking in the Target Options pane and selecting Add target.
              -
              - - -
            12. -
            - - -

            Converting projects (Convert to a QNX Project wizard)

            - -

            At various times, you may want to convert projects to give them a QNX nature. For example:

            -
              -
            • if other developers committed a project to CVS without the .project and .cdtproject files, the IDE won't recognize the project as a QNX project when you get it from CVS -
            • -
            • you wish to turn a Standard Make C/C++ Project into a QNX C/C++ Application Project.
            • -
            -

            The QNX nature causes the IDE to use QNX make tools and the QNX make structure when building them.

            -

            -

            The IDE lets you convert many projects in the same step, but the projects are all converted into projects of the same type.

            -

            - -
            - - - -
            Note:If you wish to convert a QNX Project back into a Standard Make C/C++ Project, you can use the Convert C/C++ Projects wizard. From the main menu, select File-->New-->Project. In the left pane, select C. In the right pane, select Convert to a C or C++ Project.
            -
            - - -

            - -To convert to a QNX Project:

            -
              - -
            1. From the menu, select File-->New-->Project. -
            2. -
            3. In the left pane, select QNX. -
            4. -
            5. In the right pane, select Convert to a QNX Project:

              Common wizards: Convert to a QNX Project; selecting wizard -

            6. -
            7. Click Next. -
            8. -
            9. Fill in the fields described below: - -

              The fields let you to convert a selection of projects to one of the following types of projects:

                -
              • QNX C Application Project -
              • -
              • QNX C Library Project -
              • -
              • QNX C++ Application Project -
              • -
              • QNX C++ Library Project
              • -
              - -
              - -
              Candidates for conversion
              -
              The IDE lists all the projects that can be converted. Check off all the projects you wish to convert. - -
              -
              Convert to C or C++
              -
              Select whether your projects are C or C++. - -
              -
              Convert to QNX project type
              -
              Select QNX Application Project or QNX Library Project, depending on whether or not your projects are applications or libraries.
              -
              - - - -
            10. -
            11. Click Finish.
            12. -
            - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/dbug.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/dbug.html deleted file mode 100644 index 5d3a166c0e9..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/dbug.html +++ /dev/null @@ -1,942 +0,0 @@ - - - - - -Debugging Programs - - - -
            - - -

            Debugging Programs

            - -

            - -Once you've written your program, you might need to debug it. The IDE debugger lets you detect and diagnose errors in your programs, whether they're running locally or remotely.

            -

            Suggested prior reading:

            - -

            Related information:

            -
              -
            • gdb utility -
            • -
            -

            -In this chapter: - - -

            Introduction

            - -

            The debugger lets you see what's going on "inside" a program while it executes, and what it was doing at the moment it crashed or misbehaved.

            -

            - -In order to use the full power of the Debug perspective, you must use executables compiled for debugging. These executables contain additional debug information that lets the debugger make direct associations between the source code and the binaries generated from that original source. The debuggable executables have _g appended to their filenames.

            -

            - -The IDE debugger uses GDB as the underlying debug engine. It translates each GUI action into a sequence of GDB commands and processes the output from GDB to display the current state of the program being debugged.

            -

            - -The views update only when the program is suspended.

            -

            - -
            - - - -
            Note:Editing the source after compiling causes the line numbering to be out of step because the debug information is tied directly to the source. -Similarly, debugging optimized binaries can also cause unexpected jumps in the execution trace.
            -
            - - - -

            Debugging your program

            - -

            To debug a program, you must build an executable and launch the debugging session. Once you've launched your debugging session, you'll want to control the session.

            - -

            Building a debuggable executable

            - -

            Although you can debug a regular executable, you get far more control by building debug variants of the executables. When you created your project, you may have already set the option to make the IDE build one. If so, you should have debuggable executables with _g appended to the filename. If not, you must set the IDE to build debug variants:

            -
              - -
            1. In the C/C++ Projects view (or the Navigator view), right-click the project and select Properties. -
            2. -
            3. In the left pane, select QNX C/C++ Project. -
            4. -
            5. In the right pane, select the Options tab. -
            6. -
            7. Under Build Type, ensure Build debug version is enabled:

              Properties dialog; options tab -

            8. -
            9. Click Apply. -
            10. -
            11. Click OK. -
            12. -
            13. If it's not done automatically, rebuild the project.
            14. -
            - -

            For more information about setting project options, see the Common Wizards chapter.

            - -

            Starting your debugging session

            - - -
            - - - -
            Note:For a full description of starting your programs and the Launch Configurations options, see the Starting Your Programs chapter.
            -
            - - -

            - -Once you've got a debuggable executable, you must create a launch configuration.

            -

            - -To launch a debuggable executable:

            -
              - -
            1. From the main menu, select Run-->Debug. (This menu item appears by default in the C/C++ Development perspective. If it doesn't, or you wish to add it to another perspective, select Window-->Customize Perspective. In the left pane, select Other-->Launch. Enable Launch.) - The Launch Configurations dialog appears. -
            2. -
            3. Create a launch configuration as you normally would, but don't click OK. -
            4. -
            5. Select the Debugger tab. -
            6. -
            7. Ensure Run program in debugger is selected. -
            8. -
            9. Ensure Stop at main() on startup is enabled. -
            10. -
            11. Click Apply. -
            12. -
            13. By default, the IDE automatically changes to the Debug perspective when you debug a program. If the default is no longer set, or you wish to change to a different perspective when you debug, see the "Setting execution options (Launch Configurations tabs)" section in the Starting Your Programs chapter. -
            14. -
            15. Click Debug.
            16. -
            - - -

            Controlling your debug session (Debug view)

            - -

            The Debug view shows a listing of your debug sessions and lets you run your code step-by-step. The IDE is powerful; you can simultaneously debug multiple processes, each with multiple threads.

            - -

            Understanding the Debug view

            - -

            The Debug view lets you manage the debugging or running of a program in the workbench. This view displays the stack frame for the suspended threads for each target you're debugging. Each thread in your program appears as a node in the tree. The view displays the process for each program you're running.

            -

            Debug view

            -

            The Debug view shows the target information in a tree hierarchy as follows (shown here with a sample of the possible icons):

            - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            Session item - Description - Possible
            icons
            Launch instance - Launch configuration name and launch type (e.g. Stack Builder [C/C++ QNX QConn (IP)]) - Icon: Debug executable - Icon: Run executable - -
            Debugger instance - Debugger name and state (e.g. GDB Debugger (Breakpoint hit)) - Icon: Debugger - -
            Thread instance - Thread number and state (e.g. Thread[1] (Suspended)) - Icon: Thread; suspended - Icon: Thread; running - Icon: Thread; stopped - -
            Stack frame instance - Stack frame number, function, filename, and file line number - Icon: Stackframe - Icon: Stack frame; running
            - - -
            - - - -
            Note:The number beside the thread label is a reference counter for the IDE, not a thread identification number (TID).
            -
            - - -

            - -The IDE displays stack frames as child elements. It displays the reason for the suspension beside the target, such as end of stepping range, breakpoint hit, signal received, and so on. When a program exits, the IDE displays the exit code.

            -

            - -The label includes the thread's state. In the example above, the label indicates that the thread was suspended because the program hit a breakpoint. You can't suspend only one thread in a process; when one thread is suspended, they all are.

            -

            - -The Debug view also drives the C/C++ Editor; as you step through your program, the C/C++ Editor highlights the location of the execution pointer. - -

            - -

            Controlling your debug execution

            - -

            After you start your debug execution, it stops (by default) in main() and waits for your input. (For information about changing this setting, see the "Debugger tab" section in the Starting Your Programs chapter.) You can control your debug execution in various ways, but they all rely on a core set of debug controls.

            - -

            Debug execution controls

            - -

            The debug execution controls appear in the following places (though they don't all appear in any one place):

            -
              -
            • at the top of the Debug view as buttons -
            • -
            • in the Debug view right-click context menu -
            • -
            • in the main menu under Run (with hotkeys) -
            • -
            • in the C/C++ Editor.
            • -
            -

            The debug execution controls are superceded by breakpoints. For example, if you ask the program to step over a function (i.e. run until it finishes that function) and the program hits a breakpoint, it pauses, even though it hasn't finished the function.

            -

            - -The icons and menu items are context-sensitive. For example, you can terminate a process, but you can't terminate a stack frame.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            Action - Icon - Hotkey - Description -
            Resume - Icon: Resume - F8 - Run the process freely from current point - -
            Suspend - Icon: Suspend -   - - Regain control of the running process -
            Terminate - Icon: Terminate -   - - Kill the process - -
            Restart - Icon: Restart -   - - Rerun the process from the beginning -
            Step into - Icon: Step Into - F5 - Step forward one line, going into function calls - -
            Step over - Icon: Step Over - F6 - Step forward one line, not going into function calls - -
            Run to return - Icon: Step Return - F7 - Finish this function
            - - -

            Controlling your debug execution (Debug view)

            - -

            You can control how many steps the program runs before it suspends again (if you want it to suspend at all). You'll probably use the Debug view primarily to control your program flow.

            -

            - -To control your debug execution:

            -

            -
              - -
            1. In the Debug view, select the thread you wish to control. -
            2. -
            3. Click one of the debug stepping icons described in the "Debug execution controls" section, above. -
            4. -
            5. Repeat step 2 as desired. -
            6. -
            7. Finish the debug session by choosing one of the controls described in the "Debug launch controls" section in this chapter.
            8. -
            - - -

            Controlling your debug execution (hotkeys)

            - -

            If you're running your debug session without the Debug view showing, you can use either the hotkeys or the Run menu to step through your program. The customization works on a per-perspective basis; if you want to use the hotkeys in another perspective, you must enable them there, too.

            -

            - -To enable the debug hotkeys:

            -
              - -
            1. Open the perspective you want to enable the hotkeys for. -
            2. -
            3. From the menu, select Window-->Customize Perspective. -
            4. -
            5. In the left pane, select Other-->Debug. -
            6. -
            7. In the left pane, enable Debug. -
            8. -
            9. Click OK. - The hotkeys are enabled for that particular perspective. You can also access the controls from the Run menu. -
            10. -
            - - -

            Controlling your debug execution (C/C++ Editor)

            - -

            You can control your debug session using the C/C++ Editor by having the program run until it hits the line your cursor is sitting on. (This is the same as the gdb until command.) If the program never hits that line, the program runs until it finishes.

            -

            - -You enable this option on a per-perspective basis. The option is enabled by default in the Debug perspective.

            -

            - -To enable debug execution using the C/C++ Editor:

            -

            -
              - -
            1. From the menu, select Window-->Customize Perspective. -
            2. -
            3. In the left pane, select Other-->C/C++ Debug. -
            4. -
            5. In the left pane, enable C/C++ Debug. -
            6. -
            7. Click OK. - The controls for debug execution in the C/C++ Editor are enabled for your active perspective.
            8. -
            - -

            - -To debug using the C/C++ Editor:

            -

            -
              - -
            1. In the C/C++ Editor, select a file associated with the process being debugged (e.g. myProgram.c). -
            2. -
            3. Left-click to insert the cursor where you want to interrupt the execution. -
            4. -
            5. Right-click near the cursor and select Run to C/C++ Line: -

              Debug view; run to line

              The program continues running until it hits that line.

            6. -
            - - -

            Debug launch controls

            - -

            In addition to controlling the individual stepping of your programs, you can also control the debug session itself. You can perform actions such as terminating the session, stopping the program, and so on, using the debug launch controls available in the Debug view or in the Debug view's right-click context menu. As with the other debug controls, these are context-sensitive; some are disabled depending on whether you've selected a thread, a process, and so on, in the Debug view.

            -

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            Action - Icon - Description
            Terminate - Icon: Terminate - Kill the selected process
            Terminate & Remove - Icon: Terminate and Remove - Kill the selected process and remove it from the Debug view
            Terminate All - Icon: Terminate All - Kill all active processes in the Debug view
            Disconnect - Icon: Disconnect - Detach the debugger (i.e. gdb) from the selected process (useful for debugging attached processes)
            Remove All Terminated Launches - Icon: Remove All Terminated - Clear all the killed processes from the Debug view
            Relaunch - Icon: Relaunch - Restart the process
            - - -

            Disassembly mode

            - -

            When you're debugging, you can also examine your program as it steps into functions that you don't have source code for, such as printf(). Normally, the debugger steps over these functions, even when you click Step Into. When the instruction pointer enters functions for which it doesn't have the source, the IDE shows the function in the Assembly Editor. - -

            -

            To step into assembler functions during debugging:

            - - - - -
            =>>In the Debug view, click the Disassembly Mode On/Off toggle button Icon: Disassembly Mode On/Off. - As you Step Into assembler functions, the IDE shows the execution trace in the Assembly Editor.
            - - - -

            More debugging features

            - -

            This section contains the following subsections:

            - - -

            Inspecting your variables (Variables view)

            - -

            - -The Variables view displays information about the variables in the currently selected stack frame:

            -

            Variables view

            -

            When the execution stops, the changed values are highlighted in red (by default). Like the other debug-related views, the Variables view doesn't try to keep up with the execution of a running program; it updates only when execution stops. - -

            -

            You can set whether or not the variable type (e.g. int) is displayed by clicking the Show Type Names toggle button Icon: Show Type Names.

            - -

            Customizing the Variables view

            - -

            You can customize the look of the Variables view and set the color of changed variables (red by default). - -

            -

            To access the Variables view preferences:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Debug-->Variables View:

              Variables view; customization

            4. -
            - - -

            Changing variable values

            - -

            During the course of debugging, you may wish to artificially change the value of a variable to test how your program handles the setting or to speed through a loop.

            -

            - -To change a variable value while debugging:

            -

            -
              - -
            1. In the Variables view, right-click the variable and select Change Variable Value. -
            2. -
            3. Enter the new value in the available field.
            4. -
            - - -

            Using breakpoints and watchpoints (Breakpoints view)

            - -

            The Breakpoints view lists all the breakpoints and watchpoints you've set in your open projects:

            -

            Breakpoints view - -

            -

            A breakpoint makes your program stop whenever a certain point in the program is reached. For each breakpoint, you can add conditions to better control whether or not your program stops.

            -

            - -A watchpoint is a special breakpoint that stops the program's execution whenever the value of an expression changes, without specifying where this may happen. Unlike breakpoints, which are line-specific, watchpoints are event-specific and take effect whenever a specified condition is true, regardless of when or where it occurred.

            -

            - - - - - - - - - - - - - - - - - - - - - - -
            Object - Icon
            Breakpoint - Icon: Breakpoint
            Watchpoint (read) - Icon: Watchpoint; read
            Watchpoint (write) - Icon: Watchpoint; write
            Watchpoint (read and write) - Icon: Watchpoint; read and write
            - -

            If the breakpoint or watchpoint is for a connected target, a check mark Icon: Checkmark; overlay is superimposed on the icon. - - -

            -

            The rest of this section describes how to: - -

            - - -
            - - - -
            Note:While the Breakpoints view displays both breakpoints and watchpoints, the procedures for setting them differ somewhat.
            -
            - - - -

            Adding breakpoints

            - -

            You set breakpoints on an executable line of a program. If the breakpoint is enabled when you debug, the execution suspends before that line of code executes.

            -

            - -To add a breakpoint:

            -
              - -
            1. In the editor area, open the file that you want to add the breakpoint to (e.g. myProgram.c). -
            2. -
            3. Notice that the left edge of the C/C++ Editor has a blank space called a marker bar. -
            4. -
            5. Hover your pointer over the marker bar, beside the exact line of code where you want to add a breakpoint. Right-click the marker bar and select Add Breakpoint:

              Breakpoints view; adding breakpoints

              A dot Icon: Breakpoint object appears, indicating a breakpoint. A corresponding dot Icon: Breakpoint object also appears in the Breakpoints view, along with the name of the file in which you set the breakpoint:

              Breakpoints view; breakpoint added -

            6. -
            - - -

            Adding watchpoints

            - -

            To add a watchpoint:

            -
              - -
            1. From the main menu, select Run-->Add C/C++ Watchpoint. (If this option isn't available, select Window-->Customize Perspective. In the left pane, select Other. Enable C/C++ Debug. Click OK.) - The Add C/C++ Watchpoint dialog appears:

              Breakpoints view; adding watchpoints -

            2. -
            3. Enter an expression in the Expression to watch field. The expression may be anything that can be evaluated inside an if statement. (e.g. y==1) -
            4. -
            5. If you want the program to stop when it reads the watch expression, enable Read; to have the program stop when it writes the watch expression, enable Write. You must enable at least one. -
            6. -
            7. Click OK. - The watchpoint appears in the Breakpoints view list.
            8. -
            - - -

            Setting properties of breakpoints and watchpoints

            - -

            After you've set your breakpoint or watchpoint, the IDE unconditionally halts the program when:

            -
              -
            • it reaches a line of code that the breakpoint is set on -

              Or: -

            • -
            • the expression specified by the watchpoint becomes true.
            • -
            -

            - -To set the properties for a breakpoint or watchpoint:

            -
              - -
            1. In the Breakpoints view, right-click the breakpoint or watchpoint and select Properties. (Or for breakpoints only, in the C/C++ Editor, right-click the breakpoint and select Breakpoint Properties.) - The C/C++ Line Breakpoint Properties or C/C++ Watchpoint Properties dialog appears (they're very similar). You need to fill in at least one field:

              Breakpoints view; setting breakpoint properties - -

            2. -
            3. In the Condition field, enter the Boolean expression to evaluate. The expression may be anything that can be evaluated inside an if statement (e.g. x > y ). The default is TRUE. -
            4. -
            5. In the Ignore Count field, enter the number of times the breakpoint or watchpoint may be hit before it begins to take effect (not the number of times the condition is true). The default is 0. -
            6. -
            7. Click OK. - When in debug mode, your program stops when it meets the conditions you've set for the breakpoint or watchpoint.
            8. -
            - - -

            Disabling and enabling breakpoints and watchpoints

            - -

            You may wish to temporarily deactivate a breakpoint or watchpoint without losing the information it contains.

            -

            - -To disable or enable a breakpoint or watchpoint:

            - - - - -
            =>>In the Breakpoints view, right-click the breakpoint or watchpoint and select Disable or Enable (Or for breakpoints only, right-click the breakpoint in the editor area and select Disable Breakpoint or Enable Breakpoint):

            Breakpoints view; disabling breakpoints

            - - -

            To disable or enable all (or many) breakpoints or watchpoints: - -

            -
              - -
            1. In the Breakpoints view, use any of the following methods: -
                -
              • Select breakpoints and watchpoints while holding down the Ctrl key. -
              • -
              • Select a range of breakpoints and watchpoints while holding down the Shift key. -
              • -
              • From the main menu, select Edit-->Select All. -
              • -
              • Right-click in the Breakpoints view and select Select All. -
              • -
              -
            2. -
            3. Right-click the highlighted breakpoints and watchpoints and select Disable or Enable.
            4. -
            - - -

            Removing breakpoints and watchpoints

            - -

            - -To remove one or more breakpoints and watchpoints:

            - - - - -
            =>>Follow the procedure described in "Disabling and enabling breakpoints and watchpoints", with the following exceptions: -
              -
            • Instead of selecting Disable or Enable, select Remove. -
            • -
            - - -

            - -To remove all breakpoints and watchpoints: - -

            - - - - -
            =>>In the Breakpoints view, right-click and select Remove All.
            - - - -

            Evaluating your expressions (Expressions view)

            - -

            The Expressions view lets you evaluate and examine the value of expressions:

            -

            Expressions view - - -

            -

            To evaluate an expression:

            -
              - -
            1. From the menu, select Run-->Add C/C++ Expression. (Or, right-click in the C/C++ Editor and select Add C/C++ Expression.) - The Add Expression dialog opens:

              Expressions view; add expressions - -

            2. -
            3. Enter the expression you want to evaluate (e.g. (x-5)*3 ). -
            4. -
            5. Click OK. - The expression and its value appear in the Expressions view. When the execution of a program is suspended, the IDE reevaluates all expressions and highlights the changed values.
            6. -
            - - -

            Inspecting your registers (Registers view)

            - -

            The Registers view displays information about the registers in the currently selected stack frame. When the execution stops, the changed values are highlighted. The functionality of the Registers view is very similar to that of the Variables view; for more information, see the "Inspecting your variables (Variables view)" section in this chapter.

            -

            Registers view

            -

            You can also customize the colors in the Registers view and change the default value of the Show Type Names option. - -

            -

            To access the Registers view customization dialog:

            -
              - -
            1. From the main menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Debug-->Registers View.
            4. -
            - - -

            Inspecting your process memory (Memory view)

            - -

            The Memory view lets you inspect and change your process memory. The view consists of four tabs that let you inspect multiple sections of memory:

            -

            Memory view - -

            -

            - - -

            Inspecting memory

            - -

            The Memory view supports the same addressing as the C language. You can address memory using expressions such as 0x0847d3c, (&y)+1024, and *ptr. - -

            -

            To inspect your process memory:

            -
              - -
            1. In the Debug view, select a process. Selecting a thread automatically selects the associated process. -
            2. -
            3. In the Memory view, select one of the four tabs labeled Memory 1, Memory 2, and so on. -
            4. -
            5. In the Address field, type the address and press Enter.
            6. -
            - - -

            Changing memory

            - -

            - -
            - - - -
            Caution:Changing your process memory can make your program crash.
            -
            - - -

            To change your process memory:

            -
              - -
            1. Follow the procedure for inspecting your process memory. -
            2. -
            3. In the memory pane, type the new value for the memory. The Memory view works in "typeover" mode; use the arrow keys to jump from byte to byte:

              Memory view; changing -

            4. -
            5. Click the Save Changes buttonIcon: Save Changes. - The changed memory appears in red.
            6. -
            - - -

            Configuring output format

            - -

            You can configure your output to display hexadecimal or decimal. You can also set the number of display columns and the memory unit size. You can configure each memory tab independently.

            -

            - -To configure the output format:

            -
              - -
            1. In the Memory view, select one of the four tabs labeled Memory 1, Memory 2, and so on. -
            2. -
            3. Right-click the pane and select any of Format, Memory Unit Size, or Number of Columns. Choose your desired output format:

              Memory view; configure

              The output reflects your selection. Note that some output formats are best viewed in a nonproportional font such as Courier. - -

            4. -
            - - -

            Customizing the Memory view

            - -

            You can customize the Memory view to display in different colors and fonts. You can also customize some of its behavior. The customizations affect the entire Memory view.

            -

            - -To access the Memory view customization dialog:

            -
              - -
            1. From the menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Debug-->Memory View. -
            4. -
            5. You can now change the colors, font, and behavior of the Memory view. When you're done, click Apply, then OK. -
            6. -
            - - -

            Viewing your output (Console view)

            - -

            The Console view shows you the output of the execution of your program and lets you supply input to your program:

            -

            Console view

            -

            - -
            - - - -
            Note:See also the "Debugging with GDB (Console view)" section, below.
            -
            - - -

            - -The console shows three different kinds of text, each in a different default color:

            -
              -
            • standard output (blue) -
            • -
            • standard error (red) -
            • -
            • standard input (green)
            • -
            -

            You can choose different colors for these kinds of text on the preferences pages. - -

            -

            To access the Console view customization dialog:

            -
              - -
            1. From the menu, select Window-->Preferences. -
            2. -
            3. In the left pane, select Debug-->Console.
            4. -
            - - -

            Debugging with GDB (Console view)

            - -

            The IDE lets you debug using a subset of the commands that the gdb utility offers:

            -

            Console view; GDB

            -

            - -
            - - - -
            Note:See also the "Viewing your output (Console view)" section, above.
            -
            - -

            - -

            Enabling the GDB Console view

            - -

            The GDB Console view is part of the regular Console view but isn't accessible until you toggle to it. Once you do, GDB output appears in place of the regular Console view output. - -

            -

            To enable the GDB Console view:

            -
              - -
            1. In the Debug view, select a debug session. -
            2. -
            3. In the Debug view, click the Show Debugger Console on Target Selection button Icon: Show Debugger Console on Target Selection. - The Console view changes to the GDB Debugger Console view.
            4. -
            - - -

            Using the GDB Console view

            - -

            The GDB Console view lets you bypass the IDE and talk directly to GDB; the IDE is unaware of anything done in the GDB Console view. Thus, items such as breakpoints that you set from the GDB Console view don't appear in the C/C++ Editor.

            -

            - -
            - - - -
            Note:You can't use the Tab key for line completion because the commands are sent to GDB only when you press Enter.
            -
            - - -

            To use the GDB Console view:

            - - - - -
            =>>In the GDB Console view, enter a command. For example, enter help to get a list of commands; nexti to step one instruction, proceeding through subroutine calls; nexti 3 to step three:

            Console view; GDB; using

            - - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/caution.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/caution.gif deleted file mode 100644 index f4ec4e7b194..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/caution.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/onestep.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/onestep.gif deleted file mode 100644 index 239243c1059..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/onestep.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/pointing.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/pointing.gif deleted file mode 100644 index 903f23707c9..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/image-lib/pointing.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz.jpg deleted file mode 100644 index 23d9f690a84..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c.jpg deleted file mode 100644 index c1898523069..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_architecture.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_architecture.jpg deleted file mode 100644 index a07df4a7457..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_architecture.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_buildsettings.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_buildsettings.jpg deleted file mode 100644 index 1a45dcad259..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_buildsettings.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_library.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_library.jpg deleted file mode 100644 index d824c834336..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_library.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_options.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_options.jpg deleted file mode 100644 index aaf0bdfad6c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_options.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_projects.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_projects.jpg deleted file mode 100644 index 5c80aa3fd32..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_c_projects.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_convert_1.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_convert_1.jpg deleted file mode 100644 index e1027e3438b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_convert_1.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_target.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_target.jpg deleted file mode 100644 index 1f4530af3e8..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/cwiz_target.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c.jpg deleted file mode 100644 index 775044e2c13..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_codetemplates_use.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_codetemplates_use.jpg deleted file mode 100644 index 0382955bdf7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_codetemplates_use.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_contentassist.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_contentassist.jpg deleted file mode 100644 index b7db881d3e6..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_contentassist.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_helloworld.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_helloworld.jpg deleted file mode 100644 index 9fb6c01590b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_helloworld.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_hoverhelp.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_hoverhelp.jpg deleted file mode 100644 index 0971f4ee3cf..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/editor_c_hoverhelp.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/findit b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/findit deleted file mode 100644 index 34010dbfb31..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/findit +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -for i in `ls *.gif *.jpg` -do - - grep $i ../*.html > /dev/null - result=$? - if [ $result -ne 0 ] - then - echo "Removing $i ($result)" - /bin/rm -f $i - fi -done diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/first_look.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/first_look.jpg deleted file mode 100644 index 8c73a267472..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/first_look.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_breakpoint_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_breakpoint_obj.gif deleted file mode 100644 index 06d007905b2..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_breakpoint_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debug_exc.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debug_exc.gif deleted file mode 100644 index 3052a80cd67..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debug_exc.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugger_console.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugger_console.gif deleted file mode 100644 index e6d5b138d46..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugger_console.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugt_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugt_obj.gif deleted file mode 100644 index d139cde9dd4..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_debugt_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disassembly.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disassembly.gif deleted file mode 100644 index a78e3024c87..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disassembly.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disconnect.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disconnect.gif deleted file mode 100644 index f1d5fb31e51..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_disconnect.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_error_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_error_obj.gif deleted file mode 100644 index b04020bc723..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_error_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_filter_tsk.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_filter_tsk.gif deleted file mode 100644 index 1492b4efae2..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_filter_tsk.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_installed_ovr.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_installed_ovr.gif deleted file mode 100644 index 7f4a31ee7eb..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_installed_ovr.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_memory_update.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_memory_update.gif deleted file mode 100644 index ca4fe2b1cff..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_memory_update.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_menu.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_menu.gif deleted file mode 100644 index a492838d248..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_menu.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_app.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_app.gif deleted file mode 100644 index b7165fa005a..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_app.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_lib.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_lib.gif deleted file mode 100644 index af20154d34b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newccqnx_lib.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_app.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_app.gif deleted file mode 100644 index 385a8ba0cc8..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_app.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_lib.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_lib.gif deleted file mode 100644 index a48b45c47ce..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_newcqnx_lib.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_next_error_nav.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_next_error_nav.gif deleted file mode 100644 index 775842e89d1..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_next_error_nav.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_prev_error_nav.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_prev_error_nav.gif deleted file mode 100644 index 3b1bb7ca128..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_prev_error_nav.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_relaunch.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_relaunch.gif deleted file mode 100644 index 6b0c23d8f61..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_relaunch.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_remove_all.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_remove_all.gif deleted file mode 100644 index 2c069ab3f43..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_remove_all.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_restart.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_restart.gif deleted file mode 100644 index a063c230aca..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_restart.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_resume.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_resume.gif deleted file mode 100644 index 2088548a499..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_resume.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_run_exc.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_run_exc.gif deleted file mode 100644 index 8174dade2bb..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_run_exc.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe.gif deleted file mode 100644 index b9783c814a7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe_running.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe_running.gif deleted file mode 100644 index ef406cf24c9..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stackframe_running.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepinto.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepinto.gif deleted file mode 100644 index cc1378e0e0d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepinto.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepover.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepover.gif deleted file mode 100644 index 5e24fb9b8fe..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepover.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepreturn.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepreturn.gif deleted file mode 100644 index 6081cba13ba..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_stepreturn.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_suspend.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_suspend.gif deleted file mode 100644 index 457893c1ba5..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_suspend.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate.gif deleted file mode 100644 index d47876f6857..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_all.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_all.gif deleted file mode 100644 index ec56a24fabc..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_all.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_rem.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_rem.gif deleted file mode 100644 index bd53994fb7b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_terminate_rem.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread1.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread1.gif deleted file mode 100644 index 7e4a43cd78c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread1.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread2.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread2.gif deleted file mode 100644 index fb5175f5c68..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread2.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread3.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread3.gif deleted file mode 100644 index f2a16394e6d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_thread3.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_tnames.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_tnames.gif deleted file mode 100644 index 1bbbb95c8ea..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_tnames.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_warning_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_warning_obj.gif deleted file mode 100644 index cf8d571833d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_warning_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_read_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_read_obj.gif deleted file mode 100644 index 793b189d849..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_read_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_readwrite_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_readwrite_obj.gif deleted file mode 100644 index 0b1184d72a8..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_readwrite_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_write_obj.gif b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_write_obj.gif deleted file mode 100644 index b5fa352bb51..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/icon_watchpoint_write_obj.gif and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch.jpg deleted file mode 100644 index 735c3b3e553..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_arguments.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_arguments.jpg deleted file mode 100644 index dab157b564b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_arguments.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_common.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_common.jpg deleted file mode 100644 index 12a27679ef8..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_common.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_customize.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_customize.jpg deleted file mode 100644 index df901271dbd..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_customize.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debug_debug.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debug_debug.jpg deleted file mode 100644 index 1f241c0cfb5..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debug_debug.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debugger.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debugger.jpg deleted file mode 100644 index 92679ca2c29..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_debugger.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_environment.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_environment.jpg deleted file mode 100644 index d5d29676680..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_environment.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_main.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_main.jpg deleted file mode 100644 index 9ba0a2b2cc7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_main.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run2_faster.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run2_faster.jpg deleted file mode 100644 index f575b571111..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run2_faster.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run_run.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run_run.jpg deleted file mode 100644 index 6d428f53843..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/lnch_run_run.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/persp_dbug_properties_options.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/persp_dbug_properties_options.jpg deleted file mode 100644 index 2ac4b01c9d1..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/persp_dbug_properties_options.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints.jpg deleted file mode 100644 index b90f436f57c..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_added.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_added.jpg deleted file mode 100644 index 6c46064d6d9..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_added.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_adding.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_adding.jpg deleted file mode 100644 index b0cefdcf9c5..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_adding.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_disable.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_disable.jpg deleted file mode 100644 index d2713acb7a0..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_disable.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_prop.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_prop.jpg deleted file mode 100644 index 33dc1b97a31..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_prop.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_watch_add.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_watch_add.jpg deleted file mode 100644 index 51d66095f5b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_breakpoints_watch_add.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild.jpg deleted file mode 100644 index 22eb91ce741..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild_configurations.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild_configurations.jpg deleted file mode 100644 index d51d5e9b2cf..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cbuild_configurations.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console.jpg deleted file mode 100644 index f0e8fcba1f6..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb.jpg deleted file mode 100644 index 201fd624130..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb_using.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb_using.jpg deleted file mode 100644 index 1450ef52ee8..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_gdb_using.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_helloworld.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_helloworld.jpg deleted file mode 100644 index 7d73ca6d547..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_console_helloworld.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects.jpg deleted file mode 100644 index 7b26f7986bd..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_building.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_building.jpg deleted file mode 100644 index 81a98ae2d48..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_building.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_filter.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_filter.jpg deleted file mode 100644 index fe2068b3aed..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_filter.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_executable.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_executable.jpg deleted file mode 100644 index 48e0c86bcd7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_executable.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_source.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_source.jpg deleted file mode 100644 index 17469f7dea9..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_outline_source.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_add.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_add.jpg deleted file mode 100644 index 2dc8b6c61a7..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_add.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_use.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_use.jpg deleted file mode 100644 index 15d968fcbeb..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_cprojects_target_use.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug.jpg deleted file mode 100644 index 5ffbab51a2d..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug_runtoline.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug_runtoline.jpg deleted file mode 100644 index 43674afff51..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_debug_runtoline.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions.jpg deleted file mode 100644 index 4d706ed99ab..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions_add.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions_add.jpg deleted file mode 100644 index 8836ec003c2..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_expressions_add.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory.jpg deleted file mode 100644 index 414cb658784..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_change.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_change.jpg deleted file mode 100644 index 3636d953921..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_change.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_configure.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_configure.jpg deleted file mode 100644 index 9a8a809b78a..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_memory_configure.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_outline.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_outline.jpg deleted file mode 100644 index 420c4787856..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_outline.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_registers.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_registers.jpg deleted file mode 100644 index bc2ee4ebf26..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_registers.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks.jpg deleted file mode 100644 index 5284ac82218..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_filter_tasks.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_filter_tasks.jpg deleted file mode 100644 index e7ede1228cb..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_filter_tasks.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_new_tasks.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_new_tasks.jpg deleted file mode 100644 index 294c6fcfb45..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_tasks_new_tasks.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables.jpg deleted file mode 100644 index 9435b70d68f..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables_customize.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables_customize.jpg deleted file mode 100644 index bfc696b7b00..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/view_variables_customize.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_c_codetemplates.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_c_codetemplates.jpg deleted file mode 100644 index ee85448640b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_c_codetemplates.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_workbench.jpg b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_workbench.jpg deleted file mode 100644 index bc1e73b061b..00000000000 Binary files a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/images/window_preferences_workbench.jpg and /dev/null differ diff --git a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/lnch.html b/doc/org.eclipse.cdt.doc.user/raw/hackedguide/lnch.html deleted file mode 100644 index f86b9bbb092..00000000000 --- a/doc/org.eclipse.cdt.doc.user/raw/hackedguide/lnch.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - -Starting Your Programs (launcher) - - - -
            - - -

            Starting Your Programs (launcher)

            - -

            - - -

            -

            Before running or debugging a program, you must configure how and where to -run it, and what options to pass to it. To do all this, you must use the -launcher. - -

            -

            - -In this chapter: - - -

            How the launcher works

            - -

            To run or debug programs with the IDE, you must set up a launch -configuration. Launch configurations define which programs to launch, -the command-line options to use, and what values to use for environment -variables.

            -

            - -The IDE saves your launch configurations so you can quickly reproduce the -execution conditions by running existing configurations, even if the setup -is complicated.

            - -

            Types of launch configurations

            - -

            The IDE supports these types of launch configurations: - -

            -
            - -
            C/C++ Local
            -
            If you're developing on your target (self-hosted), you may create a C/C++ Local launch configuration. You don't need to use qconn; the IDE launches your program through gdb. - -
            -
            C/C++ Postmortem debugger
            -
            If your program produced a corefile (via the dumper utility) when it faulted, you can examine the state of your program by loading it into the postmortem debugger. This option is available only when you select Debug. When you debug, you're prompted with the Select the corefile dialog. - -
            -
            - -

            - -

            Running and debugging the first time (Launch Configurations dialog)

            - -

            You can use the same launch configuration to run or debug a program. Your choices in the Launch Configurations dialog may -cause subtle changes in the dialog but greatly affect such things as which options in the -dialog are enabled. - -

            Enabling the Run and Debug menu items

            - -

            The Run and Debug menu items appear in the C/C++ Development perspective by default, but they might not appear in all perspectives. It's also possible to remove them. If the Run-->Run menu item doesn't appear, you must enable it. - -

            -

            To enable the Run and Debug menu items:

            -
              - -
            1. From the main menu, select Window-->Customize Perspective. - The Customize Perspective dialog appears. -
            2. -
            3. In the left pane, select Other-->Launch. -
            4. -
            5. Enable Launch: -

              Launch Configuration dialog; customization -

            6. -
            7. Click OK. - The Run-->Run menu item is now accessible in your current perspective.
            8. -
            - - -

            Debugging a program the first time

            - -

            When you first debug a program, you have to create a launch configuration.

            -

            - -To debug a program the first time:

            -
              - -
            1. In the C/C++ Projects view (or the Navigator view), select your project. -
            2. -
            3. From the main menu, select Run-->Debug (or, click the Debug icon and select Debug from the dropdown menu): -

              Launch Configuration dialog; debugging -

            4. -
            5. Select a launch configuration type: -

              Launch Configuration dialog

              If you're connecting to your target via IP, select C/C++ QNX QConn (IP). If not, see the -"Types of Launch Configurations" section in this chapter before deciding: - -

            6. -
            7. Click New. -The dialog displays the appropriate tabs -
            8. -
            9. Enter an appropriate description for your configuration in the Name field. -
            10. -
            11. Fill in the details in the various tabs. See the "Setting execution options (Launch Configurations tabs)" section in this chapter for details about each tab. -
            12. -
            13. Click Debug. - You can now debug your program.
            14. -
            - - -

            Running a program the first time

            - -

            When you configure a program to run, you should also configure it to debug as well. - -

            - -
            - - - -
            Note:There are fewer options for running programs than for debugging. Some configurations aren't available.
            -
            - - -

            - -To run a program the first time:

            - - - - -
            =>>Repeat the procedure for debugging a program (see "Debugging a program the first time"), with the following changes: -
              -
            • Instead of selecting Run-->Debug from the main menu, select Run-->Run (or, click the Run icon and select Run from the dropdown menu): -

              Launch Configuration dialog; running -

            • -
            • Instead of clicking Debug when you're done, click Run. -
            • -
            • Instead of running under the control of a debugger, your program runs.
            • -
            - - - -

            Running and debugging subsequent times (Launch Configurations dialog)

            - -

            Once you've created your launch configuration, running or debugging a program is as easy as selecting your previous configuration. There are several ways to do it:

            - - -

            Launching a selected program

            - -

            - -To debug or run a program that you've created a launch configuration for:

            -
              - -
            1. From the main menu, select Run-->Debug or Run-->Run. - The Launch Configurations dialog appears. -
            2. -
            3. In the left pane, select the launch configuration you created when you first ran or debugged your program. -
            4. -
            5. Click Debug or Run. -
            6. -
            - - -

            Launching from a list of favorites

            - -

            If you have a program that you launch frequently, you can add it to the Debug or Run drop-down menu so you can launch it quickly.

            -

            - -
            - - - -
            Note:To use this method, you must have selected Display in favorites when you first created your Launch Configuration. If you didn't, edit the Display in favorites option under the Common tab. See the "Setting execution options (Launch Configurations tabs)" section in this chapter.
            -
            - - -

            To debug or run a program using your favorites list:

            -
              - -
            1. Do one of the following: -
                -
              • Run: From the main menu, select Run-->Run History. -
              • -
              • Run: Click the dropdown menu Icon: Menu dropdown part of the run menu button set Icon: RunIcon: Menu dropdown. -
              • -
              • Debug: From the main menu, select Run-->Debug History. -
              • -
              • Debug: Click the dropdown menu Icon: Menu dropdown part of the debug menu button set Icon: DebugIcon: Menu dropdown. -
              • -
              - A list appears, showing all the launch configurations for which you enabled Display in favorites: -

              Launch Configuration dialog; running a program subsequent times (faster) - -

            2. -
            3. Select your launch configuration.
            4. -
            - - -

            Launching the last-launched program

            - -

            To relaunch the last program you ran or debugged:

            -

            - - - - -
            =>>Press F11 or click one of: -
              -
            • the Debug Last Launched: yourLaunchName button -Icon: Debug -
            • -
            • the Run Last Launched: yourLaunchName -Icon:Run
            • -
            - - - -

            Setting execution options (Launch Configurations tabs)

            - -

            The Launch Configurations dialog has many tabs, including:

            -

            - -

            Depending on what type of launch configuration you've selected, only certain tabs appear:

            -

            - - - - - - - - - - - - - - - - - - - - -
            Launch Configuration - Main tab,
            - Common tab - -
            Arguments tab,
            - Environment tab -
            Debugger tab -
            C/C++ Local - Yes - Yes - Yes -
            C/C++ Postmortem debug*** - Yes - No - Yes -
            - -

            ***Debug only; core file required.

            -

            - - -

            - -

            Main tab

            - -

            This tab lets you specify the project and program that you want to run or debug. The IDE might fill in some of the fields for you:

            -

            Launch Configurations dialog; Main tab

            -

            - -The Main tab varies, depending on the type of configuration you're creating. If you're creating a C/C++ QNX QConn (IP) launch configuration, you'll see a section for Target Options; for C/C++ PDebug (Serial), you'll see Serial Options. - -

            -
            - -
            Project
            -
            Enter the name of your project. You may also select from the open projects by clicking Browse. You can create or edit launch configurations only for open projects. - -
            -
            C/C++ Application
            -
            Enter the relative path of the executable from the project directory (e.g. x86/o/KillerApp). -For QNX projects, an executable with a _g suffix indicates it was compiled for debugging. -You may also select from the available executables by clicking Search. - -
            -
            Target Options
            -
            You'll see this section only for C/C++ QNX QConn (IP) launch configurations. -Select a target from the available list. If you haven't created a target, right-click the empty pane and select Add Target. For more information about creating a target, see the Common Wizards chapter. - -
            -
            Filter targets based on C/C++ Application selection
            -
            Enable this option to hide platforms that don't match your chosen executable. For example, if you've chosen a program compiled for PPC, you'll see only PPC targets. - -
            -
            Serial Options
            -
            You'll see this section only for C/C++ QNX PDebug (Serial) launch configurations. - -
            -
            Serial Port
            -
            Enter the communication port (e.g. COM1 for Windows; /dev/ser1 for QNX Neutrino). - -
            -
            Baud Rate
            -
            Select the baud rate from the dropdown list.
            -
            - - -

            Arguments tab

            - -

            This tab lets you specify the arguments your program uses and the directory where it runs:

            -

            Launch Configurations dialog; Arguments tab - -

            -
            - -
            C/C++ Program Arguments
            -
            Enter the arguments that you want to pass on the command line. For example, if you want to send the equivalent of myProgram -v -L 7, type -v -L 7 in this field. You can put -v and -L 7 on separate lines because the IDE automatically strings the entire contents together. - -
            -
            Working directory
            -
            Enable Use default working directory to run the executable from the directory where the IDE is running. If you disable Use default working directory, you can specify a full path in the Local directory field or a relative path in the Workspace field.
            -
            - - -

            Environment tab

            - -

            The Environment tab lets you set the environment variables and values to use when the program launches:

            -

            Launch Configurations dialog; Environment tab

            -

            For example, if you want to set the environment variable named PHOTON to the value /dev/photon_2 when you run your program, use this tab. Click New to add an environment variable.

            - -

            Debugger tab

            - -

            The Debugger tab lets you choose which debugger to use when you debug your program:

            -

            Launch Configurations dialog; Debugger tab

            - -
            - - - -
            Note:The settings in the Debugger tab affect the program only when you debug it, not when you run it.
            -
            - - -
            - -
            Debugger
            -
            The debugger dropdown list includes the available debuggers for the selected launch-configuration type. The list also varies depending on whether you're debugging self-hosted. - -
            -
            Run program in debugger/Attach to running process
            -
            Most of the time, you'll want to simply Run program in debugger. -If you enable Attach to running process, you're prompted to select a process from a list at run time. Note the following limitations: - -
              -
            • You can attach only to programs that you launched for debugging. -
            • -
            • You can't use the Memory Trace tool. -
            • -
            -
            Stop at main() on startup
            -
            If you deselect Stop at main() on startup, the program runs until you interrupt it manually, or until it hits a breakpoint. - -
            -
            Debugger Options
            -
            You'll see this section only for C/C++ Local launch configurations; the IDE already automatically fills in the options for QNX launch configurations. - -
            - -
            MI Debugger -
            -
            You can choose the MI (Machine Interface) Debugger, such as the gdb executable. - -
            -
            Load shared library symbols automatically -
            -
            If you want to watch line-by-line stepping of library functions in the C Editor, enable this option. You may wish to disable this option if your target doesn't have much memory; the library symbols take up RAM on the target. It's enabled by default. -
            -
            -
            -
            - - -

            Common tab

            - -

            The Common tab lets you define where the launch configuration is stored, how you access it, and what perspective you change to when you launch:

            -

            Launch Configurations dialog; Common tab - - -

            -
            - -
            Type of launch configuration
            -
            When you create a launch configuration, the IDE saves it as a .launch file. If you select Local, the IDE stores the configuration in one of its own plugin directories. If you select Shared, you can save it in a location you specify (such as in your project). Saving as Shared lets you commit the .launch file to CVS so your coworkers can run the program using the same configuration. - -
            -
            Perspective to switch to or open when launched in
            -
            You can configure which perspectives the IDE changes to when you run or debug. You can set the perspectives specifically, or simply set them to Default. To determine the default perspectives for both, select Window-->Preferences from the main menu and select Debug from the left pane. - -
            -
            Display in favorites
            -
            You can have your launch configuration displayed when you click the Run or Debug dropdown menus. To do so, enable Run or Debug under the Display in favorites menu: heading.
            -
            - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ceditor_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ceditor_pref.htm deleted file mode 100644 index b8ddf1cc732..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ceditor_pref.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -C/C++ editor, code templates and search preferences - - - - - -

            C/C++ editor, code templates and search preferences

            - -

            This section describes the preferences pages for the C/C++ editor, code -templates and search features.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn aboutSee
            General C/C++ editor preferencesGeneral page, - Preferences window
            C/C++ editor annotations preferencesAnnotations - page, Preferences window
            C/C++ editor text color preferencesColors page, - Preferences window
            C/C++ editor preference Content Assist - preferencesContent - Assist page, Preferences window
            C/C++ editor Code Templates preferencesCode Templates - page, Preferences window
            C/C++ editor Search preferencesC/C++ search page, - Search dialog box
            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_dbg_view.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_dbg_view.htm deleted file mode 100644 index 9046ecb6ae4..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_dbg_view.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - -Debug views - - - - - -

            Debug views

            - -

            This section describes debug views.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            View information about registersRegisters view
            Inspect and change process memoryMemory view
            Change the appearance of the memory viewMemory view - preferences
            View information about shared librariesShared - Libraries view
            View signals defined for a given debug targetSignals view
            View debug informationDebug view
            Set C/C++ debug preferencesDebug preferences
            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_proj_prop_pages.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_proj_prop_pages.htm deleted file mode 100644 index 72106e95c4d..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_proj_prop_pages.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Project properties - - - - - -

            Project properties

            -

            In this section, learn about the C/C++ project properties pages.

            - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn about theSee
            Make Builder pageMake - Builder page, C/C++ Properties window
            Error Parsers pageError - Parsers, C/C++ Properties window
            Binary Parsers page - Binary Parser, C/C++ Properties window
            Paths and symbols pagePaths and - symbols page, C/C++ Properties window
            Target platform pageTarget - platform, C/C++ Properties window
            -

            -IBM Copyright Statement - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm deleted file mode 100644 index f7fb7003875..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_ref.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Reference - - - - - -

            Reference

            This section describes the C/C++ perspective.

            - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn aboutSee
            Icons displayed in the C/C++ perspectiveC/C++ perspective - icons
            Project properties pagesProject - properties
            ViewsViews
            Run and debug pagesRun and Debug - dialog box
            C/C++ editor preference pagesC/C++ editor, - code templates and search preferences
            -

            -IBM Copyright Statement -

            - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_run_dbg_pages.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_run_dbg_pages.htm deleted file mode 100644 index b812368a3d5..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_run_dbg_pages.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - -Run and Debug dialog boxes - - - - - -

            Run and Debug dialog boxes

            - -

            This section describes the Run and Debug dialog boxes.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn about theSee
            Main pageMain page, - Run or Debug dialog box
            Arguments pageArguments page, - Run or Debug dialog box
            Environment pageEnvironment - page, Run or Debug dialog box
            Debugger pageDebugger page, - Run or Debug dialog box
            Source pageSource page, - Run or Debug dialog box
            Common pageCommon page, - Run or Debug dialog box
            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_views.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_o_views.htm deleted file mode 100644 index ce8af3609fc..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_o_views.htm +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -Views - - - - - -

            Views

            This section describes views of the C/C++ perspective.

            - - - - - - - - - - - - - - - - - -
            To learn about theSee
            Outline viewOutline view
            C/C++ Projects viewC/C++ Projects - view
            Debug viewDebug views
            -

            -IBM Copyright Statement - - - diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_anno.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_anno.htm deleted file mode 100644 index 57cd1a088a6..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_anno.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - -Annotations page, Preferences window - - - - - -

            Annotations page, Preferences window

            - -

            The Annotations page of the Preferences window lets you customize the -appearance of annotations in the C/C++ editor.

            - -
            -
            Annotation Presentation Options
            -
            Lists items that can be displayed in a specified color.
            -
            Show in Text
            -
            Displays the selected annotation type in the text. The - corresponding text is underlined.
            -
            Show in Overview Ruler
            -
            Displays the selected annotation type in the overview ruler.
            -
            Annotations Color
            -
            Specifies the color in which to display an annotation.
            -
            - -

            Related concepts
            -Coding aids

            -

            Related tasks -
            -Customizing the C/C++ editor

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_color.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_color.htm deleted file mode 100644 index ac1477d97af..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_color.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - -Colors page, Preferences window - - - - - - -

            Colors page, Preferences window

            - -

            The Colors page of the Preferences window lets you customize the appearance of the C/C++ editor.

            - -
            -
            System Default
            -
            Uses the system default background color.
            -
            Custom
            -
            Changes the background color.
            -
            Foreground
            -
            Lists items that can be displayed in a specified color.
            -
            Color
            -
            Specifies the color in which to display the selected item.
            -
            Bold
            -
            Bolds the selected item.
            -
            - -

            Related concepts
            -Coding aids

            -

            Related tasks -
            -Customizing the C/C++ editor

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_con_assist.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_con_assist.htm deleted file mode 100644 index ef6f682fbec..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_con_assist.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - -Content Assist page, Preferences window - - - - - -

            Content Assist page, Preferences window

            - -

            The Contents Assist page of the Preferences window, lets you customize how the Content Assist feature works.

            - -
            -
            Insert single proposals automatically
            -
            Inserts an element into your code when it is the only item in the Content Assist - list.
            -
            Enable auto activation
            -
            Opens Content Assist when you type the first letter - of an element in the C/C++ editor for which there is a code template or an - element that begins with the same letter.
            -
            Auto activation delay
            -
            Specifies the number of seconds before Content Assist is - activated.
            -
            Auto activation triggers for C:
            -
            Specifies a character that, if typed in the C/C++ editor, causes code assist to - be invoked immediately  before the delay times out.
            -
            Background for completion proposals
            -
            Specifies the background color for the Content Assist dialog box.
            -
            - -

            Related concepts
            -Coding aids

            -

            Related tasks -
            -Customizing the C/C++ editor
            -Working with Content Assist

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_gen.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_gen.htm deleted file mode 100644 index 0ebeae5c392..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_c_editor_gen.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - -General page, Preferences window - - - - - - -

            General page, Preferences window

            - -

            The General page of the Preferences window lets you customize the appearance of the C/C++ editor.

            - -
            -
            Displayed tab width
            -
            Specifies the tab width as a number of characters. For example 4, - means the tab width will be 4 characters wide.
            -
            Print margin column
            -
            Specifies the print margin width as a number of characters.
            -
            Insert space for tabs
            -
            Inserts spaces instead of a tab character when your press Tab.
            -
            Highlight matching brackets
            -
            Highlights matching brackets.
            -
            Show line numbers
            -
            Displays line numbers in the left margin.
            -
            Highlight current line
            -
            Highlights the line that was last selected.
            -
            Show overview ruler
            -
            Displays the overview ruler on the right margin.
            -
            Show print margin
            -
            Displays the print margin.
            -
            Appearance color options
            -
            Lists items that can be displayed in a specified color.
            -
            Color
            -
            Changes the color of the item selected in the list.
            -
            - -

            Related concepts
            -Coding aids

            -

            Related tasks -
            -Customizing the C/C++ editor

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_code_temp.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_code_temp.htm deleted file mode 100644 index 4df5e313c27..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_code_temp.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -Code Templates page, Preferences window - - - - - - -

            Code Templates page, Preferences window

            - -

            The Code Templates page of the Preferences window lets you create, edit -import and export code templates.

            - -
            -
            New
            -
            Creates a new code template.
            -
            Edit
            -
            Edits the code template selected in the list.
            -
            Remove
            -
            Removes the selected code templates from the list.
            -
            Import
            -
            Imports a code template.
            -
            Export
            -
            Exports the selected code templates.
            -
            Export All
            -
            Exports all templates in the list.
            -
            Enable All
            -
            Makes all templates available when the Content Assist feature is - invoked.
            -
            Disable All
            -
            Makes all templates unavailable when the Content Assist feature is - invoked.
            -
            - -

            Related concepts
            -Coding aids

            -

            Related tasks -
            -Customizing the C/C++ editor
            -Working with Content Assist

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_pref.htm deleted file mode 100644 index 0b3d846a8c7..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_pref.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - -Debug preferences - - - - - -

            C/C++ debug preferences

            - -

            The Debug view of the Debug perspective displays information about the variables in the currently -selected stack frame.

            - -
            -
            Show full paths
            -
            Displays the full path of resources
            -
            Default variable format
            -
            Specifies the number system in which to display variables (Natural, - Hexadecimal or Decimal).
            -
            Default expression format
            -
            Specifies the number system in which to display expressions (Natural, - Hexadecimal or Decimal).
            -
            Default register format
            -
            Specifies the number system in which to display registers (Natural, Hexadecimal or - Decimal).
            -
            Automatically switch to disassembly mode
            -
            Automatically examines your program in disassembly mode as it steps into -functions for which you do not have source code, such as printf().
            -
            - -

            Related concepts -
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_view.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_view.htm deleted file mode 100644 index ed1b5bde70d..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_dbg_view.htm +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - -Debug view - - - - - -

            Debug view

            - -

            The Debug view shows the target information in a tree hierarchy shown -below with a sample of the possible icons:

            - - - - - - - - - - - - - - - - - - - - - - - - - - -
            Session item Description Icons
            Launch instance Launch configuration name and launch type Icon: Debug executable - Icon: Run executable
            Debugger instance Debugger name and stateIcon: Debugger
            Thread instance Thread number and stateIcon: Thread; suspended - Icon: Thread; running - Icon: Thread; stopped
            Stack frame instance Stack frame number, function, file name, and file line number Icon: Stackframe - Icon: Stack frame; running
            -

            The number beside the thread label is a reference counter, not a -thread identification number (TID).

            -

            The CDT displays stack frames as child elements. It displays the reason for -the suspension beside the target, (such as end of stepping range, breakpoint -hit, and signal received). When a program exits, the exit -code is displayed.

            - -

            In addition to controlling the individual stepping of your programs, you can -also control the debug session. You can perform actions such as terminating the -session and stopping the program by using the debug launch controls available -from Debug view.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ActionIconDescription
            Terminate - Ends the selected process
            Disconnect - Detaches the debugger from the selected process (useful for -debugging attached processes)
            Remove All Terminated - Clears all the killed processes in Debug view
            Terminate and Remove - Ends the selected process and remove it from Debug - view
            Relaunch - Restarts the process
            Terminate All - Ends all active processes in Debug view
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Run and Debug dialog box

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_gdb_mi_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_gdb_mi_pref.htm deleted file mode 100644 index 3a4428891fb..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_gdb_mi_pref.htm +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - -GDB MI - - - - - -

            Debug view preference

            - -IBM Copyright Statement - -

            - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_icons.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_icons.htm deleted file mode 100644 index 6b28e4b5dde..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_icons.htm +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - -C/C++ perspective icons - - - - - -

            C/C++ perspective icons

            - -

            The table below lists the icons displayed in the C/C++ perspective.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            IconDescription
            - C or C++ file
            - Class
            - Code template
            - Define
            - Enum
            - Enumerator
            - Field
            - Field private
            - Field protected
            - Field public
            - Include
            - Makefile
            - Method private
            - Method protected
            - Method public
            - Namespace
            - Struct
            - Type definition
            - Union
            - Variable
            -

            Related concepts -
            -Project file views
            -Outline view

            -

            Related tasks -
            -Displaying C/C++ file components in the -C/C++ Projects view

            -

            Related reference -
            -Views

            -IBM Copyright Statement. - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_mem_view_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_mem_view_pref.htm deleted file mode 100644 index cdd038d68e3..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_mem_view_pref.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Memory view preferences - - - - - -

            Memory view preferences

            - -

            You can change the appearance of the memory view.

            - -
            -
            Text Color
            -
            Changes the color of the text.
            -
            Background Color
            -
            Changes the background color.
            -
            Address Color
            -
            Changes the color of the memory address text.
            -
            Changed Value color
            -
            Changes the color of values.
            -
            Font
            -
            Changes the font.
            -
            Padding Character
            -
            Specifies the character to use for padded values.
            -
            Auto-refresh by default
            -
            Updates the view automatically.
            -
            Show ASCII by default
            -
            Displays values in ASCII.
            -
            - -

            Related concepts -
            -Debug information

            -

            Related tasks -
            -Working with memory

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_memoryview.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_memoryview.htm deleted file mode 100644 index 436ab146168..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_memoryview.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Memory view - - - - - -

            Memory view

            -

            The Memory view of the Debug perspective lets you inspect and change your process memory. The view -consists of four tabs that let you inspect multiple sections of memory. The -options described below are available when you right-click a memory value.

            -
            -
            Auto-Refresh
            -
            Updates the memory address list each time execution stops.
            -
            Refresh
            -
            Updates the memory address list.
            -
            Clear
            -
            Clears the selected memory address.
            -
            Format
            -
            Specifies the number system in which to display memory values (Hexadecimal, Signed Decimal, or Unsigned Decimal).
            -
            Memory Unit Size
            -
            Specifies the memory address size (1 byte, 2 bytes, 4 bytes, 8 bytes).
            -
            Number of Columns
            -
            Specifies the numbers of columns displayed in the Registers view (1 column, 2 columns, 4 columns, 8 columns, 16 columns).
            -
            Show ASCII
            -
            Displays the selected value as ASCII.
            -
            Detail panel
            -
            Displays the raw output from GDB for the selected variable.
            -
            -

            Related concepts -
            -Debug information

            -

            Related tasks -
            -Working with memory

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_buildset.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_buildset.htm deleted file mode 100644 index 9ab509de9fc..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_buildset.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -Make Builder page, C/C++ Properties window - - - - - - -

            Make Builder page, C/C++ Properties window

            - -

            The Make Builder page of the C/C++ Properties window lets you define build settings.

            - -
            -
            Stop on Error
            -
            Stops the build when an error is encountered.
            -
            Keep Going on Error
            -
            Continues the build even if an error is encountered.
            -
            Use Default
            -
            Use the default make command. Clear the check box to change the default make command.
            -
            Build Command
            -
            Type a build command.
            -
            Build on resource save (Auto Build)
            -
            Changes the default build make target. By default, - this option to stop the build when an error is encountered.
            - Note: This option is only effective if it is enabled in the Workbench - preferences.
            -
            Build (Incremental Build)
            -
            Changes the default build make target. By default, - this option builds only the components affected by modified files in that particular - project.
            -
            Rebuild (Full Build)
            -
            Changes the default build make target. By default, - this option builds every file in a project whether or not a file has been modified since -the last build. A Rebuild is a clean followed by a - build.
            -
            Make build target
            -
            Type a make build target.
            -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining build settings

            -

            Related reference -
            -Project properties

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_binary.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_binary.htm deleted file mode 100644 index 76b096e21de..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_binary.htm +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -Binary Parser, C/C++ Properties window - - - - - - -

            Binary Parser page, C/C++ Properties window

            - -

            The Binary Parser page of the C/C++ Properties window lists binary parsers.

            - -
            -
            Binary Parser
            -
            Select a binary parser from the list.
            -
            Binary Parser Options
            -
            If available, define binary parser options.
            -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Selecting a binary parser

            -

            Related reference -
            -Project properties

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_error.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_error.htm deleted file mode 100644 index 5d363b51371..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_parser_error.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - -Error Parsers, C/C++ Properties window - - - - - - -

            Error Parsers, C/C++ Properties window

            - -

            The Error Parsers page of the Properties window lists a set of filters that detect error patterns in -the build output log.

            - -
            -
            Error Parsers
            -
            Lists error parsers.
            -
            Up
            -
            Moves a highlighted error parser up the list.
            -
            Down
            -
            Moves a highlighted error parser down the list.
            -
            Select All
            -
            Selects all error parsers.
            -
            Unselect All
            -
            Deselects all error parsers.
            -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Filtering errors

            -

            Related reference -
            -Project properties

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_pathsymb.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_pathsymb.htm deleted file mode 100644 index c0dd25f0a84..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_pathsymb.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -Paths and symbols page, C/C++ Properties window - - - - - - -

            Paths and Symbols page, C/C++ Properties window

            - -

            The Paths and Symbols page of the C/C++ Properties window lets you define include paths and preprocessor symbols.

            - -
            -
            Include paths
            -
            Specifies a directory path for the files that exist on your development - platform. For example, "/usr/include" on a linux/solaris system or "c:/usr/include" - for windows.
            -
            Defined symbols
            -
            Symbols are simple preprocessor symbols that can be a name, (such as - DEBUG) or a name=value, (such as "CPU=x86").
            -
            New
            -
            Specifies a New button to enter a New Include Path or Defined - symbol.
            -
            Remove
            -
            Specifies Remove button to remove selected Include Path or - Defined symbol.
            -
            Move Up
            -
            Moves Up button to move the selected Include Path - or Defined symbol up the list.
            -
            Move Down
            -
            Moves Down button to move the selected Include Path - or Defined symbol down the list.
            -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Including paths and symbols

            -

            Related reference -
            -Project properties

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_platf.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_platf.htm deleted file mode 100644 index 852af64b271..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_newproj_platf.htm +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - -Target platform, C/C++ Properties window - - - - - - -

            Target platform, C/C++ Properties window

            - -

            The Target platform page of the C/C++ Properties window lets you select the -select the platform on which you plan to deploy your program for managed make -projects.

            - -
            -
            Platform
            -
            Specifies the deployment platform for your project.
            -
            Configurations
            -
            Specifies the configuration(s) for your project.
            -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Selecting a deployment platform

            -

            Related reference -
            -Project properties

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_outlineview.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_outlineview.htm deleted file mode 100644 index c72e56b162f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_outlineview.htm +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - -Outline view - - - - - - -

            Outline view

            - -

            The Outline view displays a structural view of C/C++ source code. The Outline -view automatically refreshes as you add declarations to your source code.

            - -

            Outline view toolbar

            - -
            -
            Hide Fields
            -
            Hide fields.
            -
            Hide Static Members
            -
            Hide static members.
            -
            Hide Non-Public Members
            -
            Hide non-public members.
            -
            Sort
            -
            Sort items alphabetically.
            -
            - -

            Outline view icons

            - -

            The table below lists the icons displayed in the Outline view.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            IconDescription
            - C or C++ file
            - Class
            - Namespace
            - Include
            - Enum
            - Enumerator
            - Field
            - Field private
            - Field protected
            - Field public
            - Include
            - Method private
            - Method protected
            - Method public
            - Struct
            - Type definition
            - Union
            - Variable
            -

            Related concepts -
            -Outline view

            -

            Related tasks -
            -Displaying C/C++ file components in the -C/C++ Projects view

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_reg_view_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_reg_view_pref.htm deleted file mode 100644 index 78f6eff145f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_reg_view_pref.htm +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - -Registers view preferences - - - - - -

            Registers view preferences

            - -

             

            - -

            -IBM Copyright Statement -

            - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_registersview.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_registersview.htm deleted file mode 100644 index 2cd27563721..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_registersview.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - -Registers view - - - - - -

            Registers view

            - -

            The Registers view of the Debug perspective lists information about the registers in a selected stack frame. -Values that have changed are highlighted in the Registers view when your program -stops. The options described below are available when you right-click a register -value.

            - -
            -
            Change Register Value
            -
            Specifies a register value.
            -
            Format
            -
            Displays register values, in Natural, Decimal, or Hexadecimal number - systems.
            -
            Show Type Names
            -
            Displays the type, (such as int) beside each register value.
            -
            Auto-Refresh
            -
            Updates the registers list each time execution stops.
            -
            Refresh
            -
            Updates the registers list.
            -
            Display as Array
            -
            Displays a selected register as an array of a specified length and index. - This option is only applicable to pointers.
            -
            Cast To Type
            -
            Casts a register value to a different type.
            -
            Restore to Original Type
            -
            Restores a register value to its original type.
            -
            - -

            Related concepts -
            -Debug information

            -

            Related tasks -
            -Working with registers

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_arg.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_arg.htm deleted file mode 100644 index 2f640b772b5..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_arg.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - -Arguments page, Run or Debug dialog box - - - - - -

            Arguments page, Run or Debug dialog boxes

            - -

            The Arguments page of the Run dialog box and the Debug dialog box lets you specify the execution arguments -that an application uses and the working directory -for a run configuration.

            -
            -
            C/C++ Project Arguments
            -
            Specifies the arguments that are passed on the command line.
            -
            Use default working directory
            -
            Clears the check box to specify a local directory or a different project in - your workspace.
            -
            Local directory
            -
            Specifies the path of, or browse to, a local directory.
            -
            Workspace
            -
            Specifies the path of, or browse to, a workspace relative working directory.
            -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Running and debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_comm.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_comm.htm deleted file mode 100644 index 87e6d2db69e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_comm.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -Common page, Run or Debug dialog box - - - - - -

            Common page, Run or Debug dialog box

            - -

            The Main page of the Run dialog box and the Debug dialog box lets you specify -the location in which to store your run configuration and how you access it and what -perspective to open when running an application.

            -
            -
            Local
            -
            Saves the launch configuration locally.
            -
            Shared
            -
            Saves the launch configuration to a project in your workspace, - and be able to commit it to CVS.
            -
            Location of shared configuration
            -
            Specifies the location of a launch configuration.
            -
            Run mode
            -
            Selects a perspective to switch to when you run an application.
            -
            Debug mode
            -
            Selects a perspective to switch to when you debug an application.
            -
            Run
            -
            Displays "Run" in favorites menu.
            -
            Debug
            -
            Displays in "Debug" favorites menu.
            -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Running and debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_dbg.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_dbg.htm deleted file mode 100644 index 6e277861f10..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_dbg.htm +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - -Debugger page, Run or Debug dialog box - - - - - -

            Debugger page, Run or Debug dialog box

            - -

            The Debugger page of the Run dialog box and the Debug dialog box lets you select a debugger to use when debugging an application.

            - -
            -
            Debugger
            -
            Selects debugger from the list.
            -
            Run program in debugger
            -
            Runs the program in debug mode.
            -
            Attach to running process
            -
            Prompts you to select a process from a list at run-time.
            -
            Stop at main() on startup
            -
            Stops program at main().
            -
            Enable variable bookkeeping
            -
            Updates variables in the - Variables view. Individual variables can be updated manually in the Variables - view.
            -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Running and debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_env.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_env.htm deleted file mode 100644 index 9c126a250dd..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_env.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - -Environment page, Run or Debug dialog box - - - - - -

            Environment page, Run or Debug dialog box

            - -

            The Environment page of the Run dialog box and the Debug dialog box lets you -set environment variables and values to use when an application runs.

            - -
            -
            Name
            -
            Displays the name of environment variables.
            -
            Value
            -
            Displays the value of environment variables.
            -
            New
            -
            Creates a new environment variable.
            -
            Edit
            -
            Modifies the name and value of an environment variable.
            -
            Remove
            -
            Removes selected environment variables from the list.
            -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Running and debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_main.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_main.htm deleted file mode 100644 index 0024ff6b31a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_main.htm +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -Main page, Run or Debug dialog box - - - - - -

            Main page, Run or Debug dialog boxes

            - -

            The Main page of the Run dialog box and the Debug dialog box, identifies the project and application you want to run or debug.

            - -
            -
            Project
            -
            Specifies the name of the project.
            -
            C/C++ Application
            -
            Specifies the name of the application.
            -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Running and debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_srce.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_srce.htm deleted file mode 100644 index 30cbcad1a97..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_run_dbg_srce.htm +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - -Source page, Run or Debug dialog box - - - - - -

            Source page, Run or Debug dialog box

            - -

            The Source page of the Run dialog box and the Debug dialog box lets you specify the location of source files used when debugging a C or C++ -application. By default, this information is taken from the build path of your -project.

            -
            -
            Generic Source Locations
            -
            Displays the location of the project selected in the C/C++ Projects view - and in any referenced projects.
            -
            Additional Source Locations
            -
            Lists projects and directories added to the debugger search list.
            -
            Select All
            -
            Selects all items in the Generic Source Locations list.
            -
            Deselect All
            -
            Deselects all items in the Generic Source Locations list.
            -
            Add
            -
            Adds new projects and directories to the debugger search list.
            -
            Up
            -
            Moves selected items up the Additional Source Locations list.
            -
            Down
            -
            Moves selected items down the Additional Source Locations list.
            -
            Remove
            -
            Removes selected items from the Additional Source Locations list.
            -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Running and debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_search.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_search.htm deleted file mode 100644 index 82c5dc32c40..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_search.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - -C/C++ search page, Search dialog box - - - - - -

            C/C++ search page, Search dialog box

            - -

            The C/C++ search page of the Search dialog box lets you search for C/C++ -elements.

            - -
            -
            Search string
            -
            Specifies a search string.
            -
            Class/Struct
            -
            Includes classes and structs in your search.
            -
            Function
            -
            Searches for global functions or functions in a namespace - (functions that are not members of a class, struct, or union).
            -
            Variable
            -
            Searches for variables that are not members of a class, - struct or union.
            -
            Union
            -
            Searches for unions.
            -
            Method
            -
            Searches for methods that are members of a class, struct, or - union.
            -
            Field
            -
            Searches for fields that are members of a class, struct, or - union.
            -
            Enumeration
            -
            Searches for enumerations.
            -
            Namespace
            -
            Searches for namespaces.
            -
            Any Element
            -
            Includes all elements in the search.
            -
            Declarations
            -
            Limits the search to declarations.
            -
            Definitions
            -
            Limits the search to definitions (for functions, methods, - variables and fields).
            -
            References
            -
            Limits the search to references.
            -
            All Occurrences
            -
            Includes declarations, definitions, and references in the - search.
            -
            Workspace
            -
            Searches the eclipse workspace.
            -
            Selected Resources
            -
            Includes selected resources in the search.
            -
            Working Set
            -
            Specifies a working set to search.
            -
            - -

            Related concepts
            -Coding aids
            -C/C++ search

            -

            Related tasks
            -Searching for C/C++ elements
            -Customizing the C/C++ editor

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view.htm deleted file mode 100644 index e13c37bd42a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - -Shared Libraries view - - - - - -

            Shared Libraries view

            - -

            The Shared Libraries view of the Debug perspective lets you view information about the shared libraries loaded in the current -debug session.

            - -
            -
            Load Symbols
            -
            Loads the symbols of the selected library. This option does not affect the - libraries with loaded symbols.
            -
            Load Symbols For All
            -
            Loads the symbols of the libraries used in the current session.
            -
            Auto-Refresh
            -
            Updates the shared library information each time execution stops.
            -
            Refresh
            -
            Updates the shared library information as required.
            -
            Show Full Paths
            -
            Displays the full path of libraries.
            -
            - -

            Related concepts -
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view_pref.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view_pref.htm deleted file mode 100644 index 6aa54d49f8d..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_shared_lib_view_pref.htm +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - -Shared Libraries view preferences - - - - - -

            Shared Libraries view preferences

            - -IBM Copyright Statement - -

            - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_signals_view.htm b/doc/org.eclipse.cdt.doc.user/reference/cdt_u_signals_view.htm deleted file mode 100644 index 84e239e4436..00000000000 --- a/doc/org.eclipse.cdt.doc.user/reference/cdt_u_signals_view.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - -Signals view - - - - - -

            Signals view

            - -

            The Signals view of the Debug perspective lets you view the signals defined on the selected debug target and how the -debugger handles each one.

            -
            -
            Name
            -
            Displays the name of the signal.
            -
            Pass
            -
            Where "yes" is displayed, the debugger lets your program see the - signal. Your program can handle the signal, or else it may terminate if the - signal is fatal and not handled.
            -
            Suspend
            -
            Where "yes" is displayed, the debugger suspends your program when this - signal is handled.
            -
            Description
            -
            Displays a description of the signal.
            -
            - -

            Related concepts -
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_brkpnts_watch.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_brkpnts_watch.htm deleted file mode 100644 index b25c961525b..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_brkpnts_watch.htm +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - -Working with breakpoints and watchpoints - - - - - -

            Working with breakpoints and watchpoints

            - -

            This section explains how to work with breakpoints and watchpoints.

            - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Add breakpointsAdding - breakpoints
            Add watchpointsAdding - watchpoints
            Remove breakpoints and watchpointsRemoving - breakpoints and watchpoints
            Enable or disable breakpoints and watchpointsDisabling and - enabling breakpoints and watchpoints
            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_build_task.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_build_task.htm deleted file mode 100644 index a08dade0218..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_build_task.htm +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - -Building projects - - - - - -

            Building projects

            -

            This sections explains how to build your project and manage compile -errors.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Rename a projectRenaming a - project
            Select referenced projectsSelecting - referenced projects
            Configure how the CDT handles make errors, - change the default build command and specify a make targetDefining build - settings
            Control which build errors are displayedFiltering - errors
            Select a binary parserSelecting a - binary parser
            Include paths and symbolsIncluding paths - and symbols
            For Managed Make projects, select a deployment platform for managed - make projectsSelecting a - deployment platform
            Set build orderSetting a - build order
            Build your project as requiredBuilding - manually
            Save modified resources before you buildAutosaving on a - manual build
            Add a make targetCreating a make - target
            Customize the C-Build viewCustomizing the - C-Build view
            View and manage compile errorsViewing and - managing compile errors
            - -

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_con_assist.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_con_assist.htm deleted file mode 100644 index 023fae8b21a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_con_assist.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -Working with Content Assist - - - - - -

            Working with Content Assist

            -

            This section provides information on code entry aids.

            - - - - - - - - - - - - - - - - - -
            To learn aboutSee
            Inserting code elements and code templates into - your codeUsing Content - Assist
            Creating and editing code templatesCreating and - editing code templates
            Importing and exporting code templatesImporting and - exporting code templates
            - -

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_debug.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_debug.htm deleted file mode 100644 index ebf4dd8bb7f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_debug.htm +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - -Debugging - - - - - -

            Debugging

            - -

            This section explains how to debug your project.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Start a debug sessionDebugging a - program
            Add, remove, enable or disable breakpoints and - watchpointsWorking with - breakpoints and watchpoints
            Control your debug executionControlling - your debug execution
            Work in disassembly modeStepping into - assembler functions
            View or change a variableWorking with - variables
            Add and expressionAdding - expressions
            Change registers or how they are displayedWorking with - registers
            Change memory or how it is displayedWorking with memory
            - -

             

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm deleted file mode 100644 index da78ab1fb34..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_files.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -Working with C/C++ project files - - - - - -

            Working with C/C++ project files

            This section explains how to create and manage project files.

            - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Display file members in the C/C++ Projects viewDisplaying - C/C++ file components in the C/C++ Projects view
            Assign a C or C++ nature to a projectAssigning a C or - C++ nature to a project
            Create a cpp fileCreating a C++ - file
            Create a makefileCreating a - makefile
            Hide files of a given typeHiding - files by type in the C/C++ Projects view
            - - 

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_prop.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_prop.htm deleted file mode 100644 index cd29cf0829e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_proj_prop.htm +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - -Defining project properties - - - - - -

            Defining project properties

            -

            This section explains how to define project properties.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            To learn aboutSee
            Renaming a projectRenaming a - project
            Selecting referenced projectsSelecting - referenced projects
            Configuring how the CDT handles make errors, - changing the default build command and specifying a make targetDefining build - settings
            Control which build errors are displayedFiltering - errors
            Selecting a binary parserSelecting a - binary parser
            Including paths and symbolsIncluding paths - and symbols
            Selecting a deployment platform for managed - make projectsSelecting a - deployment platform
            - -

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm deleted file mode 100644 index 09bb464f4b6..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -Running and debugging projects - - - - - -

            Running and debugging projects

            -

            This section explains how to run a C or C++ application using an -existing run configuration and how to create a new run configuration.

            - - - - - - - - - - - - - - - - - -
            ToSee
            Specify a project and application to runCreating or - editing a run/debug configuration
            Create a run or debug configurationSelecting a run - or debug - configuration
            Debug an applicationDebugging
            - -

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run_config.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run_config.htm deleted file mode 100644 index 0ca6dc387db..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_run_config.htm +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - -Creating or editing a run/debug configuration - - - - - -

            Creating or editing a run/debug configuration

            -

            You can run an application by right-clicking the file and clicking Open -With > System Editor or you can create a run configure a run environment with -which to run your application.

            -

            This section explains how to create a run or debug configuration.

            -

            The Run and Debug dialog boxes each contain the following tabs:

            -
              -
            • Main
            • -
            • Arguments
            • -
            • Environment
            • -
            • Debugger
            • -
            • Source
            • -
            • Common
            • -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Select a run or debug configurationSelecting a run - or debug - configuration
            Create a run or debug configurationCreating a - run or debug configuration
            Specify a project and application to run or - debugSelecting an - application to run
            Specify the execution arguments an application - uses and the working directory for a run or debug configurationSpecifying - execution arguments
            Set the environment variables and values to use - when running or debugging applicationSetting environment - variables
            Select a debugger to use when debugging an - applicationDefining debug - settings
            Specify the location of source files used when - debugging a C or C++ applicationSpecifying the - location of source files
            Specify where the run configuration is stored, - how you access it, and what perspective to open when running an applicationSpecifying the - location of the run configuration
            - - 

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm deleted file mode 100644 index 491d68a073a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasks.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -Tasks - - - - - -

            Tasks

            Task topics provide step-by-step procedural instructions to help you -perform required tasks.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Update your installation of the CDTUpdating the CDT
            Create projectsCreating a project
            Work with C or C++ project filesWorking with - C/C++ project files
            Write codeWriting code
            Build your C or C++ projectsBuilding - projects
            Run/debug your C or C++ projectsRunning and debugging
            -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasksview.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasksview.htm deleted file mode 100644 index b0e74f5f65a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tasksview.htm +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - -Viewing and managing compile errors - - - - - -

            Viewing and managing compile errors

            - -

            This section describes how to view and manage compile errors. Compile errors -are displayed in the Tasks view.

            - - - - - - - - - - - - - - - - - - -
            ToSee
            Jump to errorsJumping to errors
            Filter errorsFiltering the - Tasks view
            Set remindersSetting reminders
            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tutorial.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tutorial.htm deleted file mode 100644 index b02d8d70f1a..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_tutorial.htm +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - -Tutorial - - - - - -

            Tutorial

            This tutorial guides you through the basic steps to get started -with the C/C++ Development Toolkit (CDT) by creating a HelloWorld -project on Windows.

            -

            Before you begin

            -

            You need to install and configure the following utilities:

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Create, name, and specify the location of your - projectCreating your - project
            Create, name, and save your .cpp fileCreating your C++ - file
            Create, name, and save your gnu makefileCreating your makefile
            Build your projectBuilding your project
            Create a debug configuration and debug - your projectDebugging your - project
            - - 

            -IBM Copyright Statement

            - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_write_code.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_write_code.htm deleted file mode 100644 index 33fbf49175e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_o_write_code.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -Writing code - - - - - -

            Writing code

            This sections explains how to work with the C/C++ editor.

            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ToSee
            Customize the C/C editorCustomizing - the C/C++ editor
            Comment out codeCommenting out - code
            Use Content AssistWorking with - Content Assist
            Shift lines of code to the left or rightShifting lines - of code to the left or right
            Search for C/++ elementsSearching for C/C++ - elements
            Navigate to C/C++ declarations by nameNavigating - to C/C++ declarations
            - - 

            - -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_brkpnts.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_brkpnts.htm deleted file mode 100644 index 3e3adc538ec..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_brkpnts.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - -Adding breakpoints - - - - - -

            Adding breakpoints

            - -

            A breakpoint is set on an executable line of a program. If the breakpoint is -enabled when you debug, the execution suspends before that line of code -executes.

            - -

            To add a breakpoint:

            - -
              -
            1. Point to the marker bar located in the left margin of the C/C++ Editor beside the line of code - where you want to add a breakpoint.
            2. -
            3. Right-click the marker bar, and select - Add Breakpoint.
            4. -

              A dot Icon: Breakpoint object is - displayed in the marker bar and - in the Breakpoints view, along with the name of the associated file.

              -
            -

            For more information on marker bar icons, see Workbench User Guide > -Reference > User interface information > Icons and buttons > Editor area -marker bar.

            -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Working with breakpoints and watchpoints

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_codetemp.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_codetemp.htm deleted file mode 100644 index f3d47e4a127..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_codetemp.htm +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - -Creating and editing code templates - - - - - -

            Creating and editing code templates

            - -

            Code templates are stored in templates.xml in the org.eclipse.cdt.ui and -org.eclipse.jdt.ui folders.

            - -

            To create a code template:

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, and click Code Templates.
            4. -
            5. Click New.
            6. -
            7. Do the following:

              -
                -
              • In the Name field, enter a template name.
              • -
              • Click the Context button and select a template type: C or C++.
              • -
              • In the Description field, enter a description for your new - code template.
              • -
              • In the Pattern field, enter the code for your template.
              • -
              • Click Insert Variable to add a variable from the list to the - code you have entered in the Pattern box.
              • -
              -
            8. -
            9. Click OK.
              - The new code template is now displayed in the list.
            10. -
            - -

            To edit a code template:

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, and click Code Templates.
            4. -
            5. Click Edit. The New Template dialog box opens.
            6. -
            7. Do the following:

              -
                -
              • In the Name field, change the template name to create a new - template based on the current template.
              • -
              • Click the Context button and select a template type to change the nature of the template.
              • -
              • In the Description field, change the description of the code - template to reflect your changes.
              • -
              • In the Pattern field, edit the code.
              • -
              • Click Insert Variable to add a variable from the list to the - code you have edited in the Pattern box.
              • -
              -
            8. -
            9. Click OK.
            10. -
            - -

            Related concepts -
            -Content Assist

            -

            Related tasks -
            -Using Content Assist
            -Importing and exporting code templates

            -

            Related reference
            -Code Templates page, Preferences window
            -Code Templates page

            -

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_watch.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_watch.htm deleted file mode 100644 index daede2ecf53..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_add_watch.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -Adding watchpoints - - - - - -

            Adding watchpoints

            - -

            A watchpoint is a special breakpoint that stops the execution of an -application whenever the value of a given expression changes, without specifying -where this may happen. Unlike breakpoints which are line-specific watchpoints -are associated with files. They take effect whenever a specified condition is -true regardless of when or where it occurred.

            - -

            To add a watchpoint:

            - -
              -
            1. Click Run > Add C/C++ Watchpoint.
            2. -
                -
              1. If Add C/C++ Watchpoint is not listed on the Run menu, select Window - > Customize Perspective.
              2. In the Customize Perspective dialog - box, expand Other in the Available Items list.
              3. Select the C/C++ Debug check box. Click OK.
              4. -
              -
            3. In the Add C/C++ Watchpoint dialog box, type an expression in the Expression to watch - box. The - expression may be anything that can be evaluated inside an if - statement.
            4. -
            5. Do any of the following:
            6. -
              • To stop execution when the watch expression is read, select the - Read check box.
              • -
              • To stop execution when the watch expression is written to, select the Write - check box.
              -
            7. In the C/C++ editor, open the file that you added the watchpoint to.
            8. -
            9. Click OK.
            10. -
            11. The watchpoint appears in the Breakpoints view - list.
            12. -
            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Working with breakpoints and watchpoints

            -

            Related reference -
            -Run and Debug dialog box

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm deleted file mode 100644 index f9385100d1f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - -Creating a make target - - - - - -

            Creating a make target

            - -

            A make target is an action called by the make utility to perform a customized -build-related task. For example, many makefiles support a target named clean, -which is called as make clean. You can call your own target (such as myMakeAction) to be called as make myMakeAction.

            - -

            You can also use a make target -to pass options such as CPULIST=x86, which causes the make utility to build only -for x86. These options work only if they are already defined in the makefile.

            - -

            If you have added your own make targets, you can configure the CDT to call them -specifically. For more information, see -Defining build settings.

            - -

            To create a customized make target:

            - -
              -
            1. In the C/C++ Projects view, right-click a project, and select Create Make - Target.
            2. -
            3. In the Target Name box, type the name of the make target.
            4. -
            5. In the Build Target box, type a build target.
            6. -
            7. Select one of the following:
            8. -
                -
              • Stop On Error to stop the build when an error is encountered.
              • -
              • Keep Going On Error to continue the build even if an error is - encountered.
              • -
              -
            9. Select one of the following:
            10. -
                -
              • Select the Use Default check box to use the default make command.
              • -
              • Clear the Use Default check box to use a different make utility to build your project and - enter your own command in the Build Command box.
              • -
              -
            11. Click OK.
            12. -

              The target option is added under the Build Make Target menu item on the C/C++ -Projects view context menu.

              -

              You can view the output of the make - utility in the C-Build view.

              -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining build settings
            -Building

            -

            Related reference
            -Make Builder page, C/C++ Properties window

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_autosave.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_autosave.htm deleted file mode 100644 index a4b028c2014..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_autosave.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -Autosaving on a manual build - - - - - -

            Autosaving on a manual build

            - -

            You can let the CDT save modified files whenever you perform a manual build. -The files are saved before the build is performed so that the latest -version of your files are built.  You can view the output of the make -utility in the C-Build view.

            - -

            To save resources before manual builds:

            -
              -
            1. Click Window > Preferences.
            2. -
            3. Select Workbench from the list.
            4. -
            5. On the Workbench page, select the Save all modified resources automatically - prior to manual build check box.
            6. Click OK.
            7. -

              The CDT will now save your resources when you build a project.

            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining build settings
            -Building

            -

            Related reference -
            -Make Builder page, C/C++ Properties window

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_build_process.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_build_process.htm deleted file mode 100644 index 34548ebec43..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_build_process.htm +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - -Building manually - - - - - -

            Building a CDT project

            - -

            Provide roadmap whereby a link is provided to each build setting-related -task.

            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining Build Settings
            -Building

            -

            Related reference -
            -Make Builder page, C/C++ Properties window

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cbuild_pref.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cbuild_pref.htm deleted file mode 100644 index d7cc86c8841..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cbuild_pref.htm +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -Customizing the C-Build view - - - - - -

            Customizing the C-Build view

            - -

            The C-Build view displays the output of the make utility.

            -

            To set C-Build view preferences

            -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, and click Build Console.
            4. -
            5. To display information on the latest build, select the Always clear C-Build view before building check box.
            6. -
            7. To open the C-Build view when a project is built, select the Open C-Build view when building check box.
            8. -
            9. To display the C-Build view if it is already open when a project is built, - select the Bring the C-Build view to top when building (if present).
            10. -
            11. Click OK.
            12. -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining Build Settings
            -Building

            -

            Related reference
            -Views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_comment_out.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_comment_out.htm deleted file mode 100644 index d14d256d3e9..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_comment_out.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Commenting out code - - - - - -

            Commenting out code

            - -

            You can comment out one or more lines of code. The leading characters // -are added to the beginning of each line.

            - -

            Tip: The characters /* */ on lines that already are -already commented out are not affected when you comment and uncomment code as -described above.

            - -

            To comment out code:

            - -
              -
            1. In the C/C++ editor, select the line(s) of code that you want to comment out.
            2. -
            3. Right-click and do one of the following:
            4. -
                -
              • To comment out the selected code, select Comment.
              • -
              • To remove the leading // characters from the selected - line(s) of code, select Uncomment.
              • -
              -
            - -

            Related concepts -
            - Code entry

            -

            Related tasks -
            -Customizing the C/C++ editor
            -Working with Content Assist

            -

            Related reference -
            -C/C++ editor, code templates and search -preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_contentassist.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_contentassist.htm deleted file mode 100644 index c9dbbe5c439..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_contentassist.htm +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - -Using Content Assist - - - - - -

            Using Content Assist

            - -

            Use Content Assist to insert C/C++ elements of your project or referenced project(s), -and code templates into your code. You can insert a code template into your source code rather than retyping -commonly-used snippets of code.

            - -

            To insert a code template or element:

            - -
              -
            1. In the C/C++ editor, type at least the first letter of a code template or - element.
            2. -
            3. Click Edit > Content Assist.
              - A list displays the code templates - followed by the elements, in - alphabetical order, that start with the letter combination - you typed.
            4. -
            5. Do one of the following: -
                -
              • Continue typing. The list shortens. When there is only one item in the - list, it is automatically inserted.
              • -
              • Double-click an item in the list to insert it into your code.
              • -
              • Press Esc to close the Content Assist Window.
              • -
              -
            6. -
            - -

            To set Content Assist preferences:

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, and clickC/C++ Editor.
            4. -
            5. Click the Content Assist tab.
            6. -
            7. Do the following: -
                -
              • To insert an element when you open Content Assist and it is the only - item - in the list, select the Insert single proposals automatically check - box.
              • -
              • To automatically open Content Assist when you type the first letter of an - element for which there is a match, select the Enable auto activation. -
              • -
              • To turn on Content Assist after a given number of seconds, type a value - in the Auto activation delay box.
              • -
              • To specify a character that, if typed in the C/C++ editor, causes code - assist to be invoked immediately  before the delay times out, type a - trigger in the Auto activation triggers for C: box.
              • -
              • To change the background color of the Content Assist dialog box, click - the color palette button.
              • -
              -
            8. -
            9. Click OK.
            10. -
            -

            Related concepts -
            -Content Assist

            -

            Related tasks -
            -Creating and editing code templates
            -Importing and exporting code templates

            -

            Related reference -
            -Content Assist page, Preferences window
            -Code Templates page

            -

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_controldebug.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_controldebug.htm deleted file mode 100644 index 48ed2dbc971..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_controldebug.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Controlling debug execution in the Debug view - - - - - -

            Controlling debug execution

            - -

            The debug execution controls are superceded by breakpoints. For example, if -you attempt to step over a function and the program hits a breakpoint, -it pauses, regardless of whether the function is completed. You can control your debug execution in various ways, but they all rely on a -core set of debug controls.

            - -

            To control a debug execution:

            - -
              -
            1. In the Debug view, select a thread.
            2. -
            3. To complete the debug session, click:
            4. -
              • Run > Resume
              • -
              • Run > Suspend
              • -
              • Run > Terminate
              • -
              • Run > Disconnect
              • -
              • Run > Remove All Terminated Launches
              • -
              • Run > Restart
              • -
              -
            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Debug launch controls
            -Debug view

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_conv_proj.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_conv_proj.htm deleted file mode 100644 index e19557bb29e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_conv_proj.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - -Assigning a C or C++ nature to a project - - - - - -

            Assigning a C or C++ nature to a project

            - -

            You can assign a C nature to a C++ file or vice versa.

            - -

            To assign a C or C++ nature to a project

            - -
              -
            1. Click File > New > Other.
            2. -
            3. Click C or C++.
            4. -
            5. Click Convert to Make Project.
            6. -
            7. Click Next.
            8. -
            9. In the Candidates for conversion list, select the projects to convert.
            10. -
            11. In the Convert to C or C++ box, click C Project or C++ Project.
            12. -
            13. Click Finish
            14. -
            -

            Related concepts -
            - CDT Projects
            - Project file views -

            -

            Related tasks -
            -Defining project properties
            -Writing code

            -

            Related reference -
            -Project properties

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cust_cpp_editor.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cust_cpp_editor.htm deleted file mode 100644 index 6408634516b..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_cust_cpp_editor.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - -Customizing the C/C++ editor - - - - - -

            Customizing the C/C++ editor

            - -

            You can customize the appearance of the C++ editor by specifying how -information is displayed.

            - -

            To customize the C/C++ editor preferences:

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, click C/C++ Editor.
            4. -
            5. Click - the General tab.
            6. -
            7. Set your preferences and click Apply.
            8. -
            9. To control the information that is displayed in the margins of the C/C++ - editor, click the Annotations tab.
            10. -
            11. To customize the color of the text on the editable area of the C/C++ - editor, click the Colors tab.
            12. -
            13. Set your preferences and click Apply.
            14. -
            15. To customize how Code Assist works, click the Code Assist tab. For - more information, see -

              Using Content Assist

            16. -
            17. Click OK.
            18. -
            - -

            Related concepts
            -Coding aids

            -

            Related tasks -
            -Customizing the C/C++ editor

            -

            Related reference -
            -C/C++ editor preferences

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_debug_prog.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_debug_prog.htm deleted file mode 100644 index efc688624bc..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_debug_prog.htm +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - -Debugging a program - - - - - -

            Debugging a program

            - -

            You must create a debug launch configuration the first time you debug your -program.

            - -

            To create a debug configuration:

            - -
              -
            1. In C/C++ Projects view, select a project. -
            2. -
            3. Click Run > Debug.
            4. -
            5. In the Debug dialog box, select a debug configuration type from the Configurations - list.
            6. -
            7. Click New.

            8. -
            9. In the Name box, type a descriptive name for this debug configuration.
            10. -
            11. In the Project box, type the name of the project containing - the application you want to debug.
            12. -
            13. In the C/C++ Application box, type the name of the executable - that you want to run.
            14. -
            15. Click the Debugger tab.
            16. -
            17. Select Run program in debugger.
            18. -
            19. Select the Stop at main() on startup checkbox.
            20. -
            21. Click Debug.
            22. -

              The debug perspective is opened and the application window opens on - top. The C/C++ editor window is repositioned in the perspective.

              -
            - -

            For more information:

            - - -

            To use a debug configuration:

            - -

            You can reuse a previously created debug launch configuration to debug your -program.

            - -
              -
            1. Click Run > Debug.
            2. -
            3. In the Debug dialog box, select a debug configuration from the Configurations - list.
            4. -
            5. Click Debug.
            6. -
            - -

            Related concepts -
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_disassembly.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_disassembly.htm deleted file mode 100644 index 9ded6625d68..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_disassembly.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - -Stepping into assembler functions - - - - - -

            Stepping into assembler functions

            - -

            Disassembly mode lets you can examine your program as it steps into -functions that you do not have source code for [such as printf()]. When the -instruction pointer enters a function for which it does not have the source, the -function is displayed in the Assembly editor.

            - -

            When disassembly mode is disabled, the -debugger steps over functions for which you do not have the source.

            - -

            To step into assembler functions during debugging:

            - -
              -
            • In the Debug view, right-click, and select Disassembly Mode.
            • -

              As you step Into assembler functions, the execution trace is displayed in - the Assembly Editor.

              -
            -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Debug views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_endis_able_brk_wtch.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_endis_able_brk_wtch.htm deleted file mode 100644 index 657e5416efe..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_endis_able_brk_wtch.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - -Enabling and disabling breakpoints and watchpoints - - - - - -

            Enabling and disabling breakpoints and watchpoints

            - -

            You can temporarily disable a breakpoint or watchpoint without losing the -information it contains.

            - -

            To enable or disable breakpoints or watchpoints:

            -
              -
            1. In the Breakpoints view, do one of the following: -
                -
              • Select the breakpoints and watchpoints that you want to remove.
              • -
              • Click Edit > Select All.
              • -
              • Right-click, and select Select All.
              • -
              -
            2. -
            3. In the Breakpoints view, right-click the highlighted breakpoints and watchpoints and - click - Disable or Enable.
            4. -
            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Working with breakpoints and watchpoints

            -

            Related reference -
            -Run and Debug dialog box

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_expressions.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_expressions.htm deleted file mode 100644 index d0878ffaf25..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_expressions.htm +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - -Adding expressions - - - - - -

            Adding expressions

            - -

            You can add and view expressions in the Expressions view. The Expressions -view is part of the Debug perspective.

            - -

            To add an expression:

            - -
              -
            1. Click Run > Add Expression.
            2. -
            3. Type the expression that you want to evaluate. For example, (x-5)*3 ).
            4. -
            5. Click OK.

              The expression and its value appear in the - Expressions view. When the execution of a program is suspended, all expressions - are reevaluated and changed values are highlighted.

            6. -
            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Debug views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_filtererror.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_filtererror.htm deleted file mode 100644 index 4b806426182..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_filtererror.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - -Filtering the Tasks view - - - - - -

            Filtering the Tasks view

            - -

            Depending on the complexity and stage of your program, -an overwhelming number of errors can be generated. You can customize Tasks view to only view certain types of errors.

            - -

            To filter errors:

            - -
              -
            1. In Tasks view, click the Filters icon - .
            2. -
            3. To view all errors and warnings, select all checkboxes in the Show items of type - list, and click On any resource.
            4. -
            5. Click OK.
            6. -
            - -

            For more information on the Tasks view, see:

              -
            • Workbench User Guide > Concepts> Views > Tasks view
            • -
            • Workbench User Guide > Tasks > Bookmarks, tasks and other - markers > - Filtering the Tasks view
            • -
            • Workbench User Guide > Reference > User interface information > - Views and editors > Tasks view
            • -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining Build Settings
            -Jumping to errors
            -Setting reminders

            -

            Related reference -
            -Run and Debug dialog box

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_imp_code_temp.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_imp_code_temp.htm deleted file mode 100644 index b821de07308..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_imp_code_temp.htm +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - -Importing and exporting code templates - - - - - - -

            Importing and exporting code templates

            - -

            You can import and export code templates.

            - -

            Note: A code template must be an .xml file formatted as follows:

            - -
            <?xml version="1.0" encoding="UTF-8" ?> 
            -<templates>
            -<template name="author" description="author name" context="C" enabled="true">author ${user}</template> 
            -</templates>
            - -

            To import a code template

            -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, and click Code Templates. -
            4. -
            5. Click Import.
            6. -
            7. Select the template file that you want to import.
            8. -
            9. Click OK.
              - The code template list is updated to include the template that you imported.
            10. -
            -

            To export a code template

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand C/C++, and click Code Templates.
            4. -
            5. Select the templates that you want to export. The Exporting x dialog opens - where x is the number of code templates that you are exporting.
            6. -
            7. In File name box, type the path  where you want your code templates - file to be saved.
            8. -
            9. Click Save.
              - The templates.xml file containing the code templates you exported is saved - in your file system.
            10. -
            - -

            Related concepts -
            -Content Assist

            -

            Related tasks -
            -Using Content Assist
            -Creating and editing code templates

            -

            Related reference -
            -Code Templates page, Preferences window
            -Code Templates page

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_jumperror.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_jumperror.htm deleted file mode 100644 index dc4b6c27ebf..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_jumperror.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - -Jumping to errors - - - - - -

            Jumping to errors

            - -

            The CDT will parse the output from the make and compiler/linker. If the CDT can -determine the location of an error, it is added to the Tasks view.

            - -

            To jump to the source of an error:

            - -
              -
            • In the Tasks view, double-click the Error iconor - the Warning icon.

              -

              The file opens in the C/C++ editor and the cursor moves to the line with the error.

              -
            • -
            - -

            To jump to errors sequentially:

            - -
              -
            • Click Jump to next or Jump to previous.
            • -
            - -

            For more information on the Tasks view, see:

              -
            • Workbench User Guide > Concepts> Views > Tasks view
            • -
            • Workbench User Guide > Reference > User interface information > - Views and editors > Tasks view
            • -
            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining Build Settings
            -Filtering the Tasks view
            -Setting reminders

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_manualbuild.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_manualbuild.htm deleted file mode 100644 index 45b632b0be0..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_manualbuild.htm +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - -Building manually - - - - - -

            Building manually

            - -

            Manual builds let you choose the scope of a build, whether to build, -or rebuild projects. You can view the output of the make utility in the -C-Build view.

            - -

            To rebuild all open projects:

            - -

            You can manually rebuild all open projects. Depending -on the number of projects, the size of the projects, and the number of target -architectures, this action can take a significant amount of time.

            - -
              -
            • Click Project > Build Project.
            • -
            - -

            To rebuild a single project:

            - -

            Because rebuilding all open projects may be time-consuming, you may -want to build only certain projects.

            - -
              -
            • In C/C++ Projects view, right-click a project, and click Rebuild Project.
            • -
            - -

            Tip: If you get the error message:

            - -

            Exec error:Launching failed

            - -

            The error message means -that the CDT cannot locate the build command, (usually make). Either your path is -not configured correctly or you do not have make installed on your system.

            - -

            Related concepts -
            -Build overview

            -

            Related tasks -
            -Defining Build Settings
            -Building

            -

            Related reference -
            -Make Builder page, C/C++ Properties window

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_memory.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_memory.htm deleted file mode 100644 index 494e5213cea..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_memory.htm +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - -Working with memory - - - - - -

            Working with memory

            - -

            You can inspect and change process memory.

            - -

            The Memory view supports the same addressing as the C language. You -can address memory using expressions such as:

            -
              -
            • 0x0847d3c
            • -
            • (&y)+1024
            • -
            • *ptr
            • -
            -

            You can configure your output to display hexadecimal or decimal. You can also -set the number of display columns and the memory unit size. You can configure -each memory tab independently.

            -

            You can customize the Memory view to colors and fonts displayed. You can also customize some of its behavior. The customizations affect -the entire Memory view.

            -

            To change process memory:

            -

            Warning: Changing process memory can cause a program to crash.

            -
              -
            1. In the Debug view, select a process. Selecting a thread - automatically selects the associated process.
            2. -
            3. In the Memory view, click a memory tab.
            4. -
            5. Do one of the following:
            6. -
              • In the Address box, type an address and press Enter.
              • -
              • In the memory view, type a new value for memory. The Memory - view works in "typeover" mode. To jump from byte to byte use the arrow keys:

                 

              -
            -

            To change the appearance of the Memory view:

            -
              -
            1. Do one of the following:
            2. -
              • In the Memory view, click one of the tabs.
              • -
              • Click Window > Preferences.
              -
            3. In list of memory addresses, right-click, and select:
            4. -
              • Format > Hexadecimal, Signed Decimal or Unsigned Decimal.
              • -
              • Memory Unit Size > 1, 2, 4, or 8 bytes
              • -
              • Number of Columns > 1, 2, 4, 8, or 16 columns.
              -
            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Debug views

            -IBM Copyright Statement - - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_cpp.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_cpp.htm deleted file mode 100644 index 1e3393b7c32..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_cpp.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - -Creating a C/C++ file - - - - - -

            Creating a C/C++ file

            - -

            Files are edited in the C/C++ editor, that is by default, located in the -editor area to the right of the C/C++ Projects view.

            - -

            The marker bar on the left margin of the C/C++ editor, displays icons for -errors, warnings, bookmarks, breakpoints and tasks.

            - -

            For more information on the marker bar, see Workbench User Guide > Reference > User interface -information > Views and editors > Editor area.

            - -

            To create a C++ file:

            -
              -
            1. In the C++ Projects view, right-click a project, - and select New > File.
            2. -
            3. In the list of projects, verify that the correct project is selected.
            4. -
            5. In the File name box, type a name followed by the appropriate - extension.
            6. -
            7. Click Finish.
            8. -

              The C/C++ editor opens.

              -
            9. Type your makefile instructions in the C/C++ editor.
            10. -
            11. Click File > - Save.
            12. -
            -

            Related concepts -
            -CDT Projects
            -Project file views -

            -

            Related tasks -
            -Displaying C/C++ file components in the -C/C++ Projects view
            -Hiding files by type in the C/C++ Projects -view

            -

            Related reference -
            -Project properties

            - -

            -IBM Copyright Statement \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_make.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_make.htm deleted file mode 100644 index 10b5a26b8b2..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_make.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - -Creating a makefile - - - - - -

            Creating a makefile

            - -

            If you have created a Standard Make C/C++ Project, you need to provide a makefile.

            - -

            When you build a project, output from make is displayed in the C-Build view. Makefile actions are displayed in the Make Targets -view.

            -

            To create a makefile:

            -
              -
            1. In the C++ Projects view, right-click a project, and select New > File.
            2. -
            3. In the File name box, type makefile.
            4. -
            5. In the list of projects, verify that the correct project is selected.
            6. -
            7. Click Finish.
            8. -

              The C/C++ editor opens.

              -
            9. Type makefile instructions in the C/C++ editor.
            10. -
            11. Click File > - Save.
            -

            Related concepts -
            -Projects
            -Working with C/C++ project files -

            -

            Related tasks -
            -Displaying C/C++ file components in the -C/C++ Projects view
            -Hiding files by type in the C/C++ Projects -view

            -

            Related reference -
            -Views

            -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_run_config.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_run_config.htm deleted file mode 100644 index 9b587e36aba..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_new_run_config.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -Creating a run or debug configuration - - - - - -

            Creating a run or debug configuration

            - -

            You can create customized run configuration that is saved for reuse.

            - -

            To create a run configuration:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. -
            7. Click New. The name of the new project is displayed in the - Configurations box. The default name is the name of the project.
            8. -
            9. To change the default name of the new run/debug configuration, see - Selecting an application to run or debug.
            10. -
            - -

            Related concepts -
            -CDT Projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_open_declarations.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_open_declarations.htm deleted file mode 100644 index a9ed4e12282..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_open_declarations.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - -Navigating to C/C++ declarations - - - - - -

            Navigating to C/C++ declarations

            - -

            The Open Declarations feature lets you navigate to declarations that match a -selected declaration in the C/C++ editor. It is recommended that you look for -element declarations on successfully compiled programs.

            - -

            To navigate to C/C++ declarations:

            - -
              -
            1. In the C/C++ editor, select a declaration.
            2. -
            3. Right-click the selected declaration, select Open Declarations.
            4. -
            - -

            For more information, see:

              -
            • Workbench User Guide > Tasks> Navigating and finding resources
            • -
            - -

            Related concepts -
            -Open Declarations
            -CDT Projects
            -C/C++ search

            -

            Related tasks -
            -Searching for C/C++ elements

            -

            Related reference -
            -C/C++ search page, Search dialog box

            - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_build_set.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_build_set.htm deleted file mode 100644 index d17aaf7ff46..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_build_set.htm +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - -Defining build settings - - - - - -

            Defining build settings

            - -

            The Make Builder page lets you:

            - -
              -
            • Configure how the CDT handles make -errors.
            • -
            • Change the default build command.
            • -
            • Map the target passed to make when you select build or rebuild.
            • -
            - -

            You can define the properties on a per project basis in the New Project -wizard, in the C/C++ Projects view or in the Navigator view. You can also define -project properties in the Preferences window for future make projects.

            - -

            Before you begin

            - -

            In order to be able to turn on or to turn off the feature that automatically performs -an incremental build of your project every time a resource is saved for -individual projects, you need to enable the Workbench preference. You can then -disable this feature or change the associated make target for individual -projects.

            - -

            To enable build on resource save:

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. To automatically perform an incremental build of your project every time a - resource is saved, select Workbench from the list.
            4. -
            5. Select the Perform build automatically on - resource modification check box.
            6. -

              You can now enable or disable this feature on a per project basis.

              -
            - -

            To define build settings:

            - -
              -
            1. Do one of the following:
            2. -
                -
              • Click Window > Preferences. Expand C/C++, click - New Make Projects.
              • -
              • In the C/C++ Projects view, right-click a project, and select Properties. - Select C/C++ Make Project from the list.
              -
            3. Click the Make Builder tab.
            4. -
            5. Do one of the following:
            6. -
                -
              • To stop the build when an error is encountered, select Stop on error.
              • -
              • To continue the build even if an error is encountered, select Keep going on error.
              • -
              -
            7. Select one of the following build command settings:
            8. -
                -
              • To use the default make command, select the Use Default check box.
              • -
              • To use a build utility other than the default make command Build Command - box, clear the Use Default check box .
              • -
              -
            9. In the Workbench Build Behavior box, do the following:
            10. -
              • To build your project when resources are saved and change the default - make build target, select - the Build on resource save (Auto Build) check box. Enter a new build target in the Make build - target box.
              • -
              • To change the build default make build target, select the Build - (Incremental Build) check box. Enter a new build target in the Make - build target box.
              • To change the rebuild default make build target, - select the Rebuild (Full Build) check box. Enter a new build target - in the Make build target box.
              • -
              -
            11. Click the Finish.
            12. -
            -

            Related concepts -
            - CDT Projects
            - Project file views

            -

            Related tasks -
            -Defining project properties
            -Working with C/C++ project files

            -

            Related reference -
            -Make Builder page, C/C++ Properties window

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_error_parser.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_error_parser.htm deleted file mode 100644 index 3a73d707eeb..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_error_parser.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -Filtering errors - - - - - -

            Filtering errors

            - -

            The Error Parsers page of the Properties window lists a set of filters that detect error patterns in -the build output log.

            - -

            If an error or warning is detected, an icon appears on the file in the Tasks -view. If the file is not found, the icon appears on the project.

            - -

            You can define the properties on a per project basis in the New Project -wizard, in the C/C++ Projects view or in the Navigator view. You can also define -project properties in the Preferences window for future standard make projects.

            - -

            To select error parsers:

            - -
              -
            1. Do one of the following:
            2. -
                -
              • To set properties for future Standard Make projects, click Window > Preferences - . Expand - C/C++, and click New Make Projects.
              • -
              • In the C/C++ Projects view, right-click a project, and select Properties. - Select C/C++ Make Project from the list.
              -
            3. Click the Error Parsers tab.
            4. -
            5. In the Error parsers list, select error parsers.
            6. -
            7. Click OK.
            8. -
            -

            Related concepts -
            - CDT Projects
            - Project file views

            -

            Related tasks -
            -Defining project properties

            -

            Related reference -
            -Error Parsers, C/C++ Properties window

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_new.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_new.htm deleted file mode 100644 index 7ed636fa797..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_new.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -Creating a project - - - - - -

            Creating a project

            - -

            You can create a standard make or managed make C or C++ project.

            - -

            To create a project:

            - -
              -
            1. Click File > New > Project.
            2. -
            3. In the New Project wizard, click C or C++.
            4. -
            5. Click Standard Make C++ Project  or Managed Make C++ Project.
            6. -
            7. Click Next.
            8. -
            9. In the Name box, type a name.
            10. -
            11. To specify a different directory in which to save your project, clear the - Use Default Location check box, and enter the path in the Location - box.
            12. -
            13. For managed make projects, click Next to select a deployment - platform. For more information, see Selecting a - deployment platform.
            14. -
            15. To create your project, click Finish.
            16. If a message box prompts - you to switch perspectives, click Yes.
            17. Define your project - properties. For more information, see Defining - project properties.
            -

            Related concepts -
            - CDT Projects
            - Project file views

            -

            Related tasks
            -
            -Working with C/C++ project files

            -

            Related reference -
            -Project properties
            -Views

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_parser.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_parser.htm deleted file mode 100644 index b127a4e0e08..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_parser.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - -Selecting a binary parser - - - - - -

            Selecting a binary parser

            - -

            Selecting the correct parser is important to ensure the accuracy of the C/C++ -Projects view and the ability to successfully run and debug your programs. Windows users should select the -PE Windows Parser. Solaris, UNIX and Linux users should select the Elf Parser. When -you select the correct parser for your development environment and build your -project, you can view the components of the .o file in the C/C++ Projects view -and view the contents of the .o file in the C/C++ editor.

            - -

            You can define the properties on a per project basis from the New Project -wizard, in the C/C++ Projects view or in the Navigator view. You can also define -project properties in the Preferences window for future standard make projects.

            - -

            To select a binary parser:

            - -
              -
            1. Do one of the following:
            2. -
                -
              • To set properties for future Standard Make projects, click Window > - Preferences . Expand - C/C++, click New Make Projects.
              • -
              • In the C/C++ Projects view, right-click a project, and select Properties. - Select C/C++ Make Project from the list.
              -
            3. Click the Binary Parser tab.
            4. -
            5. In the Binary Parser list, click:
            6. -
              • Elf Parser, if you are a Solaris, UNIX, or Linux user.
              • -
              • PE Windows Parser, if you are a Windows user.
              -
            7. Click OK.
            8. -
            -

            Related concepts -
            - CDT Projects
            Project file views

            -

            Related tasks -
            -Working with C/C++ project files

            -

            Related reference -
            -Binary Parser, C/C++ Properties window

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm deleted file mode 100644 index a2fea483dfd..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - -Including paths and symbols - - - - - -

            Including paths and symbols

            - -

            You can define include paths and preprocessor symbols for the parser. This enables the parser to -understand the contents of the C/C++ source code so that you may more -effectively use the search and code completion features. Include paths are also -used by the builder to locate files that are not in the workspace.

            - -

            You can define the properties on a per project basis in the New Project -wizard, in the C/C++ Projects view or in the Navigator view. You can also define -project properties in the Preferences window for future standard make projects.

            - -

            To include paths and symbols:

            - -
              -
            1. Do one of the following:
            2. -
                -
              • To set properties for future Standard Make projects, click Window > - Preferences . Expand - C/C++, click New Make Projects.
              • -
              • In the C/C++ Projects view, right-click a project, and select Properties. - Select C/C++ Make Project from the list.
              -
            3.  Click the - Paths and - Symbols tab and do one the following:
            4. -
              • To the right of the Include paths box, click New, type the include path and - click OK.
              • -
              • To the right of the Defined symbols box, click New, type the symbol and - click OK.
              • -
              -
            5. Click OK.
            6. -
            -

            Related concepts -
            - CDT Projects
            Project file views

            -

            Related tasks -
            -Working with C/C++ project files

            -

            Related reference -
            -Paths and symbols page, C/C++ Properties -window

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_platf.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_platf.htm deleted file mode 100644 index 6f6bdb78f09..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_platf.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - -Selecting a deployment platform - - - - - -

            Selecting a deployment platform

            - -

            For managed make projects, you need to select the platform on which you plan -to deploy your program. You also need to select a release or debug configuration for your project.

            - -

            To select a deployment platform:

            - -
              -
            1. In the C/C++ Projects view, right-click a project, and select Properties.
            2. Select C/C++ - Build from the list.
            3. -
            4. To create a configuration with optimization flags enabled and debug - symbols disabled, in the Configurations list, select Release.
            5. -
            6. To create a configuration with optimization flags disabled and debug - symbols enabled, in the Configurations list, select Debug.
            7. -
            -

            Related concepts -
            - CDT Projects
            - Project file views -

            -

            Related tasks -
            -Working with C/C++ project files

            -

            Related reference -
            -Target platform, C/C++ Properties window

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_ref.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_ref.htm deleted file mode 100644 index 859b4d60a04..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_ref.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Selecting referenced projects - - - - - -

            Selecting referenced projects

            - -

            The Referenced C/C++ Projects list on the Projects References page for a -given project, displays every project in your workspace -in the build order you specify. For more information, -see Setting build order.

            - -

            Projects selected in the list are built before the current project according to their dependencies. -The least used projects are built first.

            - -

            To select referenced projects:

            - -
              -
            1. In the C/C++ Projects view, right-click a project, and select Properties.
            2. -
            3. On the left, select Project References from the list.
            4. -
            5. In the Project references... list, select referenced - projects.
            6. -
            7. Click OK.
            8. -
            -

            Related concepts -
            - CDT Projects
            - Project file views

            -

            Related tasks -
            -Defining project properties
            -Working with C/C++ project files

            -

            Related reference -
            -Project properties

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_rename.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_rename.htm deleted file mode 100644 index 8d8534b0ae7..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_rename.htm +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - -Renaming a project - - - - - -

            Renaming a project

            - -

            You can rename a project.

            - -

            To rename a project:

            - -
              -
            1. In the C/C++ Projects view, right-click a project, and select - Rename.
            2. -
            3. Type a new name.
            4. -
            5. Press Enter.
            6. -
            -

            Related concepts -
            - CDT Projects
            - Project file views

            -

            Related tasks -
            -Working with C/C++ project files

            -

            Related reference -
            -Project properties

            - - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_prvw_hide_files.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_prvw_hide_files.htm deleted file mode 100644 index 4b29f19167d..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_prvw_hide_files.htm +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -Hiding files by type in the C/C++ Projects view - - - - - -

            Hiding files by type in the C/C++ Projects view

            - -

            You can hide files by type that you do not need to see in the C/C++ Projects -view.

            -

            To hide files by type:

            -
              -
            1. In the C/C++ Projects view, click the Menu icon.
            2. -
            3. Click Filters.
            4. -
            5. Select the file types that you want to hide.
            6. -
            7. Click OK.
            8. -

              The C/C++ Projects view refreshes automatically.

            - -

            Related concepts -
            -CDT Projects
            -Project file views -

            -

            Related tasks -
            -Displaying C/C++ file components in the -C/C++ Projects view
            -Hiding files by type in the C/C++ Projects -view

            -

            Related reference -
            -Views

            -

            -IBM Copyright Statement - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_registers.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_registers.htm deleted file mode 100644 index 16a1d989219..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_registers.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -Working with registers - - - - - -

            Working with registers

            - -

            You can modify registers in the Registers view.

            - -

            To modify Registers:

            - -
              -
            1. In the Registers view, right-click a register and click Change Register Value.
            2. -
            3. Type a new value.
            4. -
            5. Press Enter.
            6. -

              The Register value is highlighted in red whether or not it was changed.

              -
            - -

            To change the number system displayed:

            - -

            You can change the number system used to display register values.

            - -
              -
            1. In the Registers view, right-click a register, and select Format.
            2. -
            3. Type a new value.
            4. -
            5. Do one of the following:
            6. -
              • Click Natural.
              • Click Decimal.
              • Click - Hexadecimal.
              -
            - -

            To modify Registers view preferences:

            - -
              -
            1. Click Window > Preferences.
            2. -
            3. Expand Debug, and click Registers View.
            4. -
            5. Make the required changes, and click OK.
            6. -
            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Debugging

            -

            Related reference -
            -Debug views

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rem_wtch_brk.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rem_wtch_brk.htm deleted file mode 100644 index b171c6374d9..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_rem_wtch_brk.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -Removing breakpoints and watchpoints - - - - - -

            Removing breakpoints and watchpoints

            - -

            When you remove a breakpoint or watchpoint, the corresponding icon is removed from the marker bar -where it was inserted and the Breakpoints view.

            - -

            To remove breakpoints or watchpoints:

            -
              -
            1. In the Breakpoints view, do one of the following: -
                -
              • Select the breakpoints and watchpoints you want to remove.
              • -
              • Click Edit > Select All.
              • -
              • Right-click, click Select All.
              • -
              -
            2. -
            3. In the Breakpoints view, right-click and select - Remove or Remove All.
            4. -
            - -

            For more information on marker bar icons, see Workbench User Guide > -Reference > User interface information > Icons and buttons > Editor area -marker bar.

            - -

            Related concepts -
            -C/C++ Development perspective
            -Projects

            -

            Related tasks -
            -Working with breakpoints and watchpoints

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_arg.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_arg.htm deleted file mode 100644 index 48438055770..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_arg.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -Specifying execution arguments - - - - - -

            Specifying execution arguments

            - -

            You can specify the execution arguments that an application uses and the working directory -for a run configuration.

            - -

            To specify execution arguments:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. -
            7. Select a run or debug configuration.
            8. -
            9. Click the Arguments tab.
            10. -
            11. In the C/C++ Program Arguments box, type the arguments that you - want to pass to the command line.
            12. -
            13. To specify a local directory or a different project in your workspace, - clear the Use default working directory check box.
            14. -
            15. Click Run or do the following, as required: -
            - -

            Related concepts -
            -CDT projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_com.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_com.htm deleted file mode 100644 index 176a1a02f95..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_com.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - -Specifying the location of the run configuration - - - - - -

            Specifying the location of the run configuration

            - -

            When you create a run configuration, it is saved with the extension .launch in org.eclipse.debug.core. -You can specify an alternate location in which to store your run configuration. You can -also specify how you access it and what -perspective to open when running an application.

            -

            To specify the location of a run configuration:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. - -
            7. Click the Common tab.
            8. -
            9. To save .launch to a project in your workspace, and to be able - to commit it to CVS, click Shared.
            10. -
            11. In the Folder Selection window, select a project, and click OK.
            12. -
            13. To specify which perspective opens when you run, select a perspective - from the Run mode list.
            14. -
            15. To specify which perspective opens when you run, select a perspective - from the Debug mode list.
            16. -
            17. Click Run, or do the following, as required: - -
            - -

            Related concepts -
            -CDT Projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_config.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_config.htm deleted file mode 100644 index 0630c5bd07d..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_config.htm +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - -Selecting a run or debug configuration - - - - - -

            Selecting a run or debug configuration

            - -

            You can select an existing run configuration to use to run your program.

            - -

            To select a run configuration:

            - -
              -
            1. Click Run > Run or Run > Debug.
            2. -
            3. Select a configuration from the Configurations list.
            4. -
            5. Click Run or Debug.
            6. -
            - -

            Related concepts -
            -CDT Projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_dbg.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_dbg.htm deleted file mode 100644 index dd9659e05cb..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_dbg.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -Defining debug settings - - - - - -

            Defining debug settings

            - -

            Select a debugger to use when debugging an application.

            - -

            To select a debugger:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. -
            7. Select a run or debug configuration.
            8. -
            9. Click the Debugger tab.
            10. -
            11. Specify debug options in the Debugger Options box.
            12. -
            13. Select a debugger from the Debugger list.
            14. -
            15. To be prompted to select a process from a list at run-time, select Attach to running process.
            16. -
            17. To let your program run until you interrupt it manually, or until it - hits a breakpoint, clear the Stop at main() on startup check box .
            18. -
            19. Click Run or do the following, as required: - -
            - -

            Related concepts -
            -CDT Projects
            -Project file views
            -Debug overview
            -Debug information

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_env.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_env.htm deleted file mode 100644 index 51d48305290..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_env.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - -Setting environment variables - - - - - -

            Setting environment variables

            - -

            You can set the environment variables and values to use when an application -runs.

            - -

            To set environment variables:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. -
            7. Select a run or debug configuration.
            8. -
            9. Click the Environment tab.
            10. -
            11. Do one of the following:
              • To create a new environment variable, - click New.
              • -
              • To edit an existing environment variable, select an item from the list and - click Edit.
              • -
              • To remove an existing environment variable, select an item from the list - and click Remove.
              -
            12. Type a name in the Name box.
            13. -
            14. Type a value in the Value box.
            15. -
            16. Click Run or do the following, as required: - -
            - -

            Related concepts -
            -CDT Projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_main.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_main.htm deleted file mode 100644 index ba6684225b5..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_main.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - -Selecting an application to run or debug - - - - - -

            Selecting an application to run or debug

            - -

            You need to specify the project or program that you want to run or debug for -this run configuration.

            - -

            To select an application to run:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. -
            7. Select a run or debug configuration.
            8. -
            9. Click the Main tab.
            10. -
            11. Do the following: -
              • In the Name box, type a descriptive name for this new a - descriptive name for this launch configuration.
              • -
              • In the Project box, type the name of the project containing - the application that you want to run.
              • -
              • In the C/C++ Application box, type the name of the executable - that you want to run.
              • -
            12. -
            13. Click Run or do the following, as required: -
            - -

            Related concepts -
            -CDT projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_source.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_source.htm deleted file mode 100644 index dc26ac7a4a2..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_run_source.htm +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - -Specifying the location of source files - - - - - -

            Specifying the location of source files

            - -

            You can specify the location of source files used when debugging a C or C++ -application. By default, this information is taken from the build path of your -project.

            - -

            To specify the location of source files:

            - -
              -
            1. In the C/C++ Projects view, select a project.
            2. -
            3. Click Run > Run or Run > Debug.
            4. -
            5. In the Configurations box, expand C/C++ Local.
            6. -
            7. Select a run or debug configuration.
            8. -
            9. Click the Source tab.

              The Generic Source Locations list shows - the location of the project selected in the C/C++ Projects view and any - referenced projects.

            -

            To add an existing source locations:

            -
            1. To add an existing project to the Additional Source Locations - list, click Add to be prompted to select a process from a list at - run-time.
            2. -
            3. In the Add Source Location dialog box, select a location type.
            4. -
            5. Click Next.
            6. -
            7. Do one of the following:
            8. -
              • Select an existing project in your workspace. Click Finish.
              • -
              • Specify a location in your file system. Click Finish.
              -
            9. Click Run or do the following, as required: - -
            - -

            Related concepts -
            -CDT Projects
            -Project file views

            -

            Related tasks -
            -Creating or editing a run configuration

            -

            Related reference -
            -Run and Debug dialog box

            -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm deleted file mode 100644 index 48d735d206f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_search.htm +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - -Searching for C/C++ elements - - - - - -

            Searching for C/C++ elements

            - -

            It is recommended that you perform searches on successfully compiled -programs to ensure the accuracy of search results. It is important to familiarize yourself with the correct search syntax -to use to complete an effective search. It is also important to ensure that -include paths and symbols are correctly defined. For more information, see -Including paths and symbols.

            - -

            See C/C++ search, for more information on:

            - -
              -
            • What you can search for
            • -
            • How to limit your search
            • -
            • How to use wildcard characters in your search
            • -
            • Syntax examples
            • -
            - -

            To search for an element in your project:

            - -
              -
            1. Do one of the following:
            2. -
              • In the C/C++ Projects view, select the files and/or projects that you want - to include in your search.
              • -
              • In the C/C++ Projects view or in the Outline view, select the element - that you want to search - for.
              • -

                In the Search dialog box, the Search string box will be populated with the - selected element name and type.

                -
              • In the C/C++ editor select the name of the element that you want to search for.
              • -

                In the Search dialog box, the Search string box will be populated with the - selected element name.

              -
            3. Click Search > C/C++.
            4. -
            5. In the Search string box, type a search string.
            6. -
            7. To make your search case sensitive, select the Case sensitive box .
            8. -
            9. Select an element in the Search For box.
            10. -
            11. Select a search limiter in the Limit To box.
            12. -
            13. Do one of the following: -
              • To search all projects in your workspace, select Workspace .
              • - To search selected resources, select Selected Resources.
              • -
              • To search a predefined group of resources in your workspace, select Working Set - .
              -

              Search results are displayed in the Search view. Double-click a search - result in the Search view to open the corresponding resource. The - search element is highlighted.

              -
            -

            For more information, see: -

          • Workbench User Guide > Concepts > Views > Search view
          • -
          • Workbench User Guide > Tasks > Navigating and finding resources
          • -
          - -

          Related concepts -
          -C/C++ search
          -CDT Projects
          -Open Declarations

          -

          Related tasks -
          -Navigate to C/C++ declarations

          -

          Related reference -
          -C/C++ search page, Search dialog box

          -

           

          -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setbuildorder.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setbuildorder.htm deleted file mode 100644 index cb53972a88e..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setbuildorder.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -Setting build order - - - - - -

          Setting build order

          - -

          You can specify the order in which projects are built. -Referenced projects are built first.

          - -

          When you set the build order, the CDT does not rebuild projects that depend -on a project. You must rebuild all projects to ensure changes are -propagated.

          - -

          For more information on build order, see Workbench User Guide > Reference -> Preference > Build Order.

          - -

          To set the project build order:

          - -
            -
          1. Click Window > Preferences.
          2. -
          3. Select Build Order from the list.
          4. -
          5. Clear the Use default build order checkbox.
          6. -
          7. Select a project in the list.
          8. -
          9. Do one of the following:
          10. -
            • Click Up to move the project up the list.
            • -
            • Click Down to move the project down the list.
            -
          11. To add projects to the build path, click Add Project.
          12. -
          13. Select the projects to add to the build path.
          14. -
          15. Click OK.
          16. -
          17. To remove a project from the Project build order list, click Remove - Project.
          18. -

            When building or rebuilding all projects, the projects that have been - removed from the build order are built last.

            -
          19. Click Apply.
          20. -
          - -

          Related concepts -
          -Build overview

          -

          Related tasks -
          -Defining build settings
          -Building

          -

          Related reference -
          -Make Builder page, C/C++ Properties window

          - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setreminder.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setreminder.htm deleted file mode 100644 index 8a037b87b51..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_setreminder.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - -Setting reminders - - - - - -

          Setting reminders

          - -

          The Tasks view lets you create your own tasks. In addition to having the Tasks view automatically list build errors, you can set personal reminders -for tasks, such as unfinished functions that you write or error handling routines -that you -want to verify.

          - -

          To set a reminder:

          - -
            -
          1. In Tasks view, right-click the Tasks pane, and select New Task.
          2. -
          3. In the Description box, type a new task.
          4. -
          5. Click OK.
          6. -
          - -

          For more information on the Tasks view, see:

            -
          • Workbench User Guide > Concepts> Views > Tasks view
          • -
          • Workbench User Guide > Reference > User interface information > - Views and editors > Tasks view
          • -
          - -

          Related concepts -
          -Build overview

          -

          Related tasks -
          -Defining Build Settings
          -Jumping to errors
          -Filtering the Tasks view

          -

          Related reference -
          -Run and Debug dialog box

          - -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_shift_code.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_shift_code.htm deleted file mode 100644 index 3f64688e841..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_shift_code.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - -Shifting lines of code to the right or left - - - - - -

          Shifting lines of code to the right or left

          - -

          You can shift lines of code to the left or right in the C/C++ editor. You can -change the tab width in the C/C++ editor preferences window. For more -information, see Customizing the C/C++ -editor.

          - -

          To shift lines of code to the right or left:

          - -
            -
          1. In the C/C++ editor, select the full length of the lines that you want to shift.
          2. -
          3. Do one of the following:
          4. -
            • To move the text to the right, press Tab .
            • To move the - text to the right, click Edit > - Shift Right.
            • To move the text to the left, press Shift+Tab.
            • -
            • To move the text to the left, click Edit > Shift Left.
            • -
            -
          - -

          Related concepts -
          - Code entry

          -

          Related tasks -
          -Customizing the C/C++ editor

          -

          Related reference -
          -C/C++ editor, code templates and search -preferences

          -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_show_proj_files.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_show_proj_files.htm deleted file mode 100644 index adb05ecbd97..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_show_proj_files.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -Displaying C/C++ file components in the C/C++ Projects view - - - - - -

          Displaying C/C++ file components in the C/C++ Projects view

          - -

          File components are displayed in the C/C++ Projects view and in the Outline -view. You can display or hide all file components in the C/C++ Projects view.

          - -

          To display file components

          - -
            -
          1. Click Window > Preferences.
          2. -
          3. In the Preferences dialog box, select C/C++ from the list.
          4. -
          5. Select the Show file members in Project View check box.
          6. -
          7. Click OK.
          8. -
          9. In the C/C++ Projects view, double-click a file component.
          10. -

            The component is highlighted in the C/C++ editor.

            -
          - -

          The C/C++ Projects view can also be filtered to show certain types of file -components. For more information, see Hiding -files by type in the C/C++ Projects view.

          - -

          Related concepts -
          -CDT Projects
          -Project file views -

          -

          Related tasks -
          -Hiding files by type in the C/C++ Projects -view
          -Searching for C/C++ elements
          -Navigate to C/C++ declarations

          -

          Related reference -
          -C/C++ editor, code templates and search -preferences

          -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_update_man.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_update_man.htm deleted file mode 100644 index 38f4172f0e2..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_update_man.htm +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - -Updating the CDT - - - - - -

          Updating the CDT

          - -

          The Install/Update perspective provides information on your current -Eclipse installation and lets you manage updates. For more information, see Workbench User Guide > Tasks > Updating - features with the update manager.

          - -

          You can also click Help > Software Updates > New Updates to view a -list of the updates available for the toolsets you have installed.

          -

          Related concepts -
          -CDT Overview
          -C/C++ Development perspective

          -

          Related tasks -
          -Defining project properties
          -Working with C/C++ project files

          -

          Related reference -
          -Views

          -

          - -IBM Copyright Statement

          - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_variables.htm b/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_variables.htm deleted file mode 100644 index ef1c0b10d68..00000000000 --- a/doc/org.eclipse.cdt.doc.user/tasks/cdt_t_variables.htm +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - -Working with variables - - - - - -

          Working with variables

          - -

          During a debug session, you can display variable types, and change -or disable variable values.

          - -

          To display variable type names:

          - -
            -
          • In Variables view, click the Show Type Names toggle button.
          • -
          - -

          To change a variable value while debugging:

          - -

          During a debug, you can change the value of a variable to test how your -program handles a particular value or to speed through a loop.

          - -
            -
          1. In Variables view, right-click a variable, and select Change Variable - Value.
          2. -
          3. Type a value.
          4. -
          - -

          To disable a variable value while debugging:

          - -

          You can disable a variable so that the debugger does not read the variable's -value from the target. This is useful if the target is very sensitive or the -variable is specified as volatile.

          - -
            -
          • In Variables view, right-click a variable, and select Disable.
          • -
          - -

          Related concepts -
          -C/C++ Development perspective
          -Projects

          -

          Related tasks -
          -Debugging

          -

          Related reference -
          -Debug views

          - -

          -IBM Copyright Statement - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/toc.xml b/doc/org.eclipse.cdt.doc.user/toc.xml deleted file mode 100644 index b44f62c314f..00000000000 --- a/doc/org.eclipse.cdt.doc.user/toc.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml b/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml deleted file mode 100644 index 0cae128cdd9..00000000000 --- a/doc/org.eclipse.cdt.doc.user/topics_Concepts.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/org.eclipse.cdt.doc.user/topics_Getting_Started.xml b/doc/org.eclipse.cdt.doc.user/topics_Getting_Started.xml deleted file mode 100644 index a63b19a7bdf..00000000000 --- a/doc/org.eclipse.cdt.doc.user/topics_Getting_Started.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/topics_Reference.xml b/doc/org.eclipse.cdt.doc.user/topics_Reference.xml deleted file mode 100644 index 75051b2a313..00000000000 --- a/doc/org.eclipse.cdt.doc.user/topics_Reference.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml b/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml deleted file mode 100644 index bde9149d608..00000000000 --- a/doc/org.eclipse.cdt.doc.user/topics_Tasks.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/org.eclipse.cdt.launch/.classpath b/launch/org.eclipse.cdt.launch/.classpath deleted file mode 100644 index 065ac06e197..00000000000 --- a/launch/org.eclipse.cdt.launch/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/launch/org.eclipse.cdt.launch/.cvsignore b/launch/org.eclipse.cdt.launch/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/launch/org.eclipse.cdt.launch/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/launch/org.eclipse.cdt.launch/.project b/launch/org.eclipse.cdt.launch/.project deleted file mode 100644 index 94d34bf6d81..00000000000 --- a/launch/org.eclipse.cdt.launch/.project +++ /dev/null @@ -1,37 +0,0 @@ - - - org.eclipse.cdt.launch - - - org.eclipse.cdt.core - org.eclipse.cdt.core.aix - org.eclipse.cdt.core.linux - org.eclipse.cdt.core.qnx - org.eclipse.cdt.core.solaris - org.eclipse.cdt.core.win32 - org.eclipse.cdt.debug.core - org.eclipse.cdt.debug.ui - org.eclipse.cdt.ui - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog deleted file mode 100644 index 6b1ce948135..00000000000 --- a/launch/org.eclipse.cdt.launch/ChangeLog +++ /dev/null @@ -1,355 +0,0 @@ -2004-01-07 Alain Magloire - - Fix # 49652 - You could not see a difference with binaries of the same name but different location. - - * src/org/eclipse/cdt/launch/ui/CMainTab.java - * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java - -2003-12-18 Alain Magloire - - Possible NPE, PR 49146 - - * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java - -2003-12-17 Mikhail Khodjaiants - Fix for PR 49051: Launcher: Debugger tab: variable tracking. - * CDebuggerTab.java - -2003-12-16 Alain Magloire - - Choose a debugger base on the Eclipse platform - - * plugin.xml - * src/org/eclipse/cdt/launch/internal/CApplicationlaunchShortcut.java - -2003-10-27 - Fixed 46129 - - AbstractCLaunchDelegate.java - -2003-10-27 Mikhail Khodjaiants - Changed the initialization of 'SourceLookupBlock'. - * CSourceLookupTab.java - -2003-10-27 Mikhail Khodjaiants - Moved the 'org.eclipse.debug.core.sourceLocators' extension from the launcher. - * plugin.xml - * plugin.properties - -2003-10-27 Mikhail Khodjaiants - Removed the dependency to 'org.apache.xerces'. - * plugin.xml - * .classpath - * .project - -2003-10-27 Mikhail Khodjaiants - Moved 'DefaultSourceLocator' from the 'org.eclipse.cdt.launch' plugin and merge it with 'CUISourceLocator'. - Removed the 'org.eclipse.cdt.launch.internal.ui.sourcelookup' package. - * DefaultSourceLocator.java: moved to the 'org.eclipse.cdt.debug.ui' plugin. - -2003-11-22 Mikhail Khodjaiants - src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java: - Dispose 'SourceLookupBlock' when disposing 'CSourceLookupTab'. - -2003-11-17 Mikhail Khodjaiants - src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java: - "Search for duplicate source files" option support. - -2003-10-07 Mikhail Khodjaiants - src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java: - use 'MultiStatus' instead of 'Status' in the 'abort' method. - -2003-09-22 David Inglis - Add help context IDs to plugin and associate ids to each launch tab control. - - src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java - src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java - src/org/eclipse/cdt/launch/ui/CArgumentsTab.java - src/org/eclipse/cdt/launch/ui/CDebuggerTab.java - src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java - src/org/eclipse/cdt/launch/ui/CMainTab.java - src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java - src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java - -2003-08-05 Mikhail Khodjaiants - * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java - Check if the project saved in the launch configuration equals to the project set - in the source lookup tab. - -2003-07-28 Tom Tromey - * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java - (loadDebuggerComboBox): Sort entries by name. from - -2003-07-28 Mikhail Khodjaiants - * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java - Refactoring: moved the 'CDebugUtils' class to the 'org.eclipse.cdt.debug.core' package - - the methods of this class are mostly used in UI plugins. - -2003-07-22 David Inglis - * src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java - * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java - * src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java - Refactor getName & getImage up into AbstructCDebuggerTab - fixed problem with selecting a debugger for a core file from a unknown project platform. - -2003-07-22 David Inglis - * src/org/eclipse/cdt/launch/ui/CMainTab.java - Use project name for configuration naming when no binary selected - -2003-07-22 Mikhail Khodjaiants - * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java - * src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java - Fixed initialization problems. - -2003-07-17 Thomas Fletcher - * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java - Applied source locator patch to expand the scope of source lookups. - Patch from Mikhail Khodjaiants - -2003-07-09 Thomas Fletcher - * src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java - Filled out this class which previously wasn't loading images ... now it is. - -2003-07-03 David Inglis - * src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java - * src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java - * src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java - * src/org/eclipse/cdt/launch/ui/CMainTab.java - Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=39583 - -2003-06-26 David Inglis - - * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java - Added variable book-keeping option in config. - - * src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java (getContext) - Returns an ICElement even if CDescriptor does not exsist. - - * src/org/eclipse/cdt/launch/ui/CMainTab.java - Use BusyIndicator when getting binary list from project - fixed problem with prefilling a new config when the project did not have a CDescriptor - - -2003-04-17 Alain Magloire - - * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortCut.java: - fix Typo. - -2003-03-27 Alain Magloire - - * src/org/eclipse/cdt/launch/ui/CMainTab.java: - Refactor of ICRoot to ICModel adjust the code. - -2003-03-19 David Inglis - Fixed bug with not showing C Project lists with the launch config, when C UI Plugins was not - created yet. - -2003-03-18 Alain Magloire - - * plugin.xml - * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java: - Change the texts for "C Local Application". - -2003-02-20 Mikhail Khodjaiants - The generation of launch configuration shouldn't fail if project is not set or project name is empty. - * DefaultSourceLocator.java - * CSourceLookupTab.java - -2003-02-18 Mikhail Khodjaiants - New 'Source Lookup' tab. - * plugin.xml - Added dependency on the 'org.apache.xerces' plugin and the 'sourceLocator' extension. - * plugin.properties - Name for the source locator. - * CoreFileCLaunchConfigurationTabGroup.java - * LocalCLaunchConfigurationTabGroup.java - Added the 'Source Lookup' tab. - * DefaultSourceLocator.java - Implementation of 'IPersistableSourceLocator'. - * CSourceLookupTab.java - Implementation of 'ILaunchConfiguartionTab'. - -2003-02-07 David Inglis - - Refactor LaunchConstants into debug.core and make setting source locator happen before - debug target it created. - - * src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java - * src/org/eclipse/cdt/launch/ICDTLaunchConfigurationConstants.java - * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java - * src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java - * src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java - * src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java - * src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java - * src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java - * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java - * src/org/eclipse/cdt/launch/ui/CArgumentsTab.java - * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java - * src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java - * src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java - * src/org/eclipse/cdt/launch/ui/CMainTab.java - * src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java - -2003-02-06 Alain Magloire - - * src/.../launch/internal/ui/WorkingDirectoryBlock.java (geLaunchConfiguration): - (updateLaunchConfigurationDialog): New method to change the scope for inner classes. - * src/.../launch/ui/CArgumentsTab.java (updateLaunchConfigurationDialog): - New method changing the scope for inner classes. - * src/.../launch/ui/CDebuggerTab.java (updateLaunchConfigurationDialog): - New method changing the scope for inner classes. - * src/.../launch/ui/CMainTab.java (updateLaunchConfigurationDialog): - New method changing the scope for inner classes. - * src/.../launch/ui/CorefileDebuggerTab.java (handleDebuggerChange): - New method changing the scope for inner classes. - - -2003-02-06 David Inglis - * src/.../launch/internal/CApplicationLaunchShortcut.java - * src/.../launch/ui/CMainTab.java - Change to use WorkbenchLabelProvider - -2003-01-29 David Inglis - * src/.../launch/internal/ui/LaunchUIPluging.java (getShell) - change so that it will always return a shell. - -2003-01-28 Alain Magloire - - * src/.../launch/internal/CApplicationLaunchShortCut.java (getCLaunchConfigType): - Change to protected. - -2003-01-16 David Inglis - * src/.../launch/ui/CDebuggerTab.java - made 'revert' work properly within the debugger tab. - -2003-01-16 David Inglis - * src/.../launch/AbstractCLaunchDelegate.java - add check for program existance on disk before launch - - * src/.../launch/internal/ui/AbstractCDebuggerTab.java - * src/.../launch/ui/CDebuggerTab.java - * src/.../launch/ui/CorefileDebuggerTab.java - Fixed http://bugs.eclipse.org/bugs/show_bug.cgi?id=29532 - -2003-01-06 Alain Magloire - - * build.properties: Patch from Judy Green. - -2003-01-06 Alain Magloire - - Add support for variable substitution: - HOME=/foo - MYHOME=${HOME}/bar - - MYHOME --> /foo/bar - - Furture work: provide the shell brace expansion. - - * src/.../launch/internal/AbstractCLaunchDelegate.java (expandEnvironment): - Expand variable values containing format ${..}. - * src/.../launch/internal/LocalCLaunConfiguratDelegate.java (exec): - Use expandEnvironment(). - (launch): Use expandEnvironment(). - -2002-12-17 David Inglis - - * src/.../launch/AbstractCLaunchDelegate.java(setDefaultSourceLocator): new method - * src/.../sourcelookup/DefaultSourceLocator.java:new class - add method for delegate to call to set a default source locator. - -2002-12-03 Alain Magloire - - * src/.../internal/LocalCLaunchConfigurationDelegate.java(exec): - Change the signature to take Properties for the environment get - the default environment and add it to new environment to it. - Use ProcessFactory to run the Application, with the new environment - array. - -2002-11-23 Alain Magloire - - * src/.../internal/ui/CApplicationLaunchShortcut.java (searchAndLaunch): - Bail out with a message if no binaries. - -2002-11-22 Alain Magloire - - * src/.../AbstractCLaunchDelegate.java (getProgranName): Now static. - * src/.../internal/ui/LaunchUIPlugin.java.java (errorDialog): New method. - * src/.../internal/ui/CApplicationLauchShortcut.java.java : New File - provides shortcut to start C applications. - * plugin.xml: Implement extenxion point shortcut. - -2002-11-22 Alain Magloire - - * src/.../internal/ui/LaunchUIPlugin.java (startup): - On startup add a listener to DebugPlugin for debug events. - (shutdown): remove the listener. - (handleDebugEvents): For Termination events do a refresh on - the project. - -2002-11-21 Alain Magloire - - * src/.../internal/ui/WorkingDirectoryBlock.java (setDefaultWorkingDir): - Set the workspace directory default to be the Project. - * src/.../internal/LocalCLaunchConfigurationDelegate.java (launch): - Use the new function getWorkingDirectory(), it does more check by - calling verifyWorkingDirectory(). - * src/.../AbstractCLaunchDelegate.java (getEnvironmentArray): - implemented. - (getWorkingDirectory): New method, call verifyWorkingDirectory(); - (verifyWorkingDirectory): New method, does more checking. - (getWorkingDir): Deprecated and calls getWorkingDirectory(). - (getWorkingDirectoryPath): New method. - (getCProject): Now static. - (getProjectName): Now static - -2002-11-21 Judy N. Green - - * src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java (verifyCProject): - If we cannot get the ICProject with the config, we get the project - and see if it exists and/or it is closed. The appropriate error is now - displayed, rather than reporting that the project does not exist when it - does exist, but is closed. - -2002-11-14 Thomas Fletcher - * src/.../launch/ui/CMainTab.java - Updated error condition to catch closed projects. - -2002-11-13 Thomas Fletcher - * src/.../launch/ui/CDebuggerTab.java - Updated punctuation. - -2002-11-13 David Inglis - * src/.../launch/ui/CDebuggerTab.java - * src/.../launch/ui/CLaunchConfigurationTab.java - * src/.../launch/ui/CorefileDebuggerTab.java - Added support for supported cpus on a debugger and filters list based on - selected IBinary. - Default debugger selection is not the first exact matching debugger for - the specified platform. - -2002-11-06 David Inglis - * src/.../launch/ui/CMainTab.java - * src/.../launch/ui/ClaunchCOnfigurationTAb.java - fixed problem with preselection of project/program for new configurations - -2002-11-04 David Inglis - * src/.../launch/ui/CDebuggerTab.java - * src/.../launch/ui/CMainTab.java - change "local" to "native" and support "*" as a wildcard for platform. - -2002-11-04 David Inglis - * src/.../launch/internal/ui/LocalCLaunchCOnfigurationTabGroup.java - don't filter tab list based on mode since the configuration is shared with debug mode. - -2002-11-01 David Inglis - * src/.../launch/internal/CoreFileLaunchDelegate.java - * src/.../launch/internal/LocalCLaunchConfigur.ationDelegate.java - use new newDebugTaget methods in CDebugModel - -2002-10-23 David Inglis - - * /src/.../launch/internal/CoreFileDelegate.java - * /src/.../launch/internal/LocalCLaunchConfigurationDelegate.java - create new IProcess for debug console from CDISession and pass - to newDebugTarget methods diff --git a/launch/org.eclipse.cdt.launch/about.html b/launch/org.eclipse.cdt.launch/about.html deleted file mode 100644 index 293340ea8ed..00000000000 --- a/launch/org.eclipse.cdt.launch/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

          About This Content

          - -

          20th August, 2002

          -

          License

          -

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

          - -

          Contributions

          - -

          If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

          - -

          If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

          - - - \ No newline at end of file diff --git a/launch/org.eclipse.cdt.launch/build.properties b/launch/org.eclipse.cdt.launch/build.properties deleted file mode 100644 index 39635cca9f4..00000000000 --- a/launch/org.eclipse.cdt.launch/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -bin.includes = plugin.xml,\ - plugin.properties,\ - icons/,\ - about.html,\ - cdtlaunch.jar -src.includes = plugin.xml,\ - plugin.properties,\ - icons/,\ - about.html -javadoc.packages = org.eclipse.cdt.launch.ui.*,\ - org.eclipse.cdt.launch.sourcelookup*,\ - org.eclipse.cdt.launch.* -source.cdtlaunch.jar = src/ diff --git a/launch/org.eclipse.cdt.launch/icons/c_app.gif b/launch/org.eclipse.cdt.launch/icons/c_app.gif deleted file mode 100644 index 67c491f307b..00000000000 Binary files a/launch/org.eclipse.cdt.launch/icons/c_app.gif and /dev/null differ diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif deleted file mode 100644 index 8670a384bd3..00000000000 Binary files a/launch/org.eclipse.cdt.launch/icons/tabs/arguments_tab.gif and /dev/null differ diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif deleted file mode 100644 index 8b4f2340c94..00000000000 Binary files a/launch/org.eclipse.cdt.launch/icons/tabs/debugger_tab.gif and /dev/null differ diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif deleted file mode 100644 index 65d63ec00d6..00000000000 Binary files a/launch/org.eclipse.cdt.launch/icons/tabs/environment_tab.gif and /dev/null differ diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif deleted file mode 100644 index 6b86d079780..00000000000 Binary files a/launch/org.eclipse.cdt.launch/icons/tabs/main_tab.gif and /dev/null differ diff --git a/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif b/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif deleted file mode 100644 index 3976f8f7913..00000000000 Binary files a/launch/org.eclipse.cdt.launch/icons/tabs/source_tab.gif and /dev/null differ diff --git a/launch/org.eclipse.cdt.launch/plugin.properties b/launch/org.eclipse.cdt.launch/plugin.properties deleted file mode 100644 index de0ff3f8491..00000000000 --- a/launch/org.eclipse.cdt.launch/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -###################################################################### -# Copyright (c) 2002 QNX Software Systems Ltd. and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v0.5 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v05.html -# -# Contributors: -# QNX Software Systems Ltd. - Initial implementation -###################################################################### -pluginName=C/C++ Development Tools Launching Support -providerName=Eclipse.org - -LocalCDTLaunch.name= C/C++ Local -CoreFileCDTLaunch.name= C/C++ Postmortem debugger diff --git a/launch/org.eclipse.cdt.launch/plugin.xml b/launch/org.eclipse.cdt.launch/plugin.xml deleted file mode 100644 index 197d1145948..00000000000 --- a/launch/org.eclipse.cdt.launch/plugin.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java deleted file mode 100644 index 4b0462f7064..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java +++ /dev/null @@ -1,554 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.launch; - -import java.io.File; -import java.io.FileNotFoundException; -import java.text.DateFormat; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; -import java.util.Map.Entry; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.cdt.utils.spawner.EnvironmentReader; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; -import org.eclipse.debug.core.model.IPersistableSourceLocator; - -abstract public class AbstractCLaunchDelegate implements ILaunchConfigurationDelegate { - - abstract public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) - throws CoreException; - - /** - * Return the save environment variables in the configuration. - * The array does not include the default environment of the target. - * array[n] : name=value - */ - protected String[] getEnvironmentArray(ILaunchConfiguration config) { - Map env = null; - try { - env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null); - } - catch (CoreException e) { - } - if (env == null) { - return new String[0]; - } - String[] array = new String[env.size()]; - Iterator entries = env.entrySet().iterator(); - Entry entry; - for (int i = 0; entries.hasNext() && i < array.length; i++) { - entry = (Entry) entries.next(); - array[i] = ((String) entry.getKey()) + "=" + ((String) entry.getValue()); - } - return array; - } - - /** - * Return the save environment variables of this configuration. - * The array does not include the default environment of the target. - */ - protected Properties getEnvironmentProperty(ILaunchConfiguration config) { - Properties prop = new Properties(); - Map env = null; - try { - env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null); - } catch (CoreException e) { - } - if (env == null) - return prop; - Iterator entries = env.entrySet().iterator(); - Entry entry; - while (entries.hasNext()) { - entry = (Entry) entries.next(); - prop.setProperty((String) entry.getKey(), (String) entry.getValue()); - } - return prop; - } - - /** - * Return the default Environment of the target. - */ - protected Properties getDefaultEnvironment() { - return EnvironmentReader.getEnvVars(); - } - - /** - * Expand the variable with the format ${key}. example: - * HOME=/foobar - * NEWHOME = ${HOME}/project - * The environement NEWHOME will be /foobar/project. - */ - protected Properties expandEnvironment(ILaunchConfiguration config ) { - return expandEnvironment(getEnvironmentProperty(config)); - } - - /** - * Expand the variable with the format ${key}. example: - * HOME=/foobar - * NEWHOME = ${HOME}/project - * The environement NEWHOME will be /foobar/project. - */ - protected Properties expandEnvironment(Properties props) { - Enumeration names = props.propertyNames(); - if (names != null) { - while (names.hasMoreElements()) { - String key = (String) names.nextElement(); - String value = props.getProperty(key); - if (value != null && value.indexOf('$') != -1) { - StringBuffer sb = new StringBuffer(); - StringBuffer param = new StringBuffer(); - char prev = '\n'; - char ch = prev; - boolean inMacro = false; - boolean inSingleQuote = false; - - for (int i = 0; i < value.length(); i++) { - ch = value.charAt(i); - switch (ch) { - case '\'': - if (prev != '\\') { - inSingleQuote = !inSingleQuote; - } - break; - - case '$' : - if (!inSingleQuote && prev != '\\') { - if (i < value.length() && value.indexOf('}', i) > 0) { - char c = value.charAt(i + 1); - if (c == '{') { - param.setLength(0); - inMacro = true; - prev = ch; - continue; - } - } - } - break; - - case '}' : - if (inMacro) { - inMacro = false; - String v = null; - String p = param.toString(); - /* Search in the current property only - * if it is not the same name. - */ - if (!p.equals(key)) { - v = props.getProperty(p); - } - /* Fallback to the default Environemnt. */ - if (v == null) { - Properties def = getDefaultEnvironment(); - if (def != null) { - v = def.getProperty(p); - } - } - if (v != null) { - sb.append(v); - } - param.setLength(0); - /* Skip the trailing } */ - prev = ch; - continue; - } - break; - } /* switch */ - - if (!inMacro) { - sb.append(ch); - } else { - /* Do not had the '{' */ - if (!(ch == '{' && prev == '$')) { - param.append(ch); - } - } - prev = (ch == '\\' && prev == '\\') ? '\n' : ch; - } /* for */ - props.setProperty(key, sb.toString()); - } /* !if (value ..) */ - } /* while() */ - } /* if (names != null) */ - return props; - } - - /** - * Returns the working directory specified by - * the given launch configuration, or null if none. - * - * @deprecated Should use getWorkingDirectory() - * @param configuration launch configuration - * @return the working directory specified by the given - * launch configuration, or null if none - * @exception CoreException if unable to retrieve the attribute - */ - public File getWorkingDir(ILaunchConfiguration configuration) throws CoreException { - return getWorkingDirectory(configuration); - } - - /** - * Returns the working directory specified by - * the given launch configuration, or null if none. - * - * @param configuration launch configuration - * @return the working directory specified by the given - * launch configuration, or null if none - * @exception CoreException if unable to retrieve the attribute - */ - public File getWorkingDirectory(ILaunchConfiguration configuration) throws CoreException { - return verifyWorkingDirectory(configuration); - } - - protected IPath getWorkingDirectoryPath(ILaunchConfiguration config) throws CoreException { - String path = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); - if (path != null) { - return new Path(path); - } - return null; - } - - /** - * Throws a core exception with an error status object built from - * the given message, lower level exception, and error code. - * - * @param message the status message - * @param exception lower level exception associated with the - * error, or null if none - * @param code error code - */ - protected void abort(String message, Throwable exception, int code) throws CoreException { - MultiStatus status = new MultiStatus(getPluginID(),code, message,exception); - status.add(new Status(IStatus.ERROR,getPluginID(),code, exception == null ? "" : exception.getLocalizedMessage(),exception)); - throw new CoreException(status); - } - - protected void cancel(String message, int code) throws CoreException { - throw new CoreException(new Status(IStatus.OK, getPluginID(), code, message, null)); - } - - abstract protected String getPluginID(); - - public static ICProject getCProject(ILaunchConfiguration configuration) throws CoreException { - String projectName = getProjectName(configuration); - if (projectName != null) { - projectName = projectName.trim(); - if (projectName.length() > 0) { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project); - if (cProject != null && cProject.exists()) { - return cProject; - } - } - } - return null; - } - - public static String getProjectName(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); - } - - public static String getProgramName(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null); - } - - /** - * Assigns a default source locator to the given launch if a source locator has not yet been assigned to it, and the associated - * launch configuration does not specify a source locator. - * - * @param launch launch object - * @param configuration configuration being launched - * @exception CoreException if unable to set the source locator - */ - protected void setSourceLocator(ILaunch launch, ILaunchConfiguration configuration) throws CoreException { - // set default source locator if none specified - if (launch.getSourceLocator() == null) { - IPersistableSourceLocator sourceLocator; - String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null); - if (id == null) { - ICProject cProject = getCProject(configuration); - if (cProject == null) { - abort("Project does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); - } - sourceLocator = CDebugUIPlugin.createDefaultSourceLocator(); - sourceLocator.initializeDefaults(configuration); - } else { - sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id); - String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null); - if (memento == null) { - sourceLocator.initializeDefaults(configuration); - } else { - sourceLocator.initializeFromMemento(memento); - } - } - launch.setSourceLocator(sourceLocator); - } - } - - /** - * Returns the program arguments as a String. - * - * @return the program arguments as a String - */ - public String getProgramArguments(ILaunchConfiguration config) throws CoreException { - return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null); - - } - /** - * Returns the program arguments as an array of individual arguments. - * - * @return the program arguments as an array of individual arguments - */ - public String[] getProgramArgumentsArray(ILaunchConfiguration config) throws CoreException { - return parseArguments(getProgramArguments(config)); - } - - private static String[] parseArguments(String args) { - if (args == null) - return new String[0]; - ArgumentParser parser = new ArgumentParser(args); - String[] res = parser.parseArguments(); - - return res; - } - - protected ICDebugConfiguration getDebugConfig(ILaunchConfiguration config) throws CoreException { - ICDebugConfiguration dbgCfg = null; - try { - dbgCfg = - CDebugCorePlugin.getDefault().getDebugConfiguration( - config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "")); - } - catch (CoreException e) { - IStatus status = - new Status( - IStatus.ERROR, - LaunchUIPlugin.getUniqueIdentifier(), - ICDTLaunchConfigurationConstants.ERR_DEBUGGER_NOT_INSTALLED, - "CDT Debubger not installed", - e); - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); - - if (handler != null) { - Object result = handler.handleStatus(status, this); - if (result instanceof String) { - // this could return the new debugger id to use? - } - } - throw e; - } - return dbgCfg; - } - - protected String renderTargetLabel(ICDebugConfiguration debugConfig) { - String format = "{0} ({1})"; - String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis())); - return MessageFormat.format(format, new String[] { debugConfig.getName(), timestamp }); - } - - protected String renderProcessLabel(String commandLine) { - String format = "{0} ({1})"; - String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis())); - return MessageFormat.format(format, new String[] { commandLine, timestamp }); - } - - protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException { - String name = getProjectName(config); - if (name == null) { - abort("C Project not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT); - } - ICProject cproject = getCProject(config); - if (cproject == null) { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); - if (!project.exists()) { - abort("Project '"+ name + "' does not exist", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); - } - else if (!project.isOpen()) { - abort("Project '"+ name + "' is closed", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); - } - abort("Project is not a C/C++ project", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); - } - return cproject; - } - - protected IFile getProgramFile(ILaunchConfiguration config) throws CoreException { - ICProject cproject = verifyCProject(config); - String fileName = getProgramName(config); - if (fileName == null) { - abort("Program file not specified", null, ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM); - } - - IFile programPath = ((IProject) cproject.getResource()).getFile(fileName); - if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) { - abort("Program file does not exist", new FileNotFoundException(programPath.getLocation() + " not found."), ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST); - } - return programPath; - } - - protected IPath verifyProgramFile(ILaunchConfiguration config) throws CoreException { - return getProgramFile(config).getLocation(); - } - - /** - * Verifies the working directory specified by the given - * launch configuration exists, and returns the working - * directory, or null if none is specified. - * - * @param configuration launch configuration - * @return the working directory specified by the given - * launch configuration, or null if none - * @exception CoreException if unable to retrieve the attribute - */ - public File verifyWorkingDirectory(ILaunchConfiguration configuration) throws CoreException { - IPath path = getWorkingDirectoryPath(configuration); - if (path == null) { - // default working dir is the project if this config has a project - ICProject cp = getCProject(configuration); - if (cp != null) { - IProject p = cp.getProject(); - return p.getLocation().toFile(); - } - } - else { - if (path.isAbsolute()) { - File dir = new File(path.toOSString()); - if (dir.isDirectory()) { - return dir; - } - else { - abort( - "Working directory does not exist", - new FileNotFoundException(path.toOSString() + " not found."), - ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); - } - } - else { - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path); - if (res instanceof IContainer && res.exists()) { - return res.getLocation().toFile(); - } - else { - abort( - "Working directory does not exist", - new FileNotFoundException(path.toOSString() + "Does not exsit."), - ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST); - } - } - } - return null; - } - - private static class ArgumentParser { - private String fArgs; - private int fIndex = 0; - private int ch = -1; - - public ArgumentParser(String args) { - fArgs = args; - } - - public String[] parseArguments() { - ArrayList v = new ArrayList(); - - ch = getNext(); - while (ch > 0) { - while (Character.isWhitespace((char) ch)) - ch = getNext(); - - if (ch == '"') { - v.add(parseString()); - } - else { - v.add(parseToken()); - } - } - - String[] result = new String[v.size()]; - v.toArray(result); - return result; - } - - private int getNext() { - if (fIndex < fArgs.length()) - return fArgs.charAt(fIndex++); - return -1; - } - - private String parseString() { - StringBuffer buf = new StringBuffer(); - ch = getNext(); - while (ch > 0 && ch != '"') { - if (ch == '\\') { - ch = getNext(); - if (ch != '"') { // Only escape double quotes - buf.append('\\'); - } - } - if (ch > 0) { - buf.append((char) ch); - ch = getNext(); - } - } - - ch = getNext(); - - return buf.toString(); - } - - private String parseToken() { - StringBuffer buf = new StringBuffer(); - - while (ch > 0 && !Character.isWhitespace((char) ch)) { - if (ch == '\\') { - ch = getNext(); - if (ch > 0) { - if (ch != '"') { // Only escape double quotes - buf.append('\\'); - } - buf.append((char) ch); - ch = getNext(); - } - else if (ch == -1) { // Don't lose a trailing backslash - buf.append('\\'); - } - } - else if (ch == '"') { - buf.append(parseString()); - } - else { - buf.append((char) ch); - ch = getNext(); - } - } - return buf.toString(); - } - } -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java deleted file mode 100644 index 59cdbafd146..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java +++ /dev/null @@ -1,349 +0,0 @@ -package org.eclipse.cdt.launch.internal; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.launch.AbstractCLaunchDelegate; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.cdt.ui.CElementLabelProvider; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.debug.ui.ILaunchShortcut; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -/** - */ -public class CApplicationLaunchShortcut implements ILaunchShortcut { - - /** - * @see org.eclipse.debug.ui.ILaunchShortcut#launch(IEditorPart, String) - */ - public void launch(IEditorPart editor, String mode) { - searchAndLaunch(new Object[] { editor.getEditorInput()}, mode); - } - - /** - * @see org.eclipse.debug.ui.ILaunchShortcut#launch(ISelection, String) - */ - public void launch(ISelection selection, String mode) { - if (selection instanceof IStructuredSelection) { - searchAndLaunch(((IStructuredSelection) selection).toArray(), mode); - } - } - - public void launch(IBinary bin, String mode) { - try { - ILaunchConfiguration config = findLaunchConfiguration(bin, mode); - if (config != null) { - DebugUITools.saveAndBuildBeforeLaunch(); - config.launch(mode, null); - } - } catch (CoreException e) { - LaunchUIPlugin.errorDialog("Launch failed", e.getStatus()); //$NON-NLS-1$ - } - } - - /** - * Locate a configuration to relaunch for the given type. If one cannot be found, create one. - * - * @return a re-useable config or null if none - */ - protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) { - ILaunchConfiguration configuration = null; - ILaunchConfigurationType configType = getCLaunchConfigType(); - List candidateConfigs = Collections.EMPTY_LIST; - try { - ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(configType); - candidateConfigs = new ArrayList(configs.length); - for (int i = 0; i < configs.length; i++) { - ILaunchConfiguration config = configs[i]; - String programName = AbstractCLaunchDelegate.getProgramName(config); - String projectName = AbstractCLaunchDelegate.getProjectName(config); - String name = bin.getResource().getProjectRelativePath().toString(); - if (projectName != null && programName.equals(name)) { - if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) { - candidateConfigs.add(config); - } - } - } - } catch (CoreException e) { - CDebugUIPlugin.log(e); - } - - // If there are no existing configs associated with the IBinary, create one. - // If there is exactly one config associated with the IBinary, return it. - // Otherwise, if there is more than one config associated with the IBinary, prompt the - // user to choose one. - int candidateCount = candidateConfigs.size(); - if (candidateCount < 1) { - // FIXME: should probably have more filtering here base on - // the mode, arch, CPU. For now we only support native. - // Prompt the user if more then 1 debugger. - ICDebugConfiguration debugConfig = null; - ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations(); - List debugList = new ArrayList(debugConfigs.length); - String os = BootLoader.getOS(); - for (int i = 0; i < debugConfigs.length; i++) { - String platform = debugConfigs[i].getPlatform(); - if (platform == null || platform.equals("native") || platform.equals(os)) { - debugList.add(debugConfigs[i]); - } - } - debugConfigs = (ICDebugConfiguration[]) debugList.toArray(new ICDebugConfiguration[0]); - if (debugConfigs.length == 1) { - debugConfig = debugConfigs[0]; - } else if (debugConfigs.length > 1) { - debugConfig = chooseDebugConfig(debugConfigs, mode); - } - if (debugConfig != null) { - configuration = createConfiguration(bin, debugConfig); - } - } else if (candidateCount == 1) { - configuration = (ILaunchConfiguration) candidateConfigs.get(0); - } else { - // Prompt the user to choose a config. A null result means the user - // cancelled the dialog, in which case this method returns null, - // since cancelling the dialog should also cancel launching anything. - configuration = chooseConfiguration(candidateConfigs, mode); - } - return configuration; - } - - /** - * Method createConfiguration. - * @param bin - * @return ILaunchConfiguration - */ - private ILaunchConfiguration createConfiguration(IBinary bin, ICDebugConfiguration debugConfig) { - ILaunchConfiguration config = null; - try { - String projectName = bin.getResource().getProjectRelativePath().toString(); - ILaunchConfigurationType configType = getCLaunchConfigType(); - ILaunchConfigurationWorkingCopy wc = - configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(bin.getElementName())); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectName); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, bin.getCProject().getElementName()); - wc.setAttribute(IDebugUIConstants.ATTR_TARGET_DEBUG_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT); - wc.setAttribute(IDebugUIConstants.ATTR_TARGET_RUN_PERSPECTIVE, IDebugUIConstants.PERSPECTIVE_DEFAULT); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true); - wc.setAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID()); - config = wc.doSave(); - } catch (CoreException ce) { - CDebugUIPlugin.log(ce); - } - return config; - } - - /** - * Method getCLaunchConfigType. - * @return ILaunchConfigurationType - */ - protected ILaunchConfigurationType getCLaunchConfigType() { - return getLaunchManager().getLaunchConfigurationType(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP); - } - - protected ILaunchManager getLaunchManager() { - return DebugPlugin.getDefault().getLaunchManager(); - } - - /** - * Convenience method to get the window that owns this action's Shell. - */ - protected Shell getShell() { - return CDebugUIPlugin.getActiveWorkbenchShell(); - } - - /** - * Method chooseDebugConfig. - * @param debugConfigs - * @param mode - * @return ICDebugConfiguration - */ - private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) { - ILabelProvider provider = new LabelProvider() { - /** - * The LabelProvider implementation of this - * ILabelProvider method returns the element's toString - * string. Subclasses may override. - */ - public String getText(Object element) { - if (element == null) { - return ""; - } else if (element instanceof ICDebugConfiguration) { - return ((ICDebugConfiguration) element).getName(); - } - return element.toString(); - } - }; - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider); - dialog.setElements(debugConfigs); - dialog.setTitle("Launch Debug Configuration Selection"); //$NON-NLS-1$ - if (mode.equals(ILaunchManager.DEBUG_MODE)) { - dialog.setMessage("Choose a debug configuration to debug"); //$NON-NLS-1$ - } else { - dialog.setMessage("Choose a configuration to run"); //$NON-NLS-1$ - } - dialog.setMultipleSelection(false); - int result = dialog.open(); - provider.dispose(); - if (result == ElementListSelectionDialog.OK) { - return (ICDebugConfiguration) dialog.getFirstResult(); - } - return null; - } - - /** - * Show a selection dialog that allows the user to choose one of the specified - * launch configurations. Return the chosen config, or null if the - * user cancelled the dialog. - */ - protected ILaunchConfiguration chooseConfiguration(List configList, String mode) { - IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider); - dialog.setElements(configList.toArray()); - dialog.setTitle("Launch Configuration Selection"); //$NON-NLS-1$ - if (mode.equals(ILaunchManager.DEBUG_MODE)) { - dialog.setMessage("Choose a launch configuration to debug"); //$NON-NLS-1$ - } else { - dialog.setMessage("Choose a launch configuration to run"); //$NON-NLS-1$ - } - dialog.setMultipleSelection(false); - int result = dialog.open(); - labelProvider.dispose(); - if (result == ElementListSelectionDialog.OK) { - return (ILaunchConfiguration) dialog.getFirstResult(); - } - return null; - } - - /** - * Prompts the user to select a binary - * - * @return the selected binary or null if none. - */ - protected IBinary chooseBinary(List binList, String mode) { - ILabelProvider provider = new CElementLabelProvider() { - public String getText(Object element) { - if (element instanceof IBinary) { - IBinary bin = (IBinary)element; - StringBuffer name = new StringBuffer(); - name.append(bin.getPath().toString()); - name.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); - return name.toString(); - } - return super.getText(element); - } - }; - - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider); - dialog.setElements(binList.toArray()); - dialog.setTitle("C Local Application"); //$NON-NLS-1$ - if (mode.equals(ILaunchManager.DEBUG_MODE)) { - dialog.setMessage("Choose a local application to debug"); //$NON-NLS-1$ - } else { - dialog.setMessage("Choose a local application to run"); //$NON-NLS-1$ - } - dialog.setMultipleSelection(false); - if (dialog.open() == ElementListSelectionDialog.OK) { - return (IBinary) dialog.getFirstResult(); - } - return null; - } - - /** - * Method searchAndLaunch. - * @param objects - * @param mode - */ - private void searchAndLaunch(final Object[] elements, String mode) { - final List results = new ArrayList(); - if (elements != null && elements.length > 0) { - try { - ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); - IRunnableWithProgress runnable = new IRunnableWithProgress() { - public void run(IProgressMonitor pm) throws InterruptedException { - int nElements = elements.length; - pm.beginTask("Looking for executables", nElements); //$NON-NLS-1$ - try { - IProgressMonitor sub = new SubProgressMonitor(pm, 1); - for (int i = 0; i < nElements; i++) { - if (elements[i] instanceof IAdaptable) { - IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class); - if (r != null) { - ICProject cproject = CoreModel.getDefault().create(r.getProject()); - if (cproject != null) { - IBinary[] bins = cproject.getBinaryContainer().getBinaries(); - - for (int j = 0; j < bins.length; j++) { - if (bins[j].isExecutable()) { - results.add(bins[j]); - } - } - } - } - } - if (pm.isCanceled()) { - throw new InterruptedException(); - } - sub.done(); - } - } finally { - pm.done(); - } - } - }; - dialog.run(true, true, runnable); - } catch (InterruptedException e) { - return; - } catch (InvocationTargetException e) { - MessageDialog.openError(getShell(), "C Local Application Launcher", e.getMessage()); - return; - } - if (results.size() == 0) { - MessageDialog.openError(getShell(), "C Local Application Launcher", "Launch failed no binaries"); - } else { - IBinary bin = chooseBinary(results, mode); - if (bin != null) { - launch(bin, mode); - } - } - } else { - MessageDialog.openError(getShell(), "C Local Application Launcher", "Launch failed no project selected"); - } - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java deleted file mode 100644 index c0fb322dd31..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.eclipse.cdt.launch.internal; - -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.launch.AbstractCLaunchDelegate; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Shell; - -/** - * Insert the type's description here. - * @see ILaunchConfigurationDelegate - */ -public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate { - - public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - monitor.beginTask("Launching postmortem debugger", IProgressMonitor.UNKNOWN); - // check for cancellation - if (monitor.isCanceled()) { - return; - } - IFile exeFile = getProgramFile(config); - - ICDebugConfiguration debugConfig = getDebugConfig(config); - ICDISession dsession = null; - ICProject cproject = getCProject(config); - - IPath corefile = getCoreFilePath((IProject) cproject.getResource()); - if (corefile == null) { - cancel("No Corefile selected", ICDTLaunchConfigurationConstants.ERR_NO_COREFILE); - } - Process debugger = null; - IProcess debuggerProcess = null; - try { - dsession = debugConfig.getDebugger().createCoreSession(config, exeFile, corefile); - debugger = dsession.getSessionProcess(); - } catch (CDIException e) { - abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } - if ( debugger != null ) { - debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); - launch.removeProcess(debuggerProcess); - } - // set the source locator - setSourceLocator(launch, config); - - CDebugModel.newCoreFileDebugTarget( - launch, - dsession.getCurrentTarget(), - renderTargetLabel(debugConfig), - debuggerProcess, - exeFile); - - monitor.done(); - } - - protected IPath getCoreFilePath(final IProject project) throws CoreException { - final Shell shell = LaunchUIPlugin.getShell(); - final String res[] = { null }; - if (shell == null) { - abort("No Shell available in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } - Display display = shell.getDisplay(); - display.syncExec(new Runnable() { - public void run() { - FileDialog dialog = new FileDialog(shell); - dialog.setText("Select Corefile"); - - String initPath = null; - try { - initPath = project.getPersistentProperty(new QualifiedName(LaunchUIPlugin.getUniqueIdentifier(), "SavePath")); - } catch (CoreException e) { - } - if (initPath == null || initPath.equals("")) { - initPath = project.getLocation().toString(); - } - dialog.setFilterPath(initPath); - res[0] = dialog.open(); - } - }); - if (res[0] != null) { - return new Path(res[0]); - } - return null; - } - - public String getPluginID() { - return LaunchUIPlugin.getUniqueIdentifier(); - } -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java deleted file mode 100644 index 6f85722e0f8..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java +++ /dev/null @@ -1,245 +0,0 @@ -package org.eclipse.cdt.launch.internal; - -/* - * (c) Copyright QNX Software System 2002. - * All Rights Reserved. - */ - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Enumeration; -import java.util.Properties; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.IProcessInfo; -import org.eclipse.cdt.core.IProcessList; -import org.eclipse.cdt.debug.core.CDebugModel; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.core.cdi.CDIException; -import org.eclipse.cdt.debug.core.cdi.ICDIRuntimeOptions; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.launch.AbstractCLaunchDelegate; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.cdt.utils.spawner.ProcessFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -/** - * Insert the type's description here. - * @see ILaunchConfigurationDelegate - */ -public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate { - - public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - monitor.beginTask("Launching Local C Application", IProgressMonitor.UNKNOWN); - // check for cancellation - if (monitor.isCanceled()) { - return; - } - IFile exeFile = getProgramFile(config); - String arguments[] = getProgramArgumentsArray(config); - ArrayList command = new ArrayList(1 + arguments.length); - command.add(exeFile.getLocation().toOSString()); - command.addAll(Arrays.asList(arguments)); - String[] commandArray = (String[]) command.toArray(new String[command.size()]); - - // set the default source locator if required - setSourceLocator(launch, config); - - if (mode.equals(ILaunchManager.DEBUG_MODE)) { - IProcess debuggerProcess = null; - Process debugger; - ICDebugConfiguration debugConfig = getDebugConfig(config); - ICDISession dsession = null; - try { - String debugMode = - config.getAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); - if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { - dsession = debugConfig.getDebugger().createLaunchSession(config, exeFile); - ICDIRuntimeOptions opt = dsession.getRuntimeOptions(); - opt.setArguments(getProgramArgumentsArray(config)); - File wd = getWorkingDirectory(config); - if (wd != null) { - opt.setWorkingDirectory(wd.getAbsolutePath()); - } - opt.setEnvironment(expandEnvironment(config)); - ICDITarget dtarget = dsession.getTargets()[0]; - Process process = dtarget.getProcess(); - IProcess iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0])); - debugger = dsession.getSessionProcess(); - if ( debugger != null ) { - debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); - launch.removeProcess(debuggerProcess); - } - boolean stopInMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); - CDebugModel.newDebugTarget( - launch, - dsession.getCurrentTarget(), - renderTargetLabel(debugConfig), - iprocess, - debuggerProcess, - exeFile, - true, - false, - stopInMain); - - } else if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { - int pid = getProcessID(); - if (pid == -1) { - cancel("No Process ID selected", ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID); - } - dsession = debugConfig.getDebugger().createAttachSession(config, exeFile, pid); - debugger = dsession.getSessionProcess(); - if ( debugger != null ) { - debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console"); - launch.removeProcess(debuggerProcess); - } - CDebugModel.newAttachDebugTarget( - launch, - dsession.getCurrentTarget(), - renderTargetLabel(debugConfig), - debuggerProcess, - exeFile); - } - } catch (CDIException e) { - abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } - } else { - File wd = getWorkingDirectory(config); - if (wd == null) { - wd = new File(System.getProperty("user.home", ".")); //NON-NLS-1; - } - Process process = exec(commandArray, getEnvironmentProperty(config), wd); - DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0])); - } - - monitor.done(); - - } - - private int getProcessID() throws CoreException { - final Shell shell = LaunchUIPlugin.getShell(); - final int pid[] = { -1 }; - if (shell == null) { - abort("No Shell availible in Launch", null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } - Display display = shell.getDisplay(); - display.syncExec(new Runnable() { - public void run() { - ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider() { - public String getText(Object element) { - IProcessInfo info = (IProcessInfo) element; - return info.getPid() + " " + info.getName(); - } - }); - dialog.setTitle("Select Process"); - dialog.setMessage("Select a Process to attach debugger to:"); - IProcessList plist = CCorePlugin.getDefault().getProcessList(); - if (plist == null) { - MessageDialog.openError(shell, "CDT Launch Error", "Current platform does not support listing processes"); - return; - } - dialog.setElements(plist.getProcessList()); - if (dialog.open() == ElementListSelectionDialog.OK) { - IProcessInfo info = (IProcessInfo) dialog.getFirstResult(); - if ( info != null ) { - pid[0] = info.getPid(); - } - } - } - }); - return pid[0]; - } - - /** - * Performs a runtime exec on the given command line in the context - * of the specified working directory, and returns - * the resulting process. If the current runtime does not support the - * specification of a working directory, the status handler for error code - * ERR_WORKING_DIRECTORY_NOT_SUPPORTED is queried to see if the - * exec should be re-executed without specifying a working directory. - * - * @param cmdLine the command line - * @param workingDirectory the working directory, or null - * @return the resulting process or null if the exec is - * cancelled - * @see Runtime - */ - protected Process exec(String[] cmdLine, Properties environ, File workingDirectory) throws CoreException { - Process p = null; - Properties props = getDefaultEnvironment(); - props.putAll(expandEnvironment(environ)); - String[] envp = null; - ArrayList envList = new ArrayList(); - Enumeration names = props.propertyNames(); - if (names != null) { - while (names.hasMoreElements()) { - String key = (String) names.nextElement(); - envList.add(key + "=" + props.getProperty(key)); - } - envp = (String[]) envList.toArray(new String[envList.size()]); - } - try { - - if (workingDirectory == null) { - p = ProcessFactory.getFactory().exec(cmdLine, envp); - } else { - p = ProcessFactory.getFactory().exec(cmdLine, envp, workingDirectory); - } - } catch (IOException e) { - if (p != null) { - p.destroy(); - } - abort("Error starting process", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); - } catch (NoSuchMethodError e) { - //attempting launches on 1.2.* - no ability to set working directory - - IStatus status = - new Status( - IStatus.ERROR, - LaunchUIPlugin.getUniqueIdentifier(), - ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_NOT_SUPPORTED, - "Eclipse runtime does not support working directory", - e); - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); - - if (handler != null) { - Object result = handler.handleStatus(status, this); - if (result instanceof Boolean && ((Boolean) result).booleanValue()) { - p = exec(cmdLine, environ, null); - } - } - } - return p; - } - - protected String getPluginID() { - return LaunchUIPlugin.getUniqueIdentifier(); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java deleted file mode 100644 index 0f0ae625317..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/AbstractCDebuggerTab.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.launch.internal.ui; - -import java.util.Map; - -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.launch.ui.CLaunchConfigurationTab; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - -public abstract class AbstractCDebuggerTab extends CLaunchConfigurationTab { - - protected ILaunchConfiguration fLaunchConfiguration; - protected ILaunchConfigurationWorkingCopy fWorkingCopy; - protected ICDebugConfiguration fCurrentDebugConfig; - - // Dynamic Debugger UI widgets - protected ILaunchConfigurationTab fDynamicTab; - protected Composite fDynamicTabHolder; - private boolean fInitDefaults; - - protected void setDebugConfig(ICDebugConfiguration config) { - fCurrentDebugConfig = config; - } - - protected ICDebugConfiguration getDebugConfig() { - return fCurrentDebugConfig; - } - - protected ILaunchConfigurationTab getDynamicTab() { - return fDynamicTab; - } - - protected void setDynamicTab(ILaunchConfigurationTab tab) { - fDynamicTab = tab; - } - - protected Composite getDynamicTabHolder() { - return fDynamicTabHolder; - } - - protected void setDynamicTabHolder(Composite tabHolder) { - fDynamicTabHolder = tabHolder; - } - - protected ILaunchConfigurationWorkingCopy getLaunchConfigurationWorkingCopy() { - return fWorkingCopy; - } - - protected void setLaunchConfiguration(ILaunchConfiguration launchConfiguration) { - fLaunchConfiguration = launchConfiguration; - } - - protected ILaunchConfiguration getLaunchConfiguration() { - return fLaunchConfiguration; - } - - protected void setLaunchConfigurationWorkingCopy(ILaunchConfigurationWorkingCopy workingCopy) { - fWorkingCopy = workingCopy; - } - - /** - * Overridden here so that any error message in the dynamic UI gets returned. - * - * @see ILaunchConfigurationTab#getErrorMessage() - */ - public String getErrorMessage() { - ILaunchConfigurationTab tab = getDynamicTab(); - if ((super.getErrorMessage() != null) || (tab == null)) { - return super.getErrorMessage(); - } else { - return tab.getErrorMessage(); - } - } - - /** - * Notification that the user changed the selection of the Debugger. - */ - protected void handleDebuggerChanged() { - loadDynamicDebugArea(); - - // always set the newly created area with defaults - ILaunchConfigurationWorkingCopy wc = getLaunchConfigurationWorkingCopy(); - if (getDynamicTab() == null) { - // remove any debug specfic args from the config - if (wc == null) { - if (getLaunchConfiguration().isWorkingCopy()) { - wc = (ILaunchConfigurationWorkingCopy) getLaunchConfiguration(); - } - } - if (wc != null) { - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null); - } - } else { - if (wc == null) { - try { - if (getLaunchConfiguration().isWorkingCopy()) { - setLaunchConfigurationWorkingCopy((ILaunchConfigurationWorkingCopy)getLaunchConfiguration()); - } else { - setLaunchConfigurationWorkingCopy(getLaunchConfiguration().getWorkingCopy()); - } - wc = getLaunchConfigurationWorkingCopy(); - - } catch (CoreException e) { - return; - } - } - if (initDefaults()) { - getDynamicTab().setDefaults(wc); - } - setInitializeDefault(false); - getDynamicTab().initializeFrom(wc); - } - updateLaunchConfigurationDialog(); - } - - /** - * Show the contributed piece of UI that was registered for the debugger id - * of the currently selected debugger. - */ - protected void loadDynamicDebugArea() { - // Dispose of any current child widgets in the tab holder area - Control[] children = getDynamicTabHolder().getChildren(); - for (int i = 0; i < children.length; i++) { - children[i].dispose(); - } - - // Retrieve the dynamic UI for the current Debugger - ICDebugConfiguration debugConfig = getConfigForCurrentDebugger(); - if (debugConfig == null) { - setDynamicTab(null); - } else { - setDynamicTab(CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID())); - ICDebugConfiguration oldConfig = getDebugConfig(); - if ( oldConfig != null && oldConfig != debugConfig ) { - setInitializeDefault(true); - } - } - setDebugConfig(debugConfig); - if (getDynamicTab() == null) { - return; - } - // Ask the dynamic UI to create its Control - getDynamicTab().setLaunchConfigurationDialog(getLaunchConfigurationDialog()); - getDynamicTab().createControl(getDynamicTabHolder()); - getDynamicTab().getControl().setVisible(true); - getDynamicTabHolder().layout(true); - } - - abstract protected ICDebugConfiguration getConfigForCurrentDebugger(); - abstract public void createControl(Composite parent); - - public void initializeFrom(ILaunchConfiguration config) { - setLaunchConfiguration(config); - ILaunchConfigurationTab dynamicTab = getDynamicTab(); - if (dynamicTab != null) { - dynamicTab.initializeFrom(config); - } - } - - public void performApply(ILaunchConfigurationWorkingCopy config) { - if (getDebugConfig() != null) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, getDebugConfig().getID()); - ILaunchConfigurationTab dynamicTab = getDynamicTab(); - if (dynamicTab == null) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, (Map) null); - } else { - dynamicTab.performApply(config); - } - } - } - - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - setLaunchConfigurationWorkingCopy(config); - ILaunchConfigurationTab dynamicTab = getDynamicTab(); - if (dynamicTab != null) { - dynamicTab.setDefaults(config); - setInitializeDefault(false); - } - } - - public boolean isValid(ILaunchConfiguration config) { - setErrorMessage(null); - setMessage(null); - if (getDebugConfig() == null) { - setErrorMessage("No debugger available"); - return false; - } - - ILaunchConfigurationTab dynamicTab = getDynamicTab(); - if (dynamicTab != null) { - return dynamicTab.isValid(config); - } - return true; - } - - protected void setInitializeDefault(boolean init) { - fInitDefaults = init; - } - - protected boolean initDefaults() { - return fInitDefaults; - } - - public Image getImage() { - return LaunchImages.get(LaunchImages.IMG_VIEW_DEBUGGER_TAB); - } - - public String getName() { - return "Debugger"; - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java deleted file mode 100644 index 2013c1225fb..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/CoreFileCLaunchConfigurationTabGroup.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.cdt.launch.internal.ui; - -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.launch.ui.CMainTab; -import org.eclipse.cdt.launch.ui.CSourceLookupTab; -import org.eclipse.cdt.launch.ui.CorefileDebuggerTab; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -/** - * Insert the type's description here. - * @see AbstractLaunchConfigurationTabGroup - */ -public class CoreFileCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { - - /** - * Insert the method's description here. - * @see AbstractLaunchConfigurationTabGroup#createTabs - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - new CMainTab(), - new CorefileDebuggerTab(), - new CSourceLookupTab(), - new CommonTab() - }; - setTabs(tabs); - } - - public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { - // This configuration should work for all platforms - configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, "*"); - super.setDefaults(configuration); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java deleted file mode 100644 index 928cd34c8be..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.eclipse.cdt.launch.internal.ui; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; - -/* - * (c) Copyright QN Software Systems Ltd. 2002. - * All Rights Reserved. - */ -public class LaunchImages { - private static final String NAME_PREFIX= LaunchUIPlugin.PLUGIN_ID + '.'; - private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length(); - - // The plugin registry - private static ImageRegistry imageRegistry = new ImageRegistry(); - - // Subdirectory (under the package containing this class) where 16 color images are - private static URL fgIconBaseURL; - static { - try { - fgIconBaseURL= new URL(LaunchUIPlugin.getDefault().getDescriptor().getInstallURL(), "icons/" ); - } catch (MalformedURLException e) { - //LaunchUIPlugin.getDefault().log(e); - } - } - - private static final String T_TABS = "tabs/"; - - public static String IMG_VIEW_MAIN_TAB = NAME_PREFIX + "main_tab.gif"; - public static String IMG_VIEW_ARGUMENTS_TAB = NAME_PREFIX + "arguments_tab.gif"; - public static String IMG_VIEW_ENVIRONMENT_TAB = NAME_PREFIX + "environment_tab.gif"; - public static String IMG_VIEW_DEBUGGER_TAB = NAME_PREFIX + "debugger_tab.gif"; - public static String IMG_VIEW_SOURCE_TAB = NAME_PREFIX + "source_tab.gif"; - - public static final ImageDescriptor DESC_TAB_MAIN= createManaged(T_TABS, IMG_VIEW_MAIN_TAB); - public static final ImageDescriptor DESC_TAB_ARGUMENTS = createManaged(T_TABS, IMG_VIEW_ARGUMENTS_TAB); - public static final ImageDescriptor DESC_TAB_ENVIRONMENT = createManaged(T_TABS, IMG_VIEW_ENVIRONMENT_TAB); - public static final ImageDescriptor DESC_TAB_DEBUGGER = createManaged(T_TABS, IMG_VIEW_DEBUGGER_TAB); - public static final ImageDescriptor DESC_TAB_SOURCE = createManaged(T_TABS, IMG_VIEW_SOURCE_TAB); - - public static void initialize() { - } - - private static ImageDescriptor createManaged(String prefix, String name) { - return createManaged(imageRegistry, prefix, name); - } - - private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) { - ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH))); - registry.put(name, result); - return result; - } - - public static Image get(String key) { - return imageRegistry.get(key); - } - - - private static URL makeIconFileURL(String prefix, String name) { - StringBuffer buffer= new StringBuffer(prefix); - buffer.append(name); - try { - return new URL(fgIconBaseURL, buffer.toString()); - } catch (MalformedURLException e) { - CUIPlugin.getDefault().log(e); - return null; - } - } - - /** - * Helper method to access the image registry from the JavaPlugin class. - */ - static ImageRegistry getImageRegistry() { - return imageRegistry; - } -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java deleted file mode 100644 index c6ccf3728a3..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java +++ /dev/null @@ -1,209 +0,0 @@ -package org.eclipse.cdt.launch.internal.ui; - -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.launch.AbstractCLaunchDelegate; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -public class LaunchUIPlugin extends AbstractUIPlugin - implements IDebugEventSetListener { - public static final String PLUGIN_ID = LaunchUIPlugin.getUniqueIdentifier(); - - /** - * Launch UI plug-in instance - */ - private static LaunchUIPlugin fgPlugin; - private static Shell debugDialogShell; - - /** - * Constructor for LaunchUIPlugin. - * @param descriptor - */ - public LaunchUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - setDefault(this); - } - - /** - * Sets the Java Debug UI plug-in instance - * - * @param plugin the plugin instance - */ - private static void setDefault(LaunchUIPlugin plugin) { - fgPlugin = plugin; - } - - /** - * Returns the Java Debug UI plug-in instance - * - * @return the Java Debug UI plug-in instance - */ - public static LaunchUIPlugin getDefault() { - return fgPlugin; - } - - public static Shell getShell() { - if (getActiveWorkbenchShell() != null) { - return getActiveWorkbenchShell(); - } else { - if ( debugDialogShell != null ) { - if (!debugDialogShell.isDisposed() ) - return debugDialogShell; - debugDialogShell = null; - } - IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows(); - return windows[0].getShell(); - } - } - - public static void setDialogShell(Shell shell) { - debugDialogShell = shell; - } - - /** - * Convenience method which returns the unique identifier of this plugin. - */ - public static String getUniqueIdentifier() { - if (getDefault() == null) { - // If the default instance is not yet initialized, - // return a static identifier. This identifier must - // match the plugin id defined in plugin.xml - return "org.eclipse.cdt.launch"; //$NON-NLS-1$ - } - return getDefault().getDescriptor().getUniqueIdentifier(); - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status status to log - */ - public static void log(IStatus status) { - getDefault().getLog().log(status); - } - /** - * Logs an internal error with the specified message. - * - * @param message the error message to log - */ - public static void logErrorMessage(String message) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null)); - } - - /** - * Logs an internal error with the specified throwable - * - * @param e the exception to be logged - */ - public static void log(Throwable e) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e)); //$NON-NLS-1$ - } - - /** - * Returns the active workbench window - * - * @return the active workbench window - */ - public static IWorkbenchWindow getActiveWorkbenchWindow() { - return getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - public static IWorkbenchPage getActivePage() { - IWorkbenchWindow w = getActiveWorkbenchWindow(); - if (w != null) { - return w.getActivePage(); - } - return null; - } - - /** - * Returns the active workbench shell or null if none - * - * @return the active workbench shell or null if none - */ - public static Shell getActiveWorkbenchShell() { - IWorkbenchWindow window = getActiveWorkbenchWindow(); - if (window != null) { - return window.getShell(); - } - return null; - } - - public static void errorDialog( String message, IStatus status ) { - log(status); - Shell shell = getActiveWorkbenchShell(); - if (shell != null) { - ErrorDialog.openError(shell, "Error", message, status); - } - } - - public static void errorDialog(String message, Throwable t) { - log(t); - Shell shell = getActiveWorkbenchShell(); - if (shell != null) { - IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 1, t.getMessage(), null); //$NON-NLS-1$ - ErrorDialog.openError(shell, "Error", message, status); - } - } - /** - * @see org.eclipse.core.runtime.Plugin#shutdown() - */ - public void shutdown() throws CoreException { - DebugPlugin.getDefault().removeDebugEventListener(this); - super.shutdown(); - } - - /** - * @see org.eclipse.core.runtime.Plugin#startup() - */ - public void startup() throws CoreException { - super.startup(); - DebugPlugin.getDefault().addDebugEventListener(this); - } - - /** - * Notifies this listener of the given debug events. - * All of the events in the given event collection occurred - * at the same location the program be run or debugged. - * - * @param events the debug events - */ - public void handleDebugEvents(DebugEvent[] events) { - for (int i = 0; i < events.length; i++) { - if (events[i].getKind() == DebugEvent.TERMINATE) { - Object o = events[i].getSource(); - if (o instanceof IProcess) { - IProcess proc = (IProcess)o; - ICProject cproject = null; - try { - cproject = AbstractCLaunchDelegate.getCProject(proc.getLaunch().getLaunchConfiguration()); - } catch (CoreException e) { - } - if (cproject != null) { - try { - cproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - } - } - } - } - } - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java deleted file mode 100644 index 278af2b4c64..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LocalCLaunchConfigurationTabGroup.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.cdt.launch.internal.ui; - -import org.eclipse.cdt.launch.ui.CArgumentsTab; -import org.eclipse.cdt.launch.ui.CDebuggerTab; -import org.eclipse.cdt.launch.ui.CEnvironmentTab; -import org.eclipse.cdt.launch.ui.CMainTab; -import org.eclipse.cdt.launch.ui.CSourceLookupTab; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -/** - * Insert the type's description here. - * @see AbstractLaunchConfigurationTabGroup - */ -public class LocalCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { - - /** - * Insert the method's description here. - * @see AbstractLaunchConfigurationTabGroup#createTabs - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - new CMainTab(), - new CArgumentsTab(), - new CEnvironmentTab(), - new CDebuggerTab(), - new CSourceLookupTab(), - new CommonTab() - }; - setTabs(tabs); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java deleted file mode 100644 index 5867bae887c..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java +++ /dev/null @@ -1,417 +0,0 @@ -package org.eclipse.cdt.launch.internal.ui; -import java.io.File; - -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.launch.AbstractCLaunchDelegate; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ContainerSelectionDialog; - -/** - * A control for setting the working directory associated with a launch - * configuration. - */ -public class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab { - - // Working directory UI widgets - protected Label fWorkingDirLabel; - - // Local directory - protected Button fLocalDirButton; - protected Text fWorkingDirText; - protected Button fWorkingDirBrowseButton; - - - // Workspace directory - protected Button fWorkspaceDirButton; - protected Text fWorkspaceDirText; - protected Button fWorkspaceDirBrowseButton; - - // use default button - protected Button fUseDefaultWorkingDirButton; - - protected static final String EMPTY_STRING = ""; //$NON-NLS-1$ - - /** - * The last launch config this tab was initialized from - */ - protected ILaunchConfiguration fLaunchConfiguration; - - /** - * @see ILaunchConfigurationTab#createControl(Composite) - */ - public void createControl(Composite parent) { - - Composite workingDirComp = new Composite(parent, SWT.NONE); -// WorkbenchHelp.setHelp(workingDirComp, IJavaDebugHelpContextIds.WORKING_DIRECTORY_BLOCK);; - GridLayout workingDirLayout = new GridLayout(); - workingDirLayout.numColumns = 3; - workingDirLayout.marginHeight = 0; - workingDirLayout.marginWidth = 0; - workingDirComp.setLayout(workingDirLayout); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - workingDirComp.setLayoutData(gd); - setControl(workingDirComp); - - fWorkingDirLabel = new Label(workingDirComp, SWT.NONE); - fWorkingDirLabel.setText("Wor&king directory:"); - gd = new GridData(); - gd.horizontalSpan = 3; - fWorkingDirLabel.setLayoutData(gd); - - fUseDefaultWorkingDirButton = new Button(workingDirComp,SWT.CHECK); - fUseDefaultWorkingDirButton.setText("Use de&fault working directory"); - gd = new GridData(); - gd.horizontalSpan = 3; - fUseDefaultWorkingDirButton.setLayoutData(gd); - fUseDefaultWorkingDirButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleUseDefaultWorkingDirButtonSelected(); - } - }); - - fLocalDirButton = createRadioButton(workingDirComp, "&Local directory"); - fLocalDirButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleLocationButtonSelected(); - } - }); - - fWorkingDirText = new Text(workingDirComp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fWorkingDirText.setLayoutData(gd); - fWorkingDirText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - updateLaunchConfigurationDialog(); - } - }); - - fWorkingDirBrowseButton = createPushButton(workingDirComp, "&Browse", null); - fWorkingDirBrowseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleWorkingDirBrowseButtonSelected(); - } - }); - - fWorkspaceDirButton = createRadioButton(workingDirComp, "Works&pace"); - fWorkspaceDirButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleLocationButtonSelected(); - } - }); - - fWorkspaceDirText = new Text(workingDirComp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fWorkspaceDirText.setLayoutData(gd); - fWorkspaceDirText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - updateLaunchConfigurationDialog(); - } - }); - - fWorkspaceDirBrowseButton = createPushButton(workingDirComp, "B&rowse...", null); - fWorkspaceDirBrowseButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleWorkspaceDirBrowseButtonSelected(); - } - }); - - } - - /** - * @see ILaunchConfigurationTab#dispose() - */ - public void dispose() { - } - - /** - * Show a dialog that lets the user select a working directory - */ - protected void handleWorkingDirBrowseButtonSelected() { - DirectoryDialog dialog = new DirectoryDialog(getShell()); - dialog.setMessage("Select a &working directory for the launch configuration"); - String currentWorkingDir = fWorkingDirText.getText(); - if (!currentWorkingDir.trim().equals(EMPTY_STRING)) { - File path = new File(currentWorkingDir); - if (path.exists()) { - dialog.setFilterPath(currentWorkingDir); - } - } - - String selectedDirectory = dialog.open(); - if (selectedDirectory != null) { - fWorkingDirText.setText(selectedDirectory); - } - } - - /** - * Show a dialog that lets the user select a working directory from - * the workspace - */ - protected void handleWorkspaceDirBrowseButtonSelected() { - ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), - ResourcesPlugin.getWorkspace().getRoot(), - false, - "Select a &workspace relative working directory"); - - IContainer currentContainer = getContainer(); - if (currentContainer != null) { - IPath path = currentContainer.getFullPath(); - dialog.setInitialSelections(new Object[] {path}); - } - - dialog.showClosedProjects(false); - dialog.open(); - Object[] results = dialog.getResult(); - if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) { - IPath path = (IPath)results[0]; - String containerName = path.makeRelative().toString(); - fWorkspaceDirText.setText(containerName); - } - } - - /** - * Returns the selected workspace container,or null - */ - protected IContainer getContainer() { - IResource res = getResource(); - if (res instanceof IContainer) { - return (IContainer)res; - } - return null; - } - - /** - * Returns the selected workspace resource, or null - */ - protected IResource getResource() { - IPath path = new Path(fWorkspaceDirText.getText()); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - return root.findMember(path); - } - - /** - * The "local directory" or "workspace directory" button has been selected. - */ - protected void handleLocationButtonSelected() { - if (!isDefaultWorkingDirectory()) { - boolean local = isLocalWorkingDirectory(); - fWorkingDirText.setEnabled(local); - fWorkingDirBrowseButton.setEnabled(local); - fWorkspaceDirText.setEnabled(!local); - fWorkspaceDirBrowseButton.setEnabled(!local); - } - updateLaunchConfigurationDialog(); - } - - /** - * The default working dir check box has been toggled. - */ - protected void handleUseDefaultWorkingDirButtonSelected() { - if (isDefaultWorkingDirectory()) { - setDefaultWorkingDir(); - fLocalDirButton.setEnabled(false); - fWorkingDirText.setEnabled(false); - fWorkingDirBrowseButton.setEnabled(false); - fWorkspaceDirButton.setEnabled(false); - fWorkspaceDirText.setEnabled(false); - fWorkspaceDirBrowseButton.setEnabled(false); - } else { - fLocalDirButton.setEnabled(true); - fWorkspaceDirButton.setEnabled(true); - handleLocationButtonSelected(); - } - } - - /** - * Sets the default working directory - */ - protected void setDefaultWorkingDir() { - ILaunchConfiguration config = getLaunchConfiguration(); - if (config != null) { - ICProject cProject = null; - try { - cProject = AbstractCLaunchDelegate.getCProject(config); - } catch (CoreException e) { - } - if (cProject != null) { - fWorkspaceDirText.setText(cProject.getPath().makeRelative().toOSString()); - fLocalDirButton.setSelection(false); - fWorkspaceDirButton.setSelection(true); - return; - } - } - - fWorkingDirText.setText(System.getProperty("user.dir")); - fLocalDirButton.setSelection(true); - fWorkspaceDirButton.setSelection(false); - } - - /** - * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration config) { - - setErrorMessage(null); - setMessage(null); - - if (isLocalWorkingDirectory()) { - String workingDirPath = fWorkingDirText.getText().trim(); - if (workingDirPath.length() > 0) { - File dir = new File(workingDirPath); - if (!dir.exists()) { - setErrorMessage("Working directory does not exist"); - return false; - } - if (!dir.isDirectory()) { - setErrorMessage("Working directory is not a directory_11"); - return false; - } - } - } else { - if (getContainer() == null) { - setErrorMessage("Specified project or folder does not exist."); - return false; - } - } - - return true; - } - - /** - * Defaults are empty. - * - * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null); - } - - /** - * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration configuration) { - setLaunchConfiguration(configuration); - try { - String wd = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null); - fWorkspaceDirText.setText(EMPTY_STRING); - fWorkingDirText.setText(EMPTY_STRING); - if (wd == null) { - fUseDefaultWorkingDirButton.setSelection(true); - } else { - IPath path = new Path(wd); - if (path.isAbsolute()) { - fWorkingDirText.setText(wd); - fLocalDirButton.setSelection(true); - fWorkspaceDirButton.setSelection(false); - } else { - fWorkspaceDirText.setText(wd); - fWorkspaceDirButton.setSelection(true); - fLocalDirButton.setSelection(false); - } - fUseDefaultWorkingDirButton.setSelection(false); - } - handleUseDefaultWorkingDirButtonSelected(); - } catch (CoreException e) { - setErrorMessage("Exception occurred reading configuration " + e.getStatus().getMessage()); - LaunchUIPlugin.log(e); - } - } - - /** - * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - String wd = null; - if (!isDefaultWorkingDirectory()) { - if (isLocalWorkingDirectory()) { - wd = getAttributeValueFrom(fWorkingDirText); - } else { - IPath path = new Path(fWorkspaceDirText.getText()); - path = path.makeRelative(); - wd = path.toString(); - } - } - configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, wd); - } - - /** - * Retuns the string in the text widget, or null if empty. - * - * @return text or null - */ - protected String getAttributeValueFrom(Text text) { - String content = text.getText().trim(); - if (content.length() > 0) { - return content; - } - return null; - } - - /** - * @see ILaunchConfigurationTab#getName() - */ - public String getName() { - return "Working Directory"; - } - - /** - * Returns whether the default working directory is to be used - */ - protected boolean isDefaultWorkingDirectory() { - return fUseDefaultWorkingDirButton.getSelection(); - } - - /** - * Returns whether the working directory is local - */ - protected boolean isLocalWorkingDirectory() { - return fLocalDirButton.getSelection(); - } - - /** - * Sets the java project currently specified by the - * given launch config, if any. - */ - protected void setLaunchConfiguration(ILaunchConfiguration config) { - fLaunchConfiguration = config; - } - - /** - * Returns the current java project context - */ - protected ILaunchConfiguration getLaunchConfiguration() { - return fLaunchConfiguration; - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() - */ - protected void updateLaunchConfigurationDialog() { - super.updateLaunchConfigurationDialog(); - } - -} - diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java deleted file mode 100644 index 71d79f61ce4..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java +++ /dev/null @@ -1,186 +0,0 @@ -package org.eclipse.cdt.launch.ui; - -/* - * (c) Copyright QNX Software System 2002. - * All Rights Reserved. - */ - -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.launch.internal.ui.LaunchImages; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.cdt.launch.internal.ui.WorkingDirectoryBlock; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * A launch configuration tab that displays and edits program arguments, - * and working directory launch configuration attributes. - *

          - * This class may be instantiated. This class is not intended to be subclassed. - *

          - */ -public class CArgumentsTab extends CLaunchConfigurationTab { - - // Program arguments UI widgets - protected Label fPrgmArgumentsLabel; - protected Text fPrgmArgumentsText; - - // Working directory - protected WorkingDirectoryBlock fWorkingDirectoryBlock = new WorkingDirectoryBlock(); - - /** - * @see ILaunchConfigurationTab#createControl(Composite) - */ - public void createControl(Composite parent) { - - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - - WorkbenchHelp.setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_ARGUMNETS_TAB); - - GridLayout topLayout = new GridLayout(); - comp.setLayout(topLayout); - GridData gd; - - createVerticalSpacer(comp, 1); - - fPrgmArgumentsLabel = new Label(comp, SWT.NONE); - fPrgmArgumentsLabel.setText("C/C++ Program Arguments:"); - fPrgmArgumentsText = new Text(comp, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.heightHint = 40; - fPrgmArgumentsText.setLayoutData(gd); - fPrgmArgumentsText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - updateLaunchConfigurationDialog(); - } - }); - - createVerticalSpacer(comp, 1); - - fWorkingDirectoryBlock.createControl(comp); - } - - /** - * @see ILaunchConfigurationTab#dispose() - */ - public void dispose() { - } - - /** - * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration config) { - return fWorkingDirectoryBlock.isValid(config); - } - - /** - * Defaults are empty. - * - * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); - } - - /** - * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration configuration) { - try { - fPrgmArgumentsText.setText(configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$ - fWorkingDirectoryBlock.initializeFrom(configuration); - } - catch (CoreException e) { - setErrorMessage("Exception occurred reading configuration " + e.getStatus().getMessage()); - LaunchUIPlugin.log(e); - } - } - - /** - * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - configuration.setAttribute( - ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, - getAttributeValueFrom(fPrgmArgumentsText)); - fWorkingDirectoryBlock.performApply(configuration); - } - - /** - * Retuns the string in the text widget, or null if empty. - * - * @return text or null - */ - protected String getAttributeValueFrom(Text text) { - String content = text.getText().trim(); - if (content.length() > 0) { - return content; - } - return null; - } - - /** - * @see ILaunchConfigurationTab#getName() - */ - public String getName() { - return "Arguments"; - } - - /** - * @see ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog) - */ - public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) { - super.setLaunchConfigurationDialog(dialog); - fWorkingDirectoryBlock.setLaunchConfigurationDialog(dialog); - } - /** - * @see ILaunchConfigurationTab#getErrorMessage() - */ - public String getErrorMessage() { - String m = super.getErrorMessage(); - if (m == null) { - return fWorkingDirectoryBlock.getErrorMessage(); - } - return m; - } - - /** - * @see ILaunchConfigurationTab#getMessage() - */ - public String getMessage() { - String m = super.getMessage(); - if (m == null) { - return fWorkingDirectoryBlock.getMessage(); - } - return m; - } - - /** - * @see ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return LaunchImages.get(LaunchImages.IMG_VIEW_ARGUMENTS_TAB); - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() - */ - protected void updateLaunchConfigurationDialog() { - super.updateLaunchConfigurationDialog(); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java deleted file mode 100644 index 2fbdc664550..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.launch.ui; - -import java.util.Arrays; -import java.util.Comparator; - -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.help.WorkbenchHelp; - -public class CDebuggerTab extends AbstractCDebuggerTab { - - protected Combo fDCombo; - protected Button fStopInMain; - protected Button fAttachButton; - protected Button fRunButton; - protected Button fVarBookKeeping; - - private final boolean DEFAULT_STOP_AT_MAIN = true; - - public void createControl(Composite parent) { - GridData gd; - - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - - WorkbenchHelp.setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB); - - GridLayout layout = new GridLayout(2, false); - comp.setLayout(layout); - - Composite comboComp = new Composite(comp, SWT.NONE); - layout = new GridLayout(2, false); - comboComp.setLayout(layout); - Label dlabel = new Label(comboComp, SWT.NONE); - dlabel.setText("Debugger:"); - fDCombo = new Combo(comboComp, SWT.DROP_DOWN | SWT.READ_ONLY); - fDCombo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateComboFromSelection(); - } - }); - - Composite radioComp = new Composite(comp, SWT.NONE); - GridLayout radioLayout = new GridLayout(2, true); - radioLayout.marginHeight = 0; - radioLayout.marginWidth = 0; - radioComp.setLayout(radioLayout); - fRunButton = createRadioButton(radioComp, "Run program in debugger."); - fRunButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (fRunButton.getSelection() == true) { - fStopInMain.setEnabled(true); - } else { - fStopInMain.setEnabled(false); - } - updateLaunchConfigurationDialog(); - } - }); - fAttachButton = createRadioButton(radioComp, "Attach to running process."); - fAttachButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - - Composite optionComp = new Composite(comp, SWT.NONE); - layout = new GridLayout(2, false); - optionComp.setLayout(layout); - gd = new GridData(); - gd.horizontalSpan = 2; - optionComp.setLayoutData(gd); - - fStopInMain = new Button(optionComp, SWT.CHECK); - fStopInMain.setText("Stop at main() on startup."); - fStopInMain.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - fVarBookKeeping = new Button(optionComp, SWT.CHECK); - fVarBookKeeping.setText("Automatically track the values of variables."); - fVarBookKeeping.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN); - debuggerGroup.setText("Debugger Options"); - setDynamicTabHolder(debuggerGroup); - GridLayout tabHolderLayout = new GridLayout(); - tabHolderLayout.marginHeight = 0; - tabHolderLayout.marginWidth = 0; - tabHolderLayout.numColumns = 1; - getDynamicTabHolder().setLayout(tabHolderLayout); - gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 2; - getDynamicTabHolder().setLayoutData(gd); - } - - protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) { - ICDebugConfiguration[] debugConfigs; - String configPlatform = getPlatform(config); - String programCPU = "native"; - ICElement ce = getContext(config, configPlatform); - if (ce instanceof IBinary) { - IBinary bin = (IBinary) ce; - programCPU = bin.getCPU(); - } - fDCombo.removeAll(); - debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations(); - Arrays.sort(debugConfigs, new Comparator() { - public int compare(Object o1, Object o2) { - ICDebugConfiguration ic1 = (ICDebugConfiguration) o1; - ICDebugConfiguration ic2 = (ICDebugConfiguration) o2; - return ic1.getName().compareTo(ic2.getName()); - } - }); - int x = 0; - int selndx = -1; - for (int i = 0; i < debugConfigs.length; i++) { - if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN) - || debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { - String debuggerPlatform = debugConfigs[i].getPlatform(); - boolean isNative = configPlatform.equals(BootLoader.getOS()); - if (debuggerPlatform.equalsIgnoreCase(configPlatform) - || (isNative && debuggerPlatform.equalsIgnoreCase("native"))) { - if (debugConfigs[i].supportsCPU(programCPU)) { - fDCombo.add(debugConfigs[i].getName()); - fDCombo.setData(Integer.toString(x), debugConfigs[i]); - // select first exact matching debugger for platform or requested selection - if ((selndx == -1 && debuggerPlatform.equalsIgnoreCase(configPlatform)) - || selection.equals(debugConfigs[i].getID())) { - selndx = x; - } - x++; - } - } - } - } - // if no selection meaning nothing in config the force initdefault on tab - setInitializeDefault(selection.equals("") ? true : false); - - fDCombo.select(selndx == -1 ? 0 : selndx); - //The behaviour is undefined for if the callbacks should be triggered for this, - //so to avoid unnecessary confusion, we force an update. - updateComboFromSelection(); - fDCombo.getParent().layout(true); - } - - protected void updateComboFromSelection() { - handleDebuggerChanged(); - ICDebugConfiguration debugConfig = getConfigForCurrentDebugger(); - if (debugConfig != null) { - fRunButton.setEnabled(debugConfig.supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)); - fRunButton.setSelection(false); - fAttachButton.setEnabled(debugConfig.supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)); - fAttachButton.setSelection(false); - try { - String mode = - getLaunchConfiguration().getAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); - if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN) && fRunButton.isEnabled()) { - fRunButton.setSelection(true); - } else if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH) && fAttachButton.isEnabled()) { - fAttachButton.setSelection(true); - } - if (fRunButton.getSelection() == true) { - fStopInMain.setEnabled(true); - } else { - fStopInMain.setEnabled(false); - } - } catch (CoreException ex) { - } - } - updateLaunchConfigurationDialog(); - } - - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - super.setDefaults(config); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, DEFAULT_STOP_AT_MAIN); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false); - config.setAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); - } - - public void initializeFrom(ILaunchConfiguration config) { - super.initializeFrom(config); - try { - String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); - if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) { - loadDebuggerComboBox(config, id); - } - String mode = - config.getAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); - if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) { - fRunButton.setSelection(true); - fAttachButton.setSelection(false); - } else if (mode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH)) { - fAttachButton.setSelection(true); - fRunButton.setSelection(false); - } - if (config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, DEFAULT_STOP_AT_MAIN) == true) { - fStopInMain.setSelection(true); - } - if (config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false) == false) { - fVarBookKeeping.setSelection(true); - } - } catch (CoreException e) { - return; - } - } - - public void performApply(ILaunchConfigurationWorkingCopy config) { - if (isValid(config)) { - super.performApply(config); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, !fVarBookKeeping.getSelection()); - if (fAttachButton.getSelection() == true) { - config.setAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_ATTACH); - } else { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, fStopInMain.getSelection()); - config.setAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN); - } - } - } - - public boolean isValid(ILaunchConfiguration config) { - if (!validateDebuggerConfig(config)) { - setErrorMessage("No debugger available"); - return false; - } - if (super.isValid(config) == false) { - return false; - } - if (!fRunButton.getSelection() && !fAttachButton.getSelection()) { - setErrorMessage("Select a Debug mode."); - return false; - } - return true; - } - - private boolean validateDebuggerConfig(ILaunchConfiguration config) { - String platform = getPlatform(config); - ICElement ce = getContext(config, null); - String projectPlatform = getPlatform(config); - String projectCPU = "native"; - if (ce != null) { - if (ce instanceof IBinary) { - IBinary bin = (IBinary) ce; - projectCPU = bin.getCPU(); - } - } - ICDebugConfiguration debugConfig = getDebugConfig(); - if (debugConfig == null) { - return false; - } - String debuggerPlatform = debugConfig.getPlatform(); - boolean isNative = platform.equals(projectPlatform); - if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (isNative && debuggerPlatform.equalsIgnoreCase("native"))) { - if (debugConfig.supportsCPU(projectCPU)) { - return true; - } - } - return false; - } - - /** - * Return the class that implements ILaunchConfigurationTab - * that is registered against the debugger id of the currently selected debugger. - */ - protected ICDebugConfiguration getConfigForCurrentDebugger() { - int selectedIndex = fDCombo.getSelectionIndex(); - return (ICDebugConfiguration) fDCombo.getData(Integer.toString(selectedIndex)); - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() - */ - protected void updateLaunchConfigurationDialog() { - super.updateLaunchConfigurationDialog(); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java deleted file mode 100644 index d889e693471..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java +++ /dev/null @@ -1,397 +0,0 @@ -package org.eclipse.cdt.launch.ui; - -/* - * (c) Copyright QNX Software System 2002. - * All Rights Reserved. - */ - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.Map; -import java.util.Properties; - -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.launch.internal.ui.LaunchImages; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.FontMetrics; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.help.WorkbenchHelp; - -public class CEnvironmentTab extends CLaunchConfigurationTab { - - protected Properties fElements; - - protected TableViewer fVariableList; - protected Button fBtnNew; - protected Button fBtnEdit; - protected Button fBtnRemove; - - class SimpleSorter extends ViewerSorter { - public boolean isSorterProperty(Object element, Object property) { - return true; - } - } - - class ElementsContentProvider implements IStructuredContentProvider { - Object input = null; - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - public void dispose() { - } - - public Object[] getElements(Object parent) { - return fElements.entrySet().toArray(); - } - } - - class ElementsLabelProvider extends LabelProvider implements ITableLabelProvider { - - public Image getColumnImage(Object element, int columnIndex) { - return null; - } - - public String getColumnText(Object element, int columnIndex) { - if (element != null && element instanceof Map.Entry) { - return (columnIndex == 0) ? ((Map.Entry) element).getKey().toString() : ((Map.Entry) element).getValue().toString(); - } - return null; - } - } - - class EntryDialog extends Dialog { - private String fName; - private String fValue; - private boolean fEdit = false; - - private Button fBtnOk = null; - private Button fBtnCancel = null; - private Text fTextName = null; - private Text fTextValue = null; - - public EntryDialog(String name, String value, boolean edit) { - super(CEnvironmentTab.this.getControl().getShell()); - fName = name; - fValue = value; - fEdit = edit; - } - - protected Control createContents(Composite parent) { - Control result = super.createContents(parent); - updateButtonsState(); - return result; - } - - protected void configureShell(Shell shell) { - super.configureShell(shell); - String title = (fEdit) ? "Edit Variable" : "New Variable"; - shell.setText(title); - } - - protected Control createDialogArea(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(2, false); - layout.marginWidth = 5; - layout.numColumns = 2; - composite.setLayout(layout); - - GC gc = new GC(composite); - gc.setFont(composite.getFont()); - FontMetrics metrics = gc.getFontMetrics(); - gc.dispose(); - int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50); - - Label label = new Label(composite, SWT.NONE); - label.setText("Name:"); - fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER); - GridData gd = new GridData(GridData.FILL_BOTH); - gd.grabExcessHorizontalSpace = true; - gd.widthHint = fieldWidthHint; - fTextName.setLayoutData(gd); - label = new Label(composite, SWT.NONE); - label.setText("Value:"); - fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_BOTH); - gd.grabExcessHorizontalSpace = true; - gd.widthHint = fieldWidthHint; - fTextValue.setLayoutData(gd); - fTextName.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateButtonsState(); - } - }); - fTextValue.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateButtonsState(); - } - }); - fTextName.setText(fName); - fTextValue.setText(fValue); - - return composite; - } - - protected void createButtonsForButtonBar(Composite parent) { - fBtnOk = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); - fBtnCancel = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); - } - - protected void updateButtonsState() { - if (fBtnOk != null) - fBtnOk.setEnabled(fTextName.getText().trim().length() > 0); - } - - protected String getName() { - return fName; - } - - protected String getValue() { - return fValue; - } - - protected void okPressed() { - fName = fTextName.getText().trim(); - fValue = fTextValue.getText().trim(); - setReturnCode(OK); - close(); - } - } - - public void createControl(Composite parent) { - fElements = new Properties(); - Composite control = new Composite(parent, SWT.NONE); - setControl(control); - - WorkbenchHelp.setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB); - - GridLayout gl = new GridLayout(2, false); - - createVerticalSpacer(control, 2); - - control.setLayout(gl); - createVariableList(control); - createButtons(control); - fVariableList.setInput(fElements); - fVariableList.getTable().setFocus(); - } - - public void set(String env) { - fElements.clear(); - ByteArrayInputStream input = new ByteArrayInputStream(env.getBytes()); - try { - fElements.load(input); - } catch (IOException e) { - } - - fVariableList.refresh(); - fVariableList.getTable().setFocus(); - if (fVariableList.getTable().getItemCount() > 0) - fVariableList.getTable().setSelection(0); - } - - public String get() { - String result = new String(); - Object[] entries = fElements.entrySet().toArray(); - for (int i = 0; i < entries.length; ++i) - result += entries[i].toString() + '\n'; - return result; - } - - public Properties getProperties() { - return fElements; - } - - public Object[] toArray() { - return fElements.entrySet().toArray(); - } - - private void createVariableList(Composite parent) { - fVariableList = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); - fVariableList.setContentProvider(new ElementsContentProvider()); - fVariableList.setLabelProvider(new ElementsLabelProvider()); - fVariableList.setSorter(new SimpleSorter()); - - Table table = fVariableList.getTable(); - - TableLayout tableLayout = new TableLayout(); - table.setLayout(tableLayout); - - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL); - gd.grabExcessVerticalSpace = true; - gd.grabExcessHorizontalSpace = true; - table.setLayoutData(gd); - - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableColumn column1 = new TableColumn(table, SWT.NULL); - column1.setText("Name"); - tableLayout.addColumnData(new ColumnWeightData(30)); - - TableColumn column2 = new TableColumn(table, SWT.NULL); - column2.setText("Value"); - tableLayout.addColumnData(new ColumnWeightData(30)); - - fVariableList.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent e) { - elementDoubleClicked((IStructuredSelection) e.getSelection()); - } - }); - fVariableList.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent e) { - updateButtons(); - } - }); - } - - private void createButtons(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); - composite.setLayout(new GridLayout(1, true)); - fBtnNew = new Button(composite, SWT.NONE); - fBtnNew.setText("New..."); - fBtnNew.setLayoutData(new GridData(GridData.FILL_BOTH)); - fBtnNew.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - newEntry(); - } - }); - fBtnEdit = new Button(composite, SWT.NONE); - fBtnEdit.setText("Edit..."); - fBtnEdit.setLayoutData(new GridData(GridData.FILL_BOTH)); - fBtnEdit.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - edit(); - } - }); - fBtnRemove = new Button(composite, SWT.NONE); - fBtnRemove.setText("Remove"); - fBtnRemove.setLayoutData(new GridData(GridData.FILL_BOTH)); - fBtnRemove.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - remove(); - } - }); - } - - protected void updateButtons() { - IStructuredSelection selection = (IStructuredSelection) fVariableList.getSelection(); - fBtnEdit.setEnabled(selection.size() == 1); - fBtnRemove.setEnabled(selection.size() > 0); - } - - protected void elementDoubleClicked(IStructuredSelection selection) { - if (selection.size() != 1) - return; - doEdit((Map.Entry) selection.getFirstElement()); - } - - protected void newEntry() { - EntryDialog dialog = new EntryDialog(new String(), new String(), false); - if (dialog.open() == EntryDialog.OK) { - fElements.setProperty(dialog.getName(), dialog.getValue()); - fVariableList.refresh(); - } - updateButtons(); - updateLaunchConfigurationDialog(); - } - - protected void edit() { - IStructuredSelection selection = (IStructuredSelection) fVariableList.getSelection(); - doEdit((Map.Entry) selection.getFirstElement()); - } - - protected void doEdit(Map.Entry entry) { - EntryDialog dialog = new EntryDialog(entry.getKey().toString(), entry.getValue().toString(), true); - if (dialog.open() == EntryDialog.OK) { - fElements.remove(entry.getKey()); - fElements.setProperty(dialog.getName(), dialog.getValue()); - fVariableList.refresh(); - } - updateButtons(); - updateLaunchConfigurationDialog(); - } - - protected void remove() { - IStructuredSelection selection = (IStructuredSelection) fVariableList.getSelection(); - Object[] elements = selection.toArray(); - for (int i = 0; i < elements.length; ++i) - fElements.remove(((Map.Entry) elements[i]).getKey()); - fVariableList.refresh(); - updateButtons(); - updateLaunchConfigurationDialog(); - } - - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true); - } - - public void initializeFrom(ILaunchConfiguration config) { - try { - Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null); - if (env != null) { - fElements.clear(); - fElements.putAll(env); - fVariableList.refresh(); - updateButtons(); - } - // config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true); - } catch (CoreException e) { - } - } - - public void performApply(ILaunchConfigurationWorkingCopy config) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) fElements.clone()); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return "Environment"; - } - - /** - * @see ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return LaunchImages.get(LaunchImages.IMG_VIEW_ENVIRONMENT_TAB); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java deleted file mode 100644 index c7832d439bd..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.eclipse.cdt.launch.ui; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; - -/* - * (c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - */ -public abstract class CLaunchConfigurationTab extends AbstractLaunchConfigurationTab { - - /** - * Returns the current C element context from which to initialize - * default settings, or null if none. - * Note, if possible we will return the IBinary based on config entry - * as this may be more usefull then just the project. - * @return C element context. - */ - protected ICElement getContext(ILaunchConfiguration config, String platform) { - String projectName = null; - String programName = null; - IWorkbenchPage page = LaunchUIPlugin.getActivePage(); - Object obj = null; - try { - projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); - programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null); - } - catch (CoreException e) { - } - if (projectName != null && !projectName.equals("")) { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project); - if (cProject != null && cProject.exists()) { - obj = cProject; - } - } - else { - if (page != null) { - ISelection selection = page.getSelection(); - if (selection instanceof IStructuredSelection) { - IStructuredSelection ss = (IStructuredSelection) selection; - if (!ss.isEmpty()) { - obj = ss.getFirstElement(); - } - } - } - } - if (obj instanceof IResource) { - ICElement ce = CoreModel.getDefault().create((IResource) obj); - if (ce == null) { - IProject pro = ((IResource) obj).getProject(); - ce = CoreModel.getDefault().create(pro); - } - obj = ce; - } - if (obj instanceof ICElement) { - if (platform != null && !platform.equals("*")) { - ICDescriptor descriptor; - try { - descriptor = CCorePlugin.getDefault().getCProjectDescription(((ICElement) obj).getCProject().getProject()); - String projectPlatform = descriptor.getPlatform(); - if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) { - obj = null; - } - } - catch (CoreException e) { - } - } - if (obj != null) { - if (programName == null || programName.equals("")) { - return (ICElement) obj; - } - ICElement ce = (ICElement) obj; - IProject project; - project = (IProject) ce.getCProject().getResource(); - IPath programFile = project.getFile(programName).getLocation(); - ce = CCorePlugin.getDefault().getCoreModel().create(programFile); - if (ce != null && ce.exists()) { - return ce; - } - return (ICElement) obj; - } - } - IEditorPart part = page.getActiveEditor(); - if (part != null) { - IEditorInput input = part.getEditorInput(); - return (ICElement) input.getAdapter(ICElement.class); - } - return null; - } - - /** - * Set the C project attribute based on the ICElement. - */ - protected void initializeCProject(ICElement cElement, ILaunchConfigurationWorkingCopy config) { - ICProject cProject = cElement.getCProject(); - String name = null; - if (cProject != null && cProject.exists()) { - name = cProject.getElementName(); - } - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, name); - - } - - protected String getPlatform(ILaunchConfiguration config) { - String platform = BootLoader.getOS(); - try { - return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, platform); - } - catch (CoreException e) { - return platform; - } - } -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java deleted file mode 100644 index 8e8b86c522b..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java +++ /dev/null @@ -1,429 +0,0 @@ -package org.eclipse.cdt.launch.ui; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.util.ArrayList; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.launch.internal.ui.LaunchImages; -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; -import org.eclipse.cdt.ui.CElementLabelProvider; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * A launch configuration tab that displays and edits project and - * main type name launch configuration attributes. - *

          - * This class may be instantiated. This class is not intended to be subclassed. - *

          - * @since 2.0 - */ - -public class CMainTab extends CLaunchConfigurationTab { - - // Project UI widgets - protected Label fProjLabel; - protected Text fProjText; - protected Button fProjButton; - - // Main class UI widgets - protected Label fProgLabel; - protected Text fProgText; - protected Button fSearchButton; - - protected static final String EMPTY_STRING = ""; //$NON-NLS-1$ - - private String filterPlatform = EMPTY_STRING; - - /** - * @see ILaunchConfigurationTab#createControl(Composite) - */ - public void createControl(Composite parent) { - - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - - WorkbenchHelp.setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB); - - GridLayout topLayout = new GridLayout(); - comp.setLayout(topLayout); - - - createVerticalSpacer(comp, 1); - - Composite projComp = new Composite(comp, SWT.NONE); - GridLayout projLayout = new GridLayout(); - projLayout.numColumns = 2; - projLayout.marginHeight = 0; - projLayout.marginWidth = 0; - projComp.setLayout(projLayout); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - projComp.setLayoutData(gd); - - fProjLabel = new Label(projComp, SWT.NONE); - fProjLabel.setText("&Project:"); - gd = new GridData(); - gd.horizontalSpan = 2; - fProjLabel.setLayoutData(gd); - - fProjText = new Text(projComp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fProjText.setLayoutData(gd); - fProjText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - updateLaunchConfigurationDialog(); - } - }); - - fProjButton = createPushButton(projComp, "&Browse...", null); - fProjButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleProjectButtonSelected(); - updateLaunchConfigurationDialog(); - } - }); - - createVerticalSpacer(comp, 1); - - Composite mainComp = new Composite(comp, SWT.NONE); - GridLayout mainLayout = new GridLayout(); - mainLayout.numColumns = 2; - mainLayout.marginHeight = 0; - mainLayout.marginWidth = 0; - mainComp.setLayout(mainLayout); - gd = new GridData(GridData.FILL_HORIZONTAL); - mainComp.setLayoutData(gd); - fProgLabel = new Label(mainComp, SWT.NONE); - fProgLabel.setText("C/C++ Application:"); - gd = new GridData(); - gd.horizontalSpan = 2; - fProgLabel.setLayoutData(gd); - fProgText = new Text(mainComp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fProgText.setLayoutData(gd); - fProgText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - updateLaunchConfigurationDialog(); - } - }); - fSearchButton = createPushButton(mainComp, "Searc&h...", null); - fSearchButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleSearchButtonSelected(); - updateLaunchConfigurationDialog(); - } - }); - LaunchUIPlugin.setDialogShell(parent.getShell()); - } - - /** - * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration config) { - filterPlatform = getPlatform(config); - updateProjectFromConfig(config); - updateProgramFromConfig(config); - - } - - protected void updateProjectFromConfig(ILaunchConfiguration config) { - String projectName = EMPTY_STRING; - try { - projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING); - } catch (CoreException ce) { - LaunchUIPlugin.log(ce); - } - fProjText.setText(projectName); - } - - protected void updateProgramFromConfig(ILaunchConfiguration config) { - String programName = EMPTY_STRING; - try { - programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING); - } catch (CoreException ce) { - LaunchUIPlugin.log(ce); - } - fProgText.setText(programName); - } - - /** - * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy config) { - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText()); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText()); - } - - /** - * Show a dialog that lists all main types - */ - protected void handleSearchButtonSelected() { - - if (getCProject() == null) { - MessageDialog.openInformation( - getShell(), - "Project required", - "Project must first be entered before searching for a program"); - return; - } - ILabelProvider labelProvider = new CElementLabelProvider() { - public String getText(Object element) { - if (element instanceof IBinary) { - IBinary bin = (IBinary)element; - StringBuffer name = new StringBuffer(); - name.append(bin.getPath().toString()); - name.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); - return name.toString(); - } - return super.getText(element); - } - }; - - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider); - dialog.setElements(getBinaryFiles(getCProject())); - dialog.setMessage("Choose a &program to run"); - dialog.setTitle("Program Selection"); - if (dialog.open() == ElementListSelectionDialog.OK) { - IBinary binary = (IBinary) dialog.getFirstResult(); - fProgText.setText(binary.getResource().getProjectRelativePath().toString()); - } - } - - /** - * Iterate through and suck up all of the executable files that - * we can find. - */ - protected IBinary[] getBinaryFiles(final ICProject cproject) { - final Display display; - if ( getShell() == null ) { - display = LaunchUIPlugin.getShell().getDisplay(); - } else { - display = getShell().getDisplay(); - } - final Object[] ret = new Object[1]; - BusyIndicator.showWhile(display, new Runnable() { - public void run() { - ret[0] = cproject.getBinaryContainer().getBinaries(); - } - }); - - return (IBinary[])ret[0]; - } - - /** - * Show a dialog that lets the user select a project. This in turn provides - * context for the main type, allowing the user to key a main type name, or - * constraining the search for main types to the specified project. - */ - protected void handleProjectButtonSelected() { - ICProject project = chooseCProject(); - if (project == null) { - return; - } - - String projectName = project.getElementName(); - fProjText.setText(projectName); - } - - /** - * Realize a C Project selection dialog and return the first selected project, - * or null if there was none. - */ - protected ICProject chooseCProject() { - ICProject[] projects; - projects = getCProjects(); - - ILabelProvider labelProvider = new CElementLabelProvider(); - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider); - dialog.setTitle("Project Selection"); - dialog.setMessage("Choose a &project to constrain the search for a program"); - dialog.setElements(projects); - - ICProject cProject = getCProject(); - if (cProject != null) { - dialog.setInitialSelections(new Object[] { cProject }); - } - if (dialog.open() == ElementListSelectionDialog.OK) { - return (ICProject) dialog.getFirstResult(); - } - return null; - } - - /** - * Return an array a ICProject whose platform match that of the runtime env. - **/ - - protected ICProject[] getCProjects() { - ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects(); - ArrayList list = new ArrayList(cproject.length); - boolean isNative = filterPlatform.equals(BootLoader.getOS()); - - for (int i = 0; i < cproject.length; i++) { - ICDescriptor cdesciptor = null; - try { - cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource()); - String projectPlatform = cdesciptor.getPlatform(); - if (filterPlatform.equals("*") - || projectPlatform.equals("*") - || (isNative && cdesciptor.getPlatform().equalsIgnoreCase("native")) - || filterPlatform.equalsIgnoreCase(cdesciptor.getPlatform()) == true) { - list.add(cproject[i]); - } - } catch (CoreException e) { - list.add(cproject[i]); - } - } - return (ICProject[]) list.toArray(new ICProject[list.size()]); - } - /** - * Return the ICProject corresponding to the project name in the project name - * text field, or null if the text does not match a project name. - */ - protected ICProject getCProject() { - String projectName = fProjText.getText().trim(); - if (projectName.length() < 1) { - return null; - } - return CoreModel.getDefault().getCModel().getCProject(projectName); - } - - /** - * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration config) { - - setErrorMessage(null); - setMessage(null); - - String name = fProjText.getText().trim(); - if (name.length() == 0) { - setErrorMessage("Project not specified"); - return false; - } - if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) { - setErrorMessage("Project does not exist"); - return false; - } - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); - - name = fProgText.getText().trim(); - if (name.length() == 0) { - setErrorMessage("Program not specified"); - return false; - } - if (name.equals(".") || name.equals("..")) { - setErrorMessage("Program does not exist"); - return false; - } - if (!project.isOpen()) { - setErrorMessage("Project must be opened"); - return false; - } - if (!project.getFile(name).exists()) { - setErrorMessage("Program does not exist"); - return false; - } - return true; - } - - /** - * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - // We set empty attributes for project & program so that when one config is - // compared to another, the existence of empty attributes doesn't cause an - // incorrect result (the performApply() method can result in empty values - // for these attributes being set on a config if there is nothing in the - // corresponding text boxes) - // plus getContext will use this to base context from if set. - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING); - ICElement cElement = null; - cElement = getContext(config, getPlatform(config)); - if (cElement != null) { - initializeCProject(cElement, config); - initializeProgramName(cElement, config); - } - } - - /** - * Set the program name attributes on the working copy based on the ICElement - */ - protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) { - IBinary binary = null; - if (cElement instanceof ICProject) { - IBinary[] bins = getBinaryFiles((ICProject) cElement); - if (bins.length == 1) { - binary = bins[0]; - } - } - - if (binary != null) { - String path; - path = binary.getResource().getProjectRelativePath().toOSString(); - config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path); - String name = binary.getElementName(); - int index = name.lastIndexOf('.'); - if (index > 0) { - name = name.substring(index + 1); - } - name = getLaunchConfigurationDialog().generateName(name); - config.rename(name); - } else { - String name = getLaunchConfigurationDialog().generateName(cElement.getCProject().getElementName()); - config.rename(name); - } - } - /** - * @see ILaunchConfigurationTab#getName() - */ - public String getName() { - return "Main"; - } - - /** - * @see ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return LaunchImages.get(LaunchImages.IMG_VIEW_MAIN_TAB); - } - - /** - * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() - */ - protected void updateLaunchConfigurationDialog() { - super.updateLaunchConfigurationDialog(); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java deleted file mode 100644 index ec7cc355dd2..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CSourceLookupTab.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.launch.ui; - -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.debug.ui.sourcelookup.SourceLookupBlock; -import org.eclipse.cdt.launch.internal.ui.LaunchImages; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * Enter type comment. - * - * @since: Feb 13, 2003 - */ -public class CSourceLookupTab extends CLaunchConfigurationTab -{ - private SourceLookupBlock fBlock = null; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl( Composite parent ) - { - Composite control = new Composite( parent, SWT.NONE ); - control.setLayout( new GridLayout() ); - setControl( control ); - - WorkbenchHelp.setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_SOURCELOOKUP_TAB); - - fBlock = new SourceLookupBlock(); - fBlock.createControl( control ); - fBlock.setLaunchConfigurationDialog( getLaunchConfigurationDialog() ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void setDefaults( ILaunchConfigurationWorkingCopy configuration ) - { - configuration.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, CDebugUIPlugin.getDefaultSourceLocatorID() ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeFrom( ILaunchConfiguration configuration ) - { - fBlock.initialize( configuration ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply( ILaunchConfigurationWorkingCopy configuration ) - { - configuration.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, CDebugUIPlugin.getDefaultSourceLocatorID() ); - IProject project = getProject( configuration ); - if ( project != null ) - fBlock.performApply( configuration ); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() - { - return "Source"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() - { - return LaunchImages.get( LaunchImages.IMG_VIEW_SOURCE_TAB ); - } - - private IProject getProject( ILaunchConfiguration configuration ) - { - IProject project = null; - try - { - String projectName = configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" ); - if ( !isEmpty( projectName ) ) - project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); - } - catch( CoreException e ) - { - } - return project; - } - - private boolean isEmpty( String string ) - { - return string == null || string.length() == 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() - */ - public void dispose() - { - if ( fBlock != null ) - fBlock.dispose(); - super.dispose(); - } -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java deleted file mode 100644 index 3bfbdf2e505..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CorefileDebuggerTab.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.launch.ui; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ICDescriptor; -import org.eclipse.cdt.core.model.IBinary; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.help.WorkbenchHelp; - -public class CorefileDebuggerTab extends AbstractCDebuggerTab { - protected Combo fDCombo; - - private boolean initializingComboBox = false; - - public void createControl(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - - WorkbenchHelp.setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB); - - GridLayout topLayout = new GridLayout(2, false); - comp.setLayout(topLayout); - Label dlabel = new Label(comp, SWT.NONE); - dlabel.setText("Debugger:"); - fDCombo = new Combo(comp, SWT.DROP_DOWN | SWT.READ_ONLY); - fDCombo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - handleDebuggerChanged(); - } - }); - Group debuggerGroup = new Group(comp, SWT.SHADOW_ETCHED_IN); - debuggerGroup.setText("Debugger Options"); - setDynamicTabHolder(debuggerGroup); - GridLayout tabHolderLayout = new GridLayout(); - tabHolderLayout.marginHeight = 0; - tabHolderLayout.marginWidth = 0; - tabHolderLayout.numColumns = 1; - getDynamicTabHolder().setLayout(tabHolderLayout); - GridData gd = new GridData(GridData.FILL_BOTH); - gd.horizontalSpan = 2; - getDynamicTabHolder().setLayoutData(gd); - } - - protected void loadDebuggerComboBox(ILaunchConfiguration config, String selection) { - if (initializingComboBox) { - return; - } - initializingComboBox = true; - ICDebugConfiguration[] debugConfigs; - String configPlatform = getPlatform(config); - ICElement ce = getContext(config, null); - String projectPlatform = "*"; - String projectCPU = "*"; - if (ce != null) { - try { - ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject()); - projectPlatform = descriptor.getPlatform(); - IBinary bin = (IBinary) ce; - projectCPU = bin.getCPU(); - } catch (Exception e) { - } - } - fDCombo.removeAll(); - debugConfigs = CDebugCorePlugin.getDefault().getDebugConfigurations(); - int x = 0; - int selndx = -1; - for (int i = 0; i < debugConfigs.length; i++) { - if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE)) { - String debuggerPlatform = debugConfigs[i].getPlatform(); - boolean platformMatch = configPlatform.equals(projectPlatform); - if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) { - if (debugConfigs[i].supportsCPU(projectCPU)) { - fDCombo.add(debugConfigs[i].getName()); - fDCombo.setData(Integer.toString(x), debugConfigs[i]); - // select first exact matching debugger for platform or requested selection - if ((selndx == -1 && debuggerPlatform.equalsIgnoreCase(projectPlatform)) - || selection.equals(debugConfigs[i].getID())) { - selndx = x; - } - x++; - } - } - } - } - // if no selection meaning nothing in config the force initdefault on tab - setInitializeDefault(selection.equals("") ? true : false); - - fDCombo.select(selndx == -1 ? 0 : selndx); - //The behaviour is undefined for if the callbacks should be triggered for this, - //so to avoid unnecessary confusion, we force an update. - handleDebuggerChanged(); - fDCombo.getParent().layout(true); - initializingComboBox = false; - } - - public void initializeFrom(ILaunchConfiguration config) { - super.initializeFrom(config); - try { - String id = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, ""); - if (getDebugConfig() == null || !getDebugConfig().getID().equals(id)) { - loadDebuggerComboBox(config, id); - } - } catch (CoreException e) { - return; - } - } - - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - super.setDefaults(config); - config.setAttribute( - ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, - ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); - } - - public boolean isValid(ILaunchConfiguration config) { - if (!validateDebuggerConfig(config)) { - setErrorMessage("No debugger available"); - return false; - } - return super.isValid(config); - } - - private boolean validateDebuggerConfig(ILaunchConfiguration config) { - String platform = getPlatform(config); - ICElement ce = getContext(config, null); - String projectPlatform = "*"; - String projectCPU = "*"; - if (ce != null) { - try { - ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject()); - projectPlatform = descriptor.getPlatform(); - IBinary bin = (IBinary) ce; - projectCPU = bin.getCPU(); - } catch (Exception e) { - } - } - ICDebugConfiguration debugConfig = getDebugConfig(); - if (debugConfig == null) { - return false; - } - String debuggerPlatform = debugConfig.getPlatform(); - boolean platformMatch = platform.equals(projectPlatform); - if (debuggerPlatform.equalsIgnoreCase(projectPlatform) || (platformMatch && projectPlatform.equals("*"))) { - if (debugConfig.supportsCPU(projectCPU)) { - return true; - } - } - setDebugConfig(null); - return false; - } - - /** - * Return the class that implements ILaunchConfigurationTab - * that is registered against the debugger id of the currently selected debugger. - */ - protected ICDebugConfiguration getConfigForCurrentDebugger() { - int selectedIndex = fDCombo.getSelectionIndex(); - return (ICDebugConfiguration) fDCombo.getData(Integer.toString(selectedIndex)); - } - - /** - * @see org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab#handleDebuggerChanged() - */ - protected void handleDebuggerChanged() { - super.handleDebuggerChanged(); - } - -} diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java deleted file mode 100644 index 90f5308a9a3..00000000000 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Created on 22-Sep-2003 - * - * Copyright (c) 2002,2003 QNX Software Systems Ltd. - * - * Contributors: - * QNX Software Systems - Initial API and implementation -***********************************************************************/ -package org.eclipse.cdt.launch.ui; - -import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; - -public interface ICDTLaunchHelpContextIds { - - public static final String PREFIX = LaunchUIPlugin.PLUGIN_ID + "."; //$NON-NLS-1$ - - // Launch configuration dialog pages - public static final String LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB = PREFIX + "launch_configuration_dialog_main_tab"; //$NON-NLS-1$ - public static final String LAUNCH_CONFIGURATION_DIALOG_ARGUMNETS_TAB = PREFIX + "launch_configuration_dialog_arguments_tab"; //$NON-NLS-1$ - public static final String LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB = PREFIX + "launch_configuration_dialog_environment_tab"; //$NON-NLS-1$ - public static final String LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB = PREFIX + "launch_configuration_dialog_debugger_tab"; //$NON-NLS-1$ - public static final String LAUNCH_CONFIGURATION_DIALOG_SOURCELOOKUP_TAB = PREFIX + "launch_configuration_dialog_source_tab"; //$NON-NLS-1$ - -} diff --git a/releng/org.eclipse.cdt-feature/.project b/releng/org.eclipse.cdt-feature/.project deleted file mode 100644 index 514cc100664..00000000000 --- a/releng/org.eclipse.cdt-feature/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.cdt-feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.FeatureNature - org.eclipse.pde.PluginNature - - diff --git a/releng/org.eclipse.cdt-feature/build.properties b/releng/org.eclipse.cdt-feature/build.properties deleted file mode 100644 index fdeec5c9ca8..00000000000 --- a/releng/org.eclipse.cdt-feature/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -bin.includes = cpl-v10.html,\ - feature.xml,\ - feature.properties,\ - eclipse_update_120.jpg,\ - license.html -src.includes = cpl-v10.html,\ - feature.xml,\ - feature.properties,\ - eclipse_update_120.jpg,\ - license.html diff --git a/releng/org.eclipse.cdt-feature/cpl-v10.html b/releng/org.eclipse.cdt-feature/cpl-v10.html deleted file mode 100644 index 36aa208d4a2..00000000000 --- a/releng/org.eclipse.cdt-feature/cpl-v10.html +++ /dev/null @@ -1,125 +0,0 @@ - - - -Common Public License - v 1.0 - - - - - - -

          Common Public License - v 1.0 -

          -

          THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. -

          -

          1. DEFINITIONS -

          "Contribution" means: - -

            a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
            -b) in the case of each subsequent Contributor:
          - - -
            i) changes to the Program, and
          - - -
            ii) additions to the Program;
          - - -
            where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
          - -

          -

          "Contributor" means any person or entity that distributes the Program. -

          -

          "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -

          -

          "Program" means the Contributions distributed in accordance with this Agreement. -

          -

          "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. -

          -

          2. GRANT OF RIGHTS - -

            a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
          - - -
          - - -
            b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
          - - -
          - - -
            c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
          - - -
          - - -
            d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
          - - -
          - -

          3. REQUIREMENTS -

          A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -

            a) it complies with the terms and conditions of this Agreement; and
          - - -
            b) its license agreement:
          - - -
            i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
          - - -
            ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
          - - -
            iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
          - - -
            iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
          - - -
          - -

          When the Program is made available in source code form: - -

            a) it must be made available under this Agreement; and
          - - -
            b) a copy of this Agreement must be included with each copy of the Program.
          - -

          -

          Contributors may not remove or alter any copyright notices contained within the Program. -

          -

          Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. -

          -

          4. COMMERCIAL DISTRIBUTION -

          Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. -

          -

          For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. -

          -

          5. NO WARRANTY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. -

          -

          6. DISCLAIMER OF LIABILITY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -

          -

          7. GENERAL -

          If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -

          -

          If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -

          -

          All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -

          -

          Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -

          -

          This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. -

          -

          - - - - \ No newline at end of file diff --git a/releng/org.eclipse.cdt-feature/eclipse_update_120.jpg b/releng/org.eclipse.cdt-feature/eclipse_update_120.jpg deleted file mode 100644 index 68e3e0248e6..00000000000 Binary files a/releng/org.eclipse.cdt-feature/eclipse_update_120.jpg and /dev/null differ diff --git a/releng/org.eclipse.cdt-feature/feature.properties b/releng/org.eclipse.cdt-feature/feature.properties deleted file mode 100644 index b00b283b9c9..00000000000 --- a/releng/org.eclipse.cdt-feature/feature.properties +++ /dev/null @@ -1,99 +0,0 @@ -# features.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Eclipse C/C++ Development Tools - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -updateSiteName=Eclipse CDT Update Site - -# "description" property - description of the feature -description=Eclipse C/C++ development tools. (Binary runtime and user documentation.) - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE.ORG SOFTWARE USER AGREEMENT\n\ -17th June, 2002\n\ -\n\ -ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Unless otherwise indicated, all Content made available by Eclipse.org\n\ -is provided to you under the terms and conditions of the Common Public\n\ -License Version 1.0 ("CPL"). A copy of the CPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/cpl-v10.html.\n\ -For purposes of the CPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ -Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments\n\ -("Fragments"), and features ("Features"). A Feature is a bundle of one or\n\ -more Plug-ins and/or Fragments and associated material. Files named\n\ -"feature.xml" may contain a list of the names and version numbers of the\n\ -Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments\n\ -are located in directories named "plugins" and Features are located in\n\ -directories named "features".\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Subdirectories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by Eclipse.org is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory. The Abouts, Feature\n\ -Licenses and Feature Update Licenses may refer to the CPL or other\n\ -license agreements, notices or terms and conditions . It is your\n\ -obligation to read and accept all such all terms and conditions prior\n\ -to use of the Content. If no About, Feature License or Feature Update\n\ -License is provided, please contact Eclipse.org to determine what terms\n\ -and conditions govern that particular Content.\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n -########### end of license property ########################################## diff --git a/releng/org.eclipse.cdt-feature/feature.xml b/releng/org.eclipse.cdt-feature/feature.xml deleted file mode 100644 index c2268506632..00000000000 --- a/releng/org.eclipse.cdt-feature/feature.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - %description - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/releng/org.eclipse.cdt-feature/license.html b/releng/org.eclipse.cdt-feature/license.html deleted file mode 100644 index 00d784b4656..00000000000 --- a/releng/org.eclipse.cdt-feature/license.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - -Eclipse.org Software User Agreement - - - -

          Eclipse.org Software User Agreement

          -

          17th June, 2002

          - -

          ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

          - -

          Unless otherwise indicated, all Content made available by Eclipse.org is provided to you under the terms and conditions of the Common Public License Version 1.0 - ("CPL"). A copy of the CPL is provided with this Content and is also available at http://www.eclipse.org/legal/cpl-v10.html. - For purposes of the CPL, "Program" will mean the Content.

          - -

          Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").

          - -

          Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".

          - -

          Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.

          - -

          The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:

          - -
            -
          • The top-level (root) directory
          • -
          • Plug-in and Fragment directories
          • -
          • Subdirectories of the directory named "src" of certain Plug-ins
          • -
          • Feature directories
          • -
          - -

          Note: if a Feature made available by Eclipse.org is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory. The Abouts, Feature Licenses and Feature Update Licenses may refer to the CPL or other license agreements, notices or terms and conditions . It is your obligation to read and accept all such all terms and conditions prior to use of the Content. -If no About, Feature License or Feature Update License is provided, please contact Eclipse.org to determine what terms and conditions govern that particular Content.

          - -

          Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.

          - - diff --git a/releng/org.eclipse.cdt.testing-feature/.project b/releng/org.eclipse.cdt.testing-feature/.project deleted file mode 100644 index 63f3a231d39..00000000000 --- a/releng/org.eclipse.cdt.testing-feature/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.eclipse.cdt.testing-feature - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/releng/org.eclipse.cdt.testing-feature/build.properties b/releng/org.eclipse.cdt.testing-feature/build.properties deleted file mode 100644 index d086b4c8449..00000000000 --- a/releng/org.eclipse.cdt.testing-feature/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -bin.includes = cpl-v10.html,\ - feature.xml,\ - feature.properties,\ - eclipse_update_120.jpg,\ - license.html diff --git a/releng/org.eclipse.cdt.testing-feature/cpl-v10.html b/releng/org.eclipse.cdt.testing-feature/cpl-v10.html deleted file mode 100644 index 36aa208d4a2..00000000000 --- a/releng/org.eclipse.cdt.testing-feature/cpl-v10.html +++ /dev/null @@ -1,125 +0,0 @@ - - - -Common Public License - v 1.0 - - - - - - -

          Common Public License - v 1.0 -

          -

          THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. -

          -

          1. DEFINITIONS -

          "Contribution" means: - -

            a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
            -b) in the case of each subsequent Contributor:
          - - -
            i) changes to the Program, and
          - - -
            ii) additions to the Program;
          - - -
            where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
          - -

          -

          "Contributor" means any person or entity that distributes the Program. -

          -

          "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -

          -

          "Program" means the Contributions distributed in accordance with this Agreement. -

          -

          "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. -

          -

          2. GRANT OF RIGHTS - -

            a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
          - - -
          - - -
            b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
          - - -
          - - -
            c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
          - - -
          - - -
            d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
          - - -
          - -

          3. REQUIREMENTS -

          A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -

            a) it complies with the terms and conditions of this Agreement; and
          - - -
            b) its license agreement:
          - - -
            i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
          - - -
            ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
          - - -
            iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
          - - -
            iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
          - - -
          - -

          When the Program is made available in source code form: - -

            a) it must be made available under this Agreement; and
          - - -
            b) a copy of this Agreement must be included with each copy of the Program.
          - -

          -

          Contributors may not remove or alter any copyright notices contained within the Program. -

          -

          Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. -

          -

          4. COMMERCIAL DISTRIBUTION -

          Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. -

          -

          For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. -

          -

          5. NO WARRANTY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. -

          -

          6. DISCLAIMER OF LIABILITY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -

          -

          7. GENERAL -

          If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -

          -

          If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -

          -

          All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -

          -

          Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -

          -

          This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. -

          -

          - - - - \ No newline at end of file diff --git a/releng/org.eclipse.cdt.testing-feature/eclipse_update_120.jpg b/releng/org.eclipse.cdt.testing-feature/eclipse_update_120.jpg deleted file mode 100644 index 68e3e0248e6..00000000000 Binary files a/releng/org.eclipse.cdt.testing-feature/eclipse_update_120.jpg and /dev/null differ diff --git a/releng/org.eclipse.cdt.testing-feature/feature.properties b/releng/org.eclipse.cdt.testing-feature/feature.properties deleted file mode 100644 index b838f7efffa..00000000000 --- a/releng/org.eclipse.cdt.testing-feature/feature.properties +++ /dev/null @@ -1,99 +0,0 @@ -# features.properties -# contains externalized strings for feature.xml -# "%foo" in feature.xml corresponds to the key "foo" in this file -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file should be translated. - -# "featureName" property - name of the feature -featureName=Eclipse C/C++ Development Tools - -# "providerName" property - name of the company that provides the feature -providerName=Eclipse.org - -# "updateSiteName" property - label for the update site -updateSiteName=Eclipse.org update site - -# "description" property - description of the feature -description=Eclipse C/C++ development tools. (Binary runtime and user documentation.) - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -ECLIPSE.ORG SOFTWARE USER AGREEMENT\n\ -17th June, 2002\n\ -\n\ -ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Unless otherwise indicated, all Content made available by Eclipse.org\n\ -is provided to you under the terms and conditions of the Common Public\n\ -License Version 1.0 ("CPL"). A copy of the CPL is provided with this\n\ -Content and is also available at http://www.eclipse.org/legal/cpl-v10.html.\n\ -For purposes of the CPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse.org CVS\n\ -repository ("Repository") in CVS modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ -Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments\n\ -("Fragments"), and features ("Features"). A Feature is a bundle of one or\n\ -more Plug-ins and/or Fragments and associated material. Files named\n\ -"feature.xml" may contain a list of the names and version numbers of the\n\ -Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments\n\ -are located in directories named "plugins" and Features are located in\n\ -directories named "features".\n\ -\n\ -Features may also include other Features ("Included Features"). Files named\n\ -"feature.xml" may contain a list of the names and version numbers of\n\ -Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ - - The top-level (root) directory\n\ - - Plug-in and Fragment directories\n\ - - Subdirectories of the directory named "src" of certain Plug-ins\n\ - - Feature directories\n\ -\n\ -Note: if a Feature made available by Eclipse.org is installed using the\n\ -Eclipse Update Manager, you must agree to a license ("Feature Update\n\ -License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties". Such Abouts,\n\ -Feature Licenses and Feature Update Licenses contain the terms and\n\ -conditions (or references to such terms and conditions) that govern your\n\ -use of the associated Content in that directory. The Abouts, Feature\n\ -Licenses and Feature Update Licenses may refer to the CPL or other\n\ -license agreements, notices or terms and conditions . It is your\n\ -obligation to read and accept all such all terms and conditions prior\n\ -to use of the Content. If no About, Feature License or Feature Update\n\ -License is provided, please contact Eclipse.org to determine what terms\n\ -and conditions govern that particular Content.\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use,\n\ -and re-export of encryption software, to see if this is permitted.\n -########### end of license property ########################################## diff --git a/releng/org.eclipse.cdt.testing-feature/feature.xml b/releng/org.eclipse.cdt.testing-feature/feature.xml deleted file mode 100644 index 71e0f002528..00000000000 --- a/releng/org.eclipse.cdt.testing-feature/feature.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - %description - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/releng/org.eclipse.cdt.testing-feature/license.html b/releng/org.eclipse.cdt.testing-feature/license.html deleted file mode 100644 index 00d784b4656..00000000000 --- a/releng/org.eclipse.cdt.testing-feature/license.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - -Eclipse.org Software User Agreement - - - -

          Eclipse.org Software User Agreement

          -

          17th June, 2002

          - -

          ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

          - -

          Unless otherwise indicated, all Content made available by Eclipse.org is provided to you under the terms and conditions of the Common Public License Version 1.0 - ("CPL"). A copy of the CPL is provided with this Content and is also available at http://www.eclipse.org/legal/cpl-v10.html. - For purposes of the CPL, "Program" will mean the Content.

          - -

          Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").

          - -

          Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".

          - -

          Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.

          - -

          The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:

          - -
            -
          • The top-level (root) directory
          • -
          • Plug-in and Fragment directories
          • -
          • Subdirectories of the directory named "src" of certain Plug-ins
          • -
          • Feature directories
          • -
          - -

          Note: if a Feature made available by Eclipse.org is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory. The Abouts, Feature Licenses and Feature Update Licenses may refer to the CPL or other license agreements, notices or terms and conditions . It is your obligation to read and accept all such all terms and conditions prior to use of the Content. -If no About, Feature License or Feature Update License is provided, please contact Eclipse.org to determine what terms and conditions govern that particular Content.

          - -

          Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.

          - - diff --git a/releng/org.eclipse.cdt.testing/.project b/releng/org.eclipse.cdt.testing/.project deleted file mode 100644 index 162151c68c5..00000000000 --- a/releng/org.eclipse.cdt.testing/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.eclipse.cdt.testing - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/releng/org.eclipse.cdt.testing/about.html b/releng/org.eclipse.cdt.testing/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/releng/org.eclipse.cdt.testing/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

          About This Content

          - -

          20th June, 2002

          -

          License

          -

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

          - -

          Contributions

          - -

          If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

          - -

          If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

          - - - \ No newline at end of file diff --git a/releng/org.eclipse.cdt.testing/about.ini b/releng/org.eclipse.cdt.testing/about.ini deleted file mode 100644 index 2c7a823562d..00000000000 --- a/releng/org.eclipse.cdt.testing/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=eclipse32.gif - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -welcomePage=$nl$/welcome.xml - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional diff --git a/releng/org.eclipse.cdt.testing/about.mappings b/releng/org.eclipse.cdt.testing/about.mappings deleted file mode 100644 index c39de2d7fe5..00000000000 --- a/releng/org.eclipse.cdt.testing/about.mappings +++ /dev/null @@ -1,9 +0,0 @@ -# about.mappings -# contains fill-ins for about.properties -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file does not need to be translated. - -# The following should contain the build version. -# e.g. "0=20020612" -# This value will be added automaticaly via the build scripts -0=@build@ \ No newline at end of file diff --git a/releng/org.eclipse.cdt.testing/about.properties b/releng/org.eclipse.cdt.testing/about.properties deleted file mode 100644 index aca0663112c..00000000000 --- a/releng/org.eclipse.cdt.testing/about.properties +++ /dev/null @@ -1,14 +0,0 @@ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. - -blurb=Eclipse C/C++ Development Tools Testing Framework\n\ -\n\ -Version: 1.2.0\n\ -Build id: {0}\n\ -\n\ -(c) Copyright QNX Software Systems Ltd. and others, 2000, 2001, 2002, 2003. All rights reserved.\n\ -Visit http://www.eclipse.org/cdt - diff --git a/releng/org.eclipse.cdt.testing/build.properties b/releng/org.eclipse.cdt.testing/build.properties deleted file mode 100644 index 0696f42676b..00000000000 --- a/releng/org.eclipse.cdt.testing/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -bin.includes=\ -about.html,\ -about.ini,\ -about.mappings,\ -about.properties,\ -eclipse32.gif,\ -plugin.properties,\ -plugin.xml - -# note: the following files are intentionally not listed in bin.includes -# cpl-v10.html -# notice.html -# these files need to end up as root files in /eclipse/ for a jdt runtime platform build diff --git a/releng/org.eclipse.cdt.testing/cpl-v10.html b/releng/org.eclipse.cdt.testing/cpl-v10.html deleted file mode 100644 index 36aa208d4a2..00000000000 --- a/releng/org.eclipse.cdt.testing/cpl-v10.html +++ /dev/null @@ -1,125 +0,0 @@ - - - -Common Public License - v 1.0 - - - - - - -

          Common Public License - v 1.0 -

          -

          THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. -

          -

          1. DEFINITIONS -

          "Contribution" means: - -

            a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
            -b) in the case of each subsequent Contributor:
          - - -
            i) changes to the Program, and
          - - -
            ii) additions to the Program;
          - - -
            where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
          - -

          -

          "Contributor" means any person or entity that distributes the Program. -

          -

          "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -

          -

          "Program" means the Contributions distributed in accordance with this Agreement. -

          -

          "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. -

          -

          2. GRANT OF RIGHTS - -

            a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
          - - -
          - - -
            b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
          - - -
          - - -
            c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
          - - -
          - - -
            d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
          - - -
          - -

          3. REQUIREMENTS -

          A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -

            a) it complies with the terms and conditions of this Agreement; and
          - - -
            b) its license agreement:
          - - -
            i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
          - - -
            ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
          - - -
            iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
          - - -
            iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
          - - -
          - -

          When the Program is made available in source code form: - -

            a) it must be made available under this Agreement; and
          - - -
            b) a copy of this Agreement must be included with each copy of the Program.
          - -

          -

          Contributors may not remove or alter any copyright notices contained within the Program. -

          -

          Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. -

          -

          4. COMMERCIAL DISTRIBUTION -

          Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. -

          -

          For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. -

          -

          5. NO WARRANTY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. -

          -

          6. DISCLAIMER OF LIABILITY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -

          -

          7. GENERAL -

          If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -

          -

          If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -

          -

          All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -

          -

          Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -

          -

          This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. -

          -

          - - - - \ No newline at end of file diff --git a/releng/org.eclipse.cdt.testing/eclipse32.gif b/releng/org.eclipse.cdt.testing/eclipse32.gif deleted file mode 100644 index f71a8f6f9ee..00000000000 Binary files a/releng/org.eclipse.cdt.testing/eclipse32.gif and /dev/null differ diff --git a/releng/org.eclipse.cdt.testing/notice.html b/releng/org.eclipse.cdt.testing/notice.html deleted file mode 100644 index 00d784b4656..00000000000 --- a/releng/org.eclipse.cdt.testing/notice.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - -Eclipse.org Software User Agreement - - - -

          Eclipse.org Software User Agreement

          -

          17th June, 2002

          - -

          ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

          - -

          Unless otherwise indicated, all Content made available by Eclipse.org is provided to you under the terms and conditions of the Common Public License Version 1.0 - ("CPL"). A copy of the CPL is provided with this Content and is also available at http://www.eclipse.org/legal/cpl-v10.html. - For purposes of the CPL, "Program" will mean the Content.

          - -

          Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").

          - -

          Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".

          - -

          Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.

          - -

          The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:

          - -
            -
          • The top-level (root) directory
          • -
          • Plug-in and Fragment directories
          • -
          • Subdirectories of the directory named "src" of certain Plug-ins
          • -
          • Feature directories
          • -
          - -

          Note: if a Feature made available by Eclipse.org is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory. The Abouts, Feature Licenses and Feature Update Licenses may refer to the CPL or other license agreements, notices or terms and conditions . It is your obligation to read and accept all such all terms and conditions prior to use of the Content. -If no About, Feature License or Feature Update License is provided, please contact Eclipse.org to determine what terms and conditions govern that particular Content.

          - -

          Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.

          - - diff --git a/releng/org.eclipse.cdt.testing/plugin.properties b/releng/org.eclipse.cdt.testing/plugin.properties deleted file mode 100644 index 81161c0c286..00000000000 --- a/releng/org.eclipse.cdt.testing/plugin.properties +++ /dev/null @@ -1,2 +0,0 @@ -pluginName=Eclipse C/C++ Development Tools Testing Framework -providerName=Eclipse.org \ No newline at end of file diff --git a/releng/org.eclipse.cdt.testing/plugin.xml b/releng/org.eclipse.cdt.testing/plugin.xml deleted file mode 100644 index 4512b7b1042..00000000000 --- a/releng/org.eclipse.cdt.testing/plugin.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/releng/org.eclipse.cdt/.eclipseproduct b/releng/org.eclipse.cdt/.eclipseproduct deleted file mode 100644 index 1e73475d1ee..00000000000 --- a/releng/org.eclipse.cdt/.eclipseproduct +++ /dev/null @@ -1,4 +0,0 @@ -name=Eclipse C/C++ Development Tools -id=org.eclipse.cdt -version=1.0.0 -feature.default.id=org.eclipse.cdt \ No newline at end of file diff --git a/releng/org.eclipse.cdt/.project b/releng/org.eclipse.cdt/.project deleted file mode 100644 index c5baad78ec3..00000000000 --- a/releng/org.eclipse.cdt/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.eclipse.cdt - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/releng/org.eclipse.cdt/about.html b/releng/org.eclipse.cdt/about.html deleted file mode 100644 index 9db411aab99..00000000000 --- a/releng/org.eclipse.cdt/about.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -About - - - -

          About This Content

          - -

          20th June, 2002

          -

          License

          -

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

          - -

          Contributions

          - -

          If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise -made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such -Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.

          - -

          If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or -other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the -host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available -to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also -providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of -the CPL.

          - - - \ No newline at end of file diff --git a/releng/org.eclipse.cdt/about.ini b/releng/org.eclipse.cdt/about.ini deleted file mode 100644 index 2c7a823562d..00000000000 --- a/releng/org.eclipse.cdt/about.ini +++ /dev/null @@ -1,27 +0,0 @@ -# about.ini -# contains information about a feature -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# "%key" are externalized strings defined in about.properties -# This file does not need to be translated. - -# Property "aboutText" contains blurb for "About" dialog (translated) -aboutText=%blurb - -# Property "windowImage" contains path to window icon (16x16) -# needed for primary features only - -# Property "featureImage" contains path to feature image (32x32) -featureImage=eclipse32.gif - -# Property "aboutImage" contains path to product image (500x330 or 115x164) -# needed for primary features only - -# Property "appName" contains name of the application (translated) -# needed for primary features only - -# Property "welcomePage" contains path to welcome page (special XML-based format) -welcomePage=$nl$/welcome.xml - -# Property "welcomePerspective" contains the id of the perspective in which the -# welcome page is to be opened. -# optional diff --git a/releng/org.eclipse.cdt/about.mappings b/releng/org.eclipse.cdt/about.mappings deleted file mode 100644 index c39de2d7fe5..00000000000 --- a/releng/org.eclipse.cdt/about.mappings +++ /dev/null @@ -1,9 +0,0 @@ -# about.mappings -# contains fill-ins for about.properties -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# This file does not need to be translated. - -# The following should contain the build version. -# e.g. "0=20020612" -# This value will be added automaticaly via the build scripts -0=@build@ \ No newline at end of file diff --git a/releng/org.eclipse.cdt/about.properties b/releng/org.eclipse.cdt/about.properties deleted file mode 100644 index 68b3930429a..00000000000 --- a/releng/org.eclipse.cdt/about.properties +++ /dev/null @@ -1,13 +0,0 @@ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. - -blurb=Eclipse C/C++ Development Tools\n\ -\n\ -Version: 1.2.0\n\ -Build id: {0}\n\ -\n\ -(c) Copyright QNX Software Systems Ltd. and others, 2000, 2001, 2002, 2003. All rights reserved.\n\ -Visit http://www.eclipse.org/cdt diff --git a/releng/org.eclipse.cdt/build.properties b/releng/org.eclipse.cdt/build.properties deleted file mode 100644 index 858cde9e51d..00000000000 --- a/releng/org.eclipse.cdt/build.properties +++ /dev/null @@ -1,25 +0,0 @@ -bin.includes = about.html,\ - about.ini,\ - about.mappings,\ - about.properties,\ - eclipse32.gif,\ - plugin.properties,\ - plugin.xml,\ - welcome.xml -# note: the following files are intentionally not listed in bin.includes -# cpl-v10.html -# notice.html -# these files need to end up as root files in /eclipse/ for a jdt runtime platform build - -src.includes = about.html,\ - about.ini,\ - about.mappings,\ - about.properties,\ - eclipse32.gif,\ - plugin.properties,\ - plugin.xml,\ - welcome.xml,\ - cpl-v10.html,\ - notice.html - - diff --git a/releng/org.eclipse.cdt/cpl-v10.html b/releng/org.eclipse.cdt/cpl-v10.html deleted file mode 100644 index 36aa208d4a2..00000000000 --- a/releng/org.eclipse.cdt/cpl-v10.html +++ /dev/null @@ -1,125 +0,0 @@ - - - -Common Public License - v 1.0 - - - - - - -

          Common Public License - v 1.0 -

          -

          THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. -

          -

          1. DEFINITIONS -

          "Contribution" means: - -

            a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
            -b) in the case of each subsequent Contributor:
          - - -
            i) changes to the Program, and
          - - -
            ii) additions to the Program;
          - - -
            where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
          - -

          -

          "Contributor" means any person or entity that distributes the Program. -

          -

          "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. -

          -

          "Program" means the Contributions distributed in accordance with this Agreement. -

          -

          "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. -

          -

          2. GRANT OF RIGHTS - -

            a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
          - - -
          - - -
            b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
          - - -
          - - -
            c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
          - - -
          - - -
            d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
          - - -
          - -

          3. REQUIREMENTS -

          A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -

            a) it complies with the terms and conditions of this Agreement; and
          - - -
            b) its license agreement:
          - - -
            i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
          - - -
            ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
          - - -
            iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
          - - -
            iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
          - - -
          - -

          When the Program is made available in source code form: - -

            a) it must be made available under this Agreement; and
          - - -
            b) a copy of this Agreement must be included with each copy of the Program.
          - -

          -

          Contributors may not remove or alter any copyright notices contained within the Program. -

          -

          Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. -

          -

          4. COMMERCIAL DISTRIBUTION -

          Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. -

          -

          For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. -

          -

          5. NO WARRANTY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. -

          -

          6. DISCLAIMER OF LIABILITY -

          EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -

          -

          7. GENERAL -

          If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -

          -

          If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. -

          -

          All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. -

          -

          Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. -

          -

          This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. -

          -

          - - - - \ No newline at end of file diff --git a/releng/org.eclipse.cdt/eclipse32.gif b/releng/org.eclipse.cdt/eclipse32.gif deleted file mode 100644 index f71a8f6f9ee..00000000000 Binary files a/releng/org.eclipse.cdt/eclipse32.gif and /dev/null differ diff --git a/releng/org.eclipse.cdt/notice.html b/releng/org.eclipse.cdt/notice.html deleted file mode 100644 index 00d784b4656..00000000000 --- a/releng/org.eclipse.cdt/notice.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - -Eclipse.org Software User Agreement - - - -

          Eclipse.org Software User Agreement

          -

          17th June, 2002

          - -

          ECLIPSE.ORG MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

          - -

          Unless otherwise indicated, all Content made available by Eclipse.org is provided to you under the terms and conditions of the Common Public License Version 1.0 - ("CPL"). A copy of the CPL is provided with this Content and is also available at http://www.eclipse.org/legal/cpl-v10.html. - For purposes of the CPL, "Program" will mean the Content.

          - -

          Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").

          - -

          Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".

          - -

          Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.

          - -

          The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:

          - -
            -
          • The top-level (root) directory
          • -
          • Plug-in and Fragment directories
          • -
          • Subdirectories of the directory named "src" of certain Plug-ins
          • -
          • Feature directories
          • -
          - -

          Note: if a Feature made available by Eclipse.org is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory. The Abouts, Feature Licenses and Feature Update Licenses may refer to the CPL or other license agreements, notices or terms and conditions . It is your obligation to read and accept all such all terms and conditions prior to use of the Content. -If no About, Feature License or Feature Update License is provided, please contact Eclipse.org to determine what terms and conditions govern that particular Content.

          - -

          Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.

          - - diff --git a/releng/org.eclipse.cdt/plugin.properties b/releng/org.eclipse.cdt/plugin.properties deleted file mode 100644 index 01342fd4c95..00000000000 --- a/releng/org.eclipse.cdt/plugin.properties +++ /dev/null @@ -1,2 +0,0 @@ -pluginName=Eclipse C/C++ Development Tools -providerName=Eclipse.org \ No newline at end of file diff --git a/releng/org.eclipse.cdt/plugin.xml b/releng/org.eclipse.cdt/plugin.xml deleted file mode 100644 index 473527e4760..00000000000 --- a/releng/org.eclipse.cdt/plugin.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/releng/org.eclipse.cdt/welcome.xml b/releng/org.eclipse.cdt/welcome.xml deleted file mode 100644 index 9a167a6d86d..00000000000 --- a/releng/org.eclipse.cdt/welcome.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - The CDT project provides a set of plugins that implement a C/C++ IDE. -It adds a C/C++ Perspective to the Eclipse Workbench that supports C/C++ development -with a number of views, wizards, a powerful editor, and a debugger. The CDT is designed -to provide an extensible architecture, that will provide support for integration of tools -provided by Independent Software Vendors. - -This page will help familiarize you with the Eclipse C/C++ development tooling. -To get started, read the sections below and click on the related links. - - The C/C++ perspective -To open the C/C++ perspective: Click Window > Open Perspective > C/C++ Development. - - What's new -Learn about the new features in this version of the CDT. - What's new - - CDT Tutorial -This quick tutorial guides you through the basic steps to get started. - Tutorial - - CppUnit integration and other contributed plugins -Visit the CDT Community Webpage to find a list of contributed plugins -and a CppUnit integration in the CDT. - - - -- cgit v1.2.3